// ==UserScript== // @name bilibili-app-recommend // @namespace https://magicdawn.fun // @version 0.8.3 // @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== (i=>{const e=document.createElement("style");e.dataset.source="vite-plugin-monkey",e.innerText=i,document.head.appendChild(e)})(`.primary-btn[disabled]:active,.primary-btn[disabled]:hover{cursor:wait;background-color:inherit}._modal-mask_1fjgs_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_1fjgs_1{width:500px;max-height:calc(80vh - 50px);background-color:#fff;border-radius:10px;padding:0 15px 15px;display:flex;flex-direction:column;overflow:hidden}._modal-header_1fjgs_23{padding-top:10px;padding-bottom:10px;border-bottom:none;display:flex;align-items:center}._modal-body_1fjgs_30{padding-top:0;flex-grow:1;overflow-y:scroll}._modal-title_1fjgs_35{font-size:1.5rem;margin-bottom:0;line-height:1.5;display:flex;align-items:center}._btn-close_1fjgs_42{margin-left:10px}._btn-close_1fjgs_42 svg{width:10px;height:10px;margin-right:3px;margin-top:-1px}body.dark ._btn-close_1fjgs_42{color:#eee!important;background-color:#333!important;border-color:transparent!important;height:auto;padding:8px 12px;line-height:16px;font-size:13px}._toast-container_mcbuq_1{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:999999;padding:12px 24px;font-size:14px;min-width:200px;width:max-content;max-width:450px;background:#ffb243;color:#fff;border-radius:6px;white-space:pre-wrap}._toast-container_mcbuq_1._single-line_mcbuq_17{text-align:center}._modal_g0in4_1{width:500px}._title-desc_g0in4_4{margin-left:5px;font-size:40%}._reason-list_g0in4_8{display:flex;align-items:center;flex-wrap:wrap;justify-content:space-between}._reason_g0in4_8{color:inherit;width:48%;text-align:center;line-height:20px;position:relative;border:1px solid #eee;padding-top:5px;padding-bottom:5px;margin-top:5px;margin-bottom:5px}body.dark ._reason_g0in4_8{border:1px solid #333}._reason-no_g0in4_29{position:absolute;left:6px;width:20px;height:20px;border-radius:50%;top:6px;display:flex;align-items:center;justify-content:center;background-color:#6a5acd;background-color:#fb7299;color:#fff}._tips_g0in4_43{margin-top:20px;display:flex;align-items:center}._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}._video-grid_14t5i_9{display:grid;position:relative;width:100%;grid-gap:20px 12px}@media (max-width: 1099.9px){._video-grid_14t5i_9{grid-template-columns:repeat(4,1fr)}._video-grid_14t5i_9._limit-two-lines_14t5i_19>*:nth-of-type(1n + 9){display:none!important}}@media (min-width: 1100px) and (max-width: 1700.9px){._video-grid_14t5i_9{grid-template-columns:repeat(5,1fr)}._video-grid_14t5i_9._limit-two-lines_14t5i_19>*:nth-of-type(1n + 11){display:none!important}}@media (min-width: 1701px){._video-grid_14t5i_9{grid-template-columns:repeat(6,1fr)}._video-grid_14t5i_9._limit-two-lines_14t5i_19>*:nth-of-type(1n + 13){display:none!important}}._video-grid_14t5i_9._internal-testing_14t5i_43{grid-gap:20px 20px}@media (max-width: 1399.9px){._video-grid_14t5i_9._internal-testing_14t5i_43{grid-template-columns:repeat(4,1fr)}._video-grid_14t5i_9._internal-testing_14t5i_43._limit-one-line_14t5i_50>*:nth-of-type(1n + 5){display:none!important}._video-grid_14t5i_9._internal-testing_14t5i_43._limit-two-lines_14t5i_19>*:nth-of-type(1n + 9){display:none!important}}@media (min-width: 1400px){._video-grid_14t5i_9._internal-testing_14t5i_43{grid-template-columns:repeat(5,1fr)}._video-grid_14t5i_9._internal-testing_14t5i_43._limit-one-line_14t5i_50>*:nth-of-type(1n + 6){display:none!important}._video-grid_14t5i_9._internal-testing_14t5i_43._limit-two-lines_14t5i_19>*:nth-of-type(1n + 11){display:none!important}}._narrow-mode_14t5i_71{grid-template-columns:repeat(2,1fr)!important}._config-icon_4kok1_1{line-height:1;margin-right:5px;font-size:0}._settings-group_4kok1_6{margin-bottom:10px}._settings-group_4kok1_6 ._settings-group-title_4kok1_9{font-size:2em}._settings-group_4kok1_6 ._settings-group-content_4kok1_12{color:default}._settings-group_4kok1_6 ._settings-group-content_4kok1_12 button:first-child{margin-left:0}._row_4kok1_18{display:flex;align-items:center;flex-wrap:wrap}._check_4kok1_23{margin-right:20px;margin-bottom:5px}._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_1as61_1._narrow-mode_1as61_1{background-color:#000000e6}._modal_1as61_1{width:calc(100vw - 30px);height:calc(100vh - 30px);max-height:unset;padding-right:0}body.dark ._modal_1as61_1{border:1px solid #fb7299}._modal_1as61_1._narrow-mode_1as61_1{width:606px;height:calc(100vh - 10px);border:none}body.dark ._modal_1as61_1._narrow-mode_1as61_1{border:none}._modal-header_1as61_21,._modal-body_1as61_22{padding-right:15px}body.dark ._btn-refresh_1as61_25{color:#eee!important;background-color:#333!important;border-color:transparent!important;height:auto;padding:8px 12px;line-height:16px;font-size:13px} `); var pv=Object.defineProperty;var mv=(p,me,$e)=>me in p?pv(p,me,{enumerable:!0,configurable:!0,writable:!0,value:$e}):p[me]=$e;var ir=(p,me,$e)=>(mv(p,typeof me!="symbol"?me+"":me,$e),$e);(function(p,me,$e,Cc){"use strict";const en=e=>e&&typeof e=="object"&&"default"in e?e:{default:e};function xc(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const ce=en(p),Ji=xc(p),Ac=en(me),sr=en($e),Oc=en(Cc);var Tc=typeof global=="object"&&global&&global.Object===Object&&global;const Zi=Tc;var Mc=typeof self=="object"&&self&&self.Object===Object&&self,Lc=Zi||Mc||Function("return this")();const ge=Lc;var Rc=ge.Symbol;const ye=Rc;var Qi=Object.prototype,Pc=Qi.hasOwnProperty,Dc=Qi.toString,wt=ye?ye.toStringTag:void 0;function Nc(e){var t=Pc.call(e,wt),n=e[wt];try{e[wt]=void 0;var r=!0}catch{}var i=Dc.call(e);return r&&(t?e[wt]=n:delete e[wt]),i}var Fc=Object.prototype,Ic=Fc.toString;function jc(e){return Ic.call(e)}var zc="[object Null]",Wc="[object Undefined]",qi=ye?ye.toStringTag:void 0;function et(e){return e==null?e===void 0?Wc:zc:qi&&qi in Object(e)?Nc(e):jc(e)}function tt(e){return e!=null&&typeof e=="object"}var Bc="[object Symbol]";function tn(e){return typeof e=="symbol"||tt(e)&&et(e)==Bc}function $c(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n0){if(++t>=_u)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Cu(e){return function(){return e}}var xu=function(){try{var e=Ue(Object,"defineProperty");return e({},"",{}),e}catch{}}();const nn=xu;var Au=nn?function(e,t){return nn(e,"toString",{configurable:!0,enumerable:!1,value:Cu(t),writable:!0})}:ss,Ou=Eu(Au);const Tu=Ou;function Mu(e,t,n,r){for(var i=e.length,s=n+(r?1:-1);r?s--:++s-1}var Nu=9007199254740991,Fu=/^(?:0|[1-9]\d*)$/;function lr(e,t){var n=typeof e;return t=t==null?Nu:t,!!t&&(n=="number"||n!="symbol"&&Fu.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=$u}function Hu(e){return e!=null&&dr(e.length)&&!os(e)}var Uu=Object.prototype;function Gu(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Uu;return e===n}function Vu(e,t){for(var n=-1,r=Array(e);++n-1}function of(e,t){var n=this.__data__,r=rn(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Pe(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t0&&n(a)?t>1?Ss(a,t-1,n,r,i):ws(i,a):r||(i[i.length]=a)}return i}function Ef(e){var t=e==null?0:e.length;return t?Ss(e,1):[]}function Cf(e){return Tu(Bu(e,void 0,Ef),e+"")}var xf="Expected a function";function Af(e,t){var n;if(typeof t!="function")throw new TypeError(xf);return e=is(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}function Of(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:Of(e,t,n)}var Mf="\\ud800-\\udfff",Lf="\\u0300-\\u036f",Rf="\\ufe20-\\ufe2f",Pf="\\u20d0-\\u20ff",Df=Lf+Rf+Pf,Nf="\\ufe0e\\ufe0f",Ff="\\u200d",If=RegExp("["+Ff+Mf+Df+Nf+"]");function br(e){return If.test(e)}function jf(e){return e.split("")}var ks="\\ud800-\\udfff",zf="\\u0300-\\u036f",Wf="\\ufe20-\\ufe2f",Bf="\\u20d0-\\u20ff",$f=zf+Wf+Bf,Hf="\\ufe0e\\ufe0f",Uf="["+ks+"]",wr="["+$f+"]",_r="\\ud83c[\\udffb-\\udfff]",Gf="(?:"+wr+"|"+_r+")",Es="[^"+ks+"]",Cs="(?:\\ud83c[\\udde6-\\uddff]){2}",xs="[\\ud800-\\udbff][\\udc00-\\udfff]",Vf="\\u200d",As=Gf+"?",Os="["+Hf+"]?",Yf="(?:"+Vf+"(?:"+[Es,Cs,xs].join("|")+")"+Os+As+")*",Kf=Os+As+Yf,Xf="(?:"+[Es+wr+"?",wr,Cs,xs,Uf].join("|")+")",Jf=RegExp(_r+"(?="+_r+")|"+Xf+Kf,"g");function Zf(e){return e.match(Jf)||[]}function Qf(e){return br(e)?Zf(e):jf(e)}function qf(){this.__data__=new Pe,this.size=0}function ed(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function td(e){return this.__data__.get(e)}function nd(e){return this.__data__.has(e)}var rd=200;function id(e,t){var n=this.__data__;if(n instanceof Pe){var r=n.__data__;if(!kt||r.lengtha))return!1;var u=s.get(e),l=s.get(t);if(u&&l)return u==t&&l==e;var f=-1,d=!0,m=n&Ad?new Ct:void 0;for(s.set(e,t),s.set(t,e);++f=t||M<0||f&&z>=s}function E(){var A=xr();if(k(A))return x(A);a=setTimeout(E,y(A))}function x(A){return a=void 0,d&&r?m(A):(r=i=void 0,o)}function F(){a!==void 0&&clearTimeout(a),u=0,r=c=i=a=void 0}function N(){return a===void 0?o:x(xr())}function L(){var A=xr(),M=k(A);if(r=arguments,i=this,c=A,M){if(a===void 0)return w(c);if(f)return clearTimeout(a),a=setTimeout(E,t),m(c)}return a===void 0&&(a=setTimeout(E,t)),o}return L.cancel=F,L.flush=N,L}function hh(e,t,n){for(var r=-1,i=e==null?0:e.length;++rvh)return n;do t%2&&(n+=e),t=bh(t/2),t&&(e+=e);while(t);return n}var wh=Ys("length");const _h=wh;var Js="\\ud800-\\udfff",Sh="\\u0300-\\u036f",kh="\\ufe20-\\ufe2f",Eh="\\u20d0-\\u20ff",Ch=Sh+kh+Eh,xh="\\ufe0e\\ufe0f",Ah="["+Js+"]",Ar="["+Ch+"]",Or="\\ud83c[\\udffb-\\udfff]",Oh="(?:"+Ar+"|"+Or+")",Zs="[^"+Js+"]",Qs="(?:\\ud83c[\\udde6-\\uddff]){2}",qs="[\\ud800-\\udbff][\\udc00-\\udfff]",Th="\\u200d",eo=Oh+"?",to="["+xh+"]?",Mh="(?:"+Th+"(?:"+[Zs,Qs,qs].join("|")+")"+to+eo+")*",Lh=to+eo+Mh,Rh="(?:"+[Zs+Ar+"?",Ar,Qs,qs,Ah].join("|")+")",no=RegExp(Or+"(?="+Or+")|"+Rh+Lh,"g");function Ph(e){for(var t=no.lastIndex=0;no.test(e);)++t;return t}function ro(e){return br(e)?Ph(e):_h(e)}var Dh=Math.ceil;function Nh(e,t){t=t===void 0?" ":or(t);var n=t.length;if(n<2)return n?Xs(t,e):t;var r=Xs(t,Dh(e/ro(t)));return br(t)?Tf(Qf(r),0,e).join(""):r.slice(0,e)}function Fh(e,t,n){e=bs(e),t=is(t);var r=t?ro(e):0;return t&&r=Uh){var u=t?null:Hh(e);if(u)return Er(u);o=!1,i=js,c=new Ct}else c=t?[]:a;e:for(;++rnew Proxy(e,t);const Mr=Object.getPrototypeOf,Lr=new WeakMap,oo=e=>e&&(Lr.has(e)?Lr.get(e):Mr(e)===Object.prototype||Mr(e)===Array.prototype),un=e=>typeof e=="object"&&e!==null,Rr=e=>e[Tr]||e,ao=(e,t,n)=>{if(!oo(e))return e;const r=Rr(e),i=(o=>Object.isFrozen(o)||Object.values(Object.getOwnPropertyDescriptors(o)).some(a=>!a.writable))(r);let s=n&&n.get(r);return s&&s[1].f===i||(s=((o,a)=>{const c={f:a};let u=!1;const l=(d,m)=>{if(!u){let w=c[xt].get(o);if(w||(w={},c[xt].set(o,w)),d===At)w[At]=!0;else{let y=w[d];y||(y=new Set,w[d]=y),y.add(m)}}},f={get:(d,m)=>m===Tr?o:(l("k",m),ao(Reflect.get(d,m),c[xt],c.c)),has:(d,m)=>m===Vh?(u=!0,c[xt].delete(o),!0):(l("h",m),Reflect.has(d,m)),getOwnPropertyDescriptor:(d,m)=>(l("o",m),Reflect.getOwnPropertyDescriptor(d,m)),ownKeys:d=>(l(At),Reflect.ownKeys(d))};return a&&(f.set=f.deleteProperty=()=>!1),[f,c]})(r,i),s[1].p=Yh(i?(o=>{if(Array.isArray(o))return Array.from(o);const a=Object.getOwnPropertyDescriptors(o);return Object.values(a).forEach(c=>{c.configurable=!0}),Object.create(Mr(o),a)})(r):r,s[0]),n&&n.set(r,s)),s[1][xt]=t,s[1].c=n,s[1].p},co=(e,t,n,r)=>{if(Object.is(e,t))return!1;if(!un(e)||!un(t))return!0;const i=n.get(Rr(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;try{for(const o of i.h||[])if(s=Reflect.has(e,o)!==Reflect.has(t,o),s)return s;if(i[At]===!0){if(s=((o,a)=>{const c=Reflect.ownKeys(o),u=Reflect.ownKeys(a);return c.length!==u.length||c.some((l,f)=>l!==u[f])})(e,t),s)return s}else for(const o of i.o||[])if(s=!!Reflect.getOwnPropertyDescriptor(e,o)!=!!Reflect.getOwnPropertyDescriptor(t,o),s)return s;for(const o of i.k||[])if(s=co(e[o],t[o],n,r),s)return s;return s===null&&(s=!0),s}finally{r&&r.set(e,{n:t,g:s})}},Kh=e=>oo(e)&&e[Tr]||null,uo=(e,t=!0)=>{Lr.set(e,t)},Xh=(e,t,n)=>{const r=[],i=new WeakSet,s=(o,a)=>{if(i.has(o))return;un(o)&&i.add(o);const c=un(o)&&t.get(Rr(o));if(c){var u,l;if((u=c.h)==null||u.forEach(d=>{const m=`:has(${String(d)})`;r.push(a?[...a,m]:[m])}),c[At]===!0){const d=":ownKeys";r.push(a?[...a,d]:[d])}else{var f;(f=c.o)==null||f.forEach(d=>{const m=`:hasOwn(${String(d)})`;r.push(a?[...a,m]:[m])})}(l=c.k)==null||l.forEach(d=>{n&&!("value"in(Object.getOwnPropertyDescriptor(o,d)||{}))||s(o[d],a?[...a,d]:[d])})}else a&&r.push(a)};return s(e),r},Pr=e=>typeof e=="object"&&e!==null,Ye=new WeakMap,ln=new WeakSet,Jh=(e=Object.is,t=(u,l)=>new Proxy(u,l),n=u=>Pr(u)&&!ln.has(u)&&(Array.isArray(u)||!(Symbol.iterator in u))&&!(u instanceof WeakMap)&&!(u instanceof WeakSet)&&!(u instanceof Error)&&!(u instanceof Number)&&!(u instanceof Date)&&!(u instanceof String)&&!(u instanceof RegExp)&&!(u instanceof ArrayBuffer),r=u=>{switch(u.status){case"fulfilled":return u.value;case"rejected":throw u.reason;default:throw u}},i=new WeakMap,s=(u,l,f=r)=>{const d=i.get(u);if((d==null?void 0:d[0])===l)return d[1];const m=Array.isArray(u)?[]:Object.create(Object.getPrototypeOf(u));return uo(m,!0),i.set(u,[l,m]),Reflect.ownKeys(u).forEach(w=>{if(Object.getOwnPropertyDescriptor(m,w))return;const y=Reflect.get(u,w),k={value:y,enumerable:!0};ln.has(y)?uo(y,!1):y instanceof Promise?(delete k.value,k.get=()=>f(y)):Ye.has(y)&&(k.value=Dr(y,f)),Object.defineProperty(m,w,k)}),m},o=new WeakMap,a=[1,1],c=function u(l){if(!Pr(l))throw new Error("object required");const f=o.get(l);if(f)return f;let d=a[0];const m=new Set,w=(C,R=++a[0])=>{d!==R&&(d=R,m.forEach(_=>_(C,R)))};let y=a[1];const k=(C=++a[1])=>(y!==C&&!m.size&&(y=C,x.forEach(([R])=>{const _=R[1](C);_>d&&(d=_)})),d),E=C=>(R,_)=>{const v=[...R];v[1]=[C,...v[1]],w(v,_)},x=new Map,F=(C,R)=>{var _;if(((_={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0})==null?void 0:_.MODE)!=="production"&&x.has(C))throw new Error("prop listener already exists");if(m.size){const v=R[3](E(C));x.set(C,[R,v])}else x.set(C,[R])},N=C=>{var R;const _=x.get(C);_&&(x.delete(C),(R=_[1])==null||R.call(_))},L=C=>(m.add(C),m.size===1&&x.forEach(([_,v],g)=>{var b;if(((b={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0})==null?void 0:b.MODE)!=="production"&&v)throw new Error("remove already exists");const O=_[3](E(g));x.set(g,[_,O])}),()=>{m.delete(C),m.size===0&&x.forEach(([_,v],g)=>{v&&(v(),x.set(g,[_]))})}),A=Array.isArray(l)?[]:Object.create(Object.getPrototypeOf(l)),z=t(A,{deleteProperty(C,R){const _=Reflect.get(C,R);N(R);const v=Reflect.deleteProperty(C,R);return v&&w(["delete",[R],_]),v},set(C,R,_,v){const g=Reflect.has(C,R),b=Reflect.get(C,R,v);if(g&&(e(b,_)||o.has(_)&&e(b,o.get(_))))return!0;N(R),Pr(_)&&(_=Kh(_)||_);let O=_;if(_ instanceof Promise)_.then(S=>{_.status="fulfilled",_.value=S,w(["resolve",[R],S])}).catch(S=>{_.status="rejected",_.reason=S,w(["reject",[R],S])});else{!Ye.has(_)&&n(_)&&(O=u(_));const S=!ln.has(O)&&Ye.get(O);S&&F(R,S)}return Reflect.set(C,R,O,v),w(["set",[R],_,b]),!0}});o.set(l,z);const W=[A,k,s,L];return Ye.set(z,W),Reflect.ownKeys(l).forEach(C=>{const R=Object.getOwnPropertyDescriptor(l,C),_="value"in R;delete R.value,Object.defineProperty(A,C,R),_&&(z[C]=l[C])}),z})=>[c,Ye,ln,e,t,n,r,i,s,o,a],[Zh]=Jh();function Ot(e={}){return Zh(e)}function lo(e,t,n){var r;const i=Ye.get(e);((r={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0})==null?void 0:r.MODE)!=="production"&&!i&&console.warn("Please use proxy object");let s;const o=[],a=i[3];let c=!1;const l=a(f=>{if(o.push(f),n){t(o.splice(0));return}s||(s=Promise.resolve().then(()=>{s=void 0,c&&t(o.splice(0))}))});return c=!0,()=>{c=!1,l()}}function Dr(e,t){var n;const r=Ye.get(e);((n={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0})==null?void 0:n.MODE)!=="production"&&!r&&console.warn("Please use proxy object");const[i,s,o]=r;return o(i,s(),t)}var Qh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function qh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ep(e){var t=e.default;if(typeof t=="function"){var n=function(){return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var fo={exports:{}},ho={};/** * @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 rt=ce.default;function tp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var np=typeof Object.is=="function"?Object.is:tp,rp=rt.useState,ip=rt.useEffect,sp=rt.useLayoutEffect,op=rt.useDebugValue;function ap(e,t){var n=t(),r=rp({inst:{value:n,getSnapshot:t}}),i=r[0].inst,s=r[1];return sp(function(){i.value=n,i.getSnapshot=t,Nr(i)&&s({inst:i})},[e,n,t]),ip(function(){return Nr(i)&&s({inst:i}),e(function(){Nr(i)&&s({inst:i})})},[e]),op(n),n}function Nr(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!np(e,n)}catch{return!0}}function cp(e,t){return t()}var up=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?cp:ap;ho.useSyncExternalStore=rt.useSyncExternalStore!==void 0?rt.useSyncExternalStore:up,function(e){e.exports=ho}(fo);const lp=qh(fo.exports),{use:po}=ce.default,{useSyncExternalStore:fp}=lp,dp=(e,t)=>{const n=p.useRef();p.useEffect(()=>{n.current=Xh(e,t,!0)}),p.useDebugValue(n.current)};function it(e,t){var n;const r=t==null?void 0:t.sync,i=p.useRef(),s=p.useRef();let o=!0;const a=fp(p.useCallback(l=>{const f=lo(e,l,r);return l(),f},[e,r]),()=>{const l=Dr(e,po);try{if(!o&&i.current&&s.current&&!co(i.current,l,s.current,new WeakMap))return i.current}catch{}return l},()=>Dr(e,po));o=!1;const c=new WeakMap;p.useEffect(()=>{i.current=a,s.current=c}),((n={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0})==null?void 0:n.MODE)!=="production"&&dp(a,c);const u=p.useMemo(()=>new WeakMap,[]);return ao(a,c,u)}const Fr={accessKey:"",useNarrowMode:!1,initialShowMore:!1,pureRecommend:!1,openInIINAWhenRightClick:!1,usePcDesktopApi:!1},re=Ot({...Fr}),mo=Object.keys(Fr),je=function(){return it(re)},go="bilibili-app-recommend",Ir=`${go}.config`,fn=`${go}.settings`;function hp(){Object.keys(GM_getValue(Ir)||{}).length&&!Object.keys(GM_getValue(fn)||{}).length&&(GM_setValue(fn,GM_getValue(Ir)),GM_deleteValue(Ir));const e=GM_getValue(fn);e&&typeof e=="object"&&Object.assign(re,io(e,mo)),lo(re,()=>{pp()})}function pp(){const e=io(re,mo);GM_setValue(fn,e)}function yo(e){Object.assign(re,e)}function mp(){return yo(Fr)}hp();var Tt={exports:{}};const gp=(e,t)=>Math.floor(Math.random()*(t-e+1)+e),vo=()=>{const e=new Error("Delay aborted");return e.name="AbortError",e},bo=({clearTimeout:e,setTimeout:t,willResolve:n})=>(r,{value:i,signal:s}={})=>{if(s&&s.aborted)return Promise.reject(vo());let o,a,c;const u=e||clearTimeout,l=()=>{u(o),c(vo())},f=()=>{s&&s.removeEventListener("abort",l)},d=new Promise((m,w)=>{a=()=>{f(),n?m(i):w(i)},c=w,o=(t||setTimeout)(a,r)});return s&&s.addEventListener("abort",l,{once:!0}),d.clear=()=>{u(o),o=null,a()},d},wo=e=>{const t=bo({...e,willResolve:!0});return t.reject=bo({...e,willResolve:!1}),t.range=(n,r,i)=>t(gp(n,r),i),t},jr=wo();jr.createWithTimers=wo,Tt.exports=jr,Tt.exports.default=jr;var dn,_o=Ac.default;dn=_o.createRoot,_o.hydrateRoot;const yv="",Mt=yh(()=>!!document.querySelectorAll(".bili-feed4").length),So=document.querySelector(".bili-header__bar"),ko=Boolean(So&&window.getComputedStyle(So).display==="none")?50:64,Eo=()=>document.body.classList.contains("dark"),Co=Ot({value:Eo()});function xo(){return it(Co).value}const hn=new MutationObserver(function(){Co.value=Eo()});hn.observe(document.body,{attributes:!0,attributeFilter:["class"]}),window.addEventListener("unload",()=>{hn==null||hn.disconnect()});var zr={},ie={};Object.defineProperty(ie,"__esModule",{value:!0}),ie.DEFAULT_ICON_CONFIGS=void 0,ie.IconConverter=Lo,ie.IconProvider=void 0,ie.IconWrapper=Ep;var pn=yp(ce.default);function Ao(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Ao=function(r){return r?n:t})(e)}function yp(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Ao(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(s!=="default"&&Object.prototype.hasOwnProperty.call(e,s)){var o=i?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=e[s]}return r.default=e,n&&n.set(e,r),r}var vp=["size","strokeWidth","strokeLinecap","strokeLinejoin","theme","fill","className","spin"];function Oo(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 To(e){for(var t=1;t=0)&&(!Object.prototype.propertyIsEnumerable.call(e,r)||(n[r]=e[r]))}return n}function _p(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 Mo={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"};ie.DEFAULT_ICON_CONFIGS=Mo;function Sp(){return"icon-"+((1+Math.random())*4294967296|0).toString(16).substring(1)}function Lo(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 Ro=(0,pn.createContext)(Mo),kp=Ro.Provider;ie.IconProvider=kp;function Ep(e,t,n){return function(r){var i=r.size,s=r.strokeWidth,o=r.strokeLinecap,a=r.strokeLinejoin,c=r.theme,u=r.fill,l=r.className,f=r.spin,d=wp(r,vp),m=(0,pn.useContext)(Ro),w=(0,pn.useMemo)(Sp,[]),y=Lo(w,{size:i,strokeWidth:s,strokeLinecap:o,strokeLinejoin:a,theme:c,fill:u},m),k=[m.prefix+"-icon"];return k.push(m.prefix+"-icon-"+e),t&&m.rtl&&k.push(m.prefix+"-icon-rtl"),f&&k.push(m.prefix+"-icon-spin"),l&&k.push(l),pn.default.createElement("span",To(To({},d),{},{className:k.join(" ")}),n(y))}}Object.defineProperty(zr,"__esModule",{value:!0});var Po=zr.default=void 0,Wr=xp(ce.default),Cp=ie;function xp(e){return e&&e.__esModule?e:{default:e}}var Ap=(0,Cp.IconWrapper)("close",!1,function(e){return Wr.default.createElement("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none"},Wr.default.createElement("path",{d:"M8 8L40 40",stroke:e.colors[0],strokeWidth:e.strokeWidth,strokeLinecap:e.strokeLinecap,strokeLinejoin:e.strokeLinejoin}),Wr.default.createElement("path",{d:"M8 40L40 8",stroke:e.colors[0],strokeWidth:e.strokeWidth,strokeLinecap:e.strokeLinecap,strokeLinejoin:e.strokeLinejoin}))});Po=zr.default=Ap;var Br={};Object.defineProperty(Br,"__esModule",{value:!0});var Do=Br.default=void 0,$r=Tp(ce.default),Op=ie;function Tp(e){return e&&e.__esModule?e:{default:e}}var Mp=(0,Op.IconWrapper)("config",!1,function(e){return $r.default.createElement("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none"},$r.default.createElement("path",{d:"M24 4L18 10H10V18L4 24L10 30V38H18L24 44L30 38H38V30L44 24L38 18V10H30L24 4Z",fill:e.colors[1],stroke:e.colors[0],strokeWidth:e.strokeWidth,strokeLinejoin:e.strokeLinejoin}),$r.default.createElement("path",{d:"M24 30C27.3137 30 30 27.3137 30 24C30 20.6863 27.3137 18 24 18C20.6863 18 18 20.6863 18 24C18 27.3137 20.6863 30 24 30Z",fill:e.colors[3],stroke:e.colors[2],strokeWidth:e.strokeWidth,strokeLinejoin:e.strokeLinejoin}))});Do=Br.default=Mp;var Hr={};Object.defineProperty(Hr,"__esModule",{value:!0});var No=Hr.default=void 0,Lt=Rp(ce.default),Lp=ie;function Rp(e){return e&&e.__esModule?e:{default:e}}var Pp=(0,Lp.IconWrapper)("distraught-face",!1,function(e){return Lt.default.createElement("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none"},Lt.default.createElement("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}),Lt.default.createElement("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}),Lt.default.createElement("path",{d:"M32 17L29 20L32 23",stroke:e.colors[2],strokeWidth:e.strokeWidth,strokeLinecap:e.strokeLinecap,strokeLinejoin:e.strokeLinejoin}),Lt.default.createElement("path",{d:"M16 17L19 20L16 23",stroke:e.colors[2],strokeWidth:e.strokeWidth,strokeLinecap:e.strokeLinecap,strokeLinejoin:e.strokeLinejoin}))});No=Hr.default=Pp;var Ur={};Object.defineProperty(Ur,"__esModule",{value:!0});var Fo=Ur.default=void 0,Rt=Np(ce.default),Dp=ie;function Np(e){return e&&e.__esModule?e:{default:e}}var Fp=(0,Dp.IconWrapper)("info",!0,function(e){return Rt.default.createElement("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none"},Rt.default.createElement("path",{d:"M24 44C29.5228 44 34.5228 41.7614 38.1421 38.1421C41.7614 34.5228 44 29.5228 44 24C44 18.4772 41.7614 13.4772 38.1421 9.85786C34.5228 6.23858 29.5228 4 24 4C18.4772 4 13.4772 6.23858 9.85786 9.85786C6.23858 13.4772 4 18.4772 4 24C4 29.5228 6.23858 34.5228 9.85786 38.1421C13.4772 41.7614 18.4772 44 24 44Z",fill:e.colors[1],stroke:e.colors[0],strokeWidth:e.strokeWidth,strokeLinejoin:e.strokeLinejoin}),Rt.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M24 11C25.3807 11 26.5 12.1193 26.5 13.5C26.5 14.8807 25.3807 16 24 16C22.6193 16 21.5 14.8807 21.5 13.5C21.5 12.1193 22.6193 11 24 11Z",fill:e.colors[2]}),Rt.default.createElement("path",{d:"M24.5 34V20H23.5H22.5",stroke:e.colors[2],strokeWidth:e.strokeWidth,strokeLinecap:e.strokeLinecap,strokeLinejoin:e.strokeLinejoin}),Rt.default.createElement("path",{d:"M21 34H28",stroke:e.colors[2],strokeWidth:e.strokeWidth,strokeLinecap:e.strokeLinecap,strokeLinejoin:e.strokeLinejoin}))});Fo=Ur.default=Fp;var Gr={};Object.defineProperty(Gr,"__esModule",{value:!0});var Io=Gr.default=void 0,Vr=jp(ce.default),Ip=ie;function jp(e){return e&&e.__esModule?e:{default:e}}var zp=(0,Ip.IconWrapper)("loading",!0,function(e){return Vr.default.createElement("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none"},Vr.default.createElement("path",{d:"M4 24C4 35.0457 12.9543 44 24 44V44C35.0457 44 44 35.0457 44 24C44 12.9543 35.0457 4 24 4",stroke:e.colors[0],strokeWidth:e.strokeWidth,strokeLinecap:e.strokeLinecap,strokeLinejoin:e.strokeLinejoin}),Vr.default.createElement("path",{d:"M36 24C36 17.3726 30.6274 12 24 12C17.3726 12 12 17.3726 12 24C12 30.6274 17.3726 36 24 36V36",stroke:e.colors[0],strokeWidth:e.strokeWidth,strokeLinecap:e.strokeLinecap,strokeLinejoin:e.strokeLinejoin}))});Io=Gr.default=zp;var Yr={};Object.defineProperty(Yr,"__esModule",{value:!0});var jo=Yr.default=void 0,be=Bp(ce.default),Wp=ie;function Bp(e){return e&&e.__esModule?e:{default:e}}var $p=(0,Wp.IconWrapper)("loading-three",!1,function(e){return be.default.createElement("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none"},be.default.createElement("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,strokeLinecap:e.strokeLinecap,strokeLinejoin:e.strokeLinejoin}),be.default.createElement("path",{d:"M24 12V15",stroke:e.colors[2],strokeWidth:e.strokeWidth,strokeLinecap:e.strokeLinecap,strokeLinejoin:e.strokeLinejoin}),be.default.createElement("path",{d:"M32.4852 15.5147L30.3639 17.636",stroke:e.colors[2],strokeWidth:e.strokeWidth,strokeLinecap:e.strokeLinecap,strokeLinejoin:e.strokeLinejoin}),be.default.createElement("path",{d:"M36 24H33",stroke:e.colors[2],strokeWidth:e.strokeWidth,strokeLinecap:e.strokeLinecap,strokeLinejoin:e.strokeLinejoin}),be.default.createElement("path",{d:"M32.4852 32.4853L30.3639 30.364",stroke:e.colors[2],strokeWidth:e.strokeWidth,strokeLinecap:e.strokeLinecap,strokeLinejoin:e.strokeLinejoin}),be.default.createElement("path",{d:"M24 36V33",stroke:e.colors[2],strokeWidth:e.strokeWidth,strokeLinecap:e.strokeLinecap,strokeLinejoin:e.strokeLinejoin}),be.default.createElement("path",{d:"M15.5148 32.4853L17.6361 30.364",stroke:e.colors[2],strokeWidth:e.strokeWidth,strokeLinecap:e.strokeLinecap,strokeLinejoin:e.strokeLinejoin}),be.default.createElement("path",{d:"M12 24H15",stroke:e.colors[2],strokeWidth:e.strokeWidth,strokeLinecap:e.strokeLinecap,strokeLinejoin:e.strokeLinejoin}),be.default.createElement("path",{d:"M15.5148 15.5147L17.6361 17.636",stroke:e.colors[2],strokeWidth:e.strokeWidth,strokeLinecap:e.strokeLinecap,strokeLinejoin:e.strokeLinejoin}))});jo=Yr.default=$p;var Kr={};Object.defineProperty(Kr,"__esModule",{value:!0});var zo=Kr.default=void 0,Xr=Up(ce.default),Hp=ie;function Up(e){return e&&e.__esModule?e:{default:e}}var Gp=(0,Hp.IconWrapper)("return",!0,function(e){return Xr.default.createElement("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none"},Xr.default.createElement("path",{d:"M12.9998 8L6 14L12.9998 21",stroke:e.colors[0],strokeWidth:e.strokeWidth,strokeLinecap:e.strokeLinecap,strokeLinejoin:e.strokeLinejoin}),Xr.default.createElement("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}))});zo=Kr.default=Gp;function Vp(e){if(e.sheet)return e.sheet;for(var t=0;t0?ee(ot,--se):0,st--,K===10&&(st=1,vn--),K}function ue(){return K=se2||Ft(K)>3?"":" "}function im(e,t){for(;--t&&ue()&&!(K<48||K>102||K>57&&K<65||K>70&&K<97););return Nt(e,wn()+(t<6&&_e()==32&&ue()==32))}function ei(e){for(;ue();)switch(K){case e:return se;case 34:case 39:e!==34&&e!==39&&ei(K);break;case 40:e===41&&ei(e);break;case 92:ue();break}return se}function sm(e,t){for(;ue()&&e+K!==47+10;)if(e+K===42+42&&_e()===47)break;return"/*"+Nt(t,se-1)+"*"+gn(e===47?e:ue())}function om(e){for(;!Ft(_e());)ue();return Nt(e,se)}function am(e){return Go(Sn("",null,null,null,[""],e=Uo(e),0,[0],e))}function Sn(e,t,n,r,i,s,o,a,c){for(var u=0,l=0,f=o,d=0,m=0,w=0,y=1,k=1,E=1,x=0,F="",N=i,L=s,A=r,M=F;k;)switch(w=x,x=ue()){case 40:if(w!=108&&ee(M,f-1)==58){Qr(M+=B(_n(x),"&","&\f"),"&\f")!=-1&&(E=-1);break}case 34:case 39:case 91:M+=_n(x);break;case 9:case 10:case 13:case 32:M+=rm(w);break;case 92:M+=im(wn()-1,7);continue;case 47:switch(_e()){case 42:case 47:yn(cm(sm(ue(),wn()),t,n),c);break;default:M+="/"}break;case 123*y:a[u++]=we(M)*E;case 125*y:case 59:case 0:switch(x){case 0:case 125:k=0;case 59+l:m>0&&we(M)-f&&yn(m>32?Yo(M+";",r,n,f-1):Yo(B(M," ","")+";",r,n,f-2),c);break;case 59:M+=";";default:if(yn(A=Vo(M,t,n,u,l,i,a,F,N=[],L=[],f),s),x===123)if(l===0)Sn(M,t,A,A,N,s,f,a,L);else switch(d===99&&ee(M,3)===110?100:d){case 100:case 109:case 115:Sn(e,A,A,r&&yn(Vo(e,A,A,0,0,i,a,F,i,N=[],f),L),i,L,f,a,r?N:L);break;default:Sn(M,A,A,A,[""],L,0,a,L)}}u=l=m=0,y=E=1,F=M="",f=o;break;case 58:f=1+we(M),m=w;default:if(y<1){if(x==123)--y;else if(x==125&&y++==0&&nm()==125)continue}switch(M+=gn(x),x*y){case 38:E=l>0?1:(M+="\f",-1);break;case 44:a[u++]=(we(M)-1)*E,E=1;break;case 64:_e()===45&&(M+=_n(ue())),d=_e(),l=f=we(F=M+=om(wn())),x++;break;case 45:w===45&&we(M)==2&&(y=0)}}return s}function Vo(e,t,n,r,i,s,o,a,c,u,l){for(var f=i-1,d=i===0?s:[""],m=qr(d),w=0,y=0,k=0;w0?d[E]+" "+x:B(x,/&\f/g,d[E])))&&(c[k++]=F);return bn(e,t,n,i===0?Jr:a,c,u,l)}function cm(e,t,n){return bn(e,t,n,Wo,gn(tm()),Pt(e,2,-2),0)}function Yo(e,t,n,r){return bn(e,t,n,Zr,Pt(e,0,r),Pt(e,r+1,-1),r)}function at(e,t){for(var n="",r=qr(e),i=0;i6)switch(ee(e,t+1)){case 109:if(ee(e,t+4)!==45)break;case 102:return B(e,/(.+:)(.+)-([^]+)/,"$1"+j+"$2-$3$1"+mn+(ee(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Qr(e,"stretch")?Xo(B(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(ee(e,t+1)!==115)break;case 6444:switch(ee(e,we(e)-3-(~Qr(e,"!important")&&10))){case 107:return B(e,":",":"+j)+e;case 101:return B(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+j+(ee(e,14)===45?"inline-":"")+"box$3$1"+j+"$2$3$1"+te+"$2box$3")+e}break;case 5936:switch(ee(e,t+11)){case 114:return j+e+te+B(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return j+e+te+B(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return j+e+te+B(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return j+e+te+e+e}return e}var vm=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case Zr:t.return=Xo(t.value,t.length);break;case Bo:return at([Dt(t,{value:B(t.value,"@","@"+j)})],i);case Jr:if(t.length)return em(t.props,function(s){switch(qp(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return at([Dt(t,{props:[B(s,/:(read-\w+)/,":"+mn+"$1")]})],i);case"::placeholder":return at([Dt(t,{props:[B(s,/:(plac\w+)/,":"+j+"input-$1")]}),Dt(t,{props:[B(s,/:(plac\w+)/,":"+mn+"$1")]}),Dt(t,{props:[B(s,/:(plac\w+)/,te+"input-$1")]})],i)}return""})}},bm=[vm],Jo=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(y){var k=y.getAttribute("data-emotion");k.indexOf(" ")!==-1&&(document.head.appendChild(y),y.setAttribute("data-s",""))})}var i=t.stylisPlugins||bm,s={},o,a=[];o=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(y){for(var k=y.getAttribute("data-emotion").split(" "),E=1;E=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var Tm={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Mm=/[A-Z]|^ms/g,Lm=/_EMO_([^_]+?)_([^]*?)_EMO_/g,ra=function(t){return t.charCodeAt(1)===45},ia=function(t){return t!=null&&typeof t!="boolean"},si=dm(function(e){return ra(e)?e:e.replace(Mm,"-$&").toLowerCase()}),sa=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(Lm,function(r,i,s){return Se={name:i,styles:s,next:Se},i})}return Tm[t]!==1&&!ra(t)&&typeof n=="number"&&n!==0?n+"px":n},bv="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function It(e,t,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return Se={name:n.name,styles:n.styles,next:Se},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)Se={name:r.name,styles:r.styles,next:Se},r=r.next;var i=n.styles+";";return i}return Rm(e,t,n)}case"function":{if(e!==void 0){var s=Se,o=n(e);return Se=s,It(e,t,o)}break}}if(t==null)return n;var a=t[n];return a!==void 0?a:n}function Rm(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i(t,n)=>{const r=p.useRef(!1);e(()=>()=>{r.current=!1},[]),e(()=>{if(!r.current)r.current=!0;else return t()},n)};function ga(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);itypeof e=="function",Qm=e=>typeof e=="string",ya=e=>typeof e=="number",ci=!1;function H(e){ci&&(lt(e)||console.error(`useMemoizedFn expected parameter is a function, got ${typeof e}`));const t=p.useRef(e);t.current=p.useMemo(()=>e,[e]);const n=p.useRef();return n.current||(n.current=function(...r){return t.current.apply(this,r)}),n.current}const ui=Jm(p.useEffect),va=(e,{manual:t,ready:n=!0,defaultParams:r=[],refreshDeps:i=[],refreshDepsAction:s})=>{const o=p.useRef(!1);return o.current=!1,ui(()=>{!t&&n&&(o.current=!0,e.run(...r))},[n]),ui(()=>{o.current||t||(o.current=!0,s?s():e.refresh())},[...i]),{onBefore:()=>{if(!n)return{stopNow:!0}}}};va.onInit=({ready:e=!0,manual:t})=>({loading:!t&&e});const qm=va;function li(e,t){if(e===t)return!0;for(let n=0;n{ci&&(lt(e)||console.error(`useUnmount expected parameter is a function, got ${typeof e}`));const t=zt(e);p.useEffect(()=>()=>{t.current()},[])},Fn=new Map,eg=(e,t,n)=>{const r=Fn.get(e);r!=null&&r.timer&&clearTimeout(r.timer);let i;t>-1&&(i=setTimeout(()=>{Fn.delete(e)},t)),Fn.set(e,Object.assign(Object.assign({},n),{timer:i}))},tg=e=>Fn.get(e),In=new Map,ng=e=>In.get(e),rg=(e,t)=>{In.set(e,t),t.then(n=>(In.delete(e),n)).catch(()=>{In.delete(e)})},Ke={},ig=(e,t)=>{Ke[e]&&Ke[e].forEach(n=>n(t))},fi=(e,t)=>(Ke[e]||(Ke[e]=[]),Ke[e].push(t),function(){const r=Ke[e].indexOf(t);Ke[e].splice(r,1)}),sg=(e,{cacheKey:t,cacheTime:n=5*60*1e3,staleTime:r=0,setCache:i,getCache:s})=>{const o=p.useRef(),a=p.useRef(),c=(l,f)=>{i?i(f):eg(l,n,f),ig(l,f.data)},u=(l,f=[])=>s?s(f):tg(l);return ba(()=>{if(!t)return;const l=u(t);l&&Object.hasOwnProperty.call(l,"data")&&(e.state.data=l.data,e.state.params=l.params,(r===-1||new Date().getTime()-l.time<=r)&&(e.state.loading=!1)),o.current=fi(t,f=>{e.setState({data:f})})},[]),Wt(()=>{var l;(l=o.current)===null||l===void 0||l.call(o)}),t?{onBefore:l=>{const f=u(t,l);return!f||!Object.hasOwnProperty.call(f,"data")?{}:r===-1||new Date().getTime()-f.time<=r?{loading:!1,data:f==null?void 0:f.data,error:void 0,returnNow:!0}:{data:f==null?void 0:f.data,error:void 0}},onRequest:(l,f)=>{let d=ng(t);return d&&d!==a.current?{servicePromise:d}:(d=l(...f),a.current=d,rg(t,d),{servicePromise:d})},onSuccess:(l,f)=>{var d;t&&((d=o.current)===null||d===void 0||d.call(o),c(t,{data:l,params:f,time:new Date().getTime()}),o.current=fi(t,m=>{e.setState({data:m})}))},onMutate:l=>{var f;t&&((f=o.current)===null||f===void 0||f.call(o),c(t,{data:l,params:e.state.params,time:new Date().getTime()}),o.current=fi(t,d=>{e.setState({data:d})}))}}:{}},og=(e,{debounceWait:t,debounceLeading:n,debounceTrailing:r,debounceMaxWait:i})=>{const s=p.useRef(),o=p.useMemo(()=>{const a={};return n!==void 0&&(a.leading=n),r!==void 0&&(a.trailing=r),i!==void 0&&(a.maxWait=i),a},[n,r,i]);return p.useEffect(()=>{if(t){const a=e.runAsync.bind(e);return s.current=Ks(c=>{c()},t,o),e.runAsync=(...c)=>new Promise((u,l)=>{var f;(f=s.current)===null||f===void 0||f.call(s,()=>{a(...c).then(u).catch(l)})}),()=>{var c;(c=s.current)===null||c===void 0||c.cancel(),e.runAsync=a}}},[t,o]),t?{onCancel:()=>{var a;(a=s.current)===null||a===void 0||a.cancel()}}:{}},ag=(e,{loadingDelay:t})=>{const n=p.useRef();if(!t)return{};const r=()=>{n.current&&clearTimeout(n.current)};return{onBefore:()=>(r(),n.current=setTimeout(()=>{e.setState({loading:!0})},t),{loading:!1}),onFinally:()=>{r()},onCancel:()=>{r()}}},Bt=!!(typeof window<"u"&&window.document&&window.document.createElement);function di(){return Bt?document.visibilityState!=="hidden":!0}const $t=[];function cg(e){return $t.push(e),function(){const n=$t.indexOf(e);$t.splice(n,1)}}if(Bt){const e=()=>{if(!!di())for(let t=0;t<$t.length;t++){const n=$t[t];n()}};window.addEventListener("visibilitychange",e,!1)}const ug=(e,{pollingInterval:t,pollingWhenHidden:n=!0,pollingErrorRetryCount:r=-1})=>{const i=p.useRef(),s=p.useRef(),o=p.useRef(0),a=()=>{var c;i.current&&clearTimeout(i.current),(c=s.current)===null||c===void 0||c.call(s)};return ui(()=>{t||a()},[t]),t?{onBefore:()=>{a()},onError:()=>{o.current+=1},onSuccess:()=>{o.current=0},onFinally:()=>{r===-1||r!==-1&&o.current<=r?i.current=setTimeout(()=>{!n&&!di()?s.current=cg(()=>{e.refresh()}):e.refresh()},t):o.current=0},onCancel:()=>{a()}}:{}};function lg(e,t){let n=!1;return(...r)=>{n||(n=!0,e(...r),setTimeout(()=>{n=!1},t))}}function fg(){return Bt&&typeof navigator.onLine<"u"?navigator.onLine:!0}const Ht=[];function dg(e){return Ht.push(e),function(){const n=Ht.indexOf(e);n>-1&&Ht.splice(n,1)}}if(Bt){const e=()=>{if(!(!di()||!fg()))for(let t=0;t{const r=p.useRef(),i=()=>{var s;(s=r.current)===null||s===void 0||s.call(r)};return p.useEffect(()=>{if(t){const s=lg(e.refresh.bind(e),n);r.current=dg(()=>{s()})}return()=>{i()}},[t,n]),Wt(()=>{i()}),{}},pg=(e,{retryInterval:t,retryCount:n})=>{const r=p.useRef(),i=p.useRef(0),s=p.useRef(!1);return n?{onBefore:()=>{s.current||(i.current=0),s.current=!1,r.current&&clearTimeout(r.current)},onSuccess:()=>{i.current=0},onError:()=>{if(i.current+=1,n===-1||i.current<=n){const o=t!=null?t:Math.min(1e3*Math.pow(2,i.current),3e4);r.current=setTimeout(()=>{s.current=!0,e.refresh()},o)}else i.current=0},onCancel:()=>{i.current=0,r.current&&clearTimeout(r.current)}}:{}},mg=(e,{throttleWait:t,throttleLeading:n,throttleTrailing:r})=>{const i=p.useRef(),s={};return n!==void 0&&(s.leading=n),r!==void 0&&(s.trailing=r),p.useEffect(()=>{if(t){const o=e.runAsync.bind(e);return i.current=Wh(a=>{a()},t,s),e.runAsync=(...a)=>new Promise((c,u)=>{var l;(l=i.current)===null||l===void 0||l.call(i,()=>{o(...a).then(c).catch(u)})}),()=>{var a;e.runAsync=o,(a=i.current)===null||a===void 0||a.cancel()}}},[t,n,r]),t?{onCancel:()=>{var o;(o=i.current)===null||o===void 0||o.cancel()}}:{}},gg=e=>{ci&&(lt(e)||console.error(`useMount: parameter \`fn\` expected to be a function, but got "${typeof e}".`)),p.useEffect(()=>{e==null||e()},[])},yg=()=>{const[,e]=p.useState({});return p.useCallback(()=>e({}),[])};class vg{constructor(t,n,r,i={}){this.serviceRef=t,this.options=n,this.subscribe=r,this.initState=i,this.count=0,this.state={loading:!1,params:void 0,data:void 0,error:void 0},this.state=Object.assign(Object.assign(Object.assign({},this.state),{loading:!n.manual}),i)}setState(t={}){this.state=Object.assign(Object.assign({},this.state),t),this.subscribe()}runPluginHandler(t,...n){const r=this.pluginImpls.map(i=>{var s;return(s=i[t])===null||s===void 0?void 0:s.call(i,...n)}).filter(Boolean);return Object.assign({},...r)}runAsync(...t){var n,r,i,s,o,a,c,u,l,f;return Zm(this,void 0,void 0,function*(){this.count+=1;const d=this.count,m=this.runPluginHandler("onBefore",t),{stopNow:w=!1,returnNow:y=!1}=m,k=ga(m,["stopNow","returnNow"]);if(w)return new Promise(()=>{});if(this.setState(Object.assign({loading:!0,params:t},k)),y)return Promise.resolve(k.data);(r=(n=this.options).onBefore)===null||r===void 0||r.call(n,t);try{let{servicePromise:E}=this.runPluginHandler("onRequest",this.serviceRef.current,t);E||(E=this.serviceRef.current(...t));const x=yield E;return d!==this.count?new Promise(()=>{}):(this.setState({data:x,error:void 0,loading:!1}),(s=(i=this.options).onSuccess)===null||s===void 0||s.call(i,x,t),this.runPluginHandler("onSuccess",x,t),(a=(o=this.options).onFinally)===null||a===void 0||a.call(o,t,x,void 0),d===this.count&&this.runPluginHandler("onFinally",t,x,void 0),x)}catch(E){if(d!==this.count)return new Promise(()=>{});throw this.setState({error:E,loading:!1}),(u=(c=this.options).onError)===null||u===void 0||u.call(c,E,t),this.runPluginHandler("onError",E,t),(f=(l=this.options).onFinally)===null||f===void 0||f.call(l,t,void 0,E),d===this.count&&this.runPluginHandler("onFinally",t,void 0,E),E}})}run(...t){this.runAsync(...t).catch(n=>{this.options.onError||console.error(n)})}cancel(){this.count+=1,this.setState({loading:!1}),this.runPluginHandler("onCancel")}refresh(){this.run(...this.state.params||[])}refreshAsync(){return this.runAsync(...this.state.params||[])}mutate(t){const n=lt(t)?t(this.state.data):t;this.runPluginHandler("onMutate",n),this.setState({data:n})}}function bg(e,t={},n=[]){const{manual:r=!1}=t,i=ga(t,["manual"]),s=Object.assign({manual:r},i),o=zt(e),a=yg(),c=ba(()=>{const u=n.map(l=>{var f;return(f=l==null?void 0:l.onInit)===null||f===void 0?void 0:f.call(l,s)}).filter(Boolean);return new vg(o,s,a,Object.assign({},...u))},[]);return c.options=s,c.pluginImpls=n.map(u=>u(c,s)),gg(()=>{if(!r){const u=c.state.params||t.defaultParams||[];c.run(...u)}}),Wt(()=>{c.cancel()}),{loading:c.state.loading,data:c.state.data,error:c.state.error,params:c.state.params||[],cancel:H(c.cancel.bind(c)),refresh:H(c.refresh.bind(c)),refreshAsync:H(c.refreshAsync.bind(c)),run:H(c.run.bind(c)),runAsync:H(c.runAsync.bind(c)),mutate:H(c.mutate.bind(c))}}function wa(e,t,n){return bg(e,t,[...n||[],og,ag,ug,hg,mg,qm,sg,pg])}function _a(e=!1,t){const[n,r]=p.useState(e),i=p.useMemo(()=>{const s=t===void 0?!e:t;return{toggle:()=>r(l=>l===e?s:e),set:l=>r(l),setLeft:()=>r(e),setRight:()=>r(s)}},[]);return[n,i]}function wg(e=!1){const[t,{toggle:n,set:r}]=_a(e),i=p.useMemo(()=>({toggle:n,set:a=>r(!!a),setTrue:()=>r(!0),setFalse:()=>r(!1)}),[]);return[t,i]}function jn(e,t){if(!Bt)return;if(!e)return t;let n;return lt(e)?n=e():"current"in e?n=e.current:n=e,n}const Sa=(e=>(n,r,i)=>{const s=p.useRef(!1),o=p.useRef([]),a=p.useRef([]),c=p.useRef();e(()=>{var u;const f=(Array.isArray(i)?i:[i]).map(d=>jn(d));if(!s.current){s.current=!0,o.current=f,a.current=r,c.current=n();return}(f.length!==o.current.length||!li(f,o.current)||!li(r,a.current))&&((u=c.current)===null||u===void 0||u.call(c),o.current=f,a.current=r,c.current=n())}),Wt(()=>{var u;(u=c.current)===null||u===void 0||u.call(c),s.current=!1})})(p.useEffect);var ka={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Qh,function(){var n=1e3,r=6e4,i=36e5,s="millisecond",o="second",a="minute",c="hour",u="day",l="week",f="month",d="quarter",m="year",w="date",y="Invalid Date",k=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,E=/\[([^\]]+)]|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,x={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(v){var g=["th","st","nd","rd"],b=v%100;return"["+v+(g[(b-20)%10]||g[b]||g[0])+"]"}},F=function(v,g,b){var O=String(v);return!O||O.length>=g?v:""+Array(g+1-O.length).join(b)+v},N={s:F,z:function(v){var g=-v.utcOffset(),b=Math.abs(g),O=Math.floor(b/60),S=b%60;return(g<=0?"+":"-")+F(O,2,"0")+":"+F(S,2,"0")},m:function v(g,b){if(g.date()1)return v(D[0])}else{var I=g.name;A[I]=g,S=I}return!O&&S&&(L=S),S||!O&&L},W=function(v,g){if(M(v))return v.clone();var b=typeof g=="object"?g:{};return b.date=v,b.args=arguments,new R(b)},C=N;C.l=z,C.i=M,C.w=function(v,g){return W(v,{locale:g.$L,utc:g.$u,x:g.$x,$offset:g.$offset})};var R=function(){function v(b){this.$L=z(b.locale,null,!0),this.parse(b)}var g=v.prototype;return g.parse=function(b){this.$d=function(O){var S=O.date,P=O.utc;if(S===null)return new Date(NaN);if(C.u(S))return new Date;if(S instanceof Date)return new Date(S);if(typeof S=="string"&&!/Z$/i.test(S)){var D=S.match(k);if(D){var I=D[2]-1||0,V=(D[7]||"0").substring(0,3);return P?new Date(Date.UTC(D[1],I,D[3]||1,D[4]||0,D[5]||0,D[6]||0,V)):new Date(D[1],I,D[3]||1,D[4]||0,D[5]||0,D[6]||0,V)}}return new Date(S)}(b),this.$x=b.x||{},this.init()},g.init=function(){var b=this.$d;this.$y=b.getFullYear(),this.$M=b.getMonth(),this.$D=b.getDate(),this.$W=b.getDay(),this.$H=b.getHours(),this.$m=b.getMinutes(),this.$s=b.getSeconds(),this.$ms=b.getMilliseconds()},g.$utils=function(){return C},g.isValid=function(){return this.$d.toString()!==y},g.isSame=function(b,O){var S=W(b);return this.startOf(O)<=S&&S<=this.endOf(O)},g.isAfter=function(b,O){return W(b){const i=jn(n.target,window);if(!(i!=null&&i.addEventListener))return;const s=o=>r.current(o);return i.addEventListener(e,s,{capture:n.capture,once:n.once,passive:n.passive}),()=>{i.removeEventListener(e,s,{capture:n.capture})}},[e,n.capture,n.once,n.passive],n.target)}const hi=(e,t)=>{const{onEnter:n,onLeave:r,onChange:i}=t||{},[s,{setTrue:o,setFalse:a}]=wg(!1);return zn("mouseenter",()=>{n==null||n(),o(),i==null||i(!0)},{target:e}),zn("mouseleave",()=>{r==null||r(),a(),i==null||i(!1)},{target:e}),s},_g=(e,t=[])=>ph(e,t),Sg=(e,t,n)=>{const r=p.useRef(),i=p.useRef(0);_g(t,r.current)||(r.current=t,i.current+=1),Sa(e,[i.current],n)},kg=/(mac|iphone|ipod|ipad)/i.test(typeof navigator<"u"?navigator==null?void 0:navigator.platform:""),Wn={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};kg?Wn.meta=[91,93]:Wn.meta=[91,92];const pi={ctrl:e=>e.ctrlKey,shift:e=>e.shiftKey,alt:e=>e.altKey,meta:e=>e.type==="keyup"?Wn.meta.includes(e.keyCode):e.metaKey};function Eg(e){const t=Object.keys(pi).reduce((n,r)=>pi[r](e)?n+1:n,0);return[16,17,18,91,92].includes(e.keyCode)?t:t+1}function Ca(e,t,n){if(!e.key)return!1;if(ya(t))return e.keyCode===t;const r=t.split(".");let i=0;for(const s of r){const o=pi[s],a=Wn[s.toLowerCase()];(o&&o(e)||a&&a===e.keyCode)&&i++}return n?i===r.length&&Eg(e)===r.length:i===r.length}function Cg(e,t){return lt(e)?e:Qm(e)||ya(e)?n=>Ca(n,e,t):Array.isArray(e)?n=>e.some(r=>Ca(n,r,t)):()=>Boolean(e)}const xg=["keydown"];function ke(e,t,n){const{events:r=xg,target:i,exactMatch:s=!1,useCapture:o=!1}=n||{},a=zt(t),c=zt(e);Sg(()=>{var u;const l=jn(i,window);if(!l)return;const f=d=>{var m;if(Cg(c.current,s)(d))return(m=a.current)===null||m===void 0?void 0:m.call(a,d)};for(const d of r)(u=l==null?void 0:l.addEventListener)===null||u===void 0||u.call(l,d,f,o);return()=>{var d;for(const m of r)(d=l==null?void 0:l.removeEventListener)===null||d===void 0||d.call(l,m,f,o)}},[r],i)}function Ag(e){const t=p.useRef(0),[n,r]=p.useState(e),i=p.useCallback(s=>{cancelAnimationFrame(t.current),t.current=requestAnimationFrame(()=>{r(s)})},[]);return Wt(()=>{cancelAnimationFrame(t.current)}),[n,i]}const Og={screenX:NaN,screenY:NaN,clientX:NaN,clientY:NaN,pageX:NaN,pageY:NaN,elementX:NaN,elementY:NaN,elementH:NaN,elementW:NaN,elementPosX:NaN,elementPosY:NaN},Tg=e=>{const[t,n]=Ag(Og);return zn("mousemove",r=>{const{screenX:i,screenY:s,clientX:o,clientY:a,pageX:c,pageY:u}=r,l={screenX:i,screenY:s,clientX:o,clientY:a,pageX:c,pageY:u,elementX:NaN,elementY:NaN,elementH:NaN,elementW:NaN,elementPosX:NaN,elementPosY:NaN},f=jn(e);if(f){const{left:d,top:m,width:w,height:y}=f.getBoundingClientRect();l.elementPosX=d+window.pageXOffset,l.elementPosY=m+window.pageYOffset,l.elementX=c-l.elementPosX,l.elementY=u-l.elementPosY,l.elementW=w,l.elementH=y}n(l)},{target:()=>document}),t},de={modalMask:"_modal-mask_1fjgs_1",modal:"_modal_1fjgs_1",modalHeader:"_modal-header_1fjgs_23",modalBody:"_modal-body_1fjgs_30",modalTitle:"_modal-title_1fjgs_35",btnClose:"_btn-close_1fjgs_42"};let Ut=0;const Mg=()=>{Ut++,document.body.style.overflow="hidden"},Lg=()=>{Ut--,Ut<0&&(Ut=0),Ut===0&&(document.body.style.overflow="")};function mi({show:e,onHide:t,children:n,clsModalMask:r,clsModal:i,hideWhenMaskOnClick:s=!1,hideWhenEsc:o=!1}){p.useLayoutEffect(()=>{e?Mg():Lg()},[e]);const a=p.useRef(null),c=xo(),{bg:u,c:l}=p.useMemo(()=>{const y=window.getComputedStyle(document.body)["background-color"],k=window.getComputedStyle(document.body).color;return{bg:y,c:k}},[c]),f=p.useMemo(()=>c?{"--bg":u,"--c":l,backgroundColor:u,color:l}:{},[u,l,c]),d=p.useId(),m=p.useMemo(()=>{const y=document.createElement("div");return y.setAttribute("data-id","base-modal-"+d),document.body.appendChild(y),y},[]),w=H(y=>{var k;(k=a.current)!=null&&k.contains(y.target)||s&&t()});return ke("esc",()=>{!e||o&&t()}),e?me.createPortal(h("div",{className:X(de.modalMask,r),onClick:w,children:h("div",{className:X(de.modal,i),style:f,ref:a,children:n})}),m):null}const gi=e=>h(ct,{...e,name:"Close",size:18,style:{cursor:"pointer",marginLeft:10,...e.style}});var ft=1e3,dt=ft*60,ht=dt*60,Xe=ht*24,Rg=Xe*7,Pg=Xe*365.25,Dg=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return Ng(e);if(n==="number"&&isFinite(e))return t.long?Ig(e):Fg(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Ng(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!!t){var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*Pg;case"weeks":case"week":case"w":return n*Rg;case"days":case"day":case"d":return n*Xe;case"hours":case"hour":case"hrs":case"hr":case"h":return n*ht;case"minutes":case"minute":case"mins":case"min":case"m":return n*dt;case"seconds":case"second":case"secs":case"sec":case"s":return n*ft;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function Fg(e){var t=Math.abs(e);return t>=Xe?Math.round(e/Xe)+"d":t>=ht?Math.round(e/ht)+"h":t>=dt?Math.round(e/dt)+"m":t>=ft?Math.round(e/ft)+"s":e+"ms"}function Ig(e){var t=Math.abs(e);return t>=Xe?Bn(e,t,Xe,"day"):t>=ht?Bn(e,t,ht,"hour"):t>=dt?Bn(e,t,dt,"minute"):t>=ft?Bn(e,t,ft,"second"):e+" ms"}function Bn(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+" "+r+(i?"s":"")}const xa="_toast-container_mcbuq_1",Aa="_single-line_mcbuq_17",Hv={toastContainer:xa,singleLine:Aa};function fe(e,t=2e3){let n=typeof t=="number"?t:Dg(t);const r=document.createElement("div");r.className=xa,r.innerText=e,!e.includes(` `)&&!e.includes("r.remove(),n)}const jg="\u8BF7\u6C42\u5931\u8D25, \u8BF7\u91CD\u8BD5 !!!",zg="\u64CD\u4F5C\u5931\u8D25, \u8BF7\u91CD\u8BD5 !!!";function Oa(){return fe(jg)}function Ta(){return fe(zg)}function Wg(e){const t=Ot({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}const Ma="27eb53fc9058f8c3";async function Bg(){var c,u;const t=(await sr.default.get("https://passport.bilibili.com/login/app/third",{params:{appkey:Ma,api:"https://www.mcbbs.net/template/mcbbs/image/special_photo_bg.png",sign:"04224646d1fea004e79606d3b038c84a"},withCredentials:!0})).data;if(!((c=t==null?void 0:t.data)!=null&&c.has_login))return{errmsg:"\u4F60\u5FC5\u987B\u767B\u5F55B\u7AD9\u4E4B\u540E\u624D\u80FD\u4F7F\u7528\u6388\u6743",json:t};if(!((u=t==null?void 0:t.data)!=null&&u.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(l=>{window.addEventListener("message",f=>{if(f.origin!="https://www.mcbbs.net"||!f.data)return;const d=f.data.match(/access_key=([0-9a-z]{32})/);if(!d||!d[1])return l({errmsg:"\u6CA1\u6709\u83B7\u5F97\u5339\u914D\u7684\u5BC6\u94A5"});l(d[1])}),r=setTimeout(()=>{l({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 a=await i;return o(),a}async function $g(){const e=await Bg();if(typeof e=="object"&&"errmsg"in e){fe(e.errmsg);return}const t=e;return re.accessKey=t,fe("\u83B7\u53D6\u6210\u529F"),t}function Hg(){re.accessKey="",fe("\u5DF2\u5220\u9664 access_key")}const La="https://api.bilibili.com",Ra="https://app.bilibili.com",$n=sr.default.create({baseURL:La});$n.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 Hn=sr.default.create({adapter:Oc.default});Hn.interceptors.request.use(function(e){return e.params={appkey:Ma,access_key:re.accessKey||"",...e.params},e},function(e){return Promise.reject(e)}),Hn.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});function Ug(){var t;const e=(t=document.cookie.match(/bili_jct=([0-9a-fA-F]{32})/))==null?void 0:t[1];if(!e)throw fe("\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 Gt=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Un=typeof AbortController=="function"?AbortController:class{constructor(){this.signal=new Pa}abort(){this.signal.dispatchEvent("abort")}},Gg=typeof AbortSignal=="function",Vg=typeof Un.AbortSignal=="function",Pa=Gg?AbortSignal:Vg?Un.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))}},yi=new Set,vi=(e,t)=>{const n=`LRU_CACHE_OPTION_${e}`;Gn(n)&&wi(n,`${e} option`,`options.${t}`,Je)},bi=(e,t)=>{const n=`LRU_CACHE_METHOD_${e}`;if(Gn(n)){const{prototype:r}=Je,{get:i}=Object.getOwnPropertyDescriptor(r,e);wi(n,`${e} method`,`cache.${t}()`,i)}},Yg=(e,t)=>{const n=`LRU_CACHE_PROPERTY_${e}`;if(Gn(n)){const{prototype:r}=Je,{get:i}=Object.getOwnPropertyDescriptor(r,e);wi(n,`${e} property`,`cache.${t}`,i)}},Da=(...e)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...e):console.error(...e)},Gn=e=>!yi.has(e),wi=(e,t,n,r)=>{yi.add(e);const i=`The ${t} is deprecated. Please use ${n} instead.`;Da(i,"DeprecationWarning",e,r)},We=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),Na=e=>We(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?Vn:null:null;class Vn extends Array{constructor(t){super(t),this.fill(0)}}class Kg{constructor(t){if(t===0)return[];const n=Na(t);this.heap=new n(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}}class Je{constructor(t={}){const{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:u,disposeAfter:l,noDisposeOnSet:f,noUpdateTTL:d,maxSize:m=0,maxEntrySize:w=0,sizeCalculation:y,fetchMethod:k,fetchContext:E,noDeleteOnFetchRejection:x,noDeleteOnStaleGet:F}=t,{length:N,maxAge:L,stale:A}=t instanceof Je?{}:t;if(n!==0&&!We(n))throw new TypeError("max option must be a nonnegative integer");const M=n?Na(n):Array;if(!M)throw new Error("invalid max value: "+n);if(this.max=n,this.maxSize=m,this.maxEntrySize=w||this.maxSize,this.sizeCalculation=y||N,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=k||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=E,!this.fetchMethod&&E!==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 M(n),this.prev=new M(n),this.head=0,this.tail=0,this.free=new Kg(n),this.initialFill=1,this.size=0,typeof u=="function"&&(this.dispose=u),typeof l=="function"?(this.disposeAfter=l,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!f,this.noUpdateTTL=!!d,this.noDeleteOnFetchRejection=!!x,this.maxEntrySize!==0){if(this.maxSize!==0&&!We(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!We(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!c||!!A,this.noDeleteOnStaleGet=!!F,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=We(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||L||0,this.ttl){if(!We(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 z="LRU_CACHE_UNBOUNDED";Gn(z)&&(yi.add(z),Da("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",z,Je))}A&&vi("stale","allowStale"),L&&vi("maxAge","ttl"),N&&vi("length","sizeCalculation")}getRemainingTTL(t){return this.has(t,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new Vn(this.max),this.starts=new Vn(this.max),this.setItemTTL=(r,i,s=Gt.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?Gt.now():0};let t=0;const n=()=>{const r=Gt.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 Vn(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(!We(r))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(r=i(n,t),!We(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 bi("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 a=Gt.now()-this.starts[n];o.start=Math.floor(Date.now()-a)}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=Gt.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:a=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL}={}){if(o=this.requireSize(t,n,o,a),this.maxEntrySize&&o>this.maxEntrySize)return this.delete(t),this;let u=this.size===0?void 0:this.keyMap.get(t);if(u===void 0)u=this.newIndex(),this.keyList[u]=t,this.valList[u]=n,this.keyMap.set(t,u),this.next[this.tail]=u,this.prev[u]=this.tail,this.tail=u,this.size++,this.addItemSize(u,o),c=!1;else{const l=this.valList[u];n!==l&&(this.isBackgroundFetch(l)?l.__abortController.abort():s||(this.dispose(l,t,"set"),this.disposeAfter&&this.disposed.push([l,t,"set"])),this.removeItemSize(u),this.valList[u]=n,this.addItemSize(u,o)),this.moveToTail(u)}if(r!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),c||this.setItemTTL(u,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 Un,a={signal:o.signal,options:r,context:i},c=d=>(o.signal.aborted||this.set(t,d,a.options),d),u=d=>{if(this.valList[n]===f&&(!r.noDeleteOnFetchRejection||f.__staleWhileFetching===void 0?this.delete(t):this.valList[n]=f.__staleWhileFetching),f.__returned===f)throw d},l=d=>d(this.fetchMethod(t,s,a)),f=new Promise(l).then(c,u);return f.__abortController=o,f.__staleWhileFetching=s,f.__returned=null,n===void 0?(this.set(t,f,a.options),n=this.keyMap.get(t)):this.valList[n]=f,f}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:a=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:l=this.noDeleteOnFetchRejection,fetchContext:f=this.fetchContext,forceRefresh:d=!1}={}){if(!this.fetchMethod)return this.get(t,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i});const m={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:s,noDisposeOnSet:o,size:a,sizeCalculation:c,noUpdateTTL:u,noDeleteOnFetchRejection:l};let w=this.keyMap.get(t);if(w===void 0){const y=this.backgroundFetch(t,w,m,f);return y.__returned=y}else{const y=this.valList[w];if(this.isBackgroundFetch(y))return n&&y.__staleWhileFetching!==void 0?y.__staleWhileFetching:y.__returned=y;if(!d&&!this.isStale(w))return this.moveToTail(w),r&&this.updateItemAge(w),y;const k=this.backgroundFetch(t,w,m,f);return n&&k.__staleWhileFetching!==void 0?k.__staleWhileFetching:k.__returned=k}}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],a=this.isBackgroundFetch(o);return this.isStale(s)?a?n?o.__staleWhileFetching:void 0:(i||this.delete(t),n?o:void 0):a?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 bi("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 bi("reset","clear"),this.clear}get length(){return Yg("length","size"),this.size}static get AbortController(){return Un}static get AbortSignal(){return Pa}}var Xg=Je;const Jg=Xg;async function Zg(e){return(await $n.get("/pvideo",{params:{aid:e}})).data.data}async function Qg(e){return[]}const _i=new Jg({max:200});async function qg(e){if(_i.has(e))return _i.get(e);const[t,n]=await Promise.all([Zg(e),Qg()]);return _i.set(e,{pvideoData:t,dmData:n}),{pvideoData:t,dmData:n}}function Fa(e){return async function(n){const r=new FormData;r.append("aid",n),r.append("csrf",Ug());const s=(await $n.post("/x/v2/history/toview/"+e,r,{withCredentials:!0})).data,o=(s==null?void 0:s.code)===0&&(s==null?void 0:s.message)==="0";return o||fe((s==null?void 0:s.message)||"\u51FA\u9519\u4E86"),o}}const ey=Fa("add"),ty=Fa("del"),Ia=e=>{const t={dislike:"/x/feed/dislike",cancel:"/x/feed/dislike/cancel"}[e];return async function(n,r){var a;const s=(await Hn.get(Ra+t,{params:{goto:n.goto,id:n.param,mid:n.mid,rid:n.tid,tag_id:(a=n.tag)==null?void 0:a.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"}},ny=Ia("dislike"),ry=Ia("cancel"),Ze={modal:"_modal_g0in4_1",titleDesc:"_title-desc_g0in4_4",reasonList:"_reason-list_g0in4_8",reason:"_reason_g0in4_8",reasonNo:"_reason-no_g0in4_29",tips:"_tips_g0in4_43"},Yn=Wg();function iy(){return it(Yn)}function sy(e){const t=iy();if(!!e)return t.get(e)}function oy({show:e,onHide:t,item:n}){const[r,i]=p.useState(!1),s=H(async c=>{if(!n)return;let u=!1,l=null;try{i(!0),u=await ny(n,c.id)}catch(f){l=f}finally{i(!1)}if(l)return console.error(l.stack||l),Oa();u?fe("\u5DF2\u6807\u8BB0\u4E0D\u60F3\u770B"):Ta(),u&&(Yn.set(n.param,{...c}),t())}),o=p.useMemo(()=>{var c;return((c=n==null?void 0:n.three_point)==null?void 0:c.dislike_reasons)||[]},[n]),a=["1","2","3","4","5","6"];return ke(a,c=>{if(!e||!n||!a.includes(c.key))return;const u=Number(c.key)-1,l=document.querySelectorAll(`.${Ze.reason}`)[u]||null;l==null||l.click()}),T(mi,{show:e,onHide:t,clsModal:Ze.modal,hideWhenMaskOnClick:!0,hideWhenEsc:!0,children:[T("div",{className:de.modalHeader,children:[T("div",{className:de.modalTitle,children:["\u6211\u4E0D\u60F3\u770B",h("span",{className:Ze.titleDesc,children:"(\u9009\u62E9\u540E\u5C06\u51CF\u5C11\u76F8\u4F3C\u5185\u5BB9\u63A8\u8350)"})]}),h("div",{className:"space",style:{flex:1}}),h(gi,{onClick:t})]}),T("div",{className:de.modalBody,children:[h("div",{className:Ze.reasonList,children:o.map((c,u)=>T("button",{className:Ze.reason,"data-id":c.id,onClick:()=>s(c),disabled:r,children:[h("span",{className:Ze.reasonNo,children:u+1}),c.name]},c.id))}),T("div",{className:Ze.tips,children:[h(ct,{name:"Info",size:15,style:{marginRight:5}}),"\u4F7F\u7528\u5220\u9664\u952E\u6253\u5F00\u5F39\u6846, \u6570\u5B57\u952E\u9009\u62E9, Esc \u5173\u95ED"]})]})]})}const Kn={show:!1,onHide:za,item:null},ja=Ot({value:Kn.show}),ay=function(){return it(ja).value};function za(){Wa({show:!1,item:null})}function Wa(e){Object.assign(Kn,e),ja.value=Kn.show,cy().render(h(oy,{...Kn,onHide:za}))}let Si;function cy(){if(!Si){const e=document.createElement("div");e.classList.add("show-dislike-container"),document.body.appendChild(e),Si=dn(e)}return Si}function Ba(e){(e==null?void 0:e.param)&&Yn.has(e.param)||Wa({show:!0,item:e})}function uy(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=>Fh(o.toString(),2,"0")).join(":")}function ki(e){if(!e)return"";if(e<=9999)return e.toString();let t=(e/1e4).toFixed(1);return t=t.replace(/\.0$/,""),`${t}\u4E07`}const Q={biliVideoCard:"_bili-video-card_1a93a_1",imageWrapper:"_image-wrapper_1a93a_4",previewCardWrapper:"_preview-card-wrapper_1a93a_8",previewCardInner:"_preview-card-inner_1a93a_21",watchLater:"_watch-later_1a93a_25",badge:"_badge_1a93a_28",recommendReason:"_recommend-reason_1a93a_36",bangumiDesc:"_bangumi-desc_1a93a_51",btnDislike:"_btn-dislike_1a93a_54",btnDislikeIcon:"_btn-dislike-icon_1a93a_69",btnDislikeTip:"_btn-dislike-tip_1a93a_76",dislikedWrapper:"_disliked-wrapper_1a93a_91",dislikeContentCover:"_dislike-content-cover_1a93a_105",dislikeContentCoverInner:"_dislike-content-cover-inner_1a93a_111",dislikeIcon:"_dislike-icon_1a93a_122",dislikeReason:"_dislike-reason_1a93a_125",dislikeDesc:"_dislike-desc_1a93a_129",dislikeContentAction:"_dislike-content-action_1a93a_133"};function Ei(e,t){return isNaN(e)?t:e}function ly({className:e,videoDuration:t,pvideo:n,enterCursorState:r}){const i=p.useRef(null),s=Tg(i),o={videoDuration:t,pvideo:n,cursorState:s,elWidth:Ei(s.elementW,r.width),elHeight:Ei(s.elementH,r.height),relativeX:Ei(s.elementX,r.relativeX)};return h("div",{ref:i,className:X(Q.previewCardWrapper,e),children:n?h(fy,{...o}):!1})}function fy({videoDuration:e,pvideo:t,elWidth:n,elHeight:r,relativeX:i}){var A;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||0)*s));let a=p.useMemo(()=>{const M=(t==null?void 0:t.index)||[];let z=hy(M,o);return z!==-1?z:o>M[M.length-1]?(z=Math.floor(M.length*s)-1,z<0&&(z=0),z):0},[t,o]);const{img_x_len:c,img_y_len:u,img_x_size:l,img_y_size:f}=t,d=u*c;a=a+1;const m=Math.floor(a/d),w=a-m*d,y=((A=t.image)==null?void 0:A[m])||"",k=Math.floor(w/c)+1,E=w-(k-1)*c,x=n*c,F=r*u,N=(k-1)*r,L=(E-1)*n;return h("div",{className:Q.previewCardInner,style:{backgroundColor:"black",backgroundImage:`url(${y})`,backgroundPosition:`-${L}px -${N}px`,backgroundSize:`${x}px ${F}px`},children:h(dy,{progress:s})})}function dy({progress:e}){return h("div",{className:"track",style:{position:"absolute",bottom:0,left:0,backgroundColor:"#eee",width:"100%",height:2},children:h("div",{className:"bar",style:{backgroundColor:"#fa6a9d",height:"100%",width:`${e*100}%`}})})}function hy(e,t){var a;let n=0,r=e.length-1,i=-1;for(;n<=r;){const c=Math.floor((n+r)/2),u=e[c];if(t===u)return c;u{if(!e)return"";const t=Ea.unix(e);return t.format("YYYY")===py?t.format("M-D"):t.format("YY-M-D")},gy=e=>(e||"").replace(/^http:\/\//,"https://"),Ci=p.memo(function({style:t,className:n,item:r,loading:i,...s}){i=i!=null?i:!r;const o=T("div",{className:X("bili-video-card__skeleton",{hide:!i}),children:[h("div",{className:"bili-video-card__skeleton--cover"}),h("div",{className:"bili-video-card__skeleton--info",children:T("div",{className:"bili-video-card__skeleton--right",children:[h("p",{className:"bili-video-card__skeleton--text"}),h("p",{className:"bili-video-card__skeleton--text short"}),h("p",{className:"bili-video-card__skeleton--light"})]})})]}),a=sy((r==null?void 0:r.api)==="app"&&r.param);return T("div",{style:t,className:X("bili-video-card",Q.biliVideoCard,n),"data-report":"partition_recommend.content",...s,children:[o,!i&&r&&(a?h(yy,{item:r,dislikedReason:a}):h(vy,{item:r}))]})}),yy=p.memo(function({dislikedReason:t,item:n}){const r=H(async()=>{if(!(t!=null&&t.id))return;let i=!1,s=null;try{i=await ry(n,t.id)}catch(o){s=o}if(s)return console.error(s.stack||s),Oa();i?fe("\u5DF2\u64A4\u9500"):Ta(),i&&Yn.delete(n.param)});return T("div",{className:X(Q.dislikedWrapper),children:[h("div",{className:Q.dislikeContentCover,children:T("div",{className:Q.dislikeContentCoverInner,children:[h(ct,{name:"DistraughtFace",size:32,className:Q.dislikeIcon}),h("div",{className:Q.dislikeReason,children:t==null?void 0:t.name}),h("div",{className:Q.dislikeDesc,children:(t==null?void 0:t.toast)||"\u5C06\u51CF\u5C11\u6B64\u7C7B\u5185\u5BB9\u63A8\u8350"})]})}),h("div",{className:Q.dislikeContentAction,children:T("button",{onClick:r,children:[h(ct,{name:"Return",size:"16",style:{marginRight:4,marginTop:-2}}),"\u64A4\u9500"]})})]})}),vy=p.memo(function({item:t}){var _c,Sc,kc;const n=p.useRef(null),[r,i]=p.useState(()=>({width:0,height:0,relativeX:0}));zn("mouseenter",ae=>{var Ec;const Le=(Ec=n.current)==null?void 0:Ec.getBoundingClientRect();if(!Le)return;const{width:bt,height:Xi,x:hv}=Le;i({width:bt,height:Xi,relativeX:ae.pageX-window.pageXOffset-hv})},{target:n});const s=hi(n),o=p.useRef(null),a=hi(o),[c,u]=p.useState(!1),{accessKey:l}=je(),f=Boolean(l),d=t.api==="pc",m=t.api==="app",w=String(d?t.id:t.param),y=d?t.bvid:"",k=t.goto,E=d?t.stat.view:void 0,x=d?t.stat.like:void 0,F=t.title,N=d?t.pic:t.cover,L=d?t.pubdate:void 0,A=(d?t.duration:(_c=t.player_args)==null?void 0:_c.duration)||0,M=d?t.owner.name:t.args.up_name;d&&t.owner.face;const z=d?t.owner.mid:t.args.up_id,W=void 0,C=d?void 0:t.badge,R=d?void 0:((Sc=t.desc_button)==null?void 0:Sc.text)||"",_=d?(kc=t.rcmd_reason)==null?void 0:kc.content:t.rcmd_reason,v=p.useMemo(()=>my(L),[L]),g=p.useMemo(()=>gy(N),[N]),[b,O]=p.useState(null),[S,P]=p.useState(!1),D=H(async()=>{if(!b&&!S)try{P(!0);const ae=await qg(w);O(ae)}finally{P(!1)}});p.useEffect(()=>{s&&D()},[s]);let I=!1;const V=H(async ae=>{if(ae.preventDefault(),I)return;I=!0;const Le=c?ty:ey;let bt=!1;try{bt=await Le(w)}finally{I=!1}bt&&u(Xi=>!Xi)}),G=p.useRef(null),q=hi(G),Oe=H(ae=>{ae.stopPropagation(),ae.preventDefault(),m&&Ba(t)}),he=t.goto==="bangumi",Te=t.goto==="av",Me=d?Te&&y?`/video/${y}`:t.uri:Te?`/video/av${t.param}`:t.uri,Be=p.useMemo(()=>uy(A),[A]),ne=p.useMemo(()=>ki(E),[E]),pe=p.useMemo(()=>ki(x),[x]),qt=p.useMemo(()=>ki(W),[W]),vt=d?pe:qt,dv=H(ae=>{if(!re.openInIINAWhenRightClick)return;const Le=new URL(Me,location.href).href,bt=`iina://open?url=${encodeURIComponent(Le)}`;window.open(bt,"_self"),ae.preventDefault()}),rr=({text:ae,iconSvgName:Le})=>T("span",{className:"bili-video-card__stats--item",children:[h("svg",{className:"bili-video-card__stats--icon",children:h("use",{xlinkHref:Le})}),h("span",{className:"bili-video-card__stats--text",children:ae})]}),Ki={play:"#widget-video-play-count",danmaku:"#widget-video-danmaku",like:"#widget-agree",bangumiFollow:"#widget-agree"},bc={1:"play",2:"like",3:"danmaku",4:"bangumiFollow"},wc=ae=>{const Le=bc[ae]||bc[1];return Ki[Le]};return T("div",{className:"bili-video-card__wrap __scale-wrap",onContextMenu:dv,children:[h("a",{href:Me,target:"_blank","data-mod":"partition_recommend","data-idx":"content","data-ext":"click",children:T("div",{className:"bili-video-card__image __scale-player-wrap",ref:n,children:[T("div",{className:X("bili-video-card__image--wrap",Q.imageWrapper),children:[T("picture",{className:"v-img bili-video-card__cover",children:[h("source",{srcSet:`${g}@672w_378h_1c_!web-home-common-cover.avif`,type:"image/avif"}),h("source",{srcSet:`${g}@672w_378h_1c_!web-home-common-cover.webp`,type:"image/webp"}),h("img",{src:`${g}@672w_378h_1c_!web-home-common-cover`,alt:F,loading:"eager"})]}),s&&h(ly,{videoDuration:A,pvideo:b==null?void 0:b.pvideoData,enterCursorState:r}),T("div",{className:`bili-watch-later ${Q.watchLater}`,style:{display:s?"flex":"none"},ref:o,onClick:V,children:[h("svg",{className:"bili-watch-later__icon",children:h("use",{xlinkHref:c?"#widget-watch-save":"#widget-watch-later"})}),h("span",{className:"bili-watch-later__tip",style:{display:a?"block":"none"},children:c?"\u79FB\u9664":"\u7A0D\u540E\u518D\u770B"})]}),m&&f&&T("div",{ref:G,className:Q.btnDislike,onClick:Oe,style:{display:s?"flex":"none"},children:[h("svg",{className:Q.btnDislikeIcon,children:h("use",{xlinkHref:"#widget-close"})}),h("span",{className:Q.btnDislikeTip,style:{display:q?"block":"none"},children:"\u6211\u4E0D\u60F3\u770B"})]})]}),h("div",{className:"bili-video-card__mask",children:T("div",{className:"bili-video-card__stats",children:[h("div",{className:"bili-video-card__stats--left",children:d?T(ze,{children:[rr({text:ne,iconSvgName:Ki.play}),rr({text:k==="av"?pe:vt,iconSvgName:Ki.like})]}):T(ze,{children:[rr({iconSvgName:wc(t.cover_left_icon_1),text:t.cover_left_text_1}),rr({iconSvgName:wc(t.cover_left_icon_2),text:t.cover_left_text_2})]})}),h("span",{className:"bili-video-card__stats__duration",children:Te&&Be})]})})]})}),h("div",{className:"bili-video-card__info __scale-disable",children:T("div",{className:"bili-video-card__info--right",children:[h("a",{href:Me,target:"_blank","data-mod":"partition_recommend","data-idx":"content","data-ext":"click",children:h("h3",{className:"bili-video-card__info--tit",title:F,children:F})}),T("p",{className:"bili-video-card__info--bottom",children:[Te&&T("a",{className:"bili-video-card__info--owner",href:`//space.bilibili.com/${z}`,target:"_blank","data-mod":"partition_recommend","data-idx":"content","data-ext":"click",children:[_?h("span",{className:Q.recommendReason,children:_}):h("svg",{className:"bili-video-card__info--owner__up",children:h("use",{xlinkHref:"#widget-up"})}),h("span",{className:"bili-video-card__info--author",children:M}),v&&T("span",{className:"bili-video-card__info--date",children:["\xB7 ",v]})]}),he&&T("a",{className:"bili-video-card__info--owner",href:Me,target:"_blank",children:[h("span",{className:Q.badge,children:C||""}),h("span",{className:Q.bangumiDesc,children:R||""})]})]})]})})]})}),$a="bilibili-app-recommend";var Xn={exports:{}},xi={exports:{}},Vt={exports:{}},Y=Vt.exports={},Ee,Ce;function Ai(){throw new Error("setTimeout has not been defined")}function Oi(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Ee=setTimeout:Ee=Ai}catch{Ee=Ai}try{typeof clearTimeout=="function"?Ce=clearTimeout:Ce=Oi}catch{Ce=Oi}})();function Ha(e){if(Ee===setTimeout)return setTimeout(e,0);if((Ee===Ai||!Ee)&&setTimeout)return Ee=setTimeout,setTimeout(e,0);try{return Ee(e,0)}catch{try{return Ee.call(null,e,0)}catch{return Ee.call(this,e,0)}}}function by(e){if(Ce===clearTimeout)return clearTimeout(e);if((Ce===Oi||!Ce)&&clearTimeout)return Ce=clearTimeout,clearTimeout(e);try{return Ce(e)}catch{try{return Ce.call(null,e)}catch{return Ce.call(this,e)}}}var Fe=[],pt=!1,Qe,Jn=-1;function wy(){!pt||!Qe||(pt=!1,Qe.length?Fe=Qe.concat(Fe):Jn=-1,Fe.length&&Ua())}function Ua(){if(!pt){var e=Ha(wy);pt=!0;for(var t=Fe.length;t;){for(Qe=Fe,Fe=[];++Jn1)for(var n=1;n=i)return a;switch(a){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch{return"[Circular]"}default:return a}}),o=r[n];n=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),qn(t)?n.showHidden=t:t&&ji(n,t),Ae(n.showHidden)&&(n.showHidden=!1),Ae(n.depth)&&(n.depth=2),Ae(n.colors)&&(n.colors=!1),Ae(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=Sy),Qn(n,e,n.depth)}xe.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]},xe.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function Sy(e,t){var n=xe.styles[t];return n?"\x1B["+xe.colors[n][0]+"m"+e+"\x1B["+xe.colors[n][1]+"m":e}function ky(e,t){return e}function Ey(e){var t={};return e.forEach(function(n,r){t[n]=!0}),t}function Qn(e,t,n){if(e.customInspect&&t&&Zt(t.inspect)&&t.inspect!==xe&&!(t.constructor&&t.constructor.prototype===t)){var r=t.inspect(n,e);return Kt(r)||(r=Qn(e,r,n)),r}var i=Cy(e,t);if(i)return i;var s=Object.keys(t),o=Ey(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(t)),Jt(t)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return Ri(t);if(s.length===0){if(Zt(t)){var a=t.name?": "+t.name:"";return e.stylize("[Function"+a+"]","special")}if(Xt(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(er(t))return e.stylize(Date.prototype.toString.call(t),"date");if(Jt(t))return Ri(t)}var c="",u=!1,l=["{","}"];if(Di(t)&&(u=!0,l=["[","]"]),Zt(t)){var f=t.name?": "+t.name:"";c=" [Function"+f+"]"}if(Xt(t)&&(c=" "+RegExp.prototype.toString.call(t)),er(t)&&(c=" "+Date.prototype.toUTCString.call(t)),Jt(t)&&(c=" "+Ri(t)),s.length===0&&(!u||t.length==0))return l[0]+c+l[1];if(n<0)return Xt(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var d;return u?d=xy(e,t,n,o,s):d=s.map(function(m){return Pi(e,t,n,o,m,u)}),e.seen.pop(),Ay(d,c,l)}function Cy(e,t){if(Ae(t))return e.stylize("undefined","undefined");if(Kt(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(Ni(t))return e.stylize(""+t,"number");if(qn(t))return e.stylize(""+t,"boolean");if(Yt(t))return e.stylize("null","null")}function Ri(e){return"["+Error.prototype.toString.call(e)+"]"}function xy(e,t,n,r,i){for(var s=[],o=0,a=t.length;o-1&&(s?a=a.split(` `).map(function(u){return" "+u}).join(` `).substr(2):a=` `+a.split(` `).map(function(u){return" "+u}).join(` `))):a=e.stylize("[Circular]","special")),Ae(o)){if(s&&i.match(/^\d+$/))return a;o=JSON.stringify(""+i),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+a}function Ay(e,t,n){var r=e.reduce(function(i,s){return s.indexOf(` `)>=0,i+s.replace(/\u001b\[\d\d?m/g,"").length+1},0);return r>60?n[0]+(t===""?"":t+` `)+" "+e.join(`, `)+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function Di(e){return Array.isArray(e)}function qn(e){return typeof e=="boolean"}function Yt(e){return e===null}function Ka(e){return e==null}function Ni(e){return typeof e=="number"}function Kt(e){return typeof e=="string"}function Xa(e){return typeof e=="symbol"}function Ae(e){return e===void 0}function Xt(e){return qe(e)&&Fi(e)==="[object RegExp]"}function qe(e){return typeof e=="object"&&e!==null}function er(e){return qe(e)&&Fi(e)==="[object Date]"}function Jt(e){return qe(e)&&(Fi(e)==="[object Error]"||e instanceof Error)}function Zt(e){return typeof e=="function"}function Ja(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||typeof e>"u"}function Za(e){return Buffer.isBuffer(e)}function Fi(e){return Object.prototype.toString.call(e)}function Ii(e){return e<10?"0"+e.toString(10):e.toString(10)}var Oy=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ty(){var e=new Date,t=[Ii(e.getHours()),Ii(e.getMinutes()),Ii(e.getSeconds())].join(":");return[e.getDate(),Oy[e.getMonth()],t].join(" ")}function Qa(){console.log("%s - %s",Ty(),mt.apply(null,arguments))}function ji(e,t){if(!t||!qe(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}function qa(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var My=ep(Object.freeze(Object.defineProperty({__proto__:null,format:mt,deprecate:Mi,debuglog:Ya,inspect:xe,isArray:Di,isBoolean:qn,isNull:Yt,isNullOrUndefined:Ka,isNumber:Ni,isString:Kt,isSymbol:Xa,isUndefined:Ae,isRegExp:Xt,isObject:qe,isDate:er,isError:Jt,isFunction:Zt,isPrimitive:Ja,isBuffer:Za,log:Qa,inherits:Va,_extend:ji,default:{inherits:Va,_extend:ji,log:Qa,isBuffer:Za,isPrimitive:Ja,isFunction:Zt,isError:Jt,isDate:er,isObject:qe,isRegExp:Xt,isUndefined:Ae,isSymbol:Xa,isString:Kt,isNumber:Ni,isNullOrUndefined:Ka,isNull:Yt,isBoolean:qn,isArray:Di,inspect:xe,deprecate:Mi,format:mt,debuglog:Ya}},Symbol.toStringTag,{value:"Module"}))).format;function Ly(){(typeof AbortController>"u"||typeof AbortSignal>"u")&&console.error("[promise.timeout] need global AbortController & AbortSingal")}function Ry(e,t){return function(){var n=this,r=[].slice.call(arguments);Ly();var i=new AbortController;return r.push(i.signal),new Promise(function(s,o){var a=setTimeout(function(){var c=new tr(t);o(c),i.abort()},t);Promise.resolve(e.apply(n,r)).then(function(c){clearTimeout(a),s(c)},function(c){clearTimeout(a),o(c)})})}}class tr extends Error{constructor(t){super(),this.timeout=t,this.message=My("timeout of %sms exceed",t),Error.captureStackTrace(this,tr)}}xi.exports=Ry,xi.exports.TimeoutError=tr;const ec=xi.exports,Py=ec.TimeoutError;Xn.exports=function(t,n){const r=t;n=n||{};const i=n.times||5,s=n.timeout;s&&(t=ec(t,s));const o=n.onerror;return async function(){const a=this,c=[].slice.call(arguments),u=new Array(i);for(let l=0;l"} ${this.times} times`,this.timeout&&(this.message+=` with timeout = ${this.timeout}ms`),Error.captureStackTrace(this,this.constructor)}}class Dy 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 Ny=Xn.exports.RetryError=tc;Xn.exports.TimeoutError=Py;class zi extends Error{constructor(n){super();ir(this,"json");Error.captureStackTrace(this,zi),this.json=n,this.message=n.message||JSON.stringify(n)}}async function Fy(){var r;const t=(await Hn.get(Ra+"/x/v2/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 zi(t);return fe(`${$a}: \u672A\u77E5\u9519\u8BEF, \u8BF7\u8054\u7CFB\u5F00\u53D1\u8005 code=${t.code} message=${t.message||""}`,"5s"),[]}return((r=t==null?void 0:t.data)==null?void 0:r.items)||[]}const Iy=Xn.exports(Fy,{times:5,timeout:2e3,onerror(e,t){console.info("[%s] tryGetRecommend onerror: index=%s",$a,t,e)}});async function jy(){try{return await Iy()}catch(e){if(e instanceof Ny){console.error(e.errors);const t=[mt("\u8BF7\u6C42\u51FA\u9519, \u5DF2\u91CD\u8BD5%s\u6B21:",e.times),...e.errors.map((n,r)=>mt(" %s) %s",r+1,n.message)),"","\u8BF7\u91CD\u65B0\u83B7\u53D6 access_key \u540E\u91CD\u8BD5~"].join(` `);fe(t,"5s")}throw e}}async function nc(e){let t=[];const n=new Array(e).fill(0).map(i=>jy());return t=(await Promise.all(n)).reduce((i,s)=>i.concat(s||[]),[]),t=so(t,i=>i.param),t.map(i=>({...i,api:"app",uniqId:i.param+"-"+crypto.randomUUID()}))}async function zy(){return nc(2)}async function Wy(e){const t=e.page++;return(await $n.get("/x/web-interface/index/top/rcmd",{baseURL:La,withCredentials:!0,params:{fresh_type:3,version:1,ps:14,fresh_idx:t,fresh_idx_1h:t,homepage_ver:1}})).data.data.item}async function rc(e,t){let n=(await Promise.all(new Array(e).fill(0).map(()=>Wy(t)))).flat();return n=so(n,r=>r.id),n.forEach(r=>{var i,s;((i=r.rcmd_reason)==null?void 0:i.reason_type)===1&&((s=r.rcmd_reason).content||(s.content="\u5DF2\u5173\u6CE8"))}),n.map(r=>({...r,uniqId:r.id+"-"+crypto.randomUUID(),api:"pc"}))}async function By(e){return rc(1,e)}async function ic(e,t){return re.usePcDesktopApi?rc(e,t):nc(e)}async function $y(e){return re.usePcDesktopApi?By(e):zy()}var oe={exports:{}},Hy="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Uy=Hy,Gy=Uy;function sc(){}function oc(){}oc.resetWarningCache=sc;var Vy=function(){function e(r,i,s,o,a,c){if(c!==Gy){var u=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 u.name="Invariant Violation",u}}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:oc,resetWarningCache:sc};return n.PropTypes=n,n};oe.exports=Vy();class Wi extends p.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=E,l&&l(E)};const k=[n];return i&&(a?o?k.unshift(a):k.push(a):this.defaultLoader&&(o?k.unshift(this.defaultLoader):k.push(this.defaultLoader))),ce.default.createElement(r,y,k)}}ir(Wi,"propTypes",{children:oe.exports.node.isRequired,element:oe.exports.node,hasMore:oe.exports.bool,initialLoad:oe.exports.bool,isReverse:oe.exports.bool,loader:oe.exports.node,loadMore:oe.exports.func.isRequired,pageStart:oe.exports.number,ref:oe.exports.func,getScrollParent:oe.exports.func,threshold:oe.exports.number,useCapture:oe.exports.bool,useWindow:oe.exports.bool}),ir(Wi,"defaultProps",{element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null});const Bi="_video-grid_14t5i_9",ac="_limit-two-lines_14t5i_19",$i="_internal-testing_14t5i_43",Yy="_limit-one-line_14t5i_50",cc="_narrow-mode_14t5i_71",v1={videoGrid:Bi,limitTwoLines:ac,internalTesting:$i,limitOneLine:Yy,narrowMode:cc};function Ky({enabled:e,refresh:t,minIndex:n=0,maxIndex:r,containerRef:i,getScrollerRect:s,openDislikeAt:o,changeScrollY:a}){const[c,u]=p.useState(null),l=H(()=>{var v;if(!e)return!1;const _=(((v=document.activeElement)==null?void 0:v.tagName)||"").toLowerCase();return!(["input","textarea"].includes(_)||document.querySelector(".center-search__bar.is-focus"))}),f=H(()=>{var g;if(c===null||!i.current)return!1;const _=s(),v=(g=i.current.querySelector(`.${gt.card}.${gt.cardActive}`))==null?void 0:g.getBoundingClientRect();return!(!_||!v||v.top-_.top<-(_.height+v.height)||v.top-_.top>_.height*2+v.height)}),d=H((_,v)=>{if(!l())return;v==null||v.preventDefault();const g=f()?c+_:L();if(gr){W(r);return}u(g),W(g)}),m=p.useCallback(_=>{d(-1,_)},[]),w=p.useCallback(_=>{d(1,_)},[]);ke("leftarrow",m),ke("rightarrow",w);const y=p.useCallback(_=>{d(-R(),_)},[]),k=p.useCallback(_=>{d(R(),_)},[]);ke("uparrow",y),ke("downarrow",k);const E=H(()=>{!l()||u(null)}),x=H(()=>{!l()||typeof c!="number"||C(c)}),F=H(()=>{!l()||typeof c!="number"||o(c)});ke("esc",E),ke("enter",x),ke("backspace",F);const N=H(()=>{!l()||t()});ke("r",N,{exactMatch:!0});function L(){const _=s();if(!_)return 0;const v=M();for(let g=0;g=_.top)return g;return 0}const A=`.${gt.card}`;function M(){var _;return[...((_=i.current)==null?void 0:_.querySelectorAll(A))||[]]}function z(_){return M()[_]}function W(_){var O;const v=z(_);(O=v==null?void 0:v.scrollIntoViewIfNeeded)==null||O.call(v,!1);const g=s(),b=v.getBoundingClientRect();if(!(!g||!b)){if(b.top<=g.top){const S=-(g.top-b.top+10);a==null||a({offset:S});return}if(g.bottom-b.bottom<10){const S=10-(g.bottom-b.bottom);a==null||a({offset:S});return}}}function C(_){const v=z(_);if(!v)return;const g=v.querySelector(".bili-video-card__wrap > a");g==null||g.click()}function R(){if(re.useNarrowMode)return 2;let _=uc.get(window.innerWidth);if(_)return _;const v=i.current;if(!v)return 0;const g=window.getComputedStyle(v);return g.display!=="grid"?0:(_=g.gridTemplateColumns.split(" ").length,uc.set(window.innerWidth,_),_)}return{activeIndex:c,clearActiveIndex:E}}const uc=new Map,gt={loader:ai` text-align: center; line-height: 60px; font-size: 120%; `,card:ai` border: 2px solid transparent; /* global class under .card */ .bili-video-card__info { padding-left: 2px; padding-bottom: 1px; margin-top: calc(var(--info-margin-top) - 1px); } `,cardActive:ai` border-color: #fb7299; border-radius: 6px; overflow: hidden; `},lc=p.forwardRef(({infiteScrollUseWindow:e,shortcutEnabled:t,onScrollToTop:n,className:r,scrollerRef:i},s)=>{const[o,a]=p.useState([]),[c,u]=p.useState(!1);p.useImperativeHandle(s,()=>({refresh:f}));const l=p.useMemo(()=>({page:1}),[]),f=H(async()=>{await(n==null?void 0:n());try{x(),u(!0),l.page=1,a(await ic(2,l)),x()}finally{u(!1)}}),d=H(async()=>{const N=await ic(2,l);a(L=>[...L,...N])}),{useNarrowMode:m}=je(),w=p.useRef(null),y=H(()=>{var N;if(e){const L=ko+50;return new DOMRect(0,L,window.innerWidth,window.innerHeight-L)}else return(N=i==null?void 0:i.current)==null?void 0:N.getBoundingClientRect()}),k=ay(),{activeIndex:E,clearActiveIndex:x}=Ky({enabled:t&&!k,refresh:f,maxIndex:o.length-1,containerRef:w,getScrollerRect:y,openDislikeAt(N){const L=o[N];L.api==="app"&&Ba(L)},changeScrollY:e?function({offset:N,absolute:L}){const A=document.documentElement;if(typeof N=="number"){A.scrollTop+=N;return}if(typeof L=="number"){A.scrollTop=L;return}}:void 0}),F=Mt();return h(Wi,{pageStart:0,loadMore:d,hasMore:!0,useWindow:e,threshold:360,style:{minHeight:"100%"},loader:h("div",{className:gt.loader,children:"\u52A0\u8F7D\u4E2D..."},0),children:h("div",{ref:w,className:X(Bi,{[$i]:F},{[cc]:m},r),children:o.map((N,L)=>h(Ci,{loading:c,item:N,className:X(gt.card,{[gt.cardActive]:L===E})},N.uniqId))})})});function Hi(){const e=p.useRef(null),{accessKey:t}=je(),n=wa($g,{manual:!0}),r=H(async()=>{var a;await n.runAsync()&&((a=e.current)==null||a.set(!1))}),i=Hg,s=H(()=>{const o="https://github.com/indefined/UserScripts/tree/master/bilibiliHome#%E6%8E%88%E6%9D%83%E8%AF%B4%E6%98%8E";window.open(o,"_blank")});return h(ze,{children:t?T(ze,{children:[h("button",{className:"primary-btn roll-btn",onClick:s,children:h("span",{children:"access_key \u8BF4\u660E"})}),h("button",{className:"primary-btn roll-btn",onClick:()=>r(),disabled:n.loading,children:h("span",{children:"\u91CD\u65B0\u83B7\u53D6 access_key"})}),h("button",{className:"primary-btn roll-btn",onClick:i,children:h("span",{children:"\u5220\u9664 access_key"})})]}):T(ze,{children:[h("button",{className:"primary-btn roll-btn",onClick:s,children:h("span",{children:"access_key \u8BF4\u660E"})}),h("button",{className:"primary-btn roll-btn",onClick:r,disabled:n.loading,children:h("span",{children:"\u83B7\u53D6 access_key"})})]})})}const Ui={container:{name:"8irbms",styles:"display:inline-flex;align-items:center"},checkbox:{name:"4l4ubo",styles:"cursor:pointer;outline:none"},label:{name:"side0b",styles:"margin-left:2px;user-select:none;cursor:pointer"}};function fc({className:e,label:t,checked:n,onChange:r}){const i=p.useCallback(o=>{const a=o.target.checked;r(a)},[r]),s=p.useId();return T("span",{css:Ui.container,className:e,children:[h("input",{type:"checkbox",id:s,checked:n,onChange:i,css:Ui.checkbox}),h("label",{htmlFor:s,css:Ui.label,children:t})]})}function yt({configKey:e,label:t,className:n}){const i=!!je()[e],s=p.useCallback(o=>{yo({[e]:o}),o&&e==="initialShowMore"&&fe("\u5DF2\u5F00\u542F\u81EA\u52A8\u67E5\u770B\u66F4\u591A: \u4E0B\u6B21\u6253\u5F00\u9996\u9875\u65F6\u5C06\u76F4\u63A5\u5C55\u793A\u63A8\u8350\u5F39\u6846")},[]);return h(fc,{className:n,label:t||e,checked:i,onChange:s})}var Xy={name:"1qkltea",styles:"margin-left:5px"};const Jy=function(){const e=Xy;return T(ze,{children:[h(yt,{configKey:"initialShowMore",label:"\u81EA\u52A8\u67E5\u770B\u66F4\u591A",css:e}),h(yt,{configKey:"useNarrowMode",label:"\u542F\u7528\u5C45\u4E2D\u6A21\u5F0F(\u5C45\u4E2D\u4E24\u5217)",css:e})]})},J={configIcon:"_config-icon_4kok1_1",settingsGroup:"_settings-group_4kok1_6",settingsGroupTitle:"_settings-group-title_4kok1_9",settingsGroupContent:"_settings-group-content_4kok1_12",row:"_row_4kok1_18",check:"_check_4kok1_23"};async function dc(){fe("\u5373\u5C06\u5237\u65B0\u7F51\u9875"),await Tt.exports(500),location.reload()}function Zy(){if(!!window.confirm("\u786E\u5B9A?"))return mp(),dc()}function Qy({show:e,onHide:t}){const{pureRecommend:n,usePcDesktopApi:r}=je();return T(mi,{show:e,onHide:t,hideWhenMaskOnClick:!0,hideWhenEsc:!0,children:[T("div",{className:de.modalHeader,children:[T("div",{className:de.modalTitle,children:[h(ct,{name:"Config",className:J.configIcon}),"\u8BBE\u7F6E\u9879"]}),h("div",{className:"space",style:{flex:1}}),h(gi,{onClick:t})]}),T("main",{className:de.modalBody,children:[T("div",{className:J.settingsGroup,children:[h("div",{className:J.settingsGroupTitle,children:"\u63A5\u53E3\u5207\u6362"}),T("div",{className:X(J.settingsGroupContent),children:[h(yt,{configKey:"usePcDesktopApi",label:"\u4F7F\u7528\u684C\u9762\u7AEF\u63A5\u53E3(\u9ED8\u8BA4\u4F7F\u7528 App \u7AEF\u63A5\u53E3)",className:J.check}),!r&&h("div",{className:J.row,children:h(Hi,{})})]})]}),T("div",{className:J.settingsGroup,children:[h("div",{className:J.settingsGroupTitle,children:"\u5F00\u5173"}),T("div",{className:X(J.settingsGroupContent,J.row),children:[h(fc,{label:"\u5F00\u542F\u7EAF\u63A8\u8350\u6A21\u5F0F",checked:n,className:J.check,onChange:i=>(re.pureRecommend=i,dc())}),h(yt,{configKey:"initialShowMore",label:"\u81EA\u52A8\u67E5\u770B\u66F4\u591A",className:J.check}),h(yt,{configKey:"useNarrowMode",label:"\u542F\u7528\u5C45\u4E2D\u6A21\u5F0F(\u5C45\u4E2D\u4E24\u5217)",className:J.check})]})]}),T("div",{className:J.settingsGroup,children:[h("div",{className:J.settingsGroupTitle,children:"\u9AD8\u7EA7"}),T("div",{className:X(J.settingsGroupContent),children:[h("div",{className:J.row,children:h("button",{className:"primary-btn roll-btn",style:{display:"inline-flex"},onClick:Zy,children:h("span",{children:"\u6062\u590D\u9ED8\u8BA4\u8BBE\u7F6E"})})}),h("div",{className:J.row,style:{marginTop:10},children:h(yt,{configKey:"openInIINAWhenRightClick",label:"\u53F3\u952E\u5728 IINA \u4E2D\u6253\u5F00",className:J.check})})]})]})]})]})}var Gi={};Object.defineProperty(Gi,"__esModule",{value:!0});var hc=Gi.useSticky=void 0;const Vi=ce.default;function qy(){const e=(0,Vi.useRef)(null),[t,n]=(0,Vi.useState)(!1);return(0,Vi.useEffect)(()=>{function r(){if(!e.current)return;const i=e.current.getBoundingClientRect().top,s=parseInt(getComputedStyle(e.current).top),o=i<=s;o&&!t?n(!0):!o&&t&&n(!1)}return r(),document.addEventListener("scroll",r),window.addEventListener("resize",r),window.addEventListener("orientationchange",r),()=>{document.removeEventListener("scroll",r),window.removeEventListener("resize",r),window.removeEventListener("orientationchange",r)}},[t]),[e,t]}hc=Gi.useSticky=qy;const pc={expandBtn:"_expand-btn_wdzp9_1",expanded:"_expanded_wdzp9_12"},mc=p.forwardRef(function({children:t},n){const[r,i]=_a(!1);p.useImperativeHandle(n,()=>i,[i]);const s=h("button",{className:X("primary-btn",pc.expandBtn),onClick:i.toggle,children:h("svg",{className:X({[pc.expanded]:r}),children:h("use",{xlinkHref:"#widget-arrow"})})});return T(ze,{children:[s,r&&t]})}),Qt={modalMask:"_modal-mask_1as61_1",narrowMode:"_narrow-mode_1as61_1",modal:"_modal_1as61_1",modalHeader:"_modal-header_1as61_21",modalBody:"_modal-body_1as61_22",btnRefresh:"_btn-refresh_1as61_25"},ev=p.memo(function({show:t,onHide:n}){const r=p.useRef(null),i=p.useRef(null),{useNarrowMode:s}=je(),o=p.useMemo(()=>({[Qt.narrowMode]:s}),[s]),a=H(()=>{var u;return(u=i.current)==null?void 0:u.refresh()}),c=H(()=>{r.current&&(r.current.scrollTop=0)});return T(mi,{show:t,onHide:n,clsModalMask:X(o),clsModal:X(Qt.modal,o),children:[T("div",{className:X(de.modalHeader,Qt.modalHeader),children:[h("div",{className:de.modalTitle,children:"\u63A8\u8350"}),h("div",{className:"space",style:{flex:1}}),h(mc,{children:h(Jy,{})}),T("button",{className:`primary-btn roll-btn ${Qt.btnRefresh}`,onClick:a,children:[h("svg",{children:h("use",{xlinkHref:"#widget-roll"})}),h("span",{children:"\u6362\u4E00\u6362"})]}),h(gi,{onClick:n})]}),h("div",{className:X(de.modalBody,Qt.modalBody),ref:r,children:h(lc,{ref:i,shortcutEnabled:t,onScrollToTop:c,infiteScrollUseWindow:!1,scrollerRef:r})})]})}),gc={btn:ut` padding: 0; width: 31px; height: 31px; border-radius: 50%; `,icon:ut` svg { width: 14px; height: 14px; } `},nr=Ot({showMore:re.initialShowMore}),tv=function(){return it(nr)},nv=()=>{nr.showMore=!0},rv=()=>{nr.showMore=!1};function yc({onRefresh:e}){const{accessKey:t,pureRecommend:n,usePcDesktopApi:r}=je(),i=p.useRef(null),{showMore:s}=it(nr),[o,a]=p.useState(!1),c=p.useCallback(()=>{a(!0)},[]),u=p.useCallback(()=>{a(!1)},[]),[l,f]=hc();return T(ze,{children:[T("div",{ref:l,className:"area-header",css:[ut` margin-bottom: 0; height: 50px; `,n&&ut` position: sticky; top: ${ko}px; z-index: 1000; `,n&&f&&ut` background-color: var(--bg1_float); box-shadow: 0 2px 4px rgb(0 0 0 / 8%); `,"",""],children:[T("div",{className:"left",children:[h("a",{id:"\u5F71\u89C6",className:"the-world area-anchor","data-id":"25"}),h("svg",{className:"icon",children:h("use",{xlinkHref:"#channel-cinephile"})}),h("a",{className:"title",href:"#",children:h("span",{children:"\u63A8\u8350"})})]}),T("div",{className:"right",children:[!r&&(t?h(mc,{ref:i,children:h(Hi,{})}):h(Hi,{})),h("button",{className:"primary-btn",css:gc.btn,onClick:c,children:h(ct,{name:"Config",css:gc.icon})}),T("button",{className:"primary-btn roll-btn",onClick:e,children:[h("svg",{style:{transform:"rotate(0deg)"},children:h("use",{xlinkHref:"#widget-roll"})}),h("span",{children:"\u6362\u4E00\u6362"})]}),!n&&T("button",{className:"primary-btn see-more",onClick:nv,children:[h("span",{children:"\u67E5\u770B\u66F4\u591A"}),h("svg",{children:h("use",{xlinkHref:"#widget-arrow"})})]})]})]}),h(ev,{show:s,onHide:rv}),h(Qy,{show:o,onHide:u})]})}const iv={grid:ut` /* card=299 col-gap=20 */ width: ${299*2+20}px; margin: 0 auto; `};function sv(){const{useNarrowMode:e}=je(),{showMore:t}=tv(),n=p.useRef(null),r=H(()=>{var s;return(s=n.current)==null?void 0:s.refresh()}),i=H(()=>{document.documentElement.scrollTop=0});return T("section",{"data-area":"\u63A8\u8350",children:[h(yc,{onRefresh:r}),h(lc,{ref:n,css:[e&&iv.grid,"",""],shortcutEnabled:!t,infiteScrollUseWindow:!0,onScrollToTop:i})]})}function ov(){const e=p.useMemo(()=>new Array(20).fill(0).map(()=>crypto.randomUUID()),[]),t=Mt(),n=p.useMemo(()=>({page:1}),[]),{data:r,loading:i,error:s,refresh:o}=wa(()=>$y(n));return s&&console.error(s.stack||s),T("section",{"data-area":"\u63A8\u8350",children:[h(yc,{onRefresh:o}),h("div",{className:X(Bi,ac,{[$i]:t}),style:{marginBottom:t?30:0},children:i||s?e.map(a=>h(Ci,{},a)):r.map(a=>h(Ci,{item:a},a.uniqId))})]})}const av=10*1e3,cv=200;async function vc(e,t){let n=[];const r=()=>{n=Array.from(document.querySelectorAll(e))};r();const i=performance.now();for(;!n.length&&performance.now()-it.remove())}(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 uv()})();async function uv(){return Yi(".adblock-tips"),vc("html.gray",e=>e.classList.remove("gray")),re.pureRecommend?fv():lv()}async function lv(){const t=Date.now()+1e4;let n=null;for(;;){if(document.querySelector(".bili-layout > section.bili-grid")){const s=document.querySelector(".bili-layout > section.bili-grid");n=o=>s==null?void 0:s.insertAdjacentElement("afterend",o);break}if(Mt()&&document.querySelector(".bili-feed4-layout")){n=s=>{var o;return(o=document.querySelector(".bili-feed4-layout"))==null?void 0:o.insertAdjacentElement("afterbegin",s)};break}if(Date.now()>t)break;await Tt.exports(200)}if(!n){console.error("[bilibili-app-recommend]: init fail");return}const r=document.createElement("section");n(r),dn(r).render(h(ov,{}))}async function fv(){var i,s;Mt()?((i=document.querySelector(".bili-feed4 .bili-feed4-layout"))==null||i.remove(),Yi(".bili-feed4 .header-channel")):((s=document.querySelector(".bili-layout"))==null||s.remove(),Yi(".bili-footer"));const e=document.createElement("div");e.classList.add(Mt()?"bili-feed4-layout":"bili-layout","pure-recommend");const t=document.querySelector(".bili-header");t==null||t.insertAdjacentElement("afterend",e);const n=document.createElement("section");e==null||e.appendChild(n),dn(n).render(h(sv,{}))}})(React,ReactDOM,axios,axiosGmxhrAdapter);