Greasy Fork

Greasy Fork is available in English.

bilibili-app-recommend

为B站首页添加像App一样的推荐

目前为 2022-06-30 提交的版本。查看 最新版本

// ==UserScript==
// @name         bilibili-app-recommend
// @namespace    https://magicdawn.fun
// @version      0.3.4
// @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        https://www.mcbbs.net/template/mcbbs/image/special_photo_bg.png
// @match        *://www.bilibili.com/
// @require      https://unpkg.com/[email protected]/dist/jquery.min.js
// @require      https://unpkg.com/[email protected]/dist/axios.min.js
// @require      https://unpkg.com/[email protected]/dist/axiosGmxhrAdapter.min.js
// @require      https://unpkg.com/[email protected]/umd/react.production.min.js
// @require      https://unpkg.com/[email protected]/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_xmlhttpRequest
// @grant        GM_getValue
// @grant        GM_setValue
// @grant        GM_deleteValue
// @grant        unsafeWindow
// ==/UserScript==

;(({ cssTextList = [] }) => {
  cssTextList.forEach((s) => {
    const style = document.createElement("style");
    style.innerText = s;
    style.dataset.source = "vite-plugin-monkey";
    document.head.appendChild(style);
  });
})({
  "cssTextList": [
    "._toast-container_9119l_1{position:fixed;top:50%;left:50%;z-index:999999;padding:12px 24px;font-size:14px;width:240px;margin-left:-120px;background:#ffb243;color:#fff;border-radius:6px}._expand-btn_wdzp9_1{padding:0;width:31px;height:31px;border-radius:50%}._expand-btn_wdzp9_1 svg{width:13px;height:13px;transform:rotate(180deg)}._expand-btn_wdzp9_1 svg._expanded_wdzp9_12{transform:rotate(0)}body.dark ._expand-btn_wdzp9_1{color:#eee!important;border-color:transparent!important;background-color:#333!important}body.dark ._expand-btn_wdzp9_1:hover{background-color:#555!important}._bili-video-card_14zjz_1{position:relative}._image-wrapper_14zjz_4{border-radius:6px;overflow:hidden}._preview-card-wrapper_14zjz_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}._watch-later_14zjz_21{z-index:3}._badge_14zjz_24{color:#fa6a9d;border-radius:2px;border:1px #fa6a9d solid;line-height:20px;padding:0 10px;transform:scale(.8)}._recommend-reason_14zjz_32{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_14zjz_47{color:default}._btn-dislike_14zjz_50{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_14zjz_50 ._btn-dislike-icon_14zjz_65{pointer-events:none;user-select:none;width:12px;height:12px;color:#fff}._btn-dislike_14zjz_50 ._btn-dislike-tip_14zjz_72{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_14zjz_87{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_14zjz_87{border:1px solid #333}._disliked-wrapper_14zjz_87 ._dislike-content-cover_14zjz_101{border-top-left-radius:6px;border-top-right-radius:6px;padding-top:56.25%;position:relative}._disliked-wrapper_14zjz_87 ._dislike-content-cover_14zjz_101 ._dislike-content-cover-inner_14zjz_107{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center}._disliked-wrapper_14zjz_87 ._dislike-content-cover_14zjz_101 ._dislike-content-cover-inner_14zjz_107 ._dislike-icon_14zjz_118{color:inherit}._disliked-wrapper_14zjz_87 ._dislike-content-cover_14zjz_101 ._dislike-content-cover-inner_14zjz_107 ._dislike-reason_14zjz_121{font-size:20px;text-align:center}._disliked-wrapper_14zjz_87 ._dislike-content-cover_14zjz_101 ._dislike-content-cover-inner_14zjz_107 ._dislike-desc_14zjz_125{font-size:16px;text-align:center}._disliked-wrapper_14zjz_87 ._dislike-content-action_14zjz_129{flex:1;width:100%;border-top:1px solid #eee;display:flex;align-items:center;justify-content:center}body.dark ._disliked-wrapper_14zjz_87 ._dislike-content-action_14zjz_129{border-top:1px solid #333}._disliked-wrapper_14zjz_87 ._dislike-content-action_14zjz_129 button{font-size:18px;color:inherit}._modal-mask_vh629_1{position:fixed;left:0;top:0;right:0;bottom:0;background-color:#00000080;z-index:11003;display:flex;align-items:center;justify-content:center}._modal_vh629_1{width:500px;max-height:calc(80vh - 50px);border-radius:10px;overflow:hidden;background-color:#fff;padding:0 15px 15px;display:flex;flex-direction:column}._modal_vh629_1 ._modal-header_vh629_23{padding-top:10px;padding-bottom:10px;border-bottom:none;display:flex;align-items:center}._modal_vh629_1 ._modal-header_vh629_23 ._modal-title_vh629_30{font-size:1.5rem;margin-bottom:0;line-height:1.5}._modal_vh629_1 ._modal-header_vh629_23 ._title-desc_vh629_35{margin-left:5px;font-size:40%}._modal_vh629_1 ._modal-header_vh629_23 ._btn-close_vh629_39{margin-left:10px}._modal_vh629_1 ._modal-header_vh629_23 ._btn-close_vh629_39 svg{width:10px;height:10px;margin-right:3px;margin-top:-1px}body.dark ._modal_vh629_1 ._modal-header_vh629_23 ._btn-close_vh629_39{color:#eee!important;background-color:#333!important;border-color:transparent!important;height:auto;padding:8px 12px;line-height:16px;font-size:13px}._modal_vh629_1 ._modal-body_vh629_57{padding-top:0;flex-grow:1;overflow-y:scroll}._reason-list_vh629_62{display:flex;align-items:center;flex-wrap:wrap;justify-content:space-between}._reason_vh629_62{color:inherit;width:45%;text-align:center;line-height:20px;border:1px solid #eee;margin-top:8px;margin-bottom:8px;padding-top:5px;padding-bottom:5px}body.dark ._reason_vh629_62{border:1px solid #333}._modal-mask_1urmj_1{position:fixed;left:0;top:0;right:0;bottom:0;z-index:11000;background-color:#00000080;display:flex;align-items:center;justify-content:center}._modal-mask_1urmj_1._narrow-mode_1urmj_13{background-color:#000000e6}._modal_1urmj_1{width:calc(100vw - 30px);height:calc(100vh - 30px);border-radius:10px;overflow:hidden;background-color:#fff;padding:0 0 15px 15px;display:flex;flex-direction:column}body.dark ._modal_1urmj_1{border:1px solid #fb7299}._modal_1urmj_1._narrow-mode_1urmj_13{width:606px;height:calc(100vh - 10px);border:none}body.dark ._modal_1urmj_1._narrow-mode_1urmj_13{border:none}._modal_1urmj_1 ._modal-header_1urmj_38{padding-top:10px;padding-bottom:10px;border-bottom:none;padding-right:15px;display:flex;align-items:center}._modal_1urmj_1 ._modal-header_1urmj_38 ._modal-title_1urmj_46{font-size:1.5rem;margin-bottom:0;line-height:1.5}body.dark ._modal_1urmj_1 ._modal-header_1urmj_38 ._btn-refresh_1urmj_51,body.dark ._modal_1urmj_1 ._modal-header_1urmj_38 ._btn-close_1urmj_52{color:#eee!important;background-color:#333!important;border-color:transparent!important;height:auto;padding:8px 12px;line-height:16px;font-size:13px}._modal_1urmj_1 ._modal-header_1urmj_38 ._btn-close_1urmj_52{margin-left:10px}._modal_1urmj_1 ._modal-header_1urmj_38 ._btn-close_1urmj_52 svg{width:10px;height:10px}._modal_1urmj_1 ._modal-body_1urmj_68{padding-top:0;flex-grow:1;overflow-y:scroll;padding-right:15px}._list_1urmj_74{color:inherit}._card_1urmj_77{border:2px solid transparent}._card_1urmj_77 .bili-video-card__info{padding-left:2px;padding-bottom:1px;margin-top:calc(var(--info-margin-top) - 1px)}._card_1urmj_77._active_1urmj_85{border-color:#fb7299;border-radius:6px;overflow:hidden}._video-card-list_1urmj_90{display:block!important}#_video-card-body_1urmj_1>*{display:block!important}#_video-card-body_1urmj_1._narrow-mode_1urmj_13{grid-template-columns:repeat(2,1fr)}._loader_1urmj_99{text-align:center;line-height:60px;font-size:120%}._checkbox_1urmj_104{margin-left:5px;margin-top:1px;cursor:pointer;outline:none}._checkbox_1urmj_104+label{margin-left:2px;user-select:none;cursor:pointer}._grid_p5dvw_1{color:default}@media (min-width: 2200px){._video-card-list_p5dvw_5.is-full{grid-column:span 7!important}._video-card-list_p5dvw_5.is-full .video-card-body.more-class1.more-class2{grid-column:span 7!important;grid-template-columns:repeat(7,1fr)!important}._video-card-list_p5dvw_5.is-full .video-card-body.more-class1.more-class2>*{display:block!important}._video-card-list_p5dvw_5.is-full .video-card-body.more-class1.more-class2>*:nth-of-type(1n + 15){display:none!important}}._expand-btn_p5dvw_19{padding:0;width:31px;height:31px;border-radius:50%}._expand-btn_p5dvw_19 svg{width:13px;height:13px;transform:rotate(180deg)}._expand-btn_p5dvw_19 svg._expanded_p5dvw_30{transform:rotate(0)}\n"
  ]
});

