// ==UserScript== // @name bilibili-app-recommend // @namespace https://magicdawn.fun // @version 0.5.2 // @author magicdawn // @description 为B站首页添加像App一样的推荐 // @license MIT // @homepageURL https://github.com/magicdawn/bilibili-app-recommend // @supportURL https://github.com/magicdawn/bilibili-app-recommend/issues // @match *://www.bilibili.com/ // @match *://www.bilibili.com/?* // @match https://www.mcbbs.net/template/mcbbs/image/special_photo_bg.png // @match https://www.mcbbs.net/template/mcbbs/image/special_photo_bg.png?* // @require https://unpkg.com/axios@0.27.2/dist/axios.min.js // @require https://unpkg.com/axios-userscript-adapter@0.2.0/dist/axiosGmxhrAdapter.min.js // @require https://unpkg.com/react@18.2.0/umd/react.production.min.js // @require https://unpkg.com/react-dom@18.2.0/umd/react-dom.production.min.js // @connect app.bilibili.com // @connect passport.bilibili.com // @connect link.acg.tv // @connect www.mcbbs.net // @grant GM.xmlHttpRequest // @grant GM_deleteValue // @grant GM_getValue // @grant GM_setValue // @grant GM_xmlhttpRequest // @grant unsafeWindow // @downloadURL none // ==/UserScript== (o=>{const e=document.createElement("style");e.dataset.source="vite-plugin-monkey",e.innerText=o,document.head.appendChild(e)})(`._toast-container_9119l_1{position:fixed;top:50%;left:50%;z-index:999999;padding:12px 24px;font-size:14px;width:240px;margin-left:-120px;background:#ffb243;color:#fff;border-radius:6px}._expand-btn_wdzp9_1{padding:0;width:31px;height:31px;border-radius:50%}._expand-btn_wdzp9_1 svg{width:13px;height:13px;transform:rotate(180deg)}._expand-btn_wdzp9_1 svg._expanded_wdzp9_12{transform:rotate(0)}body.dark ._expand-btn_wdzp9_1{color:#eee!important;border-color:transparent!important;background-color:#333!important}body.dark ._expand-btn_wdzp9_1:hover{background-color:#555!important}._modal-mask_vh629_1{position:fixed;left:0;top:0;right:0;bottom:0;background-color:#00000080;z-index:11003;display:flex;align-items:center;justify-content:center}._modal_vh629_1{width:500px;max-height:calc(80vh - 50px);border-radius:10px;overflow:hidden;background-color:#fff;padding:0 15px 15px;display:flex;flex-direction:column}._modal_vh629_1 ._modal-header_vh629_23{padding-top:10px;padding-bottom:10px;border-bottom:none;display:flex;align-items:center}._modal_vh629_1 ._modal-header_vh629_23 ._modal-title_vh629_30{font-size:1.5rem;margin-bottom:0;line-height:1.5}._modal_vh629_1 ._modal-header_vh629_23 ._title-desc_vh629_35{margin-left:5px;font-size:40%}._modal_vh629_1 ._modal-header_vh629_23 ._btn-close_vh629_39{margin-left:10px}._modal_vh629_1 ._modal-header_vh629_23 ._btn-close_vh629_39 svg{width:10px;height:10px;margin-right:3px;margin-top:-1px}body.dark ._modal_vh629_1 ._modal-header_vh629_23 ._btn-close_vh629_39{color:#eee!important;background-color:#333!important;border-color:transparent!important;height:auto;padding:8px 12px;line-height:16px;font-size:13px}._modal_vh629_1 ._modal-body_vh629_57{padding-top:0;flex-grow:1;overflow-y:scroll}._reason-list_vh629_62{display:flex;align-items:center;flex-wrap:wrap;justify-content:space-between}._reason_vh629_62{color:inherit;width:45%;text-align:center;line-height:20px;border:1px solid #eee;margin-top:8px;margin-bottom:8px;padding-top:5px;padding-bottom:5px}body.dark ._reason_vh629_62{border:1px solid #333}._bili-video-card_1a93a_1{position:relative}._image-wrapper_1a93a_4{border-radius:6px;overflow:hidden}._preview-card-wrapper_1a93a_8{position:absolute;top:0;left:0;right:0;bottom:0;z-index:2;overflow:hidden;border-top-left-radius:inherit;border-top-right-radius:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0}._preview-card-wrapper_1a93a_8 ._preview-card-inner_1a93a_21{width:100%;height:100%}._watch-later_1a93a_25{z-index:3}._badge_1a93a_28{color:#fa6a9d;border-radius:2px;border:1px #fa6a9d solid;line-height:20px;padding:0 10px;transform:scale(.8)}._recommend-reason_1a93a_36{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;display:inline-block;color:var(--Or5);background-color:var(--Or1);border-radius:4px;margin-right:4px;font-size:var(--follow-icon-font-size);line-height:var(--follow-icon-line-height);height:var(--follow-icon-line-height);padding:0 4px;cursor:default}._bangumi-desc_1a93a_51{color:default}._btn-dislike_1a93a_54{display:flex;align-items:center;justify-content:center;position:absolute;top:8px;left:8px;width:28px;height:28px;border-radius:6px;cursor:pointer;background-color:#212121cc;z-index:9;transform:translateZ(0)}._btn-dislike_1a93a_54 ._btn-dislike-icon_1a93a_69{pointer-events:none;user-select:none;width:12px;height:12px;color:#fff}._btn-dislike_1a93a_54 ._btn-dislike-tip_1a93a_76{pointer-events:none;user-select:none;position:absolute;bottom:-6px;left:-5px;transform:translateY(100%);font-size:12px;color:#fff;border-radius:4px;line-height:18px;padding:4px 8px;background-color:#000c;white-space:nowrap}._disliked-wrapper_1a93a_91{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;flex-direction:column;border-radius:6px;border:1px solid #eee}body.dark ._disliked-wrapper_1a93a_91{border:1px solid #333}._disliked-wrapper_1a93a_91 ._dislike-content-cover_1a93a_105{border-top-left-radius:6px;border-top-right-radius:6px;padding-top:56.25%;position:relative}._disliked-wrapper_1a93a_91 ._dislike-content-cover_1a93a_105 ._dislike-content-cover-inner_1a93a_111{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center}._disliked-wrapper_1a93a_91 ._dislike-content-cover_1a93a_105 ._dislike-content-cover-inner_1a93a_111 ._dislike-icon_1a93a_122{margin-bottom:5px}._disliked-wrapper_1a93a_91 ._dislike-content-cover_1a93a_105 ._dislike-content-cover-inner_1a93a_111 ._dislike-reason_1a93a_125{font-size:20px;text-align:center}._disliked-wrapper_1a93a_91 ._dislike-content-cover_1a93a_105 ._dislike-content-cover-inner_1a93a_111 ._dislike-desc_1a93a_129{font-size:16px;text-align:center}._disliked-wrapper_1a93a_91 ._dislike-content-action_1a93a_133{flex:1;width:100%;border-top:1px solid #eee;display:flex;align-items:center;justify-content:center}body.dark ._disliked-wrapper_1a93a_91 ._dislike-content-action_1a93a_133{border-top:1px solid #333}._disliked-wrapper_1a93a_91 ._dislike-content-action_1a93a_133 button{font-size:16px;color:inherit;display:flex;align-items:center}._modal-mask_1urmj_1{position:fixed;left:0;top:0;right:0;bottom:0;z-index:11000;background-color:#00000080;display:flex;align-items:center;justify-content:center}._modal-mask_1urmj_1._narrow-mode_1urmj_13{background-color:#000000e6}._modal_1urmj_1{width:calc(100vw - 30px);height:calc(100vh - 30px);border-radius:10px;overflow:hidden;background-color:#fff;padding:0 0 15px 15px;display:flex;flex-direction:column}body.dark ._modal_1urmj_1{border:1px solid #fb7299}._modal_1urmj_1._narrow-mode_1urmj_13{width:606px;height:calc(100vh - 10px);border:none}body.dark ._modal_1urmj_1._narrow-mode_1urmj_13{border:none}._modal_1urmj_1 ._modal-header_1urmj_38{padding-top:10px;padding-bottom:10px;border-bottom:none;padding-right:15px;display:flex;align-items:center}._modal_1urmj_1 ._modal-header_1urmj_38 ._modal-title_1urmj_46{font-size:1.5rem;margin-bottom:0;line-height:1.5}body.dark ._modal_1urmj_1 ._modal-header_1urmj_38 ._btn-refresh_1urmj_51,body.dark ._modal_1urmj_1 ._modal-header_1urmj_38 ._btn-close_1urmj_52{color:#eee!important;background-color:#333!important;border-color:transparent!important;height:auto;padding:8px 12px;line-height:16px;font-size:13px}._modal_1urmj_1 ._modal-header_1urmj_38 ._btn-close_1urmj_52{margin-left:10px}._modal_1urmj_1 ._modal-header_1urmj_38 ._btn-close_1urmj_52 svg{width:10px;height:10px}._modal_1urmj_1 ._modal-body_1urmj_68{padding-top:0;flex-grow:1;overflow-y:scroll;padding-right:15px}._list_1urmj_74{color:inherit}._card_1urmj_77{border:2px solid transparent}._card_1urmj_77 .bili-video-card__info{padding-left:2px;padding-bottom:1px;margin-top:calc(var(--info-margin-top) - 1px)}._card_1urmj_77._active_1urmj_85{border-color:#fb7299;border-radius:6px;overflow:hidden}._video-card-list_1urmj_90{display:block!important}#_video-card-body_1urmj_1>*{display:block!important}#_video-card-body_1urmj_1._narrow-mode_1urmj_13{grid-template-columns:repeat(2,1fr)}._loader_1urmj_99{text-align:center;line-height:60px;font-size:120%}._checkbox_1urmj_104{margin-left:5px;margin-top:1px;cursor:pointer;outline:none}._checkbox_1urmj_104+label{margin-left:2px;user-select:none;cursor:pointer}._grid_svuzk_1{color:default;margin-bottom:20px}@media (min-width: 2200px){._video-card-list_svuzk_6.is-full{grid-column:span 7!important}._video-card-list_svuzk_6.is-full .video-card-body.more-class1.more-class2{grid-column:span 7!important;grid-template-columns:repeat(7,1fr)!important}._video-card-list_svuzk_6.is-full .video-card-body.more-class1.more-class2>*{display:block!important}._video-card-list_svuzk_6.is-full .video-card-body.more-class1.more-class2>*:nth-of-type(1n + 15){display:none!important}}._expand-btn_svuzk_20{padding:0;width:31px;height:31px;border-radius:50%}._expand-btn_svuzk_20 svg{width:13px;height:13px;transform:rotate(180deg)}._expand-btn_svuzk_20 svg._expanded_svuzk_31{transform:rotate(0)}.primary-btn[disabled]:active,.primary-btn[disabled]:hover{cursor:wait;background-color:inherit} `); var Hh=Object.defineProperty;var Uh=(b,ne,pe)=>ne in b?Hh(b,ne,{enumerable:!0,configurable:!0,writable:!0,value:pe}):b[ne]=pe;var ht=(b,ne,pe)=>(Uh(b,typeof ne!="symbol"?ne+"":ne,pe),pe);(function(b,ne,pe,Ms){"use strict";const $e=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},Be=$e(b),Ls=$e(ne),pt=$e(pe),Rs=$e(Ms);var Ds=typeof global=="object"&&global&&global.Object===Object&&global;const xn=Ds;var Ns=typeof self=="object"&&self&&self.Object===Object&&self,Fs=xn||Ns||Function("return this")();const re=Fs;var js=re.Symbol;const ie=js;var kn=Object.prototype,Is=kn.hasOwnProperty,zs=kn.toString,xe=ie?ie.toStringTag:void 0;function $s(e){var t=Is.call(e,xe),n=e[xe];try{e[xe]=void 0;var r=!0}catch{}var i=zs.call(e);return r&&(t?e[xe]=n:delete e[xe]),i}var Bs=Object.prototype,Ws=Bs.toString;function Hs(e){return Ws.call(e)}var Us="[object Null]",Ys="[object Undefined]",Pn=ie?ie.toStringTag:void 0;function Se(e){return e==null?e===void 0?Ys:Us:Pn&&Pn in Object(e)?$s(e):Hs(e)}function Te(e){return e!=null&&typeof e=="object"}var Gs="[object Symbol]";function We(e){return typeof e=="symbol"||Te(e)&&Se(e)==Gs}function Ks(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n0){if(++t>=xo)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Lo(e){return function(){return e}}var Ro=function(){try{var e=me(Object,"defineProperty");return e({},"",{}),e}catch{}}();const He=Ro;var Do=He?function(e,t){return He(e,"toString",{configurable:!0,enumerable:!1,value:Lo(t),writable:!0})}:ao,No=Mo(Do);const Fo=No;var jo=9007199254740991,Io=/^(?:0|[1-9]\d*)$/;function bt(e,t){var n=typeof e;return t=t==null?jo:t,!!t&&(n=="number"||n!="symbol"&&Io.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=Uo}function Yo(e){return e!=null&&wt(e.length)&&!Nn(e)}var Go=Object.prototype;function Ko(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Go;return e===n}function Xo(e,t){for(var n=-1,r=Array(e);++n-1}function lc(e,t){var n=this.__data__,r=Ue(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function ce(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t0&&n(c)?t>1?Jn(c,t-1,n,r,i):Xn(i,c):r||(i[i.length]=c)}return i}function Ac(e){var t=e==null?0:e.length;return t?Jn(e,1):[]}function xc(e){return Fo(Ho(e,void 0,Ac),e+"")}function kc(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(i);++r=r?e:kc(e,t,n)}var Mc="\\ud800-\\udfff",Lc="\\u0300-\\u036f",Rc="\\ufe20-\\ufe2f",Dc="\\u20d0-\\u20ff",Nc=Lc+Rc+Dc,Fc="\\ufe0e\\ufe0f",jc="\\u200d",Ic=RegExp("["+jc+Mc+Nc+Fc+"]");function At(e){return Ic.test(e)}function zc(e){return e.split("")}var Zn="\\ud800-\\udfff",$c="\\u0300-\\u036f",Bc="\\ufe20-\\ufe2f",Wc="\\u20d0-\\u20ff",Hc=$c+Bc+Wc,Uc="\\ufe0e\\ufe0f",Yc="["+Zn+"]",xt="["+Hc+"]",kt="\\ud83c[\\udffb-\\udfff]",Gc="(?:"+xt+"|"+kt+")",Qn="[^"+Zn+"]",qn="(?:\\ud83c[\\udde6-\\uddff]){2}",er="[\\ud800-\\udbff][\\udc00-\\udfff]",Kc="\\u200d",tr=Gc+"?",nr="["+Uc+"]?",Xc="(?:"+Kc+"(?:"+[Qn,qn,er].join("|")+")"+nr+tr+")*",Vc=nr+tr+Xc,Jc="(?:"+[Qn+xt+"?",xt,qn,er,Yc].join("|")+")",Zc=RegExp(kt+"(?="+kt+")|"+Jc+Vc,"g");function Qc(e){return e.match(Zc)||[]}function qc(e){return At(e)?Qc(e):zc(e)}function el(){this.__data__=new ce,this.size=0}function tl(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function nl(e){return this.__data__.get(e)}function rl(e){return this.__data__.has(e)}var il=200;function sl(e,t){var n=this.__data__;if(n instanceof ce){var r=n.__data__;if(!Me||r.lengthc))return!1;var a=s.get(e),f=s.get(t);if(a&&f)return a==t&&f==e;var d=-1,p=!0,v=n&kl?new Ke:void 0;for(s.set(e,t),s.set(t,e);++d=t||P<0||d&&D>=s}function O(){var S=Dt();if(y(S))return $(S);c=setTimeout(O,w(S))}function $(S){return c=void 0,p&&r?v(S):(r=i=void 0,o)}function F(){c!==void 0&&clearTimeout(c),a=0,r=u=i=c=void 0}function A(){return c===void 0?o:$(Dt())}function T(){var S=Dt(),P=y(S);if(r=arguments,i=this,u=S,P){if(c===void 0)return g(u);if(d)return clearTimeout(c),c=setTimeout(O,t),v(u)}return c===void 0&&(c=setTimeout(O,t)),o}return T.cancel=F,T.flush=A,T}function au(e,t){return vr(e,t)}function cu(e,t,n,r){if(!ue(e))return e;t=Ge(t,e);for(var i=-1,s=t.length,o=s-1,c=e;c!=null&&++iuu)return n;do t%2&&(n+=e),t=fu(t/2),t&&(e+=e);while(t);return n}var du=nu("length");const hu=du;var _r="\\ud800-\\udfff",pu="\\u0300-\\u036f",gu="\\ufe20-\\ufe2f",mu="\\u20d0-\\u20ff",vu=pu+gu+mu,yu="\\ufe0e\\ufe0f",bu="["+_r+"]",Nt="["+vu+"]",Ft="\\ud83c[\\udffb-\\udfff]",_u="(?:"+Nt+"|"+Ft+")",wr="[^"+_r+"]",Sr="(?:\\ud83c[\\udde6-\\uddff]){2}",Tr="[\\ud800-\\udbff][\\udc00-\\udfff]",wu="\\u200d",Cr=_u+"?",Er="["+yu+"]?",Su="(?:"+wu+"(?:"+[wr,Sr,Tr].join("|")+")"+Er+Cr+")*",Tu=Er+Cr+Su,Cu="(?:"+[wr+Nt+"?",Nt,Sr,Tr,bu].join("|")+")",Or=RegExp(Ft+"(?="+Ft+")|"+Cu+Tu,"g");function Eu(e){for(var t=Or.lastIndex=0;Or.test(e);)++t;return t}function Ar(e){return At(e)?Eu(e):hu(e)}var Ou=Math.ceil;function Au(e,t){t=t===void 0?" ":gt(t);var n=t.length;if(n<2)return n?br(t,e):t;var r=br(t,Ou(e/Ar(t)));return At(t)?Pc(qc(r),0,e).join(""):r.slice(0,e)}function xu(e,t,n){e=Kn(e),t=oo(t);var r=t?Ar(e):0;return t&&rnew Proxy(e,t);const zt=Object.getPrototypeOf,$t=new WeakMap,kr=e=>e&&($t.has(e)?$t.get(e):zt(e)===Object.prototype||zt(e)===Array.prototype),Pr=e=>typeof e=="object"&&e!==null,Mr=new WeakMap,Lr=e=>e[It]||e,Rr=(e,t,n)=>{if(!kr(e))return e;const r=Lr(e),i=(o=>Object.isFrozen(o)||Object.values(Object.getOwnPropertyDescriptors(o)).some(c=>!c.writable))(r);let s=n&&n.get(r);return s&&s[1].f===i||(s=((o,c)=>{const u={f:c};let a=!1;const f=(p,v)=>{if(!a){let g=u.a.get(o);g||(g=new Set,u.a.set(o,g)),v&&g.has(jt)||g.add(p)}},d={get:(p,v)=>v===It?o:(f(v),Rr(p[v],u.a,u.c)),has:(p,v)=>v===Ru?(a=!0,u.a.delete(o),!0):(f(v),v in p),getOwnPropertyDescriptor:(p,v)=>(f(v,!0),Object.getOwnPropertyDescriptor(p,v)),ownKeys:p=>(f(jt),Reflect.ownKeys(p))};return c&&(d.set=d.deleteProperty=()=>!1),[d,u]})(r,i),s[1].p=Du(i?(o=>{let c=Mr.get(o);if(!c){if(Array.isArray(o))c=Array.from(o);else{const u=Object.getOwnPropertyDescriptors(o);Object.values(u).forEach(a=>{a.configurable=!0}),c=Object.create(zt(o),u)}Mr.set(o,c)}return c})(r):r,s[0]),n&&n.set(r,s)),s[1].a=t,s[1].c=n,s[1].p},Nu=(e,t)=>{const n=Reflect.ownKeys(e),r=Reflect.ownKeys(t);return n.length!==r.length||n.some((i,s)=>i!==r[s])},Dr=(e,t,n,r)=>{if(Object.is(e,t))return!1;if(!Pr(e)||!Pr(t))return!0;const i=n.get(Lr(e));if(!i)return!0;if(r){const o=r.get(e);if(o&&o.n===t)return o.g;r.set(e,{n:t,g:!1})}let s=null;for(const o of i){const c=o===jt?Nu(e,t):Dr(e[o],t[o],n,r);if(c!==!0&&c!==!1||(s=c),s)break}return s===null&&(s=!0),r&&r.set(e,{n:t,g:s}),s},Nr=e=>kr(e)&&e[It]||null,Fr=(e,t=!0)=>{$t.set(e,t)};var jr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ir={exports:{}},zr={};/** * @license React * use-sync-external-store-shim.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Ce=Be.default;function ju(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Iu=typeof Object.is=="function"?Object.is:ju,zu=Ce.useState,$u=Ce.useEffect,Bu=Ce.useLayoutEffect,Wu=Ce.useDebugValue;function Hu(e,t){var n=t(),r=zu({inst:{value:n,getSnapshot:t}}),i=r[0].inst,s=r[1];return Bu(function(){i.value=n,i.getSnapshot=t,Bt(i)&&s({inst:i})},[e,n,t]),$u(function(){return Bt(i)&&s({inst:i}),e(function(){Bt(i)&&s({inst:i})})},[e]),Wu(n),n}function Bt(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Iu(e,n)}catch{return!0}}function Uu(e,t){return t()}var Yu=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Uu:Hu;zr.useSyncExternalStore=Ce.useSyncExternalStore!==void 0?Ce.useSyncExternalStore:Yu,function(e){e.exports=zr}(Ir);const Gu=Fu(Ir.exports),Wt=e=>typeof e=="object"&&e!==null,q=Symbol(),Ht=new WeakSet,Ku=(e=Object.is,t=(a,f)=>new Proxy(a,f),n=a=>Wt(a)&&!Ht.has(a)&&(Array.isArray(a)||!(Symbol.iterator in a))&&!(a instanceof WeakMap)&&!(a instanceof WeakSet)&&!(a instanceof Error)&&!(a instanceof Number)&&!(a instanceof Date)&&!(a instanceof String)&&!(a instanceof RegExp)&&!(a instanceof ArrayBuffer),r=a=>{switch(a.status){case"fulfilled":return a.value;case"rejected":throw a.reason;default:throw a}},i=new WeakMap,s=(a,f,d,p=r)=>{const v=i.get(f);if((v==null?void 0:v[0])===d)return v[1];const g=Array.isArray(a)?[]:Object.create(Object.getPrototypeOf(a));return Fr(g,!0),i.set(f,[d,g]),Reflect.ownKeys(a).forEach(w=>{const y=Reflect.get(a,w,f);Ht.has(y)?(Fr(y,!1),g[w]=y):y instanceof Promise?Object.defineProperty(g,w,{get(){return p(y)}}):y!=null&&y[q]?g[w]=Ut(y,p):g[w]=y}),Object.freeze(g)},o=new WeakMap,c=[1],u=a=>{if(!Wt(a))throw new Error("object required");const f=o.get(a);if(f)return f;let d=c[0];const p=new Set,v=(A,T=++c[0])=>{d!==T&&(d=T,p.forEach(S=>S(A,T)))},g=new Map,w=A=>{let T=g.get(A);return T||(T=(S,P)=>{const D=[...S];D[1]=[A,...D[1]],v(D,P)},g.set(A,T)),T},y=A=>{const T=g.get(A);return g.delete(A),T},O=Array.isArray(a)?[]:Object.create(Object.getPrototypeOf(a)),F=t(O,{get(A,T,S){return T===q?[A,S,d,s,p]:Reflect.get(A,T,S)},deleteProperty(A,T){var S;const P=Reflect.get(A,T),D=(S=P==null?void 0:P[q])==null?void 0:S[4];D&&D.delete(y(T));const I=Reflect.deleteProperty(A,T);return I&&v(["delete",[T],P]),I},set(A,T,S,P){var D,I;const z=Reflect.has(A,T),Z=Reflect.get(A,T,P);if(z&&e(Z,S))return!0;const V=(D=Z==null?void 0:Z[q])==null?void 0:D[4];V&&V.delete(y(T)),Wt(S)&&(S=Nr(S)||S);let k=S;return(I=Object.getOwnPropertyDescriptor(A,T))!=null&&I.set||(S instanceof Promise?S.then(E=>{S.status="fulfilled",S.value=E,v(["resolve",[T],E])}).catch(E=>{S.status="rejected",S.reason=E,v(["reject",[T],E])}):(!(S!=null&&S[q])&&n(S)&&(k=Ve(S)),k!=null&&k[q]&&k[q][4].add(w(T)))),Reflect.set(A,T,k,P),v(["set",[T],S,Z]),!0}});return o.set(a,F),Reflect.ownKeys(a).forEach(A=>{const T=Object.getOwnPropertyDescriptor(a,A);T.get||T.set?Object.defineProperty(O,A,T):F[A]=a[A]}),F})=>[u,q,Ht,e,t,n,r,i,s,o,c],[Xu]=Ku();function Ve(e={}){return Xu(e)}function $r(e,t,n){({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"&&!(e!=null&&e[q])&&console.warn("Please use proxy object");let r;const i=[],s=e[q][4],o=c=>{if(i.push(c),n){t(i.splice(0));return}r||(r=Promise.resolve().then(()=>{r=void 0,s.has(o)&&t(i.splice(0))}))};return s.add(o),()=>s.delete(o)}function Ut(e,t){({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"&&!(e!=null&&e[q])&&console.warn("Please use proxy object");const[n,r,i,s]=e[q];return s(n,r,i,t)}const{use:Br}=Be.default,{useSyncExternalStore:Vu}=Gu,Ju=(e,t)=>{const n=[],r=new WeakSet,i=(s,o)=>{if(r.has(s))return;let c;typeof s=="object"&&s!==null&&(r.add(s),c=t.get(Nr(s)||s)),c?c.forEach(u=>{"value"in(Object.getOwnPropertyDescriptor(s,u)||{})&&i(s[u],o?[...o,u]:[u])}):o&&n.push(o)};return i(e),n},Zu=(e,t)=>{const n=b.useRef();b.useEffect(()=>{n.current=Ju(e,t)}),b.useDebugValue(n.current)};function Yt(e,t){const n=t==null?void 0:t.sync,r=b.useRef(),i=b.useRef();let s=!0;const o=Vu(b.useCallback(a=>{const f=$r(e,a,n);return a(),f},[e,n]),()=>{const a=Ut(e,Br);try{if(!s&&r.current&&i.current&&!Dr(r.current,a,i.current,new WeakMap))return r.current}catch{}return a},()=>Ut(e,Br));s=!1;const c=new WeakMap;b.useEffect(()=>{r.current=o,i.current=c}),({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"&&Zu(o,c);const u=b.useMemo(()=>new WeakMap,[]);return Rr(o,c,u)}const Wr={accessKey:"",useNarrowMode:!1,initialShowMore:!1},Hr=Object.keys(Wr),se=Ve(Wr),Gt=function(){return Yt(se)},Ur="bilibili-app-recommend.config";function Qu(){const e=GM_getValue(Ur);e&&typeof e=="object"&&Object.assign(se,xr(e,Hr)),$r(se,()=>{qu()})}function qu(){const e=xr(se,Hr);GM_setValue(Ur,e)}function Yr(e){Object.assign(se,e)}Qu();var Kt={exports:{}};const ef=(e,t)=>Math.floor(Math.random()*(t-e+1)+e),Gr=()=>{const e=new Error("Delay aborted");return e.name="AbortError",e},Kr=({clearTimeout:e,setTimeout:t,willResolve:n})=>(r,{value:i,signal:s}={})=>{if(s&&s.aborted)return Promise.reject(Gr());let o,c,u;const a=e||clearTimeout,f=()=>{a(o),u(Gr())},d=()=>{s&&s.removeEventListener("abort",f)},p=new Promise((v,g)=>{c=()=>{d(),n?v(i):g(i)},u=g,o=(t||setTimeout)(c,r)});return s&&s.addEventListener("abort",f,{once:!0}),p.clear=()=>{a(o),o=null,c()},p},Xr=e=>{const t=Kr({...e,willResolve:!0});return t.reject=Kr({...e,willResolve:!1}),t.range=(n,r,i)=>t(ef(n,r),i),t},Xt=Xr();Xt.createWithTimers=Xr,Kt.exports=Xt,Kt.exports.default=Xt;var Vt,Vr=Ls.default;Vt=Vr.createRoot,Vr.hydrateRoot;const Jr="_toast-container_9119l_1",Kh={toastContainer:Jr};function te(e,t=2e3){const n=document.createElement("div");n.className=Jr,n.innerText=e,document.body.appendChild(n),setTimeout(()=>n.remove(),t)}const tf="\u8BF7\u6C42\u5931\u8D25, \u8BF7\u91CD\u8BD5 !!!",nf="\u64CD\u4F5C\u5931\u8D25, \u8BF7\u91CD\u8BD5 !!!";function Zr(){return te(tf)}function Qr(){return te(nf)}const rf="https://api.bilibili.com",qr="https://app.bilibili.com",Jt=pt.default.create({baseURL:rf});Jt.interceptors.request.use(function(e){var t;return(t=e.params)!=null&&t._||(e.params={...e.params,_:Date.now()}),e},function(e){return Promise.reject(e)});const Je=pt.default.create({adapter:Rs.default});Je.interceptors.request.use(function(e){return e.params={access_key:se.accessKey||"",...e.params},e},function(e){return Promise.reject(e)}),Je.interceptors.response.use(e=>{if(e.config.responseType==="json"&&e.data&&e.data instanceof ArrayBuffer){const t=new TextDecoder,n=new Uint8Array(e.data),r=t.decode(n);e.data=r;try{e.data=JSON.parse(r)}catch{}}return e});var Ze={exports:{}},Zt={exports:{}},ei={},sf=function(t){return t&&typeof t=="object"&&typeof t.copy=="function"&&typeof t.fill=="function"&&typeof t.readUInt8=="function"},Qt={exports:{}};typeof Object.create=="function"?Qt.exports=function(t,n){t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:Qt.exports=function(t,n){t.super_=n;var r=function(){};r.prototype=n.prototype,t.prototype=new r,t.prototype.constructor=t},function(e){var t=/%[sdj%]/g;e.format=function(l){if(!F(l)){for(var h=[],_=0;_=j)return B;switch(B){case"%s":return String(x[_++]);case"%d":return Number(x[_++]);case"%j":try{return JSON.stringify(x[_++])}catch{return"[Circular]"}default:return B}}),R=x[_];_=3&&(_.depth=arguments[2]),arguments.length>=4&&(_.colors=arguments[3]),w(h)?_.showHidden=h:h&&e._extend(_,h),T(_.showHidden)&&(_.showHidden=!1),T(_.depth)&&(_.depth=2),T(_.colors)&&(_.colors=!1),T(_.customInspect)&&(_.customInspect=!0),_.colors&&(_.stylize=s),u(_,l,_.depth)}e.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function s(l,h){var _=i.styles[h];return _?"\x1B["+i.colors[_][0]+"m"+l+"\x1B["+i.colors[_][1]+"m":l}function o(l,h){return l}function c(l){var h={};return l.forEach(function(_,x){h[_]=!0}),h}function u(l,h,_){if(l.customInspect&&h&&z(h.inspect)&&h.inspect!==e.inspect&&!(h.constructor&&h.constructor.prototype===h)){var x=h.inspect(_,l);return F(x)||(x=u(l,x,_)),x}var j=a(l,h);if(j)return j;var M=Object.keys(h),R=c(M);if(l.showHidden&&(M=Object.getOwnPropertyNames(h)),I(h)&&(M.indexOf("message")>=0||M.indexOf("description")>=0))return f(h);if(M.length===0){if(z(h)){var B=h.name?": "+h.name:"";return l.stylize("[Function"+B+"]","special")}if(S(h))return l.stylize(RegExp.prototype.toString.call(h),"regexp");if(D(h))return l.stylize(Date.prototype.toString.call(h),"date");if(I(h))return f(h)}var W="",G=!1,J=["{","}"];if(g(h)&&(G=!0,J=["[","]"]),z(h)){var oe=h.name?": "+h.name:"";W=" [Function"+oe+"]"}if(S(h)&&(W=" "+RegExp.prototype.toString.call(h)),D(h)&&(W=" "+Date.prototype.toUTCString.call(h)),I(h)&&(W=" "+f(h)),M.length===0&&(!G||h.length==0))return J[0]+W+J[1];if(_<0)return S(h)?l.stylize(RegExp.prototype.toString.call(h),"regexp"):l.stylize("[Object]","special");l.seen.push(h);var Y;return G?Y=d(l,h,_,R,M):Y=M.map(function(ee){return p(l,h,_,R,ee,G)}),l.seen.pop(),v(Y,W,J)}function a(l,h){if(T(h))return l.stylize("undefined","undefined");if(F(h)){var _="'"+JSON.stringify(h).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return l.stylize(_,"string")}if($(h))return l.stylize(""+h,"number");if(w(h))return l.stylize(""+h,"boolean");if(y(h))return l.stylize("null","null")}function f(l){return"["+Error.prototype.toString.call(l)+"]"}function d(l,h,_,x,j){for(var M=[],R=0,B=h.length;R-1&&(M?B=B.split(` `).map(function(G){return" "+G}).join(` `).substr(2):B=` `+B.split(` `).map(function(G){return" "+G}).join(` `))):B=l.stylize("[Circular]","special")),T(R)){if(M&&j.match(/^\d+$/))return B;R=JSON.stringify(""+j),R.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(R=R.substr(1,R.length-2),R=l.stylize(R,"name")):(R=R.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),R=l.stylize(R,"string"))}return R+": "+B}function v(l,h,_){var x=l.reduce(function(j,M){return M.indexOf(` `)>=0,j+M.replace(/\u001b\[\d\d?m/g,"").length+1},0);return x>60?_[0]+(h===""?"":h+` `)+" "+l.join(`, `)+" "+_[1]:_[0]+h+" "+l.join(", ")+" "+_[1]}function g(l){return Array.isArray(l)}e.isArray=g;function w(l){return typeof l=="boolean"}e.isBoolean=w;function y(l){return l===null}e.isNull=y;function O(l){return l==null}e.isNullOrUndefined=O;function $(l){return typeof l=="number"}e.isNumber=$;function F(l){return typeof l=="string"}e.isString=F;function A(l){return typeof l=="symbol"}e.isSymbol=A;function T(l){return l===void 0}e.isUndefined=T;function S(l){return P(l)&&V(l)==="[object RegExp]"}e.isRegExp=S;function P(l){return typeof l=="object"&&l!==null}e.isObject=P;function D(l){return P(l)&&V(l)==="[object Date]"}e.isDate=D;function I(l){return P(l)&&(V(l)==="[object Error]"||l instanceof Error)}e.isError=I;function z(l){return typeof l=="function"}e.isFunction=z;function Z(l){return l===null||typeof l=="boolean"||typeof l=="number"||typeof l=="string"||typeof l=="symbol"||typeof l>"u"}e.isPrimitive=Z,e.isBuffer=sf;function V(l){return Object.prototype.toString.call(l)}function k(l){return l<10?"0"+l.toString(10):l.toString(10)}var E=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function C(){var l=new Date,h=[k(l.getHours()),k(l.getMinutes()),k(l.getSeconds())].join(":");return[l.getDate(),E[l.getMonth()],h].join(" ")}e.log=function(){console.log("%s - %s",C(),e.format.apply(e,arguments))},e.inherits=Qt.exports,e._extend=function(l,h){if(!h||!P(h))return l;for(var _=Object.keys(h),x=_.length;x--;)l[_[x]]=h[_[x]];return l};function L(l,h){return Object.prototype.hasOwnProperty.call(l,h)}}(ei);var of=ei.format;function af(){(typeof AbortController>"u"||typeof AbortSignal>"u")&&console.error("[promise.timeout] need global AbortController & AbortSingal")}function cf(e,t){return function(){var n=this,r=[].slice.call(arguments);af();var i=new AbortController;return r.push(i.signal),new Promise(function(s,o){var c=setTimeout(function(){var u=new Qe(t);o(u),i.abort()},t);Promise.resolve(e.apply(n,r)).then(function(u){clearTimeout(c),s(u)},function(u){clearTimeout(c),o(u)})})}}class Qe extends Error{constructor(t){super(),this.timeout=t,this.message=of("timeout of %sms exceed",t),Error.captureStackTrace(this,Qe)}}Zt.exports=cf,Zt.exports.TimeoutError=Qe;const ti=Zt.exports,lf=ti.TimeoutError;Ze.exports=function(t,n){const r=t;n=n||{};const i=n.times||5,s=n.timeout;s&&(t=ti(t,s));const o=n.onerror;return async function(){const c=this,u=[].slice.call(arguments),a=new Array(i);for(let f=0;f"} ${this.times} times`,this.timeout&&(this.message+=` with timeout = ${this.timeout}ms`),Error.captureStackTrace(this,this.constructor)}}class uf extends Error{constructor(t){super(),t instanceof Error?(this.originalError=t,{message:t}=t):(this.originalError=new Error(t),this.originalError.stack=this.stack),this.name="AbortError",this.message=t}}var ff=Ze.exports.RetryError=ni;Ze.exports.TimeoutError=lf;const df="bilibili-app-recommend".toUpperCase();class qt extends Error{constructor(n){super();ht(this,"json");Error.captureStackTrace(this,qt),this.json=n}}async function hf(){const t=(await Je.get(qr+"/x/feed/index",{responseType:"json",params:{build:"1",mobi_app:"android",idx:(Date.now()/1e3).toFixed(0)+"0"+(Math.random()*10).toFixed(0)}})).data;if(!t.data){if(t.code===-663)throw new qt(t);return te(`${df}: \u672A\u77E5\u9519\u8BEF, \u8BF7\u8054\u7CFB\u5F00\u53D1\u8005 code=${t.code} message=${t.message||""}`,1e4),[]}return t.data}const pf=Ze.exports(hf,{times:5,timeout:2e3});async function gf(){try{return await pf()}catch(e){throw e instanceof ff&&(console.error(e.errors),te("\u8BF7\u6C42\u51FA\u9519, \u8BF7\u91CD\u8BD5 !!!")),e}}async function mf(){return en(2)}async function en(e){const t=new Array(e).fill(0).map(i=>gf());let r=(await Promise.all(t)).reduce((i,s)=>i.concat(s||[]),[]);return r=vf(r),r.map(i=>({...i,uniqId:i.param+"-"+crypto.randomUUID()}))}function vf(e){const t=new Set;return e=e.filter(n=>{const{param:r}=n;return t.has(r)?(console.log("[bilibili-app-recommend]: [uniqRecList]: duplicate",n),!1):(t.add(r),!0)}),e}async function yf(){var u,a;const t=(await pt.default.get("https://passport.bilibili.com/login/app/third",{params:{appkey:"27eb53fc9058f8c3",api:"https://www.mcbbs.net/template/mcbbs/image/special_photo_bg.png",sign:"04224646d1fea004e79606d3b038c84a"},withCredentials:!0})).data;if(!((u=t==null?void 0:t.data)!=null&&u.has_login))return{errmsg:"\u4F60\u5FC5\u987B\u767B\u5F55B\u7AD9\u4E4B\u540E\u624D\u80FD\u4F7F\u7528\u6388\u6743",json:t};if(!((a=t==null?void 0:t.data)!=null&&a.confirm_uri))return{errmsg:"\u65E0\u6CD5\u83B7\u5F97\u6388\u6743\u7F51\u5740",json:t};const n=t.data.confirm_uri;let r;const i=new Promise(f=>{window.addEventListener("message",d=>{if(d.origin!="https://www.mcbbs.net"||!d.data)return;const p=d.data.match(/access_key=([0-9a-z]{32})/);if(!p||!p[1])return f({errmsg:"\u6CA1\u6709\u83B7\u5F97\u5339\u914D\u7684\u5BC6\u94A5"});f(p[1])}),r=setTimeout(()=>{f({errmsg:"\u83B7\u53D6\u6388\u6743\u8D85\u65F6"})},10*1e3)}),s=document.createElement("iframe");s.src=n,s.style.display="none",document.body.appendChild(s);function o(){s.remove(),r&&(clearTimeout(r),r=null)}const c=await i;return o(),c}async function bf(){const e=await yf();if(typeof e=="object"&&"errmsg"in e){te(e.errmsg);return}const t=e;return se.accessKey=t,te("\u83B7\u53D6\u6210\u529F"),t}function _f(){se.accessKey="",te("\u5DF2\u5220\u9664 access_key")}var wf=function(t){return function(n,r){var i=b.useRef(!1);t(function(){return function(){i.current=!1}},[]),t(function(){if(!i.current)i.current=!0;else return n()},r)}},Ee=function(t){return typeof t=="function"},Sf=function(t){return typeof t=="string"},ri=function(t){return typeof t=="number"},Tf=!1;const tn=Tf;function U(e){tn&&(Ee(e)||console.error("useMemoizedFn expected parameter is a function, got ".concat(typeof e)));var t=b.useRef(e);t.current=b.useMemo(function(){return e},[e]);var n=b.useRef();return n.current||(n.current=function(){for(var r=[],i=0;i0)&&!(i=r.next()).done;)s.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},si=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r-1&&(s=setTimeout(function(){et.delete(t)},n)),et.set(t,qe(qe({},r),{timer:s}))},Af=function(t){return et.get(t)},tt=new Map,xf=function(t){return tt.get(t)},kf=function(t,n){tt.set(t,n),n.then(function(r){return tt.delete(t),r}).catch(function(){tt.delete(t)})},be={},Pf=function(t,n){be[t]&&be[t].forEach(function(r){return r(n)})},sn=function(t,n){return be[t]||(be[t]=[]),be[t].push(n),function(){var i=be[t].indexOf(n);be[t].splice(i,1)}},Mf=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},Lf=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r0)&&!(i=r.next()).done;)s.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},Ff=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r0)&&!(i=r.next()).done;)s.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},Kf=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r-1&&Fe.splice(n,1)}}if(De){var ci=function(){if(!(!on()||!Vf()))for(var t=0;t0)&&!(i=r.next()).done;)s.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},nd=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r0)&&!(i=r.next()).done;)s.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},cd=function(){var t=ad(b.useState({}),2),n=t[1];return b.useCallback(function(){return n({})},[])};const ld=cd;var de=globalThis&&globalThis.__assign||function(){return de=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&s[s.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]0)&&!(i=r.next()).done;)s.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},Ae=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r0)&&!(i=r.next()).done;)s.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},ui=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r0)&&!(i=r.next()).done;)s.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},fi=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r0)&&!(i=r.next()).done;)s.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s};function hi(e,t){e===void 0&&(e=!1);var n=yd(b.useState(e),2),r=n[0],i=n[1],s=b.useMemo(function(){var o=t===void 0?!e:t,c=function(){return i(function(p){return p===e?o:e})},u=function(p){return i(p)},a=function(){return i(e)},f=function(){return i(o)};return{toggle:c,set:u,setLeft:a,setRight:f}},[]);return[r,s]}var bd=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s};function _d(e){e===void 0&&(e=!1);var t=bd(hi(e),2),n=t[0],r=t[1],i=r.toggle,s=r.set,o=b.useMemo(function(){var c=function(){return s(!0)},u=function(){return s(!1)};return{toggle:i,set:function(f){return s(!!f)},setTrue:c,setFalse:u}},[]);return[n,o]}function nt(e,t){if(!!De){if(!e)return t;var n;return Ee(e)?n=e():"current"in e?n=e.current:n=e,n}}var wd=function(t){var n=function(i,s,o){var c=b.useRef(!1),u=b.useRef([]),a=b.useRef([]),f=b.useRef();t(function(){var d,p=Array.isArray(o)?o:[o],v=p.map(function(g){return nt(g)});if(!c.current){c.current=!0,u.current=v,a.current=s,f.current=i();return}(v.length!==u.current.length||!rn(v,u.current)||!rn(s,a.current))&&((d=f.current)===null||d===void 0||d.call(f),u.current=v,a.current=s,f.current=i())}),Re(function(){var d;(d=f.current)===null||d===void 0||d.call(f),c.current=!1})};return n},Sd=wd(b.useEffect);const pi=Sd;var gi={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(jr,function(){var n=1e3,r=6e4,i=36e5,s="millisecond",o="second",c="minute",u="hour",a="day",f="week",d="month",p="quarter",v="year",g="date",w="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,O=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,$={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(k){var E=["th","st","nd","rd"],C=k%100;return"["+k+(E[(C-20)%10]||E[C]||E[0])+"]"}},F=function(k,E,C){var L=String(k);return!L||L.length>=E?k:""+Array(E+1-L.length).join(C)+k},A={s:F,z:function(k){var E=-k.utcOffset(),C=Math.abs(E),L=Math.floor(C/60),l=C%60;return(E<=0?"+":"-")+F(L,2,"0")+":"+F(l,2,"0")},m:function k(E,C){if(E.date()1)return k(_[0])}else{var x=E.name;S[x]=E,l=x}return!L&&l&&(T=l),l||!L&&T},I=function(k,E){if(P(k))return k.clone();var C=typeof E=="object"?E:{};return C.date=k,C.args=arguments,new Z(C)},z=A;z.l=D,z.i=P,z.w=function(k,E){return I(k,{locale:E.$L,utc:E.$u,x:E.$x,$offset:E.$offset})};var Z=function(){function k(C){this.$L=D(C.locale,null,!0),this.parse(C)}var E=k.prototype;return E.parse=function(C){this.$d=function(L){var l=L.date,h=L.utc;if(l===null)return new Date(NaN);if(z.u(l))return new Date;if(l instanceof Date)return new Date(l);if(typeof l=="string"&&!/Z$/i.test(l)){var _=l.match(y);if(_){var x=_[2]-1||0,j=(_[7]||"0").substring(0,3);return h?new Date(Date.UTC(_[1],x,_[3]||1,_[4]||0,_[5]||0,_[6]||0,j)):new Date(_[1],x,_[3]||1,_[4]||0,_[5]||0,_[6]||0,j)}}return new Date(l)}(C),this.$x=C.x||{},this.init()},E.init=function(){var C=this.$d;this.$y=C.getFullYear(),this.$M=C.getMonth(),this.$D=C.getDate(),this.$W=C.getDay(),this.$H=C.getHours(),this.$m=C.getMinutes(),this.$s=C.getSeconds(),this.$ms=C.getMilliseconds()},E.$utils=function(){return z},E.isValid=function(){return this.$d.toString()!==w},E.isSame=function(C,L){var l=I(C);return this.startOf(L)<=l&&l<=this.endOf(L)},E.isAfter=function(C,L){return I(C)0)&&!(i=r.next()).done;)s.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s};const cn=function(e,t){var n=t||{},r=n.onEnter,i=n.onLeave,s=n.onChange,o=Td(_d(!1),2),c=o[0],u=o[1],a=u.setTrue,f=u.setFalse;return rt("mouseenter",function(){r==null||r(),a(),s==null||s(!0)},{target:e}),rt("mouseleave",function(){i==null||i(),f(),s==null||s(!1)},{target:e}),c};var Cd=function(t,n){return n===void 0&&(n=[]),au(t,n)},Ed=function(t,n,r){var i=b.useRef(),s=b.useRef(0);Cd(n,i.current)||(i.current=n,s.current+=1),pi(t,[s.current],r)};const Od=Ed;var ln=globalThis&&globalThis.__values||function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ad={0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,pausebreak:19,capslock:20,esc:27,space:32,pageup:33,pagedown:34,end:35,home:36,leftarrow:37,uparrow:38,rightarrow:39,downarrow:40,insert:45,delete:46,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,leftwindowkey:91,rightwindowkey:92,selectkey:93,numpad0:96,numpad1:97,numpad2:98,numpad3:99,numpad4:100,numpad5:101,numpad6:102,numpad7:103,numpad8:104,numpad9:105,multiply:106,add:107,subtract:109,decimalpoint:110,divide:111,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123,numlock:144,scrolllock:145,semicolon:186,equalsign:187,comma:188,dash:189,period:190,forwardslash:191,graveaccent:192,openbracket:219,backslash:220,closebracket:221,singlequote:222},un={ctrl:function(t){return t.ctrlKey},shift:function(t){return t.shiftKey},alt:function(t){return t.altKey},meta:function(t){return t.metaKey}};function xd(e){var t=Object.keys(un).reduce(function(n,r){return un[r](e)?n+1:n},0);return[16,17,18,91,92].includes(e.keyCode)?t:t+1}function vi(e,t,n){var r,i;if(!e.key)return!1;if(ri(t))return e.keyCode===t;var s=t.split("."),o=0;try{for(var c=ln(s),u=c.next();!u.done;u=c.next()){var a=u.value,f=un[a],d=Ad[a.toLowerCase()];(f&&f(e)||d&&d===e.keyCode)&&o++}}catch(p){r={error:p}}finally{try{u&&!u.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}return n?o===s.length&&xd(e)===s.length:o===s.length}function kd(e,t){return Ee(e)?e:Sf(e)||ri(e)?function(n){return vi(n,e,t)}:Array.isArray(e)?function(n){return e.some(function(r){return vi(n,r,t)})}:e?function(){return!0}:function(){return!1}}var Pd=["keydown"];function _e(e,t,n){var r=n||{},i=r.events,s=i===void 0?Pd:i,o=r.target,c=r.exactMatch,u=c===void 0?!1:c,a=Le(t),f=Le(e);Od(function(){var d,p,v,g=nt(o,window);if(!!g){var w=function(A){var T,S=kd(f.current,u);if(S(A))return(T=a.current)===null||T===void 0?void 0:T.call(a,A)};try{for(var y=ln(s),O=y.next();!O.done;O=y.next()){var $=O.value;(v=g==null?void 0:g.addEventListener)===null||v===void 0||v.call(g,$,w)}}catch(F){d={error:F}}finally{try{O&&!O.done&&(p=y.return)&&p.call(y)}finally{if(d)throw d.error}}return function(){var F,A,T;try{for(var S=ln(s),P=S.next();!P.done;P=S.next()){var D=P.value;(T=g==null?void 0:g.removeEventListener)===null||T===void 0||T.call(g,D,w)}}catch(I){F={error:I}}finally{try{P&&!P.done&&(A=S.return)&&A.call(S)}finally{if(F)throw F.error}}}}},[s],o)}var Md=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s};function Ld(e){var t=b.useRef(0),n=Md(b.useState(e),2),r=n[0],i=n[1],s=b.useCallback(function(o){cancelAnimationFrame(t.current),t.current=requestAnimationFrame(function(){i(o)})},[]);return Re(function(){cancelAnimationFrame(t.current)}),[r,s]}var Rd=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,s=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s},Dd={screenX:NaN,screenY:NaN,clientX:NaN,clientY:NaN,pageX:NaN,pageY:NaN,elementX:NaN,elementY:NaN,elementH:NaN,elementW:NaN,elementPosX:NaN,elementPosY:NaN};const Nd=function(e){var t=Rd(Ld(Dd),2),n=t[0],r=t[1];return rt("mousemove",function(i){var s=i.screenX,o=i.screenY,c=i.clientX,u=i.clientY,a=i.pageX,f=i.pageY,d={screenX:s,screenY:o,clientX:c,clientY:u,pageX:a,pageY:f,elementX:NaN,elementY:NaN,elementH:NaN,elementW:NaN,elementPosX:NaN,elementPosY:NaN},p=nt(e);if(p){var v=p.getBoundingClientRect(),g=v.left,w=v.top,y=v.width,O=v.height;d.elementPosX=g+window.pageXOffset,d.elementPosY=w+window.pageYOffset,d.elementX=a-d.elementPosX,d.elementY=f-d.elementPosY,d.elementW=y,d.elementH=O}r(d)},{target:function(){return document}}),n};var yi={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r=[],i=0;ii,[i]);const s=m("button",{className:K("primary-btn",bi),onClick:i.toggle,children:m("svg",{className:K({[_i]:r}),children:m("use",{xlinkHref:"#widget-arrow"})})});return N(ot,{children:[s,r&&t]})});var X={exports:{}},Wd="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Hd=Wd,Ud=Hd;function Ti(){}function Ci(){}Ci.resetWarningCache=Ti;var Yd=function(){function e(r,i,s,o,c,u){if(u!==Ud){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Ci,resetWarningCache:Ti};return n.PropTypes=n,n};X.exports=Yd();class fn extends b.Component{constructor(t){super(t),this.scrollListener=this.scrollListener.bind(this),this.eventListenerOptions=this.eventListenerOptions.bind(this),this.mousewheelListener=this.mousewheelListener.bind(this)}componentDidMount(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}componentDidUpdate(){if(this.props.isReverse&&this.loadMore){const t=this.getParentElement(this.scrollComponent);t.scrollTop=t.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}componentWillUnmount(){this.detachScrollListener(),this.detachMousewheelListener()}isPassiveSupported(){let t=!1;const n={get passive(){t=!0}};try{document.addEventListener("test",null,n),document.removeEventListener("test",null,n)}catch{}return t}eventListenerOptions(){let t=this.props.useCapture;return this.isPassiveSupported()?t={useCapture:this.props.useCapture,passive:!0}:t={passive:!1},t}setDefaultLoader(t){this.defaultLoader=t}detachMousewheelListener(){let t=window;this.props.useWindow===!1&&(t=this.scrollComponent.parentNode),t.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}detachScrollListener(){let t=window;this.props.useWindow===!1&&(t=this.getParentElement(this.scrollComponent)),t.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),t.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}getParentElement(t){const n=this.props.getScrollParent&&this.props.getScrollParent();return n!=null?n:t&&t.parentNode}filterProps(t){return t}attachScrollListener(){const t=this.getParentElement(this.scrollComponent);if(!this.props.hasMore||!t)return;let n=window;this.props.useWindow===!1&&(n=t),n.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),n.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),n.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}mousewheelListener(t){t.deltaY===1&&!this.isPassiveSupported()&&t.preventDefault()}scrollListener(){const t=this.scrollComponent,n=window,r=this.getParentElement(t);let i;if(this.props.useWindow){const s=document.documentElement||document.body.parentNode||document.body,o=n.pageYOffset!==void 0?n.pageYOffset:s.scrollTop;this.props.isReverse?i=o:i=this.calculateOffset(t,o)}else this.props.isReverse?i=r.scrollTop:i=t.scrollHeight-r.scrollTop-r.clientHeight;i{this.scrollComponent=O,f&&f(O)};const y=[n];return i&&(c?o?y.unshift(c):y.push(c):this.defaultLoader&&(o?y.unshift(this.defaultLoader):y.push(this.defaultLoader))),Be.default.createElement(r,w,y)}}ht(fn,"propTypes",{children:X.exports.node.isRequired,element:X.exports.node,hasMore:X.exports.bool,initialLoad:X.exports.bool,isReverse:X.exports.bool,loader:X.exports.node,loadMore:X.exports.func.isRequired,pageStart:X.exports.number,ref:X.exports.func,getScrollParent:X.exports.func,threshold:X.exports.number,useCapture:X.exports.bool,useWindow:X.exports.bool}),ht(fn,"defaultProps",{element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null});let je=0;const Gd=()=>{je++,document.body.style.overflow="hidden"},Kd=()=>{je--,je<0&&(je=0),je===0&&(document.body.style.overflow="overlay")},Ei=()=>document.body.classList.contains("dark"),Oi=Ve({value:Ei()}),Xd=function(){return Yt(Oi).value};new MutationObserver(function(){Oi.value=Ei()}).observe(document.body,{attributes:!0,attributeFilter:["class"]});function Ai({show:e,onHide:t,children:n,clsModalMask:r,clsModal:i,hideWhenMaskOnClick:s=!1}){b.useLayoutEffect(()=>{e?Gd():Kd()},[e]);const o=b.useRef(null),c=Xd(),{bg:u,c:a}=b.useMemo(()=>{const g=window.getComputedStyle(document.body)["background-color"],w=window.getComputedStyle(document.body).color;return{bg:g,c:w}},[c]),f=b.useMemo(()=>c?{"--bg":u,"--c":a,backgroundColor:u,color:a}:{},[u,a,c]),d=b.useId(),p=b.useMemo(()=>{const g=document.createElement("div");return g.setAttribute("data-id","base-modal-"+d),document.body.appendChild(g),g},[]),v=U(g=>{var w;(w=o.current)!=null&&w.contains(g.target)||s&&t()});return e?ne.createPortal(m("div",{className:K(r),onClick:v,children:m("div",{className:K(i),style:f,ref:o,children:n})}),p):null}function Vd(e){const t=Ve({data:Array.from(e||[]),has(n){return this.data.some(r=>r[0]===n)},set(n,r){const i=this.data.find(s=>s[0]===n);return i?i[1]=r:this.data.push([n,r]),this},get(n){var r;return(r=this.data.find(i=>i[0]===n))==null?void 0:r[1]},delete(n){const r=this.data.findIndex(i=>i[0]===n);return r===-1?!1:(this.data.splice(r,1),!0)},clear(){this.data.splice(0)},get size(){return this.data.length},toJSON(){return new Map(this.data)},forEach(n){this.data.forEach(r=>{n(r[1],r[0],this)})},keys(){return this.data.map(n=>n[0]).values()},values(){return this.data.map(n=>n[1]).values()},entries(){return new Map(this.data).entries()},get[Symbol.toStringTag](){return"Map"},[Symbol.iterator](){return this.entries()}});return Object.defineProperties(t,{data:{enumerable:!1},size:{enumerable:!1},toJSON:{enumerable:!1}}),Object.seal(t),t}function Jd(){var t;const e=(t=document.cookie.match(/bili_jct=([0-9a-fA-F]{32})/))==null?void 0:t[1];if(!e)throw te("\u627E\u4E0D\u5230 csrf token, \u8BF7\u68C0\u67E5\u662F\u5426\u767B\u5F55"),new Error("\u627E\u4E0D\u5230 csrf token, \u8BF7\u68C0\u67E5\u662F\u5426\u767B\u5F55");return e}const Ie=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,at=typeof AbortController=="function"?AbortController:class{constructor(){this.signal=new xi}abort(){this.signal.dispatchEvent("abort")}},Zd=typeof AbortSignal=="function",Qd=typeof at.AbortSignal=="function",xi=Zd?AbortSignal:Qd?at.AbortController:class{constructor(){this.aborted=!1,this._listeners=[]}dispatchEvent(t){if(t==="abort"){this.aborted=!0;const n={type:t,target:this};this.onabort(n),this._listeners.forEach(r=>r(n),this)}}onabort(){}addEventListener(t,n){t==="abort"&&this._listeners.push(n)}removeEventListener(t,n){t==="abort"&&(this._listeners=this._listeners.filter(r=>r!==n))}},dn=new Set,hn=(e,t)=>{const n=`LRU_CACHE_OPTION_${e}`;ct(n)&&gn(n,`${e} option`,`options.${t}`,we)},pn=(e,t)=>{const n=`LRU_CACHE_METHOD_${e}`;if(ct(n)){const{prototype:r}=we,{get:i}=Object.getOwnPropertyDescriptor(r,e);gn(n,`${e} method`,`cache.${t}()`,i)}},qd=(e,t)=>{const n=`LRU_CACHE_PROPERTY_${e}`;if(ct(n)){const{prototype:r}=we,{get:i}=Object.getOwnPropertyDescriptor(r,e);gn(n,`${e} property`,`cache.${t}`,i)}},ki=(...e)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...e):console.error(...e)},ct=e=>!dn.has(e),gn=(e,t,n,r)=>{dn.add(e);const i=`The ${t} is deprecated. Please use ${n} instead.`;ki(i,"DeprecationWarning",e,r)},he=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),Pi=e=>he(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?lt:null:null;class lt extends Array{constructor(t){super(t),this.fill(0)}}class eh{constructor(t){if(t===0)return[];const n=Pi(t);this.heap=new n(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}}class we{constructor(t={}){const{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:c,allowStale:u,dispose:a,disposeAfter:f,noDisposeOnSet:d,noUpdateTTL:p,maxSize:v=0,maxEntrySize:g=0,sizeCalculation:w,fetchMethod:y,fetchContext:O,noDeleteOnFetchRejection:$,noDeleteOnStaleGet:F}=t,{length:A,maxAge:T,stale:S}=t instanceof we?{}:t;if(n!==0&&!he(n))throw new TypeError("max option must be a nonnegative integer");const P=n?Pi(n):Array;if(!P)throw new Error("invalid max value: "+n);if(this.max=n,this.maxSize=v,this.maxEntrySize=g||this.maxSize,this.sizeCalculation=w||A,this.sizeCalculation){if(!this.maxSize&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=y||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=O,!this.fetchMethod&&O!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(n).fill(null),this.valList=new Array(n).fill(null),this.next=new P(n),this.prev=new P(n),this.head=0,this.tail=0,this.free=new eh(n),this.initialFill=1,this.size=0,typeof a=="function"&&(this.dispose=a),typeof f=="function"?(this.disposeAfter=f,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!$,this.maxEntrySize!==0){if(this.maxSize!==0&&!he(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!he(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!u||!!S,this.noDeleteOnStaleGet=!!F,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!c,this.ttlResolution=he(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||T||0,this.ttl){if(!he(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){const D="LRU_CACHE_UNBOUNDED";ct(D)&&(dn.add(D),ki("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",D,we))}S&&hn("stale","allowStale"),T&&hn("maxAge","ttl"),A&&hn("length","sizeCalculation")}getRemainingTTL(t){return this.has(t,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new lt(this.max),this.starts=new lt(this.max),this.setItemTTL=(r,i,s=Ie.now())=>{if(this.starts[r]=i!==0?s:0,this.ttls[r]=i,i!==0&&this.ttlAutopurge){const o=setTimeout(()=>{this.isStale(r)&&this.delete(this.keyList[r])},i+1);o.unref&&o.unref()}},this.updateItemAge=r=>{this.starts[r]=this.ttls[r]!==0?Ie.now():0};let t=0;const n=()=>{const r=Ie.now();if(this.ttlResolution>0){t=r;const i=setTimeout(()=>t=0,this.ttlResolution);i.unref&&i.unref()}return r};this.getRemainingTTL=r=>{const i=this.keyMap.get(r);return i===void 0?0:this.ttls[i]===0||this.starts[i]===0?1/0:this.starts[i]+this.ttls[i]-(t||n())},this.isStale=r=>this.ttls[r]!==0&&this.starts[r]!==0&&(t||n())-this.starts[r]>this.ttls[r]}updateItemAge(t){}setItemTTL(t,n,r){}isStale(t){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new lt(this.max),this.removeItemSize=t=>{this.calculatedSize-=this.sizes[t],this.sizes[t]=0},this.requireSize=(t,n,r,i)=>{if(this.isBackgroundFetch(n))return 0;if(!he(r))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(r=i(n,t),!he(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer)");return r},this.addItemSize=(t,n)=>{if(this.sizes[t]=n,this.maxSize){const r=this.maxSize-this.sizes[t];for(;this.calculatedSize>r;)this.evict(!0)}this.calculatedSize+=this.sizes[t]}}removeItemSize(t){}addItemSize(t,n){}requireSize(t,n,r,i){if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}*indexes({allowStale:t=this.allowStale}={}){if(this.size)for(let n=this.tail;!(!this.isValidIndex(n)||((t||!this.isStale(n))&&(yield n),n===this.head));)n=this.prev[n]}*rindexes({allowStale:t=this.allowStale}={}){if(this.size)for(let n=this.head;!(!this.isValidIndex(n)||((t||!this.isStale(n))&&(yield n),n===this.tail));)n=this.next[n]}isValidIndex(t){return this.keyMap.get(this.keyList[t])===t}*entries(){for(const t of this.indexes())yield[this.keyList[t],this.valList[t]]}*rentries(){for(const t of this.rindexes())yield[this.keyList[t],this.valList[t]]}*keys(){for(const t of this.indexes())yield this.keyList[t]}*rkeys(){for(const t of this.rindexes())yield this.keyList[t]}*values(){for(const t of this.indexes())yield this.valList[t]}*rvalues(){for(const t of this.rindexes())yield this.valList[t]}[Symbol.iterator](){return this.entries()}find(t,n={}){for(const r of this.indexes())if(t(this.valList[r],this.keyList[r],this))return this.get(this.keyList[r],n)}forEach(t,n=this){for(const r of this.indexes())t.call(n,this.valList[r],this.keyList[r],this)}rforEach(t,n=this){for(const r of this.rindexes())t.call(n,this.valList[r],this.keyList[r],this)}get prune(){return pn("prune","purgeStale"),this.purgeStale}purgeStale(){let t=!1;for(const n of this.rindexes({allowStale:!0}))this.isStale(n)&&(this.delete(this.keyList[n]),t=!0);return t}dump(){const t=[];for(const n of this.indexes({allowStale:!0})){const r=this.keyList[n],i=this.valList[n],o={value:this.isBackgroundFetch(i)?i.__staleWhileFetching:i};if(this.ttls){o.ttl=this.ttls[n];const c=Ie.now()-this.starts[n];o.start=Math.floor(Date.now()-c)}this.sizes&&(o.size=this.sizes[n]),t.unshift([r,o])}return t}load(t){this.clear();for(const[n,r]of t){if(r.start){const i=Date.now()-r.start;r.start=Ie.now()-i}this.set(n,r.value,r)}}dispose(t,n,r){}set(t,n,{ttl:r=this.ttl,start:i,noDisposeOnSet:s=this.noDisposeOnSet,size:o=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL}={}){if(o=this.requireSize(t,n,o,c),this.maxEntrySize&&o>this.maxEntrySize)return this.delete(t),this;let a=this.size===0?void 0:this.keyMap.get(t);if(a===void 0)a=this.newIndex(),this.keyList[a]=t,this.valList[a]=n,this.keyMap.set(t,a),this.next[this.tail]=a,this.prev[a]=this.tail,this.tail=a,this.size++,this.addItemSize(a,o),u=!1;else{const f=this.valList[a];n!==f&&(this.isBackgroundFetch(f)?f.__abortController.abort():s||(this.dispose(f,t,"set"),this.disposeAfter&&this.disposed.push([f,t,"set"])),this.removeItemSize(a),this.valList[a]=n,this.addItemSize(a,o)),this.moveToTail(a)}if(r!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),u||this.setItemTTL(a,r,i),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){const t=this.valList[this.head];return this.evict(!0),t}}evict(t){const n=this.head,r=this.keyList[n],i=this.valList[n];return this.isBackgroundFetch(i)?i.__abortController.abort():(this.dispose(i,r,"evict"),this.disposeAfter&&this.disposed.push([i,r,"evict"])),this.removeItemSize(n),t&&(this.keyList[n]=null,this.valList[n]=null,this.free.push(n)),this.head=this.next[n],this.keyMap.delete(r),this.size--,n}has(t,{updateAgeOnHas:n=this.updateAgeOnHas}={}){const r=this.keyMap.get(t);return r!==void 0&&!this.isStale(r)?(n&&this.updateItemAge(r),!0):!1}peek(t,{allowStale:n=this.allowStale}={}){const r=this.keyMap.get(t);if(r!==void 0&&(n||!this.isStale(r))){const i=this.valList[r];return this.isBackgroundFetch(i)?i.__staleWhileFetching:i}}backgroundFetch(t,n,r,i){const s=n===void 0?void 0:this.valList[n];if(this.isBackgroundFetch(s))return s;const o=new at,c={signal:o.signal,options:r,context:i},u=p=>(o.signal.aborted||this.set(t,p,c.options),p),a=p=>{if(this.valList[n]===d&&(!r.noDeleteOnFetchRejection||d.__staleWhileFetching===void 0?this.delete(t):this.valList[n]=d.__staleWhileFetching),d.__returned===d)throw p},f=p=>p(this.fetchMethod(t,s,c)),d=new Promise(f).then(u,a);return d.__abortController=o,d.__staleWhileFetching=s,d.__returned=null,n===void 0?(this.set(t,d,c.options),n=this.keyMap.get(t)):this.valList[n]=d,d}isBackgroundFetch(t){return t&&typeof t=="object"&&typeof t.then=="function"&&Object.prototype.hasOwnProperty.call(t,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(t,"__returned")&&(t.__returned===t||t.__returned===null)}async fetch(t,{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:c=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:a=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,fetchContext:d=this.fetchContext,forceRefresh:p=!1}={}){if(!this.fetchMethod)return this.get(t,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i});const v={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:s,noDisposeOnSet:o,size:c,sizeCalculation:u,noUpdateTTL:a,noDeleteOnFetchRejection:f};let g=this.keyMap.get(t);if(g===void 0){const w=this.backgroundFetch(t,g,v,d);return w.__returned=w}else{const w=this.valList[g];if(this.isBackgroundFetch(w))return n&&w.__staleWhileFetching!==void 0?w.__staleWhileFetching:w.__returned=w;if(!p&&!this.isStale(g))return this.moveToTail(g),r&&this.updateItemAge(g),w;const y=this.backgroundFetch(t,g,v,d);return n&&y.__staleWhileFetching!==void 0?y.__staleWhileFetching:y.__returned=y}}get(t,{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet}={}){const s=this.keyMap.get(t);if(s!==void 0){const o=this.valList[s],c=this.isBackgroundFetch(o);return this.isStale(s)?c?n?o.__staleWhileFetching:void 0:(i||this.delete(t),n?o:void 0):c?void 0:(this.moveToTail(s),r&&this.updateItemAge(s),o)}}connect(t,n){this.prev[n]=t,this.next[t]=n}moveToTail(t){t!==this.tail&&(t===this.head?this.head=this.next[t]:this.connect(this.prev[t],this.next[t]),this.connect(this.tail,t),this.tail=t)}get del(){return pn("del","delete"),this.delete}delete(t){let n=!1;if(this.size!==0){const r=this.keyMap.get(t);if(r!==void 0)if(n=!0,this.size===1)this.clear();else{this.removeItemSize(r);const i=this.valList[r];this.isBackgroundFetch(i)?i.__abortController.abort():(this.dispose(i,t,"delete"),this.disposeAfter&&this.disposed.push([i,t,"delete"])),this.keyMap.delete(t),this.keyList[r]=null,this.valList[r]=null,r===this.tail?this.tail=this.prev[r]:r===this.head?this.head=this.next[r]:(this.next[this.prev[r]]=this.next[r],this.prev[this.next[r]]=this.prev[r]),this.size--,this.free.push(r)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return n}clear(){for(const t of this.rindexes({allowStale:!0})){const n=this.valList[t];if(this.isBackgroundFetch(n))n.__abortController.abort();else{const r=this.keyList[t];this.dispose(n,r,"delete"),this.disposeAfter&&this.disposed.push([n,r,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return pn("reset","clear"),this.clear}get length(){return qd("length","size"),this.size}static get AbortController(){return at}static get AbortSignal(){return xi}}var th=we;const nh=th;async function rh(e){return(await Jt.get("/pvideo",{params:{aid:e}})).data.data}async function ih(e){return[]}const mn=new nh({max:200});async function sh(e){if(mn.has(e))return mn.get(e);const[t,n]=await Promise.all([rh(e),ih()]);return mn.set(e,{pvideoData:t,dmData:n}),{pvideoData:t,dmData:n}}function Mi(e){return async function(n){const r=new FormData;r.append("aid",n),r.append("csrf",Jd());const s=(await Jt.post("/x/v2/history/toview/"+e,r,{withCredentials:!0})).data;return(s==null?void 0:s.code)===0&&(s==null?void 0:s.message)==="0"}}const oh=Mi("add"),ah=Mi("del"),Li=e=>{const t={dislike:"/x/feed/dislike",cancel:"/x/feed/dislike/cancel"}[e];return async function(n,r){var c;const s=(await Je.get(qr+t,{params:{goto:n.goto,id:n.param,mid:n.mid,rid:n.tid,tag_id:(c=n.tag)==null?void 0:c.tag_id,reason_id:r,build:"1",mobi_app:"android",idx:(Date.now()/1e3).toFixed(0)}})).data;return(s==null?void 0:s.code)===0&&(s==null?void 0:s.message)==="0"}},ch=Li("dislike"),lh=Li("cancel"),Ri="_modal-mask_vh629_1",Di="_modal_vh629_1",Ni="_modal-header_vh629_23",Fi="_modal-title_vh629_30",ji="_title-desc_vh629_35",Ii="_btn-close_vh629_39",zi="_modal-body_vh629_57",$i="_reason-list_vh629_62",Bi="_reason_vh629_62",Qh={modalMask:Ri,modal:Di,modalHeader:Ni,modalTitle:Fi,titleDesc:ji,btnClose:Ii,modalBody:zi,reasonList:$i,reason:Bi},vn=Vd();function uh(){return Yt(vn)}function fh(e){const t=uh();if(!!e)return t.get(e)}function dh({show:e,onHide:t,item:n}){const[r,i]=b.useState(!1),s=U(async(c,u)=>{if(!n)return;let a=!1,f=null;try{i(!0),a=await ch(n,c)}catch(d){f=d}finally{i(!1)}if(f)return console.error(f.stack||f),Zr();a?te("\u5DF2\u6807\u8BB0\u4E0D\u60F3\u770B"):Qr(),a&&(vn.set(n.param,{id:c,name:u}),t())}),o=b.useMemo(()=>{var c;return[...(c=n==null?void 0:n.dislike_reasons)!=null?c:[],{reason_id:12,reason_name:"\u6B64\u7C7B\u5185\u5BB9\u8FC7\u591A"},{reason_id:13,reason_name:"\u63A8\u8350\u8FC7"}]},[n]);return N(Ai,{show:e,onHide:t,clsModalMask:Ri,clsModal:Di,hideWhenMaskOnClick:!0,children:[N("div",{className:Ni,children:[N("div",{className:Fi,children:["\u6211\u4E0D\u60F3\u770B",m("span",{className:ji,children:"(\u9009\u62E9\u540E\u5C06\u51CF\u5C11\u76F8\u4F3C\u5185\u5BB9\u63A8\u8350)"})]}),m("div",{className:"space",style:{flex:1}}),N("button",{className:`primary-btn roll-btn ${Ii}`,onClick:t,children:[m("svg",{style:{transform:"rotate(0deg)"},children:m("use",{xlinkHref:"#widget-close"})}),m("span",{children:"\u5173\u95ED"})]})]}),m("div",{className:zi,children:m("div",{className:$i,children:o.map(c=>m("button",{className:Bi,"data-id":c.reason_id,onClick:()=>s(c.reason_id,c.reason_name),disabled:r,children:c.reason_name},c.reason_id))})})]})}const Wi={show:!1,onHide:Hi,item:null};function Hi(){Ui({show:!1,item:null})}function Ui(e){Object.assign(Wi,e),hh().render(m(dh,{...Wi,onHide:Hi}))}let yn;function hh(){if(!yn){const e=document.createElement("div");e.classList.add("show-dislike-container"),document.body.appendChild(e),yn=Vt(e)}return yn}function ph(e){Ui({show:!0,item:e})}function gh(e){if(!e)return"00:00";const t=Math.trunc(e/3600);e-=t*3600;const n=Math.trunc(e/60);e-=n*60;const i=[t,n,e];return i[0]===0&&i.shift(),i.map(o=>xu(o.toString(),2,"0")).join(":")}function bn(e){if(!e)return"";if(e<=9999)return e.toString();let t=(e/1e4).toFixed(1);return t=t.replace(/\.0$/,""),`${t}\u4E07`}var mh=["size","strokeWidth","strokeLinecap","strokeLinejoin","theme","fill","className","spin"];function Yi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Gi(e){for(var t=1;t=0)&&(!Object.prototype.propertyIsEnumerable.call(e,r)||(n[r]=e[r]))}return n}function bh(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s=0)&&(n[i]=e[i]);return n}var _h={size:"1em",strokeWidth:4,strokeLinecap:"round",strokeLinejoin:"round",rtl:!1,theme:"outline",colors:{outline:{fill:"#333",background:"transparent"},filled:{fill:"#333",background:"#FFF"},twoTone:{fill:"#333",twoTone:"#2F88FF"},multiColor:{outStrokeColor:"#333",outFillColor:"#2F88FF",innerStrokeColor:"#FFF",innerFillColor:"#43CCF8"}},prefix:"i"};function wh(){return"icon-"+((1+Math.random())*4294967296|0).toString(16).substring(1)}function Sh(e,t,n){var r=typeof t.fill=="string"?[t.fill]:t.fill||[],i=[],s=t.theme||n.theme;switch(s){case"outline":i.push(typeof r[0]=="string"?r[0]:"currentColor"),i.push("none"),i.push(typeof r[0]=="string"?r[0]:"currentColor"),i.push("none");break;case"filled":i.push(typeof r[0]=="string"?r[0]:"currentColor"),i.push(typeof r[0]=="string"?r[0]:"currentColor"),i.push("#FFF"),i.push("#FFF");break;case"two-tone":i.push(typeof r[0]=="string"?r[0]:"currentColor"),i.push(typeof r[1]=="string"?r[1]:n.colors.twoTone.twoTone),i.push(typeof r[0]=="string"?r[0]:"currentColor"),i.push(typeof r[1]=="string"?r[1]:n.colors.twoTone.twoTone);break;case"multi-color":i.push(typeof r[0]=="string"?r[0]:"currentColor"),i.push(typeof r[1]=="string"?r[1]:n.colors.multiColor.outFillColor),i.push(typeof r[2]=="string"?r[2]:n.colors.multiColor.innerStrokeColor),i.push(typeof r[3]=="string"?r[3]:n.colors.multiColor.innerFillColor);break}return{size:t.size||n.size,strokeWidth:t.strokeWidth||n.strokeWidth,strokeLinecap:t.strokeLinecap||n.strokeLinecap,strokeLinejoin:t.strokeLinejoin||n.strokeLinejoin,colors:i,id:e}}var Ki=b.createContext(_h);Ki.Provider;function Xi(e,t,n){return function(r){var i=r.size,s=r.strokeWidth,o=r.strokeLinecap,c=r.strokeLinejoin,u=r.theme,a=r.fill,f=r.className,d=r.spin,p=yh(r,mh),v=b.useContext(Ki),g=b.useMemo(wh,[]),w=Sh(g,{size:i,strokeWidth:s,strokeLinecap:o,strokeLinejoin:c,theme:u,fill:a},v),y=[v.prefix+"-icon"];return y.push(v.prefix+"-icon-"+e),t&&v.rtl&&y.push(v.prefix+"-icon-rtl"),d&&y.push(v.prefix+"-icon-spin"),f&&y.push(f),m("span",{...Gi(Gi({},p),{},{className:y.join(" ")}),children:n(w)})}}const Th=Xi("distraught-face",!1,function(e){return N("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none",children:[m("path",{d:"M24 44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4C12.9543 4 4 12.9543 4 24C4 35.0457 12.9543 44 24 44Z",fill:e.colors[1],stroke:e.colors[0],strokeWidth:e.strokeWidth,strokeLinejoin:e.strokeLinejoin}),m("path",{d:"M24 29C29 29 31 33 31 33H17C17 33 19 29 24 29Z",stroke:e.colors[2],strokeWidth:e.strokeWidth,strokeLinecap:e.strokeLinecap,strokeLinejoin:e.strokeLinejoin}),m("path",{d:"M32 17L29 20L32 23",stroke:e.colors[2],strokeWidth:e.strokeWidth,strokeLinecap:e.strokeLinecap,strokeLinejoin:e.strokeLinejoin}),m("path",{d:"M16 17L19 20L16 23",stroke:e.colors[2],strokeWidth:e.strokeWidth,strokeLinecap:e.strokeLinecap,strokeLinejoin:e.strokeLinejoin})]})}),Ch=Xi("return",!0,function(e){return N("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none",children:[m("path",{d:"M12.9998 8L6 14L12.9998 21",stroke:e.colors[0],strokeWidth:e.strokeWidth,strokeLinecap:e.strokeLinecap,strokeLinejoin:e.strokeLinejoin}),m("path",{d:"M6 14H28.9938C35.8768 14 41.7221 19.6204 41.9904 26.5C42.2739 33.7696 36.2671 40 28.9938 40H11.9984",stroke:e.colors[0],strokeWidth:e.strokeWidth,strokeLinecap:e.strokeLinecap,strokeLinejoin:e.strokeLinejoin})]})}),Vi="_bili-video-card_1a93a_1",Ji="_image-wrapper_1a93a_4",Zi="_preview-card-wrapper_1a93a_8",Qi="_preview-card-inner_1a93a_21",qi="_watch-later_1a93a_25",es="_badge_1a93a_28",ts="_recommend-reason_1a93a_36",ns="_bangumi-desc_1a93a_51",rs="_btn-dislike_1a93a_54",is="_btn-dislike-icon_1a93a_69",ss="_btn-dislike-tip_1a93a_76",os="_disliked-wrapper_1a93a_91",as="_dislike-content-cover_1a93a_105",cs="_dislike-content-cover-inner_1a93a_111",ls="_dislike-icon_1a93a_122",us="_dislike-reason_1a93a_125",fs="_dislike-desc_1a93a_129",ds="_dislike-content-action_1a93a_133",qh={biliVideoCard:Vi,imageWrapper:Ji,previewCardWrapper:Zi,previewCardInner:Qi,watchLater:qi,badge:es,recommendReason:ts,bangumiDesc:ns,btnDislike:rs,btnDislikeIcon:is,btnDislikeTip:ss,dislikedWrapper:os,dislikeContentCover:as,dislikeContentCoverInner:cs,dislikeIcon:ls,dislikeReason:us,dislikeDesc:fs,dislikeContentAction:ds};function _n(e,t){return isNaN(e)?t:e}function Eh({className:e,item:t,pvideo:n,enterCursorState:r}){const i=b.useRef(null),s=Nd(i),o={item:t,pvideo:n,cursorState:s,elWidth:_n(s.elementW,r.width),elHeight:_n(s.elementH,r.height),relativeX:_n(s.elementX,r.relativeX)};return m("div",{ref:i,className:K(Zi,e),children:n?m(Oh,{...o}):!1})}function Oh({item:e,pvideo:t,elWidth:n,elHeight:r,relativeX:i}){var S;let s=0,o=0;n&&i&&!isNaN(i)&&!isNaN(n)&&(s=i/n,s<0&&(s=0),s>1&&(s=1),o=Math.floor((e.duration||0)*s));let c=b.useMemo(()=>{const P=(t==null?void 0:t.index)||[];let D=xh(P,o);return D!==-1?D:o>P[P.length-1]?(D=Math.floor(P.length*s)-1,D<0&&(D=0),D):0},[t,o]);const{img_x_len:u,img_y_len:a,img_x_size:f,img_y_size:d}=t,p=a*u;c=c+1;const v=Math.floor(c/p),g=c-v*p,w=((S=t.image)==null?void 0:S[v])||"",y=Math.floor(g/u)+1,O=g-(y-1)*u,$=n*u,F=r*a,A=(y-1)*r,T=(O-1)*n;return m("div",{className:Qi,style:{backgroundColor:"black",backgroundImage:`url(${w})`,backgroundPosition:`-${T}px -${A}px`,backgroundSize:`${$}px ${F}px`},children:m(Ah,{progress:s})})}function Ah({progress:e}){return m("div",{className:"track",style:{position:"absolute",bottom:0,left:0,backgroundColor:"#eee",width:"100%",height:2},children:m("div",{className:"bar",style:{backgroundColor:"#fa6a9d",height:"100%",width:`${e*100}%`}})})}function xh(e,t){var c;let n=0,r=e.length-1,i=-1;for(;n<=r;){const u=Math.floor((n+r)/2),a=e[u];if(t===a)return u;a{if(!e)return"";const t=mi.unix(e);return t.format("YYYY")===kh?t.format("M-D"):t.format("YY-M-D")},Mh=e=>e.replace(/^http:\/\//,"https://"),wn=b.memo(function({style:t,className:n,item:r,loading:i}){i=i!=null?i:!r;const s=N("div",{className:K("bili-video-card__skeleton",{hide:!i}),children:[m("div",{className:"bili-video-card__skeleton--cover"}),m("div",{className:"bili-video-card__skeleton--info",children:N("div",{className:"bili-video-card__skeleton--right",children:[m("p",{className:"bili-video-card__skeleton--text"}),m("p",{className:"bili-video-card__skeleton--text short"}),m("p",{className:"bili-video-card__skeleton--light"})]})})]}),o=fh(r==null?void 0:r.param);return N("div",{style:t,className:K("bili-video-card",Vi,n),"data-report":"partition_recommend.content",children:[s,!i&&r&&(o?m(Lh,{item:r,dislikedReason:o}):m(Rh,{item:r}))]})}),Lh=b.memo(function({dislikedReason:t,item:n}){const r=U(async()=>{if(!(t!=null&&t.id))return;let i=!1,s=null;try{i=await lh(n,t.id)}catch(o){s=o}if(s)return console.error(s.stack||s),Zr();i?te("\u5DF2\u64A4\u9500"):Qr(),i&&vn.delete(n.param)});return N("div",{className:K(os),children:[m("div",{className:as,children:N("div",{className:cs,children:[m(Th,{theme:"outline",size:"32",fill:"#333",className:ls}),m("div",{className:us,children:t==null?void 0:t.name}),m("div",{className:fs,children:"\u5C06\u51CF\u5C11\u6B64\u7C7B\u5185\u5BB9\u63A8\u8350"})]})}),m("div",{className:ds,children:N("button",{onClick:r,children:[m(Ch,{theme:"outline",size:"16",fill:"#333",style:{marginRight:4,fontSize:0,marginTop:-2}}),"\u64A4\u9500"]})})]})}),Rh=b.memo(function({item:t}){const n=b.useRef(null),[r,i]=b.useState(()=>({width:0,height:0,relativeX:0}));rt("mouseenter",Q=>{var Ps;const ft=(Ps=n.current)==null?void 0:Ps.getBoundingClientRect();if(!ft)return;const{width:dt,height:An,x:Wh}=ft;i({width:dt,height:An,relativeX:Q.pageX-window.pageXOffset-Wh})},{target:n});const s=cn(n),o=b.useRef(null),c=cn(o),[u,a]=b.useState(!1),{accessKey:f}=Gt(),d=Boolean(f),{param:p,title:v,cover:g,goto:w,play:y,like:O,coin:$,desc:F,danmaku:A,ctime:T,duration:S,name:P,face:D,mid:I,favorite:z,badge:Z,rcmd_reason:V}=t,k=b.useMemo(()=>Ph(T),[T]),E=b.useMemo(()=>Mh(g),[g]),[C,L]=b.useState(null),[l,h]=b.useState(!1),_=U(async()=>{if(!C&&!l)try{h(!0);const Q=await sh(p);L(Q)}finally{h(!1)}});b.useEffect(()=>{s&&_()},[s]);let x=!1;const j=U(async Q=>{if(Q.preventDefault(),x)return;x=!0;const ft=u?ah:oh;let dt=!1;try{dt=await ft(p)}finally{x=!1}dt&&a(An=>!An)}),M=b.useRef(null),R=cn(M),B=U(Q=>{Q.stopPropagation(),Q.preventDefault(),ph(t)}),W=t.goto==="bangumi",G=t.goto==="av",J=G?`/video/av${p}`:t.uri,oe=b.useMemo(()=>gh(S),[S]),Y=b.useMemo(()=>bn(y),[y]),ee=b.useMemo(()=>bn(O),[O]),ze=b.useMemo(()=>bn(z),[z]);return N("div",{className:"bili-video-card__wrap __scale-wrap",children:[m("a",{href:J,target:"_blank","data-mod":"partition_recommend","data-idx":"content","data-ext":"click",children:N("div",{className:"bili-video-card__image __scale-player-wrap",ref:n,children:[N("div",{className:K("bili-video-card__image--wrap",Ji),children:[N("picture",{className:"v-img bili-video-card__cover",children:[m("source",{srcSet:`${E}@672w_378h_1c.webp`,type:"image/webp"}),m("img",{src:`${E}@672w_378h_1c.webp`,alt:v,loading:"lazy"})]}),s&&m(Eh,{item:t,pvideo:C==null?void 0:C.pvideoData,enterCursorState:r}),N("div",{className:`bili-watch-later ${qi}`,style:{display:s?"flex":"none"},ref:o,onClick:j,children:[m("svg",{className:"bili-watch-later__icon",children:m("use",{xlinkHref:u?"#widget-watch-save":"#widget-watch-later"})}),m("span",{className:"bili-watch-later__tip",style:{display:c?"block":"none"},children:u?"\u79FB\u9664":"\u7A0D\u540E\u518D\u770B"})]}),d&&N("div",{ref:M,className:rs,onClick:B,style:{display:s?"flex":"none"},children:[m("svg",{className:is,children:m("use",{xlinkHref:"#widget-close"})}),m("span",{className:ss,style:{display:R?"block":"none"},children:"\u6211\u4E0D\u60F3\u770B"})]})]}),m("div",{className:"bili-video-card__mask",children:N("div",{className:"bili-video-card__stats",children:[N("div",{className:"bili-video-card__stats--left",children:[N("span",{className:"bili-video-card__stats--item",children:[m("svg",{className:"bili-video-card__stats--icon",children:m("use",{xlinkHref:"#widget-play-count"})}),m("span",{className:"bili-video-card__stats--text",children:Y})]}),m("span",{className:"bili-video-card__stats--item",children:w==="av"?N(ot,{children:[m("svg",{className:"bili-video-card__stats--icon",children:m("use",{xlinkHref:"#widget-agree"})}),m("span",{className:"bili-video-card__stats--text",children:ee})]}):N(ot,{children:[m("svg",{className:"bili-video-card__stats--icon",children:m("use",{xlinkHref:"#widget-agree"})}),m("span",{className:"bili-video-card__stats--text",children:ze})]})})]}),m("span",{className:"bili-video-card__stats__duration",children:G&&oe})]})})]})}),m("div",{className:"bili-video-card__info __scale-disable",children:N("div",{className:"bili-video-card__info--right",children:[m("a",{href:J,target:"_blank","data-mod":"partition_recommend","data-idx":"content","data-ext":"click",children:m("h3",{className:"bili-video-card__info--tit",title:v,children:v})}),N("p",{className:"bili-video-card__info--bottom",children:[G&&N("a",{className:"bili-video-card__info--owner",href:`//space.bilibili.com/${I}`,target:"_blank","data-mod":"partition_recommend","data-idx":"content","data-ext":"click",children:[V!=null&&V.content?m("span",{className:ts,children:V.content}):m("svg",{className:"bili-video-card__info--owner__up",children:m("use",{xlinkHref:"#widget-up"})}),m("span",{className:"bili-video-card__info--author",children:P}),k&&N("span",{className:"bili-video-card__info--date",children:["\xB7 ",k]})]}),W&&N("a",{className:"bili-video-card__info--owner",href:J,target:"_blank",children:[m("span",{className:es,children:Z}),m("span",{className:ns,children:F})]})]})]})})]})}),hs="_modal-mask_1urmj_1",ps="_narrow-mode_1urmj_13",gs="_modal_1urmj_1",ms="_modal-header_1urmj_38",vs="_modal-title_1urmj_46",ys="_btn-refresh_1urmj_51",bs="_btn-close_1urmj_52",ut="_modal-body_1urmj_68",Dh="_list_1urmj_74",Sn="_card_1urmj_77",Tn="_active_1urmj_85",_s="_video-card-list_1urmj_90",Cn="_video-card-body_1urmj_1",ws="_loader_1urmj_99",En="_checkbox_1urmj_104",ep={modalMask:hs,narrowMode:ps,modal:gs,modalHeader:ms,modalTitle:vs,btnRefresh:ys,btnClose:bs,modalBody:ut,list:Dh,card:Sn,active:Tn,videoCardList:_s,videoCardBody:Cn,loader:ws,checkbox:En};function Nh({show:e,refresh:t,minIndex:n=0,maxIndex:r}){const[i,s]=b.useState(null),o=U(()=>{if(i===null)return!1;const w=document.querySelector(`${On}.${Tn}`),y=document.querySelector(`.${ut}`);if(!w||!y)return!1;const O=y.getBoundingClientRect(),$=w.getBoundingClientRect();return!($.top-O.top<-(O.height+$.height)||$.top-O.top>O.height*2+$.height)}),c=U((w,y)=>{if(!e)return;y==null||y.preventDefault();const O=o()?i+w:Fh();if(!(Or){Cs(r);return}s(O),Cs(O)}}),u=b.useCallback(w=>{c(-1,w)},[]),a=b.useCallback(w=>{c(1,w)},[]);_e("leftarrow",u),_e("rightarrow",a);const f=b.useCallback(w=>{c(-Os(),w)},[]),d=b.useCallback(w=>{c(Os(),w)},[]);_e("uparrow",f),_e("downarrow",d);const p=U(()=>{!i||!e||jh(i)}),v=U(()=>{!e||s(null)});_e("enter",p),_e("esc",v);const g=U(()=>{!e||t()});return _e("r",g,{exactMatch:!0}),{activeIndex:i,clearActiveIndex:v}}function Fh(){const e=document.querySelector(`.${ut}`);if(!e)return 0;const t=e.getBoundingClientRect(),n=Ss();for(let r=0;r=t.top)return r;return 0}const On=`#${Cn} .${Sn}`;function Ss(){return[...document.querySelectorAll(On)]}function Ts(e){return Ss()[e]}function Cs(e){var n;const t=Ts(e);(n=t==null?void 0:t.scrollIntoViewIfNeeded)==null||n.call(t,!1)}function jh(e){const t=Ts(e);if(!t)return;const n=t.querySelector(".bili-video-card__wrap > a");n==null||n.click()}const Es=new Map;function Os(){if(se.useNarrowMode)return 2;let e=Es.get(window.innerWidth);if(e)return e;const t=document.querySelector(On);if(!t)throw new Error("expect found first card");e=1;const n=t.getBoundingClientRect().top;let r=t.nextElementSibling;for(;r&&r.getBoundingClientRect().top===n;)e++,r=r.nextElementSibling;return Es.set(window.innerWidth,e),e}function As(){return b.useMemo(()=>crypto.randomUUID(),[])}const Ih=b.memo(function({show:t,onHide:n}){const[r,i]=b.useState([]),[s,o]=b.useState(!1),c=b.useRef(null),u=U(async()=>{c.current&&(c.current.scrollTop=0);try{y(),o(!0),i(await en(2)),y()}finally{o(!1)}}),a=U(async F=>{const A=await en(2);i(T=>[...T,...A])}),{useNarrowMode:f,initialShowMore:d}=Gt(),p=b.useCallback(F=>{const A=F.target.checked;Yr({useNarrowMode:A})},[]),v=b.useCallback(F=>{const A=F.target.checked;Yr({initialShowMore:A}),A&&te("\u5DF2\u5F00\u542F\u81EA\u52A8\u67E5\u770B\u66F4\u591A: \u4E0B\u6B21\u6253\u5F00\u9996\u9875\u65F6\u5C06\u76F4\u63A5\u5C55\u793A\u672C\u63A8\u8350\u5F39\u6846")},[]),g=b.useMemo(()=>({[ps]:f}),[f]),{activeIndex:w,clearActiveIndex:y}=Nh({show:t,refresh:u,maxIndex:r.length-1}),O=As(),$=As();return N(Ai,{show:t,onHide:n,clsModalMask:K(hs,g),clsModal:K(gs,g),children:[N("div",{className:ms,children:[m("div",{className:vs,children:"\u63A8\u8350"}),m("div",{className:"space",style:{flex:1}}),N(Si,{children:[m("input",{type:"checkbox",className:En,id:$,checked:d,onChange:v}),m("label",{htmlFor:$,children:"\u81EA\u52A8\u67E5\u770B\u66F4\u591A"}),m("input",{type:"checkbox",className:En,id:O,checked:f,onChange:p}),m("label",{htmlFor:O,children:"\u542F\u7528\u7A84\u5C4F\u6A21\u5F0F"})]}),N("button",{className:`primary-btn roll-btn ${ys}`,onClick:u,children:[m("svg",{children:m("use",{xlinkHref:"#widget-roll"})}),m("span",{children:"\u6362\u4E00\u6362"})]}),N("button",{className:`primary-btn roll-btn ${bs}`,onClick:n,children:[m("svg",{children:m("use",{xlinkHref:"#widget-close"})}),m("span",{children:"\u5173\u95ED"})]})]}),m("div",{className:ut,ref:c,children:m(fn,{pageStart:0,loadMore:a,hasMore:!0,useWindow:!1,threshold:360,style:{minHeight:"100%"},loader:m("div",{className:ws,children:"\u52A0\u8F7D\u4E2D..."},0),children:m("div",{className:`video-card-list is-full ${_s}`,children:m("div",{id:Cn,className:K("video-card-body",g),children:r.map((F,A)=>m(wn,{loading:s,item:F,className:K(Sn,{[Tn]:A===w})},F.uniqId))})})})})]})}),xs="_grid_svuzk_1",ks="_video-card-list_svuzk_6",rp={grid:xs,videoCardList:ks,expandBtn:"_expand-btn_svuzk_20",expanded:"_expanded_svuzk_31"};function zh({internalTesting:e=!1}){const t=b.useRef(null),{accessKey:n}=Gt(),r=di(bf,{manual:!0}),i=U(async()=>{var O;await r.runAsync()&&((O=t.current)==null||O.set(!1))}),s=_f,o=U(()=>{const y="https://github.com/indefined/UserScripts/tree/master/bilibiliHome#%E6%8E%88%E6%9D%83%E8%AF%B4%E6%98%8E";window.open(y,"_blank")}),c=b.useMemo(()=>new Array(20).fill(0).map(()=>crypto.randomUUID()),[]),{data:u,loading:a,error:f,refresh:d}=di(mf);f&&console.error(f.stack||f);const[p,v]=b.useState(()=>se.initialShowMore),g=b.useCallback(()=>{v(!0)},[]),w=b.useCallback(()=>{v(!1)},[]);return m("section",{className:K("bili-grid",{"no-margin":!e},xs),"data-area":"\u63A8\u8350",children:N("div",{className:`video-card-list is-full ${ks}`,children:[N("div",{className:"area-header",children:[N("div",{className:"left",children:[m("a",{id:"\u5F71\u89C6",className:"the-world area-anchor","data-id":"25"}),m("svg",{className:"icon",children:m("use",{xlinkHref:"#channel-cinephile"})}),m("a",{className:"title",href:"#",children:m("span",{children:"\u63A8\u8350"})})]}),N("div",{className:"right",children:[n?N(Si,{ref:t,children:[m("button",{className:"primary-btn roll-btn",onClick:o,children:m("span",{children:"access_key \u8BF4\u660E"})}),m("button",{className:"primary-btn roll-btn",onClick:()=>i(),disabled:r.loading,children:m("span",{children:"\u91CD\u65B0\u83B7\u53D6 access_key"})}),m("button",{className:"primary-btn roll-btn",onClick:s,children:m("span",{children:"\u5220\u9664 access_key"})})]}):N(ot,{children:[m("button",{className:"primary-btn roll-btn",onClick:o,children:m("span",{children:"access_key \u8BF4\u660E"})}),m("button",{className:"primary-btn roll-btn",onClick:i,disabled:r.loading,children:m("span",{children:"\u83B7\u53D6 access_key"})})]}),N("button",{className:"primary-btn roll-btn",onClick:d,children:[m("svg",{style:{transform:"rotate(0deg)"},children:m("use",{xlinkHref:"#widget-roll"})}),m("span",{children:"\u6362\u4E00\u6362"})]}),N("button",{className:"primary-btn see-more",onClick:g,children:[m("span",{children:"\u67E5\u770B\u66F4\u591A"}),m("svg",{children:m("use",{xlinkHref:"#widget-arrow"})})]})]})]}),m(Ih,{show:p,onHide:w}),m("div",{className:"video-card-body more-class1 more-class2",children:a||f?c.map(y=>m(wn,{},y)):u.map(y=>m(wn,{item:y},y.uniqId))})]})})}(function(){var t;if(location.href.startsWith("https://www.mcbbs.net/template/mcbbs/image/special_photo_bg.png?"))return window.stop(),(t=window.top)==null?void 0:t.postMessage(location.href,"https://www.bilibili.com");if(location.pathname==="/")return $h()})();async function $h(){const t=Date.now()+1e4;let n=null,r=!1;for(;;){if(document.querySelector(".bili-layout > section.bili-grid")){n=document.querySelector(".bili-layout > section.bili-grid");break}if(Bh()&&document.querySelector(".recommended-container")){r=!0,n=document.querySelector(".recommended-container");break}if(Date.now()>t)break;await Kt.exports(100)}if(!n){console.error("[bilibili-app-recommend]: init fail");return}const i=document.createElement("section");n.insertAdjacentElement("afterend",i),Vt(i).render(m(zh,{internalTesting:r}))}function Bh(){var e;return((e=document.querySelector("button.go-back"))==null?void 0:e.innerText.trim())==="\u9000\u51FA\u5185\u6D4B"}})(React,ReactDOM,axios,axiosGmxhrAdapter);