// Built at: 2026/7/16 22:29:11 var j=a=>async(e,t)=>{let n=r=>async()=>{let i=r===a.length?t:a[r];if(i)return await i(e,n(r+1))};return n(0)()};function me(a){return a instanceof Uint8Array}function cn(a){return typeof a!="object"||a===null?String(a):a instanceof Error?`${a.toString()} ${JSON.stringify({stack:a.stack})}`:Array.isArray(a)?JSON.stringify(a):typeof a.toString=="function"&&a.toString!==Object.prototype.toString?a.toString():JSON.stringify(a)}function dn(){let a="";return typeof $environment<"u"&&$environment["device-model"]?a=$environment["device-model"]:typeof $loon<"u"&&(a=$loon),a}function he(a){return $utils.ungzip(a)}var v=class extends Error{constructor(t,n=`Process exited with code ${t}`){super(n);this.code=t}name="Exit";toString(){return`[${this.name}] ${this.message}`}};var yn=(i=>(i[i.DEBUG=1]="DEBUG",i[i.INFO=2]="INFO",i[i.WARN=3]="WARN",i[i.ERROR=4]="ERROR",i[i.OFF=5]="OFF",i))(yn||{}),T=class{static level=4;static setLevel(e){this.level=Number(e)||yn[e.toUpperCase()]||4}static log(...e){console.log(e.map(t=>cn(t)).join(" "))}static debug(...e){this.level>1||this.log("[DEBUG]",...e)}static info(...e){this.level>2||this.log("[INFO]",...e)}static warn(...e){this.level>3||this.log("[WARN]",...e)}static error(...e){if(this.level>4)return;let t=e[0];if(t instanceof v){t.code!==0&&this.error(t.toString());return}this.log("[ERROR]",...e)}};var _=class a{static getInstance(){return a.instance||(a.instance=a.createInstance()),a.instance}static createInstance(){if(typeof $loon<"u")return new be;if(typeof $task<"u")throw new Error("QuantumultX is not supported");return new q}static instance;request;response;state={};argument={};#e;get url(){return this.#e||(this.#e=new URL(this.request.url)),this.#e}get path(){return this.url.pathname}get method(){return this.request.method}constructor(){this.request=this.createRequest(typeof $request<"u"?$request:null),this.response=this.createResponse(typeof $response<"u"?$response:null)}getJSON(e){let t=this.getVal(e);return t?JSON.parse(t):null}setJSON(e,t){this.setVal(JSON.stringify(e),t)}exit(){$done({})}toString(){let{method:e,url:t}=this.request,{status:n,body:r}=this.response;return JSON.stringify({method:e,url:t,status:n,body:r})}},q=class extends _{createRequest(e){return Object.create(e,{bodyBytes:{get(){return this.body},set(t){this.body=t}}})}createResponse(e){return Object.create(e,{bodyBytes:{get(){return this.body},set(t){this.body=t}}})}initArgument(e){if(Object.assign(this.argument,e),typeof $argument=="string")try{Object.assign(this.argument,JSON.parse($argument))}catch(t){T.log(t)}}getVal(e){return $persistentStore.read(e)}setVal(e,t){return $persistentStore.write(e,t)}fetch(e){let{method:t,body:n,timeout:r=5,...i}=e;return new Promise((f,s)=>{$httpClient[t.toLowerCase()]({...i,body:n,"binary-mode":me(n),timeout:r},(o,l,u)=>{if(o)return s(o);f(this.createResponse({...l,body:u}))})})}notify(e="",t="",n="",r={}){let{openUrl:i,clipboard:f,mediaUrl:s,dismiss:o,sound:l=!0}=r,u={url:i,text:f,"media-url":s,"auto-dismiss":o,sound:l};i?u.action="open-url":f&&(u.action="clipboard"),$notification.post(e,t,n,u)}done(e){$done({...e})}abort(){$done({abort:!0})}},be=class extends q{initArgument(e){super.initArgument(e),typeof $argument=="object"&&Object.assign(this.argument,$argument)}fetch(e){return e.timeout=(e.timeout??5)*1e3,e.alpn="h2",super.fetch(e)}notify(e="",t="",n="",r={}){let{openUrl:i,mediaUrl:f,clipboard:s,delay:o}=r,l={openUrl:i,mediaUrl:f,clipboard:s};$notification.post(e,t,n,l,o)}abort(){$done()}};var K=_.getInstance();var G=class{middleware=[];use(e){return this.middleware.push(e),this}run(){j(this.middleware)(K).catch(e=>T.error(e,K)).finally(()=>K.exit())}};var mn=(a,e)=>e().then(()=>{a.done(a.response)});var hn=async(a,e)=>{let t=a.response.bodyBytes;a.response.bodyBytes=t[0]?he(t.subarray(5)):t.subarray(5),await e(),t=a.response.bodyBytes;let n=t.length,r=new Uint8Array(5+n);r[0]=0,r[1]=n>>>24,r[2]=n>>>16&255,r[3]=n>>>8&255,r[4]=n&255,r.set(t,5),a.response.bodyBytes=r};var bn=a=>(e,t)=>(e.initArgument(a),T.setLevel(String(e.argument.logLevel)),T.debug("[Argument]",e.argument),t());var D=bn({displayUpList:"show",purifyComment:!0,sponsorBlock:!0}),gn=(a,e)=>e().then(()=>{if(a.response.h2_trailers!==void 0)return;let t=a.request.headers["x-bili-moss-engine-type"];if(t===void 0)return;if(t!=="1"){T.error(`x-bili-moss-engine-type: ${t}`);return}let n=a.response.headers;Object.hasOwn(n,"grpc-status")||(a.response.headers={...n,"grpc-status":"0"})});var A=class{path;methods;stack;constructor(e,t,n){this.path=e,this.methods=t,this.stack=n}};var pi=(a,e)=>e.path===a.path,wn=(a,e)=>e.request.url.endsWith(a.path);var H=class{stack=[];matchPath;constructor(e={}){this.matchPath=e.matchPath||pi}use(...e){return this.register("",[],e)}get(e,...t){return this.register(e,["GET"],t)}post(e,...t){return this.register(e,["POST"],t)}routes(){return(e,t)=>{let n=this.match(e);if(!n.route)return t();e.state.route=!0;let r=n.pathAndMethod.flatMap(i=>i.stack);return j(r)(e,t)}}routeNotMatched(){return(e,t)=>t().then(()=>{if(!e.state.route)throw new Error("Unexpected request")})}match(e){let t={path:[],pathAndMethod:[],route:!1};for(let n of this.stack)(n.path===""||this.matchPath(n,e))&&(t.path.push(n),(n.methods.length===0||n.methods.includes(e.method))&&(t.pathAndMethod.push(n),n.methods.length>0&&(t.route=!0)));return t}register(e,t,n){if(Array.isArray(e))for(let r of e)this.stack.push(new A(r,t,n));else this.stack.push(new A(e,t,n));return this}};function J(a){let e=typeof a;if(e=="object"){if(Array.isArray(a))return"array";if(a===null)return"null"}return e}function kn(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}var U="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),X=[];for(let a=0;a>4,f=i,r=2;break;case 2:t[n++]=(f&15)<<4|(i&60)>>2,f=i,r=3;break;case 3:t[n++]=(f&3)<<6|i,r=0;break}}if(r==1)throw Error("invalid base64 string.");return t.subarray(0,n)}function Rn(a){let e="",t=0,n,r=0;for(let i=0;i>2],r=(n&3)<<4,t=1;break;case 1:e+=U[r|n>>4],r=(n&15)<<2,t=2;break;case 2:e+=U[r|n>>6],e+=U[n&63],t=0;break}return t&&(e+=U[r],e+="=",t==1&&(e+="=")),e}var c;(function(a){a.symbol=Symbol.for("protobuf-ts/unknown"),a.onRead=(t,n,r,i,f)=>{(e(n)?n[a.symbol]:n[a.symbol]=[]).push({no:r,wireType:i,data:f})},a.onWrite=(t,n,r)=>{for(let{no:i,wireType:f,data:s}of a.list(n))r.tag(i,f).raw(s)},a.list=(t,n)=>{if(e(t)){let r=t[a.symbol];return n?r.filter(i=>i.no==n):r}return[]},a.last=(t,n)=>a.list(t,n).slice(-1)[0];let e=t=>t&&Array.isArray(t[a.symbol])})(c||(c={}));var p;(function(a){a[a.Varint=0]="Varint",a[a.Bit64=1]="Bit64",a[a.LengthDelimited=2]="LengthDelimited",a[a.StartGroup=3]="StartGroup",a[a.EndGroup=4]="EndGroup",a[a.Bit32=5]="Bit32"})(p||(p={}));function In(){let a=0,e=0;for(let n=0;n<28;n+=7){let r=this.buf[this.pos++];if(a|=(r&127)<>4,(t&128)==0)return this.assertBounds(),[a,e];for(let n=3;n<=31;n+=7){let r=this.buf[this.pos++];if(e|=(r&127)<>>i,s=!(!(f>>>7)&&e==0),o=(s?f|128:f)&255;if(t.push(o),!s)return}let n=a>>>28&15|(e&7)<<4,r=e>>3!=0;if(t.push((r?n|128:n)&255),!!r){for(let i=3;i<31;i=i+7){let f=e>>>i,s=!!(f>>>7),o=(s?f|128:f)&255;if(t.push(o),!s)return}t.push(e>>>31&1)}}var Y=65536*65536;function ge(a){let e=a[0]=="-";e&&(a=a.slice(1));let t=1e6,n=0,r=0;function i(f,s){let o=Number(a.slice(f,s));r*=t,n=n*t+o,n>=Y&&(r=r+(n/Y|0),n=n%Y)}return i(-24,-18),i(-18,-12),i(-12,-6),i(-6),[e,n,r]}function z(a,e){if(e>>>0<=2097151)return""+(Y*e+(a>>>0));let t=a&16777215,n=(a>>>24|e<<8)>>>0&16777215,r=e>>16&65535,i=t+n*6777216+r*6710656,f=n+r*8147497,s=r*2,o=1e7;i>=o&&(f+=Math.floor(i/o),i%=o),f>=o&&(s+=Math.floor(f/o),f%=o);function l(u,g){let b=u?String(u):"";return g?"0000000".slice(b.length)+b:b}return l(s,0)+l(f,s)+l(i,1)}function we(a,e){if(a>=0){for(;a>127;)e.push(a&127|128),a=a>>>7;e.push(a)}else{for(let t=0;t<9;t++)e.push(a&127|128),a=a>>7;e.push(1)}}function Nn(){let a=this.buf[this.pos++],e=a&127;if((a&128)==0)return this.assertBounds(),e;if(a=this.buf[this.pos++],e|=(a&127)<<7,(a&128)==0)return this.assertBounds(),e;if(a=this.buf[this.pos++],e|=(a&127)<<14,(a&128)==0)return this.assertBounds(),e;if(a=this.buf[this.pos++],e|=(a&127)<<21,(a&128)==0)return this.assertBounds(),e;a=this.buf[this.pos++],e|=(a&15)<<28;for(let t=5;(a&128)!==0&&t<10;t++)a=this.buf[this.pos++];if((a&128)!=0)throw new Error("invalid varint");return this.assertBounds(),e>>>0}var w;function ui(){let a=new DataView(new ArrayBuffer(8));w=globalThis.BigInt!==void 0&&typeof a.getBigInt64=="function"&&typeof a.getBigUint64=="function"&&typeof a.setBigInt64=="function"&&typeof a.setBigUint64=="function"?{MIN:BigInt("-9223372036854775808"),MAX:BigInt("9223372036854775807"),UMIN:BigInt("0"),UMAX:BigInt("18446744073709551615"),C:BigInt,V:a}:void 0}ui();function Tn(a){if(!a)throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support")}var xn=/^-?[0-9]+$/,ee=4294967296,Q=2147483648,te=class{constructor(e,t){this.lo=e|0,this.hi=t|0}isZero(){return this.lo==0&&this.hi==0}toNumber(){let e=this.hi*ee+(this.lo>>>0);if(!Number.isSafeInteger(e))throw new Error("cannot convert to safe number");return e}},B=class a extends te{static from(e){if(w)switch(typeof e){case"string":if(e=="0")return this.ZERO;if(e=="")throw new Error("string is no integer");e=w.C(e);case"number":if(e===0)return this.ZERO;e=w.C(e);case"bigint":if(!e)return this.ZERO;if(ew.UMAX)throw new Error("ulong too large");return w.V.setBigUint64(0,e,!0),new a(w.V.getInt32(0,!0),w.V.getInt32(4,!0))}else switch(typeof e){case"string":if(e=="0")return this.ZERO;if(e=e.trim(),!xn.test(e))throw new Error("string is no integer");let[t,n,r]=ge(e);if(t)throw new Error("signed value for ulong");return new a(n,r);case"number":if(e==0)return this.ZERO;if(!Number.isSafeInteger(e))throw new Error("number is no integer");if(e<0)throw new Error("signed value for ulong");return new a(e,e/ee)}throw new Error("unknown value "+typeof e)}toString(){return w?this.toBigInt().toString():z(this.lo,this.hi)}toBigInt(){return Tn(w),w.V.setInt32(0,this.lo,!0),w.V.setInt32(4,this.hi,!0),w.V.getBigUint64(0,!0)}};B.ZERO=new B(0,0);var k=class a extends te{static from(e){if(w)switch(typeof e){case"string":if(e=="0")return this.ZERO;if(e=="")throw new Error("string is no integer");e=w.C(e);case"number":if(e===0)return this.ZERO;e=w.C(e);case"bigint":if(!e)return this.ZERO;if(ew.MAX)throw new Error("signed long too large");return w.V.setBigInt64(0,e,!0),new a(w.V.getInt32(0,!0),w.V.getInt32(4,!0))}else switch(typeof e){case"string":if(e=="0")return this.ZERO;if(e=e.trim(),!xn.test(e))throw new Error("string is no integer");let[t,n,r]=ge(e);if(t){if(r>Q||r==Q&&n!=0)throw new Error("signed long too small")}else if(r>=Q)throw new Error("signed long too large");let i=new a(n,r);return t?i.negate():i;case"number":if(e==0)return this.ZERO;if(!Number.isSafeInteger(e))throw new Error("number is no integer");return e>0?new a(e,e/ee):new a(-e,-e/ee).negate()}throw new Error("unknown value "+typeof e)}isNegative(){return(this.hi&Q)!==0}negate(){let e=~this.hi,t=this.lo;return t?t=~t+1:e+=1,new a(t,e)}toString(){if(w)return this.toBigInt().toString();if(this.isNegative()){let e=this.negate();return"-"+z(e.lo,e.hi)}return z(this.lo,this.hi)}toBigInt(){return Tn(w),w.V.setInt32(0,this.lo,!0),w.V.setInt32(4,this.hi,!0),w.V.getBigInt64(0,!0)}};k.ZERO=new k(0,0);var On={readUnknownField:!0,readerFactory:a=>new ke(a)};function Un(a){return a?Object.assign(Object.assign({},On),a):On}var ke=class{constructor(e,t){this.varint64=In,this.uint32=Nn,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.textDecoder=t??new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0})}tag(){let e=this.uint32(),t=e>>>3,n=e&7;if(t<=0||n<0||n>5)throw new Error("illegal tag: field no "+t+" wire type "+n);return[t,n]}skip(e){let t=this.pos;switch(e){case p.Varint:for(;this.buf[this.pos++]&128;);break;case p.Bit64:this.pos+=4;case p.Bit32:this.pos+=4;break;case p.LengthDelimited:let n=this.uint32();this.pos+=n;break;case p.StartGroup:let r;for(;(r=this.tag()[1])!==p.EndGroup;)this.skip(r);break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(t,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return new k(...this.varint64())}uint64(){return new B(...this.varint64())}sint64(){let[e,t]=this.varint64(),n=-(e&1);return e=(e>>>1|(t&1)<<31)^n,t=t>>>1^n,new k(e,t)}bool(){let[e,t]=this.varint64();return e!==0||t!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return new B(this.sfixed32(),this.sfixed32())}sfixed64(){return new k(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(){return this.textDecoder.decode(this.bytes())}};function h(a,e){if(!a)throw new Error(e)}var ci=34028234663852886e22,di=-34028234663852886e22,yi=4294967295,mi=2147483647,hi=-2147483648;function P(a){if(typeof a!="number")throw new Error("invalid int 32: "+typeof a);if(!Number.isInteger(a)||a>mi||ayi||a<0)throw new Error("invalid uint 32: "+a)}function V(a){if(typeof a!="number")throw new Error("invalid float 32: "+typeof a);if(Number.isFinite(a)&&(a>ci||anew Be};function Wn(a){return a?Object.assign(Object.assign({},Pn),a):Pn}var Be=class{constructor(e){this.stack=[],this.textEncoder=e??new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let e=0;for(let r=0;r>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(W(e);e>127;)this.buf.push(e&127|128),e=e>>>7;return this.buf.push(e),this}int32(e){return P(e),we(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let t=this.textEncoder.encode(e);return this.uint32(t.byteLength),this.raw(t)}float(e){V(e);let t=new Uint8Array(4);return new DataView(t.buffer).setFloat32(0,e,!0),this.raw(t)}double(e){let t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!0),this.raw(t)}fixed32(e){W(e);let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),this.raw(t)}sfixed32(e){P(e);let t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,e,!0),this.raw(t)}sint32(e){return P(e),e=(e<<1^e>>31)>>>0,we(e,this.buf),this}sfixed64(e){let t=new Uint8Array(8),n=new DataView(t.buffer),r=k.from(e);return n.setInt32(0,r.lo,!0),n.setInt32(4,r.hi,!0),this.raw(t)}fixed64(e){let t=new Uint8Array(8),n=new DataView(t.buffer),r=B.from(e);return n.setInt32(0,r.lo,!0),n.setInt32(4,r.hi,!0),this.raw(t)}int64(e){let t=k.from(e);return Z(t.lo,t.hi,this.buf),this}sint64(e){let t=k.from(e),n=t.hi>>31,r=t.lo<<1^n,i=(t.hi<<1|t.lo>>>31)^n;return Z(r,i,this.buf),this}uint64(e){let t=B.from(e);return Z(t.lo,t.hi,this.buf),this}};var Vn={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0},Cn={ignoreUnknownFields:!1};function En(a){return a?Object.assign(Object.assign({},Cn),a):Cn}function Sn(a){return a?Object.assign(Object.assign({},Vn),a):Vn}var ne=Symbol.for("protobuf-ts/message-type");function Re(a){let e=!1,t=[];for(let n=0;n!r.includes(f))||!n&&r.some(f=>!i.known.includes(f)))return!1;if(t<1)return!0;for(let f of i.oneofs){let s=e[f];if(!Dn(s))return!1;if(s.oneofKind===void 0)continue;let o=this.fields.find(l=>l.localName===s.oneofKind);if(!o||!this.field(s[s.oneofKind],o,n,t))return!1}for(let f of this.fields)if(f.oneof===void 0&&!this.field(e[f.localName],f,n,t))return!1;return!0}field(e,t,n,r){let i=t.repeat;switch(t.kind){case"scalar":return e===void 0?t.opt:i?this.scalars(e,t.T,r,t.L):this.scalar(e,t.T,t.L);case"enum":return e===void 0?t.opt:i?this.scalars(e,d.INT32,r):this.scalar(e,d.INT32);case"message":return e===void 0?!0:i?this.messages(e,t.T(),n,r):this.message(e,t.T(),n,r);case"map":if(typeof e!="object"||e===null)return!1;if(r<2)return!0;if(!this.mapKeys(e,t.K,r))return!1;switch(t.V.kind){case"scalar":return this.scalars(Object.values(e),t.V.T,r,t.V.L);case"enum":return this.scalars(Object.values(e),d.INT32,r);case"message":return this.messages(Object.values(e),t.V.T(),n,r)}break}return!0}message(e,t,n,r){return n?t.isAssignable(e,r):t.is(e,r)}messages(e,t,n,r){if(!Array.isArray(e))return!1;if(r<2)return!0;if(n){for(let i=0;iparseInt(i)),t,n);case d.BOOL:return this.scalars(r.slice(0,n).map(i=>i=="true"?!0:i=="false"?!1:i),t,n);default:return this.scalars(r,t,n,I.STRING)}}};function N(a,e){switch(e){case I.BIGINT:return a.toBigInt();case I.NUMBER:return a.toNumber();default:return a.toString()}}var re=class{constructor(e){this.info=e}prepare(){var e;if(this.fMap===void 0){this.fMap={};let t=(e=this.info.fields)!==null&&e!==void 0?e:[];for(let n of t)this.fMap[n.name]=n,this.fMap[n.jsonName]=n,this.fMap[n.localName]=n}}assert(e,t,n){if(!e){let r=J(n);throw(r=="number"||r=="boolean")&&(r=n.toString()),new Error(`Cannot parse JSON ${r} for ${this.info.typeName}#${t}`)}}read(e,t,n){this.prepare();let r=[];for(let[i,f]of Object.entries(e)){let s=this.fMap[i];if(!s){if(!n.ignoreUnknownFields)throw new Error(`Found unknown field while reading ${this.info.typeName} from JSON format. JSON key: ${i}`);continue}let o=s.localName,l;if(s.oneof){if(f===null&&(s.kind!=="enum"||s.T()[0]!=="google.protobuf.NullValue"))continue;if(r.includes(s.oneof))throw new Error(`Multiple members of the oneof group "${s.oneof}" of ${this.info.typeName} are present in JSON.`);r.push(s.oneof),l=t[s.oneof]={oneofKind:o}}else l=t;if(s.kind=="map"){if(f===null)continue;this.assert(kn(f),s.name,f);let u=l[o];for(let[g,b]of Object.entries(f)){this.assert(b!==null,s.name+" map value",null);let x;switch(s.V.kind){case"message":x=s.V.T().internalJsonRead(b,n);break;case"enum":if(x=this.enum(s.V.T(),b,s.name,n.ignoreUnknownFields),x===!1)continue;break;case"scalar":x=this.scalar(b,s.V.T,s.V.L,s.name);break}this.assert(x!==void 0,s.name+" map value",b);let O=g;s.K==d.BOOL&&(O=O=="true"?!0:O=="false"?!1:O),O=this.scalar(O,s.K,I.STRING,s.name).toString(),u[O]=x}}else if(s.repeat){if(f===null)continue;this.assert(Array.isArray(f),s.name,f);let u=l[o];for(let g of f){this.assert(g!==null,s.name,null);let b;switch(s.kind){case"message":b=s.T().internalJsonRead(g,n);break;case"enum":if(b=this.enum(s.T(),g,s.name,n.ignoreUnknownFields),b===!1)continue;break;case"scalar":b=this.scalar(g,s.T,s.L,s.name);break}this.assert(b!==void 0,s.name,f),u.push(b)}}else switch(s.kind){case"message":if(f===null&&s.T().typeName!="google.protobuf.Value"){this.assert(s.oneof===void 0,s.name+" (oneof member)",null);continue}l[o]=s.T().internalJsonRead(f,n,l[o]);break;case"enum":if(f===null)continue;let u=this.enum(s.T(),f,s.name,n.ignoreUnknownFields);if(u===!1)continue;l[o]=u;break;case"scalar":if(f===null)continue;l[o]=this.scalar(f,s.T,s.L,s.name);break}}}enum(e,t,n,r){if(e[0]=="google.protobuf.NullValue"&&h(t===null||t==="NULL_VALUE",`Unable to parse field ${this.info.typeName}#${n}, enum ${e[0]} only accepts null.`),t===null)return 0;switch(typeof t){case"number":return h(Number.isInteger(t),`Unable to parse field ${this.info.typeName}#${n}, enum can only be integral number, got ${t}.`),t;case"string":let i=t;e[2]&&t.substring(0,e[2].length)===e[2]&&(i=t.substring(e[2].length));let f=e[1][i];return typeof f>"u"&&r?!1:(h(typeof f=="number",`Unable to parse field ${this.info.typeName}#${n}, enum ${e[0]} has no value for "${t}".`),f)}h(!1,`Unable to parse field ${this.info.typeName}#${n}, cannot parse enum value from ${typeof t}".`)}scalar(e,t,n,r){let i;try{switch(t){case d.DOUBLE:case d.FLOAT:if(e===null)return 0;if(e==="NaN")return Number.NaN;if(e==="Infinity")return Number.POSITIVE_INFINITY;if(e==="-Infinity")return Number.NEGATIVE_INFINITY;if(e===""){i="empty string";break}if(typeof e=="string"&&e.trim().length!==e.length){i="extra whitespace";break}if(typeof e!="string"&&typeof e!="number")break;let f=Number(e);if(Number.isNaN(f)){i="not a number";break}if(!Number.isFinite(f)){i="too large or small";break}return t==d.FLOAT&&V(f),f;case d.INT32:case d.FIXED32:case d.SFIXED32:case d.SINT32:case d.UINT32:if(e===null)return 0;let s;if(typeof e=="number"?s=e:e===""?i="empty string":typeof e=="string"&&(e.trim().length!==e.length?i="extra whitespace":s=Number(e)),s===void 0)break;return t==d.UINT32?W(s):P(s),s;case d.INT64:case d.SFIXED64:case d.SINT64:if(e===null)return N(k.ZERO,n);if(typeof e!="number"&&typeof e!="string")break;return N(k.from(e),n);case d.FIXED64:case d.UINT64:if(e===null)return N(B.ZERO,n);if(typeof e!="number"&&typeof e!="string")break;return N(B.from(e),n);case d.BOOL:if(e===null)return!1;if(typeof e!="boolean")break;return e;case d.STRING:if(e===null)return"";if(typeof e!="string"){i="extra whitespace";break}try{encodeURIComponent(e)}catch(o){o="invalid UTF8";break}return e;case d.BYTES:if(e===null||e==="")return new Uint8Array(0);if(typeof e!="string")break;return Bn(e)}}catch(f){i=f.message}this.assert(!1,r+(i?" - "+i:""),e)}};var ae=class{constructor(e){var t;this.fields=(t=e.fields)!==null&&t!==void 0?t:[]}write(e,t){let n={},r=e;for(let i of this.fields){if(!i.oneof){let l=this.field(i,r[i.localName],t);l!==void 0&&(n[t.useProtoFieldName?i.name:i.jsonName]=l);continue}let f=r[i.oneof];if(f.oneofKind!==i.localName)continue;let s=i.kind=="scalar"||i.kind=="enum"?Object.assign(Object.assign({},t),{emitDefaultValues:!0}):t,o=this.field(i,f[i.localName],s);h(o!==void 0),n[t.useProtoFieldName?i.name:i.jsonName]=o}return n}field(e,t,n){let r;if(e.kind=="map"){h(typeof t=="object"&&t!==null);let i={};switch(e.V.kind){case"scalar":for(let[o,l]of Object.entries(t)){let u=this.scalar(e.V.T,l,e.name,!1,!0);h(u!==void 0),i[o.toString()]=u}break;case"message":let f=e.V.T();for(let[o,l]of Object.entries(t)){let u=this.message(f,l,e.name,n);h(u!==void 0),i[o.toString()]=u}break;case"enum":let s=e.V.T();for(let[o,l]of Object.entries(t)){h(l===void 0||typeof l=="number");let u=this.enum(s,l,e.name,!1,!0,n.enumAsInteger);h(u!==void 0),i[o.toString()]=u}break}(n.emitDefaultValues||Object.keys(i).length>0)&&(r=i)}else if(e.repeat){h(Array.isArray(t));let i=[];switch(e.kind){case"scalar":for(let o=0;o0||n.emitDefaultValues)&&(r=i)}else switch(e.kind){case"scalar":r=this.scalar(e.T,t,e.name,e.opt,n.emitDefaultValues);break;case"enum":r=this.enum(e.T(),t,e.name,e.opt,n.emitDefaultValues,n.enumAsInteger);break;case"message":r=this.message(e.T(),t,e.name,n);break}return r}enum(e,t,n,r,i,f){if(e[0]=="google.protobuf.NullValue")return!i&&!r?void 0:null;if(t===void 0){h(r);return}if(!(t===0&&!i&&!r))return h(typeof t=="number"),h(Number.isInteger(t)),f||!e[1].hasOwnProperty(t)?t:e[2]?e[2]+e[1][t]:e[1][t]}message(e,t,n,r){return t===void 0?r.emitDefaultValues?null:void 0:e.internalJsonWrite(t,r)}scalar(e,t,n,r,i){if(t===void 0){h(r);return}let f=i||r;switch(e){case d.INT32:case d.SFIXED32:case d.SINT32:return t===0?f?0:void 0:(P(t),t);case d.FIXED32:case d.UINT32:return t===0?f?0:void 0:(W(t),t);case d.FLOAT:V(t);case d.DOUBLE:return t===0?f?0:void 0:(h(typeof t=="number"),Number.isNaN(t)?"NaN":t===Number.POSITIVE_INFINITY?"Infinity":t===Number.NEGATIVE_INFINITY?"-Infinity":t);case d.STRING:return t===""?f?"":void 0:(h(typeof t=="string"),t);case d.BOOL:return t===!1?f?!1:void 0:(h(typeof t=="boolean"),t);case d.UINT64:case d.FIXED64:h(typeof t=="number"||typeof t=="string"||typeof t=="bigint");let s=B.from(t);return s.isZero()&&!f?void 0:s.toString();case d.INT64:case d.SFIXED64:case d.SINT64:h(typeof t=="number"||typeof t=="string"||typeof t=="bigint");let o=k.from(t);return o.isZero()&&!f?void 0:o.toString();case d.BYTES:return h(t instanceof Uint8Array),t.byteLength?Rn(t):f?"":void 0}}};function M(a,e=I.STRING){switch(a){case d.BOOL:return!1;case d.UINT64:case d.FIXED64:return N(B.ZERO,e);case d.INT64:case d.SFIXED64:case d.SINT64:return N(k.ZERO,e);case d.DOUBLE:case d.FLOAT:return 0;case d.BYTES:return new Uint8Array(0);case d.STRING:return"";default:return 0}}var se=class{constructor(e){this.info=e}prepare(){var e;if(!this.fieldNoToField){let t=(e=this.info.fields)!==null&&e!==void 0?e:[];this.fieldNoToField=new Map(t.map(n=>[n.no,n]))}}read(e,t,n,r){this.prepare();let i=r===void 0?e.len:e.pos+r;for(;e.post.no-n.no)}}write(e,t,n){this.prepare();for(let i of this.fields){let f,s,o=i.repeat,l=i.localName;if(i.oneof){let u=e[i.oneof];if(u.oneofKind!==l)continue;f=u[l],s=!0}else f=e[l],s=!1;switch(i.kind){case"scalar":case"enum":let u=i.kind=="enum"?d.INT32:i.T;if(o)if(h(Array.isArray(f)),o==L.PACKED)this.packed(t,u,i.no,f);else for(let g of f)this.scalar(t,u,i.no,g,!0);else f===void 0?h(i.opt):this.scalar(t,u,i.no,f,s||i.opt);break;case"message":if(o){h(Array.isArray(f));for(let g of f)this.message(t,n,i.T(),i.no,g)}else this.message(t,n,i.T(),i.no,f);break;case"map":h(typeof f=="object"&&f!==null);for(let[g,b]of Object.entries(f))this.mapEntry(t,n,i,g,b);break}}let r=n.writeUnknownFields;r!==!1&&(r===!0?c.onWrite:r)(this.info.typeName,e,t)}mapEntry(e,t,n,r,i){e.tag(n.no,p.LengthDelimited),e.fork();let f=r;switch(n.K){case d.INT32:case d.FIXED32:case d.UINT32:case d.SFIXED32:case d.SINT32:f=Number.parseInt(r);break;case d.BOOL:h(r=="true"||r=="false"),f=r=="true";break}switch(this.scalar(e,n.K,1,f,!0),n.V.kind){case"scalar":this.scalar(e,n.V.T,2,i,!0);break;case"enum":this.scalar(e,d.INT32,2,i,!0);break;case"message":this.message(e,t,n.V.T(),2,i);break}e.join()}message(e,t,n,r,i){i!==void 0&&(n.internalBinaryWrite(i,e.tag(r,p.LengthDelimited).fork(),t),e.join())}scalar(e,t,n,r,i){let[f,s,o]=this.scalarInfo(t,r);(!o||i)&&(e.tag(n,f),e[s](r))}packed(e,t,n,r){if(!r.length)return;h(t!==d.BYTES&&t!==d.STRING),e.tag(n,p.LengthDelimited),e.fork();let[,i]=this.scalarInfo(t);for(let f=0;f(n[n.DYN_NONE=0]="DYN_NONE",n[n.AD=15]="AD",n[n.LIVE_RCMD=18]="LIVE_RCMD",n))(Ve||{}),xe=class extends m{constructor(){super("bilibili.app.dynamic.v2.DynAllReply",[{no:1,name:"dynamic_list",kind:"message",T:()=>Ie},{no:2,name:"up_list",kind:"message",T:()=>Te},{no:3,name:"topic_list",kind:"scalar",opt:!0,T:12}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&y(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),f=e.pos+t;for(;e.posNe}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.list=[],e!==void 0&&y(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),f=e.pos+t;for(;e.pos["bilibili.app.dynamic.v2.DynamicType",Ve]}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.cardType=0,e!==void 0&&y(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),f=e.pos+t;for(;e.posC},{no:4,name:"show_live_num",kind:"scalar",T:5},{no:10,name:"list_second",kind:"message",repeat:2,T:()=>C}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.list=[],t.showLiveNum=0,t.listSecond=[],e!==void 0&&y(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),f=e.pos+t;for(;e.posfe}}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.arcConfs={},e!==void 0&&y(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),f=e.pos+t;for(;e.posEe},{no:4,name:"unsupport_scene",kind:"scalar",repeat:1,T:5}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.isSupport=!1,t.disabled=!1,t.unsupportScene=[],e!==void 0&&y(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),f=e.pos+t;for(;e.pospe},{no:9,name:"view_info",kind:"message",T:()=>ue}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&y(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),f=e.pos+t;for(;e.pos$e}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&y(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),f=e.pos+t;for(;e.posE},{no:3,name:"cast_conf",kind:"message",T:()=>E}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&y(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),f=e.pos+t;for(;e.posje},{no:4,name:"unsupport_scene",kind:"scalar",repeat:1,T:3}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.isSupport=!1,t.disabled=!1,t.unsupportScene=[],e!==void 0&&y(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),f=e.pos+t;for(;e.posHe},{no:10,name:"rcmd_one_item",kind:"scalar",oneof:"item",T:12},{no:11,name:"small_cover_v5_ad",kind:"scalar",oneof:"item",T:12},{no:12,name:"topic_list",kind:"scalar",oneof:"item",T:12}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.item={oneofKind:void 0},e!==void 0&&y(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),f=e.pos+t;for(;e.posJe}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&y(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),f=e.pos+t;for(;e.posce}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.items=[],e!==void 0&&y(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),f=e.pos+t;for(;e.poset},{no:10,name:"relates",kind:"message",repeat:2,T:()=>S},{no:23,name:"label",kind:"scalar",opt:!0,T:12},{no:30,name:"cms",kind:"scalar",repeat:2,T:12},{no:31,name:"cm_config",kind:"scalar",opt:!0,T:12},{no:41,name:"cm_ipad",kind:"scalar",opt:!0,T:12},{no:50,name:"special_cell_new",kind:"scalar",repeat:2,T:12}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.relates=[],t.cms=[],t.specialCellNew=[],e!==void 0&&y(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),f=e.pos+t;for(;e.postt}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&y(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),f=e.pos+t;for(;e.posS}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.list=[],e!==void 0&&y(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),f=e.pos+t;for(;e.pos(t[t.TAB_NONE=0]="TAB_NONE",t[t.TAB_INTRODUCTION=1]="TAB_INTRODUCTION",t))(_n||{}),Et=(o=>(o[o.UNKNOWN=0]="UNKNOWN",o[o.UGC_HEADLINE=3]="UGC_HEADLINE",o[o.ACTIVITY=18]="ACTIVITY",o[o.RELATED_RECOMMEND=28]="RELATED_RECOMMEND",o[o.PAY_BAR=29]="PAY_BAR",o[o.SPECIALTAG=37]="SPECIALTAG",o[o.MERCHANDISE=55]="MERCHANDISE",o[o.VIDEO_MENTIONS=63]="VIDEO_MENTIONS",o))(Et||{}),St=(s=>(s[s.CARD_TYPE_UNKNOWN=0]="CARD_TYPE_UNKNOWN",s[s.AV=1]="AV",s[s.GAME=4]="GAME",s[s.CM_TYPE=5]="CM_TYPE",s[s.LIVE=6]="LIVE",s[s.AI_RECOMMEND=7]="AI_RECOMMEND",s[s.COURSE=11]="COURSE",s))(St||{}),kt=class extends m{constructor(){super("bilibili.app.viewunite.v1.ViewReply",[{no:3,name:"req_user",kind:"message",T:()=>ut},{no:5,name:"tab",kind:"message",T:()=>ct},{no:7,name:"cm",kind:"scalar",opt:!0,T:12}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&y(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),f=e.pos+t;for(;e.posdt}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.tabModule=[],e!==void 0&&y(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),f=e.pos+t;for(;e.pos["bilibili.app.viewunite.v1.TabType",_n]},{no:2,name:"introduction",kind:"message",oneof:"tab",T:()=>yt}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.tabType=0,t.tab={oneofKind:void 0},e!==void 0&&y(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),f=e.pos+t;for(;e.posmt}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.modules=[],e!==void 0&&y(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),f=e.pos+t;for(;e.pos["bilibili.app.viewunite.v1.ModuleType",Et]},{no:5,name:"head_line",kind:"message",oneof:"data",T:()=>ht},{no:22,name:"relates",kind:"message",oneof:"data",T:()=>bt}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.type=0,t.data={oneofKind:void 0},e!==void 0&&y(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),f=e.pos+t;for(;e.posF}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.cards=[],e!==void 0&&y(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),f=e.pos+t;for(;e.pos["bilibili.app.viewunite.v1.RelateCardType",St]},{no:11,name:"cm_stock",kind:"scalar",T:12},{no:12,name:"basic_info",kind:"message",T:()=>gt}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.relateCardType=0,t.cmStock=new Uint8Array(0),e!==void 0&&y(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),f=e.pos+t;for(;e.poswt},{no:4,name:"dm",kind:"scalar",opt:!0,T:12}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&y(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),f=e.pos+t;for(;e.posF}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.relates=[],e!==void 0&&y(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),f=e.pos+t;for(;e.posLt},{no:25,name:"qoe",kind:"scalar",opt:!0,T:12}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.activityMeta=[],e!==void 0&&y(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),f=e.pos+t;for(;e.pos(o[o.UNKNOWN=0]="UNKNOWN",o[o.OGV_GRADE=1]="OGV_GRADE",o[o.UP_PROTECTION=2]="UP_PROTECTION",o[o.CM=3]="CM",o[o.UP_SELECTION=4]="UP_SELECTION",o[o.OPERATION=5]="OPERATION",o[o.VOTE=6]="VOTE",o[o.ESPORTS_GRADE=7]="ESPORTS_GRADE",o))(Yt||{}),Kt=class extends m{constructor(){super("bilibili.main.community.reply.v1.MainListReply",[{no:11,name:"cm",kind:"scalar",opt:!0,T:12},{no:14,name:"top_replies",kind:"message",repeat:2,T:()=>vt},{no:28,name:"subject_top_cards",kind:"message",repeat:2,T:()=>qt}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.topReplies=[],t.subjectTopCards=[],e!==void 0&&y(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),f=e.pos+t;for(;e.pos_t}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&y(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),f=e.pos+t;for(;e.posde}}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.message="",t.urls={},e!==void 0&&y(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),f=e.pos+t;for(;e.pos["bilibili.main.community.reply.v1.Type",Yt]}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.type=0,e!==void 0&&y(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),f=e.pos+t;for(;e.poszt},{no:6,name:"play_ext_conf",kind:"message",T:()=>Qt}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&y(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),f=e.pos+t;for(;e.posen}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.allowCloseSubtitle=!1,e!==void 0&&y(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),f=e.pos+t;for(;e.poson}])}create(e){let t=globalThis.Object.create(this.messagePrototype);return t.item=[],e!==void 0&&y(this,t,e),t}internalBinaryRead(e,t,n,r){let i=r??this.create(),f=e.pos+t;for(;e.pos{let{displayUpList:t}=a.argument,n=Ce.fromBinary(a.response.bodyBytes);if(n.topicList=void 0,n.dynamicList){let r=[15,18];n.dynamicList.list=n.dynamicList.list.filter(i=>!r.includes(i.cardType))}return gi(n,t),a.response.bodyBytes=Ce.toBinary(n),e()};function gi(a,e){if(e==="show"||dn().startsWith("iPad"))return;if(e==="hide"||!a.upList?.showLiveNum){a.upList=void 0;return}let{list:t,listSecond:n}=a.upList,r=n.at(-1);r&&(r.separator=!0,a.upList.list=[...n,...t],n.length=0)}var Kn=(a,e)=>{let t=Me.fromBinary(a.response.bodyBytes);return t.viewInfo&&(t.viewInfo.promptBar=void 0),t.playArcConf?.arcConfs&&Object.values(t.playArcConf.arcConfs).forEach(n=>{n.isSupport&&n.disabled&&(n.disabled=!1,n.extraContent=void 0,n.unsupportScene.length=0)}),a.response.bodyBytes=Me.toBinary(t),e()},Gn=(a,e)=>{let t=Ge.fromBinary(a.response.bodyBytes),{backgroundPlayConf:n,castConf:r}=t.playArc||{};return[n,r].forEach(i=>{i&&(!i.isSupport||i.disabled)&&(i.isSupport=!0,i.disabled=!1,i.extraContent=void 0,i.unsupportScene.length=0)}),a.response.bodyBytes=Ge.toBinary(t),e()},Hn=(a,e)=>{let t=Qe.fromBinary(a.response.bodyBytes),n=["rcmdOneItem","smallCoverV5Ad","topicList"];return t.items=t.items.filter(r=>{if(r.item.oneofKind==="smallCoverV5"){let i=r.item.smallCoverV5;return i.base?.fromType==="recommend"&&!i.base.adInfo.length}return!n.includes(r.item.oneofKind)}),a.response.bodyBytes=Qe.toBinary(t),e()},Jn=(a,e)=>{let t=lt.fromBinary(a.response.bodyBytes);return t.label=void 0,t.cmIpad=void 0,t.cmConfig=void 0,t.reqUser&&(t.reqUser.elecPlusBtn=void 0),t.cms.length=0,t.specialCellNew.length=0,t.relates=t.relates.filter(n=>!n.cm.length),a.response.bodyBytes=lt.toBinary(t),e()},Xn=(a,e)=>{let{sponsorBlock:t}=a.argument,n=ft.fromBinary(a.response.bodyBytes);return n.videoGuide=void 0,zn(t)&&n.chronos&&Qn(n.chronos,a.request.headers),a.response.bodyBytes=ft.toBinary(n),e()},Yn=(a,e)=>{let t=pt.fromBinary(a.response.bodyBytes);return t.list=t.list.filter(n=>!n.cm.length),a.response.bodyBytes=pt.toBinary(t),e()},Zn=(a,e)=>{let{sponsorBlock:t}=a.argument,n=Dt.fromBinary(a.response.bodyBytes);return n.dm=void 0,zn(t)&&n.chronos&&Qn(n.chronos,a.request.headers),a.response.bodyBytes=Dt.toBinary(n),e()};function zn(a){return!!(a&&a!=="#")}function Qn(a,e){let t=wi(),n=t[a.md5];n||(n=t[ki(e)],T.warn(`MD5 mismatch detected. Received: ${a.md5}; File: ${a.file}.`,"Please update the app or script to the latest version.","If you are already using the latest version, please contact the author for adjustments.")),a.md5=n,a.file=`https://raw.githubusercontent.com/kokoryh/chronos/refs/heads/master/${n}.zip`,a.sign=void 0}function wi(){return{universal:"e5a968f1a5055bbe5c12e67b100a6dcb",hd:"f993a054969a4f6ae6b20a65f1292e47",inter:"8c3feda2e92bf60e8a7aeade1a231586","45b564f5ba1fdd3746406937059addd8":"e5a968f1a5055bbe5c12e67b100a6dcb",c29bd8f2b64a8f57f49c3622c0f763db:"ecca73e42e160074e0caf4b3ddb54a52",c218977c14e5dfdafd51edf3ae49ed02:"f993a054969a4f6ae6b20a65f1292e47","8232ffb6ee43b687b5fe5add5b3e97de":"feaca416bbc1174b8e935cf87ff8f0b5","325e7073ffc6fb5263682fecdcd1058f":"932002070dc1b51241198a074d2279fc","3a14beddd23328eaddfe9f0eb048d713":"8c3feda2e92bf60e8a7aeade1a231586"}}function ki(a){let e=a["user-agent"]||a["User-Agent"]||"",t="universal";return e.startsWith("bili-hd")?t="hd":e.startsWith("bili-inter")&&(t="inter"),t}var ei=(a,e)=>{let t=At.fromBinary(a.response.bodyBytes);return t.relates=ni(t.relates),a.response.bodyBytes=At.toBinary(t),e()},ti=(a,e)=>{let t=Ft.fromBinary(a.response.bodyBytes);t.cm=void 0,t.reqUser&&(t.reqUser.elecPlusBtn=void 0);let n=[18,29,37,55,63];return t.tab?.tabModule.forEach(r=>{r.tab.oneofKind==="introduction"&&(r.tab.introduction.modules=r.tab.introduction.modules.filter(i=>n.includes(i.type)?!1:(i.type===3&&i.data.oneofKind==="headLine"?i.data.headLine.label=void 0:i.type===28&&i.data.oneofKind==="relates"&&(i.data.relates.cards=ni(i.data.relates.cards)),!0),[]))}),a.response.bodyBytes=Ft.toBinary(t),e()};function ni(a){let e=[4,5,6,7,11];return a.filter(t=>!e.includes(t.relateCardType)&&!t.cmStock.length&&!t.basicInfo?.uniqueId)}var ii=(a,e)=>{let t=jt.fromBinary(a.response.bodyBytes);return t.qoe=void 0,t.activityMeta.length=0,t.command?.commandDms.length&&(t.command.commandDms.length=0),a.response.bodyBytes=jt.toBinary(t),e()},ri=(a,e)=>{let{purifyComment:t}=a.argument,n=Zt.fromBinary(a.response.bodyBytes);n.cm=void 0;let r=[3,5];if(n.subjectTopCards=n.subjectTopCards.filter(i=>!r.includes(i.type)),t){let i=/https:\/\/b23\.tv\/(?:cm|mall)/,f=/淘宝|某宝|天猫|京东|狗东|拼多多|饿了么|美团|转转|妙界|神气小鹿/;n.topReplies=n.topReplies.filter(s=>{let o=s.content?.urls||{},l=s.content?.message||"";return!Object.keys(o).some(u=>i.test(u))&&!i.test(l)&&!f.test(l)})}return a.response.bodyBytes=Zt.toBinary(n),e()},ai=(a,e)=>{let t=sn.fromBinary(a.response.bodyBytes);return t.viewInfo&&(t.viewInfo.tryWatchPromptBar=void 0),t.playExtConf?.castTips&&(t.playExtConf.castTips={code:0,message:""}),a.response.bodyBytes=sn.toBinary(t),e()},si=(a,e)=>{let t=pn.fromBinary(a.response.bodyBytes),n=/_ad_?/;return t.item=t.item.filter(r=>!n.test(r.linktype)),a.response.bodyBytes=pn.toBinary(t),e()};var R=new H({matchPath:wn});R.post("v2.Dynamic/DynAll",D,qn);R.post("playerunite.v1.Player/PlayViewUnite",Kn);R.post("playurl.v1.PlayURL/PlayView",Gn);R.post("v1.Popular/Index",Hn);R.post("view.v1.View/View",Jn);R.post("view.v1.View/ViewProgress",D,Xn);R.post("view.v1.View/RelatesFeed",Yn);R.post("viewunite.v1.View/ViewProgress",D,Zn);R.post("viewunite.v1.View/RelatesFeed",ei);R.post("viewunite.v1.View/View",ti);R.post("v1.DM/DmView",ii);R.post("v1.Reply/MainList",D,ri);R.post("v2.PlayURL/PlayView",ai);R.post("v1.Search/SearchAll",si);var un=new G;un.use(mn).use(gn).use(hn).use(R.routes()).use(R.routeNotMatched());un.run();