@trimjs/web-app 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- var be = Object.defineProperty;
2
- var we = (r, e, t) => e in r ? be(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
- var A = (r, e, t) => we(r, typeof e != "symbol" ? e + "" : e, t);
4
- class ve {
1
+ var we = Object.defineProperty;
2
+ var ve = (n, e, t) => e in n ? we(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
+ var A = (n, e, t) => ve(n, typeof e != "symbol" ? e + "" : e, t);
4
+ class Ee {
5
5
  constructor() {
6
6
  A(this, "debug", !1);
7
7
  }
@@ -47,25 +47,30 @@ class ve {
47
47
  this.debug && console.info("[Trim App]", ...e);
48
48
  }
49
49
  }
50
- const d = new ve();
51
- function Ee(r) {
50
+ const d = new Ee();
51
+ function Se(n) {
52
52
  const e = /FNOS\/([\d.]+)|FNAppType\/(\w+)|FNAppVer\/([\d.]+)/g, t = {};
53
- let n;
54
- for (; (n = e.exec(r)) !== null; )
55
- n[1] && (t.fnOSVersion = n[1]), n[2] && (t.fnAppType = n[2]), n[3] && (t.fnAppVersion = n[3]);
53
+ let r;
54
+ for (; (r = e.exec(n)) !== null; )
55
+ r[1] && (t.fnOSVersion = r[1]), r[2] && (t.fnAppType = r[2]), r[3] && (t.fnAppVersion = r[3]);
56
56
  return t;
57
57
  }
58
- const ce = () => Ee(navigator.userAgent).fnAppVersion, Se = () => new Promise((r) => {
58
+ const ce = () => Se(navigator.userAgent).fnAppVersion;
59
+ let ae = !1;
60
+ window.addEventListener("flutterInAppWebViewPlatformReady", () => {
61
+ ae = !0;
62
+ });
63
+ const Ae = () => new Promise((n) => {
59
64
  var e;
60
- (e = window.flutter_inappwebview) != null && e._platformReady ? (d.log("flutter_inappwebview is ready"), r(window.flutter_inappwebview)) : window.addEventListener("flutterInAppWebViewPlatformReady", () => {
61
- d.log("flutter_inappwebview is ready"), r(window.flutter_inappwebview);
65
+ ae || (e = window.flutter_inappwebview) != null && e._platformReady ? (d.log("flutter_inappwebview is ready"), n(window.flutter_inappwebview)) : window.addEventListener("flutterInAppWebViewPlatformReady", () => {
66
+ d.log("flutter_inappwebview is ready"), n(window.flutter_inappwebview);
62
67
  });
63
- }), Ae = async (r, e, t) => {
68
+ }), $e = async (n, e, t) => {
64
69
  d.log(`callHandler: ${e}, params: ${t}`);
65
- const n = await r.callHandler(e, t);
66
- if (n)
70
+ const r = await n.callHandler(e, t);
71
+ if (r)
67
72
  try {
68
- const o = JSON.parse(n);
73
+ const o = JSON.parse(r);
69
74
  d.log(`messageData: ${JSON.stringify(o)}`);
70
75
  const i = JSON.parse(o.result);
71
76
  return d.log(`appMessage: ${JSON.stringify(i)}`), i;
@@ -74,71 +79,71 @@ const ce = () => Ee(navigator.userAgent).fnAppVersion, Se = () => new Promise((r
74
79
  }
75
80
  return null;
76
81
  }, Q = /* @__PURE__ */ new Map();
77
- function $e() {
78
- window.fnAppMessage = (r) => {
79
- d.log("app-message", r);
80
- const e = JSON.parse(r), t = Q.get(e.reqId);
82
+ function Pe() {
83
+ window.fnAppMessage = (n) => {
84
+ d.log("app-message", n);
85
+ const e = JSON.parse(n), t = Q.get(e.reqId);
81
86
  t && (t(e), Q.delete(e.reqId));
82
87
  };
83
88
  }
84
- ce() && $e();
85
- var T = /* @__PURE__ */ ((r) => (r.Call = "call", r.Reply = "reply", r.Syn = "syn", r.SynAck = "synAck", r.Ack = "ack", r))(T || {}), k = /* @__PURE__ */ ((r) => (r.Fulfilled = "fulfilled", r.Rejected = "rejected", r))(k || {}), z = /* @__PURE__ */ ((r) => (r.ConnectionDestroyed = "ConnectionDestroyed", r.ConnectionTimeout = "ConnectionTimeout", r.NoIframeSrc = "NoIframeSrc", r))(z || {}), ae = /* @__PURE__ */ ((r) => (r.DataCloneError = "DataCloneError", r))(ae || {}), R = /* @__PURE__ */ ((r) => (r.Message = "message", r))(R || {});
86
- const Pe = (r, e) => {
89
+ ce() && Pe();
90
+ var T = /* @__PURE__ */ ((n) => (n.Call = "call", n.Reply = "reply", n.Syn = "syn", n.SynAck = "synAck", n.Ack = "ack", n))(T || {}), k = /* @__PURE__ */ ((n) => (n.Fulfilled = "fulfilled", n.Rejected = "rejected", n))(k || {}), z = /* @__PURE__ */ ((n) => (n.ConnectionDestroyed = "ConnectionDestroyed", n.ConnectionTimeout = "ConnectionTimeout", n.NoIframeSrc = "NoIframeSrc", n))(z || {}), le = /* @__PURE__ */ ((n) => (n.DataCloneError = "DataCloneError", n))(le || {}), R = /* @__PURE__ */ ((n) => (n.Message = "message", n))(R || {});
91
+ const Me = (n, e) => {
87
92
  const t = [];
88
- let n = !1;
93
+ let r = !1;
89
94
  return {
90
95
  destroy(o) {
91
- n || (n = !0, e(`${r}: Destroying connection`), t.forEach((i) => {
96
+ r || (r = !0, e(`${n}: Destroying connection`), t.forEach((i) => {
92
97
  i(o);
93
98
  }));
94
99
  },
95
100
  onDestroy(o) {
96
- n ? o() : t.push(o);
101
+ r ? o() : t.push(o);
97
102
  }
98
103
  };
99
- }, Me = (r) => (...e) => {
100
- r && console.log("[Penpal]", ...e);
104
+ }, _e = (n) => (...e) => {
105
+ n && console.log("[Penpal]", ...e);
101
106
  }, G = ({
102
- name: r,
107
+ name: n,
103
108
  message: e,
104
109
  stack: t
105
110
  }) => ({
106
- name: r,
111
+ name: n,
107
112
  message: e,
108
113
  stack: t
109
- }), _e = (r) => {
114
+ }), Ce = (n) => {
110
115
  const e = new Error();
111
- return Object.keys(r).forEach((t) => e[t] = r[t]), e;
112
- }, Ce = (r, e, t) => {
116
+ return Object.keys(n).forEach((t) => e[t] = n[t]), e;
117
+ }, Fe = (n, e, t) => {
113
118
  const {
114
- localName: n,
119
+ localName: r,
115
120
  local: o,
116
121
  remote: i,
117
122
  originForSending: s,
118
123
  originForReceiving: c
119
- } = r;
124
+ } = n;
120
125
  let f = !1;
121
- const w = (b) => {
122
- if (b.source !== i || b.data.penpal !== T.Call)
126
+ const w = (m) => {
127
+ if (m.source !== i || m.data.penpal !== T.Call)
123
128
  return;
124
- if (c !== "*" && b.origin !== c) {
129
+ if (c !== "*" && m.origin !== c) {
125
130
  t(
126
- `${n} received message from origin ${b.origin} which did not match expected origin ${c}`
131
+ `${r} received message from origin ${m.origin} which did not match expected origin ${c}`
127
132
  );
128
133
  return;
129
134
  }
130
- const v = b.data, { methodName: g, args: p, id: m } = v;
131
- t(`${n}: Received ${g}() call`);
135
+ const v = m.data, { methodName: g, args: p, id: b } = v;
136
+ t(`${r}: Received ${g}() call`);
132
137
  const a = (y) => (S) => {
133
- if (t(`${n}: Sending ${g}() reply`), f) {
138
+ if (t(`${r}: Sending ${g}() reply`), f) {
134
139
  t(
135
- `${n}: Unable to send ${g}() reply due to destroyed connection`
140
+ `${r}: Unable to send ${g}() reply due to destroyed connection`
136
141
  );
137
142
  return;
138
143
  }
139
144
  const $ = {
140
145
  penpal: T.Reply,
141
- id: m,
146
+ id: b,
142
147
  resolution: y,
143
148
  returnValue: S
144
149
  };
@@ -146,10 +151,10 @@ const Pe = (r, e) => {
146
151
  try {
147
152
  i.postMessage($, s);
148
153
  } catch (M) {
149
- if (M.name === ae.DataCloneError) {
154
+ if (M.name === le.DataCloneError) {
150
155
  const _ = {
151
156
  penpal: T.Reply,
152
- id: m,
157
+ id: b,
153
158
  resolution: k.Rejected,
154
159
  returnValue: G(M),
155
160
  returnValueIsError: !0
@@ -170,25 +175,25 @@ const Pe = (r, e) => {
170
175
  f = !0, o.removeEventListener(R.Message, w);
171
176
  };
172
177
  };
173
- let Fe = 0;
174
- const Te = () => ++Fe, le = ".", ue = (r) => r ? r.split(le) : [], Oe = (r) => r.join(le), Re = (r, e) => {
175
- const t = ue(e || "");
176
- return t.push(r), Oe(t);
177
- }, xe = (r, e, t) => {
178
- const n = ue(e);
179
- return n.reduce((o, i, s) => (typeof o[i] > "u" && (o[i] = {}), s === n.length - 1 && (o[i] = t), o[i]), r), r;
180
- }, fe = (r, e) => {
178
+ let Te = 0;
179
+ const Oe = () => ++Te, ue = ".", fe = (n) => n ? n.split(ue) : [], Re = (n) => n.join(ue), xe = (n, e) => {
180
+ const t = fe(e || "");
181
+ return t.push(n), Re(t);
182
+ }, De = (n, e, t) => {
183
+ const r = fe(e);
184
+ return r.reduce((o, i, s) => (typeof o[i] > "u" && (o[i] = {}), s === r.length - 1 && (o[i] = t), o[i]), n), n;
185
+ }, pe = (n, e) => {
181
186
  const t = {};
182
- return Object.keys(r).forEach((n) => {
183
- const o = r[n], i = Re(n, e);
184
- typeof o == "object" && Object.assign(t, fe(o, i)), typeof o == "function" && (t[i] = o);
187
+ return Object.keys(n).forEach((r) => {
188
+ const o = n[r], i = xe(r, e);
189
+ typeof o == "object" && Object.assign(t, pe(o, i)), typeof o == "function" && (t[i] = o);
185
190
  }), t;
186
- }, De = (r) => {
191
+ }, Ie = (n) => {
187
192
  const e = {};
188
- for (const t in r)
189
- xe(e, t, r[t]);
193
+ for (const t in n)
194
+ De(e, t, n[t]);
190
195
  return e;
191
- }, Ie = (r, e, t, n, o) => {
196
+ }, ke = (n, e, t, r, o) => {
192
197
  const {
193
198
  localName: i,
194
199
  local: s,
@@ -196,9 +201,9 @@ const Te = () => ++Fe, le = ".", ue = (r) => r ? r.split(le) : [], Oe = (r) => r
196
201
  originForSending: f,
197
202
  originForReceiving: w
198
203
  } = e;
199
- let b = !1;
204
+ let m = !1;
200
205
  o(`${i}: Connecting call sender`);
201
- const v = (p) => (...m) => {
206
+ const v = (p) => (...b) => {
202
207
  o(`${i}: Sending ${p}() call`);
203
208
  let a;
204
209
  try {
@@ -206,14 +211,14 @@ const Te = () => ++Fe, le = ".", ue = (r) => r ? r.split(le) : [], Oe = (r) => r
206
211
  } catch {
207
212
  a = !0;
208
213
  }
209
- if (a && n(), b) {
214
+ if (a && r(), m) {
210
215
  const y = new Error(
211
216
  `Unable to send ${p}() call due to destroyed connection`
212
217
  );
213
218
  throw y.code = z.ConnectionDestroyed, y;
214
219
  }
215
220
  return new Promise((y, S) => {
216
- const $ = Te(), M = (C) => {
221
+ const $ = Oe(), M = (C) => {
217
222
  if (C.source !== c || C.data.penpal !== T.Reply || C.data.id !== $)
218
223
  return;
219
224
  if (w !== "*" && C.origin !== w) {
@@ -222,14 +227,14 @@ const Te = () => ++Fe, le = ".", ue = (r) => r ? r.split(le) : [], Oe = (r) => r
222
227
  );
223
228
  return;
224
229
  }
225
- const j = C.data;
230
+ const V = C.data;
226
231
  o(`${i}: Received ${p}() reply`), s.removeEventListener(
227
232
  R.Message,
228
233
  M
229
234
  );
230
- let V = j.returnValue;
231
- j.returnValueIsError && (V = _e(V)), (j.resolution === k.Fulfilled ? y : S)(
232
- V
235
+ let j = V.returnValue;
236
+ V.returnValueIsError && (j = Ce(j)), (V.resolution === k.Fulfilled ? y : S)(
237
+ j
233
238
  );
234
239
  };
235
240
  s.addEventListener(R.Message, M);
@@ -237,35 +242,35 @@ const Te = () => ++Fe, le = ".", ue = (r) => r ? r.split(le) : [], Oe = (r) => r
237
242
  penpal: T.Call,
238
243
  id: $,
239
244
  methodName: p,
240
- args: m
245
+ args: b
241
246
  };
242
247
  c.postMessage(_, f);
243
248
  });
244
- }, g = t.reduce((p, m) => (p[m] = v(m), p), {});
245
- return Object.assign(r, De(g)), () => {
246
- b = !0;
249
+ }, g = t.reduce((p, b) => (p[b] = v(b), p), {});
250
+ return Object.assign(n, Ie(g)), () => {
251
+ m = !0;
247
252
  };
248
- }, ke = (r, e) => {
253
+ }, Ve = (n, e) => {
249
254
  let t;
250
- return r !== void 0 && (t = window.setTimeout(() => {
251
- const n = new Error(
252
- `Connection timed out after ${r}ms`
255
+ return n !== void 0 && (t = window.setTimeout(() => {
256
+ const r = new Error(
257
+ `Connection timed out after ${n}ms`
253
258
  );
254
- n.code = z.ConnectionTimeout, e(n);
255
- }, r)), () => {
259
+ r.code = z.ConnectionTimeout, e(r);
260
+ }, n)), () => {
256
261
  clearTimeout(t);
257
262
  };
258
- }, je = "@fn/micro-app-postmate", Ve = "0.1.2", qe = "module", We = "src/index.ts", Ne = {
263
+ }, je = "@fn/micro-app-postmate", We = "0.1.2", qe = "module", Le = "src/index.ts", Ne = {
259
264
  dev: "vite",
260
265
  build: "tsc -b && vite build",
261
266
  lint: "eslint ."
262
- }, Le = [
267
+ }, He = [
263
268
  "src",
264
269
  "dist"
265
- ], He = {
270
+ ], Ue = {
266
271
  "@fn/micro-app-event": "^0.0.1",
267
272
  rxjs: "^7.8.0"
268
- }, Ue = {
273
+ }, Be = {
269
274
  "@eslint/js": "^9.13.0",
270
275
  "@fn/micro-app-event": "workspace:*",
271
276
  eslint: "^9.13.0",
@@ -274,63 +279,63 @@ const Te = () => ++Fe, le = ".", ue = (r) => r ? r.split(le) : [], Oe = (r) => r
274
279
  "typescript-eslint": "^8.11.0",
275
280
  rxjs: "^7.8.0",
276
281
  vite: "^5.4.10"
277
- }, Be = {
278
- registry: "http://verdaccio.teiron-inc.cn:4873"
279
282
  }, Je = {
283
+ registry: "http://verdaccio.teiron-inc.cn:4873"
284
+ }, Ye = {
280
285
  name: je,
281
- version: Ve,
286
+ version: We,
282
287
  type: qe,
283
- main: We,
288
+ main: Le,
284
289
  scripts: Ne,
285
- files: Le,
286
- peerDependencies: He,
287
- devDependencies: Ue,
288
- publishConfig: Be
289
- }, Ye = (r, e, t, n, o) => {
290
- const { destroy: i, onDestroy: s } = n;
290
+ files: He,
291
+ peerDependencies: Ue,
292
+ devDependencies: Be,
293
+ publishConfig: Je
294
+ }, ze = (n, e, t, r, o) => {
295
+ const { destroy: i, onDestroy: s } = r;
291
296
  return (c) => {
292
- if (!(r instanceof RegExp ? r.test(c.origin) : r === "*" || r === c.origin)) {
297
+ if (!(n instanceof RegExp ? n.test(c.origin) : n === "*" || n === c.origin)) {
293
298
  o(
294
- `Child: Handshake - Received SYN-ACK from origin ${c.origin} which did not match expected origin ${r}`
299
+ `Child: Handshake - Received SYN-ACK from origin ${c.origin} which did not match expected origin ${n}`
295
300
  );
296
301
  return;
297
302
  }
298
303
  o("Child: Handshake - Received SYN-ACK, responding with ACK");
299
- const w = c.origin === "null" ? "*" : c.origin, b = {
304
+ const w = c.origin === "null" ? "*" : c.origin, m = {
300
305
  penpal: T.Ack,
301
306
  methodNames: Object.keys(e),
302
307
  config: t
303
308
  };
304
- window.parent.postMessage(b, w);
309
+ window.parent.postMessage(m, w);
305
310
  const v = {
306
311
  localName: "Child",
307
312
  local: window,
308
313
  remote: window.parent,
309
314
  originForSending: w,
310
315
  originForReceiving: c.origin
311
- }, g = Ce(
316
+ }, g = Fe(
312
317
  v,
313
318
  e,
314
319
  o
315
320
  );
316
321
  s(g);
317
- const p = {}, m = Ie(
322
+ const p = {}, b = ke(
318
323
  p,
319
324
  v,
320
325
  c.data.methodNames,
321
326
  i,
322
327
  o
323
328
  );
324
- return s(m), p;
329
+ return s(b), p;
325
330
  };
326
331
  };
327
- function X(r, e) {
328
- console == null || console.warn(`[fnApp warn]: ${r}`, e);
332
+ function X(n, e) {
333
+ console == null || console.warn(`[fnApp warn]: ${n}`, e);
329
334
  }
330
- function Z(r, e) {
331
- console == null || console.error(`[fnApp error]: ${r}`, e);
335
+ function Z(n, e) {
336
+ console == null || console.error(`[fnApp error]: ${n}`, e);
332
337
  }
333
- const I = "_fn_all_event", ee = "事件订阅数量为空", q = window.__POWERED_BY_FNAPP__ ? window.__FNAPP.inject.appEventObjMap : /* @__PURE__ */ new Map();
338
+ const I = "_fn_all_event", ee = "事件订阅数量为空", W = window.__POWERED_BY_FNAPP__ ? window.__FNAPP.inject.appEventObjMap : /* @__PURE__ */ new Map();
334
339
  class te {
335
340
  constructor(e, t) {
336
341
  A(this, "id");
@@ -340,12 +345,12 @@ class te {
340
345
  var t;
341
346
  return ((t = this.eventObj[e]) == null ? void 0 : t.length) || 0;
342
347
  });
343
- console.log("id", e, t), this.id = e, this.appName = t, this.$clear(), q.get(this.id) || q.set(this.id, {}), this.eventObj = q.get(this.id);
348
+ console.log("id", e, t), this.id = e, this.appName = t, this.$clear(), W.get(this.id) || W.set(this.id, {}), this.eventObj = W.get(this.id);
344
349
  }
345
350
  // 监听事件
346
351
  $on(e, t) {
347
- const n = this.eventObj[e];
348
- return n ? (n.includes(t) || n.push(t), this) : (this.eventObj[e] = [t], this);
352
+ const r = this.eventObj[e];
353
+ return r ? (r.includes(t) || r.push(t), this) : (this.eventObj[e] = [t], this);
349
354
  }
350
355
  /** 任何$emit都会导致监听函数触发,第一个参数为事件名,后续的参数为$emit的参数 */
351
356
  $onAll(e) {
@@ -357,13 +362,13 @@ class te {
357
362
  }
358
363
  // 取消监听
359
364
  $off(e, t) {
360
- const n = this.eventObj[e];
361
- if (!e || !n || !n.length)
365
+ const r = this.eventObj[e];
366
+ if (!e || !r || !r.length)
362
367
  return X(`${e} ${ee}`), this;
363
- let o, i = n.length;
368
+ let o, i = r.length;
364
369
  for (; i--; )
365
- if (o = n[i], o === t) {
366
- n.splice(i, 1);
370
+ if (o = r[i], o === t) {
371
+ r.splice(i, 1);
367
372
  break;
368
373
  }
369
374
  return this;
@@ -378,11 +383,11 @@ class te {
378
383
  }
379
384
  // 发送事件
380
385
  $pureEmit(e, ...t) {
381
- let n = 0, o = 0;
382
- return q.forEach((i) => {
386
+ let r = 0, o = 0;
387
+ return W.forEach((i) => {
383
388
  if (i[e])
384
389
  for (let s = i[e].length - 1; s >= 0; s--) {
385
- n++;
390
+ r++;
386
391
  const c = i[e][s];
387
392
  c.$__once && i[e].splice(s, 1);
388
393
  try {
@@ -393,7 +398,7 @@ class te {
393
398
  }
394
399
  if (i[I])
395
400
  for (let s = i[I].length - 1; s >= 0; s--) {
396
- n++;
401
+ r++;
397
402
  const c = i[I][s];
398
403
  c.$__once && i[I].splice(s, 1);
399
404
  try {
@@ -402,99 +407,99 @@ class te {
402
407
  Z(f);
403
408
  }
404
409
  }
405
- }), (!e || n === 0 && o === 0) && X(`${e} ${ee}`), this;
410
+ }), (!e || r === 0 && o === 0) && X(`${e} ${ee}`), this;
406
411
  }
407
412
  // 清空当前所有的监听事件
408
413
  $clear() {
409
- const e = q.get(this.id) ?? {};
410
- return Object.keys(e).forEach((n) => delete e[n]), this;
414
+ const e = W.get(this.id) ?? {};
415
+ return Object.keys(e).forEach((r) => delete e[r]), this;
411
416
  }
412
417
  }
413
- var U = function(r, e) {
414
- return U = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, n) {
415
- t.__proto__ = n;
416
- } || function(t, n) {
417
- for (var o in n) Object.prototype.hasOwnProperty.call(n, o) && (t[o] = n[o]);
418
- }, U(r, e);
418
+ var U = function(n, e) {
419
+ return U = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, r) {
420
+ t.__proto__ = r;
421
+ } || function(t, r) {
422
+ for (var o in r) Object.prototype.hasOwnProperty.call(r, o) && (t[o] = r[o]);
423
+ }, U(n, e);
419
424
  };
420
- function pe(r, e) {
425
+ function de(n, e) {
421
426
  if (typeof e != "function" && e !== null)
422
427
  throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
423
- U(r, e);
428
+ U(n, e);
424
429
  function t() {
425
- this.constructor = r;
430
+ this.constructor = n;
426
431
  }
427
- r.prototype = e === null ? Object.create(e) : (t.prototype = e.prototype, new t());
432
+ n.prototype = e === null ? Object.create(e) : (t.prototype = e.prototype, new t());
428
433
  }
429
- function re(r) {
430
- var e = typeof Symbol == "function" && Symbol.iterator, t = e && r[e], n = 0;
431
- if (t) return t.call(r);
432
- if (r && typeof r.length == "number") return {
434
+ function ne(n) {
435
+ var e = typeof Symbol == "function" && Symbol.iterator, t = e && n[e], r = 0;
436
+ if (t) return t.call(n);
437
+ if (n && typeof n.length == "number") return {
433
438
  next: function() {
434
- return r && n >= r.length && (r = void 0), { value: r && r[n++], done: !r };
439
+ return n && r >= n.length && (n = void 0), { value: n && n[r++], done: !n };
435
440
  }
436
441
  };
437
442
  throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
438
443
  }
439
- function B(r, e) {
440
- var t = typeof Symbol == "function" && r[Symbol.iterator];
441
- if (!t) return r;
442
- var n = t.call(r), o, i = [], s;
444
+ function B(n, e) {
445
+ var t = typeof Symbol == "function" && n[Symbol.iterator];
446
+ if (!t) return n;
447
+ var r = t.call(n), o, i = [], s;
443
448
  try {
444
- for (; (e === void 0 || e-- > 0) && !(o = n.next()).done; ) i.push(o.value);
449
+ for (; (e === void 0 || e-- > 0) && !(o = r.next()).done; ) i.push(o.value);
445
450
  } catch (c) {
446
451
  s = { error: c };
447
452
  } finally {
448
453
  try {
449
- o && !o.done && (t = n.return) && t.call(n);
454
+ o && !o.done && (t = r.return) && t.call(r);
450
455
  } finally {
451
456
  if (s) throw s.error;
452
457
  }
453
458
  }
454
459
  return i;
455
460
  }
456
- function J(r, e, t) {
457
- if (t || arguments.length === 2) for (var n = 0, o = e.length, i; n < o; n++)
458
- (i || !(n in e)) && (i || (i = Array.prototype.slice.call(e, 0, n)), i[n] = e[n]);
459
- return r.concat(i || Array.prototype.slice.call(e));
461
+ function J(n, e, t) {
462
+ if (t || arguments.length === 2) for (var r = 0, o = e.length, i; r < o; r++)
463
+ (i || !(r in e)) && (i || (i = Array.prototype.slice.call(e, 0, r)), i[r] = e[r]);
464
+ return n.concat(i || Array.prototype.slice.call(e));
460
465
  }
461
- function O(r) {
462
- return typeof r == "function";
466
+ function O(n) {
467
+ return typeof n == "function";
463
468
  }
464
- function ze(r) {
465
- var e = function(n) {
466
- Error.call(n), n.stack = new Error().stack;
467
- }, t = r(e);
469
+ function Ke(n) {
470
+ var e = function(r) {
471
+ Error.call(r), r.stack = new Error().stack;
472
+ }, t = n(e);
468
473
  return t.prototype = Object.create(Error.prototype), t.prototype.constructor = t, t;
469
474
  }
470
- var L = ze(function(r) {
475
+ var N = Ke(function(n) {
471
476
  return function(t) {
472
- r(this), this.message = t ? t.length + ` errors occurred during unsubscription:
473
- ` + t.map(function(n, o) {
474
- return o + 1 + ") " + n.toString();
477
+ n(this), this.message = t ? t.length + ` errors occurred during unsubscription:
478
+ ` + t.map(function(r, o) {
479
+ return o + 1 + ") " + r.toString();
475
480
  }).join(`
476
481
  `) : "", this.name = "UnsubscriptionError", this.errors = t;
477
482
  };
478
483
  });
479
- function ne(r, e) {
480
- if (r) {
481
- var t = r.indexOf(e);
482
- 0 <= t && r.splice(t, 1);
484
+ function re(n, e) {
485
+ if (n) {
486
+ var t = n.indexOf(e);
487
+ 0 <= t && n.splice(t, 1);
483
488
  }
484
489
  }
485
490
  var K = function() {
486
- function r(e) {
491
+ function n(e) {
487
492
  this.initialTeardown = e, this.closed = !1, this._parentage = null, this._finalizers = null;
488
493
  }
489
- return r.prototype.unsubscribe = function() {
490
- var e, t, n, o, i;
494
+ return n.prototype.unsubscribe = function() {
495
+ var e, t, r, o, i;
491
496
  if (!this.closed) {
492
497
  this.closed = !0;
493
498
  var s = this._parentage;
494
499
  if (s)
495
500
  if (this._parentage = null, Array.isArray(s))
496
501
  try {
497
- for (var c = re(s), f = c.next(); !f.done; f = c.next()) {
502
+ for (var c = ne(s), f = c.next(); !f.done; f = c.next()) {
498
503
  var w = f.value;
499
504
  w.remove(this);
500
505
  }
@@ -509,110 +514,110 @@ var K = function() {
509
514
  }
510
515
  else
511
516
  s.remove(this);
512
- var b = this.initialTeardown;
513
- if (O(b))
517
+ var m = this.initialTeardown;
518
+ if (O(m))
514
519
  try {
515
- b();
520
+ m();
516
521
  } catch (a) {
517
- i = a instanceof L ? a.errors : [a];
522
+ i = a instanceof N ? a.errors : [a];
518
523
  }
519
524
  var v = this._finalizers;
520
525
  if (v) {
521
526
  this._finalizers = null;
522
527
  try {
523
- for (var g = re(v), p = g.next(); !p.done; p = g.next()) {
524
- var m = p.value;
528
+ for (var g = ne(v), p = g.next(); !p.done; p = g.next()) {
529
+ var b = p.value;
525
530
  try {
526
- ie(m);
531
+ ie(b);
527
532
  } catch (a) {
528
- i = i ?? [], a instanceof L ? i = J(J([], B(i)), B(a.errors)) : i.push(a);
533
+ i = i ?? [], a instanceof N ? i = J(J([], B(i)), B(a.errors)) : i.push(a);
529
534
  }
530
535
  }
531
536
  } catch (a) {
532
- n = { error: a };
537
+ r = { error: a };
533
538
  } finally {
534
539
  try {
535
540
  p && !p.done && (o = g.return) && o.call(g);
536
541
  } finally {
537
- if (n) throw n.error;
542
+ if (r) throw r.error;
538
543
  }
539
544
  }
540
545
  }
541
546
  if (i)
542
- throw new L(i);
547
+ throw new N(i);
543
548
  }
544
- }, r.prototype.add = function(e) {
549
+ }, n.prototype.add = function(e) {
545
550
  var t;
546
551
  if (e && e !== this)
547
552
  if (this.closed)
548
553
  ie(e);
549
554
  else {
550
- if (e instanceof r) {
555
+ if (e instanceof n) {
551
556
  if (e.closed || e._hasParent(this))
552
557
  return;
553
558
  e._addParent(this);
554
559
  }
555
560
  (this._finalizers = (t = this._finalizers) !== null && t !== void 0 ? t : []).push(e);
556
561
  }
557
- }, r.prototype._hasParent = function(e) {
562
+ }, n.prototype._hasParent = function(e) {
558
563
  var t = this._parentage;
559
564
  return t === e || Array.isArray(t) && t.includes(e);
560
- }, r.prototype._addParent = function(e) {
565
+ }, n.prototype._addParent = function(e) {
561
566
  var t = this._parentage;
562
567
  this._parentage = Array.isArray(t) ? (t.push(e), t) : t ? [t, e] : e;
563
- }, r.prototype._removeParent = function(e) {
568
+ }, n.prototype._removeParent = function(e) {
564
569
  var t = this._parentage;
565
- t === e ? this._parentage = null : Array.isArray(t) && ne(t, e);
566
- }, r.prototype.remove = function(e) {
570
+ t === e ? this._parentage = null : Array.isArray(t) && re(t, e);
571
+ }, n.prototype.remove = function(e) {
567
572
  var t = this._finalizers;
568
- t && ne(t, e), e instanceof r && e._removeParent(this);
569
- }, r.EMPTY = function() {
570
- var e = new r();
573
+ t && re(t, e), e instanceof n && e._removeParent(this);
574
+ }, n.EMPTY = function() {
575
+ var e = new n();
571
576
  return e.closed = !0, e;
572
- }(), r;
577
+ }(), n;
573
578
  }();
574
579
  K.EMPTY;
575
- function de(r) {
576
- return r instanceof K || r && "closed" in r && O(r.remove) && O(r.add) && O(r.unsubscribe);
580
+ function he(n) {
581
+ return n instanceof K || n && "closed" in n && O(n.remove) && O(n.add) && O(n.unsubscribe);
577
582
  }
578
- function ie(r) {
579
- O(r) ? r() : r.unsubscribe();
583
+ function ie(n) {
584
+ O(n) ? n() : n.unsubscribe();
580
585
  }
581
- var he = {
586
+ var ge = {
582
587
  onUnhandledError: null,
583
588
  onStoppedNotification: null,
584
589
  Promise: void 0,
585
590
  useDeprecatedSynchronousErrorHandling: !1,
586
591
  useDeprecatedNextContext: !1
587
- }, Ke = {
588
- setTimeout: function(r, e) {
589
- for (var t = [], n = 2; n < arguments.length; n++)
590
- t[n - 2] = arguments[n];
591
- return setTimeout.apply(void 0, J([r, e], B(t)));
592
+ }, Qe = {
593
+ setTimeout: function(n, e) {
594
+ for (var t = [], r = 2; r < arguments.length; r++)
595
+ t[r - 2] = arguments[r];
596
+ return setTimeout.apply(void 0, J([n, e], B(t)));
592
597
  },
593
- clearTimeout: function(r) {
594
- return clearTimeout(r);
598
+ clearTimeout: function(n) {
599
+ return clearTimeout(n);
595
600
  },
596
601
  delegate: void 0
597
602
  };
598
- function Qe(r) {
599
- Ke.setTimeout(function() {
600
- throw r;
603
+ function Ge(n) {
604
+ Qe.setTimeout(function() {
605
+ throw n;
601
606
  });
602
607
  }
603
608
  function oe() {
604
609
  }
605
- function Ge(r) {
606
- r();
610
+ function Xe(n) {
611
+ n();
607
612
  }
608
- var ge = function(r) {
609
- pe(e, r);
613
+ var ye = function(n) {
614
+ de(e, n);
610
615
  function e(t) {
611
- var n = r.call(this) || this;
612
- return n.isStopped = !1, t ? (n.destination = t, de(t) && t.add(n)) : n.destination = tt, n;
616
+ var r = n.call(this) || this;
617
+ return r.isStopped = !1, t ? (r.destination = t, he(t) && t.add(r)) : r.destination = nt, r;
613
618
  }
614
- return e.create = function(t, n, o) {
615
- return new Y(t, n, o);
619
+ return e.create = function(t, r, o) {
620
+ return new Y(t, r, o);
616
621
  }, e.prototype.next = function(t) {
617
622
  this.isStopped || this._next(t);
618
623
  }, e.prototype.error = function(t) {
@@ -620,7 +625,7 @@ var ge = function(r) {
620
625
  }, e.prototype.complete = function() {
621
626
  this.isStopped || (this.isStopped = !0, this._complete());
622
627
  }, e.prototype.unsubscribe = function() {
623
- this.closed || (this.isStopped = !0, r.prototype.unsubscribe.call(this), this.destination = null);
628
+ this.closed || (this.isStopped = !0, n.prototype.unsubscribe.call(this), this.destination = null);
624
629
  }, e.prototype._next = function(t) {
625
630
  this.destination.next(t);
626
631
  }, e.prototype._error = function(t) {
@@ -636,54 +641,54 @@ var ge = function(r) {
636
641
  this.unsubscribe();
637
642
  }
638
643
  }, e;
639
- }(K), Xe = Function.prototype.bind;
640
- function H(r, e) {
641
- return Xe.call(r, e);
644
+ }(K), Ze = Function.prototype.bind;
645
+ function H(n, e) {
646
+ return Ze.call(n, e);
642
647
  }
643
- var Ze = function() {
644
- function r(e) {
648
+ var et = function() {
649
+ function n(e) {
645
650
  this.partialObserver = e;
646
651
  }
647
- return r.prototype.next = function(e) {
652
+ return n.prototype.next = function(e) {
648
653
  var t = this.partialObserver;
649
654
  if (t.next)
650
655
  try {
651
656
  t.next(e);
652
- } catch (n) {
653
- N(n);
657
+ } catch (r) {
658
+ L(r);
654
659
  }
655
- }, r.prototype.error = function(e) {
660
+ }, n.prototype.error = function(e) {
656
661
  var t = this.partialObserver;
657
662
  if (t.error)
658
663
  try {
659
664
  t.error(e);
660
- } catch (n) {
661
- N(n);
665
+ } catch (r) {
666
+ L(r);
662
667
  }
663
668
  else
664
- N(e);
665
- }, r.prototype.complete = function() {
669
+ L(e);
670
+ }, n.prototype.complete = function() {
666
671
  var e = this.partialObserver;
667
672
  if (e.complete)
668
673
  try {
669
674
  e.complete();
670
675
  } catch (t) {
671
- N(t);
676
+ L(t);
672
677
  }
673
- }, r;
674
- }(), Y = function(r) {
675
- pe(e, r);
676
- function e(t, n, o) {
677
- var i = r.call(this) || this, s;
678
+ }, n;
679
+ }(), Y = function(n) {
680
+ de(e, n);
681
+ function e(t, r, o) {
682
+ var i = n.call(this) || this, s;
678
683
  if (O(t) || !t)
679
684
  s = {
680
685
  next: t ?? void 0,
681
- error: n ?? void 0,
686
+ error: r ?? void 0,
682
687
  complete: o ?? void 0
683
688
  };
684
689
  else {
685
690
  var c;
686
- i && he.useDeprecatedNextContext ? (c = Object.create(t), c.unsubscribe = function() {
691
+ i && ge.useDeprecatedNextContext ? (c = Object.create(t), c.unsubscribe = function() {
687
692
  return i.unsubscribe();
688
693
  }, s = {
689
694
  next: t.next && H(t.next, c),
@@ -691,55 +696,55 @@ var Ze = function() {
691
696
  complete: t.complete && H(t.complete, c)
692
697
  }) : s = t;
693
698
  }
694
- return i.destination = new Ze(s), i;
699
+ return i.destination = new et(s), i;
695
700
  }
696
701
  return e;
697
- }(ge);
698
- function N(r) {
699
- Qe(r);
702
+ }(ye);
703
+ function L(n) {
704
+ Ge(n);
700
705
  }
701
- function et(r) {
702
- throw r;
706
+ function tt(n) {
707
+ throw n;
703
708
  }
704
- var tt = {
709
+ var nt = {
705
710
  closed: !0,
706
711
  next: oe,
707
- error: et,
712
+ error: tt,
708
713
  complete: oe
709
714
  }, rt = function() {
710
715
  return typeof Symbol == "function" && Symbol.observable || "@@observable";
711
716
  }();
712
- function nt(r) {
713
- return r;
717
+ function it(n) {
718
+ return n;
714
719
  }
715
- function it(r) {
716
- return r.length === 0 ? nt : r.length === 1 ? r[0] : function(t) {
717
- return r.reduce(function(n, o) {
718
- return o(n);
720
+ function ot(n) {
721
+ return n.length === 0 ? it : n.length === 1 ? n[0] : function(t) {
722
+ return n.reduce(function(r, o) {
723
+ return o(r);
719
724
  }, t);
720
725
  };
721
726
  }
722
- var ot = function() {
723
- function r(e) {
727
+ var st = function() {
728
+ function n(e) {
724
729
  e && (this._subscribe = e);
725
730
  }
726
- return r.prototype.lift = function(e) {
727
- var t = new r();
731
+ return n.prototype.lift = function(e) {
732
+ var t = new n();
728
733
  return t.source = this, t.operator = e, t;
729
- }, r.prototype.subscribe = function(e, t, n) {
730
- var o = this, i = ct(e) ? e : new Y(e, t, n);
731
- return Ge(function() {
734
+ }, n.prototype.subscribe = function(e, t, r) {
735
+ var o = this, i = at(e) ? e : new Y(e, t, r);
736
+ return Xe(function() {
732
737
  var s = o, c = s.operator, f = s.source;
733
738
  i.add(c ? c.call(i, f) : f ? o._subscribe(i) : o._trySubscribe(i));
734
739
  }), i;
735
- }, r.prototype._trySubscribe = function(e) {
740
+ }, n.prototype._trySubscribe = function(e) {
736
741
  try {
737
742
  return this._subscribe(e);
738
743
  } catch (t) {
739
744
  e.error(t);
740
745
  }
741
- }, r.prototype.forEach = function(e, t) {
742
- var n = this;
746
+ }, n.prototype.forEach = function(e, t) {
747
+ var r = this;
743
748
  return t = se(t), new t(function(o, i) {
744
749
  var s = new Y({
745
750
  next: function(c) {
@@ -752,52 +757,52 @@ var ot = function() {
752
757
  error: i,
753
758
  complete: o
754
759
  });
755
- n.subscribe(s);
760
+ r.subscribe(s);
756
761
  });
757
- }, r.prototype._subscribe = function(e) {
762
+ }, n.prototype._subscribe = function(e) {
758
763
  var t;
759
764
  return (t = this.source) === null || t === void 0 ? void 0 : t.subscribe(e);
760
- }, r.prototype[rt] = function() {
765
+ }, n.prototype[rt] = function() {
761
766
  return this;
762
- }, r.prototype.pipe = function() {
767
+ }, n.prototype.pipe = function() {
763
768
  for (var e = [], t = 0; t < arguments.length; t++)
764
769
  e[t] = arguments[t];
765
- return it(e)(this);
766
- }, r.prototype.toPromise = function(e) {
770
+ return ot(e)(this);
771
+ }, n.prototype.toPromise = function(e) {
767
772
  var t = this;
768
- return e = se(e), new e(function(n, o) {
773
+ return e = se(e), new e(function(r, o) {
769
774
  var i;
770
775
  t.subscribe(function(s) {
771
776
  return i = s;
772
777
  }, function(s) {
773
778
  return o(s);
774
779
  }, function() {
775
- return n(i);
780
+ return r(i);
776
781
  });
777
782
  });
778
- }, r.create = function(e) {
779
- return new r(e);
780
- }, r;
783
+ }, n.create = function(e) {
784
+ return new n(e);
785
+ }, n;
781
786
  }();
782
- function se(r) {
787
+ function se(n) {
783
788
  var e;
784
- return (e = r ?? he.Promise) !== null && e !== void 0 ? e : Promise;
789
+ return (e = n ?? ge.Promise) !== null && e !== void 0 ? e : Promise;
785
790
  }
786
- function st(r) {
787
- return r && O(r.next) && O(r.error) && O(r.complete);
791
+ function ct(n) {
792
+ return n && O(n.next) && O(n.error) && O(n.complete);
788
793
  }
789
- function ct(r) {
790
- return r && r instanceof ge || st(r) && de(r);
794
+ function at(n) {
795
+ return n && n instanceof ye || ct(n) && he(n);
791
796
  }
792
- const at = () => {
797
+ const lt = () => {
793
798
  try {
794
799
  clearTimeout(void 0);
795
800
  } catch {
796
801
  return !1;
797
802
  }
798
803
  return !0;
799
- }, lt = (r = {}) => {
800
- const { parentOrigin: e = "*", timeout: t, debug: n = !1, config: o = {} } = r, i = Me(n), s = Pe("App", i), { destroy: c, onDestroy: f } = s, w = () => {
804
+ }, ut = (n = {}) => {
805
+ const { parentOrigin: e = "*", timeout: t, debug: r = !1, config: o = {} } = n, i = _e(r), s = Me("App", i), { destroy: c, onDestroy: f } = s, w = () => {
801
806
  i("Child: Handshake - Sending SYN");
802
807
  const v = { penpal: T.Syn }, g = e instanceof RegExp ? "*" : e;
803
808
  window.parent.postMessage(v, g);
@@ -805,9 +810,9 @@ const at = () => {
805
810
  return {
806
811
  promise: new Promise(
807
812
  (v, g) => {
808
- const p = ke(t, c), m = (a) => {
809
- if (at() && !(a.source !== parent || !a.data) && a.data.penpal === T.SynAck) {
810
- const y = a.data, S = new te(y.id, y.appName), $ = new te(y.id + "/api", y.appName), M = y.id, _ = {}, C = (l) => "api/" + l, j = {
813
+ const p = Ve(t, c), b = (a) => {
814
+ if (lt() && !(a.source !== parent || !a.data) && a.data.penpal === T.SynAck) {
815
+ const y = a.data, S = new te(y.id, y.appName), $ = new te(y.id + "/api", y.appName), M = y.id, _ = {}, C = (l) => "api/" + l, V = {
811
816
  $emit: (l, ...u) => {
812
817
  S.getEventCallBackLength(l) > 0 ? S.$pureEmit(l, ...u) : _ == null || _.$off(l, () => {
813
818
  }, !0);
@@ -817,28 +822,28 @@ const at = () => {
817
822
  },
818
823
  onOsNotify: (l) => {
819
824
  }
820
- }, V = (l) => function(h) {
825
+ }, j = (l) => function(h) {
821
826
  const P = C(l);
822
827
  $.$on(P, function D(E) {
823
828
  h.next(E), E.reqid && E.result === "succ" && (h.complete(), $.$off(P, D));
824
829
  });
825
- }, ye = fe(j), x = Ye(
830
+ }, be = pe(V), x = ze(
826
831
  e,
827
- ye,
832
+ be,
828
833
  {
829
834
  ...o,
830
- postmateVersion: Je.version
835
+ postmateVersion: Ye.version
831
836
  },
832
837
  s,
833
838
  i
834
839
  )(
835
840
  a
836
- ), F = {}, W = x.bus;
837
- if (W) {
841
+ ), F = {}, q = x.bus;
842
+ if (q) {
838
843
  const l = (u, h, P) => {
839
- P ? (h.$__once = !0, S.$once(u, h)) : S.$on(u, h), F[u] ? F[u].push(h) : (F[u] = [h], W.$on(u, M));
844
+ P ? (h.$__once = !0, S.$once(u, h)) : S.$on(u, h), F[u] ? F[u].push(h) : (F[u] = [h], q.$on(u, M));
840
845
  };
841
- Object.assign(_, W, {
846
+ Object.assign(_, q, {
842
847
  $on: l,
843
848
  $off: (u, h, P) => {
844
849
  var D;
@@ -846,7 +851,7 @@ const at = () => {
846
851
  const E = F[u].indexOf(h);
847
852
  E > -1 && (F[u].splice(E, 1), S.$off(u, h));
848
853
  }
849
- P && delete F[u], (D = F[u]) != null && D.length || (W.$off(u, M), delete F[u]);
854
+ P && delete F[u], (D = F[u]) != null && D.length || (q.$off(u, M), delete F[u]);
850
855
  },
851
856
  $once: (u, h) => {
852
857
  l(u, h, !0);
@@ -871,8 +876,8 @@ const at = () => {
871
876
  });
872
877
  },
873
878
  createObservableQuery: async (l, u = {}) => {
874
- const h = (l == null ? void 0 : l.reqid) || await x.genReqId(), P = new ot(
875
- V(h)
879
+ const h = (l == null ? void 0 : l.reqid) || await x.genReqId(), P = new st(
880
+ j(h)
876
881
  );
877
882
  return x.query(
878
883
  {
@@ -886,14 +891,14 @@ const at = () => {
886
891
  ), P;
887
892
  }
888
893
  };
889
- x && (window.removeEventListener(R.Message, m), p(), v({
894
+ x && (window.removeEventListener(R.Message, b), p(), v({
890
895
  methods: me,
891
896
  config: a.data.config
892
897
  }));
893
898
  }
894
899
  };
895
- window.addEventListener(R.Message, m), w(), f((a) => {
896
- window.removeEventListener(R.Message, m), a && g(a);
900
+ window.addEventListener(R.Message, b), w(), f((a) => {
901
+ window.removeEventListener(R.Message, b), a && g(a);
897
902
  });
898
903
  }
899
904
  ),
@@ -901,10 +906,10 @@ const at = () => {
901
906
  c();
902
907
  }
903
908
  };
904
- }, ut = (r) => lt({
905
- debug: r == null ? void 0 : r.debug
909
+ }, ft = (n) => ut({
910
+ debug: n == null ? void 0 : n.debug
906
911
  }).promise;
907
- class dt {
912
+ class ht {
908
913
  constructor(e = {}) {
909
914
  A(this, "options");
910
915
  A(this, "flutterInAppWebView", null);
@@ -915,15 +920,15 @@ class dt {
915
920
  }
916
921
  async init() {
917
922
  return d.log("Starting initialization..."), new Promise((e) => {
918
- ce() ? (this.isWeb = !1, d.log("Initializing mobile platform..."), Se().then((t) => {
923
+ ce() ? (this.isWeb = !1, d.log("Initializing mobile platform..."), Ae().then((t) => {
919
924
  this.flutterInAppWebView = t, d.log("Mobile platform initialized"), e();
920
- })) : (this.isWeb = !0, d.log("Initializing web platform..."), ut().then((t) => {
925
+ })) : (this.isWeb = !0, d.log("Initializing web platform..."), ft().then((t) => {
921
926
  this.osConnector = t, d.log("Web platform initialized"), e();
922
927
  }));
923
928
  });
924
929
  }
925
930
  async callAppMethod(e, t) {
926
- return this.flutterInAppWebView ? Ae(this.flutterInAppWebView, e, t) : null;
931
+ return this.flutterInAppWebView ? $e(this.flutterInAppWebView, e, t) : null;
927
932
  }
928
933
  /**
929
934
  * 等待初始化完成
@@ -1009,17 +1014,15 @@ class dt {
1009
1014
  */
1010
1015
  async close() {
1011
1016
  var e;
1012
- if (await this.initPromise, this.isWeb)
1013
- return (e = this.osConnector) == null ? void 0 : e.methods.close();
1014
- throw new Error("close is not supported on mobile platform");
1017
+ return await this.initPromise, this.isWeb ? (e = this.osConnector) == null ? void 0 : e.methods.close() : this.callAppMethod("exitPage");
1015
1018
  }
1016
1019
  /**
1017
1020
  * 请求接口
1018
1021
  */
1019
1022
  async query(e, t) {
1020
- var n;
1023
+ var r;
1021
1024
  if (await this.initPromise, this.isWeb) {
1022
- const o = await ((n = this.osConnector) == null ? void 0 : n.methods.query(e, t));
1025
+ const o = await ((r = this.osConnector) == null ? void 0 : r.methods.query(e, t));
1023
1026
  if (!o)
1024
1027
  throw new Error("Failed to query");
1025
1028
  return o;
@@ -1035,6 +1038,6 @@ class dt {
1035
1038
  }
1036
1039
  }
1037
1040
  export {
1038
- dt as TrimApp,
1039
- dt as default
1041
+ ht as TrimApp,
1042
+ ht as default
1040
1043
  };