superapp-miniapp-invoke-native 1.0.54 → 1.0.56
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.d.ts +5 -4
- package/lib/main.js +262 -235
- package/lib/main.umd.cjs +1 -1
- package/package.json +1 -1
package/lib/main.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ declare interface CommunicatePluginsHandleType {
|
|
|
9
9
|
openMinAppHandle(minApp: MinAppType): Promise<MinAppType>;
|
|
10
10
|
showTitleHandle(title: TitleType): Promise<TitleType>;
|
|
11
11
|
showSubMaskHandle(subMask: subMaskType): Promise<subMaskType>;
|
|
12
|
+
showDialogHandle: (data: any) => Promise<void>;
|
|
13
|
+
cancelDialogHandle: (data: any) => Promise<void>;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
declare interface CommunicatePluginsHookType {
|
|
@@ -21,9 +23,7 @@ declare const _default: NativeApi;
|
|
|
21
23
|
export default _default;
|
|
22
24
|
|
|
23
25
|
declare class InitialContextPlugins implements InitialContextPluginsType {
|
|
24
|
-
private nativeAppInfoConfig;
|
|
25
26
|
static defaultNativeAppInfoConfig: NativeAppInfoConfigType;
|
|
26
|
-
constructor();
|
|
27
27
|
isNativeHandle(): Promise<boolean>;
|
|
28
28
|
specifiedPageHandle(specifiedPageParams: SpecifiedPageType): Promise<void>;
|
|
29
29
|
nativeAppInfoHandle(nativeAppInfoConfig?: NativeAppInfoConfigType): Promise<any>;
|
|
@@ -40,8 +40,7 @@ declare interface MinAppType {
|
|
|
40
40
|
params?: string;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
declare class NativeApi extends InitialContextPlugins implements CommunicatePluginsHookType, CommunicatePluginsHandleType {
|
|
44
|
-
constructor();
|
|
43
|
+
export declare class NativeApi extends InitialContextPlugins implements CommunicatePluginsHookType, CommunicatePluginsHandleType {
|
|
45
44
|
private communicatePlugins;
|
|
46
45
|
openMinAppHandle(minApp: MinAppType): Promise<MinAppType>;
|
|
47
46
|
showTitleHandle(title: TitleType): Promise<TitleType>;
|
|
@@ -52,6 +51,8 @@ declare class NativeApi extends InitialContextPlugins implements CommunicatePlug
|
|
|
52
51
|
};
|
|
53
52
|
homeBtnHandle(cb: PluginCallback): void;
|
|
54
53
|
fabBtnHandle(data: SetFabDataType): void;
|
|
54
|
+
showDialogHandle(): Promise<void>;
|
|
55
|
+
cancelDialogHandle(): Promise<void>;
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
declare interface NativeAppInfoConfigType {
|
package/lib/main.js
CHANGED
|
@@ -1,135 +1,135 @@
|
|
|
1
1
|
var pe = Object.defineProperty;
|
|
2
2
|
var ue = (n, e, t) => e in n ? pe(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var z = (n, e, t) => (ue(n, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
var s = (n, e, t) => new Promise((r, a) => {
|
|
5
|
+
var i = (u) => {
|
|
6
6
|
try {
|
|
7
|
-
|
|
7
|
+
o(t.next(u));
|
|
8
8
|
} catch (p) {
|
|
9
|
-
|
|
9
|
+
a(p);
|
|
10
10
|
}
|
|
11
11
|
}, d = (u) => {
|
|
12
12
|
try {
|
|
13
|
-
|
|
13
|
+
o(t.throw(u));
|
|
14
14
|
} catch (p) {
|
|
15
|
-
|
|
15
|
+
a(p);
|
|
16
16
|
}
|
|
17
|
-
},
|
|
18
|
-
|
|
17
|
+
}, o = (u) => u.done ? r(u.value) : Promise.resolve(u.value).then(i, d);
|
|
18
|
+
o((t = t.apply(n, e)).next());
|
|
19
19
|
});
|
|
20
20
|
/*! Capacitor: https://capacitorjs.com/ - MIT License */
|
|
21
21
|
const me = (n) => n.CapacitorPlatforms = ((e) => {
|
|
22
22
|
const t = /* @__PURE__ */ new Map();
|
|
23
23
|
t.set("web", { name: "web" });
|
|
24
|
-
const
|
|
25
|
-
return
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
},
|
|
24
|
+
const r = e.CapacitorPlatforms || { currentPlatform: { name: "web" }, platforms: t };
|
|
25
|
+
return r.addPlatform = (a, i) => {
|
|
26
|
+
r.platforms.set(a, i);
|
|
27
|
+
}, r.setPlatform = (a) => {
|
|
28
|
+
r.platforms.has(a) && (r.currentPlatform = r.platforms.get(a));
|
|
29
|
+
}, r;
|
|
30
30
|
})(n), se = me(typeof globalThis != "undefined" ? globalThis : typeof self != "undefined" ? self : typeof window != "undefined" ? window : typeof global != "undefined" ? global : {});
|
|
31
31
|
var S;
|
|
32
32
|
se.addPlatform, se.setPlatform, function(n) {
|
|
33
33
|
n.Unimplemented = "UNIMPLEMENTED", n.Unavailable = "UNAVAILABLE";
|
|
34
34
|
}(S || (S = {}));
|
|
35
35
|
class G extends Error {
|
|
36
|
-
constructor(e, t,
|
|
37
|
-
super(e), this.message = e, this.code = t, this.data =
|
|
36
|
+
constructor(e, t, r) {
|
|
37
|
+
super(e), this.message = e, this.code = t, this.data = r;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
const fe = (n) => {
|
|
41
|
-
var e, t,
|
|
42
|
-
const d = n.CapacitorCustomPlatform || null,
|
|
41
|
+
var e, t, r, a, i;
|
|
42
|
+
const d = n.CapacitorCustomPlatform || null, o = n.Capacitor || {}, u = o.Plugins = o.Plugins || {}, p = n.CapacitorPlatforms, g = ((e = p == null ? void 0 : p.currentPlatform) === null || e === void 0 ? void 0 : e.getPlatform) || (() => d !== null ? d.name : ((l) => {
|
|
43
43
|
var c, m;
|
|
44
44
|
return l != null && l.androidBridge ? "android" : !((m = (c = l == null ? void 0 : l.webkit) === null || c === void 0 ? void 0 : c.messageHandlers) === null || m === void 0) && m.bridge ? "ios" : "web";
|
|
45
|
-
})(n)), h = ((t = p == null ? void 0 : p.currentPlatform) === null || t === void 0 ? void 0 : t.isNativePlatform) || (() =>
|
|
46
|
-
const c =
|
|
47
|
-
return !!(c != null && c.platforms.has(
|
|
48
|
-
}),
|
|
45
|
+
})(n)), h = ((t = p == null ? void 0 : p.currentPlatform) === null || t === void 0 ? void 0 : t.isNativePlatform) || (() => g() !== "web"), C = ((r = p == null ? void 0 : p.currentPlatform) === null || r === void 0 ? void 0 : r.isPluginAvailable) || ((l) => {
|
|
46
|
+
const c = v.get(l);
|
|
47
|
+
return !!(c != null && c.platforms.has(g())) || !!O(l);
|
|
48
|
+
}), O = ((a = p == null ? void 0 : p.currentPlatform) === null || a === void 0 ? void 0 : a.getPluginHeader) || ((l) => {
|
|
49
49
|
var c;
|
|
50
|
-
return (c =
|
|
51
|
-
}),
|
|
52
|
-
const m =
|
|
50
|
+
return (c = o.PluginHeaders) === null || c === void 0 ? void 0 : c.find((m) => m.name === l);
|
|
51
|
+
}), v = /* @__PURE__ */ new Map(), b = ((i = p == null ? void 0 : p.currentPlatform) === null || i === void 0 ? void 0 : i.registerPlugin) || ((l, c = {}) => {
|
|
52
|
+
const m = v.get(l);
|
|
53
53
|
if (m)
|
|
54
54
|
return console.warn(`Capacitor plugin "${l}" already registered. Cannot register plugins twice.`), m.proxy;
|
|
55
|
-
const _ =
|
|
56
|
-
let
|
|
57
|
-
const
|
|
58
|
-
let
|
|
59
|
-
const E = (...
|
|
60
|
-
const T = (() =>
|
|
61
|
-
return !
|
|
62
|
-
}))().then((
|
|
63
|
-
const ae = ((y,
|
|
64
|
-
var
|
|
55
|
+
const _ = g(), N = O(l);
|
|
56
|
+
let A;
|
|
57
|
+
const K = (P) => {
|
|
58
|
+
let L;
|
|
59
|
+
const E = (...D) => {
|
|
60
|
+
const T = (() => s(void 0, null, function* () {
|
|
61
|
+
return !A && _ in c ? A = A = typeof c[_] == "function" ? yield c[_]() : c[_] : d !== null && !A && "web" in c && (A = A = typeof c.web == "function" ? yield c.web() : c.web), A;
|
|
62
|
+
}))().then((H) => {
|
|
63
|
+
const ae = ((y, M) => {
|
|
64
|
+
var W, q;
|
|
65
65
|
if (!N) {
|
|
66
66
|
if (y)
|
|
67
|
-
return (
|
|
67
|
+
return (q = y[M]) === null || q === void 0 ? void 0 : q.bind(y);
|
|
68
68
|
throw new G(`"${l}" plugin is not implemented on ${_}`, S.Unimplemented);
|
|
69
69
|
}
|
|
70
70
|
{
|
|
71
|
-
const re = N == null ? void 0 : N.methods.find((
|
|
71
|
+
const re = N == null ? void 0 : N.methods.find((j) => M === j.name);
|
|
72
72
|
if (re)
|
|
73
|
-
return re.rtype === "promise" ? (
|
|
73
|
+
return re.rtype === "promise" ? (j) => o.nativePromise(l, M.toString(), j) : (j, ce) => o.nativeCallback(l, M.toString(), j, ce);
|
|
74
74
|
if (y)
|
|
75
|
-
return (
|
|
75
|
+
return (W = y[M]) === null || W === void 0 ? void 0 : W.bind(y);
|
|
76
76
|
}
|
|
77
|
-
})(
|
|
77
|
+
})(H, P);
|
|
78
78
|
if (ae) {
|
|
79
|
-
const y = ae(...
|
|
80
|
-
return
|
|
79
|
+
const y = ae(...D);
|
|
80
|
+
return L = y == null ? void 0 : y.remove, y;
|
|
81
81
|
}
|
|
82
82
|
throw new G(`"${l}.${P}()" is not implemented on ${_}`, S.Unimplemented);
|
|
83
83
|
});
|
|
84
|
-
return P === "addListener" && (T.remove = () =>
|
|
85
|
-
return
|
|
84
|
+
return P === "addListener" && (T.remove = () => s(void 0, null, function* () {
|
|
85
|
+
return L();
|
|
86
86
|
})), T;
|
|
87
87
|
};
|
|
88
88
|
return E.toString = () => `${P.toString()}() { [capacitor code] }`, Object.defineProperty(E, "name", { value: P, writable: !1, configurable: !1 }), E;
|
|
89
|
-
},
|
|
90
|
-
const E =
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
}), T = new Promise((
|
|
94
|
-
return T.remove = () =>
|
|
95
|
-
console.warn("Using addListener() without 'await' is deprecated."), yield
|
|
89
|
+
}, te = K("addListener"), ne = K("removeListener"), le = (P, L) => {
|
|
90
|
+
const E = te({ eventName: P }, L), D = () => s(void 0, null, function* () {
|
|
91
|
+
const H = yield E;
|
|
92
|
+
ne({ eventName: P, callbackId: H }, L);
|
|
93
|
+
}), T = new Promise((H) => E.then(() => H({ remove: D })));
|
|
94
|
+
return T.remove = () => s(void 0, null, function* () {
|
|
95
|
+
console.warn("Using addListener() without 'await' is deprecated."), yield D();
|
|
96
96
|
}), T;
|
|
97
|
-
},
|
|
98
|
-
switch (
|
|
97
|
+
}, V = new Proxy({}, { get(P, L) {
|
|
98
|
+
switch (L) {
|
|
99
99
|
case "$$typeof":
|
|
100
100
|
return;
|
|
101
101
|
case "toJSON":
|
|
102
102
|
return () => ({});
|
|
103
103
|
case "addListener":
|
|
104
|
-
return N ? le :
|
|
104
|
+
return N ? le : te;
|
|
105
105
|
case "removeListener":
|
|
106
|
-
return
|
|
106
|
+
return ne;
|
|
107
107
|
default:
|
|
108
|
-
return
|
|
108
|
+
return K(L);
|
|
109
109
|
}
|
|
110
110
|
} });
|
|
111
|
-
return u[l] =
|
|
111
|
+
return u[l] = V, v.set(l, { name: l, proxy: V, platforms: /* @__PURE__ */ new Set([...Object.keys(c), ...N ? [_] : []]) }), V;
|
|
112
112
|
});
|
|
113
|
-
return
|
|
113
|
+
return o.convertFileSrc || (o.convertFileSrc = (l) => l), o.getPlatform = g, o.handleError = (l) => n.console.error(l), o.isNativePlatform = h, o.isPluginAvailable = C, o.pluginMethodNoop = (l, c, m) => Promise.reject(`${m} does not have an implementation of "${c}".`), o.registerPlugin = b, o.Exception = G, o.DEBUG = !!o.DEBUG, o.isLoggingEnabled = !!o.isLoggingEnabled, o.platform = o.getPlatform(), o.isNative = o.isNativePlatform(), o;
|
|
114
114
|
}, we = (n) => n.Capacitor = fe(n), w = we(typeof globalThis != "undefined" ? globalThis : typeof self != "undefined" ? self : typeof window != "undefined" ? window : typeof global != "undefined" ? global : {}), Y = w.registerPlugin;
|
|
115
115
|
w.Plugins;
|
|
116
|
-
class
|
|
116
|
+
class F {
|
|
117
117
|
constructor(e) {
|
|
118
118
|
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);
|
|
119
119
|
}
|
|
120
120
|
addListener(e, t) {
|
|
121
121
|
this.listeners[e] || (this.listeners[e] = []), this.listeners[e].push(t);
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
const
|
|
122
|
+
const r = this.windowListeners[e];
|
|
123
|
+
r && !r.registered && this.addWindowListener(r);
|
|
124
|
+
const a = () => s(this, null, function* () {
|
|
125
125
|
return this.removeListener(e, t);
|
|
126
|
-
}),
|
|
127
|
-
return Object.defineProperty(
|
|
128
|
-
console.warn("Using addListener() without 'await' is deprecated."), yield
|
|
129
|
-
}) }),
|
|
126
|
+
}), i = Promise.resolve({ remove: a });
|
|
127
|
+
return Object.defineProperty(i, "remove", { value: () => s(this, null, function* () {
|
|
128
|
+
console.warn("Using addListener() without 'await' is deprecated."), yield a();
|
|
129
|
+
}) }), i;
|
|
130
130
|
}
|
|
131
131
|
removeAllListeners() {
|
|
132
|
-
return
|
|
132
|
+
return s(this, null, function* () {
|
|
133
133
|
this.listeners = {};
|
|
134
134
|
for (const e in this.windowListeners)
|
|
135
135
|
this.removeWindowListener(this.windowListeners[e]);
|
|
@@ -137,15 +137,15 @@ class R {
|
|
|
137
137
|
});
|
|
138
138
|
}
|
|
139
139
|
notifyListeners(e, t) {
|
|
140
|
-
const
|
|
141
|
-
|
|
140
|
+
const r = this.listeners[e];
|
|
141
|
+
r && r.forEach((a) => a(t));
|
|
142
142
|
}
|
|
143
143
|
hasListeners(e) {
|
|
144
144
|
return !!this.listeners[e].length;
|
|
145
145
|
}
|
|
146
146
|
registerWindowListener(e, t) {
|
|
147
|
-
this.windowListeners[t] = { registered: !1, windowEventName: e, pluginEventName: t, handler: (
|
|
148
|
-
this.notifyListeners(t,
|
|
147
|
+
this.windowListeners[t] = { registered: !1, windowEventName: e, pluginEventName: t, handler: (r) => {
|
|
148
|
+
this.notifyListeners(t, r);
|
|
149
149
|
} };
|
|
150
150
|
}
|
|
151
151
|
unimplemented(e = "not implemented") {
|
|
@@ -155,12 +155,12 @@ class R {
|
|
|
155
155
|
return new w.Exception(e, S.Unavailable);
|
|
156
156
|
}
|
|
157
157
|
removeListener(e, t) {
|
|
158
|
-
return
|
|
159
|
-
const
|
|
160
|
-
if (!
|
|
158
|
+
return s(this, null, function* () {
|
|
159
|
+
const r = this.listeners[e];
|
|
160
|
+
if (!r)
|
|
161
161
|
return;
|
|
162
|
-
const
|
|
163
|
-
this.listeners[e].splice(
|
|
162
|
+
const a = r.indexOf(t);
|
|
163
|
+
this.listeners[e].splice(a, 1), this.listeners[e].length || this.removeWindowListener(this.windowListeners[e]);
|
|
164
164
|
});
|
|
165
165
|
}
|
|
166
166
|
addWindowListener(e) {
|
|
@@ -171,30 +171,30 @@ class R {
|
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
const oe = (n) => encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape), ie = (n) => n.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
|
|
174
|
-
class he extends
|
|
174
|
+
class he extends F {
|
|
175
175
|
getCookies() {
|
|
176
|
-
return
|
|
176
|
+
return s(this, null, function* () {
|
|
177
177
|
const e = document.cookie, t = {};
|
|
178
|
-
return e.split(";").forEach((
|
|
179
|
-
if (
|
|
178
|
+
return e.split(";").forEach((r) => {
|
|
179
|
+
if (r.length <= 0)
|
|
180
180
|
return;
|
|
181
|
-
let [
|
|
182
|
-
|
|
181
|
+
let [a, i] = r.replace(/=/, "CAP_COOKIE").split("CAP_COOKIE");
|
|
182
|
+
a = ie(a).trim(), i = ie(i).trim(), t[a] = i;
|
|
183
183
|
}), t;
|
|
184
184
|
});
|
|
185
185
|
}
|
|
186
186
|
setCookie(e) {
|
|
187
|
-
return
|
|
187
|
+
return s(this, null, function* () {
|
|
188
188
|
try {
|
|
189
|
-
const t = oe(e.key),
|
|
190
|
-
document.cookie = `${t}=${
|
|
189
|
+
const t = oe(e.key), r = oe(e.value), a = `; expires=${(e.expires || "").replace("expires=", "")}`, i = (e.path || "/").replace("path=", ""), d = e.url != null && e.url.length > 0 ? `domain=${e.url}` : "";
|
|
190
|
+
document.cookie = `${t}=${r || ""}${a}; path=${i}; ${d};`;
|
|
191
191
|
} catch (t) {
|
|
192
192
|
return Promise.reject(t);
|
|
193
193
|
}
|
|
194
194
|
});
|
|
195
195
|
}
|
|
196
196
|
deleteCookie(e) {
|
|
197
|
-
return
|
|
197
|
+
return s(this, null, function* () {
|
|
198
198
|
try {
|
|
199
199
|
document.cookie = `${e.key}=; Max-Age=0`;
|
|
200
200
|
} catch (t) {
|
|
@@ -203,7 +203,7 @@ class he extends R {
|
|
|
203
203
|
});
|
|
204
204
|
}
|
|
205
205
|
clearCookies() {
|
|
206
|
-
return
|
|
206
|
+
return s(this, null, function* () {
|
|
207
207
|
try {
|
|
208
208
|
const e = document.cookie.split(";") || [];
|
|
209
209
|
for (const t of e)
|
|
@@ -214,7 +214,7 @@ class he extends R {
|
|
|
214
214
|
});
|
|
215
215
|
}
|
|
216
216
|
clearAllCookies() {
|
|
217
|
-
return
|
|
217
|
+
return s(this, null, function* () {
|
|
218
218
|
try {
|
|
219
219
|
yield this.clearCookies();
|
|
220
220
|
} catch (e) {
|
|
@@ -224,92 +224,92 @@ class he extends R {
|
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
Y("CapacitorCookies", { web: () => new he() });
|
|
227
|
-
const
|
|
228
|
-
const t = Object.assign({ method: n.method || "GET", headers: n.headers }, e),
|
|
229
|
-
const
|
|
230
|
-
return Object.keys(
|
|
227
|
+
const ge = (n, e = {}) => {
|
|
228
|
+
const t = Object.assign({ method: n.method || "GET", headers: n.headers }, e), r = ((a = {}) => {
|
|
229
|
+
const i = Object.keys(a);
|
|
230
|
+
return Object.keys(a).map((d) => d.toLocaleLowerCase()).reduce((d, o, u) => (d[o] = a[i[u]], d), {});
|
|
231
231
|
})(n.headers)["content-type"] || "";
|
|
232
232
|
if (typeof n.data == "string")
|
|
233
233
|
t.body = n.data;
|
|
234
|
-
else if (
|
|
235
|
-
const
|
|
236
|
-
for (const [
|
|
237
|
-
|
|
238
|
-
t.body =
|
|
239
|
-
} else if (
|
|
240
|
-
const
|
|
234
|
+
else if (r.includes("application/x-www-form-urlencoded")) {
|
|
235
|
+
const a = new URLSearchParams();
|
|
236
|
+
for (const [i, d] of Object.entries(n.data || {}))
|
|
237
|
+
a.set(i, d);
|
|
238
|
+
t.body = a.toString();
|
|
239
|
+
} else if (r.includes("multipart/form-data")) {
|
|
240
|
+
const a = new FormData();
|
|
241
241
|
if (n.data instanceof FormData)
|
|
242
|
-
n.data.forEach((d,
|
|
243
|
-
|
|
242
|
+
n.data.forEach((d, o) => {
|
|
243
|
+
a.append(o, d);
|
|
244
244
|
});
|
|
245
245
|
else
|
|
246
246
|
for (const d of Object.keys(n.data))
|
|
247
|
-
|
|
248
|
-
t.body =
|
|
249
|
-
const
|
|
250
|
-
|
|
247
|
+
a.append(d, n.data[d]);
|
|
248
|
+
t.body = a;
|
|
249
|
+
const i = new Headers(t.headers);
|
|
250
|
+
i.delete("content-type"), t.headers = i;
|
|
251
251
|
} else
|
|
252
|
-
(
|
|
252
|
+
(r.includes("application/json") || typeof n.data == "object") && (t.body = JSON.stringify(n.data));
|
|
253
253
|
return t;
|
|
254
254
|
};
|
|
255
|
-
class
|
|
255
|
+
class ve extends F {
|
|
256
256
|
request(e) {
|
|
257
|
-
return
|
|
258
|
-
const t =
|
|
259
|
-
const [b, l] =
|
|
257
|
+
return s(this, null, function* () {
|
|
258
|
+
const t = ge(e, e.webFetchExtra), r = ((h, C = !0) => h ? Object.entries(h).reduce((O, v) => {
|
|
259
|
+
const [b, l] = v;
|
|
260
260
|
let c, m;
|
|
261
261
|
return Array.isArray(l) ? (m = "", l.forEach((_) => {
|
|
262
|
-
c =
|
|
263
|
-
}), m.slice(0, -1)) : (c =
|
|
264
|
-
}, "").substr(1) : null)(e.params, e.shouldEncodeUrlParams),
|
|
265
|
-
let
|
|
262
|
+
c = C ? encodeURIComponent(_) : _, m += `${b}=${c}&`;
|
|
263
|
+
}), m.slice(0, -1)) : (c = C ? encodeURIComponent(l) : l, m = `${b}=${c}`), `${O}&${m}`;
|
|
264
|
+
}, "").substr(1) : null)(e.params, e.shouldEncodeUrlParams), a = r ? `${e.url}?${r}` : e.url, i = yield fetch(a, t), d = i.headers.get("content-type") || "";
|
|
265
|
+
let o, u, { responseType: p = "text" } = i.ok ? e : {};
|
|
266
266
|
switch (d.includes("application/json") && (p = "json"), p) {
|
|
267
267
|
case "arraybuffer":
|
|
268
268
|
case "blob":
|
|
269
|
-
u = yield
|
|
270
|
-
return new Promise((
|
|
271
|
-
const
|
|
272
|
-
|
|
273
|
-
const b =
|
|
274
|
-
|
|
275
|
-
},
|
|
269
|
+
u = yield i.blob(), o = yield ((h) => s(this, null, function* () {
|
|
270
|
+
return new Promise((C, O) => {
|
|
271
|
+
const v = new FileReader();
|
|
272
|
+
v.onload = () => {
|
|
273
|
+
const b = v.result;
|
|
274
|
+
C(b.indexOf(",") >= 0 ? b.split(",")[1] : b);
|
|
275
|
+
}, v.onerror = (b) => O(b), v.readAsDataURL(h);
|
|
276
276
|
});
|
|
277
277
|
}))(u);
|
|
278
278
|
break;
|
|
279
279
|
case "json":
|
|
280
|
-
|
|
280
|
+
o = yield i.json();
|
|
281
281
|
break;
|
|
282
282
|
default:
|
|
283
|
-
|
|
283
|
+
o = yield i.text();
|
|
284
284
|
}
|
|
285
|
-
const
|
|
286
|
-
return
|
|
287
|
-
|
|
288
|
-
}), { data:
|
|
285
|
+
const g = {};
|
|
286
|
+
return i.headers.forEach((h, C) => {
|
|
287
|
+
g[C] = h;
|
|
288
|
+
}), { data: o, headers: g, status: i.status, url: i.url };
|
|
289
289
|
});
|
|
290
290
|
}
|
|
291
291
|
get(e) {
|
|
292
|
-
return
|
|
292
|
+
return s(this, null, function* () {
|
|
293
293
|
return this.request(Object.assign(Object.assign({}, e), { method: "GET" }));
|
|
294
294
|
});
|
|
295
295
|
}
|
|
296
296
|
post(e) {
|
|
297
|
-
return
|
|
297
|
+
return s(this, null, function* () {
|
|
298
298
|
return this.request(Object.assign(Object.assign({}, e), { method: "POST" }));
|
|
299
299
|
});
|
|
300
300
|
}
|
|
301
301
|
put(e) {
|
|
302
|
-
return
|
|
302
|
+
return s(this, null, function* () {
|
|
303
303
|
return this.request(Object.assign(Object.assign({}, e), { method: "PUT" }));
|
|
304
304
|
});
|
|
305
305
|
}
|
|
306
306
|
patch(e) {
|
|
307
|
-
return
|
|
307
|
+
return s(this, null, function* () {
|
|
308
308
|
return this.request(Object.assign(Object.assign({}, e), { method: "PATCH" }));
|
|
309
309
|
});
|
|
310
310
|
}
|
|
311
311
|
delete(e) {
|
|
312
|
-
return
|
|
312
|
+
return s(this, null, function* () {
|
|
313
313
|
return this.request(Object.assign(Object.assign({}, e), { method: "DELETE" }));
|
|
314
314
|
});
|
|
315
315
|
}
|
|
@@ -317,42 +317,38 @@ class ge extends R {
|
|
|
317
317
|
function J() {
|
|
318
318
|
return w.getPlatform() === "android" ? JSON.parse(AndroidInitialContext.initialContext()) : window.portalInitialContext;
|
|
319
319
|
}
|
|
320
|
-
Y("CapacitorHttp", { web: () => new
|
|
320
|
+
Y("CapacitorHttp", { web: () => new ve() }), /*! Ionic Portals: https://ionic.io/portals - Commercial License */
|
|
321
321
|
Y("Portals", { web: () => Promise.resolve().then(function() {
|
|
322
322
|
return be;
|
|
323
323
|
}).then((n) => new n.PortalsWeb()) });
|
|
324
|
-
const be = Object.freeze({ __proto__: null, PortalsWeb: class extends
|
|
324
|
+
const be = Object.freeze({ __proto__: null, PortalsWeb: class extends F {
|
|
325
325
|
publishNative(n) {
|
|
326
|
-
return
|
|
326
|
+
return s(this, null, function* () {
|
|
327
327
|
});
|
|
328
328
|
}
|
|
329
329
|
} });
|
|
330
|
-
var
|
|
330
|
+
var U = ((n) => (n.DEV = "dev", n.SIT = "sit", n.UAT = "uat", n.PROD = "prod", n.TEST = "test", n))(U || {}), B = ((n) => (n.EU = "eu", n.ASIA = "asia", n))(B || {});
|
|
331
331
|
const Q = (n) => {
|
|
332
|
-
var e, t,
|
|
332
|
+
var e, t, r;
|
|
333
333
|
if (typeof window != "undefined" && J && ((e = J()) != null && e.value)) {
|
|
334
|
-
const
|
|
335
|
-
if (!
|
|
334
|
+
const a = (r = (t = J()) == null ? void 0 : t.value) != null ? r : null;
|
|
335
|
+
if (!a)
|
|
336
336
|
return void console.error("native initialContext is undefine");
|
|
337
337
|
if (!n)
|
|
338
338
|
return void console.error("initialContext call back is undefine");
|
|
339
|
-
n(
|
|
339
|
+
n(a);
|
|
340
340
|
}
|
|
341
|
-
}, _e = (n) => new Promise((e) =>
|
|
341
|
+
}, _e = (n) => new Promise((e) => s(void 0, null, function* () {
|
|
342
342
|
let t = null;
|
|
343
|
-
t = n != null && n.mockData ? n.mockData : ((
|
|
344
|
-
var
|
|
345
|
-
const
|
|
343
|
+
t = n != null && n.mockData ? n.mockData : ((r, { asiaUatData: a, euSitData: i, euUatData: d }) => {
|
|
344
|
+
var g, h;
|
|
345
|
+
const o = (g = r.mockServerInfo) == null ? void 0 : g.env, u = (h = r.mockServerInfo) == null ? void 0 : h.area;
|
|
346
346
|
let p = null;
|
|
347
|
-
return
|
|
348
|
-
})(n, { asiaUatData: yield Promise.resolve().then(() =>
|
|
349
|
-
})),
|
|
350
|
-
constructor() {
|
|
351
|
-
B(this, "nativeAppInfoConfig");
|
|
352
|
-
this.nativeAppInfoConfig = U.defaultNativeAppInfoConfig;
|
|
353
|
-
}
|
|
347
|
+
return o && u && (B.ASIA === u ? U.UAT === o && (p = a) : B.EU === u && (U.SIT === o ? p = i : U.UAT === o && (p = d))), p;
|
|
348
|
+
})(n, { asiaUatData: yield Promise.resolve().then(() => Ae), euSitData: yield Promise.resolve().then(() => Oe), euUatData: yield Promise.resolve().then(() => Ee) }), e(t ? t != null && t.default ? t == null ? void 0 : t.default : t : null);
|
|
349
|
+
})), $ = class $ {
|
|
354
350
|
isNativeHandle() {
|
|
355
|
-
return
|
|
351
|
+
return s(this, null, function* () {
|
|
356
352
|
return yield (() => {
|
|
357
353
|
let e = !1;
|
|
358
354
|
return Q((t) => {
|
|
@@ -362,46 +358,47 @@ const Q = (n) => {
|
|
|
362
358
|
});
|
|
363
359
|
}
|
|
364
360
|
specifiedPageHandle(e) {
|
|
365
|
-
return
|
|
361
|
+
return s(this, null, function* () {
|
|
366
362
|
yield (({ cb: t }) => {
|
|
367
|
-
Q((
|
|
368
|
-
var
|
|
369
|
-
if (!(
|
|
363
|
+
Q((r) => {
|
|
364
|
+
var o;
|
|
365
|
+
if (!(r != null && r.params))
|
|
370
366
|
return void console.error("native params is undefine");
|
|
371
|
-
const
|
|
372
|
-
if (!
|
|
367
|
+
const a = (o = JSON.parse(r.params)) != null ? o : null;
|
|
368
|
+
if (!a)
|
|
373
369
|
return;
|
|
374
|
-
const { params:
|
|
375
|
-
|
|
370
|
+
const { params: i, routeName: d } = a;
|
|
371
|
+
i && d && (t ? t(a) : console.error("call back is undefine"));
|
|
376
372
|
});
|
|
377
373
|
})(e);
|
|
378
374
|
});
|
|
379
375
|
}
|
|
380
376
|
nativeAppInfoHandle(e) {
|
|
381
|
-
return
|
|
382
|
-
|
|
383
|
-
|
|
377
|
+
return s(this, null, function* () {
|
|
378
|
+
const t = e != null && e.mockServerInfo || e != null && e.mockData ? e : $.defaultNativeAppInfoConfig;
|
|
379
|
+
return (yield this.isNativeHandle()) ? yield (() => {
|
|
380
|
+
let r = null;
|
|
384
381
|
return Q((a) => {
|
|
385
|
-
|
|
386
|
-
}),
|
|
387
|
-
})() : yield _e(
|
|
382
|
+
r = a != null ? a : null;
|
|
383
|
+
}), r;
|
|
384
|
+
})() : yield _e(t);
|
|
388
385
|
});
|
|
389
386
|
}
|
|
390
387
|
};
|
|
391
|
-
|
|
392
|
-
let Z =
|
|
388
|
+
z($, "defaultNativeAppInfoConfig", { mockServerInfo: { area: B.ASIA, env: U.UAT } });
|
|
389
|
+
let Z = $;
|
|
393
390
|
const ee = () => {
|
|
394
391
|
let n = null;
|
|
395
392
|
return n = typeof window == "undefined" ? {} : window, n;
|
|
396
|
-
},
|
|
393
|
+
}, R = "CommunicatePlugin", f = w.registerPlugin(R, { web: () => Promise.resolve().then(() => Se).then((n) => new n.PluginsWeb()) }), k = ee();
|
|
397
394
|
k.addListenerBackHandle = () => null;
|
|
398
395
|
const ye = (n) => {
|
|
399
396
|
k != null && k.addListenerBackHandle && k.addListenerBackHandle(), setTimeout(() => {
|
|
400
|
-
((e) =>
|
|
401
|
-
k != null && k.addListenerBackHandle && e && (k.addListenerBackHandle = yield ((t) =>
|
|
397
|
+
((e) => s(void 0, null, function* () {
|
|
398
|
+
k != null && k.addListenerBackHandle && e && (k.addListenerBackHandle = yield ((t) => s(void 0, null, function* () {
|
|
402
399
|
if (w.addListener) {
|
|
403
|
-
const
|
|
404
|
-
return
|
|
400
|
+
const r = yield w.addListener(R, "nativeSendBack", (a) => t && t(a));
|
|
401
|
+
return r != null && r.remove ? r.remove : () => null;
|
|
405
402
|
}
|
|
406
403
|
}))(e));
|
|
407
404
|
}))(n);
|
|
@@ -412,86 +409,86 @@ const X = (n) => {
|
|
|
412
409
|
de = (e) => {
|
|
413
410
|
n && n(e);
|
|
414
411
|
};
|
|
415
|
-
},
|
|
416
|
-
|
|
412
|
+
}, I = ee();
|
|
413
|
+
I.addListenerHomeHandle = () => null;
|
|
417
414
|
const Pe = (n) => {
|
|
418
|
-
|
|
419
|
-
((e) =>
|
|
420
|
-
e && (
|
|
415
|
+
I.addListenerHomeHandle && I.addListenerHomeHandle(), setTimeout(() => {
|
|
416
|
+
((e) => s(void 0, null, function* () {
|
|
417
|
+
e && (I.addListenerHomeHandle = yield ((t) => s(void 0, null, function* () {
|
|
421
418
|
if (w.addListener) {
|
|
422
|
-
const
|
|
423
|
-
return
|
|
419
|
+
const r = yield w.addListener(R, "nativeSendHome", (a) => t && t(a));
|
|
420
|
+
return r != null && r.remove ? r.remove : () => null;
|
|
424
421
|
}
|
|
425
422
|
}))(e));
|
|
426
423
|
}))(n);
|
|
427
424
|
});
|
|
428
|
-
},
|
|
429
|
-
|
|
425
|
+
}, x = ee();
|
|
426
|
+
x.removeAddListenerFab = () => null;
|
|
430
427
|
const ke = (n) => {
|
|
431
|
-
var t,
|
|
432
|
-
|
|
428
|
+
var t, r;
|
|
429
|
+
x.removeAddListenerFab && x.removeAddListenerFab();
|
|
433
430
|
const e = [];
|
|
434
|
-
(t = f.showFABMenu) == null || t.call(f, { fabMenu: e }), n && ((
|
|
435
|
-
e.push({ icon: n[
|
|
431
|
+
(t = f.showFABMenu) == null || t.call(f, { fabMenu: e }), n && ((r = Object.keys(n)) != null && r.length) && (Object.keys(n).forEach((a) => {
|
|
432
|
+
e.push({ icon: n[a].icon, id: n[a].id, name: n[a].title });
|
|
436
433
|
}), queueMicrotask(() => {
|
|
437
|
-
var
|
|
438
|
-
(
|
|
434
|
+
var a;
|
|
435
|
+
(a = f.showFABMenu) == null || a.call(f, { fabMenu: e });
|
|
439
436
|
}), setTimeout(() => {
|
|
440
|
-
((
|
|
441
|
-
|
|
437
|
+
((a) => s(void 0, null, function* () {
|
|
438
|
+
a && (x.removeAddListenerFab = yield ((i) => s(void 0, null, function* () {
|
|
442
439
|
if (w.addListener) {
|
|
443
|
-
const d = yield w.addListener(
|
|
440
|
+
const d = yield w.addListener(R, "nativeSendFab", (o) => i && i(o));
|
|
444
441
|
return d != null && d.remove ? d.remove : () => null;
|
|
445
442
|
}
|
|
446
|
-
}))(
|
|
447
|
-
}))((
|
|
448
|
-
let
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
}),
|
|
443
|
+
}))(a));
|
|
444
|
+
}))((a) => {
|
|
445
|
+
let i;
|
|
446
|
+
a && a.id && Object.keys(n).forEach((d) => {
|
|
447
|
+
a.id === n[d].id && (i = n[d].fn);
|
|
448
|
+
}), i && i();
|
|
452
449
|
});
|
|
453
450
|
}));
|
|
454
451
|
};
|
|
455
|
-
class
|
|
452
|
+
class Ce {
|
|
456
453
|
constructor() {
|
|
457
454
|
var e;
|
|
458
455
|
(e = this.homeIsClick) == null || e.call(this, { isClick: !0 });
|
|
459
456
|
}
|
|
460
457
|
homeIsClick(e) {
|
|
461
|
-
return
|
|
458
|
+
return s(this, null, function* () {
|
|
462
459
|
var t;
|
|
463
460
|
return yield (t = f.homeIsClick) == null ? void 0 : t.call(f, e);
|
|
464
461
|
});
|
|
465
462
|
}
|
|
466
463
|
openMinApp(e) {
|
|
467
|
-
return
|
|
464
|
+
return s(this, null, function* () {
|
|
468
465
|
return yield f.openMinApp(e);
|
|
469
466
|
});
|
|
470
467
|
}
|
|
471
468
|
showTitle(e) {
|
|
472
|
-
return
|
|
469
|
+
return s(this, null, function* () {
|
|
473
470
|
return yield f.showTitle(e);
|
|
474
471
|
});
|
|
475
472
|
}
|
|
476
473
|
showSubMask(e) {
|
|
477
|
-
return
|
|
474
|
+
return s(this, null, function* () {
|
|
478
475
|
return yield f.showSubMask(e);
|
|
479
476
|
});
|
|
480
477
|
}
|
|
481
478
|
backBtnApiHook(e) {
|
|
482
|
-
return t = e, { initBackBtnHandle: (
|
|
483
|
-
|
|
479
|
+
return t = e, { initBackBtnHandle: (r) => {
|
|
480
|
+
r && r.afterEach((a) => {
|
|
484
481
|
ye(() => {
|
|
485
|
-
|
|
482
|
+
a != null && a.name && de(a.name);
|
|
486
483
|
});
|
|
487
484
|
});
|
|
488
|
-
}, registerBackBtnHandle: (
|
|
489
|
-
const { onMounted:
|
|
490
|
-
|
|
485
|
+
}, registerBackBtnHandle: (r) => {
|
|
486
|
+
const { onMounted: a, onUnmounted: i } = r;
|
|
487
|
+
a(() => {
|
|
491
488
|
X((d) => {
|
|
492
489
|
t != null && t.backBtnCb && t.backBtnCb(d);
|
|
493
490
|
});
|
|
494
|
-
}),
|
|
491
|
+
}), i(() => {
|
|
495
492
|
X && X(() => "");
|
|
496
493
|
});
|
|
497
494
|
} };
|
|
@@ -503,70 +500,100 @@ class Ae {
|
|
|
503
500
|
fabBtnHandle(e) {
|
|
504
501
|
ke(e);
|
|
505
502
|
}
|
|
503
|
+
showDialog() {
|
|
504
|
+
return s(this, null, function* () {
|
|
505
|
+
return yield f.showDialog();
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
cancelDialog() {
|
|
509
|
+
return s(this, null, function* () {
|
|
510
|
+
return yield f.cancelDialog();
|
|
511
|
+
});
|
|
512
|
+
}
|
|
506
513
|
}
|
|
507
|
-
|
|
514
|
+
class Le extends Z {
|
|
508
515
|
constructor() {
|
|
509
|
-
super();
|
|
510
|
-
|
|
516
|
+
super(...arguments);
|
|
517
|
+
z(this, "communicatePlugins", new Ce());
|
|
511
518
|
}
|
|
512
|
-
openMinAppHandle(
|
|
513
|
-
return
|
|
514
|
-
return yield this.communicatePlugins.openMinApp(
|
|
519
|
+
openMinAppHandle(t) {
|
|
520
|
+
return s(this, null, function* () {
|
|
521
|
+
return yield this.communicatePlugins.openMinApp(t);
|
|
515
522
|
});
|
|
516
523
|
}
|
|
517
|
-
showTitleHandle(
|
|
518
|
-
return
|
|
519
|
-
return yield this.communicatePlugins.showTitle(
|
|
524
|
+
showTitleHandle(t) {
|
|
525
|
+
return s(this, null, function* () {
|
|
526
|
+
return yield this.communicatePlugins.showTitle(t);
|
|
520
527
|
});
|
|
521
528
|
}
|
|
522
|
-
showSubMaskHandle(
|
|
523
|
-
return
|
|
524
|
-
return yield this.communicatePlugins.showSubMask(
|
|
529
|
+
showSubMaskHandle(t) {
|
|
530
|
+
return s(this, null, function* () {
|
|
531
|
+
return yield this.communicatePlugins.showSubMask(t);
|
|
525
532
|
});
|
|
526
533
|
}
|
|
527
|
-
backBtnApiHook(
|
|
528
|
-
return this.communicatePlugins.backBtnApiHook(
|
|
534
|
+
backBtnApiHook(t) {
|
|
535
|
+
return this.communicatePlugins.backBtnApiHook(t);
|
|
529
536
|
}
|
|
530
|
-
homeBtnHandle(
|
|
531
|
-
this.communicatePlugins.homeBtnHandle(
|
|
537
|
+
homeBtnHandle(t) {
|
|
538
|
+
this.communicatePlugins.homeBtnHandle(t);
|
|
532
539
|
}
|
|
533
|
-
fabBtnHandle(
|
|
534
|
-
this.communicatePlugins.fabBtnHandle(
|
|
540
|
+
fabBtnHandle(t) {
|
|
541
|
+
this.communicatePlugins.fabBtnHandle(t);
|
|
535
542
|
}
|
|
536
|
-
|
|
543
|
+
showDialogHandle() {
|
|
544
|
+
return s(this, null, function* () {
|
|
545
|
+
return yield this.communicatePlugins.showDialog();
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
cancelDialogHandle() {
|
|
549
|
+
return s(this, null, function* () {
|
|
550
|
+
return yield this.communicatePlugins.cancelDialog();
|
|
551
|
+
});
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
const Te = new Le(), Ae = Object.freeze(Object.defineProperty({ __proto__: null, default: { data_info: { bu: { default_tenant_code: "WTCHK", tenants: [{ store_detail_list: [{ name: "APELDOORN HOOFDSTRAAT 136", code: "3462" }], name: "WTCHK", stores: ["3462"], timezone: "Europe/Amsterdam", code: "WTCHK" }] }, menus: [{ code: "osp-superapp-inventory", id: "6113847737833037825", name: "Inventory", parent_id: "0" }, { code: "osp-superapp-event-count", id: "6113867563402076161", name: "Event Count", parent_id: "6113847737833037825" }, { code: "osp-superapp-shelf-fulfillment", id: "6113867975718936577", name: "Shelf Fulfillment", parent_id: "6113847737833037825" }, { code: "osp-superapp-reports", id: "6113868456755273729", name: "Reports", parent_id: "0" }, { code: "osp-superapp-user-management", id: "6113868869072134145", name: "User Management", parent_id: "0" }, { code: "osp-superapp-online-orders", id: "6318558832782852097", name: "Online Orders", parent_id: "0" }, { code: "osp-superapp-pick-pack-orders", id: "6318559348178927617", name: "Pick & Pack Orders", parent_id: "6318558832782852097" }, { code: "osp-superapp-collect-orders", id: "6318559863575003137", name: "Collect Orders", parent_id: "6318558832782852097" }, { code: "osp-superapp-collect-orders@unpack_orders/home", id: "6318560756928200705", name: "Unpack Orders", parent_id: "6318558832782852097" }, { code: "osp-superapp-collect-orders@orders_collect/search", id: "6318561856439828481", name: "Search Orders", parent_id: "6318558832782852097" }], serverInfo: { serverArea: "asia", serverEnv: "uat" }, token: { access_token: "2c0d362e-5835-4bac-b168-a00ac9856998", expires_in: 86399, refresh_token: "992e3a36-fd27-4074-af15-f09a4a939b67", scope: "read write", token_type: "bearer" }, user: { create_time: "2023-08-22 11: 08: 21", email: "ospsuperapp2@163.com", gender: "", id: "6113892817809776640", introduction: "", language: "en", last_modify_time: "2023-08-24 10: 53: 32", password_strength_name: "MIDDLE", password_validity_period: "PERMANENT", password_validity_period_time: "2856-12-22 11: 08: 21", phone: "", real_name: "ospsuperapp2", special: "false", status: "NORMAL", tenant_id: "0", time_zone: "Europe/Amsterdam", type: "STAFF", user_name: "ospsuperapp2", errorCode: 0, errorMessage: "", requseCodeTag: 4, success: !1 } }, data_store: { name: "APELDOORN HOOFDSTRAAT 3462", code: "3462" }, data_language: { code: "en", id: "en_US", name: "English" } } }, Symbol.toStringTag, { value: "Module" })), Oe = Object.freeze(Object.defineProperty({ __proto__: null, default: { data_info: { bu: { default_tenant_code: "KVN", tenants: [{ code: "KVN", name: "KVN", store_detail_list: [{ buCode: "KVN", code: "9998", name: "KVNL 9998" }], stores: ["9998"], timezone: "Europe/Amsterdam" }], errorCode: 0, errorMessage: "", requseCodeTag: 6, success: !1 }, menus: [{ code: "osp-superapp-inventory", id: "6113847737833037825", name: "Inventory", parent_id: "0" }, { code: "osp-superapp-event-count", id: "6113867563402076161", name: "Event Count", parent_id: "6113847737833037825" }, { code: "osp-superapp-shelf-fulfillment", id: "6113867975718936577", name: "Shelf Fulfillment", parent_id: "6113847737833037825" }, { code: "osp-superapp-reports", id: "6113868456755273729", name: "Reports", parent_id: "0" }, { code: "osp-superapp-user-management", id: "6113868869072134145", name: "User Management", parent_id: "0" }, { code: "osp-superapp-online-orders", id: "6318558832782852097", name: "Online Orders", parent_id: "0" }, { code: "osp-superapp-pick-pack-orders", id: "6318559348178927617", name: "Pick & Pack Orders", parent_id: "6318558832782852097" }, { code: "osp-superapp-collect-orders", id: "6318559863575003137", name: "Collect Orders", parent_id: "6318558832782852097" }, { code: "osp-superapp-collect-orders@unpack_orders/home", id: "6318560756928200705", name: "Unpack Orders", parent_id: "6318558832782852097" }, { code: "osp-superapp-collect-orders@orders_collect/search", id: "6318561856439828481", name: "Search Orders", parent_id: "6318558832782852097" }], serverInfo: { serverArea: "eu", serverEnv: "sit" }, token: { access_token: "2c0d362e-5835-4bac-b168-a00ac9856998", expires_in: 86399, refresh_token: "992e3a36-fd27-4074-af15-f09a4a939b67", scope: "read write", token_type: "bearer" }, user: { create_time: "2023-08-22 11: 08: 21", email: "ospsuperapp2@163.com", gender: "", id: "6113892817809776640", introduction: "", language: "en", last_modify_time: "2023-08-24 10: 53: 32", password_strength_name: "MIDDLE", password_validity_period: "PERMANENT", password_validity_period_time: "2856-12-22 11: 08: 21", phone: "", real_name: "ospsuperapp2", special: "false", status: "NORMAL", tenant_id: "0", time_zone: "Europe/Amsterdam", type: "STAFF", user_name: "ospsuperapp2", errorCode: 0, errorMessage: "", requseCodeTag: 4, success: !1 } }, data_store: { buCode: "KVN", code: "9998", name: "KVNL 9998" }, data_language: { code: "en", id: "en_US", name: "English" } } }, Symbol.toStringTag, { value: "Module" })), Ee = Object.freeze(Object.defineProperty({ __proto__: null, default: { data_info: { bu: { default_tenant_code: "KVN", tenants: [{ code: "KVN", name: "KVN", store_detail_list: [{ buCode: "KVN", code: "9998", name: "KVNL 9998" }], stores: ["9998"], timezone: "Europe/Amsterdam" }], errorCode: 0, errorMessage: "", requseCodeTag: 6, success: !1 }, menus: [{ code: "osp-superapp-inventory", id: "6113847737833037825", name: "Inventory", parent_id: "0" }, { code: "osp-superapp-event-count", id: "6113867563402076161", name: "Event Count", parent_id: "6113847737833037825" }, { code: "osp-superapp-shelf-fulfillment", id: "6113867975718936577", name: "Shelf Fulfillment", parent_id: "6113847737833037825" }, { code: "osp-superapp-reports", id: "6113868456755273729", name: "Reports", parent_id: "0" }, { code: "osp-superapp-user-management", id: "6113868869072134145", name: "User Management", parent_id: "0" }, { code: "osp-superapp-online-orders", id: "6318558832782852097", name: "Online Orders", parent_id: "0" }, { code: "osp-superapp-pick-pack-orders", id: "6318559348178927617", name: "Pick & Pack Orders", parent_id: "6318558832782852097" }, { code: "osp-superapp-collect-orders", id: "6318559863575003137", name: "Collect Orders", parent_id: "6318558832782852097" }, { code: "osp-superapp-collect-orders@unpack_orders/home", id: "6318560756928200705", name: "Unpack Orders", parent_id: "6318558832782852097" }, { code: "osp-superapp-collect-orders@orders_collect/search", id: "6318561856439828481", name: "Search Orders", parent_id: "6318558832782852097" }], serverInfo: { serverArea: "eu", serverEnv: "sit" }, token: { access_token: "2c0d362e-5835-4bac-b168-a00ac9856998", expires_in: 86399, refresh_token: "992e3a36-fd27-4074-af15-f09a4a939b67", scope: "read write", token_type: "bearer" }, user: { create_time: "2023-08-22 11: 08: 21", email: "ospsuperapp2@163.com", gender: "", id: "6113892817809776640", introduction: "", language: "en", last_modify_time: "2023-08-24 10: 53: 32", password_strength_name: "MIDDLE", password_validity_period: "PERMANENT", password_validity_period_time: "2856-12-22 11: 08: 21", phone: "", real_name: "ospsuperapp2", special: "false", status: "NORMAL", tenant_id: "0", time_zone: "Europe/Amsterdam", type: "STAFF", user_name: "ospsuperapp2", errorCode: 0, errorMessage: "", requseCodeTag: 4, success: !1 } }, data_store: { buCode: "KVN", code: "9998", name: "KVNL 9998" }, data_language: { code: "en", id: "en_US", name: "English" } } }, Symbol.toStringTag, { value: "Module" })), Se = Object.freeze(Object.defineProperty({ __proto__: null, PluginsWeb: class extends F {
|
|
537
555
|
homeIsClick() {
|
|
538
|
-
return
|
|
556
|
+
return s(this, null, function* () {
|
|
539
557
|
});
|
|
540
558
|
}
|
|
541
559
|
openMinApp(n) {
|
|
542
|
-
return
|
|
560
|
+
return s(this, null, function* () {
|
|
543
561
|
return new Promise((e) => {
|
|
544
562
|
e(n);
|
|
545
563
|
});
|
|
546
564
|
});
|
|
547
565
|
}
|
|
548
566
|
showTitle(n) {
|
|
549
|
-
return
|
|
567
|
+
return s(this, null, function* () {
|
|
550
568
|
return new Promise((e) => {
|
|
551
569
|
e(n);
|
|
552
570
|
});
|
|
553
571
|
});
|
|
554
572
|
}
|
|
555
573
|
showFABMenu(n) {
|
|
556
|
-
return
|
|
574
|
+
return s(this, null, function* () {
|
|
557
575
|
return new Promise((e) => {
|
|
558
576
|
e(n);
|
|
559
577
|
});
|
|
560
578
|
});
|
|
561
579
|
}
|
|
562
580
|
showSubMask(n) {
|
|
563
|
-
return
|
|
581
|
+
return s(this, null, function* () {
|
|
564
582
|
return new Promise((e) => {
|
|
565
583
|
e(n);
|
|
566
584
|
});
|
|
567
585
|
});
|
|
568
586
|
}
|
|
587
|
+
showDialog() {
|
|
588
|
+
return s(this, null, function* () {
|
|
589
|
+
});
|
|
590
|
+
}
|
|
591
|
+
cancelDialog() {
|
|
592
|
+
return s(this, null, function* () {
|
|
593
|
+
});
|
|
594
|
+
}
|
|
569
595
|
} }, Symbol.toStringTag, { value: "Module" }));
|
|
570
596
|
export {
|
|
571
|
-
|
|
597
|
+
Le as NativeApi,
|
|
598
|
+
Te as default
|
|
572
599
|
};
|
package/lib/main.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(w,m){typeof exports=="object"&&typeof module!="undefined"?module.exports=m():typeof define=="function"&&define.amd?define(m):(w=typeof globalThis!="undefined"?globalThis:w||self).main=m()})(this,function(){"use strict";var Ee=Object.defineProperty;var Se=(w,m,u)=>m in w?Ee(w,m,{enumerable:!0,configurable:!0,writable:!0,value:u}):w[m]=u;var J=(w,m,u)=>(Se(w,typeof m!="symbol"?m+"":m,u),u);var o=(w,m,u)=>new Promise((I,K)=>{var Q=v=>{try{T(u.next(v))}catch(j){K(j)}},h=v=>{try{T(u.throw(v))}catch(j){K(j)}},T=v=>v.done?I(v.value):Promise.resolve(v.value).then(Q,h);T((u=u.apply(w,m)).next())});/*! Capacitor: https://capacitorjs.com/ - MIT License */const w=t=>t.CapacitorPlatforms=(e=>{const n=new Map;n.set("web",{name:"web"});const a=e.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:n};return a.addPlatform=(r,s)=>{a.platforms.set(r,s)},a.setPlatform=r=>{a.platforms.has(r)&&(a.currentPlatform=a.platforms.get(r))},a})(t),m=w(typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{});var u;m.addPlatform,m.setPlatform,function(t){t.Unimplemented="UNIMPLEMENTED",t.Unavailable="UNAVAILABLE"}(u||(u={}));class I extends Error{constructor(e,n,a){super(e),this.message=e,this.code=n,this.data=a}}const K=t=>{var e,n,a,r,s;const d=t.CapacitorCustomPlatform||null,i=t.Capacitor||{},_=i.Plugins=i.Plugins||{},p=t.CapacitorPlatforms,y=((e=p==null?void 0:p.currentPlatform)===null||e===void 0?void 0:e.getPlatform)||(()=>d!==null?d.name:(l=>{var c,f;return l!=null&&l.androidBridge?"android":!((f=(c=l==null?void 0:l.webkit)===null||c===void 0?void 0:c.messageHandlers)===null||f===void 0)&&f.bridge?"ios":"web"})(t)),b=((n=p==null?void 0:p.currentPlatform)===null||n===void 0?void 0:n.isNativePlatform)||(()=>y()!=="web"),E=((a=p==null?void 0:p.currentPlatform)===null||a===void 0?void 0:a.isPluginAvailable)||(l=>{const c=P.get(l);return!!(c!=null&&c.platforms.has(y()))||!!M(l)}),M=((r=p==null?void 0:p.currentPlatform)===null||r===void 0?void 0:r.getPluginHeader)||(l=>{var c;return(c=i.PluginHeaders)===null||c===void 0?void 0:c.find(f=>f.name===l)}),P=new Map,k=((s=p==null?void 0:p.currentPlatform)===null||s===void 0?void 0:s.registerPlugin)||((l,c={})=>{const f=P.get(l);if(f)return console.warn(`Capacitor plugin "${l}" already registered. Cannot register plugins twice.`),f.proxy;const A=y(),B=M(l);let N;const ne=L=>{let S;const H=(...G)=>{const D=(()=>o(this,null,function*(){return!N&&A in c?N=N=typeof c[A]=="function"?yield c[A]():c[A]:d!==null&&!N&&"web"in c&&(N=N=typeof c.web=="function"?yield c.web():c.web),N}))().then($=>{const ce=((C,F)=>{var re,oe;if(!B){if(C)return(oe=C[F])===null||oe===void 0?void 0:oe.bind(C);throw new I(`"${l}" plugin is not implemented on ${A}`,u.Unimplemented)}{const pe=B==null?void 0:B.methods.find(R=>F===R.name);if(pe)return pe.rtype==="promise"?R=>i.nativePromise(l,F.toString(),R):(R,Le)=>i.nativeCallback(l,F.toString(),R,Le);if(C)return(re=C[F])===null||re===void 0?void 0:re.bind(C)}})($,L);if(ce){const C=ce(...G);return S=C==null?void 0:C.remove,C}throw new I(`"${l}.${L}()" is not implemented on ${A}`,u.Unimplemented)});return L==="addListener"&&(D.remove=()=>o(this,null,function*(){return S()})),D};return H.toString=()=>`${L.toString()}() { [capacitor code] }`,Object.defineProperty(H,"name",{value:L,writable:!1,configurable:!1}),H},de=ne("addListener"),le=ne("removeListener"),Oe=(L,S)=>{const H=de({eventName:L},S),G=()=>o(this,null,function*(){const $=yield H;le({eventName:L,callbackId:$},S)}),D=new Promise($=>H.then(()=>$({remove:G})));return D.remove=()=>o(this,null,function*(){console.warn("Using addListener() without 'await' is deprecated."),yield G()}),D},ae=new Proxy({},{get(L,S){switch(S){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return B?Oe:de;case"removeListener":return le;default:return ne(S)}}});return _[l]=ae,P.set(l,{name:l,proxy:ae,platforms:new Set([...Object.keys(c),...B?[A]:[]])}),ae});return i.convertFileSrc||(i.convertFileSrc=l=>l),i.getPlatform=y,i.handleError=l=>t.console.error(l),i.isNativePlatform=b,i.isPluginAvailable=E,i.pluginMethodNoop=(l,c,f)=>Promise.reject(`${f} does not have an implementation of "${c}".`),i.registerPlugin=k,i.Exception=I,i.DEBUG=!!i.DEBUG,i.isLoggingEnabled=!!i.isLoggingEnabled,i.platform=i.getPlatform(),i.isNative=i.isNativePlatform(),i},Q=t=>t.Capacitor=K(t),h=Q(typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{}),T=h.registerPlugin;h.Plugins;class v{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,n){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(n);const a=this.windowListeners[e];a&&!a.registered&&this.addWindowListener(a);const r=()=>o(this,null,function*(){return this.removeListener(e,n)}),s=Promise.resolve({remove:r});return Object.defineProperty(s,"remove",{value:()=>o(this,null,function*(){console.warn("Using addListener() without 'await' is deprecated."),yield r()})}),s}removeAllListeners(){return o(this,null,function*(){this.listeners={};for(const e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}})}notifyListeners(e,n){const a=this.listeners[e];a&&a.forEach(r=>r(n))}hasListeners(e){return!!this.listeners[e].length}registerWindowListener(e,n){this.windowListeners[n]={registered:!1,windowEventName:e,pluginEventName:n,handler:a=>{this.notifyListeners(n,a)}}}unimplemented(e="not implemented"){return new h.Exception(e,u.Unimplemented)}unavailable(e="not available"){return new h.Exception(e,u.Unavailable)}removeListener(e,n){return o(this,null,function*(){const a=this.listeners[e];if(!a)return;const r=a.indexOf(n);this.listeners[e].splice(r,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 j=t=>encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),se=t=>t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class ue extends v{getCookies(){return o(this,null,function*(){const e=document.cookie,n={};return e.split(";").forEach(a=>{if(a.length<=0)return;let[r,s]=a.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");r=se(r).trim(),s=se(s).trim(),n[r]=s}),n})}setCookie(e){return o(this,null,function*(){try{const n=j(e.key),a=j(e.value),r=`; expires=${(e.expires||"").replace("expires=","")}`,s=(e.path||"/").replace("path=",""),d=e.url!=null&&e.url.length>0?`domain=${e.url}`:"";document.cookie=`${n}=${a||""}${r}; path=${s}; ${d};`}catch(n){return Promise.reject(n)}})}deleteCookie(e){return o(this,null,function*(){try{document.cookie=`${e.key}=; Max-Age=0`}catch(n){return Promise.reject(n)}})}clearCookies(){return o(this,null,function*(){try{const e=document.cookie.split(";")||[];for(const n of e)document.cookie=n.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(e){return Promise.reject(e)}})}clearAllCookies(){return o(this,null,function*(){try{yield this.clearCookies()}catch(e){return Promise.reject(e)}})}}T("CapacitorCookies",{web:()=>new ue});const me=(t,e={})=>{const n=Object.assign({method:t.method||"GET",headers:t.headers},e),a=((r={})=>{const s=Object.keys(r);return Object.keys(r).map(d=>d.toLocaleLowerCase()).reduce((d,i,_)=>(d[i]=r[s[_]],d),{})})(t.headers)["content-type"]||"";if(typeof t.data=="string")n.body=t.data;else if(a.includes("application/x-www-form-urlencoded")){const r=new URLSearchParams;for(const[s,d]of Object.entries(t.data||{}))r.set(s,d);n.body=r.toString()}else if(a.includes("multipart/form-data")){const r=new FormData;if(t.data instanceof FormData)t.data.forEach((d,i)=>{r.append(i,d)});else for(const d of Object.keys(t.data))r.append(d,t.data[d]);n.body=r;const s=new Headers(n.headers);s.delete("content-type"),n.headers=s}else(a.includes("application/json")||typeof t.data=="object")&&(n.body=JSON.stringify(t.data));return n};class fe extends v{request(e){return o(this,null,function*(){const n=me(e,e.webFetchExtra),a=((b,E=!0)=>b?Object.entries(b).reduce((M,P)=>{const[k,l]=P;let c,f;return Array.isArray(l)?(f="",l.forEach(A=>{c=E?encodeURIComponent(A):A,f+=`${k}=${c}&`}),f.slice(0,-1)):(c=E?encodeURIComponent(l):l,f=`${k}=${c}`),`${M}&${f}`},"").substr(1):null)(e.params,e.shouldEncodeUrlParams),r=a?`${e.url}?${a}`:e.url,s=yield fetch(r,n),d=s.headers.get("content-type")||"";let i,_,{responseType:p="text"}=s.ok?e:{};switch(d.includes("application/json")&&(p="json"),p){case"arraybuffer":case"blob":_=yield s.blob(),i=yield(b=>o(this,null,function*(){return new Promise((E,M)=>{const P=new FileReader;P.onload=()=>{const k=P.result;E(k.indexOf(",")>=0?k.split(",")[1]:k)},P.onerror=k=>M(k),P.readAsDataURL(b)})}))(_);break;case"json":i=yield s.json();break;default:i=yield s.text()}const y={};return s.headers.forEach((b,E)=>{y[E]=b}),{data:i,headers:y,status:s.status,url:s.url}})}get(e){return o(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"GET"}))})}post(e){return o(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"POST"}))})}put(e){return o(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"PUT"}))})}patch(e){return o(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"PATCH"}))})}delete(e){return o(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"DELETE"}))})}}function X(){return h.getPlatform()==="android"?JSON.parse(AndroidInitialContext.initialContext()):window.portalInitialContext}T("CapacitorHttp",{web:()=>new fe}),T("Portals",{web:()=>Promise.resolve().then(function(){return he}).then(t=>new t.PortalsWeb)});const he=Object.freeze({__proto__:null,PortalsWeb:class extends v{publishNative(t){return o(this,null,function*(){})}}});var U=(t=>(t.DEV="dev",t.SIT="sit",t.UAT="uat",t.PROD="prod",t.TEST="test",t))(U||{}),V=(t=>(t.EU="eu",t.ASIA="asia",t))(V||{});const Y=t=>{var e,n,a;if(typeof window!="undefined"&&X&&((e=X())!=null&&e.value)){const r=(a=(n=X())==null?void 0:n.value)!=null?a:null;if(!r)return void console.error("native initialContext is undefine");if(!t)return void console.error("initialContext call back is undefine");t(r)}},we=t=>new Promise(e=>o(this,null,function*(){let n=null;n=t!=null&&t.mockData?t.mockData:((a,{asiaUatData:r,euSitData:s,euUatData:d})=>{var y,b;const i=(y=a.mockServerInfo)==null?void 0:y.env,_=(b=a.mockServerInfo)==null?void 0:b.area;let p=null;return i&&_&&(V.ASIA===_?U.UAT===i&&(p=r):V.EU===_&&(U.SIT===i?p=s:U.UAT===i&&(p=d))),p})(t,{asiaUatData:yield Promise.resolve().then(()=>Pe),euSitData:yield Promise.resolve().then(()=>ke),euUatData:yield Promise.resolve().then(()=>Ae)}),e(n?n!=null&&n.default?n==null?void 0:n.default:n:null)})),x=class x{constructor(){J(this,"nativeAppInfoConfig");this.nativeAppInfoConfig=x.defaultNativeAppInfoConfig}isNativeHandle(){return o(this,null,function*(){return yield(()=>{let e=!1;return Y(n=>{e=!!(n!=null&&n.isNative)}),e})()})}specifiedPageHandle(e){return o(this,null,function*(){yield(({cb:n})=>{Y(a=>{var i;if(!(a!=null&&a.params))return void console.error("native params is undefine");const r=(i=JSON.parse(a.params))!=null?i:null;if(!r)return;const{params:s,routeName:d}=r;s&&d&&(n?n(r):console.error("call back is undefine"))})})(e)})}nativeAppInfoHandle(e){return o(this,null,function*(){return this.nativeAppInfoConfig=e!=null&&e.mockServerInfo||e!=null&&e.mockData?e:x.defaultNativeAppInfoConfig,(yield this.isNativeHandle())?yield(()=>{let n=null;return Y(a=>{n=a!=null?a:null}),n})():yield we(this.nativeAppInfoConfig)})}};J(x,"defaultNativeAppInfoConfig",{mockServerInfo:{area:V.ASIA,env:U.UAT}});let Z=x;const ee=()=>{let t=null;return t=typeof window=="undefined"?{}:window,t},W="CommunicatePlugin",g=h.registerPlugin(W,{web:()=>Promise.resolve().then(()=>Ce).then(t=>new t.PluginsWeb)}),O=ee();O.addListenerBackHandle=()=>null;const ve=t=>{O!=null&&O.addListenerBackHandle&&O.addListenerBackHandle(),setTimeout(()=>{(e=>o(this,null,function*(){O!=null&&O.addListenerBackHandle&&e&&(O.addListenerBackHandle=yield(n=>o(this,null,function*(){if(h.addListener){const a=yield h.addListener(W,"nativeSendBack",r=>n&&n(r));return a!=null&&a.remove?a.remove:()=>null}}))(e))}))(t)})};let ie;const te=t=>{ie=e=>{t&&t(e)}},q=ee();q.addListenerHomeHandle=()=>null;const ge=t=>{q.addListenerHomeHandle&&q.addListenerHomeHandle(),setTimeout(()=>{(e=>o(this,null,function*(){e&&(q.addListenerHomeHandle=yield(n=>o(this,null,function*(){if(h.addListener){const a=yield h.addListener(W,"nativeSendHome",r=>n&&n(r));return a!=null&&a.remove?a.remove:()=>null}}))(e))}))(t)})},z=ee();z.removeAddListenerFab=()=>null;const be=t=>{var n,a;z.removeAddListenerFab&&z.removeAddListenerFab();const e=[];(n=g.showFABMenu)==null||n.call(g,{fabMenu:e}),t&&((a=Object.keys(t))!=null&&a.length)&&(Object.keys(t).forEach(r=>{e.push({icon:t[r].icon,id:t[r].id,name:t[r].title})}),queueMicrotask(()=>{var r;(r=g.showFABMenu)==null||r.call(g,{fabMenu:e})}),setTimeout(()=>{(r=>o(this,null,function*(){r&&(z.removeAddListenerFab=yield(s=>o(this,null,function*(){if(h.addListener){const d=yield h.addListener(W,"nativeSendFab",i=>s&&s(i));return d!=null&&d.remove?d.remove:()=>null}}))(r))}))(r=>{let s;r&&r.id&&Object.keys(t).forEach(d=>{r.id===t[d].id&&(s=t[d].fn)}),s&&s()})}))};class _e{constructor(){var e;(e=this.homeIsClick)==null||e.call(this,{isClick:!0})}homeIsClick(e){return o(this,null,function*(){var n;return yield(n=g.homeIsClick)==null?void 0:n.call(g,e)})}openMinApp(e){return o(this,null,function*(){return yield g.openMinApp(e)})}showTitle(e){return o(this,null,function*(){return yield g.showTitle(e)})}showSubMask(e){return o(this,null,function*(){return yield g.showSubMask(e)})}backBtnApiHook(e){return n=e,{initBackBtnHandle:a=>{a&&a.afterEach(r=>{ve(()=>{r!=null&&r.name&&ie(r.name)})})},registerBackBtnHandle:a=>{const{onMounted:r,onUnmounted:s}=a;r(()=>{te(d=>{n!=null&&n.backBtnCb&&n.backBtnCb(d)})}),s(()=>{te&&te(()=>"")})}};var n}homeBtnHandle(e){ge(e)}fabBtnHandle(e){be(e)}}const ye=new class extends Z{constructor(){super();J(this,"communicatePlugins",new _e)}openMinAppHandle(e){return o(this,null,function*(){return yield this.communicatePlugins.openMinApp(e)})}showTitleHandle(e){return o(this,null,function*(){return yield this.communicatePlugins.showTitle(e)})}showSubMaskHandle(e){return o(this,null,function*(){return yield this.communicatePlugins.showSubMask(e)})}backBtnApiHook(e){return this.communicatePlugins.backBtnApiHook(e)}homeBtnHandle(e){this.communicatePlugins.homeBtnHandle(e)}fabBtnHandle(e){this.communicatePlugins.fabBtnHandle(e)}},Pe=Object.freeze(Object.defineProperty({__proto__:null,default:{data_info:{bu:{default_tenant_code:"WTCHK",tenants:[{store_detail_list:[{name:"APELDOORN HOOFDSTRAAT 136",code:"3462"}],name:"WTCHK",stores:["3462"],timezone:"Europe/Amsterdam",code:"WTCHK"}]},menus:[{code:"osp-superapp-inventory",id:"6113847737833037825",name:"Inventory",parent_id:"0"},{code:"osp-superapp-event-count",id:"6113867563402076161",name:"Event Count",parent_id:"6113847737833037825"},{code:"osp-superapp-shelf-fulfillment",id:"6113867975718936577",name:"Shelf Fulfillment",parent_id:"6113847737833037825"},{code:"osp-superapp-reports",id:"6113868456755273729",name:"Reports",parent_id:"0"},{code:"osp-superapp-user-management",id:"6113868869072134145",name:"User Management",parent_id:"0"},{code:"osp-superapp-online-orders",id:"6318558832782852097",name:"Online Orders",parent_id:"0"},{code:"osp-superapp-pick-pack-orders",id:"6318559348178927617",name:"Pick & Pack Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders",id:"6318559863575003137",name:"Collect Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders@unpack_orders/home",id:"6318560756928200705",name:"Unpack Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders@orders_collect/search",id:"6318561856439828481",name:"Search Orders",parent_id:"6318558832782852097"}],serverInfo:{serverArea:"asia",serverEnv:"uat"},token:{access_token:"2c0d362e-5835-4bac-b168-a00ac9856998",expires_in:86399,refresh_token:"992e3a36-fd27-4074-af15-f09a4a939b67",scope:"read write",token_type:"bearer"},user:{create_time:"2023-08-22 11: 08: 21",email:"ospsuperapp2@163.com",gender:"",id:"6113892817809776640",introduction:"",language:"en",last_modify_time:"2023-08-24 10: 53: 32",password_strength_name:"MIDDLE",password_validity_period:"PERMANENT",password_validity_period_time:"2856-12-22 11: 08: 21",phone:"",real_name:"ospsuperapp2",special:"false",status:"NORMAL",tenant_id:"0",time_zone:"Europe/Amsterdam",type:"STAFF",user_name:"ospsuperapp2",errorCode:0,errorMessage:"",requseCodeTag:4,success:!1}},data_store:{name:"APELDOORN HOOFDSTRAAT 3462",code:"3462"},data_language:{code:"en",id:"en_US",name:"English"}}},Symbol.toStringTag,{value:"Module"})),ke=Object.freeze(Object.defineProperty({__proto__:null,default:{data_info:{bu:{default_tenant_code:"KVN",tenants:[{code:"KVN",name:"KVN",store_detail_list:[{buCode:"KVN",code:"9998",name:"KVNL 9998"}],stores:["9998"],timezone:"Europe/Amsterdam"}],errorCode:0,errorMessage:"",requseCodeTag:6,success:!1},menus:[{code:"osp-superapp-inventory",id:"6113847737833037825",name:"Inventory",parent_id:"0"},{code:"osp-superapp-event-count",id:"6113867563402076161",name:"Event Count",parent_id:"6113847737833037825"},{code:"osp-superapp-shelf-fulfillment",id:"6113867975718936577",name:"Shelf Fulfillment",parent_id:"6113847737833037825"},{code:"osp-superapp-reports",id:"6113868456755273729",name:"Reports",parent_id:"0"},{code:"osp-superapp-user-management",id:"6113868869072134145",name:"User Management",parent_id:"0"},{code:"osp-superapp-online-orders",id:"6318558832782852097",name:"Online Orders",parent_id:"0"},{code:"osp-superapp-pick-pack-orders",id:"6318559348178927617",name:"Pick & Pack Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders",id:"6318559863575003137",name:"Collect Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders@unpack_orders/home",id:"6318560756928200705",name:"Unpack Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders@orders_collect/search",id:"6318561856439828481",name:"Search Orders",parent_id:"6318558832782852097"}],serverInfo:{serverArea:"eu",serverEnv:"sit"},token:{access_token:"2c0d362e-5835-4bac-b168-a00ac9856998",expires_in:86399,refresh_token:"992e3a36-fd27-4074-af15-f09a4a939b67",scope:"read write",token_type:"bearer"},user:{create_time:"2023-08-22 11: 08: 21",email:"ospsuperapp2@163.com",gender:"",id:"6113892817809776640",introduction:"",language:"en",last_modify_time:"2023-08-24 10: 53: 32",password_strength_name:"MIDDLE",password_validity_period:"PERMANENT",password_validity_period_time:"2856-12-22 11: 08: 21",phone:"",real_name:"ospsuperapp2",special:"false",status:"NORMAL",tenant_id:"0",time_zone:"Europe/Amsterdam",type:"STAFF",user_name:"ospsuperapp2",errorCode:0,errorMessage:"",requseCodeTag:4,success:!1}},data_store:{buCode:"KVN",code:"9998",name:"KVNL 9998"},data_language:{code:"en",id:"en_US",name:"English"}}},Symbol.toStringTag,{value:"Module"})),Ae=Object.freeze(Object.defineProperty({__proto__:null,default:{data_info:{bu:{default_tenant_code:"KVN",tenants:[{code:"KVN",name:"KVN",store_detail_list:[{buCode:"KVN",code:"9998",name:"KVNL 9998"}],stores:["9998"],timezone:"Europe/Amsterdam"}],errorCode:0,errorMessage:"",requseCodeTag:6,success:!1},menus:[{code:"osp-superapp-inventory",id:"6113847737833037825",name:"Inventory",parent_id:"0"},{code:"osp-superapp-event-count",id:"6113867563402076161",name:"Event Count",parent_id:"6113847737833037825"},{code:"osp-superapp-shelf-fulfillment",id:"6113867975718936577",name:"Shelf Fulfillment",parent_id:"6113847737833037825"},{code:"osp-superapp-reports",id:"6113868456755273729",name:"Reports",parent_id:"0"},{code:"osp-superapp-user-management",id:"6113868869072134145",name:"User Management",parent_id:"0"},{code:"osp-superapp-online-orders",id:"6318558832782852097",name:"Online Orders",parent_id:"0"},{code:"osp-superapp-pick-pack-orders",id:"6318559348178927617",name:"Pick & Pack Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders",id:"6318559863575003137",name:"Collect Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders@unpack_orders/home",id:"6318560756928200705",name:"Unpack Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders@orders_collect/search",id:"6318561856439828481",name:"Search Orders",parent_id:"6318558832782852097"}],serverInfo:{serverArea:"eu",serverEnv:"sit"},token:{access_token:"2c0d362e-5835-4bac-b168-a00ac9856998",expires_in:86399,refresh_token:"992e3a36-fd27-4074-af15-f09a4a939b67",scope:"read write",token_type:"bearer"},user:{create_time:"2023-08-22 11: 08: 21",email:"ospsuperapp2@163.com",gender:"",id:"6113892817809776640",introduction:"",language:"en",last_modify_time:"2023-08-24 10: 53: 32",password_strength_name:"MIDDLE",password_validity_period:"PERMANENT",password_validity_period_time:"2856-12-22 11: 08: 21",phone:"",real_name:"ospsuperapp2",special:"false",status:"NORMAL",tenant_id:"0",time_zone:"Europe/Amsterdam",type:"STAFF",user_name:"ospsuperapp2",errorCode:0,errorMessage:"",requseCodeTag:4,success:!1}},data_store:{buCode:"KVN",code:"9998",name:"KVNL 9998"},data_language:{code:"en",id:"en_US",name:"English"}}},Symbol.toStringTag,{value:"Module"})),Ce=Object.freeze(Object.defineProperty({__proto__:null,PluginsWeb:class extends v{homeIsClick(){return o(this,null,function*(){})}openMinApp(t){return o(this,null,function*(){return new Promise(e=>{e(t)})})}showTitle(t){return o(this,null,function*(){return new Promise(e=>{e(t)})})}showFABMenu(t){return o(this,null,function*(){return new Promise(e=>{e(t)})})}showSubMask(t){return o(this,null,function*(){return new Promise(e=>{e(t)})})}}},Symbol.toStringTag,{value:"Module"}));return ye});
|
|
1
|
+
(function(w,f){typeof exports=="object"&&typeof module!="undefined"?f(exports):typeof define=="function"&&define.amd?define(["exports"],f):f((w=typeof globalThis!="undefined"?globalThis:w||self).main={})})(this,function(w){"use strict";var Te=Object.defineProperty;var Ne=(w,f,g)=>f in w?Te(w,f,{enumerable:!0,configurable:!0,writable:!0,value:g}):w[f]=g;var oe=(w,f,g)=>(Ne(w,typeof f!="symbol"?f+"":f,g),g);var o=(w,f,g)=>new Promise((O,j)=>{var G=v=>{try{u(g.next(v))}catch(S){j(S)}},J=v=>{try{u(g.throw(v))}catch(S){j(S)}},u=v=>v.done?O(v.value):Promise.resolve(v.value).then(G,J);u((g=g.apply(w,f)).next())});/*! Capacitor: https://capacitorjs.com/ - MIT License */const f=n=>n.CapacitorPlatforms=(e=>{const t=new Map;t.set("web",{name:"web"});const r=e.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:t};return r.addPlatform=(a,s)=>{r.platforms.set(a,s)},r.setPlatform=a=>{r.platforms.has(a)&&(r.currentPlatform=r.platforms.get(a))},r})(n),g=f(typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{});var O;g.addPlatform,g.setPlatform,function(n){n.Unimplemented="UNIMPLEMENTED",n.Unavailable="UNAVAILABLE"}(O||(O={}));class j extends Error{constructor(e,t,r){super(e),this.message=e,this.code=t,this.data=r}}const G=n=>{var e,t,r,a,s;const d=n.CapacitorCustomPlatform||null,i=n.Capacitor||{},_=i.Plugins=i.Plugins||{},p=n.CapacitorPlatforms,y=((e=p==null?void 0:p.currentPlatform)===null||e===void 0?void 0:e.getPlatform)||(()=>d!==null?d.name:(l=>{var c,m;return l!=null&&l.androidBridge?"android":!((m=(c=l==null?void 0:l.webkit)===null||c===void 0?void 0:c.messageHandlers)===null||m===void 0)&&m.bridge?"ios":"web"})(n)),b=((t=p==null?void 0:p.currentPlatform)===null||t===void 0?void 0:t.isNativePlatform)||(()=>y()!=="web"),T=((r=p==null?void 0:p.currentPlatform)===null||r===void 0?void 0:r.isPluginAvailable)||(l=>{const c=P.get(l);return!!(c!=null&&c.platforms.has(y()))||!!H(l)}),H=((a=p==null?void 0:p.currentPlatform)===null||a===void 0?void 0:a.getPluginHeader)||(l=>{var c;return(c=i.PluginHeaders)===null||c===void 0?void 0:c.find(m=>m.name===l)}),P=new Map,k=((s=p==null?void 0:p.currentPlatform)===null||s===void 0?void 0:s.registerPlugin)||((l,c={})=>{const m=P.get(l);if(m)return console.warn(`Capacitor plugin "${l}" already registered. Cannot register plugins twice.`),m.proxy;const L=y(),I=H(l);let M;const te=E=>{let N;const U=(...z)=>{const x=(()=>o(this,null,function*(){return!M&&L in c?M=M=typeof c[L]=="function"?yield c[L]():c[L]:d!==null&&!M&&"web"in c&&(M=M=typeof c.web=="function"?yield c.web():c.web),M}))().then(B=>{const ue=((A,$)=>{var ae,re;if(!I){if(A)return(re=A[$])===null||re===void 0?void 0:re.bind(A);throw new j(`"${l}" plugin is not implemented on ${L}`,O.Unimplemented)}{const me=I==null?void 0:I.methods.find(F=>$===F.name);if(me)return me.rtype==="promise"?F=>i.nativePromise(l,$.toString(),F):(F,Se)=>i.nativeCallback(l,$.toString(),F,Se);if(A)return(ae=A[$])===null||ae===void 0?void 0:ae.bind(A)}})(B,E);if(ue){const A=ue(...z);return N=A==null?void 0:A.remove,A}throw new j(`"${l}.${E}()" is not implemented on ${L}`,O.Unimplemented)});return E==="addListener"&&(x.remove=()=>o(this,null,function*(){return N()})),x};return U.toString=()=>`${E.toString()}() { [capacitor code] }`,Object.defineProperty(U,"name",{value:E,writable:!1,configurable:!1}),U},ce=te("addListener"),pe=te("removeListener"),Oe=(E,N)=>{const U=ce({eventName:E},N),z=()=>o(this,null,function*(){const B=yield U;pe({eventName:E,callbackId:B},N)}),x=new Promise(B=>U.then(()=>B({remove:z})));return x.remove=()=>o(this,null,function*(){console.warn("Using addListener() without 'await' is deprecated."),yield z()}),x},ne=new Proxy({},{get(E,N){switch(N){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return I?Oe:ce;case"removeListener":return pe;default:return te(N)}}});return _[l]=ne,P.set(l,{name:l,proxy:ne,platforms:new Set([...Object.keys(c),...I?[L]:[]])}),ne});return i.convertFileSrc||(i.convertFileSrc=l=>l),i.getPlatform=y,i.handleError=l=>n.console.error(l),i.isNativePlatform=b,i.isPluginAvailable=T,i.pluginMethodNoop=(l,c,m)=>Promise.reject(`${m} does not have an implementation of "${c}".`),i.registerPlugin=k,i.Exception=j,i.DEBUG=!!i.DEBUG,i.isLoggingEnabled=!!i.isLoggingEnabled,i.platform=i.getPlatform(),i.isNative=i.isNativePlatform(),i},J=n=>n.Capacitor=G(n),u=J(typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{}),v=u.registerPlugin;u.Plugins;class S{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,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t);const r=this.windowListeners[e];r&&!r.registered&&this.addWindowListener(r);const a=()=>o(this,null,function*(){return this.removeListener(e,t)}),s=Promise.resolve({remove:a});return Object.defineProperty(s,"remove",{value:()=>o(this,null,function*(){console.warn("Using addListener() without 'await' is deprecated."),yield a()})}),s}removeAllListeners(){return o(this,null,function*(){this.listeners={};for(const e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}})}notifyListeners(e,t){const r=this.listeners[e];r&&r.forEach(a=>a(t))}hasListeners(e){return!!this.listeners[e].length}registerWindowListener(e,t){this.windowListeners[t]={registered:!1,windowEventName:e,pluginEventName:t,handler:r=>{this.notifyListeners(t,r)}}}unimplemented(e="not implemented"){return new u.Exception(e,O.Unimplemented)}unavailable(e="not available"){return new u.Exception(e,O.Unavailable)}removeListener(e,t){return o(this,null,function*(){const r=this.listeners[e];if(!r)return;const a=r.indexOf(t);this.listeners[e].splice(a,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 se=n=>encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),ie=n=>n.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class fe extends S{getCookies(){return o(this,null,function*(){const e=document.cookie,t={};return e.split(";").forEach(r=>{if(r.length<=0)return;let[a,s]=r.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");a=ie(a).trim(),s=ie(s).trim(),t[a]=s}),t})}setCookie(e){return o(this,null,function*(){try{const t=se(e.key),r=se(e.value),a=`; expires=${(e.expires||"").replace("expires=","")}`,s=(e.path||"/").replace("path=",""),d=e.url!=null&&e.url.length>0?`domain=${e.url}`:"";document.cookie=`${t}=${r||""}${a}; path=${s}; ${d};`}catch(t){return Promise.reject(t)}})}deleteCookie(e){return o(this,null,function*(){try{document.cookie=`${e.key}=; Max-Age=0`}catch(t){return Promise.reject(t)}})}clearCookies(){return o(this,null,function*(){try{const e=document.cookie.split(";")||[];for(const t of e)document.cookie=t.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(e){return Promise.reject(e)}})}clearAllCookies(){return o(this,null,function*(){try{yield this.clearCookies()}catch(e){return Promise.reject(e)}})}}v("CapacitorCookies",{web:()=>new fe});const we=(n,e={})=>{const t=Object.assign({method:n.method||"GET",headers:n.headers},e),r=((a={})=>{const s=Object.keys(a);return Object.keys(a).map(d=>d.toLocaleLowerCase()).reduce((d,i,_)=>(d[i]=a[s[_]],d),{})})(n.headers)["content-type"]||"";if(typeof n.data=="string")t.body=n.data;else if(r.includes("application/x-www-form-urlencoded")){const a=new URLSearchParams;for(const[s,d]of Object.entries(n.data||{}))a.set(s,d);t.body=a.toString()}else if(r.includes("multipart/form-data")){const a=new FormData;if(n.data instanceof FormData)n.data.forEach((d,i)=>{a.append(i,d)});else for(const d of Object.keys(n.data))a.append(d,n.data[d]);t.body=a;const s=new Headers(t.headers);s.delete("content-type"),t.headers=s}else(r.includes("application/json")||typeof n.data=="object")&&(t.body=JSON.stringify(n.data));return t};class he extends S{request(e){return o(this,null,function*(){const t=we(e,e.webFetchExtra),r=((b,T=!0)=>b?Object.entries(b).reduce((H,P)=>{const[k,l]=P;let c,m;return Array.isArray(l)?(m="",l.forEach(L=>{c=T?encodeURIComponent(L):L,m+=`${k}=${c}&`}),m.slice(0,-1)):(c=T?encodeURIComponent(l):l,m=`${k}=${c}`),`${H}&${m}`},"").substr(1):null)(e.params,e.shouldEncodeUrlParams),a=r?`${e.url}?${r}`:e.url,s=yield fetch(a,t),d=s.headers.get("content-type")||"";let i,_,{responseType:p="text"}=s.ok?e:{};switch(d.includes("application/json")&&(p="json"),p){case"arraybuffer":case"blob":_=yield s.blob(),i=yield(b=>o(this,null,function*(){return new Promise((T,H)=>{const P=new FileReader;P.onload=()=>{const k=P.result;T(k.indexOf(",")>=0?k.split(",")[1]:k)},P.onerror=k=>H(k),P.readAsDataURL(b)})}))(_);break;case"json":i=yield s.json();break;default:i=yield s.text()}const y={};return s.headers.forEach((b,T)=>{y[T]=b}),{data:i,headers:y,status:s.status,url:s.url}})}get(e){return o(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"GET"}))})}post(e){return o(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"POST"}))})}put(e){return o(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"PUT"}))})}patch(e){return o(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"PATCH"}))})}delete(e){return o(this,null,function*(){return this.request(Object.assign(Object.assign({},e),{method:"DELETE"}))})}}function Q(){return u.getPlatform()==="android"?JSON.parse(AndroidInitialContext.initialContext()):window.portalInitialContext}v("CapacitorHttp",{web:()=>new he}),v("Portals",{web:()=>Promise.resolve().then(function(){return ge}).then(n=>new n.PortalsWeb)});const ge=Object.freeze({__proto__:null,PortalsWeb:class extends S{publishNative(n){return o(this,null,function*(){})}}});var D=(n=>(n.DEV="dev",n.SIT="sit",n.UAT="uat",n.PROD="prod",n.TEST="test",n))(D||{}),R=(n=>(n.EU="eu",n.ASIA="asia",n))(R||{});const X=n=>{var e,t,r;if(typeof window!="undefined"&&Q&&((e=Q())!=null&&e.value)){const a=(r=(t=Q())==null?void 0:t.value)!=null?r:null;if(!a)return void console.error("native initialContext is undefine");if(!n)return void console.error("initialContext call back is undefine");n(a)}},ve=n=>new Promise(e=>o(this,null,function*(){let t=null;t=n!=null&&n.mockData?n.mockData:((r,{asiaUatData:a,euSitData:s,euUatData:d})=>{var y,b;const i=(y=r.mockServerInfo)==null?void 0:y.env,_=(b=r.mockServerInfo)==null?void 0:b.area;let p=null;return i&&_&&(R.ASIA===_?D.UAT===i&&(p=a):R.EU===_&&(D.SIT===i?p=s:D.UAT===i&&(p=d))),p})(n,{asiaUatData:yield Promise.resolve().then(()=>Le),euSitData:yield Promise.resolve().then(()=>Ae),euUatData:yield Promise.resolve().then(()=>Ce)}),e(t?t!=null&&t.default?t==null?void 0:t.default:t:null)})),q=class q{isNativeHandle(){return o(this,null,function*(){return yield(()=>{let e=!1;return X(t=>{e=!!(t!=null&&t.isNative)}),e})()})}specifiedPageHandle(e){return o(this,null,function*(){yield(({cb:t})=>{X(r=>{var i;if(!(r!=null&&r.params))return void console.error("native params is undefine");const a=(i=JSON.parse(r.params))!=null?i:null;if(!a)return;const{params:s,routeName:d}=a;s&&d&&(t?t(a):console.error("call back is undefine"))})})(e)})}nativeAppInfoHandle(e){return o(this,null,function*(){const t=e!=null&&e.mockServerInfo||e!=null&&e.mockData?e:q.defaultNativeAppInfoConfig;return(yield this.isNativeHandle())?yield(()=>{let r=null;return X(a=>{r=a!=null?a:null}),r})():yield ve(t)})}};oe(q,"defaultNativeAppInfoConfig",{mockServerInfo:{area:R.ASIA,env:D.UAT}});let Y=q;const Z=()=>{let n=null;return n=typeof window=="undefined"?{}:window,n},K="CommunicatePlugin",h=u.registerPlugin(K,{web:()=>Promise.resolve().then(()=>Ee).then(n=>new n.PluginsWeb)}),C=Z();C.addListenerBackHandle=()=>null;const be=n=>{C!=null&&C.addListenerBackHandle&&C.addListenerBackHandle(),setTimeout(()=>{(e=>o(this,null,function*(){C!=null&&C.addListenerBackHandle&&e&&(C.addListenerBackHandle=yield(t=>o(this,null,function*(){if(u.addListener){const r=yield u.addListener(K,"nativeSendBack",a=>t&&t(a));return r!=null&&r.remove?r.remove:()=>null}}))(e))}))(n)})};let de;const ee=n=>{de=e=>{n&&n(e)}},V=Z();V.addListenerHomeHandle=()=>null;const _e=n=>{V.addListenerHomeHandle&&V.addListenerHomeHandle(),setTimeout(()=>{(e=>o(this,null,function*(){e&&(V.addListenerHomeHandle=yield(t=>o(this,null,function*(){if(u.addListener){const r=yield u.addListener(K,"nativeSendHome",a=>t&&t(a));return r!=null&&r.remove?r.remove:()=>null}}))(e))}))(n)})},W=Z();W.removeAddListenerFab=()=>null;const ye=n=>{var t,r;W.removeAddListenerFab&&W.removeAddListenerFab();const e=[];(t=h.showFABMenu)==null||t.call(h,{fabMenu:e}),n&&((r=Object.keys(n))!=null&&r.length)&&(Object.keys(n).forEach(a=>{e.push({icon:n[a].icon,id:n[a].id,name:n[a].title})}),queueMicrotask(()=>{var a;(a=h.showFABMenu)==null||a.call(h,{fabMenu:e})}),setTimeout(()=>{(a=>o(this,null,function*(){a&&(W.removeAddListenerFab=yield(s=>o(this,null,function*(){if(u.addListener){const d=yield u.addListener(K,"nativeSendFab",i=>s&&s(i));return d!=null&&d.remove?d.remove:()=>null}}))(a))}))(a=>{let s;a&&a.id&&Object.keys(n).forEach(d=>{a.id===n[d].id&&(s=n[d].fn)}),s&&s()})}))};class Pe{constructor(){var e;(e=this.homeIsClick)==null||e.call(this,{isClick:!0})}homeIsClick(e){return o(this,null,function*(){var t;return yield(t=h.homeIsClick)==null?void 0:t.call(h,e)})}openMinApp(e){return o(this,null,function*(){return yield h.openMinApp(e)})}showTitle(e){return o(this,null,function*(){return yield h.showTitle(e)})}showSubMask(e){return o(this,null,function*(){return yield h.showSubMask(e)})}backBtnApiHook(e){return t=e,{initBackBtnHandle:r=>{r&&r.afterEach(a=>{be(()=>{a!=null&&a.name&&de(a.name)})})},registerBackBtnHandle:r=>{const{onMounted:a,onUnmounted:s}=r;a(()=>{ee(d=>{t!=null&&t.backBtnCb&&t.backBtnCb(d)})}),s(()=>{ee&&ee(()=>"")})}};var t}homeBtnHandle(e){_e(e)}fabBtnHandle(e){ye(e)}showDialog(){return o(this,null,function*(){return yield h.showDialog()})}cancelDialog(){return o(this,null,function*(){return yield h.cancelDialog()})}}class le extends Y{constructor(){super(...arguments);oe(this,"communicatePlugins",new Pe)}openMinAppHandle(t){return o(this,null,function*(){return yield this.communicatePlugins.openMinApp(t)})}showTitleHandle(t){return o(this,null,function*(){return yield this.communicatePlugins.showTitle(t)})}showSubMaskHandle(t){return o(this,null,function*(){return yield this.communicatePlugins.showSubMask(t)})}backBtnApiHook(t){return this.communicatePlugins.backBtnApiHook(t)}homeBtnHandle(t){this.communicatePlugins.homeBtnHandle(t)}fabBtnHandle(t){this.communicatePlugins.fabBtnHandle(t)}showDialogHandle(){return o(this,null,function*(){return yield this.communicatePlugins.showDialog()})}cancelDialogHandle(){return o(this,null,function*(){return yield this.communicatePlugins.cancelDialog()})}}const ke=new le,Le=Object.freeze(Object.defineProperty({__proto__:null,default:{data_info:{bu:{default_tenant_code:"WTCHK",tenants:[{store_detail_list:[{name:"APELDOORN HOOFDSTRAAT 136",code:"3462"}],name:"WTCHK",stores:["3462"],timezone:"Europe/Amsterdam",code:"WTCHK"}]},menus:[{code:"osp-superapp-inventory",id:"6113847737833037825",name:"Inventory",parent_id:"0"},{code:"osp-superapp-event-count",id:"6113867563402076161",name:"Event Count",parent_id:"6113847737833037825"},{code:"osp-superapp-shelf-fulfillment",id:"6113867975718936577",name:"Shelf Fulfillment",parent_id:"6113847737833037825"},{code:"osp-superapp-reports",id:"6113868456755273729",name:"Reports",parent_id:"0"},{code:"osp-superapp-user-management",id:"6113868869072134145",name:"User Management",parent_id:"0"},{code:"osp-superapp-online-orders",id:"6318558832782852097",name:"Online Orders",parent_id:"0"},{code:"osp-superapp-pick-pack-orders",id:"6318559348178927617",name:"Pick & Pack Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders",id:"6318559863575003137",name:"Collect Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders@unpack_orders/home",id:"6318560756928200705",name:"Unpack Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders@orders_collect/search",id:"6318561856439828481",name:"Search Orders",parent_id:"6318558832782852097"}],serverInfo:{serverArea:"asia",serverEnv:"uat"},token:{access_token:"2c0d362e-5835-4bac-b168-a00ac9856998",expires_in:86399,refresh_token:"992e3a36-fd27-4074-af15-f09a4a939b67",scope:"read write",token_type:"bearer"},user:{create_time:"2023-08-22 11: 08: 21",email:"ospsuperapp2@163.com",gender:"",id:"6113892817809776640",introduction:"",language:"en",last_modify_time:"2023-08-24 10: 53: 32",password_strength_name:"MIDDLE",password_validity_period:"PERMANENT",password_validity_period_time:"2856-12-22 11: 08: 21",phone:"",real_name:"ospsuperapp2",special:"false",status:"NORMAL",tenant_id:"0",time_zone:"Europe/Amsterdam",type:"STAFF",user_name:"ospsuperapp2",errorCode:0,errorMessage:"",requseCodeTag:4,success:!1}},data_store:{name:"APELDOORN HOOFDSTRAAT 3462",code:"3462"},data_language:{code:"en",id:"en_US",name:"English"}}},Symbol.toStringTag,{value:"Module"})),Ae=Object.freeze(Object.defineProperty({__proto__:null,default:{data_info:{bu:{default_tenant_code:"KVN",tenants:[{code:"KVN",name:"KVN",store_detail_list:[{buCode:"KVN",code:"9998",name:"KVNL 9998"}],stores:["9998"],timezone:"Europe/Amsterdam"}],errorCode:0,errorMessage:"",requseCodeTag:6,success:!1},menus:[{code:"osp-superapp-inventory",id:"6113847737833037825",name:"Inventory",parent_id:"0"},{code:"osp-superapp-event-count",id:"6113867563402076161",name:"Event Count",parent_id:"6113847737833037825"},{code:"osp-superapp-shelf-fulfillment",id:"6113867975718936577",name:"Shelf Fulfillment",parent_id:"6113847737833037825"},{code:"osp-superapp-reports",id:"6113868456755273729",name:"Reports",parent_id:"0"},{code:"osp-superapp-user-management",id:"6113868869072134145",name:"User Management",parent_id:"0"},{code:"osp-superapp-online-orders",id:"6318558832782852097",name:"Online Orders",parent_id:"0"},{code:"osp-superapp-pick-pack-orders",id:"6318559348178927617",name:"Pick & Pack Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders",id:"6318559863575003137",name:"Collect Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders@unpack_orders/home",id:"6318560756928200705",name:"Unpack Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders@orders_collect/search",id:"6318561856439828481",name:"Search Orders",parent_id:"6318558832782852097"}],serverInfo:{serverArea:"eu",serverEnv:"sit"},token:{access_token:"2c0d362e-5835-4bac-b168-a00ac9856998",expires_in:86399,refresh_token:"992e3a36-fd27-4074-af15-f09a4a939b67",scope:"read write",token_type:"bearer"},user:{create_time:"2023-08-22 11: 08: 21",email:"ospsuperapp2@163.com",gender:"",id:"6113892817809776640",introduction:"",language:"en",last_modify_time:"2023-08-24 10: 53: 32",password_strength_name:"MIDDLE",password_validity_period:"PERMANENT",password_validity_period_time:"2856-12-22 11: 08: 21",phone:"",real_name:"ospsuperapp2",special:"false",status:"NORMAL",tenant_id:"0",time_zone:"Europe/Amsterdam",type:"STAFF",user_name:"ospsuperapp2",errorCode:0,errorMessage:"",requseCodeTag:4,success:!1}},data_store:{buCode:"KVN",code:"9998",name:"KVNL 9998"},data_language:{code:"en",id:"en_US",name:"English"}}},Symbol.toStringTag,{value:"Module"})),Ce=Object.freeze(Object.defineProperty({__proto__:null,default:{data_info:{bu:{default_tenant_code:"KVN",tenants:[{code:"KVN",name:"KVN",store_detail_list:[{buCode:"KVN",code:"9998",name:"KVNL 9998"}],stores:["9998"],timezone:"Europe/Amsterdam"}],errorCode:0,errorMessage:"",requseCodeTag:6,success:!1},menus:[{code:"osp-superapp-inventory",id:"6113847737833037825",name:"Inventory",parent_id:"0"},{code:"osp-superapp-event-count",id:"6113867563402076161",name:"Event Count",parent_id:"6113847737833037825"},{code:"osp-superapp-shelf-fulfillment",id:"6113867975718936577",name:"Shelf Fulfillment",parent_id:"6113847737833037825"},{code:"osp-superapp-reports",id:"6113868456755273729",name:"Reports",parent_id:"0"},{code:"osp-superapp-user-management",id:"6113868869072134145",name:"User Management",parent_id:"0"},{code:"osp-superapp-online-orders",id:"6318558832782852097",name:"Online Orders",parent_id:"0"},{code:"osp-superapp-pick-pack-orders",id:"6318559348178927617",name:"Pick & Pack Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders",id:"6318559863575003137",name:"Collect Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders@unpack_orders/home",id:"6318560756928200705",name:"Unpack Orders",parent_id:"6318558832782852097"},{code:"osp-superapp-collect-orders@orders_collect/search",id:"6318561856439828481",name:"Search Orders",parent_id:"6318558832782852097"}],serverInfo:{serverArea:"eu",serverEnv:"sit"},token:{access_token:"2c0d362e-5835-4bac-b168-a00ac9856998",expires_in:86399,refresh_token:"992e3a36-fd27-4074-af15-f09a4a939b67",scope:"read write",token_type:"bearer"},user:{create_time:"2023-08-22 11: 08: 21",email:"ospsuperapp2@163.com",gender:"",id:"6113892817809776640",introduction:"",language:"en",last_modify_time:"2023-08-24 10: 53: 32",password_strength_name:"MIDDLE",password_validity_period:"PERMANENT",password_validity_period_time:"2856-12-22 11: 08: 21",phone:"",real_name:"ospsuperapp2",special:"false",status:"NORMAL",tenant_id:"0",time_zone:"Europe/Amsterdam",type:"STAFF",user_name:"ospsuperapp2",errorCode:0,errorMessage:"",requseCodeTag:4,success:!1}},data_store:{buCode:"KVN",code:"9998",name:"KVNL 9998"},data_language:{code:"en",id:"en_US",name:"English"}}},Symbol.toStringTag,{value:"Module"})),Ee=Object.freeze(Object.defineProperty({__proto__:null,PluginsWeb:class extends S{homeIsClick(){return o(this,null,function*(){})}openMinApp(n){return o(this,null,function*(){return new Promise(e=>{e(n)})})}showTitle(n){return o(this,null,function*(){return new Promise(e=>{e(n)})})}showFABMenu(n){return o(this,null,function*(){return new Promise(e=>{e(n)})})}showSubMask(n){return o(this,null,function*(){return new Promise(e=>{e(n)})})}showDialog(){return o(this,null,function*(){})}cancelDialog(){return o(this,null,function*(){})}}},Symbol.toStringTag,{value:"Module"}));w.NativeApi=le,w.default=ke,Object.defineProperties(w,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|