openx-js-sdk 0.0.26 → 0.0.28

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/README.md CHANGED
@@ -1,6 +1,28 @@
1
- # openx-js-sdk 使用说明文档
1
+ # openx-js-sdk
2
+
3
+ ## 1. SDK 介绍
4
+
5
+ **openx-js-sdk** 面向 CNKI 研学、授权等业务场景,是一个轻量级、可扩展的前端通用 SDK,封装了:
6
+
7
+ * 🔑 **JWT 自动获取 & 自动续期**
8
+ * 🌍 **统一接口代理(development/test/production)**
9
+ * ⚙️ **get/post 请求封装**
10
+ * 🚦 **可配置的全局响应处理器**
11
+ * 💡 **IP 获取、Cookie 工具、本地缓存管理**
12
+ * 📊 **埋点(Tracker)按需加载与 AppId 统一管理**
13
+
14
+ 业务开发者只需使用公开 API,无需关心底层网络、身份态、埋点加载等逻辑。
2
15
 
3
16
  📌 **版本历史**
17
+
18
+ **v0.0.28 – 2026-01-10**
19
+ * 处理微前端应用下埋点宿主应用与子应用冲突行为
20
+
21
+ **v0.0.27 – 2026-01-09**
22
+ * 增加 scene 用于业务/宿主场景标识
23
+ * 新增 toTrackOpenx 埋点方法,用于 OpenX SDK 内部统一注入业务 / 宿主场景标识
24
+ * 去除 overrideTrackerAppId 方法
25
+
4
26
  **v0.0.26 – 2025-12-09**
5
27
  * 新增 skipInterceptorsRequest 请求配置项
6
28
  允许业务方在单个接口级别跳过 interceptorsRequest 对入参的结构化处理。
@@ -9,6 +31,7 @@
9
31
  * 新增 interceptorResult 方法
10
32
  允许业务方在请求完成后对最终返回结构进行自定义改造。
11
33
  * 埋点业务开发环境关闭加载
34
+
12
35
  **v0.0.24 – 2025-12-08**
13
36
  * openx 实例新增 logOut 方法用于业务方主动触发退出登录逻辑。
14
37
  * 针对 5014、5007、重复获取jwt情况,SDK 内部新增自动执行清理机制。
@@ -24,11 +47,12 @@
24
47
  * 原字段 response 已标记为兼容字段,统一替换为 interceptorsResponse
25
48
 
26
49
  **v0.0.20 – 2025-11-30**
50
+
27
51
  处理埋点业务多应用 app_id 混合使用问题
28
52
 
29
53
  **v0.0.17 – 2025-11-30**
30
54
 
31
- * 处理 jwt 5013 返回数据问题
55
+ * 处理 jwt 5013 返回数据问题
32
56
 
33
57
  **v0.0.15 – 2025-11-28**
34
58
 
@@ -49,24 +73,11 @@
49
73
  * 新增 `verifyRealName` 配置项,用于开启实名认证阻断机制(429001)
50
74
  * 优化内部正则 URL 匹配逻辑,支持 `/proxy-sdk-jwt` 等带短横线的代理路径
51
75
 
52
- ---
53
76
 
54
- # 1. SDK 介绍
55
77
 
56
- **openx-js-sdk** 面向 CNKI 研学、授权等业务场景,是一个轻量级、可扩展的前端通用 SDK,封装了:
57
78
 
58
- * 🔑 **JWT 自动获取 & 自动续期**
59
- * 🌍 **统一接口代理(development/test/production)**
60
- * ⚙️ **get/post 请求封装**
61
- * 🚦 **可配置的全局响应处理器**
62
- * 💡 **IP 获取、Cookie 工具、本地缓存管理**
63
- * 📊 **埋点(Tracker)按需加载与 AppId 统一管理**
64
79
 
65
- 业务开发者只需使用公开 API,无需关心底层网络、身份态、埋点加载等逻辑。
66
-
67
- ---
68
-
69
- # 2. 安装方式
80
+ ## 2. 安装方式
70
81
 
71
82
  ```bash
72
83
  npm install openx-js-sdk
@@ -76,11 +87,10 @@ yarn add openx-js-sdk
76
87
  pnpm add openx-js-sdk
77
88
  ```
78
89
 
79
- ---
80
90
 
81
- # 3. 快速开始
91
+ ## 3. 快速开始
82
92
 
83
- ## 3.1 初始化(推荐在应用入口处执行)
93
+ ### 3.1 初始化(推荐在应用入口处执行)
84
94
 
85
95
  ```ts
86
96
  import openx from 'openx-js-sdk'
@@ -91,7 +101,7 @@ openx.config({
91
101
  verifyRealName: true, // 开启实名认证自动阻断
92
102
  timeout: 5000, // axios 超时时间,默认 5000ms
93
103
  tracker: true, // 是否开启埋点(按需加载)
94
- overrideTrackerAppId: true, // 是否覆盖埋点默认 AppId(统一 AppId)
104
+ scene: '', // 多场景标识,没有场景需求可为空
95
105
  interceptorsResponse: (res) => {
96
106
  // 可选:全局业务响应处理
97
107
  },
@@ -140,11 +150,10 @@ openx.config({
140
150
  await openx.ready()
141
151
  ```
142
152
 
143
- ---
144
153
 
145
- # 4. 请求接口
154
+ ## 4. 请求接口
146
155
 
147
- ## 4.1 GET 请求
156
+ ### 4.1 GET 请求
148
157
 
149
158
  ```ts
150
159
  const res = await openx.getAction('/proxy-ix/endpoint', {
@@ -152,7 +161,7 @@ const res = await openx.getAction('/proxy-ix/endpoint', {
152
161
  })
153
162
  ```
154
163
 
155
- ## 4.2 POST 请求
164
+ ### 4.2 POST 请求
156
165
 
157
166
  ```ts
158
167
  const res = await openx.postAction('/proxy-ix/endpoint', {
@@ -167,7 +176,7 @@ SDK 会自动:
167
176
  * 根据 proxy 自动切换 BaseURL
168
177
  * 对响应进行封装
169
178
 
170
- ## 4.3 支持第三个参数配置 Headers / Timeout 等 Axios 配置
179
+ ### 4.3 支持第三个参数配置 Headers / Timeout 等 Axios 配置
171
180
 
172
181
  业务方可以为 getAction 与 postAction 传递 第三个参数,用于设置额外的请求配置,例如自定义 Header、超时时间、携带特殊标记字段等。
173
182
  示例:传入自定义 Headers
@@ -186,9 +195,8 @@ const res = await openx.postAction(
186
195
  )
187
196
  ```
188
197
 
189
- ---
190
198
 
191
- # 5. JWT 管理
199
+ ## 5. JWT 管理
192
200
 
193
201
  ### 5.1 获取当前 JWT
194
202
 
@@ -202,9 +210,8 @@ const token = openx.getJwt()
202
210
  openx.removeJwt()
203
211
  ```
204
212
 
205
- ---
206
213
 
207
- # 6. 配置项说明(ConfigOptions)
214
+ ## 6. 配置项说明(ConfigOptions)
208
215
 
209
216
  ```ts
