qsh-webview-sdk 2.3.3 → 2.3.4

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.
@@ -1,71 +1,71 @@
1
- var Ut = Object.defineProperty, Wt = Object.defineProperties;
2
- var $t = Object.getOwnPropertyDescriptors;
3
- var Fe = Object.getOwnPropertySymbols;
4
- var Ft = Object.prototype.hasOwnProperty, Bt = Object.prototype.propertyIsEnumerable;
5
- var Oe = (t, e, r) => e in t ? Ut(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, h = (t, e) => {
1
+ var Bt = Object.defineProperty, kt = Object.defineProperties;
2
+ var Gt = Object.getOwnPropertyDescriptors;
3
+ var Ke = Object.getOwnPropertySymbols;
4
+ var Kt = Object.prototype.hasOwnProperty, zt = Object.prototype.propertyIsEnumerable;
5
+ var Ne = (t, e, r) => e in t ? Bt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, g = (t, e) => {
6
6
  for (var r in e || (e = {}))
7
- Ft.call(e, r) && Oe(t, r, e[r]);
8
- if (Fe)
9
- for (var r of Fe(e))
10
- Bt.call(e, r) && Oe(t, r, e[r]);
7
+ Kt.call(e, r) && Ne(t, r, e[r]);
8
+ if (Ke)
9
+ for (var r of Ke(e))
10
+ zt.call(e, r) && Ne(t, r, e[r]);
11
11
  return t;
12
- }, m = (t, e) => Wt(t, $t(e));
13
- var U = (t, e, r) => Oe(t, typeof e != "symbol" ? e + "" : e, r);
12
+ }, p = (t, e) => kt(t, Gt(e));
13
+ var U = (t, e, r) => Ne(t, typeof e != "symbol" ? e + "" : e, r);
14
14
  var w = (t, e, r) => new Promise((n, i) => {
15
- var s = (d) => {
15
+ var s = (f) => {
16
16
  try {
17
- f(r.next(d));
18
- } catch (p) {
19
- i(p);
17
+ h(r.next(f));
18
+ } catch (A) {
19
+ i(A);
20
20
  }
21
- }, c = (d) => {
21
+ }, c = (f) => {
22
22
  try {
23
- f(r.throw(d));
24
- } catch (p) {
25
- i(p);
23
+ h(r.throw(f));
24
+ } catch (A) {
25
+ i(A);
26
26
  }
27
- }, f = (d) => d.done ? n(d.value) : Promise.resolve(d.value).then(s, c);
28
- f((r = r.apply(t, e)).next());
27
+ }, h = (f) => f.done ? n(f.value) : Promise.resolve(f.value).then(s, c);
28
+ h((r = r.apply(t, e)).next());
29
29
  });
30
- function ue() {
30
+ function de() {
31
31
  return typeof window != "undefined" ? window : void 0;
32
32
  }
33
- function Me() {
33
+ function Le() {
34
34
  return typeof navigator == "undefined" ? "" : navigator.userAgent || "";
35
35
  }
36
36
  function C() {
37
- const t = ue();
37
+ const t = de();
38
38
  if (!t) return !1;
39
39
  if (t.__wxjs_environment === "miniprogram" || t.wx && t.wx.miniProgram)
40
40
  return !0;
41
- const e = Me();
41
+ const e = Le();
42
42
  return !!(e && /micromessenger/i.test(e) && /miniProgram/i.test(e));
43
43
  }
44
- function ye() {
45
- const t = ue();
44
+ function _e() {
45
+ const t = de();
46
46
  return !!(t && t.plus);
47
47
  }
48
- function Ie() {
49
- const t = ue();
48
+ function Ce() {
49
+ const t = de();
50
50
  return !!(t && (t.__dcloud_weex_postMessage || t.__dcloud_weex_));
51
51
  }
52
- function Ae() {
53
- const t = ue();
52
+ function Oe() {
53
+ const t = de();
54
54
  return !!(t && (t.__uniapp_x_postMessage || t.__uniapp_x_));
55
55
  }
56
- function Ce() {
57
- const t = Me();
56
+ function Pe() {
57
+ const t = Le();
58
58
  return /uni-app/i.test(t);
59
59
  }
60
- function Se() {
61
- const t = Me();
60
+ function be() {
61
+ const t = Le();
62
62
  return /Html5Plus/i.test(t);
63
63
  }
64
- function Je() {
65
- return Ce() || Se();
64
+ function Ze() {
65
+ return Pe() || be();
66
66
  }
67
67
  function J() {
68
- const t = ue();
68
+ const t = de();
69
69
  if (!t) return !1;
70
70
  if (t.__offline_bridge_postMessage) return !0;
71
71
  try {
@@ -75,22 +75,22 @@ function J() {
75
75
  }
76
76
  return !1;
77
77
  }
78
- function kt() {
79
- return Ae() ? "uvue" : Ie() ? "nvue" : C() ? "weixin" : J() ? "offline" : ye() ? "plus" : Je() ? "webview" : Ce() ? "UniApp" : "h5";
78
+ function Vt() {
79
+ return Oe() ? "uvue" : Ce() ? "nvue" : C() ? "weixin" : J() ? "offline" : _e() ? "plus" : Ze() ? "webview" : Pe() ? "UniApp" : "h5";
80
80
  }
81
- let de = null;
81
+ let me = null;
82
82
  function ne(t = !1) {
83
- return de && !t || (de = {
83
+ return me && !t || (me = {
84
84
  isWeixinMiniProgram: C(),
85
- isAppPlus: ye(),
86
- isNvue: Ie(),
87
- isUvue: Ae(),
88
- isUniApp: Ce(),
89
- isHtml5Plus: Se(),
90
- isUniAppWebView: Je(),
85
+ isAppPlus: _e(),
86
+ isNvue: Ce(),
87
+ isUvue: Oe(),
88
+ isUniApp: Pe(),
89
+ isHtml5Plus: be(),
90
+ isUniAppWebView: Ze(),
91
91
  isOfflineWebview: J(),
92
- type: kt()
93
- }), de;
92
+ type: Vt()
93
+ }), me;
94
94
  }
95
95
  const l = ne(), b = {
96
96
  PLATFORM_NOT_SUPPORTED: "PLATFORM_NOT_SUPPORTED",
@@ -99,7 +99,7 @@ const l = ne(), b = {
99
99
  INVALID_PARAMETERS: "INVALID_PARAMETERS",
100
100
  NETWORK_ERROR: "NETWORK_ERROR"
101
101
  };
102
- class M extends Error {
102
+ class N extends Error {
103
103
  /**
104
104
  * 构造函数
105
105
  * @param {string} type - 错误类型
@@ -108,7 +108,7 @@ class M extends Error {
108
108
  * @param {Error} [originalError] - 原始错误对象
109
109
  */
110
110
  constructor(e, r, n = {}, i = null) {
111
- super(r), this.name = "QshError", this.type = e, this.context = n, this.originalError = i, this.timestamp = (/* @__PURE__ */ new Date()).toISOString(), Error.captureStackTrace && Error.captureStackTrace(this, M);
111
+ super(r), this.name = "QshError", this.type = e, this.context = n, this.originalError = i, this.timestamp = (/* @__PURE__ */ new Date()).toISOString(), Error.captureStackTrace && Error.captureStackTrace(this, N);
112
112
  }
113
113
  /**
114
114
  * 转换为 JSON 格式
@@ -125,28 +125,28 @@ class M extends Error {
125
125
  };
126
126
  }
127
127
  }
128
- const _ = class _ {
128
+ const O = class O {
129
129
  /**
130
130
  * 设置调试模式
131
131
  * @param {boolean} enabled - 是否启用调试模式
132
132
  */
133
133
  static setDebugMode(e) {
134
- _.isDebugMode = e;
134
+ O.isDebugMode = e;
135
135
  }
136
136
  /**
137
137
  * 添加错误回调
138
138
  * @param {Function} callback - 错误处理回调函数
139
139
  */
140
140
  static addErrorCallback(e) {
141
- typeof e == "function" && _.errorCallbacks.push(e);
141
+ typeof e == "function" && O.errorCallbacks.push(e);
142
142
  }
143
143
  /**
144
144
  * 移除错误回调
145
145
  * @param {Function} callback - 要移除的回调函数
146
146
  */
147
147
  static removeErrorCallback(e) {
148
- const r = _.errorCallbacks.indexOf(e);
149
- r > -1 && _.errorCallbacks.splice(r, 1);
148
+ const r = O.errorCallbacks.indexOf(e);
149
+ r > -1 && O.errorCallbacks.splice(r, 1);
150
150
  }
151
151
  /**
152
152
  * 处理 API 调用错误
@@ -156,16 +156,16 @@ const _ = class _ {
156
156
  */
157
157
  static handleApiError(e, r = {}) {
158
158
  let n;
159
- return e instanceof M ? n = e : e instanceof Error ? n = new M(
159
+ return e instanceof N ? n = e : e instanceof Error ? n = new N(
160
160
  b.API_CALL_FAILED,
161
161
  e.message,
162
162
  r,
163
163
  e
164
- ) : n = new M(
164
+ ) : n = new N(
165
165
  b.API_CALL_FAILED,
166
166
  String(e),
167
167
  r
168
- ), _.logError(n), _.notifyCallbacks(n), n;
168
+ ), O.logError(n), O.notifyCallbacks(n), n;
169
169
  }
170
170
  /**
171
171
  * 处理平台不支持错误
@@ -174,12 +174,12 @@ const _ = class _ {
174
174
  * @returns {QshError} 错误对象
175
175
  */
176
176
  static handlePlatformNotSupported(e, r) {
177
- const n = new M(
177
+ const n = new N(
178
178
  b.PLATFORM_NOT_SUPPORTED,
179
179
  `API "${r}" is not supported on platform "${e}"`,
180
180
  { platformType: e, apiName: r }
181
181
  );
182
- return _.logError(n), _.notifyCallbacks(n), n;
182
+ return O.logError(n), O.notifyCallbacks(n), n;
183
183
  }
184
184
  /**
185
185
  * 处理桥接未就绪错误
@@ -187,12 +187,12 @@ const _ = class _ {
187
187
  * @returns {QshError} 错误对象
188
188
  */
189
189
  static handleBridgeNotReady(e) {
190
- const r = new M(
190
+ const r = new N(
191
191
  b.BRIDGE_NOT_READY,
192
192
  `Bridge is not ready when calling "${e}"`,
193
193
  { apiName: e }
194
194
  );
195
- return _.logError(r), _.notifyCallbacks(r), r;
195
+ return O.logError(r), O.notifyCallbacks(r), r;
196
196
  }
197
197
  /**
198
198
  * 处理参数验证错误
@@ -203,12 +203,12 @@ const _ = class _ {
203
203
  * @returns {QshError} 错误对象
204
204
  */
205
205
  static handleInvalidParameters(e, r, n, i) {
206
- const s = new M(
206
+ const s = new N(
207
207
  b.INVALID_PARAMETERS,
208
208
  `Invalid parameter "${r}" in "${e}": expected ${n}, got ${typeof i}`,
209
209
  { apiName: e, paramName: r, expectedType: n, actualValue: i }
210
210
  );
211
- return _.logError(s), _.notifyCallbacks(s), s;
211
+ return O.logError(s), O.notifyCallbacks(s), s;
212
212
  }
213
213
  /**
214
214
  * 安全地包装函数执行,捕获并处理错误
@@ -220,7 +220,7 @@ const _ = class _ {
220
220
  try {
221
221
  return e();
222
222
  } catch (n) {
223
- return _.handleApiError(n, r);
223
+ return O.handleApiError(n, r);
224
224
  }
225
225
  }
226
226
  /**
@@ -234,7 +234,7 @@ const _ = class _ {
234
234
  try {
235
235
  return yield e();
236
236
  } catch (i) {
237
- return _.handleApiError(i, r);
237
+ return O.handleApiError(i, r);
238
238
  }
239
239
  });
240
240
  }
@@ -246,7 +246,7 @@ const _ = class _ {
246
246
  static logError(e) {
247
247
  if (typeof console != "undefined") {
248
248
  const r = `[QSH-SDK Error] ${e.type}: ${e.message}`;
249
- _.isDebugMode ? console.error(r, {
249
+ O.isDebugMode ? console.error(r, {
250
250
  context: e.context,
251
251
  originalError: e.originalError,
252
252
  stack: e.stack,
@@ -260,7 +260,7 @@ const _ = class _ {
260
260
  * @private
261
261
  */
262
262
  static notifyCallbacks(e) {
263
- _.errorCallbacks.forEach((r) => {
263
+ O.errorCallbacks.forEach((r) => {
264
264
  try {
265
265
  r(e);
266
266
  } catch (n) {
@@ -277,20 +277,20 @@ const _ = class _ {
277
277
  return function(r, n, i) {
278
278
  const s = i.value;
279
279
  return i.value = function(...c) {
280
- return _.safeExecute(() => s.apply(this, c), m(h({}, e), { method: n, target: r.constructor.name }));
280
+ return O.safeExecute(() => s.apply(this, c), p(g({}, e), { method: n, target: r.constructor.name }));
281
281
  }, i;
282
282
  };
283
283
  }
284
284
  };
285
- U(_, "isDebugMode", !1), U(_, "errorCallbacks", []);
286
- let u = _;
285
+ U(O, "isDebugMode", !1), U(O, "errorCallbacks", []);
286
+ let u = O;
287
287
  const L = {
288
288
  UNINITIALIZED: "uninitialized",
289
289
  INITIALIZING: "initializing",
290
290
  READY: "ready",
291
291
  ERROR: "error"
292
292
  };
293
- class Kt {
293
+ class qt {
294
294
  constructor() {
295
295
  this.state = L.UNINITIALIZED, this.readyPromise = null, this.readyCallbacks = [], this.errorCallbacks = [], this.initializationError = null, this.handleBridgeReady = this.handleBridgeReady.bind(this), this.handleInitializationError = this.handleInitializationError.bind(this);
296
296
  }
@@ -423,52 +423,52 @@ class Kt {
423
423
  };
424
424
  }
425
425
  }
426
- const V = new Kt(), je = () => V.waitForReady(), Gt = () => V.isReady(), zt = () => V.getState(), A = {
426
+ const V = new qt(), Xe = () => V.waitForReady(), Jt = () => V.isReady(), jt = () => V.getState(), _ = {
427
427
  ERROR: 0,
428
428
  WARN: 1,
429
429
  INFO: 2,
430
430
  DEBUG: 3,
431
431
  TRACE: 4
432
- }, ie = {
433
- [A.ERROR]: "ERROR",
434
- [A.WARN]: "WARN",
435
- [A.INFO]: "INFO",
436
- [A.DEBUG]: "DEBUG",
437
- [A.TRACE]: "TRACE"
438
- }, g = class g {
432
+ }, oe = {
433
+ [_.ERROR]: "ERROR",
434
+ [_.WARN]: "WARN",
435
+ [_.INFO]: "INFO",
436
+ [_.DEBUG]: "DEBUG",
437
+ [_.TRACE]: "TRACE"
438
+ }, d = class d {
439
439
  // 可注入的外部 reporter
440
440
  /**
441
441
  * 设置日志级别
442
442
  * @param {number} level - 日志级别
443
443
  */
444
444
  static setLevel(e) {
445
- e >= A.ERROR && e <= A.TRACE && (g.currentLevel = e, g.log(A.INFO, "Logger", `日志级别设置为: ${ie[e]}`));
445
+ e >= _.ERROR && e <= _.TRACE && (d.currentLevel = e, d.log(_.INFO, "Logger", `日志级别设置为: ${oe[e]}`));
446
446
  }
447
447
  /**
448
448
  * 启用开发模式(显示所有日志)
449
449
  */
450
450
  static enableDevMode() {
451
- g.setLevel(A.DEBUG), g.log(A.INFO, "Logger", "开发模式已启用");
451
+ d.setLevel(_.DEBUG), d.log(_.INFO, "Logger", "开发模式已启用");
452
452
  }
453
453
  /**
454
454
  * 启用生产模式(只显示错误和警告)
455
455
  */
456
456
  static enableProdMode() {
457
- g.setLevel(A.WARN), g.log(A.INFO, "Logger", "生产模式已启用");
457
+ d.setLevel(_.WARN), d.log(_.INFO, "Logger", "生产模式已启用");
458
458
  }
459
459
  /**
460
460
  * 启用特定模块的日志
461
461
  * @param {string} module - 模块名称
462
462
  */
463
463
  static enableModule(e) {
464
- g.enabledModules.add(e), g.log(A.INFO, "Logger", `模块日志已启用: ${e}`);
464
+ d.enabledModules.add(e), d.log(_.INFO, "Logger", `模块日志已启用: ${e}`);
465
465
  }
466
466
  /**
467
467
  * 禁用特定模块的日志
468
468
  * @param {string} module - 模块名称
469
469
  */
470
470
  static disableModule(e) {
471
- g.enabledModules.delete(e), g.log(A.INFO, "Logger", `模块日志已禁用: ${e}`);
471
+ d.enabledModules.delete(e), d.log(_.INFO, "Logger", `模块日志已禁用: ${e}`);
472
472
  }
473
473
  /**
474
474
  * 检查是否应该记录日志
@@ -478,7 +478,7 @@ const V = new Kt(), je = () => V.waitForReady(), Gt = () => V.isReady(), zt = ()
478
478
  * @private
479
479
  */
480
480
  static shouldLog(e, r) {
481
- return e > g.currentLevel ? !1 : r && g.enabledModules.size > 0 ? g.enabledModules.has(r) : !0;
481
+ return e > d.currentLevel ? !1 : r && d.enabledModules.size > 0 ? d.enabledModules.has(r) : !0;
482
482
  }
483
483
  /**
484
484
  * 核心日志记录方法
@@ -489,9 +489,9 @@ const V = new Kt(), je = () => V.waitForReady(), Gt = () => V.isReady(), zt = ()
489
489
  * @private
490
490
  */
491
491
  static log(e, r, n, ...i) {
492
- if (!g.shouldLog(e, r))
492
+ if (!d.shouldLog(e, r))
493
493
  return;
494
- const s = (/* @__PURE__ */ new Date()).toISOString(), c = ie[e], f = r ? `[${r}]` : "", d = `${g.prefix} ${f} ${n}`, p = {
494
+ const s = (/* @__PURE__ */ new Date()).toISOString(), c = oe[e], h = r ? `[${r}]` : "", f = `${d.prefix} ${h} ${n}`, A = {
495
495
  timestamp: s,
496
496
  level: e,
497
497
  levelName: c,
@@ -499,12 +499,12 @@ const V = new Kt(), je = () => V.waitForReady(), Gt = () => V.isReady(), zt = ()
499
499
  message: n,
500
500
  args: i
501
501
  };
502
- if (g.addToHistory(p), typeof g.reporter == "function")
502
+ if (d.addToHistory(A), typeof d.reporter == "function")
503
503
  try {
504
- g.reporter(p);
505
- } catch (R) {
504
+ d.reporter(A);
505
+ } catch (M) {
506
506
  }
507
- g.outputToConsole(e, d, ...i);
507
+ d.outputToConsole(e, f, ...i);
508
508
  }
509
509
  /**
510
510
  * 添加日志到历史记录
@@ -512,7 +512,7 @@ const V = new Kt(), je = () => V.waitForReady(), Gt = () => V.isReady(), zt = ()
512
512
  * @private
513
513
  */
514
514
  static addToHistory(e) {
515
- g.logHistory.push(e), g.logHistory.length > g.maxHistorySize && g.logHistory.shift();
515
+ d.logHistory.push(e), d.logHistory.length > d.maxHistorySize && d.logHistory.shift();
516
516
  }
517
517
  /**
518
518
  * 输出到控制台
@@ -526,17 +526,17 @@ const V = new Kt(), je = () => V.waitForReady(), Gt = () => V.isReady(), zt = ()
526
526
  return;
527
527
  const i = n && n.length > 0;
528
528
  switch (e) {
529
- case A.ERROR:
529
+ case _.ERROR:
530
530
  i ? console.error(r, ...n) : console.error(r);
531
531
  break;
532
- case A.WARN:
532
+ case _.WARN:
533
533
  i ? console.warn(r, ...n) : console.warn(r);
534
534
  break;
535
- case A.INFO:
535
+ case _.INFO:
536
536
  i ? console.info(r, ...n) : console.info(r);
537
537
  break;
538
- case A.DEBUG:
539
- case A.TRACE:
538
+ case _.DEBUG:
539
+ case _.TRACE:
540
540
  i ? console.log(r, ...n) : console.log(r);
541
541
  break;
542
542
  }
@@ -548,7 +548,7 @@ const V = new Kt(), je = () => V.waitForReady(), Gt = () => V.isReady(), zt = ()
548
548
  * @param {any[]} args - 额外参数
549
549
  */
550
550
  static error(e, r, ...n) {
551
- g.log(A.ERROR, e, r, ...n);
551
+ d.log(_.ERROR, e, r, ...n);
552
552
  }
553
553
  /**
554
554
  * 警告级别日志
@@ -557,7 +557,7 @@ const V = new Kt(), je = () => V.waitForReady(), Gt = () => V.isReady(), zt = ()
557
557
  * @param {any[]} args - 额外参数
558
558
  */
559
559
  static warn(e, r, ...n) {
560
- g.log(A.WARN, e, r, ...n);
560
+ d.log(_.WARN, e, r, ...n);
561
561
  }
562
562
  /**
563
563
  * 信息级别日志
@@ -566,7 +566,7 @@ const V = new Kt(), je = () => V.waitForReady(), Gt = () => V.isReady(), zt = ()
566
566
  * @param {any[]} args - 额外参数
567
567
  */
568
568
  static info(e, r, ...n) {
569
- g.log(A.INFO, e, r, ...n);
569
+ d.log(_.INFO, e, r, ...n);
570
570
  }
571
571
  /**
572
572
  * 调试级别日志
@@ -575,7 +575,7 @@ const V = new Kt(), je = () => V.waitForReady(), Gt = () => V.isReady(), zt = ()
575
575
  * @param {any[]} args - 额外参数
576
576
  */
577
577
  static debug(e, r, ...n) {
578
- g.log(A.DEBUG, e, r, ...n);
578
+ d.log(_.DEBUG, e, r, ...n);
579
579
  }
580
580
  /**
581
581
  * 跟踪级别日志
@@ -584,7 +584,7 @@ const V = new Kt(), je = () => V.waitForReady(), Gt = () => V.isReady(), zt = ()
584
584
  * @param {any[]} args - 额外参数
585
585
  */
586
586
  static trace(e, r, ...n) {
587
- g.log(A.TRACE, e, r, ...n);
587
+ d.log(_.TRACE, e, r, ...n);
588
588
  }
589
589
  /**
590
590
  * 获取日志历史
@@ -592,13 +592,13 @@ const V = new Kt(), je = () => V.waitForReady(), Gt = () => V.isReady(), zt = ()
592
592
  * @returns {Array} 日志条目数组
593
593
  */
594
594
  static getHistory(e) {
595
- return e && e > 0 ? g.logHistory.slice(-e) : [...g.logHistory];
595
+ return e && e > 0 ? d.logHistory.slice(-e) : [...d.logHistory];
596
596
  }
597
597
  /**
598
598
  * 清空日志历史
599
599
  */
600
600
  static clearHistory() {
601
- g.logHistory = [], g.log(A.INFO, "Logger", "日志历史已清空");
601
+ d.logHistory = [], d.log(_.INFO, "Logger", "日志历史已清空");
602
602
  }
603
603
  /**
604
604
  * 获取日志统计信息
@@ -606,15 +606,15 @@ const V = new Kt(), je = () => V.waitForReady(), Gt = () => V.isReady(), zt = ()
606
606
  */
607
607
  static getStats() {
608
608
  const e = {
609
- currentLevel: g.currentLevel,
610
- currentLevelName: ie[g.currentLevel],
611
- enabledModules: Array.from(g.enabledModules),
612
- historySize: g.logHistory.length,
613
- maxHistorySize: g.maxHistorySize
609
+ currentLevel: d.currentLevel,
610
+ currentLevelName: oe[d.currentLevel],
611
+ enabledModules: Array.from(d.enabledModules),
612
+ historySize: d.logHistory.length,
613
+ maxHistorySize: d.maxHistorySize
614
614
  }, r = {};
615
- for (const n of Object.keys(ie))
616
- r[ie[n]] = 0;
617
- return g.logHistory.forEach((n) => {
615
+ for (const n of Object.keys(oe))
616
+ r[oe[n]] = 0;
617
+ return d.logHistory.forEach((n) => {
618
618
  r[n.levelName]++;
619
619
  }), e.levelCounts = r, e;
620
620
  }
@@ -624,7 +624,7 @@ const V = new Kt(), je = () => V.waitForReady(), Gt = () => V.isReady(), zt = ()
624
624
  * @returns {string} JSON 字符串
625
625
  */
626
626
  static exportToJSON(e) {
627
- const r = g.getHistory(e), n = g.getStats();
627
+ const r = d.getHistory(e), n = d.getStats();
628
628
  return JSON.stringify({
629
629
  exportTime: (/* @__PURE__ */ new Date()).toISOString(),
630
630
  stats: n,
@@ -638,11 +638,11 @@ const V = new Kt(), je = () => V.waitForReady(), Gt = () => V.isReady(), zt = ()
638
638
  */
639
639
  static createModuleLogger(e) {
640
640
  return {
641
- error: (r, ...n) => g.error(e, r, ...n),
642
- warn: (r, ...n) => g.warn(e, r, ...n),
643
- info: (r, ...n) => g.info(e, r, ...n),
644
- debug: (r, ...n) => g.debug(e, r, ...n),
645
- trace: (r, ...n) => g.trace(e, r, ...n)
641
+ error: (r, ...n) => d.error(e, r, ...n),
642
+ warn: (r, ...n) => d.warn(e, r, ...n),
643
+ info: (r, ...n) => d.info(e, r, ...n),
644
+ debug: (r, ...n) => d.debug(e, r, ...n),
645
+ trace: (r, ...n) => d.trace(e, r, ...n)
646
646
  };
647
647
  }
648
648
  /**
@@ -650,14 +650,14 @@ const V = new Kt(), je = () => V.waitForReady(), Gt = () => V.isReady(), zt = ()
650
650
  * @param {(entry: any) => void|null} reporter
651
651
  */
652
652
  static setReporter(e) {
653
- g.reporter = typeof e == "function" ? e : null;
653
+ d.reporter = typeof e == "function" ? e : null;
654
654
  }
655
655
  };
656
- U(g, "currentLevel", A.ERROR), // 生产环境默认只显示错误
657
- U(g, "enabledModules", /* @__PURE__ */ new Set()), // 启用日志的模块
658
- U(g, "logHistory", []), // 日志历史(最多保留1000条)
659
- U(g, "maxHistorySize", 1e3), U(g, "prefix", "[QSH-SDK]"), U(g, "reporter", null);
660
- let T = g;
656
+ U(d, "currentLevel", _.ERROR), // 生产环境默认只显示错误
657
+ U(d, "enabledModules", /* @__PURE__ */ new Set()), // 启用日志的模块
658
+ U(d, "logHistory", []), // 日志历史(最多保留1000条)
659
+ U(d, "maxHistorySize", 1e3), U(d, "prefix", "[QSH-SDK]"), U(d, "reporter", null);
660
+ let T = d;
661
661
  if (typeof window != "undefined") {
662
662
  const t = window.location && (window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" || window.location.hostname.includes("192.168.")), e = window.location && (window.location.search.includes("debug=true") || window.location.search.includes("qsh_debug=1"));
663
663
  let r = !1;
@@ -667,14 +667,14 @@ if (typeof window != "undefined") {
667
667
  }
668
668
  (t || e || r) && T.enableDevMode();
669
669
  }
670
- const y = T.createModuleLogger("Bridge"), E = T.createModuleLogger("Platform"), a = T.createModuleLogger("API"), v = T.createModuleLogger("State"), me = /complete|loaded|interactive/;
671
- function Vt(t) {
670
+ const y = T.createModuleLogger("Bridge"), E = T.createModuleLogger("Platform"), a = T.createModuleLogger("API"), v = T.createModuleLogger("State"), Ee = /complete|loaded|interactive/;
671
+ function Ht(t) {
672
672
  if (!J()) return !1;
673
673
  y.debug("检测到离线包环境,开始初始化");
674
674
  const e = () => {
675
675
  t();
676
676
  };
677
- if (me.test(document.readyState))
677
+ if (Ee.test(document.readyState))
678
678
  y.debug("离线包环境 DOM 已就绪,立即初始化"), setTimeout(e, 0);
679
679
  else {
680
680
  y.debug("离线包环境,等待 DOMContentLoaded");
@@ -686,19 +686,19 @@ function Vt(t) {
686
686
  }
687
687
  return !0;
688
688
  }
689
- function qt(t) {
690
- return Ce() || Se() ? (y.debug("检测到 APP 环境,开始初始化"), window.__uniapp_x_postMessage || window.__uniapp_x_ || window.__dcloud_weex_postMessage || window.__dcloud_weex_ ? (y.debug("NVUE/UVUE 环境,等待 DOMContentLoaded"), document.addEventListener("DOMContentLoaded", t)) : window.plus && me.test(document.readyState) ? (y.debug("Plus 环境已就绪,立即初始化"), setTimeout(t, 0)) : window.plus ? (y.debug("Plus 环境,等待 plusready 事件"), document.addEventListener("plusready", t)) : me.test(document.readyState) ? setTimeout(t, 0) : document.addEventListener("DOMContentLoaded", t, { once: !0 }), !0) : !1;
689
+ function Yt(t) {
690
+ return Pe() || be() ? (y.debug("检测到 APP 环境,开始初始化"), window.__uniapp_x_postMessage || window.__uniapp_x_ || window.__dcloud_weex_postMessage || window.__dcloud_weex_ ? (y.debug("NVUE/UVUE 环境,等待 DOMContentLoaded"), document.addEventListener("DOMContentLoaded", t)) : window.plus && Ee.test(document.readyState) ? (y.debug("Plus 环境已就绪,立即初始化"), setTimeout(t, 0)) : window.plus ? (y.debug("Plus 环境,等待 plusready 事件"), document.addEventListener("plusready", t)) : Ee.test(document.readyState) ? setTimeout(t, 0) : document.addEventListener("DOMContentLoaded", t, { once: !0 }), !0) : !1;
691
691
  }
692
- function Jt(t) {
692
+ function Zt(t) {
693
693
  return window.wx && window.wx.miniProgram ? (y.debug("检测到微信小程序环境,开始初始化"), window.WeixinJSBridge && window.WeixinJSBridge.invoke ? (y.debug("微信 JSBridge 已就绪,立即初始化"), setTimeout(t, 0)) : (y.debug("微信 JSBridge 未就绪,等待 WeixinJSBridgeReady 事件"), document.addEventListener("WeixinJSBridgeReady", t)), !0) : !1;
694
694
  }
695
- function jt(t) {
696
- return y.info("开始初始化 JSBridge"), Vt(t) ? (y.info("使用离线包环境初始化"), !0) : qt(t) ? (y.info("使用 APP 环境初始化"), !0) : Jt(t) ? (y.info("使用微信小程序环境初始化"), !0) : (y.debug("使用默认 H5 环境初始化"), me.test(document.readyState) ? (y.debug("DOM 已就绪,立即初始化"), setTimeout(t, 0)) : (y.debug("DOM 未就绪,等待 DOMContentLoaded"), document.addEventListener("DOMContentLoaded", t)), !0);
695
+ function Xt(t) {
696
+ return y.info("开始初始化 JSBridge"), Ht(t) ? (y.info("使用离线包环境初始化"), !0) : Yt(t) ? (y.info("使用 APP 环境初始化"), !0) : Zt(t) ? (y.info("使用微信小程序环境初始化"), !0) : (y.debug("使用默认 H5 环境初始化"), Ee.test(document.readyState) ? (y.debug("DOM 已就绪,立即初始化"), setTimeout(t, 0)) : (y.debug("DOM 未就绪,等待 DOMContentLoaded"), document.addEventListener("DOMContentLoaded", t)), !0);
697
697
  }
698
- function Ht() {
698
+ function Qt() {
699
699
  return V.waitForReady();
700
700
  }
701
- function He() {
701
+ function Qe() {
702
702
  return V.startInitialization(() => w(null, null, function* () {
703
703
  return new Promise((t, e) => {
704
704
  const r = () => {
@@ -710,7 +710,7 @@ function He() {
710
710
  e(s);
711
711
  };
712
712
  try {
713
- jt(() => {
713
+ Xt(() => {
714
714
  r();
715
715
  });
716
716
  } catch (i) {
@@ -719,7 +719,7 @@ function He() {
719
719
  });
720
720
  }));
721
721
  }
722
- const N = {
722
+ const R = {
723
723
  UNINITIALIZED: "uninitialized",
724
724
  CONFIGURING: "configuring",
725
725
  CONFIGURED: "configured",
@@ -728,16 +728,16 @@ const N = {
728
728
  function $() {
729
729
  return typeof window == "undefined" || !window.wx ? !1 : typeof window.wx.config == "function" && typeof window.wx.ready == "function" && typeof window.wx.error == "function";
730
730
  }
731
- class Yt {
731
+ class er {
732
732
  constructor() {
733
- this.state = N.UNINITIALIZED, this.configPromise = null, this.readyCallbacks = [], this.errorCallbacks = [], this.lastError = null, this.runtimeConfig = {
733
+ this.state = R.UNINITIALIZED, this.configPromise = null, this.readyCallbacks = [], this.errorCallbacks = [], this.lastError = null, this.runtimeConfig = {
734
734
  clientId: null,
735
735
  isProd: !1
736
736
  }, this.CONFIG_API_URL = this.getConfigApiUrl(this.runtimeConfig.isProd), this.DEFAULT_JS_API_LIST = ["chooseImage", "uploadImage", "previewImage", "downloadImage", "getLocalImgData", "scanQRCode", "getLocation", "openLocation", "updateAppMessageShareData", "updateTimelineShareData"], this.handleConfigSuccess = this.handleConfigSuccess.bind(this), this.handleConfigError = this.handleConfigError.bind(this);
737
737
  }
738
738
  configure(e = {}) {
739
739
  if (!e || typeof e != "object" || Array.isArray(e))
740
- throw new M(
740
+ throw new N(
741
741
  b.INVALID_PARAMETERS,
742
742
  "config参数异常",
743
743
  { config: e }
@@ -745,29 +745,29 @@ class Yt {
745
745
  if (!Object.prototype.hasOwnProperty.call(e, "clientId"))
746
746
  throw this.createMissingClientIdError();
747
747
  if (typeof e.clientId != "string" || !e.clientId.trim())
748
- throw new M(
748
+ throw new N(
749
749
  b.INVALID_PARAMETERS,
750
750
  "clientId参数异常",
751
751
  { clientId: e.clientId }
752
752
  );
753
753
  if (Object.prototype.hasOwnProperty.call(e, "isProd") && typeof e.isProd != "boolean")
754
- throw new M(
754
+ throw new N(
755
755
  b.INVALID_PARAMETERS,
756
756
  "isProd参数异常",
757
757
  { isProd: e.isProd }
758
758
  );
759
759
  const r = e.clientId.trim(), n = e.isProd === !0, i = r !== this.runtimeConfig.clientId || n !== this.runtimeConfig.isProd;
760
- return this.runtimeConfig = m(h({}, this.runtimeConfig), {
760
+ return this.runtimeConfig = p(g({}, this.runtimeConfig), {
761
761
  clientId: r,
762
762
  isProd: n
763
- }), this.CONFIG_API_URL = this.getConfigApiUrl(n), (this.state === N.ERROR || i && (this.state === N.CONFIGURING || this.state === N.CONFIGURED)) && this.reset(), E.info("Updated Weixin runtime config", {
763
+ }), this.CONFIG_API_URL = this.getConfigApiUrl(n), (this.state === R.ERROR || i && (this.state === R.CONFIGURING || this.state === R.CONFIGURED)) && this.reset(), E.info("Updated Weixin runtime config", {
764
764
  clientId: this.runtimeConfig.clientId,
765
765
  isProd: this.runtimeConfig.isProd,
766
766
  configApiUrl: this.CONFIG_API_URL
767
767
  }), this.getRuntimeConfig();
768
768
  }
769
769
  getRuntimeConfig() {
770
- return h({}, this.runtimeConfig);
770
+ return g({}, this.runtimeConfig);
771
771
  }
772
772
  hasClientId() {
773
773
  return typeof this.runtimeConfig.clientId == "string" && this.runtimeConfig.clientId.length > 0;
@@ -776,7 +776,7 @@ class Yt {
776
776
  return this.isTestMode() || this.hasClientId();
777
777
  }
778
778
  createMissingClientIdError() {
779
- return new M(
779
+ return new N(
780
780
  b.INVALID_PARAMETERS,
781
781
  "clientId错误",
782
782
  { field: "clientId" }
@@ -831,7 +831,7 @@ class Yt {
831
831
  } catch (i) {
832
832
  if (E.error("获取微信配置失败", i), this.shouldUseTestMode(i))
833
833
  return E.warn("网络请求失败,降级到测试模式"), this.getMockConfig();
834
- throw new M(
834
+ throw new N(
835
835
  b.NETWORK_ERROR,
836
836
  `获取微信配置失败: ${i.message}`,
837
837
  { url: n, originalError: i }
@@ -907,7 +907,7 @@ class Yt {
907
907
  * @private
908
908
  */
909
909
  handleConfigSuccess() {
910
- E.info("微信配置成功"), this.state = N.CONFIGURED, this.lastError = null, this.configPromise = null;
910
+ E.info("微信配置成功"), this.state = R.CONFIGURED, this.lastError = null, this.configPromise = null;
911
911
  const e = [...this.readyCallbacks];
912
912
  this.readyCallbacks = [], this.errorCallbacks = [], e.forEach((r) => {
913
913
  try {
@@ -925,12 +925,12 @@ class Yt {
925
925
  handleConfigError(e) {
926
926
  const r = `微信配置验证失败: ${JSON.stringify(e)}`;
927
927
  E.error(r, e);
928
- const n = new M(
928
+ const n = new N(
929
929
  b.API_CALL_FAILED,
930
930
  r,
931
931
  { weixinErrorResponse: e }
932
932
  );
933
- this.state = N.ERROR, this.lastError = n, this.configPromise = null;
933
+ this.state = R.ERROR, this.lastError = n, this.configPromise = null;
934
934
  const i = [...this.errorCallbacks];
935
935
  this.readyCallbacks = [], this.errorCallbacks = [], i.forEach((s) => {
936
936
  try {
@@ -946,7 +946,7 @@ class Yt {
946
946
  */
947
947
  autoConfig() {
948
948
  return w(this, null, function* () {
949
- return this.hasRequiredConfig() ? this.state === N.CONFIGURED ? Promise.resolve() : this.state === N.ERROR ? Promise.reject(this.lastError) : this.configPromise ? this.configPromise : (this.state = N.CONFIGURING, this.configPromise = this.performAutoConfig(), this.configPromise) : (E.warn("clientId为空,等待qsh.config({ clientId })"), Promise.resolve());
949
+ return this.hasRequiredConfig() ? this.state === R.CONFIGURED ? Promise.resolve() : this.state === R.ERROR ? Promise.reject(this.lastError) : this.configPromise ? this.configPromise : (this.state = R.CONFIGURING, this.configPromise = this.performAutoConfig(), this.configPromise) : (E.warn("clientId为空,等待qsh.config({ clientId })"), Promise.resolve());
950
950
  });
951
951
  }
952
952
  /**
@@ -963,19 +963,19 @@ class Yt {
963
963
  throw new Error("微信JS-SDK未加载,无法执行配置");
964
964
  const e = yield this.fetchWeixinConfig();
965
965
  return this.executeWeixinConfig(e), yield new Promise((r, n) => {
966
- if (this.state === N.CONFIGURED) {
966
+ if (this.state === R.CONFIGURED) {
967
967
  r();
968
968
  return;
969
969
  }
970
- if (this.state === N.ERROR) {
970
+ if (this.state === R.ERROR) {
971
971
  n(this.lastError);
972
972
  return;
973
973
  }
974
974
  this.readyCallbacks.push(r), this.errorCallbacks.push(n);
975
975
  });
976
976
  } catch (e) {
977
- const r = e instanceof M ? e : u.handleApiError(e, { context: "WeixinConfigManager.performAutoConfig" });
978
- this.state = N.ERROR, this.lastError = r, this.configPromise = null;
977
+ const r = e instanceof N ? e : u.handleApiError(e, { context: "WeixinConfigManager.performAutoConfig" });
978
+ this.state = R.ERROR, this.lastError = r, this.configPromise = null;
979
979
  const n = [...this.errorCallbacks];
980
980
  throw this.readyCallbacks = [], this.errorCallbacks = [], n.forEach((i) => {
981
981
  try {
@@ -992,7 +992,7 @@ class Yt {
992
992
  * @returns {Promise<void>} 配置完成的Promise
993
993
  */
994
994
  waitForReady() {
995
- return this.state === N.CONFIGURED ? Promise.resolve() : this.state === N.ERROR ? Promise.reject(this.lastError) : this.hasRequiredConfig() ? this.state === N.UNINITIALIZED ? this.autoConfig() : new Promise((e, r) => {
995
+ return this.state === R.CONFIGURED ? Promise.resolve() : this.state === R.ERROR ? Promise.reject(this.lastError) : this.hasRequiredConfig() ? this.state === R.UNINITIALIZED ? this.autoConfig() : new Promise((e, r) => {
996
996
  this.readyCallbacks.push(e), this.errorCallbacks.push(r);
997
997
  }) : Promise.reject(this.createMissingClientIdError());
998
998
  }
@@ -1001,7 +1001,7 @@ class Yt {
1001
1001
  * @returns {boolean} 是否已配置
1002
1002
  */
1003
1003
  isReady() {
1004
- return this.state === N.CONFIGURED;
1004
+ return this.state === R.CONFIGURED;
1005
1005
  }
1006
1006
  /**
1007
1007
  * 获取当前状态
@@ -1021,7 +1021,7 @@ class Yt {
1021
1021
  * 重置配置管理器(用于重试或测试)
1022
1022
  */
1023
1023
  reset() {
1024
- this.state = N.UNINITIALIZED, this.configPromise = null, this.readyCallbacks = [], this.errorCallbacks = [], this.lastError = null, E.debug("微信配置管理器已重置");
1024
+ this.state = R.UNINITIALIZED, this.configPromise = null, this.readyCallbacks = [], this.errorCallbacks = [], this.lastError = null, E.debug("微信配置管理器已重置");
1025
1025
  }
1026
1026
  /**
1027
1027
  * 获取配置统计信息
@@ -1041,18 +1041,18 @@ class Yt {
1041
1041
  };
1042
1042
  }
1043
1043
  }
1044
- const S = new Yt();
1045
- let X = !1, oe = !1, x = null, pe = !1;
1046
- function Zt(t) {
1044
+ const S = new er();
1045
+ let X = !1, le = !1, x = null, ye = !1;
1046
+ function tr(t) {
1047
1047
  return new Promise((e) => {
1048
1048
  let r = !1, n = null;
1049
- const i = (f) => w(null, null, function* () {
1049
+ const i = (h) => w(null, null, function* () {
1050
1050
  if (!r) {
1051
- if (r = !0, n && clearTimeout(n), X = !1, oe = f, f)
1051
+ if (r = !0, n && clearTimeout(n), X = !1, le = h, h)
1052
1052
  try {
1053
- yield Ye();
1054
- } catch (d) {
1055
- E.error("微信配置失败,将使用消息桥作为后备", d);
1053
+ yield et();
1054
+ } catch (f) {
1055
+ E.error("微信配置失败,将使用消息桥作为后备", f);
1056
1056
  }
1057
1057
  e();
1058
1058
  }
@@ -1066,31 +1066,31 @@ function Zt(t) {
1066
1066
  }, 3e3);
1067
1067
  });
1068
1068
  }
1069
- function Te() {
1069
+ function ve() {
1070
1070
  return w(this, arguments, function* (t = {}) {
1071
1071
  const { force: e = !1, recoverFromError: r = !1 } = t;
1072
- if (yield Ze({ force: e }), !$())
1072
+ if (yield tt({ force: e }), !$())
1073
1073
  throw new Error("微信 JS-SDK 未正确加载,无法执行配置");
1074
- r && Qt();
1074
+ r && nr();
1075
1075
  });
1076
1076
  }
1077
- function Xt(t = !1) {
1077
+ function rr(t = !1) {
1078
1078
  if (typeof window == "undefined") return !1;
1079
1079
  if ($())
1080
- return oe = !0, !1;
1081
- if (oe || J()) return !1;
1080
+ return le = !0, !1;
1081
+ if (le || J()) return !1;
1082
1082
  if (t) return !0;
1083
1083
  const e = navigator.userAgent || "", r = /micromessenger/i.test(e), n = /miniProgram/i.test(e), i = typeof window.__wxjs_environment != "undefined" && window.__wxjs_environment === "miniprogram", s = !!(window.wx && window.wx.miniProgram);
1084
1084
  return r && (n || i || s);
1085
1085
  }
1086
- function Qt() {
1087
- S.getState() === "error" && (S.reset(), pe = !1);
1086
+ function nr() {
1087
+ S.getState() === "error" && (S.reset(), ye = !1);
1088
1088
  }
1089
- function Ye() {
1089
+ function et() {
1090
1090
  return w(this, null, function* () {
1091
- if (pe)
1091
+ if (ye)
1092
1092
  return S.waitForReady();
1093
- pe = !0, E.info("开始自动配置微信JS-SDK");
1093
+ ye = !0, E.info("开始自动配置微信JS-SDK");
1094
1094
  try {
1095
1095
  yield S.autoConfig(), E.info("微信JS-SDK自动配置完成");
1096
1096
  } catch (t) {
@@ -1098,24 +1098,24 @@ function Ye() {
1098
1098
  }
1099
1099
  });
1100
1100
  }
1101
- function Ze(t = {}) {
1101
+ function tt(t = {}) {
1102
1102
  const { force: e = !1 } = t;
1103
1103
  if (typeof window == "undefined")
1104
1104
  return Promise.resolve();
1105
1105
  if ($())
1106
- return oe = !0, Promise.resolve();
1106
+ return le = !0, Promise.resolve();
1107
1107
  const r = document.getElementById("weixin-jssdk");
1108
- return r ? x || (X = !0, x = Zt(r).finally(() => {
1108
+ return r ? x || (X = !0, x = tr(r).finally(() => {
1109
1109
  x = null;
1110
- }), x) : Xt(e) ? x || (x = new Promise((n) => {
1110
+ }), x) : rr(e) ? x || (x = new Promise((n) => {
1111
1111
  X = !0;
1112
1112
  try {
1113
1113
  const i = document.createElement("script");
1114
1114
  i.id = "weixin-jssdk", i.type = "text/javascript", i.async = !0, i.src = "https://res.wx.qq.com/open/js/jweixin-1.6.2.js", i.onload = function() {
1115
1115
  return w(this, null, function* () {
1116
- oe = !0, X = !1, E.info("微信 JS-SDK 已自动加载");
1116
+ le = !0, X = !1, E.info("微信 JS-SDK 已自动加载");
1117
1117
  try {
1118
- yield Ye();
1118
+ yield et();
1119
1119
  } catch (c) {
1120
1120
  E.error("微信配置失败,将使用消息桥作为后备", c);
1121
1121
  }
@@ -1131,12 +1131,12 @@ function Ze(t = {}) {
1131
1131
  x = null;
1132
1132
  }), x) : Promise.resolve();
1133
1133
  }
1134
- function G() {
1135
- return Te({ force: !0, recoverFromError: !0 }).then(() => S.waitForReady());
1134
+ function K() {
1135
+ return ve({ force: !0, recoverFromError: !0 }).then(() => S.waitForReady());
1136
1136
  }
1137
- function Be(t = {}) {
1137
+ function ze(t = {}) {
1138
1138
  const e = S.configure(t);
1139
- return typeof window == "undefined" || Te({
1139
+ return typeof window == "undefined" || ve({
1140
1140
  force: !0,
1141
1141
  recoverFromError: S.getState() === "error"
1142
1142
  }).then(() => {
@@ -1152,18 +1152,18 @@ function Be(t = {}) {
1152
1152
  function j() {
1153
1153
  return S.isReady();
1154
1154
  }
1155
- function er() {
1155
+ function ir() {
1156
1156
  return S.getState();
1157
1157
  }
1158
- function Pe() {
1158
+ function Me() {
1159
1159
  return S;
1160
1160
  }
1161
- function tr() {
1161
+ function ar() {
1162
1162
  return w(this, null, function* () {
1163
- return E.info("手动重试微信配置"), S.reset(), pe = !1, yield Te({ force: !0 }), S.waitForReady();
1163
+ return E.info("手动重试微信配置"), S.reset(), ye = !1, yield ve({ force: !0 }), S.waitForReady();
1164
1164
  });
1165
1165
  }
1166
- class rr {
1166
+ class sr {
1167
1167
  constructor() {
1168
1168
  this.plugins = /* @__PURE__ */ new Map(), this.installed = /* @__PURE__ */ new Set(), this.installOrder = [], a.debug("插件管理器已初始化");
1169
1169
  }
@@ -1356,8 +1356,8 @@ class rr {
1356
1356
  this.plugins.clear(), this.installed.clear(), this.installOrder = [];
1357
1357
  }
1358
1358
  }
1359
- const ae = new rr();
1360
- class nr {
1359
+ const ce = new sr();
1360
+ class or {
1361
1361
  constructor() {
1362
1362
  this.requestInterceptors = [], this.responseInterceptors = [], a.debug("拦截器链已初始化");
1363
1363
  }
@@ -1417,7 +1417,7 @@ class nr {
1417
1417
  */
1418
1418
  runRequest(e) {
1419
1419
  return w(this, null, function* () {
1420
- let r = h({}, e);
1420
+ let r = g({}, e);
1421
1421
  for (const { fn: n } of this.requestInterceptors) {
1422
1422
  if (r.abort) {
1423
1423
  a.debug("请求被中止", { apiName: r.apiName });
@@ -1471,7 +1471,7 @@ class nr {
1471
1471
  };
1472
1472
  }
1473
1473
  }
1474
- const z = new nr(), ir = {
1474
+ const z = new or(), cr = {
1475
1475
  /**
1476
1476
  * 请求日志
1477
1477
  */
@@ -1516,7 +1516,7 @@ const z = new nr(), ir = {
1516
1516
  getReport: () => {
1517
1517
  const t = {};
1518
1518
  return B.metrics.forEach((e, r) => {
1519
- t[r] = h({}, e);
1519
+ t[r] = g({}, e);
1520
1520
  }), t;
1521
1521
  },
1522
1522
  /**
@@ -1526,7 +1526,7 @@ const z = new nr(), ir = {
1526
1526
  B.metrics.clear();
1527
1527
  }
1528
1528
  };
1529
- function ar(t = {}) {
1529
+ function ur(t = {}) {
1530
1530
  const {
1531
1531
  maxRetries: e = 3,
1532
1532
  retryDelay: r = 1e3,
@@ -1538,7 +1538,7 @@ function ar(t = {}) {
1538
1538
  })
1539
1539
  };
1540
1540
  }
1541
- function sr(t = {}) {
1541
+ function lr(t = {}) {
1542
1542
  return {
1543
1543
  request: (e) => {
1544
1544
  const r = t[e.apiName];
@@ -1550,7 +1550,7 @@ function sr(t = {}) {
1550
1550
  }
1551
1551
  };
1552
1552
  }
1553
- class or {
1553
+ class fr {
1554
1554
  constructor() {
1555
1555
  this.state = {
1556
1556
  // SDK 状态
@@ -1617,7 +1617,7 @@ class or {
1617
1617
  * store.set('network.online', false)
1618
1618
  */
1619
1619
  set(e, r) {
1620
- const n = e.split("."), i = n.pop(), s = n.reduce((f, d) => ((!f[d] || typeof f[d] != "object") && (f[d] = {}), f[d]), this.state), c = s[i];
1620
+ const n = e.split("."), i = n.pop(), s = n.reduce((h, f) => ((!h[f] || typeof h[f] != "object") && (h[f] = {}), h[f]), this.state), c = s[i];
1621
1621
  c !== r && (s[i] = r, v.debug(`状态已更新: ${e}`, { oldValue: c, newValue: r }), this.notify(e, r, c));
1622
1622
  }
1623
1623
  /**
@@ -1680,20 +1680,20 @@ class or {
1680
1680
  i && i.forEach((c) => {
1681
1681
  try {
1682
1682
  c(r, n, e);
1683
- } catch (f) {
1684
- v.error("订阅者执行失败", f);
1683
+ } catch (h) {
1684
+ v.error("订阅者执行失败", h);
1685
1685
  }
1686
1686
  });
1687
1687
  const s = e.split(".");
1688
1688
  for (let c = 1; c < s.length; c++) {
1689
- const f = s.slice(0, c).join("."), d = this.listeners.get(f);
1690
- if (d) {
1691
- const p = this.get(f);
1692
- d.forEach((R) => {
1689
+ const h = s.slice(0, c).join("."), f = this.listeners.get(h);
1690
+ if (f) {
1691
+ const A = this.get(h);
1692
+ f.forEach((M) => {
1693
1693
  try {
1694
- R(p, void 0, f);
1695
- } catch (O) {
1696
- v.error("父路径订阅者执行失败", O);
1694
+ M(A, void 0, h);
1695
+ } catch (m) {
1696
+ v.error("父路径订阅者执行失败", m);
1697
1697
  }
1698
1698
  });
1699
1699
  }
@@ -1701,8 +1701,8 @@ class or {
1701
1701
  this.wildcardListeners.forEach((c) => {
1702
1702
  try {
1703
1703
  c(r, n, e);
1704
- } catch (f) {
1705
- v.error("通配符订阅者执行失败", f);
1704
+ } catch (h) {
1705
+ v.error("通配符订阅者执行失败", h);
1706
1706
  }
1707
1707
  });
1708
1708
  }
@@ -1728,7 +1728,7 @@ class or {
1728
1728
  */
1729
1729
  setApiLoading(e, r = !0) {
1730
1730
  const n = `api.${e}`, i = this.get(n) || {};
1731
- this.set(n, m(h({}, i), {
1731
+ this.set(n, p(g({}, i), {
1732
1732
  loading: r,
1733
1733
  lastCall: r ? Date.now() : i.lastCall
1734
1734
  }));
@@ -1740,7 +1740,7 @@ class or {
1740
1740
  */
1741
1741
  setApiResult(e, r) {
1742
1742
  const n = `api.${e}`, i = this.get(n) || {};
1743
- this.set(n, m(h({}, i), {
1743
+ this.set(n, p(g({}, i), {
1744
1744
  loading: !1,
1745
1745
  lastResult: r,
1746
1746
  lastCallEnd: Date.now()
@@ -1795,7 +1795,7 @@ class or {
1795
1795
  };
1796
1796
  }
1797
1797
  }
1798
- const W = new or(), o = {
1798
+ const W = new fr(), o = {
1799
1799
  // SDK 核心错误 (E_SDK_xxx)
1800
1800
  SDK_NOT_READY: "E_SDK_001",
1801
1801
  SDK_INIT_FAILED: "E_SDK_002",
@@ -1846,7 +1846,7 @@ const W = new or(), o = {
1846
1846
  API_TIMEOUT: "E_TIMEOUT_001",
1847
1847
  // 通用错误
1848
1848
  UNKNOWN_ERROR: "E_UNKNOWN_999"
1849
- }, Re = {
1849
+ }, Se = {
1850
1850
  // SDK 核心
1851
1851
  [o.SDK_NOT_READY]: "SDK 未就绪",
1852
1852
  [o.SDK_INIT_FAILED]: "SDK 初始化失败",
@@ -1902,7 +1902,7 @@ const W = new or(), o = {
1902
1902
  // 配置问题
1903
1903
  UNKNOWN: "unknown"
1904
1904
  // 未知问题
1905
- }, cr = {
1905
+ }, dr = {
1906
1906
  // 图片相关
1907
1907
  "IMAGE/USER_CANCEL": o.IMAGE_CANCELLED,
1908
1908
  "IMAGE/PERMISSION_DENIED": o.IMAGE_NO_PERMISSION,
@@ -1910,7 +1910,7 @@ const W = new or(), o = {
1910
1910
  "COMMON/UNKNOWN": o.UNKNOWN_ERROR,
1911
1911
  "COMMON/CONFIG_NOT_READY": o.IMAGE_CONFIG_NOT_READY,
1912
1912
  "COMMON/PLATFORM_NOT_SUPPORTED": o.PLATFORM_NOT_SUPPORTED
1913
- }, ke = {
1913
+ }, Ve = {
1914
1914
  // 微信平台错误模式
1915
1915
  weixin: {
1916
1916
  patterns: [
@@ -1944,7 +1944,7 @@ const W = new or(), o = {
1944
1944
  ],
1945
1945
  default: o.UNKNOWN_ERROR
1946
1946
  }
1947
- }, Ke = {
1947
+ }, qe = {
1948
1948
  chooseImage: {
1949
1949
  "fail cancel": o.IMAGE_CANCELLED,
1950
1950
  "fail auth deny": o.IMAGE_NO_PERMISSION,
@@ -1958,17 +1958,17 @@ const W = new or(), o = {
1958
1958
  NOT_IN_CONTAINER: o.PLATFORM_NOT_SUPPORTED
1959
1959
  }
1960
1960
  };
1961
- function Xe(t) {
1961
+ function rt(t) {
1962
1962
  return t ? t.includes("CANCEL") ? D.USER_CANCEL : t.includes("PERM") || t.includes("PERMISSION") ? D.PERMISSION : t.includes("NET") || t.includes("NETWORK") ? D.NETWORK : t.includes("PARAM") ? D.PARAM : t.includes("CONFIG") ? D.CONFIG : t.includes("SDK") || t.includes("PLATFORM") ? D.SYSTEM : D.UNKNOWN : D.UNKNOWN;
1963
1963
  }
1964
- function ur(t) {
1964
+ function gr(t) {
1965
1965
  return t.includes("NET_") || t.includes("TIMEOUT") || t === o.NETWORK_ERROR || t === o.NETWORK_TIMEOUT || t === o.API_TIMEOUT;
1966
1966
  }
1967
- function lr(t) {
1968
- return t.includes("CANCEL") || Xe(t) === D.USER_CANCEL;
1967
+ function hr(t) {
1968
+ return t.includes("CANCEL") || rt(t) === D.USER_CANCEL;
1969
1969
  }
1970
1970
  function Q(t) {
1971
- return Re[t] || Re[o.UNKNOWN_ERROR];
1971
+ return Se[t] || Se[o.UNKNOWN_ERROR];
1972
1972
  }
1973
1973
  class F extends Error {
1974
1974
  /**
@@ -1978,7 +1978,7 @@ class F extends Error {
1978
1978
  * @param {Object} options - 选项
1979
1979
  */
1980
1980
  constructor(e, r, n = {}) {
1981
- super(r), this.name = "StandardError", this.code = e, this.message = r || Q(e), this.platform = n.platform || l.type, this.apiName = n.apiName, this.category = n.category || Xe(e), this.retriable = n.retriable !== void 0 ? n.retriable : ur(e), this.originalError = n.originalError, this.details = n.details || {}, this.timestamp = Date.now();
1981
+ super(r), this.name = "StandardError", this.code = e, this.message = r || Q(e), this.platform = n.platform || l.type, this.apiName = n.apiName, this.category = n.category || rt(e), this.retriable = n.retriable !== void 0 ? n.retriable : gr(e), this.originalError = n.originalError, this.details = n.details || {}, this.timestamp = Date.now();
1982
1982
  }
1983
1983
  /**
1984
1984
  * 是否可重试
@@ -1992,14 +1992,14 @@ class F extends Error {
1992
1992
  * @returns {boolean}
1993
1993
  */
1994
1994
  isUserAction() {
1995
- return lr(this.code);
1995
+ return hr(this.code);
1996
1996
  }
1997
1997
  /**
1998
1998
  * 转为普通对象
1999
1999
  * @returns {Object}
2000
2000
  */
2001
2001
  toJSON() {
2002
- return h({
2002
+ return g({
2003
2003
  code: this.code,
2004
2004
  message: this.message,
2005
2005
  platform: this.platform,
@@ -2013,11 +2013,11 @@ class F extends Error {
2013
2013
  } : {});
2014
2014
  }
2015
2015
  }
2016
- function Qe(t, e = {}) {
2016
+ function nt(t, e = {}) {
2017
2017
  if (t instanceof F)
2018
2018
  return t;
2019
2019
  const { apiName: r, platform: n = l.type } = e;
2020
- return t && typeof t.code == "string" && t.code.includes("/") ? fr(t, { apiName: r, platform: n }) : t && (t.errMsg || t.message) ? dr(t, { apiName: r, platform: n }) : typeof t == "string" ? new F(
2020
+ return t && typeof t.code == "string" && t.code.includes("/") ? mr(t, { apiName: r, platform: n }) : t && (t.errMsg || t.message) ? pr(t, { apiName: r, platform: n }) : typeof t == "string" ? new F(
2021
2021
  o.UNKNOWN_ERROR,
2022
2022
  t,
2023
2023
  { apiName: r, platform: n, originalError: t }
@@ -2032,8 +2032,8 @@ function Qe(t, e = {}) {
2032
2032
  }
2033
2033
  );
2034
2034
  }
2035
- function fr(t, e) {
2036
- const { apiName: r, platform: n } = e, i = t.code, s = cr[i] || o.UNKNOWN_ERROR;
2035
+ function mr(t, e) {
2036
+ const { apiName: r, platform: n } = e, i = t.code, s = dr[i] || o.UNKNOWN_ERROR;
2037
2037
  return a.debug("转换旧版错误码", {
2038
2038
  legacy: i,
2039
2039
  new: s
@@ -2044,29 +2044,29 @@ function fr(t, e) {
2044
2044
  apiName: r,
2045
2045
  platform: t.platform || n,
2046
2046
  originalError: t,
2047
- details: h({
2047
+ details: g({
2048
2048
  legacyCode: i,
2049
2049
  legacyVersion: t.version
2050
2050
  }, t.details)
2051
2051
  }
2052
2052
  );
2053
2053
  }
2054
- function dr(t, e) {
2054
+ function pr(t, e) {
2055
2055
  const { apiName: r, platform: n } = e, i = (t.errMsg || t.message || "").toLowerCase();
2056
- if (r && Ke[r]) {
2057
- const f = Ke[r];
2058
- for (const [d, p] of Object.entries(f))
2059
- if (i.includes(d.toLowerCase()))
2060
- return new F(p, Q(p), {
2056
+ if (r && qe[r]) {
2057
+ const h = qe[r];
2058
+ for (const [f, A] of Object.entries(h))
2059
+ if (i.includes(f.toLowerCase()))
2060
+ return new F(A, Q(A), {
2061
2061
  apiName: r,
2062
2062
  platform: n,
2063
2063
  originalError: t
2064
2064
  });
2065
2065
  }
2066
- const s = ke[n] || ke.uniapp;
2067
- for (const { pattern: f, code: d } of s.patterns)
2068
- if (f.test(i))
2069
- return new F(d, Q(d), {
2066
+ const s = Ve[n] || Ve.uniapp;
2067
+ for (const { pattern: h, code: f } of s.patterns)
2068
+ if (h.test(i))
2069
+ return new F(f, Q(f), {
2070
2070
  apiName: r,
2071
2071
  platform: n,
2072
2072
  originalError: t
@@ -2082,7 +2082,7 @@ function dr(t, e) {
2082
2082
  }
2083
2083
  );
2084
2084
  }
2085
- const et = {
2085
+ const it = {
2086
2086
  /**
2087
2087
  * 响应拦截器
2088
2088
  * @param {Object} result - API 响应结果
@@ -2091,7 +2091,7 @@ const et = {
2091
2091
  */
2092
2092
  response: (t, e) => {
2093
2093
  if (!t.success && t.error) {
2094
- const r = Qe(t.error, {
2094
+ const r = nt(t.error, {
2095
2095
  apiName: e.apiName,
2096
2096
  platform: l.type
2097
2097
  });
@@ -2104,25 +2104,25 @@ const et = {
2104
2104
  return t;
2105
2105
  }
2106
2106
  };
2107
- function gr(t, e = {}) {
2107
+ function wr(t, e = {}) {
2108
2108
  return new F(t, Q(t), e);
2109
2109
  }
2110
- function hr(t) {
2110
+ function Er(t) {
2111
2111
  return t instanceof F;
2112
2112
  }
2113
- function mr(t, e, r) {
2113
+ function yr(t, e, r) {
2114
2114
  return e ? Promise.race([
2115
2115
  t(),
2116
2116
  new Promise((n, i) => setTimeout(() => i(new Error(`Init task timeout: ${r}`)), e))
2117
2117
  ]) : t();
2118
2118
  }
2119
- function pr() {
2119
+ function Ir() {
2120
2120
  return w(this, arguments, function* (t = [], e = {}) {
2121
2121
  for (const r of t) {
2122
2122
  const n = (r == null ? void 0 : r.name) || "anonymous-task", i = (r == null ? void 0 : r.run) || r;
2123
2123
  if (typeof i == "function")
2124
2124
  try {
2125
- yield mr(() => Promise.resolve().then(() => i()), r.timeoutMs, n), typeof r.onSuccess == "function" && r.onSuccess();
2125
+ yield yr(() => Promise.resolve().then(() => i()), r.timeoutMs, n), typeof r.onSuccess == "function" && r.onSuccess();
2126
2126
  } catch (s) {
2127
2127
  if (typeof r.onError == "function" && r.onError(s), typeof e.onError == "function")
2128
2128
  e.onError(s, r);
@@ -2132,7 +2132,7 @@ function pr() {
2132
2132
  }
2133
2133
  });
2134
2134
  }
2135
- class tt {
2135
+ class at {
2136
2136
  /**
2137
2137
  * 构造函数
2138
2138
  * @param {string} name - 平台名称
@@ -2147,7 +2147,7 @@ class tt {
2147
2147
  */
2148
2148
  processNavigationOptions(e = {}) {
2149
2149
  const { url: r, delta: n = 1 } = e, i = r && encodeURI(r), s = parseInt(n) || 1;
2150
- return m(h({}, e), {
2150
+ return p(g({}, e), {
2151
2151
  url: i,
2152
2152
  delta: s
2153
2153
  });
@@ -2258,18 +2258,18 @@ class tt {
2258
2258
  throw new Error(`${this.name} platform must implement performGetEnv method`);
2259
2259
  }
2260
2260
  }
2261
- let se = [];
2262
- function wr() {
2263
- if (se.length === 0 && window.plus) {
2261
+ let ue = [];
2262
+ function Ar() {
2263
+ if (ue.length === 0 && window.plus) {
2264
2264
  const t = plus.webview.currentWebview();
2265
2265
  if (!t)
2266
2266
  throw new Error("plus.webview.currentWebview() is undefined");
2267
2267
  const e = t.parent(), r = e ? e.id : t.id;
2268
- se.push(r);
2268
+ ue.push(r);
2269
2269
  }
2270
- return se;
2270
+ return ue;
2271
2271
  }
2272
- function Er(t, e) {
2272
+ function _r(t, e) {
2273
2273
  const r = {
2274
2274
  options: {
2275
2275
  timestamp: +/* @__PURE__ */ new Date()
@@ -2285,12 +2285,12 @@ function Er(t, e) {
2285
2285
  type: "WEB_INVOKE_APPSERVICE",
2286
2286
  args: {
2287
2287
  data: r,
2288
- webviewIds: se
2288
+ webviewIds: ue
2289
2289
  }
2290
2290
  };
2291
2291
  window.__uniapp_x_postMessage ? window.__uniapp_x_postMessageToService(n) : window.__uniapp_x_.postMessageToService(JSON.stringify(n));
2292
2292
  }
2293
- function yr(t, e) {
2293
+ function Cr(t, e) {
2294
2294
  const r = {
2295
2295
  options: {
2296
2296
  timestamp: +/* @__PURE__ */ new Date()
@@ -2306,19 +2306,19 @@ function yr(t, e) {
2306
2306
  type: "WEB_INVOKE_APPSERVICE",
2307
2307
  args: {
2308
2308
  data: r,
2309
- webviewIds: se
2309
+ webviewIds: ue
2310
2310
  }
2311
2311
  };
2312
2312
  window.__dcloud_weex_postMessage ? window.__dcloud_weex_postMessageToService(n) : window.__dcloud_weex_.postMessageToService(JSON.stringify(n));
2313
2313
  }
2314
- function Ir(t, e) {
2314
+ function Or(t, e) {
2315
2315
  const r = {
2316
2316
  options: {
2317
2317
  timestamp: +/* @__PURE__ */ new Date()
2318
2318
  },
2319
2319
  name: t,
2320
2320
  arg: e
2321
- }, n = wr();
2321
+ }, n = Ar();
2322
2322
  if (plus.webview.getWebviewById("__uniapp__service"))
2323
2323
  plus.webview.postMessageToUniNView({
2324
2324
  type: "WEB_INVOKE_APPSERVICE",
@@ -2334,7 +2334,7 @@ function Ir(t, e) {
2334
2334
  );
2335
2335
  }
2336
2336
  }
2337
- function Ar(t, e) {
2337
+ function Pr(t, e) {
2338
2338
  const r = {
2339
2339
  options: {
2340
2340
  timestamp: +/* @__PURE__ */ new Date()
@@ -2348,10 +2348,10 @@ function Ar(t, e) {
2348
2348
  pageId: ""
2349
2349
  }, "*");
2350
2350
  }
2351
- function Cr(t) {
2351
+ function Rr(t) {
2352
2352
  return !!(t && typeof t == "object" && t.type === "qsh_api_call" && typeof t.api == "string" && typeof t.callbackId == "string");
2353
2353
  }
2354
- function _r(t, e) {
2354
+ function Nr(t, e) {
2355
2355
  const r = {
2356
2356
  options: {
2357
2357
  timestamp: +/* @__PURE__ */ new Date()
@@ -2359,7 +2359,7 @@ function _r(t, e) {
2359
2359
  name: t,
2360
2360
  arg: e
2361
2361
  };
2362
- if (t === "postMessage" && Cr(e))
2362
+ if (t === "postMessage" && Rr(e))
2363
2363
  return window.__offline_bridge_postMessage(e);
2364
2364
  window.__offline_bridge_postMessage({
2365
2365
  type: "WEB_INVOKE_APPSERVICE",
@@ -2367,10 +2367,10 @@ function _r(t, e) {
2367
2367
  pageId: ""
2368
2368
  });
2369
2369
  }
2370
- function ce(t, e) {
2371
- Ae() ? Er(t, e) : Ie() ? yr(t, e) : J() ? _r(t, e) : ye() ? Ir(t, e) : Ar(t, e);
2370
+ function fe(t, e) {
2371
+ Oe() ? _r(t, e) : Ce() ? Cr(t, e) : J() ? Nr(t, e) : _e() ? Or(t, e) : Pr(t, e);
2372
2372
  }
2373
- class rt extends tt {
2373
+ class st extends at {
2374
2374
  constructor() {
2375
2375
  super("weixin");
2376
2376
  }
@@ -2395,11 +2395,11 @@ class rt extends tt {
2395
2395
  const c = window.wx.miniProgram[e];
2396
2396
  if (typeof c == "function") {
2397
2397
  E.debug(`使用微信原生 API: wx.miniProgram.${e}`);
2398
- const f = e === "navigateBack" ? { delta: i } : { url: n };
2399
- return c.call(window.wx.miniProgram, f);
2398
+ const h = e === "navigateBack" ? { delta: i } : { url: n };
2399
+ return c.call(window.wx.miniProgram, h);
2400
2400
  }
2401
2401
  }
2402
- E.debug(`使用消息桥接执行: ${e}`), ce(e, e === "navigateBack" ? { delta: i } : { url: n });
2402
+ E.debug(`使用消息桥接执行: ${e}`), fe(e, e === "navigateBack" ? { delta: i } : { url: n });
2403
2403
  }, {
2404
2404
  platform: this.name,
2405
2405
  method: "performNavigation",
@@ -2417,7 +2417,7 @@ class rt extends tt {
2417
2417
  const { data: r } = e;
2418
2418
  if (this.isWeixinApiAvailable())
2419
2419
  return window.wx.miniProgram.postMessage({ data: r });
2420
- ce("postMessage", r);
2420
+ fe("postMessage", r);
2421
2421
  }, {
2422
2422
  platform: this.name,
2423
2423
  method: "performPostMessage",
@@ -2445,19 +2445,19 @@ class rt extends tt {
2445
2445
  });
2446
2446
  }
2447
2447
  }
2448
- const H = new rt(), Or = (t) => H.navigateTo(t), Pr = (t) => H.navigateBack(t), Rr = (t) => H.switchTab(t), Nr = (t) => H.reLaunch(t), Mr = (t) => H.redirectTo(t), Sr = (t) => H.postMessage(t), Tr = (t) => H.getEnv(t);
2449
- var nt = /* @__PURE__ */ Object.freeze({
2448
+ const H = new st(), Mr = (t) => H.navigateTo(t), Sr = (t) => H.navigateBack(t), Tr = (t) => H.switchTab(t), Lr = (t) => H.reLaunch(t), br = (t) => H.redirectTo(t), vr = (t) => H.postMessage(t), xr = (t) => H.getEnv(t);
2449
+ var ot = /* @__PURE__ */ Object.freeze({
2450
2450
  __proto__: null,
2451
- WeixinPlatform: rt,
2452
- getEnv: Tr,
2453
- navigateBack: Pr,
2454
- navigateTo: Or,
2455
- postMessage: Sr,
2456
- reLaunch: Nr,
2457
- redirectTo: Mr,
2458
- switchTab: Rr
2451
+ WeixinPlatform: st,
2452
+ getEnv: xr,
2453
+ navigateBack: Sr,
2454
+ navigateTo: Mr,
2455
+ postMessage: vr,
2456
+ reLaunch: Lr,
2457
+ redirectTo: br,
2458
+ switchTab: Tr
2459
2459
  });
2460
- class it extends tt {
2460
+ class ct extends at {
2461
2461
  constructor() {
2462
2462
  super("app");
2463
2463
  }
@@ -2470,7 +2470,7 @@ class it extends tt {
2470
2470
  performNavigation(e, r) {
2471
2471
  return u.safeExecute(() => {
2472
2472
  const { url: n, delta: i } = r;
2473
- ce(e, e === "navigateBack" ? { delta: i } : { url: n });
2473
+ fe(e, e === "navigateBack" ? { delta: i } : { url: n });
2474
2474
  }, {
2475
2475
  platform: this.name,
2476
2476
  method: "performNavigation",
@@ -2486,7 +2486,7 @@ class it extends tt {
2486
2486
  performPostMessage(e) {
2487
2487
  return u.safeExecute(() => {
2488
2488
  const { data: r } = e;
2489
- ce("postMessage", r);
2489
+ fe("postMessage", r);
2490
2490
  }, {
2491
2491
  platform: this.name,
2492
2492
  method: "performPostMessage",
@@ -2504,59 +2504,59 @@ class it extends tt {
2504
2504
  throw new Error("Callback function is required for getEnv");
2505
2505
  const r = {};
2506
2506
  let n = !1;
2507
- Ae() ? (r.uvue = !0, n = !0) : Ie() ? (r.nvue = !0, n = !0) : ye() ? (r.plus = !0, n = !0) : J() && (r.offline = !0, n = !0), n ? r.app = !0 : r.h5 = !0, e(r);
2507
+ Oe() ? (r.uvue = !0, n = !0) : Ce() ? (r.nvue = !0, n = !0) : _e() ? (r.plus = !0, n = !0) : J() && (r.offline = !0, n = !0), n ? r.app = !0 : r.h5 = !0, e(r);
2508
2508
  }, {
2509
2509
  platform: this.name,
2510
2510
  method: "performGetEnv"
2511
2511
  });
2512
2512
  }
2513
2513
  }
2514
- const Y = new it(), Lr = (t) => Y.navigateTo(t), br = (t) => Y.navigateBack(t), vr = (t) => Y.switchTab(t), xr = (t) => Y.reLaunch(t), Dr = (t) => Y.redirectTo(t), Ur = (t) => Y.postMessage(t), Wr = (t) => Y.getEnv(t);
2515
- var at = /* @__PURE__ */ Object.freeze({
2514
+ const Y = new ct(), Dr = (t) => Y.navigateTo(t), Ur = (t) => Y.navigateBack(t), Wr = (t) => Y.switchTab(t), $r = (t) => Y.reLaunch(t), Fr = (t) => Y.redirectTo(t), Br = (t) => Y.postMessage(t), kr = (t) => Y.getEnv(t);
2515
+ var ut = /* @__PURE__ */ Object.freeze({
2516
2516
  __proto__: null,
2517
- AppPlatform: it,
2518
- getEnv: Wr,
2519
- navigateBack: br,
2520
- navigateTo: Lr,
2521
- postMessage: Ur,
2522
- reLaunch: xr,
2523
- redirectTo: Dr,
2524
- switchTab: vr
2517
+ AppPlatform: ct,
2518
+ getEnv: kr,
2519
+ navigateBack: Ur,
2520
+ navigateTo: Dr,
2521
+ postMessage: Br,
2522
+ reLaunch: $r,
2523
+ redirectTo: Fr,
2524
+ switchTab: Wr
2525
2525
  });
2526
- function le() {
2527
- return C() ? nt : at;
2526
+ function ge() {
2527
+ return C() ? ot : ut;
2528
2528
  }
2529
- function $r(t) {
2530
- return le().navigateTo(t);
2529
+ function Gr(t) {
2530
+ return ge().navigateTo(t);
2531
2531
  }
2532
- function Fr(t) {
2533
- return le().navigateBack(t);
2532
+ function Kr(t) {
2533
+ return ge().navigateBack(t);
2534
2534
  }
2535
- function Br(t) {
2536
- return le().switchTab(t);
2535
+ function zr(t) {
2536
+ return ge().switchTab(t);
2537
2537
  }
2538
- function kr(t) {
2539
- return le().reLaunch(t);
2538
+ function Vr(t) {
2539
+ return ge().reLaunch(t);
2540
2540
  }
2541
- function Kr(t) {
2542
- return le().redirectTo(t);
2541
+ function qr(t) {
2542
+ return ge().redirectTo(t);
2543
2543
  }
2544
- function st() {
2545
- return C() ? nt : at;
2544
+ function lt() {
2545
+ return C() ? ot : ut;
2546
2546
  }
2547
- function Gr(t = {}) {
2548
- return st().postMessage(t);
2547
+ function Jr(t = {}) {
2548
+ return lt().postMessage(t);
2549
2549
  }
2550
- function zr(t) {
2551
- return st().getEnv(t);
2550
+ function jr(t) {
2551
+ return lt().getEnv(t);
2552
2552
  }
2553
- function Vr(t) {
2553
+ function Hr(t) {
2554
2554
  return t && typeof t == "object" && t.__v_raw ? t.__v_raw : t;
2555
2555
  }
2556
- function qr() {
2556
+ function Yr() {
2557
2557
  return "qsh_callback_" + Date.now() + "_" + Math.random().toString(36).substring(2, 9);
2558
2558
  }
2559
- class Jr {
2559
+ class Zr {
2560
2560
  constructor() {
2561
2561
  this.callbacks = /* @__PURE__ */ new Map(), this.timeouts = /* @__PURE__ */ new Map(), this.persistentCallbacksByApi = /* @__PURE__ */ new Map(), this.defaultTimeout = 3e4, typeof window != "undefined" && (window.qshWebviewCallbacks || (window.qshWebviewCallbacks = {})), y.debug("WebView 桥接器已初始化");
2562
2562
  }
@@ -2570,13 +2570,13 @@ class Jr {
2570
2570
  callApi(i) {
2571
2571
  return w(this, arguments, function* (e, r = {}, n = {}) {
2572
2572
  return u.safeExecute(() => w(this, null, function* () {
2573
- var p;
2573
+ var A;
2574
2574
  if (typeof window != "undefined" && window === window.parent && !window.plus && !window.__uniapp_x_postMessage && !window.__uniapp_x_ && !window.__dcloud_weex_postMessage && !window.__dcloud_weex_ && !J()) {
2575
- const R = new M(
2575
+ const M = new N(
2576
2576
  b.PLATFORM_NOT_SUPPORTED,
2577
2577
  "当前不在宿主 WebView 容器中,无法发送消息"
2578
2578
  );
2579
- n && typeof n.fail == "function" && n.fail({ errMsg: R.message, code: "NOT_IN_CONTAINER" }), n && typeof n.complete == "function" && n.complete({ success: !1, error: { errMsg: R.message } });
2579
+ n && typeof n.fail == "function" && n.fail({ errMsg: M.message, code: "NOT_IN_CONTAINER" }), n && typeof n.complete == "function" && n.complete({ success: !1, error: { errMsg: M.message } });
2580
2580
  return;
2581
2581
  }
2582
2582
  const c = {
@@ -2588,49 +2588,49 @@ class Jr {
2588
2588
  metadata: {}
2589
2589
  };
2590
2590
  W.setApiLoading(e, !0);
2591
- const f = yield z.runRequest(c);
2592
- if (f.abort) {
2591
+ const h = yield z.runRequest(c);
2592
+ if (h.abort) {
2593
2593
  y.warn("API 调用被拦截器中止", { api: e }), W.setApiLoading(e, !1), n.fail && n.fail({
2594
- errMsg: ((p = f.error) == null ? void 0 : p.message) || "API 调用被中止",
2594
+ errMsg: ((A = h.error) == null ? void 0 : A.message) || "API 调用被中止",
2595
2595
  code: "INTERCEPTED"
2596
2596
  }), n.complete && n.complete({ success: !1 });
2597
2597
  return;
2598
2598
  }
2599
- const d = qr();
2599
+ const f = Yr();
2600
2600
  if (n.success || n.fail || n.complete) {
2601
- if (this.callbacks.set(d, m(h({}, n), {
2602
- context: f
2601
+ if (this.callbacks.set(f, p(g({}, n), {
2602
+ context: h
2603
2603
  // 保存上下文用于响应拦截
2604
- })), window.qshWebviewCallbacks[d] = (Z) => {
2605
- this.handleCallback(d, Z);
2606
- }, r.isPersistent && (this.persistentCallbacksByApi.has(e) || this.persistentCallbacksByApi.set(e, /* @__PURE__ */ new Set()), this.persistentCallbacksByApi.get(e).add(d)), r.isPersistent || r.disableTimeout)
2604
+ })), window.qshWebviewCallbacks[f] = (ie) => {
2605
+ this.handleCallback(f, ie);
2606
+ }, r.isPersistent && (this.persistentCallbacksByApi.has(e) || this.persistentCallbacksByApi.set(e, /* @__PURE__ */ new Set()), this.persistentCallbacksByApi.get(e).add(f)), r.isPersistent || r.disableTimeout)
2607
2607
  y.info(`API ${e} 禁用超时清理,将等待回调返回后清理`, {
2608
- callbackId: d,
2608
+ callbackId: f,
2609
2609
  isPersistent: r.isPersistent,
2610
2610
  disableTimeout: r.disableTimeout
2611
2611
  });
2612
2612
  else {
2613
- const Z = setTimeout(() => {
2614
- y.warn("API 调用超时,自动清理回调", { api: e, callbackId: d }), n.fail && n.fail({
2613
+ const ie = setTimeout(() => {
2614
+ y.warn("API 调用超时,自动清理回调", { api: e, callbackId: f }), n.fail && n.fail({
2615
2615
  errMsg: `API ${e} 调用超时`,
2616
2616
  code: "TIMEOUT"
2617
- }), this.cleanupCallback(d);
2617
+ }), this.cleanupCallback(f);
2618
2618
  }, r.timeout || this.defaultTimeout);
2619
- this.timeouts.set(d, Z);
2619
+ this.timeouts.set(f, ie);
2620
2620
  }
2621
- const O = {
2621
+ const m = {
2622
2622
  type: "qsh_api_call",
2623
2623
  api: e,
2624
- params: f.params,
2625
- callbackId: d,
2624
+ params: h.params,
2625
+ callbackId: f,
2626
2626
  timestamp: Date.now()
2627
2627
  };
2628
2628
  y.info("发送 API 调用消息", {
2629
2629
  api: e,
2630
- callbackId: d,
2630
+ callbackId: f,
2631
2631
  hasSuccess: !!n.success,
2632
2632
  hasFail: !!n.fail
2633
- }), console.log("message:", JSON.stringify(Vr(O), null, 2)), ce("postMessage", O);
2633
+ }), console.log("message:", JSON.stringify(Hr(m), null, 2)), fe("postMessage", m);
2634
2634
  }
2635
2635
  }), {
2636
2636
  context: "WebViewBridge.callApi",
@@ -2647,16 +2647,16 @@ class Jr {
2647
2647
  handleCallback(e, r) {
2648
2648
  return w(this, null, function* () {
2649
2649
  return u.safeExecute(() => w(this, null, function* () {
2650
- var R, O;
2650
+ var M, m;
2651
2651
  const n = this.callbacks.get(e);
2652
2652
  if (!n) {
2653
2653
  y.warn("未找到回调函数", { callbackId: e });
2654
2654
  return;
2655
2655
  }
2656
- const { success: i, fail: s, complete: c, context: f } = n;
2656
+ const { success: i, fail: s, complete: c, context: h } = n;
2657
2657
  y.debug("处理回调", { callbackId: e, result: r });
2658
- const d = yield z.runResponse(r, f);
2659
- f && W.setApiResult(f.apiName, d), d.success && i ? i(d.data) : !d.success && s && s(d.error || { errMsg: "操作失败" }), c && c(d), ((O = (R = n.context) == null ? void 0 : R.params) == null ? void 0 : O.isPersistent) ? y.debug("持久监听API:保留回调", { callbackId: e }) : (this.cleanupCallback(e), y.debug("回调执行完成,已清理", { callbackId: e }));
2658
+ const f = yield z.runResponse(r, h);
2659
+ h && W.setApiResult(h.apiName, f), f.success && i ? i(f.data) : !f.success && s && s(f.error || { errMsg: "操作失败" }), c && c(f), ((m = (M = n.context) == null ? void 0 : M.params) == null ? void 0 : m.isPersistent) ? y.debug("持久监听API:保留回调", { callbackId: e }) : (this.cleanupCallback(e), y.debug("回调执行完成,已清理", { callbackId: e }));
2660
2660
  }), {
2661
2661
  context: "WebViewBridge.handleCallback",
2662
2662
  callbackId: e
@@ -2709,14 +2709,14 @@ class Jr {
2709
2709
  };
2710
2710
  }
2711
2711
  }
2712
- const ot = new Jr(), P = (t, e, r) => ot.callApi(t, e, r), ee = (t) => ot.cleanupPersistentCallbacksByApi(t);
2713
- function ct() {
2712
+ const ft = new Zr(), P = (t, e, r) => ft.callApi(t, e, r), ee = (t) => ft.cleanupPersistentCallbacksByApi(t);
2713
+ function dt() {
2714
2714
  return ne(!0);
2715
2715
  }
2716
- function jr(t) {
2716
+ function Xr(t) {
2717
2717
  return t === "offline";
2718
2718
  }
2719
- function Hr(t = {}) {
2719
+ function Qr(t = {}) {
2720
2720
  return u.safeExecute(() => {
2721
2721
  a.debug("Call getCode through offline webview bridge", {
2722
2722
  clientId: t.clientId
@@ -2739,13 +2739,13 @@ function Hr(t = {}) {
2739
2739
  );
2740
2740
  }, {
2741
2741
  context: "getCodeInHost",
2742
- platform: ct().type
2742
+ platform: dt().type
2743
2743
  });
2744
2744
  }
2745
- function Yr(t = {}) {
2745
+ function en(t = {}) {
2746
2746
  return u.safeExecute(() => {
2747
2747
  var n, i;
2748
- const e = ct(), r = String((t == null ? void 0 : t.clientId) || "").trim();
2748
+ const e = dt(), r = String((t == null ? void 0 : t.clientId) || "").trim();
2749
2749
  if (!r) {
2750
2750
  const s = {
2751
2751
  errMsg: "clientId is required",
@@ -2754,7 +2754,7 @@ function Yr(t = {}) {
2754
2754
  a.error("Get code missing clientId"), (n = t.fail) == null || n.call(t, s);
2755
2755
  return;
2756
2756
  }
2757
- if (!jr(e.type)) {
2757
+ if (!Xr(e.type)) {
2758
2758
  const s = {
2759
2759
  errMsg: `Current environment (${e.type}) does not support getCode`,
2760
2760
  code: "PLATFORM_NOT_SUPPORTED"
@@ -2764,7 +2764,7 @@ function Yr(t = {}) {
2764
2764
  }), (i = t.fail) == null || i.call(t, s);
2765
2765
  return;
2766
2766
  }
2767
- Hr(m(h({}, t), {
2767
+ Qr(p(g({}, t), {
2768
2768
  clientId: r
2769
2769
  }));
2770
2770
  }, {
@@ -2772,11 +2772,11 @@ function Yr(t = {}) {
2772
2772
  options: t
2773
2773
  });
2774
2774
  }
2775
- function ut() {
2775
+ function gt() {
2776
2776
  return ne(!0);
2777
2777
  }
2778
- const Ge = ["release", "trial", "develop"];
2779
- function Zr(t = {}) {
2778
+ const Je = ["release", "trial", "develop"];
2779
+ function tn(t = {}) {
2780
2780
  const e = String((t == null ? void 0 : t.appid) || "").trim(), r = (t == null ? void 0 : t.path) == null ? "" : t.path, n = t == null ? void 0 : t.env, i = n == null || n === "" ? void 0 : String(n).trim();
2781
2781
  if (!e)
2782
2782
  throw {
@@ -2788,24 +2788,24 @@ function Zr(t = {}) {
2788
2788
  errMsg: "path must be a string",
2789
2789
  code: "PARAM_TYPE_ERROR"
2790
2790
  };
2791
- if (i !== void 0 && !Ge.includes(i))
2791
+ if (i !== void 0 && !Je.includes(i))
2792
2792
  throw {
2793
- errMsg: `env must be one of ${Ge.join("/")}`,
2793
+ errMsg: `env must be one of ${Je.join("/")}`,
2794
2794
  code: "PARAM_INVALID"
2795
2795
  };
2796
- return m(h({}, t), {
2796
+ return p(g({}, t), {
2797
2797
  appid: e,
2798
2798
  path: r.trim(),
2799
2799
  env: i
2800
2800
  });
2801
2801
  }
2802
- function Xr() {
2802
+ function rn() {
2803
2803
  return typeof window != "undefined" && window.wx && window.wx.miniProgram && typeof window.wx.miniProgram.postMessage == "function" && typeof window.wx.miniProgram.navigateBack == "function";
2804
2804
  }
2805
- function Qr(t = {}) {
2805
+ function nn(t = {}) {
2806
2806
  return u.safeExecute(() => {
2807
2807
  var r;
2808
- if (!Xr()) {
2808
+ if (!rn()) {
2809
2809
  const n = {
2810
2810
  errMsg: "wx.miniProgram.postMessage or wx.miniProgram.navigateBack is not available",
2811
2811
  code: "PLATFORM_NOT_SUPPORTED"
@@ -2838,19 +2838,19 @@ function Qr(t = {}) {
2838
2838
  window.wx.miniProgram.navigateBack({
2839
2839
  delta: 1,
2840
2840
  success: (c) => {
2841
- var d;
2842
- const f = m(h({}, c), {
2841
+ var f;
2842
+ const h = p(g({}, c), {
2843
2843
  errMsg: (c == null ? void 0 : c.errMsg) || "navigateToMiniProgram:queued"
2844
2844
  });
2845
2845
  a.info("Navigate to mini program request queued in weixin web-view", {
2846
2846
  appid: t.appid,
2847
2847
  path: t.path,
2848
2848
  env: t.env
2849
- }), (d = t.success) == null || d.call(t, f), n(f);
2849
+ }), (f = t.success) == null || f.call(t, h), n(h);
2850
2850
  },
2851
2851
  fail: (c) => {
2852
- var f;
2853
- a.error("Navigate back after posting mini program message failed", c), (f = t.fail) == null || f.call(t, c), i(c);
2852
+ var h;
2853
+ a.error("Navigate back after posting mini program message failed", c), (h = t.fail) == null || h.call(t, c), i(c);
2854
2854
  },
2855
2855
  complete: t.complete
2856
2856
  });
@@ -2860,7 +2860,7 @@ function Qr(t = {}) {
2860
2860
  platform: "weixin"
2861
2861
  });
2862
2862
  }
2863
- function en(t = {}) {
2863
+ function an(t = {}) {
2864
2864
  return u.safeExecute(() => (a.debug("Call navigateToMiniProgram through webview bridge", {
2865
2865
  appid: t.appid,
2866
2866
  path: t.path,
@@ -2887,16 +2887,16 @@ function en(t = {}) {
2887
2887
  );
2888
2888
  })), {
2889
2889
  context: "navigateToMiniProgramInHost",
2890
- platform: ut().type
2890
+ platform: gt().type
2891
2891
  });
2892
2892
  }
2893
- function tn(t = {}) {
2893
+ function sn(t = {}) {
2894
2894
  return u.safeExecute(() => {
2895
2895
  var n;
2896
- const e = ut();
2896
+ const e = gt();
2897
2897
  let r;
2898
2898
  try {
2899
- r = Zr(t);
2899
+ r = tn(t);
2900
2900
  } catch (i) {
2901
2901
  a.error("Navigate to mini program params validation failed", i), (n = t.fail) == null || n.call(t, i);
2902
2902
  return;
@@ -2906,35 +2906,35 @@ function tn(t = {}) {
2906
2906
  appid: r.appid,
2907
2907
  path: r.path,
2908
2908
  env: r.env
2909
- }), e.isWeixinMiniProgram ? Qr(r) : en(r);
2909
+ }), e.isWeixinMiniProgram ? nn(r) : an(r);
2910
2910
  }, {
2911
2911
  context: "navigateToMiniProgram",
2912
2912
  options: t
2913
2913
  });
2914
2914
  }
2915
- const we = {
2915
+ const Ie = {
2916
2916
  ALBUM: "album",
2917
2917
  // 相册
2918
2918
  CAMERA: "camera"
2919
2919
  // 相机
2920
- }, Ee = {
2920
+ }, Ae = {
2921
2921
  ORIGINAL: "original",
2922
2922
  // 原图
2923
2923
  COMPRESSED: "compressed"
2924
2924
  // 压缩图
2925
- }, rn = {
2925
+ }, on = {
2926
2926
  count: 9,
2927
- sizeType: [Ee.ORIGINAL, Ee.COMPRESSED],
2928
- sourceType: [we.ALBUM, we.CAMERA]
2927
+ sizeType: [Ae.ORIGINAL, Ae.COMPRESSED],
2928
+ sourceType: [Ie.ALBUM, Ie.CAMERA]
2929
2929
  };
2930
- function nn(t = {}) {
2931
- const e = h(h({}, rn), t);
2932
- return Array.isArray(e.sizeType) || (e.sizeType = [e.sizeType].filter(Boolean)), Array.isArray(e.sourceType) || (e.sourceType = [e.sourceType].filter(Boolean)), e.count = Math.max(1, Math.min(9, parseInt(e.count) || 1)), e.sizeType.length === 0 && (e.sizeType = [Ee.COMPRESSED]), e.sourceType.length === 0 && (e.sourceType = [we.ALBUM]), e;
2930
+ function cn(t = {}) {
2931
+ const e = g(g({}, on), t);
2932
+ return Array.isArray(e.sizeType) || (e.sizeType = [e.sizeType].filter(Boolean)), Array.isArray(e.sourceType) || (e.sourceType = [e.sourceType].filter(Boolean)), e.count = Math.max(1, Math.min(9, parseInt(e.count) || 1)), e.sizeType.length === 0 && (e.sizeType = [Ae.COMPRESSED]), e.sourceType.length === 0 && (e.sourceType = [Ie.ALBUM]), e;
2933
2933
  }
2934
- function lt() {
2934
+ function ht() {
2935
2935
  return ["weixin", "webview", "UniApp", "plus", "nvue", "uvue", "offline"].includes(l.type);
2936
2936
  }
2937
- function ft(t) {
2937
+ function mt(t) {
2938
2938
  return u.safeExecute(() => {
2939
2939
  var e;
2940
2940
  if (!window.wx) {
@@ -2946,7 +2946,7 @@ function ft(t) {
2946
2946
  return;
2947
2947
  }
2948
2948
  if (!j()) {
2949
- a.info("等待微信配置完成"), G().then(() => ft(t)).catch((r) => {
2949
+ a.info("等待微信配置完成"), K().then(() => mt(t)).catch((r) => {
2950
2950
  var n;
2951
2951
  a.error("微信配置失败", r), (n = t.fail) == null || n.call(t, { errMsg: `微信配置失败: ${r.message}` });
2952
2952
  });
@@ -2971,9 +2971,9 @@ function ft(t) {
2971
2971
  platform: "weixin"
2972
2972
  });
2973
2973
  }
2974
- function an(t) {
2974
+ function un(t) {
2975
2975
  return u.safeExecute(() => {
2976
- a.debug("通过 WebView 桥接调用图片选择", t), P("chooseImage", m(h({}, t), { disableTimeout: !0 }), {
2976
+ a.debug("通过 WebView 桥接调用图片选择", t), P("chooseImage", p(g({}, t), { disableTimeout: !0 }), {
2977
2977
  success: (e) => {
2978
2978
  var r, n;
2979
2979
  a.info("UniApp 图片选择成功", {
@@ -2991,10 +2991,10 @@ function an(t) {
2991
2991
  platform: "uniapp"
2992
2992
  });
2993
2993
  }
2994
- function sn(t = {}) {
2994
+ function ln(t = {}) {
2995
2995
  return u.safeExecute(() => {
2996
2996
  var r;
2997
- if (!lt()) {
2997
+ if (!ht()) {
2998
2998
  const n = {
2999
2999
  errMsg: `当前环境 (${l.type}) 不支持图片选择功能`,
3000
3000
  code: "PLATFORM_NOT_SUPPORTED"
@@ -3002,21 +3002,21 @@ function sn(t = {}) {
3002
3002
  a.error("平台不支持图片选择", { platform: l.type }), (r = t.fail) == null || r.call(t, n);
3003
3003
  return;
3004
3004
  }
3005
- const e = nn(t);
3005
+ const e = cn(t);
3006
3006
  a.info("开始选择图片", {
3007
3007
  platform: l.type,
3008
3008
  count: e.count,
3009
3009
  sizeType: e.sizeType,
3010
3010
  sourceType: e.sourceType
3011
- }), C() ? ft(e) : an(e);
3011
+ }), C() ? mt(e) : un(e);
3012
3012
  }, {
3013
3013
  context: "chooseImage",
3014
3014
  options: t
3015
3015
  });
3016
3016
  }
3017
- function on() {
3017
+ function fn() {
3018
3018
  return {
3019
- supported: lt(),
3019
+ supported: ht(),
3020
3020
  environment: l.type,
3021
3021
  implementation: C() ? "weixin" : "webview",
3022
3022
  features: {
@@ -3040,20 +3040,20 @@ const q = {
3040
3040
  // Data Matrix 码
3041
3041
  PDF417: "pdf417"
3042
3042
  // PDF417 条码
3043
- }, cn = {
3043
+ }, dn = {
3044
3044
  onlyFromCamera: !0,
3045
3045
  // 只从相机扫码
3046
3046
  scanType: [q.QR_CODE, q.BAR_CODE]
3047
3047
  // 支持二维码和一维码
3048
3048
  };
3049
- function un(t = {}) {
3050
- const e = h(h({}, cn), t);
3049
+ function gn(t = {}) {
3050
+ const e = g(g({}, dn), t);
3051
3051
  return Array.isArray(e.scanType) || (e.scanType = [e.scanType].filter(Boolean)), e.scanType.length === 0 && (e.scanType = [q.QR_CODE, q.BAR_CODE]), e.onlyFromCamera = !!e.onlyFromCamera, e;
3052
3052
  }
3053
- function dt() {
3053
+ function pt() {
3054
3054
  return ["weixin", "webview", "UniApp", "plus", "nvue", "uvue", "offline"].includes(l.type);
3055
3055
  }
3056
- function gt(t) {
3056
+ function wt(t) {
3057
3057
  return u.safeExecute(() => {
3058
3058
  var e;
3059
3059
  if (!window.wx) {
@@ -3065,7 +3065,7 @@ function gt(t) {
3065
3065
  return;
3066
3066
  }
3067
3067
  if (!j()) {
3068
- a.info("等待微信配置完成"), G().then(() => gt(t)).catch((r) => {
3068
+ a.info("等待微信配置完成"), K().then(() => wt(t)).catch((r) => {
3069
3069
  var n;
3070
3070
  a.error("微信配置失败", r), (n = t.fail) == null || n.call(t, { errMsg: `微信配置失败: ${r.message}` });
3071
3071
  });
@@ -3081,7 +3081,7 @@ function gt(t) {
3081
3081
  const n = {
3082
3082
  result: r.resultStr,
3083
3083
  // 扫码内容
3084
- scanType: ln(r.resultStr),
3084
+ scanType: hn(r.resultStr),
3085
3085
  // 推测扫码类型
3086
3086
  charSet: "utf-8",
3087
3087
  // 微信默认 UTF-8
@@ -3100,12 +3100,12 @@ function gt(t) {
3100
3100
  platform: "weixin"
3101
3101
  });
3102
3102
  }
3103
- function ln(t) {
3103
+ function hn(t) {
3104
3104
  return t ? t.length > 50 || /[^\d]/.test(t) ? q.QR_CODE : q.BAR_CODE : "unknown";
3105
3105
  }
3106
- function fn(t) {
3106
+ function mn(t) {
3107
3107
  return u.safeExecute(() => {
3108
- a.debug("通过 WebView 桥接调用扫码", t), P("scanCode", m(h({}, t), { disableTimeout: !0 }), {
3108
+ a.debug("通过 WebView 桥接调用扫码", t), P("scanCode", p(g({}, t), { disableTimeout: !0 }), {
3109
3109
  success: (e) => {
3110
3110
  var r;
3111
3111
  a.info("UniApp 扫码成功", {
@@ -3124,10 +3124,10 @@ function fn(t) {
3124
3124
  platform: "uniapp"
3125
3125
  });
3126
3126
  }
3127
- function dn(t = {}) {
3127
+ function pn(t = {}) {
3128
3128
  return u.safeExecute(() => {
3129
3129
  var r;
3130
- if (!dt()) {
3130
+ if (!pt()) {
3131
3131
  const n = {
3132
3132
  errMsg: `当前环境 (${l.type}) 不支持扫码功能`,
3133
3133
  code: "PLATFORM_NOT_SUPPORTED"
@@ -3135,20 +3135,20 @@ function dn(t = {}) {
3135
3135
  a.error("平台不支持扫码", { platform: l.type }), (r = t.fail) == null || r.call(t, n);
3136
3136
  return;
3137
3137
  }
3138
- const e = un(t);
3138
+ const e = gn(t);
3139
3139
  a.info("开始扫码", {
3140
3140
  platform: l.type,
3141
3141
  onlyFromCamera: e.onlyFromCamera,
3142
3142
  scanType: e.scanType
3143
- }), C() ? gt(e) : fn(e);
3143
+ }), C() ? wt(e) : mn(e);
3144
3144
  }, {
3145
3145
  context: "scanCode",
3146
3146
  options: t
3147
3147
  });
3148
3148
  }
3149
- function gn() {
3149
+ function wn() {
3150
3150
  return {
3151
- supported: dt(),
3151
+ supported: pt(),
3152
3152
  environment: l.type,
3153
3153
  implementation: C() ? "weixin" : "webview",
3154
3154
  features: {
@@ -3170,23 +3170,23 @@ const te = {
3170
3170
  // 国测局坐标(火星坐标)
3171
3171
  BD09: "bd09"
3172
3172
  // 百度坐标
3173
- }, hn = {
3173
+ }, En = {
3174
3174
  type: te.WGS84,
3175
3175
  altitude: !1
3176
- }, mn = {
3176
+ }, yn = {
3177
3177
  scale: 18
3178
3178
  // 地图缩放级别 1-28
3179
3179
  };
3180
- function pn(t = {}) {
3181
- const e = h(h({}, hn), t);
3180
+ function In(t = {}) {
3181
+ const e = g(g({}, En), t);
3182
3182
  return Object.values(te).includes(e.type) || (e.type = te.WGS84), e.altitude = !!e.altitude, e;
3183
3183
  }
3184
- function wn(t = {}) {
3185
- const e = h({}, t);
3184
+ function An(t = {}) {
3185
+ const e = g({}, t);
3186
3186
  return Object.values(te).includes(e.type) || (e.type = te.WGS84), e.needFullAccuracy = !!e.needFullAccuracy, e;
3187
3187
  }
3188
- function En(t = {}) {
3189
- const e = h(h({}, mn), t);
3188
+ function _n(t = {}) {
3189
+ const e = g(g({}, yn), t);
3190
3190
  if (e.latitude === void 0 || e.latitude === null)
3191
3191
  throw {
3192
3192
  errMsg: "缺少必需参数:latitude(纬度)",
@@ -3245,10 +3245,10 @@ function En(t = {}) {
3245
3245
  }
3246
3246
  return e;
3247
3247
  }
3248
- function Le() {
3248
+ function xe() {
3249
3249
  return ["weixin", "webview", "UniApp", "plus", "nvue", "uvue", "offline"].includes(l.type);
3250
3250
  }
3251
- function ht(t) {
3251
+ function Et(t) {
3252
3252
  return u.safeExecute(() => {
3253
3253
  var e;
3254
3254
  if (!window.wx) {
@@ -3260,7 +3260,7 @@ function ht(t) {
3260
3260
  return;
3261
3261
  }
3262
3262
  if (!j()) {
3263
- a.info("等待微信配置完成"), G().then(() => ht(t)).catch((r) => {
3263
+ a.info("等待微信配置完成"), K().then(() => Et(t)).catch((r) => {
3264
3264
  var n;
3265
3265
  a.error("微信配置失败", r), (n = t.fail) == null || n.call(t, { errMsg: `微信配置失败: ${r.message}` });
3266
3266
  });
@@ -3286,7 +3286,7 @@ function ht(t) {
3286
3286
  platform: "weixin"
3287
3287
  });
3288
3288
  }
3289
- function mt(t) {
3289
+ function yt(t) {
3290
3290
  return u.safeExecute(() => {
3291
3291
  var e;
3292
3292
  if (!window.wx) {
@@ -3298,7 +3298,7 @@ function mt(t) {
3298
3298
  return;
3299
3299
  }
3300
3300
  if (!j()) {
3301
- a.info("等待微信配置完成"), G().then(() => mt(t)).catch((r) => {
3301
+ a.info("等待微信配置完成"), K().then(() => yt(t)).catch((r) => {
3302
3302
  var n;
3303
3303
  a.error("微信配置失败", r), (n = t.fail) == null || n.call(t, { errMsg: `微信配置失败: ${r.message}` });
3304
3304
  });
@@ -3326,7 +3326,7 @@ function mt(t) {
3326
3326
  platform: "weixin"
3327
3327
  });
3328
3328
  }
3329
- function yn(t) {
3329
+ function Cn(t) {
3330
3330
  return u.safeExecute(() => {
3331
3331
  a.debug("通过 WebView 桥接调用获取位置", t), P("getLocation", t, {
3332
3332
  success: (e) => {
@@ -3347,7 +3347,7 @@ function yn(t) {
3347
3347
  platform: "uniapp"
3348
3348
  });
3349
3349
  }
3350
- function In(t) {
3350
+ function On(t) {
3351
3351
  return u.safeExecute(() => {
3352
3352
  a.debug("通过 WebView 桥接调用查看位置", t), P("openLocation", t, {
3353
3353
  success: (e) => {
@@ -3365,10 +3365,10 @@ function In(t) {
3365
3365
  platform: "uniapp"
3366
3366
  });
3367
3367
  }
3368
- function An(t = {}) {
3368
+ function Pn(t = {}) {
3369
3369
  return u.safeExecute(() => {
3370
3370
  var r;
3371
- if (!Le()) {
3371
+ if (!xe()) {
3372
3372
  const n = {
3373
3373
  errMsg: `当前环境 (${l.type}) 不支持定位功能`,
3374
3374
  code: "PLATFORM_NOT_SUPPORTED"
@@ -3376,21 +3376,21 @@ function An(t = {}) {
3376
3376
  a.error("平台不支持定位", { platform: l.type }), (r = t.fail) == null || r.call(t, n);
3377
3377
  return;
3378
3378
  }
3379
- const e = pn(t);
3379
+ const e = In(t);
3380
3380
  a.info("开始获取位置", {
3381
3381
  platform: l.type,
3382
3382
  type: e.type,
3383
3383
  altitude: e.altitude
3384
- }), C() ? ht(e) : yn(e);
3384
+ }), C() ? Et(e) : Cn(e);
3385
3385
  }, {
3386
3386
  context: "getLocation",
3387
3387
  options: t
3388
3388
  });
3389
3389
  }
3390
- function Cn(t = {}) {
3390
+ function Rn(t = {}) {
3391
3391
  return u.safeExecute(() => {
3392
3392
  var r, n, i;
3393
- if (!Le()) {
3393
+ if (!xe()) {
3394
3394
  const s = {
3395
3395
  errMsg: `当前环境 (${l.type}) 不支持查看位置功能`,
3396
3396
  code: "PLATFORM_NOT_SUPPORTED"
@@ -3400,7 +3400,7 @@ function Cn(t = {}) {
3400
3400
  }
3401
3401
  let e;
3402
3402
  try {
3403
- e = En(t);
3403
+ e = _n(t);
3404
3404
  } catch (s) {
3405
3405
  a.error("参数验证失败", s), (n = t.fail) == null || n.call(t, s), (i = t.complete) == null || i.call(t);
3406
3406
  return;
@@ -3410,16 +3410,16 @@ function Cn(t = {}) {
3410
3410
  latitude: e.latitude,
3411
3411
  longitude: e.longitude,
3412
3412
  name: e.name
3413
- }), C() ? mt(e) : In(e);
3413
+ }), C() ? yt(e) : On(e);
3414
3414
  }, {
3415
3415
  context: "openLocation",
3416
3416
  options: t
3417
3417
  });
3418
3418
  }
3419
- function _n() {
3419
+ function Nn() {
3420
3420
  const t = C();
3421
3421
  return {
3422
- supported: Le(),
3422
+ supported: xe(),
3423
3423
  environment: l.type,
3424
3424
  implementation: t ? "weixin" : "webview",
3425
3425
  features: {
@@ -3438,8 +3438,8 @@ function _n() {
3438
3438
  }
3439
3439
  };
3440
3440
  }
3441
- const k = /* @__PURE__ */ new Set(), K = /* @__PURE__ */ new Set();
3442
- function pt(t, e, r) {
3441
+ const k = /* @__PURE__ */ new Set(), G = /* @__PURE__ */ new Set();
3442
+ function It(t, e, r) {
3443
3443
  t.forEach((n) => {
3444
3444
  if (typeof n == "function") {
3445
3445
  u.safeExecute(() => n(e), { context: r });
@@ -3448,7 +3448,7 @@ function pt(t, e, r) {
3448
3448
  a.warn("监听回调不是函数,已跳过", { type: typeof n });
3449
3449
  });
3450
3450
  }
3451
- function On(t = {}) {
3451
+ function Mn(t = {}) {
3452
3452
  return u.safeExecute(() => {
3453
3453
  var r, n;
3454
3454
  if (C()) {
@@ -3459,7 +3459,7 @@ function On(t = {}) {
3459
3459
  a.error("当前环境不支持此接口", { platform: l.type }), (r = t.fail) == null || r.call(t, i), (n = t.complete) == null || n.call(t, i);
3460
3460
  return;
3461
3461
  }
3462
- const e = wn(t);
3462
+ const e = An(t);
3463
3463
  a.info("正在开启定位监听"), P("startLocationUpdate", {
3464
3464
  type: e.type,
3465
3465
  needFullAccuracy: e.needFullAccuracy
@@ -3476,7 +3476,7 @@ function On(t = {}) {
3476
3476
  });
3477
3477
  }, { context: "startLocationUpdate" });
3478
3478
  }
3479
- function Pn(t = {}) {
3479
+ function Sn(t = {}) {
3480
3480
  return u.safeExecute(() => {
3481
3481
  var e, r;
3482
3482
  if (C()) {
@@ -3500,7 +3500,7 @@ function Pn(t = {}) {
3500
3500
  });
3501
3501
  }, { context: "stopLocationUpdate" });
3502
3502
  }
3503
- function Rn(t) {
3503
+ function Tn(t) {
3504
3504
  return u.safeExecute(() => {
3505
3505
  if (C()) {
3506
3506
  a.warn("当前环境不支持此接口", { platform: l.type });
@@ -3514,7 +3514,7 @@ function Rn(t) {
3514
3514
  const e = k.size > 0;
3515
3515
  k.add(t), e || (a.debug("注册实时位置变化监听器"), P("onLocationChange", { isPersistent: !0 }, {
3516
3516
  success: (r) => {
3517
- a.debug("收到实时位置推送", r), pt(k, r, "onLocationChange");
3517
+ a.debug("收到实时位置推送", r), It(k, r, "onLocationChange");
3518
3518
  },
3519
3519
  fail: (r) => {
3520
3520
  a.warn("位置变化监听出错,请通过 onLocationChangeError 监听错误", r), k.delete(t), k.size === 0 && ee("onLocationChange");
@@ -3522,7 +3522,7 @@ function Rn(t) {
3522
3522
  }));
3523
3523
  }, { context: "onLocationChange" });
3524
3524
  }
3525
- function Nn(t) {
3525
+ function Ln(t) {
3526
3526
  return u.safeExecute(() => {
3527
3527
  if (C()) {
3528
3528
  a.warn("当前环境不支持此接口", { platform: l.type });
@@ -3543,7 +3543,7 @@ function Nn(t) {
3543
3543
  }));
3544
3544
  }, { context: "offLocationChange" });
3545
3545
  }
3546
- function Mn(t) {
3546
+ function bn(t) {
3547
3547
  return u.safeExecute(() => {
3548
3548
  if (C()) {
3549
3549
  a.warn("当前环境不支持此接口", { platform: l.type });
@@ -3554,18 +3554,18 @@ function Mn(t) {
3554
3554
  errMsg: "onLocationChangeError 回调必须是函数",
3555
3555
  code: "INVALID_CALLBACK"
3556
3556
  };
3557
- const e = K.size > 0;
3558
- K.add(t), e || (a.debug("注册位置更新错误监听器"), P("onLocationChangeError", { isPersistent: !0 }, {
3557
+ const e = G.size > 0;
3558
+ G.add(t), e || (a.debug("注册位置更新错误监听器"), P("onLocationChangeError", { isPersistent: !0 }, {
3559
3559
  success: (r) => {
3560
- a.warn("持续定位发生异常", r), pt(K, r, "onLocationChangeError");
3560
+ a.warn("持续定位发生异常", r), It(G, r, "onLocationChangeError");
3561
3561
  },
3562
3562
  fail: (r) => {
3563
- a.warn("位置更新错误监听注册失败", r), K.delete(t), K.size === 0 && ee("onLocationChangeError");
3563
+ a.warn("位置更新错误监听注册失败", r), G.delete(t), G.size === 0 && ee("onLocationChangeError");
3564
3564
  }
3565
3565
  }));
3566
3566
  }, { context: "onLocationChangeError" });
3567
3567
  }
3568
- function Sn(t) {
3568
+ function vn(t) {
3569
3569
  return u.safeExecute(() => {
3570
3570
  if (C()) {
3571
3571
  a.warn("当前环境不支持此接口", { platform: l.type });
@@ -3576,7 +3576,7 @@ function Sn(t) {
3576
3576
  errMsg: "offLocationChangeError 回调必须是函数",
3577
3577
  code: "INVALID_CALLBACK"
3578
3578
  };
3579
- t ? K.delete(t) : K.clear(), !(K.size > 0) && (a.info("移除定位错误监听器"), P("offLocationChangeError", {}, {
3579
+ t ? G.delete(t) : G.clear(), !(G.size > 0) && (a.info("移除定位错误监听器"), P("offLocationChangeError", {}, {
3580
3580
  success: () => {
3581
3581
  a.info("定位错误监听已移除"), ee("onLocationChangeError");
3582
3582
  },
@@ -3586,14 +3586,14 @@ function Sn(t) {
3586
3586
  }));
3587
3587
  }, { context: "offLocationChangeError" });
3588
3588
  }
3589
- const Tn = {
3589
+ const xn = {
3590
3590
  latitude: null,
3591
3591
  // 目标地纬度
3592
3592
  longitude: null
3593
3593
  // 目标地经度
3594
3594
  };
3595
- function Ln(t = {}) {
3596
- const e = h(h({}, Tn), t);
3595
+ function Dn(t = {}) {
3596
+ const e = g(g({}, xn), t);
3597
3597
  return e.latitude !== null && e.latitude !== void 0 && (typeof e.latitude != "number" ? (a.warn("latitude 参数类型错误,已忽略", {
3598
3598
  latitude: e.latitude
3599
3599
  }), e.latitude = null) : (e.latitude < -90 || e.latitude > 90) && (a.warn("latitude 超出范围,已忽略", {
@@ -3604,10 +3604,10 @@ function Ln(t = {}) {
3604
3604
  longitude: e.longitude
3605
3605
  }), e.longitude = null)), e;
3606
3606
  }
3607
- function wt() {
3607
+ function At() {
3608
3608
  return ["weixin", "webview", "UniApp", "plus", "nvue", "uvue", "offline"].includes(l.type);
3609
3609
  }
3610
- function Et(t) {
3610
+ function _t(t) {
3611
3611
  return u.safeExecute(() => {
3612
3612
  var n;
3613
3613
  if (!window.wx) {
@@ -3619,7 +3619,7 @@ function Et(t) {
3619
3619
  return;
3620
3620
  }
3621
3621
  if (!j()) {
3622
- a.info("等待微信配置完成"), G().then(() => Et(t)).catch((i) => {
3622
+ a.info("等待微信配置完成"), K().then(() => _t(t)).catch((i) => {
3623
3623
  var s;
3624
3624
  a.error("微信配置失败", i), (s = t.fail) == null || s.call(t, { errMsg: `微信配置失败: ${i.message}` });
3625
3625
  });
@@ -3654,7 +3654,7 @@ function Et(t) {
3654
3654
  },
3655
3655
  complete: t.complete
3656
3656
  }, r = {};
3657
- t.latitude !== null && t.latitude !== void 0 && (r.latitude = t.latitude), t.longitude !== null && t.longitude !== void 0 && (r.longitude = t.longitude), window.wx.chooseLocation(m(h({}, r), {
3657
+ t.latitude !== null && t.latitude !== void 0 && (r.latitude = t.latitude), t.longitude !== null && t.longitude !== void 0 && (r.longitude = t.longitude), window.wx.chooseLocation(p(g({}, r), {
3658
3658
  success: e.success,
3659
3659
  fail: e.fail,
3660
3660
  complete: e.complete
@@ -3664,7 +3664,7 @@ function Et(t) {
3664
3664
  platform: "weixin"
3665
3665
  });
3666
3666
  }
3667
- function bn(t) {
3667
+ function Un(t) {
3668
3668
  return u.safeExecute(() => {
3669
3669
  a.debug("通过 WebView 桥接调用位置选择", t);
3670
3670
  const e = {
@@ -3699,10 +3699,10 @@ function bn(t) {
3699
3699
  platform: "uniapp"
3700
3700
  });
3701
3701
  }
3702
- function vn(t = {}) {
3702
+ function Wn(t = {}) {
3703
3703
  return u.safeExecute(() => {
3704
3704
  var r;
3705
- if (!wt()) {
3705
+ if (!At()) {
3706
3706
  const n = {
3707
3707
  errMsg: `当前环境 (${l.type}) 不支持位置选择功能`,
3708
3708
  code: "PLATFORM_NOT_SUPPORTED"
@@ -3710,20 +3710,20 @@ function vn(t = {}) {
3710
3710
  a.error("平台不支持位置选择", { platform: l.type }), (r = t.fail) == null || r.call(t, n);
3711
3711
  return;
3712
3712
  }
3713
- const e = Ln(t);
3713
+ const e = Dn(t);
3714
3714
  a.info("开始选择位置", {
3715
3715
  platform: l.type,
3716
3716
  latitude: e.latitude,
3717
3717
  longitude: e.longitude
3718
- }), C() ? Et(e) : bn(e);
3718
+ }), C() ? _t(e) : Un(e);
3719
3719
  }, {
3720
3720
  context: "chooseLocation",
3721
3721
  options: t
3722
3722
  });
3723
3723
  }
3724
- function xn() {
3724
+ function $n() {
3725
3725
  return {
3726
- supported: wt(),
3726
+ supported: At(),
3727
3727
  environment: l.type,
3728
3728
  implementation: C() ? "weixin" : "webview",
3729
3729
  features: {
@@ -3736,13 +3736,13 @@ function xn() {
3736
3736
  }
3737
3737
  };
3738
3738
  }
3739
- function Dn(t) {
3739
+ function Fn(t) {
3740
3740
  return t === "timeline" || Number(t) === 1 ? 1 : 0;
3741
3741
  }
3742
- function Un(t = {}) {
3742
+ function Bn(t = {}) {
3743
3743
  if (!t || typeof t != "object")
3744
3744
  throw { errMsg: "shareDirected 参数必须是对象", code: "PARAM_TYPE_ERROR" };
3745
- const e = String(t.kind || "").trim(), r = t.payload || {}, n = Dn(t.scene);
3745
+ const e = String(t.kind || "").trim(), r = t.payload || {}, n = Fn(t.scene);
3746
3746
  if (!["web", "image", "text"].includes(e))
3747
3747
  throw { errMsg: 'shareDirected: kind 仅支持 "web"|"image"|"text"', code: "PARAM_INVALID" };
3748
3748
  if (e === "web") {
@@ -3764,27 +3764,58 @@ function Un(t = {}) {
3764
3764
  complete: t.complete
3765
3765
  };
3766
3766
  }
3767
- function Wn(t) {
3767
+ function kn(t) {
3768
3768
  return t.isWeixinMiniProgram ? "已同步分享内容,请点击右上角“···”选择发送给朋友或分享到朋友圈。" : "正在拉起微信分享面板,请选择聊天框或朋友圈。";
3769
3769
  }
3770
- function yt(t = {}) {
3770
+ function Gn(t) {
3771
+ return {
3772
+ type: "qsh_api_call",
3773
+ api: "shareDirected",
3774
+ params: {
3775
+ kind: t.kind,
3776
+ scene: t.scene,
3777
+ payload: t.payload
3778
+ },
3779
+ timestamp: Date.now()
3780
+ };
3781
+ }
3782
+ function Kn(t) {
3783
+ const e = typeof window != "undefined" && window.wx && window.wx.miniProgram;
3784
+ if (!e || typeof e.postMessage != "function")
3785
+ throw {
3786
+ errMsg: "当前微信小程序容器未注入 postMessage 能力,无法发起 shareDirected",
3787
+ code: "MINIPROGRAM_BRIDGE_UNAVAILABLE"
3788
+ };
3789
+ e.postMessage({
3790
+ data: [t]
3791
+ });
3792
+ }
3793
+ function Ct(t = {}) {
3771
3794
  return u.safeExecute(() => {
3772
- var i, s, c;
3795
+ var i, s, c, h, f, A, M;
3773
3796
  let e;
3774
3797
  try {
3775
- e = Un(t);
3776
- } catch (f) {
3777
- return (i = t.fail) == null || i.call(t, f), Promise.reject(f);
3798
+ e = Bn(t);
3799
+ } catch (m) {
3800
+ return (i = t.fail) == null || i.call(t, m), Promise.reject(m);
3778
3801
  }
3779
- const r = ne(!0), n = Wn(r);
3780
- if (r.type === "h5" && !r.isUniAppWebView && !r.isOfflineWebview && !r.isWeixinMiniProgram) {
3781
- const f = {
3802
+ const r = ne(!0), n = kn(r);
3803
+ if (r.isWeixinMiniProgram)
3804
+ try {
3805
+ Kn(Gn(e));
3806
+ const m = { success: !0, hint: n };
3807
+ return (s = e.success) == null || s.call(e, m), (c = e.complete) == null || c.call(e, m), Promise.resolve(m);
3808
+ } catch (m) {
3809
+ return (h = e.fail) == null || h.call(e, m), (f = e.complete) == null || f.call(e, m), Promise.reject(m);
3810
+ }
3811
+ if (r.type === "h5" && !r.isUniAppWebView && !r.isOfflineWebview) {
3812
+ const m = {
3782
3813
  errMsg: "当前页面不在宿主 WebView 中,无法分享。请在 unified-platform-app 内打开该 H5 再重试。",
3783
3814
  code: "NOT_IN_CONTAINER"
3784
3815
  };
3785
- return (s = e.fail) == null || s.call(e, f), (c = e.complete) == null || c.call(e, f), Promise.reject(f);
3816
+ return (A = e.fail) == null || A.call(e, m), (M = e.complete) == null || M.call(e, m), Promise.reject(m);
3786
3817
  }
3787
- return new Promise((f, d) => {
3818
+ return new Promise((m, ie) => {
3788
3819
  P(
3789
3820
  "shareDirected",
3790
3821
  {
@@ -3793,14 +3824,14 @@ function yt(t = {}) {
3793
3824
  payload: e.payload
3794
3825
  },
3795
3826
  {
3796
- success: (p) => {
3797
- var O, Z;
3798
- const R = m(h({}, p), { hint: n });
3799
- (O = e.success) == null || O.call(e, R), (Z = e.complete) == null || Z.call(e, R), f(R);
3827
+ success: (ae) => {
3828
+ var se, Ge;
3829
+ const Z = p(g({}, ae), { hint: n });
3830
+ (se = e.success) == null || se.call(e, Z), (Ge = e.complete) == null || Ge.call(e, Z), m(Z);
3800
3831
  },
3801
- fail: (p) => {
3802
- var R, O;
3803
- (R = e.fail) == null || R.call(e, p), (O = e.complete) == null || O.call(e, p), d(p);
3832
+ fail: (ae) => {
3833
+ var Z, se;
3834
+ (Z = e.fail) == null || Z.call(e, ae), (se = e.complete) == null || se.call(e, ae), ie(ae);
3804
3835
  }
3805
3836
  }
3806
3837
  );
@@ -3810,15 +3841,15 @@ function yt(t = {}) {
3810
3841
  options: t
3811
3842
  });
3812
3843
  }
3813
- function $n(t = {}) {
3844
+ function zn(t = {}) {
3814
3845
  return new Promise((e, r) => {
3815
- yt(m(h({}, t), {
3846
+ Ct(p(g({}, t), {
3816
3847
  success: e,
3817
3848
  fail: r
3818
3849
  }));
3819
3850
  });
3820
3851
  }
3821
- const Fn = {
3852
+ const Vn = {
3822
3853
  OFF: "off",
3823
3854
  // 蓝牙关闭
3824
3855
  ON: "on",
@@ -3827,19 +3858,19 @@ const Fn = {
3827
3858
  // 不支持蓝牙
3828
3859
  UNAUTHORIZED: "unauthorized"
3829
3860
  // 未授权
3830
- }, Bn = {
3861
+ }, qn = {
3831
3862
  allowDuplicatesKey: !1,
3832
3863
  // 是否允许重复上报同一设备
3833
3864
  services: []
3834
3865
  // 指定服务 UUID 列表
3835
3866
  };
3836
- function _e(t = {}) {
3837
- return h(h({}, Bn), t);
3867
+ function Re(t = {}) {
3868
+ return g(g({}, qn), t);
3838
3869
  }
3839
- function fe() {
3870
+ function he() {
3840
3871
  return ["weixin", "webview", "UniApp", "plus", "nvue", "uvue", "offline"].includes(l.type);
3841
3872
  }
3842
- function kn(t) {
3873
+ function Jn(t) {
3843
3874
  return u.safeExecute(() => w(null, null, function* () {
3844
3875
  var e;
3845
3876
  if (!window.wx) {
@@ -3847,9 +3878,9 @@ function kn(t) {
3847
3878
  (e = t.fail) == null || e.call(t, r);
3848
3879
  return;
3849
3880
  }
3850
- j() || (a.info("等待微信配置完成"), yield G()), wx.openBluetoothAdapter({
3881
+ j() || (a.info("等待微信配置完成"), yield K()), wx.openBluetoothAdapter({
3851
3882
  success: () => {
3852
- a.info("微信蓝牙适配器已打开"), It(t);
3883
+ a.info("微信蓝牙适配器已打开"), Ot(t);
3853
3884
  },
3854
3885
  fail: (r) => {
3855
3886
  var n;
@@ -3858,7 +3889,7 @@ function kn(t) {
3858
3889
  });
3859
3890
  }), { context: "openBluetoothAdapterInWeixin" });
3860
3891
  }
3861
- function Kn(t) {
3892
+ function jn(t) {
3862
3893
  return u.safeExecute(() => {
3863
3894
  a.debug("通过 WebView 桥接调用蓝牙功能", t), P("bluetooth", t, {
3864
3895
  success: (e) => {
@@ -3873,7 +3904,7 @@ function Kn(t) {
3873
3904
  });
3874
3905
  }, { context: "bluetoothInUniApp" });
3875
3906
  }
3876
- function Gn(t) {
3907
+ function Hn(t) {
3877
3908
  return u.safeExecute(() => {
3878
3909
  var e;
3879
3910
  a.debug("通过 WebView 桥接调用蓝牙设备搜索功能", t), P("bluetoothDevicesDiscovery", {
@@ -3895,11 +3926,11 @@ function Gn(t) {
3895
3926
  });
3896
3927
  }, { context: "startBluetoothDevicesDiscoveryInUniApp" });
3897
3928
  }
3898
- const ge = /* @__PURE__ */ new Set();
3899
- function zn(t, e = {}) {
3929
+ const pe = /* @__PURE__ */ new Set();
3930
+ function Yn(t, e = {}) {
3900
3931
  return u.safeExecute(() => {
3901
3932
  var r;
3902
- return ge.add(t), ge.size === 1 && P("onBluetoothDeviceFound", {
3933
+ return pe.add(t), pe.size === 1 && P("onBluetoothDeviceFound", {
3903
3934
  action: "onBluetoothDeviceFound",
3904
3935
  isPersistent: !0,
3905
3936
  params: {
@@ -3908,7 +3939,7 @@ function zn(t, e = {}) {
3908
3939
  }
3909
3940
  }, {
3910
3941
  success: (n) => {
3911
- ge.forEach((i) => {
3942
+ pe.forEach((i) => {
3912
3943
  typeof i == "function" ? u.safeExecute(() => i(n), { context: "BluetoothDeviceCallback" }) : console.warn("[BluetoothDeviceCallback] 不是函数:", i);
3913
3944
  });
3914
3945
  },
@@ -3917,10 +3948,10 @@ function zn(t, e = {}) {
3917
3948
  console.error("[Bluetooth] 搜索失败:", n), (i = e.fail) == null || i.call(e, n);
3918
3949
  },
3919
3950
  complete: e.complete
3920
- }), () => ge.delete(t);
3951
+ }), () => pe.delete(t);
3921
3952
  }, { context: "qsh_onBluetoothDeviceFound" });
3922
3953
  }
3923
- function Vn(t) {
3954
+ function Zn(t) {
3924
3955
  return u.safeExecute(() => {
3925
3956
  var e;
3926
3957
  a.debug("通过 WebView 桥接调用蓝牙连接功能", t), P("bluetoothConnection", {
@@ -3943,10 +3974,10 @@ function Vn(t) {
3943
3974
  });
3944
3975
  }, { context: "createBLEConnectionInUniApp" });
3945
3976
  }
3946
- function qn(t = {}) {
3977
+ function Xn(t = {}) {
3947
3978
  return u.safeExecute(() => {
3948
3979
  var r;
3949
- if (!fe()) {
3980
+ if (!he()) {
3950
3981
  const n = {
3951
3982
  errMsg: `当前环境 (${l.type}) 不支持蓝牙功能`,
3952
3983
  code: "PLATFORM_NOT_SUPPORTED"
@@ -3954,18 +3985,18 @@ function qn(t = {}) {
3954
3985
  a.error("平台不支持蓝牙", { platform: l.type }), (r = t.fail) == null || r.call(t, n);
3955
3986
  return;
3956
3987
  }
3957
- const e = _e(t);
3988
+ const e = Re(t);
3958
3989
  a.info("开始蓝牙操作", {
3959
3990
  platform: l.type,
3960
3991
  services: e.services,
3961
3992
  allowDuplicatesKey: e.allowDuplicatesKey
3962
- }), C() ? kn(e) : Kn(e);
3993
+ }), C() ? Jn(e) : jn(e);
3963
3994
  }, { context: "openBluetoothAdapter", options: t });
3964
3995
  }
3965
- function Jn(t = {}) {
3996
+ function Qn(t = {}) {
3966
3997
  return u.safeExecute(() => {
3967
3998
  var r, n;
3968
- if (!fe()) {
3999
+ if (!he()) {
3969
4000
  const i = {
3970
4001
  errMsg: `当前环境 (${l.type}) 不支持蓝牙功能`,
3971
4002
  code: "PLATFORM_NOT_SUPPORTED"
@@ -3973,18 +4004,18 @@ function Jn(t = {}) {
3973
4004
  a.error("平台不支持蓝牙", { platform: l.type }), (r = t.fail) == null || r.call(t, i), (n = t.complete) == null || n.call(t, i);
3974
4005
  return;
3975
4006
  }
3976
- const e = _e(t);
4007
+ const e = Re(t);
3977
4008
  a.info("开始搜索蓝牙设备", {
3978
4009
  platform: l.type,
3979
4010
  services: e.services,
3980
4011
  allowDuplicatesKey: e.allowDuplicatesKey
3981
- }), C() ? startBluetoothDevicesDiscoveryInWeixin(e) : Gn(e);
4012
+ }), C() ? startBluetoothDevicesDiscoveryInWeixin(e) : Hn(e);
3982
4013
  }, { context: "startBluetoothDevicesDiscovery", options: t });
3983
4014
  }
3984
- function It(t, e = {}) {
4015
+ function Ot(t, e = {}) {
3985
4016
  return u.safeExecute(() => {
3986
4017
  var n, i;
3987
- if (!fe()) {
4018
+ if (!he()) {
3988
4019
  const s = {
3989
4020
  errMsg: `当前环境 (${l.type}) 不支持蓝牙功能`,
3990
4021
  code: "PLATFORM_NOT_SUPPORTED"
@@ -3992,25 +4023,25 @@ function It(t, e = {}) {
3992
4023
  a.error("平台不支持蓝牙", { platform: l.type }), (n = e.fail) == null || n.call(e, s), (i = e.complete) == null || i.call(e, s);
3993
4024
  return;
3994
4025
  }
3995
- const r = _e(e);
3996
- a.info("注册蓝牙设备发现监听", { platform: l.type }), C() ? onBluetoothDeviceFoundInWeixin(r) : zn(t, r);
4026
+ const r = Re(e);
4027
+ a.info("注册蓝牙设备发现监听", { platform: l.type }), C() ? onBluetoothDeviceFoundInWeixin(r) : Yn(t, r);
3997
4028
  }, { context: "onBluetoothDeviceFound", options: e });
3998
4029
  }
3999
- function jn(t = {}) {
4030
+ function ei(t = {}) {
4000
4031
  return u.safeExecute(() => {
4001
- var s, c, f, d;
4002
- if (!fe()) {
4003
- const p = {
4032
+ var s, c, h, f;
4033
+ if (!he()) {
4034
+ const A = {
4004
4035
  errMsg: `当前环境 (${l.type}) 不支持蓝牙功能`,
4005
4036
  code: "PLATFORM_NOT_SUPPORTED"
4006
4037
  };
4007
- a.error("平台不支持蓝牙连接", { platform: l.type }), (s = t.fail) == null || s.call(t, p), (c = t.complete) == null || c.call(t, p);
4038
+ a.error("平台不支持蓝牙连接", { platform: l.type }), (s = t.fail) == null || s.call(t, A), (c = t.complete) == null || c.call(t, A);
4008
4039
  return;
4009
4040
  }
4010
- const e = _e(t), { name: r, deviceId: n, autoConnect: i = !1 } = e;
4041
+ const e = Re(t), { name: r, deviceId: n, autoConnect: i = !1 } = e;
4011
4042
  if (!n) {
4012
- const p = { errMsg: "缺少 deviceId 参数", code: "INVALID_PARAMS" };
4013
- (f = t.fail) == null || f.call(t, p), (d = t.complete) == null || d.call(t, p);
4043
+ const A = { errMsg: "缺少 deviceId 参数", code: "INVALID_PARAMS" };
4044
+ (h = t.fail) == null || h.call(t, A), (f = t.complete) == null || f.call(t, A);
4014
4045
  return;
4015
4046
  }
4016
4047
  a.info("创建蓝牙连接", { deviceId: n, autoConnect: i, platform: l.type }), C() ? uni.createBLEConnection({
@@ -4019,12 +4050,12 @@ function jn(t = {}) {
4019
4050
  success: t.success,
4020
4051
  fail: t.fail,
4021
4052
  complete: t.complete
4022
- }) : Vn(e);
4053
+ }) : Zn(e);
4023
4054
  }, { context: "createBLEConnection", options: t });
4024
4055
  }
4025
- function Hn() {
4056
+ function ti() {
4026
4057
  return {
4027
- supported: fe(),
4058
+ supported: he(),
4028
4059
  environment: l.type,
4029
4060
  implementation: C() ? "weixin" : "webview",
4030
4061
  features: {
@@ -4036,18 +4067,18 @@ function Hn() {
4036
4067
  }
4037
4068
  };
4038
4069
  }
4039
- const Yn = {
4070
+ const ri = {
4040
4071
  // TODO: 添加更多默认配置
4041
4072
  };
4042
- function Zn(t = {}) {
4043
- return h(h({}, Yn), t);
4073
+ function ni(t = {}) {
4074
+ return g(g({}, ri), t);
4044
4075
  }
4045
- function At() {
4076
+ function Pt() {
4046
4077
  return ["webview", "UniApp", "plus", "nvue", "uvue", "offline"].includes(l.type);
4047
4078
  }
4048
- function Xn(t) {
4079
+ function ii(t) {
4049
4080
  return u.safeExecute(() => {
4050
- a.debug("通过 WebView 桥接调用打印PDF", t), P("printPdf", m(h({}, t), {
4081
+ a.debug("通过 WebView 桥接调用打印PDF", t), P("printPdf", p(g({}, t), {
4051
4082
  isPersistent: !0
4052
4083
  // 强制禁用超时自动清理
4053
4084
  }), {
@@ -4066,10 +4097,10 @@ function Xn(t) {
4066
4097
  platform: "uniapp"
4067
4098
  });
4068
4099
  }
4069
- function Qn(t = {}) {
4100
+ function ai(t = {}) {
4070
4101
  return u.safeExecute(() => {
4071
4102
  var r;
4072
- if (!At()) {
4103
+ if (!Pt()) {
4073
4104
  const n = {
4074
4105
  errMsg: `当前环境 (${l.type}) 不支持打印PDF功能`,
4075
4106
  code: "PLATFORM_NOT_SUPPORTED"
@@ -4077,16 +4108,16 @@ function Qn(t = {}) {
4077
4108
  a.error("平台不支持打印PDF", { platform: l.type }), (r = t.fail) == null || r.call(t, n);
4078
4109
  return;
4079
4110
  }
4080
- const e = Zn(t);
4081
- a.info("开始打印PDF", { platform: l.type }), Xn(e);
4111
+ const e = ni(t);
4112
+ a.info("开始打印PDF", { platform: l.type }), ii(e);
4082
4113
  }, {
4083
4114
  context: "printPdf",
4084
4115
  options: t
4085
4116
  });
4086
4117
  }
4087
- function ei() {
4118
+ function si() {
4088
4119
  return {
4089
- supported: At(),
4120
+ supported: Pt(),
4090
4121
  environment: l.type,
4091
4122
  implementation: "uniapp",
4092
4123
  features: {
@@ -4094,9 +4125,9 @@ function ei() {
4094
4125
  }
4095
4126
  };
4096
4127
  }
4097
- const Ne = "/pages/face/index";
4098
- function ti(t = {}) {
4099
- const e = h({}, t);
4128
+ const Te = "/pages/face/index";
4129
+ function oi(t = {}) {
4130
+ const e = g({}, t);
4100
4131
  if (!e.name || typeof e.name != "string" || !e.name.trim())
4101
4132
  throw {
4102
4133
  errMsg: "缺少必需参数:name(姓名)",
@@ -4109,26 +4140,26 @@ function ti(t = {}) {
4109
4140
  };
4110
4141
  return e.idCardNumber = e.idCardNumber.trim(), e;
4111
4142
  }
4112
- function Ct() {
4143
+ function Rt() {
4113
4144
  return C();
4114
4145
  }
4115
- function ri() {
4146
+ function ci() {
4116
4147
  return typeof window != "undefined" && window.wx && window.wx.miniProgram && typeof window.wx.miniProgram.navigateTo == "function";
4117
4148
  }
4118
- function ni(t) {
4119
- const e = m(h({}, t), {
4149
+ function ui(t) {
4150
+ const e = p(g({}, t), {
4120
4151
  title: document.title || "",
4121
4152
  url: window.location.href || ""
4122
4153
  }), r = Object.entries(e).filter(([, n]) => n != null && n !== "").map(([n, i]) => `${encodeURIComponent(n)}=${encodeURIComponent(String(i))}`).join("&");
4123
- return r ? `${Ne}?${r}` : Ne;
4154
+ return r ? `${Te}?${r}` : Te;
4124
4155
  }
4125
- function ii(t) {
4156
+ function li(t) {
4126
4157
  return u.safeExecute(() => {
4127
- if (!ri()) {
4158
+ if (!ci()) {
4128
4159
  a.error("微信小程序导航API不可用");
4129
4160
  return;
4130
4161
  }
4131
- const e = ni(t);
4162
+ const e = ui(t);
4132
4163
  a.debug("跳转宿主人脸识别页面", {
4133
4164
  name: t.name,
4134
4165
  targetUrl: e
@@ -4146,15 +4177,15 @@ function ii(t) {
4146
4177
  platform: "weixin"
4147
4178
  });
4148
4179
  }
4149
- function ai(t = {}) {
4180
+ function fi(t = {}) {
4150
4181
  return u.safeExecute(() => {
4151
- if (!Ct()) {
4182
+ if (!Rt()) {
4152
4183
  a.error("平台不支持人脸识别", { platform: l.type });
4153
4184
  return;
4154
4185
  }
4155
4186
  let e;
4156
4187
  try {
4157
- e = ti(t);
4188
+ e = oi(t);
4158
4189
  } catch (r) {
4159
4190
  a.error("人脸识别参数校验失败", r);
4160
4191
  return;
@@ -4162,16 +4193,16 @@ function ai(t = {}) {
4162
4193
  a.info("开始人脸识别", {
4163
4194
  platform: l.type,
4164
4195
  name: e.name,
4165
- pagePath: Ne
4166
- }), ii(e);
4196
+ pagePath: Te
4197
+ }), li(e);
4167
4198
  }, {
4168
4199
  context: "faceVerify",
4169
4200
  options: t
4170
4201
  });
4171
4202
  }
4172
- function si() {
4203
+ function di() {
4173
4204
  return {
4174
- supported: Ct(),
4205
+ supported: Rt(),
4175
4206
  environment: l.type,
4176
4207
  implementation: "weixin",
4177
4208
  features: {
@@ -4180,164 +4211,164 @@ function si() {
4180
4211
  }
4181
4212
  };
4182
4213
  }
4183
- const _t = ne();
4184
- function oi() {
4214
+ const Nt = ne();
4215
+ function gi() {
4185
4216
  if (typeof window == "undefined" || !ne(!0).isWeixinMiniProgram)
4186
4217
  return !1;
4187
- const e = Pe().getRuntimeConfig();
4218
+ const e = Me().getRuntimeConfig();
4188
4219
  return typeof e.clientId == "string" && e.clientId.length > 0;
4189
4220
  }
4190
- function ci() {
4221
+ function hi() {
4191
4222
  return w(this, null, function* () {
4192
- yield Ht(), oi() && (yield G());
4223
+ yield Qt(), gi() && (yield K());
4193
4224
  });
4194
4225
  }
4195
- z.useResponse(et.response, { priority: 1e3 });
4196
- let ze = !1;
4197
- function Ve() {
4198
- if (ze) return;
4199
- ze = !0, pr([
4200
- { name: "load-weixin-sdk", run: Ze, timeoutMs: 8e3 },
4201
- { name: "init-bridge", run: He, timeoutMs: 8e3 }
4226
+ z.useResponse(it.response, { priority: 1e3 });
4227
+ let je = !1;
4228
+ function He() {
4229
+ if (je) return;
4230
+ je = !0, Ir([
4231
+ { name: "load-weixin-sdk", run: tt, timeoutMs: 8e3 },
4232
+ { name: "init-bridge", run: Qe, timeoutMs: 8e3 }
4202
4233
  ], {
4203
4234
  onError: (e, r) => {
4204
4235
  console.error(`[QSH-SDK] 初始化失败(${(r == null ? void 0 : r.name) || "unknown"}):`, e);
4205
4236
  }
4206
4237
  });
4207
4238
  }
4208
- typeof window != "undefined" && (document.readyState === "complete" || document.readyState === "interactive" ? setTimeout(Ve, 0) : document.addEventListener("DOMContentLoaded", Ve));
4239
+ typeof window != "undefined" && (document.readyState === "complete" || document.readyState === "interactive" ? setTimeout(He, 0) : document.addEventListener("DOMContentLoaded", He));
4209
4240
  function I(t, { apiName: e } = {}) {
4210
4241
  return function(r = {}, ...n) {
4211
- const i = r && typeof r == "object" && (typeof r.success == "function" || typeof r.fail == "function" || typeof r.complete == "function"), s = r && typeof r == "object" ? r : {}, c = () => i ? t(s, ...n) : new Promise((d, p) => {
4212
- const R = m(h({}, s), {
4213
- success: (O) => {
4214
- typeof s.success == "function" && s.success(O), d(O);
4242
+ const i = r && typeof r == "object" && (typeof r.success == "function" || typeof r.fail == "function" || typeof r.complete == "function"), s = r && typeof r == "object" ? r : {}, c = () => i ? t(s, ...n) : new Promise((f, A) => {
4243
+ const M = p(g({}, s), {
4244
+ success: (m) => {
4245
+ typeof s.success == "function" && s.success(m), f(m);
4215
4246
  },
4216
- fail: (O) => {
4217
- typeof s.fail == "function" && s.fail(O), p(O);
4247
+ fail: (m) => {
4248
+ typeof s.fail == "function" && s.fail(m), A(m);
4218
4249
  },
4219
4250
  complete: s.complete
4220
4251
  });
4221
- t(R, ...n);
4252
+ t(M, ...n);
4222
4253
  });
4223
- return (typeof window == "undefined" ? Promise.resolve() : je()).then(() => c()).catch((d) => {
4224
- throw console.error(`[QSH-SDK] ${e || "API"} call failed:`, d), d;
4254
+ return (typeof window == "undefined" ? Promise.resolve() : Xe()).then(() => c()).catch((f) => {
4255
+ throw console.error(`[QSH-SDK] ${e || "API"} call failed:`, f), f;
4225
4256
  });
4226
4257
  };
4227
4258
  }
4228
- function he(t) {
4259
+ function we(t) {
4229
4260
  return typeof t == "function" ? { success: t } : t && typeof t == "object" ? t : {};
4230
4261
  }
4231
- const Ot = I($r), Pt = I(Fr), Rt = I(Br), Nt = I(kr), Mt = I(Kr), St = I(Gr);
4232
- function Tt(t) {
4233
- const e = () => zr(t);
4234
- return (typeof window == "undefined" ? Promise.resolve() : je()).then(() => e());
4262
+ const Mt = I(Gr), St = I(Kr), Tt = I(zr), Lt = I(Vr), bt = I(qr), vt = I(Jr);
4263
+ function xt(t) {
4264
+ const e = () => jr(t);
4265
+ return (typeof window == "undefined" ? Promise.resolve() : Xe()).then(() => e());
4235
4266
  }
4236
- const be = I(Yr, { apiName: "getCode" });
4237
- function ui(t = {}) {
4267
+ const De = I(en, { apiName: "getCode" });
4268
+ function mi(t = {}) {
4238
4269
  return new Promise((e, r) => {
4239
- be(m(h({}, t), {
4270
+ De(p(g({}, t), {
4240
4271
  success: e,
4241
4272
  fail: r
4242
4273
  }));
4243
4274
  });
4244
4275
  }
4245
- const ve = I(tn, {
4276
+ const Ue = I(sn, {
4246
4277
  apiName: "navigateToMiniProgram"
4247
4278
  });
4248
- function li(t = {}) {
4279
+ function pi(t = {}) {
4249
4280
  return new Promise((e, r) => {
4250
- ve(m(h({}, t), {
4281
+ Ue(p(g({}, t), {
4251
4282
  success: e,
4252
4283
  fail: r
4253
4284
  }));
4254
4285
  });
4255
4286
  }
4256
- const xe = I(sn);
4257
- function fi(t = {}) {
4287
+ const We = I(ln);
4288
+ function wi(t = {}) {
4258
4289
  return new Promise((e, r) => {
4259
- xe(m(h({}, t), {
4290
+ We(p(g({}, t), {
4260
4291
  success: e,
4261
4292
  fail: r
4262
4293
  }));
4263
4294
  });
4264
4295
  }
4265
- const Lt = I(Qn);
4266
- function di(t = {}) {
4296
+ const Dt = I(ai);
4297
+ function Ei(t = {}) {
4267
4298
  return new Promise((e, r) => {
4268
- Lt(m(h({}, t), {
4299
+ Dt(p(g({}, t), {
4269
4300
  success: e,
4270
4301
  fail: r
4271
4302
  }));
4272
4303
  });
4273
4304
  }
4274
- const De = I(dn), gi = I(ai);
4275
- function hi(t = {}) {
4305
+ const $e = I(pn), yi = I(fi);
4306
+ function Ii(t = {}) {
4276
4307
  return new Promise((e, r) => {
4277
- De(m(h({}, t), {
4308
+ $e(p(g({}, t), {
4278
4309
  success: e,
4279
4310
  fail: r
4280
4311
  }));
4281
4312
  });
4282
4313
  }
4283
- const mi = I(yt, { apiName: "shareDirected" }), pi = I($n, { apiName: "shareDirectedAsync" }), Ue = I(An);
4284
- function wi(t = {}) {
4314
+ const Ai = I(Ct, { apiName: "shareDirected" }), _i = I(zn, { apiName: "shareDirectedAsync" }), Fe = I(Pn);
4315
+ function Ci(t = {}) {
4285
4316
  return new Promise((e, r) => {
4286
- Ue(m(h({}, t), {
4317
+ Fe(p(g({}, t), {
4287
4318
  success: e,
4288
4319
  fail: r
4289
4320
  }));
4290
4321
  });
4291
4322
  }
4292
- const We = I(Cn);
4293
- function Ei(t = {}) {
4323
+ const Be = I(Rn);
4324
+ function Oi(t = {}) {
4294
4325
  return new Promise((e, r) => {
4295
- We(m(h({}, t), {
4326
+ Be(p(g({}, t), {
4296
4327
  success: e,
4297
4328
  fail: r
4298
4329
  }));
4299
4330
  });
4300
4331
  }
4301
- const $e = I(vn);
4302
- function yi(t = {}) {
4332
+ const ke = I(Wn);
4333
+ function Pi(t = {}) {
4303
4334
  return new Promise((e, r) => {
4304
- $e(m(h({}, t), {
4335
+ ke(p(g({}, t), {
4305
4336
  success: e,
4306
4337
  fail: r
4307
4338
  }));
4308
4339
  });
4309
4340
  }
4310
- const bt = I(qn);
4311
- function Ii(t = {}) {
4341
+ const Ut = I(Xn);
4342
+ function Ri(t = {}) {
4312
4343
  return new Promise((e, r) => {
4313
- bt(m(h({}, t), {
4344
+ Ut(p(g({}, t), {
4314
4345
  success: e,
4315
4346
  fail: r
4316
4347
  }));
4317
4348
  });
4318
4349
  }
4319
- const vt = I(Jn);
4320
- function Ai(t = {}) {
4350
+ const Wt = I(Qn);
4351
+ function Ni(t = {}) {
4321
4352
  return new Promise((e, r) => {
4322
- vt(m(h({}, t), {
4353
+ Wt(p(g({}, t), {
4323
4354
  success: e,
4324
4355
  fail: r
4325
4356
  }));
4326
4357
  });
4327
4358
  }
4328
- const xt = I(It);
4329
- function Ci(t = {}) {
4359
+ const $t = I(Ot);
4360
+ function Mi(t = {}) {
4330
4361
  return new Promise((e, r) => {
4331
- xt(m(h({}, t), {
4362
+ $t(p(g({}, t), {
4332
4363
  success: e,
4333
4364
  fail: r
4334
4365
  }));
4335
4366
  });
4336
4367
  }
4337
- const Dt = I(jn);
4338
- function _i(t = {}) {
4368
+ const Ft = I(ei);
4369
+ function Si(t = {}) {
4339
4370
  return new Promise((e, r) => {
4340
- Dt(m(h({}, t), {
4371
+ Ft(p(g({}, t), {
4341
4372
  success: e,
4342
4373
  fail: r
4343
4374
  }));
@@ -4345,40 +4376,40 @@ function _i(t = {}) {
4345
4376
  }
4346
4377
  const re = {
4347
4378
  // 导航 API
4348
- navigateTo: Ot,
4349
- navigateBack: Pt,
4350
- switchTab: Rt,
4351
- reLaunch: Nt,
4352
- redirectTo: Mt,
4379
+ navigateTo: Mt,
4380
+ navigateBack: St,
4381
+ switchTab: Tt,
4382
+ reLaunch: Lt,
4383
+ redirectTo: bt,
4353
4384
  // 消息 API
4354
- postMessage: St,
4355
- getEnv: Tt,
4356
- getCode: be,
4357
- getCodeAsync: ui,
4358
- navigateToMiniProgram: ve,
4359
- navigateToMiniProgramAsync: li,
4385
+ postMessage: vt,
4386
+ getEnv: xt,
4387
+ getCode: De,
4388
+ getCodeAsync: mi,
4389
+ navigateToMiniProgram: Ue,
4390
+ navigateToMiniProgramAsync: pi,
4360
4391
  // 图片 API
4361
- chooseImage: xe,
4362
- chooseImageAsync: fi,
4392
+ chooseImage: We,
4393
+ chooseImageAsync: wi,
4363
4394
  // 扫码 API
4364
- scanCode: De,
4365
- scanCodeAsync: hi,
4395
+ scanCode: $e,
4396
+ scanCodeAsync: Ii,
4366
4397
  // 位置 API
4367
- getLocation: Ue,
4368
- getLocationAsync: wi,
4369
- openLocation: We,
4370
- openLocationAsync: Ei,
4371
- chooseLocation: $e,
4372
- chooseLocationAsync: yi,
4398
+ getLocation: Fe,
4399
+ getLocationAsync: Ci,
4400
+ openLocation: Be,
4401
+ openLocationAsync: Oi,
4402
+ chooseLocation: ke,
4403
+ chooseLocationAsync: Pi,
4373
4404
  // 位置监听 API(保留回调签名)
4374
- onLocationChange: (t) => I((e = {}) => Rn(e.success), { apiName: "onLocationChange" })(he(t)),
4375
- offLocationChange: (t) => I((e = {}) => Nn(e.success), { apiName: "offLocationChange" })(he(t)),
4376
- onLocationChangeError: (t) => I((e = {}) => Mn(e.success), { apiName: "onLocationChangeError" })(he(t)),
4377
- offLocationChangeError: (t) => I((e = {}) => Sn(e.success), { apiName: "offLocationChangeError" })(he(t)),
4378
- startLocationUpdate: I(On, { apiName: "startLocationUpdate" }),
4379
- stopLocationUpdate: I(Pn, { apiName: "stopLocationUpdate" }),
4405
+ onLocationChange: (t) => I((e = {}) => Tn(e.success), { apiName: "onLocationChange" })(we(t)),
4406
+ offLocationChange: (t) => I((e = {}) => Ln(e.success), { apiName: "offLocationChange" })(we(t)),
4407
+ onLocationChangeError: (t) => I((e = {}) => bn(e.success), { apiName: "onLocationChangeError" })(we(t)),
4408
+ offLocationChangeError: (t) => I((e = {}) => vn(e.success), { apiName: "offLocationChangeError" })(we(t)),
4409
+ startLocationUpdate: I(Mn, { apiName: "startLocationUpdate" }),
4410
+ stopLocationUpdate: I(Sn, { apiName: "stopLocationUpdate" }),
4380
4411
  // 环境信息
4381
- environment: _t,
4412
+ environment: Nt,
4382
4413
  /**
4383
4414
  * Wait for SDK readiness.
4384
4415
  * In Weixin mini-program web-view, if qsh.config({ clientId }) was called,
@@ -4388,7 +4419,7 @@ const re = {
4388
4419
  * await qsh.ready()
4389
4420
  * @since 2.0.0
4390
4421
  */
4391
- ready: ci,
4422
+ ready: hi,
4392
4423
  /**
4393
4424
  * 手动初始化 JSBridge
4394
4425
  * 默认会在 DOM 就绪时自动初始化;如需更早或手动控制,可调用本方法。
@@ -4397,7 +4428,7 @@ const re = {
4397
4428
  * await qsh.init()
4398
4429
  * @since 2.0.0
4399
4430
  */
4400
- init: He,
4431
+ init: Qe,
4401
4432
  /**
4402
4433
  * 检查 JSBridge 是否就绪
4403
4434
  * @returns {boolean}
@@ -4405,7 +4436,7 @@ const re = {
4405
4436
  * if (qsh.isReady()) { console.log('ready') }
4406
4437
  * @since 2.0.0
4407
4438
  */
4408
- isReady: Gt,
4439
+ isReady: Jt,
4409
4440
  /**
4410
4441
  * 获取当前 SDK 状态
4411
4442
  * @returns {string}
@@ -4413,8 +4444,8 @@ const re = {
4413
4444
  * console.log(qsh.getState()) // 'ready'
4414
4445
  * @since 2.0.0
4415
4446
  */
4416
- getState: zt,
4417
- config: Be,
4447
+ getState: jt,
4448
+ config: ze,
4418
4449
  // 微信配置 API
4419
4450
  weixin: {
4420
4451
  /**
@@ -4424,8 +4455,8 @@ const re = {
4424
4455
  * await qsh.weixin.waitForConfig()
4425
4456
  * @since 2.0.0
4426
4457
  */
4427
- config: Be,
4428
- waitForConfig: G,
4458
+ config: ze,
4459
+ waitForConfig: K,
4429
4460
  /**
4430
4461
  * 检查微信配置是否完成
4431
4462
  * @returns {boolean}
@@ -4441,7 +4472,7 @@ const re = {
4441
4472
  * console.log(qsh.weixin.getConfigState()) // 'configured'
4442
4473
  * @since 2.0.0
4443
4474
  */
4444
- getConfigState: er,
4475
+ getConfigState: ir,
4445
4476
  /**
4446
4477
  * 手动重试微信配置
4447
4478
  * @returns {Promise<void>}
@@ -4449,13 +4480,13 @@ const re = {
4449
4480
  * await qsh.weixin.retryConfig()
4450
4481
  * @since 2.0.0
4451
4482
  */
4452
- retryConfig: tr
4483
+ retryConfig: ar
4453
4484
  },
4454
4485
  // WebView 对象(兼容旧版本)
4455
4486
  webView: null,
4456
4487
  // 图片相关常量
4457
- ImageSourceTypes: we,
4458
- ImageSizeTypes: Ee,
4488
+ ImageSourceTypes: Ie,
4489
+ ImageSizeTypes: Ae,
4459
4490
  /**
4460
4491
  * 获取图片功能能力信息
4461
4492
  * @returns {Object} 能力信息对象
@@ -4464,7 +4495,7 @@ const re = {
4464
4495
  * console.log('是否支持:', capabilities.supported)
4465
4496
  * @since 2.0.0
4466
4497
  */
4467
- getImageCapabilities: on,
4498
+ getImageCapabilities: fn,
4468
4499
  // 扫码相关常量
4469
4500
  ScanTypes: q,
4470
4501
  /**
@@ -4475,7 +4506,7 @@ const re = {
4475
4506
  * console.log('是否支持:', capabilities.supported)
4476
4507
  * @since 2.1.0
4477
4508
  */
4478
- getScanCapabilities: gn,
4509
+ getScanCapabilities: wn,
4479
4510
  // 位置相关常量
4480
4511
  CoordinateTypes: te,
4481
4512
  /**
@@ -4486,7 +4517,7 @@ const re = {
4486
4517
  * console.log('是否支持:', capabilities.supported)
4487
4518
  * @since 2.1.0
4488
4519
  */
4489
- getLocationCapabilities: _n,
4520
+ getLocationCapabilities: Nn,
4490
4521
  /**
4491
4522
  * 获取位置选择功能能力信息
4492
4523
  * @returns {Object} 能力信息对象
@@ -4495,22 +4526,22 @@ const re = {
4495
4526
  * console.log('是否支持:', capabilities.supported)
4496
4527
  * @since 2.1.0
4497
4528
  */
4498
- getChooseLocationCapabilities: xn,
4529
+ getChooseLocationCapabilities: $n,
4499
4530
  // 蓝牙 API
4500
- openBluetoothAdapter: bt,
4501
- openBluetoothAdapterAsync: Ii,
4502
- startBluetoothDevicesDiscovery: vt,
4503
- startBluetoothDevicesDiscoveryAsync: Ai,
4504
- onBluetoothDeviceFound: xt,
4505
- onBluetoothDeviceFoundAsync: Ci,
4506
- createBLEConnection: Dt,
4507
- createBLEConnectionAsync: _i,
4531
+ openBluetoothAdapter: Ut,
4532
+ openBluetoothAdapterAsync: Ri,
4533
+ startBluetoothDevicesDiscovery: Wt,
4534
+ startBluetoothDevicesDiscoveryAsync: Ni,
4535
+ onBluetoothDeviceFound: $t,
4536
+ onBluetoothDeviceFoundAsync: Mi,
4537
+ createBLEConnection: Ft,
4538
+ createBLEConnectionAsync: Si,
4508
4539
  // 蓝牙相关常量
4509
- BluetoothStates: Fn,
4540
+ BluetoothStates: Vn,
4510
4541
  //微信分享(定向模块)
4511
4542
  /** 定向分享模块:仅 H5->宿主 WebView,图文/文字/图片到微信会话/朋友圈 */
4512
- shareDirected: mi,
4513
- shareDirectedAsync: pi,
4543
+ shareDirected: Ai,
4544
+ shareDirectedAsync: _i,
4514
4545
  /**
4515
4546
  * 获取蓝牙功能能力信息
4516
4547
  * @returns {Object} 能力信息对象
@@ -4518,10 +4549,10 @@ const re = {
4518
4549
  * const capabilities = qsh.getBluetoothCapabilities()
4519
4550
  * console.log('是否支持:', capabilities.supported)
4520
4551
  */
4521
- getBluetoothCapabilities: Hn,
4552
+ getBluetoothCapabilities: ti,
4522
4553
  // 打印PDF API
4523
- printPdf: Lt,
4524
- printPdfAsync: di,
4554
+ printPdf: Dt,
4555
+ printPdfAsync: Ei,
4525
4556
  /**
4526
4557
  * 获取打印PDF功能能力信息
4527
4558
  * @returns {Object} 能力信息对象
@@ -4529,16 +4560,16 @@ const re = {
4529
4560
  * const capabilities = qsh.getPrintCapabilities()
4530
4561
  * console.log('是否支持:', capabilities.supported)
4531
4562
  */
4532
- getPrintCapabilities: ei,
4563
+ getPrintCapabilities: si,
4533
4564
  // 人脸识别 API(仅支持微信小程序环境)
4534
- faceVerify: gi,
4535
- getFaceCapabilities: si,
4565
+ faceVerify: yi,
4566
+ getFaceCapabilities: di,
4536
4567
  // 插件系统
4537
4568
  plugins: {
4538
4569
  /**
4539
4570
  * 插件管理器
4540
4571
  */
4541
- manager: ae,
4572
+ manager: ce,
4542
4573
  /**
4543
4574
  * 注册插件
4544
4575
  * @param {Object} plugin - 插件对象
@@ -4546,7 +4577,7 @@ const re = {
4546
4577
  * @example
4547
4578
  * qsh.plugins.register(myPlugin)
4548
4579
  */
4549
- register: (t) => ae.register(t),
4580
+ register: (t) => ce.register(t),
4550
4581
  /**
4551
4582
  * 安装插件
4552
4583
  * @param {string} name - 插件名称
@@ -4554,14 +4585,14 @@ const re = {
4554
4585
  * @example
4555
4586
  * await qsh.plugins.install('image')
4556
4587
  */
4557
- install: (t) => ae.install(t, re),
4588
+ install: (t) => ce.install(t, re),
4558
4589
  /**
4559
4590
  * 获取插件列表
4560
4591
  * @returns {Array} 插件列表
4561
4592
  * @example
4562
4593
  * console.log(qsh.plugins.list())
4563
4594
  */
4564
- list: () => ae.getPluginList()
4595
+ list: () => ce.getPluginList()
4565
4596
  },
4566
4597
  // 拦截器系统
4567
4598
  interceptors: {
@@ -4597,11 +4628,11 @@ const re = {
4597
4628
  * 内置拦截器
4598
4629
  */
4599
4630
  builtin: {
4600
- logging: ir,
4631
+ logging: cr,
4601
4632
  performance: B,
4602
- createRetry: ar,
4603
- createValidation: sr,
4604
- errorNormalizer: et
4633
+ createRetry: ur,
4634
+ createValidation: lr,
4635
+ errorNormalizer: it
4605
4636
  }
4606
4637
  },
4607
4638
  // 观测指标
@@ -4624,7 +4655,7 @@ const re = {
4624
4655
  /**
4625
4656
  * 错误消息
4626
4657
  */
4627
- messages: Re,
4658
+ messages: Se,
4628
4659
  /**
4629
4660
  * 错误分类
4630
4661
  */
@@ -4637,7 +4668,7 @@ const re = {
4637
4668
  * @example
4638
4669
  * const standardError = qsh.errors.normalize(error, { apiName: 'chooseImage' })
4639
4670
  */
4640
- normalize: Qe,
4671
+ normalize: nt,
4641
4672
  /**
4642
4673
  * 创建标准错误
4643
4674
  * @param {string} code - 错误码
@@ -4646,7 +4677,7 @@ const re = {
4646
4677
  * @example
4647
4678
  * const error = qsh.errors.create('E_IMG_001', { apiName: 'chooseImage' })
4648
4679
  */
4649
- create: gr,
4680
+ create: wr,
4650
4681
  /**
4651
4682
  * 判断是否为标准错误
4652
4683
  * @param {any} error - 错误对象
@@ -4654,7 +4685,7 @@ const re = {
4654
4685
  * @example
4655
4686
  * if (qsh.errors.isStandard(error)) { ... }
4656
4687
  */
4657
- isStandard: hr
4688
+ isStandard: Er
4658
4689
  },
4659
4690
  // 状态管理
4660
4691
  store: {
@@ -4738,8 +4769,8 @@ const re = {
4738
4769
  getStats: () => ({
4739
4770
  logger: T.getStats(),
4740
4771
  state: V.getStats(),
4741
- weixinConfig: Pe().getStats(),
4742
- plugins: ae.getStats(),
4772
+ weixinConfig: Me().getStats(),
4773
+ plugins: ce.getStats(),
4743
4774
  interceptors: z.getStats(),
4744
4775
  store: W.getStats()
4745
4776
  }),
@@ -4749,7 +4780,7 @@ const re = {
4749
4780
  * @example
4750
4781
  * console.log(qsh.debug.getWeixinConfigManager().getStats())
4751
4782
  */
4752
- getWeixinConfigManager: Pe,
4783
+ getWeixinConfigManager: Me,
4753
4784
  /**
4754
4785
  * 导出调试信息
4755
4786
  * @returns {string} JSON 格式的调试信息
@@ -4759,25 +4790,25 @@ const re = {
4759
4790
  exportDebugInfo: () => T.exportToJSON()
4760
4791
  }
4761
4792
  };
4762
- _t.isWeixinMiniProgram ? re.webView = window.wx && window.wx.miniProgram : re.webView = {
4763
- navigateTo: Ot,
4764
- navigateBack: Pt,
4765
- switchTab: Rt,
4766
- reLaunch: Nt,
4767
- redirectTo: Mt,
4768
- postMessage: St,
4769
- getEnv: Tt,
4770
- getCode: be,
4771
- navigateToMiniProgram: ve,
4772
- chooseImage: xe,
4773
- scanCode: De,
4774
- getLocation: Ue,
4775
- openLocation: We,
4776
- chooseLocation: $e
4793
+ Nt.isWeixinMiniProgram ? re.webView = window.wx && window.wx.miniProgram : re.webView = {
4794
+ navigateTo: Mt,
4795
+ navigateBack: St,
4796
+ switchTab: Tt,
4797
+ reLaunch: Lt,
4798
+ redirectTo: bt,
4799
+ postMessage: vt,
4800
+ getEnv: xt,
4801
+ getCode: De,
4802
+ navigateToMiniProgram: Ue,
4803
+ chooseImage: We,
4804
+ scanCode: $e,
4805
+ getLocation: Fe,
4806
+ openLocation: Be,
4807
+ chooseLocation: ke
4777
4808
  };
4778
- const qe = typeof window.uni != "undefined" ? window.uni : {};
4779
- Object.keys(qe).forEach((t) => {
4780
- re.hasOwnProperty(t) || (re[t] = qe[t]);
4809
+ const Ye = typeof window.uni != "undefined" ? window.uni : {};
4810
+ Object.keys(Ye).forEach((t) => {
4811
+ re.hasOwnProperty(t) || (re[t] = Ye[t]);
4781
4812
  });
4782
4813
  typeof window != "undefined" && (window.qsh = re);
4783
4814
  export {