dna-api 0.6.1 → 0.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -62,7 +62,7 @@ export declare class DNAAPI extends DNABaseAPI {
62
62
  * @returns 帖子列表响应
63
63
  */
64
64
  getPostList(forumId?: number, pageIndex?: number, pageSize?: number, searchType?: number, timeType?: number): Promise<import("./TimeBasicResponse").TimeBasicResponse<import("./type-generated").DNADiscussAreaResponse>>;
65
- getPostDetail(postId: string | number): Promise<import("./TimeBasicResponse").TimeBasicResponse<import("./type-generated").DNAPostDetailResponse>>;
65
+ getPostDetail(postId: string): Promise<import("./TimeBasicResponse").TimeBasicResponse<import("./type-generated").DNAPostDetailResponse>>;
66
66
  getPostByTopic(topicId?: number, pageIndex?: number, pageSize?: number, searchType?: number, timeType?: number): Promise<import("./TimeBasicResponse").TimeBasicResponse<import("./type-generated").DNATopicListResponse>>;
67
67
  getTaskProcess(): Promise<import("./TimeBasicResponse").TimeBasicResponse<import("./type-generated").DNAUserTaskProcessEntity>>;
68
68
  haveSignIn(): Promise<import("./TimeBasicResponse").TimeBasicResponse<import("./type-generated").DNASignInBean>>;
@@ -71,25 +71,25 @@ export declare class DNAAPI extends DNABaseAPI {
71
71
  getActivityList(curTime?: string, startTime?: string, endTime?: string): Promise<import("./TimeBasicResponse").TimeBasicResponse<import("./type-generated").DNAActivityListBean>>;
72
72
  bbsSign(): Promise<import("./TimeBasicResponse").TimeBasicResponse<import("./type-generated").DNASignInBean>>;
73
73
  getRoleList(): Promise<import("./TimeBasicResponse").TimeBasicResponse<import("./type-generated").DNARoleListBean>>;
74
- adminAdjustScore(postId: number, gameForumId: number, weight: string): Promise<import("./TimeBasicResponse").TimeBasicResponse<any>>;
74
+ adminAdjustScore(postId: string, gameForumId: number, weight: string): Promise<import("./TimeBasicResponse").TimeBasicResponse<any>>;
75
75
  adminDelete(post: {
76
- postId: number;
76
+ postId: string;
77
77
  gameId?: number;
78
78
  gameForumId: number;
79
79
  }, content: string, reasonCode: number): Promise<import("./TimeBasicResponse").TimeBasicResponse<any>>;
80
80
  adminMovePost(post: {
81
- postId: number;
81
+ postId: string;
82
82
  gameId?: number;
83
83
  gameForumId: number;
84
84
  }, newGameId: number, newForumId: number, newTopicIdStr: string): Promise<import("./TimeBasicResponse").TimeBasicResponse<any>>;
85
85
  adminRefreshTime(post: {
86
- postId: number;
86
+ postId: string;
87
87
  gameId?: number;
88
88
  gameForumId: number;
89
89
  }, refresh: number): Promise<import("./TimeBasicResponse").TimeBasicResponse<any>>;
90
90
  blockList(): Promise<import("./TimeBasicResponse").TimeBasicResponse<import("./type-generated").DNABlockBean>>;
91
- blockOther(blockPostId: number, blockUserId: string, type: number): Promise<import("./TimeBasicResponse").TimeBasicResponse<any>>;
92
- collect(postId: number, toUserId: string, operateType?: number): Promise<import("./TimeBasicResponse").TimeBasicResponse<any>>;
91
+ blockOther(blockPostId: string, blockUserId: string, type: number): Promise<import("./TimeBasicResponse").TimeBasicResponse<any>>;
92
+ collect(postId: string, toUserId: string, operateType?: number): Promise<import("./TimeBasicResponse").TimeBasicResponse<any>>;
93
93
  commentDelete(comment: {
94
94
  id: number;
95
95
  gameId: number;
@@ -119,10 +119,10 @@ export declare class DNAAPI extends DNABaseAPI {
119
119
  getDoujin(forumId: number): Promise<import("./TimeBasicResponse").TimeBasicResponse<import("./type-generated").DNADiscussAreaResponse>>;
120
120
  getExchange(forumId: number): Promise<import("./TimeBasicResponse").TimeBasicResponse<import("./type-generated").DNADiscussAreaResponse>>;
121
121
  getGameBanner(gameId?: number): Promise<import("./TimeBasicResponse").TimeBasicResponse<import("./type-generated").DNAGameBannerBean>>;
122
- getPostCommentList(postId: number, pageIndex?: number, pageSize?: number, isOnlyPublisher?: number): Promise<import("./TimeBasicResponse").TimeBasicResponse<import("./type-generated").DNACommentListResponse>>;
122
+ getPostCommentList(postId: string, pageIndex?: number, pageSize?: number, isOnlyPublisher?: number): Promise<import("./TimeBasicResponse").TimeBasicResponse<import("./type-generated").DNACommentListResponse>>;
123
123
  getRankList(forumId: number): Promise<import("./TimeBasicResponse").TimeBasicResponse<import("./type-generated").DNAFraternityResponse>>;
124
124
  getRecommendPosts(gameId?: number, pageIndex?: number, pageSize?: number): Promise<import("./TimeBasicResponse").TimeBasicResponse<import("./type-generated").DNAHomeOffWaterResponse>>;
125
- getReplyList(postId: number, postCommentId: number, pageIndex?: number, pageSize?: number): Promise<import("./TimeBasicResponse").TimeBasicResponse<import("./type-generated").DNAReplyListResponse>>;
125
+ getReplyList(postId: string, postCommentId: number, pageIndex?: number, pageSize?: number): Promise<import("./TimeBasicResponse").TimeBasicResponse<import("./type-generated").DNAReplyListResponse>>;
126
126
  getStatistics(gameId?: number): Promise<import("./TimeBasicResponse").TimeBasicResponse<import("./type-generated").DNAStatisticsBean>>;
127
127
  getTips(): Promise<import("./TimeBasicResponse").TimeBasicResponse<import("./type-generated").DNATipsBean>>;
128
128
  getWalkthrough(forumId: number): Promise<import("./TimeBasicResponse").TimeBasicResponse<import("./type-generated").DNADiscussAreaResponse>>;
@@ -135,27 +135,27 @@ export declare class DNAAPI extends DNABaseAPI {
135
135
  userId: string;
136
136
  }): Promise<import("./TimeBasicResponse").TimeBasicResponse<any>>;
137
137
  lockPost(post: {
138
- postId: number;
138
+ postId: string;
139
139
  gameId?: number;
140
140
  gameForumId: number;
141
141
  }, operateType: number): Promise<import("./TimeBasicResponse").TimeBasicResponse<any>>;
142
142
  postDownOrUp(post: {
143
- postId: number;
143
+ postId: string;
144
144
  gameId?: number;
145
145
  gameForumId: number;
146
146
  }, operateType: number): Promise<import("./TimeBasicResponse").TimeBasicResponse<any>>;
147
147
  postElite(post: {
148
- postId: number;
148
+ postId: string;
149
149
  gameId?: number;
150
150
  gameForumId: number;
151
151
  }, operateType: number): Promise<import("./TimeBasicResponse").TimeBasicResponse<any>>;
152
152
  postHide(post: {
153
- postId: number;
153
+ postId: string;
154
154
  gameId?: number;
155
155
  gameForumId: number;
156
156
  }, operateType: number): Promise<import("./TimeBasicResponse").TimeBasicResponse<any>>;
157
157
  reRank(post: {
158
- postId: number;
158
+ postId: string;
159
159
  gameId?: number;
160
160
  gameForumId: number;
161
161
  }, weight: number): Promise<import("./TimeBasicResponse").TimeBasicResponse<any>>;
@@ -171,12 +171,12 @@ export declare class DNAAPI extends DNABaseAPI {
171
171
  searchUser(keyword: string, pageIndex: number, pageSize: number): Promise<import("./TimeBasicResponse").TimeBasicResponse<import("./type-generated").DNASearchUserBean>>;
172
172
  shareTask(): Promise<import("./TimeBasicResponse").TimeBasicResponse<any>>;
173
173
  strongRecommend(post: {
174
- postId: number;
174
+ postId: string;
175
175
  gameId?: number;
176
176
  gameForumId: number;
177
177
  }, operateType?: number): Promise<import("./TimeBasicResponse").TimeBasicResponse<any>>;
178
178
  viewCommunity(): Promise<import("./TimeBasicResponse").TimeBasicResponse<any>>;
179
- viewCount(postId: number, gameId?: number): Promise<import("./TimeBasicResponse").TimeBasicResponse<any>>;
179
+ viewCount(postId: string, gameId?: number): Promise<import("./TimeBasicResponse").TimeBasicResponse<any>>;
180
180
  loginLog(): Promise<import("./TimeBasicResponse").TimeBasicResponse<any>>;
181
181
  login(mobile: string, code: string): Promise<import("./TimeBasicResponse").TimeBasicResponse<import("./type-generated").DNAUserDataBean>>;
182
182
  getSmsCode(mobile: string, vJson: string): Promise<import("./TimeBasicResponse").TimeBasicResponse<any>>;
@@ -279,7 +279,7 @@ export declare class DNAAPI extends DNABaseAPI {
279
279
  operateType: number;
280
280
  postCommentId: number;
281
281
  postCommentReplyId: number;
282
- postId: number;
282
+ postId: string;
283
283
  postType: number;
284
284
  toUserId: string;
285
285
  }): Promise<import("./TimeBasicResponse").TimeBasicResponse<any>>;
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- var k;((s)=>{s[s.ERROR=-999]="ERROR";s[s.OK_ZERO=0]="OK_ZERO";s[s.OK_HTTP=200]="OK_HTTP";s[s.BAD_REQUEST=400]="BAD_REQUEST";s[s.SERVER_ERROR=500]="SERVER_ERROR"})(k||={});class h{code=0;msg="";data;constructor(e){this.code=e.code||0,this.msg=e.msg||"",this.data=e.data}get is_success(){return this.code===200||this.code===0}get success(){return this.is_success}static err(e,n=-999){return new h({code:n,msg:e,data:void 0})}}import*as C from"node-forge";function q(e,n){try{let t=[];for(let o=0;o<n.length;o+=64)t.push(n.slice(o,o+64));let r=`-----BEGIN PUBLIC KEY-----
1
+ var k;((s)=>{s[s.ERROR=-999]="ERROR";s[s.OK_ZERO=0]="OK_ZERO";s[s.OK_HTTP=200]="OK_HTTP";s[s.BAD_REQUEST=400]="BAD_REQUEST";s[s.SERVER_ERROR=500]="SERVER_ERROR"})(k||={});class y{code=0;msg="";data;constructor(e){this.code=e.code||0,this.msg=e.msg||"",this.data=e.data}get is_success(){return this.code===200||this.code===0}get success(){return this.is_success}static err(e,n=-999){return new y({code:n,msg:e,data:void 0})}}import*as p from"node-forge";function I(e,n){try{let t=[];for(let u=0;u<n.length;u+=64)t.push(n.slice(u,u+64));let r=`-----BEGIN PUBLIC KEY-----
2
2
  ${t.join(`
3
3
  `)}
4
- -----END PUBLIC KEY-----`,i=C.pki.publicKeyFromPem(r),s=C.util.encodeUtf8(e),a=i.encrypt(s);return C.util.encode64(a)}catch(t){throw Error(`[DNA] RSA 加密失败: ${t.message}`)}}function y(e=16){let t="";for(let r=0;r<e;r++)t+="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".charAt(Math.floor(Math.random()*62));return t}function L(e=16){let t="";for(let r=0;r<e;r++)t+="abcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(Math.random()*36));return t}function K(e){let n=C.md.md5.create();return n.update(e),n.digest().toHex().toUpperCase()}function be(e){if(e.length<=23)return e;let n=e.split(""),t=[[1,13],[5,17],[7,23]];for(let[r,i]of t)[n[r],n[i]]=[n[i],n[r]];return n.join("")}function le(){let e=y(17),n=Date.now().toString(),t=[],r=0,i=0;for(let u=0;u<30;u++)if(8<=u&&u<=12)t.push(n[i]),i++;else if(16<=u&&u<=20)t.push(n[i]),i++;else if(22<=u&&u<=24)t.push(n[i]),i++;else t.push(e[r]),r++;let s=t.join(""),a=s.split("");for(let[u,A]of[[2,23],[9,17],[13,25]])[a[u],a[A]]=[a[A],a[u]];let o=a.join("");return[s,o]}function De(e,n){let t=Object.keys(e).sort(),r=[];for(let i of t){let s=e[i];if(s!==null&&s!==void 0&&s!=="")r.push(`${i}=${s}`)}return r.push(n),r.join("&")}function z(e,n){let t=De(e,n),r=K(t);return be(r)}function W(e,n){let t=new TextEncoder,r=t.encode(e),i=t.encode(n),s=[];for(let a=0;a<r.length;a++){let o=(r[a]&255)+(i[a%i.length]&255);s.push(`@${o}`)}return s.join("")}function ee(e,n,t){let r=y(16),[i,s]=le(),a={};for(let[m,f]of Object.entries(n))a[m]=String(f);let o={...a};if(t)o.token=t;o.sa=i;let u=z(o,r),A=W(u,r),N=`${q(r,e)},${A}`;return{rk:r,tn:N,sa:s}}function F(e,n,t){if(n<0||t<0||n>=e.length||t>=e.length)return e;let r=e.split("");return[r[n],r[t]]=[r[t],r[n]],r.join("")}function Ne(e,n=Date.now()){let t=e;t=F(t,7,11),t=F(t,18,26),t=F(t,12,22),t=F(t,3,15);let r=String(n);if(t.length!==30||r.length<13)return t;let i=0,s=[];for(let a=0;a<t.length;a++){if(a===8||a===16)s.push(r.slice(i,i+5)),i+=5;else if(a===22)s.push(r.slice(i,i+3)),i+=3;s.push(t[a])}return s.join("")}function ne(e,n,t){let r=y(16),i=y(30),s=Ne(i),a={};for(let[m,f]of Object.entries(n))a[m]=String(f);let o={...a};if(t)o.token=t;o.sa=i;let u=z(o,r),A=W(u,r),N=`${q(r,e)},${A}`;return{rk:r,tn:N,sa:s}}function te(e){let n=y(16),t=q(n,e);return{signature:re(t),key:n}}function re(e){let n=e.split(""),t=[[3,23],[11,32],[22,42],[25,48]];for(let[r,i]of t)if(r<n.length&&i<n.length)[n[r],n[i]]=[n[i],n[r]];return n.join("")}function ie(e,n){let t=re(e),r=C.util.decode64(t),i=C.cipher.createDecipher("AES-CBC",n);return i.start({iv:"A-16-Byte-String"}),i.update(C.util.createBuffer(r)),i.finish(),i.output.getBytes()}function Ae(e){function n(t,r){let i=t.split("");for(let s=1;s<r.length;s+=2){let a=r[s-1],o=r[s];if(a>=0&&a<i.length&&o>=0&&o<i.length)[i[a],i[o]]=[i[o],i[a]]}return i.join("")}return n(K(e),[1,13,5,17,7,23])}function de(e,n){let t=[],r=Object.keys(e).sort();for(let s of r){let a=e[s];if(a!==null&&a!==void 0&&a!=="")t.push(`${s}=${a}`)}let i=t.join("&");return Ae(`${i}&${n}`)}function se(e,n){let t=Date.now(),r={...e,timestamp:t,token:n},i=y(16),s=de(r,i);return{s:W(s,i),t,k:i}}class _{fetchFn;RSA_PUBLIC_KEY="MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDGpdbezK+eknQZQzPOjp8mr/dP+QHwk8CRkQh6C6qFnfLH3tiyl0pnt3dePuFDnM1PUXGhCkQ157ePJCQgkDU2+mimDmXh0oLFn9zuWSp+U8uLSLX3t3PpJ8TmNCROfUDWvzdbnShqg7JfDmnrOJz49qd234W84nrfTHbzdqeigQIDAQAB";BASE_URL="https://dnabbs-api.yingxiong.com/";BASE_WEB_SOCKET_URL="wss://dnabbs-api.yingxiong.com:8180/ws-community-websocket";KF_BASE_URL="https://kf.yingxiong.com/";uploadKey="";sign_api_urls=new Set;baseHeaders={};dev_code="";token="";kf_token="";debug=!1;cookieToken="";_server="cn";get server(){return this._server}set server(e){if(this._server=e,e==="global")this.BASE_URL="https://lunoloft-api.yingxiong.com/",this.BASE_WEB_SOCKET_URL="wss://lunoloft-api.yingxiong.com:8181/ws-community-websocket";else this.BASE_URL="https://dnabbs-api.yingxiong.com/",this.BASE_WEB_SOCKET_URL="wss://dnabbs-api.yingxiong.com:8180/ws-community-websocket";this.updateHeaders()}_mode="ios";get mode(){return this._mode}set mode(e){this._mode=e,this.updateHeaders()}_lang="zh-Hans";get lang(){return this._lang}set lang(e){this._lang=e,this.updateHeaders()}constructor(e={}){if(e.server==="global")this.server="global";else this.server="cn";if(this.fetchFn=e.fetchFn,e.mode!==void 0)this.mode=e.mode;if(e.lang!==void 0)this.lang=e.lang;if(e.rsa_public_key!==void 0)this.RSA_PUBLIC_KEY=e.rsa_public_key;if(e.dev_code!==void 0)this.dev_code=e.dev_code;else this.dev_code=_.generateDeviceCode();if(e.token!==void 0)this.token=e.token;if(e.kf_token!==void 0)this.kf_token=e.kf_token;if(e.debug)this.debug=!0}static generateDeviceCode(){return`2${L(32)}`}updateHeaders(){if(this.mode==="android")this.baseHeaders={"log-header":"I am the log request header.",countrycode:"CN",version:this.server==="cn"?"1.2.2":"1.1.1",versioncode:this.server==="cn"?"9":"5",source:"android",lang:this.lang,"Content-Type":"application/x-www-form-urlencoded","User-Agent":this.server==="cn"?"okhttp/3.10.0":"okhttp/5.3.2"};else this.baseHeaders={"log-header":"I am the log request header.",countrycode:"CN",version:this.server==="cn"?"1.2.0":"1.1.1",versioncode:this.server==="cn"?"7":"5",source:"ios",lang:this.lang,"Content-Type":"application/x-www-form-urlencoded","User-Agent":this.server==="cn"?"DoubleHelix/3 CFNetwork/3860.300.31 Darwin/25.2.0":"DoubleHelix/4 CFNetwork/3860.100.1 Darwin/25.0.0"}}async fileUpload(e,n){let t=await this._dna_request(e,n,{sign:!0});if(t.is_success&&t.data)t.data=t.data.map((r)=>ie(r,this.uploadKey));return t}async getRsaPublicKey(){if(this.RSA_PUBLIC_KEY)return this.RSA_PUBLIC_KEY;let e=await this._dna_request("config/getRsaPublicKey");if(e.is_success&&e.data){let n=e.data.key;if(typeof n==="string")this.RSA_PUBLIC_KEY=n}return this.RSA_PUBLIC_KEY}async getHeaders(e){let{payload:n={},exparams:t,dev_code:r=this.dev_code,refer:i,token:s=this.token,kf_token:a=this.kf_token,h5:o,kf:u}=e||{},A={version:"3.11.0",source:"h5","Content-Type":"application/x-www-form-urlencoded","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36"},w={Authorization:a,Referer:"https://kf.yingxiong.com/kf2.0/im-chat","X-Requested-With":"com.hero.dna","Content-Type":"application/json; charset=utf-8","User-Agent":"Mozilla/5.0 (Linux; Android 16; PLQ110 Build/BP2A.250605.015; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/143.0.7499.192 Mobile Safari/537.36CP6.TgzO Hero/1.1.4"},N=o||!1,m=u?w:N?A:{...this.baseHeaders};if(r&&!u)m.devCode=r;if(i||N)m.origin="https://dnabbs.yingxiong.com",m.refer="https://dnabbs.yingxiong.com/";if(s&&!u)m.token=s;if(u&&this.cookieToken)m.Cookie=this.cookieToken;if(n instanceof FormData){let f=await this.getRsaPublicKey(),{signature:p,key:b}=te(f);if(m.t=p,this.uploadKey=b,t)for(let[D,d]of Object.entries(t))n.append(D,String(d));delete m["Content-Type"]}else if(typeof n==="object")if(!u){let f=await this.getRsaPublicKey();if(this.server==="cn")if(this.mode==="android"){let{tn:D,sa:d}=ne(f,n,s);m.tn=D,m.sa=d}else{let{tn:D,sa:d,rk:I}=ee(f,n,s);m.rk=I,m.tn=D,m.sa=d}if(t)Object.assign(n,t);let p=new URLSearchParams;Object.entries(n).forEach(([D,d])=>{p.append(D,String(d))});let b=n;if(n=p.toString(),!u&&this.server!=="cn"){let D=u?{}:se(b,"");Object.assign(b,{sign:D.s,timestamp:D.t});let d=D.k,I=await this.getRsaPublicKey(),P=q(d,I);if(o)m.k=P;else m.rk=d,m.key=P}}else n=JSON.stringify(n);return{headers:m,payload:n}}async needSign(e){if(e==="config/getCommonConfig")return!1;if(this.sign_api_urls.size===0)try{await this.initializeSignConfig()}catch(n){console.error("初始化签名配置失败:",n)}finally{if(this.sign_api_urls.size===0)this.sign_api_urls=new Set(["/user/sdkLogin","/user/getSmsCode","/role/defaultRoleForTool","/media/av/cfg/getVideos","/media/av/cfg/getAudios","/media/av/cfg/getImages","/encourage/signin/signin","/user/refreshToken","/user/signIn","/role/defaultRole","/role/list","/role/getShortNoteInfo","/forum/like","/encourage/calendar/Activity/list"].map((n)=>n.replace(/^\/+/,"")))}return this.sign_api_urls.has(e)}async initializeSignConfig(){try{let e=await this._dna_request("config/getCommonConfig",void 0,{sign:!1});if(e.is_success&&e.data?.signApiConfigVo?.signApiList)this.sign_api_urls=new Set(e.data.signApiConfigVo.signApiList.map((n)=>n.replace(/^\/+/,"")))}catch(e){console.error("初始化签名配置失败:",e)}}async _dna_request_h5(e,n,t){return await this._dna_request(e,n,{...t,h5:!0})}async _dna_request_kf(e,n,t){return await this._dna_request(e,n,{...t,kf:!0})}async _dna_request(e,n,t){let{method:r="POST",sign:i,h5:s,kf:a,refer:o,params:u,max_retries:A=3,retry_delay:w=2000,timeout:N=3000}=t||{};if(e.startsWith("/"))e=e.slice(1);if(i===void 0&&await this.needSign(e))i=!0;let m;if(i){let{payload:p,headers:b}=await this.getHeaders({payload:n,refer:o,exparams:u,token:this.token,h5:s});n=p,m=b}else{let{headers:p}=await this.getHeaders({refer:o,h5:s,kf:a});m=p}if(this.debug)console.debug("[_dna_request] url:",e,"headers:",m,"data:",n);let f=null;for(let p=0;p<A;p++)try{let b=n;if(n&&typeof n==="object"&&!(n instanceof FormData))if(!a||r==="GET"){let R=new URLSearchParams;Object.entries(n).forEach(([ce,Y])=>{if(Y!==void 0)R.append(ce,String(Y))}),b=R.toString()}else b=JSON.stringify(n);let D=r==="GET"?{method:r,headers:m}:{method:r,headers:m,body:b},d=new AbortController,I=setTimeout(()=>d.abort(),N),P={...D,signal:d.signal},$=a?this.KF_BASE_URL:this.BASE_URL,J=r==="GET"?`${$}${e}${b?`?${b}`:""}`:`${$}${e}`,S=this.fetchFn?await this.fetchFn(J,P):await fetch(J,P);clearTimeout(I);let ge=S.headers.get("content-type")||"";if(a){let R=S.headers.get("set-cookie");if(R)this.cookieToken=R.split(";")[0]}let B;if(ge.includes("text/")){let R=await S.text();B={code:-999,data:R}}else B=await S.json();if(typeof B==="object"&&B!==null)try{if(typeof B.data==="string")B.data=JSON.parse(B.data)}catch{}if(this.debug)console.debug("[_dna_request] raw_res:",B);if(typeof B.data==="object"&&B.data!==null&&Object.keys(B.data).length===0&&e.includes("role"))throw Error("空返回值");return new h(B)}catch(b){if(b instanceof Error&&b.message.includes("AbortError"))await new Promise((D)=>setTimeout(D,w));else{console.trace(`请求失败: ${b.message}`),f=b;break}}return h.err(f?.message||"请求服务器失败,已达最大重试次数")}}class c{base;constructor(e){this.base=e}get dev_code(){return this.base.dev_code}get token(){return this.base.token}set token(e){this.base.token=e}get kf_token(){return this.base.kf_token}set kf_token(e){this.base.kf_token=e}get fetchFn(){return this.base.fetchFn}get RSA_PUBLIC_KEY(){return this.base.RSA_PUBLIC_KEY}get BASE_URL(){return this.base.BASE_URL}get uploadKey(){return this.base.uploadKey}async getRsaPublicKey(){return this.base.getRsaPublicKey()}async fileUpload(e,n){return await this.base.fileUpload(e,n)}async _dna_request(e,n,t){return this.base._dna_request(e,n,t)}async _dna_request_h5(e,n,t){return this.base._dna_request_h5(e,n,t)}async _dna_request_kf(e,n,t){return this.base._dna_request_kf(e,n,t)}async getHeaders(e){return this.base.getHeaders(e)}}class G extends c{async defaultRoleForTool(e=1,n=""){let t={otherUserId:n,type:e};return await this._dna_request("role/defaultRoleForTool",t,{sign:!0})}async getMhSwitchStatus(){return await this._dna_request("user/push/getMhSwitchStatus")}async getRoleDetail(e,n,t){let r={charId:e,charEid:n,type:1,otherUserId:t};return await this._dna_request("role/getCharDetail",r)}async getShortNoteInfo(){return await this._dna_request("role/getShortNoteInfo",void 0,{sign:!0})}async getWeaponDetail(e,n,t){let r={weaponId:e,weaponEid:n,type:1,otherUserId:t};return await this._dna_request("role/getWeaponDetail",r)}async updateMhSwitchStatus(e){return await this._dna_request("user/push/updateMhSwitchStatus",{config:e})}async soulTask(){return await this._dna_request("role/soul/task")}}class O extends c{async getMapMatterCategorizeOptions(){return await this._dna_request_h5("map/matter/categorize/getOptions")}async getMapCategorizeList(){return await this._dna_request_h5("map/categorize/list")}async getMapDetail(e){return await this._dna_request_h5("map/detail",{id:e})}async getMapSiteDetail(e){return await this._dna_request_h5("map/site/detail",{id:e})}async getEmojiList(){return await this._dna_request_h5("config/getEmoji")}}var g=268;class U extends c{async adminAdjustScore(e,n,t,r=g){let i={postId:e,gameId:r??g,gameForumId:n,weight:t};return await this._dna_request("forum/moderator/setPostWeight",i)}async adminDelete(e,n,t){let r={postId:e.postId,gameId:e.gameId??g,gameForumId:e.gameForumId,content:n,reasonCode:t};return await this._dna_request("forum/moderator/postDelete",r)}async adminMovePost(e,n,t,r){let i={postId:e.postId,gameId:e.gameId??g,gameForumId:e.gameForumId,newGameId:n,newForumId:t,newTopicIdStr:r};return await this._dna_request("forum/moderator/postMove",i)}async adminRefreshTime(e,n){let t={postId:e.postId,gameId:e.gameId??g,gameForumId:e.gameForumId,refresh:n};return await this._dna_request("forum/moderator/setRefresh",t)}async blockList(){return await this._dna_request("user/block/list")}async blockOther(e,n,t){return await this._dna_request("user/block/other",{blockPostId:e,blockUserId:n,type:t})}async collect(e,n,t=1){let r={operateType:t,postId:e,toUserId:n};return await this._dna_request("forum/collect",r)}async commentDelete(e,n,t,r){let i={id:e.id,gameId:e.gameId,gameForumId:e.gameForumId,entityType:n,content:t,reasonCode:r};return await this._dna_request("forum/commentReplyDelete",i)}async createComment(e,n){let t=JSON.stringify([{content:n,contentType:"1"}]),r={postId:e.postId,forumId:e.gameForumId,postType:"1",content:t};return await this._dna_request("forum/comment/createComment",r,{sign:!0,params:{toUserId:e.userId}})}async createReply(e,n){let r={content:JSON.stringify([{content:n,contentType:"1",imgHeight:0,imgWidth:0,url:""}]),forumId:e.gameForumId,postCommentId:e.postCommentId,postId:e.postId,postType:"1",toUserId:e.userId};return await this._dna_request("forum/comment/createReply",r,{sign:!0,params:{toUserId:e.userId}})}async createReplyList(e,n){let r={content:JSON.stringify([{content:n,contentType:"1",imgHeight:0,imgWidth:0,url:""}]),forumId:e.gameForumId,postCommentId:e.postCommentId,postCommentReplyId:e.postCommentReplyId,postId:e.postId,postType:"1",toUserId:e.userId};return await this._dna_request("forum/comment/createReply",r,{sign:!0,params:{toUserId:e.userId}})}async deletePost(e,n){return await this._dna_request("forum/more/delete",{deleteType:e,id:n},{sign:!0,refer:!0})}async followUser(e,n){let t={followUserId:e,operateType:n?0:1};return await this._dna_request("user/followUser",t,{sign:!0})}async getFollowState(e){let n={followUserId:e};return await this._dna_request("user/isFollow",n)}async gameSignIn(e,n){let t={dayAwardId:e,periodId:n,signinType:1};return await this._dna_request("encourage/signin/signin",t,{sign:!0})}async getActivityList(e,n,t){let r=new Date;function i(s){return s.toLocaleString("zh-CN",{timeZone:"Asia/Shanghai",hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).replace(/\//g,"-")}if(!e)e=i(r);if(!n){let s=new Date("2025-12-29 00:00:00 GMT+0800"),a=new Date(r.getFullYear(),r.getMonth()-3,r.getDate());n=i(a>s?a:s)}if(!t)t=i(new Date(r.getFullYear(),r.getMonth()+3,r.getDate(),23,59));return await this._dna_request("encourage/calendar/Activity/list",{curTime:e,startTime:n,endTime:t})}async getDoujin(e){return await this._dna_request("forum/discuss/getDoujin",{forumId:e})}async getExchange(e){return await this._dna_request("forum/discuss/getExchange",{forumId:e})}async getGameBanner(e=g){return await this._dna_request("forum/gameBanner",{gameId:e})}async getPostByTopic(e=177,n=1,t=20,r=1,i=0){let s={topicId:e,gameId:g,pageIndex:n,pageSize:t,searchType:r,timeType:i};return await this._dna_request("forum/getPostByTopic",s)}async getPostCommentList(e,n=1,t=20,r=0){return await this._dna_request("forum/comment/getPostCommentList",{postId:e,pageIndex:n,pageSize:t,isOnlyPublisher:r})}async getPostDetail(e){return await this._dna_request("forum/getPostDetail",{postId:e})}async getPostList(e=48,n=1,t=20,r=1,i=0){let s={forumId:e,gameId:g,pageIndex:n,pageSize:t,searchType:r,timeType:i};return await this._dna_request("forum/list",s)}async getRankList(e){return await this._dna_request("forum/discuss/getRank",{forumId:e})}async getRecommendPosts(e=g,n=1,t=20){return await this._dna_request("forum/getRecommendPosts",{gameId:e,pageIndex:n,pageSize:t})}async getReplyList(e,n,t=1,r=20){return await this._dna_request("forum/comment/getReplyList",{postId:e,postCommentId:n,pageIndex:t,pageSize:r})}async getStatistics(e=g){return await this._dna_request("forum/statistics",{gameId:e})}async getTips(){return await this._dna_request("config/getTips")}async getWalkthrough(e){return await this._dna_request("forum/discuss/getWalkthrough",{forumId:e})}async hotList(e=1,n=g){return await this._dna_request("forum/hot/ranking/list",{gameId:n,type:e})}async haveSignIn(){let e={gameId:g};return await this._dna_request("user/haveSignInNew",e)}async isHaveSignin(){let e={gameId:g};return await this._dna_request("encourage/signin/isHaveSignin",e)}async isRedPoint(){return await this._dna_request("forum/dynamic/isRedPoint")}async signCalendar(){let e={gameId:g};return await this._dna_request("encourage/signin/show",e)}async like(e){let n={forumId:e.gameForumId,gameId:g,likeType:"1",operateType:"1",postCommentId:"",postCommentReplyId:"",postId:e.postId,postType:e.postType,toUserId:e.userId};return await this._dna_request("forum/like",n)}async lockPost(e,n){let t={postId:e.postId,gameId:e.gameId??g,gameForumId:e.gameForumId,operateType:n};return await this._dna_request("forum/moderator/postLock",t)}async postDownOrUp(e,n){let t={postId:e.postId,gameId:e.gameId??g,gameForumId:e.gameForumId,operateType:n};return await this._dna_request("forum/moderator/postDownOrUp",t)}async postElite(e,n){let t={postId:e.postId,gameId:e.gameId??g,gameForumId:e.gameForumId,operateType:n};return await this._dna_request("forum/moderator/postElite",t)}async postHide(e,n){let t={postId:e.postId,gameId:e.gameId??g,gameForumId:e.gameForumId,operateType:n};return await this._dna_request("forum/moderator/postHide",t)}async reRank(e,n){let t={postId:e.postId,gameId:e.gameId??g,gameForumId:e.gameForumId,weight:n};return await this._dna_request("forum/moderator/reRank",t)}async receiveLog(e,n,t){let r={periodId:e,pageIndex:n,pageSize:t};return await this._dna_request("encourage/signin/receiveLog",r)}async recommendList(e,n,t,r,i=g){let s={gameId:i,recIndex:e,newIndex:n,size:t,history:r};return await this._dna_request("forum/recommend/list",s)}async report({commentId:e=0,postId:n=0,replyId:t=0},r=1,i=1){let s={commentId:e,postId:n,replyId:t,reportReason:r,reportType:i};return await this._dna_request("forum/more/report",s)}async searchPost(e,n,t,r=g,i=1){let s={gameId:r,keyword:e,pageIndex:n,pageSize:t,searchType:i};return await this._dna_request("forum/searchPost",s)}async searchTopic(e,n,t=20,r=g){let i={gameId:r,keyword:e,pageIndex:n,pageSize:t};return await this._dna_request("forum/searchPost",i)}async searchUser(e,n,t){let r={keyword:e,pageIndex:n,pageSize:t};return await this._dna_request("forum/searchPost",r)}async shareTask(){let e={gameId:g};return await this._dna_request("encourage/level/shareTask",e)}async bbsSign(){let e={gameId:g};return await this._dna_request("user/signIn",e)}async strongRecommend(e,n=1){let t={postId:e.postId,gameId:e.gameId??g,gameForumId:e.gameForumId,operateType:n};return await this._dna_request("forum/moderator/setForceRecommend",t)}async viewCommunity(){return await this._dna_request("encourage/level/viewCommunity")}async viewCount(e,n=g){return await this._dna_request("forum/viewCount",{gameId:n,postId:e})}async getTaskProcess(){let e={gameId:g};return await this._dna_request("encourage/level/getTaskProcess",e)}async soulTask(){return await this._dna_request("role/soul/task")}}class M extends c{async blackUser(e,n){return await this._dna_request("user/blackUser",{toUserId:e,type:n})}async cleanFansNew(e,n){return await this._dna_request("user/cleanFansNew",{type:e,userFollowId:n})}async collect(e,n,t=1){return await this._dna_request("forum/collect",{operateType:t,postId:e,toUserId:n})}async defaultRole(e,n=1){return await this._dna_request("user/defaultRole",{otherUserId:e,type:n})}async deleteRole(e){return await this._dna_request("role/remove",{roleBoundId:e})}async draftDelete(e){return await this._dna_request("forum/more/draftDelete",{draftId:e})}async fans(e,n,t,r){return await this._dna_request("user/fans",{otherUserId:e,pageNo:n,pageSize:t,type:r})}async fastBind(){return await this._dna_request("role/quickBound")}async follow(e,n,t,r){return await this._dna_request("user/follow",{otherUserId:e,pageNo:n,pageSize:t,type:r})}async followUser(e,n){return await this._dna_request("user/followUser",{followUserId:e,operateType:n?0:1})}async getApplyStatus(){return await this._dna_request("user/creator/getApplyStatus")}async getDraftList(e,n){return await this._dna_request("forum/getDraftList",{pageIndex:e,pageSize:n})}async getMineComment(e,n,t,r){return await this._dna_request("user/notice/mine",{otherUserId:e,pageIndex:n,pageSize:t,type:r})}async getMinePost(e,n,t,r,i,s){return await this._dna_request("forum/getMinePost",{otherUserId:e,pageIndex:n,pageSize:t,searchType:r,type:i,postType:s})}async getNotifySwitch(){return await this._dna_request("user/push/getSwitchStatus")}async historyView(e,n){return await this._dna_request("forum/historyView",{pageIndex:e,pageSize:n})}async like(e){return await this._dna_request("forum/like",e)}async manualBound(e,n,t){return await this._dna_request("role/manualBound",{roleId:e,type:n,code:t})}async mine(e,n,t,r){let i={otherUserId:e,searchType:n,type:t,postType:r};if(!e)delete i.otherUserId;return await this._dna_request("user/mine",i)}async mineV2(e){return await this._dna_request("user/mineV2",{otherUserId:e})}async moderatorByGame(e){return await this._dna_request("user/moderator/getModeratorByGame",{gameId:e})}async muteCancel(e){return await this._dna_request("forum/moderator/muteCancel",{toUserId:e})}async muteUser(e,n,t,r,i){return await this._dna_request("forum/moderator/muteUser",{toUserId:e,gameIdStr:n,type:t,reason:r,content:i})}async resetDefault(e){return await this._dna_request("role/resetDefault",{roleBoundId:e})}async roleManager(){return await this._dna_request("role/list")}}class V extends c{async addAddress(e,n,t){return await this._dna_request("user/more/userAddressAdd",{receiverName:e,receiverMobile:n,receiverAddress:t})}async blackUser(e,n){return await this._dna_request("user/blackUser",{toUserId:e,type:n})}async cancelCode(e){return await this._dna_request("user/more/cancelCode",{code:e})}async cancel(e,n,t,r,i){return await this._dna_request("user/more/cancel",{cancelType:e,operateType:n,position:t,cancelReason:r,reasonDetail:i})}async deleteAddress(e){return await this._dna_request("user/more/deleteUserAddress",{addressId:e})}async editAddress(e,n,t,r){return await this._dna_request("user/more/userAddressEdit",{addressId:e,receiverName:n,receiverMobile:t,receiverAddress:r})}async feedback(e,n,t,r){return await this._dna_request("user/more/feedback",{listPic:e,proDesc:n,mobile:t,isLogin:r})}async getCancelStatus(){return await this._dna_request("user/more/getCancelStatus")}async getNotifySwitch(){return await this._dna_request("user/push/getSwitchStatus")}async getPrivateSet(){return await this._dna_request("user/getPrivateSet")}async getUserAddress(e,n){return await this._dna_request("user/more/getUserAddress",{userId:e,type:n})}async getUserBlackList(e,n){return await this._dna_request("user/getUserBlackList",{pageIndex:e,pageSize:n})}async msgListDetail(e,n,t){return await this._dna_request("user/block/listDetail",{pageNo:e,pageSize:n,type:t})}async postListDetail(e,n,t){return await this._dna_request("user/block/listDetail",{pageNo:e,pageSize:n,type:t})}async privateSet(e,n){return await this._dna_request("user/privateSet",{operateType:e,option:n})}async sendSms(e,n,t){return await this._dna_request("user/sms/sendSms",{mobile:e,timeStamp:n,type:t})}async setDefaultAddress(e){return await this._dna_request("user/more/setDefaultAddress",{addressId:e})}async setNotifySwitch(e,n){return await this._dna_request("user/push/updateSwitchStatus",{operateType:e,switchType:n})}async uploadFeedBack(e){let n=new FormData;return n.append("parts",e),await this.fileUpload("user/img/uploadFeedBack",n)}}class v extends c{async draftSave(e,n,t,r,i,s,a){return await this._dna_request("forum/draftSave",{content:e,draftId:n,h5Content:t,postTitle:r,postType:i,gameId:s,videoReUpload:a})}async followUser(e,n){return await this._dna_request("user/followUser",{followUserId:e,operateType:n})}async getConfigTopicByGameId(e,n){return await this._dna_request("config/getConfigTopicByGameId",{name:e,showType:n})}async getPostPublishPage(){return await this._dna_request("forum/getPostPublishPage")}async getRecommend(e,n){return await this._dna_request("user/getRecommend",{history:e,pageSize:n})}async getTips(){return await this._dna_request("config/getTips")}async getVodToken(e,n){return await this._dna_request("forum/getVodToken",{fileName:e,title:n})}async like(e,n,t,r,i,s,a,o,u){return await this._dna_request("forum/like",{forumId:e,gameId:n,likeType:t,operateType:r,postCommentId:i,postCommentReplyId:s,postId:a,postType:o,toUserId:u})}async list(e,n,t){return await this._dna_request("forum/dynamic/list",{pageIndex:e,pageSize:n,userId:t})}async parseLink(e){return await this._dna_request("forum/parseLink",{link:e})}async posAdminEdit(e,n,t,r,i,s,a,o,u){return await this._dna_request("forum/moderator/postEdit",{content:e,gameForumId:n,h5Content:t,postId:r,postTitle:i,topics:s,postType:a,gameId:o,videoReUpload:u})}async postEdit(e,n,t,r,i,s,a,o){return await this._dna_request("forum/postEdit",{content:e,gameForumId:n,h5Content:t,postId:r,postTitle:i,topics:s,postType:a,videoReUpload:o})}async postPublish(e,n,t,r,i,s,a,o){return await this._dna_request("forum/postPublish",{content:e,draftId:n,gameForumId:t,gameId:r,h5Content:i,postTitle:s,postType:a,topics:o})}async safeCheck(e){return await this._dna_request("forum/more/safeCheck",{url:e})}async uploadImage(e){let n=new FormData;return n.append("files",e),n.append("type","post"),await this.fileUpload("config/img/upload",n)}async videoPostPublish(e,n,t,r,i,s,a,o){return await this._dna_request("forum/moderator/postPublish",{content:e,draftId:n,gameForumId:t,gameId:r,h5Content:i,postTitle:s,postType:a,topics:o})}async viewCount(e,n){return await this._dna_request("forum/viewCount",{gameId:e,postId:n})}}var Be;((r)=>{r[r.TEXT=1]="TEXT";r[r.IMAGE=2]="IMAGE";r[r.VIDEO=5]="VIDEO"})(Be||={});var l=268;import*as x from"node-forge";var fe="159",pe="10456",oe="1969162350523490",ue="e1efe6e74f2ae46f87231bb519d3a304",T="HJgwHbASKFT9P9WeGVZhaHi5V",j="VmqVoGcCRsUggpXrEQpbttkTLftuIJveD3okOVWpcOEc5vDc13",ae="459",Ce="la3nh98r46032fn90tzl";function me(e){let n=x.md5.create().update(e).digest();return x.util.encode64(n.toHex().toLowerCase())}function Le(...e){let n=new Map;for(let a=0;a<e.length-1;a+=2){let o=e[a],u=e[a+1];if(o&&u)n.set(o,u)}let t=Array.from(n.keys()).filter((a)=>a!=="sign").sort(),r=[];for(let a of t){let o=n.get(a);if(o&&o.length>0)r.push(`${a}=${o}`)}r.push(Ce);let i=r.join("&"),s=x.md.md5.create();return s.update(i),s.digest().toHex()}function we(e){let n=x.util.encodeUtf8(e);return x.util.encode64(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"")}function xe(e){let n=JSON.stringify(e),t=we(n);if(t.length>51)return Re(t);return t}function Re(e){let n=e.split(""),t=[[1,33],[10,42],[18,50],[19,51]];for(let[r,i]of t)if(r<n.length&&i<n.length)[n[r],n[i]]=[n[i],n[r]];return n.join("")}function Z(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e)=>{let n=Math.floor(Math.random()*16);return(e==="x"?n:n&3|8).toString(16)})}function Q(e){let t={...{gid:fe,osh:"1280",gaid:Z(),nt:"1",dn:Z(),imsi:"",osw:"720",apiVersion:"1",osVersion:"9",gfsid:L(16),deviceMode:"NX627J",plat:"0",lang:"zh_CN",vc:"5",svc:"50008",af_version:"",ov:"9",svn:"5.0.0.08",afid:"",oriDev:"0",tsid:L(32),tusid:"0",tcsid:"0",vn:"1.1.1",imei:"",upv:"0",pk:"com.herodna.oversea",projectId:pe,tdn:Z()},...e},r=xe(t),i=Math.floor(Date.now()/1000).toString(),s=Le("pcode",ae,"data",r,"timestamp",i);return new URLSearchParams({pcode:ae,data:r,sign:s,timestamp:i}).toString()}class E extends c{async loginLog(){return await this._dna_request("user/login/log")}async blockList(){return await this._dna_request("user/block/list")}async canEditNickName(){return await this._dna_request("user/canUpdateNameTimes")}async cancel(e,n,t,r,i){return await this._dna_request("user/more/cancel",{cancelType:e,operateType:n,position:t,cancelReason:r,reasonDetail:i})}async cleanToken(){return await this._dna_request("user/cleanToken")}async editGender(e){return await this._dna_request("user/editGender",{gender:e})}async editNickName(e){return await this._dna_request("user/updateName",{userName:e})}async getCommonConfig(){return await this._dna_request("config/getCommonConfig")}async getConfig(){return await this._dna_request("config/getConfig")}async getConfigSwitch(){return await this._dna_request("config/switchAll")}async getModeratorPermission(){return await this._dna_request("user/moderator/getModeratorPermission")}async getOpenScreen(){return await this._dna_request("config/getOpenScreen")}async getPublicKey(){return await this._dna_request("config/getRsaPublicKey")}async getUserGame(){return await this._dna_request("user/getUserGame")}async getWikiData(){return await this._dna_request("config/getGameWiki")}async haveOfficialRole(){return await this._dna_request("role/haveOfficialRole")}async isRedPoint(){return await this._dna_request("forum/dynamic/isRedPoint")}async login(e,n){let t={code:n,devCode:this.dev_code,gameList:l,loginType:1,mobile:e},r=await this._dna_request("user/sdkLogin",t,{sign:!0});if(r.is_success&&r.data){let i=r.data;if(typeof i.token==="string")this.token=i.token}return r}async sendEmailVerifyCode(e){let t=Q({emailType:"updateCode",email:e,accessToken:""});return await(await(this.fetchFn||fetch)(`https://hgsdkeu.herogame.com/hgsrv/v1/email/sendVerifyCode?${t}`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"}})).json()}async loginEmail(e,n,t,r){let i={devCode:this.dev_code,loginType:1,email:e,pwd:`${me(n)}
5
- `,cUid:t,gameList:l,accessToken:r},s=await this._dna_request("user/login",i,{sign:!0});if(s.is_success&&s.data){let a=s.data;if(typeof a.token==="string")this.token=a.token}return s}async emailVerify(e,n){let r=Q({email:e,code:n,emailWithPwd:"0",accessToken:""});return await(await(this.fetchFn||fetch)(`https://hgsdkeu.herogame.com/hgsrv/v2/email/login?${r}`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:""})).json()}async oneTapLoginRestriction(){return await this._dna_request("user/oneTapLoginRestriction")}async recommendConfig(){return await this._dna_request("forum/recommend/config")}async refreshToken(e){return await this._dna_request("user/refreshToken",{refreshToken:e})}async register(e,n,t,r,i){return await this._dna_request("user/register",{code:e,devCode:n,gameList:t,mobile:r,password:i})}async saveUserInfo(e,n,t,r){return await this._dna_request("user/saveUserInfo",{gender:e,headCode:n,headUrl:t,userName:r})}async sendSms(e,n,t){return await this._dna_request("user/getSmsCode",{mobile:e,isCaptcha:t,vJson:n})}async signature(e){return await this._dna_request("user/edit/signature",{newSignature:e})}async updateHeadCode(e){return await this._dna_request("user/updateHeadCode",{headCode:e})}async updateHeadUrl(e){return await this._dna_request("user/updateHeadUrl",{headUrl:e})}async updateProfileBg(e){return await this._dna_request("user/updateBg",{bgUrl:e})}async uploadHead(e){let n=new FormData;return n.append("parts",e),await this.fileUpload("user/img/uploadHead",n)}async uploadProfileBg(e){let n=new FormData;return n.append("parts",e),await this.fileUpload("user/img/uploadMineBg",n)}async getEmoji(){return await this._dna_request("config/getEmoji")}async getGameConfig(){return await this._dna_request("config/getGameConfig")}async getGameHeadCode(){return await this._dna_request("user/getGameHeadCode")}async facebookLogin(e){let n={accessToken:e,devCode:this.dev_code,gameList:l,loginType:1},t=await this._dna_request("user/sdkLogin",n,{sign:!0});if(t.is_success&&t.data){let r=t.data;if(typeof r.token==="string")this.token=r.token}return t}async twitterLogin(e,n){let t={accessToken:e,accessTokenSecret:n,devCode:this.dev_code,gameList:l,loginType:5},r=await this._dna_request("user/sdkLogin",t,{sign:!0});if(r.is_success&&r.data){let i=r.data;if(typeof i.token==="string")this.token=i.token}return r}async getFacebookAccessToken(e,n){let r=new URLSearchParams({client_id:oe,client_secret:ue,code:e,redirect_uri:n});return(await(await(this.fetchFn||fetch)(`https://graph.facebook.com/v19.0/oauth/access_token?${r.toString()}`)).json()).access_token}async getTwitterAccessToken(e,n){let r=Math.floor(Date.now()/1000).toString(),i=L(32),s=new URLSearchParams({oauth_consumer_key:T,oauth_nonce:i,oauth_signature_method:"HMAC-SHA1",oauth_timestamp:r,oauth_token:e,oauth_verifier:n,oauth_version:"1.0"}),a=`POST&${encodeURIComponent("https://api.twitter.com/oauth/access_token")}&${encodeURIComponent(s.toString())}`,o=`${encodeURIComponent(j)}&`,u=await this.generateHmacSha1Signature(o,a),A=`OAuth oauth_consumer_key="${T}", oauth_nonce="${i}", oauth_signature="${encodeURIComponent(u)}", oauth_signature_method="HMAC-SHA1", oauth_timestamp="${r}", oauth_token="${e}", oauth_verifier="${n}", oauth_version="1.0"`,N=await(await(this.fetchFn||fetch)("https://api.twitter.com/oauth/access_token",{method:"POST",headers:{Authorization:A}})).text(),m=new URLSearchParams(N);return{accessToken:m.get("oauth_token")||"",accessTokenSecret:m.get("oauth_token_secret")||"",userId:m.get("user_id")||"",screenName:m.get("screen_name")||""}}async getTwitterRequestToken(e){let t=Math.floor(Date.now()/1000).toString(),r=L(32),i=new URLSearchParams({oauth_callback:e,oauth_consumer_key:T,oauth_nonce:r,oauth_signature_method:"HMAC-SHA1",oauth_timestamp:t,oauth_version:"1.0"}),s=`POST&${encodeURIComponent("https://api.twitter.com/oauth/request_token")}&${encodeURIComponent(i.toString())}`,a=`${encodeURIComponent(j)}&`,o=await this.generateHmacSha1Signature(a,s),u=`OAuth oauth_callback="${encodeURIComponent(e)}", oauth_consumer_key="${T}", oauth_nonce="${r}", oauth_signature="${encodeURIComponent(o)}", oauth_signature_method="HMAC-SHA1", oauth_timestamp="${t}", oauth_version="1.0"`,w=await(await(this.fetchFn||fetch)("https://api.twitter.com/oauth/request_token",{method:"POST",headers:{Authorization:u}})).text(),N=new URLSearchParams(w);return{oauthToken:N.get("oauth_token")||"",oauthTokenSecret:N.get("oauth_token_secret")||"",oauthCallbackConfirmed:N.get("oauth_callback_confirmed")==="true"}}async generateHmacSha1Signature(e,n){let t=new TextEncoder,r=t.encode(e),i=t.encode(n),s=await crypto.subtle.importKey("raw",r,{name:"HMAC",hash:"SHA-1"},!1,["sign"]),a=await crypto.subtle.sign("HMAC",s,i),o=Array.from(new Uint8Array(a));return btoa(String.fromCharCode(...o))}}class H extends c{async addAddress(e,n,t){return await this._dna_request("user/more/userAddressAdd",{receiverName:e,receiverMobile:n,receiverAddress:t})}async apply(e,n,t,r,i,s,a,o){return await this._dna_request("user/creator/apply",{type:e,id:n,concatWay:t,otherPlatform:r,otherPlatformUrl:i,otherPlatformFans:s,materialUrl:a,gameId:o})}async awardList(e){return await this._dna_request("encourage/draw/awardList",{drawId:e})}async awardWin(e,n,t,r){return await this._dna_request("/encourage/draw/awardWin",{drawId:e,fullName:n,mobile:t,address:r})}async buyGold(e,n){return await this._dna_request("encourage/draw/buy",{drawId:e,count:n})}async buyProduct(e,n,t,r){return await this._dna_request("/encourage/store/buyProduct",{address:e,fullName:n,mobile:t,productId:r})}async deleteAddress(e){return await this._dna_request("user/more/deleteUserAddress",{addressId:e})}async drawDetail(e){return await this._dna_request("encourage/draw/detail",{drawId:e})}async editAddress(e,n,t,r){return await this._dna_request("user/more/userAddressEdit",{addressId:e,receiverName:n,receiverMobile:t,receiverAddress:r})}async getAliProductConfig(){return await this._dna_request("encourage/store/ali/getAliStoreConfigAndBanner")}async getAliProductList(e,n,t){return await this._dna_request("encourage/store/ali/productList",{gameId:e,pageIndex:n,pageSize:t})}async getApplyPage(){return await this._dna_request("user/creator/getApplyPage")}async getExpLogsList(e,n,t){return await this._dna_request("encourage/level/getExpLogs",{gameId:e,pageIndex:n,pageSize:t})}async getGameCreator(){return await this._dna_request("config/identification/getGameCreator")}async getGoldDetailList(e,n,t,r){return await this._dna_request("encourage/gold/getGoldLogs",{pageIndex:e,pageSize:n,type:t,storeType:r})}async getProductList(e,n,t,r){return await this._dna_request("encourage/store/productList",{gameId:e,pageIndex:n,pageSize:t,storeType:r})}async getTotalGold(e){if(e!==void 0)return await this._dna_request("encourage/gold/getTotalGold",{type:e});return await this._dna_request("encourage/gold/getTotalGold")}async getUserAddress(e,n){return await this._dna_request("user/more/getUserAddress",{userId:e,type:n})}async getUserGameLevel(e,n,t){return await this._dna_request("encourage/level/getUserGameLevelDetail",{gameId:e,ifProcess:n,otherUserId:t})}async getUserGameTaskProcess(e,n){return await this._dna_request("encourage/level/getTaskProcess",{gameId:e,userId:n})}async list(e,n,t,r){return await this._dna_request("encourage/draw/list",{pageIndex:e,pageSize:n,queryType:t,gameId:r})}async page(){return await this._dna_request("user/creator/page")}async productDetail(e){return await this._dna_request("encourage/store/productDetail",{productId:e})}async setDefaultAddress(e){return await this._dna_request("user/more/setDefaultAddress",{addressId:e})}async uploadImage(e){let n=new FormData;return n.append("parts",e),await this.fileUpload("user/img/uploadHead",n)}}class X extends c{base_param={game_id:2277,lang:"zh"};async getTokenForCs(e=l){return this._dna_request(`/role/getTokenForCs?game_id=${e}`)}async sdkMoyuLogin(e){return this._dna_request_kf("/v1/public/login/sdkMoyuLogin",{...this.base_param,token:e},{method:"GET"})}async sdkLogin(){let e=await this.getTokenForCs();if(e.data?.token){let n=await this.sdkMoyuLogin(e.data.token);if(n.data)this.kf_token=n.data.token;return n}return e}async getUserInfo(){return this._dna_request_kf("/v1/frontend/login/getUserInfo",this.base_param,{method:"GET"})}async getRole(){return this._dna_request_kf("/v1/frontend/role/getRole",this.base_param,{method:"GET"})}async sendGameMail(e,n=29046){return this._dna_request_kf("/v1/public/role/sendGameMail",{...this.base_param,server_id:n,role:e})}async verifyRoleMailCode(e){return this._dna_request_kf("/v1/frontend/role/verify",{...this.base_param,mail_code:e})}async getServerType(e=2277){return this._dna_request_kf("/v1/public/select/serverType",{...this.base_param,game_id:e},{method:"GET"})}async getServerList(e=230){return this._dna_request_kf("/v1/public/select/getServerList",{...this.base_param,server_type:e},{method:"GET"})}async getPropCategory(){return this._dna_request_kf("/v1/public/selfService/getPropCategory",this.base_param,{method:"GET"})}async queryFlow(e,n,t,r="Resource",i,s=29046){return this._dna_request_kf("/v1/frontend/selfService/queryFlow",{...this.base_param,date:e,name:n,role:t,server_id:s,category_id:r,next_cursor:i})}async bindRole(e,n,t){return this._dna_request_kf("/v1/frontend/role/bindRole",{server_id:e,role:n,mail_code:t})}async captcha(){return this._dna_request_kf("/v1/public/login/captcha",void 0,{method:"GET"})}async sendVerifyCode(e,n){return this._dna_request_kf("/v1/public/login/sendSms",{...this.base_param,phone:e,code:n,type:"login"})}async loginByPhone(e,n){let t=await this._dna_request_kf("/v1/public/login/byphone",{...this.base_param,code:n,phone:e});if(t.is_success&&t.data?.token)this.kf_token=t.data.token;return t}}class he extends _{game;home;profile;setting;trend;user;kf;userGrowing;h5;constructor(e={}){super(e);this.game=new G(this),this.home=new U(this),this.profile=new M(this),this.setting=new V(this),this.trend=new v(this),this.user=new E(this),this.userGrowing=new H(this),this.h5=new O(this),this.kf=new X(this)}static generateDeviceCode(){return`2${L(32)}`}async initialize(){await this.initializeSignConfig()}get GAME_ID(){return l}async getMhSwitchStatus(){return await this.game.getMhSwitchStatus()}async updateMhSwitchStatus(e){return await this.game.updateMhSwitchStatus(e)}async soulTask(){return await this.game.soulTask()}async defaultRoleForTool(e=1,n){return await this.game.defaultRoleForTool(e,n)}async getRoleDetail(e,n,t){return await this.game.getRoleDetail(e,n,t)}async getWeaponDetail(e,n,t){return await this.game.getWeaponDetail(e,n,t)}async getShortNoteInfo(){return await this.game.getShortNoteInfo()}async getPostList(e=48,n=1,t=20,r=1,i=0){return await this.home.getPostList(e,n,t,r,i)}async getPostDetail(e){return await this.home.getPostDetail(e)}async getPostByTopic(e=177,n=1,t=20,r=1,i=0){return await this.home.getPostByTopic(e,n,t,r,i)}async getTaskProcess(){return await this.home.getTaskProcess()}async haveSignIn(){return await this.home.haveSignIn()}async signCalendar(){return await this.home.signCalendar()}async gameSign(e,n){return await this.home.gameSignIn(e,n)}async getActivityList(e,n,t){return await this.home.getActivityList(e,n,t)}async bbsSign(){return await this.home.bbsSign()}async getRoleList(){return await this.profile.roleManager()}async adminAdjustScore(e,n,t){return await this.home.adminAdjustScore(e,n,t)}async adminDelete(e,n,t){return await this.home.adminDelete(e,n,t)}async adminMovePost(e,n,t,r){return await this.home.adminMovePost(e,n,t,r)}async adminRefreshTime(e,n){return await this.home.adminRefreshTime(e,n)}async blockList(){return await this.home.blockList()}async blockOther(e,n,t){return await this.home.blockOther(e,n,t)}async collect(e,n,t=1){return await this.home.collect(e,n,t)}async commentDelete(e,n,t,r){return await this.home.commentDelete(e,n,t,r)}async createComment(e,n){return await this.home.createComment(e,n)}async createReply(e,n){return await this.home.createReply(e,n)}async createReplyList(e,n){return await this.home.createReplyList(e,n)}async deletePost(e,n){return await this.home.deletePost(e,n)}async followUser(e,n){return await this.home.followUser(e,n)}async getFollowState(e){return await this.home.getFollowState(e)}async getDoujin(e){return await this.home.getDoujin(e)}async getExchange(e){return await this.home.getExchange(e)}async getGameBanner(e=l){return await this.home.getGameBanner(e)}async getPostCommentList(e,n=1,t=20,r=0){return await this.home.getPostCommentList(e,n,t,r)}async getRankList(e){return await this.home.getRankList(e)}async getRecommendPosts(e=l,n=1,t=20){return await this.home.getRecommendPosts(e,n,t)}async getReplyList(e,n,t=1,r=20){return await this.home.getReplyList(e,n,t,r)}async getStatistics(e=l){return await this.home.getStatistics(e)}async getTips(){return await this.home.getTips()}async getWalkthrough(e){return await this.home.getWalkthrough(e)}async hotList(e=1,n=l){return await this.home.hotList(e,n)}async isRedPoint(){return await this.home.isRedPoint()}async likePost(e){return await this.home.like(e)}async lockPost(e,n){return await this.home.lockPost(e,n)}async postDownOrUp(e,n){return await this.home.postDownOrUp(e,n)}async postElite(e,n){return await this.home.postElite(e,n)}async postHide(e,n){return await this.home.postHide(e,n)}async reRank(e,n){return await this.home.reRank(e,n)}async receiveLog(e,n,t){return await this.home.receiveLog(e,n,t)}async recommendList(e,n,t,r,i=l){return await this.home.recommendList(e,n,t,r,i)}async report({commentId:e=0,postId:n=0,replyId:t=0},r=1,i=1){return await this.home.report({commentId:e,postId:n,replyId:t},r,i)}async searchPost(e,n,t,r=l,i=1){return await this.home.searchPost(e,n,t,r,i)}async searchTopic(e,n,t=20,r=l){return await this.home.searchTopic(e,n,t,r)}async searchUser(e,n,t){return await this.home.searchUser(e,n,t)}async shareTask(){return await this.home.shareTask()}async strongRecommend(e,n=1){return await this.home.strongRecommend(e,n)}async viewCommunity(){return await this.home.viewCommunity()}async viewCount(e,n=l){return await this.home.viewCount(e,n)}async loginLog(){return await this.user.loginLog()}async login(e,n){return await this.user.login(e,n)}async getSmsCode(e,n){return await this.user.sendSms(e,n,1)}async getMine(e="",n=1,t=0){return await this.profile.mine(e,n,t)}async getOtherMine(e="709542994134436647",n=1,t=2){return await this.profile.mine(e,n,t)}async canEditNickName(){return await this.user.canEditNickName()}async cleanToken(){return await this.user.cleanToken()}async editGender(e){return await this.user.editGender(e)}async editNickName(e){return await this.user.editNickName(e)}async getCommonConfig(){return await this.user.getCommonConfig()}async getConfig(){return await this.user.getConfig()}async getConfigSwitch(){return await this.user.getConfigSwitch()}async getModeratorPermission(){return await this.user.getModeratorPermission()}async getOpenScreen(){return await this.user.getOpenScreen()}async getPublicKey(){return await this.user.getPublicKey()}async getUserGame(){return await this.user.getUserGame()}async getWikiData(){return await this.user.getWikiData()}async haveOfficialRole(){return await this.user.haveOfficialRole()}async oneTapLoginRestriction(){return await this.user.oneTapLoginRestriction()}async recommendConfig(){return await this.user.recommendConfig()}async refreshToken(e){return await this.user.refreshToken(e)}async register(e,n,t,r,i){return await this.user.register(e,n,t,r,i)}async saveUserInfo(e,n,t,r){return await this.user.saveUserInfo(e,n,t,r)}async signature(e){return await this.user.signature(e)}async updateHeadCode(e){return await this.user.updateHeadCode(e)}async updateHeadUrl(e){return await this.user.updateHeadUrl(e)}async updateProfileBg(e){return await this.user.updateProfileBg(e)}async uploadHead(e){return await this.user.uploadHead(e)}async uploadProfileBg(e){return await this.user.uploadProfileBg(e)}async getEmoji(){return await this.user.getEmoji()}async getGameConfig(){return await this.user.getGameConfig()}async getGameHeadCode(){return await this.user.getGameHeadCode()}async facebookLogin(e){return await this.user.facebookLogin(e)}async twitterLogin(e,n){return await this.user.twitterLogin(e,n)}async getFacebookAccessToken(e,n){return await this.user.getFacebookAccessToken(e,n)}async getTwitterAccessToken(e,n){return await this.user.getTwitterAccessToken(e,n)}async getTwitterRequestToken(e){return await this.user.getTwitterRequestToken(e)}async getMapCategorizeList(){return await this.h5.getMapCategorizeList()}async getMapDetail(e){return await this.h5.getMapDetail(e)}async getMapSiteDetail(e){return await this.h5.getMapSiteDetail(e)}async getEmojiList(){return await this.h5.getEmojiList()}async getMapMatterCategorizeOptions(){return await this.h5.getMapMatterCategorizeOptions()}async blackUser(e,n){return await this.profile.blackUser(e,n)}async cleanFansNew(e,n){return await this.profile.cleanFansNew(e,n)}async defaultRole(e,n=1){return await this.profile.defaultRole(e,n)}async deleteRole(e){return await this.profile.deleteRole(e)}async draftDelete(e){return await this.profile.draftDelete(e)}async fans(e,n,t,r){return await this.profile.fans(e,n,t,r)}async fastBind(){return await this.profile.fastBind()}async follow(e,n,t,r){return await this.profile.follow(e,n,t,r)}async getApplyStatus(){return await this.profile.getApplyStatus()}async getDraftList(e,n){return await this.profile.getDraftList(e,n)}async getMineComment(e,n,t,r){return await this.profile.getMineComment(e,n,t,r)}async getMinePost(e,n,t,r,i,s){return await this.profile.getMinePost(e,n,t,r,i,s)}async getProfileNotifySwitch(){return await this.profile.getNotifySwitch()}async historyView(e,n){return await this.profile.historyView(e,n)}async likeProfilePost(e){return await this.profile.like(e)}async manualBound(e,n,t){return await this.profile.manualBound(e,n,t)}async mine(e,n,t,r){return await this.profile.mine(e,n,t,r)}async mineV2(e){return await this.profile.mineV2(e)}async moderatorByGame(e){return await this.profile.moderatorByGame(e)}async muteCancel(e){return await this.profile.muteCancel(e)}async muteUser(e,n,t,r,i){return await this.profile.muteUser(e,n,t,r,i)}async resetDefault(e){return await this.profile.resetDefault(e)}async addAddress(e,n,t){return await this.setting.addAddress(e,n,t)}async cancelCode(e){return await this.setting.cancelCode(e)}async cancel(e,n,t,r,i){return await this.setting.cancel(e,n,t,r,i)}async deleteAddress(e){return await this.setting.deleteAddress(e)}async editAddress(e,n,t,r){return await this.setting.editAddress(e,n,t,r)}async feedback(e,n,t,r){return await this.setting.feedback(e,n,t,r)}async getCancelStatus(){return await this.setting.getCancelStatus()}async getPrivateSet(){return await this.setting.getPrivateSet()}async getUserAddress(e,n){return await this.setting.getUserAddress(e,n)}async getUserBlackList(e,n){return await this.setting.getUserBlackList(e,n)}async msgListDetail(e,n,t){return await this.setting.msgListDetail(e,n,t)}async postListDetail(e,n,t){return await this.setting.postListDetail(e,n,t)}async privateSet(e,n){return await this.setting.privateSet(e,n)}async sendSms(e,n,t){return await this.setting.sendSms(e,n,t)}async setDefaultAddress(e){return await this.setting.setDefaultAddress(e)}async setNotifySwitch(e,n){return await this.setting.setNotifySwitch(e,n)}async uploadFeedBack(e){return await this.setting.uploadFeedBack(e)}async draftSave(e,n,t,r,i,s,a){return await this.trend.draftSave(e,n,t,r,i,s,a)}async getConfigTopicByGameId(e,n){return await this.trend.getConfigTopicByGameId(e,n)}async getPostPublishPage(){return await this.trend.getPostPublishPage()}async getRecommend(e,n){return await this.trend.getRecommend(e,n)}async getVodToken(e,n){return await this.trend.getVodToken(e,n)}async trendList(e,n,t){return await this.trend.list(e,n,t)}async parseLink(e){return await this.trend.parseLink(e)}async posAdminEdit(e,n,t,r,i,s,a,o,u){return await this.trend.posAdminEdit(e,n,t,r,i,s,a,o,u)}async postEdit(e,n,t,r,i,s,a,o){return await this.trend.postEdit(e,n,t,r,i,s,a,o)}async postPublish(e,n,t,r,i,s,a,o){return await this.trend.postPublish(e,n,t,r,i,s,a,o)}async safeCheck(e){return await this.trend.safeCheck(e)}async uploadImage(e){return await this.trend.uploadImage(e)}async videoPostPublish(e,n,t,r,i,s,a,o){return await this.trend.videoPostPublish(e,n,t,r,i,s,a,o)}async apply(e,n,t,r,i,s,a,o){return await this.userGrowing.apply(e,n,t,r,i,s,a,o)}async awardList(e){return await this.userGrowing.awardList(e)}async awardWin(e,n,t,r){return await this.userGrowing.awardWin(e,n,t,r)}async buyGold(e,n){return await this.userGrowing.buyGold(e,n)}async buyProduct(e,n,t,r){return await this.userGrowing.buyProduct(e,n,t,r)}async drawDetail(e){return await this.userGrowing.drawDetail(e)}async getAliProductConfig(){return await this.userGrowing.getAliProductConfig()}async getAliProductList(e,n,t){return await this.userGrowing.getAliProductList(e,n,t)}async getApplyPage(){return await this.userGrowing.getApplyPage()}async getExpLogsList(e,n,t){return await this.userGrowing.getExpLogsList(e,n,t)}async getGameCreator(){return await this.userGrowing.getGameCreator()}async getGoldDetailList(e,n,t,r){return await this.userGrowing.getGoldDetailList(e,n,t,r)}async getProductList(e,n,t,r){return await this.userGrowing.getProductList(e,n,t,r)}async getTotalGold(e){return await this.userGrowing.getTotalGold(e)}async getUserGameLevel(e,n,t){return await this.userGrowing.getUserGameLevel(e,n,t)}async getUserGameTaskProcess(e,n){return await this.userGrowing.getUserGameTaskProcess(e,n)}async list(e,n,t,r){return await this.userGrowing.list(e,n,t,r)}async page(){return await this.userGrowing.page()}async productDetail(e){return await this.userGrowing.productDetail(e)}}export{W as xor_encode,re as swapForUploadImgApp,z as sign_shuffled,be as shuffle_md5,q as rsa_encrypt,L as rand_str2,y as rand_str,K as md5_upper,le as generate_sa,te as build_upload_signature,ne as build_signature122,ee as build_signature120,se as build_signature111,De as build_sign_string,ie as aesDecryptImageUrl,H as UserGrowingAPI,E as UserAPI,v as TrendAPI,h as TimeBasicResponse,V as SettingAPI,k as RespCode,M as ProfileAPI,Be as PostContentType,X as KFAPI,U as HomeAPI,O as H5API,G as GameAPI,l as DNA_GAME_ID,c as DNASubModule,_ as DNABaseAPI,he as DNAAPI};
4
+ -----END PUBLIC KEY-----`,i=p.pki.publicKeyFromPem(r),s=p.util.encodeUtf8(e),a=117,o="";for(let u=0;u<s.length;u+=a)o+=i.encrypt(s.slice(u,u+a));return p.util.encode64(o)}catch(t){throw Error(`[DNA] RSA 加密失败: ${t.message}`)}}function h(e=16){let t="";for(let r=0;r<e;r++)t+="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".charAt(Math.floor(Math.random()*62));return t}function w(e=16){let t="";for(let r=0;r<e;r++)t+="abcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(Math.random()*36));return t}class z{multiplier=0x5deece66dn;addend=0xbn;mask=(1n<<48n)-1n;seed;constructor(e=BigInt(Date.now())){this.seed=(e^this.multiplier)&this.mask}next(e){return this.seed=this.seed*this.multiplier+this.addend&this.mask,Number(this.seed>>BigInt(48-e))}nextInt(e){if(e<=0)throw Error("bound must be positive");if((e&-e)===e)return Number(BigInt(e)*BigInt(this.next(31))>>31n);let n=0,t=0;do n=this.next(31),t=n%e;while(n-t+(e-1)<0);return t}}function De(e){let t=new z,r="";for(let i=0;i<e;i++)r+="01234567890123456789012345678901234567890123456789010123456789".charAt(t.nextInt(62));return r}function ee(e){let n=p.md.md5.create();return n.update(e),n.digest().toHex().toUpperCase()}function le(e){if(e.length<=23)return e;let n=e.split(""),t=[[1,13],[5,17],[7,23]];for(let[r,i]of t)[n[r],n[i]]=[n[i],n[r]];return n.join("")}function Ne(){let e=h(17),n=Date.now().toString(),t=[],r=0,i=0;for(let u=0;u<30;u++)if(8<=u&&u<=12)t.push(n[i]),i++;else if(16<=u&&u<=20)t.push(n[i]),i++;else if(22<=u&&u<=24)t.push(n[i]),i++;else t.push(e[r]),r++;let s=t.join(""),a=s.split("");for(let[u,N]of[[2,23],[9,17],[13,25]])[a[u],a[N]]=[a[N],a[u]];let o=a.join("");return[s,o]}function Ae(e,n){let t=Object.keys(e).sort(),r=[];for(let i of t){let s=e[i];if(s!==null&&s!==void 0&&s!=="")r.push(`${i}=${s}`)}return r.push(n),r.join("&")}function O(e,n){let t=Ae(e,n),r=ee(t);return le(r)}function _(e,n){let t=new TextEncoder,r=t.encode(e),i=t.encode(n),s=[];for(let a=0;a<r.length;a++){let o=(r[a]&255)+(i[a%i.length]&255);s.push(`@${o}`)}return s.join("")}function ne(e,n,t){let r=h(16),[i,s]=Ne(),a={};for(let[m,f]of Object.entries(n))a[m]=String(f);let o={...a};if(t)o.token=t;o.sa=i;let u=O(o,r),N=_(u,r),l=`${I(r,e)},${N}`;return{rk:r,tn:l,sa:s}}function G(e,n,t){if(n<0||t<0||n>=e.length||t>=e.length)return e;let r=e.split("");return[r[n],r[t]]=[r[t],r[n]],r.join("")}function de(e,n=Date.now()){let t=e;t=G(t,7,11),t=G(t,18,26),t=G(t,12,22),t=G(t,3,15);let r=String(n);if(t.length!==30||r.length<13)return t;let i=0,s=[];for(let a=0;a<t.length;a++){if(a===8||a===16)s.push(r.slice(i,i+5)),i+=5;else if(a===22)s.push(r.slice(i,i+3)),i+=3;s.push(t[a])}return s.join("")}function te(e,n,t){let r=h(16),i=h(30),s=de(i),a={};for(let[m,f]of Object.entries(n))a[m]=String(f);let o={...a};if(t)o.token=t;o.sa=i;let u=O(o,r),N=_(u,r),l=`${I(r,e)},${N}`;return{rk:r,tn:l,sa:s}}function qe(e,n,t){let r=h(16),i=De(30),s={};for(let[L,l]of Object.entries(n))s[L]=String(l);if(t)s.token=t;s.sa=i;let a=O(s,r),o=_(a,r),N=`${I(r,e)},${o}`;return{rk:r,tn:N,sa:i}}function re(e){let n=h(16),t=I(n,e);return{signature:ie(t),key:n}}function ie(e){let n=e.split(""),t=[[3,23],[11,32],[22,42],[25,48]];for(let[r,i]of t)if(r<n.length&&i<n.length)[n[r],n[i]]=[n[i],n[r]];return n.join("")}function se(e,n){let t=ie(e),r=p.util.decode64(t),i=p.cipher.createDecipher("AES-CBC",n);return i.start({iv:"A-16-Byte-String"}),i.update(p.util.createBuffer(r)),i.finish(),i.output.getBytes()}function Be(e){function n(t,r){let i=t.split("");for(let s=1;s<r.length;s+=2){let a=r[s-1],o=r[s];if(a>=0&&a<i.length&&o>=0&&o<i.length)[i[a],i[o]]=[i[o],i[a]]}return i.join("")}return n(ee(e),[1,13,5,17,7,23])}function fe(e,n){let t=[],r=Object.keys(e).sort();for(let s of r){let a=e[s];if(a!==null&&a!==void 0&&a!=="")t.push(`${s}=${a}`)}let i=t.join("&");return Be(`${i}&${n}`)}function ae(e,n){let t=Date.now(),r={...e,timestamp:t,token:n},i=h(16),s=fe(r,i);return{s:_(s,i),t,k:i}}class T{fetchFn;RSA_PUBLIC_KEY="MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDGpdbezK+eknQZQzPOjp8mr/dP+QHwk8CRkQh6C6qFnfLH3tiyl0pnt3dePuFDnM1PUXGhCkQ157ePJCQgkDU2+mimDmXh0oLFn9zuWSp+U8uLSLX3t3PpJ8TmNCROfUDWvzdbnShqg7JfDmnrOJz49qd234W84nrfTHbzdqeigQIDAQAB";BASE_URL="https://dnabbs-api.yingxiong.com/";BASE_WEB_SOCKET_URL="wss://dnabbs-api.yingxiong.com:8180/ws-community-websocket";KF_BASE_URL="https://kf.yingxiong.com/";uploadKey="";sign_api_urls=new Set;baseHeaders={};dev_code="";token="";kf_token="";debug=!1;cookieToken="";_server="cn";get server(){return this._server}set server(e){if(this._server=e,e==="global")this.BASE_URL="https://lunoloft-api.yingxiong.com/",this.BASE_WEB_SOCKET_URL="wss://lunoloft-api.yingxiong.com:8181/ws-community-websocket";else this.BASE_URL="https://dnabbs-api.yingxiong.com/",this.BASE_WEB_SOCKET_URL="wss://dnabbs-api.yingxiong.com:8180/ws-community-websocket";this.updateHeaders()}_mode="ios";get mode(){return this._mode}set mode(e){this._mode=e,this.updateHeaders()}_lang="zh-Hans";get lang(){return this._lang}set lang(e){this._lang=e,this.updateHeaders()}constructor(e={}){if(e.server==="global")this.server="global";else this.server="cn";if(this.fetchFn=e.fetchFn,e.mode!==void 0)this.mode=e.mode;if(e.lang!==void 0)this.lang=e.lang;if(e.rsa_public_key!==void 0)this.RSA_PUBLIC_KEY=e.rsa_public_key;if(e.dev_code!==void 0)this.dev_code=e.dev_code;else this.dev_code=T.generateDeviceCode();if(e.token!==void 0)this.token=e.token;if(e.kf_token!==void 0)this.kf_token=e.kf_token;if(e.debug)this.debug=!0}static generateDeviceCode(){return`2${w(32)}`}updateHeaders(){if(this.mode==="android")this.baseHeaders={countrycode:"CN",version:this.server==="cn"?"1.2.2":"1.1.1",versioncode:this.server==="cn"?"9":"5",source:"android",lang:this.lang,"Content-Type":"application/x-www-form-urlencoded","User-Agent":this.server==="cn"?"okhttp/3.10.0":"okhttp/5.3.2"};else this.baseHeaders={countrycode:"CN",version:this.server==="cn"?"1.2.0":"1.1.1",versioncode:this.server==="cn"?"7":"5",source:"ios",lang:this.lang,"Content-Type":"application/x-www-form-urlencoded","User-Agent":this.server==="cn"?"DoubleHelix/3 CFNetwork/3860.300.31 Darwin/25.2.0":"DoubleHelix/4 CFNetwork/3860.100.1 Darwin/25.0.0"}}async fileUpload(e,n){let t=await this._dna_request(e,n,{sign:!0});if(t.is_success&&t.data)t.data=t.data.map((r)=>se(r,this.uploadKey));return t}async getRsaPublicKey(){if(this.RSA_PUBLIC_KEY)return this.RSA_PUBLIC_KEY;let e=await this._dna_request("config/getRsaPublicKey");if(e.is_success&&e.data){let n=e.data.key;if(typeof n==="string")this.RSA_PUBLIC_KEY=n}return this.RSA_PUBLIC_KEY}async getHeaders(e){let{payload:n={},exparams:t,dev_code:r=this.dev_code,refer:i,token:s=this.token,kf_token:a=this.kf_token,h5:o,kf:u}=e||{},N={version:"3.11.0",source:"h5","Content-Type":"application/x-www-form-urlencoded","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36"},L={Authorization:a,Referer:"https://kf.yingxiong.com/kf2.0/im-chat","X-Requested-With":"com.hero.dna","Content-Type":"application/json; charset=utf-8","User-Agent":"Mozilla/5.0 (Linux; Android 16; PLQ110 Build/BP2A.250605.015; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/143.0.7499.192 Mobile Safari/537.36CP6.TgzO Hero/1.1.4"},l=o||!1,m=u?L:l?N:{...this.baseHeaders};if(r&&!u)m.devCode=r;if(i||l)m.origin="https://dnabbs.yingxiong.com",m.refer="https://dnabbs.yingxiong.com/";if(s&&!u)m.token=s;if(u&&this.cookieToken)m.Cookie=this.cookieToken;if(n instanceof FormData){let f=await this.getRsaPublicKey(),{signature:C,key:b}=re(f);if(m.t=C,this.uploadKey=b,t)for(let[A,d]of Object.entries(t))n.append(A,String(d));delete m["Content-Type"]}else if(typeof n==="object")if(!u){let f=await this.getRsaPublicKey();if(this.server==="cn")if(this.mode==="android"){let{tn:A,sa:d}=te(f,n,s);if(e?.token)m.tn=A,m.sa=d}else{let{tn:A,sa:d,rk:P}=ne(f,n,s);m.rk=P,m.tn=A,m.sa=d}if(t)Object.assign(n,t);let C=new URLSearchParams;Object.entries(n).forEach(([A,d])=>{C.append(A,String(d))});let b=n;if(n=C.toString(),!u&&this.server!=="cn"){let A=u?{}:ae(b,"");Object.assign(b,{sign:A.s,timestamp:A.t});let d=A.k,P=await this.getRsaPublicKey(),q=I(d,P);if(o)m.k=q;else m.rk=d,m.key=q}}else n=JSON.stringify(n);return{headers:m,payload:n}}async needSign(e){if(e==="config/getCommonConfig")return!1;if(this.sign_api_urls.size===0)try{await this.initializeSignConfig()}catch(n){console.error("初始化签名配置失败:",n)}finally{if(this.sign_api_urls.size===0)this.sign_api_urls=new Set(["/user/sdkLogin","/user/getSmsCode","/role/defaultRoleForTool","/media/av/cfg/getVideos","/media/av/cfg/getAudios","/media/av/cfg/getImages","/encourage/signin/signin","/user/refreshToken","/user/signIn","/role/defaultRole","/role/list","/role/getShortNoteInfo","/forum/like","/encourage/calendar/Activity/list"].map((n)=>n.replace(/^\/+/,"")))}return this.sign_api_urls.has(e)}async initializeSignConfig(){try{let e=await this._dna_request("config/getCommonConfig",void 0,{sign:!1});if(e.is_success&&e.data?.signApiConfigVo?.signApiList)this.sign_api_urls=new Set(e.data.signApiConfigVo.signApiList.map((n)=>n.replace(/^\/+/,"")))}catch(e){console.error("初始化签名配置失败:",e)}}async _dna_request_h5(e,n,t){return await this._dna_request(e,n,{...t,h5:!0})}async _dna_request_kf(e,n,t){return await this._dna_request(e,n,{...t,kf:!0})}async _dna_request(e,n,t){let{method:r="POST",sign:i,h5:s,kf:a,refer:o,params:u,max_retries:N=3,retry_delay:L=2000,timeout:l=3000}=t||{};if(e.startsWith("/"))e=e.slice(1);if(i===void 0&&await this.needSign(e))i=!0;let m;if(i){let{payload:C,headers:b}=await this.getHeaders({payload:n,refer:o,exparams:u,token:this.token,h5:s});n=C,m=b}else{let{headers:C}=await this.getHeaders({refer:o,h5:s,kf:a});m=C}if(this.debug)console.debug("[_dna_request] url:",e,"headers:",m,"data:",n);let f=null;for(let C=0;C<N;C++)try{let b=n;if(n&&typeof n==="object"&&!(n instanceof FormData))if(!a||r==="GET"){let R=new URLSearchParams;Object.entries(n).forEach(([be,K])=>{if(K!==void 0)R.append(be,String(K))}),b=R.toString()}else b=JSON.stringify(n);let A=r==="GET"?{method:r,headers:m}:{method:r,headers:m,body:b},d=new AbortController,P=setTimeout(()=>d.abort(),l),q={...A,signal:d.signal},J=a?this.KF_BASE_URL:this.BASE_URL,Y=r==="GET"?`${J}${e}${b?`?${b}`:""}`:`${J}${e}`,F=this.fetchFn?await this.fetchFn(Y,q):await fetch(Y,q);clearTimeout(P);let ce=F.headers.get("content-type")||"";if(a){let R=F.headers.get("set-cookie");if(R)this.cookieToken=R.split(";")[0]}let B;if(ce.includes("text/")){let R=await F.text();B={code:-999,data:R}}else B=await F.json();if(typeof B==="object"&&B!==null)try{if(typeof B.data==="string")B.data=JSON.parse(B.data)}catch{}if(this.debug)console.debug("[_dna_request] raw_res:",B);if(typeof B.data==="object"&&B.data!==null&&Object.keys(B.data).length===0&&e.includes("role"))throw Error("空返回值");return new y(B)}catch(b){if(b instanceof Error&&b.message.includes("AbortError"))await new Promise((A)=>setTimeout(A,L));else{console.trace(`请求失败: ${b.message}`),f=b;break}}return y.err(f?.message||"请求服务器失败,已达最大重试次数")}}class c{base;constructor(e){this.base=e}get dev_code(){return this.base.dev_code}get token(){return this.base.token}set token(e){this.base.token=e}get kf_token(){return this.base.kf_token}set kf_token(e){this.base.kf_token=e}get fetchFn(){return this.base.fetchFn}get RSA_PUBLIC_KEY(){return this.base.RSA_PUBLIC_KEY}get BASE_URL(){return this.base.BASE_URL}get uploadKey(){return this.base.uploadKey}async getRsaPublicKey(){return this.base.getRsaPublicKey()}async fileUpload(e,n){return await this.base.fileUpload(e,n)}async _dna_request(e,n,t){return this.base._dna_request(e,n,t)}async _dna_request_h5(e,n,t){return this.base._dna_request_h5(e,n,t)}async _dna_request_kf(e,n,t){return this.base._dna_request_kf(e,n,t)}async getHeaders(e){return this.base.getHeaders(e)}}class U extends c{async defaultRoleForTool(e=1,n=""){let t={otherUserId:n,type:e};return await this._dna_request("role/defaultRoleForTool",t,{sign:!0})}async getMhSwitchStatus(){return await this._dna_request("user/push/getMhSwitchStatus")}async getRoleDetail(e,n,t){let r={charId:e,charEid:n,type:1,otherUserId:t};return await this._dna_request("role/getCharDetail",r)}async getShortNoteInfo(){return await this._dna_request("role/getShortNoteInfo",void 0,{sign:!0})}async getWeaponDetail(e,n,t){let r={weaponId:e,weaponEid:n,type:1,otherUserId:t};return await this._dna_request("role/getWeaponDetail",r)}async updateMhSwitchStatus(e){return await this._dna_request("user/push/updateMhSwitchStatus",{config:e})}async soulTask(){return await this._dna_request("role/soul/task")}}class Z extends c{async getMapMatterCategorizeOptions(){return await this._dna_request_h5("map/matter/categorize/getOptions")}async getMapCategorizeList(){return await this._dna_request_h5("map/categorize/list")}async getMapDetail(e){return await this._dna_request_h5("map/detail",{id:e})}async getMapSiteDetail(e){return await this._dna_request_h5("map/site/detail",{id:e})}async getEmojiList(){return await this._dna_request_h5("config/getEmoji")}}var g=268;class M extends c{async adminAdjustScore(e,n,t,r=g){let i={postId:e,gameId:r??g,gameForumId:n,weight:t};return await this._dna_request("forum/moderator/setPostWeight",i)}async adminDelete(e,n,t){let r={postId:e.postId,gameId:e.gameId??g,gameForumId:e.gameForumId,content:n,reasonCode:t};return await this._dna_request("forum/moderator/postDelete",r)}async adminMovePost(e,n,t,r){let i={postId:e.postId,gameId:e.gameId??g,gameForumId:e.gameForumId,newGameId:n,newForumId:t,newTopicIdStr:r};return await this._dna_request("forum/moderator/postMove",i)}async adminRefreshTime(e,n){let t={postId:e.postId,gameId:e.gameId??g,gameForumId:e.gameForumId,refresh:n};return await this._dna_request("forum/moderator/setRefresh",t)}async blockList(){return await this._dna_request("user/block/list")}async blockOther(e,n,t){return await this._dna_request("user/block/other",{blockPostId:e,blockUserId:n,type:t})}async collect(e,n,t=1){let r={operateType:t,postId:e,toUserId:n};return await this._dna_request("forum/collect",r)}async commentDelete(e,n,t,r){let i={id:e.id,gameId:e.gameId,gameForumId:e.gameForumId,entityType:n,content:t,reasonCode:r};return await this._dna_request("forum/commentReplyDelete",i)}async createComment(e,n){let t=JSON.stringify([{content:n,contentType:"1"}]),r={postId:e.postId,forumId:e.gameForumId,postType:"1",content:t};return await this._dna_request("forum/comment/createComment",r,{sign:!0,params:{toUserId:e.userId}})}async createReply(e,n){let r={content:JSON.stringify([{content:n,contentType:"1",imgHeight:0,imgWidth:0,url:""}]),forumId:e.gameForumId,postCommentId:e.postCommentId,postId:e.postId,postType:"1",toUserId:e.userId};return await this._dna_request("forum/comment/createReply",r,{sign:!0,params:{toUserId:e.userId}})}async createReplyList(e,n){let r={content:JSON.stringify([{content:n,contentType:"1",imgHeight:0,imgWidth:0,url:""}]),forumId:e.gameForumId,postCommentId:e.postCommentId,postCommentReplyId:e.postCommentReplyId,postId:e.postId,postType:"1",toUserId:e.userId};return await this._dna_request("forum/comment/createReply",r,{sign:!0,params:{toUserId:e.userId}})}async deletePost(e,n){return await this._dna_request("forum/more/delete",{deleteType:e,id:n},{sign:!0,refer:!0})}async followUser(e,n){let t={followUserId:e,operateType:n?0:1};return await this._dna_request("user/followUser",t,{sign:!0})}async getFollowState(e){let n={followUserId:e};return await this._dna_request("user/isFollow",n)}async gameSignIn(e,n){let t={dayAwardId:e,periodId:n,signinType:1};return await this._dna_request("encourage/signin/signin",t,{sign:!0})}async getActivityList(e,n,t){let r=new Date;function i(s){return s.toLocaleString("zh-CN",{timeZone:"Asia/Shanghai",hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).replace(/\//g,"-")}if(!e)e=i(r);if(!n){let s=new Date("2025-12-29 00:00:00 GMT+0800"),a=new Date(r.getFullYear(),r.getMonth()-3,r.getDate());n=i(a>s?a:s)}if(!t)t=i(new Date(r.getFullYear(),r.getMonth()+3,r.getDate(),23,59));return await this._dna_request("encourage/calendar/Activity/list",{curTime:e,startTime:n,endTime:t})}async getDoujin(e){return await this._dna_request("forum/discuss/getDoujin",{forumId:e})}async getExchange(e){return await this._dna_request("forum/discuss/getExchange",{forumId:e})}async getGameBanner(e=g){return await this._dna_request("forum/gameBanner",{gameId:e})}async getPostByTopic(e=177,n=1,t=20,r=1,i=0){let s={topicId:e,gameId:g,pageIndex:n,pageSize:t,searchType:r,timeType:i};return await this._dna_request("forum/getPostByTopic",s)}async getPostCommentList(e,n=1,t=20,r=0,i=1){return await this._dna_request("forum/comment/getPostCommentList",{isOnlyPublisher:r,pageIndex:n,pageSize:t,postId:e,showOrderType:i})}async getPostDetail(e){return await this._dna_request("forum/getPostDetail",{postId:e})}async getPostList(e=48,n=1,t=20,r=1,i=0){let s={forumId:e,gameId:g,pageIndex:n,pageSize:t,searchType:r,timeType:i};return await this._dna_request("forum/list",s)}async getRankList(e){return await this._dna_request("forum/discuss/getRank",{forumId:e})}async getRecommendPosts(e=g,n=1,t=20){return await this._dna_request("forum/getRecommendPosts",{gameId:e,pageIndex:n,pageSize:t})}async getReplyList(e,n,t=1,r=20){return await this._dna_request("forum/comment/getReplyList",{postId:e,postCommentId:n,pageIndex:t,pageSize:r})}async getStatistics(e=g){return await this._dna_request("forum/statistics",{gameId:e})}async getTips(){return await this._dna_request("config/getTips")}async getWalkthrough(e){return await this._dna_request("forum/discuss/getWalkthrough",{forumId:e})}async hotList(e=1,n=g){return await this._dna_request("forum/hot/ranking/list",{gameId:n,type:e})}async haveSignIn(){let e={gameId:g};return await this._dna_request("user/haveSignInNew",e)}async isHaveSignin(){let e={gameId:g};return await this._dna_request("encourage/signin/isHaveSignin",e)}async isRedPoint(){return await this._dna_request("forum/dynamic/isRedPoint")}async signCalendar(){let e={gameId:g};return await this._dna_request("encourage/signin/show",e)}async like(e){let n={forumId:e.gameForumId,gameId:g,likeType:"1",operateType:"1",postCommentId:"",postCommentReplyId:"",postId:e.postId,postType:e.postType,toUserId:e.userId};return await this._dna_request("forum/like",n)}async lockPost(e,n){let t={postId:e.postId,gameId:e.gameId??g,gameForumId:e.gameForumId,operateType:n};return await this._dna_request("forum/moderator/postLock",t)}async postDownOrUp(e,n){let t={postId:e.postId,gameId:e.gameId??g,gameForumId:e.gameForumId,operateType:n};return await this._dna_request("forum/moderator/postDownOrUp",t)}async postElite(e,n){let t={postId:e.postId,gameId:e.gameId??g,gameForumId:e.gameForumId,operateType:n};return await this._dna_request("forum/moderator/postElite",t)}async postHide(e,n){let t={postId:e.postId,gameId:e.gameId??g,gameForumId:e.gameForumId,operateType:n};return await this._dna_request("forum/moderator/postHide",t)}async reRank(e,n){let t={postId:e.postId,gameId:e.gameId??g,gameForumId:e.gameForumId,weight:n};return await this._dna_request("forum/moderator/reRank",t)}async receiveLog(e,n,t){let r={periodId:e,pageIndex:n,pageSize:t};return await this._dna_request("encourage/signin/receiveLog",r)}async recommendList(e,n,t,r,i=g){let s={gameId:i,recIndex:e,newIndex:n,size:t,history:r};return await this._dna_request("forum/recommend/list",s)}async report({commentId:e=0,postId:n=0,replyId:t=0},r=1,i=1){let s={commentId:e,postId:n,replyId:t,reportReason:r,reportType:i};return await this._dna_request("forum/more/report",s)}async searchPost(e,n,t,r=g,i=1){let s={gameId:r,keyword:e,pageIndex:n,pageSize:t,searchType:i};return await this._dna_request("forum/searchPost",s)}async searchTopic(e,n,t=20,r=g){let i={gameId:r,keyword:e,pageIndex:n,pageSize:t};return await this._dna_request("forum/searchPost",i)}async searchUser(e,n,t){let r={keyword:e,pageIndex:n,pageSize:t};return await this._dna_request("forum/searchPost",r)}async shareTask(){let e={gameId:g};return await this._dna_request("encourage/level/shareTask",e)}async bbsSign(){let e={gameId:g};return await this._dna_request("user/signIn",e)}async strongRecommend(e,n=1){let t={postId:e.postId,gameId:e.gameId??g,gameForumId:e.gameForumId,operateType:n};return await this._dna_request("forum/moderator/setForceRecommend",t)}async viewCommunity(){return await this._dna_request("encourage/level/viewCommunity")}async viewCount(e,n=g){return await this._dna_request("forum/viewCount",{gameId:n,postId:e})}async getTaskProcess(){let e={gameId:g};return await this._dna_request("encourage/level/getTaskProcess",e)}async soulTask(){return await this._dna_request("role/soul/task")}}class V extends c{async blackUser(e,n){return await this._dna_request("user/blackUser",{toUserId:e,type:n})}async cleanFansNew(e,n){return await this._dna_request("user/cleanFansNew",{type:e,userFollowId:n})}async collect(e,n,t=1){return await this._dna_request("forum/collect",{operateType:t,postId:e,toUserId:n})}async defaultRole(e,n=1){return await this._dna_request("user/defaultRole",{otherUserId:e,type:n})}async deleteRole(e){return await this._dna_request("role/remove",{roleBoundId:e})}async draftDelete(e){return await this._dna_request("forum/more/draftDelete",{draftId:e})}async fans(e,n,t,r){return await this._dna_request("user/fans",{otherUserId:e,pageNo:n,pageSize:t,type:r})}async fastBind(){return await this._dna_request("role/quickBound")}async follow(e,n,t,r){return await this._dna_request("user/follow",{otherUserId:e,pageNo:n,pageSize:t,type:r})}async followUser(e,n){return await this._dna_request("user/followUser",{followUserId:e,operateType:n?0:1})}async getApplyStatus(){return await this._dna_request("user/creator/getApplyStatus")}async getDraftList(e,n){return await this._dna_request("forum/getDraftList",{pageIndex:e,pageSize:n})}async getMineComment(e,n,t,r){return await this._dna_request("user/notice/mine",{otherUserId:e,pageIndex:n,pageSize:t,type:r})}async getMinePost(e,n,t,r,i,s){return await this._dna_request("forum/getMinePost",{otherUserId:e,pageIndex:n,pageSize:t,searchType:r,type:i,postType:s})}async getNotifySwitch(){return await this._dna_request("user/push/getSwitchStatus")}async historyView(e,n){return await this._dna_request("forum/historyView",{pageIndex:e,pageSize:n})}async like(e){return await this._dna_request("forum/like",e)}async manualBound(e,n,t){return await this._dna_request("role/manualBound",{roleId:e,type:n,code:t})}async mine(e,n,t,r){let i={otherUserId:e,searchType:n,type:t,postType:r};if(!e)delete i.otherUserId;return await this._dna_request("user/mine",i)}async mineV2(e){return await this._dna_request("user/mineV2",{otherUserId:e})}async moderatorByGame(e){return await this._dna_request("user/moderator/getModeratorByGame",{gameId:e})}async muteCancel(e){return await this._dna_request("forum/moderator/muteCancel",{toUserId:e})}async muteUser(e,n,t,r,i){return await this._dna_request("forum/moderator/muteUser",{toUserId:e,gameIdStr:n,type:t,reason:r,content:i})}async resetDefault(e){return await this._dna_request("role/resetDefault",{roleBoundId:e})}async roleManager(){return await this._dna_request("role/list")}}class v extends c{async addAddress(e,n,t){return await this._dna_request("user/more/userAddressAdd",{receiverName:e,receiverMobile:n,receiverAddress:t})}async blackUser(e,n){return await this._dna_request("user/blackUser",{toUserId:e,type:n})}async cancelCode(e){return await this._dna_request("user/more/cancelCode",{code:e})}async cancel(e,n,t,r,i){return await this._dna_request("user/more/cancel",{cancelType:e,operateType:n,position:t,cancelReason:r,reasonDetail:i})}async deleteAddress(e){return await this._dna_request("user/more/deleteUserAddress",{addressId:e})}async editAddress(e,n,t,r){return await this._dna_request("user/more/userAddressEdit",{addressId:e,receiverName:n,receiverMobile:t,receiverAddress:r})}async feedback(e,n,t,r){return await this._dna_request("user/more/feedback",{listPic:e,proDesc:n,mobile:t,isLogin:r})}async getCancelStatus(){return await this._dna_request("user/more/getCancelStatus")}async getNotifySwitch(){return await this._dna_request("user/push/getSwitchStatus")}async getPrivateSet(){return await this._dna_request("user/getPrivateSet")}async getUserAddress(e,n){return await this._dna_request("user/more/getUserAddress",{userId:e,type:n})}async getUserBlackList(e,n){return await this._dna_request("user/getUserBlackList",{pageIndex:e,pageSize:n})}async msgListDetail(e,n,t){return await this._dna_request("user/block/listDetail",{pageNo:e,pageSize:n,type:t})}async postListDetail(e,n,t){return await this._dna_request("user/block/listDetail",{pageNo:e,pageSize:n,type:t})}async privateSet(e,n){return await this._dna_request("user/privateSet",{operateType:e,option:n})}async sendSms(e,n,t){return await this._dna_request("user/sms/sendSms",{mobile:e,timeStamp:n,type:t})}async setDefaultAddress(e){return await this._dna_request("user/more/setDefaultAddress",{addressId:e})}async setNotifySwitch(e,n){return await this._dna_request("user/push/updateSwitchStatus",{operateType:e,switchType:n})}async uploadFeedBack(e){let n=new FormData;return n.append("parts",e),await this.fileUpload("user/img/uploadFeedBack",n)}}class E extends c{async draftSave(e,n,t,r,i,s,a){return await this._dna_request("forum/draftSave",{content:e,draftId:n,h5Content:t,postTitle:r,postType:i,gameId:s,videoReUpload:a})}async followUser(e,n){return await this._dna_request("user/followUser",{followUserId:e,operateType:n})}async getConfigTopicByGameId(e,n){return await this._dna_request("config/getConfigTopicByGameId",{name:e,showType:n})}async getPostPublishPage(){return await this._dna_request("forum/getPostPublishPage")}async getRecommend(e,n){return await this._dna_request("user/getRecommend",{history:e,pageSize:n})}async getTips(){return await this._dna_request("config/getTips")}async getVodToken(e,n){return await this._dna_request("forum/getVodToken",{fileName:e,title:n})}async like(e,n,t,r,i,s,a,o,u){return await this._dna_request("forum/like",{forumId:e,gameId:n,likeType:t,operateType:r,postCommentId:i,postCommentReplyId:s,postId:a,postType:o,toUserId:u})}async list(e,n,t){return await this._dna_request("forum/dynamic/list",{pageIndex:e,pageSize:n,userId:t})}async parseLink(e){return await this._dna_request("forum/parseLink",{link:e})}async posAdminEdit(e,n,t,r,i,s,a,o,u){return await this._dna_request("forum/moderator/postEdit",{content:e,gameForumId:n,h5Content:t,postId:r,postTitle:i,topics:s,postType:a,gameId:o,videoReUpload:u})}async postEdit(e,n,t,r,i,s,a,o){return await this._dna_request("forum/postEdit",{content:e,gameForumId:n,h5Content:t,postId:r,postTitle:i,topics:s,postType:a,videoReUpload:o})}async postPublish(e,n,t,r,i,s,a,o){return await this._dna_request("forum/postPublish",{content:e,draftId:n,gameForumId:t,gameId:r,h5Content:i,postTitle:s,postType:a,topics:o})}async safeCheck(e){return await this._dna_request("forum/more/safeCheck",{url:e})}async uploadImage(e){let n=new FormData;return n.append("files",e),n.append("type","post"),await this.fileUpload("config/img/upload",n)}async videoPostPublish(e,n,t,r,i,s,a,o){return await this._dna_request("forum/moderator/postPublish",{content:e,draftId:n,gameForumId:t,gameId:r,h5Content:i,postTitle:s,postType:a,topics:o})}async viewCount(e,n){return await this._dna_request("forum/viewCount",{gameId:e,postId:n})}}var Ce;((r)=>{r[r.TEXT=1]="TEXT";r[r.IMAGE=2]="IMAGE";r[r.VIDEO=5]="VIDEO"})(Ce||={});var D=268;import*as x from"node-forge";var pe="159",Le="10456",ue="1969162350523490",me="e1efe6e74f2ae46f87231bb519d3a304",S="HJgwHbASKFT9P9WeGVZhaHi5V",Q="VmqVoGcCRsUggpXrEQpbttkTLftuIJveD3okOVWpcOEc5vDc13",oe="459",we="la3nh98r46032fn90tzl";function ge(e){let n=x.md5.create().update(e).digest();return x.util.encode64(n.toHex().toLowerCase())}function xe(...e){let n=new Map;for(let a=0;a<e.length-1;a+=2){let o=e[a],u=e[a+1];if(o&&u)n.set(o,u)}let t=Array.from(n.keys()).filter((a)=>a!=="sign").sort(),r=[];for(let a of t){let o=n.get(a);if(o&&o.length>0)r.push(`${a}=${o}`)}r.push(we);let i=r.join("&"),s=x.md.md5.create();return s.update(i),s.digest().toHex()}function Re(e){let n=x.util.encodeUtf8(e);return x.util.encode64(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"")}function he(e){let n=JSON.stringify(e),t=Re(n);if(t.length>51)return ye(t);return t}function ye(e){let n=e.split(""),t=[[1,33],[10,42],[18,50],[19,51]];for(let[r,i]of t)if(r<n.length&&i<n.length)[n[r],n[i]]=[n[i],n[r]];return n.join("")}function j(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e)=>{let n=Math.floor(Math.random()*16);return(e==="x"?n:n&3|8).toString(16)})}function X(e){let t={...{gid:pe,osh:"1280",gaid:j(),nt:"1",dn:j(),imsi:"",osw:"720",apiVersion:"1",osVersion:"9",gfsid:w(16),deviceMode:"NX627J",plat:"0",lang:"zh_CN",vc:"5",svc:"50008",af_version:"",ov:"9",svn:"5.0.0.08",afid:"",oriDev:"0",tsid:w(32),tusid:"0",tcsid:"0",vn:"1.1.1",imei:"",upv:"0",pk:"com.herodna.oversea",projectId:Le,tdn:j()},...e},r=he(t),i=Math.floor(Date.now()/1000).toString(),s=xe("pcode",oe,"data",r,"timestamp",i);return new URLSearchParams({pcode:oe,data:r,sign:s,timestamp:i}).toString()}class H extends c{async loginLog(){return await this._dna_request("user/login/log")}async blockList(){return await this._dna_request("user/block/list")}async canEditNickName(){return await this._dna_request("user/canUpdateNameTimes")}async cancel(e,n,t,r,i){return await this._dna_request("user/more/cancel",{cancelType:e,operateType:n,position:t,cancelReason:r,reasonDetail:i})}async cleanToken(){return await this._dna_request("user/cleanToken")}async editGender(e){return await this._dna_request("user/editGender",{gender:e})}async editNickName(e){return await this._dna_request("user/updateName",{userName:e})}async getCommonConfig(){return await this._dna_request("config/getCommonConfig")}async getConfig(){return await this._dna_request("config/getConfig")}async getConfigSwitch(){return await this._dna_request("config/switchAll")}async getModeratorPermission(){return await this._dna_request("user/moderator/getModeratorPermission")}async getOpenScreen(){return await this._dna_request("config/getOpenScreen")}async getPublicKey(){return await this._dna_request("config/getRsaPublicKey")}async getUserGame(){return await this._dna_request("user/getUserGame")}async getWikiData(){return await this._dna_request("config/getGameWiki")}async haveOfficialRole(){return await this._dna_request("role/haveOfficialRole")}async isRedPoint(){return await this._dna_request("forum/dynamic/isRedPoint")}async login(e,n){let t={code:n,devCode:this.dev_code,gameList:D,loginType:1,mobile:e},r=await this._dna_request("user/sdkLogin",t,{sign:!0});if(r.is_success&&r.data){let i=r.data;if(typeof i.token==="string")this.token=i.token}return r}async sendEmailVerifyCode(e){let t=X({emailType:"updateCode",email:e,accessToken:""});return await(await(this.fetchFn||fetch)(`https://hgsdkeu.herogame.com/hgsrv/v1/email/sendVerifyCode?${t}`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"}})).json()}async loginEmail(e,n,t,r){let i={devCode:this.dev_code,loginType:1,email:e,pwd:`${ge(n)}
5
+ `,cUid:t,gameList:D,accessToken:r},s=await this._dna_request("user/login",i,{sign:!0});if(s.is_success&&s.data){let a=s.data;if(typeof a.token==="string")this.token=a.token}return s}async emailVerify(e,n){let r=X({email:e,code:n,emailWithPwd:"0",accessToken:""});return await(await(this.fetchFn||fetch)(`https://hgsdkeu.herogame.com/hgsrv/v2/email/login?${r}`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:""})).json()}async oneTapLoginRestriction(){return await this._dna_request("user/oneTapLoginRestriction")}async recommendConfig(){return await this._dna_request("forum/recommend/config")}async refreshToken(e){return await this._dna_request("user/refreshToken",{refreshToken:e})}async register(e,n,t,r,i){return await this._dna_request("user/register",{code:e,devCode:n,gameList:t,mobile:r,password:i})}async saveUserInfo(e,n,t,r){return await this._dna_request("user/saveUserInfo",{gender:e,headCode:n,headUrl:t,userName:r})}async sendSms(e,n,t){return await this._dna_request("user/getSmsCode",{mobile:e,isCaptcha:t,vJson:n})}async signature(e){return await this._dna_request("user/edit/signature",{newSignature:e})}async updateHeadCode(e){return await this._dna_request("user/updateHeadCode",{headCode:e})}async updateHeadUrl(e){return await this._dna_request("user/updateHeadUrl",{headUrl:e})}async updateProfileBg(e){return await this._dna_request("user/updateBg",{bgUrl:e})}async uploadHead(e){let n=new FormData;return n.append("parts",e),await this.fileUpload("user/img/uploadHead",n)}async uploadProfileBg(e){let n=new FormData;return n.append("parts",e),await this.fileUpload("user/img/uploadMineBg",n)}async getEmoji(){return await this._dna_request("config/getEmoji")}async getGameConfig(){return await this._dna_request("config/getGameConfig")}async getGameHeadCode(){return await this._dna_request("user/getGameHeadCode")}async facebookLogin(e){let n={accessToken:e,devCode:this.dev_code,gameList:D,loginType:1},t=await this._dna_request("user/sdkLogin",n,{sign:!0});if(t.is_success&&t.data){let r=t.data;if(typeof r.token==="string")this.token=r.token}return t}async twitterLogin(e,n){let t={accessToken:e,accessTokenSecret:n,devCode:this.dev_code,gameList:D,loginType:5},r=await this._dna_request("user/sdkLogin",t,{sign:!0});if(r.is_success&&r.data){let i=r.data;if(typeof i.token==="string")this.token=i.token}return r}async getFacebookAccessToken(e,n){let r=new URLSearchParams({client_id:ue,client_secret:me,code:e,redirect_uri:n});return(await(await(this.fetchFn||fetch)(`https://graph.facebook.com/v19.0/oauth/access_token?${r.toString()}`)).json()).access_token}async getTwitterAccessToken(e,n){let r=Math.floor(Date.now()/1000).toString(),i=w(32),s=new URLSearchParams({oauth_consumer_key:S,oauth_nonce:i,oauth_signature_method:"HMAC-SHA1",oauth_timestamp:r,oauth_token:e,oauth_verifier:n,oauth_version:"1.0"}),a=`POST&${encodeURIComponent("https://api.twitter.com/oauth/access_token")}&${encodeURIComponent(s.toString())}`,o=`${encodeURIComponent(Q)}&`,u=await this.generateHmacSha1Signature(o,a),N=`OAuth oauth_consumer_key="${S}", oauth_nonce="${i}", oauth_signature="${encodeURIComponent(u)}", oauth_signature_method="HMAC-SHA1", oauth_timestamp="${r}", oauth_token="${e}", oauth_verifier="${n}", oauth_version="1.0"`,l=await(await(this.fetchFn||fetch)("https://api.twitter.com/oauth/access_token",{method:"POST",headers:{Authorization:N}})).text(),m=new URLSearchParams(l);return{accessToken:m.get("oauth_token")||"",accessTokenSecret:m.get("oauth_token_secret")||"",userId:m.get("user_id")||"",screenName:m.get("screen_name")||""}}async getTwitterRequestToken(e){let t=Math.floor(Date.now()/1000).toString(),r=w(32),i=new URLSearchParams({oauth_callback:e,oauth_consumer_key:S,oauth_nonce:r,oauth_signature_method:"HMAC-SHA1",oauth_timestamp:t,oauth_version:"1.0"}),s=`POST&${encodeURIComponent("https://api.twitter.com/oauth/request_token")}&${encodeURIComponent(i.toString())}`,a=`${encodeURIComponent(Q)}&`,o=await this.generateHmacSha1Signature(a,s),u=`OAuth oauth_callback="${encodeURIComponent(e)}", oauth_consumer_key="${S}", oauth_nonce="${r}", oauth_signature="${encodeURIComponent(o)}", oauth_signature_method="HMAC-SHA1", oauth_timestamp="${t}", oauth_version="1.0"`,L=await(await(this.fetchFn||fetch)("https://api.twitter.com/oauth/request_token",{method:"POST",headers:{Authorization:u}})).text(),l=new URLSearchParams(L);return{oauthToken:l.get("oauth_token")||"",oauthTokenSecret:l.get("oauth_token_secret")||"",oauthCallbackConfirmed:l.get("oauth_callback_confirmed")==="true"}}async generateHmacSha1Signature(e,n){let t=new TextEncoder,r=t.encode(e),i=t.encode(n),s=await crypto.subtle.importKey("raw",r,{name:"HMAC",hash:"SHA-1"},!1,["sign"]),a=await crypto.subtle.sign("HMAC",s,i),o=Array.from(new Uint8Array(a));return btoa(String.fromCharCode(...o))}}class W extends c{async addAddress(e,n,t){return await this._dna_request("user/more/userAddressAdd",{receiverName:e,receiverMobile:n,receiverAddress:t})}async apply(e,n,t,r,i,s,a,o){return await this._dna_request("user/creator/apply",{type:e,id:n,concatWay:t,otherPlatform:r,otherPlatformUrl:i,otherPlatformFans:s,materialUrl:a,gameId:o})}async awardList(e){return await this._dna_request("encourage/draw/awardList",{drawId:e})}async awardWin(e,n,t,r){return await this._dna_request("/encourage/draw/awardWin",{drawId:e,fullName:n,mobile:t,address:r})}async buyGold(e,n){return await this._dna_request("encourage/draw/buy",{drawId:e,count:n})}async buyProduct(e,n,t,r){return await this._dna_request("/encourage/store/buyProduct",{address:e,fullName:n,mobile:t,productId:r})}async deleteAddress(e){return await this._dna_request("user/more/deleteUserAddress",{addressId:e})}async drawDetail(e){return await this._dna_request("encourage/draw/detail",{drawId:e})}async editAddress(e,n,t,r){return await this._dna_request("user/more/userAddressEdit",{addressId:e,receiverName:n,receiverMobile:t,receiverAddress:r})}async getAliProductConfig(){return await this._dna_request("encourage/store/ali/getAliStoreConfigAndBanner")}async getAliProductList(e,n,t){return await this._dna_request("encourage/store/ali/productList",{gameId:e,pageIndex:n,pageSize:t})}async getApplyPage(){return await this._dna_request("user/creator/getApplyPage")}async getExpLogsList(e,n,t){return await this._dna_request("encourage/level/getExpLogs",{gameId:e,pageIndex:n,pageSize:t})}async getGameCreator(){return await this._dna_request("config/identification/getGameCreator")}async getGoldDetailList(e,n,t,r){return await this._dna_request("encourage/gold/getGoldLogs",{pageIndex:e,pageSize:n,type:t,storeType:r})}async getProductList(e,n,t,r){return await this._dna_request("encourage/store/productList",{gameId:e,pageIndex:n,pageSize:t,storeType:r})}async getTotalGold(e){if(e!==void 0)return await this._dna_request("encourage/gold/getTotalGold",{type:e});return await this._dna_request("encourage/gold/getTotalGold")}async getUserAddress(e,n){return await this._dna_request("user/more/getUserAddress",{userId:e,type:n})}async getUserGameLevel(e,n,t){return await this._dna_request("encourage/level/getUserGameLevelDetail",{gameId:e,ifProcess:n,otherUserId:t})}async getUserGameTaskProcess(e,n){return await this._dna_request("encourage/level/getTaskProcess",{gameId:e,userId:n})}async list(e,n,t,r){return await this._dna_request("encourage/draw/list",{pageIndex:e,pageSize:n,queryType:t,gameId:r})}async page(){return await this._dna_request("user/creator/page")}async productDetail(e){return await this._dna_request("encourage/store/productDetail",{productId:e})}async setDefaultAddress(e){return await this._dna_request("user/more/setDefaultAddress",{addressId:e})}async uploadImage(e){let n=new FormData;return n.append("parts",e),await this.fileUpload("user/img/uploadHead",n)}}class $ extends c{base_param={game_id:2277,lang:"zh"};async getTokenForCs(e=D){return this._dna_request(`/role/getTokenForCs?game_id=${e}`)}async sdkMoyuLogin(e){return this._dna_request_kf("/v1/public/login/sdkMoyuLogin",{...this.base_param,token:e},{method:"GET"})}async sdkLogin(){let e=await this.getTokenForCs();if(e.data?.token){let n=await this.sdkMoyuLogin(e.data.token);if(n.data)this.kf_token=n.data.token;return n}return e}async getUserInfo(){return this._dna_request_kf("/v1/frontend/login/getUserInfo",this.base_param,{method:"GET"})}async getRole(){return this._dna_request_kf("/v1/frontend/role/getRole",this.base_param,{method:"GET"})}async sendGameMail(e,n=29046){return this._dna_request_kf("/v1/public/role/sendGameMail",{...this.base_param,server_id:n,role:e})}async verifyRoleMailCode(e){return this._dna_request_kf("/v1/frontend/role/verify",{...this.base_param,mail_code:e})}async getServerType(e=2277){return this._dna_request_kf("/v1/public/select/serverType",{...this.base_param,game_id:e},{method:"GET"})}async getServerList(e=230){return this._dna_request_kf("/v1/public/select/getServerList",{...this.base_param,server_type:e},{method:"GET"})}async getPropCategory(){return this._dna_request_kf("/v1/public/selfService/getPropCategory",this.base_param,{method:"GET"})}async queryFlow(e,n,t,r="Resource",i,s=29046){return this._dna_request_kf("/v1/frontend/selfService/queryFlow",{...this.base_param,date:e,name:n,role:t,server_id:s,category_id:r,next_cursor:i})}async bindRole(e,n,t){return this._dna_request_kf("/v1/frontend/role/bindRole",{server_id:e,role:n,mail_code:t})}async captcha(){return this._dna_request_kf("/v1/public/login/captcha",void 0,{method:"GET"})}async sendVerifyCode(e,n){return this._dna_request_kf("/v1/public/login/sendSms",{...this.base_param,phone:e,code:n,type:"login"})}async loginByPhone(e,n){let t=await this._dna_request_kf("/v1/public/login/byphone",{...this.base_param,code:n,phone:e});if(t.is_success&&t.data?.token)this.kf_token=t.data.token;return t}}class Ie extends T{game;home;profile;setting;trend;user;kf;userGrowing;h5;constructor(e={}){super(e);this.game=new U(this),this.home=new M(this),this.profile=new V(this),this.setting=new v(this),this.trend=new E(this),this.user=new H(this),this.userGrowing=new W(this),this.h5=new Z(this),this.kf=new $(this)}static generateDeviceCode(){return`2${w(32)}`}async initialize(){await this.initializeSignConfig()}get GAME_ID(){return D}async getMhSwitchStatus(){return await this.game.getMhSwitchStatus()}async updateMhSwitchStatus(e){return await this.game.updateMhSwitchStatus(e)}async soulTask(){return await this.game.soulTask()}async defaultRoleForTool(e=1,n){return await this.game.defaultRoleForTool(e,n)}async getRoleDetail(e,n,t){return await this.game.getRoleDetail(e,n,t)}async getWeaponDetail(e,n,t){return await this.game.getWeaponDetail(e,n,t)}async getShortNoteInfo(){return await this.game.getShortNoteInfo()}async getPostList(e=48,n=1,t=20,r=1,i=0){return await this.home.getPostList(e,n,t,r,i)}async getPostDetail(e){return await this.home.getPostDetail(e)}async getPostByTopic(e=177,n=1,t=20,r=1,i=0){return await this.home.getPostByTopic(e,n,t,r,i)}async getTaskProcess(){return await this.home.getTaskProcess()}async haveSignIn(){return await this.home.haveSignIn()}async signCalendar(){return await this.home.signCalendar()}async gameSign(e,n){return await this.home.gameSignIn(e,n)}async getActivityList(e,n,t){return await this.home.getActivityList(e,n,t)}async bbsSign(){return await this.home.bbsSign()}async getRoleList(){return await this.profile.roleManager()}async adminAdjustScore(e,n,t){return await this.home.adminAdjustScore(e,n,t)}async adminDelete(e,n,t){return await this.home.adminDelete(e,n,t)}async adminMovePost(e,n,t,r){return await this.home.adminMovePost(e,n,t,r)}async adminRefreshTime(e,n){return await this.home.adminRefreshTime(e,n)}async blockList(){return await this.home.blockList()}async blockOther(e,n,t){return await this.home.blockOther(e,n,t)}async collect(e,n,t=1){return await this.home.collect(e,n,t)}async commentDelete(e,n,t,r){return await this.home.commentDelete(e,n,t,r)}async createComment(e,n){return await this.home.createComment(e,n)}async createReply(e,n){return await this.home.createReply(e,n)}async createReplyList(e,n){return await this.home.createReplyList(e,n)}async deletePost(e,n){return await this.home.deletePost(e,n)}async followUser(e,n){return await this.home.followUser(e,n)}async getFollowState(e){return await this.home.getFollowState(e)}async getDoujin(e){return await this.home.getDoujin(e)}async getExchange(e){return await this.home.getExchange(e)}async getGameBanner(e=D){return await this.home.getGameBanner(e)}async getPostCommentList(e,n=1,t=20,r=0){return await this.home.getPostCommentList(e,n,t,r)}async getRankList(e){return await this.home.getRankList(e)}async getRecommendPosts(e=D,n=1,t=20){return await this.home.getRecommendPosts(e,n,t)}async getReplyList(e,n,t=1,r=20){return await this.home.getReplyList(e,n,t,r)}async getStatistics(e=D){return await this.home.getStatistics(e)}async getTips(){return await this.home.getTips()}async getWalkthrough(e){return await this.home.getWalkthrough(e)}async hotList(e=1,n=D){return await this.home.hotList(e,n)}async isRedPoint(){return await this.home.isRedPoint()}async likePost(e){return await this.home.like(e)}async lockPost(e,n){return await this.home.lockPost(e,n)}async postDownOrUp(e,n){return await this.home.postDownOrUp(e,n)}async postElite(e,n){return await this.home.postElite(e,n)}async postHide(e,n){return await this.home.postHide(e,n)}async reRank(e,n){return await this.home.reRank(e,n)}async receiveLog(e,n,t){return await this.home.receiveLog(e,n,t)}async recommendList(e,n,t,r,i=D){return await this.home.recommendList(e,n,t,r,i)}async report({commentId:e=0,postId:n=0,replyId:t=0},r=1,i=1){return await this.home.report({commentId:e,postId:n,replyId:t},r,i)}async searchPost(e,n,t,r=D,i=1){return await this.home.searchPost(e,n,t,r,i)}async searchTopic(e,n,t=20,r=D){return await this.home.searchTopic(e,n,t,r)}async searchUser(e,n,t){return await this.home.searchUser(e,n,t)}async shareTask(){return await this.home.shareTask()}async strongRecommend(e,n=1){return await this.home.strongRecommend(e,n)}async viewCommunity(){return await this.home.viewCommunity()}async viewCount(e,n=D){return await this.home.viewCount(e,n)}async loginLog(){return await this.user.loginLog()}async login(e,n){return await this.user.login(e,n)}async getSmsCode(e,n){return await this.user.sendSms(e,n,1)}async getMine(e="",n=1,t=0){return await this.profile.mine(e,n,t)}async getOtherMine(e="709542994134436647",n=1,t=2){return await this.profile.mine(e,n,t)}async canEditNickName(){return await this.user.canEditNickName()}async cleanToken(){return await this.user.cleanToken()}async editGender(e){return await this.user.editGender(e)}async editNickName(e){return await this.user.editNickName(e)}async getCommonConfig(){return await this.user.getCommonConfig()}async getConfig(){return await this.user.getConfig()}async getConfigSwitch(){return await this.user.getConfigSwitch()}async getModeratorPermission(){return await this.user.getModeratorPermission()}async getOpenScreen(){return await this.user.getOpenScreen()}async getPublicKey(){return await this.user.getPublicKey()}async getUserGame(){return await this.user.getUserGame()}async getWikiData(){return await this.user.getWikiData()}async haveOfficialRole(){return await this.user.haveOfficialRole()}async oneTapLoginRestriction(){return await this.user.oneTapLoginRestriction()}async recommendConfig(){return await this.user.recommendConfig()}async refreshToken(e){return await this.user.refreshToken(e)}async register(e,n,t,r,i){return await this.user.register(e,n,t,r,i)}async saveUserInfo(e,n,t,r){return await this.user.saveUserInfo(e,n,t,r)}async signature(e){return await this.user.signature(e)}async updateHeadCode(e){return await this.user.updateHeadCode(e)}async updateHeadUrl(e){return await this.user.updateHeadUrl(e)}async updateProfileBg(e){return await this.user.updateProfileBg(e)}async uploadHead(e){return await this.user.uploadHead(e)}async uploadProfileBg(e){return await this.user.uploadProfileBg(e)}async getEmoji(){return await this.user.getEmoji()}async getGameConfig(){return await this.user.getGameConfig()}async getGameHeadCode(){return await this.user.getGameHeadCode()}async facebookLogin(e){return await this.user.facebookLogin(e)}async twitterLogin(e,n){return await this.user.twitterLogin(e,n)}async getFacebookAccessToken(e,n){return await this.user.getFacebookAccessToken(e,n)}async getTwitterAccessToken(e,n){return await this.user.getTwitterAccessToken(e,n)}async getTwitterRequestToken(e){return await this.user.getTwitterRequestToken(e)}async getMapCategorizeList(){return await this.h5.getMapCategorizeList()}async getMapDetail(e){return await this.h5.getMapDetail(e)}async getMapSiteDetail(e){return await this.h5.getMapSiteDetail(e)}async getEmojiList(){return await this.h5.getEmojiList()}async getMapMatterCategorizeOptions(){return await this.h5.getMapMatterCategorizeOptions()}async blackUser(e,n){return await this.profile.blackUser(e,n)}async cleanFansNew(e,n){return await this.profile.cleanFansNew(e,n)}async defaultRole(e,n=1){return await this.profile.defaultRole(e,n)}async deleteRole(e){return await this.profile.deleteRole(e)}async draftDelete(e){return await this.profile.draftDelete(e)}async fans(e,n,t,r){return await this.profile.fans(e,n,t,r)}async fastBind(){return await this.profile.fastBind()}async follow(e,n,t,r){return await this.profile.follow(e,n,t,r)}async getApplyStatus(){return await this.profile.getApplyStatus()}async getDraftList(e,n){return await this.profile.getDraftList(e,n)}async getMineComment(e,n,t,r){return await this.profile.getMineComment(e,n,t,r)}async getMinePost(e,n,t,r,i,s){return await this.profile.getMinePost(e,n,t,r,i,s)}async getProfileNotifySwitch(){return await this.profile.getNotifySwitch()}async historyView(e,n){return await this.profile.historyView(e,n)}async likeProfilePost(e){return await this.profile.like(e)}async manualBound(e,n,t){return await this.profile.manualBound(e,n,t)}async mine(e,n,t,r){return await this.profile.mine(e,n,t,r)}async mineV2(e){return await this.profile.mineV2(e)}async moderatorByGame(e){return await this.profile.moderatorByGame(e)}async muteCancel(e){return await this.profile.muteCancel(e)}async muteUser(e,n,t,r,i){return await this.profile.muteUser(e,n,t,r,i)}async resetDefault(e){return await this.profile.resetDefault(e)}async addAddress(e,n,t){return await this.setting.addAddress(e,n,t)}async cancelCode(e){return await this.setting.cancelCode(e)}async cancel(e,n,t,r,i){return await this.setting.cancel(e,n,t,r,i)}async deleteAddress(e){return await this.setting.deleteAddress(e)}async editAddress(e,n,t,r){return await this.setting.editAddress(e,n,t,r)}async feedback(e,n,t,r){return await this.setting.feedback(e,n,t,r)}async getCancelStatus(){return await this.setting.getCancelStatus()}async getPrivateSet(){return await this.setting.getPrivateSet()}async getUserAddress(e,n){return await this.setting.getUserAddress(e,n)}async getUserBlackList(e,n){return await this.setting.getUserBlackList(e,n)}async msgListDetail(e,n,t){return await this.setting.msgListDetail(e,n,t)}async postListDetail(e,n,t){return await this.setting.postListDetail(e,n,t)}async privateSet(e,n){return await this.setting.privateSet(e,n)}async sendSms(e,n,t){return await this.setting.sendSms(e,n,t)}async setDefaultAddress(e){return await this.setting.setDefaultAddress(e)}async setNotifySwitch(e,n){return await this.setting.setNotifySwitch(e,n)}async uploadFeedBack(e){return await this.setting.uploadFeedBack(e)}async draftSave(e,n,t,r,i,s,a){return await this.trend.draftSave(e,n,t,r,i,s,a)}async getConfigTopicByGameId(e,n){return await this.trend.getConfigTopicByGameId(e,n)}async getPostPublishPage(){return await this.trend.getPostPublishPage()}async getRecommend(e,n){return await this.trend.getRecommend(e,n)}async getVodToken(e,n){return await this.trend.getVodToken(e,n)}async trendList(e,n,t){return await this.trend.list(e,n,t)}async parseLink(e){return await this.trend.parseLink(e)}async posAdminEdit(e,n,t,r,i,s,a,o,u){return await this.trend.posAdminEdit(e,n,t,r,i,s,a,o,u)}async postEdit(e,n,t,r,i,s,a,o){return await this.trend.postEdit(e,n,t,r,i,s,a,o)}async postPublish(e,n,t,r,i,s,a,o){return await this.trend.postPublish(e,n,t,r,i,s,a,o)}async safeCheck(e){return await this.trend.safeCheck(e)}async uploadImage(e){return await this.trend.uploadImage(e)}async videoPostPublish(e,n,t,r,i,s,a,o){return await this.trend.videoPostPublish(e,n,t,r,i,s,a,o)}async apply(e,n,t,r,i,s,a,o){return await this.userGrowing.apply(e,n,t,r,i,s,a,o)}async awardList(e){return await this.userGrowing.awardList(e)}async awardWin(e,n,t,r){return await this.userGrowing.awardWin(e,n,t,r)}async buyGold(e,n){return await this.userGrowing.buyGold(e,n)}async buyProduct(e,n,t,r){return await this.userGrowing.buyProduct(e,n,t,r)}async drawDetail(e){return await this.userGrowing.drawDetail(e)}async getAliProductConfig(){return await this.userGrowing.getAliProductConfig()}async getAliProductList(e,n,t){return await this.userGrowing.getAliProductList(e,n,t)}async getApplyPage(){return await this.userGrowing.getApplyPage()}async getExpLogsList(e,n,t){return await this.userGrowing.getExpLogsList(e,n,t)}async getGameCreator(){return await this.userGrowing.getGameCreator()}async getGoldDetailList(e,n,t,r){return await this.userGrowing.getGoldDetailList(e,n,t,r)}async getProductList(e,n,t,r){return await this.userGrowing.getProductList(e,n,t,r)}async getTotalGold(e){return await this.userGrowing.getTotalGold(e)}async getUserGameLevel(e,n,t){return await this.userGrowing.getUserGameLevel(e,n,t)}async getUserGameTaskProcess(e,n){return await this.userGrowing.getUserGameTaskProcess(e,n)}async list(e,n,t,r){return await this.userGrowing.list(e,n,t,r)}async page(){return await this.userGrowing.page()}async productDetail(e){return await this.userGrowing.productDetail(e)}}export{_ as xor_encode,ie as swapForUploadImgApp,O as sign_shuffled,le as shuffle_md5,I as rsa_encrypt,w as rand_str2,h as rand_str,ee as md5_upper,Ne as generate_sa,re as build_upload_signature,qe as build_signature130,te as build_signature122,ne as build_signature120,ae as build_signature111,Ae as build_sign_string,se as aesDecryptImageUrl,W as UserGrowingAPI,H as UserAPI,E as TrendAPI,y as TimeBasicResponse,v as SettingAPI,k as RespCode,V as ProfileAPI,Ce as PostContentType,$ as KFAPI,M as HomeAPI,Z as H5API,U as GameAPI,D as DNA_GAME_ID,c as DNASubModule,T as DNABaseAPI,Ie as DNAAPI};
6
6
 
7
- //# debugId=3DBA3D57BF75DE7B64756E2164756E21
7
+ //# debugId=CE7525B7124891D764756E2164756E21