210
217
  openx.config({
@@ -214,6 +221,7 @@ openx.config({
214
221
  timeout?: number, // axios 超时时间
215
222
  withCredentials?: boolean, // 是否默认携带cookie
216
223
  proxy?: Record<string, any>, // 本地代理配置
224
+ scene?: string, // 多场景标识
217
225
  response?: (res: any) => any, // 全局响应处理
218
226
  interceptorsResponse?: (res: any) => any, // 全局请求响应处理
219
227
  interceptorsRequest?: (res: any) => any, // 全局请求拦截处理
@@ -223,9 +231,8 @@ openx.config({
223
231
  })
224
232
  ```
225
233
 
226
- ---
227
234
 
228
- # 7. 获取用户 IP
235
+ ## 7. 获取用户 IP
229
236
 
230
237
  ```ts
231
238
  const ip = await openx.getUserIp()
@@ -233,9 +240,7 @@ const ip = await openx.getUserIp()
233
240
 
234
241
  SDK 会自动缓存 IP,避免重复请求。
235
242
 
236
- ---
237
-
238
- # 8. 埋点管理(Tracker)
243
+ ## 8. 埋点管理(Tracker)
239
244
 
240
245
  `openx-js-sdk` 内置埋点模块,采用 **按需加载策略(Lazy Load)**,解决旧项目中必须手动引入 `sensors.min.js` 的问题。
241
246
 
@@ -245,33 +250,78 @@ SDK 会自动缓存 IP,避免重复请求。
245
250
  tracker: true
246
251
  ```
247
252
 
248
- ## 8.1 tracker 的作用
253
+ ### 8.1 tracker 的作用
249
254
 
250
255
  | 配置 | 行为 |
251
256
  | -------------------- | ----------------------------------- |
252
257
  | `tracker: false`(默认) | 不加载 sensors,不初始化埋点,全程 0 成本 |
253
258
  | `tracker: true` | 按需加载 sensors,并提供全局 `sta_api` 用于事件上报 |
254
259
 
255
- ---
256
260
 
257
- ## 8.2 统一 AppId(解决历史混用问题)
261
+ ### 8.2 toTrackOpenx 埋点方法
262
+ openx-js-sdk 通过克隆原有埋点能力,提供了一套 SDK 独有的埋点方法,用于上报 SDK 内部行为:
263
+ ```typescript
264
+ window.sta_api?.toTrackOpenx({
265
+ event_id: 'sdk_init'
266
+ })
267
+ ```
268
+ 通过 toTrackOpenx 上报的事件将:
269
+ - 自动注入初始化配置的 scene
270
+ - 使用与业务埋点一致的底层埋点 SDK 能力
271
+ - 不会影响业务侧 toTrack 的调用与数据结构
258
272
 
259
- 旧项目中存在多个 AppId 混用、冲突、覆盖的问题。
260
- SDK 提供统一管理能力:
273
+ ### 8.3 宿主应用已存在埋点配置时的说明
274
+
275
+ 在部分宿主系统中,可能已经对 window.sta_api.toTrack 做过统一封装或二次处理,例如统一注入 app_id、环境标识等:
261
276
 
262
277
  ```typescript
263
- overrideTrackerAppId: true
278
+ const originalToTrack = window.sta_api.toTrack
279
+
280
+ window.sta_api.toTrack = function (params) {
281
+ let merged = { ...params }
282
+
283
+ // 增加排除子应用策略
284
+ if (params.track_from !== 'openx-js-sdk') {
285
+ merged = {
286
+ ...params,
287
+ app_id: `${appId}${env ? '_' + env : ''}`
288
+ }
289
+ }
290
+
291
+ return originalToTrack.call(window.sta_api, merged)
292
+ }
293
+
264
294
  ```
295
+ ### 为什么需要区分 `track_from`
296
+
297
+ `openx-js-sdk` 的埋点属于 **平台 SDK 内部行为**,其语义与业务埋点不同:
298
+
299
+ * SDK 埋点用于观测 **能力使用情况、稳定性与接入状态**
300
+ * 业务埋点用于统计 **业务行为与用户路径**
301
+
302
+ 因此,**不建议**在宿主应用的统一埋点封装中,对 SDK 埋点强制覆盖 `app_id` 或业务相关字段。
303
+
304
+ ### 推荐做法
265
305
 
266
- 启用后:
306
+ * 通过 `track_from === 'openx-js-sdk'` 明确识别 SDK 埋点
307
+ * 业务侧埋点与 SDK 埋点共用底层 Sensors 能力,但 **保持语义隔离**
308
+ * SDK 埋点不参与业务 `app_id` 的二次注入逻辑
267
309
 
268
- * 强制整个应用使用 `openx.config().appId`
269
- * sensors 默认 AppId 会被自动覆盖
270
- * 所有事件上报都归属同一 AppId
271
- * 解决多子系统混用、旧代码遗留 AppId 的混乱问题
310
+ ### 8.4 设计说明(平台级约定)
311
+
312
+ > 在微前端(如乾坤)架构下,Sensors Web SDK 采用全局单实例模型。
313
+ > `openx-js-sdk` **不尝试创建独立的埋点实例**,而是通过明确的埋点来源标识(`track_from`)与场景字段,实现父 / 子应用及 SDK 内部行为的清晰区分。
314
+
315
+ 该设计确保:
316
+
317
+ * 父应用与子应用可长期共存
318
+ * 不引入 iframe 或额外运行环境
319
+ * 不破坏宿主系统现有埋点策略
320
+ * SDK 可作为平台能力持续演进
272
321
 
273
322
  ---
274
- # 9. 退出登录管理
323
+
324
+ ## 9. 退出登录管理
275
325
  sdk 提供统一的 退出登录 方法,用于在业务系统中安全清理用户登录态,包括:
276
326
  清理所有与研学平台相关的 Cookie
277
327
  清理 JWT(通过 cnki-x-jwt 管理的 token)
@@ -305,28 +355,28 @@ if (result.code===0) {
305
355
  ```
306
356
 
307
357
 
308
- # 10. 完整示例
358
+ ## 10. 完整示例
309
359
 
310
360
  ```ts
311
361
  import openx from 'openx-js-sdk'
312
362
 
313
363
  // 初始化
314
364
  openx.config({
315
- appId: 'xxx',
316
- env: 'development',
317
- proxy: {},
318
- verifyRealName: true,
319
- tracker: true,
320
- overrideTrackerAppId: true,
365
+ appId: 'xxx',
366
+ env: 'development',
367
+ proxy: {},
368
+ verifyRealName: true,
369
+ tracker: true,
370
+ scene: '',
321
371
  interceptorsResponse: (res) => {
322
- if (res.data.code === 5014) {
323
- console.log('登录过期,业务方自行处理')
372
+ if (res.data.code === 5014) {
373
+ console.log('登录过期,业务方自行处理')
374
+ }
375
+ },
376
+ interceptorsRequest: (config) => {
377
+ config.headers['X-Requested-With'] = ''
378
+ return config
324
379
  }
325
- },
326
- interceptorsRequest: (config) => {
327
- config.headers['X-Requested-With'] = ''
328
- return config
329
- }
330
380
  })
331
381
 
332
382
  await openx.ready()
package/app.js CHANGED
@@ -1,2 +1,8 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("openxAxios",[],t):"object"==typeof exports?exports.openxAxios=t():e.openxAxios=t()}(this,(()=>(()=>{var e={65:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=new(function(){function e(e,t){void 0===e&&(e=1/0),void 0===t&&(t="queue"),this.key=t,this.maxSize=e;var n=localStorage.getItem(this.key);this.queue=n?new Map(this.parseQueue(n)):new Map}return e.prototype.setValue=function(e,t){if(this.size()>=this.maxSize){var n=this.queue.keys().next().value;this.queue.delete(n)}this.queue.set(e,t),this.saveToLocalStorage()},e.prototype.isEmpty=function(){return 0===this.queue.size},e.prototype.size=function(){return this.queue.size},e.prototype.clear=function(){this.queue.clear(),this.saveToLocalStorage()},e.prototype.getValue=function(e){return this.queue.get(e)},e.prototype.saveToLocalStorage=function(){var e=Array.from(this.queue);localStorage.setItem(this.key,JSON.stringify(e))},e.prototype.parseQueue=function(e){try{var t=JSON.parse(e);return Array.isArray(t)?t:[]}catch(e){return console.error("Failed to parse queue from localStorage:",e),[]}},e}());t.default=n},336:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logOut=void 0;var r=n(384),o=n(537),i=n(489);t.logOut=function(){try{var e=["LID","AID"];e.forEach((function(e){return(0,r.removeCookie)(e)}));var t=(0,i.getJwtKey)();return t&&(0,o.removeJwt)(t),{code:0,message:"退出登录成功",clearedCookies:e,clearedJwtKey:t}}catch(e){return{code:-1,message:"退出登录失败"}}}},365:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={"/proxy-sdk-jwt":{open:!1,ws:!1,target:"https://gateway.cnki.net/coreapi/api",changeOrigin:!0,pathRewrite:{"^/proxy-sdk-jwt":"/"}},"/proxy-sdk-ip":{open:!1,ws:!1,target:"https://x.cnki.net/ip",changeOrigin:!0,pathRewrite:{"^/proxy-sdk-ip":"/"},headers:{origin:"https://x.cnki.net",referer:"https://x.cnki.net"}}}},384:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeCookie=t.setCookie=t.getCookie=void 0;t.getCookie=function(e){var t=new RegExp("(^| )"+e+"=([^;]*)(;|$)"),n=document.cookie.match(t);return n?decodeURIComponent(n[2]):null};var n=function(e,t,n,r){var o="";if(n&&0!==n){var i=new Date;i.setTime(i.getTime()+1e3*n),o="; expires=".concat(i.toUTCString())}document.cookie="".concat(e,"=").concat(t).concat(o,"; path=/; domain=").concat(r||"")};t.setCookie=n;t.removeCookie=function(e){n(e,"",-1),n(e,"",-1,"cnki.net")}},471:function(e,t,n){"use strict";var r,o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(r=function(e){return r=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},r(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=r(e),s=0;s<n.length;s++)"default"!==n[s]&&o(t,e,n[s]);return i(t,e),t}),a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},c=this&&this.__generator||function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRefreshToken=t.postAction=t.getAction=void 0;var l=u(n(637)),f=n(537),p=s(n(935));Object.defineProperty(t,"getRefreshToken",{enumerable:!0,get:function(){return p.getRefreshToken}});var d=n(776),h=s(n(489)),y=n(747),m=n(336),g=!1,b=!1,w=l.default.create({timeout:5e3,withCredentials:h.default.getOptions().withCredentials});w.interceptors.request.use((function(e){var t=h.default.getOptions(),n=null==t?void 0:t.interceptorsRequest;if(n){var r=n(e);r&&(e=r)}var o=(0,f.getJwt)((0,h.getJwtKey)());return o&&e.headers&&(e.headers.Authorization="Bearer ".concat(o)),e}),(function(e){return console.error("请求错误:",e),Promise.reject(e)})),w.interceptors.response.use((function(e){return a(void 0,void 0,void 0,(function(){var t,n,r,o,i,s,a,u,l,d,v,O;return c(this,(function(c){switch(c.label){case 0:return t=h.default.getOptions(),n=(0,y.getEnv)(),g?[2,Promise.resolve({data:{message:"请求已被全局阻断!"}})]:"function"!=typeof(r=(null==t?void 0:t.interceptorsResponse)||(null==t?void 0:t.response))?[3,2]:[4,r(e)];case 1:if(void 0!==(o=c.sent()))return[2,o];c.label=2;case 2:if(i=(null===(d=e.data)||void 0===d?void 0:d.code)||(null===(v=e.data)||void 0===v?void 0:v.Code)||(null===(O=e.data)||void 0===O?void 0:O.errcode)||200,[5014,5007].includes(i))return(0,m.logOut)(),[2,Promise.resolve(e)];if(![5013,5016].includes(i))return[3,6];(0,f.removeJwt)((0,h.getJwtKey)()),c.label=3;case 3:return c.trys.push([3,5,,6]),[4,(0,p.default)(w,e)];case 4:return[2,c.sent()];case 5:return s=c.sent(),[2,Promise.resolve({data:s})];case 6:return 429001===i&&(null==t?void 0:t.verifyRealName)&&"development"!==n&&(b||(b=!0,g=!0,a=encodeURIComponent(window.location.href),u=encodeURIComponent("platform=yxpt&returnUrl=".concat(a)),l=["test","development"].includes(n)?"https://xfat.cnki.net":"https://ix.cnki.net",["test","production"].includes(n)&&(window.location.href="".concat(l,"/psmc/user/returnUrl?code=").concat(i,"&paras=").concat(u,"&buries=true")))),[2,Promise.resolve(e)]}}))}))}),(function(e){return a(void 0,void 0,void 0,(function(){var t,n,r;return c(this,(function(o){switch(o.label){case 0:return 401!==e.status?[3,2]:(n=(t=Promise).resolve,[4,(0,p.default)(w,e)]);case 1:return[2,n.apply(t,[o.sent()])];case 2:return(null===(r=e.message)||void 0===r?void 0:r.includes("timeout"))&&console.error("请求超时,请检查网络连接"),[2,Promise.reject(e)]}}))}))}));var v=function(e,t,n,r){void 0===n&&(n={});var o=r||{};if(o.method=e,o.url=(0,d.getBaseUrl)(t),"get"===e.toLowerCase())o.params=n;else o.data=n;return w(o).then((function(e){var t=h.default.getOptions(),n=null==t?void 0:t.interceptorsResult;if(n&&!0!==o.skipInterceptorsRequest){var r=n(e);if(void 0!==r)return r}return e.data}))};t.getAction=function(e,t,n){return v("get",e,t,n)};t.postAction=function(e,t,n){return v("post",e,t,n)}},489:function(e,t){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.getJwtKey=t.store=void 0;var r=function(){function e(){this.options={appId:"",env:"development",proxy:"",timeout:5e3,verifyRealName:!0,withCredentials:!0,tracker:!1,overrideTrackerAppId:!1,response:function(){},interceptorsResponse:function(){},interceptorsRequest:function(){},interceptorsResult:function(){}}}return e.getInstance=function(){return this.instance||(this.instance=new e),this.instance},e.prototype.config=function(e){this.options=n(n({},this.options),e)},e.prototype.getOptions=function(){return n({},this.options)},e.prototype.getJwtKey=function(){return this.options.appId},e.prototype.setResponseHandler=function(e){this.options.response=e},e}();t.store=r.getInstance();t.getJwtKey=function(){return t.store.getJwtKey()},t.default=t.store},537:e=>{var t;self,t=()=>(()=>{"use strict";var e={};return{60:function(e,t){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},r=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s},i=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.removeAllJwt=t.removeJwt=t.getJwt=t.addJwt=t.initJwtManager=t.getURLParams=void 0;var s=function(e){var t=new RegExp("(^| )"+e+"=([^;]*)(;|$)"),n=document.cookie.match(t);return n?decodeURIComponent(n[2]):null};t.getURLParams=function(e){var t,n,i=new URLSearchParams(window.location.search),s={};try{for(var a=r(i.entries()),c=a.next();!c.done;c=a.next()){var u=o(c.value,2),l=u[0],f=u[1];s[l]=f}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return e?s[e]:s};var a=function(){function e(e){this.STORAGE_KEY=(null==e?void 0:e.storageKey)||"X_JWT_LIST",this.MAX_COUNT=(null==e?void 0:e.maxCount)||20,this.POP_DELETE_COUNT=(null==e?void 0:e.popDeleteCount)||5}return e.prototype.addJwt=function(e,r,o){if(!e||""===e.trim())throw new Error("JWT name cannot be empty");if(!r||""===r.trim())throw new Error("JWT token cannot be empty");if(!o||isNaN(o)||o<=0)throw new Error("expiresIn must be a valid positive number");var i=Date.now(),a=this.getJwtList(),c=a.findIndex((function(t){return t.name===e})),u={name:e,expireIn:i+1e3*(o-300),createdAt:i,jwtToken:r,source:s("LID")||(0,t.getURLParams)("LID")||""};c>=0?a[c]=n(n({},a[c]),u):(a.length>=this.MAX_COUNT&&a.splice(0,this.POP_DELETE_COUNT),a.push(u)),this.saveJWTList(a)},e.prototype.getJwt=function(e){if(!e||""===e.trim())throw new Error("JWT name cannot be empty");var n=this.getJwtList().find((function(t){return t.name===e})),r=s("LID")||(0,t.getURLParams)("LID")||"";if(n&&n.source){if(!r)return this.removeAllJwt(),null;if(n.source!==r)return null}return n?n.jwtToken:null},e.prototype.removeJwt=function(e){if(!e||""===e.trim())throw new Error("JWT name cannot be empty");var t=this.getJwtList().filter((function(t){return t.name!==e}));this.saveJWTList(t)},e.prototype.removeAllJwt=function(){localStorage.removeItem(this.STORAGE_KEY)},e.prototype.saveJWTList=function(e){localStorage.setItem(this.STORAGE_KEY,JSON.stringify(e))},e.prototype.removeExpired=function(e){var t=Date.now(),n=e.filter((function(e){return e.expireIn>t}));return this.saveJWTList(n),n},e.prototype.getJwtList=function(){var e=localStorage.getItem(this.STORAGE_KEY);if(!e)return[];try{var t=JSON.parse(e);return this.removeExpired(Array.isArray(t)?t:[])}catch(e){return console.warn("[XJwtManager] getJwtList JSON parse error:",e),[]}},e}(),c=new a;t.initJwtManager=function(e){c=new a(e)},t.addJwt=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return c.addJwt.apply(c,i([],o(e),!1))},t.getJwt=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return c.getJwt.apply(c,i([],o(e),!1))},t.removeJwt=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return c.removeJwt.apply(c,i([],o(e),!1))},t.removeAllJwt=function(){return c.removeAllJwt()},t.default={addJwt:t.addJwt,getJwt:t.getJwt,removeJwt:t.removeJwt,removeAllJwt:t.removeAllJwt,initJwtManager:t.initJwtManager}}}[60].call(e,0,e),e.default})(),e.exports=t()},551:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.tracker=function(){var e=a.default.getOptions();if("development"===e.env)return void(window.sta_api={toTrack:function(){}});if(b(e))return;p=function(t){return o(this,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:if(u.length>=l&&(u.shift(),console.warn("[STA] trackQueue overflow: oldest dropped.")),u.push(t),f)return g(e),[2];if(y)return[3,5];y=!0,r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,m()];case 2:return r.sent(),b(e),g(e),[3,5];case 3:return n=r.sent(),console.error("[STA] STA load failed:",n),[3,5];case 4:return y=!1,[7];case 5:return[2]}}))}))},window.sta_api={toTrack:function(e){if(p)return p(e);console.warn("[STA] proxyToTrack not ready.")}}};var a=s(n(489)),c="https://piccachex.cnki.net/sta_api/v1/scripts/sensors.min.js?v=20220425",u=[],l=500,f=null,p=null,d=null,h=!1,y=!1;function m(){return h?Promise.resolve():d||(d=new Promise((function(e,t){if(!!document.querySelector('script[src="'.concat(c,'"]')))h=!0,e();else{var n=document.createElement("script");n.src=c,n.async=!1,n.onload=function(){h=!0,e()},n.onerror=function(e){console.error("[STA] script load failed:",e),d=null,t(e)},document.head.appendChild(n)}})))}function g(e){if(f)for(;u.length;){var t=u.shift();f(r(r({},t),{track_from:"openx-js-sdk",app_id:e.overrideTrackerAppId||e.appId===t.app_id?e.appId:t.app_id}))}}function b(e){var t=window.sta_api;return!(!t||"function"!=typeof t.toTrack)&&(t.__OPENX_PATCHED__||(f=t.toTrack,t.toTrack=function(t){var n=r(r({},t),{track_from:"openx-js-sdk",app_id:e.overrideTrackerAppId||e.appId===t.app_id?e.appId:t.app_id});return f(n)},t.__OPENX_PATCHED__=!0),!0)}},598:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={"/proxy-sdk-jwt":{open:!1,ws:!1,target:"https://xtest.cnki.net/coreapi/api",changeOrigin:!0,pathRewrite:{"^/proxy-sdk-jwt":"/"},headers:{origin:"https://x.cnki.net",referer:"https://x.cnki.net"}},"/proxy-sdk-ip":{open:!1,ws:!1,target:"https://xtest.cnki.net/ip",changeOrigin:!0,pathRewrite:{"^/proxy-sdk-ip":"/"},headers:{origin:"https://x.cnki.net",referer:"https://x.cnki.net"}}}},637:(e,t,n)=>{"use strict";
2
- /*! Axios v1.12.2 Copyright (c) 2025 Matt Zabriskie and contributors */function r(e,t){return function(){return e.apply(t,arguments)}}const{toString:o}=Object.prototype,{getPrototypeOf:i}=Object,{iterator:s,toStringTag:a}=Symbol,c=(u=Object.create(null),e=>{const t=o.call(e);return u[t]||(u[t]=t.slice(8,-1).toLowerCase())});var u;const l=e=>(e=e.toLowerCase(),t=>c(t)===e),f=e=>t=>typeof t===e,{isArray:p}=Array,d=f("undefined");function h(e){return null!==e&&!d(e)&&null!==e.constructor&&!d(e.constructor)&&g(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const y=l("ArrayBuffer");const m=f("string"),g=f("function"),b=f("number"),w=e=>null!==e&&"object"==typeof e,v=e=>{if("object"!==c(e))return!1;const t=i(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||a in e||s in e)},O=l("Date"),E=l("File"),_=l("Blob"),R=l("FileList"),S=l("URLSearchParams"),[T,k,x,j]=["ReadableStream","Request","Response","Headers"].map(l);function A(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),p(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(h(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let s;for(r=0;r<i;r++)s=o[r],t.call(null,e[s],s,e)}}function P(e,t){if(h(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const C="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,U=e=>!d(e)&&e!==C;const N=(L="undefined"!=typeof Uint8Array&&i(Uint8Array),e=>L&&e instanceof L);var L;const I=l("HTMLFormElement"),J=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),D=l("RegExp"),F=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};A(n,((n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)})),Object.defineProperties(e,r)};const B=l("AsyncFunction"),M=(q="function"==typeof setImmediate,z=g(C.postMessage),q?setImmediate:z?(K=`axios@${Math.random()}`,W=[],C.addEventListener("message",(({source:e,data:t})=>{e===C&&t===K&&W.length&&W.shift()()}),!1),e=>{W.push(e),C.postMessage(K,"*")}):e=>setTimeout(e));var q,z,K,W;const H="undefined"!=typeof queueMicrotask?queueMicrotask.bind(C):"undefined"!=typeof process&&process.nextTick||M;var V={isArray:p,isArrayBuffer:y,isBuffer:h,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||g(e.append)&&("formdata"===(t=c(e))||"object"===t&&g(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&y(e.buffer),t},isString:m,isNumber:b,isBoolean:e=>!0===e||!1===e,isObject:w,isPlainObject:v,isEmptyObject:e=>{if(!w(e)||h(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:T,isRequest:k,isResponse:x,isHeaders:j,isUndefined:d,isDate:O,isFile:E,isBlob:_,isRegExp:D,isFunction:g,isStream:e=>w(e)&&g(e.pipe),isURLSearchParams:S,isTypedArray:N,isFileList:R,forEach:A,merge:function e(){const{caseless:t,skipUndefined:n}=U(this)&&this||{},r={},o=(o,i)=>{const s=t&&P(r,i)||i;v(r[s])&&v(o)?r[s]=e(r[s],o):v(o)?r[s]=e({},o):p(o)?r[s]=o.slice():n&&d(o)||(r[s]=o)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&A(arguments[e],o);return r},extend:(e,t,n,{allOwnKeys:o}={})=>(A(t,((t,o)=>{n&&g(t)?e[o]=r(t,n):e[o]=t}),{allOwnKeys:o}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,s,a;const c={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)a=o[s],r&&!r(a,e,t)||c[a]||(t[a]=e[a],c[a]=!0);e=!1!==n&&i(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:c,kindOfTest:l,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(p(e))return e;let t=e.length;if(!b(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[s]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:I,hasOwnProperty:J,hasOwnProp:J,reduceDescriptors:F,freezeMethods:e=>{F(e,((t,n)=>{if(g(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];g(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return p(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:P,global:C,isContextDefined:U,isSpecCompliantForm:function(e){return!!(e&&g(e.append)&&"FormData"===e[a]&&e[s])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(w(e)){if(t.indexOf(e)>=0)return;if(h(e))return e;if(!("toJSON"in e)){t[r]=e;const o=p(e)?[]:{};return A(e,((e,t)=>{const i=n(e,r+1);!d(i)&&(o[t]=i)})),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:B,isThenable:e=>e&&(w(e)||g(e))&&g(e.then)&&g(e.catch),setImmediate:M,asap:H,isIterable:e=>null!=e&&g(e[s])};function G(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}V.inherits(G,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:V.toJSONObject(this.config),code:this.code,status:this.status}}});const X=G.prototype,$={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{$[e]={value:e}})),Object.defineProperties(G,$),Object.defineProperty(X,"isAxiosError",{value:!0}),G.from=(e,t,n,r,o,i)=>{const s=Object.create(X);V.toFlatObject(e,s,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e));const a=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return G.call(s,a,c,n,r,o),e&&null==s.cause&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",i&&Object.assign(s,i),s};function Q(e){return V.isPlainObject(e)||V.isArray(e)}function Y(e){return V.endsWith(e,"[]")?e.slice(0,-2):e}function Z(e,t,n){return e?e.concat(t).map((function(e,t){return e=Y(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const ee=V.toFlatObject(V,{},null,(function(e){return/^is[A-Z]/.test(e)}));function te(e,t,n){if(!V.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=V.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!V.isUndefined(t[e])}))).metaTokens,o=n.visitor||u,i=n.dots,s=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&V.isSpecCompliantForm(t);if(!V.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(V.isDate(e))return e.toISOString();if(V.isBoolean(e))return e.toString();if(!a&&V.isBlob(e))throw new G("Blob is not supported. Use a Buffer instead.");return V.isArrayBuffer(e)||V.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(V.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(V.isArray(e)&&function(e){return V.isArray(e)&&!e.some(Q)}(e)||(V.isFileList(e)||V.endsWith(n,"[]"))&&(a=V.toArray(e)))return n=Y(n),a.forEach((function(e,r){!V.isUndefined(e)&&null!==e&&t.append(!0===s?Z([n],r,i):null===s?n:n+"[]",c(e))})),!1;return!!Q(e)||(t.append(Z(o,n,i),c(e)),!1)}const l=[],f=Object.assign(ee,{defaultVisitor:u,convertValue:c,isVisitable:Q});if(!V.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!V.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),V.forEach(n,(function(n,i){!0===(!(V.isUndefined(n)||null===n)&&o.call(t,n,V.isString(i)?i.trim():i,r,f))&&e(n,r?r.concat(i):[i])})),l.pop()}}(e),t}function ne(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function re(e,t){this._pairs=[],e&&te(e,this,t)}const oe=re.prototype;function ie(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function se(e,t,n){if(!t)return e;const r=n&&n.encode||ie;V.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(i=o?o(t,n):V.isURLSearchParams(t)?t.toString():new re(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}oe.append=function(e,t){this._pairs.push([e,t])},oe.toString=function(e){const t=e?function(t){return e.call(this,t,ne)}:ne;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var ae=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){V.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},ce={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ue={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:re,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const le="undefined"!=typeof window&&"undefined"!=typeof document,fe="object"==typeof navigator&&navigator||void 0,pe=le&&(!fe||["ReactNative","NativeScript","NS"].indexOf(fe.product)<0),de="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,he=le&&window.location.href||"http://localhost";var ye={...Object.freeze({__proto__:null,hasBrowserEnv:le,hasStandardBrowserWebWorkerEnv:de,hasStandardBrowserEnv:pe,navigator:fe,origin:he}),...ue};function me(e){function t(e,n,r,o){let i=e[o++];if("__proto__"===i)return!0;const s=Number.isFinite(+i),a=o>=e.length;if(i=!i&&V.isArray(r)?r.length:i,a)return V.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!s;r[i]&&V.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],o)&&V.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}(r[i])),!s}if(V.isFormData(e)&&V.isFunction(e.entries)){const n={};return V.forEachEntry(e,((e,r)=>{t(function(e){return V.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const ge={transitional:ce,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=V.isObject(e);o&&V.isHTMLForm(e)&&(e=new FormData(e));if(V.isFormData(e))return r?JSON.stringify(me(e)):e;if(V.isArrayBuffer(e)||V.isBuffer(e)||V.isStream(e)||V.isFile(e)||V.isBlob(e)||V.isReadableStream(e))return e;if(V.isArrayBufferView(e))return e.buffer;if(V.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return te(e,new ye.classes.URLSearchParams,{visitor:function(e,t,n,r){return ye.isNode&&V.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((i=V.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return te(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(V.isString(e))try{return(t||JSON.parse)(e),V.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||ge.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(V.isResponse(e)||V.isReadableStream(e))return e;if(e&&V.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n){if("SyntaxError"===e.name)throw G.from(e,G.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ye.classes.FormData,Blob:ye.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};V.forEach(["delete","get","head","post","put","patch"],(e=>{ge.headers[e]={}}));var be=ge;const we=V.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const ve=Symbol("internals");function Oe(e){return e&&String(e).trim().toLowerCase()}function Ee(e){return!1===e||null==e?e:V.isArray(e)?e.map(Ee):String(e)}function _e(e,t,n,r,o){return V.isFunction(r)?r.call(this,t,n):(o&&(t=n),V.isString(t)?V.isString(r)?-1!==t.indexOf(r):V.isRegExp(r)?r.test(t):void 0:void 0)}class Re{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=Oe(t);if(!o)throw new Error("header name must be a non-empty string");const i=V.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=Ee(e))}const i=(e,t)=>V.forEach(e,((e,n)=>o(e,n,t)));if(V.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(V.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&we[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t);else if(V.isObject(e)&&V.isIterable(e)){let n,r,o={};for(const t of e){if(!V.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?V.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}i(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=Oe(e)){const n=V.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(V.isFunction(t))return t.call(this,e,n);if(V.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Oe(e)){const n=V.findKey(this,e);return!(!n||void 0===this[n]||t&&!_e(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=Oe(e)){const o=V.findKey(n,e);!o||t&&!_e(0,n[o],o,t)||(delete n[o],r=!0)}}return V.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!_e(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return V.forEach(this,((r,o)=>{const i=V.findKey(n,o);if(i)return t[i]=Ee(r),void delete t[o];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(o):String(o).trim();s!==o&&delete t[o],t[s]=Ee(r),n[s]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return V.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&V.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[ve]=this[ve]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Oe(e);t[r]||(!function(e,t){const n=V.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return V.isArray(e)?e.forEach(r):r(e),this}}Re.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),V.reduceDescriptors(Re.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),V.freezeMethods(Re);var Se=Re;function Te(e,t){const n=this||be,r=t||n,o=Se.from(r.headers);let i=r.data;return V.forEach(e,(function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)})),o.normalize(),i}function ke(e){return!(!e||!e.__CANCEL__)}function xe(e,t,n){G.call(this,null==e?"canceled":e,G.ERR_CANCELED,t,n),this.name="CanceledError"}function je(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new G("Request failed with status code "+n.status,[G.ERR_BAD_REQUEST,G.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}V.inherits(xe,G,{__CANCEL__:!0});const Ae=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,s=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),u=r[s];o||(o=c),n[i]=a,r[i]=c;let l=s,f=0;for(;l!==i;)f+=n[l++],l%=e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),c-o<t)return;const p=u&&c-u;return p?Math.round(1e3*f/p):void 0}}(50,250);return function(e,t){let n,r,o=0,i=1e3/t;const s=(t,i=Date.now())=>{o=i,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=i?s(e,t):(n=e,r||(r=setTimeout((()=>{r=null,s(n)}),i-a)))},()=>n&&s(n)]}((n=>{const i=n.loaded,s=n.lengthComputable?n.total:void 0,a=i-r,c=o(a);r=i;e({loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&i<=s?(s-i)/c:void 0,event:n,lengthComputable:null!=s,[t?"download":"upload"]:!0})}),n)},Pe=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Ce=e=>(...t)=>V.asap((()=>e(...t)));var Ue=ye.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,ye.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(ye.origin),ye.navigator&&/(msie|trident)/i.test(ye.navigator.userAgent)):()=>!0,Ne=ye.hasStandardBrowserEnv?{write(e,t,n,r,o,i){const s=[e+"="+encodeURIComponent(t)];V.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),V.isString(r)&&s.push("path="+r),V.isString(o)&&s.push("domain="+o),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Le(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Ie=e=>e instanceof Se?{...e}:e;function Je(e,t){t=t||{};const n={};function r(e,t,n,r){return V.isPlainObject(e)&&V.isPlainObject(t)?V.merge.call({caseless:r},e,t):V.isPlainObject(t)?V.merge({},t):V.isArray(t)?t.slice():t}function o(e,t,n,o){return V.isUndefined(t)?V.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!V.isUndefined(t))return r(void 0,t)}function s(e,t){return V.isUndefined(t)?V.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(e,t,n)=>o(Ie(e),Ie(t),0,!0)};return V.forEach(Object.keys({...e,...t}),(function(r){const i=c[r]||o,s=i(e[r],t[r],r);V.isUndefined(s)&&i!==a||(n[r]=s)})),n}var De=e=>{const t=Je({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:a}=t;if(t.headers=s=Se.from(s),t.url=se(Le(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),V.isFormData(n))if(ye.hasStandardBrowserEnv||ye.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(V.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach((([e,n])=>{t.includes(e.toLowerCase())&&s.set(e,n)}))}if(ye.hasStandardBrowserEnv&&(r&&V.isFunction(r)&&(r=r(t)),r||!1!==r&&Ue(t.url))){const e=o&&i&&Ne.read(i);e&&s.set(o,e)}return t};var Fe="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=De(e);let o=r.data;const i=Se.from(r.headers).normalize();let s,a,c,u,l,{responseType:f,onUploadProgress:p,onDownloadProgress:d}=r;function h(){u&&u(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(s),r.signal&&r.signal.removeEventListener("abort",s)}let y=new XMLHttpRequest;function m(){if(!y)return;const r=Se.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());je((function(e){t(e),h()}),(function(e){n(e),h()}),{data:f&&"text"!==f&&"json"!==f?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:r,config:e,request:y}),y=null}y.open(r.method.toUpperCase(),r.url,!0),y.timeout=r.timeout,"onloadend"in y?y.onloadend=m:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(m)},y.onabort=function(){y&&(n(new G("Request aborted",G.ECONNABORTED,e,y)),y=null)},y.onerror=function(t){const r=new G(t&&t.message?t.message:"Network Error",G.ERR_NETWORK,e,y);r.event=t||null,n(r),y=null},y.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||ce;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new G(t,o.clarifyTimeoutError?G.ETIMEDOUT:G.ECONNABORTED,e,y)),y=null},void 0===o&&i.setContentType(null),"setRequestHeader"in y&&V.forEach(i.toJSON(),(function(e,t){y.setRequestHeader(t,e)})),V.isUndefined(r.withCredentials)||(y.withCredentials=!!r.withCredentials),f&&"json"!==f&&(y.responseType=r.responseType),d&&([c,l]=Ae(d,!0),y.addEventListener("progress",c)),p&&y.upload&&([a,u]=Ae(p),y.upload.addEventListener("progress",a),y.upload.addEventListener("loadend",u)),(r.cancelToken||r.signal)&&(s=t=>{y&&(n(!t||t.type?new xe(null,e,y):t),y.abort(),y=null)},r.cancelToken&&r.cancelToken.subscribe(s),r.signal&&(r.signal.aborted?s():r.signal.addEventListener("abort",s)));const g=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);g&&-1===ye.protocols.indexOf(g)?n(new G("Unsupported protocol "+g+":",G.ERR_BAD_REQUEST,e)):y.send(o||null)}))};var Be=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,s();const t=e instanceof Error?e:this.reason;r.abort(t instanceof G?t:new xe(t instanceof Error?t.message:t))}};let i=t&&setTimeout((()=>{i=null,o(new G(`timeout ${t} of ms exceeded`,G.ETIMEDOUT))}),t);const s=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)})),e=null)};e.forEach((e=>e.addEventListener("abort",o)));const{signal:a}=r;return a.unsubscribe=()=>V.asap(s),a}};const Me=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},qe=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},ze=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of qe(e))yield*Me(n,t)}(e,t);let i,s=0,a=e=>{i||(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let i=r.byteLength;if(n){let e=s+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},{isFunction:Ke}=V,We=(({Request:e,Response:t})=>({Request:e,Response:t}))(V.global),{ReadableStream:He,TextEncoder:Ve}=V.global,Ge=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Xe=e=>{e=V.merge.call({skipUndefined:!0},We,e);const{fetch:t,Request:n,Response:r}=e,o=t?Ke(t):"function"==typeof fetch,i=Ke(n),s=Ke(r);if(!o)return!1;const a=o&&Ke(He),c=o&&("function"==typeof Ve?(u=new Ve,e=>u.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var u;const l=i&&a&&Ge((()=>{let e=!1;const t=new n(ye.origin,{body:new He,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),f=s&&a&&Ge((()=>V.isReadableStream(new r("").body))),p={stream:f&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!p[e]&&(p[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new G(`Response type '${e}' is not supported`,G.ERR_NOT_SUPPORT,n)})}));const d=async(e,t)=>{const r=V.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(V.isBlob(e))return e.size;if(V.isSpecCompliantForm(e)){const t=new n(ye.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return V.isArrayBufferView(e)||V.isArrayBuffer(e)?e.byteLength:(V.isURLSearchParams(e)&&(e+=""),V.isString(e)?(await c(e)).byteLength:void 0)})(t):r};return async e=>{let{url:o,method:s,data:a,signal:c,cancelToken:u,timeout:h,onDownloadProgress:y,onUploadProgress:m,responseType:g,headers:b,withCredentials:w="same-origin",fetchOptions:v}=De(e),O=t||fetch;g=g?(g+"").toLowerCase():"text";let E=Be([c,u&&u.toAbortSignal()],h),_=null;const R=E&&E.unsubscribe&&(()=>{E.unsubscribe()});let S;try{if(m&&l&&"get"!==s&&"head"!==s&&0!==(S=await d(b,a))){let e,t=new n(o,{method:"POST",body:a,duplex:"half"});if(V.isFormData(a)&&(e=t.headers.get("content-type"))&&b.setContentType(e),t.body){const[e,n]=Pe(S,Ae(Ce(m)));a=ze(t.body,65536,e,n)}}V.isString(w)||(w=w?"include":"omit");const t=i&&"credentials"in n.prototype,c={...v,signal:E,method:s.toUpperCase(),headers:b.normalize().toJSON(),body:a,duplex:"half",credentials:t?w:void 0};_=i&&new n(o,c);let u=await(i?O(_,v):O(o,c));const h=f&&("stream"===g||"response"===g);if(f&&(y||h&&R)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=u[t]}));const t=V.toFiniteNumber(u.headers.get("content-length")),[n,o]=y&&Pe(t,Ae(Ce(y),!0))||[];u=new r(ze(u.body,65536,n,(()=>{o&&o(),R&&R()})),e)}g=g||"text";let T=await p[V.findKey(p,g)||"text"](u,e);return!h&&R&&R(),await new Promise(((t,n)=>{je(t,n,{data:T,headers:Se.from(u.headers),status:u.status,statusText:u.statusText,config:e,request:_})}))}catch(t){if(R&&R(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new G("Network Error",G.ERR_NETWORK,e,_),{cause:t.cause||t});throw G.from(t,t&&t.code,e,_)}}},$e=new Map,Qe=e=>{let t=e?e.env:{};const{fetch:n,Request:r,Response:o}=t,i=[r,o,n];let s,a,c=i.length,u=$e;for(;c--;)s=i[c],a=u.get(s),void 0===a&&u.set(s,a=c?new Map:Xe(t)),u=a;return a};Qe();const Ye={http:null,xhr:Fe,fetch:{get:Qe}};V.forEach(Ye,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Ze=e=>`- ${e}`,et=e=>V.isFunction(e)||null===e||!1===e;var tt=(e,t)=>{e=V.isArray(e)?e:[e];const{length:n}=e;let r,o;const i={};for(let s=0;s<n;s++){let n;if(r=e[s],o=r,!et(r)&&(o=Ye[(n=String(r)).toLowerCase()],void 0===o))throw new G(`Unknown adapter '${n}'`);if(o&&(V.isFunction(o)||(o=o.get(t))))break;i[n||"#"+s]=o}if(!o){const e=Object.entries(i).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new G("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(Ze).join("\n"):" "+Ze(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return o};function nt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new xe(null,e)}function rt(e){nt(e),e.headers=Se.from(e.headers),e.data=Te.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return tt(e.adapter||be.adapter,e)(e).then((function(t){return nt(e),t.data=Te.call(e,e.transformResponse,t),t.headers=Se.from(t.headers),t}),(function(t){return ke(t)||(nt(e),t&&t.response&&(t.response.data=Te.call(e,e.transformResponse,t.response),t.response.headers=Se.from(t.response.headers))),Promise.reject(t)}))}const ot="1.12.2",it={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{it[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const st={};it.transitional=function(e,t,n){function r(e,t){return"[Axios v"+ot+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new G(r(o," has been removed"+(t?" in "+t:"")),G.ERR_DEPRECATED);return t&&!st[o]&&(st[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},it.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var at={assertOptions:function(e,t,n){if("object"!=typeof e)throw new G("options must be an object",G.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],s=t[i];if(s){const t=e[i],n=void 0===t||s(t,i,e);if(!0!==n)throw new G("option "+i+" must be "+n,G.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new G("Unknown option "+i,G.ERR_BAD_OPTION)}},validators:it};const ct=at.validators;class ut{constructor(e){this.defaults=e||{},this.interceptors={request:new ae,response:new ae}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Je(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&at.assertOptions(n,{silentJSONParsing:ct.transitional(ct.boolean),forcedJSONParsing:ct.transitional(ct.boolean),clarifyTimeoutError:ct.transitional(ct.boolean)},!1),null!=r&&(V.isFunction(r)?t.paramsSerializer={serialize:r}:at.assertOptions(r,{encode:ct.function,serialize:ct.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),at.assertOptions(t,{baseUrl:ct.spelling("baseURL"),withXsrfToken:ct.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&V.merge(o.common,o[t.method]);o&&V.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=Se.concat(i,o);const s=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let l,f=0;if(!a){const e=[rt.bind(this),void 0];for(e.unshift(...s),e.push(...c),l=e.length,u=Promise.resolve(t);f<l;)u=u.then(e[f++],e[f++]);return u}l=s.length;let p=t;for(;f<l;){const e=s[f++],t=s[f++];try{p=e(p)}catch(e){t.call(this,e);break}}try{u=rt.call(this,p)}catch(e){return Promise.reject(e)}for(f=0,l=c.length;f<l;)u=u.then(c[f++],c[f++]);return u}getUri(e){return se(Le((e=Je(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}V.forEach(["delete","get","head","options"],(function(e){ut.prototype[e]=function(t,n){return this.request(Je(n||{},{method:e,url:t,data:(n||{}).data}))}})),V.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,o){return this.request(Je(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}ut.prototype[e]=t(),ut.prototype[e+"Form"]=t(!0)}));var lt=ut;class ft{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,o){n.reason||(n.reason=new xe(e,r,o),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new ft((function(t){e=t})),cancel:e}}}var pt=ft;const dt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(dt).forEach((([e,t])=>{dt[t]=e}));var ht=dt;const yt=function e(t){const n=new lt(t),o=r(lt.prototype.request,n);return V.extend(o,lt.prototype,n,{allOwnKeys:!0}),V.extend(o,n,null,{allOwnKeys:!0}),o.create=function(n){return e(Je(t,n))},o}(be);yt.Axios=lt,yt.CanceledError=xe,yt.CancelToken=pt,yt.isCancel=ke,yt.VERSION=ot,yt.toFormData=te,yt.AxiosError=G,yt.Cancel=yt.CanceledError,yt.all=function(e){return Promise.all(e)},yt.spread=function(e){return function(t){return e.apply(null,t)}},yt.isAxiosError=function(e){return V.isObject(e)&&!0===e.isAxiosError},yt.mergeConfig=Je,yt.AxiosHeaders=Se,yt.formToJSON=e=>me(V.isHTMLForm(e)?new FormData(e):e),yt.getAdapter=tt,yt.HttpStatusCode=ht,yt.default=yt,e.exports=yt},747:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getEnv=void 0;var o=r(n(489));t.getEnv=function(){return o.default.getOptions().env}},767:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getUserIp=void 0;var i=n(384),s=n(747),a={getUserIp:{test:"https://xtest.cnki.net/ip/client",development:"/proxy-sdk-ip/client",production:"https://x.cnki.net/ip/client"}};t.getUserIp=function(){return r(void 0,void 0,void 0,(function(){var e,t,n;return o(this,(function(r){switch(r.label){case 0:return r.trys.push([0,4,,5]),(e=(0,i.getCookie)("yxIP"))&&"undefined"!==e&&"null"!==e?[3,3]:[4,fetch(a.getUserIp[(0,s.getEnv)()],{method:"GET",headers:{source:"x.cnki.net"}})];case 1:return[4,r.sent().json()];case 2:return t=r.sent().content,n=(0,s.getEnv)(),(0,i.setCookie)("yxIP","development"===n?"124.193.98.142":t,432e3,"development"===n?"":".cnki.net"),[2,Promise.resolve(t)];case 3:return[2,Promise.resolve(e)];case 4:return r.sent(),[2,Promise.resolve("")];case 5:return[2]}}))}))}},776:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getBaseUrl=void 0;var i=o(n(598)),s=o(n(598)),a=o(n(365)),c=o(n(489)),u=n(747),l={development:i.default,test:s.default,production:a.default};t.getBaseUrl=function(e){var t,n,o=c.default.getOptions(),i=(0,u.getEnv)(),a=o.proxy?r(r({},o.proxy),l[i]):"development"===i?s.default:l[i],f=e;if("development"!==i){var p=null!==(n=null===(t=e.match(/^\/[^/]+/))||void 0===t?void 0:t[0])&&void 0!==n?n:"";Object.keys(a).forEach((function(t){(p===t||e.includes(t))&&(f=f.replace(t,a[t].target))}))}return f}},811:function(e,t,n){"use strict";var r,o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(r=function(e){return r=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},r(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=r(e),s=0;s<n.length;s++)"default"!==n[s]&&o(t,e,n[s]);return i(t,e),t}),a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},c=this&&this.__generator||function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.localQueueStore=t.removeCookie=t.setCookie=t.getCookie=void 0;var l=s(n(489)),f=n(471),p=n(537),d=u(n(65));t.localQueueStore=d.default;var h=n(767),y=n(551),m=n(336),g=function(){function e(){this.getAction=f.getAction,this.getRefreshToken=f.getRefreshToken,this.postAction=f.postAction,this.getJwt=function(){return(0,p.getJwt)((0,l.getJwtKey)())},this.removeJwt=function(){return(0,p.removeJwt)((0,l.getJwtKey)())},this.getUserIp=function(){return(0,h.getUserIp)()},this.toTrack=function(){return(0,h.getUserIp)()},this.logOut=function(){return(0,m.logOut)()}}return e.getInstance=function(){return this.instance||(this.instance=new e),this.instance},e.prototype.config=function(e){return l.default.config(e),this},e.prototype.ready=function(){return a(this,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return[4,(0,h.getUserIp)()];case 1:return e.sent(),l.default.getOptions().tracker&&(0,y.tracker)(),[4,(0,f.getRefreshToken)()];case 2:return[2,e.sent()]}}))}))},e.instance=null,e}();t.default=g.getInstance();var b=n(384);Object.defineProperty(t,"getCookie",{enumerable:!0,get:function(){return b.getCookie}}),Object.defineProperty(t,"setCookie",{enumerable:!0,get:function(){return b.setCookie}}),Object.defineProperty(t,"removeCookie",{enumerable:!0,get:function(){return b.removeCookie}})},935:function(e,t,n){"use strict";var r,o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(r=function(e){return r=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},r(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=r(e),s=0;s<n.length;s++)"default"!==n[s]&&o(t,e,n[s]);return i(t,e),t}),a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},c=this&&this.__generator||function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRefreshToken=void 0;var u=n(384),l=n(471),f=n(537),p=s(n(489)),d=n(336);t.getRefreshToken=function(){return a(void 0,void 0,void 0,(function(){var e,t,n,r,o,i,s,a,d;return c(this,(function(c){switch(c.label){case 0:if(e=p.default.getOptions(),t=(0,p.getJwtKey)(),!(n=(0,u.getCookie)("LID")))return[2,{code:5014,message:"无法获取 LID,请重新登录"}];if(r=(0,f.getJwt)(t))return[2,{code:0,content:r,message:"JWT 已缓存,无需刷新"}];c.label=1;case 1:return c.trys.push([1,3,,4]),o={AppId:e.appId,ClientId:(0,u.getCookie)("Ecp_ClientId")||"9240617191000011664",ClientIp:(0,u.getCookie)("yxIP"),EcpToken:n},[4,(0,l.postAction)("/proxy-sdk-jwt/JwtToken/ecptoken",o,{withCredentials:!1,skipInterceptorsRequest:!0})];case 2:return(i=c.sent()).Success&&i.Content?(s=i.Content,a=s.JwtToken,d=s.ExpireIn,(0,f.addJwt)(t,a,d),[2,{code:0,content:a,message:"JWT 刷新成功"}]):5019===i.Code?[2,{code:5019,message:i.Message||"Token 刷新失败"}]:5014===i.Code?[2,{code:5014,message:i.Message||"Token 刷新失败"}]:[2,{code:-1,message:i.Message||"Token 刷新失败"}];case 3:return[2,{code:500,message:c.sent().message||"Token 刷新异常,请稍后重试"}];case 4:return[2]}}))}))};var h=0,y=!1,m=[];t.default=function(e,n){return a(void 0,void 0,void 0,(function(){var r,o;return c(this,(function(i){switch(i.label){case 0:if(y)return[3,6];if(y=!0,h>=2)return y=!1,(0,d.logOut)(),[2,Promise.reject("Token 刷新异常,请稍后重试,超出最大重发次数。")];h+=1,i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,(0,t.getRefreshToken)()];case 2:if(0!==(r=i.sent()).code)throw r;return m.forEach((function(e){return e()})),m=[],[2,e(n.config)];case 3:return o=i.sent(),(0,d.logOut)(),[2,Promise.reject(o)];case 4:return y=!1,[7];case 5:return[3,7];case 6:return[2,new Promise((function(t){m.push((function(){t(e(n.config))}))}))];case 7:return[2]}}))}))}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}return n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n(811)})()));
1
+ /*!
2
+ * openx-js-sdk v0.0.28
3
+ * author: charlie
4
+ * build: 2026-01-11T07:07:22.738Z
5
+ * (c) CNKI
6
+ */
7
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("openx",[],t):"object"==typeof exports?exports.openx=t():e.openx=t()}(this,(()=>(()=>{var e={65:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=new(function(){function e(e,t){void 0===e&&(e=1/0),void 0===t&&(t="queue"),this.key=t,this.maxSize=e;var n=localStorage.getItem(this.key);this.queue=n?new Map(this.parseQueue(n)):new Map}return e.prototype.setValue=function(e,t){if(this.size()>=this.maxSize){var n=this.queue.keys().next().value;this.queue.delete(n)}this.queue.set(e,t),this.saveToLocalStorage()},e.prototype.isEmpty=function(){return 0===this.queue.size},e.prototype.size=function(){return this.queue.size},e.prototype.clear=function(){this.queue.clear(),this.saveToLocalStorage()},e.prototype.getValue=function(e){return this.queue.get(e)},e.prototype.saveToLocalStorage=function(){var e=Array.from(this.queue);localStorage.setItem(this.key,JSON.stringify(e))},e.prototype.parseQueue=function(e){try{var t=JSON.parse(e);return Array.isArray(t)?t:[]}catch(e){return console.error("Failed to parse queue from localStorage:",e),[]}},e}());t.default=n},336:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logOut=void 0;var r=n(384),o=n(537),i=n(489);t.logOut=function(){try{var e=["LID","AID"];e.forEach((function(e){return(0,r.removeCookie)(e)}));var t=(0,i.getJwtKey)();return t&&(0,o.removeJwt)(t),{code:0,message:"退出登录成功",clearedCookies:e,clearedJwtKey:t}}catch(e){return{code:-1,message:"退出登录失败"}}}},365:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={"/proxy-sdk-jwt":{open:!1,ws:!1,target:"https://gateway.cnki.net/coreapi/api",changeOrigin:!0,pathRewrite:{"^/proxy-sdk-jwt":"/"}},"/proxy-sdk-ip":{open:!1,ws:!1,target:"https://x.cnki.net/ip",changeOrigin:!0,pathRewrite:{"^/proxy-sdk-ip":"/"},headers:{origin:"https://x.cnki.net",referer:"https://x.cnki.net"}}}},384:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeCookie=t.setCookie=t.getCookie=void 0;t.getCookie=function(e){var t=new RegExp("(^| )"+e+"=([^;]*)(;|$)"),n=document.cookie.match(t);return n?decodeURIComponent(n[2]):null};var n=function(e,t,n,r){var o="";if(n&&0!==n){var i=new Date;i.setTime(i.getTime()+1e3*n),o="; expires=".concat(i.toUTCString())}document.cookie="".concat(e,"=").concat(t).concat(o,"; path=/; domain=").concat(r||"")};t.setCookie=n;t.removeCookie=function(e){n(e,"",-1),n(e,"",-1,"cnki.net")}},471:function(e,t,n){"use strict";var r,o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(r=function(e){return r=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},r(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=r(e),s=0;s<n.length;s++)"default"!==n[s]&&o(t,e,n[s]);return i(t,e),t}),a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},c=this&&this.__generator||function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRefreshToken=t.postAction=t.getAction=void 0;var l=u(n(637)),f=n(537),d=s(n(935));Object.defineProperty(t,"getRefreshToken",{enumerable:!0,get:function(){return d.getRefreshToken}});var p=n(776),h=s(n(489)),m=n(747),y=n(336),g=!1,b=!1,w=l.default.create({timeout:h.default.getOptions().timeout,withCredentials:h.default.getOptions().withCredentials});w.interceptors.request.use((function(e){var t=h.default.getOptions(),n=null==t?void 0:t.interceptorsRequest;if(n){var r=n(e);r&&(e=r)}var o=(0,f.getJwt)((0,h.getJwtKey)());return o&&e.headers&&(e.headers.Authorization="Bearer ".concat(o)),e}),(function(e){return console.error("请求错误:",e),Promise.reject(e)})),w.interceptors.response.use((function(e){return a(void 0,void 0,void 0,(function(){var t,n,r,o,i,s,a,u,l,p,v,O;return c(this,(function(c){switch(c.label){case 0:return t=h.default.getOptions(),n=(0,m.getEnv)(),g?[2,Promise.resolve({data:{message:"请求已被全局阻断!"}})]:"function"!=typeof(r=(null==t?void 0:t.interceptorsResponse)||(null==t?void 0:t.response))?[3,2]:[4,r(e)];case 1:if(void 0!==(o=c.sent()))return[2,o];c.label=2;case 2:if(i=(null===(p=e.data)||void 0===p?void 0:p.code)||(null===(v=e.data)||void 0===v?void 0:v.Code)||(null===(O=e.data)||void 0===O?void 0:O.errcode)||200,[5014,5007].includes(i))return(0,y.logOut)(),[2,Promise.resolve(e)];if(![5013,5016].includes(i))return[3,6];(0,f.removeJwt)((0,h.getJwtKey)()),c.label=3;case 3:return c.trys.push([3,5,,6]),[4,(0,d.default)(w,e)];case 4:return[2,c.sent()];case 5:return s=c.sent(),[2,Promise.resolve({data:s})];case 6:return 429001===i&&(null==t?void 0:t.verifyRealName)&&"development"!==n&&(b||(b=!0,g=!0,a=encodeURIComponent(window.location.href),u=encodeURIComponent("platform=yxpt&returnUrl=".concat(a)),l=["test","development"].includes(n)?"https://xfat.cnki.net":"https://ix.cnki.net",["test","production"].includes(n)&&(window.location.href="".concat(l,"/psmc/user/returnUrl?code=").concat(i,"&paras=").concat(u,"&buries=true")))),[2,Promise.resolve(e)]}}))}))}),(function(e){return a(void 0,void 0,void 0,(function(){var t,n,r;return c(this,(function(o){switch(o.label){case 0:return 401!==e.status?[3,2]:(n=(t=Promise).resolve,[4,(0,d.default)(w,e)]);case 1:return[2,n.apply(t,[o.sent()])];case 2:return(null===(r=e.message)||void 0===r?void 0:r.includes("timeout"))&&console.error("请求超时,请检查网络连接"),[2,Promise.reject(e)]}}))}))}));var v=function(e,t,n,r){void 0===n&&(n={});var o=h.default.getOptions(),i=r||{};if(i.method=e,i.url=(0,p.getBaseUrl)(t),i.timeout=(null==r?void 0:r.timeout)?r.timeout:o.timeout,"get"===e.toLowerCase())i.params=n;else i.data=n;return w(i).then((function(e){var t=h.default.getOptions(),n=null==t?void 0:t.interceptorsResult;if(n&&!0!==i.skipInterceptorsRequest){var r=n(e);if(void 0!==r)return r}return e.data}))};t.getAction=function(e,t,n){return v("get",e,t,n)};t.postAction=function(e,t,n){return v("post",e,t,n)}},489:function(e,t){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.getJwtKey=t.store=void 0;var r=function(){function e(){this.options={appId:"",env:"development",scene:"",proxy:"",timeout:5e3,verifyRealName:!0,withCredentials:!0,tracker:!1,overrideTrackerAppId:!1,response:function(){},interceptorsResponse:function(){},interceptorsRequest:function(){},interceptorsResult:function(){}}}return e.getInstance=function(){return this.instance||(this.instance=new e),this.instance},e.prototype.config=function(e){this.options=n(n({},this.options),e)},e.prototype.getOptions=function(){return n({},this.options)},e.prototype.getJwtKey=function(){return this.options.appId},e.prototype.setResponseHandler=function(e){this.options.response=e},e}();t.store=r.getInstance();t.getJwtKey=function(){return t.store.getJwtKey()},t.default=t.store},537:e=>{var t;self,t=()=>(()=>{"use strict";var e={};return{60:function(e,t){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},r=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s},i=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.removeAllJwt=t.removeJwt=t.getJwt=t.addJwt=t.initJwtManager=t.getURLParams=void 0;var s=function(e){var t=new RegExp("(^| )"+e+"=([^;]*)(;|$)"),n=document.cookie.match(t);return n?decodeURIComponent(n[2]):null};t.getURLParams=function(e){var t,n,i=new URLSearchParams(window.location.search),s={};try{for(var a=r(i.entries()),c=a.next();!c.done;c=a.next()){var u=o(c.value,2),l=u[0],f=u[1];s[l]=f}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return e?s[e]:s};var a=function(){function e(e){this.STORAGE_KEY=(null==e?void 0:e.storageKey)||"X_JWT_LIST",this.MAX_COUNT=(null==e?void 0:e.maxCount)||20,this.POP_DELETE_COUNT=(null==e?void 0:e.popDeleteCount)||5}return e.prototype.addJwt=function(e,r,o){if(!e||""===e.trim())throw new Error("JWT name cannot be empty");if(!r||""===r.trim())throw new Error("JWT token cannot be empty");if(!o||isNaN(o)||o<=0)throw new Error("expiresIn must be a valid positive number");var i=Date.now(),a=this.getJwtList(),c=a.findIndex((function(t){return t.name===e})),u={name:e,expireIn:i+1e3*(o-300),createdAt:i,jwtToken:r,source:s("LID")||(0,t.getURLParams)("LID")||""};c>=0?a[c]=n(n({},a[c]),u):(a.length>=this.MAX_COUNT&&a.splice(0,this.POP_DELETE_COUNT),a.push(u)),this.saveJWTList(a)},e.prototype.getJwt=function(e){if(!e||""===e.trim())throw new Error("JWT name cannot be empty");var n=this.getJwtList().find((function(t){return t.name===e})),r=s("LID")||(0,t.getURLParams)("LID")||"";if(n&&n.source){if(!r)return this.removeAllJwt(),null;if(n.source!==r)return null}return n?n.jwtToken:null},e.prototype.removeJwt=function(e){if(!e||""===e.trim())throw new Error("JWT name cannot be empty");var t=this.getJwtList().filter((function(t){return t.name!==e}));this.saveJWTList(t)},e.prototype.removeAllJwt=function(){localStorage.removeItem(this.STORAGE_KEY)},e.prototype.saveJWTList=function(e){localStorage.setItem(this.STORAGE_KEY,JSON.stringify(e))},e.prototype.removeExpired=function(e){var t=Date.now(),n=e.filter((function(e){return e.expireIn>t}));return this.saveJWTList(n),n},e.prototype.getJwtList=function(){var e=localStorage.getItem(this.STORAGE_KEY);if(!e)return[];try{var t=JSON.parse(e);return this.removeExpired(Array.isArray(t)?t:[])}catch(e){return console.warn("[XJwtManager] getJwtList JSON parse error:",e),[]}},e}(),c=new a;t.initJwtManager=function(e){c=new a(e)},t.addJwt=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return c.addJwt.apply(c,i([],o(e),!1))},t.getJwt=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return c.getJwt.apply(c,i([],o(e),!1))},t.removeJwt=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return c.removeJwt.apply(c,i([],o(e),!1))},t.removeAllJwt=function(){return c.removeAllJwt()},t.default={addJwt:t.addJwt,getJwt:t.getJwt,removeJwt:t.removeJwt,removeAllJwt:t.removeAllJwt,initJwtManager:t.initJwtManager}}}[60].call(e,0,e),e.default})(),e.exports=t()},551:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.tracker=function(){var e=i.default.getOptions();p(e)||f||(f=!0,(l?Promise.resolve():u||(u=new Promise((function(e,t){if(document.querySelector('script[src="'.concat(s,'"]')))l=!0,e();else{var n=document.createElement("script");n.src=s,n.async=!1,n.onload=function(){l=!0,e()},n.onerror=function(e){console.error("[STA] script load failed:",e),u=null,t(e)},document.head.appendChild(n)}})))).then((function(){p(e),function(){if(!d)return;for(;a.length;){var e=a.shift();d(e)}}()})).catch((function(e){console.error("[OpenX-STA] load failed:",e)})).finally((function(){f=!1})))};var i=o(n(489)),s="https://piccachex.cnki.net/sta_api/v1/scripts/sensors.min.js?v=20220425",a=[],c=500,u=null,l=!1,f=!1,d=null;function p(e){var t=window.sta_api;return!!t&&(!(!t||"function"!=typeof t.toTrack)&&(d=t.toTrack.bind(t),window.sta_api=r(r({},window.sta_api||{}),{toTrackOpenx:function(t){!function(e,t){var n=t||{},o=n.appId,i=n.scene,s=r(r({},e),{track_from:"openx-js-sdk",app_id:"".concat(o).concat(i?"@"+i:"")});if(!d)return a.length>=c&&(a.shift(),console.warn("[OpenX-STA] trackQueue overflow, drop oldest.")),void a.push(s);d(s)}(t,e)}}),!0))}},598:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default={"/proxy-sdk-jwt":{open:!1,ws:!1,target:"https://xtest.cnki.net/coreapi/api",changeOrigin:!0,pathRewrite:{"^/proxy-sdk-jwt":"/"},headers:{origin:"https://x.cnki.net",referer:"https://x.cnki.net"}},"/proxy-sdk-ip":{open:!1,ws:!1,target:"https://xtest.cnki.net/ip",changeOrigin:!0,pathRewrite:{"^/proxy-sdk-ip":"/"},headers:{origin:"https://x.cnki.net",referer:"https://x.cnki.net"}}}},637:(e,t,n)=>{"use strict";
8
+ /*! Axios v1.12.2 Copyright (c) 2025 Matt Zabriskie and contributors */function r(e,t){return function(){return e.apply(t,arguments)}}const{toString:o}=Object.prototype,{getPrototypeOf:i}=Object,{iterator:s,toStringTag:a}=Symbol,c=(u=Object.create(null),e=>{const t=o.call(e);return u[t]||(u[t]=t.slice(8,-1).toLowerCase())});var u;const l=e=>(e=e.toLowerCase(),t=>c(t)===e),f=e=>t=>typeof t===e,{isArray:d}=Array,p=f("undefined");function h(e){return null!==e&&!p(e)&&null!==e.constructor&&!p(e.constructor)&&g(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const m=l("ArrayBuffer");const y=f("string"),g=f("function"),b=f("number"),w=e=>null!==e&&"object"==typeof e,v=e=>{if("object"!==c(e))return!1;const t=i(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||a in e||s in e)},O=l("Date"),E=l("File"),_=l("Blob"),R=l("FileList"),S=l("URLSearchParams"),[T,k,x,j]=["ReadableStream","Request","Response","Headers"].map(l);function A(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),d(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(h(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let s;for(r=0;r<i;r++)s=o[r],t.call(null,e[s],s,e)}}function P(e,t){if(h(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const C="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,U=e=>!p(e)&&e!==C;const N=(L="undefined"!=typeof Uint8Array&&i(Uint8Array),e=>L&&e instanceof L);var L;const J=l("HTMLFormElement"),I=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),D=l("RegExp"),F=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};A(n,((n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)})),Object.defineProperties(e,r)};const B=l("AsyncFunction"),M=(q="function"==typeof setImmediate,z=g(C.postMessage),q?setImmediate:z?(K=`axios@${Math.random()}`,W=[],C.addEventListener("message",(({source:e,data:t})=>{e===C&&t===K&&W.length&&W.shift()()}),!1),e=>{W.push(e),C.postMessage(K,"*")}):e=>setTimeout(e));var q,z,K,W;const H="undefined"!=typeof queueMicrotask?queueMicrotask.bind(C):"undefined"!=typeof process&&process.nextTick||M;var V={isArray:d,isArrayBuffer:m,isBuffer:h,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||g(e.append)&&("formdata"===(t=c(e))||"object"===t&&g(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&m(e.buffer),t},isString:y,isNumber:b,isBoolean:e=>!0===e||!1===e,isObject:w,isPlainObject:v,isEmptyObject:e=>{if(!w(e)||h(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:T,isRequest:k,isResponse:x,isHeaders:j,isUndefined:p,isDate:O,isFile:E,isBlob:_,isRegExp:D,isFunction:g,isStream:e=>w(e)&&g(e.pipe),isURLSearchParams:S,isTypedArray:N,isFileList:R,forEach:A,merge:function e(){const{caseless:t,skipUndefined:n}=U(this)&&this||{},r={},o=(o,i)=>{const s=t&&P(r,i)||i;v(r[s])&&v(o)?r[s]=e(r[s],o):v(o)?r[s]=e({},o):d(o)?r[s]=o.slice():n&&p(o)||(r[s]=o)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&A(arguments[e],o);return r},extend:(e,t,n,{allOwnKeys:o}={})=>(A(t,((t,o)=>{n&&g(t)?e[o]=r(t,n):e[o]=t}),{allOwnKeys:o}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,s,a;const c={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)a=o[s],r&&!r(a,e,t)||c[a]||(t[a]=e[a],c[a]=!0);e=!1!==n&&i(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:c,kindOfTest:l,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(d(e))return e;let t=e.length;if(!b(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[s]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:J,hasOwnProperty:I,hasOwnProp:I,reduceDescriptors:F,freezeMethods:e=>{F(e,((t,n)=>{if(g(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];g(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return d(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:P,global:C,isContextDefined:U,isSpecCompliantForm:function(e){return!!(e&&g(e.append)&&"FormData"===e[a]&&e[s])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(w(e)){if(t.indexOf(e)>=0)return;if(h(e))return e;if(!("toJSON"in e)){t[r]=e;const o=d(e)?[]:{};return A(e,((e,t)=>{const i=n(e,r+1);!p(i)&&(o[t]=i)})),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:B,isThenable:e=>e&&(w(e)||g(e))&&g(e.then)&&g(e.catch),setImmediate:M,asap:H,isIterable:e=>null!=e&&g(e[s])};function G(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}V.inherits(G,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:V.toJSONObject(this.config),code:this.code,status:this.status}}});const X=G.prototype,$={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{$[e]={value:e}})),Object.defineProperties(G,$),Object.defineProperty(X,"isAxiosError",{value:!0}),G.from=(e,t,n,r,o,i)=>{const s=Object.create(X);V.toFlatObject(e,s,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e));const a=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return G.call(s,a,c,n,r,o),e&&null==s.cause&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",i&&Object.assign(s,i),s};function Q(e){return V.isPlainObject(e)||V.isArray(e)}function Y(e){return V.endsWith(e,"[]")?e.slice(0,-2):e}function Z(e,t,n){return e?e.concat(t).map((function(e,t){return e=Y(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const ee=V.toFlatObject(V,{},null,(function(e){return/^is[A-Z]/.test(e)}));function te(e,t,n){if(!V.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=V.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!V.isUndefined(t[e])}))).metaTokens,o=n.visitor||u,i=n.dots,s=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&V.isSpecCompliantForm(t);if(!V.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(V.isDate(e))return e.toISOString();if(V.isBoolean(e))return e.toString();if(!a&&V.isBlob(e))throw new G("Blob is not supported. Use a Buffer instead.");return V.isArrayBuffer(e)||V.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(V.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(V.isArray(e)&&function(e){return V.isArray(e)&&!e.some(Q)}(e)||(V.isFileList(e)||V.endsWith(n,"[]"))&&(a=V.toArray(e)))return n=Y(n),a.forEach((function(e,r){!V.isUndefined(e)&&null!==e&&t.append(!0===s?Z([n],r,i):null===s?n:n+"[]",c(e))})),!1;return!!Q(e)||(t.append(Z(o,n,i),c(e)),!1)}const l=[],f=Object.assign(ee,{defaultVisitor:u,convertValue:c,isVisitable:Q});if(!V.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!V.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),V.forEach(n,(function(n,i){!0===(!(V.isUndefined(n)||null===n)&&o.call(t,n,V.isString(i)?i.trim():i,r,f))&&e(n,r?r.concat(i):[i])})),l.pop()}}(e),t}function ne(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function re(e,t){this._pairs=[],e&&te(e,this,t)}const oe=re.prototype;function ie(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function se(e,t,n){if(!t)return e;const r=n&&n.encode||ie;V.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(i=o?o(t,n):V.isURLSearchParams(t)?t.toString():new re(t,n).toString(r),i){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}oe.append=function(e,t){this._pairs.push([e,t])},oe.toString=function(e){const t=e?function(t){return e.call(this,t,ne)}:ne;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var ae=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){V.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},ce={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ue={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:re,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const le="undefined"!=typeof window&&"undefined"!=typeof document,fe="object"==typeof navigator&&navigator||void 0,de=le&&(!fe||["ReactNative","NativeScript","NS"].indexOf(fe.product)<0),pe="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,he=le&&window.location.href||"http://localhost";var me={...Object.freeze({__proto__:null,hasBrowserEnv:le,hasStandardBrowserWebWorkerEnv:pe,hasStandardBrowserEnv:de,navigator:fe,origin:he}),...ue};function ye(e){function t(e,n,r,o){let i=e[o++];if("__proto__"===i)return!0;const s=Number.isFinite(+i),a=o>=e.length;if(i=!i&&V.isArray(r)?r.length:i,a)return V.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!s;r[i]&&V.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],o)&&V.isArray(r[i])&&(r[i]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}(r[i])),!s}if(V.isFormData(e)&&V.isFunction(e.entries)){const n={};return V.forEachEntry(e,((e,r)=>{t(function(e){return V.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const ge={transitional:ce,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=V.isObject(e);o&&V.isHTMLForm(e)&&(e=new FormData(e));if(V.isFormData(e))return r?JSON.stringify(ye(e)):e;if(V.isArrayBuffer(e)||V.isBuffer(e)||V.isStream(e)||V.isFile(e)||V.isBlob(e)||V.isReadableStream(e))return e;if(V.isArrayBufferView(e))return e.buffer;if(V.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return te(e,new me.classes.URLSearchParams,{visitor:function(e,t,n,r){return me.isNode&&V.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((i=V.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return te(i?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(V.isString(e))try{return(t||JSON.parse)(e),V.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||ge.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(V.isResponse(e)||V.isReadableStream(e))return e;if(e&&V.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n){if("SyntaxError"===e.name)throw G.from(e,G.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:me.classes.FormData,Blob:me.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};V.forEach(["delete","get","head","post","put","patch"],(e=>{ge.headers[e]={}}));var be=ge;const we=V.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const ve=Symbol("internals");function Oe(e){return e&&String(e).trim().toLowerCase()}function Ee(e){return!1===e||null==e?e:V.isArray(e)?e.map(Ee):String(e)}function _e(e,t,n,r,o){return V.isFunction(r)?r.call(this,t,n):(o&&(t=n),V.isString(t)?V.isString(r)?-1!==t.indexOf(r):V.isRegExp(r)?r.test(t):void 0:void 0)}class Re{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=Oe(t);if(!o)throw new Error("header name must be a non-empty string");const i=V.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=Ee(e))}const i=(e,t)=>V.forEach(e,((e,n)=>o(e,n,t)));if(V.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(V.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&we[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t);else if(V.isObject(e)&&V.isIterable(e)){let n,r,o={};for(const t of e){if(!V.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?V.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}i(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=Oe(e)){const n=V.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(V.isFunction(t))return t.call(this,e,n);if(V.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Oe(e)){const n=V.findKey(this,e);return!(!n||void 0===this[n]||t&&!_e(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=Oe(e)){const o=V.findKey(n,e);!o||t&&!_e(0,n[o],o,t)||(delete n[o],r=!0)}}return V.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!_e(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return V.forEach(this,((r,o)=>{const i=V.findKey(n,o);if(i)return t[i]=Ee(r),void delete t[o];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(o):String(o).trim();s!==o&&delete t[o],t[s]=Ee(r),n[s]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return V.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&V.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[ve]=this[ve]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Oe(e);t[r]||(!function(e,t){const n=V.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return V.isArray(e)?e.forEach(r):r(e),this}}Re.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),V.reduceDescriptors(Re.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}})),V.freezeMethods(Re);var Se=Re;function Te(e,t){const n=this||be,r=t||n,o=Se.from(r.headers);let i=r.data;return V.forEach(e,(function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)})),o.normalize(),i}function ke(e){return!(!e||!e.__CANCEL__)}function xe(e,t,n){G.call(this,null==e?"canceled":e,G.ERR_CANCELED,t,n),this.name="CanceledError"}function je(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new G("Request failed with status code "+n.status,[G.ERR_BAD_REQUEST,G.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}V.inherits(xe,G,{__CANCEL__:!0});const Ae=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,s=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),u=r[s];o||(o=c),n[i]=a,r[i]=c;let l=s,f=0;for(;l!==i;)f+=n[l++],l%=e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),c-o<t)return;const d=u&&c-u;return d?Math.round(1e3*f/d):void 0}}(50,250);return function(e,t){let n,r,o=0,i=1e3/t;const s=(t,i=Date.now())=>{o=i,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=i?s(e,t):(n=e,r||(r=setTimeout((()=>{r=null,s(n)}),i-a)))},()=>n&&s(n)]}((n=>{const i=n.loaded,s=n.lengthComputable?n.total:void 0,a=i-r,c=o(a);r=i;e({loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&i<=s?(s-i)/c:void 0,event:n,lengthComputable:null!=s,[t?"download":"upload"]:!0})}),n)},Pe=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Ce=e=>(...t)=>V.asap((()=>e(...t)));var Ue=me.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,me.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(me.origin),me.navigator&&/(msie|trident)/i.test(me.navigator.userAgent)):()=>!0,Ne=me.hasStandardBrowserEnv?{write(e,t,n,r,o,i){const s=[e+"="+encodeURIComponent(t)];V.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),V.isString(r)&&s.push("path="+r),V.isString(o)&&s.push("domain="+o),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Le(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Je=e=>e instanceof Se?{...e}:e;function Ie(e,t){t=t||{};const n={};function r(e,t,n,r){return V.isPlainObject(e)&&V.isPlainObject(t)?V.merge.call({caseless:r},e,t):V.isPlainObject(t)?V.merge({},t):V.isArray(t)?t.slice():t}function o(e,t,n,o){return V.isUndefined(t)?V.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function i(e,t){if(!V.isUndefined(t))return r(void 0,t)}function s(e,t){return V.isUndefined(t)?V.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}const c={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(e,t,n)=>o(Je(e),Je(t),0,!0)};return V.forEach(Object.keys({...e,...t}),(function(r){const i=c[r]||o,s=i(e[r],t[r],r);V.isUndefined(s)&&i!==a||(n[r]=s)})),n}var De=e=>{const t=Ie({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:a}=t;if(t.headers=s=Se.from(s),t.url=se(Le(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),V.isFormData(n))if(me.hasStandardBrowserEnv||me.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(V.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach((([e,n])=>{t.includes(e.toLowerCase())&&s.set(e,n)}))}if(me.hasStandardBrowserEnv&&(r&&V.isFunction(r)&&(r=r(t)),r||!1!==r&&Ue(t.url))){const e=o&&i&&Ne.read(i);e&&s.set(o,e)}return t};var Fe="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=De(e);let o=r.data;const i=Se.from(r.headers).normalize();let s,a,c,u,l,{responseType:f,onUploadProgress:d,onDownloadProgress:p}=r;function h(){u&&u(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(s),r.signal&&r.signal.removeEventListener("abort",s)}let m=new XMLHttpRequest;function y(){if(!m)return;const r=Se.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());je((function(e){t(e),h()}),(function(e){n(e),h()}),{data:f&&"text"!==f&&"json"!==f?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=y:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(y)},m.onabort=function(){m&&(n(new G("Request aborted",G.ECONNABORTED,e,m)),m=null)},m.onerror=function(t){const r=new G(t&&t.message?t.message:"Network Error",G.ERR_NETWORK,e,m);r.event=t||null,n(r),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||ce;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new G(t,o.clarifyTimeoutError?G.ETIMEDOUT:G.ECONNABORTED,e,m)),m=null},void 0===o&&i.setContentType(null),"setRequestHeader"in m&&V.forEach(i.toJSON(),(function(e,t){m.setRequestHeader(t,e)})),V.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),f&&"json"!==f&&(m.responseType=r.responseType),p&&([c,l]=Ae(p,!0),m.addEventListener("progress",c)),d&&m.upload&&([a,u]=Ae(d),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",u)),(r.cancelToken||r.signal)&&(s=t=>{m&&(n(!t||t.type?new xe(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(s),r.signal&&(r.signal.aborted?s():r.signal.addEventListener("abort",s)));const g=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);g&&-1===me.protocols.indexOf(g)?n(new G("Unsupported protocol "+g+":",G.ERR_BAD_REQUEST,e)):m.send(o||null)}))};var Be=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,s();const t=e instanceof Error?e:this.reason;r.abort(t instanceof G?t:new xe(t instanceof Error?t.message:t))}};let i=t&&setTimeout((()=>{i=null,o(new G(`timeout ${t} of ms exceeded`,G.ETIMEDOUT))}),t);const s=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)})),e=null)};e.forEach((e=>e.addEventListener("abort",o)));const{signal:a}=r;return a.unsubscribe=()=>V.asap(s),a}};const Me=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},qe=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},ze=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of qe(e))yield*Me(n,t)}(e,t);let i,s=0,a=e=>{i||(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let i=r.byteLength;if(n){let e=s+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},{isFunction:Ke}=V,We=(({Request:e,Response:t})=>({Request:e,Response:t}))(V.global),{ReadableStream:He,TextEncoder:Ve}=V.global,Ge=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Xe=e=>{e=V.merge.call({skipUndefined:!0},We,e);const{fetch:t,Request:n,Response:r}=e,o=t?Ke(t):"function"==typeof fetch,i=Ke(n),s=Ke(r);if(!o)return!1;const a=o&&Ke(He),c=o&&("function"==typeof Ve?(u=new Ve,e=>u.encode(e)):async e=>new Uint8Array(await new n(e).arrayBuffer()));var u;const l=i&&a&&Ge((()=>{let e=!1;const t=new n(me.origin,{body:new He,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),f=s&&a&&Ge((()=>V.isReadableStream(new r("").body))),d={stream:f&&(e=>e.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!d[e]&&(d[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new G(`Response type '${e}' is not supported`,G.ERR_NOT_SUPPORT,n)})}));const p=async(e,t)=>{const r=V.toFiniteNumber(e.getContentLength());return null==r?(async e=>{if(null==e)return 0;if(V.isBlob(e))return e.size;if(V.isSpecCompliantForm(e)){const t=new n(me.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return V.isArrayBufferView(e)||V.isArrayBuffer(e)?e.byteLength:(V.isURLSearchParams(e)&&(e+=""),V.isString(e)?(await c(e)).byteLength:void 0)})(t):r};return async e=>{let{url:o,method:s,data:a,signal:c,cancelToken:u,timeout:h,onDownloadProgress:m,onUploadProgress:y,responseType:g,headers:b,withCredentials:w="same-origin",fetchOptions:v}=De(e),O=t||fetch;g=g?(g+"").toLowerCase():"text";let E=Be([c,u&&u.toAbortSignal()],h),_=null;const R=E&&E.unsubscribe&&(()=>{E.unsubscribe()});let S;try{if(y&&l&&"get"!==s&&"head"!==s&&0!==(S=await p(b,a))){let e,t=new n(o,{method:"POST",body:a,duplex:"half"});if(V.isFormData(a)&&(e=t.headers.get("content-type"))&&b.setContentType(e),t.body){const[e,n]=Pe(S,Ae(Ce(y)));a=ze(t.body,65536,e,n)}}V.isString(w)||(w=w?"include":"omit");const t=i&&"credentials"in n.prototype,c={...v,signal:E,method:s.toUpperCase(),headers:b.normalize().toJSON(),body:a,duplex:"half",credentials:t?w:void 0};_=i&&new n(o,c);let u=await(i?O(_,v):O(o,c));const h=f&&("stream"===g||"response"===g);if(f&&(m||h&&R)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=u[t]}));const t=V.toFiniteNumber(u.headers.get("content-length")),[n,o]=m&&Pe(t,Ae(Ce(m),!0))||[];u=new r(ze(u.body,65536,n,(()=>{o&&o(),R&&R()})),e)}g=g||"text";let T=await d[V.findKey(d,g)||"text"](u,e);return!h&&R&&R(),await new Promise(((t,n)=>{je(t,n,{data:T,headers:Se.from(u.headers),status:u.status,statusText:u.statusText,config:e,request:_})}))}catch(t){if(R&&R(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new G("Network Error",G.ERR_NETWORK,e,_),{cause:t.cause||t});throw G.from(t,t&&t.code,e,_)}}},$e=new Map,Qe=e=>{let t=e?e.env:{};const{fetch:n,Request:r,Response:o}=t,i=[r,o,n];let s,a,c=i.length,u=$e;for(;c--;)s=i[c],a=u.get(s),void 0===a&&u.set(s,a=c?new Map:Xe(t)),u=a;return a};Qe();const Ye={http:null,xhr:Fe,fetch:{get:Qe}};V.forEach(Ye,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Ze=e=>`- ${e}`,et=e=>V.isFunction(e)||null===e||!1===e;var tt=(e,t)=>{e=V.isArray(e)?e:[e];const{length:n}=e;let r,o;const i={};for(let s=0;s<n;s++){let n;if(r=e[s],o=r,!et(r)&&(o=Ye[(n=String(r)).toLowerCase()],void 0===o))throw new G(`Unknown adapter '${n}'`);if(o&&(V.isFunction(o)||(o=o.get(t))))break;i[n||"#"+s]=o}if(!o){const e=Object.entries(i).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new G("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(Ze).join("\n"):" "+Ze(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return o};function nt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new xe(null,e)}function rt(e){nt(e),e.headers=Se.from(e.headers),e.data=Te.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return tt(e.adapter||be.adapter,e)(e).then((function(t){return nt(e),t.data=Te.call(e,e.transformResponse,t),t.headers=Se.from(t.headers),t}),(function(t){return ke(t)||(nt(e),t&&t.response&&(t.response.data=Te.call(e,e.transformResponse,t.response),t.response.headers=Se.from(t.response.headers))),Promise.reject(t)}))}const ot="1.12.2",it={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{it[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const st={};it.transitional=function(e,t,n){function r(e,t){return"[Axios v"+ot+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new G(r(o," has been removed"+(t?" in "+t:"")),G.ERR_DEPRECATED);return t&&!st[o]&&(st[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},it.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var at={assertOptions:function(e,t,n){if("object"!=typeof e)throw new G("options must be an object",G.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],s=t[i];if(s){const t=e[i],n=void 0===t||s(t,i,e);if(!0!==n)throw new G("option "+i+" must be "+n,G.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new G("Unknown option "+i,G.ERR_BAD_OPTION)}},validators:it};const ct=at.validators;class ut{constructor(e){this.defaults=e||{},this.interceptors={request:new ae,response:new ae}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Ie(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&at.assertOptions(n,{silentJSONParsing:ct.transitional(ct.boolean),forcedJSONParsing:ct.transitional(ct.boolean),clarifyTimeoutError:ct.transitional(ct.boolean)},!1),null!=r&&(V.isFunction(r)?t.paramsSerializer={serialize:r}:at.assertOptions(r,{encode:ct.function,serialize:ct.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),at.assertOptions(t,{baseUrl:ct.spelling("baseURL"),withXsrfToken:ct.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&V.merge(o.common,o[t.method]);o&&V.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=Se.concat(i,o);const s=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let l,f=0;if(!a){const e=[rt.bind(this),void 0];for(e.unshift(...s),e.push(...c),l=e.length,u=Promise.resolve(t);f<l;)u=u.then(e[f++],e[f++]);return u}l=s.length;let d=t;for(;f<l;){const e=s[f++],t=s[f++];try{d=e(d)}catch(e){t.call(this,e);break}}try{u=rt.call(this,d)}catch(e){return Promise.reject(e)}for(f=0,l=c.length;f<l;)u=u.then(c[f++],c[f++]);return u}getUri(e){return se(Le((e=Ie(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}V.forEach(["delete","get","head","options"],(function(e){ut.prototype[e]=function(t,n){return this.request(Ie(n||{},{method:e,url:t,data:(n||{}).data}))}})),V.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,o){return this.request(Ie(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}ut.prototype[e]=t(),ut.prototype[e+"Form"]=t(!0)}));var lt=ut;class ft{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,o){n.reason||(n.reason=new xe(e,r,o),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new ft((function(t){e=t})),cancel:e}}}var dt=ft;const pt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(pt).forEach((([e,t])=>{pt[t]=e}));var ht=pt;const mt=function e(t){const n=new lt(t),o=r(lt.prototype.request,n);return V.extend(o,lt.prototype,n,{allOwnKeys:!0}),V.extend(o,n,null,{allOwnKeys:!0}),o.create=function(n){return e(Ie(t,n))},o}(be);mt.Axios=lt,mt.CanceledError=xe,mt.CancelToken=dt,mt.isCancel=ke,mt.VERSION=ot,mt.toFormData=te,mt.AxiosError=G,mt.Cancel=mt.CanceledError,mt.all=function(e){return Promise.all(e)},mt.spread=function(e){return function(t){return e.apply(null,t)}},mt.isAxiosError=function(e){return V.isObject(e)&&!0===e.isAxiosError},mt.mergeConfig=Ie,mt.AxiosHeaders=Se,mt.formToJSON=e=>ye(V.isHTMLForm(e)?new FormData(e):e),mt.getAdapter=tt,mt.HttpStatusCode=ht,mt.default=mt,e.exports=mt},747:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getEnv=void 0;var o=r(n(489));t.getEnv=function(){return o.default.getOptions().env}},767:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getUserIp=void 0;var i=n(384),s=n(747),a={getUserIp:{test:"https://xtest.cnki.net/ip/client",development:"/proxy-sdk-ip/client",production:"https://x.cnki.net/ip/client"}};t.getUserIp=function(){return r(void 0,void 0,void 0,(function(){var e,t,n;return o(this,(function(r){switch(r.label){case 0:return r.trys.push([0,4,,5]),(e=(0,i.getCookie)("yxIP"))&&"undefined"!==e&&"null"!==e?[3,3]:[4,fetch(a.getUserIp[(0,s.getEnv)()],{method:"GET",headers:{source:"x.cnki.net"}})];case 1:return[4,r.sent().json()];case 2:return t=r.sent().content,n=(0,s.getEnv)(),(0,i.setCookie)("yxIP","development"===n?"124.193.98.142":t,432e3,"development"===n?"":".cnki.net"),[2,Promise.resolve(t)];case 3:return[2,Promise.resolve(e)];case 4:return r.sent(),[2,Promise.resolve("")];case 5:return[2]}}))}))}},776:function(e,t,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getBaseUrl=void 0;var i=o(n(598)),s=o(n(598)),a=o(n(365)),c=o(n(489)),u=n(747),l={development:i.default,test:s.default,production:a.default};t.getBaseUrl=function(e){var t,n,o=c.default.getOptions(),i=(0,u.getEnv)(),a=o.proxy?r(r({},o.proxy),l[i]):"development"===i?s.default:l[i],f=e;if("development"!==i){var d=null!==(n=null===(t=e.match(/^\/[^/]+/))||void 0===t?void 0:t[0])&&void 0!==n?n:"";Object.keys(a).forEach((function(t){(d===t||e.includes(t))&&(f=f.replace(t,a[t].target))}))}return f}},811:function(e,t,n){"use strict";var r,o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(r=function(e){return r=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},r(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=r(e),s=0;s<n.length;s++)"default"!==n[s]&&o(t,e,n[s]);return i(t,e),t}),a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},c=this&&this.__generator||function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.localQueueStore=t.removeCookie=t.setCookie=t.getCookie=void 0;var l=s(n(489)),f=n(471),d=n(537),p=u(n(65));t.localQueueStore=p.default;var h=n(767),m=n(551),y=n(336),g=function(){function e(){this.getAction=f.getAction,this.getRefreshToken=f.getRefreshToken,this.postAction=f.postAction,this.getJwt=function(){return(0,d.getJwt)((0,l.getJwtKey)())},this.removeJwt=function(){return(0,d.removeJwt)((0,l.getJwtKey)())},this.getUserIp=function(){return(0,h.getUserIp)()},this.toTrack=function(){return(0,h.getUserIp)()},this.logOut=function(){return(0,y.logOut)()}}return e.getInstance=function(){return this.instance||(this.instance=new e),this.instance},e.prototype.config=function(e){return l.default.config(e),this},e.prototype.ready=function(){return a(this,void 0,void 0,(function(){return c(this,(function(e){switch(e.label){case 0:return[4,(0,h.getUserIp)()];case 1:return e.sent(),l.default.getOptions().tracker&&(0,m.tracker)(),[4,(0,f.getRefreshToken)()];case 2:return[2,e.sent()]}}))}))},e.instance=null,e}();t.default=g.getInstance();var b=n(384);Object.defineProperty(t,"getCookie",{enumerable:!0,get:function(){return b.getCookie}}),Object.defineProperty(t,"setCookie",{enumerable:!0,get:function(){return b.setCookie}}),Object.defineProperty(t,"removeCookie",{enumerable:!0,get:function(){return b.removeCookie}})},935:function(e,t,n){"use strict";var r,o=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(r=function(e){return r=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},r(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n=r(e),s=0;s<n.length;s++)"default"!==n[s]&&o(t,e,n[s]);return i(t,e),t}),a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},c=this&&this.__generator||function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.getRefreshToken=void 0;var u=n(384),l=n(471),f=n(537),d=s(n(489)),p=n(336);t.getRefreshToken=function(){return a(void 0,void 0,void 0,(function(){var e,t,n,r,o,i,s,a,p;return c(this,(function(c){switch(c.label){case 0:if(e=d.default.getOptions(),t=(0,d.getJwtKey)(),!(n=(0,u.getCookie)("LID")))return[2,{code:5014,message:"无法获取 LID,请重新登录"}];if(r=(0,f.getJwt)(t))return[2,{code:0,content:r,message:"JWT 已缓存,无需刷新"}];c.label=1;case 1:return c.trys.push([1,3,,4]),o={AppId:e.appId,ClientId:(0,u.getCookie)("Ecp_ClientId")||"9240617191000011664",ClientIp:(0,u.getCookie)("yxIP"),EcpToken:n},[4,(0,l.postAction)("/proxy-sdk-jwt/JwtToken/ecptoken",o,{withCredentials:!1,skipInterceptorsRequest:!0})];case 2:return(i=c.sent()).Success&&i.Content?(s=i.Content,a=s.JwtToken,p=s.ExpireIn,(0,f.addJwt)(t,a,p),[2,{code:0,content:a,message:"JWT 刷新成功"}]):5019===i.Code?[2,{code:5019,message:i.Message||"Token 刷新失败"}]:5014===i.Code?[2,{code:5014,message:i.Message||"Token 刷新失败"}]:[2,{code:-1,message:i.Message||"Token 刷新失败"}];case 3:return[2,{code:500,message:c.sent().message||"Token 刷新异常,请稍后重试"}];case 4:return[2]}}))}))};var h=0,m=!1,y=[];t.default=function(e,n){return a(void 0,void 0,void 0,(function(){var r,o;return c(this,(function(i){switch(i.label){case 0:if(m)return[3,6];if(m=!0,h>=2)return m=!1,(0,p.logOut)(),[2,Promise.reject("Token 刷新异常,请稍后重试,超出最大重发次数。")];h+=1,i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,(0,t.getRefreshToken)()];case 2:if(0!==(r=i.sent()).code)throw r;return y.forEach((function(e){return e()})),y=[],[2,e(n.config)];case 3:return o=i.sent(),(0,p.logOut)(),[2,Promise.reject(o)];case 4:return m=!1,[7];case 5:return[3,7];case 6:return[2,new Promise((function(t){y.push((function(){t(e(n.config))}))}))];case 7:return[2]}}))}))}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}return n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n(811)})()));
package/app.js.gz CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openx-js-sdk",
3
- "version": "0.0.26",
3
+ "version": "0.0.28",
4
4
  "main": "./app.js",
5
5
  "scripts": {
6
6
  "serve": "set NODE_ENV=development&& webpack-dev-server --config build/webpack.dev.js --env=development",
@@ -3,12 +3,13 @@ type StaFn = (params: StaEvent) => void;
3
3
  declare global {
4
4
  interface Window {
5
5
  sta_api?: {
6
- toTrack: StaFn;
7
- __OPENX_PATCHED__?: boolean;
6
+ toTrack?: StaFn;
7
+ toTrackOpenx?: StaFn;
8
+ sa?: any;
8
9
  [key: string]: any;
9
10
  };
10
11
  }
11
12
  }
12
- /** tracker 主逻辑 */
13
+ /** ================= 对外入口 ================= */
13
14
  export declare function tracker(): void;
14
15
  export {};
package/types/index.d.ts CHANGED
@@ -2,6 +2,7 @@ export interface ConfigOptions {
2
2
  appId: string;
3
3
  env?: string;
4
4
  proxy?: any;
5
+ scene?: string;
5
6
  timeout?: number;
6
7
  withCredentials?: boolean;
7
8
  verifyRealName?: boolean;