// ==UserScript==
// @name 就要宽屏
// @version 1.1.0
// @namespace https://sleazyfork.org/zh-CN/users/1461640-%E6%98%9F%E5%AE%BF%E8%80%81%E9%AD%94
// @author 星宿老魔
// @description 多站点视频宽屏优化脚本 - 支持好色TV和九色
// @match https://hsex.tv/video-*
// @match https://hsex.men/video-*
// @match https://91porny.com/*
// @match https://*.jiuse.vip/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=hsex.tv
// @license MIT
// @grant none
// @run-at document-start
// ==/UserScript==
(function(){"use strict";var t;function e(){const t=location.hostname
;return t.includes("hsex")?"hsex":t.includes("91porny")||t.includes("jiuse")?"jiuse":null}async function n(){const t=e();if(!t)return void 0,void 0
;void 0;try{"hsex"===t?await Promise.resolve().then(()=>c):"jiuse"===t&&await Promise.resolve().then(()=>g)}catch(n){void 0}}n();const i={
wideScreenMode:!0,selectors:{videoContainer:".videos_box",videoElement:".video-js",mainContainer:".container",videoCol:".col-md-8",
sideCol:".col-md-4",controlBar:".vjs-control-bar",panelDefault:".panel-default"}};let o=class{static init(){this.setWideScreenMode(),
this.setupResizeListener()}static setWideScreenMode(){
const t=document.querySelector(i.selectors.videoContainer),e=document.querySelector(i.selectors.videoElement);if(!t&&!e)return
;this.applyMainContainerStyles(),this.applyVideoColStyles(),this.applySideColStyles(),this.applyPanelStyles(),
t&&(t.classList.contains("hsx-initialized")||t.classList.add("hsx-hidden-until-ready"),t.style.width="100%",t.style.maxWidth="100%",
t.style.margin="0 auto",t.style.position="relative"),e&&(e.style.height="",e.style.width="100%",e.style.maxWidth="100%",
e.classList.contains("vjs-fluid")||e.classList.add("vjs-fluid"));const n=document.querySelector(i.selectors.videoContainer)
;n&&(n.classList.remove("hsx-hidden-until-ready"),n.classList.add("hsx-initialized"))}static applyMainContainerStyles(){
const t=document.querySelector(i.selectors.mainContainer);t&&(t.style.width="100%",t.style.maxWidth="100%",t.style.padding="0")}
static applyVideoColStyles(){const t=document.querySelector(i.selectors.videoCol);t&&(t.style.width="100%",t.style.maxWidth="100%",
t.style.flexBasis="100%",t.style.padding="0 10px",t.classList.remove("col-md-8"),t.classList.add("col-md-12"))}static applySideColStyles(){
const t=document.querySelector(i.selectors.sideCol);t&&(t.style.display="none")}static applyPanelStyles(){
const t=document.querySelector(i.selectors.panelDefault);t&&(t.style.position="relative",t.style.clear="both",t.style.marginTop="15px",
t.style.zIndex="1")}static setupResizeListener(){window.addEventListener("resize",()=>{this.setWideScreenMode()})}};class TabButtons{
constructor(config){this.buttons=new Map,this.config=config,this.onTabChangeCallback=config.onTabChange,this.container=this.createContainer(),
this.createButtons(),this.setupEvents()}createContainer(){const t=document.createElement("div");return t.id=this.config.containerId,
t.className="unified-tab-container",t}createButtons(){this.config.buttons.forEach(t=>{const e=document.createElement("button");e.textContent=t.text,
e.className="unified-tab-button "+(t.active?"active":""),e.setAttribute("data-tab",t.id),this.buttons.set(t.id,e),this.container.appendChild(e)})}
setupEvents(){this.buttons.forEach((t,e)=>{t.addEventListener("click",()=>{this.setActiveTab(e),this.onTabChangeCallback?.(e)})})}setActiveTab(t){
this.buttons.forEach((e,n)=>{n===t?e.classList.add("active"):e.classList.remove("active")})}getContainer(){return this.container}getButton(t){
return this.buttons.get(t)}setOnTabChange(callback){this.onTabChangeCallback=callback}}
const s="\n .unified-tab-container {\n display: flex;\n gap: 10px;\n margin-bottom: 15px;\n }\n \n .unified-tab-button {\n background-color: #333;\n color: #fff;\n border: 1px solid #555;\n padding: 8px 16px;\n cursor: pointer;\n border-radius: 6px;\n font-size: 14px;\n font-weight: 500;\n transition: all 0.2s ease;\n user-select: none;\n }\n \n .unified-tab-button:hover {\n background-color: #444;\n border-color: #666;\n }\n \n .unified-tab-button.active {\n background-color: #4a90e2;\n color: #fff;\n border-color: #4a90e2;\n }\n \n .unified-tab-button.active:hover {\n background-color: #357abd;\n border-color: #357abd;\n }\n"
;class LayoutReflow{static init(){this.reflowLayout()}static reflowLayout(){try{const t=this.findLeftColumn(),e=this.findRightColumn();if(!t)return
;const n=document.querySelector(i.selectors.panelDefault)||document.querySelector(i.selectors.videoContainer)||t
;let o=document.querySelector(".hsx-two-col");o||(o=this.createTwoColumnLayout(n,t))
;const s=o.querySelector(".hsx-left"),a=o.querySelector(".hsx-right");this.handleRecommendedVideos(t,a),this.handleAuthorVideos(e,s)}catch(t){void 0}}
static findLeftColumn(){const t=document.querySelector(".videos");if(t){const e=t.closest(".col-md-8, .col-md-12");if(e)return e}
const e=document.querySelector(i.selectors.panelDefault);if(e){const t=e.closest(".col-md-8, .col-md-12");if(t)return t}
return document.querySelector(".col-md-8")||document.querySelector("#container .row > .col-md-12")}static findRightColumn(){
const t=document.querySelector(i.selectors.sideCol);if(t)return t
;const e=Array.from(document.querySelectorAll("h4")).find(t=>t.textContent&&-1!==t.textContent.indexOf("作者视频"))
;return e?e.closest(".col-md-4")||e.closest(".col-md-12"):null}static createTwoColumnLayout(t,e){const n=new TabButtons({
containerId:"hsx-tab-container",buttons:[{id:"author",text:"作者视频",active:!0},{id:"recommend",text:"推荐视频",active:!1}]});this.injectTabStyles()
;const i=n.getContainer(),o=document.createElement("div");o.className="hsx-two-col single-left";const s=document.createElement("div")
;s.className="hsx-left";const a=document.createElement("div");return a.className="hsx-right",o.appendChild(s),o.appendChild(a),
t&&t.parentNode?(t.parentNode.insertBefore(i,t.nextSibling),i.parentNode.insertBefore(o,i.nextSibling)):(e.appendChild(i),e.appendChild(o)),
n.setOnTabChange(t=>{
"author"===t?(o.classList.add("single-left"),o.classList.remove("single-right")):"recommend"===t&&(o.classList.add("single-right"),
o.classList.remove("single-left"))}),o}static injectTabStyles(){if(document.querySelector("style[data-unified-tabs]"))return
;const t=document.createElement("style");t.setAttribute("data-unified-tabs","true"),t.textContent=s,document.head.appendChild(t)}
static handleRecommendedVideos(t,e){if(e&&0===e.childElementCount){
const n=Array.from(t.querySelectorAll("h4")).find(t=>t.textContent&&-1!==t.textContent.indexOf("推荐视频"));if(n){
let i=n.closest(".col-xs-12")||n.closest(".col-md-12")||n.parentElement
;for(i=i?i.nextElementSibling:null;i&&t.contains(i)&&(!i.classList||!i.classList.contains("hsx-two-col"));){const t=i.nextElementSibling
;if(i.querySelector&&i.querySelector(".thumbnail")){e.appendChild(i);const t=i.querySelector(".image");t&&(t.style.backgroundSize="cover",
t.style.backgroundPosition="center",t.style.minHeight="120px")}i=t}}}}static handleAuthorVideos(t,e){if(e&&0===e.childElementCount&&t){
const n=Array.from(t.querySelectorAll("h4")).find(t=>t.textContent&&-1!==t.textContent.indexOf("作者视频"));if(n){
let i=n.closest(".col-md-12")||n.closest(".col-xs-12")||t;for(i=i?i.nextElementSibling:null;i&&(t.contains(i)||i.closest(".col-md-4"));){
const t=i.nextElementSibling;if(i.querySelector&&i.querySelector(".thumbnail")){e.appendChild(i);const t=i.querySelector(".image")
;t&&(t.style.backgroundSize="cover",t.style.backgroundPosition="center",t.style.minHeight="90px")}i=t}}
0===e.querySelectorAll(".thumbnail").length&&Array.from(t.querySelectorAll(".thumbnail")).forEach(t=>{
const n=t.closest(".col-xs-6, .col-md-3, .col-xs-12, .col-md-12")||t;if(!e.contains(n)){e.appendChild(n);const t=n.querySelector(".image")
;t&&(t.style.backgroundSize="cover",t.style.backgroundPosition="center",t.style.minHeight="90px")}}),t&&t.parentElement&&(t.style.display="none")}}}
const a=class{static init(){this.addStyles()}static addStyles(){const t=document.createElement("style");t.textContent=this.cssRules,
document.head.appendChild(t)}}
;a.cssRules='\n .container {\n width: 100% !important;\n max-width: 100% !important;\n padding: 0 8px !important;\n }\n .videos_box {\n width: 100% !important;\n max-width: 100% !important;\n margin: 0 auto !important;\n position: relative !important;\n z-index: 5 !important;\n aspect-ratio: 16 / 9 !important;\n min-height: 200px !important;\n overflow: hidden !important;\n }\n .videos_box.hsx-hidden-until-ready { visibility: hidden !important; }\n .video-js,\n .video-play-dimensions {\n width: 100% !important;\n max-width: 100% !important;\n position: relative !important;\n z-index: 5 !important;\n }\n .video-js.vjs-fluid {\n padding-top: 56.25% !important;\n height: auto !important;\n }\n .video-play-dimensions { height: auto !important; }\n .video-js .vjs-poster { opacity: 0.001 !important; }\n .hsx-two-col {\n display: grid !important;\n grid-template-columns: minmax(280px, 1fr) minmax(0, 3fr) !important;\n grid-gap: 16px !important;\n margin-top: 16px !important;\n width: 100% !important;\n }\n .hsx-two-col.single-left,\n .hsx-two-col.single-right {\n grid-template-columns: 1fr !important;\n }\n .hsx-two-col.single-left .hsx-right { display: none !important; }\n .hsx-two-col.single-right .hsx-left { display: none !important; }\n .hsx-left,\n .hsx-right {\n width: 100% !important;\n display: grid !important;\n grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;\n gap: 12px !important;\n align-content: start !important;\n }\n .hsx-right > *,\n .hsx-left > * { display: block !important; }\n .hsx-two-col [class*="col-"] {\n float: none !important;\n width: auto !important;\n max-width: 100% !important;\n padding: 0 !important;\n }\n .hsx-two-col .row { margin: 0 !important; display: contents !important; }\n .hsx-two-col .thumbnail {\n margin-bottom: 0 !important;\n display: block !important;\n }\n .hsx-two-col .thumbnail .image {\n background-position: center center !important;\n background-size: cover !important;\n width: 100% !important;\n min-height: 120px !important;\n }\n .col-md-12 {\n width: 100% !important;\n max-width: 100% !important;\n flex-basis: 100% !important;\n padding: 0 10px !important;\n }\n .vjs-control-bar {\n position: absolute !important;\n left: 0 !important;\n right: 0 !important;\n bottom: 0 !important;\n z-index: 10 !important;\n clear: none !important;\n width: auto !important;\n }\n .panel-default {\n position: relative !important;\n clear: both !important;\n margin-top: 16px !important;\n z-index: 1 !important;\n width: 100% !important;\n float: none !important;\n }\n .col-md-12:after {\n content: "" !important;\n display: table !important;\n clear: both !important;\n }\n .thumbnail { margin-bottom: 15px; }\n '
;let r=a,d=((t=class{static init(){this.setupDocumentListeners(),this.setupMutationObserver()}static runUpdates(){o.setWideScreenMode(),
LayoutReflow.reflowLayout()}static setupDocumentListeners(){
"loading"===document.readyState?document.addEventListener("DOMContentLoaded",this.runUpdates):this.runUpdates(),document.addEventListener("load",t=>{
const e=t.target;"VIDEO"!==e.tagName&&"IFRAME"!==e.tagName||this.runUpdates()},!0),window.addEventListener("load",this.runUpdates)}
static setupMutationObserver(){this.observer=new MutationObserver(t=>{t.some(t=>t.addedNodes.length>0)&&this.runUpdates()}),
this.observer.observe(document.body,{childList:!0,subtree:!0})}static destroy(){this.observer&&(this.observer.disconnect(),this.observer=null)}
}).observer=null,t);function l(){o.init(),LayoutReflow.init(),d.init()}r.init(),l();const c=Object.freeze(Object.defineProperty({__proto__:null,
CONFIG:i},Symbol.toStringTag,{value:"Module"})),CONFIG={debounceDelay:250,selectors:{videoContainer:".videoPlayContainer",videoElement:".video-js",
videoColumn:".left.col-60.offset-md-10.col-md-40, .left.col-md-40.offset-md-10.col-60"}},m=class{static init(){
this.injectStyles(["wideScreen","videoRecommendation","adBlocker","downloadOptimizer","utilities"])}static injectStyles(t){t.forEach(t=>{
this.injectedStyles.has(t)||(this.addStyleToDocument(t,this.styles[t]),this.injectedStyles.add(t))})}static injectStyle(t){this.injectStyles([t])}
static addCustomStyle(t,e){this.injectedStyles.has(t)||(this.addStyleToDocument(t,e),this.injectedStyles.add(t))}static addStyleToDocument(t,e){
const n=document.createElement("style");n.setAttribute("data-style-module",t),n.textContent=e.trim(),document.head.appendChild(n)}
static removeStyle(t){const e=document.querySelector(`style[data-style-module="${t}"]`);e&&(e.remove(),this.injectedStyles.delete(t))}
static getInjectedStyles(){return Array.from(this.injectedStyles)}static setElementStyles(t,e){Object.assign(t.style,e)}};m.injectedStyles=new Set,
m.styles={
wideScreen:"\n .videoPlayContainer {\n width: 100% !important;\n max-width: 100% !important;\n margin: 0 auto !important;\n margin-top: 0 !important;\n padding-top: 0 !important;\n opacity: 0 !important;\n transition: opacity 0.3s ease !important;\n }\n .videoPlayContainer.wide-screen-ready {\n opacity: 1 !important;\n }\n .video-js {\n width: 100% !important;\n max-width: 100% !important;\n }\n .row .col-100 {\n width: 100% !important;\n max-width: 100% !important;\n flex-basis: 100% !important;\n margin: 0 !important;\n padding: 0 10px !important;\n margin-top: 0 !important;\n padding-top: 0 !important;\n }\n .row {\n margin-top: 0 !important;\n padding-top: 0 !important;\n }\n .row .side.col-40.col-md-50 {\n display: none;\n }\n .videoPlayContainer .scale {\n padding-bottom: 0 !important;\n height: auto !important;\n min-height: 0 !important;\n aspect-ratio: unset !important;\n margin-top: 0 !important;\n padding-top: 0 !important;\n }\n .videoPlayContainer .video-js {\n position: relative !important;\n top: 0 !important;\n left: 0 !important;\n }\n .videoPlayContainer,\n .videoPlayContainer > *,\n .col-100 {\n margin-top: 0 !important;\n padding-top: 0 !important;\n }\n body .container .row:first-child {\n margin-top: 0 !important;\n padding-top: 0 !important;\n }\n ",
videoRecommendation:"\n #recommended-videos-container, \n #author-videos-container {\n flex-wrap: wrap;\n }\n #author-info-container a {\n color: #4a90e2;\n display: block;\n margin-bottom: 10px;\n text-decoration: none;\n }\n #author-info-container a:hover {\n text-decoration: underline;\n }\n ",
adBlocker:"\n /* 隐藏特定广告容器 */\n .aa9965ce0d851e635fa7ec1dbf56d965,\n #po-s6,\n .d9867a703dd9335a77b9f88459aa7bff {\n display: none !important;\n visibility: hidden !important;\n }\n ",
downloadOptimizer:'\n /* 下载按钮优化样式 */\n .nav-link[data-optimized="download"] {\n cursor: pointer !important;\n }\n .nav-link[data-optimized="download"] i {\n color: #28a745 !important;\n }\n .nav-link[data-optimized="download"] span {\n color: #28a745 !important;\n }\n .nav-link[data-optimized="download"]:hover i,\n .nav-link[data-optimized="download"]:hover span {\n color: #34ce57 !important;\n }\n ',
utilities:"\n /* 动画过渡 */\n .smooth-transition {\n transition: all 0.3s ease;\n }\n "};let u=m;class WideScreen{static init(){
this.setWideScreenMode(),this.setupResizeListener()}static setWideScreenMode(){
const t=document.querySelector(CONFIG.selectors.videoContainer),e=document.querySelector(CONFIG.selectors.videoElement)
;(t||e)&&(this.applyVideoColumnClasses(),setTimeout(()=>{this.calculateVideoHeight(t,e),t&&t.classList.add("wide-screen-ready")},100))}
static applyVideoColumnClasses(){const t=document.querySelector(CONFIG.selectors.videoColumn)
;t&&(t.classList.remove("col-60","offset-md-10","col-md-40"),t.classList.add("col-100"))}static calculateVideoHeight(t,e){if(e){const n=16/9;let i=0
;if(i=t&&t.offsetWidth>0?t.offsetWidth:e.offsetWidth>0?e.offsetWidth:window.innerWidth,i>0){const t=i/n;u.setElementStyles(e,{height:`${t}px`})}}}
static setupResizeListener(){window.addEventListener("resize",()=>{
const t=document.querySelector(CONFIG.selectors.videoContainer),e=document.querySelector(CONFIG.selectors.videoElement);this.calculateVideoHeight(t,e)
})}}class VideoRecommendation{static init(){this.modifyVideoRecommendations()}static modifyVideoRecommendations(){
if(document.getElementById("rec-tabs-container"))return
;const t=Array.from(document.querySelectorAll("h5.container-title")).find(t=>"视频推荐"===t.textContent?.trim());if(!t)return
;const e=t.parentElement,n=e.nextElementSibling;if(!n||!n.classList.contains("row"))return;n.id="recommended-videos-container",n.style.display="flex"
;const i=this.createAuthorInfoContainer();n.parentNode?.insertBefore(i,n);const o=this.createAuthorVideosContainer()
;i.parentNode?.insertBefore(o,i.nextSibling);const{recommendedBtn:s,authorBtn:a,buttonContainer:r}=this.createTabButtons();e.innerHTML="",
e.appendChild(r),this.setupTabEvents(s,a,n,o,i)}static createAuthorInfoContainer(){const t=document.createElement("div")
;return t.id="author-info-container",t.style.display="none",t}static createAuthorVideosContainer(){const t=document.createElement("div")
;return t.id="author-videos-container",t.className="row",t.style.display="none",t}static createTabButtons(){this.injectTabStyles()
;const t=new TabButtons({containerId:"rec-tabs-container",buttons:[{id:"recommend",text:"视频推荐",active:!0},{id:"author",text:"作者视频",active:!1}]})
;return{recommendedBtn:t.getButton("recommend"),authorBtn:t.getButton("author"),buttonContainer:t.getContainer()}}static setupTabEvents(t,e,n,i,o){
t.addEventListener("click",()=>{t.classList.add("active"),e.classList.remove("active"),n.style.display="flex",i.style.display="none",
o.style.display="none"}),e.addEventListener("click",()=>{if(e.classList.add("active"),t.classList.remove("active"),n.style.display="none",
i.style.display="flex",o.style.display="block",0===i.children.length){
const t=document.querySelector('.d-flex.justify-content-between a[href*="/author/"]')
;t?this.fetchAuthorInfoAndVideos(t.href,i,o):i.innerHTML='<p style="color: white; padding: 20px;">未找到当前视频的作者信息。</p>'}})}
static fetchAuthorInfoAndVideos(t,e,n){e.innerHTML='<p style="color: white; padding: 20px;">正在加载作者视频...</p>',n.innerHTML="",
fetch(t).then(t=>t.text()).then(i=>{
const o=(new DOMParser).parseFromString(i,"text/html"),s=Array.from(o.querySelectorAll("p, h1, h2, h3, h4, h5")).find(t=>t.textContent?.includes("共计")&&t.textContent?.includes("视频"))
;if(s){const e=document.createElement("a");e.href=t,e.target="_blank";let i=s.textContent?.trim()||"",o=i.split(",")[0];o===i&&(o=i.split(",")[0]),
e.textContent=o,e.title="点击跳转作者主页",n.appendChild(e)}const a=o.querySelectorAll(".colVideoList");e.innerHTML="",a.length>0?a.forEach(t=>{
e.appendChild(t)}):e.innerHTML='<p style="color: white; padding: 20px;">该作者没有其他视频。</p>'}).catch(t=>{void 0,
e.innerHTML='<p style="color: white; padding: 20px;">加载作者视频失败。</p>'})}static injectTabStyles(){
if(document.querySelector("style[data-unified-tabs]"))return;const t=document.createElement("style");t.setAttribute("data-unified-tabs","true"),
t.textContent=s,document.head.appendChild(t)}}function debounce(t,e){let n;return(...i)=>{clearTimeout(n),n=setTimeout(()=>t.apply(null,i),e)}}
const h=class{static registerHandler(config){this.handlers.push(config)}static init(){if(this.isInitialized)return void 0,void 0;void 0,
this.setupDocumentListeners(),this.setupMutationObserver(),this.isInitialized=!0}static setupDocumentListeners(){const t=200,e=()=>{
this.triggerAllHandlers()};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>setTimeout(e,t)):setTimeout(e,t),
setTimeout(e,1e3),document.addEventListener("load",t=>{const e=t.target;"VIDEO"!==e.tagName&&"IFRAME"!==e.tagName||this.triggerAllHandlers()},!0),
window.addEventListener("load",e)}static setupMutationObserver(){const t=()=>{
if(!document.body)return"loading"===document.readyState?document.addEventListener("DOMContentLoaded",t):setTimeout(t,100),void 0;const e=new Map
;this.handlers.forEach(t=>{const n=t.debounceDelay||CONFIG.debounceDelay;e.set(t.name,debounce(t.handler,n))}),this.observer=new MutationObserver(t=>{
this.handlers.forEach(n=>{let i=t;if(n.filter&&(i=t.filter(n.filter)),i.length>0){const t=e.get(n.name);t&&t(i)}})}),
this.observer.observe(document.body,{childList:!0,subtree:!0})};t()}static triggerAllHandlers(){this.handlers.forEach(t=>{try{t.handler([])}catch(e){
void 0}})}static destroy(){this.observer&&(this.observer.disconnect(),this.observer=null),this.handlers=[],this.isInitialized=!1}
static getHandlerCount(){return this.handlers.length}};h.observer=null,h.handlers=[],h.isInitialized=!1;let p=h;const y=class{static init(){
this.isInitialized||(this.setupAdWatcher(),this.isInitialized=!0),this.removeAuthorComments()}static removeAuthorComments(){
const t=document.querySelector(".aa9965ce0d851e635fa7ec1dbf56d965");t&&t.remove();const e=document.getElementById("po-s6");e&&e.remove(),
document.querySelectorAll('div[class*="aa9965ce0d851e635fa7ec1dbf56d965"]').forEach(t=>{t.remove()})}static setupAdWatcher(){p.registerHandler({
name:"AdBlocker",handler:t=>{t&&(t.forEach(t=>{t.addedNodes.length>0&&t.addedNodes.forEach(t=>{if(t.nodeType===Node.ELEMENT_NODE){const e=t
;this.isAdElement(e)&&e.remove(),e.querySelectorAll(".aa9965ce0d851e635fa7ec1dbf56d965, #po-s6").forEach(t=>{t.remove()})}})}),
this.removeAuthorComments())},debounceDelay:100,filter:t=>t.addedNodes.length>0})}static isAdElement(t){const e=t.className||"",n=t.id||""
;return e.includes("aa9965ce0d851e635fa7ec1dbf56d965")||"po-s6"===n}static checkAndRemoveAds(){this.removeAuthorComments()}};y.isInitialized=!1
;let f=y;const v=class{static init(){this.optimizeDownloadTabs()}static optimizeDownloadTabs(){
const t=document.querySelector('a[href="#videoShowTabDownload"]'),e=document.querySelector(".downloadBtn[data-id]")
;if(t&&e&&!this.processed.has(t))try{if(!e.getAttribute("data-id"))return;t.removeAttribute("data-toggle"),t.removeAttribute("href"),
t.setAttribute("data-optimized","download"),t.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation();const n=e.querySelector("button")
;n?n.click():e.click()});const n=t.querySelector("span");n&&(n.textContent="下载");const i=document.querySelector("#videoShowTabDownload")
;if(i&&(i.style.display="none"),t.classList.contains("active")){t.classList.remove("active")
;const e=document.querySelector('a[href="#videoShowTabAbout"]'),n=document.querySelector("#videoShowTabAbout");e&&n&&(e.classList.add("active"),
n.classList.add("show","active"))}this.processed.add(t)}catch(n){}}static reset(){this.processed.clear()}};v.processed=new Set;let b=v
;class DOMObserver{static init(){this.setupModuleHandlers(),this.initUnifiedObserver()}static setupModuleHandlers(){p.registerHandler({
name:"VideoModules",handler:()=>{WideScreen.setWideScreenMode(),VideoRecommendation.modifyVideoRecommendations(),b.optimizeDownloadTabs()},
debounceDelay:CONFIG.debounceDelay,filter:t=>{if(0===t.addedNodes.length)return!1
;for(const e of Array.from(t.addedNodes))if(e.nodeType===Node.ELEMENT_NODE){const t=e
;if(t.matches&&(t.matches(".videoPlayContainer")||t.matches(".video-js")||t.matches('[class*="recommend"]')||t.matches('[class*="video"]')||t.matches('[class*="download"]')||"VIDEO"===t.tagName||"IFRAME"===t.tagName))return!0
}return!1}})}static initUnifiedObserver(){p.init()}static destroy(){p.destroy()}}function init(){WideScreen.init(),VideoRecommendation.init(),
b.init(),f.init(),DOMObserver.init()}u.init(),init();const g=Object.freeze(Object.defineProperty({__proto__:null,CONFIG:CONFIG},Symbol.toStringTag,{
value:"Module"}))})();