superapp-miniapp-invoke-native 1.0.36 → 1.0.38
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/lib/main.js
CHANGED
|
@@ -8,12 +8,12 @@ const ie = (t) => {
|
|
|
8
8
|
const r = t.CapacitorPlatforms || {
|
|
9
9
|
currentPlatform: { name: "web" },
|
|
10
10
|
platforms: e
|
|
11
|
-
},
|
|
11
|
+
}, o = (a, i) => {
|
|
12
12
|
r.platforms.set(a, i);
|
|
13
13
|
}, n = (a) => {
|
|
14
14
|
r.platforms.has(a) && (r.currentPlatform = r.platforms.get(a));
|
|
15
15
|
};
|
|
16
|
-
return r.addPlatform =
|
|
16
|
+
return r.addPlatform = o, r.setPlatform = n, r;
|
|
17
17
|
}, le = (t) => t.CapacitorPlatforms = ie(t), R = /* @__PURE__ */ le(typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {});
|
|
18
18
|
R.addPlatform;
|
|
19
19
|
R.setPlatform;
|
|
@@ -22,72 +22,72 @@ var L;
|
|
|
22
22
|
t.Unimplemented = "UNIMPLEMENTED", t.Unavailable = "UNAVAILABLE";
|
|
23
23
|
})(L || (L = {}));
|
|
24
24
|
class E extends Error {
|
|
25
|
-
constructor(e, r,
|
|
26
|
-
super(e), this.message = e, this.code = r, this.data =
|
|
25
|
+
constructor(e, r, o) {
|
|
26
|
+
super(e), this.message = e, this.code = r, this.data = o;
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
const ce = (t) => {
|
|
30
30
|
var e, r;
|
|
31
31
|
return t != null && t.androidBridge ? "android" : !((r = (e = t == null ? void 0 : t.webkit) === null || e === void 0 ? void 0 : e.messageHandlers) === null || r === void 0) && r.bridge ? "ios" : "web";
|
|
32
32
|
}, de = (t) => {
|
|
33
|
-
var e, r,
|
|
34
|
-
const i = t.CapacitorCustomPlatform || null,
|
|
33
|
+
var e, r, o, n, a;
|
|
34
|
+
const i = t.CapacitorCustomPlatform || null, s = t.Capacitor || {}, u = s.Plugins = s.Plugins || {}, l = t.CapacitorPlatforms, O = () => i !== null ? i.name : ce(t), b = ((e = l == null ? void 0 : l.currentPlatform) === null || e === void 0 ? void 0 : e.getPlatform) || O, j = () => b() !== "web", z = ((r = l == null ? void 0 : l.currentPlatform) === null || r === void 0 ? void 0 : r.isNativePlatform) || j, Q = (c) => {
|
|
35
35
|
const d = H.get(c);
|
|
36
36
|
return !!(d != null && d.platforms.has(b()) || B(c));
|
|
37
|
-
}, X = ((
|
|
37
|
+
}, X = ((o = l == null ? void 0 : l.currentPlatform) === null || o === void 0 ? void 0 : o.isPluginAvailable) || Q, Y = (c) => {
|
|
38
38
|
var d;
|
|
39
|
-
return (d =
|
|
39
|
+
return (d = s.PluginHeaders) === null || d === void 0 ? void 0 : d.find((y) => y.name === c);
|
|
40
40
|
}, B = ((n = l == null ? void 0 : l.currentPlatform) === null || n === void 0 ? void 0 : n.getPluginHeader) || Y, Z = (c) => t.console.error(c), V = (c, d, y) => Promise.reject(`${y} does not have an implementation of "${d}".`), H = /* @__PURE__ */ new Map(), ee = (c, d = {}) => {
|
|
41
41
|
const y = H.get(c);
|
|
42
42
|
if (y)
|
|
43
43
|
return console.warn(`Capacitor plugin "${c}" already registered. Cannot register plugins twice.`), y.proxy;
|
|
44
44
|
const P = b(), C = B(c);
|
|
45
45
|
let w;
|
|
46
|
-
const re = async () => (!w && P in d ? w = typeof d[P] == "function" ? w = await d[P]() : w = d[P] : i !== null && !w && "web" in d && (w = typeof d.web == "function" ? w = await d.web() : w = d.web), w), ne = (
|
|
46
|
+
const re = async () => (!w && P in d ? w = typeof d[P] == "function" ? w = await d[P]() : w = d[P] : i !== null && !w && "web" in d && (w = typeof d.web == "function" ? w = await d.web() : w = d.web), w), ne = (f, g) => {
|
|
47
47
|
var m, v;
|
|
48
48
|
if (C) {
|
|
49
|
-
const h = C == null ? void 0 : C.methods.find((
|
|
49
|
+
const h = C == null ? void 0 : C.methods.find((p) => g === p.name);
|
|
50
50
|
if (h)
|
|
51
|
-
return h.rtype === "promise" ? (
|
|
52
|
-
if (
|
|
53
|
-
return (m =
|
|
51
|
+
return h.rtype === "promise" ? (p) => s.nativePromise(c, g.toString(), p) : (p, x) => s.nativeCallback(c, g.toString(), p, x);
|
|
52
|
+
if (f)
|
|
53
|
+
return (m = f[g]) === null || m === void 0 ? void 0 : m.bind(f);
|
|
54
54
|
} else {
|
|
55
|
-
if (
|
|
56
|
-
return (v =
|
|
55
|
+
if (f)
|
|
56
|
+
return (v = f[g]) === null || v === void 0 ? void 0 : v.bind(f);
|
|
57
57
|
throw new E(`"${c}" plugin is not implemented on ${P}`, L.Unimplemented);
|
|
58
58
|
}
|
|
59
|
-
}, S = (
|
|
60
|
-
let
|
|
59
|
+
}, S = (f) => {
|
|
60
|
+
let g;
|
|
61
61
|
const m = (...v) => {
|
|
62
|
-
const h = re().then((
|
|
63
|
-
const x = ne(
|
|
62
|
+
const h = re().then((p) => {
|
|
63
|
+
const x = ne(p, f);
|
|
64
64
|
if (x) {
|
|
65
65
|
const U = x(...v);
|
|
66
|
-
return
|
|
66
|
+
return g = U == null ? void 0 : U.remove, U;
|
|
67
67
|
} else
|
|
68
|
-
throw new E(`"${c}.${
|
|
68
|
+
throw new E(`"${c}.${f}()" is not implemented on ${P}`, L.Unimplemented);
|
|
69
69
|
});
|
|
70
|
-
return
|
|
70
|
+
return f === "addListener" && (h.remove = async () => g()), h;
|
|
71
71
|
};
|
|
72
|
-
return m.toString = () => `${
|
|
73
|
-
value:
|
|
72
|
+
return m.toString = () => `${f.toString()}() { [capacitor code] }`, Object.defineProperty(m, "name", {
|
|
73
|
+
value: f,
|
|
74
74
|
writable: !1,
|
|
75
75
|
configurable: !1
|
|
76
76
|
}), m;
|
|
77
|
-
}, G = S("addListener"), J = S("removeListener"), ae = (
|
|
78
|
-
const m = G({ eventName:
|
|
79
|
-
const
|
|
77
|
+
}, G = S("addListener"), J = S("removeListener"), ae = (f, g) => {
|
|
78
|
+
const m = G({ eventName: f }, g), v = async () => {
|
|
79
|
+
const p = await m;
|
|
80
80
|
J({
|
|
81
|
-
eventName:
|
|
82
|
-
callbackId:
|
|
83
|
-
},
|
|
84
|
-
}, h = new Promise((
|
|
81
|
+
eventName: f,
|
|
82
|
+
callbackId: p
|
|
83
|
+
}, g);
|
|
84
|
+
}, h = new Promise((p) => m.then(() => p({ remove: v })));
|
|
85
85
|
return h.remove = async () => {
|
|
86
86
|
console.warn("Using addListener() without 'await' is deprecated."), await v();
|
|
87
87
|
}, h;
|
|
88
88
|
}, T = new Proxy({}, {
|
|
89
|
-
get(
|
|
90
|
-
switch (
|
|
89
|
+
get(f, g) {
|
|
90
|
+
switch (g) {
|
|
91
91
|
case "$$typeof":
|
|
92
92
|
return;
|
|
93
93
|
case "toJSON":
|
|
@@ -97,11 +97,11 @@ const ce = (t) => {
|
|
|
97
97
|
case "removeListener":
|
|
98
98
|
return J;
|
|
99
99
|
default:
|
|
100
|
-
return S(
|
|
100
|
+
return S(g);
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
});
|
|
104
|
-
return
|
|
104
|
+
return u[c] = T, H.set(c, {
|
|
105
105
|
name: c,
|
|
106
106
|
proxy: T,
|
|
107
107
|
platforms: /* @__PURE__ */ new Set([
|
|
@@ -110,7 +110,7 @@ const ce = (t) => {
|
|
|
110
110
|
])
|
|
111
111
|
}), T;
|
|
112
112
|
}, te = ((a = l == null ? void 0 : l.currentPlatform) === null || a === void 0 ? void 0 : a.registerPlugin) || ee;
|
|
113
|
-
return
|
|
113
|
+
return s.convertFileSrc || (s.convertFileSrc = (c) => c), s.getPlatform = b, s.handleError = Z, s.isNativePlatform = z, s.isPluginAvailable = X, s.pluginMethodNoop = V, s.registerPlugin = te, s.Exception = E, s.DEBUG = !!s.DEBUG, s.isLoggingEnabled = !!s.isLoggingEnabled, s.platform = s.getPlatform(), s.isNative = s.isNativePlatform(), s;
|
|
114
114
|
}, ue = (t) => t.Capacitor = de(t), A = /* @__PURE__ */ ue(typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {}), N = A.registerPlugin;
|
|
115
115
|
A.Plugins;
|
|
116
116
|
class M {
|
|
@@ -135,8 +135,8 @@ class M {
|
|
|
135
135
|
this.windowListeners = {};
|
|
136
136
|
}
|
|
137
137
|
notifyListeners(e, r) {
|
|
138
|
-
const
|
|
139
|
-
|
|
138
|
+
const o = this.listeners[e];
|
|
139
|
+
o && o.forEach((n) => n(r));
|
|
140
140
|
}
|
|
141
141
|
hasListeners(e) {
|
|
142
142
|
return !!this.listeners[e].length;
|
|
@@ -146,8 +146,8 @@ class M {
|
|
|
146
146
|
registered: !1,
|
|
147
147
|
windowEventName: e,
|
|
148
148
|
pluginEventName: r,
|
|
149
|
-
handler: (
|
|
150
|
-
this.notifyListeners(r,
|
|
149
|
+
handler: (o) => {
|
|
150
|
+
this.notifyListeners(r, o);
|
|
151
151
|
}
|
|
152
152
|
};
|
|
153
153
|
}
|
|
@@ -158,10 +158,10 @@ class M {
|
|
|
158
158
|
return new A.Exception(e, L.Unavailable);
|
|
159
159
|
}
|
|
160
160
|
async removeListener(e, r) {
|
|
161
|
-
const
|
|
162
|
-
if (!
|
|
161
|
+
const o = this.listeners[e];
|
|
162
|
+
if (!o)
|
|
163
163
|
return;
|
|
164
|
-
const n =
|
|
164
|
+
const n = o.indexOf(r);
|
|
165
165
|
this.listeners[e].splice(n, 1), this.listeners[e].length || this.removeWindowListener(this.windowListeners[e]);
|
|
166
166
|
}
|
|
167
167
|
addWindowListener(e) {
|
|
@@ -175,17 +175,17 @@ const F = (t) => encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g, decodeURI
|
|
|
175
175
|
class fe extends M {
|
|
176
176
|
async getCookies() {
|
|
177
177
|
const e = document.cookie, r = {};
|
|
178
|
-
return e.split(";").forEach((
|
|
179
|
-
if (
|
|
178
|
+
return e.split(";").forEach((o) => {
|
|
179
|
+
if (o.length <= 0)
|
|
180
180
|
return;
|
|
181
|
-
let [n, a] =
|
|
181
|
+
let [n, a] = o.replace(/=/, "CAP_COOKIE").split("CAP_COOKIE");
|
|
182
182
|
n = K(n).trim(), a = K(a).trim(), r[n] = a;
|
|
183
183
|
}), r;
|
|
184
184
|
}
|
|
185
185
|
async setCookie(e) {
|
|
186
186
|
try {
|
|
187
|
-
const r = F(e.key),
|
|
188
|
-
document.cookie = `${r}=${
|
|
187
|
+
const r = F(e.key), o = F(e.value), n = `; expires=${(e.expires || "").replace("expires=", "")}`, a = (e.path || "/").replace("path=", ""), i = e.url != null && e.url.length > 0 ? `domain=${e.url}` : "";
|
|
188
|
+
document.cookie = `${r}=${o || ""}${n}; path=${a}; ${i};`;
|
|
189
189
|
} catch (r) {
|
|
190
190
|
return Promise.reject(r);
|
|
191
191
|
}
|
|
@@ -217,39 +217,39 @@ class fe extends M {
|
|
|
217
217
|
N("CapacitorCookies", {
|
|
218
218
|
web: () => new fe()
|
|
219
219
|
});
|
|
220
|
-
const
|
|
221
|
-
const
|
|
222
|
-
|
|
223
|
-
const n =
|
|
220
|
+
const ge = async (t) => new Promise((e, r) => {
|
|
221
|
+
const o = new FileReader();
|
|
222
|
+
o.onload = () => {
|
|
223
|
+
const n = o.result;
|
|
224
224
|
e(n.indexOf(",") >= 0 ? n.split(",")[1] : n);
|
|
225
|
-
},
|
|
226
|
-
}),
|
|
225
|
+
}, o.onerror = (n) => r(n), o.readAsDataURL(t);
|
|
226
|
+
}), pe = (t = {}) => {
|
|
227
227
|
const e = Object.keys(t);
|
|
228
228
|
return Object.keys(t).map((n) => n.toLocaleLowerCase()).reduce((n, a, i) => (n[a] = t[e[i]], n), {});
|
|
229
|
-
}, me = (t, e = !0) => t ? Object.entries(t).reduce((
|
|
229
|
+
}, me = (t, e = !0) => t ? Object.entries(t).reduce((o, n) => {
|
|
230
230
|
const [a, i] = n;
|
|
231
|
-
let
|
|
232
|
-
return Array.isArray(i) ? (
|
|
233
|
-
|
|
234
|
-
}),
|
|
231
|
+
let s, u;
|
|
232
|
+
return Array.isArray(i) ? (u = "", i.forEach((l) => {
|
|
233
|
+
s = e ? encodeURIComponent(l) : l, u += `${a}=${s}&`;
|
|
234
|
+
}), u.slice(0, -1)) : (s = e ? encodeURIComponent(i) : i, u = `${a}=${s}`), `${o}&${u}`;
|
|
235
235
|
}, "").substr(1) : null, we = (t, e = {}) => {
|
|
236
|
-
const r = Object.assign({ method: t.method || "GET", headers: t.headers }, e), n =
|
|
236
|
+
const r = Object.assign({ method: t.method || "GET", headers: t.headers }, e), n = pe(t.headers)["content-type"] || "";
|
|
237
237
|
if (typeof t.data == "string")
|
|
238
238
|
r.body = t.data;
|
|
239
239
|
else if (n.includes("application/x-www-form-urlencoded")) {
|
|
240
240
|
const a = new URLSearchParams();
|
|
241
|
-
for (const [i,
|
|
242
|
-
a.set(i,
|
|
241
|
+
for (const [i, s] of Object.entries(t.data || {}))
|
|
242
|
+
a.set(i, s);
|
|
243
243
|
r.body = a.toString();
|
|
244
244
|
} else if (n.includes("multipart/form-data")) {
|
|
245
245
|
const a = new FormData();
|
|
246
246
|
if (t.data instanceof FormData)
|
|
247
|
-
t.data.forEach((
|
|
248
|
-
a.append(
|
|
247
|
+
t.data.forEach((s, u) => {
|
|
248
|
+
a.append(u, s);
|
|
249
249
|
});
|
|
250
250
|
else
|
|
251
|
-
for (const
|
|
252
|
-
a.append(
|
|
251
|
+
for (const s of Object.keys(t.data))
|
|
252
|
+
a.append(s, t.data[s]);
|
|
253
253
|
r.body = a;
|
|
254
254
|
const i = new Headers(r.headers);
|
|
255
255
|
i.delete("content-type"), r.headers = i;
|
|
@@ -263,28 +263,28 @@ class ve extends M {
|
|
|
263
263
|
* @param options Options to build the HTTP request
|
|
264
264
|
*/
|
|
265
265
|
async request(e) {
|
|
266
|
-
const r = we(e, e.webFetchExtra),
|
|
267
|
-
let { responseType:
|
|
268
|
-
i.includes("application/json") && (
|
|
269
|
-
let
|
|
270
|
-
switch (
|
|
266
|
+
const r = we(e, e.webFetchExtra), o = me(e.params, e.shouldEncodeUrlParams), n = o ? `${e.url}?${o}` : e.url, a = await fetch(n, r), i = a.headers.get("content-type") || "";
|
|
267
|
+
let { responseType: s = "text" } = a.ok ? e : {};
|
|
268
|
+
i.includes("application/json") && (s = "json");
|
|
269
|
+
let u, l;
|
|
270
|
+
switch (s) {
|
|
271
271
|
case "arraybuffer":
|
|
272
272
|
case "blob":
|
|
273
|
-
l = await a.blob(),
|
|
273
|
+
l = await a.blob(), u = await ge(l);
|
|
274
274
|
break;
|
|
275
275
|
case "json":
|
|
276
|
-
|
|
276
|
+
u = await a.json();
|
|
277
277
|
break;
|
|
278
278
|
case "document":
|
|
279
279
|
case "text":
|
|
280
280
|
default:
|
|
281
|
-
|
|
281
|
+
u = await a.text();
|
|
282
282
|
}
|
|
283
283
|
const O = {};
|
|
284
284
|
return a.headers.forEach((b, j) => {
|
|
285
285
|
O[j] = b;
|
|
286
286
|
}), {
|
|
287
|
-
data:
|
|
287
|
+
data: u,
|
|
288
288
|
headers: O,
|
|
289
289
|
status: a.status,
|
|
290
290
|
url: a.url
|
|
@@ -351,13 +351,15 @@ var k = /* @__PURE__ */ ((t) => (t.DEV = "dev", t.SIT = "sit", t.UAT = "uat", t.
|
|
|
351
351
|
const q = (t) => {
|
|
352
352
|
var e, r;
|
|
353
353
|
if (!(typeof window > "u") && D && (e = D()) != null && e.value) {
|
|
354
|
-
const
|
|
355
|
-
|
|
354
|
+
const o = ((r = D()) == null ? void 0 : r.value) ?? null;
|
|
355
|
+
o && t && t(o);
|
|
356
356
|
}
|
|
357
|
-
}, be = (t, { asiaUatData: e, euSitData: r, euUatData:
|
|
358
|
-
|
|
357
|
+
}, be = (t, { asiaUatData: e, euSitData: r, euUatData: o }) => {
|
|
358
|
+
var s, u;
|
|
359
|
+
const n = (s = t.mockServerInfo) == null ? void 0 : s.env, a = (u = t.mockServerInfo) == null ? void 0 : u.area;
|
|
360
|
+
console.log("nativeApiConfig===", t);
|
|
359
361
|
let i = null;
|
|
360
|
-
return I.ASIA === a ? k.UAT === n && (i = e) : I.EU === a && (k.SIT === n ? i = r : k.UAT === n && (i =
|
|
362
|
+
return !n || !a || (I.ASIA === a ? k.UAT === n && (i = e) : I.EU === a && (k.SIT === n ? i = r : k.UAT === n && (i = o))), i;
|
|
361
363
|
}, ye = ({ cb: t }) => {
|
|
362
364
|
setTimeout(() => {
|
|
363
365
|
q((e) => {
|
|
@@ -366,8 +368,8 @@ const q = (t) => {
|
|
|
366
368
|
const r = JSON.parse(e.params) ?? null;
|
|
367
369
|
if (!r)
|
|
368
370
|
return;
|
|
369
|
-
const { params:
|
|
370
|
-
!
|
|
371
|
+
const { params: o, routeName: n } = r;
|
|
372
|
+
!o || !n || t && t(r);
|
|
371
373
|
});
|
|
372
374
|
});
|
|
373
375
|
}, Ce = () => {
|
|
@@ -377,10 +379,10 @@ const q = (t) => {
|
|
|
377
379
|
}), t;
|
|
378
380
|
}, Le = (t) => new Promise(async (e) => {
|
|
379
381
|
let r = null;
|
|
380
|
-
t.mockData ? r = t.mockData : r = be(t, {
|
|
382
|
+
console.log("nativeApiConfig.mockData===", t.mockData), t.mockData ? r = t.mockData : r = be(t, {
|
|
381
383
|
asiaUatData: await import("./chunk/1b5f5213.js"),
|
|
382
|
-
euSitData: await import("./chunk/
|
|
383
|
-
euUatData: await import("./chunk/
|
|
384
|
+
euSitData: await import("./chunk/02340160.js"),
|
|
385
|
+
euUatData: await import("./chunk/7615ea07.js")
|
|
384
386
|
}), e((r == null ? void 0 : r.default) ?? null);
|
|
385
387
|
}), ke = () => {
|
|
386
388
|
let t = null;
|
|
@@ -406,7 +408,7 @@ const q = (t) => {
|
|
|
406
408
|
}
|
|
407
409
|
// nativeAppInfo
|
|
408
410
|
async nativeAppInfo(e) {
|
|
409
|
-
return
|
|
411
|
+
return this.nativeApiConfig = e, await this.getIsNativeHandle() ? await ke() : await Le(this.nativeApiConfig);
|
|
410
412
|
}
|
|
411
413
|
};
|
|
412
414
|
_($, "defaultNativeApiConfig", {
|
package/lib/main.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var ae=Object.defineProperty;var oe=(t,e,r)=>e in t?ae(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var _=(t,e,r)=>(oe(t,typeof e!="symbol"?e+"":e,r),r);/*! Capacitor: https://capacitorjs.com/ - MIT License */const ie=t=>{const e=new Map;e.set("web",{name:"web"});const r=t.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:e},a=(s,i)=>{r.platforms.set(s,i)},n=s=>{r.platforms.has(s)&&(r.currentPlatform=r.platforms.get(s))};return r.addPlatform=a,r.setPlatform=n,r},le=t=>t.CapacitorPlatforms=ie(t),R=le(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});R.addPlatform;R.setPlatform;var L;(function(t){t.Unimplemented="UNIMPLEMENTED",t.Unavailable="UNAVAILABLE"})(L||(L={}));class E extends Error{constructor(e,r,a){super(e),this.message=e,this.code=r,this.data=a}}const ce=t=>{var e,r;return t!=null&&t.androidBridge?"android":!((r=(e=t==null?void 0:t.webkit)===null||e===void 0?void 0:e.messageHandlers)===null||r===void 0)&&r.bridge?"ios":"web"},de=t=>{var e,r,a,n,s;const i=t.CapacitorCustomPlatform||null,o=t.Capacitor||{},f=o.Plugins=o.Plugins||{},l=t.CapacitorPlatforms,O=()=>i!==null?i.name:ce(t),b=((e=l==null?void 0:l.currentPlatform)===null||e===void 0?void 0:e.getPlatform)||O,j=()=>b()!=="web",z=((r=l==null?void 0:l.currentPlatform)===null||r===void 0?void 0:r.isNativePlatform)||j,Q=c=>{const d=H.get(c);return!!(d!=null&&d.platforms.has(b())||B(c))},X=((a=l==null?void 0:l.currentPlatform)===null||a===void 0?void 0:a.isPluginAvailable)||Q,Y=c=>{var d;return(d=o.PluginHeaders)===null||d===void 0?void 0:d.find(y=>y.name===c)},B=((n=l==null?void 0:l.currentPlatform)===null||n===void 0?void 0:n.getPluginHeader)||Y,Z=c=>t.console.error(c),V=(c,d,y)=>Promise.reject(`${y} does not have an implementation of "${d}".`),H=new Map,ee=(c,d={})=>{const y=H.get(c);if(y)return console.warn(`Capacitor plugin "${c}" already registered. Cannot register plugins twice.`),y.proxy;const P=b(),C=B(c);let w;const re=async()=>(!w&&P in d?w=typeof d[P]=="function"?w=await d[P]():w=d[P]:i!==null&&!w&&"web"in d&&(w=typeof d.web=="function"?w=await d.web():w=d.web),w),ne=(u,g)=>{var p,v;if(C){const h=C==null?void 0:C.methods.find(m=>g===m.name);if(h)return h.rtype==="promise"?m=>o.nativePromise(c,g.toString(),m):(m,x)=>o.nativeCallback(c,g.toString(),m,x);if(u)return(p=u[g])===null||p===void 0?void 0:p.bind(u)}else{if(u)return(v=u[g])===null||v===void 0?void 0:v.bind(u);throw new E(`"${c}" plugin is not implemented on ${P}`,L.Unimplemented)}},S=u=>{let g;const p=(...v)=>{const h=re().then(m=>{const x=ne(m,u);if(x){const U=x(...v);return g=U==null?void 0:U.remove,U}else throw new E(`"${c}.${u}()" is not implemented on ${P}`,L.Unimplemented)});return u==="addListener"&&(h.remove=async()=>g()),h};return p.toString=()=>`${u.toString()}() { [capacitor code] }`,Object.defineProperty(p,"name",{value:u,writable:!1,configurable:!1}),p},G=S("addListener"),J=S("removeListener"),se=(u,g)=>{const p=G({eventName:u},g),v=async()=>{const m=await p;J({eventName:u,callbackId:m},g)},h=new Promise(m=>p.then(()=>m({remove:v})));return h.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await v()},h},T=new Proxy({},{get(u,g){switch(g){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return C?se:G;case"removeListener":return J;default:return S(g)}}});return f[c]=T,H.set(c,{name:c,proxy:T,platforms:new Set([...Object.keys(d),...C?[P]:[]])}),T},te=((s=l==null?void 0:l.currentPlatform)===null||s===void 0?void 0:s.registerPlugin)||ee;return o.convertFileSrc||(o.convertFileSrc=c=>c),o.getPlatform=b,o.handleError=Z,o.isNativePlatform=z,o.isPluginAvailable=X,o.pluginMethodNoop=V,o.registerPlugin=te,o.Exception=E,o.DEBUG=!!o.DEBUG,o.isLoggingEnabled=!!o.isLoggingEnabled,o.platform=o.getPlatform(),o.isNative=o.isNativePlatform(),o},ue=t=>t.Capacitor=de(t),A=ue(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),N=A.registerPlugin;A.Plugins;class M{constructor(e){this.listeners={},this.windowListeners={},e&&(console.warn(`Capacitor WebPlugin "${e.name}" config object was deprecated in v3 and will be removed in v4.`),this.config=e)}addListener(e,r){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(r);const n=this.windowListeners[e];n&&!n.registered&&this.addWindowListener(n);const s=async()=>this.removeListener(e,r),i=Promise.resolve({remove:s});return Object.defineProperty(i,"remove",{value:async()=>{console.warn("Using addListener() without 'await' is deprecated."),await s()}}),i}async removeAllListeners(){this.listeners={};for(const e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}}notifyListeners(e,r){const a=this.listeners[e];a&&a.forEach(n=>n(r))}hasListeners(e){return!!this.listeners[e].length}registerWindowListener(e,r){this.windowListeners[r]={registered:!1,windowEventName:e,pluginEventName:r,handler:a=>{this.notifyListeners(r,a)}}}unimplemented(e="not implemented"){return new A.Exception(e,L.Unimplemented)}unavailable(e="not available"){return new A.Exception(e,L.Unavailable)}async removeListener(e,r){const a=this.listeners[e];if(!a)return;const n=a.indexOf(r);this.listeners[e].splice(n,1),this.listeners[e].length||this.removeWindowListener(this.windowListeners[e])}addWindowListener(e){window.addEventListener(e.windowEventName,e.handler),e.registered=!0}removeWindowListener(e){e&&(window.removeEventListener(e.windowEventName,e.handler),e.registered=!1)}}const F=t=>encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),K=t=>t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class fe extends M{async getCookies(){const e=document.cookie,r={};return e.split(";").forEach(a=>{if(a.length<=0)return;let[n,s]=a.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");n=K(n).trim(),s=K(s).trim(),r[n]=s}),r}async setCookie(e){try{const r=F(e.key),a=F(e.value),n=`; expires=${(e.expires||"").replace("expires=","")}`,s=(e.path||"/").replace("path=",""),i=e.url!=null&&e.url.length>0?`domain=${e.url}`:"";document.cookie=`${r}=${a||""}${n}; path=${s}; ${i};`}catch(r){return Promise.reject(r)}}async deleteCookie(e){try{document.cookie=`${e.key}=; Max-Age=0`}catch(r){return Promise.reject(r)}}async clearCookies(){try{const e=document.cookie.split(";")||[];for(const r of e)document.cookie=r.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(e){return Promise.reject(e)}}async clearAllCookies(){try{await this.clearCookies()}catch(e){return Promise.reject(e)}}}N("CapacitorCookies",{web:()=>new fe});const ge=async t=>new Promise((e,r)=>{const a=new FileReader;a.onload=()=>{const n=a.result;e(n.indexOf(",")>=0?n.split(",")[1]:n)},a.onerror=n=>r(n),a.readAsDataURL(t)}),me=(t={})=>{const e=Object.keys(t);return Object.keys(t).map(n=>n.toLocaleLowerCase()).reduce((n,s,i)=>(n[s]=t[e[i]],n),{})},pe=(t,e=!0)=>t?Object.entries(t).reduce((a,n)=>{const[s,i]=n;let o,f;return Array.isArray(i)?(f="",i.forEach(l=>{o=e?encodeURIComponent(l):l,f+=`${s}=${o}&`}),f.slice(0,-1)):(o=e?encodeURIComponent(i):i,f=`${s}=${o}`),`${a}&${f}`},"").substr(1):null,we=(t,e={})=>{const r=Object.assign({method:t.method||"GET",headers:t.headers},e),n=me(t.headers)["content-type"]||"";if(typeof t.data=="string")r.body=t.data;else if(n.includes("application/x-www-form-urlencoded")){const s=new URLSearchParams;for(const[i,o]of Object.entries(t.data||{}))s.set(i,o);r.body=s.toString()}else if(n.includes("multipart/form-data")){const s=new FormData;if(t.data instanceof FormData)t.data.forEach((o,f)=>{s.append(f,o)});else for(const o of Object.keys(t.data))s.append(o,t.data[o]);r.body=s;const i=new Headers(r.headers);i.delete("content-type"),r.headers=i}else(n.includes("application/json")||typeof t.data=="object")&&(r.body=JSON.stringify(t.data));return r};class ve extends M{async request(e){const r=we(e,e.webFetchExtra),a=pe(e.params,e.shouldEncodeUrlParams),n=a?`${e.url}?${a}`:e.url,s=await fetch(n,r),i=s.headers.get("content-type")||"";let{responseType:o="text"}=s.ok?e:{};i.includes("application/json")&&(o="json");let f,l;switch(o){case"arraybuffer":case"blob":l=await s.blob(),f=await ge(l);break;case"json":f=await s.json();break;case"document":case"text":default:f=await s.text()}const O={};return s.headers.forEach((b,j)=>{O[j]=b}),{data:f,headers:O,status:s.status,url:s.url}}async get(e){return this.request(Object.assign(Object.assign({},e),{method:"GET"}))}async post(e){return this.request(Object.assign(Object.assign({},e),{method:"POST"}))}async put(e){return this.request(Object.assign(Object.assign({},e),{method:"PUT"}))}async patch(e){return this.request(Object.assign(Object.assign({},e),{method:"PATCH"}))}async delete(e){return this.request(Object.assign(Object.assign({},e),{method:"DELETE"}))}}N("CapacitorHttp",{web:()=>new ve});/*! Ionic Portals: https://ionic.io/portals - Commercial License */N("Portals",{web:()=>Promise.resolve().then(function(){return Pe}).then(t=>new t.PortalsWeb)});function D(){return A.getPlatform()==="android"?JSON.parse(AndroidInitialContext.initialContext()):window.portalInitialContext}class he extends M{async publishNative(e){}}const Pe=Object.freeze({__proto__:null,PortalsWeb:he});var k=(t=>(t.DEV="dev",t.SIT="sit",t.UAT="uat",t.PROD="prod",t.TEST="test",t))(k||{}),I=(t=>(t.EU="eu",t.ASIA="asia",t))(I||{});const q=t=>{var e,r;if(!(typeof window>"u")&&D&&(e=D())!=null&&e.value){const a=((r=D())==null?void 0:r.value)??null;a&&t&&t(a)}},be=(t,{asiaUatData:e,euSitData:r,euUatData:a})=>{const n=t.mockServerInfo.env,s=t.mockServerInfo.area;let i=null;return I.ASIA===s?k.UAT===n&&(i=e):I.EU===s&&(k.SIT===n?i=r:k.UAT===n&&(i=a)),i},ye=({cb:t})=>{setTimeout(()=>{q(e=>{if(!(e!=null&&e.params))return;const r=JSON.parse(e.params)??null;if(!r)return;const{params:a,routeName:n}=r;!a||!n||t&&t(r)})})},Ce=()=>{let t=!1;return q(e=>{t=!!(e!=null&&e.isNative)}),t},Le=t=>new Promise(async e=>{let r=null;t.mockData?r=t.mockData:r=be(t,{asiaUatData:await Promise.resolve().then(()=>require("./umd/fbb879ae.umd.cjs")),euSitData:await Promise.resolve().then(()=>require("./umd/7c40191f.umd.cjs")),euUatData:await Promise.resolve().then(()=>require("./umd/5ca52608.umd.cjs"))}),e((r==null?void 0:r.default)??null)}),ke=()=>{let t=null;return q(e=>{e?t={data_info:e.data_info?JSON.parse(e.data_info):null,data_store:e.data_store?JSON.parse(e.data_store):null,data_language:e.data_language?JSON.parse(e.data_language):null}:t=null}),t},$=class ${constructor(){_(this,"nativeApiConfig");this.nativeApiConfig=$.defaultNativeApiConfig}async getIsNativeHandle(){return await Ce()}async specifiedPageHandle({cb:e}){await ye({cb:e})}async nativeAppInfo(e){return e&&(this.nativeApiConfig=e),await this.getIsNativeHandle()?await ke():await Le(this.nativeApiConfig)}};_($,"defaultNativeApiConfig",{mockServerInfo:{area:I.ASIA,env:k.UAT}});let W=$;class Ae extends W{constructor(){super()}async getIsNativeHandle(){return await super.getIsNativeHandle()}async specifiedPageHandle({cb:e}){return await super.specifiedPageHandle({cb:e})}async nativeAppInfo(e){return await super.nativeAppInfo(e)}}const Oe=new Ae;module.exports=Oe;
|
|
1
|
+
"use strict";var se=Object.defineProperty;var oe=(t,e,r)=>e in t?se(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var _=(t,e,r)=>(oe(t,typeof e!="symbol"?e+"":e,r),r);/*! Capacitor: https://capacitorjs.com/ - MIT License */const ie=t=>{const e=new Map;e.set("web",{name:"web"});const r=t.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:e},o=(a,i)=>{r.platforms.set(a,i)},n=a=>{r.platforms.has(a)&&(r.currentPlatform=r.platforms.get(a))};return r.addPlatform=o,r.setPlatform=n,r},le=t=>t.CapacitorPlatforms=ie(t),R=le(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});R.addPlatform;R.setPlatform;var L;(function(t){t.Unimplemented="UNIMPLEMENTED",t.Unavailable="UNAVAILABLE"})(L||(L={}));class E extends Error{constructor(e,r,o){super(e),this.message=e,this.code=r,this.data=o}}const ce=t=>{var e,r;return t!=null&&t.androidBridge?"android":!((r=(e=t==null?void 0:t.webkit)===null||e===void 0?void 0:e.messageHandlers)===null||r===void 0)&&r.bridge?"ios":"web"},de=t=>{var e,r,o,n,a;const i=t.CapacitorCustomPlatform||null,s=t.Capacitor||{},u=s.Plugins=s.Plugins||{},l=t.CapacitorPlatforms,O=()=>i!==null?i.name:ce(t),b=((e=l==null?void 0:l.currentPlatform)===null||e===void 0?void 0:e.getPlatform)||O,j=()=>b()!=="web",z=((r=l==null?void 0:l.currentPlatform)===null||r===void 0?void 0:r.isNativePlatform)||j,Q=c=>{const d=H.get(c);return!!(d!=null&&d.platforms.has(b())||B(c))},X=((o=l==null?void 0:l.currentPlatform)===null||o===void 0?void 0:o.isPluginAvailable)||Q,Y=c=>{var d;return(d=s.PluginHeaders)===null||d===void 0?void 0:d.find(y=>y.name===c)},B=((n=l==null?void 0:l.currentPlatform)===null||n===void 0?void 0:n.getPluginHeader)||Y,Z=c=>t.console.error(c),V=(c,d,y)=>Promise.reject(`${y} does not have an implementation of "${d}".`),H=new Map,ee=(c,d={})=>{const y=H.get(c);if(y)return console.warn(`Capacitor plugin "${c}" already registered. Cannot register plugins twice.`),y.proxy;const P=b(),C=B(c);let w;const re=async()=>(!w&&P in d?w=typeof d[P]=="function"?w=await d[P]():w=d[P]:i!==null&&!w&&"web"in d&&(w=typeof d.web=="function"?w=await d.web():w=d.web),w),ne=(f,g)=>{var p,v;if(C){const h=C==null?void 0:C.methods.find(m=>g===m.name);if(h)return h.rtype==="promise"?m=>s.nativePromise(c,g.toString(),m):(m,x)=>s.nativeCallback(c,g.toString(),m,x);if(f)return(p=f[g])===null||p===void 0?void 0:p.bind(f)}else{if(f)return(v=f[g])===null||v===void 0?void 0:v.bind(f);throw new E(`"${c}" plugin is not implemented on ${P}`,L.Unimplemented)}},S=f=>{let g;const p=(...v)=>{const h=re().then(m=>{const x=ne(m,f);if(x){const U=x(...v);return g=U==null?void 0:U.remove,U}else throw new E(`"${c}.${f}()" is not implemented on ${P}`,L.Unimplemented)});return f==="addListener"&&(h.remove=async()=>g()),h};return p.toString=()=>`${f.toString()}() { [capacitor code] }`,Object.defineProperty(p,"name",{value:f,writable:!1,configurable:!1}),p},G=S("addListener"),J=S("removeListener"),ae=(f,g)=>{const p=G({eventName:f},g),v=async()=>{const m=await p;J({eventName:f,callbackId:m},g)},h=new Promise(m=>p.then(()=>m({remove:v})));return h.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await v()},h},T=new Proxy({},{get(f,g){switch(g){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return C?ae:G;case"removeListener":return J;default:return S(g)}}});return u[c]=T,H.set(c,{name:c,proxy:T,platforms:new Set([...Object.keys(d),...C?[P]:[]])}),T},te=((a=l==null?void 0:l.currentPlatform)===null||a===void 0?void 0:a.registerPlugin)||ee;return s.convertFileSrc||(s.convertFileSrc=c=>c),s.getPlatform=b,s.handleError=Z,s.isNativePlatform=z,s.isPluginAvailable=X,s.pluginMethodNoop=V,s.registerPlugin=te,s.Exception=E,s.DEBUG=!!s.DEBUG,s.isLoggingEnabled=!!s.isLoggingEnabled,s.platform=s.getPlatform(),s.isNative=s.isNativePlatform(),s},ue=t=>t.Capacitor=de(t),A=ue(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),N=A.registerPlugin;A.Plugins;class M{constructor(e){this.listeners={},this.windowListeners={},e&&(console.warn(`Capacitor WebPlugin "${e.name}" config object was deprecated in v3 and will be removed in v4.`),this.config=e)}addListener(e,r){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(r);const n=this.windowListeners[e];n&&!n.registered&&this.addWindowListener(n);const a=async()=>this.removeListener(e,r),i=Promise.resolve({remove:a});return Object.defineProperty(i,"remove",{value:async()=>{console.warn("Using addListener() without 'await' is deprecated."),await a()}}),i}async removeAllListeners(){this.listeners={};for(const e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}}notifyListeners(e,r){const o=this.listeners[e];o&&o.forEach(n=>n(r))}hasListeners(e){return!!this.listeners[e].length}registerWindowListener(e,r){this.windowListeners[r]={registered:!1,windowEventName:e,pluginEventName:r,handler:o=>{this.notifyListeners(r,o)}}}unimplemented(e="not implemented"){return new A.Exception(e,L.Unimplemented)}unavailable(e="not available"){return new A.Exception(e,L.Unavailable)}async removeListener(e,r){const o=this.listeners[e];if(!o)return;const n=o.indexOf(r);this.listeners[e].splice(n,1),this.listeners[e].length||this.removeWindowListener(this.windowListeners[e])}addWindowListener(e){window.addEventListener(e.windowEventName,e.handler),e.registered=!0}removeWindowListener(e){e&&(window.removeEventListener(e.windowEventName,e.handler),e.registered=!1)}}const F=t=>encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),K=t=>t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class fe extends M{async getCookies(){const e=document.cookie,r={};return e.split(";").forEach(o=>{if(o.length<=0)return;let[n,a]=o.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");n=K(n).trim(),a=K(a).trim(),r[n]=a}),r}async setCookie(e){try{const r=F(e.key),o=F(e.value),n=`; expires=${(e.expires||"").replace("expires=","")}`,a=(e.path||"/").replace("path=",""),i=e.url!=null&&e.url.length>0?`domain=${e.url}`:"";document.cookie=`${r}=${o||""}${n}; path=${a}; ${i};`}catch(r){return Promise.reject(r)}}async deleteCookie(e){try{document.cookie=`${e.key}=; Max-Age=0`}catch(r){return Promise.reject(r)}}async clearCookies(){try{const e=document.cookie.split(";")||[];for(const r of e)document.cookie=r.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(e){return Promise.reject(e)}}async clearAllCookies(){try{await this.clearCookies()}catch(e){return Promise.reject(e)}}}N("CapacitorCookies",{web:()=>new fe});const ge=async t=>new Promise((e,r)=>{const o=new FileReader;o.onload=()=>{const n=o.result;e(n.indexOf(",")>=0?n.split(",")[1]:n)},o.onerror=n=>r(n),o.readAsDataURL(t)}),me=(t={})=>{const e=Object.keys(t);return Object.keys(t).map(n=>n.toLocaleLowerCase()).reduce((n,a,i)=>(n[a]=t[e[i]],n),{})},pe=(t,e=!0)=>t?Object.entries(t).reduce((o,n)=>{const[a,i]=n;let s,u;return Array.isArray(i)?(u="",i.forEach(l=>{s=e?encodeURIComponent(l):l,u+=`${a}=${s}&`}),u.slice(0,-1)):(s=e?encodeURIComponent(i):i,u=`${a}=${s}`),`${o}&${u}`},"").substr(1):null,we=(t,e={})=>{const r=Object.assign({method:t.method||"GET",headers:t.headers},e),n=me(t.headers)["content-type"]||"";if(typeof t.data=="string")r.body=t.data;else if(n.includes("application/x-www-form-urlencoded")){const a=new URLSearchParams;for(const[i,s]of Object.entries(t.data||{}))a.set(i,s);r.body=a.toString()}else if(n.includes("multipart/form-data")){const a=new FormData;if(t.data instanceof FormData)t.data.forEach((s,u)=>{a.append(u,s)});else for(const s of Object.keys(t.data))a.append(s,t.data[s]);r.body=a;const i=new Headers(r.headers);i.delete("content-type"),r.headers=i}else(n.includes("application/json")||typeof t.data=="object")&&(r.body=JSON.stringify(t.data));return r};class ve extends M{async request(e){const r=we(e,e.webFetchExtra),o=pe(e.params,e.shouldEncodeUrlParams),n=o?`${e.url}?${o}`:e.url,a=await fetch(n,r),i=a.headers.get("content-type")||"";let{responseType:s="text"}=a.ok?e:{};i.includes("application/json")&&(s="json");let u,l;switch(s){case"arraybuffer":case"blob":l=await a.blob(),u=await ge(l);break;case"json":u=await a.json();break;case"document":case"text":default:u=await a.text()}const O={};return a.headers.forEach((b,j)=>{O[j]=b}),{data:u,headers:O,status:a.status,url:a.url}}async get(e){return this.request(Object.assign(Object.assign({},e),{method:"GET"}))}async post(e){return this.request(Object.assign(Object.assign({},e),{method:"POST"}))}async put(e){return this.request(Object.assign(Object.assign({},e),{method:"PUT"}))}async patch(e){return this.request(Object.assign(Object.assign({},e),{method:"PATCH"}))}async delete(e){return this.request(Object.assign(Object.assign({},e),{method:"DELETE"}))}}N("CapacitorHttp",{web:()=>new ve});/*! Ionic Portals: https://ionic.io/portals - Commercial License */N("Portals",{web:()=>Promise.resolve().then(function(){return Pe}).then(t=>new t.PortalsWeb)});function D(){return A.getPlatform()==="android"?JSON.parse(AndroidInitialContext.initialContext()):window.portalInitialContext}class he extends M{async publishNative(e){}}const Pe=Object.freeze({__proto__:null,PortalsWeb:he});var k=(t=>(t.DEV="dev",t.SIT="sit",t.UAT="uat",t.PROD="prod",t.TEST="test",t))(k||{}),I=(t=>(t.EU="eu",t.ASIA="asia",t))(I||{});const q=t=>{var e,r;if(!(typeof window>"u")&&D&&(e=D())!=null&&e.value){const o=((r=D())==null?void 0:r.value)??null;o&&t&&t(o)}},be=(t,{asiaUatData:e,euSitData:r,euUatData:o})=>{var s,u;const n=(s=t.mockServerInfo)==null?void 0:s.env,a=(u=t.mockServerInfo)==null?void 0:u.area;console.log("nativeApiConfig===",t);let i=null;return!n||!a||(I.ASIA===a?k.UAT===n&&(i=e):I.EU===a&&(k.SIT===n?i=r:k.UAT===n&&(i=o))),i},ye=({cb:t})=>{setTimeout(()=>{q(e=>{if(!(e!=null&&e.params))return;const r=JSON.parse(e.params)??null;if(!r)return;const{params:o,routeName:n}=r;!o||!n||t&&t(r)})})},Ce=()=>{let t=!1;return q(e=>{t=!!(e!=null&&e.isNative)}),t},Le=t=>new Promise(async e=>{let r=null;console.log("nativeApiConfig.mockData===",t.mockData),t.mockData?r=t.mockData:r=be(t,{asiaUatData:await Promise.resolve().then(()=>require("./umd/fbb879ae.umd.cjs")),euSitData:await Promise.resolve().then(()=>require("./umd/7c40191f.umd.cjs")),euUatData:await Promise.resolve().then(()=>require("./umd/5ca52608.umd.cjs"))}),e((r==null?void 0:r.default)??null)}),ke=()=>{let t=null;return q(e=>{e?t={data_info:e.data_info?JSON.parse(e.data_info):null,data_store:e.data_store?JSON.parse(e.data_store):null,data_language:e.data_language?JSON.parse(e.data_language):null}:t=null}),t},$=class ${constructor(){_(this,"nativeApiConfig");this.nativeApiConfig=$.defaultNativeApiConfig}async getIsNativeHandle(){return await Ce()}async specifiedPageHandle({cb:e}){await ye({cb:e})}async nativeAppInfo(e){return this.nativeApiConfig=e,await this.getIsNativeHandle()?await ke():await Le(this.nativeApiConfig)}};_($,"defaultNativeApiConfig",{mockServerInfo:{area:I.ASIA,env:k.UAT}});let W=$;class Ae extends W{constructor(){super()}async getIsNativeHandle(){return await super.getIsNativeHandle()}async specifiedPageHandle({cb:e}){return await super.specifiedPageHandle({cb:e})}async nativeAppInfo(e){return await super.nativeAppInfo(e)}}const Oe=new Ae;module.exports=Oe;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { PluginCallback } from '@capacitor/core';
|
|
2
2
|
import type { NativeApiConfigType } from '../../../type';
|
|
3
3
|
export declare const getInitialContextHandle: (cb: PluginCallback) => void;
|
|
4
|
-
export declare const getLocationMockDataHandle: (
|
|
4
|
+
export declare const getLocationMockDataHandle: (nativeApiConfig: NativeApiConfigType, { asiaUatData, euSitData, euUatData }: any) => any;
|
|
@@ -11,5 +11,5 @@ export default class InitialContextPlugins implements InitialContextPluginsType
|
|
|
11
11
|
constructor();
|
|
12
12
|
getIsNativeHandle(): Promise<boolean>;
|
|
13
13
|
specifiedPageHandle({ cb }: SpecifiedPageType): Promise<void>;
|
|
14
|
-
nativeAppInfo(nativeApiConfig: NativeApiConfigType
|
|
14
|
+
nativeAppInfo(nativeApiConfig: NativeApiConfigType): Promise<any>;
|
|
15
15
|
}
|
package/lib/src/init/index.d.ts
CHANGED
|
@@ -5,5 +5,5 @@ export default class NativeApi extends InitialContextPlugins {
|
|
|
5
5
|
constructor();
|
|
6
6
|
getIsNativeHandle(): Promise<boolean>;
|
|
7
7
|
specifiedPageHandle({ cb }: SpecifiedPageType): Promise<void>;
|
|
8
|
-
nativeAppInfo(nativeApiConfig: NativeApiConfigType
|
|
8
|
+
nativeAppInfo(nativeApiConfig: NativeApiConfigType): Promise<any>;
|
|
9
9
|
}
|
package/lib/src/type/index.d.ts
CHANGED