// 脚本引用 https://raw.githubusercontent.com/kokoryh/Sparkle/master/dist/bilibili.protobuf.response.js // Built at: 2025/10/16 22:12:06 function tn(){let a="";return typeof $environment<"u"&&$environment["device-model"]?a=$environment["device-model"]:typeof $loon<"u"&&(a=$loon),a.includes("iPad")}function nn(a){return typeof a!="object"||a===null?String(a):a instanceof Date?a.toISOString():a instanceof RegExp?a.toString():Array.isArray(a)?JSON.stringify(a):typeof a.toString=="function"&&a.toString!==Object.prototype.toString?a.toString():JSON.stringify(a)}var E=class a{static getInstance(e){let t="Surge";if(typeof $loon<"u")t="Loon";else if(typeof $task<"u")throw new Error("QuantumultX is not supported");return a.instances[t]||(a.instances[t]=a.classNames[t](e,t)),a.instances[t]}static classNames={Surge:(e,t)=>new v(e,t),Loon:(e,t)=>new Be(e,t)};static instances={};className;name;logLevels={debug:1,info:2,warn:3,error:4,off:5};logLevel=this.logLevels.error;request;response;argument;_url;get url(){return this._url||(this._url=new URL(this.request.url)),this._url}constructor(e,t){this.className=t??"",this.name=e??"",this.init()}createProxy(e){return new Proxy(e,{get:this.getFn,set:this.setFn})}getFn(e,t,n){return Reflect.get(e,t,n)}setFn(e,t,n,r){return Reflect.set(e,t,n,r),!0}setName(e){this.name=e}getJSON(e){let t=this.getVal(e);return t?JSON.parse(t):null}setJSON(e,t){this.setVal(JSON.stringify(e),t)}logWithPrefix(e,t){console.log(`${e}${t.map(n=>nn(n)).join(" | ")}`)}log(...e){this.logWithPrefix("",e)}debug(...e){this.logLevel>this.logLevels.debug||this.logWithPrefix("[DEBUG]",e)}info(...e){this.logLevel>this.logLevels.info||this.logWithPrefix("[INFO]",e)}warn(...e){this.logLevel>this.logLevels.warn||this.logWithPrefix("[WARN]",e)}error(...e){this.logLevel>this.logLevels.error||this.logWithPrefix("[ERROR]",e)}exit(){$done({})}},v=class a extends E{static propertyMap={bodyBytes:"body"};getFn(e,t,n){let r=a.propertyMap[t]||t;return super.getFn(e,r,n)}setFn(e,t,n,r){let i=a.propertyMap[t]||t;return super.setFn(e,i,n,r)}init(){typeof $request=="object"&&(this.request=this.createProxy($request)),typeof $response=="object"&&(this.response=this.createProxy($response)),typeof $argument=="string"&&(this.argument=JSON.parse($argument),"logLevel"in this.argument&&(this.logLevel=this.logLevels[this.argument.logLevel]??this.logLevels.error))}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,o)=>{$httpClient[t]({...i,body:n,"binary-mode":n instanceof Uint8Array,timeout:r},(s,l,p)=>{if(s)return o(s);let b=p instanceof Uint8Array?"bodyBytes":"body";f({status:l.status,headers:l.headers,[b]:p})})})}notify(e=this.name,t="",n="",r={}){let{openUrl:i,clipboard:f,mediaUrl:o,dismiss:s,sound:l=!0}=r,p={url:i,text:f,"media-url":o,"auto-dismiss":s,sound:l};i?p.action="open-url":f&&(p.action="clipboard"),$notification.post(e,t,n,p)}ungzip(e){return $utils.ungzip(e)}done(e){$done(e)}abort(){$done({abort:!0})}},Be=class extends v{init(){super.init(),typeof $argument=="object"&&(this.argument=$argument,"logLevel"in this.argument&&(this.logLevel=this.logLevels[this.argument.logLevel]??this.logLevels.error))}fetch(e){return e.timeout=(e.timeout??5)*1e3,super.fetch(e)}notify(e=this.name,t="",n="",r={}){let{openUrl:i,mediaUrl:f,clipboard:o,delay:s}=r,l={openUrl:i,mediaUrl:f,clipboard:o};$notification.post(e,t,n,l,s)}abort(){$done()}};var B=E.getInstance();function j(a){let e=typeof a;if(e=="object"){if(Array.isArray(a))return"array";if(a===null)return"null"}return e}function rn(a){return a!==null&&typeof a=="object"&&!Array.isArray(a)}var U="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),_=[];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 an(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 d;(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:o}of a.list(n))r.tag(i,f).raw(o)},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])})(d||(d={}));var c;(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"})(c||(c={}));function sn(){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,o=!(!(f>>>7)&&e==0),s=(o?f|128:f)&255;if(t.push(s),!o)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,o=!!(f>>>7),s=(o?f|128:f)&255;if(t.push(s),!o)return}t.push(e>>>31&1)}}var q=65536*65536;function Ie(a){let e=a[0]=="-";e&&(a=a.slice(1));let t=1e6,n=0,r=0;function i(f,o){let s=Number(a.slice(f,o));r*=t,n=n*t+s,n>=q&&(r=r+(n/q|0),n=n%q)}return i(-24,-18),i(-18,-12),i(-12,-6),i(-6),[e,n,r]}function G(a,e){if(e>>>0<=2097151)return""+(q*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,o=r*2,s=1e7;i>=s&&(f+=Math.floor(i/s),i%=s),f>=s&&(o+=Math.floor(f/s),f%=s);function l(p,b){let g=p?String(p):"";return b?"0000000".slice(g.length)+g:g}return l(o,0)+l(f,o)+l(i,1)}function Ne(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 ln(){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 Gn(){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}Gn();function fn(a){if(!a)throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support")}var cn=/^-?[0-9]+$/,X=4294967296,H=2147483648,J=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*X+(this.lo>>>0);if(!Number.isSafeInteger(e))throw new Error("cannot convert to safe number");return e}},R=class a extends J{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(),!cn.test(e))throw new Error("string is no integer");let[t,n,r]=Ie(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/X)}throw new Error("unknown value "+typeof e)}toString(){return w?this.toBigInt().toString():G(this.lo,this.hi)}toBigInt(){return fn(w),w.V.setInt32(0,this.lo,!0),w.V.setInt32(4,this.hi,!0),w.V.getBigUint64(0,!0)}};R.ZERO=new R(0,0);var k=class a extends J{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(),!cn.test(e))throw new Error("string is no integer");let[t,n,r]=Ie(e);if(t){if(r>H||r==H&&n!=0)throw new Error("signed long too small")}else if(r>=H)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/X):new a(-e,-e/X).negate()}throw new Error("unknown value "+typeof e)}isNegative(){return(this.hi&H)!==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"-"+G(e.lo,e.hi)}return G(this.lo,this.hi)}toBigInt(){return fn(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 pn={readUnknownField:!0,readerFactory:a=>new Te(a)};function un(a){return a?Object.assign(Object.assign({},pn),a):pn}var Te=class{constructor(e,t){this.varint64=sn,this.uint32=ln,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 c.Varint:for(;this.buf[this.pos++]&128;);break;case c.Bit64:this.pos+=4;case c.Bit32:this.pos+=4;break;case c.LengthDelimited:let n=this.uint32();this.pos+=n;break;case c.StartGroup:let r;for(;(r=this.tag()[1])!==c.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 R(...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 R(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 Hn=34028234663852886e22,Xn=-34028234663852886e22,Jn=4294967295,Yn=2147483647,Zn=-2147483648;function P(a){if(typeof a!="number")throw new Error("invalid int 32: "+typeof a);if(!Number.isInteger(a)||a>Yn||aJn||a<0)throw new Error("invalid uint 32: "+a)}function C(a){if(typeof a!="number")throw new Error("invalid float 32: "+typeof a);if(Number.isFinite(a)&&(a>Hn||anew xe};function yn(a){return a?Object.assign(Object.assign({},dn),a):dn}var xe=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),Ne(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){C(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,Ne(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=R.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 K(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 K(r,i,this.buf),this}uint64(e){let t=R.from(e);return K(t.lo,t.hi,this.buf),this}};var mn={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0},hn={ignoreUnknownFields:!1};function bn(a){return a?Object.assign(Object.assign({},hn),a):hn}function gn(a){return a?Object.assign(Object.assign({},mn),a):mn}var Y=Symbol.for("protobuf-ts/message-type");function Oe(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 o=e[f];if(!kn(o))return!1;if(o.oneofKind===void 0)continue;let s=this.fields.find(l=>l.localName===o.oneofKind);if(!s||!this.field(o[o.oneofKind],s,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,u.INT32,r):this.scalar(e,u.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),u.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 u.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 T(a,e){switch(e){case I.BIGINT:return a.toBigInt();case I.NUMBER:return a.toNumber();default:return a.toString()}}var z=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 o=this.fMap[i];if(!o){if(!n.ignoreUnknownFields)throw new Error(`Found unknown field while reading ${this.info.typeName} from JSON format. JSON key: ${i}`);continue}let s=o.localName,l;if(o.oneof){if(f===null&&(o.kind!=="enum"||o.T()[0]!=="google.protobuf.NullValue"))continue;if(r.includes(o.oneof))throw new Error(`Multiple members of the oneof group "${o.oneof}" of ${this.info.typeName} are present in JSON.`);r.push(o.oneof),l=t[o.oneof]={oneofKind:s}}else l=t;if(o.kind=="map"){if(f===null)continue;this.assert(rn(f),o.name,f);let p=l[s];for(let[b,g]of Object.entries(f)){this.assert(g!==null,o.name+" map value",null);let x;switch(o.V.kind){case"message":x=o.V.T().internalJsonRead(g,n);break;case"enum":if(x=this.enum(o.V.T(),g,o.name,n.ignoreUnknownFields),x===!1)continue;break;case"scalar":x=this.scalar(g,o.V.T,o.V.L,o.name);break}this.assert(x!==void 0,o.name+" map value",g);let O=b;o.K==u.BOOL&&(O=O=="true"?!0:O=="false"?!1:O),O=this.scalar(O,o.K,I.STRING,o.name).toString(),p[O]=x}}else if(o.repeat){if(f===null)continue;this.assert(Array.isArray(f),o.name,f);let p=l[s];for(let b of f){this.assert(b!==null,o.name,null);let g;switch(o.kind){case"message":g=o.T().internalJsonRead(b,n);break;case"enum":if(g=this.enum(o.T(),b,o.name,n.ignoreUnknownFields),g===!1)continue;break;case"scalar":g=this.scalar(b,o.T,o.L,o.name);break}this.assert(g!==void 0,o.name,f),p.push(g)}}else switch(o.kind){case"message":if(f===null&&o.T().typeName!="google.protobuf.Value"){this.assert(o.oneof===void 0,o.name+" (oneof member)",null);continue}l[s]=o.T().internalJsonRead(f,n,l[s]);break;case"enum":if(f===null)continue;let p=this.enum(o.T(),f,o.name,n.ignoreUnknownFields);if(p===!1)continue;l[s]=p;break;case"scalar":if(f===null)continue;l[s]=this.scalar(f,o.T,o.L,o.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 u.DOUBLE:case u.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==u.FLOAT&&C(f),f;case u.INT32:case u.FIXED32:case u.SFIXED32:case u.SINT32:case u.UINT32:if(e===null)return 0;let o;if(typeof e=="number"?o=e:e===""?i="empty string":typeof e=="string"&&(e.trim().length!==e.length?i="extra whitespace":o=Number(e)),o===void 0)break;return t==u.UINT32?W(o):P(o),o;case u.INT64:case u.SFIXED64:case u.SINT64:if(e===null)return T(k.ZERO,n);if(typeof e!="number"&&typeof e!="string")break;return T(k.from(e),n);case u.FIXED64:case u.UINT64:if(e===null)return T(R.ZERO,n);if(typeof e!="number"&&typeof e!="string")break;return T(R.from(e),n);case u.BOOL:if(e===null)return!1;if(typeof e!="boolean")break;return e;case u.STRING:if(e===null)return"";if(typeof e!="string"){i="extra whitespace";break}try{encodeURIComponent(e)}catch(s){s="invalid UTF8";break}return e;case u.BYTES:if(e===null||e==="")return new Uint8Array(0);if(typeof e!="string")break;return on(e)}}catch(f){i=f.message}this.assert(!1,r+(i?" - "+i:""),e)}};var Q=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 o=i.kind=="scalar"||i.kind=="enum"?Object.assign(Object.assign({},t),{emitDefaultValues:!0}):t,s=this.field(i,f[i.localName],o);h(s!==void 0),n[t.useProtoFieldName?i.name:i.jsonName]=s}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[s,l]of Object.entries(t)){let p=this.scalar(e.V.T,l,e.name,!1,!0);h(p!==void 0),i[s.toString()]=p}break;case"message":let f=e.V.T();for(let[s,l]of Object.entries(t)){let p=this.message(f,l,e.name,n);h(p!==void 0),i[s.toString()]=p}break;case"enum":let o=e.V.T();for(let[s,l]of Object.entries(t)){h(l===void 0||typeof l=="number");let p=this.enum(o,l,e.name,!1,!0,n.enumAsInteger);h(p!==void 0),i[s.toString()]=p}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 s=0;s0||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 u.INT32:case u.SFIXED32:case u.SINT32:return t===0?f?0:void 0:(P(t),t);case u.FIXED32:case u.UINT32:return t===0?f?0:void 0:(W(t),t);case u.FLOAT:C(t);case u.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 u.STRING:return t===""?f?"":void 0:(h(typeof t=="string"),t);case u.BOOL:return t===!1?f?!1:void 0:(h(typeof t=="boolean"),t);case u.UINT64:case u.FIXED64:h(typeof t=="number"||typeof t=="string"||typeof t=="bigint");let o=R.from(t);return o.isZero()&&!f?void 0:o.toString();case u.INT64:case u.SFIXED64:case u.SINT64:h(typeof t=="number"||typeof t=="string"||typeof t=="bigint");let s=k.from(t);return s.isZero()&&!f?void 0:s.toString();case u.BYTES:return h(t instanceof Uint8Array),t.byteLength?an(t):f?"":void 0}}};function F(a,e=I.STRING){switch(a){case u.BOOL:return!1;case u.UINT64:case u.FIXED64:return T(R.ZERO,e);case u.INT64:case u.SFIXED64:case u.SINT64:return T(k.ZERO,e);case u.DOUBLE:case u.FLOAT:return 0;case u.BYTES:return new Uint8Array(0);case u.STRING:return"";default:return 0}}var ee=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,o,s=i.repeat,l=i.localName;if(i.oneof){let p=e[i.oneof];if(p.oneofKind!==l)continue;f=p[l],o=!0}else f=e[l],o=!1;switch(i.kind){case"scalar":case"enum":let p=i.kind=="enum"?u.INT32:i.T;if(s)if(h(Array.isArray(f)),s==L.PACKED)this.packed(t,p,i.no,f);else for(let b of f)this.scalar(t,p,i.no,b,!0);else f===void 0?h(i.opt):this.scalar(t,p,i.no,f,o||i.opt);break;case"message":if(s){h(Array.isArray(f));for(let b of f)this.message(t,n,i.T(),i.no,b)}else this.message(t,n,i.T(),i.no,f);break;case"map":h(typeof f=="object"&&f!==null);for(let[b,g]of Object.entries(f))this.mapEntry(t,n,i,b,g);break}}let r=n.writeUnknownFields;r!==!1&&(r===!0?d.onWrite:r)(this.info.typeName,e,t)}mapEntry(e,t,n,r,i){e.tag(n.no,c.LengthDelimited),e.fork();let f=r;switch(n.K){case u.INT32:case u.FIXED32:case u.UINT32:case u.SFIXED32:case u.SINT32:f=Number.parseInt(r);break;case u.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,u.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,c.LengthDelimited).fork(),t),e.join())}scalar(e,t,n,r,i){let[f,o,s]=this.scalarInfo(t,r);(!s||i)&&(e.tag(n,f),e[o](r))}packed(e,t,n,r){if(!r.length)return;h(t!==u.BYTES&&t!==u.STRING),e.tag(n,c.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))(Le||{}),Ee=class extends m{constructor(){super("bilibili.app.dynamic.v2.DynAllReply",[{no:1,name:"dynamic_list",kind:"message",T:()=>Ue},{no:2,name:"up_list",kind:"message",T:()=>We},{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.posPe}])}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",Le]}])}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.posV},{no:4,name:"show_live_num",kind:"scalar",T:5},{no:10,name:"list_second",kind:"message",repeat:2,T:()=>V}])}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.posie}}])}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.posFe},{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.posre},{no:9,name:"view_info",kind:"message",T:()=>oe}])}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.posS},{no:3,name:"cast_conf",kind:"message",T:()=>S}])}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.posqe},{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.posJe},{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.posYe}])}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.posae}])}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.postt},{no:10,name:"relates",kind:"message",repeat:2,T:()=>nt},{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.posit}])}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(t[t.TAB_NONE=0]="TAB_NONE",t[t.TAB_INTRODUCTION=1]="TAB_INTRODUCTION",t))(Vn||{}),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))(Et||{}),Ct=(o=>(o[o.CARD_TYPE_UNKNOWN=0]="CARD_TYPE_UNKNOWN",o[o.AV=1]="AV",o[o.GAME=4]="GAME",o[o.CM_TYPE=5]="CM_TYPE",o[o.LIVE=6]="LIVE",o[o.AI_RECOMMEND=7]="AI_RECOMMEND",o[o.COURSE=11]="COURSE",o))(Ct||{}),gt=class extends m{constructor(){super("bilibili.app.viewunite.v1.ViewReply",[{no:3,name:"req_user",kind:"message",T:()=>ft},{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.pospt}])}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",Vn]},{no:2,name:"introduction",kind:"message",oneof:"tab",T:()=>ut}])}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.posdt}])}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:()=>yt},{no:22,name:"relates",kind:"message",oneof:"data",T:()=>mt}])}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.posA}])}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",Ct]},{no:11,name:"cm_stock",kind:"scalar",T:12},{no:12,name:"basic_info",kind:"message",T:()=>ht}])}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.posbt},{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.posA}])}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.posVt}])}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(s[s.UNKNOWN=0]="UNKNOWN",s[s.OGV_GRADE=1]="OGV_GRADE",s[s.UP_PROTECTION=2]="UP_PROTECTION",s[s.CM=3]="CM",s[s.UP_SELECTION=4]="UP_SELECTION",s[s.OPERATION=5]="OPERATION",s[s.VOTE=6]="VOTE",s[s.ESPORTS_GRADE=7]="ESPORTS_GRADE",s))(qt||{}),Mt=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:()=>Lt},{no:28,name:"subject_top_cards",kind:"message",repeat:2,T:()=>Dt}])}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.posFt}])}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.posse}}])}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",qt]}])}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.posKt},{no:6,name:"play_ext_conf",kind:"message",T:()=>Gt}])}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.posHt}])}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.poszt}])}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>>24,n[2]=t>>>16&255,n[3]=t>>>8&255,n[4]=t&255,n.set(e,5),n}};var N=class extends fe{options={showUpList:"show",purifyTopReplies:!0,airborne:!0};constructor(e){super(e,B.response.bodyBytes),Object.assign(this.options,B.argument),B.debug(B.request.url,this.options)}done(){B.done({body:this.toBinary()})}process(){return this._process(this.message),this}isAirborneEnabled(){let{airborne:e}=this.options;return!!(e&&e!=="#")}},ce=class extends N{constructor(){super(On)}_process(e){delete e.topicList,e.dynamicList&&(e.dynamicList.list=e.dynamicList.list.filter(t=>![15,18].includes(t.cardType))),this.processUpList(e)}processUpList(e){let{showUpList:t}=this.options;if(t==="show"||tn())return;if(t==="hide"||!e.upList?.showLiveNum){delete e.upList;return}let{list:n,listSecond:r}=e.upList,i=r.at(-1);i&&(i.separator=!0,e.upList.list=[...r,...n],r.length=0)}};var pe=class extends N{constructor(){super(Un)}_process(e){delete e.viewInfo?.promptBar,e.playArcConf?.arcConfs&&Object.values(e.playArcConf.arcConfs).forEach(t=>{t.isSupport&&t.disabled&&(t.disabled=!1,t.extraContent=void 0,t.unsupportScene.length=0)})}},ue=class extends N{constructor(){super(Pn)}_process(e){let{backgroundPlayConf:t,castConf:n}=e.playArc||{};[t,n].forEach(r=>{r&&(!r.isSupport||r.disabled)&&(r.isSupport=!0,r.disabled=!1,r.extraContent=void 0,r.unsupportScene.length=0)})}},de=class extends N{constructor(){super(Wn)}_process(e){e.items=e.items.filter(t=>{if(t.item.oneofKind==="smallCoverV5"){let n=t.item.smallCoverV5;return n.base?.fromType==="recommend"&&!n.base.adInfo.length}return!["rcmdOneItem","smallCoverV5Ad","topicList"].includes(t.item.oneofKind)})}};var ye=class extends N{constructor(){super(En)}_process(e){delete e.label,delete e.cmIpad,delete e.cmConfig,delete e.reqUser?.elecPlusBtn,e.cms.length=0,e.specialCellNew.length=0,e.relates=e.relates.filter(t=>!t.cm.length)}},D=class a extends N{static processChronos(e){let t=this.chronosMd5Map[e.md5];t||(B.warn(`MD5 mismatch detected. Received: ${e.md5}; File: ${e.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"),t=this.chronosMd5Map[vn()]),e.md5=t,e.file=`https://raw.githubusercontent.com/kokoryh/chronos/refs/heads/master/${t}.zip`,delete e.sign}static chronosMd5Map={universal:"2c80effb5c7ff582ad82ed7439e8f79a",hd:"932002070dc1b51241198a074d2279fc",inter:"8c3feda2e92bf60e8a7aeade1a231586","9e5e20312fafe73494f069a7bac5761e":"2c80effb5c7ff582ad82ed7439e8f79a",c29bd8f2b64a8f57f49c3622c0f763db:"ecca73e42e160074e0caf4b3ddb54a52","8232ffb6ee43b687b5fe5add5b3e97de":"feaca416bbc1174b8e935cf87ff8f0b5","325e7073ffc6fb5263682fecdcd1058f":"932002070dc1b51241198a074d2279fc","3a14beddd23328eaddfe9f0eb048d713":"8c3feda2e92bf60e8a7aeade1a231586"};constructor(){super(Cn)}_process(e){delete e.videoGuide,this.isAirborneEnabled()&&e.chronos&&a.processChronos(e.chronos)}},M=class a extends N{static filterRelateCard=e=>!this.filterRelateCardType.includes(e.relateCardType)&&!e.cmStock.length&&!e.basicInfo?.uniqueId;static filterRelateCardType=[4,5,6,7,11];constructor(){super(Ln)}_process(e){e.relates=e.relates.filter(a.filterRelateCard)}},me=class extends N{constructor(){super(Sn)}_process(e){delete e.cm,delete e.reqUser?.elecPlusBtn,e.tab?.tabModule.forEach(t=>{t.tab.oneofKind==="introduction"&&(t.tab.introduction.modules=t.tab.introduction.modules.reduce((n,r)=>([18,29,37,55].includes(r.type)||(r.type===3&&r.data.oneofKind==="headLine"?delete r.data.headLine.label:r.type===28&&r.data.oneofKind==="relates"&&(r.data.relates.cards=r.data.relates.cards.filter(M.filterRelateCard)),n.push(r)),n),[]))})}},he=class extends N{constructor(){super(An)}_process(e){delete e.dm,this.isAirborneEnabled()&&e.chronos&&D.processChronos(e.chronos)}},be=class extends N{constructor(){super(Fn)}_process(e){e.activityMeta.length=0,e.command?.commandDms.length&&(e.command.commandDms.length=0)}},ge=class extends N{constructor(){super(Dn)}_process(e){let{purifyTopReplies:t}=this.options;if(delete e.cm,e.subjectTopCards=e.subjectTopCards.filter(n=>n.type!==3),t){let n=/https:\/\/b23\.tv\/(cm|mall)/;e.topReplies=e.topReplies.filter(r=>{let i=r.content?.urls||{},f=r.content?.message||"";return!Object.keys(i).some(o=>n.test(o))&&!n.test(f)})}}},we=class extends N{constructor(){super(Mn)}_process(e){delete e.viewInfo?.tryWatchPromptBar,e.playExtConf?.castTips&&(e.playExtConf.castTips={code:0,message:""})}},ke=class extends N{constructor(){super($n)}_process(e){e.item=e.item.filter(t=>!/_ad_?/.test(t.linktype))}};var ai={"v2.Dynamic/DynAll":ce,"playerunite.v1.Player/PlayViewUnite":pe,"playurl.v1.PlayURL/PlayView":ue,"v1.Popular/Index":de,"view.v1.View/View":ye,"view.v1.View/ViewProgress":D,"viewunite.v1.View/RelatesFeed":M,"viewunite.v1.View/View":me,"viewunite.v1.View/ViewProgress":he,"v1.DM/DmView":be,"v1.Reply/MainList":ge,"v2.PlayURL/PlayView":we,"v1.Search/SearchAll":ke};function qn(a){for(let[e,t]of Object.entries(ai))if(a.endsWith(e))return new t;return null}try{qn(B.request.url)?.process().done()}catch(a){B.error(a,B.request.url)}finally{B.exit()}