diff --git a/bun.lockb b/bun.lockb index bea53233..b6ec0233 100644 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/changelog.md b/changelog.md index ca24f518..f3be1c41 100644 --- a/changelog.md +++ b/changelog.md @@ -8,6 +8,7 @@ # 1.x [WIP] +- Добавлена возможность использования эксперементальной вариации голосов Яндекса. Новые голоса работают, только при некоторых условиях, во всех остальных случаях используются старые (#897) - Исправлена некорректная генерация Sec-{Vsubs|Vtrans}-Token заголовков ([vot.js#36](https://github.com/FOSWLY/vot.js/issues/36)) # 1.7.1 diff --git a/dist/vot-min.user.js b/dist/vot-min.user.js index f2260263..538eafb0 100644 --- a/dist/vot-min.user.js +++ b/dist/vot-min.user.js @@ -175,7 +175,7 @@ // ==/UserScript== /*! For license information please see vot-min.user.js.LICENSE.txt */ -(()=>{var t={"./src/styles/main.scss":()=>{GM_addStyle('.vot-button{--vot-helper-theme:var(--vot-theme-rgb,var(--vot-primary-rgb,33,150,243));--vot-helper-ontheme:var(--vot-ontheme-rgb,var(--vot-onprimary-rgb,255,255,255));box-sizing:border-box;vertical-align:middle;text-align:center;text-overflow:ellipsis;min-width:64px;height:36px;color:rgb(var(--vot-helper-ontheme));background-color:rgb(var(--vot-helper-theme));font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);cursor:pointer;border:none;border-radius:4px;outline:none;padding:0 16px;font-size:14px;font-weight:500;line-height:36px;transition:box-shadow .2s;display:inline-block;position:relative;box-shadow:0 3px 1px -2px #0003,0 2px 2px #00000024,0 1px 5px #0000001f}.vot-button[hidden]{display:none!important}.vot-button::-moz-focus-inner{border:none}.vot-button:before,.vot-button:after{content:"";border-radius:inherit;opacity:0;position:absolute;top:0;bottom:0;left:0;right:0}.vot-button:before{background-color:rgb(var(--vot-helper-ontheme));transition:opacity .2s}.vot-button:after{background:radial-gradient(circle,currentColor 1%,#0000 1%) 50%/10000% 10000% no-repeat;transition:opacity 1s,background-size .5s}.vot-button:hover{box-shadow:0 2px 4px -1px #0003,0 4px 5px #00000024,0 1px 10px #0000001f}.vot-button:hover:before{opacity:.08}.vot-button:active{box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.vot-button:active:after{opacity:.32;background-size:100% 100%;transition:background-size}.vot-button[disabled=true]{background-color:rgba(var(--vot-onsurface-rgb,0,0,0),.12);color:rgba(var(--vot-onsurface-rgb,0,0,0),.38);box-shadow:none;cursor:initial}.vot-button[disabled=true]:before,.vot-button[disabled=true]:after{opacity:0}.vot-outlined-button{--vot-helper-theme:var(--vot-theme-rgb,var(--vot-primary-rgb,33,150,243));box-sizing:border-box;border:1px solid;border-color:rgba(var(--vot-onsurface-rgb,0,0,0),.24);vertical-align:middle;text-align:center;text-overflow:ellipsis;min-width:64px;height:36px;color:rgb(var(--vot-helper-theme));font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);cursor:pointer;background-color:#0000;border-radius:4px;outline:none;margin:0;padding:0 16px;font-size:14px;font-weight:500;line-height:34px;display:inline-block;position:relative}.vot-outlined-button[hidden]{display:none!important}.vot-outlined-button::-moz-focus-inner{border:none}.vot-outlined-button:before,.vot-outlined-button:after{content:"";opacity:0;border-radius:3px;position:absolute;top:0;bottom:0;left:0;right:0}.vot-outlined-button:before{background-color:rgb(var(--vot-helper-theme));transition:opacity .2s}.vot-outlined-button:after{background:radial-gradient(circle,currentColor 1%,#0000 1%) 50%/10000% 10000% no-repeat;transition:opacity 1s,background-size .5s}.vot-outlined-button:hover:before{opacity:.04}.vot-outlined-button:active:after{opacity:.16;background-size:100% 100%;transition:background-size}.vot-outlined-button[disabled=true]{color:rgba(var(--vot-onsurface-rgb,0,0,0),.38);cursor:initial;background-color:#0000}.vot-outlined-button[disabled=true]:before,.vot-outlined-button[disabled=true]:after{opacity:0}.vot-text-button{--vot-helper-theme:var(--vot-theme-rgb,var(--vot-primary-rgb,33,150,243));box-sizing:border-box;vertical-align:middle;text-align:center;text-overflow:ellipsis;min-width:64px;height:36px;color:rgb(var(--vot-helper-theme));font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);cursor:pointer;background-color:#0000;border:none;border-radius:4px;outline:none;margin:0;padding:0 8px;font-size:14px;font-weight:500;line-height:36px;display:inline-block;position:relative}.vot-text-button[hidden]{display:none!important}.vot-text-button::-moz-focus-inner{border:none}.vot-text-button:before,.vot-text-button:after{content:"";border-radius:inherit;opacity:0;position:absolute;top:0;bottom:0;left:0;right:0}.vot-text-button:before{background-color:rgb(var(--vot-helper-theme));transition:opacity .2s}.vot-text-button:after{background:radial-gradient(circle,currentColor 1%,#0000 1%) 50%/10000% 10000% no-repeat;transition:opacity 1s,background-size .5s}.vot-text-button:hover:before{opacity:.04}.vot-text-button:active:after{opacity:.16;background-size:100% 100%;transition:background-size}.vot-text-button[disabled=true]{color:rgba(var(--vot-onsurface-rgb,0,0,0),.38);cursor:initial;background-color:#0000}.vot-text-button[disabled=true]:before,.vot-text-button[disabled=true]:after{opacity:0}.vot-icon-button{--vot-helper-onsurface:rgba(var(--vot-onsurface-rgb,0,0,0),.87);box-sizing:border-box;vertical-align:middle;text-align:center;text-overflow:ellipsis;width:36px;height:36px;fill:var(--vot-helper-onsurface);color:var(--vot-helper-onsurface);font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);cursor:pointer;background-color:#0000;border:none;border-radius:50%;outline:none;margin:0;padding:0;font-size:14px;font-weight:500;line-height:36px;display:inline-block;position:relative}.vot-icon-button[hidden]{display:none!important}.vot-icon-button::-moz-focus-inner{border:none}.vot-icon-button:before,.vot-icon-button:after{content:"";border-radius:inherit;opacity:0;position:absolute;top:0;bottom:0;left:0;right:0}.vot-icon-button:before{background-color:var(--vot-helper-onsurface);transition:opacity .2s}.vot-icon-button:after{background:radial-gradient(circle,currentColor 1%,#0000 1%) 50%/10000% 10000% no-repeat;transition:opacity .3s,background-size .4s}.vot-icon-button:hover:before{opacity:.04}.vot-icon-button:active:after{opacity:.32;background-size:100% 100%;transition:background-size,opacity}.vot-icon-button[disabled=true]{color:rgba(var(--vot-onsurface-rgb,0,0,0),.38);fill:rgba(var(--vot-onsurface-rgb,0,0,0),.38);cursor:initial;background-color:#0000}.vot-icon-button[disabled=true]:before,.vot-icon-button[disabled=true]:after{opacity:0}.vot-textfield{display:inline-block;--vot-helper-theme:rgb(var(--vot-theme-rgb,var(--vot-primary-rgb,33,150,243)))!important;--vot-helper-safari1:rgba(var(--vot-onsurface-rgb,0,0,0),.38)!important;--vot-helper-safari2:rgba(var(--vot-onsurface-rgb,0,0,0),.6)!important;--vot-helper-safari3:rgba(var(--vot-onsurface-rgb,0,0,0),.87)!important;font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system)!important;text-align:start!important;padding-top:6px!important;font-size:16px!important;line-height:1.5!important;position:relative!important}.vot-textfield[hidden]{display:none!important}.vot-textfield>input,.vot-textfield>textarea{box-sizing:border-box!important;border-style:solid!important;border-width:1px!important;border-color:transparent var(--vot-helper-safari2)var(--vot-helper-safari2)!important;width:100%!important;height:inherit!important;color:rgba(var(--vot-onsurface-rgb,0,0,0),.87)!important;-webkit-text-fill-color:currentColor!important;font-family:inherit!important;font-size:inherit!important;line-height:inherit!important;caret-color:var(--vot-helper-theme)!important;background-color:#0000!important;border-radius:4px!important;margin:0!important;padding:15px 13px!important;transition:border .2s,box-shadow .2s!important;box-shadow:inset 1px 0 #0000,inset -1px 0 #0000,inset 0 -1px #0000!important}.vot-textfield>input:not(:focus):not(.vot-show-placeholer)::-moz-placeholder{color:#0000!important}.vot-textfield>textarea:not(:focus):not(.vot-show-placeholer)::-moz-placeholder{color:#0000!important}.vot-textfield>input:not(:focus):not(.vot-show-placeholer)::-moz-placeholder{color:#0000!important}.vot-textfield>textarea:not(:focus):not(.vot-show-placeholer)::-moz-placeholder{color:#0000!important}.vot-textfield>input:not(:focus):not(.vot-show-placeholer)::-webkit-input-placeholder{color:#0000!important}.vot-textfield>textarea:not(:focus):not(.vot-show-placeholer)::-webkit-input-placeholder{color:#0000!important}.vot-textfield>input:not(:focus):placeholder-shown,.vot-textfield>textarea:not(:focus):placeholder-shown{border-top-color:var(--vot-helper-safari2)!important}.vot-textfield>input+span,.vot-textfield>textarea+span{width:100%!important;max-height:100%!important;color:rgba(var(--vot-onsurface-rgb,0,0,0),.6)!important;cursor:text!important;pointer-events:none!important;font-size:75%!important;line-height:15px!important;transition:color .2s,font-size .2s,line-height .2s!important;display:flex!important;position:absolute!important;top:0!important;left:0!important}.vot-textfield>input:not(:focus):placeholder-shown+span,.vot-textfield>textarea:not(:focus):placeholder-shown+span{font-size:inherit!important;line-height:68px!important}.vot-textfield>input+span:before,.vot-textfield>input+span:after,.vot-textfield>textarea+span:before,.vot-textfield>textarea+span:after{content:""!important;box-sizing:border-box!important;border-top:solid 1px var(--vot-helper-safari2)!important;pointer-events:none!important;min-width:10px!important;height:8px!important;margin-top:6px!important;transition:border .2s,box-shadow .2s!important;display:block!important;box-shadow:inset 0 1px #0000!important}.vot-textfield>input+span:before,.vot-textfield>textarea+span:before{border-left:1px solid #0000!important;border-radius:4px 0!important;margin-right:4px!important}.vot-textfield>input+span:after,.vot-textfield>textarea+span:after{border-right:1px solid #0000!important;border-radius:0 4px!important;flex-grow:1!important;margin-left:4px!important}.vot-textfield>input.vot-show-placeholer+span:before,.vot-textfield>textarea.vot-show-placeholer+span:before{margin-right:0!important}.vot-textfield>input.vot-show-placeholer+span:after,.vot-textfield>textarea.vot-show-placeholer+span:after{margin-left:0!important}.vot-textfield>input:not(:focus):placeholder-shown+span:before,.vot-textfield>input:not(:focus):placeholder-shown+span:after,.vot-textfield>textarea:not(:focus):placeholder-shown+span:before,.vot-textfield>textarea:not(:focus):placeholder-shown+span:after{border-top-color:#0000!important}.vot-textfield:hover>input:not(:disabled),.vot-textfield:hover>textarea:not(:disabled){border-color:transparent var(--vot-helper-safari3)var(--vot-helper-safari3)!important}.vot-textfield:hover>input:not(:disabled)+span:before,.vot-textfield:hover>input:not(:disabled)+span:after,.vot-textfield:hover>textarea:not(:disabled)+span:before,.vot-textfield:hover>textarea:not(:disabled)+span:after{border-top-color:var(--vot-helper-safari3)!important}.vot-textfield:hover>input:not(:disabled):not(:focus):placeholder-shown,.vot-textfield:hover>textarea:not(:disabled):not(:focus):placeholder-shown{border-color:var(--vot-helper-safari3)!important}.vot-textfield>input:focus,.vot-textfield>textarea:focus{border-color:transparent var(--vot-helper-theme)var(--vot-helper-theme)!important;box-shadow:inset 1px 0 var(--vot-helper-theme),inset -1px 0 var(--vot-helper-theme),inset 0 -1px var(--vot-helper-theme)!important;outline:none!important}.vot-textfield>input:focus+span,.vot-textfield>textarea:focus+span{color:var(--vot-helper-theme)!important}.vot-textfield>input:focus+span:before,.vot-textfield>input:focus+span:after,.vot-textfield>textarea:focus+span:before,.vot-textfield>textarea:focus+span:after{border-top-color:var(--vot-helper-theme)!important;box-shadow:inset 0 1px var(--vot-helper-theme)!important}.vot-textfield>input:disabled,.vot-textfield>input:disabled+span,.vot-textfield>textarea:disabled,.vot-textfield>textarea:disabled+span{border-color:transparent var(--vot-helper-safari1)var(--vot-helper-safari1)!important;color:rgba(var(--vot-onsurface-rgb,0,0,0),.38)!important;pointer-events:none!important}.vot-textfield>input:disabled+span:before,.vot-textfield>input:disabled+span:after,.vot-textfield>textarea:disabled+span:before,.vot-textfield>textarea:disabled+span:after,.vot-textfield>input:disabled:placeholder-shown,.vot-textfield>input:disabled:placeholder-shown+span,.vot-textfield>textarea:disabled:placeholder-shown,.vot-textfield>textarea:disabled:placeholder-shown+span{border-top-color:var(--vot-helper-safari1)!important}.vot-textfield>input:disabled:placeholder-shown+span:before,.vot-textfield>input:disabled:placeholder-shown+span:after,.vot-textfield>textarea:disabled:placeholder-shown+span:before,.vot-textfield>textarea:disabled:placeholder-shown+span:after{border-top-color:#0000!important}@media not all and (-webkit-min-device-pixel-ratio:.0000264583),not all and (min-resolution:.001dpcm){@supports ((-webkit-appearance:none)){.vot-textfield>input,.vot-textfield>input+span,.vot-textfield>textarea,.vot-textfield>textarea+span,.vot-textfield>input+span:before,.vot-textfield>input+span:after,.vot-textfield>textarea+span:before,.vot-textfield>textarea+span:after{transition-duration:.1s!important}}}.vot-checkbox{--vot-helper-theme:var(--vot-theme-rgb,var(--vot-primary-rgb,33,150,243));--vot-helper-ontheme:var(--vot-ontheme-rgb,var(--vot-onprimary-rgb,255,255,255));z-index:0;color:rgba(var(--vot-onsurface-rgb,0,0,0),.87);font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);text-align:start;font-size:16px;line-height:1.5;display:inline-block;position:relative}.vot-checkbox-sub{padding-left:16px}.vot-checkbox[hidden]{display:none!important}.vot-checkbox>input{-webkit-appearance:none;appearance:none;z-index:10000;box-sizing:border-box;border:2px solid;border-color:rgba(var(--vot-onsurface-rgb,0,0,0),.6);cursor:pointer;background:0 0;border-radius:2px;outline:none;width:18px;height:18px;margin:3px 1px;padding:0;transition:border-color .2s,background-color .2s;display:block;position:absolute}.vot-checkbox>input+span{box-sizing:border-box;width:inherit;cursor:pointer;padding-left:30px;font-weight:400;display:inline-block;position:relative}.vot-checkbox>input+span:before{content:"";background-color:rgb(var(--vot-onsurface-rgb,0,0,0));opacity:0;pointer-events:none;border-radius:50%;width:40px;height:40px;transition:opacity .3s,transform .2s;display:block;position:absolute;top:-8px;left:-10px;transform:scale(1)}.vot-checkbox>input+span:after{content:"";z-index:10000;pointer-events:none;border:0 solid #0000;border-width:0 0 2px 2px;width:10px;height:5px;transition:border-color .2s;display:block;position:absolute;top:3px;left:1px;transform:translate(3px,4px)rotate(-45deg);box-sizing:content-box!important}.vot-checkbox>input:checked,.vot-checkbox>input:indeterminate{border-color:rgb(var(--vot-helper-theme));background-color:rgb(var(--vot-helper-theme))}.vot-checkbox>input:checked+span:before,.vot-checkbox>input:indeterminate+span:before{background-color:rgb(var(--vot-helper-theme))}.vot-checkbox>input:checked+span:after,.vot-checkbox>input:indeterminate+span:after{border-color:rgb(var(--vot-helper-ontheme,255,255,255))}.vot-checkbox>input:indeterminate+span:after{border-left-width:0;transform:translate(4px,3px)}.vot-checkbox:hover>input+span:before{opacity:.04}.vot-checkbox:active>input,.vot-checkbox:active:hover>input:not(:disabled){border-color:rgb(var(--vot-helper-theme))}.vot-checkbox:active>input:checked{background-color:rgba(var(--vot-onsurface-rgb,0,0,0),.6);border-color:#0000}.vot-checkbox:active>input+span:before{opacity:1;transition:transform,opacity;transform:scale(0)}.vot-checkbox>input:disabled{border-color:rgba(var(--vot-onsurface-rgb,0,0,0),.38);cursor:initial}.vot-checkbox>input:disabled:checked,.vot-checkbox>input:disabled:indeterminate{background-color:rgba(var(--vot-onsurface-rgb,0,0,0),.38);border-color:#0000}.vot-checkbox>input:disabled+span{color:rgba(var(--vot-onsurface-rgb,0,0,0),.38);cursor:initial}.vot-checkbox>input:disabled+span:before{opacity:0;transform:scale(0)}.vot-slider{display:inline-block;--vot-safari-helper1:rgba(var(--vot-primary-rgb,33,150,243),.04)!important;--vot-safari-helper2:rgba(var(--vot-primary-rgb,33,150,243),.12)!important;--vot-safari-helper3:rgba(var(--vot-primary-rgb,33,150,243),.16)!important;--vot-safari-helper4:rgba(var(--vot-primary-rgb,33,150,243),.24)!important;width:100%!important;color:rgba(var(--vot-onsurface-rgb,0,0,0),.87)!important;font-family:var(--vot-font,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system)!important;text-align:start!important;font-size:16px!important;line-height:1.5!important}.vot-slider[hidden]{display:none!important}.vot-slider>input{-webkit-appearance:none!important;appearance:none!important;cursor:pointer!important;background-color:#0000!important;border:none!important;width:100%!important;height:36px!important;margin:0 0 -36px!important;padding:0!important;display:block!important;position:relative!important;top:24px!important}.vot-slider>input:last-child{margin:0!important;position:static!important}.vot-slider>input:before{content:""!important;width:calc(100%*var(--vot-progress,0))!important;background:rgb(var(--vot-primary-rgb,33,150,243))!important;height:2px!important;display:block!important;position:absolute!important;top:calc(50% - 1px)!important}.vot-slider>input:disabled{cursor:default!important;opacity:.38!important}.vot-slider>input:disabled+span{color:rgba(var(--vot-onsurface-rgb,0,0,0),.38)!important}.vot-slider>input:disabled::-webkit-slider-runnable-track{background-color:rgba(var(--vot-onsurface-rgb,0,0,0),.38)!important}.vot-slider>input:disabled::-moz-range-track{background-color:rgba(var(--vot-onsurface-rgb,0,0,0),.38)!important}.vot-slider>input:disabled::-ms-fill-lower{background-color:rgba(var(--vot-onsurface-rgb,0,0,0),.38)!important}.vot-slider>input:disabled::-ms-fill-upper{background-color:rgba(var(--vot-onsurface-rgb,0,0,0),.38)!important}.vot-slider>input:disabled::-moz-range-thumb{background-color:rgb(var(--vot-onsurface-rgb,0,0,0))!important;box-shadow:0 0 0 1px rgb(var(--vot-surface-rgb,255,255,255))!important;transform:scale(4)!important}.vot-slider>input:disabled::-ms-thumb{background-color:rgb(var(--vot-onsurface-rgb,0,0,0))!important;box-shadow:0 0 0 1px rgb(var(--vot-surface-rgb,255,255,255))!important;transform:scale(4)!important}.vot-slider>input:disabled::-webkit-slider-thumb{background-color:rgb(var(--vot-onsurface-rgb,0,0,0))!important;box-shadow:0 0 0 1px rgb(var(--vot-surface-rgb,255,255,255))!important;transform:scale(4)!important}.vot-slider>input:disabled::-ms-fill-upper{opacity:.38!important}.vot-slider>input:disabled::-moz-range-progress{background-color:rgba(var(--vot-onsurface-rgb,0,0,0),.87)!important}.vot-slider>input:disabled:-webkit-slider-thumb{color:rgb(var(--vot-surface-rgb,255,255,255))!important}.vot-slider>input:active::-webkit-slider-thumb{box-shadow:0 0 0 2px var(--vot-safari-helper4)!important}.vot-slider>input:active::-moz-range-thumb{box-shadow:0 0 0 2px rgba(var(--vot-primary-rgb,33,150,243),.24)!important}.vot-slider>input:active::-ms-thumb{box-shadow:0 0 0 2px rgba(var(--vot-primary-rgb,33,150,243),.24)!important}.vot-slider>input:focus{outline:none!important}.vot-slider>input::-webkit-slider-runnable-track{background-color:rgba(var(--vot-primary-rgb,33,150,243),.24)!important;border-radius:1px!important;width:100%!important;height:2px!important;margin:17px 0!important}.vot-slider>input::-moz-range-track{background-color:rgba(var(--vot-primary-rgb,33,150,243),.24)!important;border-radius:1px!important;width:100%!important;height:2px!important;margin:17px 0!important}.vot-slider>input::-ms-track{box-sizing:border-box!important;background-color:#0000!important;border:none!important;border-radius:1px!important;width:100%!important;height:2px!important;margin:17px 0!important;padding:0 17px!important}.vot-slider>input::-webkit-slider-thumb{-webkit-appearance:none!important;appearance:none!important;background-color:rgb(var(--vot-primary-rgb,33,150,243))!important;border:none!important;border-radius:50%!important;width:2px!important;height:2px!important;transition:box-shadow .2s!important;transform:scale(6)!important}.vot-slider>input::-moz-range-thumb{-webkit-appearance:none!important;appearance:none!important;background-color:rgb(var(--vot-primary-rgb,33,150,243))!important;border:none!important;border-radius:50%!important;width:2px!important;height:2px!important;transition:box-shadow .2s!important;transform:scale(6)!important}.vot-slider>input::-ms-thumb{-webkit-appearance:none!important;appearance:none!important;background-color:rgb(var(--vot-primary-rgb,33,150,243))!important;border:none!important;border-radius:50%!important;width:2px!important;height:2px!important;transition:box-shadow .2s!important;transform:scale(6)!important}.vot-slider>input::-webkit-slider-thumb{-webkit-appearance:none!important;margin:0!important}.vot-slider>input::-moz-range-thumb{-moz-appearance:none!important}.vot-slider>input::-ms-thumb{margin:0 17px!important}.vot-slider>input::-moz-range-progress{background-color:rgb(var(--vot-primary-rgb,33,150,243))!important;border-radius:1px!important;height:2px!important}.vot-slider>input::-ms-fill-lower{background-color:rgb(var(--vot-primary-rgb,33,150,243))!important;border-radius:1px!important;height:2px!important}.vot-slider>input::-ms-fill-upper{background-color:rgb(var(--vot-primary-rgb,33,150,243))!important;border-radius:1px!important;height:2px!important}.vot-slider>input::-moz-focus-outer{border:none!important}.vot-slider>span{margin-bottom:36px!important;display:inline-block!important}.vot-slider:hover>input::-webkit-slider-thumb{box-shadow:0 0 0 2px var(--vot-safari-helper1)!important}.vot-slider:hover>input::-ms-thumb{box-shadow:0 0 0 2px rgba(var(--vot-primary-rgb,33,150,243),.04)!important}.vot-slider:hover>input:hover::-moz-range-thumb{box-shadow:0 0 0 2px rgba(var(--vot-primary-rgb,33,150,243),.04)!important}.vot-select{font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);text-align:start;color:var(--vot-helper-theme);fill:var(--vot-helper-theme);justify-content:space-between;align-items:center;font-size:14px;font-weight:400;line-height:1.5;display:flex;--vot-helper-theme-rgb:var(--vot-onsurface-rgb,0,0,0)!important;--vot-helper-theme:rgba(var(--vot-helper-theme-rgb),.87)!important;--vot-helper-safari1:rgba(var(--vot-onsurface-rgb,0,0,0),.6)!important;--vot-helper-safari2:rgba(var(--vot-onsurface-rgb,0,0,0),.87)!important}.vot-select[hidden]{display:none!important}.vot-select-label{font-size:16px}.vot-select-outer{cursor:pointer;justify-content:space-between;align-items:center;width:120px;max-width:120px;padding:0 5px;display:flex;border-style:solid!important;border-width:1px!important;border-color:var(--vot-helper-safari1)!important;border-radius:4px!important;transition:border .2s!important}.vot-select-outer:hover{border-color:var(--vot-helper-safari2)!important}.vot-select-title{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.vot-select-arrow-icon{justify-content:center;align-items:center;width:20px;height:32px;display:flex}.vot-select-content-list{flex-direction:column;display:flex}.vot-select-content-list .vot-select-content-item{cursor:pointer;border-radius:8px;padding:5px 10px}.vot-select-content-list .vot-select-content-item:not([inert]):hover{background-color:#2a2c31}.vot-select-content-list .vot-select-content-item[data-vot-selected=true]{color:rgb(var(--vot-primary-rgb,33,150,243));background-color:rgba(var(--vot-primary-rgb,33,150,243),.2)}.vot-select-content-list .vot-select-content-item[data-vot-selected=true]:hover{background-color:rgba(var(--vot-primary-rgb,33,150,243),.1)!important}.vot-select-content-list .vot-select-content-item[data-vot-disabled=true]{cursor:default}.vot-select-content-list .vot-select-content-item[hidden]{display:none!important}.vot-header{color:rgba(var(--vot-helper-onsurface-rgb),.87);font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);text-align:start;font-weight:700;line-height:1.5}.vot-header[hidden]{display:none!important}.vot-header:not(:first-child){padding-top:8px}.vot-header-level-1{font-size:2em}.vot-header-level-2{font-size:1.5em}.vot-header-level-3{font-size:1.17em}.vot-header-level-4{font-size:1em}.vot-header-level-5{font-size:.83em}.vot-header-level-6{font-size:.67em}.vot-info{color:rgba(var(--vot-helper-onsurface-rgb),.87);font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);text-align:start;-webkit-user-select:text;user-select:text;font-size:16px;line-height:1.5;display:flex}.vot-info[hidden]{display:none!important}.vot-info>:not(:first-child){color:rgba(var(--vot-helper-onsurface-rgb),.5);flex:1;margin-left:8px}.vot-details{color:rgba(var(--vot-helper-onsurface-rgb),.87);font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);text-align:start;cursor:pointer;border-radius:.5em;justify-content:space-between;align-items:center;margin:0 -.5em;padding:.5em;font-size:16px;line-height:1.5;transition:background .5s;display:flex}.vot-details[hidden]{display:none!important}.vot-details-arrow-icon{width:20px;height:32px;fill:rgba(var(--vot-helper-onsurface-rgb),.87);justify-content:center;align-items:center;display:flex;transform:scale(1.25)rotate(-90deg)}.vot-details:hover{background:rgba(var(--vot-onsurface-rgb,0,0,0),.04)}.vot-lang-select{--vot-helper-theme-rgb:var(--vot-onsurface-rgb,0,0,0);--vot-helper-theme:rgba(var(--vot-helper-theme-rgb),.87);color:var(--vot-helper-theme);fill:var(--vot-helper-theme);justify-content:space-between;align-items:center;display:flex}.vot-lang-select[hidden]{display:none!important}.vot-lang-select-icon{justify-content:center;align-items:center;width:32px;height:32px;display:flex}.vot-segmented-button{--vot-helper-theme-rgb:var(--vot-onsurface-rgb,0,0,0);--vot-helper-theme:rgba(var(--vot-helper-theme-rgb),.87);-webkit-user-select:none;user-select:none;background:rgb(var(--vot-surface-rgb,255,255,255));max-width:100vw;height:32px;color:var(--vot-helper-theme);fill:var(--vot-helper-theme);font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);cursor:default;z-index:2147483647;border-radius:4px;align-items:center;font-size:16px;line-height:1.5;transition:opacity .5s;display:flex;position:absolute;top:5rem;left:50%;overflow:hidden;transform:translate(-50%)}.vot-segmented-button[hidden]{display:none!important}.vot-segmented-button *{box-sizing:border-box!important}.vot-segmented-button .vot-separator{background:rgba(var(--vot-helper-theme-rgb),.1);width:1px;height:50%}.vot-segmented-button .vot-separator[hidden]{display:none!important}.vot-segmented-button .vot-segment,.vot-segmented-button .vot-segment-only-icon{height:100%;color:inherit;background-color:#0000;border:none;justify-content:center;align-items:center;padding:0 8px;transition:background-color .1s ease-in-out;display:flex;position:relative;overflow:hidden}.vot-segmented-button .vot-segment[hidden],.vot-segmented-button [hidden].vot-segment-only-icon{display:none!important}.vot-segmented-button .vot-segment:before,.vot-segmented-button .vot-segment-only-icon:before,.vot-segmented-button .vot-segment:after,.vot-segmented-button .vot-segment-only-icon:after{content:"";border-radius:inherit;opacity:0;position:absolute;top:0;bottom:0;left:0;right:0}.vot-segmented-button .vot-segment:before,.vot-segmented-button .vot-segment-only-icon:before{background-color:rgb(var(--vot-helper-theme-rgb));transition:opacity .2s}.vot-segmented-button .vot-segment:after,.vot-segmented-button .vot-segment-only-icon:after{background:radial-gradient(circle,currentColor 1%,#0000 1%) 50%/10000% 10000% no-repeat;transition:opacity 1s,background-size .5s}.vot-segmented-button .vot-segment:hover:before,.vot-segmented-button .vot-segment-only-icon:hover:before{opacity:.04}.vot-segmented-button .vot-segment:active:after,.vot-segmented-button .vot-segment-only-icon:active:after{opacity:.16;background-size:100% 100%;transition:background-size}.vot-segmented-button .vot-segment-only-icon{min-width:32px;padding:0}.vot-segmented-button .vot-segment-label{white-space:nowrap;color:inherit;margin-left:8px;font-weight:400}.vot-segmented-button[data-status=success] .vot-translate-button{color:rgb(var(--vot-primary-rgb,33,150,243));fill:rgb(var(--vot-primary-rgb,33,150,243))}.vot-segmented-button[data-status=error] .vot-translate-button{color:#f28b82;fill:#f28b82}.vot-segmented-button[data-loading=true] #vot-loading-icon{display:block!important}.vot-segmented-button[data-loading=true] #vot-translate-icon{display:none!important}.vot-segmented-button[data-direction=column]{flex-direction:column;height:fit-content}.vot-segmented-button[data-direction=column] .vot-segment-label{display:none}.vot-segmented-button[data-direction=column]>.vot-segment-only-icon,.vot-segmented-button[data-direction=column]>.vot-segment{padding:8px}.vot-segmented-button[data-direction=column] .vot-separator{width:50%;height:1px}.vot-segmented-button[data-position=left]{top:12.5vh;left:50px}.vot-segmented-button[data-position=right]{top:12.5vh;left:auto;right:0}.vot-segmented-button svg{width:24px}.vot-menu{--vot-helper-surface-rgb:var(--vot-surface-rgb,255,255,255);--vot-helper-surface:rgb(var(--vot-helper-surface-rgb));--vot-helper-onsurface-rgb:var(--vot-onsurface-rgb,0,0,0);--vot-helper-onsurface:rgba(var(--vot-helper-onsurface-rgb),.87);-webkit-user-select:none;user-select:none;background-color:var(--vot-helper-surface);color:var(--vot-helper-onsurface);font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);cursor:default;z-index:2147483647;visibility:visible;opacity:1;transform-origin:top;border-radius:8px;min-width:300px;font-size:16px;line-height:1.5;transition:opacity .3s,transform .1s;position:absolute;top:calc(5rem + 48px);left:50%;overflow:hidden;transform:translate(-50%)scale(1)}.vot-menu *{box-sizing:border-box!important}.vot-menu[hidden]{pointer-events:none;visibility:hidden;opacity:0;transform:translate(-50%)scale(0);display:block!important}.vot-menu-content-wrapper{min-height:100px;max-height:calc(var(--vot-container-height,75vh) - (5rem + 32px + 16px)*2);flex-direction:column;display:flex;overflow:auto}.vot-menu-header-container{flex-shrink:0;align-items:flex-start;min-height:31px;display:flex}.vot-menu-header-container:empty{padding:0 0 16px}.vot-menu-header-container>.vot-icon-button{margin-inline-end:4px;margin-top:4px}.vot-menu-title-container{font-size:inherit;font-weight:inherit;text-align:start;outline:0;flex:1;margin:0;display:flex}.vot-menu-title{padding-bottom:16px;padding-inline-start:16px;padding-inline-end:16px;flex:1;padding-top:16px;font-size:16px;font-weight:400;line-height:1}.vot-menu-body-container{box-sizing:border-box;overscroll-behavior:contain;flex-direction:column;gap:8px;min-height:1.375rem;padding:0 16px;display:flex;overflow:auto;scrollbar-color:rgba(var(--vot-helper-onsurface-rgb),.1)var(--vot-helper-surface)!important}.vot-menu-body-container::-webkit-scrollbar{background:var(--vot-helper-surface)!important;width:12px!important;height:12px!important}.vot-menu-body-container::-webkit-scrollbar-track{background:var(--vot-helper-surface)!important;width:12px!important;height:12px!important}.vot-menu-body-container::-webkit-scrollbar-thumb{background:rgba(var(--vot-helper-onsurface-rgb),.1)!important;border:5px solid var(--vot-helper-surface)!important;-webkit-border-radius:1ex!important}.vot-menu-body-container::-webkit-scrollbar-thumb:hover{border:3px solid var(--vot-helper-surface)!important}.vot-menu-body-container::-webkit-scrollbar-corner{background:var(--vot-helper-surface)!important}.vot-menu-footer-container{padding-bottom:16px;padding-inline-start:16px;padding-inline-end:16px;flex-shrink:0;justify-content:flex-end;padding-top:16px;display:flex}.vot-menu-footer-container:empty{padding:16px 0 0}.vot-menu[data-position=left]{top:12.5vh;left:240px}.vot-menu[data-position=right]{top:12.5vh;left:auto;right:-80px}.vot-dialog{--vot-helper-surface-rgb:var(--vot-surface-rgb,255,255,255);--vot-helper-surface:rgb(var(--vot-helper-surface-rgb));--vot-helper-onsurface-rgb:var(--vot-onsurface-rgb,0,0,0);--vot-helper-onsurface:rgba(var(--vot-helper-onsurface-rgb),.87);max-width:initial;max-height:initial;width:min(var(--vot-dialog-width,512px),100%);top:50%;bottom:50%;background-color:var(--vot-helper-surface);height:fit-content;color:var(--vot-helper-onsurface);font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);-webkit-user-select:none;user-select:none;visibility:visible;opacity:1;transform-origin:50%;border-radius:8px;margin:auto;padding:0;font-size:16px;line-height:1.5;transition:opacity .3s,transform .1s;display:block;position:fixed;top:0;bottom:0;left:0;right:0;overflow-x:auto;overflow-y:hidden;transform:scale(1);box-shadow:0 0 16px #0000001f,0 16px 16px #0000003d}[hidden]>.vot-dialog{pointer-events:none;opacity:0;transition:opacity .1s,transform .2s;transform:scale(.5)}.vot-dialog-container{visibility:visible;z-index:2147483647;position:absolute}.vot-dialog-container[hidden]{pointer-events:none;visibility:hidden;display:block!important}.vot-dialog-container *{box-sizing:border-box!important}.vot-dialog-backdrop{opacity:1;background-color:#0009;transition:opacity .3s;position:fixed;top:0;bottom:0;left:0;right:0}[hidden]>.vot-dialog-backdrop{pointer-events:none;opacity:0}.vot-dialog-content-wrapper{flex-direction:column;max-height:75vh;display:flex;overflow:auto}.vot-dialog-header-container{flex-shrink:0;align-items:flex-start;min-height:31px;display:flex}.vot-dialog-header-container:empty{padding:0 0 20px}.vot-dialog-header-container>.vot-icon-button{margin-inline-end:4px;margin-top:4px}.vot-dialog-title-container{font-size:inherit;font-weight:inherit;outline:0;flex:1;margin:0;display:flex}.vot-dialog-title{padding-bottom:16px;padding-inline-start:20px;padding-inline-end:20px;flex:1;padding-top:20px;font-size:115.385%;font-weight:700;line-height:1}.vot-dialog-body-container{box-sizing:border-box;overscroll-behavior:contain;flex-direction:column;gap:16px;min-height:1.375rem;padding:0 20px;display:flex;overflow:auto;scrollbar-color:rgba(var(--vot-helper-onsurface-rgb),.1)var(--vot-helper-surface)!important}.vot-dialog-body-container::-webkit-scrollbar{background:var(--vot-helper-surface)!important;width:12px!important;height:12px!important}.vot-dialog-body-container::-webkit-scrollbar-track{background:var(--vot-helper-surface)!important;width:12px!important;height:12px!important}.vot-dialog-body-container::-webkit-scrollbar-thumb{background:rgba(var(--vot-helper-onsurface-rgb),.1)!important;border:5px solid var(--vot-helper-surface)!important;-webkit-border-radius:1ex!important}.vot-dialog-body-container::-webkit-scrollbar-thumb:hover{border:3px solid var(--vot-helper-surface)!important}.vot-dialog-body-container::-webkit-scrollbar-corner{background:var(--vot-helper-surface)!important}.vot-dialog-footer-container{padding-bottom:16px;padding-inline-start:16px;padding-inline-end:16px;flex-shrink:0;justify-content:flex-end;padding-top:16px;display:flex}.vot-dialog-footer-container:empty{padding:20px 0 0}.vot-subtitles-widget{z-index:2147483647;pointer-events:none;justify-content:center;align-items:center;width:50%;min-height:20%;max-height:100%;display:flex;position:absolute;top:75%;left:25%}.vot-subtitles{--vot-subtitles-background:rgba(var(--vot-surface-rgb,46,47,52),var(--vot-subtitles-opacity,.8));background:var(--vot-subtitles-background,#2e2f34cc);width:max-content;max-width:100%;max-height:100%;color:var(--vot-subtitles-color,#e3e3e3);pointer-events:all;box-sizing:border-box;-webkit-user-select:none;user-select:none;border-radius:.5em;padding:.5em;font-size:20px;line-height:normal;position:relative}.vot-subtitles span{-webkit-user-select:text;user-select:text;font-size:inherit!important;line-height:normal!important}.vot-subtitles .passed{color:var(--vot-subtitles-passed-color,#2196f3)}:root{--vot-font-family:"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system;--vot-primary-rgb:139,180,245;--vot-onprimary-rgb:32,33,36;--vot-surface-rgb:32,33,36;--vot-onsurface-rgb:227,227,227;--vot-subtitles-color:rgb(var(--vot-onsurface-rgb,227,227,227));--vot-subtitles-passed-color:rgb(var(--vot-primary-rgb,33,150,243))}vot-block{display:block;visibility:visible!important}')},"./node_modules/bowser/es5.js":function(t){t.exports=function(t){var e={};function o(i){if(e[i])return e[i].exports;var a=e[i]={i,l:!1,exports:{}};return t[i].call(a.exports,a,a.exports,o),a.l=!0,a.exports}return o.m=t,o.c=e,o.d=function(t,e,i){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(o.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)o.d(i,a,function(e){return t[e]}.bind(null,a));return i},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=90)}({17:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var i=o(18),a=function(){function t(){}return t.getFirstMatch=function(t,e){var o=e.match(t);return o&&o.length>0&&o[1]||""},t.getSecondMatch=function(t,e){var o=e.match(t);return o&&o.length>1&&o[2]||""},t.matchAndReturnConst=function(t,e,o){if(t.test(e))return o},t.getWindowsVersionName=function(t){switch(t){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},t.getMacOSVersionName=function(t){var e=t.split(".").splice(0,2).map((function(t){return parseInt(t,10)||0}));if(e.push(0),10===e[0])switch(e[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},t.getAndroidVersionName=function(t){var e=t.split(".").splice(0,2).map((function(t){return parseInt(t,10)||0}));if(e.push(0),!(1===e[0]&&e[1]<5))return 1===e[0]&&e[1]<6?"Cupcake":1===e[0]&&e[1]>=6?"Donut":2===e[0]&&e[1]<2?"Eclair":2===e[0]&&2===e[1]?"Froyo":2===e[0]&&e[1]>2?"Gingerbread":3===e[0]?"Honeycomb":4===e[0]&&e[1]<1?"Ice Cream Sandwich":4===e[0]&&e[1]<4?"Jelly Bean":4===e[0]&&e[1]>=4?"KitKat":5===e[0]?"Lollipop":6===e[0]?"Marshmallow":7===e[0]?"Nougat":8===e[0]?"Oreo":9===e[0]?"Pie":void 0},t.getVersionPrecision=function(t){return t.split(".").length},t.compareVersions=function(e,o,i){void 0===i&&(i=!1);var a=t.getVersionPrecision(e),n=t.getVersionPrecision(o),r=Math.max(a,n),s=0,l=t.map([e,o],(function(e){var o=r-t.getVersionPrecision(e),i=e+new Array(o+1).join(".0");return t.map(i.split("."),(function(t){return new Array(20-t.length).join("0")+t})).reverse()}));for(i&&(s=r-Math.min(a,n)),r-=1;r>=s;){if(l[0][r]>l[1][r])return 1;if(l[0][r]===l[1][r]){if(r===s)return 0;r-=1}else if(l[0][r]1?a-1:0),r=1;r0){var r=Object.keys(o),l=s.default.find(r,(function(t){return e.isOS(t)}));if(l){var d=this.satisfies(o[l]);if(void 0!==d)return d}var u=s.default.find(r,(function(t){return e.isPlatform(t)}));if(u){var c=this.satisfies(o[u]);if(void 0!==c)return c}}if(n>0){var h=Object.keys(a),p=s.default.find(h,(function(t){return e.isBrowser(t,!0)}));if(void 0!==p)return this.compareVersion(a[p])}},e.isBrowser=function(t,e){void 0===e&&(e=!1);var o=this.getBrowserName().toLowerCase(),i=t.toLowerCase(),a=s.default.getBrowserTypeByAlias(i);return e&&a&&(i=a.toLowerCase()),i===o},e.compareVersion=function(t){var e=[0],o=t,i=!1,a=this.getBrowserVersion();if("string"==typeof a)return">"===t[0]||"<"===t[0]?(o=t.substr(1),"="===t[1]?(i=!0,o=t.substr(2)):e=[],">"===t[0]?e.push(1):e.push(-1)):"="===t[0]?o=t.substr(1):"~"===t[0]&&(i=!0,o=t.substr(1)),e.indexOf(s.default.compareVersions(a,o,i))>-1},e.isOS=function(t){return this.getOSName(!0)===String(t).toLowerCase()},e.isPlatform=function(t){return this.getPlatformType(!0)===String(t).toLowerCase()},e.isEngine=function(t){return this.getEngineName(!0)===String(t).toLowerCase()},e.is=function(t,e){return void 0===e&&(e=!1),this.isBrowser(t,e)||this.isOS(t)||this.isPlatform(t)},e.some=function(t){var e=this;return void 0===t&&(t=[]),t.some((function(t){return e.is(t)}))},t}();e.default=d,t.exports=e.default},92:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var i,a=(i=o(17))&&i.__esModule?i:{default:i},n=/version\/(\d+(\.?_?\d+)+)/i,r=[{test:[/googlebot/i],describe:function(t){var e={name:"Googlebot"},o=a.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,t)||a.default.getFirstMatch(n,t);return o&&(e.version=o),e}},{test:[/opera/i],describe:function(t){var e={name:"Opera"},o=a.default.getFirstMatch(n,t)||a.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/opr\/|opios/i],describe:function(t){var e={name:"Opera"},o=a.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,t)||a.default.getFirstMatch(n,t);return o&&(e.version=o),e}},{test:[/SamsungBrowser/i],describe:function(t){var e={name:"Samsung Internet for Android"},o=a.default.getFirstMatch(n,t)||a.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/Whale/i],describe:function(t){var e={name:"NAVER Whale Browser"},o=a.default.getFirstMatch(n,t)||a.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/MZBrowser/i],describe:function(t){var e={name:"MZ Browser"},o=a.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,t)||a.default.getFirstMatch(n,t);return o&&(e.version=o),e}},{test:[/focus/i],describe:function(t){var e={name:"Focus"},o=a.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,t)||a.default.getFirstMatch(n,t);return o&&(e.version=o),e}},{test:[/swing/i],describe:function(t){var e={name:"Swing"},o=a.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,t)||a.default.getFirstMatch(n,t);return o&&(e.version=o),e}},{test:[/coast/i],describe:function(t){var e={name:"Opera Coast"},o=a.default.getFirstMatch(n,t)||a.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(t){var e={name:"Opera Touch"},o=a.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(n,t);return o&&(e.version=o),e}},{test:[/yabrowser/i],describe:function(t){var e={name:"Yandex Browser"},o=a.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(n,t);return o&&(e.version=o),e}},{test:[/ucbrowser/i],describe:function(t){var e={name:"UC Browser"},o=a.default.getFirstMatch(n,t)||a.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/Maxthon|mxios/i],describe:function(t){var e={name:"Maxthon"},o=a.default.getFirstMatch(n,t)||a.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/epiphany/i],describe:function(t){var e={name:"Epiphany"},o=a.default.getFirstMatch(n,t)||a.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/puffin/i],describe:function(t){var e={name:"Puffin"},o=a.default.getFirstMatch(n,t)||a.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/sleipnir/i],describe:function(t){var e={name:"Sleipnir"},o=a.default.getFirstMatch(n,t)||a.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/k-meleon/i],describe:function(t){var e={name:"K-Meleon"},o=a.default.getFirstMatch(n,t)||a.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/micromessenger/i],describe:function(t){var e={name:"WeChat"},o=a.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(n,t);return o&&(e.version=o),e}},{test:[/qqbrowser/i],describe:function(t){var e={name:/qqbrowserlite/i.test(t)?"QQ Browser Lite":"QQ Browser"},o=a.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(n,t);return o&&(e.version=o),e}},{test:[/msie|trident/i],describe:function(t){var e={name:"Internet Explorer"},o=a.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/\sedg\//i],describe:function(t){var e={name:"Microsoft Edge"},o=a.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/edg([ea]|ios)/i],describe:function(t){var e={name:"Microsoft Edge"},o=a.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/vivaldi/i],describe:function(t){var e={name:"Vivaldi"},o=a.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/seamonkey/i],describe:function(t){var e={name:"SeaMonkey"},o=a.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/sailfish/i],describe:function(t){var e={name:"Sailfish"},o=a.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,t);return o&&(e.version=o),e}},{test:[/silk/i],describe:function(t){var e={name:"Amazon Silk"},o=a.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/phantom/i],describe:function(t){var e={name:"PhantomJS"},o=a.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/slimerjs/i],describe:function(t){var e={name:"SlimerJS"},o=a.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(t){var e={name:"BlackBerry"},o=a.default.getFirstMatch(n,t)||a.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/(web|hpw)[o0]s/i],describe:function(t){var e={name:"WebOS Browser"},o=a.default.getFirstMatch(n,t)||a.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/bada/i],describe:function(t){var e={name:"Bada"},o=a.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/tizen/i],describe:function(t){var e={name:"Tizen"},o=a.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(n,t);return o&&(e.version=o),e}},{test:[/qupzilla/i],describe:function(t){var e={name:"QupZilla"},o=a.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(n,t);return o&&(e.version=o),e}},{test:[/firefox|iceweasel|fxios/i],describe:function(t){var e={name:"Firefox"},o=a.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/electron/i],describe:function(t){var e={name:"Electron"},o=a.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/MiuiBrowser/i],describe:function(t){var e={name:"Miui"},o=a.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/chromium/i],describe:function(t){var e={name:"Chromium"},o=a.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(n,t);return o&&(e.version=o),e}},{test:[/chrome|crios|crmo/i],describe:function(t){var e={name:"Chrome"},o=a.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/GSA/i],describe:function(t){var e={name:"Google Search"},o=a.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:function(t){var e=!t.test(/like android/i),o=t.test(/android/i);return e&&o},describe:function(t){var e={name:"Android Browser"},o=a.default.getFirstMatch(n,t);return o&&(e.version=o),e}},{test:[/playstation 4/i],describe:function(t){var e={name:"PlayStation 4"},o=a.default.getFirstMatch(n,t);return o&&(e.version=o),e}},{test:[/safari|applewebkit/i],describe:function(t){var e={name:"Safari"},o=a.default.getFirstMatch(n,t);return o&&(e.version=o),e}},{test:[/.*/i],describe:function(t){var e=-1!==t.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:a.default.getFirstMatch(e,t),version:a.default.getSecondMatch(e,t)}}}];e.default=r,t.exports=e.default},93:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var i,a=(i=o(17))&&i.__esModule?i:{default:i},n=o(18),r=[{test:[/Roku\/DVP/],describe:function(t){var e=a.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,t);return{name:n.OS_MAP.Roku,version:e}}},{test:[/windows phone/i],describe:function(t){var e=a.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,t);return{name:n.OS_MAP.WindowsPhone,version:e}}},{test:[/windows /i],describe:function(t){var e=a.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,t),o=a.default.getWindowsVersionName(e);return{name:n.OS_MAP.Windows,version:e,versionName:o}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(t){var e={name:n.OS_MAP.iOS},o=a.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,t);return o&&(e.version=o),e}},{test:[/macintosh/i],describe:function(t){var e=a.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,t).replace(/[_\s]/g,"."),o=a.default.getMacOSVersionName(e),i={name:n.OS_MAP.MacOS,version:e};return o&&(i.versionName=o),i}},{test:[/(ipod|iphone|ipad)/i],describe:function(t){var e=a.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,t).replace(/[_\s]/g,".");return{name:n.OS_MAP.iOS,version:e}}},{test:function(t){var e=!t.test(/like android/i),o=t.test(/android/i);return e&&o},describe:function(t){var e=a.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,t),o=a.default.getAndroidVersionName(e),i={name:n.OS_MAP.Android,version:e};return o&&(i.versionName=o),i}},{test:[/(web|hpw)[o0]s/i],describe:function(t){var e=a.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,t),o={name:n.OS_MAP.WebOS};return e&&e.length&&(o.version=e),o}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(t){var e=a.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,t)||a.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,t)||a.default.getFirstMatch(/\bbb(\d+)/i,t);return{name:n.OS_MAP.BlackBerry,version:e}}},{test:[/bada/i],describe:function(t){var e=a.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,t);return{name:n.OS_MAP.Bada,version:e}}},{test:[/tizen/i],describe:function(t){var e=a.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,t);return{name:n.OS_MAP.Tizen,version:e}}},{test:[/linux/i],describe:function(){return{name:n.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:n.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(t){var e=a.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,t);return{name:n.OS_MAP.PlayStation4,version:e}}}];e.default=r,t.exports=e.default},94:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var i,a=(i=o(17))&&i.__esModule?i:{default:i},n=o(18),r=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(t){var e=a.default.getFirstMatch(/(can-l01)/i,t)&&"Nova",o={type:n.PLATFORMS_MAP.mobile,vendor:"Huawei"};return e&&(o.model=e),o}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:n.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:n.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:n.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:n.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:n.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:n.PLATFORMS_MAP.tablet}}},{test:function(t){var e=t.test(/ipod|iphone/i),o=t.test(/like (ipod|iphone)/i);return e&&!o},describe:function(t){var e=a.default.getFirstMatch(/(ipod|iphone)/i,t);return{type:n.PLATFORMS_MAP.mobile,vendor:"Apple",model:e}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:n.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:n.PLATFORMS_MAP.mobile}}},{test:function(t){return"blackberry"===t.getBrowserName(!0)},describe:function(){return{type:n.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(t){return"bada"===t.getBrowserName(!0)},describe:function(){return{type:n.PLATFORMS_MAP.mobile}}},{test:function(t){return"windows phone"===t.getBrowserName()},describe:function(){return{type:n.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(t){var e=Number(String(t.getOSVersion()).split(".")[0]);return"android"===t.getOSName(!0)&&e>=3},describe:function(){return{type:n.PLATFORMS_MAP.tablet}}},{test:function(t){return"android"===t.getOSName(!0)},describe:function(){return{type:n.PLATFORMS_MAP.mobile}}},{test:function(t){return"macos"===t.getOSName(!0)},describe:function(){return{type:n.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(t){return"windows"===t.getOSName(!0)},describe:function(){return{type:n.PLATFORMS_MAP.desktop}}},{test:function(t){return"linux"===t.getOSName(!0)},describe:function(){return{type:n.PLATFORMS_MAP.desktop}}},{test:function(t){return"playstation 4"===t.getOSName(!0)},describe:function(){return{type:n.PLATFORMS_MAP.tv}}},{test:function(t){return"roku"===t.getOSName(!0)},describe:function(){return{type:n.PLATFORMS_MAP.tv}}}];e.default=r,t.exports=e.default},95:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var i,a=(i=o(17))&&i.__esModule?i:{default:i},n=o(18),r=[{test:function(t){return"microsoft edge"===t.getBrowserName(!0)},describe:function(t){if(/\sedg\//i.test(t))return{name:n.ENGINE_MAP.Blink};var e=a.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,t);return{name:n.ENGINE_MAP.EdgeHTML,version:e}}},{test:[/trident/i],describe:function(t){var e={name:n.ENGINE_MAP.Trident},o=a.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:function(t){return t.test(/presto/i)},describe:function(t){var e={name:n.ENGINE_MAP.Presto},o=a.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:function(t){var e=t.test(/gecko/i),o=t.test(/like gecko/i);return e&&!o},describe:function(t){var e={name:n.ENGINE_MAP.Gecko},o=a.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:n.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(t){var e={name:n.ENGINE_MAP.WebKit},o=a.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}}];e.default=r,t.exports=e.default}})},"./node_modules/requestidlecallback-polyfill/index.js":()=>{window.requestIdleCallback=window.requestIdleCallback||function(t){var e=Date.now();return setTimeout((function(){t({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-e))}})}),1)},window.cancelIdleCallback=window.cancelIdleCallback||function(t){clearTimeout(t)}}},e={};function o(i){var a=e[i];if(void 0!==a)return a.exports;var n=e[i]={exports:{}};return t[i].call(n.exports,n,n.exports,o),n.exports}(()=>{"use strict";var t=o("./node_modules/bowser/es5.js");const e=protobuf;var i;function a(t){switch(t){case 0:case"NO_CONNECTION":return i.NO_CONNECTION;case 10:case"TRANSLATING":return i.TRANSLATING;case 20:case"STREAMING":return i.STREAMING;default:return i.UNRECOGNIZED}}!function(t){t[t.NO_CONNECTION=0]="NO_CONNECTION",t[t.TRANSLATING=10]="TRANSLATING",t[t.STREAMING=20]="STREAMING",t[t.UNRECOGNIZED=-1]="UNRECOGNIZED"}(i||(i={}));const n={encode:(t,o=e.Writer.create())=>(""!==t.target&&o.uint32(10).string(t.target),""!==t.targetUrl&&o.uint32(18).string(t.targetUrl),o),decode(t,o){const i=t instanceof e.Reader?t:e.Reader.create(t);let a=void 0===o?i.len:i.pos+o;const n={target:"",targetUrl:""};for(;i.pos>>3){case 1:if(10!==t)break;n.target=i.string();continue;case 2:if(18!==t)break;n.targetUrl=i.string();continue}if(4==(7&t)||0===t)break;i.skipType(7&t)}return n},fromJSON:t=>({target:x(t.target)?globalThis.String(t.target):"",targetUrl:x(t.targetUrl)?globalThis.String(t.targetUrl):""}),toJSON(t){const e={};return""!==t.target&&(e.target=t.target),""!==t.targetUrl&&(e.targetUrl=t.targetUrl),e},create:t=>n.fromPartial(t??{}),fromPartial(t){const e={target:"",targetUrl:""};return e.target=t.target??"",e.targetUrl=t.targetUrl??"",e}};const r={encode(t,o=e.Writer.create()){""!==t.url&&o.uint32(26).string(t.url),void 0!==t.deviceId&&o.uint32(34).string(t.deviceId),!1!==t.firstRequest&&o.uint32(40).bool(t.firstRequest),0!==t.duration&&o.uint32(49).double(t.duration),0!==t.unknown0&&o.uint32(56).int32(t.unknown0),""!==t.language&&o.uint32(66).string(t.language),!1!==t.forceSourceLang&&o.uint32(72).bool(t.forceSourceLang),0!==t.unknown1&&o.uint32(80).int32(t.unknown1);for(const e of t.translationHelp)n.encode(e,o.uint32(90).fork()).ldelim();return""!==t.responseLanguage&&o.uint32(114).string(t.responseLanguage),0!==t.unknown2&&o.uint32(120).int32(t.unknown2),0!==t.unknown3&&o.uint32(128).int32(t.unknown3),!1!==t.bypassCache&&o.uint32(136).bool(t.bypassCache),0!==t.unknown4&&o.uint32(144).int32(t.unknown4),o},decode(t,o){const i=t instanceof e.Reader?t:e.Reader.create(t);let a=void 0===o?i.len:i.pos+o;const r={url:"",deviceId:void 0,firstRequest:!1,duration:0,unknown0:0,language:"",forceSourceLang:!1,unknown1:0,translationHelp:[],responseLanguage:"",unknown2:0,unknown3:0,bypassCache:!1,unknown4:0};for(;i.pos>>3){case 3:if(26!==t)break;r.url=i.string();continue;case 4:if(34!==t)break;r.deviceId=i.string();continue;case 5:if(40!==t)break;r.firstRequest=i.bool();continue;case 6:if(49!==t)break;r.duration=i.double();continue;case 7:if(56!==t)break;r.unknown0=i.int32();continue;case 8:if(66!==t)break;r.language=i.string();continue;case 9:if(72!==t)break;r.forceSourceLang=i.bool();continue;case 10:if(80!==t)break;r.unknown1=i.int32();continue;case 11:if(90!==t)break;r.translationHelp.push(n.decode(i,i.uint32()));continue;case 14:if(114!==t)break;r.responseLanguage=i.string();continue;case 15:if(120!==t)break;r.unknown2=i.int32();continue;case 16:if(128!==t)break;r.unknown3=i.int32();continue;case 17:if(136!==t)break;r.bypassCache=i.bool();continue;case 18:if(144!==t)break;r.unknown4=i.int32();continue}if(4==(7&t)||0===t)break;i.skipType(7&t)}return r},fromJSON:t=>({url:x(t.url)?globalThis.String(t.url):"",deviceId:x(t.deviceId)?globalThis.String(t.deviceId):void 0,firstRequest:!!x(t.firstRequest)&&globalThis.Boolean(t.firstRequest),duration:x(t.duration)?globalThis.Number(t.duration):0,unknown0:x(t.unknown0)?globalThis.Number(t.unknown0):0,language:x(t.language)?globalThis.String(t.language):"",forceSourceLang:!!x(t.forceSourceLang)&&globalThis.Boolean(t.forceSourceLang),unknown1:x(t.unknown1)?globalThis.Number(t.unknown1):0,translationHelp:globalThis.Array.isArray(t?.translationHelp)?t.translationHelp.map((t=>n.fromJSON(t))):[],responseLanguage:x(t.responseLanguage)?globalThis.String(t.responseLanguage):"",unknown2:x(t.unknown2)?globalThis.Number(t.unknown2):0,unknown3:x(t.unknown3)?globalThis.Number(t.unknown3):0,bypassCache:!!x(t.bypassCache)&&globalThis.Boolean(t.bypassCache),unknown4:x(t.unknown4)?globalThis.Number(t.unknown4):0}),toJSON(t){const e={};return""!==t.url&&(e.url=t.url),void 0!==t.deviceId&&(e.deviceId=t.deviceId),!1!==t.firstRequest&&(e.firstRequest=t.firstRequest),0!==t.duration&&(e.duration=t.duration),0!==t.unknown0&&(e.unknown0=Math.round(t.unknown0)),""!==t.language&&(e.language=t.language),!1!==t.forceSourceLang&&(e.forceSourceLang=t.forceSourceLang),0!==t.unknown1&&(e.unknown1=Math.round(t.unknown1)),t.translationHelp?.length&&(e.translationHelp=t.translationHelp.map((t=>n.toJSON(t)))),""!==t.responseLanguage&&(e.responseLanguage=t.responseLanguage),0!==t.unknown2&&(e.unknown2=Math.round(t.unknown2)),0!==t.unknown3&&(e.unknown3=Math.round(t.unknown3)),!1!==t.bypassCache&&(e.bypassCache=t.bypassCache),0!==t.unknown4&&(e.unknown4=Math.round(t.unknown4)),e},create:t=>r.fromPartial(t??{}),fromPartial(t){const e={url:"",deviceId:void 0,firstRequest:!1,duration:0,unknown0:0,language:"",forceSourceLang:!1,unknown1:0,translationHelp:[],responseLanguage:"",unknown2:0,unknown3:0,bypassCache:!1,unknown4:0};return e.url=t.url??"",e.deviceId=t.deviceId??void 0,e.firstRequest=t.firstRequest??!1,e.duration=t.duration??0,e.unknown0=t.unknown0??0,e.language=t.language??"",e.forceSourceLang=t.forceSourceLang??!1,e.unknown1=t.unknown1??0,e.translationHelp=t.translationHelp?.map((t=>n.fromPartial(t)))||[],e.responseLanguage=t.responseLanguage??"",e.unknown2=t.unknown2??0,e.unknown3=t.unknown3??0,e.bypassCache=t.bypassCache??!1,e.unknown4=t.unknown4??0,e}};const s={encode:(t,o=e.Writer.create())=>(void 0!==t.url&&o.uint32(10).string(t.url),void 0!==t.duration&&o.uint32(17).double(t.duration),0!==t.status&&o.uint32(32).int32(t.status),void 0!==t.remainingTime&&o.uint32(40).int32(t.remainingTime),void 0!==t.unknown0&&o.uint32(48).int32(t.unknown0),""!==t.translationId&&o.uint32(58).string(t.translationId),void 0!==t.language&&o.uint32(66).string(t.language),void 0!==t.message&&o.uint32(74).string(t.message),o),decode(t,o){const i=t instanceof e.Reader?t:e.Reader.create(t);let a=void 0===o?i.len:i.pos+o;const n={url:void 0,duration:void 0,status:0,remainingTime:void 0,unknown0:void 0,translationId:"",language:void 0,message:void 0};for(;i.pos>>3){case 1:if(10!==t)break;n.url=i.string();continue;case 2:if(17!==t)break;n.duration=i.double();continue;case 4:if(32!==t)break;n.status=i.int32();continue;case 5:if(40!==t)break;n.remainingTime=i.int32();continue;case 6:if(48!==t)break;n.unknown0=i.int32();continue;case 7:if(58!==t)break;n.translationId=i.string();continue;case 8:if(66!==t)break;n.language=i.string();continue;case 9:if(74!==t)break;n.message=i.string();continue}if(4==(7&t)||0===t)break;i.skipType(7&t)}return n},fromJSON:t=>({url:x(t.url)?globalThis.String(t.url):void 0,duration:x(t.duration)?globalThis.Number(t.duration):void 0,status:x(t.status)?globalThis.Number(t.status):0,remainingTime:x(t.remainingTime)?globalThis.Number(t.remainingTime):void 0,unknown0:x(t.unknown0)?globalThis.Number(t.unknown0):void 0,translationId:x(t.translationId)?globalThis.String(t.translationId):"",language:x(t.language)?globalThis.String(t.language):void 0,message:x(t.message)?globalThis.String(t.message):void 0}),toJSON(t){const e={};return void 0!==t.url&&(e.url=t.url),void 0!==t.duration&&(e.duration=t.duration),0!==t.status&&(e.status=Math.round(t.status)),void 0!==t.remainingTime&&(e.remainingTime=Math.round(t.remainingTime)),void 0!==t.unknown0&&(e.unknown0=Math.round(t.unknown0)),""!==t.translationId&&(e.translationId=t.translationId),void 0!==t.language&&(e.language=t.language),void 0!==t.message&&(e.message=t.message),e},create:t=>s.fromPartial(t??{}),fromPartial(t){const e={url:void 0,duration:void 0,status:0,remainingTime:void 0,unknown0:void 0,translationId:"",language:void 0,message:void 0};return e.url=t.url??void 0,e.duration=t.duration??void 0,e.status=t.status??0,e.remainingTime=t.remainingTime??void 0,e.unknown0=t.unknown0??void 0,e.translationId=t.translationId??"",e.language=t.language??void 0,e.message=t.message??void 0,e}};function l(){return{audioFile:new Uint8Array(0),message:""}}const d={encode:(t,o=e.Writer.create())=>(0!==t.audioFile.length&&o.uint32(18).bytes(t.audioFile),""!==t.message&&o.uint32(10).string(t.message),o),decode(t,o){const i=t instanceof e.Reader?t:e.Reader.create(t);let a=void 0===o?i.len:i.pos+o;const n=l();for(;i.pos>>3){case 2:if(18!==t)break;n.audioFile=i.bytes();continue;case 1:if(10!==t)break;n.message=i.string();continue}if(4==(7&t)||0===t)break;i.skipType(7&t)}return n},fromJSON:t=>({audioFile:x(t.audioFile)?w(t.audioFile):new Uint8Array(0),message:x(t.message)?globalThis.String(t.message):""}),toJSON(t){const e={};return 0!==t.audioFile.length&&(e.audioFile=function(t){if(globalThis.Buffer)return globalThis.Buffer.from(t).toString("base64");{const e=[];return t.forEach((t=>{e.push(globalThis.String.fromCharCode(t))})),globalThis.btoa(e.join(""))}}(t.audioFile)),""!==t.message&&(e.message=t.message),e},create:t=>d.fromPartial(t??{}),fromPartial(t){const e=l();return e.audioFile=t.audioFile??new Uint8Array(0),e.message=t.message??"",e}};const u={encode:(t,o=e.Writer.create())=>(""!==t.translationId&&o.uint32(10).string(t.translationId),""!==t.url&&o.uint32(18).string(t.url),void 0!==t.audioInfo&&d.encode(t.audioInfo,o.uint32(50).fork()).ldelim(),o),decode(t,o){const i=t instanceof e.Reader?t:e.Reader.create(t);let a=void 0===o?i.len:i.pos+o;const n={translationId:"",url:"",audioInfo:void 0};for(;i.pos>>3){case 1:if(10!==t)break;n.translationId=i.string();continue;case 2:if(18!==t)break;n.url=i.string();continue;case 6:if(50!==t)break;n.audioInfo=d.decode(i,i.uint32());continue}if(4==(7&t)||0===t)break;i.skipType(7&t)}return n},fromJSON:t=>({translationId:x(t.translationId)?globalThis.String(t.translationId):"",url:x(t.url)?globalThis.String(t.url):"",audioInfo:x(t.audioInfo)?d.fromJSON(t.audioInfo):void 0}),toJSON(t){const e={};return""!==t.translationId&&(e.translationId=t.translationId),""!==t.url&&(e.url=t.url),void 0!==t.audioInfo&&(e.audioInfo=d.toJSON(t.audioInfo)),e},create:t=>u.fromPartial(t??{}),fromPartial(t){const e={translationId:"",url:"",audioInfo:void 0};return e.translationId=t.translationId??"",e.url=t.url??"",e.audioInfo=void 0!==t.audioInfo&&null!==t.audioInfo?d.fromPartial(t.audioInfo):void 0,e}};const c={encode:(t,o=e.Writer.create())=>(""!==t.language&&o.uint32(10).string(t.language),""!==t.url&&o.uint32(18).string(t.url),0!==t.unknown0&&o.uint32(24).int32(t.unknown0),""!==t.translatedLanguage&&o.uint32(34).string(t.translatedLanguage),""!==t.translatedUrl&&o.uint32(42).string(t.translatedUrl),0!==t.unknown1&&o.uint32(48).int32(t.unknown1),0!==t.unknown2&&o.uint32(56).int32(t.unknown2),o),decode(t,o){const i=t instanceof e.Reader?t:e.Reader.create(t);let a=void 0===o?i.len:i.pos+o;const n={language:"",url:"",unknown0:0,translatedLanguage:"",translatedUrl:"",unknown1:0,unknown2:0};for(;i.pos>>3){case 1:if(10!==t)break;n.language=i.string();continue;case 2:if(18!==t)break;n.url=i.string();continue;case 3:if(24!==t)break;n.unknown0=i.int32();continue;case 4:if(34!==t)break;n.translatedLanguage=i.string();continue;case 5:if(42!==t)break;n.translatedUrl=i.string();continue;case 6:if(48!==t)break;n.unknown1=i.int32();continue;case 7:if(56!==t)break;n.unknown2=i.int32();continue}if(4==(7&t)||0===t)break;i.skipType(7&t)}return n},fromJSON:t=>({language:x(t.language)?globalThis.String(t.language):"",url:x(t.url)?globalThis.String(t.url):"",unknown0:x(t.unknown0)?globalThis.Number(t.unknown0):0,translatedLanguage:x(t.translatedLanguage)?globalThis.String(t.translatedLanguage):"",translatedUrl:x(t.translatedUrl)?globalThis.String(t.translatedUrl):"",unknown1:x(t.unknown1)?globalThis.Number(t.unknown1):0,unknown2:x(t.unknown2)?globalThis.Number(t.unknown2):0}),toJSON(t){const e={};return""!==t.language&&(e.language=t.language),""!==t.url&&(e.url=t.url),0!==t.unknown0&&(e.unknown0=Math.round(t.unknown0)),""!==t.translatedLanguage&&(e.translatedLanguage=t.translatedLanguage),""!==t.translatedUrl&&(e.translatedUrl=t.translatedUrl),0!==t.unknown1&&(e.unknown1=Math.round(t.unknown1)),0!==t.unknown2&&(e.unknown2=Math.round(t.unknown2)),e},create:t=>c.fromPartial(t??{}),fromPartial(t){const e={language:"",url:"",unknown0:0,translatedLanguage:"",translatedUrl:"",unknown1:0,unknown2:0};return e.language=t.language??"",e.url=t.url??"",e.unknown0=t.unknown0??0,e.translatedLanguage=t.translatedLanguage??"",e.translatedUrl=t.translatedUrl??"",e.unknown1=t.unknown1??0,e.unknown2=t.unknown2??0,e}};const h={encode:(t,o=e.Writer.create())=>(""!==t.url&&o.uint32(10).string(t.url),""!==t.language&&o.uint32(18).string(t.language),o),decode(t,o){const i=t instanceof e.Reader?t:e.Reader.create(t);let a=void 0===o?i.len:i.pos+o;const n={url:"",language:""};for(;i.pos>>3){case 1:if(10!==t)break;n.url=i.string();continue;case 2:if(18!==t)break;n.language=i.string();continue}if(4==(7&t)||0===t)break;i.skipType(7&t)}return n},fromJSON:t=>({url:x(t.url)?globalThis.String(t.url):"",language:x(t.language)?globalThis.String(t.language):""}),toJSON(t){const e={};return""!==t.url&&(e.url=t.url),""!==t.language&&(e.language=t.language),e},create:t=>h.fromPartial(t??{}),fromPartial(t){const e={url:"",language:""};return e.url=t.url??"",e.language=t.language??"",e}};const p={encode(t,o=e.Writer.create()){!1!==t.waiting&&o.uint32(8).bool(t.waiting);for(const e of t.subtitles)c.encode(e,o.uint32(18).fork()).ldelim();return o},decode(t,o){const i=t instanceof e.Reader?t:e.Reader.create(t);let a=void 0===o?i.len:i.pos+o;const n={waiting:!1,subtitles:[]};for(;i.pos>>3){case 1:if(8!==t)break;n.waiting=i.bool();continue;case 2:if(18!==t)break;n.subtitles.push(c.decode(i,i.uint32()));continue}if(4==(7&t)||0===t)break;i.skipType(7&t)}return n},fromJSON:t=>({waiting:!!x(t.waiting)&&globalThis.Boolean(t.waiting),subtitles:globalThis.Array.isArray(t?.subtitles)?t.subtitles.map((t=>c.fromJSON(t))):[]}),toJSON(t){const e={};return!1!==t.waiting&&(e.waiting=t.waiting),t.subtitles?.length&&(e.subtitles=t.subtitles.map((t=>c.toJSON(t)))),e},create:t=>p.fromPartial(t??{}),fromPartial(t){const e={waiting:!1,subtitles:[]};return e.waiting=t.waiting??!1,e.subtitles=t.subtitles?.map((t=>c.fromPartial(t)))||[],e}};const g={encode:(t,o=e.Writer.create())=>(""!==t.url&&o.uint32(10).string(t.url),""!==t.timestamp&&o.uint32(18).string(t.timestamp),o),decode(t,o){const i=t instanceof e.Reader?t:e.Reader.create(t);let a=void 0===o?i.len:i.pos+o;const n={url:"",timestamp:""};for(;i.pos>>3){case 1:if(10!==t)break;n.url=i.string();continue;case 2:if(18!==t)break;n.timestamp=i.string();continue}if(4==(7&t)||0===t)break;i.skipType(7&t)}return n},fromJSON:t=>({url:x(t.url)?globalThis.String(t.url):"",timestamp:x(t.timestamp)?globalThis.String(t.timestamp):""}),toJSON(t){const e={};return""!==t.url&&(e.url=t.url),""!==t.timestamp&&(e.timestamp=t.timestamp),e},create:t=>g.fromPartial(t??{}),fromPartial(t){const e={url:"",timestamp:""};return e.url=t.url??"",e.timestamp=t.timestamp??"",e}};const m={encode:(t,o=e.Writer.create())=>(""!==t.url&&o.uint32(10).string(t.url),""!==t.language&&o.uint32(18).string(t.language),""!==t.responseLanguage&&o.uint32(26).string(t.responseLanguage),o),decode(t,o){const i=t instanceof e.Reader?t:e.Reader.create(t);let a=void 0===o?i.len:i.pos+o;const n={url:"",language:"",responseLanguage:""};for(;i.pos>>3){case 1:if(10!==t)break;n.url=i.string();continue;case 2:if(18!==t)break;n.language=i.string();continue;case 3:if(26!==t)break;n.responseLanguage=i.string();continue}if(4==(7&t)||0===t)break;i.skipType(7&t)}return n},fromJSON:t=>({url:x(t.url)?globalThis.String(t.url):"",language:x(t.language)?globalThis.String(t.language):"",responseLanguage:x(t.responseLanguage)?globalThis.String(t.responseLanguage):""}),toJSON(t){const e={};return""!==t.url&&(e.url=t.url),""!==t.language&&(e.language=t.language),""!==t.responseLanguage&&(e.responseLanguage=t.responseLanguage),e},create:t=>m.fromPartial(t??{}),fromPartial(t){const e={url:"",language:"",responseLanguage:""};return e.url=t.url??"",e.language=t.language??"",e.responseLanguage=t.responseLanguage??"",e}};const v={encode:(t,o=e.Writer.create())=>(0!==t.interval&&o.uint32(8).int32(t.interval),void 0!==t.translatedInfo&&g.encode(t.translatedInfo,o.uint32(18).fork()).ldelim(),void 0!==t.pingId&&o.uint32(24).int32(t.pingId),o),decode(t,o){const i=t instanceof e.Reader?t:e.Reader.create(t);let a=void 0===o?i.len:i.pos+o;const n={interval:0,translatedInfo:void 0,pingId:void 0};for(;i.pos>>3){case 1:if(8!==t)break;n.interval=i.int32();continue;case 2:if(18!==t)break;n.translatedInfo=g.decode(i,i.uint32());continue;case 3:if(24!==t)break;n.pingId=i.int32();continue}if(4==(7&t)||0===t)break;i.skipType(7&t)}return n},fromJSON:t=>({interval:x(t.interval)?a(t.interval):0,translatedInfo:x(t.translatedInfo)?g.fromJSON(t.translatedInfo):void 0,pingId:x(t.pingId)?globalThis.Number(t.pingId):void 0}),toJSON(t){const e={};return 0!==t.interval&&(e.interval=function(t){switch(t){case i.NO_CONNECTION:return"NO_CONNECTION";case i.TRANSLATING:return"TRANSLATING";case i.STREAMING:return"STREAMING";case i.UNRECOGNIZED:default:return"UNRECOGNIZED"}}(t.interval)),void 0!==t.translatedInfo&&(e.translatedInfo=g.toJSON(t.translatedInfo)),void 0!==t.pingId&&(e.pingId=Math.round(t.pingId)),e},create:t=>v.fromPartial(t??{}),fromPartial(t){const e={interval:0,translatedInfo:void 0,pingId:void 0};return e.interval=t.interval??0,e.translatedInfo=void 0!==t.translatedInfo&&null!==t.translatedInfo?g.fromPartial(t.translatedInfo):void 0,e.pingId=t.pingId??void 0,e}};const f={encode:(t,o=e.Writer.create())=>(0!==t.pingId&&o.uint32(8).int32(t.pingId),o),decode(t,o){const i=t instanceof e.Reader?t:e.Reader.create(t);let a=void 0===o?i.len:i.pos+o;const n={pingId:0};for(;i.pos>>3){case 1:if(8!==t)break;n.pingId=i.int32();continue}if(4==(7&t)||0===t)break;i.skipType(7&t)}return n},fromJSON:t=>({pingId:x(t.pingId)?globalThis.Number(t.pingId):0}),toJSON(t){const e={};return 0!==t.pingId&&(e.pingId=Math.round(t.pingId)),e},create:t=>f.fromPartial(t??{}),fromPartial(t){const e={pingId:0};return e.pingId=t.pingId??0,e}};const b={encode:(t,o=e.Writer.create())=>(""!==t.uuid&&o.uint32(10).string(t.uuid),""!==t.module&&o.uint32(18).string(t.module),o),decode(t,o){const i=t instanceof e.Reader?t:e.Reader.create(t);let a=void 0===o?i.len:i.pos+o;const n={uuid:"",module:""};for(;i.pos>>3){case 1:if(10!==t)break;n.uuid=i.string();continue;case 2:if(18!==t)break;n.module=i.string();continue}if(4==(7&t)||0===t)break;i.skipType(7&t)}return n},fromJSON:t=>({uuid:x(t.uuid)?globalThis.String(t.uuid):"",module:x(t.module)?globalThis.String(t.module):""}),toJSON(t){const e={};return""!==t.uuid&&(e.uuid=t.uuid),""!==t.module&&(e.module=t.module),e},create:t=>b.fromPartial(t??{}),fromPartial(t){const e={uuid:"",module:""};return e.uuid=t.uuid??"",e.module=t.module??"",e}};const y={encode:(t,o=e.Writer.create())=>(""!==t.secretKey&&o.uint32(10).string(t.secretKey),0!==t.expires&&o.uint32(16).int32(t.expires),o),decode(t,o){const i=t instanceof e.Reader?t:e.Reader.create(t);let a=void 0===o?i.len:i.pos+o;const n={secretKey:"",expires:0};for(;i.pos>>3){case 1:if(10!==t)break;n.secretKey=i.string();continue;case 2:if(16!==t)break;n.expires=i.int32();continue}if(4==(7&t)||0===t)break;i.skipType(7&t)}return n},fromJSON:t=>({secretKey:x(t.secretKey)?globalThis.String(t.secretKey):"",expires:x(t.expires)?globalThis.Number(t.expires):0}),toJSON(t){const e={};return""!==t.secretKey&&(e.secretKey=t.secretKey),0!==t.expires&&(e.expires=Math.round(t.expires)),e},create:t=>y.fromPartial(t??{}),fromPartial(t){const e={secretKey:"",expires:0};return e.secretKey=t.secretKey??"",e.expires=t.expires??0,e}};function w(t){if(globalThis.Buffer)return Uint8Array.from(globalThis.Buffer.from(t,"base64"));{const e=globalThis.atob(t),o=new Uint8Array(e.length);for(let t=0;tr.encode({url:t,firstRequest:!0,duration:e,unknown0:1,language:o,forceSourceLang:!1,unknown1:0,translationHelp:a||[],responseLanguage:i,unknown2:0,unknown3:1,bypassCache:!1,unknown4:1}).finish(),decodeTranslationResponse:t=>s.decode(new Uint8Array(t)),encodeTranslationAudioRequest:(t,e)=>u.encode({url:t,translationId:e,audioInfo:{audioFile:new Uint8Array(0),message:T.WEB_API_GET_ALL_GENERATING_URLS_DATA_FROM_IFRAME}}).finish(),decodeTranslationAudioResponse:t=>s.decode(new Uint8Array(t)),encodeSubtitlesRequest:(t,e)=>h.encode({url:t,language:e}).finish(),decodeSubtitlesResponse:t=>p.decode(new Uint8Array(t)),encodeStreamPingRequest:t=>f.encode({pingId:t}).finish(),encodeStreamRequest:(t,e,o)=>m.encode({url:t,language:e,responseLanguage:o}).finish(),decodeStreamResponse:t=>v.decode(new Uint8Array(t)),encodeYandexSessionRequest:(t,e)=>b.encode({uuid:t,module:e}).finish(),decodeYandexSessionResponse:t=>y.decode(new Uint8Array(t))},P={host:"api.browser.yandex.ru",hostVOT:"vot-api.toil.cc/v1",mediaProxy:"media-proxy.toil.cc",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 YaBrowser/24.10.0.0 Safari/537.36",componentVersion:"24.10.1.598",hmac:"bt8xH3VOlb4mqf0nqAibnDOoiPlXsisf",defaultDuration:343,loggerLevel:1,version:"1.3.9"};var L;!function(t){t[t.DEBUG=0]="DEBUG",t[t.INFO=1]="INFO",t[t.WARN=2]="WARN",t[t.ERROR=3]="ERROR",t[t.SILENCE=4]="SILENCE"}(L||(L={}));class A{static prefix=`[vot.js v${P.version}]`;static canLog(t){return P.loggerLevel<=t}static log(...t){A.canLog(L.DEBUG)&&console.log(A.prefix,...t)}static info(...t){A.canLog(L.INFO)&&console.info(A.prefix,...t)}static warn(...t){A.canLog(L.WARN)&&console.warn(A.prefix,...t)}static error(...t){A.canLog(L.ERROR)&&console.error(A.prefix,...t)}}const I=new TextEncoder;async function _(t,e,o){const i=await crypto.subtle.importKey("raw",I.encode(e),{name:"HMAC",hash:{name:t}},!1,["sign","verify"]);return await crypto.subtle.sign("HMAC",i,o)}async function O(t){const e=await _("SHA-256",P.hmac,t);return new Uint8Array(e).reduce(((t,e)=>t+e.toString(16).padStart(2,"0")),"")}async function V(t,e,o,i){const{secretKey:a,uuid:n}=e,r=await O(o),s=`${n}:${i}:${P.componentVersion}`,l=I.encode(s);return{[`${t}-Signature`]:r,[`Sec-${t}-Sk`]:a,[`Sec-${t}-Token`]:`${await O(l)}:${s}`}}const M={afr:"af",aka:"ak",alb:"sq",amh:"am",ara:"ar",arm:"hy",asm:"as",aym:"ay",aze:"az",baq:"eu",bel:"be",ben:"bn",bos:"bs",bul:"bg",bur:"my",cat:"ca",chi:"zh",cos:"co",cze:"cs",dan:"da",div:"dv",dut:"nl",eng:"en",epo:"eo",est:"et",ewe:"ee",fin:"fi",fre:"fr",fry:"fy",geo:"ka",ger:"de",gla:"gd",gle:"ga",glg:"gl",gre:"el",grn:"gn",guj:"gu",hat:"ht",hau:"ha",hin:"hi",hrv:"hr",hun:"hu",ibo:"ig",ice:"is",ind:"id",ita:"it",jav:"jv",jpn:"ja",kan:"kn",kaz:"kk",khm:"km",kin:"rw",kir:"ky",kor:"ko",kur:"ku",lao:"lo",lat:"la",lav:"lv",lin:"ln",lit:"lt",ltz:"lb",lug:"lg",mac:"mk",mal:"ml",mao:"mi",mar:"mr",may:"ms",mlg:"mg",mlt:"mt",mon:"mn",nep:"ne",nor:"no",nya:"ny",ori:"or",orm:"om",pan:"pa",per:"fa",pol:"pl",por:"pt",pus:"ps",que:"qu",rum:"ro",rus:"ru",san:"sa",sin:"si",slo:"sk",slv:"sl",smo:"sm",sna:"sn",snd:"sd",som:"so",sot:"st",spa:"es",srp:"sr",sun:"su",swa:"sw",swe:"sv",tam:"ta",tat:"tt",tel:"te",tgk:"tg",tha:"th",tir:"ti",tso:"ts",tuk:"tk",tur:"tr",uig:"ug",ukr:"uk",urd:"ur",uzb:"uz",vie:"vi",wel:"cy",xho:"xh",yid:"yi",yor:"yo",zul:"zu"};async function E(t,e={headers:{"User-Agent":P.userAgent}}){const{timeout:o=3e3,...i}=e,a=new AbortController,n=setTimeout((()=>a.abort()),o),r=await fetch(t,{signal:a.signal,...i});return clearTimeout(n),r}function B(t){return 3===t.length?M[t]:t.toLowerCase().split(/[_;-]/)[0].trim()}function N(t,e="mp4"){return`https://${P.mediaProxy}/v1/proxy/video.${e}?url=${encodeURIComponent(t.href)}&origin=${t.origin}&referer=${t.origin}`}const R=[{additionalData:"mobile",host:S.youtube,url:"https://youtu.be/",match:/^m.youtube.com$/,selector:"shorts-video #player"},{additionalData:"mobile",host:S.youtube,url:"https://youtu.be/",match:/^m.youtube.com$/,selector:".player-container"},{host:S.youtube,url:"https://youtu.be/",match:/^(www.)?youtube(-nocookie|kids)?.com$/,selector:".html5-video-container:not(#inline-player *)"},{host:S.invidious,url:"https://youtu.be/",match:["yewtu.be","yt.artemislena.eu","invidious.flokinet.to","iv.melmac.space","inv.nadeko.net","inv.tux.pizza","invidious.private.coffee","yt.drgnz.club","vid.puffyan.us","invidious.dhusch.de"],selector:"#player",needBypassCSP:!0},{host:S.piped,url:"https://youtu.be/",match:["piped.video","piped.tokhmi.xyz","piped.moomoo.me","piped.syncpundit.io","piped.mha.fi","watch.whatever.social","piped.garudalinux.org","efy.piped.pages.dev","watch.leptons.xyz","piped.lunar.icu","yt.dc09.ru","piped.mint.lgbt","il.ax","piped.privacy.com.de","piped.esmailelbob.xyz","piped.projectsegfau.lt","piped.in.projectsegfau.lt","piped.us.projectsegfau.lt","piped.privacydev.net","piped.palveluntarjoaja.eu","piped.smnz.de","piped.adminforge.de","piped.qdi.fi","piped.hostux.net","piped.chauvet.pro","piped.jotoma.de","piped.pfcd.me","piped.frontendfriendly.xyz"],selector:".shaka-video-container",needBypassCSP:!0},{host:S.poketube,url:"https://youtu.be/",match:["poketube.fun","pt.sudovanilla.org","poke.ggtyler.dev","poke.uk2.littlekai.co.uk","poke.blahai.gay"],selector:".video-player-container"},{host:S.ricktube,url:"https://youtu.be/",match:["ricktube.ru"],selector:"#oframeplayer > pjsdiv:has(video)"},{additionalData:"mobile",host:S.vk,url:"https://vk.com/video?z=",match:/^m.vk.(com|ru)$/,selector:"vk-video-player",shadowRoot:!0},{additionalData:"clips",host:S.vk,url:"https://vk.com/video?z=",match:/^(www.|m.)?vk.(com|ru)$/,selector:'div[data-testid="clipcontainer-video"]'},{host:S.vk,url:"https://vk.com/video?z=",match:/^(www.|m.)?vk.(com|ru)$/,selector:".videoplayer_media"},{host:S.nine_gag,url:"https://9gag.com/gag/",match:/^9gag.com$/,selector:".video-post"},{host:S.twitch,url:"https://twitch.tv/",match:[/^m.twitch.tv$/,/^(www.)?twitch.tv$/,/^clips.twitch.tv$/,/^player.twitch.tv$/],selector:".video-ref, main > div > section > div > div > div"},{host:S.proxitok,url:"https://www.tiktok.com/",match:["proxitok.pabloferreiro.es","proxitok.pussthecat.org","tok.habedieeh.re","proxitok.esmailelbob.xyz","proxitok.privacydev.net","tok.artemislena.eu","tok.adminforge.de","tt.vern.cc","cringe.whatever.social","proxitok.lunar.icu","proxitok.privacy.com.de"],selector:".column.has-text-centered"},{host:S.tiktok,url:"https://www.tiktok.com/",match:/^(www.)?tiktok.com$/,selector:null},{host:S.vimeo,url:"https://vimeo.com/",match:/^vimeo.com$/,needExtraData:!0,selector:".player"},{host:S.vimeo,url:"https://player.vimeo.com/",match:/^player.vimeo.com$/,additionalData:"embed",needExtraData:!0,needBypassCSP:!0,selector:".player"},{host:S.xvideos,url:"https://www.xvideos.com/",match:/^(www.)?(xvideos|xv-ru).com$/,selector:".video-bg-pic",needBypassCSP:!0},{host:S.pornhub,url:"https://rt.pornhub.com/view_video.php?viewkey=",match:/^[a-z]+.pornhub.com$/,selector:".mainPlayerDiv > .video-element-wrapper-js > div",eventSelector:".mgp_eventCatcher"},{additionalData:"embed",host:S.pornhub,url:"https://rt.pornhub.com/view_video.php?viewkey=",match:t=>t.host.includes("pornhub.com")&&t.pathname.startsWith("/embed/"),selector:"#player"},{host:S.twitter,url:"https://twitter.com/i/status/",match:/^(twitter|x).com$/,selector:'div[data-testid="videoComponent"] > div:nth-child(1) > div',eventSelector:'div[data-testid="videoPlayer"]',needBypassCSP:!0},{host:S.rumble,url:"https://rumble.com/",match:/^rumble.com$/,selector:"#videoPlayer > .videoPlayer-Rumble-cls > div"},{host:S.facebook,url:"https://facebook.com/",match:t=>t.host.includes("facebook.com")&&t.pathname.includes("/videos/"),selector:'div[role="main"] div[data-pagelet$="video" i]',needBypassCSP:!0},{additionalData:"reels",host:S.facebook,url:"https://facebook.com/",match:t=>t.host.includes("facebook.com")&&t.pathname.includes("/reel/"),selector:'div[role="main"]',needBypassCSP:!0},{host:S.rutube,url:"https://rutube.ru/video/",match:/^rutube.ru$/,selector:".video-player > div > div > div:nth-child(2)"},{additionalData:"embed",host:S.rutube,url:"https://rutube.ru/video/",match:/^rutube.ru$/,selector:"#app > div > div"},{host:S.bilibili,url:"https://www.bilibili.com/",match:/^(www|m|player).bilibili.com$/,selector:".bpx-player-video-wrap"},{additionalData:"old",host:S.bilibili,url:"https://www.bilibili.com/",match:/^(www|m).bilibili.com$/,selector:null},{host:S.mailru,url:"https://my.mail.ru/",match:/^my.mail.ru$/,selector:"#b-video-wrapper"},{host:S.bitchute,url:"https://www.bitchute.com/video/",match:/^(www.)?bitchute.com$/,selector:".video-js"},{host:S.eporner,url:"https://www.eporner.com/",match:/^(www.)?eporner.com$/,selector:".vjs-v7"},{host:S.peertube,url:"stub",match:["peertube.1312.media","tube.shanti.cafe","bee-tube.fr","video.sadmin.io","dalek.zone","review.peertube.biz","peervideo.club","tube.la-dina.net","peertube.tmp.rcp.tf","peertube.su","video.blender.org","videos.viorsan.com","tube-sciences-technologies.apps.education.fr","tube-numerique-educatif.apps.education.fr","tube-arts-lettres-sciences-humaines.apps.education.fr","beetoons.tv","comics.peertube.biz","makertube.net"],selector:".vjs-v7"},{host:S.dailymotion,url:"https://dai.ly/",match:/^geo([\d]+)?.dailymotion.com$/,selector:".player"},{host:S.trovo,url:"https://trovo.live/s/",match:/^trovo.live$/,selector:".player-video"},{host:S.yandexdisk,url:"https://yadi.sk/",match:/^disk.yandex.ru$/,selector:".video-player__player > div:nth-child(1)",eventSelector:".video-player__player",needBypassCSP:!0,needExtraData:!0},{host:S.okru,url:"https://ok.ru/video/",match:/^ok.ru$/,selector:".html5-vpl_vid"},{host:S.googledrive,url:"https://drive.google.com/file/d/",match:/^youtube.googleapis.com$/,selector:".html5-video-container"},{host:S.bannedvideo,url:"https://madmaxworld.tv/watch?id=",match:/^(www.)?banned.video|madmaxworld.tv$/,selector:".vjs-v7",needExtraData:!0},{host:S.weverse,url:"https://weverse.io/",match:/^weverse.io$/,selector:".webplayer-internal-source-wrapper",needExtraData:!0},{host:S.newgrounds,url:"https://www.newgrounds.com/",match:/^(www.)?newgrounds.com$/,selector:".ng-video-player"},{host:S.egghead,url:"https://egghead.io/",match:/^egghead.io$/,selector:".cueplayer-react-video-holder"},{host:S.youku,url:"https://v.youku.com/",match:/^v.youku.com$/,selector:"#ykPlayer"},{host:S.archive,url:"https://archive.org/details/",match:/^archive.org$/,selector:".jw-media"},{host:S.kodik,url:"stub",match:/^kodik.(info|biz|cc)$/,selector:".fp-player",needExtraData:!0},{host:S.patreon,url:"stub",match:/^(www.)?patreon.com$/,selector:'div[data-tag="post-card"] div[elevation="subtle"] > div > div > div > div',needExtraData:!0},{host:S.reddit,url:"stub",match:/^(www.|new.|old.)?reddit.com$/,selector:".reddit-video-player-root",needExtraData:!0,needBypassCSP:!0},{host:S.kick,url:"https://kick.com/",match:/^kick.com$/,selector:"#injected-embedded-channel-player-video > div",needExtraData:!0},{host:S.appledeveloper,url:"https://developer.apple.com/",match:/^developer.apple.com$/,selector:".developer-video-player",needExtraData:!0,needBypassCSP:!0},{host:S.epicgames,url:"https://dev.epicgames.com/community/learning/",match:/^dev.epicgames.com$/,selector:".vjs-v7",needExtraData:!0},{host:S.nineanimetv,url:"https://9animetv.to/watch/",match:/^rapid-cloud.co$/,selector:".jw-media",needExtraData:!0},{host:S.odysee,url:"stub",match:/^odysee.com$/,selector:".vjs-v7",needExtraData:!0},{host:S.coursehunterLike,url:"stub",match:["coursehunter.net","coursetrain.net"],selector:"#oframeplayer > pjsdiv:has(video)",needExtraData:!0},{host:S.sap,url:"https://learning.sap.com/courses/",match:/^learning.sap.com$/,selector:".playkit-container",eventSelector:".playkit-player",needExtraData:!0,needBypassCSP:!0},{host:S.udemy,url:"https://www.udemy.com/",match:/udemy.com$/,selector:'div[data-purpose="curriculum-item-viewer-content"] > section > div > div > div > div:nth-of-type(2)',needExtraData:!0},{host:S.coursera,url:"https://www.coursera.org/",match:/coursera.org$/,selector:".vjs-v8",needExtraData:!0},{host:S.watchpornto,url:"https://watchporn.to/",match:/^watchporn.to$/,selector:".fp-player"},{host:S.linkedin,url:"https://www.linkedin.com/learning/",match:/^(www.)?linkedin.com$/,selector:".vjs-v7",needExtraData:!0,needBypassCSP:!0},{host:S.incestflix,url:"https://www.incestflix.net/watch/",match:/^(www.)?incestflix.(net|to|com)$/,selector:"#incflix-stream",needExtraData:!0},{host:S.porntn,url:"https://porntn.com/videos/",match:/^porntn.com$/,selector:null,needExtraData:!0},{host:S.custom,url:"stub",match:t=>/([^.]+).(mp4|webm)/.test(t.pathname),rawResult:!0}],$=JSON.parse('{"__version__":5,"recommended":"recommended","translateVideo":"Translate video","disableTranslate":"Turn off","translationSettings":"Translation settings","subtitlesSettings":"Subtitles settings","about":"About extension","resetSettings":"Reset settings","videoBeingTranslated":"The video is being translated","videoLanguage":"Video language","translationLanguage":"Translation language","translationTake":"The translation will take","translationTakeMoreThanHour":"The translation will take more than an hour","translationTakeAboutMinute":"The translation will take about a minute","translationTakeFewMinutes":"The translation will take a few minutes","translationTakeApproximatelyMinutes":"The translation will take approximately {0} minutes","translationTakeApproximatelyMinute":"The translation will take approximately {0} minutes","unSupportedExtensionError":"Error! {0} is not supported by this version of the extension!\\n\\nPlease use the cloudflare version of the VOT extension.","requestTranslationFailed":"Failed to request video translation","audioNotReceived":"Audio link not received","grantPermissionToAutoPlay":"Grant permission to autoplay","audioFormatNotSupported":"The audio format is not supported","VOTAutoTranslate":"Translate on open","VOTDontTranslateYourLang":"Do not translate from my language","VOTVolume":"Video volume","VOTVolumeTranslation":"Translation Volume","VOTAutoSetVolume":"Reduce video volume to ","VOTShowVideoSlider":"Video volume slider","VOTSyncVolume":"Link translation and video volume","VOTAudioProxy":"Proxy received audio","VOTDisableFromYourLang":"You have disabled the translation of the video in your language","VOTLiveNotSupported":"Translation of live streams is not supported","VOTPremiere":"Wait for the premiere to end before translating","VOTVideoIsTooLong":"Video is too long","VOTNoVideoIDFound":"No video ID found","VOTSubtitles":"Subtitles","VOTSubtitlesDisabled":"Disabled","VOTSubtitlesMaxLength":"Subtitles max length","VOTHighlightWords":"Highlight words","VOTTranslatedFrom":"translated from","VOTAutogenerated":"autogenerated","VOTSettings":"VOT Settings","VOTMenuLanguage":"Menu language","VOTAuthors":"Authors","VOTVersion":"Version","VOTLoader":"Loader","VOTBrowser":"Browser","VOTShowPiPButton":"Show PiP button","langs":{"auto":"Auto","af":"Afrikaans","ak":"Akan","sq":"Albanian","am":"Amharic","ar":"Arabic","hy":"Armenian","as":"Assamese","ay":"Aymara","az":"Azerbaijani","bn":"Bangla","eu":"Basque","be":"Belarusian","bho":"Bhojpuri","bs":"Bosnian","bg":"Bulgarian","my":"Burmese","ca":"Catalan","ceb":"Cebuano","zh":"Chinese","zh-Hans":"Chinese (Simplified)","zh-Hant":"Chinese (Traditional)","co":"Corsican","hr":"Croatian","cs":"Czech","da":"Danish","dv":"Divehi","nl":"Dutch","en":"English","eo":"Esperanto","et":"Estonian","ee":"Ewe","fil":"Filipino","fi":"Finnish","fr":"French","gl":"Galician","lg":"Ganda","ka":"Georgian","de":"German","el":"Greek","gn":"Guarani","gu":"Gujarati","ht":"Haitian Creole","ha":"Hausa","haw":"Hawaiian","iw":"Hebrew","hi":"Hindi","hmn":"Hmong","hu":"Hungarian","is":"Icelandic","ig":"Igbo","id":"Indonesian","ga":"Irish","it":"Italian","ja":"Japanese","jv":"Javanese","kn":"Kannada","kk":"Kazakh","km":"Khmer","rw":"Kinyarwanda","ko":"Korean","kri":"Krio","ku":"Kurdish","ky":"Kyrgyz","lo":"Lao","la":"Latin","lv":"Latvian","ln":"Lingala","lt":"Lithuanian","lb":"Luxembourgish","mk":"Macedonian","mg":"Malagasy","ms":"Malay","ml":"Malayalam","mt":"Maltese","mi":"Māori","mr":"Marathi","mn":"Mongolian","ne":"Nepali","nso":"Northern Sotho","no":"Norwegian","ny":"Nyanja","or":"Odia","om":"Oromo","ps":"Pashto","fa":"Persian","pl":"Polish","pt":"Portuguese","pa":"Punjabi","qu":"Quechua","ro":"Romanian","ru":"Russian","sm":"Samoan","sa":"Sanskrit","gd":"Scottish Gaelic","sr":"Serbian","sn":"Shona","sd":"Sindhi","si":"Sinhala","sk":"Slovak","sl":"Slovenian","so":"Somali","st":"Southern Sotho","es":"Spanish","su":"Sundanese","sw":"Swahili","sv":"Swedish","tg":"Tajik","ta":"Tamil","tt":"Tatar","te":"Telugu","th":"Thai","ti":"Tigrinya","ts":"Tsonga","tr":"Turkish","tk":"Turkmen","uk":"Ukrainian","ur":"Urdu","ug":"Uyghur","uz":"Uzbek","vi":"Vietnamese","cy":"Welsh","fy":"Western Frisian","xh":"Xhosa","yi":"Yiddish","yo":"Yoruba","zu":"Zulu"},"udemyModuleArgsNotFound":"Could not get udemy module data due to the fact that ModuleArgs was not found","VOTTranslationHelpNull":"Could not get the data required for the translate","streamNoConnectionToServer":"There is no connection to the server","searchField":"Search...","VOTTranslateAPIErrors":"Translate errors from the API","VOTTranslationService":"Translation Service","VOTDetectService":"Detect Service","VOTTranslatingError":"Translating the error","VOTProxyWorkerHost":"Enter the proxy worker address","VOTM3u8ProxyHost":"Enter the address of the m3u8 proxy worker","proxySettings":"Proxy Settings","translationTakeApproximatelyMinute2":"The translation will take approximately {0} minutes","VOTAudioBooster":"Extended translation volume increase","VOTSubtitlesDesign":"Subtitles design","VOTSubtitlesFontSize":"Font size of subtitles","VOTSubtitlesOpacity":"Transparency of the subtitle background","VOTPressNewHotkey":"Press the new hotkey...","VOTCreateTranslationHotkey":"Create Hotkey for Translation","VOTChangeHotkeyWithCurrent":"Change Hotkey (Current: {0})","VOTSubtitlesDownloadFormat":"The format for downloading subtitles","VOTDownloadWithName":"Download files with the video name","VOTUpdateLocaleFiles":"Update localization files","VOTLocaleHash":"Locale hash","VOTUpdatedAt":"Updated at","VOTNeedWebAudioAPI":"To enable this, you must have a Web Audio API","VOTMediaCSPEnabledOnSite":"Media CSP is enabled on this site","VOTOnlyBypassMediaCSP":"Use it only for bypassing Media CSP","VOTNewAudioPlayer":"Use the new audio player"}'),D={log:(...t)=>{}},F="media-proxy.toil.cc/v1/proxy/m3u8",q="vot-worker.toil.cc",U="https://vot.toil.cc/v1",H=.15,z="yandex",W="yandex",j={yandex:"https://translate.toil.cc/detect",rustServer:"https://rust-server-531j.onrender.com/detect"},G={yandex:"https://translate.toil.cc/translate",deepl:"https://translate-deepl.toil.cc/translate"},Y=["Violentmonkey","FireMonkey","Greasemonkey","AdGuard","OrangeMonkey"],J=new class{constructor(){this.gmSupport="function"==typeof GM_getValue,D.log(`GM Storage Status: ${this.gmSupport}`)}syncGet(t,e=void 0){if(this.gmSupport)return GM_getValue(t,e);const o="number"==typeof e;const i=window.localStorage.getItem(t)??e;return o?Number(i):i}async get(t,e=void 0){if(this.gmSupport)return await GM_getValue(t,e);const o="number"==typeof e;return Promise.resolve(this.syncGet(t,e,o))}syncSet(t,e){return this.gmSupport?GM_setValue(t,e):window.localStorage.setItem(t,e)}async set(t,e){return this.gmSupport?await GM_setValue(t,e):Promise.resolve(this.syncSet(t,e))}syncDelete(t){return this.gmSupport?GM_deleteValue(t):window.localStorage.removeItem(t)}async delete(t){return this.gmSupport?await GM_deleteValue(t):Promise.resolve(this.syncDelete(t))}syncList(){return this.gmSupport?GM_listValues():["autoTranslate","dontTranslateLanguage","dontTranslateYourLang","autoSetVolumeYandexStyle","autoVolume","buttonPos","showVideoSlider","syncVolume","subtitlesMaxLength","highlightWords","responseLanguage","defaultVolume","audioProxy","showPiPButton","translateAPIErrors","translationService","detectService","m3u8ProxyHost","translateProxyEnabled","hotkeyButton","proxyWorkerHost","audioBooster","locale-version","locale-lang","locale-phrases"]}async list(){return this.gmSupport?await GM_listValues():Promise.resolve(this.syncList())}},K="https://raw.githubusercontent.com/ilyhalight/voice-over-translation/master/src/localization",Z=["auto","en","ru","af","am","ar","az","bg","bn","bs","ca","cs","cy","da","de","el","es","et","eu","fa","fi","fr","gl","hi","hr","hu","hy","id","it","ja","jv","kk","km","kn","ko","lo","mk","ml","mn","ms","mt","my","ne","nl","pa","pl","pt","ro","si","sk","sl","sq","sr","su","sv","sw","tr","uk","ur","uz","vi","zh","zu"],X=new class{lang="en";locale={};gmValues=["locale-phrases","locale-lang","locale-hash","locale-updated-at","locale-lang-override"];constructor(){const t=J.syncGet("locale-lang-override","auto");this.lang=t&&"auto"!==t?t:(navigator.language||navigator.userLanguage)?.substr(0,2)?.toLowerCase()??"en",this.setLocaleFromJsonString(J.syncGet("locale-phrases",""))}reset(){for(let t=0;ti&&o===this.lang)return;const a=await this.checkUpdates();if(await J.set("locale-updated-at",i),a){D.log("Updating locale...");try{const t=await rt(`${K}/locales/${this.lang}.json`);if(200!==t.status)throw t.status;const e=await t.text();await J.set("locale-phrases",e),this.setLocaleFromJsonString(e),await J.set("locale-hash",a),await J.set("locale-lang",this.lang)}catch(t){console.error("[VOT] [localizationProvider] Failed to get locale, cause:",t),this.setLocaleFromJsonString(await J.get("locale-phrases",""))}}}setLocaleFromJsonString(t){try{this.locale=JSON.parse(t)??{}}catch(t){console.error("[VOT] [localizationProvider]",t),this.locale={}}}getFromLocale(t,e){const o=e.split(".").reduce(((t,e)=>{if("object"==typeof t&&t)return t[e]}),t);return void 0===o&&console.warn("[VOT] [localizationProvider] locale",t,"doesn't contain key",e),o}getDefault(t){return this.getFromLocale($,t)??t}get(t){return this.getFromLocale(this.locale,t)??this.getFromLocale($,t)??t}},Q=navigator.language||navigator.userLanguage,tt=Q?.substr(0,2)?.toLowerCase()??"en";function et(){return"pictureInPictureEnabled"in document&&document.pictureInPictureEnabled}function ot(){return"undefined"!=typeof Hls&&Hls?.isSupported()?new Hls({debug:!1,lowLatencyMode:!0,backBufferLength:90}):void 0}const it=new RegExp([/(?:https?|ftp):\/\/\S+/g,/https?:\/\/\S+|www\.\S+/gm,/\b\S+\.\S+/gm,/#[^\s#]+/g,/Auto-generated by YouTube/g,/Provided to YouTube by/g,/Released on/g,/0x[a-fA-F0-9]{40}/g,/[13][a-km-zA-HJ-NP-Z1-9]{25,34}/g,/4[0-9AB][1-9A-HJ-NP-Za-km-z]{93}/g,/Paypal/g].map((t=>t.source)).join("|"));function at(t,e){const o=URL.createObjectURL(t),i=document.createElement("a");i.href=o,i.download=e,i.click(),URL.revokeObjectURL(o)}function nt(t){return 0===t.trim().length?(new Date).toLocaleDateString("en-us").replaceAll("/","-"):t.replace(/[\\/:*?"'<>|]/g,"")}async function rt(t,e={}){const{timeout:o=15e3,...i}=e,a=new AbortController,n=setTimeout((()=>a.abort()),o);try{if(t.includes("api.browser.yandex.ru"))throw new Error("Preventing yandex cors");const e=await fetch(t,{signal:a.signal,...i});return clearTimeout(n),e}catch(e){return D.log("GM_fetch preventing cors by GM_xmlhttpRequest",e.message),new Promise(((e,a)=>{clearTimeout(n),GM_xmlhttpRequest({method:i.method||"GET",url:t,responseType:"blob",...i,data:i.body,timeout:o,onload:t=>{const o=Object.fromEntries(t.responseHeaders.trim().split(/\r?\n/).map((t=>t.split(/: (.+)/))).filter((([t])=>t&&/^[\w-]+$/.test(t))));e(new Response(t.response,{status:t.status,headers:o}))},ontimeout:()=>a(new Error("Timeout")),onerror:t=>a(t),onabort:()=>a(new Error("AbortError"))})}))}}function st(){return Math.floor(Date.now()/1e3)}class lt extends Error{constructor(t){super(t),this.name="VideoHelper",this.message=t}}class dt{API_ORIGIN=window.location.origin;fetch;extraInfo;referer;origin;service;constructor({fetchFn:t=rt,extraInfo:e=!0,referer:o=document.referrer??window.location.origin+"/",origin:i=window.location.origin,service:a}={}){this.fetch=t,this.extraInfo=e,this.referer=o,this.origin=/^(http(s)?):\/\//.test(String(i))?i:window.location.origin,this.service=a}async getVideoData(t){}async getVideoId(t){}returnBaseData(t){if(this.service)return{url:this.service.url+t,videoId:t,host:this.service.host,duration:void 0}}}const ut=["auto","ru","en","zh","ko","lt","lv","ar","fr","it","es","de","ja"],ct=["ru","en","kk"],ht=["srt","vtt","json"];class pt extends Error{constructor(t){super(X.getDefault(t)),this.name="VOTLocalizedError",this.unlocalizedMessage=t,this.localizedMessage=X.get(t)}}const gt={[S.mailru]:class extends dt{API_ORIGIN="https://my.mail.ru";async getVideoMeta(t){try{const e=await this.fetch(`${this.API_ORIGIN}/+/video/meta/${t}?xemail=&ajax_call=1&func_name=&mna=&mnb=&ext=1&_=${(new Date).getTime()}`);return await e.json()}catch(t){return void A.error("Failed to get mail.ru video data",t.message)}}async getVideoId(t){const e=t.pathname;if(/\/(v|mail|bk|inbox)\//.exec(e))return e.slice(1);const o=/video\/embed\/([^/]+)/.exec(e)?.[1];if(!o)return;const i=await this.getVideoMeta(o);return i?i.meta.url.replace("//my.mail.ru/",""):void 0}},[S.weverse]:class extends dt{API_ORIGIN="https://global.apis.naver.com/weverse/wevweb";API_APP_ID="be4d79eb8fc7bd008ee82c8ec4ff6fd4";API_HMAC_KEY="1b9cb6378d959b45714bec49971ade22e6e24e42";HEADERS={Accept:"application/json, text/plain, */*",Origin:"https://weverse.io",Referer:"https://weverse.io/"};getURLData(){return{appId:this.API_APP_ID,language:"en",os:"WEB",platform:"WEB",wpf:"pc"}}async createHash(t){const e=Date.now(),o=t.substring(0,Math.min(255,t.length))+e,i=await async function(t,e){try{const o=I.encode(e),i=await _("SHA-1",t,o);return btoa(String.fromCharCode(...new Uint8Array(i)))}catch(t){return A.error(t),!1}}(this.API_HMAC_KEY,o);if(!i)throw new lt("Failed to get weverse HMAC signature");return{wmsgpad:e.toString(),wmd:i}}async getHashURLParams(t){const e=await this.createHash(t);return new URLSearchParams(e).toString()}async getPostPreview(t){const e=`/post/v1.0/post-${t}/preview?`+new URLSearchParams({fieldSet:"postForPreview",...this.getURLData()}).toString();try{const t=await this.getHashURLParams(e),o=await this.fetch(this.API_ORIGIN+e+"&"+t,{headers:this.HEADERS});return await o.json()}catch(e){return A.error(`Failed to get weverse post preview by postId: ${t}`,e.message),!1}}async getVideoInKey(t){const e=`/video/v1.1/vod/${t}/inKey?`+new URLSearchParams({gcc:"RU",...this.getURLData()}).toString();try{const t=await this.getHashURLParams(e),o=await this.fetch(this.API_ORIGIN+e+"&"+t,{method:"POST",headers:this.HEADERS});return await o.json()}catch(e){return A.error(`Failed to get weverse InKey by videoId: ${t}`,e.message),!1}}async getVideoInfo(t,e,o){const i=Date.now();try{const a=new URLSearchParams({key:e,sid:o,nonce:i.toString(),devt:"html5_pc",prv:"N",aup:"N",stpb:"N",cpl:"en",env:"prod",lc:"en",adi:JSON.stringify([{adSystem:null}]),adu:"/"}).toString(),n=await this.fetch(`https://global.apis.naver.com/rmcnmv/rmcnmv/vod/play/v2.0/${t}?`+a,{headers:this.HEADERS});return await n.json()}catch(i){return A.error(`Failed to get weverse video info (infraVideoId: ${t}, inkey: ${e}, serviceId: ${o}`,i.message),!1}}extractVideoInfo(t){return t.find((t=>!1===t.useP2P&&t.source.includes(".mp4")))}async getVideoData(t){const e=await this.getPostPreview(t);if(!e)return;const{videoId:o,serviceId:i,infraVideoId:a}=e.extension.video;if(!(o&&i&&a))return;const n=await this.getVideoInKey(o);if(!n)return;const r=await this.getVideoInfo(a,n.inKey,i);if(!r)return;const s=this.extractVideoInfo(r.videos.list);return s?{url:s.source,duration:s.duration}:void 0}async getVideoId(t){return/([^/]+)\/(live|media)\/([^/]+)/.exec(t.pathname)?.[3]}},[S.kodik]:class extends dt{API_ORIGIN=window.location.origin;async getSecureData(t){try{const e=await this.fetch(`${this.API_ORIGIN}${t}`,{headers:{"User-Agent":P.userAgent,Origin:this.API_ORIGIN,Referer:this.API_ORIGIN}}),o=await e.text(),[i,a,n]=t.split("/").filter((t=>t)),r=(new DOMParser).parseFromString(o,"text/html"),s=Array.from(r.getElementsByTagName("script")).filter((t=>t.innerHTML.includes(`videoId = "${a}"`)));if(!s.length)throw new lt("Failed to find secure script");const l=/'{[^']+}'/.exec(s[0].textContent.trim())?.[0];if(!l)throw new lt("Secure json wasn't found in secure script");const d=JSON.parse(l.replaceAll("'",""));return{videoType:i,videoId:a,hash:n,...d}}catch(e){return A.error(`Failed to get kodik secure data by videoPath: ${t}.`,e.message),!1}}async getFtor(t){const{videoType:e,videoId:o,hash:i,d:a,d_sign:n,pd:r,pd_sign:s,ref:l,ref_sign:d}=t;try{const t=await this.fetch(this.API_ORIGIN+"/ftor",{method:"POST",headers:{"User-Agent":P.userAgent,Origin:this.API_ORIGIN,Referer:`${this.API_ORIGIN}/${e}/${o}/${i}/360p`},body:new URLSearchParams({d:a,d_sign:n,pd:r,pd_sign:s,ref:decodeURIComponent(l),ref_sign:d,bad_user:"false",cdn_is_working:"true",info:"{}",type:e,hash:i,id:o})});return await t.json()}catch(t){return A.error(`Failed to get kodik video data (type: ${e}, id: ${o}, hash: ${i})`,t.message),!1}}decryptUrl(t){const e=atob(t.replace(/[a-zA-Z]/g,(function(t){const e=t.charCodeAt(0)+13,o=t<="Z"?90:122;return String.fromCharCode(o>=e?e:e-26)})));return"https:"+e}async getVideoData(t){const e=await this.getSecureData(t);if(!e)return;const o=await this.getFtor(e);if(!o)return;const i=Object.entries(o.links[o.default.toString()]),a=i.find((([t,e])=>"application/x-mpegURL"===e.type))?.[1];return a?{url:this.decryptUrl(a.src)}:void 0}async getVideoId(t){return/\/(seria|video)\/([^/]+)\/([^/]+)\/([\d]+)p/.exec(t.pathname)?.[0]}},[S.patreon]:class extends dt{API_ORIGIN="https://www.patreon.com/api";async getPosts(t){try{const e=await this.fetch(`${this.API_ORIGIN}/posts/${t}?json-api-use-default-includes=false`);return await e.json()}catch(e){return A.error(`Failed to get patreon posts by postId: ${t}.`,e.message),!1}}async getVideoData(t){const e=await this.getPosts(t);if(!e)return;const o=e.data.attributes.post_file.url;return o?{url:o}:void 0}async getVideoId(t){const e=/posts\/([^/]+)/.exec(t.pathname)?.[1];if(e)return e.replace(/[^\d.]/g,"")}},[S.reddit]:class extends dt{API_ORIGIN="https://www.reddit.com";async getVideoData(t){try{const t=document.querySelector("[data-hls-url]")?.dataset.hlsUrl.replaceAll("&","&");if(!t)throw new lt("Failed to find content url");return{url:decodeURIComponent(t)}}catch(e){return void A.error(`Failed to get reddit video data by video ID: ${t}`,e.message)}}async getVideoId(t){return/\/r\/(([^/]+)\/([^/]+)\/([^/]+)\/([^/]+))/.exec(t.pathname)?.[1]}},[S.bannedvideo]:class extends dt{API_ORIGIN="https://api.banned.video";async getVideoInfo(t){try{const e=await this.fetch(`${this.API_ORIGIN}/graphql`,{method:"POST",body:JSON.stringify({operationName:"GetVideo",query:"query GetVideo($id: String!) {\n getVideo(id: $id) {\n title\n description: summary\n duration: videoDuration\n videoUrl: directUrl\n isStream: live\n }\n }",variables:{id:t}}),headers:{"User-Agent":"bannedVideoFrontEnd","apollographql-client-name":"banned-web","apollographql-client-version":"1.3","content-type":"application/json"}});return await e.json()}catch(e){return console.error(`Failed to get bannedvideo video info by videoId: ${t}.`,e.message),!1}}async getVideoData(t){const e=await this.getVideoInfo(t);if(!e)return;const{videoUrl:o,duration:i,isStream:a,description:n,title:r}=e.data.getVideo;return{url:o,duration:i,isStream:a,title:r,description:n}}async getVideoId(t){return t.searchParams.get("id")??void 0}},[S.kick]:class extends dt{API_ORIGIN="https://kick.com/api";async getClipInfo(t){try{const e=await this.fetch(`${this.API_ORIGIN}/v2/clips/${t}`),o=await e.json(),{clip_url:i,duration:a,title:n}=o.clip;return{url:i,duration:a,title:n}}catch(e){return void A.error(`Failed to get kick clip info by clipId: ${t}.`,e.message)}}async getVideoInfo(t){try{const e=await this.fetch(`${this.API_ORIGIN}/v1/video/${t}`),o=await e.json(),{source:i,livestream:a}=o,{session_title:n,duration:r}=a;return{url:i,duration:Math.round(r/1e3),title:n}}catch(e){return void A.error(`Failed to get kick video info by videoId: ${t}.`,e.message)}}async getVideoData(t){return t.startsWith("videos")?await this.getVideoInfo(t.replace("videos/","")):await this.getClipInfo(t.replace("clips/",""))}async getVideoId(t){return/([^/]+)\/((videos|clips)\/([^/]+))/.exec(t.pathname)?.[2]}},[S.appledeveloper]:class extends dt{API_ORIGIN="https://developer.apple.com";async getVideoData(t){try{const t=document.querySelector("meta[property='og:video']")?.content;if(!t)throw new lt("Failed to find content url");return{url:t}}catch(e){return void A.error(`Failed to get apple developer video data by video ID: ${t}`,e.message)}}async getVideoId(t){return/videos\/play\/([^/]+)\/([\d]+)/.exec(t.pathname)?.[0]}},[S.epicgames]:class extends dt{API_ORIGIN="https://dev.epicgames.com/community/api/learning";async getPostInfo(t){try{const e=await this.fetch(`${this.API_ORIGIN}/post.json?hash_id=${t}`);return await e.json()}catch(e){return A.error(`Failed to get epicgames post info by videoId: ${t}.`,e.message),!1}}async getVideoData(t){const e=await this.getPostInfo(t);if(!e)return;const o=e.blocks.find((t=>"video"===t.type)),i=o?.video_url?.replace("qsep://","https://");if(!i)return;const{title:a,description:n}=e,r=o?.video_captions?.map((t=>({language:B(t.locale),format:"vtt",url:t.signed_url})));return{url:i,title:a,description:n,subtitles:r}}async getVideoId(t){return/\/(\w{3,5})\/[^/]+$/.exec(t.pathname)?.[1]}},[S.nineanimetv]:class extends dt{API_ORIGIN="https://9animetv.to/ajax/episode";RAPID_CLOUD_ORIGIN="https://rapid-cloud.co/ajax/embed-6-v2";async getSourceId(t){try{const e=await this.fetch(`${this.API_ORIGIN}/servers?episodeId=${t}`),o=await e.json();return!!o.html&&/data-id="(\d+)"/.exec(o.html)?.[1]}catch(e){return A.error(`Failed to get 9animetv servers info by episodeId: ${t}.`,e.message),!1}}async getPlayerLink(t){try{const e=await this.fetch(`${this.API_ORIGIN}/sources?id=${t}`),o=await e.json();return!!o.link.includes("rapid-cloud.co")&&o.link}catch(e){return A.error(`Failed to get player link by sourceId: ${t}.`,e.message),!1}}async getRapidCloudData(t){try{const e=await this.fetch(`${this.RAPID_CLOUD_ORIGIN}/getSources?id=${t}`),o=await e.json();return o.encrypted?(A.warn("Encrypted RapidCloud data found. Let us know about it",o),!1):o}catch(e){return A.error(`Failed to get rapid cloud data by rapidId: ${t}.`,e.message),!1}}async getVideoData(t){const e=t.split("?ep=")[1],o=await this.getSourceId(e);if(!o)return;const i=await this.getPlayerLink(o);if(!i)return;const a=/\/([^/?]+)\?/.exec(i)?.[1];if(!a)return;const n=await this.getRapidCloudData(a);if(!n)return;const r=n.sources.find((t=>"hls"===t.type))?.file;if(!r)return;const s=n.tracks.reduce(((t,e)=>{const o=/([\w+]+)(-\d)?\.vtt/.exec(e.file)?.[1];if(!o)return t;const i=B(3===o.length?o:e.label);return t.find((t=>t.language===i))||t.push({language:i,format:"vtt",url:e.file}),t}),[]);return{url:r,subtitles:s}}async getVideoId(t){return new Promise((t=>{const e="https://9animetv.to";window.addEventListener("message",(o=>{o.origin===e&&o.data?.startsWith("getVideoId:")&&t(o.data.replace("getVideoId:",""))})),window.top.postMessage("getVideoId",e)}))}},[S.odysee]:class extends dt{API_ORIGIN="https://odysee.com";async getVideoData(t){try{const e=await this.fetch(`${this.API_ORIGIN}/${t}`),o=await e.text(),i=/"contentUrl":(\s)?"([^"]+)"/.exec(o)?.[2];if(!i)throw new Error("Odysee url doesn't parsed");return{url:i}}catch(e){return void A.error(`Failed to get odysee video data by video ID: ${t}`,e.message)}}async getVideoId(t){return t.pathname.slice(1)}},[S.coursehunterLike]:class extends dt{API_ORIGIN=this.origin??"https://coursehunter.net";async getCourseId(t){try{const e=await this.fetch(`${this.API_ORIGIN}/${t}`),o=await e.text();return/course_id(\s)?=(\s)?([\d]+)/.exec(o)?.[3]}catch(e){return A.error(`Failed to get CoursehunterLike courseId by videoId: ${t}, because ${e.message}`),!1}}async getLessonsData(t){try{const e=await this.fetch(`${this.API_ORIGIN}/api/v1/course/${t}/lessons`);return await e.json()}catch(e){return A.error(`Failed to get CoursehunterLike lessons data by courseId: ${t}, because ${e.message}`),!1}}async getVideoData(t){const e=await this.getCourseId(t);if(!e)return;const o=await this.getLessonsData(e);if(!o)return;const i=+(t.split("?lesson=")?.[1]??1),a=o?.[i-1],{file:n,duration:r,title:s}=a;return n?{url:n,duration:r,title:s}:void 0}async getVideoId(t){const e=/course\/([^/]+)/.exec(t.pathname)?.[0];return e?e+t.search:void 0}},[S.twitch]:class extends dt{API_ORIGIN="https://clips.twitch.tv";async getClipLink(t,e){const o=document.querySelector("script[type='application/ld+json']"),i=t.slice(1);if(o){const t=JSON.parse(o.innerText),e=t["@graph"].find((t=>"VideoObject"===t["@type"]))?.creator.url;return`${e.replace("https://www.twitch.tv/","")}/clip/${i}`}const a="embed"===i,n=document.querySelector(a?".tw-link[data-test-selector='stream-info-card-component__stream-avatar-link']":".clips-player a:not([class])");if(!n)return;return`${n.href.replace("https://www.twitch.tv/","")}/clip/${a?e:i}`}async getVideoId(t){const e=t.pathname;if(/^m\.twitch\.tv$/.test(e))return/videos\/([^/]+)/.exec(t.href)?.[0]??e.slice(1);if(/^player\.twitch\.tv$/.test(t.hostname))return`videos/${t.searchParams.get("video")}`;const o=/([^/]+)\/(?:clip)\/([^/]+)/.exec(e);if(o)return o[0];return/^clips\.twitch\.tv$/.test(t.hostname)?await this.getClipLink(e,t.searchParams.get("clip")):/(?:videos)\/([^/]+)/.exec(e)?.[0]}},[S.sap]:class extends dt{API_ORIGIN="https://learning.sap.com/";async requestKaltura(t,e,o){try{const i=await this.fetch(`https://${t}/api_v3/service/multirequest`,{method:"POST",body:JSON.stringify({1:{service:"session",action:"startWidgetSession",widgetId:`_${e}`},2:{service:"baseEntry",action:"list",ks:"{1:result:ks}",filter:{redirectFromEntryId:o},responseProfile:{type:1,fields:"id,referenceId,name,description,dataUrl,duration,flavorParamsIds,type,dvrStatus,externalSourceType,createdAt,updatedAt,endDate,plays,views,downloadUrl,creatorId"}},3:{service:"baseEntry",action:"getPlaybackContext",entryId:"{2:result:objects:0:id}",ks:"{1:result:ks}",contextDataParams:{objectType:"KalturaContextDataParams",flavorTags:"all"}},apiVersion:"3.3.0",format:1,ks:"",clientTag:"html5:v3.17.22",partnerId:e}),headers:{"Content-Type":"application/json"}});return await i.json()}catch(t){return void A.error("Failed to request kaltura data",t.message)}}async getKalturaData(t){try{const e=/https:\/\/([^"]+)\/p\/([^"]+)\/embedPlaykitJs\/uiconf_id\/([^"]+)/.exec(document.querySelector('script[data-nscript="beforeInteractive"]')?.src);if(!e)throw new lt(`Failed to get sap data for videoId: ${t}`);const[,o,i]=e;let a=document.querySelector("#shadow")?.firstChild?.getAttribute("id");if(a||(a=/"sourceId":\s?"([^"]+)"/.exec(document.querySelector("#__NEXT_DATA__")?.innerText)?.[1]),!o||Number.isNaN(+i)||!a)throw new lt(`One of the necessary parameters for getting a link to a sap video in wasn't found for ${t}. Params: kalturaDomain = ${o}, partnerId = ${i}, entryId = ${a}`);return await this.requestKaltura(o,i,a)}catch(t){return void A.error("Failed to get kaltura data",t.message)}}async getVideoData(t){const e=await this.getKalturaData(t);if(!e)return;const[,o,i]=e,{duration:a}=o.objects[0],n=i.sources.find((t=>"url"===t.format&&"http,https"===t.protocols&&t.url.includes(".mp4")))?.url;if(!n)return;return{url:n,subtitles:i.playbackCaptions.map((t=>({language:B(t.languageCode),format:"vtt",url:t.webVttUrl,isAutoGenerated:t.label.includes("auto-generated")}))),duration:a}}async getVideoId(t){return/((courses|learning-journeys)\/([^/]+)(\/[^/]+)?)/.exec(t.pathname)?.[1]}},[S.udemy]:class extends dt{API_ORIGIN="https://www.udemy.com/api-2.0";getModuleData(){const t=document.querySelector(".ud-app-loader[data-module-id='course-taking']")?.dataset?.moduleArgs;return t?JSON.parse(t):(console.error(X.get("udemyModuleArgsNotFound")),{})}getLectureId(){return/learn\/lecture\/([^/]+)/.exec(window.location.pathname)?.[1]}async getLectureData(t,e){const o=await this.fetch(`${this.API_ORIGIN}/users/me/subscribed-courses/${t}/lectures/${e}/?`+new URLSearchParams({"fields[lecture]":"title,description,asset","fields[asset]":"length,media_sources,captions"}));return await o.json()}async getCourseLang(t){const e=await this.fetch(`${this.API_ORIGIN}/users/me/subscribed-courses/${t}?`+new URLSearchParams({"fields[course]":"locale"}));return await e.json()}findVideoUrl(t){return t?.find((t=>"video/mp4"===t.type))?.src}findSubtitleUrl(t,e){let o=t?.find((t=>B(t.locale_id)===e));return o||(o=t?.find((t=>"en"===B(t.locale_id)))??t?.[0]),o?.url}async getVideoData(t){const{courseId:e}=this.getModuleData();if(!e)return;const o=this.getLectureId();if(D.log(`[Udemy] courseId: ${e}, lectureId: ${o}`),!o)return;const{title:i,description:a,asset:n}=await this.getLectureData(e,o),{length:r,media_sources:s,captions:l}=n,d=this.findVideoUrl(s);if(!d)return void console.log("Failed to find .mp4 video file in media_sources",s);const u=await this.getCourseLang(e);let{locale:{locale:c}}=u;c=c?B(c):"en",ut.includes(c)||(c="en");const h=this.findSubtitleUrl(l,c);return h||console.log("Failed to find subtitle file in captions",l),{...h?{url:this.service?.url+t,translationHelp:[{target:"subtitles_file_url",targetUrl:h},{target:"video_file_url",targetUrl:d}],detectedLanguage:c}:{url:d,translationHelp:null},duration:r,title:i,description:a}}async getVideoId(t){return t.pathname.slice(1)}},[S.coursera]:class extends dt{API_ORIGIN="https://www.coursera.org/api";async getCourseData(t){const e=await this.fetch(`${this.API_ORIGIN}/onDemandCourses.v1/${t}`),o=await e.json();return o?.elements?.[0]}getPlayer(){return document.querySelector(".vjs-v8")}getPlayerData(){return this.getPlayer()?.player}findVideoUrl(t){return t?.find((t=>"video/mp4"===t.type))?.src}findSubtitleUrl(t,e){let o=t?.find((t=>B(t.srclang)===e));return o||(o=t?.find((t=>"en"===B(t.srclang)))||t?.[0]),o?.src}async getVideoData(t){const e=this.getPlayerData(),{duration:o}=e?.cache_||{},{courseId:i,tracks:a,sources:n}=e?.options_||{},r=this.findVideoUrl(n);if(!r)return void console.log("Failed to find .mp4 video file in sources",n);const{primaryLanguageCodes:s}=await this.getCourseData(i);let l=s?.[0];l=l?B(l):"en",ut.includes(l)||(l="en");const d=this.findSubtitleUrl(a,l);return d||console.log("Failed to find subtitle file in tracks",a),{...d?{url:this.service?.url+t,translationHelp:[{target:"subtitles_file_url",targetUrl:d},{target:"video_file_url",targetUrl:r}]}:{url:r,translationHelp:null},detectedLanguage:l,duration:o}}async getVideoId(t){return/learn\/([^/]+)\/lecture\/([^/]+)/.exec(t.pathname)?.[0]}},[S.linkedin]:class extends dt{API_ORIGIN="https://www.linkedin.com/learning";async getVideoData(t){try{const e=document.querySelector(".video-js");if(!e)throw new lt(`Failed to find video element for videoID ${t}`);const o=(e.getAttribute("data-sources")??"[]").replaceAll(""",'"').replaceAll("&","&"),i=JSON.parse(o).find((t=>t.src.includes(".mp4")));if(!i)throw new Error(`Failed to find video url for videoID ${t}`);const a=new URL(i.src),n=e.getAttribute("data-captions-url"),r=n?[{language:"en",format:"vtt",url:n}]:void 0;return{url:N(a),subtitles:r}}catch(t){return void A.error("Failed to get linkedin video data",t.message)}}async getVideoId(t){return/\/learning\/(([^/]+)\/([^/]+))/.exec(t.pathname)?.[1]}},[S.vimeo]:class extends dt{API_KEY="";DEFAULT_SITE_ORIGIN="https://vimeo.com";SITE_ORIGIN=this.isPrivatePlayer()?this.service?.url?.slice(0,-1)??this.DEFAULT_SITE_ORIGIN:this.DEFAULT_SITE_ORIGIN;isErrorData(t){return Object.hasOwn(t,"error")}isPrivatePlayer(){return this.referer&&!this.referer.includes("vimeo.com")}async getViewerData(){try{const t=await this.fetch("https://vimeo.com/_next/viewer"),e=await t.json(),{apiUrl:o,jwt:i}=e;return this.API_ORIGIN=`https://${o}`,this.API_KEY=`jwt ${i}`,e}catch(t){return A.error("Failed to get default viewer data.",t.message),!1}}async getVideoInfo(t){try{const e=new URLSearchParams({fields:"name,link,description,duration"}).toString(),o=await this.fetch(`${this.API_ORIGIN}/videos/${t}?${e}`,{headers:{Authorization:this.API_KEY}}),i=await o.json();if(this.isErrorData(i))throw new Error(i.developer_message??i.error);return i}catch(e){return A.error(`Failed to get video info by video ID: ${t}`,e.message),!1}}async getPrivateVideoSource(t){try{const{default_cdn:e,cdns:o}=t.dash,i=o[e].url,a=await this.fetch(i);if(200!==a.status)throw new lt(await a.text());const n=await a.json(),r=new URL(i),s=Array.from(n.base_url.matchAll(/\.\.\//g)).length+1,l=r.pathname.split("/");let d=n.base_url.replaceAll("../","");d=d&&!d.startsWith("/")?`/${d}`:d,r.pathname=l.slice(0,l.length-s).join("/")+d,r.pathname.endsWith("/")||(r.pathname+="/");const u=n.audio.find((t=>"audio/mp4"===t.mime_type&&"dash"===t.format));if(!u)throw new lt("Failed to find video data");const c=u.segments?.[0]?.url;if(!c)throw new lt("Failed to find first segment url");const[h,p]=c.split("?",2),g=new URLSearchParams(p);return g.delete("range"),r.pathname+=`${u.base_url}${h}`,r.href=r.href.split("?")[0]+"?"+g.toString(),r.href}catch(t){return A.error("Failed to get private video source",t.message),!1}}async getPrivateVideoInfo(t){try{const e=await this.getPrivateVideoSource(playerConfig.request.files);if(!e)throw new lt("Failed to get private video source");const{title:o,duration:i}=playerConfig.video,{text_tracks:a}=playerConfig.request;return{url:`${this.SITE_ORIGIN}/${t}`,video_url:e,title:o,duration:i,subs:a}}catch(e){return A.error(`Failed to get private video info by video ID: ${t}`,e.message),!1}}async getSubsInfo(t){try{const e=new URLSearchParams({per_page:"100",fields:"language,type,link"}).toString(),o=await this.fetch(`${this.API_ORIGIN}/videos/${t}/texttracks?${e}`,{headers:{Authorization:this.API_KEY}}),i=await o.json();if(this.isErrorData(i))throw new Error(i.developer_message??i.error);return i}catch(e){return A.error(`Failed to get subtitles info by video ID: ${t}`,e.message),!1}}async getVideoData(t){const e=this.isPrivatePlayer();if(!this.extraInfo)return this.returnBaseData(t);if(e){const e=await this.getPrivateVideoInfo(t);if(!e)return;const{url:o,subs:i,video_url:a,title:n,duration:r}=e,s=i.map((t=>({language:B(t.lang),format:"vtt",url:this.SITE_ORIGIN+t.url,isAutoGenerated:t.lang.includes("autogenerated")}))),l=s.length?[{target:"video_file_url",targetUrl:a},{target:"subtitles_file_url",targetUrl:s[0].url}]:null;return{...l?{url:o,translationHelp:l}:{url:a},subtitles:s,title:n,duration:r}}t.startsWith("video/")&&(t=t.replace("video/","")),t.includes("/")&&(t=t.replace("/",":"));if(!await this.getViewerData())return this.returnBaseData(t);const o=await this.getVideoInfo(t);if(!o)return this.returnBaseData(t);const i=await this.getSubsInfo(t),a=i?i.data.map((t=>({language:B(t.language),format:"vtt",url:t.link,isAutoGenerated:t.language.includes("autogen")}))):[],{link:n,duration:r,name:s,description:l}=o;return{url:n,title:s,description:l,subtitles:a,duration:r}}async getVideoId(t){const e=/[^/]+\/[^/]+$/.exec(t.pathname)?.[0];return this.isPrivatePlayer()?e:e?.startsWith("video/")?e.replace("video/",""):e??/[^/]+$/.exec(t.pathname)?.[0]}},[S.yandexdisk]:class extends dt{API_ORIGIN="https://disk.yandex.ru";CLIENT_PREFIX="/client/disk";async getVideoData(t){if(!t.startsWith(this.CLIENT_PREFIX))return{url:this.service.url+t};const e=new URL(window.location).searchParams.get("idDialog");if(!e)return;const o=document.querySelector("#preloaded-data");if(o)try{const t=JSON.parse(o.innerText),{idClient:i,sk:a}=t.config,n=await this.fetch(this.API_ORIGIN+"/models/?_m=resource",{method:"POST",body:new URLSearchParams({idClient:i,sk:a,"_model.0":"resource","id.0":e.replaceAll(" ","+")}).toString().replaceAll(/%2B/g,"+"),headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}}),r=await n.json();if(!r.models)throw new lt("Failed to get resource info");const s=r.models[0].data;if(Object.hasOwn(s,"error"))throw new lt(s.error?.message);const{meta:l,name:d}=s,{short_url:u,video_info:c}=l;if(!c)throw new lt("There's no video open right now");if(!u)throw new lt("VOTLimitedVideoAccess");return{url:u,title:d.replace(/(\.[^.]+)$/,""),duration:c.duration}}catch(e){if(e.message?.startsWith("VOT"))throw new pt(e.message);return void console.error(`Failed to get yandex disk video data by video ID: ${t}`,e.message)}}async getVideoId(t){const e=/\/i\/([^/]+)/.exec(t.pathname)?.[1];return e||(t.pathname.startsWith(this.CLIENT_PREFIX)?t.pathname+t.search:void 0)}},[S.vk]:class extends dt{async getVideoId(t){const e=/^\/(video|clip)-?\d{8,9}_\d{9}$/.exec(t.pathname);if(e)return e[0].slice(1);const o=t.searchParams.get("z");if(o)return o.split("/")[0];const i=t.searchParams.get("oid"),a=t.searchParams.get("id");return i&&a?`video-${Math.abs(parseInt(i))}_${a}`:void 0}},[S.trovo]:class extends dt{async getVideoId(t){const e=t.searchParams.get("vid"),o=/([^/]+)\/([\d]+)/.exec(t.pathname)?.[0];if(e&&o)return`${o}?vid=${e}`}},[S.incestflix]:class extends dt{async getVideoData(t){try{const t=document.querySelector("#incflix-stream source:first-of-type");if(!t)throw new lt("Failed to find source element");const e=t.getAttribute("src"),o=new URL(e.startsWith("//")?`https:${e}`:e);return o.searchParams.append("media-proxy","video.mp4"),{url:N(o)}}catch(e){return void A.error(`Failed to get Incestflix data by videoId: ${t}`,e.message)}}async getVideoId(t){return/\/watch\/([^/]+)/.exec(t.pathname)?.[1]}},[S.porntn]:class extends dt{async getVideoData(t){try{const t=document.body.innerHTML,e=/var flashvars\s=\s/,o=document.getElementsByTagName("script").find((t=>e.exec(t.textContent)));if(!o)throw new lt("Failed to find data script");const i=o.textContent.split(e)?.[1]?.split(";\n",1)[0].replace(/(\t|\n)/g,"");A.log(i);const a=/video_url: 'function\/0\/([^']+)'/.exec(t)?.[1],n=/rnd: '([^']+)'/.exec(t)?.[1];if(!a||!n)throw new lt("Failed to find video source or rnd");const r=/video_title: '([^']+)'/.exec(t)?.[1],s=new URL(a);return s.searchParams.append("rnd",n),A.log(s.href),{url:N(s),title:r}}catch(e){return void A.error(`Failed to get PornTN data by videoId: ${t}`,e.message)}}async getVideoId(t){return/\/videos\/(([^/]+)\/([^/]+))/.exec(t.pathname)?.[1]}}};class mt{helpersData;constructor(t={}){this.helpersData=t}getHelper(t){return new gt[t](this.helpersData)}}class vt extends Error{constructor(t){super(t),this.name="VideoDataError",this.message=t}}async function ft(t,e,o={}){const i=new URL(window.location.href),a=t.host;if(Object.keys(gt).includes(a)){const t=new mt(o).getHelper(a);return await t.getVideoId(i)}switch(a){case S.custom:return i.href;case S.piped:case S.poketube:case S.invidious:case S.ricktube:case S.youtube:return"youtu.be"===i.hostname&&(i.search=`?v=${i.pathname.replace("/","")}`,i.pathname="/watch"),/(?:watch|embed|shorts|live)\/([^/]+)/.exec(i.pathname)?.[1]??i.searchParams.get("v");case S.nine_gag:case S.gag:return/gag\/([^/]+)/.exec(i.pathname)?.[1];case S.proxitok:case S.tiktok:return/([^/]+)\/video\/([^/]+)/.exec(i.pathname)?.[0];case S.xvideos:return/[^/]+\/[^/]+$/.exec(i.pathname)?.[0];case S.pornhub:return i.searchParams.get("viewkey")??/embed\/([^/]+)/.exec(i.pathname)?.[1];case S.twitter:return/status\/([^/]+)/.exec(i.pathname)?.[1];case S.rumble:case S.facebook:return i.pathname.slice(1);case S.rutube:return/(?:video|embed)\/([^/]+)/.exec(i.pathname)?.[1];case S.bilibili:{const t=/bangumi\/play\/([^/]+)/.exec(i.pathname)?.[0];if(t)return t;const e=i.searchParams.get("bvid");if(e)return`video/${e}`;let o=/video\/([^/]+)/.exec(i.pathname)?.[0];return o&&null!==i.searchParams.get("p")&&(o+=`/?p=${i.searchParams.get("p")}`),o}case S.bitchute:return/(video|embed)\/([^/]+)/.exec(i.pathname)?.[2];case S.eporner:return/video-([^/]+)\/([^/]+)/.exec(i.pathname)?.[0];case S.peertube:return/\/w\/([^/]+)/.exec(i.pathname)?.[0];case S.dailymotion:{const t=Array.from(document.querySelectorAll("*")).filter((t=>t.innerHTML.trim().includes(".m3u8")));let e=t?.[1]?.lastChild?.src;if(!e)return;return/\/video\/(\w+)\.m3u8/.exec(e)?.[1]}case S.okru:return/\/video\/(\d+)/.exec(i.pathname)?.[1];case S.googledrive:return i.searchParams.get("docid");case S.newgrounds:return/([^/]+)\/(view)\/([^/]+)/.exec(i.pathname)?.[0];case S.egghead:return i.pathname.slice(1);case S.youku:return/v_show\/id_[\w=]+/.exec(i.pathname)?.[0];case S.archive:return/(details|embed)\/([^/]+)/.exec(i.pathname)?.[2];case S.watchpornto:return/(video|embed)\/(\d+)(\/[^/]+\/)?/.exec(i.pathname)?.[0];default:return}}async function bt(t,e,o={}){const i=await ft(t,0,o);if(!i)throw new vt(`Entered unsupported link: "${t.host}"`);const a=window.location.origin;if([S.peertube,S.coursehunterLike].includes(t.host)&&(t.url=a),t.rawResult)return{url:i,videoId:i,host:t.host,duration:void 0};if(!t.needExtraData)return{url:t.url+i,videoId:i,host:t.host,duration:void 0};const n=new mt({...o,service:t,origin:a}).getHelper(t.host),r=await n.getVideoData(i);if(!r)throw new vt(`Failed to get video raw url for ${t.host}`);return{...r,videoId:i,host:t.host}}class yt extends Error{data;constructor(t,e=void 0){super(t),this.data=e,this.name="VOTJSError",this.message=t}}class wt{host;hostVOT;schema;schemaVOT;fetch;fetchOpts;getVideoDataFn;sessions={};requestLang;responseLang;userAgent=P.userAgent;paths={videoTranslation:"/video-translation/translate",videoTranslationFailAudio:"/video-translation/fail-audio-js",videoTranslationAudio:"/video-translation/audio",videoSubtitles:"/video-subtitles/get-subtitles",streamPing:"/stream-translation/ping-stream",streamTranslation:"/stream-translation/translate-stream",createSession:"/session/create"};isCustomLink(t){return!!(/\.(m3u8|m4(a|v)|mpd)/.exec(t)??/^https:\/\/cdn\.qstv\.on\.epicgames\.com/.exec(t))}headers={"User-Agent":this.userAgent,Accept:"application/x-protobuf","Accept-Language":"en","Content-Type":"application/x-protobuf",Pragma:"no-cache","Cache-Control":"no-cache","Sec-Fetch-Mode":"no-cors"};headersVOT={"User-Agent":`vot.js/${P.version}`,"Content-Type":"application/json",Pragma:"no-cache","Cache-Control":"no-cache"};constructor({host:t=P.host,hostVOT:e=P.hostVOT,fetchFn:o=E,fetchOpts:i={},getVideoDataFn:a=bt,requestLang:n="en",responseLang:r="ru",headers:s={}}={}){const l=/(http(s)?):\/\//,d=l.exec(t)?.[1];this.host=d?t.replace(`${d}://`,""):t,this.schema=d??"https";const u=l.exec(e)?.[1];this.hostVOT=u?e.replace(`${u}://`,""):e,this.schemaVOT=u??"https",this.fetch=o,this.fetchOpts=i,this.getVideoDataFn=a,this.requestLang=n,this.responseLang=r,this.headers={...this.headers,...s}}getOpts(t,e={},o="POST"){return{method:o,headers:{...this.headers,...e},body:t,...this.fetchOpts}}async request(t,e,o={},i="POST"){const a=this.getOpts(new Blob([e]),o,i);try{const e=await this.fetch(`${this.schema}://${this.host}${t}`,a),o=await e.arrayBuffer();return{success:200===e.status,data:o}}catch(t){return{success:!1,data:t?.message}}}async requestJSON(t,e=null,o={},i="POST"){const a=this.getOpts(e,{"Content-Type":"application/json",...o},i);try{const e=await this.fetch(`${this.schema}://${this.host}${t}`,a),o=await e.json();return{success:200===e.status,data:o}}catch(t){return{success:!1,data:t?.message}}}async requestVOT(t,e,o={}){const i=this.getOpts(JSON.stringify(e),{...this.headersVOT,...o});try{const e=await this.fetch(`${this.schemaVOT}://${this.hostVOT}${t}`,i),o=await e.json();return{success:200===e.status,data:o}}catch(t){return{success:!1,data:t?.message}}}async getSession(t){const e=Math.floor(Date.now()/1e3),o=this.sessions[t];if(o&&o.timestamp+o.expires>e)return o;const{secretKey:i,expires:a,uuid:n}=await this.createSession(t);return this.sessions[t]={secretKey:i,expires:a,timestamp:e,uuid:n},this.sessions[t]}async translateVideoYAImpl({videoData:t,requestLang:e=this.requestLang,responseLang:o=this.responseLang,translationHelp:i=null,headers:a={},shouldSendFailedAudio:n=!0}){const{url:r,duration:s=P.defaultDuration}=t,l=await this.getSession("video-translation"),d=C.encodeTranslationRequest(r,s,e,o,i),u=this.paths.videoTranslation,c=await V("Vtrans",l,d,u),h=await this.request(u,d,{...c,...a});if(!h.success)throw new pt("requestTranslationFailed");const p=C.decodeTranslationResponse(h.data);switch(D.log("requestTranslation",p),p.status){case k.FAILED:throw p?.message?new yt("Yandex couldn't translate video",p):new pt("requestTranslationFailed");case k.FINISHED:case k.PART_CONTENT:if(!p.url)throw new pt("audioNotReceived");return{translated:!0,url:p.url,remainingTime:p.remainingTime??-1};case k.WAITING:return{translated:!1,remainingTime:p.remainingTime};case k.LONG_WAITING:case k.LONG_WAITING_2:return r.startsWith("https://youtu.be/")&&n?(await this.requestVtransFailAudio(r),await this.requestVtransAudio(r,p.translationId),await this.translateVideoYAImpl({videoData:t,requestLang:e,responseLang:o,translationHelp:i,headers:a,shouldSendFailedAudio:!1})):{translated:!1,remainingTime:p.remainingTime??-1};default:throw A.error("Unknown response",p),new yt("Unknown response from Yandex",p)}}async translateVideoVOTImpl({url:t,videoId:e,service:o,requestLang:i=this.requestLang,responseLang:a=this.responseLang,headers:n={}}){const r=function(t,e,o){return t===S.patreon?{service:"mux",videoId:new URL(o).pathname.slice(1)}:{service:t,videoId:e}}(o,e,t),s=await this.requestVOT(this.paths.videoTranslation,{provider:"yandex",service:r.service,videoId:r.videoId,fromLang:i,toLang:a,rawVideo:t},n);if(!s.success)throw new pt("requestTranslationFailed",s);const l=s.data;switch(l.status){case"failed":throw new yt("Yandex couldn't translate video",l);case"success":if(!l.translatedUrl)throw new pt("audioNotReceived");return{translated:!0,url:l.translatedUrl,remainingTime:-1};case"waiting":return{translated:!1,remainingTime:l.remainingTime,message:l.message}}}async requestVtransFailAudio(t){const e=await this.requestJSON(this.paths.videoTranslationFailAudio,JSON.stringify({video_url:t}),void 0,"PUT");if(!e.data||"string"==typeof e.data||1!==e.data.status)throw new yt("Failed to request to fake video translation fail audio js",e);return e}async requestVtransAudio(t,e,o={}){const i=await this.getSession("video-translation"),a=C.encodeTranslationAudioRequest(t,e),n=this.paths.videoTranslationAudio,r=await V("Vtrans",i,a,n),s=await this.request(n,a,{...r,...o},"PUT");if(!s.success)throw new yt("Failed to request video translation audio",s);return C.decodeTranslationAudioResponse(s.data)}async translateVideo({videoData:t,requestLang:e=this.requestLang,responseLang:o=this.responseLang,translationHelp:i=null,headers:a={}}){const{url:n,videoId:r,host:s}=t;return this.isCustomLink(n)?await this.translateVideoVOTImpl({url:n,videoId:r,service:s,requestLang:e,responseLang:o,headers:a}):await this.translateVideoYAImpl({videoData:t,requestLang:e,responseLang:o,translationHelp:i,headers:a})}async getSubtitles({videoData:t,requestLang:e=this.requestLang,headers:o={}}){const{url:i}=t;if(this.isCustomLink(i))return{waiting:!1,subtitles:[]};const a=await this.getSession("video-translation"),n=C.encodeSubtitlesRequest(i,e),r=this.paths.videoSubtitles,s=await V("Vsubs",a,n,r),l=await this.request(r,n,{...s,...o});if(!l.success)throw new yt("Failed to request video subtitles",l);return C.decodeSubtitlesResponse(l.data)}async pingStream({pingId:t,headers:e={}}){const o=await this.getSession("video-translation"),i=C.encodeStreamPingRequest(t),a=this.paths.streamPing,n=await V("Vtrans",o,i,a),r=await this.request(a,i,{...n,...e});if(!r.success)throw new yt("Failed to request stream ping",r);return!0}async translateStream({videoData:t,requestLang:e=this.requestLang,responseLang:o=this.responseLang,headers:a={}}){const{url:n}=t;if(this.isCustomLink(n))throw new pt("VOTStreamNotSupportedUrl");const r=await this.getSession("video-translation"),s=C.encodeStreamRequest(n,e,o),l=this.paths.streamTranslation,d=await V("Vtrans",r,s,l),u=await this.request(l,s,{...d,...a});if(!u.success)throw new yt("Failed to request stream translation",u);const c=C.decodeStreamResponse(u.data),h=c.interval;switch(h){case i.NO_CONNECTION:case i.TRANSLATING:return{translated:!1,interval:h,message:h===i.NO_CONNECTION?"streamNoConnectionToServer":"translationTakeFewMinutes"};case i.STREAMING:return{translated:!0,interval:h,pingId:c.pingId,result:c.translatedInfo};default:throw A.error("Unknown response",c),new yt("Unknown response from Yandex",c)}}async createSession(t){const e=function(){let t="";for(let e=0;e<32;e++)t+="0123456789ABCDEF"[Math.floor(16*Math.random())];return t}(),o=C.encodeYandexSessionRequest(e,t),i=await this.request(this.paths.createSession,o,{"Vtrans-Signature":await O(o)});if(!i.success)throw new yt("Failed to request create session",i);return{...C.decodeYandexSessionResponse(i.data),uuid:e}}}class xt extends wt{async request(t,e,o={},i="POST"){const a=this.getOpts(JSON.stringify({headers:{...this.headers,...o},body:Array.from(e)}),{"Content-Type":"application/json"},i);try{const e=await this.fetch(`${this.schema}://${this.host}${t}`,a),o=await e.arrayBuffer();return{success:200===e.status,data:o}}catch(t){return{success:!1,data:t?.message}}}async requestJSON(t,e=null,o={},i="POST"){const a=this.getOpts(JSON.stringify({headers:{...this.headers,"Content-Type":"application/json",Accept:"application/json",...o},body:e}),{Accept:"application/json","Content-Type":"application/json"},i);try{const e=await this.fetch(`${this.schema}://${this.host}${t}`,a),o=await e.json();return{success:200===e.status,data:o}}catch(t){return{success:!1,data:t?.message}}}}var St;function kt(t,e=","){const o=t/1e3,i=Math.floor(o/3600),a=Math.floor(o%3600/60),n=Math.floor(o%60),r=Math.floor(t%1e3);return`${i.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}${e}${r.toString().padStart(3,"0")}`}function Tt(t){const e=t.split(" ")?.[0]?.split(":");e.length<3&&e.unshift("00");const[o,i,a]=e;return 36e5*+o+6e4*+i+ +a.replace(/[,.]/,"")}function Ct(t,e="srt"){const o="vtt"===e,i=o?".":",",a=t.subtitles.map(((t,e)=>(o?"":`${e+1}\n`)+`${kt(t.startMs,i)} --\x3e ${kt(t.startMs+t.durationMs,i)}\n${t.text}\n\n`)).join("").trim();return o?`WEBVTT\n\n${a}`:a}function Pt(t,e="srt"){const o=function(t){return"string"!=typeof t?"json":/(WEBVTT)(\r?\n\r?\n)/.exec(t)?"vtt":"srt"}(t);return o===e?t:"json"===o?Ct(t,e):(t=function(t,e="srt"){const o=t.split(/\r?\n\r?\n/g);"vtt"===e&&o.shift();const i=+("srt"===e);return{containsTokens:!1,subtitles:o.reduce(((t,e)=>{const o=e.trim().split("\n"),a=o[i],n=o.slice(i+1).join("\n");if(!(2===o.length&&e.includes(" --\x3e ")||a?.includes(" --\x3e ")))return 0===t.length||(t[t.length-1].text+=`\n\n${o.join("\n")}`),t;const[r,s]=a.split(" --\x3e "),l=Tt(r),d=Tt(s)-l;return t.push({text:n,startMs:l,durationMs:d,speakerId:"0"}),t}),[])}}(t,o),"json"===e?t:Ct(t,e))}!function(t){t.Channel="Channel",t.Video="Video"}(St||(St={}));const Lt=globalThis,At=Lt.trustedTypes,It=At?At.createPolicy("lit-html",{createHTML:t=>t}):void 0,_t="$lit$",Ot=`lit$${Math.random().toFixed(9).slice(2)}$`,Vt="?"+Ot,Mt=`<${Vt}>`,Et=document,Bt=()=>Et.createComment(""),Nt=t=>null===t||"object"!=typeof t&&"function"!=typeof t,Rt=Array.isArray,$t=t=>Rt(t)||"function"==typeof t?.[Symbol.iterator],Dt="[ \t\n\f\r]",Ft=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,qt=/-->/g,Ut=/>/g,Ht=RegExp(`>|${Dt}(?:([^\\s"'>=/]+)(${Dt}*=${Dt}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),zt=/'/g,Wt=/"/g,jt=/^(?:script|style|textarea|title)$/i,Gt=t=>(e,...o)=>({_$litType$:t,strings:e,values:o}),Yt=Gt(1),Jt=Gt(2),Kt=(Gt(3),Symbol.for("lit-noChange")),Zt=Symbol.for("lit-nothing"),Xt=new WeakMap,Qt=Et.createTreeWalker(Et,129);function te(t,e){if(!Rt(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==It?It.createHTML(e):e}const ee=(t,e)=>{const o=t.length-1,i=[];let a,n=2===e?"":3===e?"":"",r=Ft;for(let e=0;e"===l[0]?(r=a??Ft,d=-1):void 0===l[1]?d=-2:(d=r.lastIndex-l[2].length,s=l[1],r=void 0===l[3]?Ht:'"'===l[3]?Wt:zt):r===Wt||r===zt?r=Ht:r===qt||r===Ut?r=Ft:(r=Ht,a=void 0);const c=r===Ht&&t[e+1].startsWith("/>")?" ":"";n+=r===Ft?o+Mt:d>=0?(i.push(s),o.slice(0,d)+_t+o.slice(d)+Ot+c):o+Ot+(-2===d?e:c)}return[te(t,n+(t[o]||"")+(2===e?"":3===e?"":"")),i]};class oe{constructor({strings:t,_$litType$:e},o){let i;this.parts=[];let a=0,n=0;const r=t.length-1,s=this.parts,[l,d]=ee(t,e);if(this.el=oe.createElement(l,o),Qt.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=Qt.nextNode())&&s.length0){i.textContent=At?At.emptyScript:"";for(let o=0;o2||""!==o[0]||""!==o[1]?(this._$AH=Array(o.length-1).fill(new String),this.strings=o):this._$AH=Zt}_$AI(t,e=this,o,i){const a=this.strings;let n=!1;if(void 0===a)t=ie(this,t,e,0),n=!Nt(t)||t!==this._$AH&&t!==Kt,n&&(this._$AH=t);else{const i=t;let r,s;for(t=a[0],r=0;r{const i=o?.renderBefore??e;let a=i._$litPart$;if(void 0===a){const t=o?.renderBefore??null;i._$litPart$=a=new ne(e.insertBefore(Bt(),t),t,void 0,o??{})}return a._$AI(t),a};function pe(t){return String(t).split("").map((t=>t.charCodeAt(0)))}function ge(t){return new Uint8Array(pe(t))}function me(t){const e=new ArrayBuffer(2*t.length),o=new Uint8Array(e);return new Uint16Array(e).set(pe(t)),o}function ve(t){const e=255;return[t>>>24&e,t>>>16&e,t>>>8&e,t&e]}function fe(t){return 11+t}function be(t,e,o,i){return 11+e+1+1+(i?2+2*(o+1):o+1)+t}function ye(t){let e=0;return t.forEach((t=>{e+=2+2*t[0].length+2+2+2*t[1].length+2})),11+e}function we(t,e){const o=2*e;let i=0;return t.forEach((t=>{i+=2+2*t[0].length+2+4})),18+o+2+i}class xe{_setIntegerFrame(t,e){const o=parseInt(e,10);this.frames.push({name:t,value:o,size:fe(o.toString().length)})}_setStringFrame(t,e){const o=e.toString();let i=13+2*o.length;"TDAT"===t&&(i=fe(o.length)),this.frames.push({name:t,value:o,size:i})}_setPictureFrame(t,e,o,i){const a=function(t){if(!t||!t.length)return null;if(255===t[0]&&216===t[1]&&255===t[2])return"image/jpeg";if(137===t[0]&&80===t[1]&&78===t[2]&&71===t[3])return"image/png";if(71===t[0]&&73===t[1]&&70===t[2])return"image/gif";if(87===t[8]&&69===t[9]&&66===t[10]&&80===t[11])return"image/webp";const e=73===t[0]&&73===t[1]&&42===t[2]&&0===t[3],o=77===t[0]&&77===t[1]&&0===t[2]&&42===t[3];return e||o?"image/tiff":66===t[0]&&77===t[1]?"image/bmp":0===t[0]&&0===t[1]&&1===t[2]&&0===t[3]?"image/x-icon":null}(new Uint8Array(e)),n=o.toString();if(!a)throw new Error("Unknown picture MIME type");o||(i=!1),this.frames.push({name:"APIC",value:e,pictureType:t,mimeType:a,useUnicodeEncoding:i,description:n,size:be(e.byteLength,a.length,n.length,i)})}_setLyricsFrame(t,e,o){const i=t.split("").map((t=>t.charCodeAt(0))),a=e.toString(),n=o.toString();var r,s;this.frames.push({name:"USLT",value:n,language:i,description:a,size:(r=a.length,s=n.length,16+2*r+2+2+2*s)})}_setCommentFrame(t,e,o){const i=t.split("").map((t=>t.charCodeAt(0))),a=e.toString(),n=o.toString();var r,s;this.frames.push({name:"COMM",value:n,language:i,description:a,size:(r=a.length,s=n.length,16+2*r+2+2+2*s)})}_setPrivateFrame(t,e){const o=t.toString();var i,a;this.frames.push({name:"PRIV",value:e,id:o,size:(i=o.length,a=e.byteLength,10+i+1+a)})}_setUserStringFrame(t,e){const o=t.toString(),i=e.toString();var a,n;this.frames.push({name:"TXXX",description:o,value:i,size:(a=o.length,n=i.length,13+2*a+2+2+2*n)})}_setUrlLinkFrame(t,e){const o=e.toString();var i;this.frames.push({name:t,value:o,size:(i=o.length,10+i)})}_setPairedTextFrame(t,e){this.frames.push({name:t,value:e,size:ye(e)})}_setSynchronisedLyricsFrame(t,e,o,i,a){const n=a.toString(),r=i.split("").map((t=>t.charCodeAt(0)));this.frames.push({name:"SYLT",value:e,language:r,description:n,type:t,timestampFormat:o,size:we(e,n.length)})}constructor(t){if(!t||"object"!=typeof t||!("byteLength"in t))throw new Error("First argument should be an instance of ArrayBuffer or Buffer");this.arrayBuffer=t,this.padding=4096,this.frames=[],this.url=""}setFrame(t,e){switch(t){case"TPE1":case"TCOM":case"TCON":{if(!Array.isArray(e))throw new Error(`${t} frame value should be an array of strings`);const o="TCON"===t?";":"/",i=e.join(o);this._setStringFrame(t,i);break}case"TLAN":case"TIT1":case"TIT2":case"TIT3":case"TALB":case"TPE2":case"TPE3":case"TPE4":case"TRCK":case"TPOS":case"TMED":case"TPUB":case"TCOP":case"TKEY":case"TEXT":case"TDAT":case"TSRC":this._setStringFrame(t,e);break;case"TBPM":case"TLEN":case"TYER":this._setIntegerFrame(t,e);break;case"USLT":if(e.language=e.language||"eng","object"!=typeof e||!("description"in e)||!("lyrics"in e))throw new Error("USLT frame value should be an object with keys description and lyrics");if(e.language&&!e.language.match(/[a-z]{3}/i))throw new Error("Language must be coded following the ISO 639-2 standards");this._setLyricsFrame(e.language,e.description,e.lyrics);break;case"APIC":if("object"!=typeof e||!("type"in e)||!("data"in e)||!("description"in e))throw new Error("APIC frame value should be an object with keys type, data and description");if(e.type<0||e.type>20)throw new Error("Incorrect APIC frame picture type");this._setPictureFrame(e.type,e.data,e.description,!!e.useUnicodeEncoding);break;case"TXXX":if("object"!=typeof e||!("description"in e)||!("value"in e))throw new Error("TXXX frame value should be an object with keys description and value");this._setUserStringFrame(e.description,e.value);break;case"WCOM":case"WCOP":case"WOAF":case"WOAR":case"WOAS":case"WORS":case"WPAY":case"WPUB":this._setUrlLinkFrame(t,e);break;case"COMM":if(e.language=e.language||"eng","object"!=typeof e||!("description"in e)||!("text"in e))throw new Error("COMM frame value should be an object with keys description and text");if(e.language&&!e.language.match(/[a-z]{3}/i))throw new Error("Language must be coded following the ISO 639-2 standards");this._setCommentFrame(e.language,e.description,e.text);break;case"PRIV":if("object"!=typeof e||!("id"in e)||!("data"in e))throw new Error("PRIV frame value should be an object with keys id and data");this._setPrivateFrame(e.id,e.data);break;case"IPLS":if(!Array.isArray(e)||!Array.isArray(e[0]))throw new Error("IPLS frame value should be an array of pairs");this._setPairedTextFrame(t,e);break;case"SYLT":if("object"!=typeof e||!("type"in e)||!("text"in e)||!("timestampFormat"in e))throw new Error("SYLT frame value should be an object with keys type, text and timestampFormat");if(!Array.isArray(e.text)||!Array.isArray(e.text[0]))throw new Error("SYLT frame text value should be an array of pairs");if(e.type<0||e.type>6)throw new Error("Incorrect SYLT frame content type");if(e.timestampFormat<1||e.timestampFormat>2)throw new Error("Incorrect SYLT frame time stamp format");e.language=e.language||"eng",e.description=e.description||"",this._setSynchronisedLyricsFrame(e.type,e.text,e.timestampFormat,e.language,e.description);break;default:throw new Error(`Unsupported frame ${t}`)}return this}removeTag(){if(this.arrayBuffer.byteLength<10)return;const t=new Uint8Array(this.arrayBuffer),e=t[3],o=((i=[t[6],t[7],t[8],t[9]])[0]<<21)+(i[1]<<14)+(i[2]<<7)+i[3]+10;var i,a;73!==(a=t)[0]||68!==a[1]||51!==a[2]||e<2||e>4||(this.arrayBuffer=new Uint8Array(t.subarray(o)).buffer)}addTag(){this.removeTag();const t=[255,254],e=10+this.frames.reduce(((t,e)=>t+e.size),0)+this.padding,o=new ArrayBuffer(this.arrayBuffer.byteLength+e),i=new Uint8Array(o);let a=0,n=[];return n=[73,68,51,3],i.set(n,a),a+=n.length,a++,a++,n=function(t){const e=127;return[t>>>21&e,t>>>14&e,t>>>7&e,t&e]}(e-10),i.set(n,a),a+=n.length,this.frames.forEach((e=>{switch(n=ge(e.name),i.set(n,a),a+=n.length,n=ve(e.size-10),i.set(n,a),a+=n.length,a+=2,e.name){case"WCOM":case"WCOP":case"WOAF":case"WOAR":case"WOAS":case"WORS":case"WPAY":case"WPUB":n=ge(e.value),i.set(n,a),a+=n.length;break;case"TPE1":case"TCOM":case"TCON":case"TLAN":case"TIT1":case"TIT2":case"TIT3":case"TALB":case"TPE2":case"TPE3":case"TPE4":case"TRCK":case"TPOS":case"TKEY":case"TMED":case"TPUB":case"TCOP":case"TEXT":case"TSRC":n=[1].concat(t),i.set(n,a),a+=n.length,n=me(e.value),i.set(n,a),a+=n.length;break;case"TXXX":case"USLT":case"COMM":n=[1],"USLT"!==e.name&&"COMM"!==e.name||(n=n.concat(e.language)),n=n.concat(t),i.set(n,a),a+=n.length,n=me(e.description),i.set(n,a),a+=n.length,n=[0,0].concat(t),i.set(n,a),a+=n.length,n=me(e.value),i.set(n,a),a+=n.length;break;case"TBPM":case"TLEN":case"TDAT":case"TYER":a++,n=ge(e.value),i.set(n,a),a+=n.length;break;case"PRIV":n=ge(e.id),i.set(n,a),a+=n.length,a++,i.set(new Uint8Array(e.value),a),a+=e.value.byteLength;break;case"APIC":n=[e.useUnicodeEncoding?1:0],i.set(n,a),a+=n.length,n=ge(e.mimeType),i.set(n,a),a+=n.length,n=[0,e.pictureType],i.set(n,a),a+=n.length,e.useUnicodeEncoding?(n=[].concat(t),i.set(n,a),a+=n.length,n=me(e.description),i.set(n,a),a+=n.length,a+=2):(n=ge(e.description),i.set(n,a),a+=n.length,a++),i.set(new Uint8Array(e.value),a),a+=e.value.byteLength;break;case"IPLS":n=[1],i.set(n,a),a+=n.length,e.value.forEach((e=>{n=[].concat(t),i.set(n,a),a+=n.length,n=me(e[0].toString()),i.set(n,a),a+=n.length,n=[0,0].concat(t),i.set(n,a),a+=n.length,n=me(e[1].toString()),i.set(n,a),a+=n.length,n=[0,0],i.set(n,a),a+=n.length}));break;case"SYLT":n=[1].concat(e.language).concat(e.timestampFormat).concat(e.type),i.set(n,a),a+=n.length,n=[].concat(t),i.set(n,a),a+=n.length,n=me(e.description),i.set(n,a),a+=n.length,a+=2,e.value.forEach((e=>{n=[].concat(t),i.set(n,a),a+=n.length,n=me(e[0].toString()),i.set(n,a),a+=n.length,n=[0,0],i.set(n,a),a+=n.length,n=ve(e[1]),i.set(n,a),a+=n.length}))}})),a+=this.padding,i.set(new Uint8Array(this.arrayBuffer),a),this.arrayBuffer=o,o}getBlob(){return new Blob([this.arrayBuffer],{type:"audio/mpeg"})}getURL(){return this.url||(this.url=URL.createObjectURL(this.getBlob())),this.url}revokeURL(){URL.revokeObjectURL(this.url)}}const Se={async translate(t,e){try{const o=await rt(`${G.yandex}?${new URLSearchParams({text:t,lang:e})}`,{timeout:3e3});if(o instanceof Error)throw o;const i=await o.json();if(200!==i.code)throw i.message;return i.text[0]}catch(e){return console.error("Error translating text:",e),t}},async detect(t){try{const e=await rt(`${j.yandex}?${new URLSearchParams({text:t})}`,{timeout:3e3});if(e instanceof Error)throw e;const o=await e.json();if(200!==o.code)throw o.message;return o.lang??"en"}catch(t){return console.error("Error getting lang from text:",t),"en"}}},ke={async detect(t){try{const e=await rt(j.rustServer,{method:"POST",body:t});if(e instanceof Error)throw e;return await e.text()}catch(t){return console.error("Error getting lang from text:",t),"en"}}},Te={async translate(t,e="auto",o="ru"){try{const i=await rt(G.deepl,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:new URLSearchParams({text:t,source_lang:e,target_lang:o})});if(i instanceof Error)throw i;const a=await i.json();if(200!==a.code)throw a.message;return a.data}catch(e){return console.error("Error translating text:",e),t}}};const Ce=Object.keys(G),Pe=Object.keys(j).map((t=>"rustServer"===t?"rust-server":t));async function Le(t,e,o,i){if(!window.location.hostname.includes("m.youtube.com")&&t?.getAudioTrack){const e=t.getAudioTrack(),o=e?.getLanguageInfo();if("und"!==o?.id)return B(o.id.split(".")[0])}const a=e?.captions?.playerCaptionsTracklistRenderer?.captionTracks;if(a?.length){const t=a.find((t=>"asr"===t.kind));if(t&&t.languageCode)return B(t.languageCode)}const n=function(t,e){return`${t} ${e?e.split("\n").filter((t=>!it.test(t))).join(" "):""}`.slice(0,450).replace(/[^\p{L}\s]+|\s+/gu," ").trim()}(o,i);return D.log(`Detecting language text: ${n}`),async function(t){switch(await J.get("detectService",W)){case"yandex":return await Se.detect(t);case"rust-server":return await ke.detect(t);default:return"en"}}(n)}function Ae(){return/^m\.youtube\.com$/.test(window.location.hostname)}function Ie(){return window.location.pathname.startsWith("/shorts/")&&!Ae()?document.querySelector("#shorts-player"):document.querySelector("#movie_player")}function _e(){const t=Ie();return t?.getPlayerResponse?t?.getPlayerResponse?.call()??null:t?.data?.playerResponse??null}function Oe(){const t=Ie();return t?.getVideoData?t?.getVideoData?.call()??null:t?.data?.playerResponse?.videoDetails??null}const Ve={isMobile:Ae,getPlayer:Ie,getPlayerResponse:_e,getPlayerData:Oe,getVideoVolume:function(){const t=Ie();return t?.getVolume?t.getVolume.call()/100:1},getSubtitles:function(){const t=_e(),e=t?.captions?.playerCaptionsTracklistRenderer;if(!e)return[];let o=e.captionTracks??[];const i=e.translationLanguages??[],a=X.lang,n=i.find((t=>t.languageCode===a)),r=o.find((t=>"asr"===t?.kind))?.languageCode??"en";return o=o.reduce(((t,e)=>{if(!("languageCode"in e))return t;const o=e.languageCode?B(e.languageCode):void 0,i=e?.url||e?.baseUrl;if(!o||!i)return t;const s=`${i.startsWith("http")?i:`${window.location.origin}/${i}`}&fmt=json3`;return t.push({source:"youtube",language:o,isAutoGenerated:"asr"===e?.kind,url:s}),n&&e.isTranslatable&&e.languageCode===r&&a!==o&&t.push({source:"youtube",language:a,isAutoGenerated:"asr"===e?.kind,translatedFromLanguage:o,url:`${s}&tlang=${a}`}),t}),[]),D.log("youtube subtitles:",o),o},getVideoData:async function(){const t=Ie(),e=_e(),o=Oe(),{title:i}=o??{},{shortDescription:a,isLive:n,title:r}=e?.videoDetails??{};let s=r?await Le(t,e,r,a):"en";s=ut.includes(s)?s:"en";const l={isLive:!!n,title:r,localizedTitle:i,description:a,detectedLanguage:s};return D.log("youtube video data:",l),console.log("[VOT] Detected language: ",l.detectedLanguage),l},setVideoVolume:function(t){const e=Ie();if(e?.setVolume)return e.setVolume(Math.round(100*t)),!0},videoSeek:function(t,e){D.log("videoSeek",e);const o=(Ie()?.getProgressState()?.seekableEnd||t.currentTime)-e;t.currentTime=o},isMuted:function(){const t=Ie();return!!t?.isMuted&&t.isMuted.call()},isMusic:function(){const t=Oe().author,e=Oe().title.toUpperCase(),o=e.match(/\w+/g),i=document.body.querySelector("ytd-watch-flexy")?.playerData;return[e,document.URL,t,i?.microformat?.playerMicroformatRenderer.category,i?.title].some((t=>t?.toUpperCase().includes("MUSIC")))||document.body.querySelector("#upload-info #channel-name .badge-style-type-verified-artist")||t&&/(VEVO|Topic|Records|RECORDS|Recordings|AMV)$/.test(t)||t&&/(MUSIC|ROCK|SOUNDS|SONGS)/.test(t.toUpperCase())||o?.length&&["🎵","♫","SONG","SONGS","SOUNDTRACK","LYRIC","LYRICS","AMBIENT","MIX","VEVO","CLIP","KARAOKE","OPENING","COVER","COVERED","VOCAL","INSTRUMENTAL","ORCHESTRAL","DUBSTEP","DJ","DNB","BASS","BEAT","ALBUM","PLAYLIST","DUBSTEP","CHILL","RELAX","CLASSIC","CINEMATIC"].some((t=>o.includes(t)))||["OFFICIAL VIDEO","OFFICIAL AUDIO","FEAT.","FT.","LIVE RADIO","DANCE VER","HIP HOP","ROCK N ROLL","HOUR VER","HOURS VER","INTRO THEME"].some((t=>e.includes(t)))||o?.length&&["OP","ED","MV","OST","NCS","BGM","EDM","GMV","AMV","MMD","MAD"].some((t=>o.includes(t)))}};function Me(t){const e=t.startMs+t.durationMs;return t.tokens.reduce(((o,i,a)=>{const n=t.tokens[a+1];let r;o.length>0&&(r=o[o.length-1]);const s=r?.alignRange?.end??0,l=s+i.text.length;if(i.alignRange={start:s,end:l},o.push(i),n){const t=i.startMs+i.durationMs,a=n.startMs?n.startMs-t:e-t;o.push({text:" ",startMs:t,durationMs:a,alignRange:{start:l,end:l+1}})}return o}),[])}function Ee(t,e){const o=t.text.split(/([\n \t])/).reduce(((t,o)=>{if(o.length){const i=t[t.length-1]??e,a=i?.alignRange?.end??0,n=a+o.length;t.push({text:o,alignRange:{start:a,end:n}})}return t}),[]),i=Math.floor(t.durationMs/o.length),a=t.startMs+t.durationMs;return o.map(((e,n)=>{const r=n===o.length-1,s=t.startMs+i*n;return{...e,startMs:s,durationMs:r?a-s:i}}))}async function Be(t){const{source:e,isAutoGenerated:o,format:i,url:a}=t,n=(async()=>{try{const t=await rt(a,{timeout:5e3});if(["vtt","srt"].includes(i)){return Pt(await t.text(),"json")}return await t.json()}catch(t){return console.error("[VOT] Failed to fetch subtitles.",t),{containsTokens:!1,subtitles:[]}}})();let r=await n;return"youtube"===e&&(r=function(t,e=!1){const o={containsTokens:e,subtitles:[]};if("object"!=typeof t||!Array.isArray(t.events))return console.error("[VOT] Failed to format youtube subtitles",t),o;for(let i=0;it.events[i+1].tStartMs&&(n=t.events[i+1].tStartMs-a.tStartMs);const r=[];let s=n;for(let t=0;tt.text)).join(" ");l&&o.subtitles.push({text:l,startMs:a.tStartMs,durationMs:n,...e?{tokens:r}:{},speakerId:"0"})}return o}(r,o)),r.subtitles=function(t,e){const o=[];let i;const{source:a,isAutoGenerated:n}=e;for(let e=0;esetTimeout((()=>e(new Error("Timeout"))),5e3)));try{const e=await Promise.race([t.getSubtitles({videoData:{host:o,url:i,videoId:n,duration:r},requestLang:a}),d]);console.log("[VOT] Subtitles response: ",e),e.waiting&&console.error("[VOT] Failed to get yandex subtitles");let s=e.subtitles??[];return s=s.reduce(((t,e)=>(e.language&&!t.find((t=>"yandex"===t.source&&t.language===e.language&&!t.translatedFromLanguage))&&t.push({source:"yandex",language:e.language,url:e.url}),e.translatedLanguage&&t.push({source:"yandex",language:e.translatedLanguage,translatedFromLanguage:e.language,url:e.translatedUrl}),t)),[]),[...s,...l].sort(((t,e)=>{if(t.source!==e.source)return"yandex"===t.source?-1:1;if(t.language!==e.language&&(t.language===tt||e.language===tt))return t.language===tt?-1:1;if("yandex"===t.source){if(t.translatedFromLanguage!==e.translatedFromLanguage)return t.translatedFromLanguage&&e.translatedFromLanguage?t.translatedFromLanguage===a?-1:1:t.language===e.language?t.translatedFromLanguage?1:-1:t.translatedFromLanguage?-1:1;if(!t.translatedFromLanguage)return t.language===a?-1:1}return"yandex"!==t.source&&t.isAutoGenerated!==e.isAutoGenerated?t.isAutoGenerated?1:-1:0}))}catch(t){throw"Timeout"===t.message?console.error("[VOT] Failed to get yandex subtitles. Reason: timeout"):console.error("[VOT] Error in getSubtitles function",t),t}}class Re{constructor(t,e,o){this.video=t,this.container="youtube"===o.host&&"mobile"!==o.additionalData?e.parentElement:e,this.site=o,this.subtitlesContainer=this.createSubtitlesContainer(),this.position={left:25,top:75},this.dragging={active:!1,offset:{x:0,y:0}},this.subtitles=null,this.lastContent=null,this.highlightWords=!1,this.fontSize=20,this.opacity=.2,this.maxLength=300,this.maxLengthRegexp=/.{1,300}(?:\s|$)/g,this.bindEvents(),this.updateContainerRect()}createSubtitlesContainer(){const t=document.createElement("vot-block");return t.classList.add("vot-subtitles-widget"),this.container.appendChild(t),t}bindEvents(){this.onMouseDownBound=t=>this.onMouseDown(t),this.onMouseUpBound=()=>this.onMouseUp(),this.onMouseMoveBound=t=>this.onMouseMove(t),this.onTimeUpdateBound=this.debounce((()=>this.update()),100),document.addEventListener("mousedown",this.onMouseDownBound),document.addEventListener("mouseup",this.onMouseUpBound),document.addEventListener("mousemove",this.onMouseMoveBound),this.video?.addEventListener("timeupdate",this.onTimeUpdateBound),this.resizeObserver=new ResizeObserver((()=>this.onResize())),this.resizeObserver.observe(this.container)}onMouseDown(t){if(this.subtitlesContainer.contains(t.target)){const e=this.subtitlesContainer.getBoundingClientRect(),o=this.container.getBoundingClientRect();this.dragging={active:!0,offset:{x:t.clientX-e.left,y:t.clientY-e.top},containerOffset:{x:o.left,y:o.top}}}}onMouseUp(){this.dragging.active=!1}onMouseMove(t){if(this.dragging.active){t.preventDefault();const{width:e,height:o}=this.container.getBoundingClientRect(),i=this.dragging.containerOffset;this.position={left:(t.clientX-this.dragging.offset.x-i.x)/e*100,top:(t.clientY-this.dragging.offset.y-i.y)/o*100},this.applySubtitlePosition()}}onResize(){this.updateContainerRect()}updateContainerRect(){this.containerRect=this.container.getBoundingClientRect(),this.applySubtitlePosition()}applySubtitlePosition(){const{width:t,height:e}=this.containerRect,{offsetWidth:o,offsetHeight:i}=this.subtitlesContainer,a=(t-o)/t*100,n=(e-i)/e*100;this.position.left=Math.max(0,Math.min(this.position.left,a)),this.position.top=Math.max(0,Math.min(this.position.top,n)),this.subtitlesContainer.style.left=`${this.position.left}%`,this.subtitlesContainer.style.top=`${this.position.top}%`}setContent(t){t&&this.video?(this.subtitles=t,this.update()):(this.subtitles=null,he(null,this.subtitlesContainer))}setMaxLength(t){"number"==typeof t&&t&&(this.maxLength=t,this.maxLengthRegexp=new RegExp(`.{1,${t}}(?:\\s|$)`,"g"),this.update())}setHighlightWords(t){this.highlightWords=Boolean(t),this.update()}setFontSize(t){this.fontSize=t;const e=this.subtitlesContainer?.querySelector(".vot-subtitles");e&&(e.style.fontSize=`${this.fontSize}px`)}setOpacity(t){this.opacity=((100-+t)/100).toFixed(2);const e=this.subtitlesContainer?.querySelector(".vot-subtitles");e&&e.style.setProperty("--vot-subtitles-opacity",this.opacity)}update(){if(!this.video||!this.subtitles)return;const t=1e3*this.video.currentTime,e=this.subtitles.subtitles?.findLast((e=>e.startMs{var t={"./src/styles/main.scss":()=>{GM_addStyle('.vot-button{--vot-helper-theme:var(--vot-theme-rgb,var(--vot-primary-rgb,33,150,243));--vot-helper-ontheme:var(--vot-ontheme-rgb,var(--vot-onprimary-rgb,255,255,255));box-sizing:border-box;vertical-align:middle;text-align:center;text-overflow:ellipsis;min-width:64px;height:36px;color:rgb(var(--vot-helper-ontheme));background-color:rgb(var(--vot-helper-theme));font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);cursor:pointer;border:none;border-radius:4px;outline:none;padding:0 16px;font-size:14px;font-weight:500;line-height:36px;transition:box-shadow .2s;display:inline-block;position:relative;box-shadow:0 3px 1px -2px #0003,0 2px 2px #00000024,0 1px 5px #0000001f}.vot-button[hidden]{display:none!important}.vot-button::-moz-focus-inner{border:none}.vot-button:before,.vot-button:after{content:"";border-radius:inherit;opacity:0;position:absolute;top:0;bottom:0;left:0;right:0}.vot-button:before{background-color:rgb(var(--vot-helper-ontheme));transition:opacity .2s}.vot-button:after{background:radial-gradient(circle,currentColor 1%,#0000 1%) 50%/10000% 10000% no-repeat;transition:opacity 1s,background-size .5s}.vot-button:hover{box-shadow:0 2px 4px -1px #0003,0 4px 5px #00000024,0 1px 10px #0000001f}.vot-button:hover:before{opacity:.08}.vot-button:active{box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.vot-button:active:after{opacity:.32;background-size:100% 100%;transition:background-size}.vot-button[disabled=true]{background-color:rgba(var(--vot-onsurface-rgb,0,0,0),.12);color:rgba(var(--vot-onsurface-rgb,0,0,0),.38);box-shadow:none;cursor:initial}.vot-button[disabled=true]:before,.vot-button[disabled=true]:after{opacity:0}.vot-outlined-button{--vot-helper-theme:var(--vot-theme-rgb,var(--vot-primary-rgb,33,150,243));box-sizing:border-box;border:1px solid;border-color:rgba(var(--vot-onsurface-rgb,0,0,0),.24);vertical-align:middle;text-align:center;text-overflow:ellipsis;min-width:64px;height:36px;color:rgb(var(--vot-helper-theme));font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);cursor:pointer;background-color:#0000;border-radius:4px;outline:none;margin:0;padding:0 16px;font-size:14px;font-weight:500;line-height:34px;display:inline-block;position:relative}.vot-outlined-button[hidden]{display:none!important}.vot-outlined-button::-moz-focus-inner{border:none}.vot-outlined-button:before,.vot-outlined-button:after{content:"";opacity:0;border-radius:3px;position:absolute;top:0;bottom:0;left:0;right:0}.vot-outlined-button:before{background-color:rgb(var(--vot-helper-theme));transition:opacity .2s}.vot-outlined-button:after{background:radial-gradient(circle,currentColor 1%,#0000 1%) 50%/10000% 10000% no-repeat;transition:opacity 1s,background-size .5s}.vot-outlined-button:hover:before{opacity:.04}.vot-outlined-button:active:after{opacity:.16;background-size:100% 100%;transition:background-size}.vot-outlined-button[disabled=true]{color:rgba(var(--vot-onsurface-rgb,0,0,0),.38);cursor:initial;background-color:#0000}.vot-outlined-button[disabled=true]:before,.vot-outlined-button[disabled=true]:after{opacity:0}.vot-text-button{--vot-helper-theme:var(--vot-theme-rgb,var(--vot-primary-rgb,33,150,243));box-sizing:border-box;vertical-align:middle;text-align:center;text-overflow:ellipsis;min-width:64px;height:36px;color:rgb(var(--vot-helper-theme));font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);cursor:pointer;background-color:#0000;border:none;border-radius:4px;outline:none;margin:0;padding:0 8px;font-size:14px;font-weight:500;line-height:36px;display:inline-block;position:relative}.vot-text-button[hidden]{display:none!important}.vot-text-button::-moz-focus-inner{border:none}.vot-text-button:before,.vot-text-button:after{content:"";border-radius:inherit;opacity:0;position:absolute;top:0;bottom:0;left:0;right:0}.vot-text-button:before{background-color:rgb(var(--vot-helper-theme));transition:opacity .2s}.vot-text-button:after{background:radial-gradient(circle,currentColor 1%,#0000 1%) 50%/10000% 10000% no-repeat;transition:opacity 1s,background-size .5s}.vot-text-button:hover:before{opacity:.04}.vot-text-button:active:after{opacity:.16;background-size:100% 100%;transition:background-size}.vot-text-button[disabled=true]{color:rgba(var(--vot-onsurface-rgb,0,0,0),.38);cursor:initial;background-color:#0000}.vot-text-button[disabled=true]:before,.vot-text-button[disabled=true]:after{opacity:0}.vot-icon-button{--vot-helper-onsurface:rgba(var(--vot-onsurface-rgb,0,0,0),.87);box-sizing:border-box;vertical-align:middle;text-align:center;text-overflow:ellipsis;width:36px;height:36px;fill:var(--vot-helper-onsurface);color:var(--vot-helper-onsurface);font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);cursor:pointer;background-color:#0000;border:none;border-radius:50%;outline:none;margin:0;padding:0;font-size:14px;font-weight:500;line-height:36px;display:inline-block;position:relative}.vot-icon-button[hidden]{display:none!important}.vot-icon-button::-moz-focus-inner{border:none}.vot-icon-button:before,.vot-icon-button:after{content:"";border-radius:inherit;opacity:0;position:absolute;top:0;bottom:0;left:0;right:0}.vot-icon-button:before{background-color:var(--vot-helper-onsurface);transition:opacity .2s}.vot-icon-button:after{background:radial-gradient(circle,currentColor 1%,#0000 1%) 50%/10000% 10000% no-repeat;transition:opacity .3s,background-size .4s}.vot-icon-button:hover:before{opacity:.04}.vot-icon-button:active:after{opacity:.32;background-size:100% 100%;transition:background-size,opacity}.vot-icon-button[disabled=true]{color:rgba(var(--vot-onsurface-rgb,0,0,0),.38);fill:rgba(var(--vot-onsurface-rgb,0,0,0),.38);cursor:initial;background-color:#0000}.vot-icon-button[disabled=true]:before,.vot-icon-button[disabled=true]:after{opacity:0}.vot-textfield{display:inline-block;--vot-helper-theme:rgb(var(--vot-theme-rgb,var(--vot-primary-rgb,33,150,243)))!important;--vot-helper-safari1:rgba(var(--vot-onsurface-rgb,0,0,0),.38)!important;--vot-helper-safari2:rgba(var(--vot-onsurface-rgb,0,0,0),.6)!important;--vot-helper-safari3:rgba(var(--vot-onsurface-rgb,0,0,0),.87)!important;font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system)!important;text-align:start!important;padding-top:6px!important;font-size:16px!important;line-height:1.5!important;position:relative!important}.vot-textfield[hidden]{display:none!important}.vot-textfield>input,.vot-textfield>textarea{box-sizing:border-box!important;border-style:solid!important;border-width:1px!important;border-color:transparent var(--vot-helper-safari2)var(--vot-helper-safari2)!important;width:100%!important;height:inherit!important;color:rgba(var(--vot-onsurface-rgb,0,0,0),.87)!important;-webkit-text-fill-color:currentColor!important;font-family:inherit!important;font-size:inherit!important;line-height:inherit!important;caret-color:var(--vot-helper-theme)!important;background-color:#0000!important;border-radius:4px!important;margin:0!important;padding:15px 13px!important;transition:border .2s,box-shadow .2s!important;box-shadow:inset 1px 0 #0000,inset -1px 0 #0000,inset 0 -1px #0000!important}.vot-textfield>input:not(:focus):not(.vot-show-placeholer)::-moz-placeholder{color:#0000!important}.vot-textfield>textarea:not(:focus):not(.vot-show-placeholer)::-moz-placeholder{color:#0000!important}.vot-textfield>input:not(:focus):not(.vot-show-placeholer)::-moz-placeholder{color:#0000!important}.vot-textfield>textarea:not(:focus):not(.vot-show-placeholer)::-moz-placeholder{color:#0000!important}.vot-textfield>input:not(:focus):not(.vot-show-placeholer)::-webkit-input-placeholder{color:#0000!important}.vot-textfield>textarea:not(:focus):not(.vot-show-placeholer)::-webkit-input-placeholder{color:#0000!important}.vot-textfield>input:not(:focus):placeholder-shown,.vot-textfield>textarea:not(:focus):placeholder-shown{border-top-color:var(--vot-helper-safari2)!important}.vot-textfield>input+span,.vot-textfield>textarea+span{width:100%!important;max-height:100%!important;color:rgba(var(--vot-onsurface-rgb,0,0,0),.6)!important;cursor:text!important;pointer-events:none!important;font-size:75%!important;line-height:15px!important;transition:color .2s,font-size .2s,line-height .2s!important;display:flex!important;position:absolute!important;top:0!important;left:0!important}.vot-textfield>input:not(:focus):placeholder-shown+span,.vot-textfield>textarea:not(:focus):placeholder-shown+span{font-size:inherit!important;line-height:68px!important}.vot-textfield>input+span:before,.vot-textfield>input+span:after,.vot-textfield>textarea+span:before,.vot-textfield>textarea+span:after{content:""!important;box-sizing:border-box!important;border-top:solid 1px var(--vot-helper-safari2)!important;pointer-events:none!important;min-width:10px!important;height:8px!important;margin-top:6px!important;transition:border .2s,box-shadow .2s!important;display:block!important;box-shadow:inset 0 1px #0000!important}.vot-textfield>input+span:before,.vot-textfield>textarea+span:before{border-left:1px solid #0000!important;border-radius:4px 0!important;margin-right:4px!important}.vot-textfield>input+span:after,.vot-textfield>textarea+span:after{border-right:1px solid #0000!important;border-radius:0 4px!important;flex-grow:1!important;margin-left:4px!important}.vot-textfield>input.vot-show-placeholer+span:before,.vot-textfield>textarea.vot-show-placeholer+span:before{margin-right:0!important}.vot-textfield>input.vot-show-placeholer+span:after,.vot-textfield>textarea.vot-show-placeholer+span:after{margin-left:0!important}.vot-textfield>input:not(:focus):placeholder-shown+span:before,.vot-textfield>input:not(:focus):placeholder-shown+span:after,.vot-textfield>textarea:not(:focus):placeholder-shown+span:before,.vot-textfield>textarea:not(:focus):placeholder-shown+span:after{border-top-color:#0000!important}.vot-textfield:hover>input:not(:disabled),.vot-textfield:hover>textarea:not(:disabled){border-color:transparent var(--vot-helper-safari3)var(--vot-helper-safari3)!important}.vot-textfield:hover>input:not(:disabled)+span:before,.vot-textfield:hover>input:not(:disabled)+span:after,.vot-textfield:hover>textarea:not(:disabled)+span:before,.vot-textfield:hover>textarea:not(:disabled)+span:after{border-top-color:var(--vot-helper-safari3)!important}.vot-textfield:hover>input:not(:disabled):not(:focus):placeholder-shown,.vot-textfield:hover>textarea:not(:disabled):not(:focus):placeholder-shown{border-color:var(--vot-helper-safari3)!important}.vot-textfield>input:focus,.vot-textfield>textarea:focus{border-color:transparent var(--vot-helper-theme)var(--vot-helper-theme)!important;box-shadow:inset 1px 0 var(--vot-helper-theme),inset -1px 0 var(--vot-helper-theme),inset 0 -1px var(--vot-helper-theme)!important;outline:none!important}.vot-textfield>input:focus+span,.vot-textfield>textarea:focus+span{color:var(--vot-helper-theme)!important}.vot-textfield>input:focus+span:before,.vot-textfield>input:focus+span:after,.vot-textfield>textarea:focus+span:before,.vot-textfield>textarea:focus+span:after{border-top-color:var(--vot-helper-theme)!important;box-shadow:inset 0 1px var(--vot-helper-theme)!important}.vot-textfield>input:disabled,.vot-textfield>input:disabled+span,.vot-textfield>textarea:disabled,.vot-textfield>textarea:disabled+span{border-color:transparent var(--vot-helper-safari1)var(--vot-helper-safari1)!important;color:rgba(var(--vot-onsurface-rgb,0,0,0),.38)!important;pointer-events:none!important}.vot-textfield>input:disabled+span:before,.vot-textfield>input:disabled+span:after,.vot-textfield>textarea:disabled+span:before,.vot-textfield>textarea:disabled+span:after,.vot-textfield>input:disabled:placeholder-shown,.vot-textfield>input:disabled:placeholder-shown+span,.vot-textfield>textarea:disabled:placeholder-shown,.vot-textfield>textarea:disabled:placeholder-shown+span{border-top-color:var(--vot-helper-safari1)!important}.vot-textfield>input:disabled:placeholder-shown+span:before,.vot-textfield>input:disabled:placeholder-shown+span:after,.vot-textfield>textarea:disabled:placeholder-shown+span:before,.vot-textfield>textarea:disabled:placeholder-shown+span:after{border-top-color:#0000!important}@media not all and (-webkit-min-device-pixel-ratio:.0000264583),not all and (min-resolution:.001dpcm){@supports ((-webkit-appearance:none)){.vot-textfield>input,.vot-textfield>input+span,.vot-textfield>textarea,.vot-textfield>textarea+span,.vot-textfield>input+span:before,.vot-textfield>input+span:after,.vot-textfield>textarea+span:before,.vot-textfield>textarea+span:after{transition-duration:.1s!important}}}.vot-checkbox{--vot-helper-theme:var(--vot-theme-rgb,var(--vot-primary-rgb,33,150,243));--vot-helper-ontheme:var(--vot-ontheme-rgb,var(--vot-onprimary-rgb,255,255,255));z-index:0;color:rgba(var(--vot-onsurface-rgb,0,0,0),.87);font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);text-align:start;font-size:16px;line-height:1.5;display:inline-block;position:relative}.vot-checkbox-sub{padding-left:16px}.vot-checkbox[hidden]{display:none!important}.vot-checkbox>input{-webkit-appearance:none;appearance:none;z-index:10000;box-sizing:border-box;border:2px solid;border-color:rgba(var(--vot-onsurface-rgb,0,0,0),.6);cursor:pointer;background:0 0;border-radius:2px;outline:none;width:18px;height:18px;margin:3px 1px;padding:0;transition:border-color .2s,background-color .2s;display:block;position:absolute}.vot-checkbox>input+span{box-sizing:border-box;width:inherit;cursor:pointer;padding-left:30px;font-weight:400;display:inline-block;position:relative}.vot-checkbox>input+span:before{content:"";background-color:rgb(var(--vot-onsurface-rgb,0,0,0));opacity:0;pointer-events:none;border-radius:50%;width:40px;height:40px;transition:opacity .3s,transform .2s;display:block;position:absolute;top:-8px;left:-10px;transform:scale(1)}.vot-checkbox>input+span:after{content:"";z-index:10000;pointer-events:none;border:0 solid #0000;border-width:0 0 2px 2px;width:10px;height:5px;transition:border-color .2s;display:block;position:absolute;top:3px;left:1px;transform:translate(3px,4px)rotate(-45deg);box-sizing:content-box!important}.vot-checkbox>input:checked,.vot-checkbox>input:indeterminate{border-color:rgb(var(--vot-helper-theme));background-color:rgb(var(--vot-helper-theme))}.vot-checkbox>input:checked+span:before,.vot-checkbox>input:indeterminate+span:before{background-color:rgb(var(--vot-helper-theme))}.vot-checkbox>input:checked+span:after,.vot-checkbox>input:indeterminate+span:after{border-color:rgb(var(--vot-helper-ontheme,255,255,255))}.vot-checkbox>input:indeterminate+span:after{border-left-width:0;transform:translate(4px,3px)}.vot-checkbox:hover>input+span:before{opacity:.04}.vot-checkbox:active>input,.vot-checkbox:active:hover>input:not(:disabled){border-color:rgb(var(--vot-helper-theme))}.vot-checkbox:active>input:checked{background-color:rgba(var(--vot-onsurface-rgb,0,0,0),.6);border-color:#0000}.vot-checkbox:active>input+span:before{opacity:1;transition:transform,opacity;transform:scale(0)}.vot-checkbox>input:disabled{border-color:rgba(var(--vot-onsurface-rgb,0,0,0),.38);cursor:initial}.vot-checkbox>input:disabled:checked,.vot-checkbox>input:disabled:indeterminate{background-color:rgba(var(--vot-onsurface-rgb,0,0,0),.38);border-color:#0000}.vot-checkbox>input:disabled+span{color:rgba(var(--vot-onsurface-rgb,0,0,0),.38);cursor:initial}.vot-checkbox>input:disabled+span:before{opacity:0;transform:scale(0)}.vot-slider{display:inline-block;--vot-safari-helper1:rgba(var(--vot-primary-rgb,33,150,243),.04)!important;--vot-safari-helper2:rgba(var(--vot-primary-rgb,33,150,243),.12)!important;--vot-safari-helper3:rgba(var(--vot-primary-rgb,33,150,243),.16)!important;--vot-safari-helper4:rgba(var(--vot-primary-rgb,33,150,243),.24)!important;width:100%!important;color:rgba(var(--vot-onsurface-rgb,0,0,0),.87)!important;font-family:var(--vot-font,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system)!important;text-align:start!important;font-size:16px!important;line-height:1.5!important}.vot-slider[hidden]{display:none!important}.vot-slider>input{-webkit-appearance:none!important;appearance:none!important;cursor:pointer!important;background-color:#0000!important;border:none!important;width:100%!important;height:36px!important;margin:0 0 -36px!important;padding:0!important;display:block!important;position:relative!important;top:24px!important}.vot-slider>input:last-child{margin:0!important;position:static!important}.vot-slider>input:before{content:""!important;width:calc(100%*var(--vot-progress,0))!important;background:rgb(var(--vot-primary-rgb,33,150,243))!important;height:2px!important;display:block!important;position:absolute!important;top:calc(50% - 1px)!important}.vot-slider>input:disabled{cursor:default!important;opacity:.38!important}.vot-slider>input:disabled+span{color:rgba(var(--vot-onsurface-rgb,0,0,0),.38)!important}.vot-slider>input:disabled::-webkit-slider-runnable-track{background-color:rgba(var(--vot-onsurface-rgb,0,0,0),.38)!important}.vot-slider>input:disabled::-moz-range-track{background-color:rgba(var(--vot-onsurface-rgb,0,0,0),.38)!important}.vot-slider>input:disabled::-ms-fill-lower{background-color:rgba(var(--vot-onsurface-rgb,0,0,0),.38)!important}.vot-slider>input:disabled::-ms-fill-upper{background-color:rgba(var(--vot-onsurface-rgb,0,0,0),.38)!important}.vot-slider>input:disabled::-moz-range-thumb{background-color:rgb(var(--vot-onsurface-rgb,0,0,0))!important;box-shadow:0 0 0 1px rgb(var(--vot-surface-rgb,255,255,255))!important;transform:scale(4)!important}.vot-slider>input:disabled::-ms-thumb{background-color:rgb(var(--vot-onsurface-rgb,0,0,0))!important;box-shadow:0 0 0 1px rgb(var(--vot-surface-rgb,255,255,255))!important;transform:scale(4)!important}.vot-slider>input:disabled::-webkit-slider-thumb{background-color:rgb(var(--vot-onsurface-rgb,0,0,0))!important;box-shadow:0 0 0 1px rgb(var(--vot-surface-rgb,255,255,255))!important;transform:scale(4)!important}.vot-slider>input:disabled::-ms-fill-upper{opacity:.38!important}.vot-slider>input:disabled::-moz-range-progress{background-color:rgba(var(--vot-onsurface-rgb,0,0,0),.87)!important}.vot-slider>input:disabled:-webkit-slider-thumb{color:rgb(var(--vot-surface-rgb,255,255,255))!important}.vot-slider>input:active::-webkit-slider-thumb{box-shadow:0 0 0 2px var(--vot-safari-helper4)!important}.vot-slider>input:active::-moz-range-thumb{box-shadow:0 0 0 2px rgba(var(--vot-primary-rgb,33,150,243),.24)!important}.vot-slider>input:active::-ms-thumb{box-shadow:0 0 0 2px rgba(var(--vot-primary-rgb,33,150,243),.24)!important}.vot-slider>input:focus{outline:none!important}.vot-slider>input::-webkit-slider-runnable-track{background-color:rgba(var(--vot-primary-rgb,33,150,243),.24)!important;border-radius:1px!important;width:100%!important;height:2px!important;margin:17px 0!important}.vot-slider>input::-moz-range-track{background-color:rgba(var(--vot-primary-rgb,33,150,243),.24)!important;border-radius:1px!important;width:100%!important;height:2px!important;margin:17px 0!important}.vot-slider>input::-ms-track{box-sizing:border-box!important;background-color:#0000!important;border:none!important;border-radius:1px!important;width:100%!important;height:2px!important;margin:17px 0!important;padding:0 17px!important}.vot-slider>input::-webkit-slider-thumb{-webkit-appearance:none!important;appearance:none!important;background-color:rgb(var(--vot-primary-rgb,33,150,243))!important;border:none!important;border-radius:50%!important;width:2px!important;height:2px!important;transition:box-shadow .2s!important;transform:scale(6)!important}.vot-slider>input::-moz-range-thumb{-webkit-appearance:none!important;appearance:none!important;background-color:rgb(var(--vot-primary-rgb,33,150,243))!important;border:none!important;border-radius:50%!important;width:2px!important;height:2px!important;transition:box-shadow .2s!important;transform:scale(6)!important}.vot-slider>input::-ms-thumb{-webkit-appearance:none!important;appearance:none!important;background-color:rgb(var(--vot-primary-rgb,33,150,243))!important;border:none!important;border-radius:50%!important;width:2px!important;height:2px!important;transition:box-shadow .2s!important;transform:scale(6)!important}.vot-slider>input::-webkit-slider-thumb{-webkit-appearance:none!important;margin:0!important}.vot-slider>input::-moz-range-thumb{-moz-appearance:none!important}.vot-slider>input::-ms-thumb{margin:0 17px!important}.vot-slider>input::-moz-range-progress{background-color:rgb(var(--vot-primary-rgb,33,150,243))!important;border-radius:1px!important;height:2px!important}.vot-slider>input::-ms-fill-lower{background-color:rgb(var(--vot-primary-rgb,33,150,243))!important;border-radius:1px!important;height:2px!important}.vot-slider>input::-ms-fill-upper{background-color:rgb(var(--vot-primary-rgb,33,150,243))!important;border-radius:1px!important;height:2px!important}.vot-slider>input::-moz-focus-outer{border:none!important}.vot-slider>span{margin-bottom:36px!important;display:inline-block!important}.vot-slider:hover>input::-webkit-slider-thumb{box-shadow:0 0 0 2px var(--vot-safari-helper1)!important}.vot-slider:hover>input::-ms-thumb{box-shadow:0 0 0 2px rgba(var(--vot-primary-rgb,33,150,243),.04)!important}.vot-slider:hover>input:hover::-moz-range-thumb{box-shadow:0 0 0 2px rgba(var(--vot-primary-rgb,33,150,243),.04)!important}.vot-select{font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);text-align:start;color:var(--vot-helper-theme);fill:var(--vot-helper-theme);justify-content:space-between;align-items:center;font-size:14px;font-weight:400;line-height:1.5;display:flex;--vot-helper-theme-rgb:var(--vot-onsurface-rgb,0,0,0)!important;--vot-helper-theme:rgba(var(--vot-helper-theme-rgb),.87)!important;--vot-helper-safari1:rgba(var(--vot-onsurface-rgb,0,0,0),.6)!important;--vot-helper-safari2:rgba(var(--vot-onsurface-rgb,0,0,0),.87)!important}.vot-select[hidden]{display:none!important}.vot-select-label{font-size:16px}.vot-select-outer{cursor:pointer;justify-content:space-between;align-items:center;width:120px;max-width:120px;padding:0 5px;display:flex;border-style:solid!important;border-width:1px!important;border-color:var(--vot-helper-safari1)!important;border-radius:4px!important;transition:border .2s!important}.vot-select-outer:hover{border-color:var(--vot-helper-safari2)!important}.vot-select-title{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.vot-select-arrow-icon{justify-content:center;align-items:center;width:20px;height:32px;display:flex}.vot-select-content-list{flex-direction:column;display:flex}.vot-select-content-list .vot-select-content-item{cursor:pointer;border-radius:8px;padding:5px 10px}.vot-select-content-list .vot-select-content-item:not([inert]):hover{background-color:#2a2c31}.vot-select-content-list .vot-select-content-item[data-vot-selected=true]{color:rgb(var(--vot-primary-rgb,33,150,243));background-color:rgba(var(--vot-primary-rgb,33,150,243),.2)}.vot-select-content-list .vot-select-content-item[data-vot-selected=true]:hover{background-color:rgba(var(--vot-primary-rgb,33,150,243),.1)!important}.vot-select-content-list .vot-select-content-item[data-vot-disabled=true]{cursor:default}.vot-select-content-list .vot-select-content-item[hidden]{display:none!important}.vot-header{color:rgba(var(--vot-helper-onsurface-rgb),.87);font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);text-align:start;font-weight:700;line-height:1.5}.vot-header[hidden]{display:none!important}.vot-header:not(:first-child){padding-top:8px}.vot-header-level-1{font-size:2em}.vot-header-level-2{font-size:1.5em}.vot-header-level-3{font-size:1.17em}.vot-header-level-4{font-size:1em}.vot-header-level-5{font-size:.83em}.vot-header-level-6{font-size:.67em}.vot-info{color:rgba(var(--vot-helper-onsurface-rgb),.87);font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);text-align:start;-webkit-user-select:text;user-select:text;font-size:16px;line-height:1.5;display:flex}.vot-info[hidden]{display:none!important}.vot-info>:not(:first-child){color:rgba(var(--vot-helper-onsurface-rgb),.5);flex:1;margin-left:8px}.vot-details{color:rgba(var(--vot-helper-onsurface-rgb),.87);font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);text-align:start;cursor:pointer;border-radius:.5em;justify-content:space-between;align-items:center;margin:0 -.5em;padding:.5em;font-size:16px;line-height:1.5;transition:background .5s;display:flex}.vot-details[hidden]{display:none!important}.vot-details-arrow-icon{width:20px;height:32px;fill:rgba(var(--vot-helper-onsurface-rgb),.87);justify-content:center;align-items:center;display:flex;transform:scale(1.25)rotate(-90deg)}.vot-details:hover{background:rgba(var(--vot-onsurface-rgb,0,0,0),.04)}.vot-lang-select{--vot-helper-theme-rgb:var(--vot-onsurface-rgb,0,0,0);--vot-helper-theme:rgba(var(--vot-helper-theme-rgb),.87);color:var(--vot-helper-theme);fill:var(--vot-helper-theme);justify-content:space-between;align-items:center;display:flex}.vot-lang-select[hidden]{display:none!important}.vot-lang-select-icon{justify-content:center;align-items:center;width:32px;height:32px;display:flex}.vot-segmented-button{--vot-helper-theme-rgb:var(--vot-onsurface-rgb,0,0,0);--vot-helper-theme:rgba(var(--vot-helper-theme-rgb),.87);-webkit-user-select:none;user-select:none;background:rgb(var(--vot-surface-rgb,255,255,255));max-width:100vw;height:32px;color:var(--vot-helper-theme);fill:var(--vot-helper-theme);font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);cursor:default;z-index:2147483647;border-radius:4px;align-items:center;font-size:16px;line-height:1.5;transition:opacity .5s;display:flex;position:absolute;top:5rem;left:50%;overflow:hidden;transform:translate(-50%)}.vot-segmented-button[hidden]{display:none!important}.vot-segmented-button *{box-sizing:border-box!important}.vot-segmented-button .vot-separator{background:rgba(var(--vot-helper-theme-rgb),.1);width:1px;height:50%}.vot-segmented-button .vot-separator[hidden]{display:none!important}.vot-segmented-button .vot-segment,.vot-segmented-button .vot-segment-only-icon{height:100%;color:inherit;background-color:#0000;border:none;justify-content:center;align-items:center;padding:0 8px;transition:background-color .1s ease-in-out;display:flex;position:relative;overflow:hidden}.vot-segmented-button .vot-segment[hidden],.vot-segmented-button [hidden].vot-segment-only-icon{display:none!important}.vot-segmented-button .vot-segment:before,.vot-segmented-button .vot-segment-only-icon:before,.vot-segmented-button .vot-segment:after,.vot-segmented-button .vot-segment-only-icon:after{content:"";border-radius:inherit;opacity:0;position:absolute;top:0;bottom:0;left:0;right:0}.vot-segmented-button .vot-segment:before,.vot-segmented-button .vot-segment-only-icon:before{background-color:rgb(var(--vot-helper-theme-rgb));transition:opacity .2s}.vot-segmented-button .vot-segment:after,.vot-segmented-button .vot-segment-only-icon:after{background:radial-gradient(circle,currentColor 1%,#0000 1%) 50%/10000% 10000% no-repeat;transition:opacity 1s,background-size .5s}.vot-segmented-button .vot-segment:hover:before,.vot-segmented-button .vot-segment-only-icon:hover:before{opacity:.04}.vot-segmented-button .vot-segment:active:after,.vot-segmented-button .vot-segment-only-icon:active:after{opacity:.16;background-size:100% 100%;transition:background-size}.vot-segmented-button .vot-segment-only-icon{min-width:32px;padding:0}.vot-segmented-button .vot-segment-label{white-space:nowrap;color:inherit;margin-left:8px;font-weight:400}.vot-segmented-button[data-status=success] .vot-translate-button{color:rgb(var(--vot-primary-rgb,33,150,243));fill:rgb(var(--vot-primary-rgb,33,150,243))}.vot-segmented-button[data-status=error] .vot-translate-button{color:#f28b82;fill:#f28b82}.vot-segmented-button[data-loading=true] #vot-loading-icon{display:block!important}.vot-segmented-button[data-loading=true] #vot-translate-icon{display:none!important}.vot-segmented-button[data-direction=column]{flex-direction:column;height:fit-content}.vot-segmented-button[data-direction=column] .vot-segment-label{display:none}.vot-segmented-button[data-direction=column]>.vot-segment-only-icon,.vot-segmented-button[data-direction=column]>.vot-segment{padding:8px}.vot-segmented-button[data-direction=column] .vot-separator{width:50%;height:1px}.vot-segmented-button[data-position=left]{top:12.5vh;left:50px}.vot-segmented-button[data-position=right]{top:12.5vh;left:auto;right:0}.vot-segmented-button svg{width:24px}.vot-menu{--vot-helper-surface-rgb:var(--vot-surface-rgb,255,255,255);--vot-helper-surface:rgb(var(--vot-helper-surface-rgb));--vot-helper-onsurface-rgb:var(--vot-onsurface-rgb,0,0,0);--vot-helper-onsurface:rgba(var(--vot-helper-onsurface-rgb),.87);-webkit-user-select:none;user-select:none;background-color:var(--vot-helper-surface);color:var(--vot-helper-onsurface);font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);cursor:default;z-index:2147483647;visibility:visible;opacity:1;transform-origin:top;border-radius:8px;min-width:300px;font-size:16px;line-height:1.5;transition:opacity .3s,transform .1s;position:absolute;top:calc(5rem + 48px);left:50%;overflow:hidden;transform:translate(-50%)scale(1)}.vot-menu *{box-sizing:border-box!important}.vot-menu[hidden]{pointer-events:none;visibility:hidden;opacity:0;transform:translate(-50%)scale(0);display:block!important}.vot-menu-content-wrapper{min-height:100px;max-height:calc(var(--vot-container-height,75vh) - (5rem + 32px + 16px)*2);flex-direction:column;display:flex;overflow:auto}.vot-menu-header-container{flex-shrink:0;align-items:flex-start;min-height:31px;display:flex}.vot-menu-header-container:empty{padding:0 0 16px}.vot-menu-header-container>.vot-icon-button{margin-inline-end:4px;margin-top:4px}.vot-menu-title-container{font-size:inherit;font-weight:inherit;text-align:start;outline:0;flex:1;margin:0;display:flex}.vot-menu-title{padding-bottom:16px;padding-inline-start:16px;padding-inline-end:16px;flex:1;padding-top:16px;font-size:16px;font-weight:400;line-height:1}.vot-menu-body-container{box-sizing:border-box;overscroll-behavior:contain;flex-direction:column;gap:8px;min-height:1.375rem;padding:0 16px;display:flex;overflow:auto;scrollbar-color:rgba(var(--vot-helper-onsurface-rgb),.1)var(--vot-helper-surface)!important}.vot-menu-body-container::-webkit-scrollbar{background:var(--vot-helper-surface)!important;width:12px!important;height:12px!important}.vot-menu-body-container::-webkit-scrollbar-track{background:var(--vot-helper-surface)!important;width:12px!important;height:12px!important}.vot-menu-body-container::-webkit-scrollbar-thumb{background:rgba(var(--vot-helper-onsurface-rgb),.1)!important;border:5px solid var(--vot-helper-surface)!important;-webkit-border-radius:1ex!important}.vot-menu-body-container::-webkit-scrollbar-thumb:hover{border:3px solid var(--vot-helper-surface)!important}.vot-menu-body-container::-webkit-scrollbar-corner{background:var(--vot-helper-surface)!important}.vot-menu-footer-container{padding-bottom:16px;padding-inline-start:16px;padding-inline-end:16px;flex-shrink:0;justify-content:flex-end;padding-top:16px;display:flex}.vot-menu-footer-container:empty{padding:16px 0 0}.vot-menu[data-position=left]{top:12.5vh;left:240px}.vot-menu[data-position=right]{top:12.5vh;left:auto;right:-80px}.vot-dialog{--vot-helper-surface-rgb:var(--vot-surface-rgb,255,255,255);--vot-helper-surface:rgb(var(--vot-helper-surface-rgb));--vot-helper-onsurface-rgb:var(--vot-onsurface-rgb,0,0,0);--vot-helper-onsurface:rgba(var(--vot-helper-onsurface-rgb),.87);max-width:initial;max-height:initial;width:min(var(--vot-dialog-width,512px),100%);top:50%;bottom:50%;background-color:var(--vot-helper-surface);height:fit-content;color:var(--vot-helper-onsurface);font-family:var(--vot-font-family,"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system);-webkit-user-select:none;user-select:none;visibility:visible;opacity:1;transform-origin:50%;border-radius:8px;margin:auto;padding:0;font-size:16px;line-height:1.5;transition:opacity .3s,transform .1s;display:block;position:fixed;top:0;bottom:0;left:0;right:0;overflow-x:auto;overflow-y:hidden;transform:scale(1);box-shadow:0 0 16px #0000001f,0 16px 16px #0000003d}[hidden]>.vot-dialog{pointer-events:none;opacity:0;transition:opacity .1s,transform .2s;transform:scale(.5)}.vot-dialog-container{visibility:visible;z-index:2147483647;position:absolute}.vot-dialog-container[hidden]{pointer-events:none;visibility:hidden;display:block!important}.vot-dialog-container *{box-sizing:border-box!important}.vot-dialog-backdrop{opacity:1;background-color:#0009;transition:opacity .3s;position:fixed;top:0;bottom:0;left:0;right:0}[hidden]>.vot-dialog-backdrop{pointer-events:none;opacity:0}.vot-dialog-content-wrapper{flex-direction:column;max-height:75vh;display:flex;overflow:auto}.vot-dialog-header-container{flex-shrink:0;align-items:flex-start;min-height:31px;display:flex}.vot-dialog-header-container:empty{padding:0 0 20px}.vot-dialog-header-container>.vot-icon-button{margin-inline-end:4px;margin-top:4px}.vot-dialog-title-container{font-size:inherit;font-weight:inherit;outline:0;flex:1;margin:0;display:flex}.vot-dialog-title{padding-bottom:16px;padding-inline-start:20px;padding-inline-end:20px;flex:1;padding-top:20px;font-size:115.385%;font-weight:700;line-height:1}.vot-dialog-body-container{box-sizing:border-box;overscroll-behavior:contain;flex-direction:column;gap:16px;min-height:1.375rem;padding:0 20px;display:flex;overflow:auto;scrollbar-color:rgba(var(--vot-helper-onsurface-rgb),.1)var(--vot-helper-surface)!important}.vot-dialog-body-container::-webkit-scrollbar{background:var(--vot-helper-surface)!important;width:12px!important;height:12px!important}.vot-dialog-body-container::-webkit-scrollbar-track{background:var(--vot-helper-surface)!important;width:12px!important;height:12px!important}.vot-dialog-body-container::-webkit-scrollbar-thumb{background:rgba(var(--vot-helper-onsurface-rgb),.1)!important;border:5px solid var(--vot-helper-surface)!important;-webkit-border-radius:1ex!important}.vot-dialog-body-container::-webkit-scrollbar-thumb:hover{border:3px solid var(--vot-helper-surface)!important}.vot-dialog-body-container::-webkit-scrollbar-corner{background:var(--vot-helper-surface)!important}.vot-dialog-footer-container{padding-bottom:16px;padding-inline-start:16px;padding-inline-end:16px;flex-shrink:0;justify-content:flex-end;padding-top:16px;display:flex}.vot-dialog-footer-container:empty{padding:20px 0 0}.vot-subtitles-widget{z-index:2147483647;pointer-events:none;justify-content:center;align-items:center;width:50%;min-height:20%;max-height:100%;display:flex;position:absolute;top:75%;left:25%}.vot-subtitles{--vot-subtitles-background:rgba(var(--vot-surface-rgb,46,47,52),var(--vot-subtitles-opacity,.8));background:var(--vot-subtitles-background,#2e2f34cc);width:max-content;max-width:100%;max-height:100%;color:var(--vot-subtitles-color,#e3e3e3);pointer-events:all;box-sizing:border-box;-webkit-user-select:none;user-select:none;border-radius:.5em;padding:.5em;font-size:20px;line-height:normal;position:relative}.vot-subtitles span{-webkit-user-select:text;user-select:text;font-size:inherit!important;line-height:normal!important}.vot-subtitles .passed{color:var(--vot-subtitles-passed-color,#2196f3)}:root{--vot-font-family:"Roboto","Segoe UI",BlinkMacSystemFont,system-ui,-apple-system;--vot-primary-rgb:139,180,245;--vot-onprimary-rgb:32,33,36;--vot-surface-rgb:32,33,36;--vot-onsurface-rgb:227,227,227;--vot-subtitles-color:rgb(var(--vot-onsurface-rgb,227,227,227));--vot-subtitles-passed-color:rgb(var(--vot-primary-rgb,33,150,243))}vot-block{display:block;visibility:visible!important}')},"./node_modules/bowser/es5.js":function(t){t.exports=function(t){var e={};function o(i){if(e[i])return e[i].exports;var a=e[i]={i,l:!1,exports:{}};return t[i].call(a.exports,a,a.exports,o),a.l=!0,a.exports}return o.m=t,o.c=e,o.d=function(t,e,i){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(o.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)o.d(i,a,function(e){return t[e]}.bind(null,a));return i},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=90)}({17:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var i=o(18),a=function(){function t(){}return t.getFirstMatch=function(t,e){var o=e.match(t);return o&&o.length>0&&o[1]||""},t.getSecondMatch=function(t,e){var o=e.match(t);return o&&o.length>1&&o[2]||""},t.matchAndReturnConst=function(t,e,o){if(t.test(e))return o},t.getWindowsVersionName=function(t){switch(t){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},t.getMacOSVersionName=function(t){var e=t.split(".").splice(0,2).map((function(t){return parseInt(t,10)||0}));if(e.push(0),10===e[0])switch(e[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},t.getAndroidVersionName=function(t){var e=t.split(".").splice(0,2).map((function(t){return parseInt(t,10)||0}));if(e.push(0),!(1===e[0]&&e[1]<5))return 1===e[0]&&e[1]<6?"Cupcake":1===e[0]&&e[1]>=6?"Donut":2===e[0]&&e[1]<2?"Eclair":2===e[0]&&2===e[1]?"Froyo":2===e[0]&&e[1]>2?"Gingerbread":3===e[0]?"Honeycomb":4===e[0]&&e[1]<1?"Ice Cream Sandwich":4===e[0]&&e[1]<4?"Jelly Bean":4===e[0]&&e[1]>=4?"KitKat":5===e[0]?"Lollipop":6===e[0]?"Marshmallow":7===e[0]?"Nougat":8===e[0]?"Oreo":9===e[0]?"Pie":void 0},t.getVersionPrecision=function(t){return t.split(".").length},t.compareVersions=function(e,o,i){void 0===i&&(i=!1);var a=t.getVersionPrecision(e),n=t.getVersionPrecision(o),r=Math.max(a,n),s=0,l=t.map([e,o],(function(e){var o=r-t.getVersionPrecision(e),i=e+new Array(o+1).join(".0");return t.map(i.split("."),(function(t){return new Array(20-t.length).join("0")+t})).reverse()}));for(i&&(s=r-Math.min(a,n)),r-=1;r>=s;){if(l[0][r]>l[1][r])return 1;if(l[0][r]===l[1][r]){if(r===s)return 0;r-=1}else if(l[0][r]1?a-1:0),r=1;r0){var r=Object.keys(o),l=s.default.find(r,(function(t){return e.isOS(t)}));if(l){var d=this.satisfies(o[l]);if(void 0!==d)return d}var u=s.default.find(r,(function(t){return e.isPlatform(t)}));if(u){var c=this.satisfies(o[u]);if(void 0!==c)return c}}if(n>0){var h=Object.keys(a),p=s.default.find(h,(function(t){return e.isBrowser(t,!0)}));if(void 0!==p)return this.compareVersion(a[p])}},e.isBrowser=function(t,e){void 0===e&&(e=!1);var o=this.getBrowserName().toLowerCase(),i=t.toLowerCase(),a=s.default.getBrowserTypeByAlias(i);return e&&a&&(i=a.toLowerCase()),i===o},e.compareVersion=function(t){var e=[0],o=t,i=!1,a=this.getBrowserVersion();if("string"==typeof a)return">"===t[0]||"<"===t[0]?(o=t.substr(1),"="===t[1]?(i=!0,o=t.substr(2)):e=[],">"===t[0]?e.push(1):e.push(-1)):"="===t[0]?o=t.substr(1):"~"===t[0]&&(i=!0,o=t.substr(1)),e.indexOf(s.default.compareVersions(a,o,i))>-1},e.isOS=function(t){return this.getOSName(!0)===String(t).toLowerCase()},e.isPlatform=function(t){return this.getPlatformType(!0)===String(t).toLowerCase()},e.isEngine=function(t){return this.getEngineName(!0)===String(t).toLowerCase()},e.is=function(t,e){return void 0===e&&(e=!1),this.isBrowser(t,e)||this.isOS(t)||this.isPlatform(t)},e.some=function(t){var e=this;return void 0===t&&(t=[]),t.some((function(t){return e.is(t)}))},t}();e.default=d,t.exports=e.default},92:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var i,a=(i=o(17))&&i.__esModule?i:{default:i},n=/version\/(\d+(\.?_?\d+)+)/i,r=[{test:[/googlebot/i],describe:function(t){var e={name:"Googlebot"},o=a.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,t)||a.default.getFirstMatch(n,t);return o&&(e.version=o),e}},{test:[/opera/i],describe:function(t){var e={name:"Opera"},o=a.default.getFirstMatch(n,t)||a.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/opr\/|opios/i],describe:function(t){var e={name:"Opera"},o=a.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,t)||a.default.getFirstMatch(n,t);return o&&(e.version=o),e}},{test:[/SamsungBrowser/i],describe:function(t){var e={name:"Samsung Internet for Android"},o=a.default.getFirstMatch(n,t)||a.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/Whale/i],describe:function(t){var e={name:"NAVER Whale Browser"},o=a.default.getFirstMatch(n,t)||a.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/MZBrowser/i],describe:function(t){var e={name:"MZ Browser"},o=a.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,t)||a.default.getFirstMatch(n,t);return o&&(e.version=o),e}},{test:[/focus/i],describe:function(t){var e={name:"Focus"},o=a.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,t)||a.default.getFirstMatch(n,t);return o&&(e.version=o),e}},{test:[/swing/i],describe:function(t){var e={name:"Swing"},o=a.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,t)||a.default.getFirstMatch(n,t);return o&&(e.version=o),e}},{test:[/coast/i],describe:function(t){var e={name:"Opera Coast"},o=a.default.getFirstMatch(n,t)||a.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(t){var e={name:"Opera Touch"},o=a.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(n,t);return o&&(e.version=o),e}},{test:[/yabrowser/i],describe:function(t){var e={name:"Yandex Browser"},o=a.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(n,t);return o&&(e.version=o),e}},{test:[/ucbrowser/i],describe:function(t){var e={name:"UC Browser"},o=a.default.getFirstMatch(n,t)||a.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/Maxthon|mxios/i],describe:function(t){var e={name:"Maxthon"},o=a.default.getFirstMatch(n,t)||a.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/epiphany/i],describe:function(t){var e={name:"Epiphany"},o=a.default.getFirstMatch(n,t)||a.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/puffin/i],describe:function(t){var e={name:"Puffin"},o=a.default.getFirstMatch(n,t)||a.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/sleipnir/i],describe:function(t){var e={name:"Sleipnir"},o=a.default.getFirstMatch(n,t)||a.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/k-meleon/i],describe:function(t){var e={name:"K-Meleon"},o=a.default.getFirstMatch(n,t)||a.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/micromessenger/i],describe:function(t){var e={name:"WeChat"},o=a.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(n,t);return o&&(e.version=o),e}},{test:[/qqbrowser/i],describe:function(t){var e={name:/qqbrowserlite/i.test(t)?"QQ Browser Lite":"QQ Browser"},o=a.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(n,t);return o&&(e.version=o),e}},{test:[/msie|trident/i],describe:function(t){var e={name:"Internet Explorer"},o=a.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/\sedg\//i],describe:function(t){var e={name:"Microsoft Edge"},o=a.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/edg([ea]|ios)/i],describe:function(t){var e={name:"Microsoft Edge"},o=a.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/vivaldi/i],describe:function(t){var e={name:"Vivaldi"},o=a.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/seamonkey/i],describe:function(t){var e={name:"SeaMonkey"},o=a.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/sailfish/i],describe:function(t){var e={name:"Sailfish"},o=a.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,t);return o&&(e.version=o),e}},{test:[/silk/i],describe:function(t){var e={name:"Amazon Silk"},o=a.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/phantom/i],describe:function(t){var e={name:"PhantomJS"},o=a.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/slimerjs/i],describe:function(t){var e={name:"SlimerJS"},o=a.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(t){var e={name:"BlackBerry"},o=a.default.getFirstMatch(n,t)||a.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/(web|hpw)[o0]s/i],describe:function(t){var e={name:"WebOS Browser"},o=a.default.getFirstMatch(n,t)||a.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/bada/i],describe:function(t){var e={name:"Bada"},o=a.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/tizen/i],describe:function(t){var e={name:"Tizen"},o=a.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(n,t);return o&&(e.version=o),e}},{test:[/qupzilla/i],describe:function(t){var e={name:"QupZilla"},o=a.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(n,t);return o&&(e.version=o),e}},{test:[/firefox|iceweasel|fxios/i],describe:function(t){var e={name:"Firefox"},o=a.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/electron/i],describe:function(t){var e={name:"Electron"},o=a.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/MiuiBrowser/i],describe:function(t){var e={name:"Miui"},o=a.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/chromium/i],describe:function(t){var e={name:"Chromium"},o=a.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,t)||a.default.getFirstMatch(n,t);return o&&(e.version=o),e}},{test:[/chrome|crios|crmo/i],describe:function(t){var e={name:"Chrome"},o=a.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/GSA/i],describe:function(t){var e={name:"Google Search"},o=a.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:function(t){var e=!t.test(/like android/i),o=t.test(/android/i);return e&&o},describe:function(t){var e={name:"Android Browser"},o=a.default.getFirstMatch(n,t);return o&&(e.version=o),e}},{test:[/playstation 4/i],describe:function(t){var e={name:"PlayStation 4"},o=a.default.getFirstMatch(n,t);return o&&(e.version=o),e}},{test:[/safari|applewebkit/i],describe:function(t){var e={name:"Safari"},o=a.default.getFirstMatch(n,t);return o&&(e.version=o),e}},{test:[/.*/i],describe:function(t){var e=-1!==t.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:a.default.getFirstMatch(e,t),version:a.default.getSecondMatch(e,t)}}}];e.default=r,t.exports=e.default},93:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var i,a=(i=o(17))&&i.__esModule?i:{default:i},n=o(18),r=[{test:[/Roku\/DVP/],describe:function(t){var e=a.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,t);return{name:n.OS_MAP.Roku,version:e}}},{test:[/windows phone/i],describe:function(t){var e=a.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,t);return{name:n.OS_MAP.WindowsPhone,version:e}}},{test:[/windows /i],describe:function(t){var e=a.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,t),o=a.default.getWindowsVersionName(e);return{name:n.OS_MAP.Windows,version:e,versionName:o}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(t){var e={name:n.OS_MAP.iOS},o=a.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,t);return o&&(e.version=o),e}},{test:[/macintosh/i],describe:function(t){var e=a.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,t).replace(/[_\s]/g,"."),o=a.default.getMacOSVersionName(e),i={name:n.OS_MAP.MacOS,version:e};return o&&(i.versionName=o),i}},{test:[/(ipod|iphone|ipad)/i],describe:function(t){var e=a.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,t).replace(/[_\s]/g,".");return{name:n.OS_MAP.iOS,version:e}}},{test:function(t){var e=!t.test(/like android/i),o=t.test(/android/i);return e&&o},describe:function(t){var e=a.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,t),o=a.default.getAndroidVersionName(e),i={name:n.OS_MAP.Android,version:e};return o&&(i.versionName=o),i}},{test:[/(web|hpw)[o0]s/i],describe:function(t){var e=a.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,t),o={name:n.OS_MAP.WebOS};return e&&e.length&&(o.version=e),o}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(t){var e=a.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,t)||a.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,t)||a.default.getFirstMatch(/\bbb(\d+)/i,t);return{name:n.OS_MAP.BlackBerry,version:e}}},{test:[/bada/i],describe:function(t){var e=a.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,t);return{name:n.OS_MAP.Bada,version:e}}},{test:[/tizen/i],describe:function(t){var e=a.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,t);return{name:n.OS_MAP.Tizen,version:e}}},{test:[/linux/i],describe:function(){return{name:n.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:n.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(t){var e=a.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,t);return{name:n.OS_MAP.PlayStation4,version:e}}}];e.default=r,t.exports=e.default},94:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var i,a=(i=o(17))&&i.__esModule?i:{default:i},n=o(18),r=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(t){var e=a.default.getFirstMatch(/(can-l01)/i,t)&&"Nova",o={type:n.PLATFORMS_MAP.mobile,vendor:"Huawei"};return e&&(o.model=e),o}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:n.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:n.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:n.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:n.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:n.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:n.PLATFORMS_MAP.tablet}}},{test:function(t){var e=t.test(/ipod|iphone/i),o=t.test(/like (ipod|iphone)/i);return e&&!o},describe:function(t){var e=a.default.getFirstMatch(/(ipod|iphone)/i,t);return{type:n.PLATFORMS_MAP.mobile,vendor:"Apple",model:e}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:n.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:n.PLATFORMS_MAP.mobile}}},{test:function(t){return"blackberry"===t.getBrowserName(!0)},describe:function(){return{type:n.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(t){return"bada"===t.getBrowserName(!0)},describe:function(){return{type:n.PLATFORMS_MAP.mobile}}},{test:function(t){return"windows phone"===t.getBrowserName()},describe:function(){return{type:n.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(t){var e=Number(String(t.getOSVersion()).split(".")[0]);return"android"===t.getOSName(!0)&&e>=3},describe:function(){return{type:n.PLATFORMS_MAP.tablet}}},{test:function(t){return"android"===t.getOSName(!0)},describe:function(){return{type:n.PLATFORMS_MAP.mobile}}},{test:function(t){return"macos"===t.getOSName(!0)},describe:function(){return{type:n.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(t){return"windows"===t.getOSName(!0)},describe:function(){return{type:n.PLATFORMS_MAP.desktop}}},{test:function(t){return"linux"===t.getOSName(!0)},describe:function(){return{type:n.PLATFORMS_MAP.desktop}}},{test:function(t){return"playstation 4"===t.getOSName(!0)},describe:function(){return{type:n.PLATFORMS_MAP.tv}}},{test:function(t){return"roku"===t.getOSName(!0)},describe:function(){return{type:n.PLATFORMS_MAP.tv}}}];e.default=r,t.exports=e.default},95:function(t,e,o){"use strict";e.__esModule=!0,e.default=void 0;var i,a=(i=o(17))&&i.__esModule?i:{default:i},n=o(18),r=[{test:function(t){return"microsoft edge"===t.getBrowserName(!0)},describe:function(t){if(/\sedg\//i.test(t))return{name:n.ENGINE_MAP.Blink};var e=a.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,t);return{name:n.ENGINE_MAP.EdgeHTML,version:e}}},{test:[/trident/i],describe:function(t){var e={name:n.ENGINE_MAP.Trident},o=a.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:function(t){return t.test(/presto/i)},describe:function(t){var e={name:n.ENGINE_MAP.Presto},o=a.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:function(t){var e=t.test(/gecko/i),o=t.test(/like gecko/i);return e&&!o},describe:function(t){var e={name:n.ENGINE_MAP.Gecko},o=a.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:n.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(t){var e={name:n.ENGINE_MAP.WebKit},o=a.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,t);return o&&(e.version=o),e}}];e.default=r,t.exports=e.default}})},"./node_modules/requestidlecallback-polyfill/index.js":()=>{window.requestIdleCallback=window.requestIdleCallback||function(t){var e=Date.now();return setTimeout((function(){t({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-e))}})}),1)},window.cancelIdleCallback=window.cancelIdleCallback||function(t){clearTimeout(t)}}},e={};function o(i){var a=e[i];if(void 0!==a)return a.exports;var n=e[i]={exports:{}};return t[i].call(n.exports,n,n.exports,o),n.exports}(()=>{"use strict";var t=o("./node_modules/bowser/es5.js");const e=protobuf;var i;function a(t){switch(t){case 0:case"NO_CONNECTION":return i.NO_CONNECTION;case 10:case"TRANSLATING":return i.TRANSLATING;case 20:case"STREAMING":return i.STREAMING;default:return i.UNRECOGNIZED}}!function(t){t[t.NO_CONNECTION=0]="NO_CONNECTION",t[t.TRANSLATING=10]="TRANSLATING",t[t.STREAMING=20]="STREAMING",t[t.UNRECOGNIZED=-1]="UNRECOGNIZED"}(i||(i={}));const n={encode:(t,o=e.Writer.create())=>(""!==t.target&&o.uint32(10).string(t.target),""!==t.targetUrl&&o.uint32(18).string(t.targetUrl),o),decode(t,o){const i=t instanceof e.Reader?t:e.Reader.create(t);let a=void 0===o?i.len:i.pos+o;const n={target:"",targetUrl:""};for(;i.pos>>3){case 1:if(10!==t)break;n.target=i.string();continue;case 2:if(18!==t)break;n.targetUrl=i.string();continue}if(4==(7&t)||0===t)break;i.skipType(7&t)}return n},fromJSON:t=>({target:x(t.target)?globalThis.String(t.target):"",targetUrl:x(t.targetUrl)?globalThis.String(t.targetUrl):""}),toJSON(t){const e={};return""!==t.target&&(e.target=t.target),""!==t.targetUrl&&(e.targetUrl=t.targetUrl),e},create:t=>n.fromPartial(t??{}),fromPartial(t){const e={target:"",targetUrl:""};return e.target=t.target??"",e.targetUrl=t.targetUrl??"",e}};const r={encode(t,o=e.Writer.create()){""!==t.url&&o.uint32(26).string(t.url),void 0!==t.deviceId&&o.uint32(34).string(t.deviceId),!1!==t.firstRequest&&o.uint32(40).bool(t.firstRequest),0!==t.duration&&o.uint32(49).double(t.duration),0!==t.unknown0&&o.uint32(56).int32(t.unknown0),""!==t.language&&o.uint32(66).string(t.language),!1!==t.forceSourceLang&&o.uint32(72).bool(t.forceSourceLang),0!==t.unknown1&&o.uint32(80).int32(t.unknown1);for(const e of t.translationHelp)n.encode(e,o.uint32(90).fork()).ldelim();return""!==t.responseLanguage&&o.uint32(114).string(t.responseLanguage),0!==t.unknown2&&o.uint32(120).int32(t.unknown2),0!==t.unknown3&&o.uint32(128).int32(t.unknown3),!1!==t.bypassCache&&o.uint32(136).bool(t.bypassCache),!1!==t.useNewModel&&o.uint32(144).bool(t.useNewModel),o},decode(t,o){const i=t instanceof e.Reader?t:e.Reader.create(t);let a=void 0===o?i.len:i.pos+o;const r={url:"",deviceId:void 0,firstRequest:!1,duration:0,unknown0:0,language:"",forceSourceLang:!1,unknown1:0,translationHelp:[],responseLanguage:"",unknown2:0,unknown3:0,bypassCache:!1,useNewModel:!1};for(;i.pos>>3){case 3:if(26!==t)break;r.url=i.string();continue;case 4:if(34!==t)break;r.deviceId=i.string();continue;case 5:if(40!==t)break;r.firstRequest=i.bool();continue;case 6:if(49!==t)break;r.duration=i.double();continue;case 7:if(56!==t)break;r.unknown0=i.int32();continue;case 8:if(66!==t)break;r.language=i.string();continue;case 9:if(72!==t)break;r.forceSourceLang=i.bool();continue;case 10:if(80!==t)break;r.unknown1=i.int32();continue;case 11:if(90!==t)break;r.translationHelp.push(n.decode(i,i.uint32()));continue;case 14:if(114!==t)break;r.responseLanguage=i.string();continue;case 15:if(120!==t)break;r.unknown2=i.int32();continue;case 16:if(128!==t)break;r.unknown3=i.int32();continue;case 17:if(136!==t)break;r.bypassCache=i.bool();continue;case 18:if(144!==t)break;r.useNewModel=i.bool();continue}if(4==(7&t)||0===t)break;i.skipType(7&t)}return r},fromJSON:t=>({url:x(t.url)?globalThis.String(t.url):"",deviceId:x(t.deviceId)?globalThis.String(t.deviceId):void 0,firstRequest:!!x(t.firstRequest)&&globalThis.Boolean(t.firstRequest),duration:x(t.duration)?globalThis.Number(t.duration):0,unknown0:x(t.unknown0)?globalThis.Number(t.unknown0):0,language:x(t.language)?globalThis.String(t.language):"",forceSourceLang:!!x(t.forceSourceLang)&&globalThis.Boolean(t.forceSourceLang),unknown1:x(t.unknown1)?globalThis.Number(t.unknown1):0,translationHelp:globalThis.Array.isArray(t?.translationHelp)?t.translationHelp.map((t=>n.fromJSON(t))):[],responseLanguage:x(t.responseLanguage)?globalThis.String(t.responseLanguage):"",unknown2:x(t.unknown2)?globalThis.Number(t.unknown2):0,unknown3:x(t.unknown3)?globalThis.Number(t.unknown3):0,bypassCache:!!x(t.bypassCache)&&globalThis.Boolean(t.bypassCache),useNewModel:!!x(t.useNewModel)&&globalThis.Boolean(t.useNewModel)}),toJSON(t){const e={};return""!==t.url&&(e.url=t.url),void 0!==t.deviceId&&(e.deviceId=t.deviceId),!1!==t.firstRequest&&(e.firstRequest=t.firstRequest),0!==t.duration&&(e.duration=t.duration),0!==t.unknown0&&(e.unknown0=Math.round(t.unknown0)),""!==t.language&&(e.language=t.language),!1!==t.forceSourceLang&&(e.forceSourceLang=t.forceSourceLang),0!==t.unknown1&&(e.unknown1=Math.round(t.unknown1)),t.translationHelp?.length&&(e.translationHelp=t.translationHelp.map((t=>n.toJSON(t)))),""!==t.responseLanguage&&(e.responseLanguage=t.responseLanguage),0!==t.unknown2&&(e.unknown2=Math.round(t.unknown2)),0!==t.unknown3&&(e.unknown3=Math.round(t.unknown3)),!1!==t.bypassCache&&(e.bypassCache=t.bypassCache),!1!==t.useNewModel&&(e.useNewModel=t.useNewModel),e},create:t=>r.fromPartial(t??{}),fromPartial(t){const e={url:"",deviceId:void 0,firstRequest:!1,duration:0,unknown0:0,language:"",forceSourceLang:!1,unknown1:0,translationHelp:[],responseLanguage:"",unknown2:0,unknown3:0,bypassCache:!1,useNewModel:!1};return e.url=t.url??"",e.deviceId=t.deviceId??void 0,e.firstRequest=t.firstRequest??!1,e.duration=t.duration??0,e.unknown0=t.unknown0??0,e.language=t.language??"",e.forceSourceLang=t.forceSourceLang??!1,e.unknown1=t.unknown1??0,e.translationHelp=t.translationHelp?.map((t=>n.fromPartial(t)))||[],e.responseLanguage=t.responseLanguage??"",e.unknown2=t.unknown2??0,e.unknown3=t.unknown3??0,e.bypassCache=t.bypassCache??!1,e.useNewModel=t.useNewModel??!1,e}};const s={encode:(t,o=e.Writer.create())=>(void 0!==t.url&&o.uint32(10).string(t.url),void 0!==t.duration&&o.uint32(17).double(t.duration),0!==t.status&&o.uint32(32).int32(t.status),void 0!==t.remainingTime&&o.uint32(40).int32(t.remainingTime),void 0!==t.unknown0&&o.uint32(48).int32(t.unknown0),""!==t.translationId&&o.uint32(58).string(t.translationId),void 0!==t.language&&o.uint32(66).string(t.language),void 0!==t.message&&o.uint32(74).string(t.message),o),decode(t,o){const i=t instanceof e.Reader?t:e.Reader.create(t);let a=void 0===o?i.len:i.pos+o;const n={url:void 0,duration:void 0,status:0,remainingTime:void 0,unknown0:void 0,translationId:"",language:void 0,message:void 0};for(;i.pos>>3){case 1:if(10!==t)break;n.url=i.string();continue;case 2:if(17!==t)break;n.duration=i.double();continue;case 4:if(32!==t)break;n.status=i.int32();continue;case 5:if(40!==t)break;n.remainingTime=i.int32();continue;case 6:if(48!==t)break;n.unknown0=i.int32();continue;case 7:if(58!==t)break;n.translationId=i.string();continue;case 8:if(66!==t)break;n.language=i.string();continue;case 9:if(74!==t)break;n.message=i.string();continue}if(4==(7&t)||0===t)break;i.skipType(7&t)}return n},fromJSON:t=>({url:x(t.url)?globalThis.String(t.url):void 0,duration:x(t.duration)?globalThis.Number(t.duration):void 0,status:x(t.status)?globalThis.Number(t.status):0,remainingTime:x(t.remainingTime)?globalThis.Number(t.remainingTime):void 0,unknown0:x(t.unknown0)?globalThis.Number(t.unknown0):void 0,translationId:x(t.translationId)?globalThis.String(t.translationId):"",language:x(t.language)?globalThis.String(t.language):void 0,message:x(t.message)?globalThis.String(t.message):void 0}),toJSON(t){const e={};return void 0!==t.url&&(e.url=t.url),void 0!==t.duration&&(e.duration=t.duration),0!==t.status&&(e.status=Math.round(t.status)),void 0!==t.remainingTime&&(e.remainingTime=Math.round(t.remainingTime)),void 0!==t.unknown0&&(e.unknown0=Math.round(t.unknown0)),""!==t.translationId&&(e.translationId=t.translationId),void 0!==t.language&&(e.language=t.language),void 0!==t.message&&(e.message=t.message),e},create:t=>s.fromPartial(t??{}),fromPartial(t){const e={url:void 0,duration:void 0,status:0,remainingTime:void 0,unknown0:void 0,translationId:"",language:void 0,message:void 0};return e.url=t.url??void 0,e.duration=t.duration??void 0,e.status=t.status??0,e.remainingTime=t.remainingTime??void 0,e.unknown0=t.unknown0??void 0,e.translationId=t.translationId??"",e.language=t.language??void 0,e.message=t.message??void 0,e}};function l(){return{audioFile:new Uint8Array(0),message:""}}const d={encode:(t,o=e.Writer.create())=>(0!==t.audioFile.length&&o.uint32(18).bytes(t.audioFile),""!==t.message&&o.uint32(10).string(t.message),o),decode(t,o){const i=t instanceof e.Reader?t:e.Reader.create(t);let a=void 0===o?i.len:i.pos+o;const n=l();for(;i.pos>>3){case 2:if(18!==t)break;n.audioFile=i.bytes();continue;case 1:if(10!==t)break;n.message=i.string();continue}if(4==(7&t)||0===t)break;i.skipType(7&t)}return n},fromJSON:t=>({audioFile:x(t.audioFile)?w(t.audioFile):new Uint8Array(0),message:x(t.message)?globalThis.String(t.message):""}),toJSON(t){const e={};return 0!==t.audioFile.length&&(e.audioFile=function(t){if(globalThis.Buffer)return globalThis.Buffer.from(t).toString("base64");{const e=[];return t.forEach((t=>{e.push(globalThis.String.fromCharCode(t))})),globalThis.btoa(e.join(""))}}(t.audioFile)),""!==t.message&&(e.message=t.message),e},create:t=>d.fromPartial(t??{}),fromPartial(t){const e=l();return e.audioFile=t.audioFile??new Uint8Array(0),e.message=t.message??"",e}};const u={encode:(t,o=e.Writer.create())=>(""!==t.translationId&&o.uint32(10).string(t.translationId),""!==t.url&&o.uint32(18).string(t.url),void 0!==t.audioInfo&&d.encode(t.audioInfo,o.uint32(50).fork()).ldelim(),o),decode(t,o){const i=t instanceof e.Reader?t:e.Reader.create(t);let a=void 0===o?i.len:i.pos+o;const n={translationId:"",url:"",audioInfo:void 0};for(;i.pos>>3){case 1:if(10!==t)break;n.translationId=i.string();continue;case 2:if(18!==t)break;n.url=i.string();continue;case 6:if(50!==t)break;n.audioInfo=d.decode(i,i.uint32());continue}if(4==(7&t)||0===t)break;i.skipType(7&t)}return n},fromJSON:t=>({translationId:x(t.translationId)?globalThis.String(t.translationId):"",url:x(t.url)?globalThis.String(t.url):"",audioInfo:x(t.audioInfo)?d.fromJSON(t.audioInfo):void 0}),toJSON(t){const e={};return""!==t.translationId&&(e.translationId=t.translationId),""!==t.url&&(e.url=t.url),void 0!==t.audioInfo&&(e.audioInfo=d.toJSON(t.audioInfo)),e},create:t=>u.fromPartial(t??{}),fromPartial(t){const e={translationId:"",url:"",audioInfo:void 0};return e.translationId=t.translationId??"",e.url=t.url??"",e.audioInfo=void 0!==t.audioInfo&&null!==t.audioInfo?d.fromPartial(t.audioInfo):void 0,e}};const c={encode:(t,o=e.Writer.create())=>(""!==t.language&&o.uint32(10).string(t.language),""!==t.url&&o.uint32(18).string(t.url),0!==t.unknown0&&o.uint32(24).int32(t.unknown0),""!==t.translatedLanguage&&o.uint32(34).string(t.translatedLanguage),""!==t.translatedUrl&&o.uint32(42).string(t.translatedUrl),0!==t.unknown1&&o.uint32(48).int32(t.unknown1),0!==t.unknown2&&o.uint32(56).int32(t.unknown2),o),decode(t,o){const i=t instanceof e.Reader?t:e.Reader.create(t);let a=void 0===o?i.len:i.pos+o;const n={language:"",url:"",unknown0:0,translatedLanguage:"",translatedUrl:"",unknown1:0,unknown2:0};for(;i.pos>>3){case 1:if(10!==t)break;n.language=i.string();continue;case 2:if(18!==t)break;n.url=i.string();continue;case 3:if(24!==t)break;n.unknown0=i.int32();continue;case 4:if(34!==t)break;n.translatedLanguage=i.string();continue;case 5:if(42!==t)break;n.translatedUrl=i.string();continue;case 6:if(48!==t)break;n.unknown1=i.int32();continue;case 7:if(56!==t)break;n.unknown2=i.int32();continue}if(4==(7&t)||0===t)break;i.skipType(7&t)}return n},fromJSON:t=>({language:x(t.language)?globalThis.String(t.language):"",url:x(t.url)?globalThis.String(t.url):"",unknown0:x(t.unknown0)?globalThis.Number(t.unknown0):0,translatedLanguage:x(t.translatedLanguage)?globalThis.String(t.translatedLanguage):"",translatedUrl:x(t.translatedUrl)?globalThis.String(t.translatedUrl):"",unknown1:x(t.unknown1)?globalThis.Number(t.unknown1):0,unknown2:x(t.unknown2)?globalThis.Number(t.unknown2):0}),toJSON(t){const e={};return""!==t.language&&(e.language=t.language),""!==t.url&&(e.url=t.url),0!==t.unknown0&&(e.unknown0=Math.round(t.unknown0)),""!==t.translatedLanguage&&(e.translatedLanguage=t.translatedLanguage),""!==t.translatedUrl&&(e.translatedUrl=t.translatedUrl),0!==t.unknown1&&(e.unknown1=Math.round(t.unknown1)),0!==t.unknown2&&(e.unknown2=Math.round(t.unknown2)),e},create:t=>c.fromPartial(t??{}),fromPartial(t){const e={language:"",url:"",unknown0:0,translatedLanguage:"",translatedUrl:"",unknown1:0,unknown2:0};return e.language=t.language??"",e.url=t.url??"",e.unknown0=t.unknown0??0,e.translatedLanguage=t.translatedLanguage??"",e.translatedUrl=t.translatedUrl??"",e.unknown1=t.unknown1??0,e.unknown2=t.unknown2??0,e}};const h={encode:(t,o=e.Writer.create())=>(""!==t.url&&o.uint32(10).string(t.url),""!==t.language&&o.uint32(18).string(t.language),o),decode(t,o){const i=t instanceof e.Reader?t:e.Reader.create(t);let a=void 0===o?i.len:i.pos+o;const n={url:"",language:""};for(;i.pos>>3){case 1:if(10!==t)break;n.url=i.string();continue;case 2:if(18!==t)break;n.language=i.string();continue}if(4==(7&t)||0===t)break;i.skipType(7&t)}return n},fromJSON:t=>({url:x(t.url)?globalThis.String(t.url):"",language:x(t.language)?globalThis.String(t.language):""}),toJSON(t){const e={};return""!==t.url&&(e.url=t.url),""!==t.language&&(e.language=t.language),e},create:t=>h.fromPartial(t??{}),fromPartial(t){const e={url:"",language:""};return e.url=t.url??"",e.language=t.language??"",e}};const p={encode(t,o=e.Writer.create()){!1!==t.waiting&&o.uint32(8).bool(t.waiting);for(const e of t.subtitles)c.encode(e,o.uint32(18).fork()).ldelim();return o},decode(t,o){const i=t instanceof e.Reader?t:e.Reader.create(t);let a=void 0===o?i.len:i.pos+o;const n={waiting:!1,subtitles:[]};for(;i.pos>>3){case 1:if(8!==t)break;n.waiting=i.bool();continue;case 2:if(18!==t)break;n.subtitles.push(c.decode(i,i.uint32()));continue}if(4==(7&t)||0===t)break;i.skipType(7&t)}return n},fromJSON:t=>({waiting:!!x(t.waiting)&&globalThis.Boolean(t.waiting),subtitles:globalThis.Array.isArray(t?.subtitles)?t.subtitles.map((t=>c.fromJSON(t))):[]}),toJSON(t){const e={};return!1!==t.waiting&&(e.waiting=t.waiting),t.subtitles?.length&&(e.subtitles=t.subtitles.map((t=>c.toJSON(t)))),e},create:t=>p.fromPartial(t??{}),fromPartial(t){const e={waiting:!1,subtitles:[]};return e.waiting=t.waiting??!1,e.subtitles=t.subtitles?.map((t=>c.fromPartial(t)))||[],e}};const g={encode:(t,o=e.Writer.create())=>(""!==t.url&&o.uint32(10).string(t.url),""!==t.timestamp&&o.uint32(18).string(t.timestamp),o),decode(t,o){const i=t instanceof e.Reader?t:e.Reader.create(t);let a=void 0===o?i.len:i.pos+o;const n={url:"",timestamp:""};for(;i.pos>>3){case 1:if(10!==t)break;n.url=i.string();continue;case 2:if(18!==t)break;n.timestamp=i.string();continue}if(4==(7&t)||0===t)break;i.skipType(7&t)}return n},fromJSON:t=>({url:x(t.url)?globalThis.String(t.url):"",timestamp:x(t.timestamp)?globalThis.String(t.timestamp):""}),toJSON(t){const e={};return""!==t.url&&(e.url=t.url),""!==t.timestamp&&(e.timestamp=t.timestamp),e},create:t=>g.fromPartial(t??{}),fromPartial(t){const e={url:"",timestamp:""};return e.url=t.url??"",e.timestamp=t.timestamp??"",e}};const m={encode:(t,o=e.Writer.create())=>(""!==t.url&&o.uint32(10).string(t.url),""!==t.language&&o.uint32(18).string(t.language),""!==t.responseLanguage&&o.uint32(26).string(t.responseLanguage),o),decode(t,o){const i=t instanceof e.Reader?t:e.Reader.create(t);let a=void 0===o?i.len:i.pos+o;const n={url:"",language:"",responseLanguage:""};for(;i.pos>>3){case 1:if(10!==t)break;n.url=i.string();continue;case 2:if(18!==t)break;n.language=i.string();continue;case 3:if(26!==t)break;n.responseLanguage=i.string();continue}if(4==(7&t)||0===t)break;i.skipType(7&t)}return n},fromJSON:t=>({url:x(t.url)?globalThis.String(t.url):"",language:x(t.language)?globalThis.String(t.language):"",responseLanguage:x(t.responseLanguage)?globalThis.String(t.responseLanguage):""}),toJSON(t){const e={};return""!==t.url&&(e.url=t.url),""!==t.language&&(e.language=t.language),""!==t.responseLanguage&&(e.responseLanguage=t.responseLanguage),e},create:t=>m.fromPartial(t??{}),fromPartial(t){const e={url:"",language:"",responseLanguage:""};return e.url=t.url??"",e.language=t.language??"",e.responseLanguage=t.responseLanguage??"",e}};const v={encode:(t,o=e.Writer.create())=>(0!==t.interval&&o.uint32(8).int32(t.interval),void 0!==t.translatedInfo&&g.encode(t.translatedInfo,o.uint32(18).fork()).ldelim(),void 0!==t.pingId&&o.uint32(24).int32(t.pingId),o),decode(t,o){const i=t instanceof e.Reader?t:e.Reader.create(t);let a=void 0===o?i.len:i.pos+o;const n={interval:0,translatedInfo:void 0,pingId:void 0};for(;i.pos>>3){case 1:if(8!==t)break;n.interval=i.int32();continue;case 2:if(18!==t)break;n.translatedInfo=g.decode(i,i.uint32());continue;case 3:if(24!==t)break;n.pingId=i.int32();continue}if(4==(7&t)||0===t)break;i.skipType(7&t)}return n},fromJSON:t=>({interval:x(t.interval)?a(t.interval):0,translatedInfo:x(t.translatedInfo)?g.fromJSON(t.translatedInfo):void 0,pingId:x(t.pingId)?globalThis.Number(t.pingId):void 0}),toJSON(t){const e={};return 0!==t.interval&&(e.interval=function(t){switch(t){case i.NO_CONNECTION:return"NO_CONNECTION";case i.TRANSLATING:return"TRANSLATING";case i.STREAMING:return"STREAMING";case i.UNRECOGNIZED:default:return"UNRECOGNIZED"}}(t.interval)),void 0!==t.translatedInfo&&(e.translatedInfo=g.toJSON(t.translatedInfo)),void 0!==t.pingId&&(e.pingId=Math.round(t.pingId)),e},create:t=>v.fromPartial(t??{}),fromPartial(t){const e={interval:0,translatedInfo:void 0,pingId:void 0};return e.interval=t.interval??0,e.translatedInfo=void 0!==t.translatedInfo&&null!==t.translatedInfo?g.fromPartial(t.translatedInfo):void 0,e.pingId=t.pingId??void 0,e}};const f={encode:(t,o=e.Writer.create())=>(0!==t.pingId&&o.uint32(8).int32(t.pingId),o),decode(t,o){const i=t instanceof e.Reader?t:e.Reader.create(t);let a=void 0===o?i.len:i.pos+o;const n={pingId:0};for(;i.pos>>3){case 1:if(8!==t)break;n.pingId=i.int32();continue}if(4==(7&t)||0===t)break;i.skipType(7&t)}return n},fromJSON:t=>({pingId:x(t.pingId)?globalThis.Number(t.pingId):0}),toJSON(t){const e={};return 0!==t.pingId&&(e.pingId=Math.round(t.pingId)),e},create:t=>f.fromPartial(t??{}),fromPartial(t){const e={pingId:0};return e.pingId=t.pingId??0,e}};const b={encode:(t,o=e.Writer.create())=>(""!==t.uuid&&o.uint32(10).string(t.uuid),""!==t.module&&o.uint32(18).string(t.module),o),decode(t,o){const i=t instanceof e.Reader?t:e.Reader.create(t);let a=void 0===o?i.len:i.pos+o;const n={uuid:"",module:""};for(;i.pos>>3){case 1:if(10!==t)break;n.uuid=i.string();continue;case 2:if(18!==t)break;n.module=i.string();continue}if(4==(7&t)||0===t)break;i.skipType(7&t)}return n},fromJSON:t=>({uuid:x(t.uuid)?globalThis.String(t.uuid):"",module:x(t.module)?globalThis.String(t.module):""}),toJSON(t){const e={};return""!==t.uuid&&(e.uuid=t.uuid),""!==t.module&&(e.module=t.module),e},create:t=>b.fromPartial(t??{}),fromPartial(t){const e={uuid:"",module:""};return e.uuid=t.uuid??"",e.module=t.module??"",e}};const y={encode:(t,o=e.Writer.create())=>(""!==t.secretKey&&o.uint32(10).string(t.secretKey),0!==t.expires&&o.uint32(16).int32(t.expires),o),decode(t,o){const i=t instanceof e.Reader?t:e.Reader.create(t);let a=void 0===o?i.len:i.pos+o;const n={secretKey:"",expires:0};for(;i.pos>>3){case 1:if(10!==t)break;n.secretKey=i.string();continue;case 2:if(16!==t)break;n.expires=i.int32();continue}if(4==(7&t)||0===t)break;i.skipType(7&t)}return n},fromJSON:t=>({secretKey:x(t.secretKey)?globalThis.String(t.secretKey):"",expires:x(t.expires)?globalThis.Number(t.expires):0}),toJSON(t){const e={};return""!==t.secretKey&&(e.secretKey=t.secretKey),0!==t.expires&&(e.expires=Math.round(t.expires)),e},create:t=>y.fromPartial(t??{}),fromPartial(t){const e={secretKey:"",expires:0};return e.secretKey=t.secretKey??"",e.expires=t.expires??0,e}};function w(t){if(globalThis.Buffer)return Uint8Array.from(globalThis.Buffer.from(t,"base64"));{const e=globalThis.atob(t),o=new Uint8Array(e.length);for(let t=0;tr.encode({url:t,firstRequest:!0,duration:e,unknown0:1,language:o,forceSourceLang:n,unknown1:0,translationHelp:a||[],responseLanguage:i,unknown2:1,unknown3:1,bypassCache:s,useNewModel:l}).finish(),decodeTranslationResponse:t=>s.decode(new Uint8Array(t)),encodeTranslationAudioRequest:(t,e)=>u.encode({url:t,translationId:e,audioInfo:{audioFile:new Uint8Array(0),message:T.WEB_API_GET_ALL_GENERATING_URLS_DATA_FROM_IFRAME}}).finish(),decodeTranslationAudioResponse:t=>s.decode(new Uint8Array(t)),encodeSubtitlesRequest:(t,e)=>h.encode({url:t,language:e}).finish(),decodeSubtitlesResponse:t=>p.decode(new Uint8Array(t)),encodeStreamPingRequest:t=>f.encode({pingId:t}).finish(),encodeStreamRequest:(t,e,o)=>m.encode({url:t,language:e,responseLanguage:o}).finish(),decodeStreamResponse:t=>v.decode(new Uint8Array(t)),encodeYandexSessionRequest:(t,e)=>b.encode({uuid:t,module:e}).finish(),decodeYandexSessionResponse:t=>y.decode(new Uint8Array(t))},P={host:"api.browser.yandex.ru",hostVOT:"vot-api.toil.cc/v1",mediaProxy:"media-proxy.toil.cc",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 YaBrowser/24.10.0.0 Safari/537.36",componentVersion:"24.10.1.598",hmac:"bt8xH3VOlb4mqf0nqAibnDOoiPlXsisf",defaultDuration:343,loggerLevel:1,version:"1.3.10"};var L;!function(t){t[t.DEBUG=0]="DEBUG",t[t.INFO=1]="INFO",t[t.WARN=2]="WARN",t[t.ERROR=3]="ERROR",t[t.SILENCE=4]="SILENCE"}(L||(L={}));class A{static prefix=`[vot.js v${P.version}]`;static canLog(t){return P.loggerLevel<=t}static log(...t){A.canLog(L.DEBUG)&&console.log(A.prefix,...t)}static info(...t){A.canLog(L.INFO)&&console.info(A.prefix,...t)}static warn(...t){A.canLog(L.WARN)&&console.warn(A.prefix,...t)}static error(...t){A.canLog(L.ERROR)&&console.error(A.prefix,...t)}}const I=new TextEncoder;async function _(t,e,o){const i=await crypto.subtle.importKey("raw",I.encode(e),{name:"HMAC",hash:{name:t}},!1,["sign","verify"]);return await crypto.subtle.sign("HMAC",i,o)}async function M(t){const e=await _("SHA-256",P.hmac,t);return new Uint8Array(e).reduce(((t,e)=>t+e.toString(16).padStart(2,"0")),"")}async function O(t,e,o,i){const{secretKey:a,uuid:n}=e,r=await M(o),s=`${n}:${i}:${P.componentVersion}`,l=I.encode(s);return{[`${t}-Signature`]:r,[`Sec-${t}-Sk`]:a,[`Sec-${t}-Token`]:`${await M(l)}:${s}`}}const V={afr:"af",aka:"ak",alb:"sq",amh:"am",ara:"ar",arm:"hy",asm:"as",aym:"ay",aze:"az",baq:"eu",bel:"be",ben:"bn",bos:"bs",bul:"bg",bur:"my",cat:"ca",chi:"zh",cos:"co",cze:"cs",dan:"da",div:"dv",dut:"nl",eng:"en",epo:"eo",est:"et",ewe:"ee",fin:"fi",fre:"fr",fry:"fy",geo:"ka",ger:"de",gla:"gd",gle:"ga",glg:"gl",gre:"el",grn:"gn",guj:"gu",hat:"ht",hau:"ha",hin:"hi",hrv:"hr",hun:"hu",ibo:"ig",ice:"is",ind:"id",ita:"it",jav:"jv",jpn:"ja",kan:"kn",kaz:"kk",khm:"km",kin:"rw",kir:"ky",kor:"ko",kur:"ku",lao:"lo",lat:"la",lav:"lv",lin:"ln",lit:"lt",ltz:"lb",lug:"lg",mac:"mk",mal:"ml",mao:"mi",mar:"mr",may:"ms",mlg:"mg",mlt:"mt",mon:"mn",nep:"ne",nor:"no",nya:"ny",ori:"or",orm:"om",pan:"pa",per:"fa",pol:"pl",por:"pt",pus:"ps",que:"qu",rum:"ro",rus:"ru",san:"sa",sin:"si",slo:"sk",slv:"sl",smo:"sm",sna:"sn",snd:"sd",som:"so",sot:"st",spa:"es",srp:"sr",sun:"su",swa:"sw",swe:"sv",tam:"ta",tat:"tt",tel:"te",tgk:"tg",tha:"th",tir:"ti",tso:"ts",tuk:"tk",tur:"tr",uig:"ug",ukr:"uk",urd:"ur",uzb:"uz",vie:"vi",wel:"cy",xho:"xh",yid:"yi",yor:"yo",zul:"zu"};async function E(t,e={headers:{"User-Agent":P.userAgent}}){const{timeout:o=3e3,...i}=e,a=new AbortController,n=setTimeout((()=>a.abort()),o),r=await fetch(t,{signal:a.signal,...i});return clearTimeout(n),r}function B(t){return 3===t.length?V[t]:t.toLowerCase().split(/[_;-]/)[0].trim()}function N(t,e="mp4"){return`https://${P.mediaProxy}/v1/proxy/video.${e}?url=${encodeURIComponent(t.href)}&origin=${t.origin}&referer=${t.origin}`}const R=[{additionalData:"mobile",host:S.youtube,url:"https://youtu.be/",match:/^m.youtube.com$/,selector:"shorts-video #player"},{additionalData:"mobile",host:S.youtube,url:"https://youtu.be/",match:/^m.youtube.com$/,selector:".player-container"},{host:S.youtube,url:"https://youtu.be/",match:/^(www.)?youtube(-nocookie|kids)?.com$/,selector:".html5-video-container:not(#inline-player *)"},{host:S.invidious,url:"https://youtu.be/",match:["yewtu.be","yt.artemislena.eu","invidious.flokinet.to","iv.melmac.space","inv.nadeko.net","inv.tux.pizza","invidious.private.coffee","yt.drgnz.club","vid.puffyan.us","invidious.dhusch.de"],selector:"#player",needBypassCSP:!0},{host:S.piped,url:"https://youtu.be/",match:["piped.video","piped.tokhmi.xyz","piped.moomoo.me","piped.syncpundit.io","piped.mha.fi","watch.whatever.social","piped.garudalinux.org","efy.piped.pages.dev","watch.leptons.xyz","piped.lunar.icu","yt.dc09.ru","piped.mint.lgbt","il.ax","piped.privacy.com.de","piped.esmailelbob.xyz","piped.projectsegfau.lt","piped.in.projectsegfau.lt","piped.us.projectsegfau.lt","piped.privacydev.net","piped.palveluntarjoaja.eu","piped.smnz.de","piped.adminforge.de","piped.qdi.fi","piped.hostux.net","piped.chauvet.pro","piped.jotoma.de","piped.pfcd.me","piped.frontendfriendly.xyz"],selector:".shaka-video-container",needBypassCSP:!0},{host:S.poketube,url:"https://youtu.be/",match:["poketube.fun","pt.sudovanilla.org","poke.ggtyler.dev","poke.uk2.littlekai.co.uk","poke.blahai.gay"],selector:".video-player-container"},{host:S.ricktube,url:"https://youtu.be/",match:["ricktube.ru"],selector:"#oframeplayer > pjsdiv:has(video)"},{additionalData:"mobile",host:S.vk,url:"https://vk.com/video?z=",match:/^m.vk.(com|ru)$/,selector:"vk-video-player",shadowRoot:!0},{additionalData:"clips",host:S.vk,url:"https://vk.com/video?z=",match:/^(www.|m.)?vk.(com|ru)$/,selector:'div[data-testid="clipcontainer-video"]'},{host:S.vk,url:"https://vk.com/video?z=",match:/^(www.|m.)?vk.(com|ru)$/,selector:".videoplayer_media"},{host:S.nine_gag,url:"https://9gag.com/gag/",match:/^9gag.com$/,selector:".video-post"},{host:S.twitch,url:"https://twitch.tv/",match:[/^m.twitch.tv$/,/^(www.)?twitch.tv$/,/^clips.twitch.tv$/,/^player.twitch.tv$/],selector:".video-ref, main > div > section > div > div > div"},{host:S.proxitok,url:"https://www.tiktok.com/",match:["proxitok.pabloferreiro.es","proxitok.pussthecat.org","tok.habedieeh.re","proxitok.esmailelbob.xyz","proxitok.privacydev.net","tok.artemislena.eu","tok.adminforge.de","tt.vern.cc","cringe.whatever.social","proxitok.lunar.icu","proxitok.privacy.com.de"],selector:".column.has-text-centered"},{host:S.tiktok,url:"https://www.tiktok.com/",match:/^(www.)?tiktok.com$/,selector:null},{host:S.vimeo,url:"https://vimeo.com/",match:/^vimeo.com$/,needExtraData:!0,selector:".player"},{host:S.vimeo,url:"https://player.vimeo.com/",match:/^player.vimeo.com$/,additionalData:"embed",needExtraData:!0,needBypassCSP:!0,selector:".player"},{host:S.xvideos,url:"https://www.xvideos.com/",match:/^(www.)?(xvideos|xv-ru).com$/,selector:".video-bg-pic",needBypassCSP:!0},{host:S.pornhub,url:"https://rt.pornhub.com/view_video.php?viewkey=",match:/^[a-z]+.pornhub.com$/,selector:".mainPlayerDiv > .video-element-wrapper-js > div",eventSelector:".mgp_eventCatcher"},{additionalData:"embed",host:S.pornhub,url:"https://rt.pornhub.com/view_video.php?viewkey=",match:t=>t.host.includes("pornhub.com")&&t.pathname.startsWith("/embed/"),selector:"#player"},{host:S.twitter,url:"https://twitter.com/i/status/",match:/^(twitter|x).com$/,selector:'div[data-testid="videoComponent"] > div:nth-child(1) > div',eventSelector:'div[data-testid="videoPlayer"]',needBypassCSP:!0},{host:S.rumble,url:"https://rumble.com/",match:/^rumble.com$/,selector:"#videoPlayer > .videoPlayer-Rumble-cls > div"},{host:S.facebook,url:"https://facebook.com/",match:t=>t.host.includes("facebook.com")&&t.pathname.includes("/videos/"),selector:'div[role="main"] div[data-pagelet$="video" i]',needBypassCSP:!0},{additionalData:"reels",host:S.facebook,url:"https://facebook.com/",match:t=>t.host.includes("facebook.com")&&t.pathname.includes("/reel/"),selector:'div[role="main"]',needBypassCSP:!0},{host:S.rutube,url:"https://rutube.ru/video/",match:/^rutube.ru$/,selector:".video-player > div > div > div:nth-child(2)"},{additionalData:"embed",host:S.rutube,url:"https://rutube.ru/video/",match:/^rutube.ru$/,selector:"#app > div > div"},{host:S.bilibili,url:"https://www.bilibili.com/",match:/^(www|m|player).bilibili.com$/,selector:".bpx-player-video-wrap"},{additionalData:"old",host:S.bilibili,url:"https://www.bilibili.com/",match:/^(www|m).bilibili.com$/,selector:null},{host:S.mailru,url:"https://my.mail.ru/",match:/^my.mail.ru$/,selector:"#b-video-wrapper"},{host:S.bitchute,url:"https://www.bitchute.com/video/",match:/^(www.)?bitchute.com$/,selector:".video-js"},{host:S.eporner,url:"https://www.eporner.com/",match:/^(www.)?eporner.com$/,selector:".vjs-v7"},{host:S.peertube,url:"stub",match:["peertube.1312.media","tube.shanti.cafe","bee-tube.fr","video.sadmin.io","dalek.zone","review.peertube.biz","peervideo.club","tube.la-dina.net","peertube.tmp.rcp.tf","peertube.su","video.blender.org","videos.viorsan.com","tube-sciences-technologies.apps.education.fr","tube-numerique-educatif.apps.education.fr","tube-arts-lettres-sciences-humaines.apps.education.fr","beetoons.tv","comics.peertube.biz","makertube.net"],selector:".vjs-v7"},{host:S.dailymotion,url:"https://dai.ly/",match:/^geo([\d]+)?.dailymotion.com$/,selector:".player"},{host:S.trovo,url:"https://trovo.live/s/",match:/^trovo.live$/,selector:".player-video"},{host:S.yandexdisk,url:"https://yadi.sk/",match:/^disk.yandex.ru$/,selector:".video-player__player > div:nth-child(1)",eventSelector:".video-player__player",needBypassCSP:!0,needExtraData:!0},{host:S.okru,url:"https://ok.ru/video/",match:/^ok.ru$/,selector:".html5-vpl_vid"},{host:S.googledrive,url:"https://drive.google.com/file/d/",match:/^youtube.googleapis.com$/,selector:".html5-video-container"},{host:S.bannedvideo,url:"https://madmaxworld.tv/watch?id=",match:/^(www.)?banned.video|madmaxworld.tv$/,selector:".vjs-v7",needExtraData:!0},{host:S.weverse,url:"https://weverse.io/",match:/^weverse.io$/,selector:".webplayer-internal-source-wrapper",needExtraData:!0},{host:S.newgrounds,url:"https://www.newgrounds.com/",match:/^(www.)?newgrounds.com$/,selector:".ng-video-player"},{host:S.egghead,url:"https://egghead.io/",match:/^egghead.io$/,selector:".cueplayer-react-video-holder"},{host:S.youku,url:"https://v.youku.com/",match:/^v.youku.com$/,selector:"#ykPlayer"},{host:S.archive,url:"https://archive.org/details/",match:/^archive.org$/,selector:".jw-media"},{host:S.kodik,url:"stub",match:/^kodik.(info|biz|cc)$/,selector:".fp-player",needExtraData:!0},{host:S.patreon,url:"stub",match:/^(www.)?patreon.com$/,selector:'div[data-tag="post-card"] div[elevation="subtle"] > div > div > div > div',needExtraData:!0},{host:S.reddit,url:"stub",match:/^(www.|new.|old.)?reddit.com$/,selector:".reddit-video-player-root",needExtraData:!0,needBypassCSP:!0},{host:S.kick,url:"https://kick.com/",match:/^kick.com$/,selector:"#injected-embedded-channel-player-video > div",needExtraData:!0},{host:S.appledeveloper,url:"https://developer.apple.com/",match:/^developer.apple.com$/,selector:".developer-video-player",needExtraData:!0,needBypassCSP:!0},{host:S.epicgames,url:"https://dev.epicgames.com/community/learning/",match:/^dev.epicgames.com$/,selector:".vjs-v7",needExtraData:!0},{host:S.nineanimetv,url:"https://9animetv.to/watch/",match:/^rapid-cloud.co$/,selector:".jw-media",needExtraData:!0},{host:S.odysee,url:"stub",match:/^odysee.com$/,selector:".vjs-v7",needExtraData:!0},{host:S.coursehunterLike,url:"stub",match:["coursehunter.net","coursetrain.net"],selector:"#oframeplayer > pjsdiv:has(video)",needExtraData:!0},{host:S.sap,url:"https://learning.sap.com/courses/",match:/^learning.sap.com$/,selector:".playkit-container",eventSelector:".playkit-player",needExtraData:!0,needBypassCSP:!0},{host:S.udemy,url:"https://www.udemy.com/",match:/udemy.com$/,selector:'div[data-purpose="curriculum-item-viewer-content"] > section > div > div > div > div:nth-of-type(2)',needExtraData:!0},{host:S.coursera,url:"https://www.coursera.org/",match:/coursera.org$/,selector:".vjs-v8",needExtraData:!0},{host:S.watchpornto,url:"https://watchporn.to/",match:/^watchporn.to$/,selector:".fp-player"},{host:S.linkedin,url:"https://www.linkedin.com/learning/",match:/^(www.)?linkedin.com$/,selector:".vjs-v7",needExtraData:!0,needBypassCSP:!0},{host:S.incestflix,url:"https://www.incestflix.net/watch/",match:/^(www.)?incestflix.(net|to|com)$/,selector:"#incflix-stream",needExtraData:!0},{host:S.porntn,url:"https://porntn.com/videos/",match:/^porntn.com$/,selector:null,needExtraData:!0},{host:S.custom,url:"stub",match:t=>/([^.]+).(mp4|webm)/.test(t.pathname),rawResult:!0}],$=JSON.parse('{"__version__":5,"recommended":"recommended","translateVideo":"Translate video","disableTranslate":"Turn off","translationSettings":"Translation settings","subtitlesSettings":"Subtitles settings","about":"About extension","resetSettings":"Reset settings","videoBeingTranslated":"The video is being translated","videoLanguage":"Video language","translationLanguage":"Translation language","translationTake":"The translation will take","translationTakeMoreThanHour":"The translation will take more than an hour","translationTakeAboutMinute":"The translation will take about a minute","translationTakeFewMinutes":"The translation will take a few minutes","translationTakeApproximatelyMinutes":"The translation will take approximately {0} minutes","translationTakeApproximatelyMinute":"The translation will take approximately {0} minutes","unSupportedExtensionError":"Error! {0} is not supported by this version of the extension!\\n\\nPlease use the cloudflare version of the VOT extension.","requestTranslationFailed":"Failed to request video translation","audioNotReceived":"Audio link not received","grantPermissionToAutoPlay":"Grant permission to autoplay","audioFormatNotSupported":"The audio format is not supported","VOTAutoTranslate":"Translate on open","VOTDontTranslateYourLang":"Do not translate from my language","VOTVolume":"Video volume","VOTVolumeTranslation":"Translation Volume","VOTAutoSetVolume":"Reduce video volume to ","VOTShowVideoSlider":"Video volume slider","VOTSyncVolume":"Link translation and video volume","VOTAudioProxy":"Proxy received audio","VOTDisableFromYourLang":"You have disabled the translation of the video in your language","VOTLiveNotSupported":"Translation of live streams is not supported","VOTPremiere":"Wait for the premiere to end before translating","VOTVideoIsTooLong":"Video is too long","VOTNoVideoIDFound":"No video ID found","VOTSubtitles":"Subtitles","VOTSubtitlesDisabled":"Disabled","VOTSubtitlesMaxLength":"Subtitles max length","VOTHighlightWords":"Highlight words","VOTTranslatedFrom":"translated from","VOTAutogenerated":"autogenerated","VOTSettings":"VOT Settings","VOTMenuLanguage":"Menu language","VOTAuthors":"Authors","VOTVersion":"Version","VOTLoader":"Loader","VOTBrowser":"Browser","VOTShowPiPButton":"Show PiP button","langs":{"auto":"Auto","af":"Afrikaans","ak":"Akan","sq":"Albanian","am":"Amharic","ar":"Arabic","hy":"Armenian","as":"Assamese","ay":"Aymara","az":"Azerbaijani","bn":"Bangla","eu":"Basque","be":"Belarusian","bho":"Bhojpuri","bs":"Bosnian","bg":"Bulgarian","my":"Burmese","ca":"Catalan","ceb":"Cebuano","zh":"Chinese","zh-Hans":"Chinese (Simplified)","zh-Hant":"Chinese (Traditional)","co":"Corsican","hr":"Croatian","cs":"Czech","da":"Danish","dv":"Divehi","nl":"Dutch","en":"English","eo":"Esperanto","et":"Estonian","ee":"Ewe","fil":"Filipino","fi":"Finnish","fr":"French","gl":"Galician","lg":"Ganda","ka":"Georgian","de":"German","el":"Greek","gn":"Guarani","gu":"Gujarati","ht":"Haitian Creole","ha":"Hausa","haw":"Hawaiian","iw":"Hebrew","hi":"Hindi","hmn":"Hmong","hu":"Hungarian","is":"Icelandic","ig":"Igbo","id":"Indonesian","ga":"Irish","it":"Italian","ja":"Japanese","jv":"Javanese","kn":"Kannada","kk":"Kazakh","km":"Khmer","rw":"Kinyarwanda","ko":"Korean","kri":"Krio","ku":"Kurdish","ky":"Kyrgyz","lo":"Lao","la":"Latin","lv":"Latvian","ln":"Lingala","lt":"Lithuanian","lb":"Luxembourgish","mk":"Macedonian","mg":"Malagasy","ms":"Malay","ml":"Malayalam","mt":"Maltese","mi":"Māori","mr":"Marathi","mn":"Mongolian","ne":"Nepali","nso":"Northern Sotho","no":"Norwegian","ny":"Nyanja","or":"Odia","om":"Oromo","ps":"Pashto","fa":"Persian","pl":"Polish","pt":"Portuguese","pa":"Punjabi","qu":"Quechua","ro":"Romanian","ru":"Russian","sm":"Samoan","sa":"Sanskrit","gd":"Scottish Gaelic","sr":"Serbian","sn":"Shona","sd":"Sindhi","si":"Sinhala","sk":"Slovak","sl":"Slovenian","so":"Somali","st":"Southern Sotho","es":"Spanish","su":"Sundanese","sw":"Swahili","sv":"Swedish","tg":"Tajik","ta":"Tamil","tt":"Tatar","te":"Telugu","th":"Thai","ti":"Tigrinya","ts":"Tsonga","tr":"Turkish","tk":"Turkmen","uk":"Ukrainian","ur":"Urdu","ug":"Uyghur","uz":"Uzbek","vi":"Vietnamese","cy":"Welsh","fy":"Western Frisian","xh":"Xhosa","yi":"Yiddish","yo":"Yoruba","zu":"Zulu"},"udemyModuleArgsNotFound":"Could not get udemy module data due to the fact that ModuleArgs was not found","VOTTranslationHelpNull":"Could not get the data required for the translate","streamNoConnectionToServer":"There is no connection to the server","searchField":"Search...","VOTTranslateAPIErrors":"Translate errors from the API","VOTTranslationService":"Translation Service","VOTDetectService":"Detect Service","VOTTranslatingError":"Translating the error","VOTProxyWorkerHost":"Enter the proxy worker address","VOTM3u8ProxyHost":"Enter the address of the m3u8 proxy worker","proxySettings":"Proxy Settings","translationTakeApproximatelyMinute2":"The translation will take approximately {0} minutes","VOTAudioBooster":"Extended translation volume increase","VOTSubtitlesDesign":"Subtitles design","VOTSubtitlesFontSize":"Font size of subtitles","VOTSubtitlesOpacity":"Transparency of the subtitle background","VOTPressNewHotkey":"Press the new hotkey...","VOTCreateTranslationHotkey":"Create Hotkey for Translation","VOTChangeHotkeyWithCurrent":"Change Hotkey (Current: {0})","VOTSubtitlesDownloadFormat":"The format for downloading subtitles","VOTDownloadWithName":"Download files with the video name","VOTUpdateLocaleFiles":"Update localization files","VOTLocaleHash":"Locale hash","VOTUpdatedAt":"Updated at","VOTNeedWebAudioAPI":"To enable this, you must have a Web Audio API","VOTMediaCSPEnabledOnSite":"Media CSP is enabled on this site","VOTOnlyBypassMediaCSP":"Use it only for bypassing Media CSP","VOTNewAudioPlayer":"Use the new audio player","VOTUseNewModel":"Use an experimental variation of Yandex voices for some videos"}'),D={log:(...t)=>{}},F="media-proxy.toil.cc/v1/proxy/m3u8",q="vot-worker.toil.cc",U="https://vot.toil.cc/v1",H=.15,z="yandex",W="yandex",j={yandex:"https://translate.toil.cc/detect",rustServer:"https://rust-server-531j.onrender.com/detect"},G={yandex:"https://translate.toil.cc/translate",deepl:"https://translate-deepl.toil.cc/translate"},Y=["Violentmonkey","FireMonkey","Greasemonkey","AdGuard","OrangeMonkey"],J=new class{constructor(){this.gmSupport="function"==typeof GM_getValue,D.log(`GM Storage Status: ${this.gmSupport}`)}syncGet(t,e=void 0){if(this.gmSupport)return GM_getValue(t,e);const o="number"==typeof e;const i=window.localStorage.getItem(t)??e;return o?Number(i):i}async get(t,e=void 0){if(this.gmSupport)return await GM_getValue(t,e);const o="number"==typeof e;return Promise.resolve(this.syncGet(t,e,o))}syncSet(t,e){return this.gmSupport?GM_setValue(t,e):window.localStorage.setItem(t,e)}async set(t,e){return this.gmSupport?await GM_setValue(t,e):Promise.resolve(this.syncSet(t,e))}syncDelete(t){return this.gmSupport?GM_deleteValue(t):window.localStorage.removeItem(t)}async delete(t){return this.gmSupport?await GM_deleteValue(t):Promise.resolve(this.syncDelete(t))}syncList(){return this.gmSupport?GM_listValues():["autoTranslate","dontTranslateLanguage","dontTranslateYourLang","autoSetVolumeYandexStyle","autoVolume","buttonPos","showVideoSlider","syncVolume","subtitlesMaxLength","highlightWords","responseLanguage","defaultVolume","audioProxy","showPiPButton","translateAPIErrors","translationService","detectService","m3u8ProxyHost","translateProxyEnabled","hotkeyButton","proxyWorkerHost","audioBooster","locale-version","locale-lang","locale-phrases"]}async list(){return this.gmSupport?await GM_listValues():Promise.resolve(this.syncList())}},K="https://raw.githubusercontent.com/ilyhalight/voice-over-translation/master/src/localization",Z=["auto","en","ru","af","am","ar","az","bg","bn","bs","ca","cs","cy","da","de","el","es","et","eu","fa","fi","fr","gl","hi","hr","hu","hy","id","it","ja","jv","kk","km","kn","ko","lo","mk","ml","mn","ms","mt","my","ne","nl","pa","pl","pt","ro","si","sk","sl","sq","sr","su","sv","sw","tr","uk","ur","uz","vi","zh","zu"],X=new class{lang="en";locale={};gmValues=["locale-phrases","locale-lang","locale-hash","locale-updated-at","locale-lang-override"];constructor(){const t=J.syncGet("locale-lang-override","auto");this.lang=t&&"auto"!==t?t:(navigator.language||navigator.userLanguage)?.substr(0,2)?.toLowerCase()??"en",this.setLocaleFromJsonString(J.syncGet("locale-phrases",""))}reset(){for(let t=0;ti&&o===this.lang)return;const a=await this.checkUpdates();if(await J.set("locale-updated-at",i),a){D.log("Updating locale...");try{const t=await rt(`${K}/locales/${this.lang}.json`);if(200!==t.status)throw t.status;const e=await t.text();await J.set("locale-phrases",e),this.setLocaleFromJsonString(e),await J.set("locale-hash",a),await J.set("locale-lang",this.lang)}catch(t){console.error("[VOT] [localizationProvider] Failed to get locale, cause:",t),this.setLocaleFromJsonString(await J.get("locale-phrases",""))}}}setLocaleFromJsonString(t){try{this.locale=JSON.parse(t)??{}}catch(t){console.error("[VOT] [localizationProvider]",t),this.locale={}}}getFromLocale(t,e){const o=e.split(".").reduce(((t,e)=>{if("object"==typeof t&&t)return t[e]}),t);return void 0===o&&console.warn("[VOT] [localizationProvider] locale",t,"doesn't contain key",e),o}getDefault(t){return this.getFromLocale($,t)??t}get(t){return this.getFromLocale(this.locale,t)??this.getFromLocale($,t)??t}},Q=navigator.language||navigator.userLanguage,tt=Q?.substr(0,2)?.toLowerCase()??"en";function et(){return"pictureInPictureEnabled"in document&&document.pictureInPictureEnabled}function ot(){return"undefined"!=typeof Hls&&Hls?.isSupported()?new Hls({debug:!1,lowLatencyMode:!0,backBufferLength:90}):void 0}const it=new RegExp([/(?:https?|ftp):\/\/\S+/g,/https?:\/\/\S+|www\.\S+/gm,/\b\S+\.\S+/gm,/#[^\s#]+/g,/Auto-generated by YouTube/g,/Provided to YouTube by/g,/Released on/g,/0x[a-fA-F0-9]{40}/g,/[13][a-km-zA-HJ-NP-Z1-9]{25,34}/g,/4[0-9AB][1-9A-HJ-NP-Za-km-z]{93}/g,/Paypal/g].map((t=>t.source)).join("|"));function at(t,e){const o=URL.createObjectURL(t),i=document.createElement("a");i.href=o,i.download=e,i.click(),URL.revokeObjectURL(o)}function nt(t){return 0===t.trim().length?(new Date).toLocaleDateString("en-us").replaceAll("/","-"):t.replace(/[\\/:*?"'<>|]/g,"")}async function rt(t,e={}){const{timeout:o=15e3,...i}=e,a=new AbortController,n=setTimeout((()=>a.abort()),o);try{if(t.includes("api.browser.yandex.ru"))throw new Error("Preventing yandex cors");const e=await fetch(t,{signal:a.signal,...i});return clearTimeout(n),e}catch(e){return D.log("GM_fetch preventing cors by GM_xmlhttpRequest",e.message),new Promise(((e,a)=>{clearTimeout(n),GM_xmlhttpRequest({method:i.method||"GET",url:t,responseType:"blob",...i,data:i.body,timeout:o,onload:t=>{const o=Object.fromEntries(t.responseHeaders.trim().split(/\r?\n/).map((t=>t.split(/: (.+)/))).filter((([t])=>t&&/^[\w-]+$/.test(t))));e(new Response(t.response,{status:t.status,headers:o}))},ontimeout:()=>a(new Error("Timeout")),onerror:t=>a(t),onabort:()=>a(new Error("AbortError"))})}))}}function st(){return Math.floor(Date.now()/1e3)}class lt extends Error{constructor(t){super(t),this.name="VideoHelper",this.message=t}}class dt{API_ORIGIN=window.location.origin;fetch;extraInfo;referer;origin;service;constructor({fetchFn:t=rt,extraInfo:e=!0,referer:o=document.referrer??window.location.origin+"/",origin:i=window.location.origin,service:a}={}){this.fetch=t,this.extraInfo=e,this.referer=o,this.origin=/^(http(s)?):\/\//.test(String(i))?i:window.location.origin,this.service=a}async getVideoData(t){}async getVideoId(t){}returnBaseData(t){if(this.service)return{url:this.service.url+t,videoId:t,host:this.service.host,duration:void 0}}}const ut=["auto","ru","en","zh","ko","lt","lv","ar","fr","it","es","de","ja"],ct=["ru","en","kk"],ht=["srt","vtt","json"];class pt extends Error{constructor(t){super(X.getDefault(t)),this.name="VOTLocalizedError",this.unlocalizedMessage=t,this.localizedMessage=X.get(t)}}const gt={[S.mailru]:class extends dt{API_ORIGIN="https://my.mail.ru";async getVideoMeta(t){try{const e=await this.fetch(`${this.API_ORIGIN}/+/video/meta/${t}?xemail=&ajax_call=1&func_name=&mna=&mnb=&ext=1&_=${(new Date).getTime()}`);return await e.json()}catch(t){return void A.error("Failed to get mail.ru video data",t.message)}}async getVideoId(t){const e=t.pathname;if(/\/(v|mail|bk|inbox)\//.exec(e))return e.slice(1);const o=/video\/embed\/([^/]+)/.exec(e)?.[1];if(!o)return;const i=await this.getVideoMeta(o);return i?i.meta.url.replace("//my.mail.ru/",""):void 0}},[S.weverse]:class extends dt{API_ORIGIN="https://global.apis.naver.com/weverse/wevweb";API_APP_ID="be4d79eb8fc7bd008ee82c8ec4ff6fd4";API_HMAC_KEY="1b9cb6378d959b45714bec49971ade22e6e24e42";HEADERS={Accept:"application/json, text/plain, */*",Origin:"https://weverse.io",Referer:"https://weverse.io/"};getURLData(){return{appId:this.API_APP_ID,language:"en",os:"WEB",platform:"WEB",wpf:"pc"}}async createHash(t){const e=Date.now(),o=t.substring(0,Math.min(255,t.length))+e,i=await async function(t,e){try{const o=I.encode(e),i=await _("SHA-1",t,o);return btoa(String.fromCharCode(...new Uint8Array(i)))}catch(t){return A.error(t),!1}}(this.API_HMAC_KEY,o);if(!i)throw new lt("Failed to get weverse HMAC signature");return{wmsgpad:e.toString(),wmd:i}}async getHashURLParams(t){const e=await this.createHash(t);return new URLSearchParams(e).toString()}async getPostPreview(t){const e=`/post/v1.0/post-${t}/preview?`+new URLSearchParams({fieldSet:"postForPreview",...this.getURLData()}).toString();try{const t=await this.getHashURLParams(e),o=await this.fetch(this.API_ORIGIN+e+"&"+t,{headers:this.HEADERS});return await o.json()}catch(e){return A.error(`Failed to get weverse post preview by postId: ${t}`,e.message),!1}}async getVideoInKey(t){const e=`/video/v1.1/vod/${t}/inKey?`+new URLSearchParams({gcc:"RU",...this.getURLData()}).toString();try{const t=await this.getHashURLParams(e),o=await this.fetch(this.API_ORIGIN+e+"&"+t,{method:"POST",headers:this.HEADERS});return await o.json()}catch(e){return A.error(`Failed to get weverse InKey by videoId: ${t}`,e.message),!1}}async getVideoInfo(t,e,o){const i=Date.now();try{const a=new URLSearchParams({key:e,sid:o,nonce:i.toString(),devt:"html5_pc",prv:"N",aup:"N",stpb:"N",cpl:"en",env:"prod",lc:"en",adi:JSON.stringify([{adSystem:null}]),adu:"/"}).toString(),n=await this.fetch(`https://global.apis.naver.com/rmcnmv/rmcnmv/vod/play/v2.0/${t}?`+a,{headers:this.HEADERS});return await n.json()}catch(i){return A.error(`Failed to get weverse video info (infraVideoId: ${t}, inkey: ${e}, serviceId: ${o}`,i.message),!1}}extractVideoInfo(t){return t.find((t=>!1===t.useP2P&&t.source.includes(".mp4")))}async getVideoData(t){const e=await this.getPostPreview(t);if(!e)return;const{videoId:o,serviceId:i,infraVideoId:a}=e.extension.video;if(!(o&&i&&a))return;const n=await this.getVideoInKey(o);if(!n)return;const r=await this.getVideoInfo(a,n.inKey,i);if(!r)return;const s=this.extractVideoInfo(r.videos.list);return s?{url:s.source,duration:s.duration}:void 0}async getVideoId(t){return/([^/]+)\/(live|media)\/([^/]+)/.exec(t.pathname)?.[3]}},[S.kodik]:class extends dt{API_ORIGIN=window.location.origin;async getSecureData(t){try{const e=await this.fetch(`${this.API_ORIGIN}${t}`,{headers:{"User-Agent":P.userAgent,Origin:this.API_ORIGIN,Referer:this.API_ORIGIN}}),o=await e.text(),[i,a,n]=t.split("/").filter((t=>t)),r=(new DOMParser).parseFromString(o,"text/html"),s=Array.from(r.getElementsByTagName("script")).filter((t=>t.innerHTML.includes(`videoId = "${a}"`)));if(!s.length)throw new lt("Failed to find secure script");const l=/'{[^']+}'/.exec(s[0].textContent.trim())?.[0];if(!l)throw new lt("Secure json wasn't found in secure script");const d=JSON.parse(l.replaceAll("'",""));return{videoType:i,videoId:a,hash:n,...d}}catch(e){return A.error(`Failed to get kodik secure data by videoPath: ${t}.`,e.message),!1}}async getFtor(t){const{videoType:e,videoId:o,hash:i,d:a,d_sign:n,pd:r,pd_sign:s,ref:l,ref_sign:d}=t;try{const t=await this.fetch(this.API_ORIGIN+"/ftor",{method:"POST",headers:{"User-Agent":P.userAgent,Origin:this.API_ORIGIN,Referer:`${this.API_ORIGIN}/${e}/${o}/${i}/360p`},body:new URLSearchParams({d:a,d_sign:n,pd:r,pd_sign:s,ref:decodeURIComponent(l),ref_sign:d,bad_user:"false",cdn_is_working:"true",info:"{}",type:e,hash:i,id:o})});return await t.json()}catch(t){return A.error(`Failed to get kodik video data (type: ${e}, id: ${o}, hash: ${i})`,t.message),!1}}decryptUrl(t){const e=atob(t.replace(/[a-zA-Z]/g,(function(t){const e=t.charCodeAt(0)+13,o=t<="Z"?90:122;return String.fromCharCode(o>=e?e:e-26)})));return"https:"+e}async getVideoData(t){const e=await this.getSecureData(t);if(!e)return;const o=await this.getFtor(e);if(!o)return;const i=Object.entries(o.links[o.default.toString()]),a=i.find((([t,e])=>"application/x-mpegURL"===e.type))?.[1];return a?{url:this.decryptUrl(a.src)}:void 0}async getVideoId(t){return/\/(seria|video)\/([^/]+)\/([^/]+)\/([\d]+)p/.exec(t.pathname)?.[0]}},[S.patreon]:class extends dt{API_ORIGIN="https://www.patreon.com/api";async getPosts(t){try{const e=await this.fetch(`${this.API_ORIGIN}/posts/${t}?json-api-use-default-includes=false`);return await e.json()}catch(e){return A.error(`Failed to get patreon posts by postId: ${t}.`,e.message),!1}}async getVideoData(t){const e=await this.getPosts(t);if(!e)return;const o=e.data.attributes.post_file.url;return o?{url:o}:void 0}async getVideoId(t){const e=/posts\/([^/]+)/.exec(t.pathname)?.[1];if(e)return e.replace(/[^\d.]/g,"")}},[S.reddit]:class extends dt{API_ORIGIN="https://www.reddit.com";async getVideoData(t){try{const t=document.querySelector("[data-hls-url]")?.dataset.hlsUrl.replaceAll("&","&");if(!t)throw new lt("Failed to find content url");return{url:decodeURIComponent(t)}}catch(e){return void A.error(`Failed to get reddit video data by video ID: ${t}`,e.message)}}async getVideoId(t){return/\/r\/(([^/]+)\/([^/]+)\/([^/]+)\/([^/]+))/.exec(t.pathname)?.[1]}},[S.bannedvideo]:class extends dt{API_ORIGIN="https://api.banned.video";async getVideoInfo(t){try{const e=await this.fetch(`${this.API_ORIGIN}/graphql`,{method:"POST",body:JSON.stringify({operationName:"GetVideo",query:"query GetVideo($id: String!) {\n getVideo(id: $id) {\n title\n description: summary\n duration: videoDuration\n videoUrl: directUrl\n isStream: live\n }\n }",variables:{id:t}}),headers:{"User-Agent":"bannedVideoFrontEnd","apollographql-client-name":"banned-web","apollographql-client-version":"1.3","content-type":"application/json"}});return await e.json()}catch(e){return console.error(`Failed to get bannedvideo video info by videoId: ${t}.`,e.message),!1}}async getVideoData(t){const e=await this.getVideoInfo(t);if(!e)return;const{videoUrl:o,duration:i,isStream:a,description:n,title:r}=e.data.getVideo;return{url:o,duration:i,isStream:a,title:r,description:n}}async getVideoId(t){return t.searchParams.get("id")??void 0}},[S.kick]:class extends dt{API_ORIGIN="https://kick.com/api";async getClipInfo(t){try{const e=await this.fetch(`${this.API_ORIGIN}/v2/clips/${t}`),o=await e.json(),{clip_url:i,duration:a,title:n}=o.clip;return{url:i,duration:a,title:n}}catch(e){return void A.error(`Failed to get kick clip info by clipId: ${t}.`,e.message)}}async getVideoInfo(t){try{const e=await this.fetch(`${this.API_ORIGIN}/v1/video/${t}`),o=await e.json(),{source:i,livestream:a}=o,{session_title:n,duration:r}=a;return{url:i,duration:Math.round(r/1e3),title:n}}catch(e){return void A.error(`Failed to get kick video info by videoId: ${t}.`,e.message)}}async getVideoData(t){return t.startsWith("videos")?await this.getVideoInfo(t.replace("videos/","")):await this.getClipInfo(t.replace("clips/",""))}async getVideoId(t){return/([^/]+)\/((videos|clips)\/([^/]+))/.exec(t.pathname)?.[2]}},[S.appledeveloper]:class extends dt{API_ORIGIN="https://developer.apple.com";async getVideoData(t){try{const t=document.querySelector("meta[property='og:video']")?.content;if(!t)throw new lt("Failed to find content url");return{url:t}}catch(e){return void A.error(`Failed to get apple developer video data by video ID: ${t}`,e.message)}}async getVideoId(t){return/videos\/play\/([^/]+)\/([\d]+)/.exec(t.pathname)?.[0]}},[S.epicgames]:class extends dt{API_ORIGIN="https://dev.epicgames.com/community/api/learning";async getPostInfo(t){try{const e=await this.fetch(`${this.API_ORIGIN}/post.json?hash_id=${t}`);return await e.json()}catch(e){return A.error(`Failed to get epicgames post info by videoId: ${t}.`,e.message),!1}}async getVideoData(t){const e=await this.getPostInfo(t);if(!e)return;const o=e.blocks.find((t=>"video"===t.type)),i=o?.video_url?.replace("qsep://","https://");if(!i)return;const{title:a,description:n}=e,r=o?.video_captions?.map((t=>({language:B(t.locale),format:"vtt",url:t.signed_url})));return{url:i,title:a,description:n,subtitles:r}}async getVideoId(t){return/\/(\w{3,5})\/[^/]+$/.exec(t.pathname)?.[1]}},[S.nineanimetv]:class extends dt{API_ORIGIN="https://9animetv.to/ajax/episode";RAPID_CLOUD_ORIGIN="https://rapid-cloud.co/ajax/embed-6-v2";async getSourceId(t){try{const e=await this.fetch(`${this.API_ORIGIN}/servers?episodeId=${t}`),o=await e.json();return!!o.html&&/data-id="(\d+)"/.exec(o.html)?.[1]}catch(e){return A.error(`Failed to get 9animetv servers info by episodeId: ${t}.`,e.message),!1}}async getPlayerLink(t){try{const e=await this.fetch(`${this.API_ORIGIN}/sources?id=${t}`),o=await e.json();return!!o.link.includes("rapid-cloud.co")&&o.link}catch(e){return A.error(`Failed to get player link by sourceId: ${t}.`,e.message),!1}}async getRapidCloudData(t){try{const e=await this.fetch(`${this.RAPID_CLOUD_ORIGIN}/getSources?id=${t}`),o=await e.json();return o.encrypted?(A.warn("Encrypted RapidCloud data found. Let us know about it",o),!1):o}catch(e){return A.error(`Failed to get rapid cloud data by rapidId: ${t}.`,e.message),!1}}async getVideoData(t){const e=t.split("?ep=")[1],o=await this.getSourceId(e);if(!o)return;const i=await this.getPlayerLink(o);if(!i)return;const a=/\/([^/?]+)\?/.exec(i)?.[1];if(!a)return;const n=await this.getRapidCloudData(a);if(!n)return;const r=n.sources.find((t=>"hls"===t.type))?.file;if(!r)return;const s=n.tracks.reduce(((t,e)=>{const o=/([\w+]+)(-\d)?\.vtt/.exec(e.file)?.[1];if(!o)return t;const i=B(3===o.length?o:e.label);return t.find((t=>t.language===i))||t.push({language:i,format:"vtt",url:e.file}),t}),[]);return{url:r,subtitles:s}}async getVideoId(t){return new Promise((t=>{const e="https://9animetv.to";window.addEventListener("message",(o=>{o.origin===e&&o.data?.startsWith("getVideoId:")&&t(o.data.replace("getVideoId:",""))})),window.top.postMessage("getVideoId",e)}))}},[S.odysee]:class extends dt{API_ORIGIN="https://odysee.com";async getVideoData(t){try{const e=await this.fetch(`${this.API_ORIGIN}/${t}`),o=await e.text(),i=/"contentUrl":(\s)?"([^"]+)"/.exec(o)?.[2];if(!i)throw new Error("Odysee url doesn't parsed");return{url:i}}catch(e){return void A.error(`Failed to get odysee video data by video ID: ${t}`,e.message)}}async getVideoId(t){return t.pathname.slice(1)}},[S.coursehunterLike]:class extends dt{API_ORIGIN=this.origin??"https://coursehunter.net";async getCourseId(t){try{const e=await this.fetch(`${this.API_ORIGIN}/${t}`),o=await e.text();return/course_id(\s)?=(\s)?([\d]+)/.exec(o)?.[3]}catch(e){return A.error(`Failed to get CoursehunterLike courseId by videoId: ${t}, because ${e.message}`),!1}}async getLessonsData(t){try{const e=await this.fetch(`${this.API_ORIGIN}/api/v1/course/${t}/lessons`);return await e.json()}catch(e){return A.error(`Failed to get CoursehunterLike lessons data by courseId: ${t}, because ${e.message}`),!1}}async getVideoData(t){const e=await this.getCourseId(t);if(!e)return;const o=await this.getLessonsData(e);if(!o)return;const i=+(t.split("?lesson=")?.[1]??1),a=o?.[i-1],{file:n,duration:r,title:s}=a;return n?{url:n,duration:r,title:s}:void 0}async getVideoId(t){const e=/course\/([^/]+)/.exec(t.pathname)?.[0];return e?e+t.search:void 0}},[S.twitch]:class extends dt{API_ORIGIN="https://clips.twitch.tv";async getClipLink(t,e){const o=document.querySelector("script[type='application/ld+json']"),i=t.slice(1);if(o){const t=JSON.parse(o.innerText),e=t["@graph"].find((t=>"VideoObject"===t["@type"]))?.creator.url;return`${e.replace("https://www.twitch.tv/","")}/clip/${i}`}const a="embed"===i,n=document.querySelector(a?".tw-link[data-test-selector='stream-info-card-component__stream-avatar-link']":".clips-player a:not([class])");if(!n)return;return`${n.href.replace("https://www.twitch.tv/","")}/clip/${a?e:i}`}async getVideoId(t){const e=t.pathname;if(/^m\.twitch\.tv$/.test(e))return/videos\/([^/]+)/.exec(t.href)?.[0]??e.slice(1);if(/^player\.twitch\.tv$/.test(t.hostname))return`videos/${t.searchParams.get("video")}`;const o=/([^/]+)\/(?:clip)\/([^/]+)/.exec(e);if(o)return o[0];return/^clips\.twitch\.tv$/.test(t.hostname)?await this.getClipLink(e,t.searchParams.get("clip")):/(?:videos)\/([^/]+)/.exec(e)?.[0]}},[S.sap]:class extends dt{API_ORIGIN="https://learning.sap.com/";async requestKaltura(t,e,o){try{const i=await this.fetch(`https://${t}/api_v3/service/multirequest`,{method:"POST",body:JSON.stringify({1:{service:"session",action:"startWidgetSession",widgetId:`_${e}`},2:{service:"baseEntry",action:"list",ks:"{1:result:ks}",filter:{redirectFromEntryId:o},responseProfile:{type:1,fields:"id,referenceId,name,description,dataUrl,duration,flavorParamsIds,type,dvrStatus,externalSourceType,createdAt,updatedAt,endDate,plays,views,downloadUrl,creatorId"}},3:{service:"baseEntry",action:"getPlaybackContext",entryId:"{2:result:objects:0:id}",ks:"{1:result:ks}",contextDataParams:{objectType:"KalturaContextDataParams",flavorTags:"all"}},apiVersion:"3.3.0",format:1,ks:"",clientTag:"html5:v3.17.22",partnerId:e}),headers:{"Content-Type":"application/json"}});return await i.json()}catch(t){return void A.error("Failed to request kaltura data",t.message)}}async getKalturaData(t){try{const e=/https:\/\/([^"]+)\/p\/([^"]+)\/embedPlaykitJs\/uiconf_id\/([^"]+)/.exec(document.querySelector('script[data-nscript="beforeInteractive"]')?.src);if(!e)throw new lt(`Failed to get sap data for videoId: ${t}`);const[,o,i]=e;let a=document.querySelector("#shadow")?.firstChild?.getAttribute("id");if(a||(a=/"sourceId":\s?"([^"]+)"/.exec(document.querySelector("#__NEXT_DATA__")?.innerText)?.[1]),!o||Number.isNaN(+i)||!a)throw new lt(`One of the necessary parameters for getting a link to a sap video in wasn't found for ${t}. Params: kalturaDomain = ${o}, partnerId = ${i}, entryId = ${a}`);return await this.requestKaltura(o,i,a)}catch(t){return void A.error("Failed to get kaltura data",t.message)}}async getVideoData(t){const e=await this.getKalturaData(t);if(!e)return;const[,o,i]=e,{duration:a}=o.objects[0],n=i.sources.find((t=>"url"===t.format&&"http,https"===t.protocols&&t.url.includes(".mp4")))?.url;if(!n)return;return{url:n,subtitles:i.playbackCaptions.map((t=>({language:B(t.languageCode),format:"vtt",url:t.webVttUrl,isAutoGenerated:t.label.includes("auto-generated")}))),duration:a}}async getVideoId(t){return/((courses|learning-journeys)\/([^/]+)(\/[^/]+)?)/.exec(t.pathname)?.[1]}},[S.udemy]:class extends dt{API_ORIGIN="https://www.udemy.com/api-2.0";getModuleData(){const t=document.querySelector(".ud-app-loader[data-module-id='course-taking']")?.dataset?.moduleArgs;return t?JSON.parse(t):(console.error(X.get("udemyModuleArgsNotFound")),{})}getLectureId(){return/learn\/lecture\/([^/]+)/.exec(window.location.pathname)?.[1]}async getLectureData(t,e){const o=await this.fetch(`${this.API_ORIGIN}/users/me/subscribed-courses/${t}/lectures/${e}/?`+new URLSearchParams({"fields[lecture]":"title,description,asset","fields[asset]":"length,media_sources,captions"}));return await o.json()}async getCourseLang(t){const e=await this.fetch(`${this.API_ORIGIN}/users/me/subscribed-courses/${t}?`+new URLSearchParams({"fields[course]":"locale"}));return await e.json()}findVideoUrl(t){return t?.find((t=>"video/mp4"===t.type))?.src}findSubtitleUrl(t,e){let o=t?.find((t=>B(t.locale_id)===e));return o||(o=t?.find((t=>"en"===B(t.locale_id)))??t?.[0]),o?.url}async getVideoData(t){const{courseId:e}=this.getModuleData();if(!e)return;const o=this.getLectureId();if(D.log(`[Udemy] courseId: ${e}, lectureId: ${o}`),!o)return;const{title:i,description:a,asset:n}=await this.getLectureData(e,o),{length:r,media_sources:s,captions:l}=n,d=this.findVideoUrl(s);if(!d)return void console.log("Failed to find .mp4 video file in media_sources",s);const u=await this.getCourseLang(e);let{locale:{locale:c}}=u;c=c?B(c):"en",ut.includes(c)||(c="en");const h=this.findSubtitleUrl(l,c);return h||console.log("Failed to find subtitle file in captions",l),{...h?{url:this.service?.url+t,translationHelp:[{target:"subtitles_file_url",targetUrl:h},{target:"video_file_url",targetUrl:d}],detectedLanguage:c}:{url:d,translationHelp:null},duration:r,title:i,description:a}}async getVideoId(t){return t.pathname.slice(1)}},[S.coursera]:class extends dt{API_ORIGIN="https://www.coursera.org/api";async getCourseData(t){const e=await this.fetch(`${this.API_ORIGIN}/onDemandCourses.v1/${t}`),o=await e.json();return o?.elements?.[0]}getPlayer(){return document.querySelector(".vjs-v8")}getPlayerData(){return this.getPlayer()?.player}findVideoUrl(t){return t?.find((t=>"video/mp4"===t.type))?.src}findSubtitleUrl(t,e){let o=t?.find((t=>B(t.srclang)===e));return o||(o=t?.find((t=>"en"===B(t.srclang)))||t?.[0]),o?.src}async getVideoData(t){const e=this.getPlayerData(),{duration:o}=e?.cache_||{},{courseId:i,tracks:a,sources:n}=e?.options_||{},r=this.findVideoUrl(n);if(!r)return void console.log("Failed to find .mp4 video file in sources",n);const{primaryLanguageCodes:s}=await this.getCourseData(i);let l=s?.[0];l=l?B(l):"en",ut.includes(l)||(l="en");const d=this.findSubtitleUrl(a,l);return d||console.log("Failed to find subtitle file in tracks",a),{...d?{url:this.service?.url+t,translationHelp:[{target:"subtitles_file_url",targetUrl:d},{target:"video_file_url",targetUrl:r}]}:{url:r,translationHelp:null},detectedLanguage:l,duration:o}}async getVideoId(t){return/learn\/([^/]+)\/lecture\/([^/]+)/.exec(t.pathname)?.[0]}},[S.linkedin]:class extends dt{API_ORIGIN="https://www.linkedin.com/learning";async getVideoData(t){try{const e=document.querySelector(".video-js");if(!e)throw new lt(`Failed to find video element for videoID ${t}`);const o=(e.getAttribute("data-sources")??"[]").replaceAll(""",'"').replaceAll("&","&"),i=JSON.parse(o).find((t=>t.src.includes(".mp4")));if(!i)throw new Error(`Failed to find video url for videoID ${t}`);const a=new URL(i.src),n=e.getAttribute("data-captions-url"),r=n?[{language:"en",format:"vtt",url:n}]:void 0;return{url:N(a),subtitles:r}}catch(t){return void A.error("Failed to get linkedin video data",t.message)}}async getVideoId(t){return/\/learning\/(([^/]+)\/([^/]+))/.exec(t.pathname)?.[1]}},[S.vimeo]:class extends dt{API_KEY="";DEFAULT_SITE_ORIGIN="https://vimeo.com";SITE_ORIGIN=this.isPrivatePlayer()?this.service?.url?.slice(0,-1)??this.DEFAULT_SITE_ORIGIN:this.DEFAULT_SITE_ORIGIN;isErrorData(t){return Object.hasOwn(t,"error")}isPrivatePlayer(){return this.referer&&!this.referer.includes("vimeo.com")}async getViewerData(){try{const t=await this.fetch("https://vimeo.com/_next/viewer"),e=await t.json(),{apiUrl:o,jwt:i}=e;return this.API_ORIGIN=`https://${o}`,this.API_KEY=`jwt ${i}`,e}catch(t){return A.error("Failed to get default viewer data.",t.message),!1}}async getVideoInfo(t){try{const e=new URLSearchParams({fields:"name,link,description,duration"}).toString(),o=await this.fetch(`${this.API_ORIGIN}/videos/${t}?${e}`,{headers:{Authorization:this.API_KEY}}),i=await o.json();if(this.isErrorData(i))throw new Error(i.developer_message??i.error);return i}catch(e){return A.error(`Failed to get video info by video ID: ${t}`,e.message),!1}}async getPrivateVideoSource(t){try{const{default_cdn:e,cdns:o}=t.dash,i=o[e].url,a=await this.fetch(i);if(200!==a.status)throw new lt(await a.text());const n=await a.json(),r=new URL(i),s=Array.from(n.base_url.matchAll(/\.\.\//g)).length+1,l=r.pathname.split("/");let d=n.base_url.replaceAll("../","");d=d&&!d.startsWith("/")?`/${d}`:d,r.pathname=l.slice(0,l.length-s).join("/")+d,r.pathname.endsWith("/")||(r.pathname+="/");const u=n.audio.find((t=>"audio/mp4"===t.mime_type&&"dash"===t.format));if(!u)throw new lt("Failed to find video data");const c=u.segments?.[0]?.url;if(!c)throw new lt("Failed to find first segment url");const[h,p]=c.split("?",2),g=new URLSearchParams(p);return g.delete("range"),r.pathname+=`${u.base_url}${h}`,r.href=r.href.split("?")[0]+"?"+g.toString(),r.href}catch(t){return A.error("Failed to get private video source",t.message),!1}}async getPrivateVideoInfo(t){try{const e=await this.getPrivateVideoSource(playerConfig.request.files);if(!e)throw new lt("Failed to get private video source");const{title:o,duration:i}=playerConfig.video,{text_tracks:a}=playerConfig.request;return{url:`${this.SITE_ORIGIN}/${t}`,video_url:e,title:o,duration:i,subs:a}}catch(e){return A.error(`Failed to get private video info by video ID: ${t}`,e.message),!1}}async getSubsInfo(t){try{const e=new URLSearchParams({per_page:"100",fields:"language,type,link"}).toString(),o=await this.fetch(`${this.API_ORIGIN}/videos/${t}/texttracks?${e}`,{headers:{Authorization:this.API_KEY}}),i=await o.json();if(this.isErrorData(i))throw new Error(i.developer_message??i.error);return i}catch(e){return A.error(`Failed to get subtitles info by video ID: ${t}`,e.message),!1}}async getVideoData(t){const e=this.isPrivatePlayer();if(!this.extraInfo)return this.returnBaseData(t);if(e){const e=await this.getPrivateVideoInfo(t);if(!e)return;const{url:o,subs:i,video_url:a,title:n,duration:r}=e,s=i.map((t=>({language:B(t.lang),format:"vtt",url:this.SITE_ORIGIN+t.url,isAutoGenerated:t.lang.includes("autogenerated")}))),l=s.length?[{target:"video_file_url",targetUrl:a},{target:"subtitles_file_url",targetUrl:s[0].url}]:null;return{...l?{url:o,translationHelp:l}:{url:a},subtitles:s,title:n,duration:r}}t.startsWith("video/")&&(t=t.replace("video/","")),t.includes("/")&&(t=t.replace("/",":"));if(!await this.getViewerData())return this.returnBaseData(t);const o=await this.getVideoInfo(t);if(!o)return this.returnBaseData(t);const i=await this.getSubsInfo(t),a=i?i.data.map((t=>({language:B(t.language),format:"vtt",url:t.link,isAutoGenerated:t.language.includes("autogen")}))):[],{link:n,duration:r,name:s,description:l}=o;return{url:n,title:s,description:l,subtitles:a,duration:r}}async getVideoId(t){const e=/[^/]+\/[^/]+$/.exec(t.pathname)?.[0];return this.isPrivatePlayer()?e:e?.startsWith("video/")?e.replace("video/",""):e??/[^/]+$/.exec(t.pathname)?.[0]}},[S.yandexdisk]:class extends dt{API_ORIGIN="https://disk.yandex.ru";CLIENT_PREFIX="/client/disk";async getVideoData(t){if(!t.startsWith(this.CLIENT_PREFIX))return{url:this.service.url+t};const e=new URL(window.location).searchParams.get("idDialog");if(!e)return;const o=document.querySelector("#preloaded-data");if(o)try{const t=JSON.parse(o.innerText),{idClient:i,sk:a}=t.config,n=await this.fetch(this.API_ORIGIN+"/models/?_m=resource",{method:"POST",body:new URLSearchParams({idClient:i,sk:a,"_model.0":"resource","id.0":e.replaceAll(" ","+")}).toString().replaceAll(/%2B/g,"+"),headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}}),r=await n.json();if(!r.models)throw new lt("Failed to get resource info");const s=r.models[0].data;if(Object.hasOwn(s,"error"))throw new lt(s.error?.message);const{meta:l,name:d}=s,{short_url:u,video_info:c}=l;if(!c)throw new lt("There's no video open right now");if(!u)throw new lt("VOTLimitedVideoAccess");return{url:u,title:d.replace(/(\.[^.]+)$/,""),duration:c.duration}}catch(e){if(e.message?.startsWith("VOT"))throw new pt(e.message);return void console.error(`Failed to get yandex disk video data by video ID: ${t}`,e.message)}}async getVideoId(t){const e=/\/i\/([^/]+)/.exec(t.pathname)?.[1];return e||(t.pathname.startsWith(this.CLIENT_PREFIX)?t.pathname+t.search:void 0)}},[S.vk]:class extends dt{async getVideoId(t){const e=/^\/(video|clip)-?\d{8,9}_\d{9}$/.exec(t.pathname);if(e)return e[0].slice(1);const o=t.searchParams.get("z");if(o)return o.split("/")[0];const i=t.searchParams.get("oid"),a=t.searchParams.get("id");return i&&a?`video-${Math.abs(parseInt(i))}_${a}`:void 0}},[S.trovo]:class extends dt{async getVideoId(t){const e=t.searchParams.get("vid"),o=/([^/]+)\/([\d]+)/.exec(t.pathname)?.[0];if(e&&o)return`${o}?vid=${e}`}},[S.incestflix]:class extends dt{async getVideoData(t){try{const t=document.querySelector("#incflix-stream source:first-of-type");if(!t)throw new lt("Failed to find source element");const e=t.getAttribute("src"),o=new URL(e.startsWith("//")?`https:${e}`:e);return o.searchParams.append("media-proxy","video.mp4"),{url:N(o)}}catch(e){return void A.error(`Failed to get Incestflix data by videoId: ${t}`,e.message)}}async getVideoId(t){return/\/watch\/([^/]+)/.exec(t.pathname)?.[1]}},[S.porntn]:class extends dt{async getVideoData(t){try{const t=document.body.innerHTML,e=/var flashvars\s=\s/,o=document.getElementsByTagName("script").find((t=>e.exec(t.textContent)));if(!o)throw new lt("Failed to find data script");const i=o.textContent.split(e)?.[1]?.split(";\n",1)[0].replace(/(\t|\n)/g,"");A.log(i);const a=/video_url: 'function\/0\/([^']+)'/.exec(t)?.[1],n=/rnd: '([^']+)'/.exec(t)?.[1];if(!a||!n)throw new lt("Failed to find video source or rnd");const r=/video_title: '([^']+)'/.exec(t)?.[1],s=new URL(a);return s.searchParams.append("rnd",n),A.log(s.href),{url:N(s),title:r}}catch(e){return void A.error(`Failed to get PornTN data by videoId: ${t}`,e.message)}}async getVideoId(t){return/\/videos\/(([^/]+)\/([^/]+))/.exec(t.pathname)?.[1]}}};class mt{helpersData;constructor(t={}){this.helpersData=t}getHelper(t){return new gt[t](this.helpersData)}}class vt extends Error{constructor(t){super(t),this.name="VideoDataError",this.message=t}}async function ft(t,e,o={}){const i=new URL(window.location.href),a=t.host;if(Object.keys(gt).includes(a)){const t=new mt(o).getHelper(a);return await t.getVideoId(i)}switch(a){case S.custom:return i.href;case S.piped:case S.poketube:case S.invidious:case S.ricktube:case S.youtube:return"youtu.be"===i.hostname&&(i.search=`?v=${i.pathname.replace("/","")}`,i.pathname="/watch"),/(?:watch|embed|shorts|live)\/([^/]+)/.exec(i.pathname)?.[1]??i.searchParams.get("v");case S.nine_gag:case S.gag:return/gag\/([^/]+)/.exec(i.pathname)?.[1];case S.proxitok:case S.tiktok:return/([^/]+)\/video\/([^/]+)/.exec(i.pathname)?.[0];case S.xvideos:return/[^/]+\/[^/]+$/.exec(i.pathname)?.[0];case S.pornhub:return i.searchParams.get("viewkey")??/embed\/([^/]+)/.exec(i.pathname)?.[1];case S.twitter:return/status\/([^/]+)/.exec(i.pathname)?.[1];case S.rumble:case S.facebook:return i.pathname.slice(1);case S.rutube:return/(?:video|embed)\/([^/]+)/.exec(i.pathname)?.[1];case S.bilibili:{const t=/bangumi\/play\/([^/]+)/.exec(i.pathname)?.[0];if(t)return t;const e=i.searchParams.get("bvid");if(e)return`video/${e}`;let o=/video\/([^/]+)/.exec(i.pathname)?.[0];return o&&null!==i.searchParams.get("p")&&(o+=`/?p=${i.searchParams.get("p")}`),o}case S.bitchute:return/(video|embed)\/([^/]+)/.exec(i.pathname)?.[2];case S.eporner:return/video-([^/]+)\/([^/]+)/.exec(i.pathname)?.[0];case S.peertube:return/\/w\/([^/]+)/.exec(i.pathname)?.[0];case S.dailymotion:{const t=Array.from(document.querySelectorAll("*")).filter((t=>t.innerHTML.trim().includes(".m3u8")));let e=t?.[1]?.lastChild?.src;if(!e)return;return/\/video\/(\w+)\.m3u8/.exec(e)?.[1]}case S.okru:return/\/video\/(\d+)/.exec(i.pathname)?.[1];case S.googledrive:return i.searchParams.get("docid");case S.newgrounds:return/([^/]+)\/(view)\/([^/]+)/.exec(i.pathname)?.[0];case S.egghead:return i.pathname.slice(1);case S.youku:return/v_show\/id_[\w=]+/.exec(i.pathname)?.[0];case S.archive:return/(details|embed)\/([^/]+)/.exec(i.pathname)?.[2];case S.watchpornto:return/(video|embed)\/(\d+)(\/[^/]+\/)?/.exec(i.pathname)?.[0];default:return}}async function bt(t,e,o={}){const i=await ft(t,0,o);if(!i)throw new vt(`Entered unsupported link: "${t.host}"`);const a=window.location.origin;if([S.peertube,S.coursehunterLike].includes(t.host)&&(t.url=a),t.rawResult)return{url:i,videoId:i,host:t.host,duration:void 0};if(!t.needExtraData)return{url:t.url+i,videoId:i,host:t.host,duration:void 0};const n=new mt({...o,service:t,origin:a}).getHelper(t.host),r=await n.getVideoData(i);if(!r)throw new vt(`Failed to get video raw url for ${t.host}`);return{...r,videoId:i,host:t.host}}class yt extends Error{data;constructor(t,e=void 0){super(t),this.data=e,this.name="VOTJSError",this.message=t}}class wt{host;hostVOT;schema;schemaVOT;fetch;fetchOpts;getVideoDataFn;sessions={};requestLang;responseLang;userAgent=P.userAgent;paths={videoTranslation:"/video-translation/translate",videoTranslationFailAudio:"/video-translation/fail-audio-js",videoTranslationAudio:"/video-translation/audio",videoSubtitles:"/video-subtitles/get-subtitles",streamPing:"/stream-translation/ping-stream",streamTranslation:"/stream-translation/translate-stream",createSession:"/session/create"};isCustomLink(t){return!!(/\.(m3u8|m4(a|v)|mpd)/.exec(t)??/^https:\/\/cdn\.qstv\.on\.epicgames\.com/.exec(t))}headers={"User-Agent":this.userAgent,Accept:"application/x-protobuf","Accept-Language":"en","Content-Type":"application/x-protobuf",Pragma:"no-cache","Cache-Control":"no-cache","Sec-Fetch-Mode":"no-cors"};headersVOT={"User-Agent":`vot.js/${P.version}`,"Content-Type":"application/json",Pragma:"no-cache","Cache-Control":"no-cache"};constructor({host:t=P.host,hostVOT:e=P.hostVOT,fetchFn:o=E,fetchOpts:i={},getVideoDataFn:a=bt,requestLang:n="en",responseLang:r="ru",headers:s={}}={}){const l=/(http(s)?):\/\//,d=l.exec(t)?.[1];this.host=d?t.replace(`${d}://`,""):t,this.schema=d??"https";const u=l.exec(e)?.[1];this.hostVOT=u?e.replace(`${u}://`,""):e,this.schemaVOT=u??"https",this.fetch=o,this.fetchOpts=i,this.getVideoDataFn=a,this.requestLang=n,this.responseLang=r,this.headers={...this.headers,...s}}getOpts(t,e={},o="POST"){return{method:o,headers:{...this.headers,...e},body:t,...this.fetchOpts}}async request(t,e,o={},i="POST"){const a=this.getOpts(new Blob([e]),o,i);try{const e=await this.fetch(`${this.schema}://${this.host}${t}`,a),o=await e.arrayBuffer();return{success:200===e.status,data:o}}catch(t){return{success:!1,data:t?.message}}}async requestJSON(t,e=null,o={},i="POST"){const a=this.getOpts(e,{"Content-Type":"application/json",...o},i);try{const e=await this.fetch(`${this.schema}://${this.host}${t}`,a),o=await e.json();return{success:200===e.status,data:o}}catch(t){return{success:!1,data:t?.message}}}async requestVOT(t,e,o={}){const i=this.getOpts(JSON.stringify(e),{...this.headersVOT,...o});try{const e=await this.fetch(`${this.schemaVOT}://${this.hostVOT}${t}`,i),o=await e.json();return{success:200===e.status,data:o}}catch(t){return{success:!1,data:t?.message}}}async getSession(t){const e=Math.floor(Date.now()/1e3),o=this.sessions[t];if(o&&o.timestamp+o.expires>e)return o;const{secretKey:i,expires:a,uuid:n}=await this.createSession(t);return this.sessions[t]={secretKey:i,expires:a,timestamp:e,uuid:n},this.sessions[t]}async translateVideoYAImpl({videoData:t,requestLang:e=this.requestLang,responseLang:o=this.responseLang,translationHelp:i=null,headers:a={},extraOpts:n={},shouldSendFailedAudio:r=!0}){const{url:s,duration:l=P.defaultDuration}=t,d=await this.getSession("video-translation"),u=C.encodeTranslationRequest(s,l,e,o,i,n),c=this.paths.videoTranslation,h=await O("Vtrans",d,u,c),p=await this.request(c,u,{...h,...a});if(!p.success)throw new pt("requestTranslationFailed");const g=C.decodeTranslationResponse(p.data);switch(D.log("requestTranslation",g),g.status){case k.FAILED:throw g?.message?new yt("Yandex couldn't translate video",g):new pt("requestTranslationFailed");case k.FINISHED:case k.PART_CONTENT:if(!g.url)throw new pt("audioNotReceived");return{translated:!0,url:g.url,remainingTime:g.remainingTime??-1};case k.WAITING:return{translated:!1,remainingTime:g.remainingTime};case k.LONG_WAITING:case k.LONG_WAITING_2:return s.startsWith("https://youtu.be/")&&r?(await this.requestVtransFailAudio(s),await this.requestVtransAudio(s,g.translationId),await this.translateVideoYAImpl({videoData:t,requestLang:e,responseLang:o,translationHelp:i,headers:a,shouldSendFailedAudio:!1})):{translated:!1,remainingTime:g.remainingTime??-1};default:throw A.error("Unknown response",g),new yt("Unknown response from Yandex",g)}}async translateVideoVOTImpl({url:t,videoId:e,service:o,requestLang:i=this.requestLang,responseLang:a=this.responseLang,headers:n={}}){const r=function(t,e,o){return t===S.patreon?{service:"mux",videoId:new URL(o).pathname.slice(1)}:{service:t,videoId:e}}(o,e,t),s=await this.requestVOT(this.paths.videoTranslation,{provider:"yandex",service:r.service,videoId:r.videoId,fromLang:i,toLang:a,rawVideo:t},n);if(!s.success)throw new pt("requestTranslationFailed",s);const l=s.data;switch(l.status){case"failed":throw new yt("Yandex couldn't translate video",l);case"success":if(!l.translatedUrl)throw new pt("audioNotReceived");return{translated:!0,url:l.translatedUrl,remainingTime:-1};case"waiting":return{translated:!1,remainingTime:l.remainingTime,message:l.message}}}async requestVtransFailAudio(t){const e=await this.requestJSON(this.paths.videoTranslationFailAudio,JSON.stringify({video_url:t}),void 0,"PUT");if(!e.data||"string"==typeof e.data||1!==e.data.status)throw new yt("Failed to request to fake video translation fail audio js",e);return e}async requestVtransAudio(t,e,o={}){const i=await this.getSession("video-translation"),a=C.encodeTranslationAudioRequest(t,e),n=this.paths.videoTranslationAudio,r=await O("Vtrans",i,a,n),s=await this.request(n,a,{...r,...o},"PUT");if(!s.success)throw new yt("Failed to request video translation audio",s);return C.decodeTranslationAudioResponse(s.data)}async translateVideo({videoData:t,requestLang:e=this.requestLang,responseLang:o=this.responseLang,translationHelp:i=null,headers:a={},extraOpts:n={},shouldSendFailedAudio:r=!0}){const{url:s,videoId:l,host:d}=t;return this.isCustomLink(s)?await this.translateVideoVOTImpl({url:s,videoId:l,service:d,requestLang:e,responseLang:o,headers:a}):await this.translateVideoYAImpl({videoData:t,requestLang:e,responseLang:o,translationHelp:i,headers:a,extraOpts:n,shouldSendFailedAudio:r})}async getSubtitles({videoData:t,requestLang:e=this.requestLang,headers:o={}}){const{url:i}=t;if(this.isCustomLink(i))return{waiting:!1,subtitles:[]};const a=await this.getSession("video-translation"),n=C.encodeSubtitlesRequest(i,e),r=this.paths.videoSubtitles,s=await O("Vsubs",a,n,r),l=await this.request(r,n,{...s,...o});if(!l.success)throw new yt("Failed to request video subtitles",l);return C.decodeSubtitlesResponse(l.data)}async pingStream({pingId:t,headers:e={}}){const o=await this.getSession("video-translation"),i=C.encodeStreamPingRequest(t),a=this.paths.streamPing,n=await O("Vtrans",o,i,a),r=await this.request(a,i,{...n,...e});if(!r.success)throw new yt("Failed to request stream ping",r);return!0}async translateStream({videoData:t,requestLang:e=this.requestLang,responseLang:o=this.responseLang,headers:a={}}){const{url:n}=t;if(this.isCustomLink(n))throw new pt("VOTStreamNotSupportedUrl");const r=await this.getSession("video-translation"),s=C.encodeStreamRequest(n,e,o),l=this.paths.streamTranslation,d=await O("Vtrans",r,s,l),u=await this.request(l,s,{...d,...a});if(!u.success)throw new yt("Failed to request stream translation",u);const c=C.decodeStreamResponse(u.data),h=c.interval;switch(h){case i.NO_CONNECTION:case i.TRANSLATING:return{translated:!1,interval:h,message:h===i.NO_CONNECTION?"streamNoConnectionToServer":"translationTakeFewMinutes"};case i.STREAMING:return{translated:!0,interval:h,pingId:c.pingId,result:c.translatedInfo};default:throw A.error("Unknown response",c),new yt("Unknown response from Yandex",c)}}async createSession(t){const e=function(){let t="";for(let e=0;e<32;e++)t+="0123456789ABCDEF"[Math.floor(16*Math.random())];return t}(),o=C.encodeYandexSessionRequest(e,t),i=await this.request(this.paths.createSession,o,{"Vtrans-Signature":await M(o)});if(!i.success)throw new yt("Failed to request create session",i);return{...C.decodeYandexSessionResponse(i.data),uuid:e}}}class xt extends wt{async request(t,e,o={},i="POST"){const a=this.getOpts(JSON.stringify({headers:{...this.headers,...o},body:Array.from(e)}),{"Content-Type":"application/json"},i);try{const e=await this.fetch(`${this.schema}://${this.host}${t}`,a),o=await e.arrayBuffer();return{success:200===e.status,data:o}}catch(t){return{success:!1,data:t?.message}}}async requestJSON(t,e=null,o={},i="POST"){const a=this.getOpts(JSON.stringify({headers:{...this.headers,"Content-Type":"application/json",Accept:"application/json",...o},body:e}),{Accept:"application/json","Content-Type":"application/json"},i);try{const e=await this.fetch(`${this.schema}://${this.host}${t}`,a),o=await e.json();return{success:200===e.status,data:o}}catch(t){return{success:!1,data:t?.message}}}}var St;function kt(t,e=","){const o=t/1e3,i=Math.floor(o/3600),a=Math.floor(o%3600/60),n=Math.floor(o%60),r=Math.floor(t%1e3);return`${i.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}${e}${r.toString().padStart(3,"0")}`}function Tt(t){const e=t.split(" ")?.[0]?.split(":");e.length<3&&e.unshift("00");const[o,i,a]=e;return 36e5*+o+6e4*+i+ +a.replace(/[,.]/,"")}function Ct(t,e="srt"){const o="vtt"===e,i=o?".":",",a=t.subtitles.map(((t,e)=>(o?"":`${e+1}\n`)+`${kt(t.startMs,i)} --\x3e ${kt(t.startMs+t.durationMs,i)}\n${t.text}\n\n`)).join("").trim();return o?`WEBVTT\n\n${a}`:a}function Pt(t,e="srt"){const o=function(t){return"string"!=typeof t?"json":/(WEBVTT)(\r?\n\r?\n)/.exec(t)?"vtt":"srt"}(t);return o===e?t:"json"===o?Ct(t,e):(t=function(t,e="srt"){const o=t.split(/\r?\n\r?\n/g);"vtt"===e&&o.shift();const i=+("srt"===e);return{containsTokens:!1,subtitles:o.reduce(((t,e)=>{const o=e.trim().split("\n"),a=o[i],n=o.slice(i+1).join("\n");if(!(2===o.length&&e.includes(" --\x3e ")||a?.includes(" --\x3e ")))return 0===t.length||(t[t.length-1].text+=`\n\n${o.join("\n")}`),t;const[r,s]=a.split(" --\x3e "),l=Tt(r),d=Tt(s)-l;return t.push({text:n,startMs:l,durationMs:d,speakerId:"0"}),t}),[])}}(t,o),"json"===e?t:Ct(t,e))}!function(t){t.Channel="Channel",t.Video="Video"}(St||(St={}));const Lt=globalThis,At=Lt.trustedTypes,It=At?At.createPolicy("lit-html",{createHTML:t=>t}):void 0,_t="$lit$",Mt=`lit$${Math.random().toFixed(9).slice(2)}$`,Ot="?"+Mt,Vt=`<${Ot}>`,Et=document,Bt=()=>Et.createComment(""),Nt=t=>null===t||"object"!=typeof t&&"function"!=typeof t,Rt=Array.isArray,$t=t=>Rt(t)||"function"==typeof t?.[Symbol.iterator],Dt="[ \t\n\f\r]",Ft=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,qt=/-->/g,Ut=/>/g,Ht=RegExp(`>|${Dt}(?:([^\\s"'>=/]+)(${Dt}*=${Dt}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),zt=/'/g,Wt=/"/g,jt=/^(?:script|style|textarea|title)$/i,Gt=t=>(e,...o)=>({_$litType$:t,strings:e,values:o}),Yt=Gt(1),Jt=Gt(2),Kt=(Gt(3),Symbol.for("lit-noChange")),Zt=Symbol.for("lit-nothing"),Xt=new WeakMap,Qt=Et.createTreeWalker(Et,129);function te(t,e){if(!Rt(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==It?It.createHTML(e):e}const ee=(t,e)=>{const o=t.length-1,i=[];let a,n=2===e?"":3===e?"":"",r=Ft;for(let e=0;e"===l[0]?(r=a??Ft,d=-1):void 0===l[1]?d=-2:(d=r.lastIndex-l[2].length,s=l[1],r=void 0===l[3]?Ht:'"'===l[3]?Wt:zt):r===Wt||r===zt?r=Ht:r===qt||r===Ut?r=Ft:(r=Ht,a=void 0);const c=r===Ht&&t[e+1].startsWith("/>")?" ":"";n+=r===Ft?o+Vt:d>=0?(i.push(s),o.slice(0,d)+_t+o.slice(d)+Mt+c):o+Mt+(-2===d?e:c)}return[te(t,n+(t[o]||"")+(2===e?"":3===e?"":"")),i]};class oe{constructor({strings:t,_$litType$:e},o){let i;this.parts=[];let a=0,n=0;const r=t.length-1,s=this.parts,[l,d]=ee(t,e);if(this.el=oe.createElement(l,o),Qt.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=Qt.nextNode())&&s.length0){i.textContent=At?At.emptyScript:"";for(let o=0;o2||""!==o[0]||""!==o[1]?(this._$AH=Array(o.length-1).fill(new String),this.strings=o):this._$AH=Zt}_$AI(t,e=this,o,i){const a=this.strings;let n=!1;if(void 0===a)t=ie(this,t,e,0),n=!Nt(t)||t!==this._$AH&&t!==Kt,n&&(this._$AH=t);else{const i=t;let r,s;for(t=a[0],r=0;r{const i=o?.renderBefore??e;let a=i._$litPart$;if(void 0===a){const t=o?.renderBefore??null;i._$litPart$=a=new ne(e.insertBefore(Bt(),t),t,void 0,o??{})}return a._$AI(t),a};function pe(t){return String(t).split("").map((t=>t.charCodeAt(0)))}function ge(t){return new Uint8Array(pe(t))}function me(t){const e=new ArrayBuffer(2*t.length),o=new Uint8Array(e);return new Uint16Array(e).set(pe(t)),o}function ve(t){const e=255;return[t>>>24&e,t>>>16&e,t>>>8&e,t&e]}function fe(t){return 11+t}function be(t,e,o,i){return 11+e+1+1+(i?2+2*(o+1):o+1)+t}function ye(t){let e=0;return t.forEach((t=>{e+=2+2*t[0].length+2+2+2*t[1].length+2})),11+e}function we(t,e){const o=2*e;let i=0;return t.forEach((t=>{i+=2+2*t[0].length+2+4})),18+o+2+i}class xe{_setIntegerFrame(t,e){const o=parseInt(e,10);this.frames.push({name:t,value:o,size:fe(o.toString().length)})}_setStringFrame(t,e){const o=e.toString();let i=13+2*o.length;"TDAT"===t&&(i=fe(o.length)),this.frames.push({name:t,value:o,size:i})}_setPictureFrame(t,e,o,i){const a=function(t){if(!t||!t.length)return null;if(255===t[0]&&216===t[1]&&255===t[2])return"image/jpeg";if(137===t[0]&&80===t[1]&&78===t[2]&&71===t[3])return"image/png";if(71===t[0]&&73===t[1]&&70===t[2])return"image/gif";if(87===t[8]&&69===t[9]&&66===t[10]&&80===t[11])return"image/webp";const e=73===t[0]&&73===t[1]&&42===t[2]&&0===t[3],o=77===t[0]&&77===t[1]&&0===t[2]&&42===t[3];return e||o?"image/tiff":66===t[0]&&77===t[1]?"image/bmp":0===t[0]&&0===t[1]&&1===t[2]&&0===t[3]?"image/x-icon":null}(new Uint8Array(e)),n=o.toString();if(!a)throw new Error("Unknown picture MIME type");o||(i=!1),this.frames.push({name:"APIC",value:e,pictureType:t,mimeType:a,useUnicodeEncoding:i,description:n,size:be(e.byteLength,a.length,n.length,i)})}_setLyricsFrame(t,e,o){const i=t.split("").map((t=>t.charCodeAt(0))),a=e.toString(),n=o.toString();var r,s;this.frames.push({name:"USLT",value:n,language:i,description:a,size:(r=a.length,s=n.length,16+2*r+2+2+2*s)})}_setCommentFrame(t,e,o){const i=t.split("").map((t=>t.charCodeAt(0))),a=e.toString(),n=o.toString();var r,s;this.frames.push({name:"COMM",value:n,language:i,description:a,size:(r=a.length,s=n.length,16+2*r+2+2+2*s)})}_setPrivateFrame(t,e){const o=t.toString();var i,a;this.frames.push({name:"PRIV",value:e,id:o,size:(i=o.length,a=e.byteLength,10+i+1+a)})}_setUserStringFrame(t,e){const o=t.toString(),i=e.toString();var a,n;this.frames.push({name:"TXXX",description:o,value:i,size:(a=o.length,n=i.length,13+2*a+2+2+2*n)})}_setUrlLinkFrame(t,e){const o=e.toString();var i;this.frames.push({name:t,value:o,size:(i=o.length,10+i)})}_setPairedTextFrame(t,e){this.frames.push({name:t,value:e,size:ye(e)})}_setSynchronisedLyricsFrame(t,e,o,i,a){const n=a.toString(),r=i.split("").map((t=>t.charCodeAt(0)));this.frames.push({name:"SYLT",value:e,language:r,description:n,type:t,timestampFormat:o,size:we(e,n.length)})}constructor(t){if(!t||"object"!=typeof t||!("byteLength"in t))throw new Error("First argument should be an instance of ArrayBuffer or Buffer");this.arrayBuffer=t,this.padding=4096,this.frames=[],this.url=""}setFrame(t,e){switch(t){case"TPE1":case"TCOM":case"TCON":{if(!Array.isArray(e))throw new Error(`${t} frame value should be an array of strings`);const o="TCON"===t?";":"/",i=e.join(o);this._setStringFrame(t,i);break}case"TLAN":case"TIT1":case"TIT2":case"TIT3":case"TALB":case"TPE2":case"TPE3":case"TPE4":case"TRCK":case"TPOS":case"TMED":case"TPUB":case"TCOP":case"TKEY":case"TEXT":case"TDAT":case"TSRC":this._setStringFrame(t,e);break;case"TBPM":case"TLEN":case"TYER":this._setIntegerFrame(t,e);break;case"USLT":if(e.language=e.language||"eng","object"!=typeof e||!("description"in e)||!("lyrics"in e))throw new Error("USLT frame value should be an object with keys description and lyrics");if(e.language&&!e.language.match(/[a-z]{3}/i))throw new Error("Language must be coded following the ISO 639-2 standards");this._setLyricsFrame(e.language,e.description,e.lyrics);break;case"APIC":if("object"!=typeof e||!("type"in e)||!("data"in e)||!("description"in e))throw new Error("APIC frame value should be an object with keys type, data and description");if(e.type<0||e.type>20)throw new Error("Incorrect APIC frame picture type");this._setPictureFrame(e.type,e.data,e.description,!!e.useUnicodeEncoding);break;case"TXXX":if("object"!=typeof e||!("description"in e)||!("value"in e))throw new Error("TXXX frame value should be an object with keys description and value");this._setUserStringFrame(e.description,e.value);break;case"WCOM":case"WCOP":case"WOAF":case"WOAR":case"WOAS":case"WORS":case"WPAY":case"WPUB":this._setUrlLinkFrame(t,e);break;case"COMM":if(e.language=e.language||"eng","object"!=typeof e||!("description"in e)||!("text"in e))throw new Error("COMM frame value should be an object with keys description and text");if(e.language&&!e.language.match(/[a-z]{3}/i))throw new Error("Language must be coded following the ISO 639-2 standards");this._setCommentFrame(e.language,e.description,e.text);break;case"PRIV":if("object"!=typeof e||!("id"in e)||!("data"in e))throw new Error("PRIV frame value should be an object with keys id and data");this._setPrivateFrame(e.id,e.data);break;case"IPLS":if(!Array.isArray(e)||!Array.isArray(e[0]))throw new Error("IPLS frame value should be an array of pairs");this._setPairedTextFrame(t,e);break;case"SYLT":if("object"!=typeof e||!("type"in e)||!("text"in e)||!("timestampFormat"in e))throw new Error("SYLT frame value should be an object with keys type, text and timestampFormat");if(!Array.isArray(e.text)||!Array.isArray(e.text[0]))throw new Error("SYLT frame text value should be an array of pairs");if(e.type<0||e.type>6)throw new Error("Incorrect SYLT frame content type");if(e.timestampFormat<1||e.timestampFormat>2)throw new Error("Incorrect SYLT frame time stamp format");e.language=e.language||"eng",e.description=e.description||"",this._setSynchronisedLyricsFrame(e.type,e.text,e.timestampFormat,e.language,e.description);break;default:throw new Error(`Unsupported frame ${t}`)}return this}removeTag(){if(this.arrayBuffer.byteLength<10)return;const t=new Uint8Array(this.arrayBuffer),e=t[3],o=((i=[t[6],t[7],t[8],t[9]])[0]<<21)+(i[1]<<14)+(i[2]<<7)+i[3]+10;var i,a;73!==(a=t)[0]||68!==a[1]||51!==a[2]||e<2||e>4||(this.arrayBuffer=new Uint8Array(t.subarray(o)).buffer)}addTag(){this.removeTag();const t=[255,254],e=10+this.frames.reduce(((t,e)=>t+e.size),0)+this.padding,o=new ArrayBuffer(this.arrayBuffer.byteLength+e),i=new Uint8Array(o);let a=0,n=[];return n=[73,68,51,3],i.set(n,a),a+=n.length,a++,a++,n=function(t){const e=127;return[t>>>21&e,t>>>14&e,t>>>7&e,t&e]}(e-10),i.set(n,a),a+=n.length,this.frames.forEach((e=>{switch(n=ge(e.name),i.set(n,a),a+=n.length,n=ve(e.size-10),i.set(n,a),a+=n.length,a+=2,e.name){case"WCOM":case"WCOP":case"WOAF":case"WOAR":case"WOAS":case"WORS":case"WPAY":case"WPUB":n=ge(e.value),i.set(n,a),a+=n.length;break;case"TPE1":case"TCOM":case"TCON":case"TLAN":case"TIT1":case"TIT2":case"TIT3":case"TALB":case"TPE2":case"TPE3":case"TPE4":case"TRCK":case"TPOS":case"TKEY":case"TMED":case"TPUB":case"TCOP":case"TEXT":case"TSRC":n=[1].concat(t),i.set(n,a),a+=n.length,n=me(e.value),i.set(n,a),a+=n.length;break;case"TXXX":case"USLT":case"COMM":n=[1],"USLT"!==e.name&&"COMM"!==e.name||(n=n.concat(e.language)),n=n.concat(t),i.set(n,a),a+=n.length,n=me(e.description),i.set(n,a),a+=n.length,n=[0,0].concat(t),i.set(n,a),a+=n.length,n=me(e.value),i.set(n,a),a+=n.length;break;case"TBPM":case"TLEN":case"TDAT":case"TYER":a++,n=ge(e.value),i.set(n,a),a+=n.length;break;case"PRIV":n=ge(e.id),i.set(n,a),a+=n.length,a++,i.set(new Uint8Array(e.value),a),a+=e.value.byteLength;break;case"APIC":n=[e.useUnicodeEncoding?1:0],i.set(n,a),a+=n.length,n=ge(e.mimeType),i.set(n,a),a+=n.length,n=[0,e.pictureType],i.set(n,a),a+=n.length,e.useUnicodeEncoding?(n=[].concat(t),i.set(n,a),a+=n.length,n=me(e.description),i.set(n,a),a+=n.length,a+=2):(n=ge(e.description),i.set(n,a),a+=n.length,a++),i.set(new Uint8Array(e.value),a),a+=e.value.byteLength;break;case"IPLS":n=[1],i.set(n,a),a+=n.length,e.value.forEach((e=>{n=[].concat(t),i.set(n,a),a+=n.length,n=me(e[0].toString()),i.set(n,a),a+=n.length,n=[0,0].concat(t),i.set(n,a),a+=n.length,n=me(e[1].toString()),i.set(n,a),a+=n.length,n=[0,0],i.set(n,a),a+=n.length}));break;case"SYLT":n=[1].concat(e.language).concat(e.timestampFormat).concat(e.type),i.set(n,a),a+=n.length,n=[].concat(t),i.set(n,a),a+=n.length,n=me(e.description),i.set(n,a),a+=n.length,a+=2,e.value.forEach((e=>{n=[].concat(t),i.set(n,a),a+=n.length,n=me(e[0].toString()),i.set(n,a),a+=n.length,n=[0,0],i.set(n,a),a+=n.length,n=ve(e[1]),i.set(n,a),a+=n.length}))}})),a+=this.padding,i.set(new Uint8Array(this.arrayBuffer),a),this.arrayBuffer=o,o}getBlob(){return new Blob([this.arrayBuffer],{type:"audio/mpeg"})}getURL(){return this.url||(this.url=URL.createObjectURL(this.getBlob())),this.url}revokeURL(){URL.revokeObjectURL(this.url)}}const Se={async translate(t,e){try{const o=await rt(`${G.yandex}?${new URLSearchParams({text:t,lang:e})}`,{timeout:3e3});if(o instanceof Error)throw o;const i=await o.json();if(200!==i.code)throw i.message;return i.text[0]}catch(e){return console.error("Error translating text:",e),t}},async detect(t){try{const e=await rt(`${j.yandex}?${new URLSearchParams({text:t})}`,{timeout:3e3});if(e instanceof Error)throw e;const o=await e.json();if(200!==o.code)throw o.message;return o.lang??"en"}catch(t){return console.error("Error getting lang from text:",t),"en"}}},ke={async detect(t){try{const e=await rt(j.rustServer,{method:"POST",body:t});if(e instanceof Error)throw e;return await e.text()}catch(t){return console.error("Error getting lang from text:",t),"en"}}},Te={async translate(t,e="auto",o="ru"){try{const i=await rt(G.deepl,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:new URLSearchParams({text:t,source_lang:e,target_lang:o})});if(i instanceof Error)throw i;const a=await i.json();if(200!==a.code)throw a.message;return a.data}catch(e){return console.error("Error translating text:",e),t}}};const Ce=Object.keys(G),Pe=Object.keys(j).map((t=>"rustServer"===t?"rust-server":t));async function Le(t,e,o,i){if(!window.location.hostname.includes("m.youtube.com")&&t?.getAudioTrack){const e=t.getAudioTrack(),o=e?.getLanguageInfo();if("und"!==o?.id)return B(o.id.split(".")[0])}const a=e?.captions?.playerCaptionsTracklistRenderer?.captionTracks;if(a?.length){const t=a.find((t=>"asr"===t.kind));if(t&&t.languageCode)return B(t.languageCode)}const n=function(t,e){return`${t} ${e?e.split("\n").filter((t=>!it.test(t))).join(" "):""}`.slice(0,450).replace(/[^\p{L}\s]+|\s+/gu," ").trim()}(o,i);return D.log(`Detecting language text: ${n}`),async function(t){switch(await J.get("detectService",W)){case"yandex":return await Se.detect(t);case"rust-server":return await ke.detect(t);default:return"en"}}(n)}function Ae(){return/^m\.youtube\.com$/.test(window.location.hostname)}function Ie(){return window.location.pathname.startsWith("/shorts/")&&!Ae()?document.querySelector("#shorts-player"):document.querySelector("#movie_player")}function _e(){const t=Ie();return t?.getPlayerResponse?t?.getPlayerResponse?.call()??null:t?.data?.playerResponse??null}function Me(){const t=Ie();return t?.getVideoData?t?.getVideoData?.call()??null:t?.data?.playerResponse?.videoDetails??null}const Oe={isMobile:Ae,getPlayer:Ie,getPlayerResponse:_e,getPlayerData:Me,getVideoVolume:function(){const t=Ie();return t?.getVolume?t.getVolume.call()/100:1},getSubtitles:function(){const t=_e(),e=t?.captions?.playerCaptionsTracklistRenderer;if(!e)return[];let o=e.captionTracks??[];const i=e.translationLanguages??[],a=X.lang,n=i.find((t=>t.languageCode===a)),r=o.find((t=>"asr"===t?.kind))?.languageCode??"en";return o=o.reduce(((t,e)=>{if(!("languageCode"in e))return t;const o=e.languageCode?B(e.languageCode):void 0,i=e?.url||e?.baseUrl;if(!o||!i)return t;const s=`${i.startsWith("http")?i:`${window.location.origin}/${i}`}&fmt=json3`;return t.push({source:"youtube",language:o,isAutoGenerated:"asr"===e?.kind,url:s}),n&&e.isTranslatable&&e.languageCode===r&&a!==o&&t.push({source:"youtube",language:a,isAutoGenerated:"asr"===e?.kind,translatedFromLanguage:o,url:`${s}&tlang=${a}`}),t}),[]),D.log("youtube subtitles:",o),o},getVideoData:async function(){const t=Ie(),e=_e(),o=Me(),{title:i}=o??{},{shortDescription:a,isLive:n,title:r}=e?.videoDetails??{};let s=r?await Le(t,e,r,a):"en";s=ut.includes(s)?s:"en";const l={isLive:!!n,title:r,localizedTitle:i,description:a,detectedLanguage:s};return D.log("youtube video data:",l),console.log("[VOT] Detected language: ",l.detectedLanguage),l},setVideoVolume:function(t){const e=Ie();if(e?.setVolume)return e.setVolume(Math.round(100*t)),!0},videoSeek:function(t,e){D.log("videoSeek",e);const o=(Ie()?.getProgressState()?.seekableEnd||t.currentTime)-e;t.currentTime=o},isMuted:function(){const t=Ie();return!!t?.isMuted&&t.isMuted.call()},isMusic:function(){const t=Me().author,e=Me().title.toUpperCase(),o=e.match(/\w+/g),i=document.body.querySelector("ytd-watch-flexy")?.playerData;return[e,document.URL,t,i?.microformat?.playerMicroformatRenderer.category,i?.title].some((t=>t?.toUpperCase().includes("MUSIC")))||document.body.querySelector("#upload-info #channel-name .badge-style-type-verified-artist")||t&&/(VEVO|Topic|Records|RECORDS|Recordings|AMV)$/.test(t)||t&&/(MUSIC|ROCK|SOUNDS|SONGS)/.test(t.toUpperCase())||o?.length&&["🎵","♫","SONG","SONGS","SOUNDTRACK","LYRIC","LYRICS","AMBIENT","MIX","VEVO","CLIP","KARAOKE","OPENING","COVER","COVERED","VOCAL","INSTRUMENTAL","ORCHESTRAL","DUBSTEP","DJ","DNB","BASS","BEAT","ALBUM","PLAYLIST","DUBSTEP","CHILL","RELAX","CLASSIC","CINEMATIC"].some((t=>o.includes(t)))||["OFFICIAL VIDEO","OFFICIAL AUDIO","FEAT.","FT.","LIVE RADIO","DANCE VER","HIP HOP","ROCK N ROLL","HOUR VER","HOURS VER","INTRO THEME"].some((t=>e.includes(t)))||o?.length&&["OP","ED","MV","OST","NCS","BGM","EDM","GMV","AMV","MMD","MAD"].some((t=>o.includes(t)))}};function Ve(t){const e=t.startMs+t.durationMs;return t.tokens.reduce(((o,i,a)=>{const n=t.tokens[a+1];let r;o.length>0&&(r=o[o.length-1]);const s=r?.alignRange?.end??0,l=s+i.text.length;if(i.alignRange={start:s,end:l},o.push(i),n){const t=i.startMs+i.durationMs,a=n.startMs?n.startMs-t:e-t;o.push({text:" ",startMs:t,durationMs:a,alignRange:{start:l,end:l+1}})}return o}),[])}function Ee(t,e){const o=t.text.split(/([\n \t])/).reduce(((t,o)=>{if(o.length){const i=t[t.length-1]??e,a=i?.alignRange?.end??0,n=a+o.length;t.push({text:o,alignRange:{start:a,end:n}})}return t}),[]),i=Math.floor(t.durationMs/o.length),a=t.startMs+t.durationMs;return o.map(((e,n)=>{const r=n===o.length-1,s=t.startMs+i*n;return{...e,startMs:s,durationMs:r?a-s:i}}))}async function Be(t){const{source:e,isAutoGenerated:o,format:i,url:a}=t,n=(async()=>{try{const t=await rt(a,{timeout:5e3});if(["vtt","srt"].includes(i)){return Pt(await t.text(),"json")}return await t.json()}catch(t){return console.error("[VOT] Failed to fetch subtitles.",t),{containsTokens:!1,subtitles:[]}}})();let r=await n;return"youtube"===e&&(r=function(t,e=!1){const o={containsTokens:e,subtitles:[]};if("object"!=typeof t||!Array.isArray(t.events))return console.error("[VOT] Failed to format youtube subtitles",t),o;for(let i=0;it.events[i+1].tStartMs&&(n=t.events[i+1].tStartMs-a.tStartMs);const r=[];let s=n;for(let t=0;tt.text)).join(" ");l&&o.subtitles.push({text:l,startMs:a.tStartMs,durationMs:n,...e?{tokens:r}:{},speakerId:"0"})}return o}(r,o)),r.subtitles=function(t,e){const o=[];let i;const{source:a,isAutoGenerated:n}=e;for(let e=0;esetTimeout((()=>e(new Error("Timeout"))),5e3)));try{const e=await Promise.race([t.getSubtitles({videoData:{host:o,url:i,videoId:n,duration:r},requestLang:a}),d]);console.log("[VOT] Subtitles response: ",e),e.waiting&&console.error("[VOT] Failed to get yandex subtitles");let s=e.subtitles??[];return s=s.reduce(((t,e)=>(e.language&&!t.find((t=>"yandex"===t.source&&t.language===e.language&&!t.translatedFromLanguage))&&t.push({source:"yandex",language:e.language,url:e.url}),e.translatedLanguage&&t.push({source:"yandex",language:e.translatedLanguage,translatedFromLanguage:e.language,url:e.translatedUrl}),t)),[]),[...s,...l].sort(((t,e)=>{if(t.source!==e.source)return"yandex"===t.source?-1:1;if(t.language!==e.language&&(t.language===tt||e.language===tt))return t.language===tt?-1:1;if("yandex"===t.source){if(t.translatedFromLanguage!==e.translatedFromLanguage)return t.translatedFromLanguage&&e.translatedFromLanguage?t.translatedFromLanguage===a?-1:1:t.language===e.language?t.translatedFromLanguage?1:-1:t.translatedFromLanguage?-1:1;if(!t.translatedFromLanguage)return t.language===a?-1:1}return"yandex"!==t.source&&t.isAutoGenerated!==e.isAutoGenerated?t.isAutoGenerated?1:-1:0}))}catch(t){throw"Timeout"===t.message?console.error("[VOT] Failed to get yandex subtitles. Reason: timeout"):console.error("[VOT] Error in getSubtitles function",t),t}}class Re{constructor(t,e,o){this.video=t,this.container="youtube"===o.host&&"mobile"!==o.additionalData?e.parentElement:e,this.site=o,this.subtitlesContainer=this.createSubtitlesContainer(),this.position={left:25,top:75},this.dragging={active:!1,offset:{x:0,y:0}},this.subtitles=null,this.lastContent=null,this.highlightWords=!1,this.fontSize=20,this.opacity=.2,this.maxLength=300,this.maxLengthRegexp=/.{1,300}(?:\s|$)/g,this.bindEvents(),this.updateContainerRect()}createSubtitlesContainer(){const t=document.createElement("vot-block");return t.classList.add("vot-subtitles-widget"),this.container.appendChild(t),t}bindEvents(){this.onMouseDownBound=t=>this.onMouseDown(t),this.onMouseUpBound=()=>this.onMouseUp(),this.onMouseMoveBound=t=>this.onMouseMove(t),this.onTimeUpdateBound=this.debounce((()=>this.update()),100),document.addEventListener("mousedown",this.onMouseDownBound),document.addEventListener("mouseup",this.onMouseUpBound),document.addEventListener("mousemove",this.onMouseMoveBound),this.video?.addEventListener("timeupdate",this.onTimeUpdateBound),this.resizeObserver=new ResizeObserver((()=>this.onResize())),this.resizeObserver.observe(this.container)}onMouseDown(t){if(this.subtitlesContainer.contains(t.target)){const e=this.subtitlesContainer.getBoundingClientRect(),o=this.container.getBoundingClientRect();this.dragging={active:!0,offset:{x:t.clientX-e.left,y:t.clientY-e.top},containerOffset:{x:o.left,y:o.top}}}}onMouseUp(){this.dragging.active=!1}onMouseMove(t){if(this.dragging.active){t.preventDefault();const{width:e,height:o}=this.container.getBoundingClientRect(),i=this.dragging.containerOffset;this.position={left:(t.clientX-this.dragging.offset.x-i.x)/e*100,top:(t.clientY-this.dragging.offset.y-i.y)/o*100},this.applySubtitlePosition()}}onResize(){this.updateContainerRect()}updateContainerRect(){this.containerRect=this.container.getBoundingClientRect(),this.applySubtitlePosition()}applySubtitlePosition(){const{width:t,height:e}=this.containerRect,{offsetWidth:o,offsetHeight:i}=this.subtitlesContainer,a=(t-o)/t*100,n=(e-i)/e*100;this.position.left=Math.max(0,Math.min(this.position.left,a)),this.position.top=Math.max(0,Math.min(this.position.top,n)),this.subtitlesContainer.style.left=`${this.position.left}%`,this.subtitlesContainer.style.top=`${this.position.top}%`}setContent(t){t&&this.video?(this.subtitles=t,this.update()):(this.subtitles=null,he(null,this.subtitlesContainer))}setMaxLength(t){"number"==typeof t&&t&&(this.maxLength=t,this.maxLengthRegexp=new RegExp(`.{1,${t}}(?:\\s|$)`,"g"),this.update())}setHighlightWords(t){this.highlightWords=Boolean(t),this.update()}setFontSize(t){this.fontSize=t;const e=this.subtitlesContainer?.querySelector(".vot-subtitles");e&&(e.style.fontSize=`${this.fontSize}px`)}setOpacity(t){this.opacity=((100-+t)/100).toFixed(2);const e=this.subtitlesContainer?.querySelector(".vot-subtitles");e&&e.style.setProperty("--vot-subtitles-opacity",this.opacity)}update(){if(!this.video||!this.subtitles)return;const t=1e3*this.video.currentTime,e=this.subtitles.subtitles?.findLast((e=>e.startMs${i} - `,c);const h=We(n,r,s,{onSelectCb:l});return d.append(u.container,c,h.container),{container:d,fromSelect:u,icon:c,toSelect:h}},updateSlider:Ue,animateLoader:function(t,e="139, 180, 245"){const o=t.querySelector(".vot-loader-helper"),i=t.querySelector(".vot-loader-main");anime.timeline({...Fe,targets:[o,i],duration:250}).add({"fill-opacity":0,"stroke-width":2,d:"M 12 1.5 C 17.799 1.5 22.5 6.201 22.5 12 C 22.5 17.799 17.799 22.5 12 22.5 C 6.201 22.5 1.5 17.799 1.5 12 C 1.5 6.201 6.201 1.5 12 1.5 Z",duration:0}).add({targets:o,stroke:`rgb(${e})`,"stroke-opacity":0,duration:0},0).add({targets:i,stroke:"#888888","stroke-opacity":.25},0);const a=anime.timeline({targets:o,easing:"easeInOutSine",duration:1e3,autoplay:!1}).add({strokeOpacity:1,duration:0},0).add({strokeDashoffset:[anime.setDashoffset,0]},0);return t=>{a.seek(a.duration*(t/100))}},afterAnimateLoader:function(t,e="139, 180, 245"){const o=t.querySelector(".vot-loader-helper"),i=t.querySelector(".vot-loader-main");anime.timeline({...Fe,targets:i,duration:600}).add({d:"M 9.0596 14.8571 L 9.7667 15.5642 L 10.4738 14.8571 L 17.0071 8.3238 C 17.0457 8.2852 17.0937 8.25 17.2333 8.25 C 17.373 8.25 17.421 8.2852 17.4596 8.3238 C 17.4981 8.3624 17.5333 8.4104 17.5333 8.55 C 17.5333 8.6896 17.4981 8.7376 17.4596 8.7762 L 9.9929 16.2429 C 9.9011 16.3346 9.8397 16.35 9.7667 16.35 C 9.6937 16.35 9.6322 16.3346 9.5404 16.2429 L 6.0738 12.7762 C 6.0352 12.7376 6 12.6897 6 12.55 C 6 12.4103 6.0352 12.3624 6.0738 12.3238 C 6.1124 12.2852 6.1603 12.25 6.3 12.25 C 6.4397 12.25 6.4876 12.2852 6.5262 12.3238 L 9.0596 14.8571 Z",duration:0}).add({strokeDashoffset:[anime.setDashoffset,0],stroke:`rgb(${e})`,"stroke-opacity":1}),setTimeout((()=>{anime.timeline({...Fe,targets:i,duration:600}).add({d:"M12 15.575C11.8667 15.575 11.7417 15.5542 11.625 15.5125C11.5083 15.4708 11.4 15.4 11.3 15.3L7.7 11.7C7.5 11.5 7.40417 11.2667 7.4125 11C7.42083 10.7333 7.51667 10.5 7.7 10.3C7.9 10.1 8.1375 9.99583 8.4125 9.9875C8.6875 9.97917 8.925 10.075 9.125 10.275L11 12.15V5C11 4.71667 11.0958 4.47917 11.2875 4.2875C11.4792 4.09583 11.7167 4 12 4C12.2833 4 12.5208 4.09583 12.7125 4.2875C12.9042 4.47917 13 4.71667 13 5V12.15L14.875 10.275C15.075 10.075 15.3125 9.97917 15.5875 9.9875C15.8625 9.99583 16.1 10.1 16.3 10.3C16.4833 10.5 16.5792 10.7333 16.5875 11C16.5958 11.2667 16.5 11.5 16.3 11.7L12.7 15.3C12.6 15.4 12.4917 15.4708 12.375 15.5125C12.2583 15.5542 12.1333 15.575 12 15.575ZM6 20C5.45 20 4.97917 19.8042 4.5875 19.4125C4.19583 19.0208 4 18.55 4 18V16C4 15.7167 4.09583 15.4792 4.2875 15.2875C4.47917 15.0958 4.71667 15 5 15C5.28333 15 5.52083 15.0958 5.7125 15.2875C5.90417 15.4792 6 15.7167 6 16V18H18V16C18 15.7167 18.0958 15.4792 18.2875 15.2875C18.4792 15.0958 18.7167 15 19 15C19.2833 15 19.5208 15.0958 19.7125 15.2875C19.9042 15.4792 20 15.7167 20 16V18C20 18.55 19.8042 19.0208 19.4125 19.4125C19.0208 19.8042 18.55 20 18 20H6Z",duration:100}).add({targets:o,d:"",duration:200},0).add({targets:i,"stroke-width":"0",stroke:`rgba(${e}), 0)`,"fill-opacity":"1","stroke-dasharray":"0","stroke-dashoffset":"0",duration:0})}),2e3)},createDetails:function(t){const e=document.createElement("vot-block");e.classList.add("vot-details");const o=document.createElement("vot-block");o.append(t);const i=document.createElement("vot-block");return i.classList.add("vot-details-arrow-icon"),he(De,i),e.append(o,i),{container:e,header:o,arrowIcon:i}}};o("./node_modules/requestidlecallback-polyfill/index.js");class Ge{constructor(){this.listeners=new Set}hasListener(t){return this.listeners.has(t)}dispatchToListener(t,...e){try{t(...e)}catch(t){console.error("[VOT]",t)}}addListener(t){if(this.hasListener(t))throw new Error("[VOT] The listener has already been added.");this.listeners.add(t)}removeListener(t){if(!this.hasListener(t))throw new Error("[VOT] The listener has not been added yet.");this.listeners.delete(t)}dispatch(...t){for(const e of Array.from(this.listeners))this.dispatchToListener(e,...t)}}const Ye=new Set(["advertise","promo","sponsor","banner","commercial","preroll","midroll","postroll","ad-container","sponsored"]),Je=(()=>{const t=Array.from(Ye).join("|");return new RegExp(t,"i")})(),Ke=t=>{const e=[];for(let o=0;o=0||(o=(t.length-i)/2);const a=2*o;this.ensureCapacity(o+this._frameCount);const n=this.endIndex;this.vector.set(t.subarray(i,i+a),n),this._frameCount+=o}putBuffer(t,e,o=0){e=e||0,o>=0||(o=t.frameCount-e),this.putSamples(t.vector,t.position+e,o)}receive(t){t>=0&&!(t>this._frameCount)||(t=this.frameCount),this._frameCount-=t,this._position+=t}receiveSamples(t,e=0){const o=2*e,i=this.startIndex;t.set(this._vector.subarray(i,i+o)),this.receive(e)}extract(t,e=0,o=0){const i=this.startIndex+2*e,a=2*o;t.set(this._vector.subarray(i,i+a))}ensureCapacity(t=0){const e=parseInt(2*t);if(this._vector.length0&&(this._vector.set(this._vector.subarray(this.startIndex,this.endIndex)),this._position=0)}}class Qe{constructor(t){t?(this._inputBuffer=new Xe,this._outputBuffer=new Xe):this._inputBuffer=this._outputBuffer=null}get inputBuffer(){return this._inputBuffer}set inputBuffer(t){this._inputBuffer=t}get outputBuffer(){return this._outputBuffer}set outputBuffer(t){this._outputBuffer=t}clear(){this._inputBuffer.clear(),this._outputBuffer.clear()}}class to extends Qe{constructor(t){super(t),this.reset(),this._rate=1}set rate(t){this._rate=t}reset(){this.slopeCount=0,this.prevSampleL=0,this.prevSampleR=0}clone(){const t=new to;return t.rate=this._rate,t}process(){const t=this._inputBuffer.frameCount;this._outputBuffer.ensureAdditionalCapacity(t/this._rate+1);const e=this.transpose(t);this._inputBuffer.receive(),this._outputBuffer.put(e)}transpose(t=0){if(0===t)return 0;const e=this._inputBuffer.vector,o=this._inputBuffer.startIndex,i=this._outputBuffer.vector,a=this._outputBuffer.endIndex;let n=0,r=0;for(;this.slopeCount<1;)i[a+2*r]=(1-this.slopeCount)*this.prevSampleL+this.slopeCount*e[o],i[a+2*r+1]=(1-this.slopeCount)*this.prevSampleR+this.slopeCount*e[o+1],r+=1,this.slopeCount+=this._rate;if(this.slopeCount-=1,1!==t)t:for(;;){for(;this.slopeCount>1;)if(this.slopeCount-=1,n+=1,n>=t-1)break t;const s=o+2*n;i[a+2*r]=(1-this.slopeCount)*e[s]+this.slopeCount*e[s+2],i[a+2*r+1]=(1-this.slopeCount)*e[s+1]+this.slopeCount*e[s+3],r+=1,this.slopeCount+=this._rate}return this.prevSampleL=e[o+2*t-2],this.prevSampleR=e[o+2*t-1],r}}class eo{constructor(t){this._pipe=t}get pipe(){return this._pipe}get inputBuffer(){return this._pipe.inputBuffer}get outputBuffer(){return this._pipe.outputBuffer}fillInputBuffer(){throw new Error("fillInputBuffer() not overridden")}fillOutputBuffer(t=0){for(;this.outputBuffer.frameCountthis._position)throw new RangeError("New position may not be greater than current position");const e=this.outputBufferPosition-(this._position-t);if(e<0)throw new RangeError("New position falls outside of history buffer");this.outputBufferPosition=e,this._position=t}get sourcePosition(){return this._sourcePosition}set sourcePosition(t){this.clear(),this._sourcePosition=t}onEnd(){this.callback()}fillInputBuffer(t=0){const e=new Float32Array(2*t),o=this.sourceSound.extract(e,t,this._sourcePosition);this._sourcePosition+=o,this.inputBuffer.putSamples(e,0,o)}extract(t,e=0){this.fillOutputBuffer(this.outputBufferPosition+e);const o=Math.min(e,this.outputBuffer.frameCount-this.outputBufferPosition);this.outputBuffer.extract(t,this.outputBufferPosition,o);const i=this.outputBufferPosition+o;return this.outputBufferPosition=Math.min(this.historyBufferSize,i),this.outputBuffer.receive(Math.max(i-this.historyBufferSize,0)),this._position+=o,o}handleSampleData(t){this.extract(t.data,4096)}clear(){super.clear(),this.outputBufferPosition=0}}const ao=[[124,186,248,310,372,434,496,558,620,682,744,806,868,930,992,1054,1116,1178,1240,1302,1364,1426,1488,0],[-100,-75,-50,-25,25,50,75,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[-20,-15,-10,-5,5,10,15,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[-4,-3,-2,-1,1,2,3,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],no=-10/1.5;class ro extends Qe{constructor(t){super(t),this._quickSeek=!0,this.midBufferDirty=!1,this.midBuffer=null,this.overlapLength=0,this.autoSeqSetting=!0,this.autoSeekSetting=!0,this._tempo=1,this.setParameters(44100,0,0,8)}clear(){super.clear(),this.clearMidBuffer()}clearMidBuffer(){this.midBufferDirty&&(this.midBufferDirty=!1,this.midBuffer=null)}setParameters(t,e,o,i){t>0&&(this.sampleRate=t),i>0&&(this.overlapMs=i),e>0?(this.sequenceMs=e,this.autoSeqSetting=!1):this.autoSeqSetting=!0,o>0?(this.seekWindowMs=o,this.autoSeekSetting=!1):this.autoSeekSetting=!0,this.calculateSequenceParameters(),this.calculateOverlapLength(this.overlapMs),this.tempo=this._tempo}set tempo(t){let e;this._tempo=t,this.calculateSequenceParameters(),this.nominalSkip=this._tempo*(this.seekWindowLength-this.overlapLength),this.skipFract=0,e=Math.floor(this.nominalSkip+.5),this.sampleReq=Math.max(e+this.overlapLength,this.seekWindowLength)+this.seekLength}get tempo(){return this._tempo}get inputChunkSize(){return this.sampleReq}get outputChunkSize(){return this.overlapLength+Math.max(0,this.seekWindowLength-2*this.overlapLength)}calculateOverlapLength(t=0){let e;e=this.sampleRate*t/1e3,e=e<16?16:e,e-=e%8,this.overlapLength=e,this.refMidBuffer=new Float32Array(2*this.overlapLength),this.midBuffer=new Float32Array(2*this.overlapLength)}checkLimits(t,e,o){return to?o:t}calculateSequenceParameters(){let t,e;this.autoSeqSetting&&(t=150+-50*this._tempo,t=this.checkLimits(t,50,125),this.sequenceMs=Math.floor(t+.5)),this.autoSeekSetting&&(e=28.333333333333332+no*this._tempo,e=this.checkLimits(e,15,25),this.seekWindowMs=Math.floor(e+.5)),this.seekWindowLength=Math.floor(this.sampleRate*this.sequenceMs/1e3),this.seekLength=Math.floor(this.sampleRate*this.seekWindowMs/1e3)}set quickSeek(t){this._quickSeek=t}clone(){const t=new ro;return t.tempo=this._tempo,t.setParameters(this.sampleRate,this.sequenceMs,this.seekWindowMs,this.overlapMs),t}seekBestOverlapPosition(){return this._quickSeek?this.seekBestOverlapPositionStereoQuick():this.seekBestOverlapPositionStereo()}seekBestOverlapPositionStereo(){let t,e,o,i=0;for(this.preCalculateCorrelationReferenceStereo(),t=0,e=Number.MIN_VALUE;ie&&(e=o,t=i);return t}seekBestOverlapPositionStereoQuick(){let t,e,o,i,a,n=0;for(this.preCalculateCorrelationReferenceStereo(),e=Number.MIN_VALUE,t=0,i=0,a=0;n<4;n+=1){let r=0;for(;ao[n][r]&&(a=i+ao[n][r],!(a>=this.seekLength));)o=this.calculateCrossCorrelationStereo(2*a,this.refMidBuffer),o>e&&(e=o,t=a),r+=1;i=t}return t}preCalculateCorrelationReferenceStereo(){let t,e,o=0;for(;o=this.sampleReq;){t=this.seekBestOverlapPosition(),this._outputBuffer.ensureAdditionalCapacity(this.overlapLength),this.overlap(Math.floor(t)),this._outputBuffer.put(this.overlapLength),e=this.seekWindowLength-2*this.overlapLength,e>0&&this._outputBuffer.putBuffer(this._inputBuffer,t+this.overlapLength,e);const i=this._inputBuffer.startIndex+2*(t+this.seekWindowLength-this.overlapLength);this.midBuffer.set(this._inputBuffer.vector.subarray(i,i+2*this.overlapLength)),this.skipFract+=this.nominalSkip,o=Math.floor(this.skipFract),this.skipFract-=o,this._inputBuffer.receive(o)}}}const so=function(t,e){return(t>e?t-e:e-t)>1e-10};class lo{constructor(){this.transposer=new to(!1),this.stretch=new ro(!1),this._inputBuffer=new Xe,this._intermediateBuffer=new Xe,this._outputBuffer=new Xe,this._rate=0,this._tempo=0,this.virtualPitch=1,this.virtualRate=1,this.virtualTempo=1,this.calculateEffectiveRateAndTempo()}clear(){this.transposer.clear(),this.stretch.clear()}clone(){const t=new lo;return t.rate=this.rate,t.tempo=this.tempo,t}get rate(){return this._rate}set rate(t){this.virtualRate=t,this.calculateEffectiveRateAndTempo()}set rateChange(t){this._rate=1+.01*t}get tempo(){return this._tempo}set tempo(t){this.virtualTempo=t,this.calculateEffectiveRateAndTempo()}set tempoChange(t){this.tempo=1+.01*t}set pitch(t){this.virtualPitch=t,this.calculateEffectiveRateAndTempo()}set pitchOctaves(t){this.pitch=Math.exp(.69314718056*t),this.calculateEffectiveRateAndTempo()}set pitchSemitones(t){this.pitchOctaves=t/12}get inputBuffer(){return this._inputBuffer}get outputBuffer(){return this._outputBuffer}calculateEffectiveRateAndTempo(){const t=this._tempo,e=this._rate;this._tempo=this.virtualTempo/this.virtualPitch,this._rate=this.virtualRate*this.virtualPitch,so(this._tempo,t)&&(this.stretch.tempo=this._tempo),so(this._rate,e)&&(this.transposer.rate=this._rate),this._rate>1?this._outputBuffer!=this.transposer.outputBuffer&&(this.stretch.inputBuffer=this._inputBuffer,this.stretch.outputBuffer=this._intermediateBuffer,this.transposer.inputBuffer=this._intermediateBuffer,this.transposer.outputBuffer=this._outputBuffer):this._outputBuffer!=this.stretch.outputBuffer&&(this.transposer.inputBuffer=this._inputBuffer,this.transposer.outputBuffer=this._intermediateBuffer,this.stretch.inputBuffer=this._intermediateBuffer,this.stretch.outputBuffer=this._outputBuffer)}process(){this._rate>1?(this.stretch.process(),this.transposer.process()):(this.transposer.process(),this.stretch.process())}}class uo{constructor(t){this.buffer=t,this._position=0}get dualChannel(){return this.buffer.numberOfChannels>1}get position(){return this._position}set position(t){this._position=t}extract(t,e=0,o=0){this.position=o;let i=this.buffer.getChannelData(0),a=this.dualChannel?this.buffer.getChannelData(1):this.buffer.getChannelData(0),n=0;for(;n=e?t:new Array(e-t.length+1).join(o)+t}(parseInt(t-60*e),2)}`},ho=function(t){const e=this.timePlayed,o=this.sampleRate;if(this.sourcePosition=t,this.timePlayed=t/o,e!==this.timePlayed){const t=new CustomEvent("play",{detail:{timePlayed:this.timePlayed,formattedTimePlayed:this.formattedTimePlayed,percentagePlayed:this.percentagePlayed}});this._node.dispatchEvent(t)}};class po{constructor(t,e,o,i=oo){this._soundtouch=new lo;const a=new uo(e);this.timePlayed=0,this.sourcePosition=0,this._filter=new io(a,this._soundtouch,i),this._node=function(t,e,o=oo,i=4096){const a=t.createScriptProcessor(i,2,2),n=new Float32Array(2*i);return a.onaudioprocess=t=>{let a=t.outputBuffer.getChannelData(0),r=t.outputBuffer.getChannelData(1),s=e.extract(n,i);o(e.sourcePosition),0===s&&e.onEnd();let l=0;for(;lho.call(this,t)),o),this.tempo=1,this.rate=1,this.duration=e.duration,this.sampleRate=t.sampleRate,this.listeners=[]}get formattedDuration(){return co(this.duration)}get formattedTimePlayed(){return co(this.timePlayed)}get percentagePlayed(){return 100*this._filter.sourcePosition/(this.duration*this.sampleRate)}set percentagePlayed(t){this._filter.sourcePosition=parseInt(t*this.duration*this.sampleRate),this.sourcePosition=this._filter.sourcePosition,this.timePlayed=this.sourcePosition/this.sampleRate}get node(){return this._node}set pitch(t){this._soundtouch.pitch=t}set pitchSemitones(t){this._soundtouch.pitchSemitones=t}set rate(t){this._soundtouch.rate=t}set tempo(t){this._soundtouch.tempo=t}connect(t){this._node.connect(t)}disconnect(){this._node.disconnect()}on(t,e){this.listeners.push({name:t,cb:e}),this._node.addEventListener(t,(t=>e(t.detail)))}off(t=null){let e=this.listeners;t&&(e=e.filter((e=>e.name===t))),e.forEach((t=>{this._node.removeEventListener(t.name,(e=>t.cb(e.detail)))}))}}const go=(...t)=>{if(Ze.debug)return console.log(`%c✦ chaimu.js v${Ze.version} ✦`,"background: #000; color: #fff; padding: 0 8px",...t)},mo=["playing","ratechange","play","waiting","pause","seeked"];function vo(){const t=window.AudioContext||window.webkitAudioContext;return t?new t:void 0}class fo{static name="BasePlayer";chaimu;_src;fetch;constructor(t,e){this.chaimu=t,this._src=e,this.fetch=Ze.fetchFn}async init(){return new Promise((t=>t(this)))}clear(){return new Promise((t=>t(this)))}lipSync(t=!1){return this}handleVideoEvent=t=>(go(`handle video ${t.type}`),this.lipSync(t.type),this);removeVideoEvents(){for(const t of mo)this.chaimu.video.removeEventListener(t,this.handleVideoEvent);return this}addVideoEvents(){for(const t of mo)this.chaimu.video.addEventListener(t,this.handleVideoEvent);return this}async play(){return new Promise((t=>t(this)))}async pause(){return new Promise((t=>t(this)))}get name(){return this.constructor.name}set src(t){this._src=t}get src(){return this._src}get currentSrc(){return this._src}set volume(t){}get volume(){return 0}get playbackRate(){return 0}set playbackRate(t){}get currentTime(){return 0}}class bo extends fo{static name="AudioPlayer";audio;gainNode;audioSource;constructor(t,e){super(t,e),this.audio=new Audio(e),this.audio.crossOrigin="anonymous"}initAudioBooster(){return this.chaimu.audioContext?(this.gainNode&&this.audioSource&&(this.audioSource.disconnect(this.gainNode),this.gainNode.disconnect()),this.gainNode=this.chaimu.audioContext.createGain(),this.gainNode.connect(this.chaimu.audioContext.destination),this.audioSource=this.chaimu.audioContext.createMediaElementSource(this.audio),this.audioSource.connect(this.gainNode),this):this}async init(){return new Promise((t=>(this.initAudioBooster(),t(this))))}audioErrorHandle=t=>{console.error("[AudioPlayer]",t)};lipSync(t=!1){if(go("[AudioPlayer] lipsync video",this.chaimu.video),!this.chaimu.video)return this;if(this.audio.currentTime=this.chaimu.video.currentTime,this.audio.playbackRate=this.chaimu.video.playbackRate,!t)return go("[AudioPlayer] lipsync mode isn't set"),this;switch(go(`[AudioPlayer] lipsync mode is ${t}`),t){case"play":case"playing":case"seeked":return this.chaimu.video.paused||this.syncPlay(),this;case"pause":case"waiting":return this.pause(),this;default:return this}}async clear(){return new Promise((t=>(this.audio.pause(),this.audio.src="",this.audio.removeAttribute("src"),t(this))))}syncPlay(){return go("[AudioPlayer] sync play called"),this.audio.play().catch(this.audioErrorHandle),this}async play(){return go("[AudioPlayer] play called"),await this.audio.play().catch(this.audioErrorHandle),this}async pause(){return new Promise((t=>(go("[AudioPlayer] pause called"),this.audio.pause(),t(this))))}set src(t){this._src=t,t?this.audio.src=t:this.clear()}get src(){return this._src}get currentSrc(){return this.audio.currentSrc}set volume(t){this.gainNode?this.gainNode.gain.value=t:this.audio.volume=t}get volume(){return this.gainNode?this.gainNode.gain.value:this.audio.volume}get playbackRate(){return this.audio.playbackRate}set playbackRate(t){this.audio.playbackRate=t}get currentTime(){return this.audio.currentTime}}class yo extends fo{static name="ChaimuPlayer";audioBuffer;sourceNode;gainNode;audioShifter;cleanerRunned=!1;async fetchAudio(){if(!this._src)throw new Error("No audio source provided");if(!this.chaimu.audioContext)throw new Error("No audio context available");go(`[ChaimuPlayer] Fetching audio from ${this._src}...`);try{const t=await this.fetch(this._src);go("[ChaimuPlayer] Decoding fetched audio...");const e=await t.arrayBuffer();this.audioBuffer=await this.chaimu.audioContext.decodeAudioData(e)}catch(t){throw new Error(`Failed to fetch audio file, because ${t.message}`)}return this}initAudioBooster(){return this.chaimu.audioContext?(this.gainNode&&this.gainNode.disconnect(),this.gainNode=this.chaimu.audioContext.createGain(),this):this}async init(){return await this.fetchAudio(),this.initAudioBooster(),this}lipSync(t=!1){if(go("[ChaimuPlayer] lipsync video",this.chaimu.video,this),!this.chaimu.video)return this;if(!t)return go("[ChaimuPlayer] lipsync mode isn't set"),this;switch(go(`[ChaimuPlayer] lipsync mode is ${t}`),t){case"play":case"playing":case"ratechange":case"seeked":return this.chaimu.video.paused||this.start(),this;case"pause":case"waiting":return this.pause(),this;default:return this}}async reopenCtx(){if(!this.chaimu.audioContext)throw new Error("No audio context available");try{await this.chaimu.audioContext.close()}catch{}return this}async clear(){if(!this.chaimu.audioContext)throw new Error("No audio context available");if(go("clear audio context"),this.cleanerRunned=!0,await this.pause(),!this.gainNode)return this.cleanerRunned=!1,this;this.sourceNode&&(this.sourceNode.stop(),this.sourceNode.disconnect(this.gainNode),this.sourceNode=void 0),this.audioShifter&&(this.audioShifter._node.disconnect(this.gainNode),this.audioShifter=void 0),this.gainNode.disconnect();const t=this.volume;return this.gainNode=void 0,await this.reopenCtx(),this.chaimu.audioContext=vo(),this.initAudioBooster(),this.volume=t,this.cleanerRunned=!1,this}async start(){if(!this.chaimu.audioContext)throw new Error("No audio context available");if(!this.audioBuffer)throw new Error("The player isn't initialized");return!this.gainNode||this.audioShifter&&this.audioShifter.duration({label:X.get("langs")[t]??t.toUpperCase(),value:t,selected:e===t})))}const ko=t=>t?X.get("VOTChangeHotkeyWithCurrent").replace("{0}",t.replace("Key","")):X.get("VOTCreateTranslationHotkey");class To{translateFromLang="en";translateToLang=tt;timer;videoData="";firstPlay=!0;audioContext=vo();hls=ot();votClient;audioPlayer;videoTranslations=[];videoTranslationTTL=7200;cachedTranslation;downloadTranslationUrl=null;autoRetry;streamPing;votOpts;volumeOnStart;tempOriginalVolume;tempVolume;firstSyncVolume=!0;subtitlesList=[];subtitlesListVideoId=null;dragging;constructor(t,e,o){D.log("[VideoHandler] add video:",t,"container:",e,this),this.video=t,this.container=e,this.site=o,this.init()}async translateVideoImpl(t,e,o,i=null){if(clearTimeout(this.autoRetry),D.log(t,`Translate video (requestLang: ${e}, responseLang: ${o})`),await ft(this.site,this.video)!==t.videoId)return null;try{const a=await this.votClient.translateVideo({videoData:t,requestLang:e,responseLang:o,translationHelp:i});if(D.log("Translate video result",a),a.translated&&a.remainingTime<1)return D.log("Video translation finished with this data: ",a),a;await this.updateTranslationErrorMsg(a.remainingTime>0?function(t){let e=Math.floor(t/60),o=Math.floor(t%60);return o/60>=.66&&(e+=1,o=0),e>=60?X.get("translationTakeMoreThanHour"):1===e||0===e&&o>0?X.get("translationTakeAboutMinute"):11!==e&&e%10==1?X.get("translationTakeApproximatelyMinute2").replace("{0}",e):![12,13,14].includes(e)&&[2,3,4].includes(e%10)?X.get("translationTakeApproximatelyMinute").replace("{0}",e):X.get("translationTakeApproximatelyMinutes").replace("{0}",e)}(a.remainingTime):a.message??X.get("translationTakeFewMinutes"))}catch(t){return console.error("[VOT] Failed to translate video",t),await this.updateTranslationErrorMsg(t.data?.message??t),null}return new Promise((a=>{const n=this.subtitlesList.some((t=>"yandex"===t.source))?2e4:3e4;this.autoRetry=setTimeout((async()=>{const n=await this.translateVideoImpl(t,e,o,i);(!n||n.translated&&n.remainingTime<1)&&a(n)}),n)}))}async translateStreamImpl(t,e,o){if(clearTimeout(this.autoRetry),D.log(t,`Translate stream (requestLang: ${e}, responseLang: ${o})`),await ft(this.site,this.video)!==t.videoId)return null;try{const i=await this.votClient.translateStream({videoData:t,requestLang:e,responseLang:o});if(D.log("Translate stream result",i),!i.translated&&10===i.interval)return await this.updateTranslationErrorMsg(X.get("translationTakeFewMinutes")),new Promise((a=>{this.autoRetry=setTimeout((async()=>{const i=await this.translateStreamImpl(t,e,o);i&&!i.translated&&10===i.interval||a(i)}),1e3*i.interval)}));if(i.message)throw D.log(`Stream translation aborted! Message: ${i.message}`),new pt("streamNoConnectionToServer");if(!i.result)throw D.log("Failed to find translation result! Data:",i),new pt("audioNotReceived");return D.log("Stream translated successfully. Running...",i),this.streamPing=setInterval((async()=>{D.log("Ping stream translation",i.pingId),this.votClient.pingStream({pingId:i.pingId})}),1e3*i.interval),i}catch(t){return console.error("[VOT] Failed to translate stream",t),await this.updateTranslationErrorMsg(t.data?.message??t),null}}async autoTranslate(){if(this.firstPlay&&1===this.data.autoTranslate&&this.videoData.videoId){this.firstPlay=!1;try{await this.translateExecutor(this.videoData.videoId)}catch(t){console.error("[VOT]",t),this.transformBtn("error","VOTLocalizedError"===t?.name?t.localizedMessage:t)}}}getPreferAudio(){return!this.audioContext||(!this.data.newAudioPlayer||(!!this.videoData.isStream||!(this.data.newAudioPlayer&&!this.data.onlyBypassMediaCSP)&&!this.site.needBypassCSP))}createPlayer(){const t=this.getPreferAudio();return D.log("preferAudio:",t),this.audioPlayer=new wo({video:this.video,debug:!1,fetchFn:rt,preferAudio:t}),this}async init(){if(this.initialized)return;const t={autoTranslate:J.get("autoTranslate",0),dontTranslateLanguage:J.get("dontTranslateLanguage",tt),dontTranslateYourLang:J.get("dontTranslateYourLang",1),autoSetVolumeYandexStyle:J.get("autoSetVolumeYandexStyle",1),autoVolume:J.get("autoVolume",H),buttonPos:J.get("buttonPos","default"),showVideoSlider:J.get("showVideoSlider",1),syncVolume:J.get("syncVolume",0),downloadWithName:J.get("downloadWithName",1),subtitlesMaxLength:J.get("subtitlesMaxLength",300),highlightWords:J.get("highlightWords",0),subtitlesFontSize:J.get("subtitlesFontSize",20),subtitlesOpacity:J.get("subtitlesOpacity",20),subtitlesDownloadFormat:J.get("subtitlesDownloadFormat","srt"),responseLanguage:J.get("responseLanguage",tt),defaultVolume:J.get("defaultVolume",100),audioProxy:J.get("audioProxy",0),onlyBypassMediaCSP:J.get("onlyBypassMediaCSP",Number(!!this.audioContext)),newAudioPlayer:J.get("newAudioPlayer",Number(!!this.audioContext)),showPiPButton:J.get("showPiPButton",0),translateAPIErrors:J.get("translateAPIErrors",1),translationService:J.get("translationService",z),detectService:J.get("detectService",W),hotkeyButton:J.get("hotkeyButton",null),m3u8ProxyHost:J.get("m3u8ProxyHost",F),translateProxyEnabled:J.get("translateProxyEnabled",0),proxyWorkerHost:J.get("proxyWorkerHost",q),audioBooster:J.get("audioBooster",0),localeHash:J.get("locale-hash",""),localeUpdatedAt:J.get("locale-updated-at",0)};this.data=Object.fromEntries(await Promise.all(Object.entries(t).map((async([t,e])=>[t,await e])))),console.log("[VOT] data from db: ",this.data),"m3u8-proxy.toil.cc"===this.data.m3u8ProxyHost&&(this.data.m3u8ProxyHost=F,await J.set("m3u8ProxyHost",F),console.log(`[VOT] Old m3u8 proxy host converted to new ${this.data.m3u8ProxyHost} media-proxy`)),"vot.toil.cc"===this.data.proxyWorkerHost&&(this.data.proxyWorkerHost=q,await J.set("proxyWorkerHost",q),console.log(`[VOT] Old proxy worker host converted to new ${this.data.proxyWorkerHost}`)),!this.data.translateProxyEnabled&&GM_info?.scriptHandler&&Y.includes(GM_info.scriptHandler)&&(this.data.translateProxyEnabled=1,await J.set("translateProxyEnabled",1),D.log("translateProxyEnabled",this.data.translateProxyEnabled)),D.log("Extension compatibility passed..."),this.votOpts={headers:this.data.translateProxyEnabled?{}:{"sec-ch-ua":null,"sec-ch-ua-mobile":null,"sec-ch-ua-platform":null},fetchFn:rt,hostVOT:U,host:this.data.translateProxyEnabled?this.data.proxyWorkerHost:"api.browser.yandex.ru"},this.votClient=new(this.data.translateProxyEnabled?xt:wt)(this.votOpts),this.subtitlesWidget=new Re(this.video,this.container,this.site),this.subtitlesWidget.setMaxLength(this.data.subtitlesMaxLength),this.subtitlesWidget.setHighlightWords(this.data.highlightWords),this.subtitlesWidget.setFontSize(this.data.subtitlesFontSize),this.subtitlesWidget.setOpacity(this.data.subtitlesOpacity),this.initUI(),this.initUIEvents(),this.videoData=await this.getVideoData(),this.createPlayer(),this.setSelectMenuValues(this.videoData.detectedLanguage,this.data.responseLanguage??"ru"),this.translateToLang=this.data.responseLanguage??"ru",this.initExtraEvents(),await Promise.all([this.updateSubtitles(),this.autoTranslate()]),this.initialized=!0}transformBtn(t,e){this.votButton.container.dataset.status=t;const o="error"===t&&e.includes(X.get("translationTake"));return this.setLoadingBtn(o),this.votButton.label.textContent=e,this.votButton.container.title="error"===t?e:"",this}setLoadingBtn(t=!1){return this.votButton.container.dataset.loading=t,this}initUI(){this.votButton=je.createVOTButton(X.get("translateVideo")),this.votButton.container.style.opacity=0,this.data?.buttonPos&&"default"!==this.data?.buttonPos&&this.container.clientWidth>550?(this.votButton.container.dataset.direction="column",this.votButton.container.dataset.position=this.data?.buttonPos):(this.votButton.container.dataset.direction="row",this.votButton.container.dataset.position="default"),this.container.appendChild(this.votButton.container),this.votButton.pipButton.hidden=!et()||!this.data?.showPiPButton,this.votButton.separator2.hidden=!et()||!this.data?.showPiPButton,this.votButton.container.addEventListener("click",(t=>{t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()})),this.votMenu=je.createVOTMenu(X.get("VOTSettings")),this.votMenu.container.dataset.position=this.container.clientWidth&&this.container.clientWidth>550?this.data?.buttonPos:"default",this.container.appendChild(this.votMenu.container),this.votDownloadButton=je.createIconButton(Jt``,c);const h=We(n,r,s,{onSelectCb:l});return d.append(u.container,c,h.container),{container:d,fromSelect:u,icon:c,toSelect:h}},updateSlider:Ue,animateLoader:function(t,e="139, 180, 245"){const o=t.querySelector(".vot-loader-helper"),i=t.querySelector(".vot-loader-main");anime.timeline({...Fe,targets:[o,i],duration:250}).add({"fill-opacity":0,"stroke-width":2,d:"M 12 1.5 C 17.799 1.5 22.5 6.201 22.5 12 C 22.5 17.799 17.799 22.5 12 22.5 C 6.201 22.5 1.5 17.799 1.5 12 C 1.5 6.201 6.201 1.5 12 1.5 Z",duration:0}).add({targets:o,stroke:`rgb(${e})`,"stroke-opacity":0,duration:0},0).add({targets:i,stroke:"#888888","stroke-opacity":.25},0);const a=anime.timeline({targets:o,easing:"easeInOutSine",duration:1e3,autoplay:!1}).add({strokeOpacity:1,duration:0},0).add({strokeDashoffset:[anime.setDashoffset,0]},0);return t=>{a.seek(a.duration*(t/100))}},afterAnimateLoader:function(t,e="139, 180, 245"){const o=t.querySelector(".vot-loader-helper"),i=t.querySelector(".vot-loader-main");anime.timeline({...Fe,targets:i,duration:600}).add({d:"M 9.0596 14.8571 L 9.7667 15.5642 L 10.4738 14.8571 L 17.0071 8.3238 C 17.0457 8.2852 17.0937 8.25 17.2333 8.25 C 17.373 8.25 17.421 8.2852 17.4596 8.3238 C 17.4981 8.3624 17.5333 8.4104 17.5333 8.55 C 17.5333 8.6896 17.4981 8.7376 17.4596 8.7762 L 9.9929 16.2429 C 9.9011 16.3346 9.8397 16.35 9.7667 16.35 C 9.6937 16.35 9.6322 16.3346 9.5404 16.2429 L 6.0738 12.7762 C 6.0352 12.7376 6 12.6897 6 12.55 C 6 12.4103 6.0352 12.3624 6.0738 12.3238 C 6.1124 12.2852 6.1603 12.25 6.3 12.25 C 6.4397 12.25 6.4876 12.2852 6.5262 12.3238 L 9.0596 14.8571 Z",duration:0}).add({strokeDashoffset:[anime.setDashoffset,0],stroke:`rgb(${e})`,"stroke-opacity":1}),setTimeout((()=>{anime.timeline({...Fe,targets:i,duration:600}).add({d:"M12 15.575C11.8667 15.575 11.7417 15.5542 11.625 15.5125C11.5083 15.4708 11.4 15.4 11.3 15.3L7.7 11.7C7.5 11.5 7.40417 11.2667 7.4125 11C7.42083 10.7333 7.51667 10.5 7.7 10.3C7.9 10.1 8.1375 9.99583 8.4125 9.9875C8.6875 9.97917 8.925 10.075 9.125 10.275L11 12.15V5C11 4.71667 11.0958 4.47917 11.2875 4.2875C11.4792 4.09583 11.7167 4 12 4C12.2833 4 12.5208 4.09583 12.7125 4.2875C12.9042 4.47917 13 4.71667 13 5V12.15L14.875 10.275C15.075 10.075 15.3125 9.97917 15.5875 9.9875C15.8625 9.99583 16.1 10.1 16.3 10.3C16.4833 10.5 16.5792 10.7333 16.5875 11C16.5958 11.2667 16.5 11.5 16.3 11.7L12.7 15.3C12.6 15.4 12.4917 15.4708 12.375 15.5125C12.2583 15.5542 12.1333 15.575 12 15.575ZM6 20C5.45 20 4.97917 19.8042 4.5875 19.4125C4.19583 19.0208 4 18.55 4 18V16C4 15.7167 4.09583 15.4792 4.2875 15.2875C4.47917 15.0958 4.71667 15 5 15C5.28333 15 5.52083 15.0958 5.7125 15.2875C5.90417 15.4792 6 15.7167 6 16V18H18V16C18 15.7167 18.0958 15.4792 18.2875 15.2875C18.4792 15.0958 18.7167 15 19 15C19.2833 15 19.5208 15.0958 19.7125 15.2875C19.9042 15.4792 20 15.7167 20 16V18C20 18.55 19.8042 19.0208 19.4125 19.4125C19.0208 19.8042 18.55 20 18 20H6Z",duration:100}).add({targets:o,d:"",duration:200},0).add({targets:i,"stroke-width":"0",stroke:`rgba(${e}), 0)`,"fill-opacity":"1","stroke-dasharray":"0","stroke-dashoffset":"0",duration:0})}),2e3)},createDetails:function(t){const e=document.createElement("vot-block");e.classList.add("vot-details");const o=document.createElement("vot-block");o.append(t);const i=document.createElement("vot-block");return i.classList.add("vot-details-arrow-icon"),he(De,i),e.append(o,i),{container:e,header:o,arrowIcon:i}}};o("./node_modules/requestidlecallback-polyfill/index.js");class Ge{constructor(){this.listeners=new Set}hasListener(t){return this.listeners.has(t)}dispatchToListener(t,...e){try{t(...e)}catch(t){console.error("[VOT]",t)}}addListener(t){if(this.hasListener(t))throw new Error("[VOT] The listener has already been added.");this.listeners.add(t)}removeListener(t){if(!this.hasListener(t))throw new Error("[VOT] The listener has not been added yet.");this.listeners.delete(t)}dispatch(...t){for(const e of Array.from(this.listeners))this.dispatchToListener(e,...t)}}const Ye=new Set(["advertise","promo","sponsor","banner","commercial","preroll","midroll","postroll","ad-container","sponsored"]),Je=(()=>{const t=Array.from(Ye).join("|");return new RegExp(t,"i")})(),Ke=t=>{const e=[];for(let o=0;o=0||(o=(t.length-i)/2);const a=2*o;this.ensureCapacity(o+this._frameCount);const n=this.endIndex;this.vector.set(t.subarray(i,i+a),n),this._frameCount+=o}putBuffer(t,e,o=0){e=e||0,o>=0||(o=t.frameCount-e),this.putSamples(t.vector,t.position+e,o)}receive(t){t>=0&&!(t>this._frameCount)||(t=this.frameCount),this._frameCount-=t,this._position+=t}receiveSamples(t,e=0){const o=2*e,i=this.startIndex;t.set(this._vector.subarray(i,i+o)),this.receive(e)}extract(t,e=0,o=0){const i=this.startIndex+2*e,a=2*o;t.set(this._vector.subarray(i,i+a))}ensureCapacity(t=0){const e=parseInt(2*t);if(this._vector.length0&&(this._vector.set(this._vector.subarray(this.startIndex,this.endIndex)),this._position=0)}}class Qe{constructor(t){t?(this._inputBuffer=new Xe,this._outputBuffer=new Xe):this._inputBuffer=this._outputBuffer=null}get inputBuffer(){return this._inputBuffer}set inputBuffer(t){this._inputBuffer=t}get outputBuffer(){return this._outputBuffer}set outputBuffer(t){this._outputBuffer=t}clear(){this._inputBuffer.clear(),this._outputBuffer.clear()}}class to extends Qe{constructor(t){super(t),this.reset(),this._rate=1}set rate(t){this._rate=t}reset(){this.slopeCount=0,this.prevSampleL=0,this.prevSampleR=0}clone(){const t=new to;return t.rate=this._rate,t}process(){const t=this._inputBuffer.frameCount;this._outputBuffer.ensureAdditionalCapacity(t/this._rate+1);const e=this.transpose(t);this._inputBuffer.receive(),this._outputBuffer.put(e)}transpose(t=0){if(0===t)return 0;const e=this._inputBuffer.vector,o=this._inputBuffer.startIndex,i=this._outputBuffer.vector,a=this._outputBuffer.endIndex;let n=0,r=0;for(;this.slopeCount<1;)i[a+2*r]=(1-this.slopeCount)*this.prevSampleL+this.slopeCount*e[o],i[a+2*r+1]=(1-this.slopeCount)*this.prevSampleR+this.slopeCount*e[o+1],r+=1,this.slopeCount+=this._rate;if(this.slopeCount-=1,1!==t)t:for(;;){for(;this.slopeCount>1;)if(this.slopeCount-=1,n+=1,n>=t-1)break t;const s=o+2*n;i[a+2*r]=(1-this.slopeCount)*e[s]+this.slopeCount*e[s+2],i[a+2*r+1]=(1-this.slopeCount)*e[s+1]+this.slopeCount*e[s+3],r+=1,this.slopeCount+=this._rate}return this.prevSampleL=e[o+2*t-2],this.prevSampleR=e[o+2*t-1],r}}class eo{constructor(t){this._pipe=t}get pipe(){return this._pipe}get inputBuffer(){return this._pipe.inputBuffer}get outputBuffer(){return this._pipe.outputBuffer}fillInputBuffer(){throw new Error("fillInputBuffer() not overridden")}fillOutputBuffer(t=0){for(;this.outputBuffer.frameCountthis._position)throw new RangeError("New position may not be greater than current position");const e=this.outputBufferPosition-(this._position-t);if(e<0)throw new RangeError("New position falls outside of history buffer");this.outputBufferPosition=e,this._position=t}get sourcePosition(){return this._sourcePosition}set sourcePosition(t){this.clear(),this._sourcePosition=t}onEnd(){this.callback()}fillInputBuffer(t=0){const e=new Float32Array(2*t),o=this.sourceSound.extract(e,t,this._sourcePosition);this._sourcePosition+=o,this.inputBuffer.putSamples(e,0,o)}extract(t,e=0){this.fillOutputBuffer(this.outputBufferPosition+e);const o=Math.min(e,this.outputBuffer.frameCount-this.outputBufferPosition);this.outputBuffer.extract(t,this.outputBufferPosition,o);const i=this.outputBufferPosition+o;return this.outputBufferPosition=Math.min(this.historyBufferSize,i),this.outputBuffer.receive(Math.max(i-this.historyBufferSize,0)),this._position+=o,o}handleSampleData(t){this.extract(t.data,4096)}clear(){super.clear(),this.outputBufferPosition=0}}const ao=[[124,186,248,310,372,434,496,558,620,682,744,806,868,930,992,1054,1116,1178,1240,1302,1364,1426,1488,0],[-100,-75,-50,-25,25,50,75,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[-20,-15,-10,-5,5,10,15,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[-4,-3,-2,-1,1,2,3,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],no=-10/1.5;class ro extends Qe{constructor(t){super(t),this._quickSeek=!0,this.midBufferDirty=!1,this.midBuffer=null,this.overlapLength=0,this.autoSeqSetting=!0,this.autoSeekSetting=!0,this._tempo=1,this.setParameters(44100,0,0,8)}clear(){super.clear(),this.clearMidBuffer()}clearMidBuffer(){this.midBufferDirty&&(this.midBufferDirty=!1,this.midBuffer=null)}setParameters(t,e,o,i){t>0&&(this.sampleRate=t),i>0&&(this.overlapMs=i),e>0?(this.sequenceMs=e,this.autoSeqSetting=!1):this.autoSeqSetting=!0,o>0?(this.seekWindowMs=o,this.autoSeekSetting=!1):this.autoSeekSetting=!0,this.calculateSequenceParameters(),this.calculateOverlapLength(this.overlapMs),this.tempo=this._tempo}set tempo(t){let e;this._tempo=t,this.calculateSequenceParameters(),this.nominalSkip=this._tempo*(this.seekWindowLength-this.overlapLength),this.skipFract=0,e=Math.floor(this.nominalSkip+.5),this.sampleReq=Math.max(e+this.overlapLength,this.seekWindowLength)+this.seekLength}get tempo(){return this._tempo}get inputChunkSize(){return this.sampleReq}get outputChunkSize(){return this.overlapLength+Math.max(0,this.seekWindowLength-2*this.overlapLength)}calculateOverlapLength(t=0){let e;e=this.sampleRate*t/1e3,e=e<16?16:e,e-=e%8,this.overlapLength=e,this.refMidBuffer=new Float32Array(2*this.overlapLength),this.midBuffer=new Float32Array(2*this.overlapLength)}checkLimits(t,e,o){return to?o:t}calculateSequenceParameters(){let t,e;this.autoSeqSetting&&(t=150+-50*this._tempo,t=this.checkLimits(t,50,125),this.sequenceMs=Math.floor(t+.5)),this.autoSeekSetting&&(e=28.333333333333332+no*this._tempo,e=this.checkLimits(e,15,25),this.seekWindowMs=Math.floor(e+.5)),this.seekWindowLength=Math.floor(this.sampleRate*this.sequenceMs/1e3),this.seekLength=Math.floor(this.sampleRate*this.seekWindowMs/1e3)}set quickSeek(t){this._quickSeek=t}clone(){const t=new ro;return t.tempo=this._tempo,t.setParameters(this.sampleRate,this.sequenceMs,this.seekWindowMs,this.overlapMs),t}seekBestOverlapPosition(){return this._quickSeek?this.seekBestOverlapPositionStereoQuick():this.seekBestOverlapPositionStereo()}seekBestOverlapPositionStereo(){let t,e,o,i=0;for(this.preCalculateCorrelationReferenceStereo(),t=0,e=Number.MIN_VALUE;ie&&(e=o,t=i);return t}seekBestOverlapPositionStereoQuick(){let t,e,o,i,a,n=0;for(this.preCalculateCorrelationReferenceStereo(),e=Number.MIN_VALUE,t=0,i=0,a=0;n<4;n+=1){let r=0;for(;ao[n][r]&&(a=i+ao[n][r],!(a>=this.seekLength));)o=this.calculateCrossCorrelationStereo(2*a,this.refMidBuffer),o>e&&(e=o,t=a),r+=1;i=t}return t}preCalculateCorrelationReferenceStereo(){let t,e,o=0;for(;o=this.sampleReq;){t=this.seekBestOverlapPosition(),this._outputBuffer.ensureAdditionalCapacity(this.overlapLength),this.overlap(Math.floor(t)),this._outputBuffer.put(this.overlapLength),e=this.seekWindowLength-2*this.overlapLength,e>0&&this._outputBuffer.putBuffer(this._inputBuffer,t+this.overlapLength,e);const i=this._inputBuffer.startIndex+2*(t+this.seekWindowLength-this.overlapLength);this.midBuffer.set(this._inputBuffer.vector.subarray(i,i+2*this.overlapLength)),this.skipFract+=this.nominalSkip,o=Math.floor(this.skipFract),this.skipFract-=o,this._inputBuffer.receive(o)}}}const so=function(t,e){return(t>e?t-e:e-t)>1e-10};class lo{constructor(){this.transposer=new to(!1),this.stretch=new ro(!1),this._inputBuffer=new Xe,this._intermediateBuffer=new Xe,this._outputBuffer=new Xe,this._rate=0,this._tempo=0,this.virtualPitch=1,this.virtualRate=1,this.virtualTempo=1,this.calculateEffectiveRateAndTempo()}clear(){this.transposer.clear(),this.stretch.clear()}clone(){const t=new lo;return t.rate=this.rate,t.tempo=this.tempo,t}get rate(){return this._rate}set rate(t){this.virtualRate=t,this.calculateEffectiveRateAndTempo()}set rateChange(t){this._rate=1+.01*t}get tempo(){return this._tempo}set tempo(t){this.virtualTempo=t,this.calculateEffectiveRateAndTempo()}set tempoChange(t){this.tempo=1+.01*t}set pitch(t){this.virtualPitch=t,this.calculateEffectiveRateAndTempo()}set pitchOctaves(t){this.pitch=Math.exp(.69314718056*t),this.calculateEffectiveRateAndTempo()}set pitchSemitones(t){this.pitchOctaves=t/12}get inputBuffer(){return this._inputBuffer}get outputBuffer(){return this._outputBuffer}calculateEffectiveRateAndTempo(){const t=this._tempo,e=this._rate;this._tempo=this.virtualTempo/this.virtualPitch,this._rate=this.virtualRate*this.virtualPitch,so(this._tempo,t)&&(this.stretch.tempo=this._tempo),so(this._rate,e)&&(this.transposer.rate=this._rate),this._rate>1?this._outputBuffer!=this.transposer.outputBuffer&&(this.stretch.inputBuffer=this._inputBuffer,this.stretch.outputBuffer=this._intermediateBuffer,this.transposer.inputBuffer=this._intermediateBuffer,this.transposer.outputBuffer=this._outputBuffer):this._outputBuffer!=this.stretch.outputBuffer&&(this.transposer.inputBuffer=this._inputBuffer,this.transposer.outputBuffer=this._intermediateBuffer,this.stretch.inputBuffer=this._intermediateBuffer,this.stretch.outputBuffer=this._outputBuffer)}process(){this._rate>1?(this.stretch.process(),this.transposer.process()):(this.transposer.process(),this.stretch.process())}}class uo{constructor(t){this.buffer=t,this._position=0}get dualChannel(){return this.buffer.numberOfChannels>1}get position(){return this._position}set position(t){this._position=t}extract(t,e=0,o=0){this.position=o;let i=this.buffer.getChannelData(0),a=this.dualChannel?this.buffer.getChannelData(1):this.buffer.getChannelData(0),n=0;for(;n=e?t:new Array(e-t.length+1).join(o)+t}(parseInt(t-60*e),2)}`},ho=function(t){const e=this.timePlayed,o=this.sampleRate;if(this.sourcePosition=t,this.timePlayed=t/o,e!==this.timePlayed){const t=new CustomEvent("play",{detail:{timePlayed:this.timePlayed,formattedTimePlayed:this.formattedTimePlayed,percentagePlayed:this.percentagePlayed}});this._node.dispatchEvent(t)}};class po{constructor(t,e,o,i=oo){this._soundtouch=new lo;const a=new uo(e);this.timePlayed=0,this.sourcePosition=0,this._filter=new io(a,this._soundtouch,i),this._node=function(t,e,o=oo,i=4096){const a=t.createScriptProcessor(i,2,2),n=new Float32Array(2*i);return a.onaudioprocess=t=>{let a=t.outputBuffer.getChannelData(0),r=t.outputBuffer.getChannelData(1),s=e.extract(n,i);o(e.sourcePosition),0===s&&e.onEnd();let l=0;for(;lho.call(this,t)),o),this.tempo=1,this.rate=1,this.duration=e.duration,this.sampleRate=t.sampleRate,this.listeners=[]}get formattedDuration(){return co(this.duration)}get formattedTimePlayed(){return co(this.timePlayed)}get percentagePlayed(){return 100*this._filter.sourcePosition/(this.duration*this.sampleRate)}set percentagePlayed(t){this._filter.sourcePosition=parseInt(t*this.duration*this.sampleRate),this.sourcePosition=this._filter.sourcePosition,this.timePlayed=this.sourcePosition/this.sampleRate}get node(){return this._node}set pitch(t){this._soundtouch.pitch=t}set pitchSemitones(t){this._soundtouch.pitchSemitones=t}set rate(t){this._soundtouch.rate=t}set tempo(t){this._soundtouch.tempo=t}connect(t){this._node.connect(t)}disconnect(){this._node.disconnect()}on(t,e){this.listeners.push({name:t,cb:e}),this._node.addEventListener(t,(t=>e(t.detail)))}off(t=null){let e=this.listeners;t&&(e=e.filter((e=>e.name===t))),e.forEach((t=>{this._node.removeEventListener(t.name,(e=>t.cb(e.detail)))}))}}const go=(...t)=>{if(Ze.debug)return console.log(`%c✦ chaimu.js v${Ze.version} ✦`,"background: #000; color: #fff; padding: 0 8px",...t)},mo=["playing","ratechange","play","waiting","pause","seeked"];function vo(){const t=window.AudioContext||window.webkitAudioContext;return t?new t:void 0}class fo{static name="BasePlayer";chaimu;_src;fetch;constructor(t,e){this.chaimu=t,this._src=e,this.fetch=Ze.fetchFn}async init(){return new Promise((t=>t(this)))}clear(){return new Promise((t=>t(this)))}lipSync(t=!1){return this}handleVideoEvent=t=>(go(`handle video ${t.type}`),this.lipSync(t.type),this);removeVideoEvents(){for(const t of mo)this.chaimu.video.removeEventListener(t,this.handleVideoEvent);return this}addVideoEvents(){for(const t of mo)this.chaimu.video.addEventListener(t,this.handleVideoEvent);return this}async play(){return new Promise((t=>t(this)))}async pause(){return new Promise((t=>t(this)))}get name(){return this.constructor.name}set src(t){this._src=t}get src(){return this._src}get currentSrc(){return this._src}set volume(t){}get volume(){return 0}get playbackRate(){return 0}set playbackRate(t){}get currentTime(){return 0}}class bo extends fo{static name="AudioPlayer";audio;gainNode;audioSource;constructor(t,e){super(t,e),this.audio=new Audio(e),this.audio.crossOrigin="anonymous"}initAudioBooster(){return this.chaimu.audioContext?(this.gainNode&&this.audioSource&&(this.audioSource.disconnect(this.gainNode),this.gainNode.disconnect()),this.gainNode=this.chaimu.audioContext.createGain(),this.gainNode.connect(this.chaimu.audioContext.destination),this.audioSource=this.chaimu.audioContext.createMediaElementSource(this.audio),this.audioSource.connect(this.gainNode),this):this}async init(){return new Promise((t=>(this.initAudioBooster(),t(this))))}audioErrorHandle=t=>{console.error("[AudioPlayer]",t)};lipSync(t=!1){if(go("[AudioPlayer] lipsync video",this.chaimu.video),!this.chaimu.video)return this;if(this.audio.currentTime=this.chaimu.video.currentTime,this.audio.playbackRate=this.chaimu.video.playbackRate,!t)return go("[AudioPlayer] lipsync mode isn't set"),this;switch(go(`[AudioPlayer] lipsync mode is ${t}`),t){case"play":case"playing":case"seeked":return this.chaimu.video.paused||this.syncPlay(),this;case"pause":case"waiting":return this.pause(),this;default:return this}}async clear(){return new Promise((t=>(this.audio.pause(),this.audio.src="",this.audio.removeAttribute("src"),t(this))))}syncPlay(){return go("[AudioPlayer] sync play called"),this.audio.play().catch(this.audioErrorHandle),this}async play(){return go("[AudioPlayer] play called"),await this.audio.play().catch(this.audioErrorHandle),this}async pause(){return new Promise((t=>(go("[AudioPlayer] pause called"),this.audio.pause(),t(this))))}set src(t){this._src=t,t?this.audio.src=t:this.clear()}get src(){return this._src}get currentSrc(){return this.audio.currentSrc}set volume(t){this.gainNode?this.gainNode.gain.value=t:this.audio.volume=t}get volume(){return this.gainNode?this.gainNode.gain.value:this.audio.volume}get playbackRate(){return this.audio.playbackRate}set playbackRate(t){this.audio.playbackRate=t}get currentTime(){return this.audio.currentTime}}class yo extends fo{static name="ChaimuPlayer";audioBuffer;sourceNode;gainNode;audioShifter;cleanerRunned=!1;async fetchAudio(){if(!this._src)throw new Error("No audio source provided");if(!this.chaimu.audioContext)throw new Error("No audio context available");go(`[ChaimuPlayer] Fetching audio from ${this._src}...`);try{const t=await this.fetch(this._src);go("[ChaimuPlayer] Decoding fetched audio...");const e=await t.arrayBuffer();this.audioBuffer=await this.chaimu.audioContext.decodeAudioData(e)}catch(t){throw new Error(`Failed to fetch audio file, because ${t.message}`)}return this}initAudioBooster(){return this.chaimu.audioContext?(this.gainNode&&this.gainNode.disconnect(),this.gainNode=this.chaimu.audioContext.createGain(),this):this}async init(){return await this.fetchAudio(),this.initAudioBooster(),this}lipSync(t=!1){if(go("[ChaimuPlayer] lipsync video",this.chaimu.video,this),!this.chaimu.video)return this;if(!t)return go("[ChaimuPlayer] lipsync mode isn't set"),this;switch(go(`[ChaimuPlayer] lipsync mode is ${t}`),t){case"play":case"playing":case"ratechange":case"seeked":return this.chaimu.video.paused||this.start(),this;case"pause":case"waiting":return this.pause(),this;default:return this}}async reopenCtx(){if(!this.chaimu.audioContext)throw new Error("No audio context available");try{await this.chaimu.audioContext.close()}catch{}return this}async clear(){if(!this.chaimu.audioContext)throw new Error("No audio context available");if(go("clear audio context"),this.cleanerRunned=!0,await this.pause(),!this.gainNode)return this.cleanerRunned=!1,this;this.sourceNode&&(this.sourceNode.stop(),this.sourceNode.disconnect(this.gainNode),this.sourceNode=void 0),this.audioShifter&&(this.audioShifter._node.disconnect(this.gainNode),this.audioShifter=void 0),this.gainNode.disconnect();const t=this.volume;return this.gainNode=void 0,await this.reopenCtx(),this.chaimu.audioContext=vo(),this.initAudioBooster(),this.volume=t,this.cleanerRunned=!1,this}async start(){if(!this.chaimu.audioContext)throw new Error("No audio context available");if(!this.audioBuffer)throw new Error("The player isn't initialized");return!this.gainNode||this.audioShifter&&this.audioShifter.duration({label:X.get("langs")[t]??t.toUpperCase(),value:t,selected:e===t})))}const ko=t=>t?X.get("VOTChangeHotkeyWithCurrent").replace("{0}",t.replace("Key","")):X.get("VOTCreateTranslationHotkey");class To{translateFromLang="en";translateToLang=tt;timer;videoData="";firstPlay=!0;audioContext=vo();hls=ot();votClient;audioPlayer;videoTranslations=[];videoTranslationTTL=7200;cachedTranslation;downloadTranslationUrl=null;autoRetry;streamPing;votOpts;volumeOnStart;tempOriginalVolume;tempVolume;firstSyncVolume=!0;subtitlesList=[];subtitlesListVideoId=null;dragging;constructor(t,e,o){D.log("[VideoHandler] add video:",t,"container:",e,this),this.video=t,this.container=e,this.site=o,this.init()}async translateVideoImpl(t,e,o,i=null){if(clearTimeout(this.autoRetry),D.log(t,`Translate video (requestLang: ${e}, responseLang: ${o})`),await ft(this.site,this.video)!==t.videoId)return null;try{const a=await this.votClient.translateVideo({videoData:t,requestLang:e,responseLang:o,translationHelp:i,extraOpts:{useNewModel:this.data?.useNewModel}});if(D.log("Translate video result",a),a.translated&&a.remainingTime<1)return D.log("Video translation finished with this data: ",a),a;await this.updateTranslationErrorMsg(a.remainingTime>0?function(t){let e=Math.floor(t/60),o=Math.floor(t%60);return o/60>=.66&&(e+=1,o=0),e>=60?X.get("translationTakeMoreThanHour"):1===e||0===e&&o>0?X.get("translationTakeAboutMinute"):11!==e&&e%10==1?X.get("translationTakeApproximatelyMinute2").replace("{0}",e):![12,13,14].includes(e)&&[2,3,4].includes(e%10)?X.get("translationTakeApproximatelyMinute").replace("{0}",e):X.get("translationTakeApproximatelyMinutes").replace("{0}",e)}(a.remainingTime):a.message??X.get("translationTakeFewMinutes"))}catch(t){return console.error("[VOT] Failed to translate video",t),await this.updateTranslationErrorMsg(t.data?.message??t),null}return new Promise((a=>{const n=this.subtitlesList.some((t=>"yandex"===t.source))?2e4:3e4;this.autoRetry=setTimeout((async()=>{const n=await this.translateVideoImpl(t,e,o,i);(!n||n.translated&&n.remainingTime<1)&&a(n)}),n)}))}async translateStreamImpl(t,e,o){if(clearTimeout(this.autoRetry),D.log(t,`Translate stream (requestLang: ${e}, responseLang: ${o})`),await ft(this.site,this.video)!==t.videoId)return null;try{const i=await this.votClient.translateStream({videoData:t,requestLang:e,responseLang:o});if(D.log("Translate stream result",i),!i.translated&&10===i.interval)return await this.updateTranslationErrorMsg(X.get("translationTakeFewMinutes")),new Promise((a=>{this.autoRetry=setTimeout((async()=>{const i=await this.translateStreamImpl(t,e,o);i&&!i.translated&&10===i.interval||a(i)}),1e3*i.interval)}));if(i.message)throw D.log(`Stream translation aborted! Message: ${i.message}`),new pt("streamNoConnectionToServer");if(!i.result)throw D.log("Failed to find translation result! Data:",i),new pt("audioNotReceived");return D.log("Stream translated successfully. Running...",i),this.streamPing=setInterval((async()=>{D.log("Ping stream translation",i.pingId),this.votClient.pingStream({pingId:i.pingId})}),1e3*i.interval),i}catch(t){return console.error("[VOT] Failed to translate stream",t),await this.updateTranslationErrorMsg(t.data?.message??t),null}}async autoTranslate(){if(this.firstPlay&&1===this.data.autoTranslate&&this.videoData.videoId){this.firstPlay=!1;try{await this.translateExecutor(this.videoData.videoId)}catch(t){console.error("[VOT]",t),this.transformBtn("error","VOTLocalizedError"===t?.name?t.localizedMessage:t)}}}getPreferAudio(){return!this.audioContext||(!this.data.newAudioPlayer||(!!this.videoData.isStream||!(this.data.newAudioPlayer&&!this.data.onlyBypassMediaCSP)&&!this.site.needBypassCSP))}createPlayer(){const t=this.getPreferAudio();return D.log("preferAudio:",t),this.audioPlayer=new wo({video:this.video,debug:!1,fetchFn:rt,preferAudio:t}),this}async init(){if(this.initialized)return;const t={autoTranslate:J.get("autoTranslate",0),dontTranslateLanguage:J.get("dontTranslateLanguage",tt),dontTranslateYourLang:J.get("dontTranslateYourLang",1),autoSetVolumeYandexStyle:J.get("autoSetVolumeYandexStyle",1),autoVolume:J.get("autoVolume",H),buttonPos:J.get("buttonPos","default"),showVideoSlider:J.get("showVideoSlider",1),syncVolume:J.get("syncVolume",0),downloadWithName:J.get("downloadWithName",1),subtitlesMaxLength:J.get("subtitlesMaxLength",300),highlightWords:J.get("highlightWords",0),subtitlesFontSize:J.get("subtitlesFontSize",20),subtitlesOpacity:J.get("subtitlesOpacity",20),subtitlesDownloadFormat:J.get("subtitlesDownloadFormat","srt"),responseLanguage:J.get("responseLanguage",tt),defaultVolume:J.get("defaultVolume",100),audioProxy:J.get("audioProxy",0),onlyBypassMediaCSP:J.get("onlyBypassMediaCSP",Number(!!this.audioContext)),newAudioPlayer:J.get("newAudioPlayer",Number(!!this.audioContext)),showPiPButton:J.get("showPiPButton",0),translateAPIErrors:J.get("translateAPIErrors",1),translationService:J.get("translationService",z),detectService:J.get("detectService",W),hotkeyButton:J.get("hotkeyButton",null),m3u8ProxyHost:J.get("m3u8ProxyHost",F),translateProxyEnabled:J.get("translateProxyEnabled",0),proxyWorkerHost:J.get("proxyWorkerHost",q),audioBooster:J.get("audioBooster",0),useNewModel:J.get("useNewModel",1),localeHash:J.get("locale-hash",""),localeUpdatedAt:J.get("locale-updated-at",0)};this.data=Object.fromEntries(await Promise.all(Object.entries(t).map((async([t,e])=>[t,await e])))),console.log("[VOT] data from db: ",this.data),"m3u8-proxy.toil.cc"===this.data.m3u8ProxyHost&&(this.data.m3u8ProxyHost=F,await J.set("m3u8ProxyHost",F),console.log(`[VOT] Old m3u8 proxy host converted to new ${this.data.m3u8ProxyHost} media-proxy`)),"vot.toil.cc"===this.data.proxyWorkerHost&&(this.data.proxyWorkerHost=q,await J.set("proxyWorkerHost",q),console.log(`[VOT] Old proxy worker host converted to new ${this.data.proxyWorkerHost}`)),!this.data.translateProxyEnabled&&GM_info?.scriptHandler&&Y.includes(GM_info.scriptHandler)&&(this.data.translateProxyEnabled=1,await J.set("translateProxyEnabled",1),D.log("translateProxyEnabled",this.data.translateProxyEnabled)),D.log("Extension compatibility passed..."),this.votOpts={headers:this.data.translateProxyEnabled?{}:{"sec-ch-ua":null,"sec-ch-ua-mobile":null,"sec-ch-ua-platform":null},fetchFn:rt,hostVOT:U,host:this.data.translateProxyEnabled?this.data.proxyWorkerHost:"api.browser.yandex.ru"},this.votClient=new(this.data.translateProxyEnabled?xt:wt)(this.votOpts),this.subtitlesWidget=new Re(this.video,this.container,this.site),this.subtitlesWidget.setMaxLength(this.data.subtitlesMaxLength),this.subtitlesWidget.setHighlightWords(this.data.highlightWords),this.subtitlesWidget.setFontSize(this.data.subtitlesFontSize),this.subtitlesWidget.setOpacity(this.data.subtitlesOpacity),this.initUI(),this.initUIEvents(),this.videoData=await this.getVideoData(),this.createPlayer(),this.setSelectMenuValues(this.videoData.detectedLanguage,this.data.responseLanguage??"ru"),this.translateToLang=this.data.responseLanguage??"ru",this.initExtraEvents(),await Promise.all([this.updateSubtitles(),this.autoTranslate()]),this.initialized=!0}transformBtn(t,e){this.votButton.container.dataset.status=t;const o="error"===t&&e.includes(X.get("translationTake"));return this.setLoadingBtn(o),this.votButton.label.textContent=e,this.votButton.container.title="error"===t?e:"",this}setLoadingBtn(t=!1){return this.votButton.container.dataset.loading=t,this}initUI(){this.votButton=je.createVOTButton(X.get("translateVideo")),this.votButton.container.style.opacity=0,this.data?.buttonPos&&"default"!==this.data?.buttonPos&&this.container.clientWidth>550?(this.votButton.container.dataset.direction="column",this.votButton.container.dataset.position=this.data?.buttonPos):(this.votButton.container.dataset.direction="row",this.votButton.container.dataset.position="default"),this.container.appendChild(this.votButton.container),this.votButton.pipButton.hidden=!et()||!this.data?.showPiPButton,this.votButton.separator2.hidden=!et()||!this.data?.showPiPButton,this.votButton.container.addEventListener("click",(t=>{t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()})),this.votMenu=je.createVOTMenu(X.get("VOTSettings")),this.votMenu.container.dataset.position=this.container.clientWidth&&this.container.clientWidth>550?this.data?.buttonPos:"default",this.container.appendChild(this.votMenu.container),this.votDownloadButton=je.createIconButton(Jt`${100*this.getVideoVolume()}%`,100*this.getVideoVolume()),this.votVideoVolumeSlider.container.hidden=1!==this.data.showVideoSlider||"success"!==this.votButton.container.dataset.status,this.votMenu.bodyContainer.appendChild(this.votVideoVolumeSlider.container),this.votVideoTranslationVolumeSlider=je.createSlider(Yt`${X.get("VOTVolumeTranslation")}: ${this.data?.defaultVolume??100}%`,this.data?.defaultVolume??100,0,this.data.audioBooster?900:100),this.votVideoTranslationVolumeSlider.container.hidden="success"!==this.votButton.container.dataset.status,this.votMenu.bodyContainer.appendChild(this.votVideoTranslationVolumeSlider.container),this.votMenu.container.addEventListener("click",(t=>{t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()})),this.votSettingsDialog=je.createDialog(X.get("VOTSettings")),document.documentElement.appendChild(this.votSettingsDialog.container),this.votTranslationHeader=je.createHeader(X.get("translationSettings")),this.votSettingsDialog.bodyContainer.appendChild(this.votTranslationHeader),this.votAutoTranslateCheckbox=je.createCheckbox(X.get("VOTAutoTranslate"),this.data?.autoTranslate??!1),this.votSettingsDialog.bodyContainer.appendChild(this.votAutoTranslateCheckbox.container),this.votDontTranslateYourLangSelect=je.createVOTSelect(X.get("langs")[this.data.dontTranslateLanguage],X.get("VOTDontTranslateYourLang"),So(ut,this.data.dontTranslateLanguage),{onSelectCb:async t=>{this.data.dontTranslateLanguage=t.target.dataset.votValue,await J.set("dontTranslateLanguage",this.data.dontTranslateLanguage)},labelElement:je.createCheckbox(X.get("VOTDontTranslateYourLang"),this.data?.dontTranslateYourLang??!0).container}),this.votSettingsDialog.bodyContainer.appendChild(this.votDontTranslateYourLangSelect.container),this.changehotkeyButton=je.createOutlinedButton(ko(this.data.hotkeyButton)),this.votSettingsDialog.bodyContainer.appendChild(this.changehotkeyButton),this.votAutoSetVolumeCheckbox=je.createCheckbox(`${X.get("VOTAutoSetVolume")}`,this.data?.autoSetVolumeYandexStyle??!0),this.votSettingsDialog.bodyContainer.appendChild(this.votAutoSetVolumeCheckbox.container),this.votAutoSetVolumeSlider=je.createSlider(Yt`${Math.round(100*(this.data?.autoVolume??H))}%`,Math.round(100*(this.data?.autoVolume??H)),0,100),this.votSettingsDialog.bodyContainer.appendChild(this.votAutoSetVolumeSlider.container),this.votShowVideoSliderCheckbox=je.createCheckbox(X.get("VOTShowVideoSlider"),this.data?.showVideoSlider??!1),this.votSettingsDialog.bodyContainer.appendChild(this.votShowVideoSliderCheckbox.container),this.votAudioBoosterCheckbox=je.createCheckbox(X.get("VOTAudioBooster"),this.data?.audioBooster??!1),this.audioContext||(this.votAudioBoosterCheckbox.input.disabled=!0,this.votAudioBoosterCheckbox.container.title=X.get("VOTNeedWebAudioAPI")),this.votSettingsDialog.bodyContainer.appendChild(this.votAudioBoosterCheckbox.container),this.votSyncVolumeCheckbox=je.createCheckbox(X.get("VOTSyncVolume"),this.data?.syncVolume??!1),this.votSettingsDialog.bodyContainer.appendChild(this.votSyncVolumeCheckbox.container),this.votDownloadWithNameCheckbox=je.createCheckbox(X.get("VOTDownloadWithName"),this.data?.downloadWithName??!1),this.votSettingsDialog.bodyContainer.appendChild(this.votDownloadWithNameCheckbox.container),this.votTranslationServiceSelect=je.createVOTSelect(this.data.translationService.toUpperCase(),X.get("VOTTranslationService"),So(Ce,this.data.translationService),{onSelectCb:async t=>{this.data.translationService=t.target.dataset.votValue,await J.set("translationService",this.data.translationService)},labelElement:je.createCheckbox(X.get("VOTTranslateAPIErrors"),this.data.translateAPIErrors??!0).container}),this.votTranslationServiceSelect.container.hidden="ru"===X.lang,this.votSettingsDialog.bodyContainer.appendChild(this.votTranslationServiceSelect.container),this.votDetectServiceSelect=je.createVOTSelect(this.data.detectService.toUpperCase(),X.get("VOTDetectService"),So(Pe,this.data.detectService),{onSelectCb:async t=>{this.data.detectService=t.target.dataset.votValue,await J.set("detectService",this.data.detectService)},labelElement:je.createVOTSelectLabel(X.get("VOTDetectService"))}),this.votSettingsDialog.bodyContainer.appendChild(this.votDetectServiceSelect.container),this.votSubtitlesHeader=je.createHeader(X.get("subtitlesSettings")),this.votSettingsDialog.bodyContainer.appendChild(this.votSubtitlesHeader),this.votSubtitlesDetails=je.createDetails(X.get("VOTSubtitlesDesign")),this.votSettingsDialog.bodyContainer.appendChild(this.votSubtitlesDetails.container),this.votProxyHeader=je.createHeader(X.get("proxySettings")),this.votSettingsDialog.bodyContainer.appendChild(this.votProxyHeader),this.votM3u8ProxyHostTextfield=je.createTextfield(X.get("VOTM3u8ProxyHost"),this.data?.m3u8ProxyHost,F),this.votSettingsDialog.bodyContainer.appendChild(this.votM3u8ProxyHostTextfield.container),this.votProxyWorkerHostTextfield=je.createTextfield(X.get("VOTProxyWorkerHost"),this.data?.proxyWorkerHost,q),this.votSettingsDialog.bodyContainer.appendChild(this.votProxyWorkerHostTextfield.container),this.votAudioProxyCheckbox=je.createCheckbox(X.get("VOTAudioProxy"),this.data?.audioProxy??!1),this.votSettingsDialog.bodyContainer.appendChild(this.votAudioProxyCheckbox.container),this.votNewAudioPlayerCheckbox=je.createCheckbox(X.get("VOTNewAudioPlayer"),this.data?.newAudioPlayer??!1),this.audioContext||(this.votNewAudioPlayerCheckbox.input.disabled=!0,this.votNewAudioPlayerCheckbox.container.title=X.get("VOTNeedWebAudioAPI")),this.votSettingsDialog.bodyContainer.appendChild(this.votNewAudioPlayerCheckbox.container),this.votOnlyBypassMediaCSPCheckbox=je.createCheckbox(X.get("VOTOnlyBypassMediaCSP")+(this.site.needBypassCSP?` (${X.get("VOTMediaCSPEnabledOnSite")})`:""),this.data?.onlyBypassMediaCSP??!1),this.votOnlyBypassMediaCSPCheckbox.container.classList.add("vot-checkbox-sub"),this.audioContext||(this.votOnlyBypassMediaCSPCheckbox.container.title=X.get("VOTNeedWebAudioAPI")),this.votOnlyBypassMediaCSPCheckbox.input.disabled=!this.data.newAudioPlayer&&this.audioContext,this.data.newAudioPlayer||(this.votOnlyBypassMediaCSPCheckbox.container.hidden=!0),this.votSettingsDialog.bodyContainer.appendChild(this.votOnlyBypassMediaCSPCheckbox.container),this.votAboutHeader=je.createHeader(X.get("about")),this.votSettingsDialog.bodyContainer.appendChild(this.votAboutHeader),this.votLanguageSelect=je.createVOTSelect(X.get("langs")[J.syncGet("locale-lang-override","auto")],X.get("VOTMenuLanguage"),So(Z,J.syncGet("locale-lang-override","auto")),{onSelectCb:async t=>{await J.set("locale-lang-override",t.target.dataset.votValue)},labelElement:je.createVOTSelectLabel(X.get("VOTMenuLanguage"))}),this.votSettingsDialog.bodyContainer.appendChild(this.votLanguageSelect.container),this.votShowPiPButtonCheckbox=je.createCheckbox(X.get("VOTShowPiPButton"),this.data?.showPiPButton??!1),this.votShowPiPButtonCheckbox.container.hidden=!et(),this.votSettingsDialog.bodyContainer.appendChild(this.votShowPiPButtonCheckbox.container),this.votVersionInfo=je.createInformation(`${X.get("VOTVersion")}:`,GM_info.script.version),this.votSettingsDialog.bodyContainer.appendChild(this.votVersionInfo.container),this.votAuthorsInfo=je.createInformation(`${X.get("VOTAuthors")}:`,GM_info.script.author),this.votSettingsDialog.bodyContainer.appendChild(this.votAuthorsInfo.container),this.votLoaderInfo=je.createInformation(`${X.get("VOTLoader")}:`,`${GM_info.scriptHandler} v${GM_info.version}`),this.votSettingsDialog.bodyContainer.appendChild(this.votLoaderInfo.container),this.votBrowserInfo=je.createInformation(`${X.get("VOTBrowser")}:`,`${xo.browser.name} ${xo.browser.version} (${xo.os.name} ${xo.os.version})`),this.votSettingsDialog.bodyContainer.appendChild(this.votBrowserInfo.container),this.votLocaleInfo=je.createInformation(`${X.get("VOTLocaleHash")}:`,Yt`${this.data.localeHash}
(${X.get("VOTUpdatedAt")} - ${new Date(1e3*this.data.localeUpdatedAt).toLocaleString()})`),this.votSettingsDialog.bodyContainer.appendChild(this.votLocaleInfo.container),this.votUpdateLocaleFilesButton=je.createOutlinedButton(X.get("VOTUpdateLocaleFiles")),this.votSettingsDialog.bodyContainer.appendChild(this.votUpdateLocaleFilesButton),this.votResetSettingsButton=je.createButton(X.get("resetSettings")),this.votSettingsDialog.bodyContainer.appendChild(this.votResetSettingsButton)}async handleTranslationBtnClick(){if(D.log("[click translationBtn]",this.audioPlayer,this.audioPlayer.player),this.audioPlayer.player.src)return D.log("[click translationBtn] audio.src is not empty",this.audioPlayer.player.src),void this.stopTranslate();if(this.hls.url)return D.log("[click translationBtn] hls is not empty",this.hls.url),void this.stopTranslate();try{if(D.log("[click translationBtn] trying execute translation"),!this.videoData.videoId)throw new pt("VOTNoVideoIDFound");"vk"===this.site.host&&"clips"===this.site.additionalData&&(this.videoData=await this.getVideoData()),await this.translateExecutor(this.videoData.videoId)}catch(t){console.error("[VOT]",t),"VOTLocalizedError"===t?.name?this.transformBtn("error",t.localizedMessage):this.transformBtn("error",t?.message)}}initUIEvents(){this.votButton.translateButton.addEventListener("click",(async()=>{await this.handleTranslationBtnClick()})),this.votButton.pipButton.addEventListener("click",(()=>{(async()=>{this.video!==document.pictureInPictureElement?await this.video.requestPictureInPicture():await document.exitPictureInPicture()})()})),this.votButton.menuButton.addEventListener("click",(()=>{this.votMenu.container.hidden=!this.votMenu.container.hidden})),this.votButton.container.addEventListener("mousedown",(()=>{this.dragging=!0})),this.container.addEventListener("mouseup",(()=>{this.dragging=!1})),this.container.addEventListener("mousemove",(async t=>{if(this.dragging){t.preventDefault();const e=t.clientX/this.container.clientWidth*100,o=this.container.clientWidth>550,i=e<=44?"left":e>=66?"right":"default";this.data.buttonPos=o?i:"default",this.votButton.container.dataset.direction="default"===this.data.buttonPos?"row":"column",this.votButton.container.dataset.position=this.data.buttonPos,this.votMenu.container.dataset.position=this.data.buttonPos,o&&await J.set("buttonPos",this.data.buttonPos)}})),this.votDownloadButton.addEventListener("click",(async()=>{if(!this.downloadTranslationUrl)return;if(!this.data.downloadWithName)return window.open(this.downloadTranslationUrl,"_blank").focus();const t=document.querySelector("#vot-loader-download"),e=getComputedStyle(this.votMenu.container).getPropertyValue("--vot-primary-rgb"),o=je.animateLoader(t,e),i=await rt(this.downloadTranslationUrl),a=i.body.getReader(),n=+i.headers.get("Content-Length");let r=0;const s=[];for(;;){const{done:t,value:e}=await a.read();if(t)break;s.push(e),r+=e.length,o(Math.round(r/n*100))}je.afterAnimateLoader(t,e);const l=new Blob(s),d=nt(this.videoData.title??this.videoData.videoId),u=await l.arrayBuffer(),c=new xe(u);c.setFrame("TIT2",d),c.addTag(),at(c.getBlob(),`${d}.mp3`)})),this.votDownloadSubtitlesButton.addEventListener("click",(async()=>{const t=this.data.subtitlesDownloadFormat,e=Pt(this.yandexSubtitles,t);at(new Blob(["json"===t?JSON.stringify(e):e],{type:"text/plain"}),`${this.data.downloadWithName?nt(this.videoData.title??this.videoData.videoId):`subtitles_${this.videoData.videoId}`}.${t}`)})),this.votSettingsButton.addEventListener("click",(()=>{this.votSettingsDialog.container.hidden=!this.votSettingsDialog.container.hidden,(document.fullscreenElement||document.webkitFullscreenElement)&&(document.webkitExitFullscreen&&document.webkitExitFullscreen(),document.exitFullscreen&&document.exitFullscreen())})),this.votVideoVolumeSlider.input.addEventListener("input",(t=>{const e=Number(t.target.value);this.votVideoVolumeSlider.label.querySelector("strong").textContent=`${e}%`,this.setVideoVolume(e/100),this.data.syncVolume&&this.syncVolumeWrapper("video",e)})),this.votVideoTranslationVolumeSlider.input.addEventListener("input",(t=>{(async()=>{this.data.defaultVolume=Number(t.target.value),await J.set("defaultVolume",this.data.defaultVolume),this.votVideoTranslationVolumeSlider.label.querySelector("strong").textContent=`${this.data.defaultVolume}%`,this.audioPlayer.player.volume=this.data.defaultVolume/100,this.data.syncVolume&&(this.syncVolumeWrapper("translation",this.data.defaultVolume),["youtube","googledrive"].includes(this.site.host)&&"mobile"!==this.site.additionalData&&this.setVideoVolume(this.tempOriginalVolume/100))})()}));{this.votAutoTranslateCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.autoTranslate=Number(t.target.checked),await Promise.all([J.set("autoTranslate",this.data.autoTranslate),this.autoTranslate()]),D.log("autoTranslate value changed. New value: ",this.data.autoTranslate)})()})),this.votDontTranslateYourLangSelect.labelElement.addEventListener("change",(t=>{(async()=>{this.data.dontTranslateYourLang=Number(t.target.checked),await J.set("dontTranslateYourLang",this.data.dontTranslateYourLang),D.log("dontTranslateYourLang value changed. New value: ",this.data.dontTranslateYourLang)})()}));const t=async t=>{await J.set("hotkeyButton",t),this.data.hotkeyButton=t,this.changehotkeyButton.textContent=ko(t)},e=o=>{const i="Escape"===o.code?null:o.code;t(i),document.removeEventListener("keydown",e)};this.changehotkeyButton.addEventListener("click",(()=>{this.changehotkeyButton.textContent=X.get("VOTPressNewHotkey"),document.addEventListener("keydown",e)})),this.votAutoSetVolumeCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.autoSetVolumeYandexStyle=Number(t.target.checked),await J.set("autoSetVolumeYandexStyle",this.data.autoSetVolumeYandexStyle),D.log("autoSetVolumeYandexStyle value changed. New value: ",this.data.autoSetVolumeYandexStyle)})()})),this.votAutoSetVolumeSlider.input.addEventListener("input",(t=>{(async()=>{const e=Number(t.target.value);this.data.autoVolume=(e/100).toFixed(2),await J.set("autoVolume",this.data.autoVolume),this.votAutoSetVolumeSlider.label.querySelector("strong").textContent=`${e}%`})()})),this.votShowVideoSliderCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.showVideoSlider=Number(t.target.checked),await J.set("showVideoSlider",this.data.showVideoSlider),D.log("showVideoSlider value changed. New value: ",this.data.showVideoSlider),this.votVideoVolumeSlider.container.hidden=1!==this.data.showVideoSlider||"success"!==this.votButton.container.dataset.status})()})),this.votAudioBoosterCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.audioBooster=Number(t.target.checked),await J.set("audioBooster",this.data.audioBooster),D.log("audioBooster value changed. New value: ",this.data.audioBooster);const e=this.votVideoTranslationVolumeSlider.input.value;this.votVideoTranslationVolumeSlider.input.max=this.data.audioBooster?900:100,this.data.audioBooster||(this.votVideoTranslationVolumeSlider.input.value=e>100?100:e,this.votVideoTranslationVolumeSlider.input.dispatchEvent(new Event("input")))})()})),this.votSyncVolumeCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.syncVolume=Number(t.target.checked),await J.set("syncVolume",this.data.syncVolume),D.log("syncVolume value changed. New value: ",this.data.syncVolume)})()})),this.votDownloadWithNameCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.downloadWithName=Number(t.target.checked),await J.set("downloadWithName",this.data.downloadWithName),D.log("downloadWithName value changed. New value: ",this.data.downloadWithName)})()})),this.votTranslationServiceSelect.labelElement.addEventListener("change",(t=>{(async()=>{this.data.translateAPIErrors=Number(t.target.checked),await J.set("translateAPIErrors",this.data.translateAPIErrors),D.log("translateAPIErrors value changed. New value: ",this.data.translateAPIErrors)})()})),this.votSubtitlesDetails.container.addEventListener("click",(()=>{this.votSubtitlesDialog=je.createDialog(X.get("VOTSubtitlesDesign")),this.votSubtitlesDialog.container.classList.add("vot-dialog-temp"),this.votSubtitlesDialog.container.hidden=!1,this.votSubtitlesDialog.backdrop.onclick=this.votSubtitlesDialog.closeButton.onclick=()=>{this.votSubtitlesDialog.container.remove()},this.votSubtitlesHighlightWordsCheckbox=je.createCheckbox(X.get("VOTHighlightWords"),this.data?.highlightWords??!1),this.votSubtitlesDialog.bodyContainer.appendChild(this.votSubtitlesHighlightWordsCheckbox.container),this.votSubtitlesDownloadFormatSelect=je.createVOTSelect(this.data.subtitlesDownloadFormat.toUpperCase(),X.get("VOTSubtitlesDownloadFormat"),So(ht,this.data.subtitlesDownloadFormat),{onSelectCb:async t=>{this.data.subtitlesDownloadFormat=t.target.dataset.votValue,await J.set("subtitlesDownloadFormat",this.data.subtitlesDownloadFormat)},labelElement:je.createVOTSelectLabel(X.get("VOTSubtitlesDownloadFormat"))}),this.votSubtitlesDialog.bodyContainer.appendChild(this.votSubtitlesDownloadFormatSelect.container),this.votSubtitlesMaxLengthSlider=je.createSlider(Yt`${X.get("VOTSubtitlesMaxLength")}: + >`,Math.round(100*(this.data?.autoVolume??H)),0,100),this.votSettingsDialog.bodyContainer.appendChild(this.votAutoSetVolumeSlider.container),this.votShowVideoSliderCheckbox=je.createCheckbox(X.get("VOTShowVideoSlider"),this.data?.showVideoSlider??!1),this.votSettingsDialog.bodyContainer.appendChild(this.votShowVideoSliderCheckbox.container),this.votAudioBoosterCheckbox=je.createCheckbox(X.get("VOTAudioBooster"),this.data?.audioBooster??!1),this.audioContext||(this.votAudioBoosterCheckbox.input.disabled=!0,this.votAudioBoosterCheckbox.container.title=X.get("VOTNeedWebAudioAPI")),this.votSettingsDialog.bodyContainer.appendChild(this.votAudioBoosterCheckbox.container),this.votSyncVolumeCheckbox=je.createCheckbox(X.get("VOTSyncVolume"),this.data?.syncVolume??!1),this.votSettingsDialog.bodyContainer.appendChild(this.votSyncVolumeCheckbox.container),this.votDownloadWithNameCheckbox=je.createCheckbox(X.get("VOTDownloadWithName"),this.data?.downloadWithName??!1),this.votSettingsDialog.bodyContainer.appendChild(this.votDownloadWithNameCheckbox.container),this.votUseNewModelCheckbox=je.createCheckbox(X.get("VOTUseNewModel"),this.data?.useNewModel??!1),this.votSettingsDialog.bodyContainer.appendChild(this.votUseNewModelCheckbox.container),this.votTranslationServiceSelect=je.createVOTSelect(this.data.translationService.toUpperCase(),X.get("VOTTranslationService"),So(Ce,this.data.translationService),{onSelectCb:async t=>{this.data.translationService=t.target.dataset.votValue,await J.set("translationService",this.data.translationService)},labelElement:je.createCheckbox(X.get("VOTTranslateAPIErrors"),this.data.translateAPIErrors??!0).container}),this.votTranslationServiceSelect.container.hidden="ru"===X.lang,this.votSettingsDialog.bodyContainer.appendChild(this.votTranslationServiceSelect.container),this.votDetectServiceSelect=je.createVOTSelect(this.data.detectService.toUpperCase(),X.get("VOTDetectService"),So(Pe,this.data.detectService),{onSelectCb:async t=>{this.data.detectService=t.target.dataset.votValue,await J.set("detectService",this.data.detectService)},labelElement:je.createVOTSelectLabel(X.get("VOTDetectService"))}),this.votSettingsDialog.bodyContainer.appendChild(this.votDetectServiceSelect.container),this.votSubtitlesHeader=je.createHeader(X.get("subtitlesSettings")),this.votSettingsDialog.bodyContainer.appendChild(this.votSubtitlesHeader),this.votSubtitlesDetails=je.createDetails(X.get("VOTSubtitlesDesign")),this.votSettingsDialog.bodyContainer.appendChild(this.votSubtitlesDetails.container),this.votProxyHeader=je.createHeader(X.get("proxySettings")),this.votSettingsDialog.bodyContainer.appendChild(this.votProxyHeader),this.votM3u8ProxyHostTextfield=je.createTextfield(X.get("VOTM3u8ProxyHost"),this.data?.m3u8ProxyHost,F),this.votSettingsDialog.bodyContainer.appendChild(this.votM3u8ProxyHostTextfield.container),this.votProxyWorkerHostTextfield=je.createTextfield(X.get("VOTProxyWorkerHost"),this.data?.proxyWorkerHost,q),this.votSettingsDialog.bodyContainer.appendChild(this.votProxyWorkerHostTextfield.container),this.votAudioProxyCheckbox=je.createCheckbox(X.get("VOTAudioProxy"),this.data?.audioProxy??!1),this.votSettingsDialog.bodyContainer.appendChild(this.votAudioProxyCheckbox.container),this.votNewAudioPlayerCheckbox=je.createCheckbox(X.get("VOTNewAudioPlayer"),this.data?.newAudioPlayer??!1),this.audioContext||(this.votNewAudioPlayerCheckbox.input.disabled=!0,this.votNewAudioPlayerCheckbox.container.title=X.get("VOTNeedWebAudioAPI")),this.votSettingsDialog.bodyContainer.appendChild(this.votNewAudioPlayerCheckbox.container),this.votOnlyBypassMediaCSPCheckbox=je.createCheckbox(X.get("VOTOnlyBypassMediaCSP")+(this.site.needBypassCSP?` (${X.get("VOTMediaCSPEnabledOnSite")})`:""),this.data?.onlyBypassMediaCSP??!1),this.votOnlyBypassMediaCSPCheckbox.container.classList.add("vot-checkbox-sub"),this.audioContext||(this.votOnlyBypassMediaCSPCheckbox.container.title=X.get("VOTNeedWebAudioAPI")),this.votOnlyBypassMediaCSPCheckbox.input.disabled=!this.data.newAudioPlayer&&this.audioContext,this.data.newAudioPlayer||(this.votOnlyBypassMediaCSPCheckbox.container.hidden=!0),this.votSettingsDialog.bodyContainer.appendChild(this.votOnlyBypassMediaCSPCheckbox.container),this.votAboutHeader=je.createHeader(X.get("about")),this.votSettingsDialog.bodyContainer.appendChild(this.votAboutHeader),this.votLanguageSelect=je.createVOTSelect(X.get("langs")[J.syncGet("locale-lang-override","auto")],X.get("VOTMenuLanguage"),So(Z,J.syncGet("locale-lang-override","auto")),{onSelectCb:async t=>{await J.set("locale-lang-override",t.target.dataset.votValue)},labelElement:je.createVOTSelectLabel(X.get("VOTMenuLanguage"))}),this.votSettingsDialog.bodyContainer.appendChild(this.votLanguageSelect.container),this.votShowPiPButtonCheckbox=je.createCheckbox(X.get("VOTShowPiPButton"),this.data?.showPiPButton??!1),this.votShowPiPButtonCheckbox.container.hidden=!et(),this.votSettingsDialog.bodyContainer.appendChild(this.votShowPiPButtonCheckbox.container),this.votVersionInfo=je.createInformation(`${X.get("VOTVersion")}:`,GM_info.script.version),this.votSettingsDialog.bodyContainer.appendChild(this.votVersionInfo.container),this.votAuthorsInfo=je.createInformation(`${X.get("VOTAuthors")}:`,GM_info.script.author),this.votSettingsDialog.bodyContainer.appendChild(this.votAuthorsInfo.container),this.votLoaderInfo=je.createInformation(`${X.get("VOTLoader")}:`,`${GM_info.scriptHandler} v${GM_info.version}`),this.votSettingsDialog.bodyContainer.appendChild(this.votLoaderInfo.container),this.votBrowserInfo=je.createInformation(`${X.get("VOTBrowser")}:`,`${xo.browser.name} ${xo.browser.version} (${xo.os.name} ${xo.os.version})`),this.votSettingsDialog.bodyContainer.appendChild(this.votBrowserInfo.container),this.votLocaleInfo=je.createInformation(`${X.get("VOTLocaleHash")}:`,Yt`${this.data.localeHash}
(${X.get("VOTUpdatedAt")} + ${new Date(1e3*this.data.localeUpdatedAt).toLocaleString()})`),this.votSettingsDialog.bodyContainer.appendChild(this.votLocaleInfo.container),this.votUpdateLocaleFilesButton=je.createOutlinedButton(X.get("VOTUpdateLocaleFiles")),this.votSettingsDialog.bodyContainer.appendChild(this.votUpdateLocaleFilesButton),this.votResetSettingsButton=je.createButton(X.get("resetSettings")),this.votSettingsDialog.bodyContainer.appendChild(this.votResetSettingsButton)}async handleTranslationBtnClick(){if(D.log("[click translationBtn]",this.audioPlayer,this.audioPlayer.player),this.audioPlayer.player.src)return D.log("[click translationBtn] audio.src is not empty",this.audioPlayer.player.src),void this.stopTranslate();if(this.hls.url)return D.log("[click translationBtn] hls is not empty",this.hls.url),void this.stopTranslate();try{if(D.log("[click translationBtn] trying execute translation"),!this.videoData.videoId)throw new pt("VOTNoVideoIDFound");"vk"===this.site.host&&"clips"===this.site.additionalData&&(this.videoData=await this.getVideoData()),await this.translateExecutor(this.videoData.videoId)}catch(t){console.error("[VOT]",t),"VOTLocalizedError"===t?.name?this.transformBtn("error",t.localizedMessage):this.transformBtn("error",t?.message)}}initUIEvents(){this.votButton.translateButton.addEventListener("click",(async()=>{await this.handleTranslationBtnClick()})),this.votButton.pipButton.addEventListener("click",(()=>{(async()=>{this.video!==document.pictureInPictureElement?await this.video.requestPictureInPicture():await document.exitPictureInPicture()})()})),this.votButton.menuButton.addEventListener("click",(()=>{this.votMenu.container.hidden=!this.votMenu.container.hidden})),this.votButton.container.addEventListener("mousedown",(()=>{this.dragging=!0})),this.container.addEventListener("mouseup",(()=>{this.dragging=!1})),this.container.addEventListener("mousemove",(async t=>{if(this.dragging){t.preventDefault();const e=t.clientX/this.container.clientWidth*100,o=this.container.clientWidth>550,i=e<=44?"left":e>=66?"right":"default";this.data.buttonPos=o?i:"default",this.votButton.container.dataset.direction="default"===this.data.buttonPos?"row":"column",this.votButton.container.dataset.position=this.data.buttonPos,this.votMenu.container.dataset.position=this.data.buttonPos,o&&await J.set("buttonPos",this.data.buttonPos)}})),this.votDownloadButton.addEventListener("click",(async()=>{if(!this.downloadTranslationUrl)return;if(!this.data.downloadWithName)return window.open(this.downloadTranslationUrl,"_blank").focus();const t=document.querySelector("#vot-loader-download"),e=getComputedStyle(this.votMenu.container).getPropertyValue("--vot-primary-rgb"),o=je.animateLoader(t,e),i=await rt(this.downloadTranslationUrl),a=i.body.getReader(),n=+i.headers.get("Content-Length");let r=0;const s=[];for(;;){const{done:t,value:e}=await a.read();if(t)break;s.push(e),r+=e.length,o(Math.round(r/n*100))}je.afterAnimateLoader(t,e);const l=new Blob(s),d=nt(this.videoData.title??this.videoData.videoId),u=await l.arrayBuffer(),c=new xe(u);c.setFrame("TIT2",d),c.addTag(),at(c.getBlob(),`${d}.mp3`)})),this.votDownloadSubtitlesButton.addEventListener("click",(async()=>{const t=this.data.subtitlesDownloadFormat,e=Pt(this.yandexSubtitles,t);at(new Blob(["json"===t?JSON.stringify(e):e],{type:"text/plain"}),`${this.data.downloadWithName?nt(this.videoData.title??this.videoData.videoId):`subtitles_${this.videoData.videoId}`}.${t}`)})),this.votSettingsButton.addEventListener("click",(()=>{this.votSettingsDialog.container.hidden=!this.votSettingsDialog.container.hidden,(document.fullscreenElement||document.webkitFullscreenElement)&&(document.webkitExitFullscreen&&document.webkitExitFullscreen(),document.exitFullscreen&&document.exitFullscreen())})),this.votVideoVolumeSlider.input.addEventListener("input",(t=>{const e=Number(t.target.value);this.votVideoVolumeSlider.label.querySelector("strong").textContent=`${e}%`,this.setVideoVolume(e/100),this.data.syncVolume&&this.syncVolumeWrapper("video",e)})),this.votVideoTranslationVolumeSlider.input.addEventListener("input",(t=>{(async()=>{this.data.defaultVolume=Number(t.target.value),await J.set("defaultVolume",this.data.defaultVolume),this.votVideoTranslationVolumeSlider.label.querySelector("strong").textContent=`${this.data.defaultVolume}%`,this.audioPlayer.player.volume=this.data.defaultVolume/100,this.data.syncVolume&&(this.syncVolumeWrapper("translation",this.data.defaultVolume),["youtube","googledrive"].includes(this.site.host)&&"mobile"!==this.site.additionalData&&this.setVideoVolume(this.tempOriginalVolume/100))})()}));{this.votAutoTranslateCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.autoTranslate=Number(t.target.checked),await Promise.all([J.set("autoTranslate",this.data.autoTranslate),this.autoTranslate()]),D.log("autoTranslate value changed. New value: ",this.data.autoTranslate)})()})),this.votDontTranslateYourLangSelect.labelElement.addEventListener("change",(t=>{(async()=>{this.data.dontTranslateYourLang=Number(t.target.checked),await J.set("dontTranslateYourLang",this.data.dontTranslateYourLang),D.log("dontTranslateYourLang value changed. New value: ",this.data.dontTranslateYourLang)})()}));const t=async t=>{await J.set("hotkeyButton",t),this.data.hotkeyButton=t,this.changehotkeyButton.textContent=ko(t)},e=o=>{const i="Escape"===o.code?null:o.code;t(i),document.removeEventListener("keydown",e)};this.changehotkeyButton.addEventListener("click",(()=>{this.changehotkeyButton.textContent=X.get("VOTPressNewHotkey"),document.addEventListener("keydown",e)})),this.votAutoSetVolumeCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.autoSetVolumeYandexStyle=Number(t.target.checked),await J.set("autoSetVolumeYandexStyle",this.data.autoSetVolumeYandexStyle),D.log("autoSetVolumeYandexStyle value changed. New value: ",this.data.autoSetVolumeYandexStyle)})()})),this.votAutoSetVolumeSlider.input.addEventListener("input",(t=>{(async()=>{const e=Number(t.target.value);this.data.autoVolume=(e/100).toFixed(2),await J.set("autoVolume",this.data.autoVolume),this.votAutoSetVolumeSlider.label.querySelector("strong").textContent=`${e}%`})()})),this.votShowVideoSliderCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.showVideoSlider=Number(t.target.checked),await J.set("showVideoSlider",this.data.showVideoSlider),D.log("showVideoSlider value changed. New value: ",this.data.showVideoSlider),this.votVideoVolumeSlider.container.hidden=1!==this.data.showVideoSlider||"success"!==this.votButton.container.dataset.status})()})),this.votAudioBoosterCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.audioBooster=Number(t.target.checked),await J.set("audioBooster",this.data.audioBooster),D.log("audioBooster value changed. New value: ",this.data.audioBooster);const e=this.votVideoTranslationVolumeSlider.input.value;this.votVideoTranslationVolumeSlider.input.max=this.data.audioBooster?900:100,this.data.audioBooster||(this.votVideoTranslationVolumeSlider.input.value=e>100?100:e,this.votVideoTranslationVolumeSlider.input.dispatchEvent(new Event("input")))})()})),this.votSyncVolumeCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.syncVolume=Number(t.target.checked),await J.set("syncVolume",this.data.syncVolume),D.log("syncVolume value changed. New value: ",this.data.syncVolume)})()})),this.votDownloadWithNameCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.downloadWithName=Number(t.target.checked),await J.set("downloadWithName",this.data.downloadWithName),D.log("downloadWithName value changed. New value: ",this.data.downloadWithName)})()})),this.votUseNewModelCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.useNewModel=Number(t.target.checked),await J.set("useNewModel",this.data.useNewModel),D.log("useNewModel value changed. New value: ",this.data.useNewModel),this.stopTranslate()})()})),this.votTranslationServiceSelect.labelElement.addEventListener("change",(t=>{(async()=>{this.data.translateAPIErrors=Number(t.target.checked),await J.set("translateAPIErrors",this.data.translateAPIErrors),D.log("translateAPIErrors value changed. New value: ",this.data.translateAPIErrors)})()})),this.votSubtitlesDetails.container.addEventListener("click",(()=>{this.votSubtitlesDialog=je.createDialog(X.get("VOTSubtitlesDesign")),this.votSubtitlesDialog.container.classList.add("vot-dialog-temp"),this.votSubtitlesDialog.container.hidden=!1,this.votSubtitlesDialog.backdrop.onclick=this.votSubtitlesDialog.closeButton.onclick=()=>{this.votSubtitlesDialog.container.remove()},this.votSubtitlesHighlightWordsCheckbox=je.createCheckbox(X.get("VOTHighlightWords"),this.data?.highlightWords??!1),this.votSubtitlesDialog.bodyContainer.appendChild(this.votSubtitlesHighlightWordsCheckbox.container),this.votSubtitlesDownloadFormatSelect=je.createVOTSelect(this.data.subtitlesDownloadFormat.toUpperCase(),X.get("VOTSubtitlesDownloadFormat"),So(ht,this.data.subtitlesDownloadFormat),{onSelectCb:async t=>{this.data.subtitlesDownloadFormat=t.target.dataset.votValue,await J.set("subtitlesDownloadFormat",this.data.subtitlesDownloadFormat)},labelElement:je.createVOTSelectLabel(X.get("VOTSubtitlesDownloadFormat"))}),this.votSubtitlesDialog.bodyContainer.appendChild(this.votSubtitlesDownloadFormatSelect.container),this.votSubtitlesMaxLengthSlider=je.createSlider(Yt`${X.get("VOTSubtitlesMaxLength")}: ${this.data?.subtitlesMaxLength??300}`,this.data?.subtitlesMaxLength??300,50,300),this.votSubtitlesDialog.bodyContainer.appendChild(this.votSubtitlesMaxLengthSlider.container),this.votSubtitlesFontSizeSlider=je.createSlider(Yt`${X.get("VOTSubtitlesFontSize")}: ${this.data?.subtitlesFontSize??20}`,this.data?.subtitlesFontSize??20,8,50),this.votSubtitlesDialog.bodyContainer.appendChild(this.votSubtitlesFontSizeSlider.container),this.votSubtitlesOpacitySlider=je.createSlider(Yt`${X.get("VOTSubtitlesOpacity")}: - ${this.data?.subtitlesOpacity??20}`,this.data?.subtitlesOpacity??20,0,100),this.votSubtitlesDialog.bodyContainer.appendChild(this.votSubtitlesOpacitySlider.container),this.votSubtitlesHighlightWordsCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.highlightWords=Number(t.target.checked),await J.set("highlightWords",this.data.highlightWords),D.log("highlightWords value changed. New value: ",this.data.highlightWords),this.subtitlesWidget.setHighlightWords(this.data.highlightWords)})()})),this.votSubtitlesMaxLengthSlider.input.addEventListener("input",(t=>{(async()=>{this.data.subtitlesMaxLength=Number(t.target.value),await J.set("subtitlesMaxLength",this.data.subtitlesMaxLength),this.votSubtitlesMaxLengthSlider.label.querySelector("strong").textContent=`${this.data.subtitlesMaxLength}`,this.subtitlesWidget.setMaxLength(this.data.subtitlesMaxLength)})()})),this.votSubtitlesFontSizeSlider.input.addEventListener("input",(t=>{(async()=>{this.data.subtitlesFontSize=Number(t.target.value),await J.set("subtitlesFontSize",this.data.subtitlesFontSize),this.votSubtitlesFontSizeSlider.label.querySelector("strong").textContent=`${this.data.subtitlesFontSize}`,this.subtitlesWidget.setFontSize(this.data.subtitlesFontSize)})()})),this.votSubtitlesOpacitySlider.input.addEventListener("input",(t=>{(async()=>{this.data.subtitlesOpacity=Number(t.target.value),await J.set("subtitlesOpacity",this.data.subtitlesOpacity),this.votSubtitlesOpacitySlider.label.querySelector("strong").textContent=`${this.data.subtitlesOpacity}`,this.subtitlesWidget.setOpacity(this.data.subtitlesOpacity)})()})),document.documentElement.appendChild(this.votSubtitlesDialog.container)})),this.votShowPiPButtonCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.showPiPButton=Number(t.target.checked),await J.set("showPiPButton",this.data.showPiPButton),D.log("showPiPButton value changed. New value: ",this.data.showPiPButton),this.votButton.pipButton.hidden=!et()||!this.data.showPiPButton,this.votButton.separator2.hidden=!et()||!this.data.showPiPButton})()})),this.votM3u8ProxyHostTextfield.input.addEventListener("change",(t=>{(async()=>{this.data.m3u8ProxyHost=t.target.value||F,await J.set("m3u8ProxyHost",this.data.m3u8ProxyHost),D.log("m3u8ProxyHost value changed. New value: ",this.data.m3u8ProxyHost)})()})),this.votProxyWorkerHostTextfield.input.addEventListener("change",(t=>{(async()=>{this.data.proxyWorkerHost=t.target.value||q,await J.set("proxyWorkerHost",this.data.proxyWorkerHost),D.log("proxyWorkerHost value changed. New value: ",this.data.proxyWorkerHost),this.data.translateProxyEnabled&&(this.votClient.host=this.data.proxyWorkerHost)})()})),this.votAudioProxyCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.audioProxy=Number(t.target.checked),await J.set("audioProxy",this.data.audioProxy),D.log("audioProxy value changed. New value: ",this.data.audioProxy)})()})),this.votOnlyBypassMediaCSPCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.onlyBypassMediaCSP=Number(t.target.checked),await J.set("onlyBypassMediaCSP",this.data.onlyBypassMediaCSP),D.log("onlyBypassMediaCSP value changed. New value: ",this.data.onlyBypassMediaCSP),this.stopTranslate(),this.createPlayer()})()})),this.votNewAudioPlayerCheckbox.input.addEventListener("change",(t=>{(async()=>{const e=t.target.checked;this.data.newAudioPlayer=Number(e),await J.set("newAudioPlayer",this.data.newAudioPlayer),D.log("newAudioPlayer value changed. New value: ",this.data.newAudioPlayer),this.stopTranslate(),this.createPlayer(),this.votOnlyBypassMediaCSPCheckbox.input.disabled=this.votOnlyBypassMediaCSPCheckbox.container.hidden=!e})()})),this.votUpdateLocaleFilesButton.addEventListener("click",(()=>{(async()=>{await J.set("locale-hash",""),await X.update(!0),window.location.reload()})()})),this.votResetSettingsButton.addEventListener("click",(()=>{(async()=>{X.reset();const t=await J.list();for(let e=0;e{this.extraEvents.push({element:t,event:e,handler:o}),t.addEventListener(e,o)},e=(e,o,i)=>{for(const a of o)t(e,a,i)};if(this.resizeObserver=new ResizeObserver((t=>{for(let e=0;e550;this.votButton.container.dataset.position=this.votMenu.container.dataset.position=e?this.data?.buttonPos:"default",this.votButton.container.dataset.direction=this.data?.buttonPos&&"default"!==this.data?.buttonPos&&e?"column":"row"})),this.resizeObserver.observe(this.video),this.votMenu.container.setAttribute("style",`--vot-container-height: ${this.video.getBoundingClientRect().height}px`),["youtube","googledrive"].includes(this.site.host)&&"mobile"!==this.site.additionalData){this.syncVolumeObserver=new MutationObserver((t=>{if(this.audioPlayer.player.src&&this.data.syncVolume)for(let e=0;e{const e=t.target,o=this.votButton.container,i=this.votMenu.container,a=this.container,n=this.votSettingsDialog.container,r=document.querySelector(".vot-dialog-temp"),s=o.contains(e),l=i.contains(e),d=a.contains(e),u=n.contains(e),c=r?.contains(e)??!1;D.log(`[document click] ${s} ${l} ${d} ${u} ${c}`),s||l||u||c||(d||this.logout(0),this.votMenu.container.hidden=!0)})),document.addEventListener("keydown",(async t=>{const e=t.code,o=document.activeElement;["input","textarea"].includes(o.tagName.toLowerCase())||o.isContentEditable||e!==this.data.hotkeyButton||await this.handleTranslationBtnClick()}));let o=this.site.eventSelector?document.querySelector(this.site.eventSelector):this.container;o&&e(o,["mousemove","mouseout"],this.resetTimer),t(this.votButton.container,"mousemove",this.changeOpacityOnEvent),t(this.votMenu.container,"mousemove",this.changeOpacityOnEvent),e(document,["touchstart","touchmove","touchend"],this.changeOpacityOnEvent),t(this.votButton.container,"mousedown",(t=>{t.stopImmediatePropagation()})),t(this.votMenu.container,"mousedown",(t=>{t.stopImmediatePropagation()})),"youtube"===this.site.host&&(this.container.draggable=!1),"googledrive"===this.site.host&&(this.container.style.height="100%"),t(this.video,"canplay",(async()=>{"rutube"===this.site.host&&this.video.src||await this.setCanPlay()})),t(this.video,"emptied",(async()=>{this.video.src&&await ft(this.site,this.video)===this.videoData.videoId||(D.log("lipsync mode is emptied"),this.videoData="",this.stopTranslation())})),["rutube","ok"].includes(this.site.host)||t(this.video,"volumechange",(()=>{this.syncVideoVolumeSlider()})),"youtube"!==this.site.host||this.site.additionalData||t(document,"yt-page-data-updated",(async()=>{D.log("yt-page-data-updated"),window.location.pathname.includes("/shorts/")&&await this.setCanPlay()}))}async setCanPlay(){await ft(this.site,this.video)!==this.videoData.videoId&&(await this.handleSrcChanged(),await this.autoTranslate(),D.log("lipsync mode is canplay"))}logout(t){this.votMenu.container.hidden&&(this.votButton.container.style.opacity=t)}resetTimer=()=>{clearTimeout(this.timer),this.logout(1),this.timer=setTimeout((()=>{this.logout(0)}),1e3)};changeOpacityOnEvent=t=>{clearTimeout(this.timer),this.logout(1),t.stopPropagation()};async changeSubtitlesLang(t){if(D.log("[onchange] subtitles",t),this.votSubtitlesSelect.setSelected(t),"disabled"===t)this.votSubtitlesSelect.setTitle(X.get("VOTSubtitlesDisabled")),this.subtitlesWidget.setContent(null),this.votDownloadSubtitlesButton.hidden=!0,this.yandexSubtitles=null;else{const e=this.subtitlesList.at(parseInt(t));if(1===this.data.audioProxy&&e.url.startsWith("https://brosubs.s3-private.mds.yandex.net/vtrans/")){const t=e.url.replace("https://brosubs.s3-private.mds.yandex.net/vtrans/","");e.url=`https://${this.data.proxyWorkerHost}/video-subtitles/subtitles-proxy/${t}`,console.log(`[VOT] Subs proxied via ${e.url}`)}this.yandexSubtitles=await Be(e),this.subtitlesWidget.setContent(this.yandexSubtitles),this.votDownloadSubtitlesButton.hidden=!1}}async updateSubtitlesLangSelect(){const t=[{label:X.get("VOTSubtitlesDisabled"),value:"disabled",selected:!0,disabled:!1},...this.subtitlesList.map(((t,e)=>({label:(X.get("langs")[t.language]??t.language.toUpperCase())+(t.translatedFromLanguage?` ${X.get("VOTTranslatedFrom")} ${X.get("langs")[t.translatedFromLanguage]??t.translatedFromLanguage.toUpperCase()}`:"")+("yandex"!==t.source?`, ${window.location.hostname}`:"")+(t.isAutoGenerated?` (${X.get("VOTAutogenerated")})`:""),value:e,selected:!1,disabled:!1})))];this.votSubtitlesSelect.updateItems(t),await this.changeSubtitlesLang(t[0].value)}async updateSubtitles(){if(await this.changeSubtitlesLang("disabled"),!this.videoData.videoId)return console.error(`[VOT] ${X.getDefault("VOTNoVideoIDFound")}`),this.subtitlesList=[],this.subtitlesListVideoId=null,this.votButton.container.hidden=!0,void await this.updateSubtitlesLangSelect();if(this.votButton.container.hidden=!1,this.subtitlesListVideoId!==this.videoData.videoId){try{this.subtitlesList=await Ne(this.votClient,this.videoData)}catch(t){D.log("Error with yandex server, try auto-fix...",t),this.votOpts={fetchFn:rt,hostVOT:U,host:this.data.proxyWorkerHost},this.votClient=new xt(this.votOpts),this.subtitlesList=await Ne(this.votClient,this.videoData),await J.set("translateProxyEnabled",1)}this.subtitlesList?this.subtitlesListVideoId=this.videoData.videoId:await this.changeSubtitlesLang("disabled"),await this.updateSubtitlesLangSelect()}}getVideoVolume(){let t=this.video?.volume;return["youtube","googledrive"].includes(this.site.host)&&(t=Ve.getVideoVolume()??t),t}setVideoVolume(t){if(["youtube","googledrive"].includes(this.site.host)){if(Ve.setVideoVolume(t))return this}return this.video.volume=t,this}isMuted(){return["youtube","googledrive"].includes(this.site.host)?Ve.isMuted():this.video?.muted}syncVideoVolumeSlider(){const t=this.isMuted()?0:100*this.getVideoVolume(),e=Math.round(t);this.votVideoVolumeSlider.input.value=e,this.votVideoVolumeSlider.label.querySelector("strong").textContent=`${e}%`,je.updateSlider(this.votVideoVolumeSlider.input),1===this.data.syncVolume&&(this.tempOriginalVolume=Number(e))}setSelectMenuValues(t,e){this.votTranslationLanguageSelect.fromSelect.setTitle(X.get("langs")[t]),this.votTranslationLanguageSelect.toSelect.setTitle(X.get("langs")[e]),this.votTranslationLanguageSelect.fromSelect.setSelected(t),this.votTranslationLanguageSelect.toSelect.setSelected(e),console.log(`[VOT] Set translation from ${t} to ${e}`),this.videoData.detectedLanguage=t,this.videoData.responseLanguage=e}syncVolumeWrapper(t,e){const o="translation"===t?this.votVideoVolumeSlider:this.votVideoTranslationVolumeSlider,i=Number(o.input.value),a=function(t,e,o,i){let a=e;return e>i?(a=o+(e-i),a=a>100?100:Math.max(a,0),t.volume=a/100):e100?100:Math.max(a,0),t.volume=a/100),a}("translation"===t?this.video:this.audioPlayer.player,e,i,"translation"===t?this.tempVolume:this.tempOriginalVolume);o.input.value=a,o.label.querySelector("strong").textContent=`${a}%`,je.updateSlider(o.input),this.tempOriginalVolume="translation"===t?a:e,this.tempVolume="translation"===t?e:a}async getVideoData(){const{duration:t,url:e,videoId:o,host:i,title:a,translationHelp:n,detectedLanguage:r,subtitles:s}=await bt(this.site,this.video),l={translationHelp:n??null,isStream:!1,duration:this.video?.duration||t||P.defaultDuration,videoId:o,url:e,host:i,detectedLanguage:r??this.translateFromLang,responseLanguage:this.translateToLang,subtitles:s,title:a};if("youtube"===this.site.host){const t=await Ve.getVideoData();l.isStream=t.isLive,t.title&&(l.detectedLanguage=t.detectedLanguage,l.title=t.localizedTitle)}else if(["rutube","ok.ru","mail_ru"].includes(this.site.host))l.detectedLanguage="ru";else if("youku"===this.site.host)l.detectedLanguage="zh";else if("vk"===this.site.host){const t=document.getElementsByTagName("track")?.[0]?.srclang;l.detectedLanguage=t||"auto"}else"weverse"===this.site.host?l.detectedLanguage="ko":["bilibili","bitchute","rumble","peertube","dailymotion","trovo","yandexdisk","coursehunterLike","archive","nineanimetv","directlink"].includes(this.site.host)&&(l.detectedLanguage="auto");return l}videoValidator(){if(["youtube","ok.ru","vk"].includes(this.site.host)&&(D.log("VideoValidator videoData: ",this.videoData),1===this.data.dontTranslateYourLang&&this.videoData.detectedLanguage===this.data.dontTranslateLanguage))throw new pt("VOTDisableFromYourLang");if(!this.videoData.isStream&&this.videoData.duration>14400)throw new pt("VOTVideoIsTooLong");return!0}stopTranslate(){this.audioPlayer.player.removeVideoEvents(),this.audioPlayer.player.clear(),this.audioPlayer.player.src=void 0,D.log("audioPlayer after stopTranslate",this.audioPlayer),this.votVideoVolumeSlider.container.hidden=!0,this.votVideoTranslationVolumeSlider.container.hidden=!0,this.votDownloadButton.hidden=!0,this.downloadTranslationUrl=null,this.transformBtn("none",X.get("translateVideo")),D.log(`Volume on start: ${this.volumeOnStart}`),this.volumeOnStart&&this.setVideoVolume(this.volumeOnStart),clearInterval(this.streamPing),clearTimeout(this.autoRetry),this.hls?.destroy(),this.hls=ot(),this.firstSyncVolume=!0}async translateExecutor(t){D.log("Run translateFunc",t),await this.translateFunc(t,this.videoData.isStream,this.videoData.detectedLanguage,this.videoData.responseLanguage,this.videoData.translationHelp)}async updateTranslationErrorMsg(t){const e=X.get("translationTake"),o=X.lang;if("VOTLocalizedError"===t?.name)this.transformBtn("error",t.localizedMessage);else if(t instanceof Error)this.transformBtn("error",t?.message);else if(1!==this.data.translateAPIErrors||t.includes(e)||"ru"===o)this.transformBtn("error",t);else{this.setLoadingBtn(!0);const e=await async function(t,e="",o="ru"){switch(await J.get("translationService",z)){case"yandex":{const i=e&&o?`${e}-${o}`:o;return await Se.translate(t,i)}case"deepl":return await Te.translate(t,e,o);default:return t}}(t,"ru",o);this.transformBtn("error",e)}["Подготавливаем перевод","Видео передано в обработку","Ожидаем перевод видео","Загружаем переведенное аудио"].includes(t)&&this.setLoadingBtn(!0)}afterUpdateTranslation(t){this.votVideoVolumeSlider.container.hidden=1!==this.data.showVideoSlider||"success"!==this.votButton.container.dataset.status,this.votVideoTranslationVolumeSlider.container.hidden="success"!==this.votButton.container.dataset.status,1===this.data.autoSetVolumeYandexStyle&&(this.votVideoVolumeSlider.input.value=100*this.data.autoVolume,this.votVideoVolumeSlider.label.querySelector("strong").textContent=100*this.data.autoVolume+"%",je.updateSlider(this.votVideoVolumeSlider.input)),this.votDownloadButton.hidden=!1,this.downloadTranslationUrl=t}async validateAudioUrl(t){try{const e=await rt(t,{method:"HEAD",timeout:5e3});if(D.log("Test audio response",e),404!==e.status)return D.log("Valid audioUrl",t),t;D.log("Yandex returned not valid audio, trying to fix...");let o=await this.translateVideoImpl(this.videoData,this.videoData.detectedLanguage="auto",this.videoData.responseLanguage,this.videoData.translationHelp);this.setSelectMenuValues(this.videoData.detectedLanguage,this.videoData.responseLanguage),t=o.url,D.log("Fixed audio audioUrl",t)}catch(t){"Timeout"===t.message?(D.log("Request timed out. Handling timeout error..."),this.data.audioProxy=1,await J.set("audioProxy",1)):D.log("Test audio error:",t)}return t}async updateTranslation(t){if(this.cachedTranslation?.url!==this.audioPlayer.player.currentSrc&&(t=await this.validateAudioUrl(t)),1===this.data.audioProxy&&t.startsWith("https://vtrans.s3-private.mds.yandex.net/tts/prod/")){const e=t.replace("https://vtrans.s3-private.mds.yandex.net/tts/prod/","");t=`https://${this.data.proxyWorkerHost}/video-translation/audio-proxy/${e}`,console.log(`[VOT] Audio proxied via ${t}`)}this.audioPlayer.player.src!==t&&(this.audioPlayer.player.src=t);try{this.audioPlayer.init()}catch(t){t.message.includes("Failed to fetch audio file")?(this.videoHandler.data.audioProxy=1,await J.set("audioProxy",1)):this.videoHandler.transformBtn("error",t.message)}this.setupAudioSettings(),"twitter"===this.site.host&&document.querySelector('button[data-testid="app-bar-back"][role="button"]').addEventListener("click",this.stopTranslation),this.transformBtn("success",X.get("disableTranslate")),this.afterUpdateTranslation(t)}async translateFunc(t,e,o,i,a){if(console.log("[VOT] Video Data: ",this.videoData),D.log("Run videoValidator"),this.videoValidator(),this.setLoadingBtn(!0),this.volumeOnStart=this.getVideoVolume(),e){let t=await this.translateStreamImpl(this.videoData,o,i);if(!t)return void D.log("Skip translation");this.transformBtn("success",X.get("disableTranslate"));const e=this.setHLSSource(t.result.url);return"youtube"===this.site.host&&Ve.videoSeek(this.video,10),this.setupAudioSettings(),this.video.src||this.video.currentSrc||this.video.srcObject?this.afterUpdateTranslation(e):this.stopTranslation()}if(this.cachedTranslation=this.videoTranslations.find((e=>e.videoId===t&&e.expires>st()&&e.from===o&&e.to===i)),this.cachedTranslation)return await this.updateTranslation(this.cachedTranslation.url),void D.log("[translateFunc] Cached translation was received");let n=await this.translateVideoImpl(this.videoData,o,i,a);D.log("[translateRes]",n),n?(await this.updateTranslation(n.url),this.subtitlesList.some((t=>"yandex"===t.source&&t.translatedFromLanguage===this.videoData.detectedLanguage&&t.language===this.videoData.responseLanguage))||(this.subtitlesList=await Ne(this.votClient,this.videoData),await this.updateSubtitlesLangSelect()),this.videoTranslations.push({videoId:t,from:o,to:i,url:this.downloadTranslationUrl,expires:st()+this.videoTranslationTTL})):D.log("Skip translation")}setupHLS(t){this.hls.on(Hls.Events.MEDIA_ATTACHED,(function(){D.log("audio and hls.js are now bound together !")})),this.hls.on(Hls.Events.MANIFEST_PARSED,(function(t){D.log("manifest loaded, found "+t?.levels?.length+" quality level")})),this.hls.loadSource(t),this.hls.attachMedia(this.audioPlayer.player.audio),this.hls.on(Hls.Events.ERROR,(function(t){if(t.fatal)switch(t.type){case Hls.ErrorTypes.MEDIA_ERROR:console.log("fatal media error encountered, try to recover"),this.hls.recoverMediaError();break;case Hls.ErrorTypes.NETWORK_ERROR:console.error("fatal network error encountered",t);break;default:this.hls.destroy()}})),D.log(this.hls)}setHLSSource(t){const e=`https://${this.data.m3u8ProxyHost}/?all=yes&origin=${encodeURIComponent("https://strm.yandex.ru")}&referer=${encodeURIComponent("https://strm.yandex.ru")}&url=${encodeURIComponent(t)}`;if(this.hls)this.setupHLS(e);else{if(!this.audioPlayer.player.audio.canPlayType("application/vnd.apple.mpegurl"))throw new pt("audioFormatNotSupported");this.audioPlayer.player.src=e}return e}setupAudioSettings(){"number"==typeof this.data.defaultVolume&&(this.audioPlayer.player.volume=this.data.defaultVolume/100),"number"==typeof this.data.autoSetVolumeYandexStyle&&this.data.autoSetVolumeYandexStyle&&this.setVideoVolume(this.data.autoVolume)}stopTranslation=()=>{this.stopTranslate(),this.syncVideoVolumeSlider()};async handleSrcChanged(){D.log("[VideoHandler] src changed",this),this.firstPlay=!0,this.stopTranslation();const t=!this.video.src&&!this.video.currentSrc&&!this.video.srcObject;this.votButton.container.hidden=t,t&&(this.votMenu.container.hidden=t),this.site.selector||(this.container=this.video.parentElement),this.container.contains(this.votButton.container)||this.container.append(this.votButton.container,this.votMenu.container),this.videoData=await this.getVideoData(),await this.updateSubtitles(),this.translateToLang=this.data.responseLanguage??"ru",this.setSelectMenuValues(this.videoData.detectedLanguage,this.videoData.responseLanguage)}async release(){D.log("[VideoHandler] release"),this.initialized=!1,this.releaseExtraEvents(),this.subtitlesWidget.release(),this.votButton.container.remove(),this.votMenu.container.remove()}}const Co=new class{constructor(){this.videoCache=new Set,this.onVideoAdded=new Ge,this.onVideoRemoved=new Ge,this.observer=new MutationObserver(this.handleMutations),this.intersectionObserver=new IntersectionObserver(this.handleIntersections,{threshold:.1})}handleMutations=t=>{window.requestIdleCallback((()=>{for(let e=0;e{for(let e=0;e{if(!t)return;const i=t.querySelectorAll("video");for(let t=0;t{this.videoCache.has(t)||(this.videoCache.add(t),this.intersectionObserver.observe(t))};handleIntersectingVideo=t=>{this.intersectionObserver.unobserve(t),(t=>{if(Je.test(t.className)||Je.test(t.title))return!0;let e=t.parentElement;for(;e;){if(Je.test(e.className)||Je.test(e.id))return!0;e=e.parentElement}return!1})(t)||(t=>t.hasAttribute("muted")&&!t.classList.contains("vjs-tech")&&!t.preload)(t)?D.log("The promotional/muted video was ignored",t):((t,e)=>{const o=()=>{(t=>t.readyState>=3)(t)?e(t):requestAnimationFrame(o)};o()})(t,this.handleVideoAdded)};handleVideoAdded=t=>{this.onVideoAdded.dispatch(t)};handleVideoRemoved=t=>{document.contains(t)||(this.videoCache.delete(t),this.onVideoRemoved.dispatch(t))}},Po=new WeakMap;function Lo(t,e){if(t.shadowRoot){let o=t.selector?Array.from(document.querySelectorAll(t.selector)).find((t=>t.shadowRoot.contains(e))):e.parentElement;return o&&o.shadowRoot?o.parentElement:o}const o=xo.browser.version?.split(".")?.[0];if(t.selector?.includes(":not")&&t.selector?.includes("*")&&o&&("Chrome"===xo.browser.name&&Number(o)<88||"Firefox"===xo.browser.name&&Number(o)<84)){const o=t.selector.split(" *")[0];return o?Array.from(document.querySelectorAll(o)).find((t=>t.contains(e))):e.parentElement}return t.selector?Array.from(document.querySelectorAll(t.selector)).find((t=>t.contains(e))):e.parentElement}(async function(){D.log("Loading extension..."),await X.update(),D.log(`Selected menu language: ${X.lang}`),"https://9animetv.to"===window.location.origin&&window.addEventListener("message",(t=>{if("https://rapid-cloud.co"===t.origin&&"getVideoId"===t.data){const t=/[^/]+$/.exec(window.location.href)?.[0],e=document.querySelector("#iframe-embed")?.contentWindow;e.postMessage(`getVideoId:${t}`,"https://rapid-cloud.co/")}})),Co.onVideoAdded.addListener((t=>{for(const e of function(){if(/(http(s)?:\/\/)(127\.0\.0\.1|localhost)/.exec(window.location.href))return[];const t=window.location.hostname,e=new URL(window.location),o=o=>o instanceof RegExp?o.test(t):"string"==typeof o?t.includes(o):"function"==typeof o&&o(e);return R.filter((t=>(Array.isArray(t.match)?t.match.some(o):o(t.match))&&t.host&&t.url))}()){if(!e)continue;let o=Lo(e,t);if(o&&(("rumble"!==e.host||t.style.display)&&(["peertube","directlink"].includes(e.host)&&(e.url=window.location.origin),!Po.has(t)))){Po.set(t,new To(t,o,e));break}}})),Co.onVideoRemoved.addListener((async t=>{Po.has(t)&&(await Po.get(t).release(),Po.delete(t))})),Co.enable()})().catch((t=>{console.error("[VOT]",t)}))})()})(); \ No newline at end of file + ${this.data?.subtitlesOpacity??20}`,this.data?.subtitlesOpacity??20,0,100),this.votSubtitlesDialog.bodyContainer.appendChild(this.votSubtitlesOpacitySlider.container),this.votSubtitlesHighlightWordsCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.highlightWords=Number(t.target.checked),await J.set("highlightWords",this.data.highlightWords),D.log("highlightWords value changed. New value: ",this.data.highlightWords),this.subtitlesWidget.setHighlightWords(this.data.highlightWords)})()})),this.votSubtitlesMaxLengthSlider.input.addEventListener("input",(t=>{(async()=>{this.data.subtitlesMaxLength=Number(t.target.value),await J.set("subtitlesMaxLength",this.data.subtitlesMaxLength),this.votSubtitlesMaxLengthSlider.label.querySelector("strong").textContent=`${this.data.subtitlesMaxLength}`,this.subtitlesWidget.setMaxLength(this.data.subtitlesMaxLength)})()})),this.votSubtitlesFontSizeSlider.input.addEventListener("input",(t=>{(async()=>{this.data.subtitlesFontSize=Number(t.target.value),await J.set("subtitlesFontSize",this.data.subtitlesFontSize),this.votSubtitlesFontSizeSlider.label.querySelector("strong").textContent=`${this.data.subtitlesFontSize}`,this.subtitlesWidget.setFontSize(this.data.subtitlesFontSize)})()})),this.votSubtitlesOpacitySlider.input.addEventListener("input",(t=>{(async()=>{this.data.subtitlesOpacity=Number(t.target.value),await J.set("subtitlesOpacity",this.data.subtitlesOpacity),this.votSubtitlesOpacitySlider.label.querySelector("strong").textContent=`${this.data.subtitlesOpacity}`,this.subtitlesWidget.setOpacity(this.data.subtitlesOpacity)})()})),document.documentElement.appendChild(this.votSubtitlesDialog.container)})),this.votShowPiPButtonCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.showPiPButton=Number(t.target.checked),await J.set("showPiPButton",this.data.showPiPButton),D.log("showPiPButton value changed. New value: ",this.data.showPiPButton),this.votButton.pipButton.hidden=!et()||!this.data.showPiPButton,this.votButton.separator2.hidden=!et()||!this.data.showPiPButton})()})),this.votM3u8ProxyHostTextfield.input.addEventListener("change",(t=>{(async()=>{this.data.m3u8ProxyHost=t.target.value||F,await J.set("m3u8ProxyHost",this.data.m3u8ProxyHost),D.log("m3u8ProxyHost value changed. New value: ",this.data.m3u8ProxyHost)})()})),this.votProxyWorkerHostTextfield.input.addEventListener("change",(t=>{(async()=>{this.data.proxyWorkerHost=t.target.value||q,await J.set("proxyWorkerHost",this.data.proxyWorkerHost),D.log("proxyWorkerHost value changed. New value: ",this.data.proxyWorkerHost),this.data.translateProxyEnabled&&(this.votClient.host=this.data.proxyWorkerHost)})()})),this.votAudioProxyCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.audioProxy=Number(t.target.checked),await J.set("audioProxy",this.data.audioProxy),D.log("audioProxy value changed. New value: ",this.data.audioProxy)})()})),this.votOnlyBypassMediaCSPCheckbox.input.addEventListener("change",(t=>{(async()=>{this.data.onlyBypassMediaCSP=Number(t.target.checked),await J.set("onlyBypassMediaCSP",this.data.onlyBypassMediaCSP),D.log("onlyBypassMediaCSP value changed. New value: ",this.data.onlyBypassMediaCSP),this.stopTranslate(),this.createPlayer()})()})),this.votNewAudioPlayerCheckbox.input.addEventListener("change",(t=>{(async()=>{const e=t.target.checked;this.data.newAudioPlayer=Number(e),await J.set("newAudioPlayer",this.data.newAudioPlayer),D.log("newAudioPlayer value changed. New value: ",this.data.newAudioPlayer),this.stopTranslate(),this.createPlayer(),this.votOnlyBypassMediaCSPCheckbox.input.disabled=this.votOnlyBypassMediaCSPCheckbox.container.hidden=!e})()})),this.votUpdateLocaleFilesButton.addEventListener("click",(()=>{(async()=>{await J.set("locale-hash",""),await X.update(!0),window.location.reload()})()})),this.votResetSettingsButton.addEventListener("click",(()=>{(async()=>{X.reset();const t=await J.list();for(let e=0;e{this.extraEvents.push({element:t,event:e,handler:o}),t.addEventListener(e,o)},e=(e,o,i)=>{for(const a of o)t(e,a,i)};if(this.resizeObserver=new ResizeObserver((t=>{for(let e=0;e550;this.votButton.container.dataset.position=this.votMenu.container.dataset.position=e?this.data?.buttonPos:"default",this.votButton.container.dataset.direction=this.data?.buttonPos&&"default"!==this.data?.buttonPos&&e?"column":"row"})),this.resizeObserver.observe(this.video),this.votMenu.container.setAttribute("style",`--vot-container-height: ${this.video.getBoundingClientRect().height}px`),["youtube","googledrive"].includes(this.site.host)&&"mobile"!==this.site.additionalData){this.syncVolumeObserver=new MutationObserver((t=>{if(this.audioPlayer.player.src&&this.data.syncVolume)for(let e=0;e{const e=t.target,o=this.votButton.container,i=this.votMenu.container,a=this.container,n=this.votSettingsDialog.container,r=document.querySelector(".vot-dialog-temp"),s=o.contains(e),l=i.contains(e),d=a.contains(e),u=n.contains(e),c=r?.contains(e)??!1;D.log(`[document click] ${s} ${l} ${d} ${u} ${c}`),s||l||u||c||(d||this.logout(0),this.votMenu.container.hidden=!0)})),document.addEventListener("keydown",(async t=>{const e=t.code,o=document.activeElement;["input","textarea"].includes(o.tagName.toLowerCase())||o.isContentEditable||e!==this.data.hotkeyButton||await this.handleTranslationBtnClick()}));let o=this.site.eventSelector?document.querySelector(this.site.eventSelector):this.container;o&&e(o,["mousemove","mouseout"],this.resetTimer),t(this.votButton.container,"mousemove",this.changeOpacityOnEvent),t(this.votMenu.container,"mousemove",this.changeOpacityOnEvent),e(document,["touchstart","touchmove","touchend"],this.changeOpacityOnEvent),t(this.votButton.container,"mousedown",(t=>{t.stopImmediatePropagation()})),t(this.votMenu.container,"mousedown",(t=>{t.stopImmediatePropagation()})),"youtube"===this.site.host&&(this.container.draggable=!1),"googledrive"===this.site.host&&(this.container.style.height="100%"),t(this.video,"canplay",(async()=>{"rutube"===this.site.host&&this.video.src||await this.setCanPlay()})),t(this.video,"emptied",(async()=>{this.video.src&&await ft(this.site,this.video)===this.videoData.videoId||(D.log("lipsync mode is emptied"),this.videoData="",this.stopTranslation())})),["rutube","ok"].includes(this.site.host)||t(this.video,"volumechange",(()=>{this.syncVideoVolumeSlider()})),"youtube"!==this.site.host||this.site.additionalData||t(document,"yt-page-data-updated",(async()=>{D.log("yt-page-data-updated"),window.location.pathname.includes("/shorts/")&&await this.setCanPlay()}))}async setCanPlay(){await ft(this.site,this.video)!==this.videoData.videoId&&(await this.handleSrcChanged(),await this.autoTranslate(),D.log("lipsync mode is canplay"))}logout(t){this.votMenu.container.hidden&&(this.votButton.container.style.opacity=t)}resetTimer=()=>{clearTimeout(this.timer),this.logout(1),this.timer=setTimeout((()=>{this.logout(0)}),1e3)};changeOpacityOnEvent=t=>{clearTimeout(this.timer),this.logout(1),t.stopPropagation()};async changeSubtitlesLang(t){if(D.log("[onchange] subtitles",t),this.votSubtitlesSelect.setSelected(t),"disabled"===t)this.votSubtitlesSelect.setTitle(X.get("VOTSubtitlesDisabled")),this.subtitlesWidget.setContent(null),this.votDownloadSubtitlesButton.hidden=!0,this.yandexSubtitles=null;else{const e=this.subtitlesList.at(parseInt(t));if(1===this.data.audioProxy&&e.url.startsWith("https://brosubs.s3-private.mds.yandex.net/vtrans/")){const t=e.url.replace("https://brosubs.s3-private.mds.yandex.net/vtrans/","");e.url=`https://${this.data.proxyWorkerHost}/video-subtitles/subtitles-proxy/${t}`,console.log(`[VOT] Subs proxied via ${e.url}`)}this.yandexSubtitles=await Be(e),this.subtitlesWidget.setContent(this.yandexSubtitles),this.votDownloadSubtitlesButton.hidden=!1}}async updateSubtitlesLangSelect(){const t=[{label:X.get("VOTSubtitlesDisabled"),value:"disabled",selected:!0,disabled:!1},...this.subtitlesList.map(((t,e)=>({label:(X.get("langs")[t.language]??t.language.toUpperCase())+(t.translatedFromLanguage?` ${X.get("VOTTranslatedFrom")} ${X.get("langs")[t.translatedFromLanguage]??t.translatedFromLanguage.toUpperCase()}`:"")+("yandex"!==t.source?`, ${window.location.hostname}`:"")+(t.isAutoGenerated?` (${X.get("VOTAutogenerated")})`:""),value:e,selected:!1,disabled:!1})))];this.votSubtitlesSelect.updateItems(t),await this.changeSubtitlesLang(t[0].value)}async updateSubtitles(){if(await this.changeSubtitlesLang("disabled"),!this.videoData.videoId)return console.error(`[VOT] ${X.getDefault("VOTNoVideoIDFound")}`),this.subtitlesList=[],this.subtitlesListVideoId=null,this.votButton.container.hidden=!0,void await this.updateSubtitlesLangSelect();if(this.votButton.container.hidden=!1,this.subtitlesListVideoId!==this.videoData.videoId){try{this.subtitlesList=await Ne(this.votClient,this.videoData)}catch(t){D.log("Error with yandex server, try auto-fix...",t),this.votOpts={fetchFn:rt,hostVOT:U,host:this.data.proxyWorkerHost},this.votClient=new xt(this.votOpts),this.subtitlesList=await Ne(this.votClient,this.videoData),await J.set("translateProxyEnabled",1)}this.subtitlesList?this.subtitlesListVideoId=this.videoData.videoId:await this.changeSubtitlesLang("disabled"),await this.updateSubtitlesLangSelect()}}getVideoVolume(){let t=this.video?.volume;return["youtube","googledrive"].includes(this.site.host)&&(t=Oe.getVideoVolume()??t),t}setVideoVolume(t){if(["youtube","googledrive"].includes(this.site.host)){if(Oe.setVideoVolume(t))return this}return this.video.volume=t,this}isMuted(){return["youtube","googledrive"].includes(this.site.host)?Oe.isMuted():this.video?.muted}syncVideoVolumeSlider(){const t=this.isMuted()?0:100*this.getVideoVolume(),e=Math.round(t);this.votVideoVolumeSlider.input.value=e,this.votVideoVolumeSlider.label.querySelector("strong").textContent=`${e}%`,je.updateSlider(this.votVideoVolumeSlider.input),1===this.data.syncVolume&&(this.tempOriginalVolume=Number(e))}setSelectMenuValues(t,e){this.votTranslationLanguageSelect.fromSelect.setTitle(X.get("langs")[t]),this.votTranslationLanguageSelect.toSelect.setTitle(X.get("langs")[e]),this.votTranslationLanguageSelect.fromSelect.setSelected(t),this.votTranslationLanguageSelect.toSelect.setSelected(e),console.log(`[VOT] Set translation from ${t} to ${e}`),this.videoData.detectedLanguage=t,this.videoData.responseLanguage=e}syncVolumeWrapper(t,e){const o="translation"===t?this.votVideoVolumeSlider:this.votVideoTranslationVolumeSlider,i=Number(o.input.value),a=function(t,e,o,i){let a=e;return e>i?(a=o+(e-i),a=a>100?100:Math.max(a,0),t.volume=a/100):e100?100:Math.max(a,0),t.volume=a/100),a}("translation"===t?this.video:this.audioPlayer.player,e,i,"translation"===t?this.tempVolume:this.tempOriginalVolume);o.input.value=a,o.label.querySelector("strong").textContent=`${a}%`,je.updateSlider(o.input),this.tempOriginalVolume="translation"===t?a:e,this.tempVolume="translation"===t?e:a}async getVideoData(){const{duration:t,url:e,videoId:o,host:i,title:a,translationHelp:n,detectedLanguage:r,subtitles:s}=await bt(this.site,this.video),l={translationHelp:n??null,isStream:!1,duration:this.video?.duration||t||P.defaultDuration,videoId:o,url:e,host:i,detectedLanguage:r??this.translateFromLang,responseLanguage:this.translateToLang,subtitles:s,title:a};if("youtube"===this.site.host){const t=await Oe.getVideoData();l.isStream=t.isLive,t.title&&(l.detectedLanguage=t.detectedLanguage,l.title=t.localizedTitle)}else if(["rutube","ok.ru","mail_ru"].includes(this.site.host))l.detectedLanguage="ru";else if("youku"===this.site.host)l.detectedLanguage="zh";else if("vk"===this.site.host){const t=document.getElementsByTagName("track")?.[0]?.srclang;l.detectedLanguage=t||"auto"}else"weverse"===this.site.host?l.detectedLanguage="ko":["bilibili","bitchute","rumble","peertube","dailymotion","trovo","yandexdisk","coursehunterLike","archive","nineanimetv","directlink"].includes(this.site.host)&&(l.detectedLanguage="auto");return l}videoValidator(){if(["youtube","ok.ru","vk"].includes(this.site.host)&&(D.log("VideoValidator videoData: ",this.videoData),1===this.data.dontTranslateYourLang&&this.videoData.detectedLanguage===this.data.dontTranslateLanguage))throw new pt("VOTDisableFromYourLang");if(!this.videoData.isStream&&this.videoData.duration>14400)throw new pt("VOTVideoIsTooLong");return!0}stopTranslate(){this.audioPlayer.player.removeVideoEvents(),this.audioPlayer.player.clear(),this.audioPlayer.player.src=void 0,D.log("audioPlayer after stopTranslate",this.audioPlayer),this.votVideoVolumeSlider.container.hidden=!0,this.votVideoTranslationVolumeSlider.container.hidden=!0,this.votDownloadButton.hidden=!0,this.downloadTranslationUrl=null,this.transformBtn("none",X.get("translateVideo")),D.log(`Volume on start: ${this.volumeOnStart}`),this.volumeOnStart&&this.setVideoVolume(this.volumeOnStart),clearInterval(this.streamPing),clearTimeout(this.autoRetry),this.hls?.destroy(),this.hls=ot(),this.firstSyncVolume=!0}async translateExecutor(t){D.log("Run translateFunc",t),await this.translateFunc(t,this.videoData.isStream,this.videoData.detectedLanguage,this.videoData.responseLanguage,this.videoData.translationHelp)}async updateTranslationErrorMsg(t){const e=X.get("translationTake"),o=X.lang;if("VOTLocalizedError"===t?.name)this.transformBtn("error",t.localizedMessage);else if(t instanceof Error)this.transformBtn("error",t?.message);else if(1!==this.data.translateAPIErrors||t.includes(e)||"ru"===o)this.transformBtn("error",t);else{this.setLoadingBtn(!0);const e=await async function(t,e="",o="ru"){switch(await J.get("translationService",z)){case"yandex":{const i=e&&o?`${e}-${o}`:o;return await Se.translate(t,i)}case"deepl":return await Te.translate(t,e,o);default:return t}}(t,"ru",o);this.transformBtn("error",e)}["Подготавливаем перевод","Видео передано в обработку","Ожидаем перевод видео","Загружаем переведенное аудио"].includes(t)&&this.setLoadingBtn(!0)}afterUpdateTranslation(t){this.votVideoVolumeSlider.container.hidden=1!==this.data.showVideoSlider||"success"!==this.votButton.container.dataset.status,this.votVideoTranslationVolumeSlider.container.hidden="success"!==this.votButton.container.dataset.status,1===this.data.autoSetVolumeYandexStyle&&(this.votVideoVolumeSlider.input.value=100*this.data.autoVolume,this.votVideoVolumeSlider.label.querySelector("strong").textContent=100*this.data.autoVolume+"%",je.updateSlider(this.votVideoVolumeSlider.input)),this.votDownloadButton.hidden=!1,this.downloadTranslationUrl=t}async validateAudioUrl(t){try{const e=await rt(t,{method:"HEAD",timeout:5e3});if(D.log("Test audio response",e),404!==e.status)return D.log("Valid audioUrl",t),t;D.log("Yandex returned not valid audio, trying to fix...");let o=await this.translateVideoImpl(this.videoData,this.videoData.detectedLanguage="auto",this.videoData.responseLanguage,this.videoData.translationHelp);this.setSelectMenuValues(this.videoData.detectedLanguage,this.videoData.responseLanguage),t=o.url,D.log("Fixed audio audioUrl",t)}catch(t){"Timeout"===t.message?(D.log("Request timed out. Handling timeout error..."),this.data.audioProxy=1,await J.set("audioProxy",1)):D.log("Test audio error:",t)}return t}async updateTranslation(t){if(this.cachedTranslation?.url!==this.audioPlayer.player.currentSrc&&(t=await this.validateAudioUrl(t)),1===this.data.audioProxy&&t.startsWith("https://vtrans.s3-private.mds.yandex.net/tts/prod/")){const e=t.replace("https://vtrans.s3-private.mds.yandex.net/tts/prod/","");t=`https://${this.data.proxyWorkerHost}/video-translation/audio-proxy/${e}`,console.log(`[VOT] Audio proxied via ${t}`)}this.audioPlayer.player.src!==t&&(this.audioPlayer.player.src=t);try{this.audioPlayer.init()}catch(t){t.message.includes("Failed to fetch audio file")?(this.videoHandler.data.audioProxy=1,await J.set("audioProxy",1)):this.videoHandler.transformBtn("error",t.message)}this.setupAudioSettings(),"twitter"===this.site.host&&document.querySelector('button[data-testid="app-bar-back"][role="button"]').addEventListener("click",this.stopTranslation),this.transformBtn("success",X.get("disableTranslate")),this.afterUpdateTranslation(t)}async translateFunc(t,e,o,i,a){if(console.log("[VOT] Video Data: ",this.videoData),D.log("Run videoValidator"),this.videoValidator(),this.setLoadingBtn(!0),this.volumeOnStart=this.getVideoVolume(),e){let t=await this.translateStreamImpl(this.videoData,o,i);if(!t)return void D.log("Skip translation");this.transformBtn("success",X.get("disableTranslate"));const e=this.setHLSSource(t.result.url);return"youtube"===this.site.host&&Oe.videoSeek(this.video,10),this.setupAudioSettings(),this.video.src||this.video.currentSrc||this.video.srcObject?this.afterUpdateTranslation(e):this.stopTranslation()}if(this.cachedTranslation=this.videoTranslations.find((e=>e.videoId===t&&e.expires>st()&&e.from===o&&e.to===i&&e.useNewModel===this.data.useNewModel)),this.cachedTranslation)return await this.updateTranslation(this.cachedTranslation.url),void D.log("[translateFunc] Cached translation was received");let n=await this.translateVideoImpl(this.videoData,o,i,a);D.log("[translateRes]",n),n?(await this.updateTranslation(n.url),this.subtitlesList.some((t=>"yandex"===t.source&&t.translatedFromLanguage===this.videoData.detectedLanguage&&t.language===this.videoData.responseLanguage))||(this.subtitlesList=await Ne(this.votClient,this.videoData),await this.updateSubtitlesLangSelect()),this.videoTranslations.push({videoId:t,from:o,to:i,url:this.downloadTranslationUrl,expires:st()+this.videoTranslationTTL,useNewModel:this.data?.useNewModel})):D.log("Skip translation")}setupHLS(t){this.hls.on(Hls.Events.MEDIA_ATTACHED,(function(){D.log("audio and hls.js are now bound together !")})),this.hls.on(Hls.Events.MANIFEST_PARSED,(function(t){D.log("manifest loaded, found "+t?.levels?.length+" quality level")})),this.hls.loadSource(t),this.hls.attachMedia(this.audioPlayer.player.audio),this.hls.on(Hls.Events.ERROR,(function(t){if(t.fatal)switch(t.type){case Hls.ErrorTypes.MEDIA_ERROR:console.log("fatal media error encountered, try to recover"),this.hls.recoverMediaError();break;case Hls.ErrorTypes.NETWORK_ERROR:console.error("fatal network error encountered",t);break;default:this.hls.destroy()}})),D.log(this.hls)}setHLSSource(t){const e=`https://${this.data.m3u8ProxyHost}/?all=yes&origin=${encodeURIComponent("https://strm.yandex.ru")}&referer=${encodeURIComponent("https://strm.yandex.ru")}&url=${encodeURIComponent(t)}`;if(this.hls)this.setupHLS(e);else{if(!this.audioPlayer.player.audio.canPlayType("application/vnd.apple.mpegurl"))throw new pt("audioFormatNotSupported");this.audioPlayer.player.src=e}return e}setupAudioSettings(){"number"==typeof this.data.defaultVolume&&(this.audioPlayer.player.volume=this.data.defaultVolume/100),"number"==typeof this.data.autoSetVolumeYandexStyle&&this.data.autoSetVolumeYandexStyle&&this.setVideoVolume(this.data.autoVolume)}stopTranslation=()=>{this.stopTranslate(),this.syncVideoVolumeSlider()};async handleSrcChanged(){D.log("[VideoHandler] src changed",this),this.firstPlay=!0,this.stopTranslation();const t=!this.video.src&&!this.video.currentSrc&&!this.video.srcObject;this.votButton.container.hidden=t,t&&(this.votMenu.container.hidden=t),this.site.selector||(this.container=this.video.parentElement),this.container.contains(this.votButton.container)||this.container.append(this.votButton.container,this.votMenu.container),this.videoData=await this.getVideoData(),await this.updateSubtitles(),this.translateToLang=this.data.responseLanguage??"ru",this.setSelectMenuValues(this.videoData.detectedLanguage,this.videoData.responseLanguage)}async release(){D.log("[VideoHandler] release"),this.initialized=!1,this.releaseExtraEvents(),this.subtitlesWidget.release(),this.votButton.container.remove(),this.votMenu.container.remove()}}const Co=new class{constructor(){this.videoCache=new Set,this.onVideoAdded=new Ge,this.onVideoRemoved=new Ge,this.observer=new MutationObserver(this.handleMutations),this.intersectionObserver=new IntersectionObserver(this.handleIntersections,{threshold:.1})}handleMutations=t=>{window.requestIdleCallback((()=>{for(let e=0;e{for(let e=0;e{if(!t)return;const i=t.querySelectorAll("video");for(let t=0;t{this.videoCache.has(t)||(this.videoCache.add(t),this.intersectionObserver.observe(t))};handleIntersectingVideo=t=>{this.intersectionObserver.unobserve(t),(t=>{if(Je.test(t.className)||Je.test(t.title))return!0;let e=t.parentElement;for(;e;){if(Je.test(e.className)||Je.test(e.id))return!0;e=e.parentElement}return!1})(t)||(t=>t.hasAttribute("muted")&&!t.classList.contains("vjs-tech")&&!t.preload)(t)?D.log("The promotional/muted video was ignored",t):((t,e)=>{const o=()=>{(t=>t.readyState>=3)(t)?e(t):requestAnimationFrame(o)};o()})(t,this.handleVideoAdded)};handleVideoAdded=t=>{this.onVideoAdded.dispatch(t)};handleVideoRemoved=t=>{document.contains(t)||(this.videoCache.delete(t),this.onVideoRemoved.dispatch(t))}},Po=new WeakMap;function Lo(t,e){if(t.shadowRoot){let o=t.selector?Array.from(document.querySelectorAll(t.selector)).find((t=>t.shadowRoot.contains(e))):e.parentElement;return o&&o.shadowRoot?o.parentElement:o}const o=xo.browser.version?.split(".")?.[0];if(t.selector?.includes(":not")&&t.selector?.includes("*")&&o&&("Chrome"===xo.browser.name&&Number(o)<88||"Firefox"===xo.browser.name&&Number(o)<84)){const o=t.selector.split(" *")[0];return o?Array.from(document.querySelectorAll(o)).find((t=>t.contains(e))):e.parentElement}return t.selector?Array.from(document.querySelectorAll(t.selector)).find((t=>t.contains(e))):e.parentElement}(async function(){D.log("Loading extension..."),await X.update(),D.log(`Selected menu language: ${X.lang}`),"https://9animetv.to"===window.location.origin&&window.addEventListener("message",(t=>{if("https://rapid-cloud.co"===t.origin&&"getVideoId"===t.data){const t=/[^/]+$/.exec(window.location.href)?.[0],e=document.querySelector("#iframe-embed")?.contentWindow;e.postMessage(`getVideoId:${t}`,"https://rapid-cloud.co/")}})),Co.onVideoAdded.addListener((t=>{for(const e of function(){if(/(http(s)?:\/\/)(127\.0\.0\.1|localhost)/.exec(window.location.href))return[];const t=window.location.hostname,e=new URL(window.location),o=o=>o instanceof RegExp?o.test(t):"string"==typeof o?t.includes(o):"function"==typeof o&&o(e);return R.filter((t=>(Array.isArray(t.match)?t.match.some(o):o(t.match))&&t.host&&t.url))}()){if(!e)continue;let o=Lo(e,t);if(o&&(("rumble"!==e.host||t.style.display)&&(["peertube","directlink"].includes(e.host)&&(e.url=window.location.origin),!Po.has(t)))){Po.set(t,new To(t,o,e));break}}})),Co.onVideoRemoved.addListener((async t=>{Po.has(t)&&(await Po.get(t).release(),Po.delete(t))})),Co.enable()})().catch((t=>{console.error("[VOT]",t)}))})()})(); \ No newline at end of file diff --git a/dist/vot.user.js b/dist/vot.user.js index 0941dd6f..2c2e528d 100644 --- a/dist/vot.user.js +++ b/dist/vot.user.js @@ -371,7 +371,7 @@ function createBaseVideoTranslationRequest() { unknown2: 0, unknown3: 0, bypassCache: false, - unknown4: 0, + useNewModel: false, }; } const VideoTranslationRequest = { @@ -415,8 +415,8 @@ const VideoTranslationRequest = { if (message.bypassCache !== false) { writer.uint32(136).bool(message.bypassCache); } - if (message.unknown4 !== 0) { - writer.uint32(144).int32(message.unknown4); + if (message.useNewModel !== false) { + writer.uint32(144).bool(message.useNewModel); } return writer; }, @@ -509,7 +509,7 @@ const VideoTranslationRequest = { if (tag !== 144) { break; } - message.unknown4 = reader.int32(); + message.useNewModel = reader.bool(); continue; } if ((tag & 7) === 4 || tag === 0) { @@ -536,7 +536,7 @@ const VideoTranslationRequest = { unknown2: isSet(object.unknown2) ? globalThis.Number(object.unknown2) : 0, unknown3: isSet(object.unknown3) ? globalThis.Number(object.unknown3) : 0, bypassCache: isSet(object.bypassCache) ? globalThis.Boolean(object.bypassCache) : false, - unknown4: isSet(object.unknown4) ? globalThis.Number(object.unknown4) : 0, + useNewModel: isSet(object.useNewModel) ? globalThis.Boolean(object.useNewModel) : false, }; }, toJSON(message) { @@ -580,8 +580,8 @@ const VideoTranslationRequest = { if (message.bypassCache !== false) { obj.bypassCache = message.bypassCache; } - if (message.unknown4 !== 0) { - obj.unknown4 = Math.round(message.unknown4); + if (message.useNewModel !== false) { + obj.useNewModel = message.useNewModel; } return obj; }, @@ -603,7 +603,7 @@ const VideoTranslationRequest = { message.unknown2 = object.unknown2 ?? 0; message.unknown3 = object.unknown3 ?? 0; message.bypassCache = object.bypassCache ?? false; - message.unknown4 = object.unknown4 ?? 0; + message.useNewModel = object.useNewModel ?? false; return message; }, }; @@ -1758,21 +1758,21 @@ var AudioInfoMessage; const yandexProtobuf = { - encodeTranslationRequest(url, duration, requestLang, responseLang, translationHelp) { + encodeTranslationRequest(url, duration, requestLang, responseLang, translationHelp, { forceSourceLang = false, bypassCache = false, useNewModel = true, } = {}) { return VideoTranslationRequest.encode({ url, firstRequest: true, duration, unknown0: 1, language: requestLang, - forceSourceLang: false, + forceSourceLang, unknown1: 0, translationHelp: translationHelp ? translationHelp : [], responseLanguage: responseLang, - unknown2: 0, + unknown2: 1, unknown3: 1, - bypassCache: false, - unknown4: 1, + bypassCache, + useNewModel, }).finish(); }, decodeTranslationResponse(response) { @@ -1836,7 +1836,7 @@ const yandexProtobuf = { hmac: "bt8xH3VOlb4mqf0nqAibnDOoiPlXsisf", defaultDuration: 343, loggerLevel: 1, - version: "1.3.9", + version: "1.3.10", }); ;// ./node_modules/vot.js/dist/types/logger.js @@ -2582,7 +2582,7 @@ const sitesCoursehunterLike = ["coursehunter.net", "coursetrain.net"]; ]); ;// ./src/localization/locales/en.json -const en_namespaceObject = /*#__PURE__*/JSON.parse('{"__version__":5,"recommended":"recommended","translateVideo":"Translate video","disableTranslate":"Turn off","translationSettings":"Translation settings","subtitlesSettings":"Subtitles settings","about":"About extension","resetSettings":"Reset settings","videoBeingTranslated":"The video is being translated","videoLanguage":"Video language","translationLanguage":"Translation language","translationTake":"The translation will take","translationTakeMoreThanHour":"The translation will take more than an hour","translationTakeAboutMinute":"The translation will take about a minute","translationTakeFewMinutes":"The translation will take a few minutes","translationTakeApproximatelyMinutes":"The translation will take approximately {0} minutes","translationTakeApproximatelyMinute":"The translation will take approximately {0} minutes","unSupportedExtensionError":"Error! {0} is not supported by this version of the extension!\\n\\nPlease use the cloudflare version of the VOT extension.","requestTranslationFailed":"Failed to request video translation","audioNotReceived":"Audio link not received","grantPermissionToAutoPlay":"Grant permission to autoplay","audioFormatNotSupported":"The audio format is not supported","VOTAutoTranslate":"Translate on open","VOTDontTranslateYourLang":"Do not translate from my language","VOTVolume":"Video volume","VOTVolumeTranslation":"Translation Volume","VOTAutoSetVolume":"Reduce video volume to ","VOTShowVideoSlider":"Video volume slider","VOTSyncVolume":"Link translation and video volume","VOTAudioProxy":"Proxy received audio","VOTDisableFromYourLang":"You have disabled the translation of the video in your language","VOTLiveNotSupported":"Translation of live streams is not supported","VOTPremiere":"Wait for the premiere to end before translating","VOTVideoIsTooLong":"Video is too long","VOTNoVideoIDFound":"No video ID found","VOTSubtitles":"Subtitles","VOTSubtitlesDisabled":"Disabled","VOTSubtitlesMaxLength":"Subtitles max length","VOTHighlightWords":"Highlight words","VOTTranslatedFrom":"translated from","VOTAutogenerated":"autogenerated","VOTSettings":"VOT Settings","VOTMenuLanguage":"Menu language","VOTAuthors":"Authors","VOTVersion":"Version","VOTLoader":"Loader","VOTBrowser":"Browser","VOTShowPiPButton":"Show PiP button","langs":{"auto":"Auto","af":"Afrikaans","ak":"Akan","sq":"Albanian","am":"Amharic","ar":"Arabic","hy":"Armenian","as":"Assamese","ay":"Aymara","az":"Azerbaijani","bn":"Bangla","eu":"Basque","be":"Belarusian","bho":"Bhojpuri","bs":"Bosnian","bg":"Bulgarian","my":"Burmese","ca":"Catalan","ceb":"Cebuano","zh":"Chinese","zh-Hans":"Chinese (Simplified)","zh-Hant":"Chinese (Traditional)","co":"Corsican","hr":"Croatian","cs":"Czech","da":"Danish","dv":"Divehi","nl":"Dutch","en":"English","eo":"Esperanto","et":"Estonian","ee":"Ewe","fil":"Filipino","fi":"Finnish","fr":"French","gl":"Galician","lg":"Ganda","ka":"Georgian","de":"German","el":"Greek","gn":"Guarani","gu":"Gujarati","ht":"Haitian Creole","ha":"Hausa","haw":"Hawaiian","iw":"Hebrew","hi":"Hindi","hmn":"Hmong","hu":"Hungarian","is":"Icelandic","ig":"Igbo","id":"Indonesian","ga":"Irish","it":"Italian","ja":"Japanese","jv":"Javanese","kn":"Kannada","kk":"Kazakh","km":"Khmer","rw":"Kinyarwanda","ko":"Korean","kri":"Krio","ku":"Kurdish","ky":"Kyrgyz","lo":"Lao","la":"Latin","lv":"Latvian","ln":"Lingala","lt":"Lithuanian","lb":"Luxembourgish","mk":"Macedonian","mg":"Malagasy","ms":"Malay","ml":"Malayalam","mt":"Maltese","mi":"Māori","mr":"Marathi","mn":"Mongolian","ne":"Nepali","nso":"Northern Sotho","no":"Norwegian","ny":"Nyanja","or":"Odia","om":"Oromo","ps":"Pashto","fa":"Persian","pl":"Polish","pt":"Portuguese","pa":"Punjabi","qu":"Quechua","ro":"Romanian","ru":"Russian","sm":"Samoan","sa":"Sanskrit","gd":"Scottish Gaelic","sr":"Serbian","sn":"Shona","sd":"Sindhi","si":"Sinhala","sk":"Slovak","sl":"Slovenian","so":"Somali","st":"Southern Sotho","es":"Spanish","su":"Sundanese","sw":"Swahili","sv":"Swedish","tg":"Tajik","ta":"Tamil","tt":"Tatar","te":"Telugu","th":"Thai","ti":"Tigrinya","ts":"Tsonga","tr":"Turkish","tk":"Turkmen","uk":"Ukrainian","ur":"Urdu","ug":"Uyghur","uz":"Uzbek","vi":"Vietnamese","cy":"Welsh","fy":"Western Frisian","xh":"Xhosa","yi":"Yiddish","yo":"Yoruba","zu":"Zulu"},"udemyModuleArgsNotFound":"Could not get udemy module data due to the fact that ModuleArgs was not found","VOTTranslationHelpNull":"Could not get the data required for the translate","streamNoConnectionToServer":"There is no connection to the server","searchField":"Search...","VOTTranslateAPIErrors":"Translate errors from the API","VOTTranslationService":"Translation Service","VOTDetectService":"Detect Service","VOTTranslatingError":"Translating the error","VOTProxyWorkerHost":"Enter the proxy worker address","VOTM3u8ProxyHost":"Enter the address of the m3u8 proxy worker","proxySettings":"Proxy Settings","translationTakeApproximatelyMinute2":"The translation will take approximately {0} minutes","VOTAudioBooster":"Extended translation volume increase","VOTSubtitlesDesign":"Subtitles design","VOTSubtitlesFontSize":"Font size of subtitles","VOTSubtitlesOpacity":"Transparency of the subtitle background","VOTPressNewHotkey":"Press the new hotkey...","VOTCreateTranslationHotkey":"Create Hotkey for Translation","VOTChangeHotkeyWithCurrent":"Change Hotkey (Current: {0})","VOTSubtitlesDownloadFormat":"The format for downloading subtitles","VOTDownloadWithName":"Download files with the video name","VOTUpdateLocaleFiles":"Update localization files","VOTLocaleHash":"Locale hash","VOTUpdatedAt":"Updated at","VOTNeedWebAudioAPI":"To enable this, you must have a Web Audio API","VOTMediaCSPEnabledOnSite":"Media CSP is enabled on this site","VOTOnlyBypassMediaCSP":"Use it only for bypassing Media CSP","VOTNewAudioPlayer":"Use the new audio player"}'); +const en_namespaceObject = /*#__PURE__*/JSON.parse('{"__version__":5,"recommended":"recommended","translateVideo":"Translate video","disableTranslate":"Turn off","translationSettings":"Translation settings","subtitlesSettings":"Subtitles settings","about":"About extension","resetSettings":"Reset settings","videoBeingTranslated":"The video is being translated","videoLanguage":"Video language","translationLanguage":"Translation language","translationTake":"The translation will take","translationTakeMoreThanHour":"The translation will take more than an hour","translationTakeAboutMinute":"The translation will take about a minute","translationTakeFewMinutes":"The translation will take a few minutes","translationTakeApproximatelyMinutes":"The translation will take approximately {0} minutes","translationTakeApproximatelyMinute":"The translation will take approximately {0} minutes","unSupportedExtensionError":"Error! {0} is not supported by this version of the extension!\\n\\nPlease use the cloudflare version of the VOT extension.","requestTranslationFailed":"Failed to request video translation","audioNotReceived":"Audio link not received","grantPermissionToAutoPlay":"Grant permission to autoplay","audioFormatNotSupported":"The audio format is not supported","VOTAutoTranslate":"Translate on open","VOTDontTranslateYourLang":"Do not translate from my language","VOTVolume":"Video volume","VOTVolumeTranslation":"Translation Volume","VOTAutoSetVolume":"Reduce video volume to ","VOTShowVideoSlider":"Video volume slider","VOTSyncVolume":"Link translation and video volume","VOTAudioProxy":"Proxy received audio","VOTDisableFromYourLang":"You have disabled the translation of the video in your language","VOTLiveNotSupported":"Translation of live streams is not supported","VOTPremiere":"Wait for the premiere to end before translating","VOTVideoIsTooLong":"Video is too long","VOTNoVideoIDFound":"No video ID found","VOTSubtitles":"Subtitles","VOTSubtitlesDisabled":"Disabled","VOTSubtitlesMaxLength":"Subtitles max length","VOTHighlightWords":"Highlight words","VOTTranslatedFrom":"translated from","VOTAutogenerated":"autogenerated","VOTSettings":"VOT Settings","VOTMenuLanguage":"Menu language","VOTAuthors":"Authors","VOTVersion":"Version","VOTLoader":"Loader","VOTBrowser":"Browser","VOTShowPiPButton":"Show PiP button","langs":{"auto":"Auto","af":"Afrikaans","ak":"Akan","sq":"Albanian","am":"Amharic","ar":"Arabic","hy":"Armenian","as":"Assamese","ay":"Aymara","az":"Azerbaijani","bn":"Bangla","eu":"Basque","be":"Belarusian","bho":"Bhojpuri","bs":"Bosnian","bg":"Bulgarian","my":"Burmese","ca":"Catalan","ceb":"Cebuano","zh":"Chinese","zh-Hans":"Chinese (Simplified)","zh-Hant":"Chinese (Traditional)","co":"Corsican","hr":"Croatian","cs":"Czech","da":"Danish","dv":"Divehi","nl":"Dutch","en":"English","eo":"Esperanto","et":"Estonian","ee":"Ewe","fil":"Filipino","fi":"Finnish","fr":"French","gl":"Galician","lg":"Ganda","ka":"Georgian","de":"German","el":"Greek","gn":"Guarani","gu":"Gujarati","ht":"Haitian Creole","ha":"Hausa","haw":"Hawaiian","iw":"Hebrew","hi":"Hindi","hmn":"Hmong","hu":"Hungarian","is":"Icelandic","ig":"Igbo","id":"Indonesian","ga":"Irish","it":"Italian","ja":"Japanese","jv":"Javanese","kn":"Kannada","kk":"Kazakh","km":"Khmer","rw":"Kinyarwanda","ko":"Korean","kri":"Krio","ku":"Kurdish","ky":"Kyrgyz","lo":"Lao","la":"Latin","lv":"Latvian","ln":"Lingala","lt":"Lithuanian","lb":"Luxembourgish","mk":"Macedonian","mg":"Malagasy","ms":"Malay","ml":"Malayalam","mt":"Maltese","mi":"Māori","mr":"Marathi","mn":"Mongolian","ne":"Nepali","nso":"Northern Sotho","no":"Norwegian","ny":"Nyanja","or":"Odia","om":"Oromo","ps":"Pashto","fa":"Persian","pl":"Polish","pt":"Portuguese","pa":"Punjabi","qu":"Quechua","ro":"Romanian","ru":"Russian","sm":"Samoan","sa":"Sanskrit","gd":"Scottish Gaelic","sr":"Serbian","sn":"Shona","sd":"Sindhi","si":"Sinhala","sk":"Slovak","sl":"Slovenian","so":"Somali","st":"Southern Sotho","es":"Spanish","su":"Sundanese","sw":"Swahili","sv":"Swedish","tg":"Tajik","ta":"Tamil","tt":"Tatar","te":"Telugu","th":"Thai","ti":"Tigrinya","ts":"Tsonga","tr":"Turkish","tk":"Turkmen","uk":"Ukrainian","ur":"Urdu","ug":"Uyghur","uz":"Uzbek","vi":"Vietnamese","cy":"Welsh","fy":"Western Frisian","xh":"Xhosa","yi":"Yiddish","yo":"Yoruba","zu":"Zulu"},"udemyModuleArgsNotFound":"Could not get udemy module data due to the fact that ModuleArgs was not found","VOTTranslationHelpNull":"Could not get the data required for the translate","streamNoConnectionToServer":"There is no connection to the server","searchField":"Search...","VOTTranslateAPIErrors":"Translate errors from the API","VOTTranslationService":"Translation Service","VOTDetectService":"Detect Service","VOTTranslatingError":"Translating the error","VOTProxyWorkerHost":"Enter the proxy worker address","VOTM3u8ProxyHost":"Enter the address of the m3u8 proxy worker","proxySettings":"Proxy Settings","translationTakeApproximatelyMinute2":"The translation will take approximately {0} minutes","VOTAudioBooster":"Extended translation volume increase","VOTSubtitlesDesign":"Subtitles design","VOTSubtitlesFontSize":"Font size of subtitles","VOTSubtitlesOpacity":"Transparency of the subtitle background","VOTPressNewHotkey":"Press the new hotkey...","VOTCreateTranslationHotkey":"Create Hotkey for Translation","VOTChangeHotkeyWithCurrent":"Change Hotkey (Current: {0})","VOTSubtitlesDownloadFormat":"The format for downloading subtitles","VOTDownloadWithName":"Download files with the video name","VOTUpdateLocaleFiles":"Update localization files","VOTLocaleHash":"Locale hash","VOTUpdatedAt":"Updated at","VOTNeedWebAudioAPI":"To enable this, you must have a Web Audio API","VOTMediaCSPEnabledOnSite":"Media CSP is enabled on this site","VOTOnlyBypassMediaCSP":"Use it only for bypassing Media CSP","VOTNewAudioPlayer":"Use the new audio player","VOTUseNewModel":"Use an experimental variation of Yandex voices for some videos"}'); ;// ./src/utils/debug.ts /* harmony default export */ const debug = ({ log: (...text) => { @@ -5109,10 +5109,10 @@ class VOTClient { }; return this.sessions[module]; } - async translateVideoYAImpl({ videoData, requestLang = this.requestLang, responseLang = this.responseLang, translationHelp = null, headers = {}, shouldSendFailedAudio = true, }) { + async translateVideoYAImpl({ videoData, requestLang = this.requestLang, responseLang = this.responseLang, translationHelp = null, headers = {}, extraOpts = {}, shouldSendFailedAudio = true, }) { const { url, duration = config.defaultDuration } = videoData; const session = await this.getSession("video-translation"); - const body = yandexProtobuf.encodeTranslationRequest(url, duration, requestLang, responseLang, translationHelp); + const body = yandexProtobuf.encodeTranslationRequest(url, duration, requestLang, responseLang, translationHelp, extraOpts); const path = this.paths.videoTranslation; const vtransHeaders = await getSecYaHeaders("Vtrans", session, body, path); const res = await this.request(path, body, { @@ -5222,7 +5222,7 @@ class VOTClient { } return yandexProtobuf.decodeTranslationAudioResponse(res.data); } - async translateVideo({ videoData, requestLang = this.requestLang, responseLang = this.responseLang, translationHelp = null, headers = {}, }) { + async translateVideo({ videoData, requestLang = this.requestLang, responseLang = this.responseLang, translationHelp = null, headers = {}, extraOpts = {}, shouldSendFailedAudio = true, }) { const { url, videoId, host } = videoData; return this.isCustomLink(url) ? await this.translateVideoVOTImpl({ @@ -5239,6 +5239,8 @@ class VOTClient { responseLang, translationHelp, headers, + extraOpts, + shouldSendFailedAudio, }); } async getSubtitles({ videoData, requestLang = this.requestLang, headers = {}, }) { @@ -8988,6 +8990,9 @@ class VideoHandler { audioContext = initAudioContext(); hls = initHls(); // debug enabled only in dev mode + /** + * @type {import("vot.js").default} + */ votClient; /** @@ -9071,6 +9076,9 @@ class VideoHandler { requestLang, responseLang, translationHelp, + extraOpts: { + useNewModel: this.data?.useNewModel, + }, }); debug.log("Translate video result", res); if (res.translated && res.remainingTime < 1) { @@ -9229,7 +9237,6 @@ class VideoHandler { this.audioPlayer = new Chaimu({ video: this.video, debug: false, - // debug: true, fetchFn: GM_fetch, preferAudio, }); @@ -9280,6 +9287,7 @@ class VideoHandler { translateProxyEnabled: votStorage.get("translateProxyEnabled", 0), proxyWorkerHost: votStorage.get("proxyWorkerHost", proxyWorkerHost), audioBooster: votStorage.get("audioBooster", 0), + useNewModel: votStorage.get("useNewModel", 1), localeHash: votStorage.get("locale-hash", ""), localeUpdatedAt: votStorage.get("locale-updated-at", 0), }; @@ -9703,6 +9711,14 @@ class VideoHandler { this.votDownloadWithNameCheckbox.container, ); + this.votUseNewModelCheckbox = ui.createCheckbox( + localizationProvider.get("VOTUseNewModel"), + this.data?.useNewModel ?? false, + ); + this.votSettingsDialog.bodyContainer.appendChild( + this.votUseNewModelCheckbox.container, + ); + this.votTranslationServiceSelect = ui.createVOTSelect( this.data.translationService.toUpperCase(), localizationProvider.get("VOTTranslationService"), @@ -10097,8 +10113,9 @@ class VideoHandler { this.votVideoVolumeSlider.input.addEventListener("input", (e) => { const value = Number(e.target.value); - this.votVideoVolumeSlider.label.querySelector("strong").textContent = - `${value}%`; + this.votVideoVolumeSlider.label.querySelector( + "strong", + ).textContent = `${value}%`; this.setVideoVolume(value / 100); if (this.data.syncVolume) { this.syncVolumeWrapper("video", value); @@ -10269,6 +10286,18 @@ class VideoHandler { })(); }); + this.votUseNewModelCheckbox.input.addEventListener("change", (e) => { + (async () => { + this.data.useNewModel = Number(e.target.checked); + await votStorage.set("useNewModel", this.data.useNewModel); + debug.log( + "useNewModel value changed. New value: ", + this.data.useNewModel, + ); + this.stopTranslate(); + })(); + }); + this.votTranslationServiceSelect.labelElement.addEventListener( "change", (e) => { @@ -10945,8 +10974,9 @@ class VideoHandler { const newSlidersVolume = Math.round(videoVolume); this.votVideoVolumeSlider.input.value = newSlidersVolume; - this.votVideoVolumeSlider.label.querySelector("strong").textContent = - `${newSlidersVolume}%`; + this.votVideoVolumeSlider.label.querySelector( + "strong", + ).textContent = `${newSlidersVolume}%`; ui.updateSlider(this.votVideoVolumeSlider.input); if (this.data.syncVolume === 1) { @@ -11306,7 +11336,8 @@ class VideoHandler { t.videoId === VIDEO_ID && t.expires > utils_getTimestamp() && t.from === requestLang && - t.to === responseLang, + t.to === responseLang && + t.useNewModel === this.data.useNewModel, ); if (this.cachedTranslation) { @@ -11348,6 +11379,7 @@ class VideoHandler { to: responseLang, url: this.downloadTranslationUrl, expires: utils_getTimestamp() + this.videoTranslationTTL, + useNewModel: this.data?.useNewModel, }); } diff --git a/package-lock.json b/package-lock.json index df98729c..619a6668 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,14 +7,13 @@ "": { "name": "voice-over-translation", "version": "1.0.0", - "hasInstallScript": true, "license": "MIT", "dependencies": { "bowser": "^2.11.0", "chaimu": "^1.0.2", "lit": "^3.2.1", "requestidlecallback-polyfill": "^1.0.2", - "vot.js": "^1.3.9" + "vot.js": "^1.3.10" }, "devDependencies": { "@types/bun": "^1.1.13", @@ -5894,9 +5893,9 @@ } }, "node_modules/vot.js": { - "version": "1.3.9", - "resolved": "https://registry.npmjs.org/vot.js/-/vot.js-1.3.9.tgz", - "integrity": "sha512-65fuQf6bJUamcxzFgW8PjBmLcc2U/jabJ6unVafVZtu2fN1qibNEnQaqrNH9DwEHhb7UxyntNRAoM8R/KZUeUQ==", + "version": "1.3.10", + "resolved": "https://registry.npmjs.org/vot.js/-/vot.js-1.3.10.tgz", + "integrity": "sha512-7E7UYs22x7R0WUlhFJ4lwbajT/AyK5CV562X+Ar3dUZHQYLOYvFz3idNsXJQ8bklr1GQV/tDte8J46wdzcZ7/g==", "license": "MIT", "dependencies": { "dom-parser": "^1.1.5", diff --git a/package.json b/package.json index 6d0bdd13..e18472a6 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,6 @@ "chaimu": "^1.0.2", "lit": "^3.2.1", "requestidlecallback-polyfill": "^1.0.2", - "vot.js": "^1.3.9" + "vot.js": "^1.3.10" } } diff --git a/patches/vot.js+1.3.3+007+added-coursera.patch b/patches/vot.js+1.3.10+007+added-coursera.patch similarity index 98% rename from patches/vot.js+1.3.3+007+added-coursera.patch rename to patches/vot.js+1.3.10+007+added-coursera.patch index d2293f70..2136c9bd 100644 --- a/patches/vot.js+1.3.3+007+added-coursera.patch +++ b/patches/vot.js+1.3.10+007+added-coursera.patch @@ -1,8 +1,8 @@ diff --git a/node_modules/vot.js/dist/config/sites.js b/node_modules/vot.js/dist/config/sites.js -index 9c2d6a0..199665d 100644 +index c2db3cc..e7ffb83 100644 --- a/node_modules/vot.js/dist/config/sites.js +++ b/node_modules/vot.js/dist/config/sites.js -@@ -370,6 +370,14 @@ export default [ +@@ -371,6 +371,14 @@ export default [ 'div[data-purpose="curriculum-item-viewer-content"] > section > div > div > div > div:nth-of-type(2)', needExtraData: true, }, @@ -265,10 +265,10 @@ index 0000000..693da49 +export {} \ No newline at end of file diff --git a/node_modules/vot.js/dist/types/yandex.d.ts b/node_modules/vot.js/dist/types/yandex.d.ts -index 555b4ac..783def9 100644 +index 4715dab..6b4fd96 100644 --- a/node_modules/vot.js/dist/types/yandex.d.ts +++ b/node_modules/vot.js/dist/types/yandex.d.ts -@@ -60,6 +60,7 @@ export declare enum VideoService { +@@ -66,6 +66,7 @@ export declare enum VideoService { coursehunterLike = "coursehunterLike", sap = "sap", udemy = "udemy", @@ -277,7 +277,7 @@ index 555b4ac..783def9 100644 linkedin = "linkedin", ricktube = "ricktube", diff --git a/node_modules/vot.js/dist/types/yandex.js b/node_modules/vot.js/dist/types/yandex.js -index 520989c..963c358 100644 +index 3811fda..9bd062d 100644 --- a/node_modules/vot.js/dist/types/yandex.js +++ b/node_modules/vot.js/dist/types/yandex.js @@ -50,6 +50,7 @@ export var VideoService; diff --git a/src/index.js b/src/index.js index 973ff830..2a60e91f 100644 --- a/src/index.js +++ b/src/index.js @@ -102,6 +102,9 @@ class VideoHandler { audioContext = initAudioContext(); hls = initHls(); // debug enabled only in dev mode + /** + * @type {import("vot.js").default} + */ votClient; /** @@ -185,6 +188,9 @@ class VideoHandler { requestLang, responseLang, translationHelp, + extraOpts: { + useNewModel: this.data?.useNewModel, + }, }); debug.log("Translate video result", res); if (res.translated && res.remainingTime < 1) { @@ -343,7 +349,6 @@ class VideoHandler { this.audioPlayer = new Chaimu({ video: this.video, debug: DEBUG_MODE, - // debug: true, fetchFn: GM_fetch, preferAudio, }); @@ -394,6 +399,7 @@ class VideoHandler { translateProxyEnabled: votStorage.get("translateProxyEnabled", 0), proxyWorkerHost: votStorage.get("proxyWorkerHost", proxyWorkerHost), audioBooster: votStorage.get("audioBooster", 0), + useNewModel: votStorage.get("useNewModel", 1), localeHash: votStorage.get("locale-hash", ""), localeUpdatedAt: votStorage.get("locale-updated-at", 0), }; @@ -817,6 +823,14 @@ class VideoHandler { this.votDownloadWithNameCheckbox.container, ); + this.votUseNewModelCheckbox = ui.createCheckbox( + localizationProvider.get("VOTUseNewModel"), + this.data?.useNewModel ?? false, + ); + this.votSettingsDialog.bodyContainer.appendChild( + this.votUseNewModelCheckbox.container, + ); + this.votTranslationServiceSelect = ui.createVOTSelect( this.data.translationService.toUpperCase(), localizationProvider.get("VOTTranslationService"), @@ -1383,6 +1397,18 @@ class VideoHandler { })(); }); + this.votUseNewModelCheckbox.input.addEventListener("change", (e) => { + (async () => { + this.data.useNewModel = Number(e.target.checked); + await votStorage.set("useNewModel", this.data.useNewModel); + debug.log( + "useNewModel value changed. New value: ", + this.data.useNewModel, + ); + this.stopTranslate(); + })(); + }); + this.votTranslationServiceSelect.labelElement.addEventListener( "change", (e) => { @@ -2420,7 +2446,8 @@ class VideoHandler { t.videoId === VIDEO_ID && t.expires > getTimestamp() && t.from === requestLang && - t.to === responseLang, + t.to === responseLang && + t.useNewModel === this.data.useNewModel, ); if (this.cachedTranslation) { @@ -2462,6 +2489,7 @@ class VideoHandler { to: responseLang, url: this.downloadTranslationUrl, expires: getTimestamp() + this.videoTranslationTTL, + useNewModel: this.data?.useNewModel, }); } diff --git a/src/localization/hashes.json b/src/localization/hashes.json index 724ca4b0..cae0f09e 100644 --- a/src/localization/hashes.json +++ b/src/localization/hashes.json @@ -1,64 +1,64 @@ { - "af": "f68b5b8ec36f965a3c197cfc09c3a13e", - "am": "eb88f856ee2491f75a693588c9692149", - "ar": "208f24997d2d5fbfd3c60c8e339da119", - "az": "2e94b7c69d6afc35b5a27c65a3d1b99c", - "bg": "a3faf5b064d0210af56feae57a9e78c8", - "bn": "5c08f3177145632d0d6f9d1ac186fd68", - "bs": "369877867e0f353a440710e1ea357947", - "ca": "8143c3289562e81d382feed1faa36958", - "cs": "77baaa4ad7c7eb1110667d942fd82824", - "cy": "7eab9ff7991f4d9c59957f4415d134df", - "da": "e1a11e3dc644c7398467ce12783db3aa", - "de": "fc36180e2724f551a6965a58733b1431", - "el": "fa00dadb12dd90c5fe997c253e11ad8e", - "en": "cb8faddc6e9caa588be88f0ac723a30f", - "es": "9f777e3f09f1f109749164f482f94ca9", - "et": "58a419847b94c5c7455507dab4b0bb45", - "eu": "b6d195853dfa82c950bd529ad7584109", - "fa": "cd4e1e22d2e29f0e0db35f730dc36c3a", - "fi": "ead261e9f83485f994155ac59e4a4643", - "fr": "be3cd9e0b1b1ed4e1462481cda6544a2", - "gl": "b8cfc3e9625ad09943465b35e11553a0", - "hi": "7ec63cb98bf45d1764c49bc31172cfa1", - "hr": "0fe81cdec287f0f8648b2edc0f286b47", - "hu": "e1354ba5a4517737828378969b17e74f", - "hy": "1695bd2ef449c08e6cd4876df258082d", - "id": "c238d74f6379ff0c1066c71db746dad9", - "it": "a104c012ecdf6ffec1c0ce628ce436b2", - "ja": "e356855d332cf5742b14a9ac5bc57ae3", - "jv": "df40695c20313e0763fb7fb204f17cca", - "kk": "c9e3e2b298b8e137b1deec789b13255d", - "km": "f06db5cfe04fb018adf16ec41764e63b", - "kn": "de95f27b205ec84c54065b06de52d0a5", - "ko": "8f9d1fa64bb12e10868702be2baff9cf", - "lo": "a7c32deff8ae06e6459ecad6dabf13df", - "mk": "a3e55dbd72c84a8e9f3a052673289613", - "ml": "03ab16b4dc431d4de84e62f7ef550522", - "mn": "deeb7ee450cca18993b49893bb762f29", - "ms": "f64290d0c75915cc11550e0921c964d6", - "mt": "8d8d1961b9a542001dfe9fd1c7f74c6d", - "my": "6c7031334ff269dd0ad54a7ad41a27f1", - "ne": "d89fe27ad6c9767160809078020cae62", - "nl": "0479ab00d4faf53c570f5a3ccadd781f", - "pa": "e3fceb0947044e422ccc1f92678efef9", - "pl": "a988ac7aed4a217fdb024dcb81c873f5", - "pt": "0b523c1c470371ff16e041bd866003fd", - "ro": "8529221a47f338e0b8b8574084ecc75d", - "ru": "367850d9c7512dba1c4162e873407644", - "si": "5d805bdb82bf96e2752352297953af0b", - "sk": "c5217324fd7f6b87c359ee212f14591d", - "sl": "3fa935809e0b08198f47b1bda7ae1fba", - "sq": "46272c2b87cd6503687bf6ec92f01e22", - "sr": "9a5da418351b9afa29f9532b6f28f265", - "su": "f0f5092ebc0c59b614f735b4c17eb02a", - "sv": "b9b54963b905b4fa626a81ba0debce4b", - "sw": "dd7390feac22bce31d29a4e4c705dc92", - "tr": "3065730d7b543a221233eba3752a7c26", - "uk": "bbd67113245959459d3e7622aab0f9fa", - "ur": "d1d832f228e9df54d17927be0dedcf84", - "uz": "87820f65ad870c833d79aa8471b675d5", - "vi": "69238396c6fc68d89c17a464e2b8692d", - "zh": "94aa400e570e5e57605877fca2d29d2f", - "zu": "f0b1b3cf72deda6069063bb5ffe7d21e" + "af": "176f19f0b2038bea3d3159a6f1d866bd", + "am": "066f31a83d146aca3e17c487b6ffc6a5", + "ar": "68c2d77ba42d6e804549dfc4b8ec1e90", + "az": "542541565c95e4f8a8cc1288296068b1", + "bg": "128647e19866a70b51bfa36e30ae6f6f", + "bn": "14fc407aa3f8ef87750b8b5eca58960f", + "bs": "f58db98f7b41761a356aa459a4c4a80a", + "ca": "868e5f00b493fc9d4450daa7c1e0b70e", + "cs": "6833ad71911054be1a70c3480794a0c9", + "cy": "3906ca1898fa34b5c19721c80994e925", + "da": "c711c55e3c963384fac37e8f919e0a15", + "de": "a824a8827e06bf6c681a343a199e8a2e", + "el": "39811497806efa7bae4f853328a6ac75", + "en": "8cdc589ac6f53baf84d0d6f9c47a3b9b", + "es": "d7b3e28d39b514a903c3acccbef749e8", + "et": "b401bb2d6d00c516dc13ccfebbda6273", + "eu": "382c4e6019abd4e2dad1705d7bc2ee66", + "fa": "55ceb979dc77c1e7a44f4e831c0f92ac", + "fi": "d45a421f441d3089b32273295884f41e", + "fr": "3e8989a66db1cee065dceaa034bc0f99", + "gl": "b7fa5ef4b5c0e67225ca7d4b867d8d2b", + "hi": "ad0547eec65bc0e3d622fb906af6d8ed", + "hr": "ac2282efa60423b1f106071f8cef628c", + "hu": "7b2ba673348911fce77fa0bb000926fa", + "hy": "022cf299450ae4930208c32747726423", + "id": "88f49a482bbf129816fa5d4038238080", + "it": "cfc50df8d9306ee7683f6ad292fbf29c", + "ja": "373af9c8abb87dd814e770fe2b8969d8", + "jv": "291e363370b90e24a86141943b6e3838", + "kk": "3df9e236760f43136fd3ed86fb18595f", + "km": "33c0151aa3b6ae8225f9ce8a46dae6f5", + "kn": "1397ce0bfb8e342552991c24be56b808", + "ko": "d1b3b465ce9ee5e8554fc29989ac1259", + "lo": "6985efa4bd84f309da1f41e9f27c94b9", + "mk": "6c99cbda472e569d61ed1de548a5c9be", + "ml": "8692a1466f9102a4c52ade0c9a04db71", + "mn": "d4e94c0a94b288592ac416bc5145687c", + "ms": "90883f18604cf032671b82c710f2c125", + "mt": "9d07ff0407e72e381cf66c7d9371004e", + "my": "a0ce9421d24c283788d39c26a1415c33", + "ne": "8061c09e6124f1d7c14ed512a67b01fe", + "nl": "b27dcee35b32fc2ff14993a297dd25eb", + "pa": "ba9f8eff2583dd774e804826e4e18a76", + "pl": "7bd575cd344731531888f634494958ba", + "pt": "ae06b757cfbf379af0ab4a2ceef843c7", + "ro": "c9ebb058d42d25ad0f5640725b1a2ec4", + "ru": "4b567130c05f68cfeec63628992f6a38", + "si": "c2d53ad5fce583e7b3664b7685fbae18", + "sk": "13e4c841932df3dd186fad99d4646cad", + "sl": "da6bae3da2aee1933caff7d50fd37f50", + "sq": "767885d62d64458cb53f9eaa79b0e0b5", + "sr": "111ffbab9d848a3140f2f8baf57ae061", + "su": "240a58abcb019ef9b91bfacc16108f38", + "sv": "4e655546560328a95cf3712be5e86348", + "sw": "5ca3bee3dac025beb9772c31e60964cd", + "tr": "01a06cb67264ea2bdc6125f685a6815e", + "uk": "9bb17b1cd9c24d589f25f638e132c854", + "ur": "f75cfb34e442595900e487d42f06f3bd", + "uz": "49803eb7f30e28188e7deb3e40ec2db2", + "vi": "412ea327fbf3743a4b87ebaf42fdaa02", + "zh": "4ed9f2f7692583bc1ff33677311a4549", + "zu": "44a34145d8d652d0bd87501de3bf27a4" } diff --git a/src/localization/locales/af.json b/src/localization/locales/af.json index 2f9fd043..79552959 100644 --- a/src/localization/locales/af.json +++ b/src/localization/locales/af.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "Om dit te aktiveer, moet jy'n Web Audio API", "VOTMediaCSPEnabledOnSite": "MEDIA CSP is geaktiveer op hierdie webwerf", "VOTOnlyBypassMediaCSP": "Gebruik dit slegs vir omseil Media CSP", - "VOTNewAudioPlayer": "Gebruik die nuwe oudiospeler" + "VOTNewAudioPlayer": "Gebruik die nuwe oudiospeler", + "VOTUseNewModel": "Gebruik'n eksperimentele variasie Van Yandex-stemme vir sommige video's" } diff --git a/src/localization/locales/am.json b/src/localization/locales/am.json index 463f8229..e49a00b1 100644 --- a/src/localization/locales/am.json +++ b/src/localization/locales/am.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "ይህንን ለማስቻል, አንድ የድር ኦዲዮ ኤፒአይ ሊኖርዎት ይገባል", "VOTMediaCSPEnabledOnSite": "በዚህ ድረ ገጽ ላይ የፒ", "VOTOnlyBypassMediaCSP": "የሚዲያ ሲ ኤስ ፒ ለማለፍ ብቻ ይጠቀሙ", - "VOTNewAudioPlayer": "አዲሱን የድምፅ ማጫወቻ ይጠቀሙ" + "VOTNewAudioPlayer": "አዲሱን የድምፅ ማጫወቻ ይጠቀሙ", + "VOTUseNewModel": "ለአንዳንድ ቪዲዮዎች የ Yandex ድምፆች የሙከራ ልዩነት ይጠቀሙ" } diff --git a/src/localization/locales/ar.json b/src/localization/locales/ar.json index be37e4a5..ea50322b 100644 --- a/src/localization/locales/ar.json +++ b/src/localization/locales/ar.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "لتمكين هذا ، يجب أن يكون لديك واجهة برمجة تطبيقات صوت الويب", "VOTMediaCSPEnabledOnSite": "يتم تمكين الطاقة الشمسية المركزة وسائل الإعلام على هذا الموقع", "VOTOnlyBypassMediaCSP": "استخدامه فقط لتجاوز وسائل الإعلام سب", - "VOTNewAudioPlayer": "استخدم مشغل الصوت الجديد" + "VOTNewAudioPlayer": "استخدم مشغل الصوت الجديد", + "VOTUseNewModel": "استخدم تباينا تجريبيا لأصوات ياندكس لبعض مقاطع الفيديو" } diff --git a/src/localization/locales/az.json b/src/localization/locales/az.json index bec86a10..0d937b66 100644 --- a/src/localization/locales/az.json +++ b/src/localization/locales/az.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "Bunu aktivləşdirmək üçün veb Audio API olmalıdır", "VOTMediaCSPEnabledOnSite": "Media CSP bu saytda aktivdir", "VOTOnlyBypassMediaCSP": "Yalnız Media CSP-ni keçmək üçün istifadə edin", - "VOTNewAudioPlayer": "Yeni audio pleyerdən istifadə edin" + "VOTNewAudioPlayer": "Yeni audio pleyerdən istifadə edin", + "VOTUseNewModel": "Bəzi videolar üçün Yandex voices-in eksperimental versiyasından istifadə edin" } diff --git a/src/localization/locales/bg.json b/src/localization/locales/bg.json index fefdc5ae..5774765c 100644 --- a/src/localization/locales/bg.json +++ b/src/localization/locales/bg.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "За да разрешите това, трябва да имате уеб аудио интерфейс", "VOTMediaCSPEnabledOnSite": "Медиа ДУСП е активирана на този сайт", "VOTOnlyBypassMediaCSP": "Използвайте го само за заобикаляне на медийния ДУУ", - "VOTNewAudioPlayer": "Използвайте новия аудио плейър" + "VOTNewAudioPlayer": "Използвайте новия аудио плейър", + "VOTUseNewModel": "Използвайте експериментална вариация на Яндекс гласове за някои видеоклипове" } diff --git a/src/localization/locales/bn.json b/src/localization/locales/bn.json index b5be8ca4..cabe6326 100644 --- a/src/localization/locales/bn.json +++ b/src/localization/locales/bn.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "এটি সক্ষম করতে আপনার অবশ্যই একটি ওয়েব অডিও এপিআই থাকতে হবে", "VOTMediaCSPEnabledOnSite": "এই সাইটে মিডিয়া সিএসপি সক্ষম করা হয়েছে", "VOTOnlyBypassMediaCSP": "মিডিয়া সিএসপি বাইপাস করার জন্য এটি ব্যবহার করুন", - "VOTNewAudioPlayer": "নতুন অডিও প্লেয়ার ব্যবহার করুন" + "VOTNewAudioPlayer": "নতুন অডিও প্লেয়ার ব্যবহার করুন", + "VOTUseNewModel": "কিছু ভিডিওর জন্য ইয়ানডেক্স ভয়েসের একটি পরীক্ষামূলক বৈচিত্র ব্যবহার করুন" } diff --git a/src/localization/locales/bs.json b/src/localization/locales/bs.json index a932bc1c..105eecef 100644 --- a/src/localization/locales/bs.json +++ b/src/localization/locales/bs.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "Da biste to omogućili, morate imati Web Audio API", "VOTMediaCSPEnabledOnSite": "Media CSP je omogućen na ovom sajtu", "VOTOnlyBypassMediaCSP": "Koristi ga samo za zaobilaženje medija CSP", - "VOTNewAudioPlayer": "Koristi novi audio player" + "VOTNewAudioPlayer": "Koristi novi audio player", + "VOTUseNewModel": "Upotrijebite eksperimentalnu varijaciju Yandex glasova za neke videozapise" } diff --git a/src/localization/locales/ca.json b/src/localization/locales/ca.json index 832914fa..a6a1ad24 100644 --- a/src/localization/locales/ca.json +++ b/src/localization/locales/ca.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "Per activar-ho, heu de tenir UNA API D'Àudio", "VOTMediaCSPEnabledOnSite": "Media CSP està habilitat en aquest lloc", "VOTOnlyBypassMediaCSP": "Utilitzeu lo només per evitar Els Mitjans Csp", - "VOTNewAudioPlayer": "Utilitzeu el nou reproductor d'àudio" + "VOTNewAudioPlayer": "Utilitzeu el nou reproductor d'àudio", + "VOTUseNewModel": "Utilitzeu una variació experimental De veus De Yandex per a alguns vídeos" } diff --git a/src/localization/locales/cs.json b/src/localization/locales/cs.json index e45a2827..d8b0479a 100644 --- a/src/localization/locales/cs.json +++ b/src/localization/locales/cs.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "Chcete-li to povolit, musíte mít webové Audio API", "VOTMediaCSPEnabledOnSite": "Media CSP je povoleno na tomto webu", "VOTOnlyBypassMediaCSP": "Použijte jej pouze pro obcházení médií CSP", - "VOTNewAudioPlayer": "Použijte nový audio přehrávač" + "VOTNewAudioPlayer": "Použijte nový audio přehrávač", + "VOTUseNewModel": "U některých videí použijte experimentální variantu hlasů Yandex" } diff --git a/src/localization/locales/cy.json b/src/localization/locales/cy.json index bd5d703d..35ae7da9 100644 --- a/src/localization/locales/cy.json +++ b/src/localization/locales/cy.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "I alluogi HYN, rhaid bod GENNYCH API Sain Gwe", "VOTMediaCSPEnabledOnSite": "Mae csp cyfryngau wedi'i alluogi ar y wefan hon", "VOTOnlyBypassMediaCSP": "Defnyddiwch ef yn unig ar gyfer osgoi Cyfryngau CSP", - "VOTNewAudioPlayer": "Defnyddio'r chwaraewr sain newydd" + "VOTNewAudioPlayer": "Defnyddio'r chwaraewr sain newydd", + "VOTUseNewModel": "Defnyddiwch amrywiad arbrofol o leisiau Yandex ar gyfer rhai fideos" } diff --git a/src/localization/locales/da.json b/src/localization/locales/da.json index b3e368b6..142b199b 100644 --- a/src/localization/locales/da.json +++ b/src/localization/locales/da.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "For at aktivere dette skal du have en Internet Audio API", "VOTMediaCSPEnabledOnSite": "Media CSP er aktiveret på dette site", "VOTOnlyBypassMediaCSP": "Brug den kun til at omgå Media CSP", - "VOTNewAudioPlayer": "Brug den nye lydafspiller" + "VOTNewAudioPlayer": "Brug den nye lydafspiller", + "VOTUseNewModel": "Brug en eksperimentel variation af Yandeks stemmer til nogle videoer" } diff --git a/src/localization/locales/de.json b/src/localization/locales/de.json index 0a0541bb..b141bdcd 100644 --- a/src/localization/locales/de.json +++ b/src/localization/locales/de.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "Um dies zu aktivieren, benötigen Sie eine Web-Audio-API", "VOTMediaCSPEnabledOnSite": "Medien-CSP ist auf dieser Site aktiviert", "VOTOnlyBypassMediaCSP": "Verwenden Sie es nur zum Umgehen von Medien-CSP", - "VOTNewAudioPlayer": "Verwenden Sie den neuen Audioplayer" + "VOTNewAudioPlayer": "Verwenden Sie den neuen Audioplayer", + "VOTUseNewModel": "Verwenden Sie für einige Videos eine experimentelle Variante von Yandex-Stimmen" } diff --git a/src/localization/locales/el.json b/src/localization/locales/el.json index 55b7af58..e8454504 100644 --- a/src/localization/locales/el.json +++ b/src/localization/locales/el.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "Για να το ενεργοποιήσετε, πρέπει να έχετε ένα API Web Audio", "VOTMediaCSPEnabledOnSite": "Το Media CSP είναι ενεργοποιημένο σε αυτόν τον ιστότοπο", "VOTOnlyBypassMediaCSP": "Χρησιμοποιήστε το μόνο για παράκαμψη CSP πολυμέσων", - "VOTNewAudioPlayer": "Χρησιμοποιήστε τη νέα συσκευή αναπαραγωγής ήχου" + "VOTNewAudioPlayer": "Χρησιμοποιήστε τη νέα συσκευή αναπαραγωγής ήχου", + "VOTUseNewModel": "Χρησιμοποιήστε μια πειραματική παραλλαγή των φωνών Yandex για ορισμένα βίντεο" } diff --git a/src/localization/locales/en.json b/src/localization/locales/en.json index 1901285e..a5e4c896 100644 --- a/src/localization/locales/en.json +++ b/src/localization/locales/en.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "To enable this, you must have a Web Audio API", "VOTMediaCSPEnabledOnSite": "Media CSP is enabled on this site", "VOTOnlyBypassMediaCSP": "Use it only for bypassing Media CSP", - "VOTNewAudioPlayer": "Use the new audio player" + "VOTNewAudioPlayer": "Use the new audio player", + "VOTUseNewModel": "Use an experimental variation of Yandex voices for some videos" } diff --git a/src/localization/locales/es.json b/src/localization/locales/es.json index 5250bd89..42e096ce 100644 --- a/src/localization/locales/es.json +++ b/src/localization/locales/es.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "Para habilitar esto, debe tener una API de audio web", "VOTMediaCSPEnabledOnSite": "Media CSP está habilitado en este sitio", "VOTOnlyBypassMediaCSP": "Úselo solo para omitir CSP de medios", - "VOTNewAudioPlayer": "Usa el nuevo reproductor de audio" + "VOTNewAudioPlayer": "Usa el nuevo reproductor de audio", + "VOTUseNewModel": "Usa una variación experimental de las voces de Yandex para algunos videos" } diff --git a/src/localization/locales/et.json b/src/localization/locales/et.json index ac41d731..dc3de455 100644 --- a/src/localization/locales/et.json +++ b/src/localization/locales/et.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "Selle lubamiseks peab teil olema Veebiheli API", "VOTMediaCSPEnabledOnSite": "Meedia CSP on lubatud sellel saidil", "VOTOnlyBypassMediaCSP": "Kasutage seda ainult mööda meedia CSP", - "VOTNewAudioPlayer": "Kasutage uut helipleierit" + "VOTNewAudioPlayer": "Kasutage uut helipleierit", + "VOTUseNewModel": "Mõne video jaoks kasutage Yandexi häälte eksperimentaalset variatsiooni" } diff --git a/src/localization/locales/eu.json b/src/localization/locales/eu.json index de5e6377..da5fc651 100644 --- a/src/localization/locales/eu.json +++ b/src/localization/locales/eu.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "Hau gaitzeko, Audio API Bat Eduki Behar duzu", "VOTMediaCSPEnabledOnSite": "Multimedia KSP gune honetan gaituta dago", "VOTOnlyBypassMediaCSP": "Erabili Media ksp saihesteko bakarrik", - "VOTNewAudioPlayer": "Erabili audio-erreproduzitzaile berria" + "VOTNewAudioPlayer": "Erabili audio-erreproduzitzaile berria", + "VOTUseNewModel": "Erabili Yandex ahotsen aldaera esperimentala bideo batzuetarako" } diff --git a/src/localization/locales/fa.json b/src/localization/locales/fa.json index 4f84320f..d2892269 100644 --- a/src/localization/locales/fa.json +++ b/src/localization/locales/fa.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "برای فعال کردن این ، شما باید یک API صوتی وب داشته باشید", "VOTMediaCSPEnabledOnSite": "Media CSP در این سایت فعال شده است", "VOTOnlyBypassMediaCSP": "از آن فقط برای دور زدن Csp رسانه استفاده کنید", - "VOTNewAudioPlayer": "از پخش کننده صوتی جدید استفاده کنید" + "VOTNewAudioPlayer": "از پخش کننده صوتی جدید استفاده کنید", + "VOTUseNewModel": "برای برخی از فیلم ها از یک تغییر تجربی از صداهای Yandex استفاده کنید" } diff --git a/src/localization/locales/fi.json b/src/localization/locales/fi.json index 2e272af3..32aacaf5 100644 --- a/src/localization/locales/fi.json +++ b/src/localization/locales/fi.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "Jotta voit ottaa tämän käyttöön, sinulla on oltava Web Audio API", "VOTMediaCSPEnabledOnSite": "Media CSP on käytössä tällä sivustolla", "VOTOnlyBypassMediaCSP": "Käytä sitä vain Media CSP: n ohittamiseen", - "VOTNewAudioPlayer": "Käytä uutta soittinta" + "VOTNewAudioPlayer": "Käytä uutta soittinta", + "VOTUseNewModel": "Käytä kokeellista muunnelmaa Yandex-äänistä joissakin videoissa" } diff --git a/src/localization/locales/fr.json b/src/localization/locales/fr.json index 713fb465..a8b392cc 100644 --- a/src/localization/locales/fr.json +++ b/src/localization/locales/fr.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "Pour activer cela, vous devez disposer d'une API audio Web", "VOTMediaCSPEnabledOnSite": "Media CSP est activé sur ce site", "VOTOnlyBypassMediaCSP": "Utilisez - le uniquement pour contourner le CSP multimédia", - "VOTNewAudioPlayer": "Utilisez le nouveau lecteur audio" + "VOTNewAudioPlayer": "Utilisez le nouveau lecteur audio", + "VOTUseNewModel": "Utilisez une variante expérimentale des voix Yandex pour certaines vidéos" } diff --git a/src/localization/locales/gl.json b/src/localization/locales/gl.json index 5a2930fc..e3b4b7d8 100644 --- a/src/localization/locales/gl.json +++ b/src/localization/locales/gl.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "Para activar isto, debes ter UNHA API De Audio Web", "VOTMediaCSPEnabledOnSite": "Os medios de COMUNICACIÓN csp están habilitados neste sitio", "VOTOnlyBypassMediaCSP": "Usalo só para evitar A MEDIA CSP", - "VOTNewAudioPlayer": "Use o novo reproductor de audio" + "VOTNewAudioPlayer": "Use o novo reproductor de audio", + "VOTUseNewModel": "Use unha variación experimental De voces De Yandex para algúns vídeos" } diff --git a/src/localization/locales/hi.json b/src/localization/locales/hi.json index 7dfb6bfb..3d2e866a 100644 --- a/src/localization/locales/hi.json +++ b/src/localization/locales/hi.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "इसे सक्षम करने के लिए, आपके पास एक वेब ऑडियो एपीआई होना चाहिए", "VOTMediaCSPEnabledOnSite": "मीडिया सीएसपी इस साइट पर सक्षम है", "VOTOnlyBypassMediaCSP": "इसका उपयोग केवल मीडिया सीएसपी को दरकिनार करने के लिए करें", - "VOTNewAudioPlayer": "नए ऑडियो प्लेयर का उपयोग करें" + "VOTNewAudioPlayer": "नए ऑडियो प्लेयर का उपयोग करें", + "VOTUseNewModel": "कुछ वीडियो के लिए यांडेक्स आवाजों की प्रयोगात्मक भिन्नता का उपयोग करें" } diff --git a/src/localization/locales/hr.json b/src/localization/locales/hr.json index 189d4b28..dda1dd55 100644 --- a/src/localization/locales/hr.json +++ b/src/localization/locales/hr.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "Da biste to omogućili, morate imati", "VOTMediaCSPEnabledOnSite": "Na ovoj je stranici omogućen", "VOTOnlyBypassMediaCSP": "Koristite ga samo za zaobilaženje", - "VOTNewAudioPlayer": "Koristite novi audio uređaj" + "VOTNewAudioPlayer": "Koristite novi audio uređaj", + "VOTUseNewModel": "Koristite eksperimentalnu opciju za neke videozapise" } diff --git a/src/localization/locales/hu.json b/src/localization/locales/hu.json index aa339961..46df4906 100644 --- a/src/localization/locales/hu.json +++ b/src/localization/locales/hu.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "Ennek engedélyezéséhez rendelkeznie kell egy Web Audio API-val", "VOTMediaCSPEnabledOnSite": "A Media CSP engedélyezve van ezen a webhelyen", "VOTOnlyBypassMediaCSP": "Csak a Media CSP megkerülésére használja", - "VOTNewAudioPlayer": "Az új audiolejátszó használata" + "VOTNewAudioPlayer": "Az új audiolejátszó használata", + "VOTUseNewModel": "Használja a Yandex voices kísérleti változatát néhány videóhoz" } diff --git a/src/localization/locales/hy.json b/src/localization/locales/hy.json index 271157ee..1d0b1d25 100644 --- a/src/localization/locales/hy.json +++ b/src/localization/locales/hy.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "Սա միացնելու համար դուք պետք է ունենաք վեբ աուդիո API", "VOTMediaCSPEnabledOnSite": "Media CSP-ն միացված է այս կայքում", "VOTOnlyBypassMediaCSP": "Օգտագործեք այն միայն Media CSP-ն շրջանցելու համար", - "VOTNewAudioPlayer": "Օգտագործեք նոր աուդիո նվագարկիչ" + "VOTNewAudioPlayer": "Օգտագործեք նոր աուդիո նվագարկիչ", + "VOTUseNewModel": "Որոշ տեսանյութերի համար օգտագործեք Yandex voices-ի փորձնական տարբերակը" } diff --git a/src/localization/locales/id.json b/src/localization/locales/id.json index 3ad1a9b5..cf89fe3a 100644 --- a/src/localization/locales/id.json +++ b/src/localization/locales/id.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "Untuk mengaktifkan ini, Anda harus memiliki Web Audio API", "VOTMediaCSPEnabledOnSite": "Media CSP diaktifkan di situs ini", "VOTOnlyBypassMediaCSP": "Gunakan hanya untuk melewati Media CSP", - "VOTNewAudioPlayer": "Gunakan pemutar audio baru" + "VOTNewAudioPlayer": "Gunakan pemutar audio baru", + "VOTUseNewModel": "Gunakan variasi eksperimental suara Yandex untuk beberapa video" } diff --git a/src/localization/locales/it.json b/src/localization/locales/it.json index 416b512f..682cd652 100644 --- a/src/localization/locales/it.json +++ b/src/localization/locales/it.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "Per abilitare questo, è necessario disporre di un'API audio Web", "VOTMediaCSPEnabledOnSite": "Media CSP è abilitato su questo sito", "VOTOnlyBypassMediaCSP": "Usalo solo per bypassare i media CSP", - "VOTNewAudioPlayer": "Utilizzare il nuovo lettore audio" + "VOTNewAudioPlayer": "Utilizzare il nuovo lettore audio", + "VOTUseNewModel": "Utilizzare una variazione sperimentale di voci Yandex per alcuni video" } diff --git a/src/localization/locales/ja.json b/src/localization/locales/ja.json index 553910d6..b892402a 100644 --- a/src/localization/locales/ja.json +++ b/src/localization/locales/ja.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "これを有効にするには、Web Audio APIが必要です", "VOTMediaCSPEnabledOnSite": "メディアCSPはこのサイトで有効になっています", "VOTOnlyBypassMediaCSP": "メディアCSPをバイパスするためにのみ使用します", - "VOTNewAudioPlayer": "新しいオーディオプレーヤーを使用する" + "VOTNewAudioPlayer": "新しいオーディオプレーヤーを使用する", + "VOTUseNewModel": "いくつかのビデオのためのYandexの声の実験的なバリエーションを使用してください" } diff --git a/src/localization/locales/jv.json b/src/localization/locales/jv.json index ed719dff..94dccb40 100644 --- a/src/localization/locales/jv.json +++ b/src/localization/locales/jv.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "Kanggo ngaktifake IKI, SAMPEYAN kudu DUWE API Audio Web", "VOTMediaCSPEnabledOnSite": "Media CSP diaktifake ing situs iki", "VOTOnlyBypassMediaCSP": "Gunakna Mung Kanggo Ngliwati MEDIA CSP", - "VOTNewAudioPlayer": "Gunakake pamuter audio anyar" + "VOTNewAudioPlayer": "Gunakake pamuter audio anyar", + "VOTUseNewModel": "Gunakake variasi eksperimen Swara Yandex kanggo sawetara video" } diff --git a/src/localization/locales/kk.json b/src/localization/locales/kk.json index dc85cc92..1b214384 100644 --- a/src/localization/locales/kk.json +++ b/src/localization/locales/kk.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "Мұны қосу Үшін Сізде Web Audio API БОЛУЫ КЕРЕК", "VOTMediaCSPEnabledOnSite": "Бұл сайтта медиа CSP қосылған", "VOTOnlyBypassMediaCSP": "Оны Тек Csp Медиасын айналып өту үшін пайдаланыңыз", - "VOTNewAudioPlayer": "Жаңа аудио ойнатқышты пайдаланыңыз" + "VOTNewAudioPlayer": "Жаңа аудио ойнатқышты пайдаланыңыз", + "VOTUseNewModel": "Кейбір бейнелер Үшін яндекс дауыстарының эксперименттік нұсқасын пайдаланыңыз" } diff --git a/src/localization/locales/km.json b/src/localization/locales/km.json index 2636a800..c6cc9670 100644 --- a/src/localization/locales/km.json +++ b/src/localization/locales/km.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "ដើម្បីអនុញ្ញាតនេះ,អ្នកត្រូវតែមានបណ្តាញ Api របស់អូឌីយ៉ូ", "VOTMediaCSPEnabledOnSite": "ប្រព័ន្ធផ្សព្វផ្សាយ CSP ត្រូវបានបើកនៅលើតំបន់បណ្ដាញនេះ", "VOTOnlyBypassMediaCSP": "ប្រើវាសម្រាប់តែឆ្លងកាត់ប្រព័ន្ធផ្សព្វផ្សាយ CSP", - "VOTNewAudioPlayer": "ប្រើកម្មវិធីចាក់អូឌីយ៉ូថ្មី" + "VOTNewAudioPlayer": "ប្រើកម្មវិធីចាក់អូឌីយ៉ូថ្មី", + "VOTUseNewModel": "ប្រើបំរែបំរួលពិសោធន៍នៃសំឡេង Yandex សម្រាប់វីដេអូមួយចំនួន" } diff --git a/src/localization/locales/kn.json b/src/localization/locales/kn.json index 2e73f8a2..894fd4db 100644 --- a/src/localization/locales/kn.json +++ b/src/localization/locales/kn.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "ಇದನ್ನು ಸಕ್ರಿಯಗೊಳಿಸಲು, ನೀವು ವೆಬ್ ಆಡಿಯೊ API ಅನ್ನು ಹೊಂದಿರಬೇಕು", "VOTMediaCSPEnabledOnSite": "ಈ ಸೈಟ್ನಲ್ಲಿ ಮೀಡಿಯಾ CSP ಅನ್ನು ಸಕ್ರಿಯಗೊಳಿಸಲಾಗಿದೆ", "VOTOnlyBypassMediaCSP": "ಮಾಧ್ಯಮ ಸಿಎಸ್ಪಿ ಬೈಪಾಸ್ ಮಾಡಲು ಮಾತ್ರ ಇದನ್ನು ಬಳಸಿ", - "VOTNewAudioPlayer": "ಹೊಸ ಆಡಿಯೋ ಪ್ಲೇಯರ್ ಬಳಸಿ" + "VOTNewAudioPlayer": "ಹೊಸ ಆಡಿಯೋ ಪ್ಲೇಯರ್ ಬಳಸಿ", + "VOTUseNewModel": "ಕೆಲವು ವೀಡಿಯೊಗಳಿಗಾಗಿ ಯಾಂಡೆಕ್ಸ್ ಧ್ವನಿಗಳ ಪ್ರಾಯೋಗಿಕ ವ್ಯತ್ಯಾಸವನ್ನು ಬಳಸಿ" } diff --git a/src/localization/locales/ko.json b/src/localization/locales/ko.json index 699caf5e..6bb7ef6a 100644 --- a/src/localization/locales/ko.json +++ b/src/localization/locales/ko.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "이 기능을 사용하려면 웹 오디오가 있어야 합니다.", "VOTMediaCSPEnabledOnSite": "이 사이트에서 사용할 수 있습니다", "VOTOnlyBypassMediaCSP": "미디어 우회 용으로만 사용", - "VOTNewAudioPlayer": "새 오디오 플레이어 사용" + "VOTNewAudioPlayer": "새 오디오 플레이어 사용", + "VOTUseNewModel": "일부 동영상에는 얀덱스 목소리의 실험적 변형을 사용합니다" } diff --git a/src/localization/locales/lo.json b/src/localization/locales/lo.json index 22c6e266..37a164cf 100644 --- a/src/localization/locales/lo.json +++ b/src/localization/locales/lo.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "ເພື່ອເປີດໃຊ້ສິ່ງນີ້,ທ່ານຕ້ອງມີ Web Audio API", "VOTMediaCSPEnabledOnSite": "Media CSP ຖືກເປີດໃຊ້ໃນເວັບໄຊທ໌ນີ້", "VOTOnlyBypassMediaCSP": "ໃຊ້ມັນພຽງແຕ່ສໍາລັບການ bypassing ສື່ CSP", - "VOTNewAudioPlayer": "ໃຊ້ເຄື່ອງຫຼີ້ນສຽງໃໝ່" + "VOTNewAudioPlayer": "ໃຊ້ເຄື່ອງຫຼີ້ນສຽງໃໝ່", + "VOTUseNewModel": "ໃຊ້ການປ່ຽນແປງການທົດລອງຂອງ yandex voices ສໍາລັບບາງວິດີໂອ" } diff --git a/src/localization/locales/mk.json b/src/localization/locales/mk.json index 2c0689bb..879671fa 100644 --- a/src/localization/locales/mk.json +++ b/src/localization/locales/mk.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "За да го овозможите ОВА, мора да имате ВЕБ АУДИО АПИ", "VOTMediaCSPEnabledOnSite": "Медиумите CSP се овозможени на оваа страница", "VOTOnlyBypassMediaCSP": "Користете го само За Заобиколување На МЕДИУМИТЕ ЦСП", - "VOTNewAudioPlayer": "Користете го новиот аудио плеер" + "VOTNewAudioPlayer": "Користете го новиот аудио плеер", + "VOTUseNewModel": "Користете експериментална варијација На гласови На Јандекс за некои видеа" } diff --git a/src/localization/locales/ml.json b/src/localization/locales/ml.json index cb43617e..0bca5d1e 100644 --- a/src/localization/locales/ml.json +++ b/src/localization/locales/ml.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "ഇത് ചെയ്യുന്നതിന്, നിങ്ങൾക്ക് ഒരു വെബ് ഓഡിയോ എപിഐ ഉണ്ടായിരിക്കണം.", "VOTMediaCSPEnabledOnSite": "മീഡിയ സിഎസ്പി ഈ സൈറ്റിൽ പ്രാപ്തമാക്കിയിരിക്കുന്നു", "VOTOnlyBypassMediaCSP": "മീഡിയ സി. എസ്. പിയെ മറികടക്കാന് മാത്രം ഉപയോഗിക്കുക", - "VOTNewAudioPlayer": "പുതിയ ഓഡിയോ പ്ലെയർ ഉപയോഗിക്കുക" + "VOTNewAudioPlayer": "പുതിയ ഓഡിയോ പ്ലെയർ ഉപയോഗിക്കുക", + "VOTUseNewModel": "ചില വീഡിയോകൾക്കായി യാൻഡെക്സ് ശബ്ദങ്ങളുടെ ഒരു പരീക്ഷണാത്മക വ്യതിയാനം ഉപയോഗിക്കുക" } diff --git a/src/localization/locales/mn.json b/src/localization/locales/mn.json index 024eb78e..22f1c1dc 100644 --- a/src/localization/locales/mn.json +++ b/src/localization/locales/mn.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "Үүнийг идэвхжүүлэхийн тулд та вэб аудио API-тэй байх естой", "VOTMediaCSPEnabledOnSite": "Хэвлэл мэдээллийн CSP энэ сайт дээр идэвхжүүлсэн байна", "VOTOnlyBypassMediaCSP": "Зөвхөн хэвлэл мэдээллийн ОНХХ алгасан үүнийг ашиглах", - "VOTNewAudioPlayer": "Шинэ аудио тоглуулагч ашиглах" + "VOTNewAudioPlayer": "Шинэ аудио тоглуулагч ашиглах", + "VOTUseNewModel": "Зарим видеонуудад Yandex-ийн дуу хоолойны туршилтын хувилбарыг ашиглана уу" } diff --git a/src/localization/locales/ms.json b/src/localization/locales/ms.json index 976b378b..577b93e4 100644 --- a/src/localization/locales/ms.json +++ b/src/localization/locales/ms.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "Untuk membolehkan ini, anda mesti mempunyai API Audio web", "VOTMediaCSPEnabledOnSite": "Media CSP diaktifkan di laman web ini", "VOTOnlyBypassMediaCSP": "Gunakan ia hanya untuk memintas media CSP", - "VOTNewAudioPlayer": "Gunakan pemain audio baru" + "VOTNewAudioPlayer": "Gunakan pemain audio baru", + "VOTUseNewModel": "Gunakan variasi percubaan suara Yandex untuk beberapa video" } diff --git a/src/localization/locales/mt.json b/src/localization/locales/mt.json index b25a0708..80999fc0 100644 --- a/src/localization/locales/mt.json +++ b/src/localization/locales/mt.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "Biex tippermetti dan, irid ikollok Api Awdjo Tal - Web", "VOTMediaCSPEnabledOnSite": "Il-PSK tal-midja huwa attivat fuq dan is-sit", "VOTOnlyBypassMediaCSP": "Użaha biss Biex tevita L-PSK Tal-Midja", - "VOTNewAudioPlayer": "Uża l-plejer tal-awdjo l-ġdid" + "VOTNewAudioPlayer": "Uża l-plejer tal-awdjo l-ġdid", + "VOTUseNewModel": "Uża varjazzjoni sperimentali ta'vuċijiet Yandex għal xi vidjows" } diff --git a/src/localization/locales/my.json b/src/localization/locales/my.json index 331b97a5..1fe5e336 100644 --- a/src/localization/locales/my.json +++ b/src/localization/locales/my.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "ဒါကိုဖွင့်ဖို့ Web Audio API တစ်ခုရှိရပါမယ်။", "VOTMediaCSPEnabledOnSite": "ဤဆိုက်တွင်မီဒီယာ CSP ကိုခွင့်ပြုထားသည်။", "VOTOnlyBypassMediaCSP": "မီဒီယာ CSP ကိုရှောင်လွှဲဖို့ပဲသုံးပါ။", - "VOTNewAudioPlayer": "အသံဖွင့်စက်အသစ်ကိုအသုံးပြုပါ" + "VOTNewAudioPlayer": "အသံဖွင့်စက်အသစ်ကိုအသုံးပြုပါ", + "VOTUseNewModel": "ဗီဒီယိုအချို့အတွက် Yandex အသံများ၏စမ်းသပ်ပြောင်းလဲမှုတစ်ခုကိုအသုံးပြုပါ။" } diff --git a/src/localization/locales/ne.json b/src/localization/locales/ne.json index 11b4d402..5e6bf20f 100644 --- a/src/localization/locales/ne.json +++ b/src/localization/locales/ne.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "यो सक्षम गर्न, तपाईं एक वेब अडियो एपीआई हुनुपर्छ", "VOTMediaCSPEnabledOnSite": "यस साइटमा मिडिया सीएसपी सक्षम छ", "VOTOnlyBypassMediaCSP": "यसलाई केवल मिडिया सीएसपीलाई बाइपास गर्नका लागि प्रयोग गर्नुहोस्", - "VOTNewAudioPlayer": "नयाँ अडियो प्लेयर प्रयोग गर्नुहोस्" + "VOTNewAudioPlayer": "नयाँ अडियो प्लेयर प्रयोग गर्नुहोस्", + "VOTUseNewModel": "केही भिडियोहरूको लागि यान्डेक्स आवाजहरूको प्रयोगात्मक भिन्नता प्रयोग गर्नुहोस्" } diff --git a/src/localization/locales/nl.json b/src/localization/locales/nl.json index 89cf2103..57a85bed 100644 --- a/src/localization/locales/nl.json +++ b/src/localization/locales/nl.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "Om dit in te schakelen, moet u een Web Audio API hebben", "VOTMediaCSPEnabledOnSite": "Media CSP is ingeschakeld op deze site", "VOTOnlyBypassMediaCSP": "Gebruik het alleen voor het omzeilen van Media CSP", - "VOTNewAudioPlayer": "De nieuwe audiospeler gebruiken" + "VOTNewAudioPlayer": "De nieuwe audiospeler gebruiken", + "VOTUseNewModel": "Gebruik een experimentele variant van Yandex voices voor sommige video ' s" } diff --git a/src/localization/locales/pa.json b/src/localization/locales/pa.json index a73ddd4f..efb2bff3 100644 --- a/src/localization/locales/pa.json +++ b/src/localization/locales/pa.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "ਇਸ ਨੂੰ ਯੋਗ ਕਰਨ ਲਈ, ਤੁਹਾਡੇ ਕੋਲ ਇੱਕ ਵੈਬ ਆਡੀਓ ਏਪੀਆਈ ਹੋਣਾ ਚਾਹੀਦਾ ਹੈ", "VOTMediaCSPEnabledOnSite": "ਮੀਡੀਆ ਸੀਐਸਪੀ ਇਸ ਸਾਈਟ ਤੇ ਸਮਰੱਥ ਹੈ", "VOTOnlyBypassMediaCSP": "ਇਸ ਨੂੰ ਸਿਰਫ ਮੀਡੀਆ ਸੀਐਸਪੀ ਨੂੰ ਬਾਈਪਾਸ ਕਰਨ ਲਈ ਵਰਤੋ", - "VOTNewAudioPlayer": "ਨਵਾਂ ਆਡੀਓ ਪਲੇਅਰ ਵਰਤੋਂ" + "VOTNewAudioPlayer": "ਨਵਾਂ ਆਡੀਓ ਪਲੇਅਰ ਵਰਤੋਂ", + "VOTUseNewModel": "ਕੁਝ ਵੀਡੀਓਜ਼ ਲਈ ਯਾਂਡੇਕਸ ਆਵਾਜ਼ਾਂ ਦੀ ਪ੍ਰਯੋਗਾਤਮਕ ਪਰਿਵਰਤਨ ਦੀ ਵਰਤੋਂ ਕਰੋ" } diff --git a/src/localization/locales/pl.json b/src/localization/locales/pl.json index 5a4a8da1..eeb716bc 100644 --- a/src/localization/locales/pl.json +++ b/src/localization/locales/pl.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "Aby to włączyć, musisz mieć Web Audio API", "VOTMediaCSPEnabledOnSite": "Media CSP jest włączony na tej stronie", "VOTOnlyBypassMediaCSP": "Używaj go tylko do omijania mediów CSP", - "VOTNewAudioPlayer": "Użyj nowego odtwarzacza audio" + "VOTNewAudioPlayer": "Użyj nowego odtwarzacza audio", + "VOTUseNewModel": "Użyj eksperymentalnej odmiany głosów Yandex dla niektórych filmów" } diff --git a/src/localization/locales/pt.json b/src/localization/locales/pt.json index 844f2e0e..9fbce6f1 100644 --- a/src/localization/locales/pt.json +++ b/src/localization/locales/pt.json @@ -202,5 +202,6 @@ "VOTNeedWebAudioAPI": "Para habilitar isso, você deve ter uma API de áudio da Web", "VOTMediaCSPEnabledOnSite": "O Media CSP está ativado neste site", "VOTOnlyBypassMediaCSP": "Use-o apenas para ignorar o CSP de mídia", - "VOTNewAudioPlayer": "Utilizar o novo leitor de áudio" + "VOTNewAudioPlayer": "Utilizar o novo leitor de áudio", + "VOTUseNewModel": "Use uma variação experimental de vozes Yandex para alguns vídeos" } diff --git a/src/localization/locales/ro.json b/src/localization/locales/ro.json index ff61652c..cb7214d0 100644 --- a/src/localization/locales/ro.json +++ b/src/localization/locales/ro.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "Pentru a activa acest lucru, trebuie să aveți un API Audio Web", "VOTMediaCSPEnabledOnSite": "Media CSP este activat pe acest site", "VOTOnlyBypassMediaCSP": "Utilizați-l numai pentru ocolirea CSP Media", - "VOTNewAudioPlayer": "Utilizați noul player audio" + "VOTNewAudioPlayer": "Utilizați noul player audio", + "VOTUseNewModel": "Utilizați o variantă experimentală a vocilor Yandex pentru unele videoclipuri" } diff --git a/src/localization/locales/ru.json b/src/localization/locales/ru.json index c67c0747..f88058cd 100644 --- a/src/localization/locales/ru.json +++ b/src/localization/locales/ru.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "Чтобы включить это, у вас должен быть Web Audio API", "VOTMediaCSPEnabledOnSite": "На этом сайте включен Media CSP", "VOTOnlyBypassMediaCSP": "Использовать только для обхода Media CSP", - "VOTNewAudioPlayer": "Использовать новый аудиоплеер" + "VOTNewAudioPlayer": "Использовать новый аудиоплеер", + "VOTUseNewModel": "Использовать экспериментальный вариант голосов Yandex для некоторых видеороликов" } diff --git a/src/localization/locales/si.json b/src/localization/locales/si.json index 4a9b4585..fd801a90 100644 --- a/src/localization/locales/si.json +++ b/src/localization/locales/si.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "මෙය සක් රීය කිරීම සඳහා, ඔබට වෙබ් ශ් රව් ය API එකක් තිබිය යුතුය", "VOTMediaCSPEnabledOnSite": "මෙම වෙබ් අඩවියේ csp මාධ් ය සක් රීය කර ඇත", "VOTOnlyBypassMediaCSP": "මාධ්ය CSP මඟ හැරීම සඳහා පමණක් එය භාවිතා කරන්න", - "VOTNewAudioPlayer": "නව ශ්රව්ය වාදකය භාවිතා කරන්න" + "VOTNewAudioPlayer": "නව ශ්රව්ය වාදකය භාවිතා කරන්න", + "VOTUseNewModel": "සමහර වීඩියෝ සඳහා Yandex voices හි පර්යේෂණාත්මක විචලනයක් භාවිතා කරන්න" } diff --git a/src/localization/locales/sk.json b/src/localization/locales/sk.json index 362be860..a34051a3 100644 --- a/src/localization/locales/sk.json +++ b/src/localization/locales/sk.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "Ak to chcete povoliť, musíte mať rozhranie Web Audio API", "VOTMediaCSPEnabledOnSite": "Media CSP je povolené na tejto stránke", "VOTOnlyBypassMediaCSP": "Používajte ho iba na obídenie médií CSP", - "VOTNewAudioPlayer": "Použite nový audio prehrávač" + "VOTNewAudioPlayer": "Použite nový audio prehrávač", + "VOTUseNewModel": "Pre niektoré videá použite experimentálnu variáciu hlasov Yandex" } diff --git a/src/localization/locales/sl.json b/src/localization/locales/sl.json index 52785ff1..ef21809b 100644 --- a/src/localization/locales/sl.json +++ b/src/localization/locales/sl.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "Če želite to omogočiti, morate imeti spletni avdio API", "VOTMediaCSPEnabledOnSite": "Media CSP je omogočen na tej spletni strani", "VOTOnlyBypassMediaCSP": "Uporabite ga samo za obhod medijev CSP", - "VOTNewAudioPlayer": "Uporabite nov predvajalnik zvoka" + "VOTNewAudioPlayer": "Uporabite nov predvajalnik zvoka", + "VOTUseNewModel": "Za nekatere videoposnetke uporabite eksperimentalno različico glasov Jandeksa" } diff --git a/src/localization/locales/sq.json b/src/localization/locales/sq.json index 8648d8b1..5c831c83 100644 --- a/src/localization/locales/sq.json +++ b/src/localization/locales/sq.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "Për ta mundësuar këtë, duhet të keni NJË API Audio Në Internet", "VOTMediaCSPEnabledOnSite": "Media CSP është aktivizuar në këtë faqe", "VOTOnlyBypassMediaCSP": "Përdoreni atë vetëm për anashkalimin E CSP-Së Mediatike", - "VOTNewAudioPlayer": "Përdorni luajtësin e ri audio" + "VOTNewAudioPlayer": "Përdorni luajtësin e ri audio", + "VOTUseNewModel": "Përdorni një variant eksperimental Të Zërave Yandex për disa video" } diff --git a/src/localization/locales/sr.json b/src/localization/locales/sr.json index 69eab398..3b8fb226 100644 --- a/src/localization/locales/sr.json +++ b/src/localization/locales/sr.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "Да бисте то омогућили, морате имати Веб Аудио АПИ", "VOTMediaCSPEnabledOnSite": "На овој веб локацији је омогућен Медиа ЦСП", "VOTOnlyBypassMediaCSP": "Користите га само за заобилажење Медиа ЦСП-а", - "VOTNewAudioPlayer": "Користите нови аудио плејер" + "VOTNewAudioPlayer": "Користите нови аудио плејер", + "VOTUseNewModel": "Користите експерименталну опцију Иандек Воицес за неке видео записе" } diff --git a/src/localization/locales/su.json b/src/localization/locales/su.json index 1eef1913..f3acbf57 100644 --- a/src/localization/locales/su.json +++ b/src/localization/locales/su.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "Pikeun ngaktipkeun ieu, anjeun kudu boga API Audio Web", "VOTMediaCSPEnabledOnSite": "Media csp diaktipkeun dina situs ieu", "VOTOnlyBypassMediaCSP": "Ngagunakeun eta ngan Pikeun Bypassing Media Csp", - "VOTNewAudioPlayer": "Paké pamuter audio anyar" + "VOTNewAudioPlayer": "Paké pamuter audio anyar", + "VOTUseNewModel": "Paké variasi ékspérimén sora Yandex pikeun sababaraha video" } diff --git a/src/localization/locales/sv.json b/src/localization/locales/sv.json index 6f72debf..5347be78 100644 --- a/src/localization/locales/sv.json +++ b/src/localization/locales/sv.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "För att aktivera detta måste du ha ETT Web Audio API", "VOTMediaCSPEnabledOnSite": "Media CSP är aktiverat på den här webbplatsen", "VOTOnlyBypassMediaCSP": "Använd den bara för att kringgå Media CSP", - "VOTNewAudioPlayer": "Använd den nya ljudspelaren" + "VOTNewAudioPlayer": "Använd den nya ljudspelaren", + "VOTUseNewModel": "Använd en experimentell variant av Yandex-Röster För vissa videor" } diff --git a/src/localization/locales/sw.json b/src/localization/locales/sw.json index 596efb01..6d6f0408 100644 --- a/src/localization/locales/sw.json +++ b/src/localization/locales/sw.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "Ili kuwezesha hii, lazima uwe NA API Ya Sauti Ya Wavuti", "VOTMediaCSPEnabledOnSite": "Media CSP imewezeshwa kwenye tovuti hii", "VOTOnlyBypassMediaCSP": "Tumia Tu kwa kupitisha Vyombo VYA Habari CSP", - "VOTNewAudioPlayer": "Tumia kicheza sauti kipya" + "VOTNewAudioPlayer": "Tumia kicheza sauti kipya", + "VOTUseNewModel": "Tumia tofauti ya majaribio Ya sauti Za Yandex kwa video zingine" } diff --git a/src/localization/locales/tr.json b/src/localization/locales/tr.json index 5d639710..4a1a3ab8 100644 --- a/src/localization/locales/tr.json +++ b/src/localization/locales/tr.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "Bunu etkinleştirmek için bir Web Ses API'sine sahip olmanız gerekir", "VOTMediaCSPEnabledOnSite": "Media CSP bu sitede etkindir", "VOTOnlyBypassMediaCSP": "Yalnızca Medya csp'sini atlamak için kullanın", - "VOTNewAudioPlayer": "Yeni ses çaları kullanma" + "VOTNewAudioPlayer": "Yeni ses çaları kullanma", + "VOTUseNewModel": "Bazı videolar için Yandex seslerinin deneysel bir varyasyonunu kullanın" } diff --git a/src/localization/locales/uk.json b/src/localization/locales/uk.json index e08b35eb..a4d420b8 100644 --- a/src/localization/locales/uk.json +++ b/src/localization/locales/uk.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "Щоб увімкнути це, ви повинні мати Web Audio API", "VOTMediaCSPEnabledOnSite": "На цьому сайті включено Media CSP", "VOTOnlyBypassMediaCSP": "Використовуйте його лише для обходу Media CSP", - "VOTNewAudioPlayer": "Використовуйте новий аудіоплеєр" + "VOTNewAudioPlayer": "Використовуйте новий аудіоплеєр", + "VOTUseNewModel": "Використовуйте експериментальний варіант Yandex voices для деяких відео" } diff --git a/src/localization/locales/ur.json b/src/localization/locales/ur.json index 34b8ce1d..67f247a8 100644 --- a/src/localization/locales/ur.json +++ b/src/localization/locales/ur.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "اس کو فعال کرنے کے ل you ، آپ کے پاس ویب آڈیو API ہونا ضروری ہے", "VOTMediaCSPEnabledOnSite": "اس سائٹ پر میڈیا سی ایس پی فعال ہے", "VOTOnlyBypassMediaCSP": "اسے صرف میڈیا CSP کو نظرانداز کرنے کے لیے استعمال کریں ۔ ", - "VOTNewAudioPlayer": "نیا آڈیو پلیئر استعمال کریں" + "VOTNewAudioPlayer": "نیا آڈیو پلیئر استعمال کریں", + "VOTUseNewModel": "کچھ ویڈیوز کے لئے یاندیکس آوازوں کی تجرباتی تغیر کا استعمال کریں ۔ " } diff --git a/src/localization/locales/uz.json b/src/localization/locales/uz.json index 42758d82..39de810b 100644 --- a/src/localization/locales/uz.json +++ b/src/localization/locales/uz.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "Buni yoqish uchun sizda veb-Audio API bo'lishi kerak", "VOTMediaCSPEnabledOnSite": "Media CSP ushbu saytda yoqilgan", "VOTOnlyBypassMediaCSP": "Uni faqat Media CSP-ni chetlab o'tish uchun foydalaning", - "VOTNewAudioPlayer": "Yangi audio pleerdan foydalaning" + "VOTNewAudioPlayer": "Yangi audio pleerdan foydalaning", + "VOTUseNewModel": "Ba'zi videolar uchun Yandex ovozlarining eksperimental variantidan foydalaning" } diff --git a/src/localization/locales/vi.json b/src/localization/locales/vi.json index 328a6b45..33f79213 100644 --- a/src/localization/locales/vi.json +++ b/src/localization/locales/vi.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "Để kích hoạt ĐIỀU này, bạn phải có Api Âm Thanh Web", "VOTMediaCSPEnabledOnSite": "Media CSP được kích hoạt trên trang web này", "VOTOnlyBypassMediaCSP": "Chỉ sử dụng Nó để bỏ QUA Media Csp", - "VOTNewAudioPlayer": "Sử dụng trình phát âm thanh mới" + "VOTNewAudioPlayer": "Sử dụng trình phát âm thanh mới", + "VOTUseNewModel": "Sử dụng một biến thể thử nghiệm Của Giọng Nói Yandex cho một số video" } diff --git a/src/localization/locales/zh.json b/src/localization/locales/zh.json index 8efd0b6f..93687546 100644 --- a/src/localization/locales/zh.json +++ b/src/localization/locales/zh.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "要启用此功能,您必须具有Web音频API", "VOTMediaCSPEnabledOnSite": "媒体CSP在此站点上启用", "VOTOnlyBypassMediaCSP": "仅将其用于绕过媒体CSP", - "VOTNewAudioPlayer": "使用新的音频播放器" + "VOTNewAudioPlayer": "使用新的音频播放器", + "VOTUseNewModel": "在一些视频中使用Yandex声音的实验变体" } diff --git a/src/localization/locales/zu.json b/src/localization/locales/zu.json index b717398b..553a80f6 100644 --- a/src/localization/locales/zu.json +++ b/src/localization/locales/zu.json @@ -203,5 +203,6 @@ "VOTNeedWebAudioAPI": "Ukuze ukwazi lokhu, kufanele UBE NE-WEB AUDIO API", "VOTMediaCSPEnabledOnSite": "I-Media csp inikwe amandla kule sayithi", "VOTOnlyBypassMediaCSP": "Sebenzisa kuphela Bypassing Media Csp", - "VOTNewAudioPlayer": "Sebenzisa umdlali omusha audio" + "VOTNewAudioPlayer": "Sebenzisa umdlali omusha audio", + "VOTUseNewModel": "Sebenzisa ukuhlukahluka kokuhlola kwamazwi E Yandex kwamanye amavidiyo" }