var Sd=Object.defineProperty,Td=Object.defineProperties;var xd=Object.getOwnPropertyDescriptors;var lt=Object.getOwnPropertySymbols;var es=Object.prototype.hasOwnProperty,ts=Object.prototype.propertyIsEnumerable;var hr=(p,W,U)=>W in p?Sd(p,W,{enumerable:!0,configurable:!0,writable:!0,value:U}):p[W]=U,be=(p,W)=>{for(var U in W||(W={}))es.call(W,U)&&hr(p,U,W[U]);if(lt)for(var U of lt(W))ts.call(W,U)&&hr(p,U,W[U]);return p},Ce=(p,W)=>Td(p,xd(W));var rs=(p,W)=>{var U={};for(var Z in p)es.call(p,Z)&&W.indexOf(Z)<0&&(U[Z]=p[Z]);if(p!=null&&lt)for(var Z of lt(p))W.indexOf(Z)<0&&ts.call(p,Z)&&(U[Z]=p[Z]);return U};var pr=(p,W,U)=>(hr(p,typeof W!="symbol"?W+"":W,U),U);(function(p,W,U,Z,ns){"use strict";function Oe(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var ct=Oe(p),Ae=Oe(W),is=Oe(U),ut=Oe(Z),ss=Oe(ns);const ft=Symbol(),as=Symbol(),dt=Symbol(),ht=Object.getPrototypeOf,pt=new WeakMap,vr=e=>e&&(pt.has(e)?pt.get(e):ht(e)===Object.prototype||ht(e)===Array.prototype),vt=e=>typeof e=="object"&&e!==null,os=(e,t)=>{let r=!1;const n=(s,a,l)=>{if(!r){let c=s.a.get(e);c||(c=new Set,s.a.set(e,c)),l&&c.has(ft)||c.add(a)}},i={f:t,get(s,a){return a===dt?e:(n(this,a),mr(s[a],this.a,this.c))},has(s,a){return a===as?(r=!0,this.a.delete(e),!0):(n(this,a),a in s)},getOwnPropertyDescriptor(s,a){return n(this,a,!0),Object.getOwnPropertyDescriptor(s,a)},ownKeys(s){return n(this,ft),Reflect.ownKeys(s)}};return t&&(i.set=i.deleteProperty=()=>!1),i},mr=(e,t,r)=>{if(!vr(e))return e;const n=e[dt]||e,i=(a=>Object.isFrozen(a)||Object.values(Object.getOwnPropertyDescriptors(a)).some(l=>!l.writable))(n);let s=r&&r.get(n);return s&&s.f===i||(s=os(n,i),s.p=new Proxy(i?(a=>{if(Array.isArray(a))return Array.from(a);const l=Object.getOwnPropertyDescriptors(a);return Object.values(l).forEach(c=>{c.configurable=!0}),Object.create(ht(a),l)})(n):n,s),r&&r.set(n,s)),s.a=t,s.c=r,s.p},ls=(e,t)=>{const r=Reflect.ownKeys(e),n=Reflect.ownKeys(t);return r.length!==n.length||r.some((i,s)=>i!==n[s])},gr=(e,t,r,n)=>{if(Object.is(e,t))return!1;if(!vt(e)||!vt(t))return!0;const i=r.get(e);if(!i)return!0;if(n){const a=n.get(e);if(a&&a.n===t)return a.g;n.set(e,{n:t,g:!1})}let s=null;for(const a of i){const l=a===ft?ls(e,t):gr(e[a],t[a],r,n);if(l!==!0&&l!==!1||(s=l),s)break}return s===null&&(s=!0),n&&n.set(e,{n:t,g:s}),s},cs=e=>vr(e)&&e[dt]||null,yr=(e,t)=>{pt.set(e,t)},us=(e,t)=>{const r=[],n=new WeakSet,i=(s,a)=>{if(n.has(s))return;vt(s)&&n.add(s);const l=t.get(s);l?l.forEach(c=>{i(s[c],a?[...a,c]:[c])}):a&&r.push(a)};return i(e),r};var fs=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},br={exports:{}},_r={};/**
 * @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 _e=ct.default;function ds(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var hs=typeof Object.is=="function"?Object.is:ds,ps=_e.useState,vs=_e.useEffect,ms=_e.useLayoutEffect,gs=_e.useDebugValue;function ys(e,t){var r=t(),n=ps({inst:{value:r,getSnapshot:t}}),i=n[0].inst,s=n[1];return ms(function(){i.value=r,i.getSnapshot=t,mt(i)&&s({inst:i})},[e,r,t]),vs(function(){return mt(i)&&s({inst:i}),e(function(){mt(i)&&s({inst:i})})},[e]),gs(r),r}function mt(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!hs(e,r)}catch{return!0}}function bs(e,t){return t()}var _s=typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"?bs:ys;_r.useSyncExternalStore=_e.useSyncExternalStore!==void 0?_e.useSyncExternalStore:_s,br.exports=_r;var ws=br.exports;const Ss=({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"?Symbol("VERSION"):Symbol(),ee=({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"?Symbol("LISTENERS"):Symbol(),We=({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"?Symbol("SNAPSHOT"):Symbol(),Ts=({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"?Symbol("HANDLER"):Symbol(),Re=({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"?Symbol("PROMISE_RESULT"):Symbol(),wr=({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"?Symbol("PROMISE_ERROR"):Symbol(),Sr=new WeakSet,gt=e=>typeof e=="object"&&e!==null,xs=e=>gt(e)&&!Sr.has(e)&&(Array.isArray(e)||!(Symbol.iterator in e))&&!(e instanceof WeakMap)&&!(e instanceof WeakSet)&&!(e instanceof Error)&&!(e instanceof Number)&&!(e instanceof Date)&&!(e instanceof String)&&!(e instanceof RegExp)&&!(e instanceof ArrayBuffer),Tr=new WeakMap;let xr=1;const Er=new WeakMap;function He(e={}){if(!gt(e))throw new Error("object required");const t=Tr.get(e);if(t)return t;let r=xr;const n=new Set,i=(h,v=++xr)=>{r!==v&&(r=v,n.forEach(d=>d(h,v)))},s=new Map,a=h=>{let v=s.get(h);return v||(v=(d,y)=>{const g=[...d];g[1]=[h,...g[1]],i(g,y)},s.set(h,v)),v},l=h=>{const v=s.get(h);return s.delete(h),v},c=(h,v)=>{const d=Er.get(v);if((d==null?void 0:d[0])===r)return d[1];const y=Array.isArray(h)?[]:Object.create(Object.getPrototypeOf(h));return yr(y,!0),Er.set(v,[r,y]),Reflect.ownKeys(h).forEach(g=>{const b=Reflect.get(h,g,v);if(Sr.has(b))yr(b,!1),y[g]=b;else if(b instanceof Promise)if(Re in b)y[g]=b[Re];else{const R=b[wr]||b;Object.defineProperty(y,g,{get(){if(Re in b)return b[Re];throw R}})}else b!=null&&b[ee]?y[g]=b[We]:y[g]=b}),Object.freeze(y),y},o=Array.isArray(e)?[]:Object.create(Object.getPrototypeOf(e)),u={get(h,v,d){return v===Ss?r:v===ee?n:v===We?c(h,d):v===Ts?u:Reflect.get(h,v,d)},deleteProperty(h,v){const d=Reflect.get(h,v),y=d==null?void 0:d[ee];y&&y.delete(l(v));const g=Reflect.deleteProperty(h,v);return g&&i(["delete",[v],d]),g},is:Object.is,canProxy:xs,set(h,v,d,y){var g;const b=Reflect.has(h,v),R=Reflect.get(h,v,y);if(b&&this.is(R,d))return!0;const D=R==null?void 0:R[ee];D&&D.delete(l(v)),gt(d)&&(d=cs(d)||d);let T;return(g=Object.getOwnPropertyDescriptor(h,v))!=null&&g.set?T=d:d instanceof Promise?T=d.then(x=>(T[Re]=x,i(["resolve",[v],x]),x)).catch(x=>{T[wr]=x,i(["reject",[v],x])}):d!=null&&d[ee]?(T=d,T[ee].add(a(v))):this.canProxy(d)?(T=He(d),T[ee].add(a(v))):T=d,Reflect.set(h,v,T,y),i(["set",[v],d,R]),!0}},f=new Proxy(o,u);return Tr.set(e,f),Reflect.ownKeys(e).forEach(h=>{const v=Object.getOwnPropertyDescriptor(e,h);v.get||v.set?Object.defineProperty(o,h,v):f[h]=e[h]}),f}function Es(e,t,r){({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"&&!(e!=null&&e[ee])&&console.warn("Please use proxy object");let n;const i=[],s=a=>{if(i.push(a),r){t(i.splice(0));return}n||(n=Promise.resolve().then(()=>{n=void 0,t(i.splice(0))}))};return e[ee].add(s),()=>{e[ee].delete(s)}}function Cr(e){return({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"&&!(e!=null&&e[We])&&console.warn("Please use proxy object"),e[We]}const{useSyncExternalStore:Cs}=ws,Os=(e,t)=>{const r=p.useRef();p.useEffect(()=>{r.current=us(e,t)}),p.useDebugValue(r.current)};function yt(e,t){const r=t==null?void 0:t.sync,n=p.useRef(),i=p.useRef();let s=!0;const a=Cs(p.useCallback(o=>{const u=Es(e,o,r);return o(),u},[e,r]),()=>{const o=Cr(e);try{if(!s&&n.current&&i.current&&!gr(n.current,o,i.current,new WeakMap))return n.current}catch{}return o},()=>Cr(e));s=!1;const l=new WeakMap;p.useEffect(()=>{n.current=a,i.current=l}),({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"&&Os(a,l);const c=p.useMemo(()=>new WeakMap,[]);return mr(a,l,c)}const le=He({accessKey:"",useNarrowMode:!1,initialShowMore:!1}),bt=function(){return yt(le)},Or="bilibili-app-recommend.config";function As(){const e=GM_getValue(Or);e&&typeof e=="object"&&Object.assign(le,e)}function Rs(){GM_setValue(Or,le)}function Ue(e){Object.assign(le,e),Rs()}As();var _t={exports:{}};const Ms=(e,t)=>Math.floor(Math.random()*(t-e+1)+e),Ar=()=>{const e=new Error("Delay aborted");return e.name="AbortError",e},Rr=({clearTimeout:e,setTimeout:t,willResolve:r})=>(n,{value:i,signal:s}={})=>{if(s&&s.aborted)return Promise.reject(Ar());let a,l,c;const o=e||clearTimeout,u=()=>{o(a),c(Ar())},f=()=>{s&&s.removeEventListener("abort",u)},h=new Promise((v,d)=>{l=()=>{f(),r?v(i):d(i)},c=d,a=(t||setTimeout)(l,n)});return s&&s.addEventListener("abort",u,{once:!0}),h.clear=()=>{o(a),a=null,l()},h},Mr=e=>{const t=Rr(Ce(be({},e),{willResolve:!0}));return t.reject=Rr(Ce(be({},e),{willResolve:!1})),t.range=(r,n,i)=>t(Ms(r,n),i),t},wt=Mr();wt.createWithTimers=Mr,_t.exports=wt,_t.exports.default=wt;var Pr=_t.exports,St,Ps=is.default;St=Ps.createRoot;var Ds=function(t){return function(r,n){var i=p.useRef(!1);t(function(){return function(){i.current=!1}},[]),t(function(){if(!i.current)i.current=!0;else return r()},n)}},Tt=function(t){return typeof t=="function"},Ls=function(t){return typeof t=="string"},Dr=function(t){return typeof t=="number"};function H(e){var t=p.useRef(e);t.current=p.useMemo(function(){return e},[e]);var r=p.useRef();return r.current||(r.current=function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return t.current.apply(this,n)}),r.current}var xt=Ds(p.useEffect),Ns=globalThis&&globalThis.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){a={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return s},Lr=globalThis&&globalThis.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Ns(arguments[t]));return e},Nr=function(t,r){var n=r.manual,i=r.ready,s=i===void 0?!0:i,a=r.defaultParams,l=a===void 0?[]:a,c=r.refreshDeps,o=c===void 0?[]:c,u=r.refreshDepsAction,f=p.useRef(!1);return f.current=!1,xt(function(){!n&&s&&(f.current=!0,t.run.apply(t,Lr(l)))},[s]),xt(function(){f.current||n||(f.current=!0,u?u():t.refresh())},Lr(o)),{onBefore:function(){if(!s)return{stopNow:!0}}}};Nr.onInit=function(e){var t=e.ready,r=t===void 0?!0:t,n=e.manual;return{loading:!n&&r}};var ks=Nr;function Et(e,t){if(e===t)return!0;for(var r=0;r<e.length;r++)if(!Object.is(e[r],t[r]))return!1;return!0}function kr(e,t){var r=p.useRef({deps:t,obj:void 0,initialized:!1}).current;return(r.initialized===!1||!Et(r.deps,t))&&(r.deps=t,r.obj=e(),r.initialized=!0),r.obj}function Me(e){var t=p.useRef(e);return t.current=e,t}var js=function(t){var r=Me(t);p.useEffect(function(){return function(){r.current()}},[])},Pe=js,Ye=globalThis&&globalThis.__assign||function(){return Ye=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Ye.apply(this,arguments)},Ve=new Map,Fs=function(t,r,n){var i=Ve.get(t);i!=null&&i.timer&&clearTimeout(i.timer);var s=void 0;r>-1&&(s=setTimeout(function(){Ve.delete(t)},r)),Ve.set(t,Ye(Ye({},n),{timer:s}))},Is=function(t){return Ve.get(t)},Ge=new Map,zs=function(t){return Ge.get(t)},$s=function(t,r){Ge.set(t,r),r.then(function(n){return Ge.delete(t),n}).catch(function(){Ge.delete(t)})},ce={},Bs=function(t,r){ce[t]&&ce[t].forEach(function(n){return n(r)})},Ct=function(t,r){return ce[t]||(ce[t]=[]),ce[t].push(r),function(){var i=ce[t].indexOf(r);ce[t].splice(i,1)}},Ws=globalThis&&globalThis.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){a={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return s},Hs=globalThis&&globalThis.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Ws(arguments[t]));return e},Us=function(t,r){var n=r.cacheKey,i=r.cacheTime,s=i===void 0?5*60*1e3:i,a=r.staleTime,l=a===void 0?0:a,c=r.setCache,o=r.getCache,u=p.useRef(),f=p.useRef(),h=function(y,g){c?c(g):Fs(y,s,g),Bs(y,g.data)},v=function(y,g){return g===void 0&&(g=[]),o?o(g):Is(y)};return kr(function(){if(!!n){var d=v(n);d&&Object.hasOwnProperty.call(d,"data")&&(t.state.data=d.data,t.state.params=d.params,(l===-1||new Date().getTime()-d.time<=l)&&(t.state.loading=!1)),u.current=Ct(n,function(y){t.setState({data:y})})}},[]),Pe(function(){var d;(d=u.current)===null||d===void 0||d.call(u)}),n?{onBefore:function(y){var g=v(n,y);return!g||!Object.hasOwnProperty.call(g,"data")?{}:l===-1||new Date().getTime()-g.time<=l?{loading:!1,data:g==null?void 0:g.data,returnNow:!0}:{data:g==null?void 0:g.data}},onRequest:function(y,g){var b=zs(n);return b&&b!==f.current?{servicePromise:b}:(b=y.apply(void 0,Hs(g)),f.current=b,$s(n,b),{servicePromise:b})},onSuccess:function(y,g){var b;n&&((b=u.current)===null||b===void 0||b.call(u),h(n,{data:y,params:g,time:new Date().getTime()}),u.current=Ct(n,function(R){t.setState({data:R})}))},onMutate:function(y){var g;n&&((g=u.current)===null||g===void 0||g.call(u),h(n,{data:y,params:t.state.params,time:new Date().getTime()}),u.current=Ct(n,function(b){t.setState({data:b})}))}}:{}},Ys=Us;function we(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Vs=typeof global=="object"&&global&&global.Object===Object&&global,jr=Vs,Gs=typeof self=="object"&&self&&self.Object===Object&&self,Ks=jr||Gs||Function("return this")(),te=Ks,Xs=function(){return te.Date.now()},Ot=Xs,Js=/\s/;function Zs(e){for(var t=e.length;t--&&Js.test(e.charAt(t)););return t}var Qs=/^\s+/;function qs(e){return e&&e.slice(0,Zs(e)+1).replace(Qs,"")}var ea=te.Symbol,se=ea,Fr=Object.prototype,ta=Fr.hasOwnProperty,ra=Fr.toString,De=se?se.toStringTag:void 0;function na(e){var t=ta.call(e,De),r=e[De];try{e[De]=void 0;var n=!0}catch{}var i=ra.call(e);return n&&(t?e[De]=r:delete e[De]),i}var ia=Object.prototype,sa=ia.toString;function aa(e){return sa.call(e)}var oa="[object Null]",la="[object Undefined]",Ir=se?se.toStringTag:void 0;function Se(e){return e==null?e===void 0?la:oa:Ir&&Ir in Object(e)?na(e):aa(e)}function Te(e){return e!=null&&typeof e=="object"}var ca="[object Symbol]";function zr(e){return typeof e=="symbol"||Te(e)&&Se(e)==ca}var $r=0/0,ua=/^[-+]0x[0-9a-f]+$/i,fa=/^0b[01]+$/i,da=/^0o[0-7]+$/i,ha=parseInt;function At(e){if(typeof e=="number")return e;if(zr(e))return $r;if(we(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=we(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=qs(e);var r=fa.test(e);return r||da.test(e)?ha(e.slice(2),r?2:8):ua.test(e)?$r:+e}var pa="Expected a function",va=Math.max,ma=Math.min;function Br(e,t,r){var n,i,s,a,l,c,o=0,u=!1,f=!1,h=!0;if(typeof e!="function")throw new TypeError(pa);t=At(t)||0,we(r)&&(u=!!r.leading,f="maxWait"in r,s=f?va(At(r.maxWait)||0,t):s,h="trailing"in r?!!r.trailing:h);function v(C){var F=n,z=i;return n=i=void 0,o=C,a=e.apply(z,F),a}function d(C){return o=C,l=setTimeout(b,t),u?v(C):a}function y(C){var F=C-c,z=C-o,k=t-F;return f?ma(k,s-z):k}function g(C){var F=C-c,z=C-o;return c===void 0||F>=t||F<0||f&&z>=s}function b(){var C=Ot();if(g(C))return R(C);l=setTimeout(b,y(C))}function R(C){return l=void 0,h&&n?v(C):(n=i=void 0,a)}function D(){l!==void 0&&clearTimeout(l),o=0,n=c=i=l=void 0}function T(){return l===void 0?a:R(Ot())}function x(){var C=Ot(),F=g(C);if(n=arguments,i=this,c=C,F){if(l===void 0)return d(c);if(f)return clearTimeout(l),l=setTimeout(b,t),v(c)}return l===void 0&&(l=setTimeout(b,t)),a}return x.cancel=D,x.flush=T,x}var ga=globalThis&&globalThis.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){a={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return s},ya=globalThis&&globalThis.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(ga(arguments[t]));return e},ba=function(t,r){var n=r.debounceWait,i=r.debounceLeading,s=r.debounceTrailing,a=r.debounceMaxWait,l=p.useRef(),c=p.useMemo(function(){var o={};return i!==void 0&&(o.leading=i),s!==void 0&&(o.trailing=s),a!==void 0&&(o.maxWait=a),o},[i,s,a]);return p.useEffect(function(){if(n){var o=t.runAsync.bind(t);return l.current=Br(function(u){u()},n,c),t.runAsync=function(){for(var u=[],f=0;f<arguments.length;f++)u[f]=arguments[f];return new Promise(function(h,v){var d;(d=l.current)===null||d===void 0||d.call(l,function(){o.apply(void 0,ya(u)).then(h).catch(v)})})},function(){var u;(u=l.current)===null||u===void 0||u.cancel(),t.runAsync=o}}},[n,c]),n?{onCancel:function(){var u;(u=l.current)===null||u===void 0||u.cancel()}}:{}},_a=ba,wa=function(t,r){var n=r.loadingDelay,i=p.useRef();if(!n)return{};var s=function(){i.current&&clearTimeout(i.current)};return{onBefore:function(){return s(),i.current=setTimeout(function(){t.setState({loading:!0})},n),{loading:!1}},onFinally:function(){s()},onCancel:function(){s()}}},Sa=wa;function Ke(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}function Rt(){return Ke()?document.visibilityState!=="hidden":!0}var Le=[];function Ta(e){return Le.push(e),function(){var r=Le.indexOf(e);Le.splice(r,1)}}if(Ke()){var xa=function(){if(!!Rt())for(var t=0;t<Le.length;t++){var r=Le[t];r()}};window.addEventListener("visibilitychange",xa,!1)}var Ea=function(t,r){var n=r.pollingInterval,i=r.pollingWhenHidden,s=i===void 0?!0:i,a=p.useRef(),l=p.useRef(),c=function(){var u;a.current&&clearTimeout(a.current),(u=l.current)===null||u===void 0||u.call(l)};return xt(function(){n||c()},[n]),n?{onBefore:function(){c()},onFinally:function(){if(!s&&!Rt()){l.current=Ta(function(){t.refresh()});return}a.current=setTimeout(function(){t.refresh()},n)},onCancel:function(){c()}}:{}},Ca=Ea,Oa=globalThis&&globalThis.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){a={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return s},Aa=globalThis&&globalThis.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Oa(arguments[t]));return e};function Ra(e,t){var r=!1;return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];r||(r=!0,e.apply(void 0,Aa(n)),setTimeout(function(){r=!1},t))}}function Ma(){return Ke()&&typeof navigator.onLine!="undefined"?navigator.onLine:!0}var Ne=[];function Pa(e){return Ne.push(e),function(){var r=Ne.indexOf(e);Ne.splice(r,1)}}if(Ke()){var Wr=function(){if(!(!Rt()||!Ma()))for(var t=0;t<Ne.length;t++){var r=Ne[t];r()}};window.addEventListener("visibilitychange",Wr,!1),window.addEventListener("focus",Wr,!1)}var Da=function(t,r){var n=r.refreshOnWindowFocus,i=r.focusTimespan,s=i===void 0?5e3:i,a=p.useRef(),l=function(){var o;(o=a.current)===null||o===void 0||o.call(a)};return p.useEffect(function(){if(n){var c=Ra(t.refresh.bind(t),s);a.current=Pa(function(){c()})}return function(){l()}},[n,s]),Pe(function(){l()}),{}},La=Da,Na=function(t,r){var n=r.retryInterval,i=r.retryCount,s=p.useRef(),a=p.useRef(0),l=p.useRef(!1);return i?{onBefore:function(){l.current||(a.current=0),l.current=!1,s.current&&clearTimeout(s.current)},onSuccess:function(){a.current=0},onError:function(){if(a.current+=1,i===-1||a.current<=i){var o=n!=null?n:Math.min(1e3*Math.pow(2,a.current),3e4);s.current=setTimeout(function(){l.current=!0,t.refresh()},o)}else a.current=0},onCancel:function(){a.current=0,s.current&&clearTimeout(s.current)}}:{}},ka=Na,ja="Expected a function";function Fa(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError(ja);return we(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),Br(e,t,{leading:n,maxWait:t,trailing:i})}var Ia=globalThis&&globalThis.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){a={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return s},za=globalThis&&globalThis.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Ia(arguments[t]));return e},$a=function(t,r){var n=r.throttleWait,i=r.throttleLeading,s=r.throttleTrailing,a=p.useRef(),l={};return i!==void 0&&(l.leading=i),s!==void 0&&(l.trailing=s),p.useEffect(function(){if(n){var c=t.runAsync.bind(t);return a.current=Fa(function(o){o()},n,l),t.runAsync=function(){for(var o=[],u=0;u<arguments.length;u++)o[u]=arguments[u];return new Promise(function(f,h){var v;(v=a.current)===null||v===void 0||v.call(a,function(){c.apply(void 0,za(o)).then(f).catch(h)})})},function(){var o;t.runAsync=c,(o=a.current)===null||o===void 0||o.cancel()}}},[n,i,s]),n?{onCancel:function(){var o;(o=a.current)===null||o===void 0||o.cancel()}}:{}},Ba=$a,Wa=function(t){p.useEffect(function(){t==null||t()},[])},Ha=Wa,Ua=globalThis&&globalThis.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){a={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return s},Ya=function(){var t=Ua(p.useState({}),2),r=t[1];return p.useCallback(function(){return r({})},[])},Va=Ya,ae=globalThis&&globalThis.__assign||function(){return ae=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},ae.apply(this,arguments)},Ga=globalThis&&globalThis.__awaiter||function(e,t,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function l(u){try{o(n.next(u))}catch(f){a(f)}}function c(u){try{o(n.throw(u))}catch(f){a(f)}}function o(u){u.done?s(u.value):i(u.value).then(l,c)}o((n=n.apply(e,t||[])).next())})},Ka=globalThis&&globalThis.__generator||function(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,a;return a={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(o){return function(u){return c([o,u])}}function c(o){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=o[0]&2?i.return:o[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,o[1])).done)return s;switch(i=0,s&&(o=[o[0]&2,s.value]),o[0]){case 0:case 1:s=o;break;case 4:return r.label++,{value:o[1],done:!1};case 5:r.label++,i=o[1],o=[0];continue;case 7:o=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(o[0]===6||o[0]===2)){r=0;continue}if(o[0]===3&&(!s||o[1]>s[0]&&o[1]<s[3])){r.label=o[1];break}if(o[0]===6&&r.label<s[1]){r.label=s[1],s=o;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(o);break}s[2]&&r.ops.pop(),r.trys.pop();continue}o=t.call(e,r)}catch(u){o=[6,u],i=0}finally{n=s=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}},Xa=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},Ja=globalThis&&globalThis.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){a={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return s},xe=globalThis&&globalThis.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Ja(arguments[t]));return e},Za=function(){function e(t,r,n,i){i===void 0&&(i={}),this.serviceRef=t,this.options=r,this.subscribe=n,this.initState=i,this.count=0,this.state={loading:!1,params:void 0,data:void 0,error:void 0},this.state=ae(ae(ae({},this.state),{loading:!r.manual}),i)}return e.prototype.setState=function(t){t===void 0&&(t={}),this.state=ae(ae({},this.state),t),this.subscribe()},e.prototype.runPluginHandler=function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var i=this.pluginImpls.map(function(s){var a;return(a=s[t])===null||a===void 0?void 0:a.call.apply(a,xe([s],r))}).filter(Boolean);return Object.assign.apply(Object,xe([{}],i))},e.prototype.runAsync=function(){for(var t,r,n,i,s,a,l,c,o,u,f=[],h=0;h<arguments.length;h++)f[h]=arguments[h];return Ga(this,void 0,void 0,function(){var v,d,y,g,b,R,D,T,x,C,F;return Ka(this,function(z){switch(z.label){case 0:if(this.count+=1,v=this.count,d=this.runPluginHandler("onBefore",f),y=d.stopNow,g=y===void 0?!1:y,b=d.returnNow,R=b===void 0?!1:b,D=Xa(d,["stopNow","returnNow"]),g)return[2,new Promise(function(){})];if(this.setState(ae({loading:!0,params:f},D)),R)return[2,Promise.resolve(D.data)];(r=(t=this.options).onBefore)===null||r===void 0||r.call(t,f),z.label=1;case 1:return z.trys.push([1,3,,4]),T=this.runPluginHandler("onRequest",this.serviceRef.current,f).servicePromise,T||(T=(F=this.serviceRef).current.apply(F,xe(f))),[4,T];case 2:return x=z.sent(),v!==this.count?[2,new Promise(function(){})]:(this.setState({data:x,error:void 0,loading:!1}),(i=(n=this.options).onSuccess)===null||i===void 0||i.call(n,x,f),this.runPluginHandler("onSuccess",x,f),(a=(s=this.options).onFinally)===null||a===void 0||a.call(s,f,x,void 0),v===this.count&&this.runPluginHandler("onFinally",f,x,void 0),[2,x]);case 3:if(C=z.sent(),v!==this.count)return[2,new Promise(function(){})];throw this.setState({error:C,loading:!1}),(c=(l=this.options).onError)===null||c===void 0||c.call(l,C,f),this.runPluginHandler("onError",C,f),(u=(o=this.options).onFinally)===null||u===void 0||u.call(o,f,void 0,C),v===this.count&&this.runPluginHandler("onFinally",f,void 0,C),C;case 4:return[2]}})})},e.prototype.run=function(){for(var t=this,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];this.runAsync.apply(this,xe(r)).catch(function(i){t.options.onError||console.error(i)})},e.prototype.cancel=function(){this.count+=1,this.setState({loading:!1}),this.runPluginHandler("onCancel")},e.prototype.refresh=function(){this.run.apply(this,xe(this.state.params||[]))},e.prototype.refreshAsync=function(){return this.runAsync.apply(this,xe(this.state.params||[]))},e.prototype.mutate=function(t){var r;Tt(t)?r=t(this.state.data):r=t,this.runPluginHandler("onMutate",r),this.setState({data:r})},e}(),Qa=Za,Mt=globalThis&&globalThis.__assign||function(){return Mt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Mt.apply(this,arguments)},qa=globalThis&&globalThis.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},eo=globalThis&&globalThis.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){a={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return s},Hr=globalThis&&globalThis.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(eo(arguments[t]));return e};function to(e,t,r){t===void 0&&(t={}),r===void 0&&(r=[]);var n=t.manual,i=n===void 0?!1:n,s=qa(t,["manual"]),a=Mt({manual:i},s),l=Me(e),c=Va(),o=kr(function(){var u=r.map(function(f){var h;return(h=f==null?void 0:f.onInit)===null||h===void 0?void 0:h.call(f,a)}).filter(Boolean);return new Qa(l,a,c,Object.assign.apply(Object,Hr([{}],u)))},[]);return o.options=a,o.pluginImpls=r.map(function(u){return u(o,a)}),Ha(function(){if(!i){var u=o.state.params||t.defaultParams||[];o.run.apply(o,Hr(u))}}),Pe(function(){o.cancel()}),{loading:o.state.loading,data:o.state.data,error:o.state.error,params:o.state.params||[],cancel:H(o.cancel.bind(o)),refresh:H(o.refresh.bind(o)),refreshAsync:H(o.refreshAsync.bind(o)),run:H(o.run.bind(o)),runAsync:H(o.runAsync.bind(o)),mutate:H(o.mutate.bind(o))}}var ro=globalThis&&globalThis.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){a={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return s},no=globalThis&&globalThis.__spread||function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(ro(arguments[t]));return e};function io(e,t,r){return to(e,t,no(r||[],[_a,Sa,Ca,La,Ba,ks,Ys,ka]))}var so=globalThis&&globalThis.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){a={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return s};function Ur(e,t){e===void 0&&(e=!1);var r=so(p.useState(e),2),n=r[0],i=r[1],s=p.useMemo(function(){var a=t===void 0?!e:t,l=function(){return i(function(h){return h===e?a:e})},c=function(h){return i(h)},o=function(){return i(e)},u=function(){return i(a)};return{toggle:l,set:c,setLeft:o,setRight:u}},[]);return[n,s]}var ao=globalThis&&globalThis.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){a={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return s};function oo(e){e===void 0&&(e=!1);var t=ao(Ur(e),2),r=t[0],n=t[1],i=n.toggle,s=n.set,a=p.useMemo(function(){var l=function(){return s(!0)},c=function(){return s(!1)};return{toggle:i,set:function(u){return s(!!u)},setTrue:l,setFalse:c}},[]);return[r,a]}var lo=!!(typeof window!="undefined"&&window.document&&window.document.createElement),co=lo;function Xe(e,t){if(!!co){if(!e)return t;var r;return Tt(e)?r=e():"current"in e?r=e.current:r=e,r}}var uo=function(t){var r=function(i,s,a){var l=p.useRef(!1),c=p.useRef([]),o=p.useRef([]),u=p.useRef();t(function(){var f,h=Array.isArray(a)?a:[a],v=h.map(function(d){return Xe(d)});if(!l.current){l.current=!0,c.current=v,o.current=s,u.current=i();return}(v.length!==c.current.length||!Et(v,c.current)||!Et(s,o.current))&&((f=u.current)===null||f===void 0||f.call(u),c.current=v,o.current=s,u.current=i())}),Pe(function(){var f;(f=u.current)===null||f===void 0||f.call(u),l.current=!1})};return r},fo=uo,ho=fo(p.useEffect),Yr=ho,Vr={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(fs,function(){var r=1e3,n=6e4,i=36e5,s="millisecond",a="second",l="minute",c="hour",o="day",u="week",f="month",h="quarter",v="year",d="date",y="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|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,R={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("_")},D=function(E,S,_){var O=String(E);return!O||O.length>=S?E:""+Array(S+1-O.length).join(_)+E},T={s:D,z:function(E){var S=-E.utcOffset(),_=Math.abs(S),O=Math.floor(_/60),w=_%60;return(S<=0?"+":"-")+D(O,2,"0")+":"+D(w,2,"0")},m:function E(S,_){if(S.date()<_.date())return-E(_,S);var O=12*(_.year()-S.year())+(_.month()-S.month()),w=S.clone().add(O,f),A=_-w<0,M=S.clone().add(O+(A?-1:1),f);return+(-(O+(_-w)/(A?w-M:M-w))||0)},a:function(E){return E<0?Math.ceil(E)||0:Math.floor(E)},p:function(E){return{M:f,y:v,w:u,d:o,D:d,h:c,m:l,s:a,ms:s,Q:h}[E]||String(E||"").toLowerCase().replace(/s$/,"")},u:function(E){return E===void 0}},x="en",C={};C[x]=R;var F=function(E){return E instanceof G},z=function E(S,_,O){var w;if(!S)return x;if(typeof S=="string"){var A=S.toLowerCase();C[A]&&(w=A),_&&(C[A]=_,w=A);var M=S.split("-");if(!w&&M.length>1)return E(M[0])}else{var N=S.name;C[N]=S,w=N}return!O&&w&&(x=w),w||!O&&x},k=function(E,S){if(F(E))return E.clone();var _=typeof S=="object"?S:{};return _.date=E,_.args=arguments,new G(_)},L=T;L.l=z,L.i=F,L.w=function(E,S){return k(E,{locale:S.$L,utc:S.$u,x:S.$x,$offset:S.$offset})};var G=function(){function E(_){this.$L=z(_.locale,null,!0),this.parse(_)}var S=E.prototype;return S.parse=function(_){this.$d=function(O){var w=O.date,A=O.utc;if(w===null)return new Date(NaN);if(L.u(w))return new Date;if(w instanceof Date)return new Date(w);if(typeof w=="string"&&!/Z$/i.test(w)){var M=w.match(g);if(M){var N=M[2]-1||0,B=(M[7]||"0").substring(0,3);return A?new Date(Date.UTC(M[1],N,M[3]||1,M[4]||0,M[5]||0,M[6]||0,B)):new Date(M[1],N,M[3]||1,M[4]||0,M[5]||0,M[6]||0,B)}}return new Date(w)}(_),this.$x=_.x||{},this.init()},S.init=function(){var _=this.$d;this.$y=_.getFullYear(),this.$M=_.getMonth(),this.$D=_.getDate(),this.$W=_.getDay(),this.$H=_.getHours(),this.$m=_.getMinutes(),this.$s=_.getSeconds(),this.$ms=_.getMilliseconds()},S.$utils=function(){return L},S.isValid=function(){return this.$d.toString()!==y},S.isSame=function(_,O){var w=k(_);return this.startOf(O)<=w&&w<=this.endOf(O)},S.isAfter=function(_,O){return k(_)<this.startOf(O)},S.isBefore=function(_,O){return this.endOf(O)<k(_)},S.$g=function(_,O,w){return L.u(_)?this[O]:this.set(w,_)},S.unix=function(){return Math.floor(this.valueOf()/1e3)},S.valueOf=function(){return this.$d.getTime()},S.startOf=function(_,O){var w=this,A=!!L.u(O)||O,M=L.p(_),N=function(J,V){var q=L.w(w.$u?Date.UTC(w.$y,V,J):new Date(w.$y,V,J),w);return A?q:q.endOf(o)},B=function(J,V){return L.w(w.toDate()[J].apply(w.toDate("s"),(A?[0,0,0,0]:[23,59,59,999]).slice(V)),w)},I=this.$W,Y=this.$M,re=this.$D,Q="set"+(this.$u?"UTC":"");switch(M){case v:return A?N(1,0):N(31,11);case f:return A?N(1,Y):N(0,Y+1);case u:var ge=this.$locale().weekStart||0,ye=(I<ge?I+7:I)-ge;return N(A?re-ye:re+(6-ye),Y);case o:case d:return B(Q+"Hours",0);case c:return B(Q+"Minutes",1);case l:return B(Q+"Seconds",2);case a:return B(Q+"Milliseconds",3);default:return this.clone()}},S.endOf=function(_){return this.startOf(_,!1)},S.$set=function(_,O){var w,A=L.p(_),M="set"+(this.$u?"UTC":""),N=(w={},w[o]=M+"Date",w[d]=M+"Date",w[f]=M+"Month",w[v]=M+"FullYear",w[c]=M+"Hours",w[l]=M+"Minutes",w[a]=M+"Seconds",w[s]=M+"Milliseconds",w)[A],B=A===o?this.$D+(O-this.$W):O;if(A===f||A===v){var I=this.clone().set(d,1);I.$d[N](B),I.init(),this.$d=I.set(d,Math.min(this.$D,I.daysInMonth())).$d}else N&&this.$d[N](B);return this.init(),this},S.set=function(_,O){return this.clone().$set(_,O)},S.get=function(_){return this[L.p(_)]()},S.add=function(_,O){var w,A=this;_=Number(_);var M=L.p(O),N=function(Y){var re=k(A);return L.w(re.date(re.date()+Math.round(Y*_)),A)};if(M===f)return this.set(f,this.$M+_);if(M===v)return this.set(v,this.$y+_);if(M===o)return N(1);if(M===u)return N(7);var B=(w={},w[l]=n,w[c]=i,w[a]=r,w)[M]||1,I=this.$d.getTime()+_*B;return L.w(I,this)},S.subtract=function(_,O){return this.add(-1*_,O)},S.format=function(_){var O=this,w=this.$locale();if(!this.isValid())return w.invalidDate||y;var A=_||"YYYY-MM-DDTHH:mm:ssZ",M=L.z(this),N=this.$H,B=this.$m,I=this.$M,Y=w.weekdays,re=w.months,Q=function(V,q,Be,ot){return V&&(V[q]||V(O,A))||Be[q].slice(0,ot)},ge=function(V){return L.s(N%12||12,V,"0")},ye=w.meridiem||function(V,q,Be){var ot=V<12?"AM":"PM";return Be?ot.toLowerCase():ot},J={YY:String(this.$y).slice(-2),YYYY:this.$y,M:I+1,MM:L.s(I+1,2,"0"),MMM:Q(w.monthsShort,I,re,3),MMMM:Q(re,I),D:this.$D,DD:L.s(this.$D,2,"0"),d:String(this.$W),dd:Q(w.weekdaysMin,this.$W,Y,2),ddd:Q(w.weekdaysShort,this.$W,Y,3),dddd:Y[this.$W],H:String(N),HH:L.s(N,2,"0"),h:ge(1),hh:ge(2),a:ye(N,B,!0),A:ye(N,B,!1),m:String(B),mm:L.s(B,2,"0"),s:String(this.$s),ss:L.s(this.$s,2,"0"),SSS:L.s(this.$ms,3,"0"),Z:M};return A.replace(b,function(V,q){return q||J[V]||M.replace(":","")})},S.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},S.diff=function(_,O,w){var A,M=L.p(O),N=k(_),B=(N.utcOffset()-this.utcOffset())*n,I=this-N,Y=L.m(this,N);return Y=(A={},A[v]=Y/12,A[f]=Y,A[h]=Y/3,A[u]=(I-B)/6048e5,A[o]=(I-B)/864e5,A[c]=I/i,A[l]=I/n,A[a]=I/r,A)[M]||I,w?Y:L.a(Y)},S.daysInMonth=function(){return this.endOf(f).$D},S.$locale=function(){return C[this.$L]},S.locale=function(_,O){if(!_)return this.$L;var w=this.clone(),A=z(_,O,!0);return A&&(w.$L=A),w},S.clone=function(){return L.w(this.$d,this)},S.toDate=function(){return new Date(this.valueOf())},S.toJSON=function(){return this.isValid()?this.toISOString():null},S.toISOString=function(){return this.$d.toISOString()},S.toString=function(){return this.$d.toUTCString()},E}(),$e=G.prototype;return k.prototype=$e,[["$ms",s],["$s",a],["$m",l],["$H",c],["$W",o],["$M",f],["$y",v],["$D",d]].forEach(function(E){$e[E[1]]=function(S){return this.$g(S,E[0],E[1])}}),k.extend=function(E,S){return E.$i||(E(S,G,k),E.$i=!0),k},k.locale=z,k.isDayjs=F,k.unix=function(E){return k(1e3*E)},k.en=C[x],k.Ls=C,k.p={},k})})(Vr);var Gr=Vr.exports;function po(){this.__data__=[],this.size=0}function Kr(e,t){return e===t||e!==e&&t!==t}function Je(e,t){for(var r=e.length;r--;)if(Kr(e[r][0],t))return r;return-1}var vo=Array.prototype,mo=vo.splice;function go(e){var t=this.__data__,r=Je(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():mo.call(t,r,1),--this.size,!0}function yo(e){var t=this.__data__,r=Je(t,e);return r<0?void 0:t[r][1]}function bo(e){return Je(this.__data__,e)>-1}function _o(e,t){var r=this.__data__,n=Je(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function ne(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ne.prototype.clear=po,ne.prototype.delete=go,ne.prototype.get=yo,ne.prototype.has=bo,ne.prototype.set=_o;function wo(){this.__data__=new ne,this.size=0}function So(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function To(e){return this.__data__.get(e)}function xo(e){return this.__data__.has(e)}var Eo="[object AsyncFunction]",Co="[object Function]",Oo="[object GeneratorFunction]",Ao="[object Proxy]";function Xr(e){if(!we(e))return!1;var t=Se(e);return t==Co||t==Oo||t==Eo||t==Ao}var Ro=te["__core-js_shared__"],Pt=Ro,Jr=function(){var e=/[^.]+$/.exec(Pt&&Pt.keys&&Pt.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Mo(e){return!!Jr&&Jr in e}var Po=Function.prototype,Do=Po.toString;function ue(e){if(e!=null){try{return Do.call(e)}catch{}try{return e+""}catch{}}return""}var Lo=/[\\^$.*+?()[\]{}|]/g,No=/^\[object .+?Constructor\]$/,ko=Function.prototype,jo=Object.prototype,Fo=ko.toString,Io=jo.hasOwnProperty,zo=RegExp("^"+Fo.call(Io).replace(Lo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function $o(e){if(!we(e)||Mo(e))return!1;var t=Xr(e)?zo:No;return t.test(ue(e))}function Bo(e,t){return e==null?void 0:e[t]}function Ee(e,t){var r=Bo(e,t);return $o(r)?r:void 0}var Wo=Ee(te,"Map"),ke=Wo,Ho=Ee(Object,"create"),je=Ho;function Uo(){this.__data__=je?je(null):{},this.size=0}function Yo(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Vo="__lodash_hash_undefined__",Go=Object.prototype,Ko=Go.hasOwnProperty;function Xo(e){var t=this.__data__;if(je){var r=t[e];return r===Vo?void 0:r}return Ko.call(t,e)?t[e]:void 0}var Jo=Object.prototype,Zo=Jo.hasOwnProperty;function Qo(e){var t=this.__data__;return je?t[e]!==void 0:Zo.call(t,e)}var qo="__lodash_hash_undefined__";function el(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=je&&t===void 0?qo:t,this}function fe(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}fe.prototype.clear=Uo,fe.prototype.delete=Yo,fe.prototype.get=Xo,fe.prototype.has=Qo,fe.prototype.set=el;function tl(){this.size=0,this.__data__={hash:new fe,map:new(ke||ne),string:new fe}}function rl(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Ze(e,t){var r=e.__data__;return rl(t)?r[typeof t=="string"?"string":"hash"]:r.map}function nl(e){var t=Ze(this,e).delete(e);return this.size-=t?1:0,t}function il(e){return Ze(this,e).get(e)}function sl(e){return Ze(this,e).has(e)}function al(e,t){var r=Ze(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function de(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}de.prototype.clear=tl,de.prototype.delete=nl,de.prototype.get=il,de.prototype.has=sl,de.prototype.set=al;var ol=200;function ll(e,t){var r=this.__data__;if(r instanceof ne){var n=r.__data__;if(!ke||n.length<ol-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new de(n)}return r.set(e,t),this.size=r.size,this}function oe(e){var t=this.__data__=new ne(e);this.size=t.size}oe.prototype.clear=wo,oe.prototype.delete=So,oe.prototype.get=To,oe.prototype.has=xo,oe.prototype.set=ll;var cl="__lodash_hash_undefined__";function ul(e){return this.__data__.set(e,cl),this}function fl(e){return this.__data__.has(e)}function Qe(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new de;++t<r;)this.add(e[t])}Qe.prototype.add=Qe.prototype.push=ul,Qe.prototype.has=fl;function dl(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}function hl(e,t){return e.has(t)}var pl=1,vl=2;function Zr(e,t,r,n,i,s){var a=r&pl,l=e.length,c=t.length;if(l!=c&&!(a&&c>l))return!1;var o=s.get(e),u=s.get(t);if(o&&u)return o==t&&u==e;var f=-1,h=!0,v=r&vl?new Qe:void 0;for(s.set(e,t),s.set(t,e);++f<l;){var d=e[f],y=t[f];if(n)var g=a?n(y,d,f,t,e,s):n(d,y,f,e,t,s);if(g!==void 0){if(g)continue;h=!1;break}if(v){if(!dl(t,function(b,R){if(!hl(v,R)&&(d===b||i(d,b,r,n,s)))return v.push(R)})){h=!1;break}}else if(!(d===y||i(d,y,r,n,s))){h=!1;break}}return s.delete(e),s.delete(t),h}var ml=te.Uint8Array,Qr=ml;function gl(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}function yl(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var bl=1,_l=2,wl="[object Boolean]",Sl="[object Date]",Tl="[object Error]",xl="[object Map]",El="[object Number]",Cl="[object RegExp]",Ol="[object Set]",Al="[object String]",Rl="[object Symbol]",Ml="[object ArrayBuffer]",Pl="[object DataView]",qr=se?se.prototype:void 0,Dt=qr?qr.valueOf:void 0;function Dl(e,t,r,n,i,s,a){switch(r){case Pl:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Ml:return!(e.byteLength!=t.byteLength||!s(new Qr(e),new Qr(t)));case wl:case Sl:case El:return Kr(+e,+t);case Tl:return e.name==t.name&&e.message==t.message;case Cl:case Al:return e==t+"";case xl:var l=gl;case Ol:var c=n&bl;if(l||(l=yl),e.size!=t.size&&!c)return!1;var o=a.get(e);if(o)return o==t;n|=_l,a.set(e,t);var u=Zr(l(e),l(t),n,i,s,a);return a.delete(e),u;case Rl:if(Dt)return Dt.call(e)==Dt.call(t)}return!1}function Ll(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var Nl=Array.isArray,Fe=Nl;function kl(e,t,r){var n=t(e);return Fe(e)?n:Ll(n,r(e))}function jl(e,t){for(var r=-1,n=e==null?0:e.length,i=0,s=[];++r<n;){var a=e[r];t(a,r,e)&&(s[i++]=a)}return s}function Fl(){return[]}var Il=Object.prototype,zl=Il.propertyIsEnumerable,en=Object.getOwnPropertySymbols,$l=en?function(e){return e==null?[]:(e=Object(e),jl(en(e),function(t){return zl.call(e,t)}))}:Fl,Bl=$l;function Wl(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var Hl="[object Arguments]";function tn(e){return Te(e)&&Se(e)==Hl}var rn=Object.prototype,Ul=rn.hasOwnProperty,Yl=rn.propertyIsEnumerable,Vl=tn(function(){return arguments}())?tn:function(e){return Te(e)&&Ul.call(e,"callee")&&!Yl.call(e,"callee")},Gl=Vl;function Kl(){return!1}var nn=typeof exports=="object"&&exports&&!exports.nodeType&&exports,sn=nn&&typeof module=="object"&&module&&!module.nodeType&&module,Xl=sn&&sn.exports===nn,an=Xl?te.Buffer:void 0,Jl=an?an.isBuffer:void 0,Zl=Jl||Kl,Lt=Zl,Ql=9007199254740991,ql=/^(?:0|[1-9]\d*)$/;function ec(e,t){var r=typeof e;return t=t==null?Ql:t,!!t&&(r=="number"||r!="symbol"&&ql.test(e))&&e>-1&&e%1==0&&e<t}var tc=9007199254740991;function on(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=tc}var rc="[object Arguments]",nc="[object Array]",ic="[object Boolean]",sc="[object Date]",ac="[object Error]",oc="[object Function]",lc="[object Map]",cc="[object Number]",uc="[object Object]",fc="[object RegExp]",dc="[object Set]",hc="[object String]",pc="[object WeakMap]",vc="[object ArrayBuffer]",mc="[object DataView]",gc="[object Float32Array]",yc="[object Float64Array]",bc="[object Int8Array]",_c="[object Int16Array]",wc="[object Int32Array]",Sc="[object Uint8Array]",Tc="[object Uint8ClampedArray]",xc="[object Uint16Array]",Ec="[object Uint32Array]",j={};j[gc]=j[yc]=j[bc]=j[_c]=j[wc]=j[Sc]=j[Tc]=j[xc]=j[Ec]=!0,j[rc]=j[nc]=j[vc]=j[ic]=j[mc]=j[sc]=j[ac]=j[oc]=j[lc]=j[cc]=j[uc]=j[fc]=j[dc]=j[hc]=j[pc]=!1;function Cc(e){return Te(e)&&on(e.length)&&!!j[Se(e)]}function Oc(e){return function(t){return e(t)}}var ln=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ie=ln&&typeof module=="object"&&module&&!module.nodeType&&module,Ac=Ie&&Ie.exports===ln,Nt=Ac&&jr.process,Rc=function(){try{var e=Ie&&Ie.require&&Ie.require("util").types;return e||Nt&&Nt.binding&&Nt.binding("util")}catch{}}(),cn=Rc,un=cn&&cn.isTypedArray,Mc=un?Oc(un):Cc,fn=Mc,Pc=Object.prototype,Dc=Pc.hasOwnProperty;function Lc(e,t){var r=Fe(e),n=!r&&Gl(e),i=!r&&!n&&Lt(e),s=!r&&!n&&!i&&fn(e),a=r||n||i||s,l=a?Wl(e.length,String):[],c=l.length;for(var o in e)(t||Dc.call(e,o))&&!(a&&(o=="length"||i&&(o=="offset"||o=="parent")||s&&(o=="buffer"||o=="byteLength"||o=="byteOffset")||ec(o,c)))&&l.push(o);return l}var Nc=Object.prototype;function kc(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Nc;return e===r}function jc(e,t){return function(r){return e(t(r))}}var Fc=jc(Object.keys,Object),Ic=Fc,zc=Object.prototype,$c=zc.hasOwnProperty;function Bc(e){if(!kc(e))return Ic(e);var t=[];for(var r in Object(e))$c.call(e,r)&&r!="constructor"&&t.push(r);return t}function Wc(e){return e!=null&&on(e.length)&&!Xr(e)}function Hc(e){return Wc(e)?Lc(e):Bc(e)}function dn(e){return kl(e,Hc,Bl)}var Uc=1,Yc=Object.prototype,Vc=Yc.hasOwnProperty;function Gc(e,t,r,n,i,s){var a=r&Uc,l=dn(e),c=l.length,o=dn(t),u=o.length;if(c!=u&&!a)return!1;for(var f=c;f--;){var h=l[f];if(!(a?h in t:Vc.call(t,h)))return!1}var v=s.get(e),d=s.get(t);if(v&&d)return v==t&&d==e;var y=!0;s.set(e,t),s.set(t,e);for(var g=a;++f<c;){h=l[f];var b=e[h],R=t[h];if(n)var D=a?n(R,b,h,t,e,s):n(b,R,h,e,t,s);if(!(D===void 0?b===R||i(b,R,r,n,s):D)){y=!1;break}g||(g=h=="constructor")}if(y&&!g){var T=e.constructor,x=t.constructor;T!=x&&"constructor"in e&&"constructor"in t&&!(typeof T=="function"&&T instanceof T&&typeof x=="function"&&x instanceof x)&&(y=!1)}return s.delete(e),s.delete(t),y}var Kc=Ee(te,"DataView"),kt=Kc,Xc=Ee(te,"Promise"),jt=Xc,Jc=Ee(te,"Set"),Ft=Jc,Zc=Ee(te,"WeakMap"),It=Zc,hn="[object Map]",Qc="[object Object]",pn="[object Promise]",vn="[object Set]",mn="[object WeakMap]",gn="[object DataView]",qc=ue(kt),eu=ue(ke),tu=ue(jt),ru=ue(Ft),nu=ue(It),he=Se;(kt&&he(new kt(new ArrayBuffer(1)))!=gn||ke&&he(new ke)!=hn||jt&&he(jt.resolve())!=pn||Ft&&he(new Ft)!=vn||It&&he(new It)!=mn)&&(he=function(e){var t=Se(e),r=t==Qc?e.constructor:void 0,n=r?ue(r):"";if(n)switch(n){case qc:return gn;case eu:return hn;case tu:return pn;case ru:return vn;case nu:return mn}return t});var yn=he,iu=1,bn="[object Arguments]",_n="[object Array]",qe="[object Object]",su=Object.prototype,wn=su.hasOwnProperty;function au(e,t,r,n,i,s){var a=Fe(e),l=Fe(t),c=a?_n:yn(e),o=l?_n:yn(t);c=c==bn?qe:c,o=o==bn?qe:o;var u=c==qe,f=o==qe,h=c==o;if(h&&Lt(e)){if(!Lt(t))return!1;a=!0,u=!1}if(h&&!u)return s||(s=new oe),a||fn(e)?Zr(e,t,r,n,i,s):Dl(e,t,c,r,n,i,s);if(!(r&iu)){var v=u&&wn.call(e,"__wrapped__"),d=f&&wn.call(t,"__wrapped__");if(v||d){var y=v?e.value():e,g=d?t.value():t;return s||(s=new oe),i(y,g,r,n,s)}}return h?(s||(s=new oe),Gc(e,t,r,n,i,s)):!1}function Sn(e,t,r,n,i){return e===t?!0:e==null||t==null||!Te(e)&&!Te(t)?e!==e&&t!==t:au(e,t,r,n,Sn,i)}function ou(e,t){return Sn(e,t)}function zt(e,t,r){r===void 0&&(r={});var n=Me(t);Yr(function(){var i=Xe(r.target,window);if(!!(i!=null&&i.addEventListener)){var s=function(l){return n.current(l)};return i.addEventListener(e,s,{capture:r.capture,once:r.once,passive:r.passive}),function(){i.removeEventListener(e,s,{capture:r.capture})}}},[e,r.capture,r.once,r.passive],r.target)}var lu=globalThis&&globalThis.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){a={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return s},$t=function(e,t){var r=t||{},n=r.onEnter,i=r.onLeave,s=lu(oo(!1),2),a=s[0],l=s[1],c=l.setTrue,o=l.setFalse;return zt("mouseenter",function(){n==null||n(),c()},{target:e}),zt("mouseleave",function(){i==null||i(),o()},{target:e}),a},cu=function(t,r){return r===void 0&&(r=[]),ou(t,r)},uu=function(t,r,n){var i=p.useRef(),s=p.useRef(0);cu(r,i.current)||(i.current=r,s.current+=1),Yr(t,[s.current],n)},fu=uu,Bt=globalThis&&globalThis.__values||function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},du={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},Wt={ctrl:function(t){return t.ctrlKey},shift:function(t){return t.shiftKey},alt:function(t){return t.altKey},meta:function(t){return t.metaKey}};function hu(e){var t=Object.keys(Wt).reduce(function(r,n){return Wt[n](e)?r+1:r},0);return[16,17,18,91,92].includes(e.keyCode)?t:t+1}function Tn(e,t,r){var n,i;if(!e.key)return!1;if(Dr(t))return e.keyCode===t;var s=t.split("."),a=0;try{for(var l=Bt(s),c=l.next();!c.done;c=l.next()){var o=c.value,u=Wt[o],f=du[o.toLowerCase()];(u&&u(e)||f&&f===e.keyCode)&&a++}}catch(h){n={error:h}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}return r?a===s.length&&hu(e)===s.length:a===s.length}function pu(e,t){return Tt(e)?e:Ls(e)||Dr(e)?function(r){return Tn(r,e,t)}:Array.isArray(e)?function(r){return e.some(function(n){return Tn(r,n,t)})}:e?function(){return!0}:function(){return!1}}var vu=["keydown"];function pe(e,t,r){var n=r||{},i=n.events,s=i===void 0?vu:i,a=n.target,l=n.exactMatch,c=l===void 0?!1:l,o=Me(t),u=Me(e);fu(function(){var f,h,v,d=Xe(a,window);if(!!d){var y=function(T){var x,C=pu(u.current,c);if(C(T))return(x=o.current)===null||x===void 0?void 0:x.call(o,T)};try{for(var g=Bt(s),b=g.next();!b.done;b=g.next()){var R=b.value;(v=d==null?void 0:d.addEventListener)===null||v===void 0||v.call(d,R,y)}}catch(D){f={error:D}}finally{try{b&&!b.done&&(h=g.return)&&h.call(g)}finally{if(f)throw f.error}}return function(){var D,T,x;try{for(var C=Bt(s),F=C.next();!F.done;F=C.next()){var z=F.value;(x=d==null?void 0:d.removeEventListener)===null||x===void 0||x.call(d,z,y)}}catch(k){D={error:k}}finally{try{F&&!F.done&&(T=C.return)&&T.call(C)}finally{if(D)throw D.error}}}}},[s],a)}var mu=globalThis&&globalThis.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){a={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return s};function gu(e){var t=p.useRef(0),r=mu(p.useState(e),2),n=r[0],i=r[1],s=p.useCallback(function(a){cancelAnimationFrame(t.current),t.current=requestAnimationFrame(function(){i(a)})},[]);return Pe(function(){cancelAnimationFrame(t.current)}),[n,s]}var yu=globalThis&&globalThis.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){a={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return s},bu={screenX:NaN,screenY:NaN,clientX:NaN,clientY:NaN,pageX:NaN,pageY:NaN,elementX:NaN,elementY:NaN,elementH:NaN,elementW:NaN,elementPosX:NaN,elementPosY:NaN},_u=function(e){var t=yu(gu(bu),2),r=t[0],n=t[1];return zt("mousemove",function(i){var s=i.screenX,a=i.screenY,l=i.clientX,c=i.clientY,o=i.pageX,u=i.pageY,f={screenX:s,screenY:a,clientX:l,clientY:c,pageX:o,pageY:u,elementX:NaN,elementY:NaN,elementH:NaN,elementW:NaN,elementPosX:NaN,elementPosY:NaN},h=Xe(e);if(h){var v=h.getBoundingClientRect(),d=v.left,y=v.top,g=v.width,b=v.height;f.elementPosX=d+window.pageXOffset,f.elementPosY=y+window.pageYOffset,f.elementX=o-f.elementPosX,f.elementY=u-f.elementPosY,f.elementW=g,f.elementH=b}n(f)},{target:function(){return document}}),r},xn={exports:{}};/*!
  Copyright (c) 2018 Jed Watson.
  Licensed under the MIT License (MIT), see
  http://jedwatson.github.io/classnames
*/(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var n=[],i=0;i<arguments.length;i++){var s=arguments[i];if(!!s){var a=typeof s;if(a==="string"||a==="number")n.push(s);else if(Array.isArray(s)){if(s.length){var l=r.apply(null,s);l&&n.push(l)}}else if(a==="object")if(s.toString===Object.prototype.toString)for(var c in s)t.call(s,c)&&s[c]&&n.push(c);else n.push(s.toString())}}return n.join(" ")}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(xn);var K=xn.exports;const wu="https://api.bilibili.com",En="https://app.bilibili.com",Ht=ut.default.create({baseURL:wu});Ht.interceptors.request.use(function(e){var t;return(t=e.params)!=null&&t._||(e.params=Ce(be({},e.params),{_:Date.now()})),e},function(e){return Promise.reject(e)});const et=ut.default.create({adapter:ss.default});et.interceptors.request.use(function(e){return e.params=be({access_key:le.accessKey||""},e.params),e},function(e){return Promise.reject(e)}),et.interceptors.response.use(e=>{if(e.config.responseType==="json"&&e.data&&e.data instanceof ArrayBuffer){const t=new TextDecoder,r=new Uint8Array(e.data),n=t.decode(r);e.data=n;try{e.data=JSON.parse(n)}catch{}}return e});async function Su(){return(await et.get(En+"/x/feed/index",{responseType:"json",params:{build:"1",mobi_app:"android",idx:(Date.now()/1e3).toFixed(0)}})).data.data}async function Tu(){return Ut(2)}async function Ut(e){const t=new Array(e).fill(0).map(i=>Su());let n=(await Promise.all(t)).reduce((i,s)=>i.concat(s),[]);return n=xu(n),n.map(i=>Ce(be({},i),{uniqId:i.param+"-"+crypto.randomUUID()}))}function xu(e){const t=new Set;return e=e.filter(r=>{const{param:n}=r;return t.has(n)?(console.log("[bilibili-app-recommend]: [uniqRecList]: duplicate",r),!1):(t.add(n),!0)}),e}const Cn="_toast-container_9119l_1";var Cd={toastContainer:Cn};function ie(e,t=2e3){const r=Ae.default(`<div class='${Cn}'>${e}</div>`);r.appendTo(document.body),setTimeout(()=>r.remove(),t)}const Eu="\u8BF7\u6C42\u5931\u8D25, \u8BF7\u91CD\u8BD5 !!!",Cu="\u64CD\u4F5C\u5931\u8D25, \u8BF7\u91CD\u8BD5 !!!";function On(){return ie(Eu)}function An(){return ie(Cu)}async function Ou(){var c,o;const t=(await ut.default.get("https://passport.bilibili.com/login/app/third",{params:{appkey:"27eb53fc9058f8c3",api:"https://www.mcbbs.net/template/mcbbs/image/special_photo_bg.png",sign:"04224646d1fea004e79606d3b038c84a"},withCredentials:!0})).data;if(!((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(!((o=t==null?void 0:t.data)!=null&&o.confirm_uri))return{errmsg:"\u65E0\u6CD5\u83B7\u5F97\u6388\u6743\u7F51\u5740",json:t};const r=t.data.confirm_uri;let n;const i=new Promise(u=>{window.addEventListener("message",f=>{if(f.origin!="https://www.mcbbs.net"||!f.data)return;const h=f.data.match(/access_key=([0-9a-z]{32})/);if(!h||!h[1])return u({errmsg:"\u6CA1\u6709\u83B7\u5F97\u5339\u914D\u7684\u5BC6\u94A5"});u(h[1])}),n=setTimeout(()=>{u({errmsg:"\u83B7\u53D6\u6388\u6743\u8D85\u65F6"})},5e3)}),s=Ae.default(`<iframe src='${r}' style="display: none;" />`);s.appendTo(document.body);function a(){s.remove(),n&&(clearTimeout(n),n=null)}const l=await i;return a(),l}async function Au(){const e=await Ou();if(typeof e=="object"&&"errmsg"in e){ie(e.errmsg);return}const t=e;return Ue({accessKey:t}),ie("\u83B7\u53D6\u6210\u529F"),t}function Ru(){Ue({accessKey:""}),ie("\u5DF2\u5220\u9664 access_key")}const Rn="_expand-btn_wdzp9_1",Mn="_expanded_wdzp9_12";var Od={expandBtn:Rn,expanded:Mn},tt={exports:{}},rt={};/**
 * @license React
 * react-jsx-runtime.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 Mu=ct.default,Pu=Symbol.for("react.element"),Du=Symbol.for("react.fragment"),Lu=Object.prototype.hasOwnProperty,Nu=Mu.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,ku={key:!0,ref:!0,__self:!0,__source:!0};function Pn(e,t,r){var n,i={},s=null,a=null;r!==void 0&&(s=""+r),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(a=t.ref);for(n in t)Lu.call(t,n)&&!ku.hasOwnProperty(n)&&(i[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)i[n]===void 0&&(i[n]=t[n]);return{$$typeof:Pu,type:e,key:s,ref:a,props:i,_owner:Nu.current}}rt.Fragment=Du,rt.jsx=Pn,rt.jsxs=Pn,tt.exports=rt;const m=tt.exports.jsx,P=tt.exports.jsxs,nt=tt.exports.Fragment,Dn=p.forwardRef(function({children:t},r){const[n,i]=Ur(!1);p.useImperativeHandle(r,()=>i,[i]);const s=m("button",{className:K("primary-btn",Rn),onClick:i.toggle,children:m("svg",{className:K({[Mn]:n}),children:m("use",{xlinkHref:"#widget-arrow"})})});return P(nt,{children:[s,n&&t]})});var Ln={exports:{}},ju="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Fu=ju,Iu=Fu;function Nn(){}function kn(){}kn.resetWarningCache=Nn;var zu=function(){function e(n,i,s,a,l,c){if(c!==Iu){var o=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 o.name="Invariant Violation",o}}e.isRequired=e;function t(){return e}var r={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:kn,resetWarningCache:Nn};return r.PropTypes=r,r};Ln.exports=zu();var X=Ln.exports;class Yt 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 r={get passive(){t=!0}};try{document.addEventListener("test",null,r),document.removeEventListener("test",null,r)}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 r=this.props.getScrollParent&&this.props.getScrollParent();return r!=null?r:t&&t.parentNode}filterProps(t){return t}attachScrollListener(){const t=this.getParentElement(this.scrollComponent);if(!this.props.hasMore||!t)return;let r=window;this.props.useWindow===!1&&(r=t),r.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),r.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),r.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,r=window,n=this.getParentElement(t);let i;if(this.props.useWindow){const s=document.documentElement||document.body.parentNode||document.body,a=r.pageYOffset!==void 0?r.pageYOffset:s.scrollTop;this.props.isReverse?i=a:i=this.calculateOffset(t,a)}else this.props.isReverse?i=n.scrollTop:i=t.scrollHeight-n.scrollTop-n.clientHeight;i<Number(this.props.threshold)&&t&&t.offsetParent!==null&&(this.detachScrollListener(),this.beforeScrollHeight=n.scrollHeight,this.beforeScrollTop=n.scrollTop,typeof this.props.loadMore=="function"&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}calculateOffset(t,r){return t?this.calculateTopPosition(t)+(t.offsetHeight-r-window.innerHeight):0}calculateTopPosition(t){return t?t.offsetTop+this.calculateTopPosition(t.offsetParent):0}render(){const b=this.filterProps(this.props),{children:r,element:n,hasMore:i,initialLoad:s,isReverse:a,loader:l,loadMore:c,pageStart:o,ref:u,threshold:f,useCapture:h,useWindow:v,getScrollParent:d}=b,y=rs(b,["children","element","hasMore","initialLoad","isReverse","loader","loadMore","pageStart","ref","threshold","useCapture","useWindow","getScrollParent"]);y.ref=R=>{this.scrollComponent=R,u&&u(R)};const g=[r];return i&&(l?a?g.unshift(l):g.push(l):this.defaultLoader&&(a?g.unshift(this.defaultLoader):g.push(this.defaultLoader))),ct.default.createElement(n,y,g)}}pr(Yt,"propTypes",{children:X.node.isRequired,element:X.node,hasMore:X.bool,initialLoad:X.bool,isReverse:X.bool,loader:X.node,loadMore:X.func.isRequired,pageStart:X.number,ref:X.func,getScrollParent:X.func,threshold:X.number,useCapture:X.bool,useWindow:X.bool}),pr(Yt,"defaultProps",{element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null});let ze=0;const $u=()=>{ze++,document.body.style.overflow="hidden"},Bu=()=>{ze--,ze<0&&(ze=0),ze===0&&(document.body.style.overflow="overlay")},jn=()=>document.body.classList.contains("dark"),Fn=He({value:jn()}),Wu=function(){return yt(Fn).value};new MutationObserver(function(){Fn.value=jn()}).observe(document.body,{attributes:!0,attributeFilter:["class"]});function In({show:e,onHide:t,children:r,clsModalMask:n,clsModal:i,hideWhenMaskOnClick:s=!1}){p.useLayoutEffect(()=>{e?$u():Bu()},[e]);const a=p.useRef(null),l=Wu(),{bg:c,c:o}=p.useMemo(()=>{const d=window.getComputedStyle(document.body)["background-color"],y=window.getComputedStyle(document.body).color;return{bg:d,c:y}},[l]),u=p.useMemo(()=>l?{"--bg":c,"--c":o,backgroundColor:c,color:o}:{},[c,o,l]),f=p.useId(),h=p.useMemo(()=>{const d=document.createElement("div");return d.setAttribute("data-id","base-modal-"+f),document.body.appendChild(d),d},[]),v=H(d=>{var y;(y=a.current)!=null&&y.contains(d.target)||s&&t()});return e?U.createPortal(m("div",{className:K(n),onClick:v,children:m("div",{className:K(i),style:u,ref:a,children:r})}),h):null}function Hu(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var Uu=1/0,zn=se?se.prototype:void 0,$n=zn?zn.toString:void 0;function Vt(e){if(typeof e=="string")return e;if(Fe(e))return Hu(e,Vt)+"";if(zr(e))return $n?$n.call(e):"";var t=e+"";return t=="0"&&1/e==-Uu?"-0":t}var Bn=1/0,Yu=17976931348623157e292;function Vu(e){if(!e)return e===0?e:0;if(e=At(e),e===Bn||e===-Bn){var t=e<0?-1:1;return t*Yu}return e===e?e:0}function Gu(e){var t=Vu(e),r=t%1;return t===t?r?t-r:t:0}function Ku(e){return e==null?"":Vt(e)}function Xu(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),r=r>i?i:r,r<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var s=Array(i);++n<i;)s[n]=e[n+t];return s}function Ju(e,t,r){var n=e.length;return r=r===void 0?n:r,!t&&r>=n?e:Xu(e,t,r)}var Zu="\\ud800-\\udfff",Qu="\\u0300-\\u036f",qu="\\ufe20-\\ufe2f",ef="\\u20d0-\\u20ff",tf=Qu+qu+ef,rf="\\ufe0e\\ufe0f",nf="\\u200d",sf=RegExp("["+nf+Zu+tf+rf+"]");function Gt(e){return sf.test(e)}function af(e){return e.split("")}var Wn="\\ud800-\\udfff",of="\\u0300-\\u036f",lf="\\ufe20-\\ufe2f",cf="\\u20d0-\\u20ff",uf=of+lf+cf,ff="\\ufe0e\\ufe0f",df="["+Wn+"]",Kt="["+uf+"]",Xt="\\ud83c[\\udffb-\\udfff]",hf="(?:"+Kt+"|"+Xt+")",Hn="[^"+Wn+"]",Un="(?:\\ud83c[\\udde6-\\uddff]){2}",Yn="[\\ud800-\\udbff][\\udc00-\\udfff]",pf="\\u200d",Vn=hf+"?",Gn="["+ff+"]?",vf="(?:"+pf+"(?:"+[Hn,Un,Yn].join("|")+")"+Gn+Vn+")*",mf=Gn+Vn+vf,gf="(?:"+[Hn+Kt+"?",Kt,Un,Yn,df].join("|")+")",yf=RegExp(Xt+"(?="+Xt+")|"+gf+mf,"g");function bf(e){return e.match(yf)||[]}function _f(e){return Gt(e)?bf(e):af(e)}function wf(e){return function(t){return t==null?void 0:t[e]}}var Sf=9007199254740991,Tf=Math.floor;function Kn(e,t){var r="";if(!e||t<1||t>Sf)return r;do t%2&&(r+=e),t=Tf(t/2),t&&(e+=e);while(t);return r}var xf=wf("length"),Ef=xf,Xn="\\ud800-\\udfff",Cf="\\u0300-\\u036f",Of="\\ufe20-\\ufe2f",Af="\\u20d0-\\u20ff",Rf=Cf+Of+Af,Mf="\\ufe0e\\ufe0f",Pf="["+Xn+"]",Jt="["+Rf+"]",Zt="\\ud83c[\\udffb-\\udfff]",Df="(?:"+Jt+"|"+Zt+")",Jn="[^"+Xn+"]",Zn="(?:\\ud83c[\\udde6-\\uddff]){2}",Qn="[\\ud800-\\udbff][\\udc00-\\udfff]",Lf="\\u200d",qn=Df+"?",ei="["+Mf+"]?",Nf="(?:"+Lf+"(?:"+[Jn,Zn,Qn].join("|")+")"+ei+qn+")*",kf=ei+qn+Nf,jf="(?:"+[Jn+Jt+"?",Jt,Zn,Qn,Pf].join("|")+")",ti=RegExp(Zt+"(?="+Zt+")|"+jf+kf,"g");function Ff(e){for(var t=ti.lastIndex=0;ti.test(e);)++t;return t}function ri(e){return Gt(e)?Ff(e):Ef(e)}var If=Math.ceil;function zf(e,t){t=t===void 0?" ":Vt(t);var r=t.length;if(r<2)return r?Kn(t,e):t;var n=Kn(t,If(e/ri(t)));return Gt(t)?Ju(_f(n),0,e).join(""):n.slice(0,e)}function $f(e,t,r){e=Ku(e),t=Gu(t);var n=t?ri(e):0;return t&&n<t?zf(t-n,r)+e:e}function Bf(e){if(!e)return"00:00";const t=Math.trunc(e/3600);e-=t*3600;const r=Math.trunc(e/60);e-=r*60;const i=[t,r,e];return i[0]===0&&i.shift(),i.map(a=>$f(a.toString(),2,"0")).join(":")}function Qt(e){if(!e)return"";if(e<=9999)return e.toString();let t=(e/1e4).toFixed(1);return t=t.replace(/\.0$/,""),`${t}\u4E07`}function Wf({className:e,item:t,pvideo:r}){var k;const n=p.useRef(null),i=_u(n.current),{elementW:s,elementH:a,elementX:l}=i;let c=0,o=0;s&&l&&!isNaN(l)&&!isNaN(s)&&(c=l/s,c<0&&(c=0),c>1&&(c=1),o=Math.floor((t.duration||0)*c));let u=p.useMemo(()=>{const L=(r==null?void 0:r.index)||[];let G=Uf(L,o);return G!==-1?G:o>L[L.length-1]?(G=Math.floor(L.length*c)-1,G<0&&(G=0),G):0},[r,o]);const{img_x_len:f,img_y_len:h,img_x_size:v,img_y_size:d}=r,y=h*f;u=u+1;const g=Math.floor(u/y),b=u-g*y,R=((k=r.image)==null?void 0:k[g])||"",D=Math.floor(b/f)+1,T=b-(D-1)*f,x=s*f,C=a*h;let F=(D-1)*a,z=(T-1)*s;return m("div",{ref:n,className:e,style:{backgroundColor:"black",backgroundImage:`url(${R})`,backgroundPosition:`-${z}px -${F}px`,backgroundSize:`${x}px ${C}px`},children:m(Hf,{progress:c})})}function Hf({progress:e}){return m("div",{className:"track",style:{position:"absolute",bottom:0,left:0,backgroundColor:"#eee",width:"100%",height:2},children:m("div",{className:"bar",style:{backgroundColor:"#fa6a9d",height:"100%",width:`${e*100}%`}})})}function Uf(e,t){var l;let r=0,n=e.length-1,i=-1;for(;r<=n;){const c=Math.floor((r+n)/2),o=e[c];if(t===o)return c;o<t?(r=c+1,i=c):n=c-1}if(i===-1)return-1;const s=e[i],a=(l=e[i+1])!=null?l:0;return s<t&&t<a?i:-1}function Yf(){var t;const e=(t=document.cookie.match(/bili_jct=([0-9a-fA-F]{32})/))==null?void 0:t[1];if(!e)throw ie("\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 qt=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,ni=typeof AbortController=="function",ii=ni?AbortController:class{constructor(){this.signal=new si}abort(){this.signal.dispatchEvent("abort")}},si=ni?AbortSignal:class{constructor(){this.aborted=!1,this._listeners=[]}dispatchEvent(t){if(t==="abort"){this.aborted=!0;const r={type:t,target:this};this.onabort(r),this._listeners.forEach(n=>n(r),this)}}onabort(){}addEventListener(t,r){t==="abort"&&this._listeners.push(r)}removeEventListener(t,r){t==="abort"&&(this._listeners=this._listeners.filter(n=>n!==r))}},er=new Set,tr=(e,t)=>{const r=`LRU_CACHE_OPTION_${e}`;it(r)&&nr(r,`${e} option`,`options.${t}`,me)},rr=(e,t)=>{const r=`LRU_CACHE_METHOD_${e}`;if(it(r)){const{prototype:n}=me,{get:i}=Object.getOwnPropertyDescriptor(n,e);nr(r,`${e} method`,`cache.${t}()`,i)}},Vf=(e,t)=>{const r=`LRU_CACHE_PROPERTY_${e}`;if(it(r)){const{prototype:n}=me,{get:i}=Object.getOwnPropertyDescriptor(n,e);nr(r,`${e} property`,`cache.${t}`,i)}},ai=(...e)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...e):console.error(...e)},it=e=>!er.has(e),nr=(e,t,r,n)=>{er.add(e);const i=`The ${t} is deprecated. Please use ${r} instead.`;ai(i,"DeprecationWarning",e,n)},ve=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),oi=e=>ve(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?st:null:null;class st extends Array{constructor(t){super(t),this.fill(0)}}class Gf{constructor(t){if(t===0)return[];const r=oi(t);this.heap=new r(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}}class me{constructor(t={}){const{max:r=0,ttl:n,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:a,updateAgeOnHas:l,allowStale:c,dispose:o,disposeAfter:u,noDisposeOnSet:f,noUpdateTTL:h,maxSize:v=0,sizeCalculation:d,fetchMethod:y,noDeleteOnFetchRejection:g}=t,{length:b,maxAge:R,stale:D}=t instanceof me?{}:t;if(r!==0&&!ve(r))throw new TypeError("max option must be a nonnegative integer");const T=r?oi(r):Array;if(!T)throw new Error("invalid max value: "+r);if(this.max=r,this.maxSize=v,this.sizeCalculation=d||b,this.sizeCalculation){if(!this.maxSize)throw new TypeError("cannot set sizeCalculation without setting maxSize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=y||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.keyMap=new Map,this.keyList=new Array(r).fill(null),this.valList=new Array(r).fill(null),this.next=new T(r),this.prev=new T(r),this.head=0,this.tail=0,this.free=new Gf(r),this.initialFill=1,this.size=0,typeof o=="function"&&(this.dispose=o),typeof u=="function"?(this.disposeAfter=u,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!f,this.noUpdateTTL=!!h,this.noDeleteOnFetchRejection=!!g,this.maxSize!==0){if(!ve(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!c||!!D,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!l,this.ttlResolution=ve(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=n||R||0,this.ttl){if(!ve(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 x="LRU_CACHE_UNBOUNDED";it(x)&&(er.add(x),ai("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",x,me))}D&&tr("stale","allowStale"),R&&tr("maxAge","ttl"),b&&tr("length","sizeCalculation")}getRemainingTTL(t){return this.has(t,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new st(this.max),this.starts=new st(this.max),this.setItemTTL=(n,i)=>{if(this.starts[n]=i!==0?qt.now():0,this.ttls[n]=i,i!==0&&this.ttlAutopurge){const s=setTimeout(()=>{this.isStale(n)&&this.delete(this.keyList[n])},i+1);s.unref&&s.unref()}},this.updateItemAge=n=>{this.starts[n]=this.ttls[n]!==0?qt.now():0};let t=0;const r=()=>{const n=qt.now();if(this.ttlResolution>0){t=n;const i=setTimeout(()=>t=0,this.ttlResolution);i.unref&&i.unref()}return n};this.getRemainingTTL=n=>{const i=this.keyMap.get(n);return i===void 0?0:this.ttls[i]===0||this.starts[i]===0?1/0:this.starts[i]+this.ttls[i]-(t||r())},this.isStale=n=>this.ttls[n]!==0&&this.starts[n]!==0&&(t||r())-this.starts[n]>this.ttls[n]}updateItemAge(t){}setItemTTL(t,r){}isStale(t){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new st(this.max),this.removeItemSize=t=>this.calculatedSize-=this.sizes[t],this.requireSize=(t,r,n,i)=>{if(!ve(n))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(n=i(r,t),!ve(n))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer)");return n},this.addItemSize=(t,r,n,i)=>{this.sizes[t]=i;const s=this.maxSize-this.sizes[t];for(;this.calculatedSize>s;)this.evict(!0);this.calculatedSize+=this.sizes[t]}}removeItemSize(t){}addItemSize(t,r,n,i){}requireSize(t,r,n,i){if(n||i)throw new TypeError("cannot set size without setting maxSize on cache")}*indexes({allowStale:t=this.allowStale}={}){if(this.size)for(let r=this.tail;!(!this.isValidIndex(r)||((t||!this.isStale(r))&&(yield r),r===this.head));)r=this.prev[r]}*rindexes({allowStale:t=this.allowStale}={}){if(this.size)for(let r=this.head;!(!this.isValidIndex(r)||((t||!this.isStale(r))&&(yield r),r===this.tail));)r=this.next[r]}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,r={}){for(const n of this.indexes())if(t(this.valList[n],this.keyList[n],this))return this.get(this.keyList[n],r)}forEach(t,r=this){for(const n of this.indexes())t.call(r,this.valList[n],this.keyList[n],this)}rforEach(t,r=this){for(const n of this.rindexes())t.call(r,this.valList[n],this.keyList[n],this)}get prune(){return rr("prune","purgeStale"),this.purgeStale}purgeStale(){let t=!1;for(const r of this.rindexes({allowStale:!0}))this.isStale(r)&&(this.delete(this.keyList[r]),t=!0);return t}dump(){const t=[];for(const r of this.indexes()){const n=this.keyList[r],s={value:this.valList[r]};this.ttls&&(s.ttl=this.ttls[r]),this.sizes&&(s.size=this.sizes[r]),t.unshift([n,s])}return t}load(t){this.clear();for(const[r,n]of t)this.set(r,n.value,n)}dispose(t,r,n){}set(t,r,{ttl:n=this.ttl,noDisposeOnSet:i=this.noDisposeOnSet,size:s=0,sizeCalculation:a=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL}={}){s=this.requireSize(t,r,s,a);let c=this.size===0?void 0:this.keyMap.get(t);if(c===void 0)c=this.newIndex(),this.keyList[c]=t,this.valList[c]=r,this.keyMap.set(t,c),this.next[this.tail]=c,this.prev[c]=this.tail,this.tail=c,this.size++,this.addItemSize(c,r,t,s),l=!1;else{const o=this.valList[c];r!==o&&(this.isBackgroundFetch(o)?o.__abortController.abort():i||(this.dispose(o,t,"set"),this.disposeAfter&&this.disposed.push([o,t,"set"])),this.removeItemSize(c),this.valList[c]=r,this.addItemSize(c,r,t,s)),this.moveToTail(c)}if(n!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),l||this.setItemTTL(c,n),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 r=this.head,n=this.keyList[r],i=this.valList[r];return this.isBackgroundFetch(i)?i.__abortController.abort():(this.dispose(i,n,"evict"),this.disposeAfter&&this.disposed.push([i,n,"evict"])),this.removeItemSize(r),t&&(this.keyList[r]=null,this.valList[r]=null,this.free.push(r)),this.head=this.next[r],this.keyMap.delete(n),this.size--,r}has(t,{updateAgeOnHas:r=this.updateAgeOnHas}={}){const n=this.keyMap.get(t);return n!==void 0&&!this.isStale(n)?(r&&this.updateItemAge(n),!0):!1}peek(t,{allowStale:r=this.allowStale}={}){const n=this.keyMap.get(t);if(n!==void 0&&(r||!this.isStale(n)))return this.valList[n]}backgroundFetch(t,r,n){const i=r===void 0?void 0:this.valList[r];if(this.isBackgroundFetch(i))return i;const s=new ii,a={signal:s.signal,options:n},l=f=>(s.signal.aborted||this.set(t,f,a.options),f),c=f=>{if(this.valList[r]===u&&(!n.noDeleteOnFetchRejection||u.__staleWhileFetching===void 0?this.delete(t):this.valList[r]=u.__staleWhileFetching),u.__returned===u)throw f},o=f=>f(this.fetchMethod(t,i,a)),u=new Promise(o).then(l,c);return u.__abortController=s,u.__staleWhileFetching=i,u.__returned=null,r===void 0?(this.set(t,u,a.options),r=this.keyMap.get(t)):this.valList[r]=u,u}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:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,ttl:i=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:a=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:o=this.noDeleteOnFetchRejection}={}){if(!this.fetchMethod)return this.get(t,{allowStale:r,updateAgeOnGet:n});const u={allowStale:r,updateAgeOnGet:n,ttl:i,noDisposeOnSet:s,size:a,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:o};let f=this.keyMap.get(t);if(f===void 0){const h=this.backgroundFetch(t,f,u);return h.__returned=h}else{const h=this.valList[f];if(this.isBackgroundFetch(h))return r&&h.__staleWhileFetching!==void 0?h.__staleWhileFetching:h.__returned=h;if(!this.isStale(f))return this.moveToTail(f),n&&this.updateItemAge(f),h;const v=this.backgroundFetch(t,f,u);return r&&v.__staleWhileFetching!==void 0?v.__staleWhileFetching:v.__returned=v}}get(t,{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet}={}){const i=this.keyMap.get(t);if(i!==void 0){const s=this.valList[i],a=this.isBackgroundFetch(s);return this.isStale(i)?a?r?s.__staleWhileFetching:void 0:(this.delete(t),r?s:void 0):a?void 0:(this.moveToTail(i),n&&this.updateItemAge(i),s)}}connect(t,r){this.prev[r]=t,this.next[t]=r}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 rr("del","delete"),this.delete}delete(t){let r=!1;if(this.size!==0){const n=this.keyMap.get(t);if(n!==void 0)if(r=!0,this.size===1)this.clear();else{this.removeItemSize(n);const i=this.valList[n];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[n]=null,this.valList[n]=null,n===this.tail?this.tail=this.prev[n]:n===this.head?this.head=this.next[n]:(this.next[this.prev[n]]=this.next[n],this.prev[this.next[n]]=this.prev[n]),this.size--,this.free.push(n)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return r}clear(){for(const t of this.rindexes({allowStale:!0})){const r=this.valList[t];if(this.isBackgroundFetch(r))r.__abortController.abort();else{const n=this.keyList[t];this.dispose(r,n,"delete"),this.disposeAfter&&this.disposed.push([r,n,"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 rr("reset","clear"),this.clear}get length(){return Vf("length","size"),this.size}static get AbortController(){return ii}static get AbortSignal(){return si}}var Kf=me;async function Xf(e){return(await Ht.get("/pvideo",{params:{aid:e}})).data.data}async function Jf(e){return[]}const ir=new Kf({max:200});async function Zf(e){if(ir.has(e))return ir.get(e);const[t,r]=await Promise.all([Xf(e),Jf()]);return ir.set(e,{pvideoData:t,dmData:r}),{pvideoData:t,dmData:r}}function li(e){return async function(r){const n=new FormData;n.append("aid",r),n.append("csrf",Yf());const s=(await Ht.post("/x/v2/history/toview/"+e,n,{withCredentials:!0})).data;return(s==null?void 0:s.code)===0&&(s==null?void 0:s.message)==="0"}}const Qf=li("add"),qf=li("del"),ci=e=>{const t={dislike:"/x/feed/dislike",cancel:"/x/feed/dislike/cancel"}[e];return async function(r,n){var l;const s=(await et.get(En+t,{params:{goto:r.goto,id:r.param,mid:r.mid,rid:r.tid,tag_id:(l=r.tag)==null?void 0:l.tag_id,reason_id:n,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"}},ed=ci("dislike"),td=ci("cancel"),ui="_bili-video-card_14zjz_1",fi="_image-wrapper_14zjz_4",di="_preview-card-wrapper_14zjz_8",hi="_watch-later_14zjz_21",pi="_badge_14zjz_24",vi="_recommend-reason_14zjz_32",mi="_bangumi-desc_14zjz_47",gi="_btn-dislike_14zjz_50",yi="_btn-dislike-icon_14zjz_65",bi="_btn-dislike-tip_14zjz_72",_i="_disliked-wrapper_14zjz_87",wi="_dislike-content-cover_14zjz_101",Si="_dislike-content-cover-inner_14zjz_107",rd="_dislike-icon_14zjz_118",Ti="_dislike-reason_14zjz_121",xi="_dislike-desc_14zjz_125",Ei="_dislike-content-action_14zjz_129";var Rd={biliVideoCard:ui,imageWrapper:fi,previewCardWrapper:di,watchLater:hi,badge:pi,recommendReason:vi,bangumiDesc:mi,btnDislike:gi,btnDislikeIcon:yi,btnDislikeTip:bi,dislikedWrapper:_i,dislikeContentCover:wi,dislikeContentCoverInner:Si,dislikeIcon:rd,dislikeReason:Ti,dislikeDesc:xi,dislikeContentAction:Ei};function nd(e){const t=He({data:Array.from(e||[]),has(r){return this.data.some(n=>n[0]===r)},set(r,n){const i=this.data.find(s=>s[0]===r);return i?i[1]=n:this.data.push([r,n]),this},get(r){var n;return(n=this.data.find(i=>i[0]===r))==null?void 0:n[1]},delete(r){const n=this.data.findIndex(i=>i[0]===r);return n===-1?!1:(this.data.splice(n,1),!0)},clear(){this.data.splice(0)},get size(){return this.data.length},toJSON(){return{}},forEach(r){this.data.forEach(n=>{r(n[1],n[0],this)})},keys(){return this.data.map(r=>r[0]).values()},values(){return this.data.map(r=>r[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 Ci="_modal-mask_vh629_1",Oi="_modal_vh629_1",Ai="_modal-header_vh629_23",Ri="_modal-title_vh629_30",Mi="_title-desc_vh629_35",Pi="_btn-close_vh629_39",Di="_modal-body_vh629_57",Li="_reason-list_vh629_62",Ni="_reason_vh629_62";var Md={modalMask:Ci,modal:Oi,modalHeader:Ai,modalTitle:Ri,titleDesc:Mi,btnClose:Pi,modalBody:Di,reasonList:Li,reason:Ni};const sr=nd();function id(){return yt(sr)}function sd(e){const t=id();if(!!e)return t.get(e)}function ad({show:e,onHide:t,item:r}){const[n,i]=p.useState(!1),s=H(async(l,c)=>{if(!r)return;let o=!1,u=null;try{i(!0),o=await ed(r,l)}catch(f){u=f}finally{i(!1)}if(u)return console.error(u.stack||u),On();o?ie("\u5DF2\u6807\u8BB0\u4E0D\u60F3\u770B"):An(),o&&(sr.set(r.param,{id:l,name:c}),t())}),a=p.useMemo(()=>{var l;return[...(l=r==null?void 0:r.dislike_reasons)!=null?l:[],{reason_id:12,reason_name:"\u6B64\u7C7B\u5185\u5BB9\u8FC7\u591A"},{reason_id:13,reason_name:"\u63A8\u8350\u8FC7"}]},[r]);return P(In,{show:e,onHide:t,clsModalMask:Ci,clsModal:Oi,hideWhenMaskOnClick:!0,children:[P("div",{className:Ai,children:[P("div",{className:Ri,children:["\u6211\u4E0D\u60F3\u770B",m("span",{className:Mi,children:"(\u9009\u62E9\u540E\u5C06\u51CF\u5C11\u76F8\u4F3C\u5185\u5BB9\u63A8\u8350)"})]}),m("div",{className:"space",style:{flex:1}}),P("button",{className:`primary-btn roll-btn ${Pi}`,onClick:t,children:[m("svg",{style:{transform:"rotate(0deg)"},children:m("use",{xlinkHref:"#widget-close"})}),m("span",{children:"\u5173\u95ED"})]})]}),m("div",{className:Di,children:m("div",{className:Li,children:a.map(l=>m("button",{className:Ni,"data-id":l.reason_id,onClick:()=>s(l.reason_id,l.reason_name),disabled:n,children:l.reason_name},l.reason_id))})})]})}let ki={show:!1,onHide:ji,item:null};function ji(){Fi({show:!1,item:null})}function Fi(e){Object.assign(ki,e),od().render(m(ad,Ce(be({},ki),{onHide:ji})))}let ar;function od(){if(!ar){const e=document.createElement("div");e.classList.add("show-dislike-container"),document.body.appendChild(e),ar=St(e)}return ar}function ld(e){Fi({show:!0,item:e})}const cd=Gr().format("YYYY"),ud=e=>{if(!e)return"";const t=Gr.unix(e);return t.format("YYYY")===cd?t.format("M-D"):t.format("YY-M-D")},fd=e=>e.replace(/^http:\/\//,"https://"),or=p.memo(function({style:t,className:r,item:n,loading:i}){i=i!=null?i:!Boolean(n);const s=P("div",{className:K("bili-video-card__skeleton",{hide:!i}),children:[m("div",{className:"bili-video-card__skeleton--cover"}),m("div",{className:"bili-video-card__skeleton--info",children:P("div",{className:"bili-video-card__skeleton--right",children:[m("p",{className:"bili-video-card__skeleton--text"}),m("p",{className:"bili-video-card__skeleton--text short"}),m("p",{className:"bili-video-card__skeleton--light"})]})})]}),a=sd(n==null?void 0:n.param);return P("div",{style:t,className:K("bili-video-card",ui,r),"data-report":"partition_recommend.content",children:[s,!i&&n&&(a?m(dd,{item:n,dislikedReason:a}):m(hd,{item:n}))]})}),dd=p.memo(function({dislikedReason:t,item:r}){const n=H(async()=>{if(!(t!=null&&t.id))return;let i=!1,s=null;try{i=await td(r,t.id)}catch(a){s=a}if(s)return console.error(s.stack||s),On();i?ie("\u5DF2\u64A4\u9500"):An(),i&&sr.delete(r.param)});return P("div",{className:K(_i),children:[m("div",{className:wi,children:P("div",{className:Si,children:[m("div",{className:"icon"}),m("div",{className:Ti,children:t==null?void 0:t.name}),m("div",{className:xi,children:"\u5C06\u51CF\u5C11\u6B64\u7C7B\u5185\u5BB9\u63A8\u8350"})]})}),m("div",{className:Ei,children:m("button",{onClick:n,children:"\u64A4\u9500"})})]})}),hd=p.memo(function({item:t}){const r=p.useRef(null),n=$t(r),i=p.useRef(null),s=$t(i),[a,l]=p.useState(!1),{accessKey:c}=bt(),o=Boolean(c),{param:u,title:f,cover:h,goto:v,play:d,like:y,coin:g,desc:b,danmaku:R,ctime:D,duration:T,name:x,face:C,mid:F,favorite:z,badge:k,rcmd_reason:L}=t,G=p.useMemo(()=>ud(D),[D]),$e=p.useMemo(()=>fd(h),[h]),[E,S]=p.useState(null),[_,O]=p.useState(!1),w=H(async()=>{if(!E&&!_)try{O(!0);const J=await Zf(u);S(J)}finally{O(!1)}});p.useEffect(()=>{n&&w()},[n]);let A=!1;const M=H(async J=>{if(J.preventDefault(),A)return;A=!0;const V=a?qf:Qf;let q=!1;try{q=await V(u)}finally{A=!1}q&&l(Be=>!Be)}),N=p.useRef(null),B=$t(N),I=H(J=>{J.stopPropagation(),J.preventDefault(),ld(t)}),Y=t.goto==="av"?`/video/av${u}`:t.uri,re=p.useMemo(()=>Bf(T),[T]),Q=p.useMemo(()=>Qt(d),[d]),ge=p.useMemo(()=>Qt(y),[y]),ye=p.useMemo(()=>Qt(z),[z]);return P("div",{className:"bili-video-card__wrap __scale-wrap",children:[m("a",{href:Y,target:"_blank","data-mod":"partition_recommend","data-idx":"content","data-ext":"click",children:P("div",{className:"bili-video-card__image __scale-player-wrap",ref:r,children:[P("div",{className:K("bili-video-card__image--wrap",fi),children:[P("picture",{className:"v-img bili-video-card__cover",children:[m("source",{srcSet:`${$e}@672w_378h_1c.webp`,type:"image/webp"}),m("img",{src:`${$e}@672w_378h_1c.webp`,alt:f,loading:"lazy"})]}),n&&(E==null?void 0:E.pvideoData)&&m(Wf,{className:di,item:t,pvideo:E==null?void 0:E.pvideoData}),P("div",{className:`bili-watch-later ${hi}`,style:{display:n?"flex":"none"},ref:i,onClick:M,children:[m("svg",{className:"bili-watch-later__icon",children:m("use",{xlinkHref:a?"#widget-watch-save":"#widget-watch-later"})}),m("span",{className:"bili-watch-later__tip",style:{display:s?"block":"none"},children:a?"\u79FB\u9664":"\u7A0D\u540E\u518D\u770B"})]}),o&&P("div",{ref:N,className:gi,onClick:I,style:{display:n?"flex":"none"},children:[m("svg",{className:yi,children:m("use",{xlinkHref:"#widget-close"})}),m("span",{className:bi,style:{display:B?"block":"none"},children:"\u6211\u4E0D\u60F3\u770B"})]})]}),m("div",{className:"bili-video-card__mask",children:P("div",{className:"bili-video-card__stats",children:[P("div",{className:"bili-video-card__stats--left",children:[P("span",{className:"bili-video-card__stats--item",children:[m("svg",{className:"bili-video-card__stats--icon",children:m("use",{xlinkHref:"#widget-play-count"})}),m("span",{className:"bili-video-card__stats--text",children:Q})]}),m("span",{className:"bili-video-card__stats--item",children:v==="av"?P(nt,{children:[m("svg",{className:"bili-video-card__stats--icon",children:m("use",{xlinkHref:"#widget-agree"})}),m("span",{className:"bili-video-card__stats--text",children:ge})]}):P(nt,{children:[m("svg",{className:"bili-video-card__stats--icon",children:m("use",{xlinkHref:"#widget-agree"})}),m("span",{className:"bili-video-card__stats--text",children:ye})]})})]}),m("span",{className:"bili-video-card__stats__duration",children:re})]})})]})}),m("div",{className:"bili-video-card__info __scale-disable",children:P("div",{className:"bili-video-card__info--right",children:[m("a",{href:Y,target:"_blank","data-mod":"partition_recommend","data-idx":"content","data-ext":"click",children:m("h3",{className:"bili-video-card__info--tit",title:f,children:f})}),P("p",{className:"bili-video-card__info--bottom",children:[v==="av"&&P("a",{className:"bili-video-card__info--owner",href:`//space.bilibili.com/${F}`,target:"_blank","data-mod":"partition_recommend","data-idx":"content","data-ext":"click",children:[L!=null&&L.content?m("span",{className:vi,children:L.content}):m("svg",{className:"bili-video-card__info--owner__up",children:m("use",{xlinkHref:"#widget-up"})}),m("span",{className:"bili-video-card__info--author",children:x}),G&&P("span",{className:"bili-video-card__info--date",children:["\xB7 ",G]})]}),v==="bangumi"&&P("a",{className:"bili-video-card__info--owner",href:Y,target:"_blank",children:[m("span",{className:pi,children:k}),m("span",{className:mi,children:b})]})]})]})})]})}),Ii="_modal-mask_1urmj_1",zi="_narrow-mode_1urmj_13",$i="_modal_1urmj_1",Bi="_modal-header_1urmj_38",Wi="_modal-title_1urmj_46",Hi="_btn-refresh_1urmj_51",Ui="_btn-close_1urmj_52",at="_modal-body_1urmj_68",pd="_list_1urmj_74",lr="_card_1urmj_77",cr="_active_1urmj_85",Yi="_video-card-list_1urmj_90",ur="_video-card-body_1urmj_1",Vi="_loader_1urmj_99",fr="_checkbox_1urmj_104";var Pd={modalMask:Ii,narrowMode:zi,modal:$i,modalHeader:Bi,modalTitle:Wi,btnRefresh:Hi,btnClose:Ui,modalBody:at,list:pd,card:lr,active:cr,videoCardList:Yi,videoCardBody:ur,loader:Vi,checkbox:fr};function vd({show:e,refresh:t,minIndex:r=0,maxIndex:n}){const[i,s]=p.useState(null),a=H(()=>{if(i===null)return!1;const y=document.querySelector(`${dr}.${cr}`),g=document.querySelector(`.${at}`);if(!y||!g)return!1;const b=g.getBoundingClientRect(),R=y.getBoundingClientRect();return!(R.top-b.top<-(b.height+R.height)||R.top-b.top>b.height*2+R.height)}),l=H((y,g)=>{if(!e)return;g==null||g.preventDefault();let b=a()?i+y:md();b<r||b>n||(s(b),gd(b))}),c=p.useCallback(y=>{l(-1,y)},[]),o=p.useCallback(y=>{l(1,y)},[]);pe("leftarrow",c),pe("rightarrow",o);const u=p.useCallback(y=>{l(-Ji(),y)},[]),f=p.useCallback(y=>{l(Ji(),y)},[]);pe("uparrow",u),pe("downarrow",f);const h=H(()=>{!i||!e||yd(i)}),v=H(()=>{!e||s(null)});pe("enter",h),pe("esc",v);const d=H(()=>{!e||t()});return pe("r",d,{exactMatch:!0}),{activeIndex:i,clearActiveIndex:v}}function md(){const e=document.querySelector(`.${at}`);if(!e)return 0;const t=e.getBoundingClientRect(),r=Gi();for(let n=0;n<r.length;n++)if(r[n].getBoundingClientRect().top>=t.top)return n;return 0}const dr=`#${ur} .${lr}`;function Gi(){return[...document.querySelectorAll(dr)]}function Ki(e){return Gi()[e]}function gd(e){var r;const t=Ki(e);(r=t==null?void 0:t.scrollIntoViewIfNeeded)==null||r.call(t,!1)}function yd(e){const t=Ki(e);if(!t)return;const r=t.querySelector(".bili-video-card__wrap > a");r==null||r.click()}const Xi=new Map;function Ji(){if(le.useNarrowMode)return 2;let e=Xi.get(window.innerWidth);if(e)return e;const t=document.querySelector(dr);if(!t)throw new Error("expect found first card");e=1;let r=t.getBoundingClientRect().top,n=t.nextElementSibling;for(;n&&n.getBoundingClientRect().top===r;)e++,n=n.nextElementSibling;return Xi.set(window.innerWidth,e),e}function Zi(){return p.useMemo(()=>crypto.randomUUID(),[])}const bd=p.memo(function({show:t,onHide:r}){const[n,i]=p.useState([]),[s,a]=p.useState(!1),l=p.useRef(null),c=H(async()=>{l.current&&(l.current.scrollTop=0),await Pr(50);try{a(!0),g(),i(await Ut(2)),g()}finally{a(!1)}}),o=H(async D=>{const T=await Ut(2);i(x=>[...x,...T])}),{useNarrowMode:u,initialShowMore:f}=bt(),h=p.useCallback(D=>{const T=D.target.checked;Ue({useNarrowMode:T})},[]),v=p.useCallback(D=>{const T=D.target.checked;Ue({initialShowMore:T}),T&&ie("\u5DF2\u5F00\u542F\u81EA\u52A8\u67E5\u770B\u66F4\u591A: \u4E0B\u6B21\u6253\u5F00\u9996\u9875\u65F6\u5C06\u76F4\u63A5\u5C55\u793A\u672C\u63A8\u8350\u5F39\u6846")},[]),d=p.useMemo(()=>({[zi]:u}),[u]),{activeIndex:y,clearActiveIndex:g}=vd({show:t,refresh:c,maxIndex:n.length-1}),b=Zi(),R=Zi();return P(In,{show:t,onHide:r,clsModalMask:K(Ii,d),clsModal:K($i,d),children:[P("div",{className:Bi,children:[m("div",{className:Wi,children:"\u63A8\u8350"}),m("div",{className:"space",style:{flex:1}}),P(Dn,{children:[m("input",{type:"checkbox",className:fr,id:R,checked:f,onChange:v}),m("label",{htmlFor:R,children:"\u81EA\u52A8\u67E5\u770B\u66F4\u591A"}),m("input",{type:"checkbox",className:fr,id:b,checked:u,onChange:h}),m("label",{htmlFor:b,children:"\u542F\u7528\u7A84\u5C4F\u6A21\u5F0F"})]}),P("button",{className:`primary-btn roll-btn ${Hi}`,onClick:c,children:[m("svg",{children:m("use",{xlinkHref:"#widget-roll"})}),m("span",{children:"\u6362\u4E00\u6362"})]}),P("button",{className:`primary-btn roll-btn ${Ui}`,onClick:r,children:[m("svg",{children:m("use",{xlinkHref:"#widget-close"})}),m("span",{children:"\u5173\u95ED"})]})]}),m("div",{className:at,ref:l,children:m(Yt,{pageStart:0,loadMore:o,hasMore:!0,useWindow:!1,threshold:360,style:{minHeight:"100%"},loader:m("div",{className:Vi,children:"\u52A0\u8F7D\u4E2D..."},0),children:m("div",{className:`video-card-list is-full ${Yi}`,children:m("div",{id:ur,className:K("video-card-body",d),children:n.map((D,T)=>m(or,{loading:s,item:D,className:K(lr,{[cr]:T===y})},D.uniqId))})})})})]})}),Qi="_grid_p5dvw_1",qi="_video-card-list_p5dvw_5";var Nd={grid:Qi,videoCardList:qi,expandBtn:"_expand-btn_p5dvw_19",expanded:"_expanded_p5dvw_30"};function _d(){const e=p.useRef(null),{accessKey:t}=bt(),r=H(async(d=!1)=>{var g;await Au()&&((g=e.current)==null||g.set(!1))}),n=Ru,i=H(()=>{const d="https://github.com/indefined/UserScripts/tree/master/bilibiliHome#%E6%8E%88%E6%9D%83%E8%AF%B4%E6%98%8E";window.open(d,"_blank")}),s=p.useMemo(()=>new Array(20).fill(0).map(()=>crypto.randomUUID()),[]),{data:a,loading:l,error:c,refresh:o}=io(Tu);c&&console.error(c.stack||c);const[u,f]=p.useState(()=>le.initialShowMore),h=p.useCallback(()=>{f(!0)},[]),v=p.useCallback(()=>{f(!1)},[]);return m("section",{className:K("bili-grid no-margin",Qi),"data-area":"\u63A8\u8350",children:P("div",{className:`video-card-list is-full ${qi}`,children:[P("div",{className:"area-header",children:[P("div",{className:"left",children:[m("a",{id:"\u5F71\u89C6",className:"the-world area-anchor","data-id":"25"}),m("svg",{className:"icon",children:m("use",{xlinkHref:"#channel-cinephile"})}),m("a",{className:"title",href:"#",children:m("span",{children:"\u63A8\u8350"})})]}),P("div",{className:"right",children:[t?P(Dn,{ref:e,children:[m("button",{className:"primary-btn roll-btn",onClick:i,children:m("span",{children:"access_key \u8BF4\u660E"})}),m("button",{className:"primary-btn roll-btn",onClick:()=>r(!0),children:m("span",{children:"\u91CD\u65B0\u83B7\u53D6 access_key"})}),m("button",{className:"primary-btn roll-btn",onClick:n,children:m("span",{children:"\u5220\u9664 access_key"})})]}):P(nt,{children:[m("button",{className:"primary-btn roll-btn",onClick:i,children:m("span",{children:"access_key \u8BF4\u660E"})}),m("button",{className:"primary-btn roll-btn",onClick:r,children:m("span",{children:"\u83B7\u53D6 access_key"})})]}),P("button",{className:"primary-btn roll-btn",onClick:o,children:[m("svg",{style:{transform:"rotate(0deg)"},children:m("use",{xlinkHref:"#widget-roll"})}),m("span",{children:"\u6362\u4E00\u6362"})]}),P("button",{className:"primary-btn see-more",onClick:h,children:[m("span",{children:"\u67E5\u770B\u66F4\u591A"}),m("svg",{children:m("use",{xlinkHref:"#widget-arrow"})})]})]})]}),m(bd,{show:u,onHide:v}),m("div",{className:"video-card-body more-class1 more-class2",children:l||c?s.map(d=>m(or,{},d)):a.map(d=>m(or,{item:d},d.uniqId))})]})})}(function(){var t;if(location.href.startsWith("https://www.mcbbs.net/template/mcbbs/image/special_photo_bg.png?"))return window.stop(),(t=window.top)==null?void 0:t.postMessage(location.href,"https://www.bilibili.com");if(location.pathname==="/")return wd()})();async function wd(){const e=Date.now(),t=10*1e3,r=()=>Ae.default(".bili-layout > section.bili-grid").length>0;for(;!r()&&Date.now()-e<t;)await Pr(100);if(!r()){console.error("[bilibili-app-recommend]: init fail");return}const n=Ae.default(".bili-layout > section.bili-grid").eq(0),i=Ae.default("<section></section>");i.insertAfter(n);const s=i[0];St(s).render(m(_d,{}))}})(React,$,ReactDOM,axios,axiosGmxhrAdapter);