gws-client 1.1.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,91 +1,99 @@
1
- var Ee = Object.defineProperty, Pe = Object.defineProperties;
2
- var $e = Object.getOwnPropertyDescriptors;
3
- var se = Object.getOwnPropertySymbols;
4
- var _e = Object.prototype.hasOwnProperty, Le = Object.prototype.propertyIsEnumerable;
5
- var Y = (s, e, t) => e in s ? Ee(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, p = (s, e) => {
1
+ var be = Object.defineProperty, xe = Object.defineProperties;
2
+ var Ne = Object.getOwnPropertyDescriptors;
3
+ var re = Object.getOwnPropertySymbols;
4
+ var $e = Object.prototype.hasOwnProperty, Te = Object.prototype.propertyIsEnumerable;
5
+ var Y = (s, e, t) => e in s ? be(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, m = (s, e) => {
6
6
  for (var t in e || (e = {}))
7
- _e.call(e, t) && Y(s, t, e[t]);
8
- if (se)
9
- for (var t of se(e))
10
- Le.call(e, t) && Y(s, t, e[t]);
7
+ $e.call(e, t) && Y(s, t, e[t]);
8
+ if (re)
9
+ for (var t of re(e))
10
+ Te.call(e, t) && Y(s, t, e[t]);
11
11
  return s;
12
- }, B = (s, e) => Pe(s, $e(e));
13
- var o = (s, e, t) => Y(s, typeof e != "symbol" ? e + "" : e, t);
14
- var l = (s, e, t) => new Promise((n, r) => {
15
- var a = (u) => {
12
+ }, _ = (s, e) => xe(s, Ne(e));
13
+ var a = (s, e, t) => Y(s, typeof e != "symbol" ? e + "" : e, t);
14
+ var c = (s, e, t) => new Promise((n, i) => {
15
+ var r = (d) => {
16
16
  try {
17
- c(t.next(u));
18
- } catch (d) {
19
- r(d);
17
+ l(t.next(d));
18
+ } catch (u) {
19
+ i(u);
20
20
  }
21
- }, i = (u) => {
21
+ }, o = (d) => {
22
22
  try {
23
- c(t.throw(u));
24
- } catch (d) {
25
- r(d);
23
+ l(t.throw(d));
24
+ } catch (u) {
25
+ i(u);
26
26
  }
27
- }, c = (u) => u.done ? n(u.value) : Promise.resolve(u.value).then(a, i);
28
- c((t = t.apply(s, e)).next());
27
+ }, l = (d) => d.done ? n(d.value) : Promise.resolve(d.value).then(r, o);
28
+ l((t = t.apply(s, e)).next());
29
29
  });
30
- const Me = window.location.href.includes("https") ? "wss://localhost:19528" : "ws://localhost:9527", re = "1", ae = "2";
31
- var we = /* @__PURE__ */ ((s) => (s.MIN = "0", s.LOW = "1", s.MIDDLE = "2", s.HIGH = "3", s))(we || {});
32
- const Ne = "00000001";
33
- function Te(s) {
30
+ const Me = window.location.href.includes("https") ? "wss://localhost:19528" : "ws://localhost:9527", ae = "1", oe = "2";
31
+ var Se = /* @__PURE__ */ ((s) => (s.MIN = "0", s.LOW = "1", s.MIDDLE = "2", s.HIGH = "3", s))(Se || {});
32
+ const I = {
33
+ LEVEL_1: 1,
34
+ LEVEL_2: 2,
35
+ LEVEL_3: 4
36
+ }, Fe = {
37
+ OPEN: I.LEVEL_1,
38
+ INTERNAL: I.LEVEL_2 | I.LEVEL_1,
39
+ OMP: I.LEVEL_3 | I.LEVEL_2 | I.LEVEL_1
40
+ }, Ge = "00000001", q = "NO_SEAL_AVAILABLE", Oe = "CERTIFICATE_NOT_FOUND", Ve = "CLIENT_CONNECTION_FAILED", Ze = "ACCESS_DENIED";
41
+ function He(s) {
34
42
  return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
35
43
  }
36
- var T = {}, ie;
37
- function Ge() {
38
- if (ie) return T;
39
- ie = 1, T.byteLength = c, T.toByteArray = d, T.fromByteArray = m;
40
- for (var s = [], e = [], t = typeof Uint8Array != "undefined" ? Uint8Array : Array, n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", r = 0, a = n.length; r < a; ++r)
41
- s[r] = n[r], e[n.charCodeAt(r)] = r;
44
+ var F = {}, ce;
45
+ function Ue() {
46
+ if (ce) return F;
47
+ ce = 1, F.byteLength = l, F.toByteArray = u, F.fromByteArray = w;
48
+ for (var s = [], e = [], t = typeof Uint8Array != "undefined" ? Uint8Array : Array, n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", i = 0, r = n.length; i < r; ++i)
49
+ s[i] = n[i], e[n.charCodeAt(i)] = i;
42
50
  e[45] = 62, e[95] = 63;
43
- function i(h) {
44
- var y = h.length;
45
- if (y % 4 > 0)
51
+ function o(h) {
52
+ var f = h.length;
53
+ if (f % 4 > 0)
46
54
  throw new Error("Invalid string. Length must be a multiple of 4");
47
- var w = h.indexOf("=");
48
- w === -1 && (w = y);
49
- var g = w === y ? 0 : 4 - w % 4;
50
- return [w, g];
55
+ var E = h.indexOf("=");
56
+ E === -1 && (E = f);
57
+ var y = E === f ? 0 : 4 - E % 4;
58
+ return [E, y];
51
59
  }
52
- function c(h) {
53
- var y = i(h), w = y[0], g = y[1];
54
- return (w + g) * 3 / 4 - g;
60
+ function l(h) {
61
+ var f = o(h), E = f[0], y = f[1];
62
+ return (E + y) * 3 / 4 - y;
55
63
  }
56
- function u(h, y, w) {
57
- return (y + w) * 3 / 4 - w;
64
+ function d(h, f, E) {
65
+ return (f + E) * 3 / 4 - E;
58
66
  }
59
- function d(h) {
60
- var y, w = i(h), g = w[0], S = w[1], v = new t(u(h, g, S)), I = 0, A = S > 0 ? g - 4 : g, k;
61
- for (k = 0; k < A; k += 4)
62
- y = e[h.charCodeAt(k)] << 18 | e[h.charCodeAt(k + 1)] << 12 | e[h.charCodeAt(k + 2)] << 6 | e[h.charCodeAt(k + 3)], v[I++] = y >> 16 & 255, v[I++] = y >> 8 & 255, v[I++] = y & 255;
63
- return S === 2 && (y = e[h.charCodeAt(k)] << 2 | e[h.charCodeAt(k + 1)] >> 4, v[I++] = y & 255), S === 1 && (y = e[h.charCodeAt(k)] << 10 | e[h.charCodeAt(k + 1)] << 4 | e[h.charCodeAt(k + 2)] >> 2, v[I++] = y >> 8 & 255, v[I++] = y & 255), v;
67
+ function u(h) {
68
+ var f, E = o(h), y = E[0], S = E[1], k = new t(d(h, y, S)), p = 0, D = S > 0 ? y - 4 : y, v;
69
+ for (v = 0; v < D; v += 4)
70
+ f = e[h.charCodeAt(v)] << 18 | e[h.charCodeAt(v + 1)] << 12 | e[h.charCodeAt(v + 2)] << 6 | e[h.charCodeAt(v + 3)], k[p++] = f >> 16 & 255, k[p++] = f >> 8 & 255, k[p++] = f & 255;
71
+ return S === 2 && (f = e[h.charCodeAt(v)] << 2 | e[h.charCodeAt(v + 1)] >> 4, k[p++] = f & 255), S === 1 && (f = e[h.charCodeAt(v)] << 10 | e[h.charCodeAt(v + 1)] << 4 | e[h.charCodeAt(v + 2)] >> 2, k[p++] = f >> 8 & 255, k[p++] = f & 255), k;
64
72
  }
65
73
  function C(h) {
66
74
  return s[h >> 18 & 63] + s[h >> 12 & 63] + s[h >> 6 & 63] + s[h & 63];
67
75
  }
68
- function f(h, y, w) {
69
- for (var g, S = [], v = y; v < w; v += 3)
70
- g = (h[v] << 16 & 16711680) + (h[v + 1] << 8 & 65280) + (h[v + 2] & 255), S.push(C(g));
76
+ function g(h, f, E) {
77
+ for (var y, S = [], k = f; k < E; k += 3)
78
+ y = (h[k] << 16 & 16711680) + (h[k + 1] << 8 & 65280) + (h[k + 2] & 255), S.push(C(y));
71
79
  return S.join("");
72
80
  }
73
- function m(h) {
74
- for (var y, w = h.length, g = w % 3, S = [], v = 16383, I = 0, A = w - g; I < A; I += v)
75
- S.push(f(h, I, I + v > A ? A : I + v));
76
- return g === 1 ? (y = h[w - 1], S.push(
77
- s[y >> 2] + s[y << 4 & 63] + "=="
78
- )) : g === 2 && (y = (h[w - 2] << 8) + h[w - 1], S.push(
79
- s[y >> 10] + s[y >> 4 & 63] + s[y << 2 & 63] + "="
81
+ function w(h) {
82
+ for (var f, E = h.length, y = E % 3, S = [], k = 16383, p = 0, D = E - y; p < D; p += k)
83
+ S.push(g(h, p, p + k > D ? D : p + k));
84
+ return y === 1 ? (f = h[E - 1], S.push(
85
+ s[f >> 2] + s[f << 4 & 63] + "=="
86
+ )) : y === 2 && (f = (h[E - 2] << 8) + h[E - 1], S.push(
87
+ s[f >> 10] + s[f >> 4 & 63] + s[f << 2 & 63] + "="
80
88
  )), S.join("");
81
89
  }
82
- return T;
90
+ return F;
83
91
  }
84
- var Fe = Ge();
85
- const oe = /* @__PURE__ */ Te(Fe);
86
- class He {
92
+ var je = Ue();
93
+ const le = /* @__PURE__ */ He(je);
94
+ class Ke {
87
95
  constructor() {
88
- o(this, "deps", /* @__PURE__ */ new Map());
96
+ a(this, "deps", /* @__PURE__ */ new Map());
89
97
  }
90
98
  on(e, t) {
91
99
  this.deps.set(e, t);
@@ -103,65 +111,65 @@ class He {
103
111
  console.error("vite-plugin-css-injected-by-js", e);
104
112
  }
105
113
  })();
106
- var Ze = Object.defineProperty, Oe = (s, e, t) => e in s ? Ze(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, ce = (s, e, t) => Oe(s, typeof e != "symbol" ? e + "" : e, t);
107
- function Q() {
114
+ var ze = Object.defineProperty, Qe = (s, e, t) => e in s ? ze(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, ue = (s, e, t) => Qe(s, typeof e != "symbol" ? e + "" : e, t);
115
+ function ee() {
108
116
  }
109
- function Ve(s, e) {
117
+ function We(s, e) {
110
118
  for (const t in e) s[t] = e[t];
111
119
  return (
112
120
  /** @type {T & S} */
113
121
  s
114
122
  );
115
123
  }
116
- function pe(s) {
124
+ function ve(s) {
117
125
  return s();
118
126
  }
119
- function le() {
127
+ function de() {
120
128
  return /* @__PURE__ */ Object.create(null);
121
129
  }
122
- function O(s) {
123
- s.forEach(pe);
130
+ function U(s) {
131
+ s.forEach(ve);
124
132
  }
125
- function F(s) {
133
+ function V(s) {
126
134
  return typeof s == "function";
127
135
  }
128
- function Se(s, e) {
136
+ function ke(s, e) {
129
137
  return s != s ? e == e : s !== e || s && typeof s == "object" || typeof s == "function";
130
138
  }
131
- function je(s) {
139
+ function Je(s) {
132
140
  return Object.keys(s).length === 0;
133
141
  }
134
- function Ue(s, e, t, n) {
142
+ function Re(s, e, t, n) {
135
143
  if (s) {
136
- const r = ke(s, e, t, n);
137
- return s[0](r);
144
+ const i = Ie(s, e, t, n);
145
+ return s[0](i);
138
146
  }
139
147
  }
140
- function ke(s, e, t, n) {
141
- return s[1] && n ? Ve(t.ctx.slice(), s[1](n(e))) : t.ctx;
148
+ function Ie(s, e, t, n) {
149
+ return s[1] && n ? We(t.ctx.slice(), s[1](n(e))) : t.ctx;
142
150
  }
143
- function ze(s, e, t, n) {
151
+ function Ye(s, e, t, n) {
144
152
  if (s[2] && n) {
145
- const r = s[2](n(t));
153
+ const i = s[2](n(t));
146
154
  if (e.dirty === void 0)
155
+ return i;
156
+ if (typeof i == "object") {
157
+ const r = [], o = Math.max(e.dirty.length, i.length);
158
+ for (let l = 0; l < o; l += 1)
159
+ r[l] = e.dirty[l] | i[l];
147
160
  return r;
148
- if (typeof r == "object") {
149
- const a = [], i = Math.max(e.dirty.length, r.length);
150
- for (let c = 0; c < i; c += 1)
151
- a[c] = e.dirty[c] | r[c];
152
- return a;
153
161
  }
154
- return e.dirty | r;
162
+ return e.dirty | i;
155
163
  }
156
164
  return e.dirty;
157
165
  }
158
- function Je(s, e, t, n, r, a) {
159
- if (r) {
160
- const i = ke(e, t, n, a);
161
- s.p(i, r);
166
+ function qe(s, e, t, n, i, r) {
167
+ if (i) {
168
+ const o = Ie(e, t, n, r);
169
+ s.p(o, i);
162
170
  }
163
171
  }
164
- function qe(s) {
172
+ function Xe(s) {
165
173
  if (s.ctx.length > 32) {
166
174
  const e = [], t = s.ctx.length / 32;
167
175
  for (let n = 0; n < t; n++)
@@ -170,180 +178,180 @@ function qe(s) {
170
178
  }
171
179
  return -1;
172
180
  }
173
- function de(s) {
181
+ function he(s) {
174
182
  return s == null ? "" : s;
175
183
  }
176
- function b(s, e) {
184
+ function L(s, e) {
177
185
  s.appendChild(e);
178
186
  }
179
- function K(s, e, t) {
187
+ function R(s, e, t) {
180
188
  s.insertBefore(e, t || null);
181
189
  }
182
- function V(s) {
190
+ function j(s) {
183
191
  s.parentNode && s.parentNode.removeChild(s);
184
192
  }
185
- function ve(s, e) {
193
+ function pe(s, e) {
186
194
  for (let t = 0; t < s.length; t += 1)
187
195
  s[t] && s[t].d(e);
188
196
  }
189
- function E(s) {
197
+ function P(s) {
190
198
  return document.createElement(s);
191
199
  }
192
- function M(s) {
200
+ function T(s) {
193
201
  return document.createTextNode(s);
194
202
  }
195
- function j() {
196
- return M(" ");
203
+ function K() {
204
+ return T(" ");
197
205
  }
198
- function We() {
199
- return M("");
206
+ function et() {
207
+ return T("");
200
208
  }
201
209
  function G(s, e, t, n) {
202
210
  return s.addEventListener(e, t, n), () => s.removeEventListener(e, t, n);
203
211
  }
204
- function x(s, e, t) {
212
+ function B(s, e, t) {
205
213
  t == null ? s.removeAttribute(e) : s.getAttribute(e) !== t && s.setAttribute(e, t);
206
214
  }
207
- function Ke(s) {
215
+ function tt(s) {
208
216
  return Array.from(s.childNodes);
209
217
  }
210
- function U(s, e) {
218
+ function z(s, e) {
211
219
  e = "" + e, s.data !== e && (s.data = /** @type {string} */
212
220
  e);
213
221
  }
214
- function q(s, e, t, n) {
222
+ function W(s, e, t, n) {
215
223
  t == null ? s.style.removeProperty(e) : s.style.setProperty(e, t, "");
216
224
  }
217
- let te;
218
- function H(s) {
219
- te = s;
225
+ let se;
226
+ function Z(s) {
227
+ se = s;
220
228
  }
221
- const _ = [], ue = [];
222
- let N = [];
223
- const he = [], Ye = /* @__PURE__ */ Promise.resolve();
224
- let X = !1;
225
- function Re() {
226
- X || (X = !0, Ye.then(Ie));
229
+ const N = [], ge = [];
230
+ let M = [];
231
+ const ye = [], nt = /* @__PURE__ */ Promise.resolve();
232
+ let te = !1;
233
+ function st() {
234
+ te || (te = !0, nt.then(_e));
227
235
  }
228
- function ee(s) {
229
- N.push(s);
236
+ function ne(s) {
237
+ M.push(s);
230
238
  }
231
- const R = /* @__PURE__ */ new Set();
232
- let $ = 0;
233
- function Ie() {
234
- if ($ !== 0)
239
+ const X = /* @__PURE__ */ new Set();
240
+ let x = 0;
241
+ function _e() {
242
+ if (x !== 0)
235
243
  return;
236
- const s = te;
244
+ const s = se;
237
245
  do {
238
246
  try {
239
- for (; $ < _.length; ) {
240
- const e = _[$];
241
- $++, H(e), Qe(e.$$);
247
+ for (; x < N.length; ) {
248
+ const e = N[x];
249
+ x++, Z(e), it(e.$$);
242
250
  }
243
251
  } catch (e) {
244
- throw _.length = 0, $ = 0, e;
252
+ throw N.length = 0, x = 0, e;
245
253
  }
246
- for (H(null), _.length = 0, $ = 0; ue.length; ) ue.pop()();
247
- for (let e = 0; e < N.length; e += 1) {
248
- const t = N[e];
249
- R.has(t) || (R.add(t), t());
254
+ for (Z(null), N.length = 0, x = 0; ge.length; ) ge.pop()();
255
+ for (let e = 0; e < M.length; e += 1) {
256
+ const t = M[e];
257
+ X.has(t) || (X.add(t), t());
250
258
  }
251
- N.length = 0;
252
- } while (_.length);
253
- for (; he.length; )
254
- he.pop()();
255
- X = !1, R.clear(), H(s);
259
+ M.length = 0;
260
+ } while (N.length);
261
+ for (; ye.length; )
262
+ ye.pop()();
263
+ te = !1, X.clear(), Z(s);
256
264
  }
257
- function Qe(s) {
265
+ function it(s) {
258
266
  if (s.fragment !== null) {
259
- s.update(), O(s.before_update);
267
+ s.update(), U(s.before_update);
260
268
  const e = s.dirty;
261
- s.dirty = [-1], s.fragment && s.fragment.p(s.ctx, e), s.after_update.forEach(ee);
269
+ s.dirty = [-1], s.fragment && s.fragment.p(s.ctx, e), s.after_update.forEach(ne);
262
270
  }
263
271
  }
264
- function Xe(s) {
272
+ function rt(s) {
265
273
  const e = [], t = [];
266
- N.forEach((n) => s.indexOf(n) === -1 ? e.push(n) : t.push(n)), t.forEach((n) => n()), N = e;
274
+ M.forEach((n) => s.indexOf(n) === -1 ? e.push(n) : t.push(n)), t.forEach((n) => n()), M = e;
267
275
  }
268
- const z = /* @__PURE__ */ new Set();
269
- let et;
270
- function ne(s, e) {
271
- s && s.i && (z.delete(s), s.i(e));
276
+ const Q = /* @__PURE__ */ new Set();
277
+ let at;
278
+ function ie(s, e) {
279
+ s && s.i && (Q.delete(s), s.i(e));
272
280
  }
273
- function Be(s, e, t, n) {
281
+ function Le(s, e, t, n) {
274
282
  if (s && s.o) {
275
- if (z.has(s)) return;
276
- z.add(s), et.c.push(() => {
277
- z.delete(s);
283
+ if (Q.has(s)) return;
284
+ Q.add(s), at.c.push(() => {
285
+ Q.delete(s);
278
286
  }), s.o(e);
279
287
  }
280
288
  }
281
- function W(s) {
289
+ function J(s) {
282
290
  return (s == null ? void 0 : s.length) !== void 0 ? s : Array.from(s);
283
291
  }
284
- function tt(s) {
292
+ function ot(s) {
285
293
  s && s.c();
286
294
  }
287
- function be(s, e, t) {
288
- const { fragment: n, after_update: r } = s.$$;
289
- n && n.m(e, t), ee(() => {
290
- const a = s.$$.on_mount.map(pe).filter(F);
291
- s.$$.on_destroy ? s.$$.on_destroy.push(...a) : O(a), s.$$.on_mount = [];
292
- }), r.forEach(ee);
295
+ function Ae(s, e, t) {
296
+ const { fragment: n, after_update: i } = s.$$;
297
+ n && n.m(e, t), ne(() => {
298
+ const r = s.$$.on_mount.map(ve).filter(V);
299
+ s.$$.on_destroy ? s.$$.on_destroy.push(...r) : U(r), s.$$.on_mount = [];
300
+ }), i.forEach(ne);
293
301
  }
294
- function De(s, e) {
302
+ function Be(s, e) {
295
303
  const t = s.$$;
296
- t.fragment !== null && (Xe(t.after_update), O(t.on_destroy), t.fragment && t.fragment.d(e), t.on_destroy = t.fragment = null, t.ctx = []);
304
+ t.fragment !== null && (rt(t.after_update), U(t.on_destroy), t.fragment && t.fragment.d(e), t.on_destroy = t.fragment = null, t.ctx = []);
297
305
  }
298
- function nt(s, e) {
299
- s.$$.dirty[0] === -1 && (_.push(s), Re(), s.$$.dirty.fill(0)), s.$$.dirty[e / 31 | 0] |= 1 << e % 31;
306
+ function ct(s, e) {
307
+ s.$$.dirty[0] === -1 && (N.push(s), st(), s.$$.dirty.fill(0)), s.$$.dirty[e / 31 | 0] |= 1 << e % 31;
300
308
  }
301
- function xe(s, e, t, n, r, a, i = null, c = [-1]) {
302
- const u = te;
303
- H(s);
304
- const d = s.$$ = {
309
+ function De(s, e, t, n, i, r, o = null, l = [-1]) {
310
+ const d = se;
311
+ Z(s);
312
+ const u = s.$$ = {
305
313
  fragment: null,
306
314
  ctx: [],
307
315
  // state
308
- props: a,
309
- update: Q,
310
- not_equal: r,
311
- bound: le(),
316
+ props: r,
317
+ update: ee,
318
+ not_equal: i,
319
+ bound: de(),
312
320
  // lifecycle
313
321
  on_mount: [],
314
322
  on_destroy: [],
315
323
  on_disconnect: [],
316
324
  before_update: [],
317
325
  after_update: [],
318
- context: new Map(e.context || (u ? u.$$.context : [])),
326
+ context: new Map(e.context || (d ? d.$$.context : [])),
319
327
  // everything else
320
- callbacks: le(),
321
- dirty: c,
328
+ callbacks: de(),
329
+ dirty: l,
322
330
  skip_bound: !1,
323
- root: e.target || u.$$.root
331
+ root: e.target || d.$$.root
324
332
  };
325
- i && i(d.root);
333
+ o && o(u.root);
326
334
  let C = !1;
327
- if (d.ctx = t ? t(s, e.props || {}, (f, m, ...h) => {
328
- const y = h.length ? h[0] : m;
329
- return d.ctx && r(d.ctx[f], d.ctx[f] = y) && (!d.skip_bound && d.bound[f] && d.bound[f](y), C && nt(s, f)), m;
330
- }) : [], d.update(), C = !0, O(d.before_update), d.fragment = n ? n(d.ctx) : !1, e.target) {
335
+ if (u.ctx = t ? t(s, e.props || {}, (g, w, ...h) => {
336
+ const f = h.length ? h[0] : w;
337
+ return u.ctx && i(u.ctx[g], u.ctx[g] = f) && (!u.skip_bound && u.bound[g] && u.bound[g](f), C && ct(s, g)), w;
338
+ }) : [], u.update(), C = !0, U(u.before_update), u.fragment = n ? n(u.ctx) : !1, e.target) {
331
339
  if (e.hydrate) {
332
- const f = Ke(e.target);
333
- d.fragment && d.fragment.l(f), f.forEach(V);
340
+ const g = tt(e.target);
341
+ u.fragment && u.fragment.l(g), g.forEach(j);
334
342
  } else
335
- d.fragment && d.fragment.c();
336
- e.intro && ne(s.$$.fragment), be(s, e.target, e.anchor), Ie();
343
+ u.fragment && u.fragment.c();
344
+ e.intro && ie(s.$$.fragment), Ae(s, e.target, e.anchor), _e();
337
345
  }
338
- H(u);
346
+ Z(d);
339
347
  }
340
- class Ae {
348
+ class Pe {
341
349
  constructor() {
342
- ce(this, "$$"), ce(this, "$$set");
350
+ ue(this, "$$"), ue(this, "$$set");
343
351
  }
344
352
  /** @returns {void} */
345
353
  $destroy() {
346
- De(this, 1), this.$destroy = Q;
354
+ Be(this, 1), this.$destroy = ee;
347
355
  }
348
356
  /**
349
357
  * @template {Extract<keyof Events, string>} K
@@ -352,12 +360,12 @@ class Ae {
352
360
  * @returns {() => void}
353
361
  */
354
362
  $on(e, t) {
355
- if (!F(t))
356
- return Q;
363
+ if (!V(t))
364
+ return ee;
357
365
  const n = this.$$.callbacks[e] || (this.$$.callbacks[e] = []);
358
366
  return n.push(t), () => {
359
- const r = n.indexOf(t);
360
- r !== -1 && n.splice(r, 1);
367
+ const i = n.indexOf(t);
368
+ i !== -1 && n.splice(i, 1);
361
369
  };
362
370
  }
363
371
  /**
@@ -365,27 +373,27 @@ class Ae {
365
373
  * @returns {void}
366
374
  */
367
375
  $set(e) {
368
- this.$$set && !je(e) && (this.$$.skip_bound = !0, this.$$set(e), this.$$.skip_bound = !1);
376
+ this.$$set && !Je(e) && (this.$$.skip_bound = !0, this.$$set(e), this.$$.skip_bound = !1);
369
377
  }
370
378
  }
371
- const st = "4";
372
- typeof window != "undefined" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(st);
373
- function rt(s) {
374
- let e, t, n, r = (
379
+ const lt = "4";
380
+ typeof window != "undefined" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(lt);
381
+ function ut(s) {
382
+ let e, t, n, i = (
375
383
  /*title*/
376
384
  (s[1] || "标题") + ""
377
- ), a, i, c, u, d, C, f = (
385
+ ), r, o, l, d, u, C, g = (
378
386
  /*cancelText*/
379
387
  (s[4] || "取消") + ""
380
- ), m, h, y, w = (
388
+ ), w, h, f, E = (
381
389
  /*okText*/
382
390
  (s[5] || "确认") + ""
383
- ), g, S, v, I;
384
- const A = (
391
+ ), y, S, k, p;
392
+ const D = (
385
393
  /*#slots*/
386
394
  s[8].default
387
- ), k = Ue(
388
- A,
395
+ ), v = Re(
396
+ D,
389
397
  s,
390
398
  /*$$scope*/
391
399
  s[7],
@@ -393,90 +401,90 @@ function rt(s) {
393
401
  );
394
402
  return {
395
403
  c() {
396
- e = E("div"), t = E("div"), n = E("div"), a = M(r), i = j(), c = E("div"), k && k.c(), u = j(), d = E("div"), C = E("button"), m = M(f), h = j(), y = E("button"), g = M(w), x(n, "class", "model-title svelte-16iv9d0"), x(c, "class", "slot svelte-16iv9d0"), x(C, "class", "modal-btn svelte-16iv9d0"), x(y, "class", "modal-btn success svelte-16iv9d0"), q(
397
- y,
404
+ e = P("div"), t = P("div"), n = P("div"), r = T(i), o = K(), l = P("div"), v && v.c(), d = K(), u = P("div"), C = P("button"), w = T(g), h = K(), f = P("button"), y = T(E), B(n, "class", "model-title svelte-16iv9d0"), B(l, "class", "slot svelte-16iv9d0"), B(C, "class", "modal-btn svelte-16iv9d0"), B(f, "class", "modal-btn success svelte-16iv9d0"), W(
405
+ f,
398
406
  "background-color",
399
407
  /*theme*/
400
408
  s[6]
401
- ), x(d, "class", "modal-footer svelte-16iv9d0"), x(t, "class", "modal-content svelte-16iv9d0"), x(e, "class", "modal-background modal-visible svelte-16iv9d0");
409
+ ), B(u, "class", "modal-footer svelte-16iv9d0"), B(t, "class", "modal-content svelte-16iv9d0"), B(e, "class", "modal-background modal-visible svelte-16iv9d0");
402
410
  },
403
- m(D, P) {
404
- K(D, e, P), b(e, t), b(t, n), b(n, a), b(t, i), b(t, c), k && k.m(c, null), b(t, u), b(t, d), b(d, C), b(C, m), b(d, h), b(d, y), b(y, g), S = !0, v || (I = [
411
+ m(A, b) {
412
+ R(A, e, b), L(e, t), L(t, n), L(n, r), L(t, o), L(t, l), v && v.m(l, null), L(t, d), L(t, u), L(u, C), L(C, w), L(u, h), L(u, f), L(f, y), S = !0, k || (p = [
405
413
  G(C, "click", function() {
406
- F(
414
+ V(
407
415
  /*onCancel*/
408
416
  s[0]
409
417
  ) && s[0].apply(this, arguments);
410
418
  }),
411
- G(y, "click", function() {
412
- F(
419
+ G(f, "click", function() {
420
+ V(
413
421
  /*onOk*/
414
422
  s[2]
415
423
  ) && s[2].apply(this, arguments);
416
424
  }),
417
- G(t, "click", at),
425
+ G(t, "click", dt),
418
426
  G(e, "click", function() {
419
- F(
427
+ V(
420
428
  /*onClose*/
421
429
  s[3]
422
430
  ) && s[3].apply(this, arguments);
423
431
  })
424
- ], v = !0);
432
+ ], k = !0);
425
433
  },
426
- p(D, [P]) {
427
- s = D, (!S || P & /*title*/
428
- 2) && r !== (r = /*title*/
429
- (s[1] || "标题") + "") && U(a, r), k && k.p && (!S || P & /*$$scope*/
430
- 128) && Je(
431
- k,
432
- A,
434
+ p(A, [b]) {
435
+ s = A, (!S || b & /*title*/
436
+ 2) && i !== (i = /*title*/
437
+ (s[1] || "标题") + "") && z(r, i), v && v.p && (!S || b & /*$$scope*/
438
+ 128) && qe(
439
+ v,
440
+ D,
433
441
  s,
434
442
  /*$$scope*/
435
443
  s[7],
436
- S ? ze(
437
- A,
444
+ S ? Ye(
445
+ D,
438
446
  /*$$scope*/
439
447
  s[7],
440
- P,
448
+ b,
441
449
  null
442
- ) : qe(
450
+ ) : Xe(
443
451
  /*$$scope*/
444
452
  s[7]
445
453
  ),
446
454
  null
447
- ), (!S || P & /*cancelText*/
448
- 16) && f !== (f = /*cancelText*/
449
- (s[4] || "取消") + "") && U(m, f), (!S || P & /*okText*/
450
- 32) && w !== (w = /*okText*/
451
- (s[5] || "确认") + "") && U(g, w), (!S || P & /*theme*/
452
- 64) && q(
453
- y,
455
+ ), (!S || b & /*cancelText*/
456
+ 16) && g !== (g = /*cancelText*/
457
+ (s[4] || "取消") + "") && z(w, g), (!S || b & /*okText*/
458
+ 32) && E !== (E = /*okText*/
459
+ (s[5] || "确认") + "") && z(y, E), (!S || b & /*theme*/
460
+ 64) && W(
461
+ f,
454
462
  "background-color",
455
463
  /*theme*/
456
464
  s[6]
457
465
  );
458
466
  },
459
- i(D) {
460
- S || (ne(k, D), S = !0);
467
+ i(A) {
468
+ S || (ie(v, A), S = !0);
461
469
  },
462
- o(D) {
463
- Be(k, D), S = !1;
470
+ o(A) {
471
+ Le(v, A), S = !1;
464
472
  },
465
- d(D) {
466
- D && V(e), k && k.d(D), v = !1, O(I);
473
+ d(A) {
474
+ A && j(e), v && v.d(A), k = !1, U(p);
467
475
  }
468
476
  };
469
477
  }
470
- const at = (s) => s.stopPropagation();
471
- function it(s, e, t) {
472
- let { $$slots: n = {}, $$scope: r } = e, { onCancel: a } = e, { title: i } = e, { onOk: c } = e, { onClose: u } = e, { cancelText: d } = e, { okText: C } = e, { theme: f } = e;
473
- return s.$$set = (m) => {
474
- "onCancel" in m && t(0, a = m.onCancel), "title" in m && t(1, i = m.title), "onOk" in m && t(2, c = m.onOk), "onClose" in m && t(3, u = m.onClose), "cancelText" in m && t(4, d = m.cancelText), "okText" in m && t(5, C = m.okText), "theme" in m && t(6, f = m.theme), "$$scope" in m && t(7, r = m.$$scope);
475
- }, [a, i, c, u, d, C, f, r, n];
478
+ const dt = (s) => s.stopPropagation();
479
+ function ht(s, e, t) {
480
+ let { $$slots: n = {}, $$scope: i } = e, { onCancel: r } = e, { title: o } = e, { onOk: l } = e, { onClose: d } = e, { cancelText: u } = e, { okText: C } = e, { theme: g } = e;
481
+ return s.$$set = (w) => {
482
+ "onCancel" in w && t(0, r = w.onCancel), "title" in w && t(1, o = w.title), "onOk" in w && t(2, l = w.onOk), "onClose" in w && t(3, d = w.onClose), "cancelText" in w && t(4, u = w.cancelText), "okText" in w && t(5, C = w.okText), "theme" in w && t(6, g = w.theme), "$$scope" in w && t(7, i = w.$$scope);
483
+ }, [r, o, l, d, u, C, g, i, n];
476
484
  }
477
- class ot extends Ae {
485
+ class gt extends Pe {
478
486
  constructor(e) {
479
- super(), xe(this, e, it, rt, Se, {
487
+ super(), De(this, e, ht, ut, ke, {
480
488
  onCancel: 0,
481
489
  title: 1,
482
490
  onOk: 2,
@@ -487,15 +495,15 @@ class ot extends Ae {
487
495
  });
488
496
  }
489
497
  }
490
- function ge(s, e, t) {
498
+ function fe(s, e, t) {
491
499
  const n = s.slice();
492
500
  return n[13] = e[t], n[15] = t, n;
493
501
  }
494
- function ye(s, e, t) {
502
+ function Ce(s, e, t) {
495
503
  const n = s.slice();
496
504
  return n[16] = e[t], n;
497
505
  }
498
- function fe(s) {
506
+ function we(s) {
499
507
  let e, t = (
500
508
  /*col*/
501
509
  (s[16].format ? (
@@ -514,44 +522,44 @@ function fe(s) {
514
522
  ), n;
515
523
  return {
516
524
  c() {
517
- e = E("div"), n = M(t), x(e, "class", "svelte-1kh75ag"), q(e, "width", `${100 / /*columns*/
525
+ e = P("div"), n = T(t), B(e, "class", "svelte-1kh75ag"), W(e, "width", `${100 / /*columns*/
518
526
  s[1].length}%`);
519
527
  },
520
- m(r, a) {
521
- K(r, e, a), b(e, n);
528
+ m(i, r) {
529
+ R(i, e, r), L(e, n);
522
530
  },
523
- p(r, a) {
524
- a & /*columns, data*/
531
+ p(i, r) {
532
+ r & /*columns, data*/
525
533
  3 && t !== (t = /*col*/
526
- (r[16].format ? (
534
+ (i[16].format ? (
527
535
  /*col*/
528
- r[16].format(
536
+ i[16].format(
529
537
  /*row*/
530
- r[13]
538
+ i[13]
531
539
  )
532
540
  ) : (
533
541
  /*row*/
534
- r[13][
542
+ i[13][
535
543
  /*col*/
536
- r[16].key
544
+ i[16].key
537
545
  ]
538
- )) + "") && U(n, t), a & /*columns*/
539
- 2 && q(e, "width", `${100 / /*columns*/
540
- r[1].length}%`);
546
+ )) + "") && z(n, t), r & /*columns*/
547
+ 2 && W(e, "width", `${100 / /*columns*/
548
+ i[1].length}%`);
541
549
  },
542
- d(r) {
543
- r && V(e);
550
+ d(i) {
551
+ i && j(e);
544
552
  }
545
553
  };
546
554
  }
547
- function Ce(s) {
548
- let e, t, n, r, a, i = W(
555
+ function me(s) {
556
+ let e, t, n, i, r, o = J(
549
557
  /*columns*/
550
558
  s[1]
551
- ), c = [];
552
- for (let d = 0; d < i.length; d += 1)
553
- c[d] = fe(ye(s, i, d));
554
- function u() {
559
+ ), l = [];
560
+ for (let u = 0; u < o.length; u += 1)
561
+ l[u] = we(Ce(s, o, u));
562
+ function d() {
555
563
  return (
556
564
  /*click_handler*/
557
565
  s[12](
@@ -562,90 +570,90 @@ function Ce(s) {
562
570
  }
563
571
  return {
564
572
  c() {
565
- e = E("div");
566
- for (let d = 0; d < c.length; d += 1)
567
- c[d].c();
568
- t = j(), x(e, "class", n = de(`cert-item ${/*index*/
573
+ e = P("div");
574
+ for (let u = 0; u < l.length; u += 1)
575
+ l[u].c();
576
+ t = K(), B(e, "class", n = he(`cert-item ${/*index*/
569
577
  s[15] === 0 ? "cert-item-first" : ""} ${/*index*/
570
578
  s[15] === /*selectedIndex*/
571
579
  s[7] ? "cert-item-selected" : ""}`) + " svelte-1kh75ag");
572
580
  },
573
- m(d, C) {
574
- K(d, e, C);
575
- for (let f = 0; f < c.length; f += 1)
576
- c[f] && c[f].m(e, null);
577
- b(e, t), r || (a = G(e, "click", u), r = !0);
581
+ m(u, C) {
582
+ R(u, e, C);
583
+ for (let g = 0; g < l.length; g += 1)
584
+ l[g] && l[g].m(e, null);
585
+ L(e, t), i || (r = G(e, "click", d), i = !0);
578
586
  },
579
- p(d, C) {
580
- if (s = d, C & /*columns, data*/
587
+ p(u, C) {
588
+ if (s = u, C & /*columns, data*/
581
589
  3) {
582
- i = W(
590
+ o = J(
583
591
  /*columns*/
584
592
  s[1]
585
593
  );
586
- let f;
587
- for (f = 0; f < i.length; f += 1) {
588
- const m = ye(s, i, f);
589
- c[f] ? c[f].p(m, C) : (c[f] = fe(m), c[f].c(), c[f].m(e, t));
594
+ let g;
595
+ for (g = 0; g < o.length; g += 1) {
596
+ const w = Ce(s, o, g);
597
+ l[g] ? l[g].p(w, C) : (l[g] = we(w), l[g].c(), l[g].m(e, t));
590
598
  }
591
- for (; f < c.length; f += 1)
592
- c[f].d(1);
593
- c.length = i.length;
599
+ for (; g < l.length; g += 1)
600
+ l[g].d(1);
601
+ l.length = o.length;
594
602
  }
595
603
  C & /*selectedIndex*/
596
- 128 && n !== (n = de(`cert-item ${/*index*/
604
+ 128 && n !== (n = he(`cert-item ${/*index*/
597
605
  s[15] === 0 ? "cert-item-first" : ""} ${/*index*/
598
606
  s[15] === /*selectedIndex*/
599
- s[7] ? "cert-item-selected" : ""}`) + " svelte-1kh75ag") && x(e, "class", n);
607
+ s[7] ? "cert-item-selected" : ""}`) + " svelte-1kh75ag") && B(e, "class", n);
600
608
  },
601
- d(d) {
602
- d && V(e), ve(c, d), r = !1, a();
609
+ d(u) {
610
+ u && j(e), pe(l, u), i = !1, r();
603
611
  }
604
612
  };
605
613
  }
606
- function ct(s) {
607
- let e, t = W(
614
+ function yt(s) {
615
+ let e, t = J(
608
616
  /*data*/
609
617
  s[0]
610
618
  ), n = [];
611
- for (let r = 0; r < t.length; r += 1)
612
- n[r] = Ce(ge(s, t, r));
619
+ for (let i = 0; i < t.length; i += 1)
620
+ n[i] = me(fe(s, t, i));
613
621
  return {
614
622
  c() {
615
- for (let r = 0; r < n.length; r += 1)
616
- n[r].c();
617
- e = We();
618
- },
619
- m(r, a) {
620
623
  for (let i = 0; i < n.length; i += 1)
621
- n[i] && n[i].m(r, a);
622
- K(r, e, a);
624
+ n[i].c();
625
+ e = et();
623
626
  },
624
- p(r, a) {
625
- if (a & /*selectedIndex, columns, data*/
627
+ m(i, r) {
628
+ for (let o = 0; o < n.length; o += 1)
629
+ n[o] && n[o].m(i, r);
630
+ R(i, e, r);
631
+ },
632
+ p(i, r) {
633
+ if (r & /*selectedIndex, columns, data*/
626
634
  131) {
627
- t = W(
635
+ t = J(
628
636
  /*data*/
629
- r[0]
637
+ i[0]
630
638
  );
631
- let i;
632
- for (i = 0; i < t.length; i += 1) {
633
- const c = ge(r, t, i);
634
- n[i] ? n[i].p(c, a) : (n[i] = Ce(c), n[i].c(), n[i].m(e.parentNode, e));
639
+ let o;
640
+ for (o = 0; o < t.length; o += 1) {
641
+ const l = fe(i, t, o);
642
+ n[o] ? n[o].p(l, r) : (n[o] = me(l), n[o].c(), n[o].m(e.parentNode, e));
635
643
  }
636
- for (; i < n.length; i += 1)
637
- n[i].d(1);
644
+ for (; o < n.length; o += 1)
645
+ n[o].d(1);
638
646
  n.length = t.length;
639
647
  }
640
648
  },
641
- d(r) {
642
- r && V(e), ve(n, r);
649
+ d(i) {
650
+ i && j(e), pe(n, i);
643
651
  }
644
652
  };
645
653
  }
646
- function lt(s) {
654
+ function ft(s) {
647
655
  let e, t;
648
- return e = new ot({
656
+ return e = new gt({
649
657
  props: {
650
658
  onOk: (
651
659
  /*handleOk*/
@@ -675,70 +683,70 @@ function lt(s) {
675
683
  /*theme*/
676
684
  s[5]
677
685
  ),
678
- $$slots: { default: [ct] },
686
+ $$slots: { default: [yt] },
679
687
  $$scope: { ctx: s }
680
688
  }
681
689
  }), {
682
690
  c() {
683
- tt(e.$$.fragment);
691
+ ot(e.$$.fragment);
684
692
  },
685
- m(n, r) {
686
- be(e, n, r), t = !0;
693
+ m(n, i) {
694
+ Ae(e, n, i), t = !0;
687
695
  },
688
- p(n, [r]) {
689
- const a = {};
690
- r & /*onClose*/
691
- 4 && (a.onClose = /*onClose*/
692
- n[2]), r & /*cancelText*/
693
- 8 && (a.cancelText = /*cancelText*/
694
- n[3]), r & /*okText*/
695
- 16 && (a.okText = /*okText*/
696
- n[4]), r & /*title*/
697
- 64 && (a.title = /*title*/
698
- n[6]), r & /*theme*/
699
- 32 && (a.theme = /*theme*/
700
- n[5]), r & /*$$scope, data, selectedIndex, columns*/
701
- 524419 && (a.$$scope = { dirty: r, ctx: n }), e.$set(a);
696
+ p(n, [i]) {
697
+ const r = {};
698
+ i & /*onClose*/
699
+ 4 && (r.onClose = /*onClose*/
700
+ n[2]), i & /*cancelText*/
701
+ 8 && (r.cancelText = /*cancelText*/
702
+ n[3]), i & /*okText*/
703
+ 16 && (r.okText = /*okText*/
704
+ n[4]), i & /*title*/
705
+ 64 && (r.title = /*title*/
706
+ n[6]), i & /*theme*/
707
+ 32 && (r.theme = /*theme*/
708
+ n[5]), i & /*$$scope, data, selectedIndex, columns*/
709
+ 524419 && (r.$$scope = { dirty: i, ctx: n }), e.$set(r);
702
710
  },
703
711
  i(n) {
704
- t || (ne(e.$$.fragment, n), t = !0);
712
+ t || (ie(e.$$.fragment, n), t = !0);
705
713
  },
706
714
  o(n) {
707
- Be(e.$$.fragment, n), t = !1;
715
+ Le(e.$$.fragment, n), t = !1;
708
716
  },
709
717
  d(n) {
710
- De(e, n);
718
+ Be(e, n);
711
719
  }
712
720
  };
713
721
  }
714
- function dt(s, e, t) {
715
- let { data: n = [] } = e, { columns: r = [] } = e, { onCancel: a } = e, { onOk: i } = e, { onClose: c } = e, { cancelText: u = "" } = e, { okText: d = "" } = e, { theme: C = "#409eff" } = e, { title: f = "" } = e, m = 0;
722
+ function Ct(s, e, t) {
723
+ let { data: n = [] } = e, { columns: i = [] } = e, { onCancel: r } = e, { onOk: o } = e, { onClose: l } = e, { cancelText: d = "" } = e, { okText: u = "" } = e, { theme: C = "#409eff" } = e, { title: g = "" } = e, w = 0;
716
724
  const h = () => {
717
- a(`${f}失败`), c == null || c();
718
- }, y = () => {
719
- i == null || i(n[m]), c == null || c();
720
- }, w = (g) => t(7, m = g);
721
- return s.$$set = (g) => {
722
- "data" in g && t(0, n = g.data), "columns" in g && t(1, r = g.columns), "onCancel" in g && t(10, a = g.onCancel), "onOk" in g && t(11, i = g.onOk), "onClose" in g && t(2, c = g.onClose), "cancelText" in g && t(3, u = g.cancelText), "okText" in g && t(4, d = g.okText), "theme" in g && t(5, C = g.theme), "title" in g && t(6, f = g.title);
725
+ r(`${g}失败`), l == null || l();
726
+ }, f = () => {
727
+ o == null || o(n[w]), l == null || l();
728
+ }, E = (y) => t(7, w = y);
729
+ return s.$$set = (y) => {
730
+ "data" in y && t(0, n = y.data), "columns" in y && t(1, i = y.columns), "onCancel" in y && t(10, r = y.onCancel), "onOk" in y && t(11, o = y.onOk), "onClose" in y && t(2, l = y.onClose), "cancelText" in y && t(3, d = y.cancelText), "okText" in y && t(4, u = y.okText), "theme" in y && t(5, C = y.theme), "title" in y && t(6, g = y.title);
723
731
  }, [
724
732
  n,
725
- r,
726
- c,
727
- u,
733
+ i,
734
+ l,
728
735
  d,
736
+ u,
729
737
  C,
730
- f,
731
- m,
738
+ g,
739
+ w,
732
740
  h,
733
- y,
734
- a,
735
- i,
736
- w
741
+ f,
742
+ r,
743
+ o,
744
+ E
737
745
  ];
738
746
  }
739
- class ut extends Ae {
747
+ class wt extends Pe {
740
748
  constructor(e) {
741
- super(), xe(this, e, dt, lt, Se, {
749
+ super(), De(this, e, Ct, ft, ke, {
742
750
  data: 0,
743
751
  columns: 1,
744
752
  onCancel: 10,
@@ -751,21 +759,21 @@ class ut extends Ae {
751
759
  });
752
760
  }
753
761
  }
754
- class ht {
762
+ class mt {
755
763
  constructor() {
756
- o(this, "modalInstance", { current: null });
757
- o(this, "open", (e) => new Promise((t, n) => {
758
- this.modalInstance.current = new ut({
764
+ a(this, "modalInstance", { current: null });
765
+ a(this, "open", (e) => new Promise((t, n) => {
766
+ this.modalInstance.current = new wt({
759
767
  target: document.body,
760
- props: B(p({}, e), {
761
- onCancel: (r) => {
768
+ props: _(m({}, e), {
769
+ onCancel: (i) => {
762
770
  n({
763
771
  code: -1,
764
- msg: r
772
+ msg: i
765
773
  });
766
774
  },
767
- onOk: (r) => {
768
- t(r);
775
+ onOk: (i) => {
776
+ t(i);
769
777
  },
770
778
  onClose: () => {
771
779
  this.close();
@@ -773,7 +781,7 @@ class ht {
773
781
  })
774
782
  });
775
783
  }));
776
- o(this, "close", () => {
784
+ a(this, "close", () => {
777
785
  setTimeout(() => {
778
786
  var e;
779
787
  (e = this.modalInstance.current) == null || e.$destroy();
@@ -781,27 +789,27 @@ class ht {
781
789
  });
782
790
  }
783
791
  }
784
- const J = new ht();
785
- function gt(s = 32, e = !0, t = 0) {
786
- const n = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), r = [];
792
+ const O = new mt();
793
+ function Et(s = 32, e = !0, t = 0) {
794
+ const n = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), i = [];
787
795
  if (t = t || n.length, s)
788
- for (let a = 0; a < s; a++) r[a] = n[0 | Math.random() * t];
796
+ for (let r = 0; r < s; r++) i[r] = n[0 | Math.random() * t];
789
797
  else {
790
- let a;
791
- r[8] = r[13] = r[18] = r[23] = "-", r[14] = "4";
792
- for (let i = 0; i < 36; i++)
793
- r[i] || (a = 0 | Math.random() * 16, r[i] = n[i === 19 ? a & 3 | 8 : a]);
798
+ let r;
799
+ i[8] = i[13] = i[18] = i[23] = "-", i[14] = "4";
800
+ for (let o = 0; o < 36; o++)
801
+ i[o] || (r = 0 | Math.random() * 16, i[o] = n[o === 19 ? r & 3 | 8 : r]);
794
802
  }
795
- return e ? (r.shift(), `u${r.join("")}`) : r.join("");
803
+ return e ? (i.shift(), `u${i.join("")}`) : i.join("");
796
804
  }
797
- const yt = [
805
+ const St = [
798
806
  {
799
807
  key: "CN"
800
808
  },
801
809
  {
802
810
  format: (s) => `${s.DevClass}(${s.sn})`
803
811
  }
804
- ], ft = [
812
+ ], vt = [
805
813
  {
806
814
  key: "SealId"
807
815
  },
@@ -811,88 +819,119 @@ const yt = [
811
819
  {
812
820
  format: (s) => `${s.FileName}(${s.FileSize}B)`
813
821
  }
814
- ], me = [
822
+ ], Ee = [
815
823
  {
816
824
  key: "SealId"
817
825
  }
826
+ ], kt = [
827
+ {
828
+ key: "manu"
829
+ },
830
+ {
831
+ key: "sn"
832
+ }
818
833
  ];
819
- class Ct {
834
+ class It {
820
835
  constructor(e) {
821
- o(this, "socketInstance", null);
822
- o(this, "eventBus", new He());
823
- o(this, "isRememberPin", !1);
824
- o(this, "pinPolicy");
825
- o(this, "socketConfig", null);
826
- o(this, "getSocketReadyState", () => {
836
+ a(this, "socketInstance", null);
837
+ a(this, "eventBus", new Ke());
838
+ a(this, "scene");
839
+ a(this, "isRememberPin", !1);
840
+ a(this, "pinPolicy");
841
+ a(this, "socketConfig", null);
842
+ a(this, "isConnecting", !1);
843
+ a(this, "messageQueue", []);
844
+ a(this, "getSocketReadyState", () => {
827
845
  var e;
828
846
  return (e = this.socketInstance) == null ? void 0 : e.readyState;
829
847
  });
830
- o(this, "destroy", () => {
848
+ a(this, "destroy", () => {
831
849
  var e;
832
850
  (e = this.socketInstance) == null || e.close();
833
851
  });
834
- o(this, "sendMessage", (e, t) => new Promise((n, r) => {
835
- var u, d;
836
- if (((u = this.socketInstance) == null ? void 0 : u.readyState) !== WebSocket.OPEN) {
852
+ a(this, "sendMessage", (e, t, n) => new Promise((i, r) => {
853
+ var l;
854
+ const o = () => {
855
+ var g, w;
856
+ if (((g = this.socketInstance) == null ? void 0 : g.readyState) !== WebSocket.OPEN) {
857
+ r({
858
+ errCode: Ve,
859
+ msg: "数字证书客户端连接失败"
860
+ });
861
+ return;
862
+ }
863
+ const d = Et(), u = (h) => {
864
+ h.success ? i(h.data) : r(h);
865
+ }, C = {
866
+ function: e,
867
+ args: t ? [t] : [],
868
+ msgid: d
869
+ };
870
+ (w = this.socketInstance) == null || w.send(JSON.stringify(C)), this.eventBus.on(e, u), this.eventBus.on(d, u);
871
+ };
872
+ if (n && (this.scene & n) !== n) {
837
873
  r({
838
- errCode: -1,
839
- msg: "数字证书客户端连接失败"
874
+ errCode: Ze,
875
+ msg: "无权限执行此操作"
840
876
  });
841
877
  return;
842
878
  }
843
- const a = gt(), i = (C) => {
844
- C.success ? n(C.data) : r(C);
845
- }, c = {
846
- function: e,
847
- args: [t != null ? t : {}],
848
- msgid: a
849
- };
850
- (d = this.socketInstance) == null || d.send(JSON.stringify(c)), this.eventBus.on(e, i), this.eventBus.on(a, i);
879
+ if (((l = this.socketInstance) == null ? void 0 : l.readyState) === WebSocket.OPEN) {
880
+ o();
881
+ return;
882
+ }
883
+ this.messageQueue.push(o), this.isConnecting || this.initSocket(this.socketConfig);
851
884
  }));
852
- o(this, "handleEventData", (e) => l(this, null, function* () {
853
- var t, n, r, a, i, c, u, d;
885
+ a(this, "flushMsgQueue", () => {
886
+ var e;
887
+ (e = this.messageQueue) == null || e.forEach((t) => t()), this.messageQueue = [];
888
+ });
889
+ a(this, "handleEventData", (e) => c(this, null, function* () {
890
+ var t, n, i, r, o, l, d, u;
854
891
  if (e.data instanceof Blob) {
855
- const C = yield e.data.arrayBuffer(), m = new TextDecoder("gbk").decode(C), h = JSON.parse(m), y = {
892
+ const C = yield e.data.arrayBuffer(), w = new TextDecoder(
893
+ navigator.userAgent.includes("Windows") ? "gbk" : "utf-8"
894
+ ).decode(C), h = JSON.parse(w), f = {
856
895
  success: (t = h.result) == null ? void 0 : t.success,
857
896
  msg: (n = h.result) == null ? void 0 : n.msg,
858
- errCode: (r = h.result) == null ? void 0 : r.errCode,
897
+ errCode: (i = h.result) == null ? void 0 : i.errCode,
859
898
  data: h.data,
860
- type: (a = h.result) == null ? void 0 : a.event
861
- }, w = (i = h.result) == null ? void 0 : i.function, g = (c = h.result) == null ? void 0 : c.msgid;
862
- g ? this.eventBus.emit(g, y) : this.eventBus.emit(w, y), (d = (u = this.socketConfig) == null ? void 0 : u.onMessage) == null || d.call(u, y);
899
+ type: (r = h.result) == null ? void 0 : r.event
900
+ }, E = (o = h.result) == null ? void 0 : o.function, y = (l = h.result) == null ? void 0 : l.msgid;
901
+ y ? this.eventBus.emit(y, f) : this.eventBus.emit(E, f), (u = (d = this.socketConfig) == null ? void 0 : d.onMessage) == null || u.call(d, f);
863
902
  }
864
903
  }));
865
- o(this, "base64Encode", (e) => {
904
+ a(this, "base64Encode", (e) => {
866
905
  const t = new TextEncoder().encode(e);
867
- return oe.fromByteArray(t);
906
+ return le.fromByteArray(t);
868
907
  });
869
- o(this, "base64Decode", (e) => {
870
- const t = oe.toByteArray(e);
908
+ a(this, "base64Decode", (e) => {
909
+ const t = le.toByteArray(e);
871
910
  return new TextDecoder().decode(t);
872
911
  });
873
- o(this, "changeIsRememberPin", (e) => l(this, null, function* () {
912
+ a(this, "changeIsRememberPin", (e) => c(this, null, function* () {
874
913
  this.isRememberPin = e;
875
914
  }));
876
- o(this, "changePinPolicy", (e) => l(this, null, function* () {
915
+ a(this, "changePinPolicy", (e) => c(this, null, function* () {
877
916
  this.pinPolicy = e;
878
917
  }));
879
- o(this, "checkCertIsLogin", (e) => l(this, null, function* () {
918
+ a(this, "checkCertIsLogin", (e) => c(this, null, function* () {
880
919
  return yield this.sendMessage("GZCA_IsLogin", e);
881
920
  }));
882
- o(this, "addUkeyEvents", () => l(this, null, function* () {
921
+ a(this, "addUkeyEvents", () => c(this, null, function* () {
883
922
  this.sendMessage("GZCA_WaitForDevEvent", {
884
- Type: Ne
923
+ Type: Ge
885
924
  }), this.eventBus.on(
886
925
  "GZCA_OnDeviceChange",
887
926
  (e) => {
888
- var t, n, r;
889
- (r = (t = this.socketConfig) == null ? void 0 : t.onUkeyChange) == null || r.call(t, B(p({}, e), {
927
+ var t, n, i;
928
+ (i = (t = this.socketConfig) == null ? void 0 : t.onUkeyChange) == null || i.call(t, _(m({}, e), {
890
929
  data: (n = e.data) == null ? void 0 : n[0]
891
930
  }));
892
931
  }
893
932
  );
894
933
  }));
895
- o(this, "certLogin", (e) => l(this, null, function* () {
934
+ a(this, "certLogin", (e) => c(this, null, function* () {
896
935
  const t = yield this.checkCertIsLogin({
897
936
  ContainerName: e
898
937
  });
@@ -903,329 +942,413 @@ class Ct {
903
942
  PinPolicy: this.pinPolicy
904
943
  }));
905
944
  }));
906
- o(this, "getCert", (e, t, n) => l(this, null, function* () {
907
- const r = t != null ? t : yield this.chooseCert(e);
908
- return this.isRememberPin && n && (yield this.certLogin(r.ContainerName)), r;
945
+ a(this, "verifyPin", (e) => c(this, null, function* () {
946
+ var t;
947
+ yield this.sendMessage("GZCA_Login", {
948
+ ContainerName: e.ContainerName,
949
+ IsLogin: e.UserPin ? "Y" : "N",
950
+ UserPin: (t = e.UserPin) != null ? t : "123456",
951
+ PinPolicy: this.pinPolicy
952
+ });
909
953
  }));
910
- o(this, "chooseCert", (e) => l(this, null, function* () {
911
- var r;
954
+ a(this, "getCert", (e, t, n) => c(this, null, function* () {
955
+ const i = t != null ? t : yield this.chooseCert(e);
956
+ return this.isRememberPin && n && (yield this.certLogin(i.ContainerName)), i;
957
+ }));
958
+ a(this, "chooseCert", (e) => c(this, null, function* () {
959
+ var i;
912
960
  const t = yield this.getCertList(e);
913
- return t != null && t.length ? (t == null ? void 0 : t.length) === 1 ? t[0] : yield J.open({
961
+ return t != null && t.length ? (t == null ? void 0 : t.length) === 1 ? t[0] : yield O.open({
914
962
  title: "选择证书",
915
963
  data: t,
916
- columns: yt,
917
- theme: (r = this.socketConfig) == null ? void 0 : r.theme
964
+ columns: St,
965
+ theme: (i = this.socketConfig) == null ? void 0 : i.theme
918
966
  }) : Promise.reject({
919
- errCode: -1,
967
+ errCode: Oe,
920
968
  msg: "暂无证书"
921
969
  });
922
970
  }));
923
- o(this, "getCertList", (e) => l(this, null, function* () {
971
+ a(this, "getCertList", (e) => c(this, null, function* () {
924
972
  return yield this.sendMessage(
925
973
  "GZCA_GetCertList",
926
974
  e
927
975
  );
928
976
  }));
929
- o(this, "pkcs1Sign", (e) => l(this, null, function* () {
930
- return yield this.sendMessage("GZCA_Pkcs1SignData", p({
977
+ a(this, "pkcs1Sign", (e) => c(this, null, function* () {
978
+ return yield this.sendMessage("GZCA_Pkcs1SignData", m({
931
979
  IsLogin: this.getIsLogin(),
932
980
  PinPolicy: this.pinPolicy
933
981
  }, e != null ? e : {}));
934
982
  }));
935
- o(this, "pkcs1Base64Sign", (e) => l(this, null, function* () {
936
- return yield this.sendMessage("GZCA_Pkcs1SignDataEx", p({
983
+ a(this, "pkcs1Base64Sign", (e) => c(this, null, function* () {
984
+ return yield this.sendMessage("GZCA_Pkcs1SignDataEx", m({
937
985
  IsLogin: this.getIsLogin(),
938
986
  PinPolicy: this.pinPolicy
939
987
  }, e != null ? e : {}));
940
988
  }));
941
- o(this, "batchPkcs1Base64Sign", (e) => l(this, null, function* () {
942
- return yield this.sendMessage("GZCA_BatchPkcs1SignDataEx", p({
989
+ a(this, "batchPkcs1Base64Sign", (e) => c(this, null, function* () {
990
+ return yield this.sendMessage("GZCA_BatchPkcs1SignDataEx", m({
943
991
  IsLogin: this.getIsLogin(),
944
992
  PinPolicy: this.pinPolicy
945
993
  }, e != null ? e : {}));
946
994
  }));
947
- o(this, "pkcs1VerifySignature", (e) => l(this, null, function* () {
995
+ a(this, "pkcs1VerifySignature", (e) => c(this, null, function* () {
948
996
  return yield this.sendMessage("GZCA_Pkcs1VerifySign", e);
949
997
  }));
950
- o(this, "pkcs1Base64VerifySignature", (e) => l(this, null, function* () {
998
+ a(this, "pkcs1Base64VerifySignature", (e) => c(this, null, function* () {
951
999
  return yield this.sendMessage("GZCA_Pkcs1VerifySignEx", e);
952
1000
  }));
953
- o(this, "getSealList", (e) => l(this, null, function* () {
954
- return yield this.sendMessage("GZCA_EnumSeals", p({
955
- IsLogin: this.getIsLogin()
956
- }, e != null ? e : {}));
1001
+ a(this, "getSealList", (e) => c(this, null, function* () {
1002
+ return yield this.sendMessage(
1003
+ "GZCA_EnumSeals",
1004
+ m({
1005
+ IsLogin: this.getIsLogin()
1006
+ }, e != null ? e : {}),
1007
+ I.LEVEL_2
1008
+ );
957
1009
  }));
958
- o(this, "writeSeal", (e) => l(this, null, function* () {
959
- return yield this.sendMessage("GZCA_WriteSeal", p({
960
- IsLogin: this.getIsLogin()
961
- }, e != null ? e : {}));
1010
+ a(this, "writeSeal", (e) => c(this, null, function* () {
1011
+ return yield this.sendMessage(
1012
+ "GZCA_WriteSeal",
1013
+ m({
1014
+ IsLogin: this.getIsLogin()
1015
+ }, e != null ? e : {}),
1016
+ I.LEVEL_2
1017
+ );
962
1018
  }));
963
- o(this, "deleteSeal", (e) => l(this, null, function* () {
964
- return yield this.sendMessage("GZCA_DeleteSeal", p({
965
- IsLogin: this.getIsLogin()
966
- }, e != null ? e : {}));
1019
+ a(this, "deleteSeal", (e) => c(this, null, function* () {
1020
+ return yield this.sendMessage(
1021
+ "GZCA_DeleteSeal",
1022
+ m({
1023
+ IsLogin: this.getIsLogin()
1024
+ }, e != null ? e : {}),
1025
+ I.LEVEL_2
1026
+ );
967
1027
  }));
968
- o(this, "getSealInfo", (e) => l(this, null, function* () {
969
- return yield this.sendMessage("GZCA_ReadSeal", p({
970
- IsLogin: this.getIsLogin()
971
- }, e != null ? e : {}));
1028
+ a(this, "getSealInfo", (e) => c(this, null, function* () {
1029
+ return yield this.sendMessage(
1030
+ "GZCA_ReadSeal",
1031
+ m({
1032
+ IsLogin: this.getIsLogin()
1033
+ }, e != null ? e : {}),
1034
+ I.LEVEL_2
1035
+ );
972
1036
  }));
973
- o(this, "getTPSealList", (e) => l(this, null, function* () {
974
- return yield this.sendMessage("GZCA_GetSealPicList", p({
975
- IsLogin: this.getIsLogin()
976
- }, e != null ? e : {}));
1037
+ a(this, "getTPSealList", (e) => c(this, null, function* () {
1038
+ return yield this.sendMessage(
1039
+ "GZCA_GetSealPicList",
1040
+ m({
1041
+ IsLogin: this.getIsLogin()
1042
+ }, e != null ? e : {}),
1043
+ I.LEVEL_2
1044
+ );
977
1045
  }));
978
- o(this, "getTPSealPic", (e) => l(this, null, function* () {
1046
+ a(this, "getTPSealPic", (e) => c(this, null, function* () {
979
1047
  var n;
980
- return yield this.sendMessage("GZCA_GetSealPicData", p({
981
- IsLogin: (n = e.IsLogin) != null ? n : this.getIsLogin()
982
- }, e != null ? e : {}));
1048
+ return yield this.sendMessage(
1049
+ "GZCA_GetSealPicData",
1050
+ m({
1051
+ IsLogin: (n = e.IsLogin) != null ? n : this.getIsLogin()
1052
+ }, e != null ? e : {}),
1053
+ I.LEVEL_2
1054
+ );
983
1055
  }));
984
- o(this, "sm2SignPreprocess1", (e) => l(this, null, function* () {
1056
+ a(this, "sm2SignPreprocess1", (e) => c(this, null, function* () {
985
1057
  return yield this.sendMessage("GZCA_PrepareSm2SignStep1", e);
986
1058
  }));
987
- o(this, "sm2SignPreprocess2", (e) => l(this, null, function* () {
1059
+ a(this, "sm2SignPreprocess2", (e) => c(this, null, function* () {
988
1060
  return yield this.sendMessage("GZCA_PrepareSm2SignStep2", e);
989
1061
  }));
990
- o(this, "pkcs1HashSign", (e) => l(this, null, function* () {
991
- return yield this.sendMessage("GZCA_Pkcs1SignDataForHash", p({
1062
+ a(this, "pkcs1HashSign", (e) => c(this, null, function* () {
1063
+ return yield this.sendMessage("GZCA_Pkcs1SignDataForHash", m({
992
1064
  IsLogin: this.getIsLogin(),
993
1065
  PinPolicy: this.pinPolicy
994
1066
  }, e != null ? e : {}));
995
1067
  }));
996
- o(this, "pkcs1HashVerifySignature", (e) => l(this, null, function* () {
1068
+ a(this, "pkcs1HashVerifySignature", (e) => c(this, null, function* () {
997
1069
  return yield this.sendMessage("GZCA_Pkcs1VerifySignForHash", e);
998
1070
  }));
999
- o(this, "pkcs7Sign", (e) => l(this, null, function* () {
1000
- return yield this.sendMessage("GZCA_Pkcs7SignData", p({
1071
+ a(this, "pkcs7Sign", (e) => c(this, null, function* () {
1072
+ return yield this.sendMessage("GZCA_Pkcs7SignData", m({
1001
1073
  IsLogin: this.getIsLogin(),
1002
1074
  IsAuthAttr: "Y",
1003
1075
  PinPolicy: this.pinPolicy
1004
1076
  }, e != null ? e : {}));
1005
1077
  }));
1006
- o(this, "pkcs7VerifySignature", (e) => l(this, null, function* () {
1078
+ a(this, "pkcs7VerifySignature", (e) => c(this, null, function* () {
1007
1079
  return yield this.sendMessage("GZCA_Pkcs7VerifySign", e);
1008
1080
  }));
1009
- o(this, "sm3Hash", (e) => l(this, null, function* () {
1081
+ a(this, "sm3Hash", (e) => c(this, null, function* () {
1010
1082
  return yield this.sendMessage("GZCA_HashData", e);
1011
1083
  }));
1012
- o(this, "sm3HexHash", (e) => l(this, null, function* () {
1084
+ a(this, "sm3HexHash", (e) => c(this, null, function* () {
1013
1085
  return yield this.sendMessage("GZCA_HashDataEx", e);
1014
1086
  }));
1015
- o(this, "sm3FileHash", (e) => l(this, null, function* () {
1087
+ a(this, "sm3FileHash", (e) => c(this, null, function* () {
1016
1088
  return yield this.sendMessage("GZCA_HashFile", e);
1017
1089
  }));
1018
- o(this, "sm3HashEncryption", (e) => l(this, null, function* () {
1090
+ a(this, "sm3HashEncryption", (e) => c(this, null, function* () {
1019
1091
  return yield this.sendMessage("GZCA_HMac", e);
1020
1092
  }));
1021
- o(this, "pkcs7Encryption", (e) => l(this, null, function* () {
1093
+ a(this, "pkcs7Encryption", (e) => c(this, null, function* () {
1022
1094
  return yield this.sendMessage("GZCA_Pkcs7EncryptData", e);
1023
1095
  }));
1024
- o(this, "pkcs7Decryption", (e) => l(this, null, function* () {
1025
- return yield this.sendMessage("GZCA_Pkcs7DecryptData", p({
1096
+ a(this, "pkcs7Decryption", (e) => c(this, null, function* () {
1097
+ return yield this.sendMessage("GZCA_Pkcs7DecryptData", m({
1026
1098
  IsLogin: this.getIsLogin()
1027
1099
  }, e != null ? e : {}));
1028
1100
  }));
1029
- o(this, "pkcs7FileEncryption", (e) => l(this, null, function* () {
1101
+ a(this, "pkcs7FileEncryption", (e) => c(this, null, function* () {
1030
1102
  return yield this.sendMessage("GZCA_EnvelopeSealFileEx_qyzc", e);
1031
1103
  }));
1032
- o(this, "pkcs7FileDecryption", (e) => l(this, null, function* () {
1033
- return yield this.sendMessage("GZCA_EnvelopeOpenFileEx_qyzc", p({
1104
+ a(this, "pkcs7FileDecryption", (e) => c(this, null, function* () {
1105
+ return yield this.sendMessage("GZCA_EnvelopeOpenFileEx_qyzc", m({
1034
1106
  IsLogin: this.getIsLogin()
1035
1107
  }, e != null ? e : {}));
1036
1108
  }));
1037
- o(this, "asymmetricEncryption", (e) => l(this, null, function* () {
1109
+ a(this, "asymmetricEncryption", (e) => c(this, null, function* () {
1038
1110
  return yield this.sendMessage("GZCA_AsymEncryptData", e);
1039
1111
  }));
1040
- o(this, "asymmetricDecryption", (e) => l(this, null, function* () {
1041
- return yield this.sendMessage("GZCA_AsymDecryptData", p({
1112
+ a(this, "asymmetricDecryption", (e) => c(this, null, function* () {
1113
+ return yield this.sendMessage("GZCA_AsymDecryptData", m({
1042
1114
  IsLogin: this.getIsLogin()
1043
1115
  }, e != null ? e : {}));
1044
1116
  }));
1045
- o(this, "sm4Encryption", (e) => l(this, null, function* () {
1117
+ a(this, "sm4Encryption", (e) => c(this, null, function* () {
1046
1118
  return yield this.sendMessage("GZCA_EncryptDataEx", e);
1047
1119
  }));
1048
- o(this, "sm4Decryption", (e) => l(this, null, function* () {
1120
+ a(this, "sm4Decryption", (e) => c(this, null, function* () {
1049
1121
  return yield this.sendMessage("GZCA_DecryptDataEx", e);
1050
1122
  }));
1051
- o(this, "getCertInfo", (e) => l(this, null, function* () {
1123
+ a(this, "getCertInfo", (e) => c(this, null, function* () {
1052
1124
  return yield this.sendMessage("GZCA_GetCertInfo", e);
1053
1125
  }));
1054
- o(this, "getCertInfoByOid", (e) => l(this, null, function* () {
1126
+ a(this, "getCertInfoByOid", (e) => c(this, null, function* () {
1055
1127
  return yield this.sendMessage("GZCA_GetCertInfoByOid", e);
1056
1128
  }));
1057
- o(this, "getSealVendor", (e) => l(this, null, function* () {
1058
- return yield this.sendMessage("GZCA_GetSealIssuer", e);
1129
+ a(this, "getSealVendor", (e) => c(this, null, function* () {
1130
+ return yield this.sendMessage(
1131
+ "GZCA_GetSealIssuer",
1132
+ e,
1133
+ I.LEVEL_2
1134
+ );
1059
1135
  }));
1060
- o(this, "deleteAllSealByVendor", (e) => l(this, null, function* () {
1061
- return yield this.sendMessage("GZCA_ClearSeal", p({
1062
- IsLogin: this.getIsLogin()
1063
- }, e != null ? e : {}));
1136
+ a(this, "deleteAllSealByVendor", (e) => c(this, null, function* () {
1137
+ return yield this.sendMessage(
1138
+ "GZCA_ClearSeal",
1139
+ m({
1140
+ IsLogin: this.getIsLogin()
1141
+ }, e != null ? e : {}),
1142
+ I.LEVEL_2
1143
+ );
1064
1144
  }));
1065
- var t, n;
1066
- this.socketConfig = e, this.socketInstance = this.createSocket(e), this.isRememberPin = (t = e.isRememberPin) != null ? t : !1, this.pinPolicy = (n = e.pinPolicy) != null ? n : we.MIN;
1145
+ a(this, "applyCert", (e) => c(this, null, function* () {
1146
+ return yield this.sendMessage(
1147
+ "GZCA_ApplyCert",
1148
+ {
1149
+ manu: e.manu,
1150
+ sn: e.sn,
1151
+ keyid: e.ContainerName,
1152
+ type: e.type,
1153
+ url: e.url
1154
+ },
1155
+ I.LEVEL_3
1156
+ );
1157
+ }));
1158
+ a(this, "resetPin", (e) => c(this, null, function* () {
1159
+ return yield this.sendMessage(
1160
+ "GZCA_UnblockUserPin",
1161
+ m({}, e != null ? e : {}),
1162
+ I.LEVEL_3
1163
+ );
1164
+ }));
1165
+ a(this, "getUKeyList", () => c(this, null, function* () {
1166
+ return yield this.sendMessage(
1167
+ "GetUKeyList",
1168
+ void 0,
1169
+ I.LEVEL_3
1170
+ );
1171
+ }));
1172
+ a(this, "getUKeyInfo", (e) => c(this, null, function* () {
1173
+ return yield this.sendMessage(
1174
+ "GetUKeyID",
1175
+ e != null ? e : {},
1176
+ I.LEVEL_3
1177
+ );
1178
+ }));
1179
+ var t, n, i;
1180
+ this.socketConfig = e, this.initSocket(e), this.isRememberPin = (t = e.isRememberPin) != null ? t : !1, this.scene = (n = e.scene) != null ? n : Fe.OPEN, this.pinPolicy = (i = e.pinPolicy) != null ? i : Se.MIN;
1067
1181
  }
1068
- createSocket(e) {
1182
+ initSocket(e) {
1183
+ this.isConnecting = !0;
1069
1184
  const t = new WebSocket(e.url);
1070
- return t.onerror = (n) => {
1071
- var r;
1072
- (r = e.onError) == null || r.call(e, n);
1185
+ t.onerror = (n) => {
1186
+ var i;
1187
+ this.isConnecting = !1, (i = e.onError) == null || i.call(e, n), this.flushMsgQueue();
1073
1188
  }, t.onopen = (n) => {
1074
- var r;
1075
- (r = e.onOpen) == null || r.call(e, n), e.onUkeyChange && this.addUkeyEvents();
1189
+ var i;
1190
+ this.isConnecting = !1, (i = e.onOpen) == null || i.call(e, n), e.onUkeyChange && this.addUkeyEvents(), this.flushMsgQueue();
1076
1191
  }, t.onmessage = (n) => {
1077
1192
  this.handleEventData(n);
1078
1193
  }, t.onclose = (n) => {
1079
- var r;
1080
- (r = e.onClose) == null || r.call(e, n);
1081
- }, t;
1194
+ var i;
1195
+ this.isConnecting = !1, (i = e.onClose) == null || i.call(e, n);
1196
+ }, this.socketInstance = t;
1082
1197
  }
1083
1198
  getIsLogin() {
1084
1199
  return this.isRememberPin ? "Y" : "N";
1085
1200
  }
1086
1201
  }
1087
- const L = class L {
1202
+ const $ = class $ {
1088
1203
  constructor(e) {
1089
- o(this, "coreInstance", null);
1090
- o(this, "gwsConfig", {});
1091
- o(this, "createGwsCore", (e) => {
1092
- this.gwsConfig = e != null ? e : {}, this.coreInstance = new Ct(B(p({}, e != null ? e : {}), {
1204
+ a(this, "coreInstance", null);
1205
+ a(this, "gwsConfig", {});
1206
+ a(this, "createGwsCore", (e) => {
1207
+ this.gwsConfig = e != null ? e : {}, this.coreInstance = new It(_(m({}, e != null ? e : {}), {
1093
1208
  url: Me
1094
1209
  }));
1095
1210
  });
1096
- o(this, "appendCertBase64", (e, t = !0) => l(this, null, function* () {
1211
+ a(this, "appendCertBase64", (e, t = !0) => c(this, null, function* () {
1097
1212
  if (e.CertB64) return e;
1098
1213
  const n = t ? yield this.getSignatureCert() : yield this.getEncryptionCert();
1099
- return B(p({}, e != null ? e : {}), { CertB64: n == null ? void 0 : n.CertB64 });
1214
+ return _(m({}, e != null ? e : {}), { CertB64: n == null ? void 0 : n.CertB64 });
1100
1215
  }));
1101
- o(this, "destroy", () => {
1216
+ a(this, "destroy", () => {
1102
1217
  var e;
1103
1218
  (e = this.coreInstance) == null || e.destroy(), this.coreInstance = null;
1104
1219
  });
1105
- o(this, "restart", (e) => {
1220
+ a(this, "restart", (e) => {
1106
1221
  this.coreInstance && this.destroy(), this.gwsConfig = e != null ? e : this.gwsConfig, this.createGwsCore(e);
1107
1222
  });
1108
- o(this, "getSocketReadyState", () => {
1223
+ a(this, "getSocketReadyState", () => {
1109
1224
  var e;
1110
1225
  return (e = this.coreInstance) == null ? void 0 : e.getSocketReadyState();
1111
1226
  });
1112
- o(this, "getSignatureCert", (e, t = !0) => l(this, null, function* () {
1113
- var r;
1114
- return yield (r = this.coreInstance) == null ? void 0 : r.getCert(
1115
- { CertType: re },
1227
+ a(this, "verifyPin", (e, t) => c(this, null, function* () {
1228
+ var i, r;
1229
+ const n = yield this.getSignatureCert(t);
1230
+ return (r = this.coreInstance) == null ? void 0 : r.verifyPin({
1231
+ ContainerName: (i = n == null ? void 0 : n.ContainerName) != null ? i : "",
1232
+ UserPin: e == null ? void 0 : e.UserPin
1233
+ });
1234
+ }));
1235
+ a(this, "getSignatureCert", (e, t = !0) => c(this, null, function* () {
1236
+ var i;
1237
+ return yield (i = this.coreInstance) == null ? void 0 : i.getCert(
1238
+ { CertType: ae },
1116
1239
  e,
1117
1240
  t
1118
1241
  );
1119
1242
  }));
1120
- o(this, "getSignatureCertList", () => l(this, null, function* () {
1243
+ a(this, "getSignatureCertList", () => c(this, null, function* () {
1121
1244
  var t;
1122
1245
  return yield (t = this.coreInstance) == null ? void 0 : t.getCertList({
1123
- CertType: re
1246
+ CertType: ae
1124
1247
  });
1125
1248
  }));
1126
- o(this, "getEncryptionCert", (e, t = !0) => l(this, null, function* () {
1127
- var r;
1128
- return yield (r = this.coreInstance) == null ? void 0 : r.getCert(
1129
- { CertType: ae },
1249
+ a(this, "getEncryptionCert", (e, t = !0) => c(this, null, function* () {
1250
+ var i;
1251
+ return yield (i = this.coreInstance) == null ? void 0 : i.getCert(
1252
+ { CertType: oe },
1130
1253
  e,
1131
1254
  t
1132
1255
  );
1133
1256
  }));
1134
- o(this, "getEncryptionCertList", () => l(this, null, function* () {
1257
+ a(this, "getEncryptionCertList", () => c(this, null, function* () {
1135
1258
  var t;
1136
1259
  return yield (t = this.coreInstance) == null ? void 0 : t.getCertList({
1137
- CertType: ae
1260
+ CertType: oe
1138
1261
  });
1139
1262
  }));
1140
- o(this, "base64Encode", (e) => {
1263
+ a(this, "base64Encode", (e) => {
1141
1264
  var t;
1142
1265
  return (t = this.coreInstance) == null ? void 0 : t.base64Encode(e.Data);
1143
1266
  });
1144
- o(this, "base64Decode", (e) => {
1267
+ a(this, "base64Decode", (e) => {
1145
1268
  var t;
1146
1269
  return (t = this.coreInstance) == null ? void 0 : t.base64Decode(e.DataB64);
1147
1270
  });
1148
- o(this, "changeIsRememberPin", (e) => {
1271
+ a(this, "changeIsRememberPin", (e) => {
1149
1272
  var t;
1150
1273
  (t = this.coreInstance) == null || t.changeIsRememberPin(e);
1151
1274
  });
1152
- o(this, "changePinPolicy", (e) => {
1275
+ a(this, "changePinPolicy", (e) => {
1153
1276
  var t;
1154
1277
  (t = this.coreInstance) == null || t.changePinPolicy(e);
1155
1278
  });
1156
- o(this, "pkcs1Sign", (e, t) => l(this, null, function* () {
1157
- var a, i, c;
1158
- const n = yield this.getSignatureCert(t), r = yield (i = this.coreInstance) == null ? void 0 : i.pkcs1Sign(B(p({}, e != null ? e : {}), {
1159
- ContainerName: (a = n == null ? void 0 : n.ContainerName) != null ? a : ""
1279
+ a(this, "pkcs1Sign", (e, t) => c(this, null, function* () {
1280
+ var r, o, l;
1281
+ const n = yield this.getSignatureCert(t), i = yield (o = this.coreInstance) == null ? void 0 : o.pkcs1Sign(_(m({}, e != null ? e : {}), {
1282
+ ContainerName: (r = n == null ? void 0 : n.ContainerName) != null ? r : ""
1160
1283
  }));
1161
- return (c = r == null ? void 0 : r[0]) == null ? void 0 : c.SignData;
1284
+ return (l = i == null ? void 0 : i[0]) == null ? void 0 : l.SignData;
1162
1285
  }));
1163
- o(this, "pkcs1VerifySignature", (e) => l(this, null, function* () {
1164
- var r;
1165
- const t = yield this.appendCertBase64(e), n = yield (r = this.coreInstance) == null ? void 0 : r.pkcs1VerifySignature(t);
1286
+ a(this, "pkcs1VerifySignature", (e) => c(this, null, function* () {
1287
+ var i;
1288
+ const t = yield this.appendCertBase64(e), n = yield (i = this.coreInstance) == null ? void 0 : i.pkcs1VerifySignature(t);
1166
1289
  return Array.isArray(n);
1167
1290
  }));
1168
- o(this, "pkcs1Base64Sign", (e, t) => l(this, null, function* () {
1169
- var i, c, u, d, C;
1170
- const n = yield this.getSignatureCert(t), r = (c = e.DataB64) != null ? c : this.base64Encode({ Data: (i = e.Data) != null ? i : "" }), a = yield (d = this.coreInstance) == null ? void 0 : d.pkcs1Base64Sign(B(p({}, e != null ? e : {}), {
1171
- ContainerName: (u = n == null ? void 0 : n.ContainerName) != null ? u : "",
1172
- DataB64: r
1173
- }));
1174
- return (C = a == null ? void 0 : a[0]) == null ? void 0 : C.SignData;
1175
- }));
1176
- o(this, "batchPkcs1Base64Sign", (e, t) => l(this, null, function* () {
1177
- var C, f, m, h, y, w;
1178
- const n = "|", r = (f = e.DataB64) != null ? f : (C = e.Data) == null ? void 0 : C.map((g) => this.base64Encode({ Data: g })), a = yield this.getSignatureCert(t);
1179
- let i = "";
1180
- i = Array.isArray(r) ? r == null ? void 0 : r.map((g, S) => `${S}:${g}`).join(n) : "";
1181
- const c = yield (h = this.coreInstance) == null ? void 0 : h.batchPkcs1Base64Sign({
1182
- ContainerName: (m = a == null ? void 0 : a.ContainerName) != null ? m : "",
1291
+ a(this, "pkcs1Base64Sign", (e, t) => c(this, null, function* () {
1292
+ var o, l, d, u, C;
1293
+ const n = yield this.getSignatureCert(t), i = (l = e.DataB64) != null ? l : this.base64Encode({ Data: (o = e.Data) != null ? o : "" }), r = yield (u = this.coreInstance) == null ? void 0 : u.pkcs1Base64Sign(_(m({}, e != null ? e : {}), {
1294
+ ContainerName: (d = n == null ? void 0 : n.ContainerName) != null ? d : "",
1183
1295
  DataB64: i
1184
- }), u = (w = (y = c == null ? void 0 : c[0]) == null ? void 0 : y.SignData) == null ? void 0 : w.split(n), d = [];
1185
- return u.forEach((g) => {
1186
- const S = g.split(":"), v = Number(S[0]), I = S[1];
1187
- d[v] = I;
1188
- }), d;
1189
- }));
1190
- o(this, "pkcs1Base64VerifySignature", (e) => l(this, null, function* () {
1191
- var a, i, c;
1192
- const t = (i = e.DataB64) != null ? i : this.base64Encode({ Data: (a = e.Data) != null ? a : "" }), n = yield this.appendCertBase64(e);
1193
- return !!(yield (c = this.coreInstance) == null ? void 0 : c.pkcs1Base64VerifySignature({
1296
+ }));
1297
+ return (C = r == null ? void 0 : r[0]) == null ? void 0 : C.SignData;
1298
+ }));
1299
+ a(this, "batchPkcs1Base64Sign", (e, t) => c(this, null, function* () {
1300
+ var C, g, w, h, f, E;
1301
+ const n = "|", i = (g = e.DataB64) != null ? g : (C = e.Data) == null ? void 0 : C.map((y) => this.base64Encode({ Data: y })), r = yield this.getSignatureCert(t);
1302
+ let o = "";
1303
+ o = Array.isArray(i) ? i == null ? void 0 : i.map((y, S) => `${S}:${y}`).join(n) : "";
1304
+ const l = yield (h = this.coreInstance) == null ? void 0 : h.batchPkcs1Base64Sign({
1305
+ ContainerName: (w = r == null ? void 0 : r.ContainerName) != null ? w : "",
1306
+ DataB64: o
1307
+ }), d = (E = (f = l == null ? void 0 : l[0]) == null ? void 0 : f.SignData) == null ? void 0 : E.split(n), u = [];
1308
+ return d.forEach((y) => {
1309
+ const S = y.split(":"), k = Number(S[0]), p = S[1];
1310
+ u[k] = p;
1311
+ }), u;
1312
+ }));
1313
+ a(this, "pkcs1Base64VerifySignature", (e) => c(this, null, function* () {
1314
+ var r, o, l;
1315
+ const t = (o = e.DataB64) != null ? o : this.base64Encode({ Data: (r = e.Data) != null ? r : "" }), n = yield this.appendCertBase64(e);
1316
+ return !!(yield (l = this.coreInstance) == null ? void 0 : l.pkcs1Base64VerifySignature({
1194
1317
  CertB64: n.CertB64,
1195
1318
  DataB64: t,
1196
1319
  SignData: n.SignData
1197
1320
  }));
1198
1321
  }));
1199
- o(this, "writeSeal", (e, t) => l(this, null, function* () {
1200
- var a, i;
1322
+ a(this, "writeSeal", (e, t) => c(this, null, function* () {
1323
+ var r, o;
1201
1324
  const n = yield this.getSignatureCert(t);
1202
- return !!(yield (i = this.coreInstance) == null ? void 0 : i.writeSeal(B(p({}, e != null ? e : {}), {
1203
- ContainerName: (a = n == null ? void 0 : n.ContainerName) != null ? a : ""
1325
+ return !!(yield (o = this.coreInstance) == null ? void 0 : o.writeSeal(_(m({}, e != null ? e : {}), {
1326
+ ContainerName: (r = n == null ? void 0 : n.ContainerName) != null ? r : ""
1204
1327
  })));
1205
1328
  }));
1206
- o(this, "deleteSeal", (e) => l(this, null, function* () {
1207
- var a, i, c, u, d;
1329
+ a(this, "deleteSeal", (e) => c(this, null, function* () {
1330
+ var r, o, l, d, u;
1208
1331
  const t = yield this.getSealList(e);
1209
- if (!((a = t == null ? void 0 : t.data) != null && a.length))
1332
+ if (!((r = t == null ? void 0 : t.data) != null && r.length))
1210
1333
  return Promise.reject({
1211
- errCode: -1,
1334
+ errCode: q,
1212
1335
  msg: "暂无印章"
1213
1336
  });
1214
- const n = yield J.open({
1337
+ const n = yield O.open({
1215
1338
  title: "删除印章",
1216
1339
  data: t == null ? void 0 : t.data,
1217
- columns: me,
1340
+ columns: Ee,
1218
1341
  okText: "删除"
1219
1342
  });
1220
- return !!(yield (d = this.coreInstance) == null ? void 0 : d.deleteSeal({
1221
- ContainerName: (c = (i = t == null ? void 0 : t.cert) == null ? void 0 : i.ContainerName) != null ? c : "",
1222
- SealId: (u = n == null ? void 0 : n.SealId) != null ? u : ""
1343
+ return !!(yield (u = this.coreInstance) == null ? void 0 : u.deleteSeal({
1344
+ ContainerName: (l = (o = t == null ? void 0 : t.cert) == null ? void 0 : o.ContainerName) != null ? l : "",
1345
+ SealId: (d = n == null ? void 0 : n.SealId) != null ? d : ""
1223
1346
  }));
1224
1347
  }));
1225
- o(this, "getSealList", (e) => l(this, null, function* () {
1226
- var r, a;
1227
- const t = yield this.getSignatureCert(e), n = yield (a = this.coreInstance) == null ? void 0 : a.getSealList({
1228
- ContainerName: (r = t == null ? void 0 : t.ContainerName) != null ? r : "",
1348
+ a(this, "getSealList", (e) => c(this, null, function* () {
1349
+ var i, r;
1350
+ const t = yield this.getSignatureCert(e), n = yield (r = this.coreInstance) == null ? void 0 : r.getSealList({
1351
+ ContainerName: (i = t == null ? void 0 : t.ContainerName) != null ? i : "",
1229
1352
  IsLogin: "Y"
1230
1353
  });
1231
1354
  return {
@@ -1233,236 +1356,272 @@ const L = class L {
1233
1356
  data: n
1234
1357
  };
1235
1358
  }));
1236
- o(this, "getSealInfo", (e) => l(this, null, function* () {
1237
- var a, i, c, u, d, C, f;
1359
+ a(this, "getSealInfo", (e) => c(this, null, function* () {
1360
+ var r, o, l, d, u, C, g;
1238
1361
  const t = yield this.getSealList(e);
1239
- if (!((a = t == null ? void 0 : t.data) != null && a.length))
1362
+ if (!((r = t == null ? void 0 : t.data) != null && r.length))
1240
1363
  return Promise.reject({
1241
- errCode: -1,
1364
+ errCode: q,
1242
1365
  msg: "暂无印章"
1243
1366
  });
1244
- const n = ((i = t == null ? void 0 : t.data) == null ? void 0 : i.length) > 1 ? yield J.open({
1367
+ const n = ((o = t == null ? void 0 : t.data) == null ? void 0 : o.length) > 1 ? yield O.open({
1245
1368
  title: "选择印章",
1246
1369
  data: t == null ? void 0 : t.data,
1247
- columns: me,
1248
- theme: (c = this.gwsConfig) == null ? void 0 : c.theme
1249
- }) : t == null ? void 0 : t.data[0], r = yield (f = this.coreInstance) == null ? void 0 : f.getSealInfo({
1250
- ContainerName: (d = (u = t == null ? void 0 : t.cert) == null ? void 0 : u.ContainerName) != null ? d : "",
1370
+ columns: Ee,
1371
+ theme: (l = this.gwsConfig) == null ? void 0 : l.theme
1372
+ }) : t == null ? void 0 : t.data[0], i = yield (g = this.coreInstance) == null ? void 0 : g.getSealInfo({
1373
+ ContainerName: (u = (d = t == null ? void 0 : t.cert) == null ? void 0 : d.ContainerName) != null ? u : "",
1251
1374
  SealId: (C = n == null ? void 0 : n.SealId) != null ? C : ""
1252
1375
  });
1253
- return r == null ? void 0 : r[0];
1376
+ return i == null ? void 0 : i[0];
1254
1377
  }));
1255
- o(this, "getTPSealList", (e, t) => l(this, null, function* () {
1256
- var a, i;
1257
- const n = yield this.getSignatureCert(t), r = yield (i = this.coreInstance) == null ? void 0 : i.getTPSealList({
1258
- ContainerName: (a = n == null ? void 0 : n.ContainerName) != null ? a : "",
1378
+ a(this, "getTPSealList", (e, t) => c(this, null, function* () {
1379
+ var r, o;
1380
+ const n = yield this.getSignatureCert(t), i = yield (o = this.coreInstance) == null ? void 0 : o.getTPSealList({
1381
+ ContainerName: (r = n == null ? void 0 : n.ContainerName) != null ? r : "",
1259
1382
  Vid: e == null ? void 0 : e.Vid
1260
1383
  });
1261
1384
  return {
1262
1385
  cert: n,
1263
- data: r
1386
+ data: i
1264
1387
  };
1265
1388
  }));
1266
- o(this, "getTPSeal", (e, t) => l(this, null, function* () {
1267
- var a, i, c;
1389
+ a(this, "getTPSeal", (e, t) => c(this, null, function* () {
1390
+ var r, o, l;
1268
1391
  const n = yield this.getTPSealList(e, t);
1269
- if (!((a = n == null ? void 0 : n.data) != null && a.length))
1392
+ if (!((r = n == null ? void 0 : n.data) != null && r.length))
1270
1393
  return Promise.reject({
1271
- errCode: -1,
1394
+ errCode: q,
1272
1395
  msg: "暂无印章"
1273
1396
  });
1274
- const r = ((i = n == null ? void 0 : n.data) == null ? void 0 : i.length) === 1 ? n == null ? void 0 : n.data[0] : yield J.open({
1397
+ const i = ((o = n == null ? void 0 : n.data) == null ? void 0 : o.length) === 1 ? n == null ? void 0 : n.data[0] : yield O.open({
1275
1398
  title: "选择印章",
1276
1399
  data: n == null ? void 0 : n.data,
1277
- columns: ft,
1278
- theme: (c = this.gwsConfig) == null ? void 0 : c.theme
1400
+ columns: vt,
1401
+ theme: (l = this.gwsConfig) == null ? void 0 : l.theme
1279
1402
  });
1280
1403
  return {
1281
1404
  cert: n == null ? void 0 : n.cert,
1282
- data: r
1405
+ data: i
1283
1406
  };
1284
1407
  }));
1285
- o(this, "getTPSealPic", (e, t) => l(this, null, function* () {
1286
- var a, i, c, u, d;
1287
- const n = yield this.getTPSeal(e, t), r = yield (d = this.coreInstance) == null ? void 0 : d.getTPSealPic(B(p({
1288
- ContainerName: (i = (a = n == null ? void 0 : n.cert) == null ? void 0 : a.ContainerName) != null ? i : ""
1289
- }, (c = n == null ? void 0 : n.data) != null ? c : {}), {
1290
- FileSize: String((u = n == null ? void 0 : n.data) == null ? void 0 : u.FileSize)
1408
+ a(this, "getTPSealPic", (e, t) => c(this, null, function* () {
1409
+ var r, o, l, d, u;
1410
+ const n = yield this.getTPSeal(e, t), i = yield (u = this.coreInstance) == null ? void 0 : u.getTPSealPic(_(m({
1411
+ ContainerName: (o = (r = n == null ? void 0 : n.cert) == null ? void 0 : r.ContainerName) != null ? o : ""
1412
+ }, (l = n == null ? void 0 : n.data) != null ? l : {}), {
1413
+ FileSize: String((d = n == null ? void 0 : n.data) == null ? void 0 : d.FileSize)
1291
1414
  }));
1292
- return r == null ? void 0 : r[0];
1415
+ return i == null ? void 0 : i[0];
1293
1416
  }));
1294
- o(this, "sm2SignPreprocess1", (e) => l(this, null, function* () {
1295
- var r, a;
1296
- const t = yield this.appendCertBase64(e), n = yield (r = this.coreInstance) == null ? void 0 : r.sm2SignPreprocess1(t);
1297
- return (a = n == null ? void 0 : n[0]) == null ? void 0 : a.Z;
1417
+ a(this, "sm2SignPreprocess1", (e) => c(this, null, function* () {
1418
+ var i, r;
1419
+ const t = yield this.appendCertBase64(e), n = yield (i = this.coreInstance) == null ? void 0 : i.sm2SignPreprocess1(t);
1420
+ return (r = n == null ? void 0 : n[0]) == null ? void 0 : r.Z;
1298
1421
  }));
1299
- o(this, "sm2SignPreprocess2", (e) => l(this, null, function* () {
1300
- var a, i;
1301
- const t = this.base64Encode({ Data: (a = e.Data) != null ? a : "" }), n = yield this.appendCertBase64(e), r = yield (i = this.coreInstance) == null ? void 0 : i.sm2SignPreprocess2({
1422
+ a(this, "sm2SignPreprocess2", (e) => c(this, null, function* () {
1423
+ var r, o;
1424
+ const t = this.base64Encode({ Data: (r = e.Data) != null ? r : "" }), n = yield this.appendCertBase64(e), i = yield (o = this.coreInstance) == null ? void 0 : o.sm2SignPreprocess2({
1302
1425
  CertB64: n.CertB64,
1303
1426
  DataB64: t
1304
1427
  });
1305
- return r == null ? void 0 : r[0].H;
1428
+ return i == null ? void 0 : i[0].H;
1306
1429
  }));
1307
- o(this, "pkcs1HashSign", (e, t) => l(this, null, function* () {
1308
- var a, i, c, u;
1309
- const n = yield this.getSignatureCert(t), r = yield (c = this.coreInstance) == null ? void 0 : c.pkcs1HashSign({
1310
- ContainerName: (a = n == null ? void 0 : n.ContainerName) != null ? a : "",
1430
+ a(this, "pkcs1HashSign", (e, t) => c(this, null, function* () {
1431
+ var r, o, l, d;
1432
+ const n = yield this.getSignatureCert(t), i = yield (l = this.coreInstance) == null ? void 0 : l.pkcs1HashSign({
1433
+ ContainerName: (r = n == null ? void 0 : n.ContainerName) != null ? r : "",
1311
1434
  DataB64: e.DataB64,
1312
- HashAlg: (i = e.HashAlg) != null ? i : "sm3"
1435
+ HashAlg: (o = e.HashAlg) != null ? o : "sm3"
1313
1436
  });
1314
- return (u = r == null ? void 0 : r[0]) == null ? void 0 : u.SignData;
1437
+ return (d = i == null ? void 0 : i[0]) == null ? void 0 : d.SignData;
1315
1438
  }));
1316
- o(this, "pkcs1HashVerifySignature", (e) => l(this, null, function* () {
1317
- var r, a;
1439
+ a(this, "pkcs1HashVerifySignature", (e) => c(this, null, function* () {
1440
+ var i, r;
1318
1441
  const t = yield this.appendCertBase64(e);
1319
- return !!(yield (a = this.coreInstance) == null ? void 0 : a.pkcs1HashVerifySignature(B(p({}, t), {
1320
- HashAlg: (r = t.HashAlg) != null ? r : "sm3"
1442
+ return !!(yield (r = this.coreInstance) == null ? void 0 : r.pkcs1HashVerifySignature(_(m({}, t), {
1443
+ HashAlg: (i = t.HashAlg) != null ? i : "sm3"
1321
1444
  })));
1322
1445
  }));
1323
- o(this, "pkcs7Sign", (e, t) => l(this, null, function* () {
1324
- var i, c, u, d, C;
1325
- const n = (c = e.DataB64) != null ? c : this.base64Encode({ Data: (i = e.Data) != null ? i : "" }), r = yield this.getSignatureCert(t), a = yield (d = this.coreInstance) == null ? void 0 : d.pkcs7Sign(B(p({}, e != null ? e : {}), {
1326
- ContainerName: (u = r == null ? void 0 : r.ContainerName) != null ? u : "",
1446
+ a(this, "pkcs7Sign", (e, t) => c(this, null, function* () {
1447
+ var o, l, d, u, C;
1448
+ const n = (l = e.DataB64) != null ? l : this.base64Encode({ Data: (o = e.Data) != null ? o : "" }), i = yield this.getSignatureCert(t), r = yield (u = this.coreInstance) == null ? void 0 : u.pkcs7Sign(_(m({}, e != null ? e : {}), {
1449
+ ContainerName: (d = i == null ? void 0 : i.ContainerName) != null ? d : "",
1327
1450
  DataB64: n
1328
1451
  }));
1329
- return (C = a == null ? void 0 : a[0]) == null ? void 0 : C.SignData;
1452
+ return (C = r == null ? void 0 : r[0]) == null ? void 0 : C.SignData;
1330
1453
  }));
1331
- o(this, "pkcs7VerifySignature", (e) => l(this, null, function* () {
1332
- var r, a, i;
1333
- const t = (a = e.DataB64) != null ? a : this.base64Encode({ Data: (r = e.Data) != null ? r : "" });
1334
- return !!(yield (i = this.coreInstance) == null ? void 0 : i.pkcs7VerifySignature({
1454
+ a(this, "pkcs7VerifySignature", (e) => c(this, null, function* () {
1455
+ var i, r, o;
1456
+ const t = (r = e.DataB64) != null ? r : this.base64Encode({ Data: (i = e.Data) != null ? i : "" });
1457
+ return !!(yield (o = this.coreInstance) == null ? void 0 : o.pkcs7VerifySignature({
1335
1458
  DataB64: t,
1336
1459
  SignData: e.SignData
1337
1460
  }));
1338
1461
  }));
1339
- o(this, "sm3Hash", (e) => l(this, null, function* () {
1340
- var n, r;
1462
+ a(this, "sm3Hash", (e) => c(this, null, function* () {
1463
+ var n, i;
1341
1464
  const t = yield (n = this.coreInstance) == null ? void 0 : n.sm3Hash(e);
1342
- return (r = t == null ? void 0 : t[0]) == null ? void 0 : r.HashB64;
1465
+ return (i = t == null ? void 0 : t[0]) == null ? void 0 : i.HashB64;
1343
1466
  }));
1344
- o(this, "sm3HexHash", (e) => l(this, null, function* () {
1345
- var n, r;
1467
+ a(this, "sm3HexHash", (e) => c(this, null, function* () {
1468
+ var n, i;
1346
1469
  const t = yield (n = this.coreInstance) == null ? void 0 : n.sm3HexHash(e);
1347
- return (r = t == null ? void 0 : t[0]) == null ? void 0 : r.HashB64;
1470
+ return (i = t == null ? void 0 : t[0]) == null ? void 0 : i.HashB64;
1348
1471
  }));
1349
- o(this, "sm3FileHash", (e) => l(this, null, function* () {
1350
- var n, r;
1472
+ a(this, "sm3FileHash", (e) => c(this, null, function* () {
1473
+ var n, i;
1351
1474
  const t = yield (n = this.coreInstance) == null ? void 0 : n.sm3FileHash(e);
1352
- return (r = t == null ? void 0 : t[0]) == null ? void 0 : r.HashB64;
1475
+ return (i = t == null ? void 0 : t[0]) == null ? void 0 : i.HashB64;
1353
1476
  }));
1354
- o(this, "sm3HashEncryption", (e) => l(this, null, function* () {
1355
- var a, i, c, u, d, C;
1356
- const t = (i = e.DataB64) != null ? i : this.base64Encode({ Data: (a = e.Data) != null ? a : "" }), n = (u = e.KeyB64) != null ? u : this.base64Encode({ Data: (c = e.Key) != null ? c : "" }), r = yield (d = this.coreInstance) == null ? void 0 : d.sm3HashEncryption({
1477
+ a(this, "sm3HashEncryption", (e) => c(this, null, function* () {
1478
+ var r, o, l, d, u, C;
1479
+ const t = (o = e.DataB64) != null ? o : this.base64Encode({ Data: (r = e.Data) != null ? r : "" }), n = (d = e.KeyB64) != null ? d : this.base64Encode({ Data: (l = e.Key) != null ? l : "" }), i = yield (u = this.coreInstance) == null ? void 0 : u.sm3HashEncryption({
1357
1480
  dataB64: t,
1358
1481
  keyB64: n,
1359
1482
  alg: "sm3"
1360
1483
  });
1361
- return (C = r == null ? void 0 : r[0]) == null ? void 0 : C.DataB64;
1484
+ return (C = i == null ? void 0 : i[0]) == null ? void 0 : C.DataB64;
1362
1485
  }));
1363
- o(this, "pkcs7Encryption", (e) => l(this, null, function* () {
1364
- var r, a, i, c;
1486
+ a(this, "pkcs7Encryption", (e) => c(this, null, function* () {
1487
+ var i, r, o, l;
1365
1488
  if (!e.CertB64List) {
1366
- const u = yield this.getEncryptionCert();
1367
- e.CertB64List = u == null ? void 0 : u.CertB64;
1489
+ const d = yield this.getEncryptionCert();
1490
+ e.CertB64List = d == null ? void 0 : d.CertB64;
1368
1491
  }
1369
- const t = (a = e.DataB64) != null ? a : this.base64Encode({ Data: (r = e.Data) != null ? r : "" }), n = yield (i = this.coreInstance) == null ? void 0 : i.pkcs7Encryption({
1492
+ const t = (r = e.DataB64) != null ? r : this.base64Encode({ Data: (i = e.Data) != null ? i : "" }), n = yield (o = this.coreInstance) == null ? void 0 : o.pkcs7Encryption({
1370
1493
  DataB64: t,
1371
1494
  CertB64List: e.CertB64List
1372
1495
  });
1373
- return (c = n == null ? void 0 : n[0]) == null ? void 0 : c.DataB64;
1496
+ return (l = n == null ? void 0 : n[0]) == null ? void 0 : l.DataB64;
1374
1497
  }));
1375
- o(this, "pkcs7Decryption", (e) => l(this, null, function* () {
1376
- var a, i;
1377
- const t = yield this.getEncryptionCert(), n = yield (a = this.coreInstance) == null ? void 0 : a.pkcs7Decryption(B(p({}, e != null ? e : {}), {
1498
+ a(this, "pkcs7Decryption", (e) => c(this, null, function* () {
1499
+ var r, o;
1500
+ const t = yield this.getEncryptionCert(), n = yield (r = this.coreInstance) == null ? void 0 : r.pkcs7Decryption(_(m({}, e != null ? e : {}), {
1378
1501
  ContainerName: t == null ? void 0 : t.ContainerName
1379
- })), r = (i = n == null ? void 0 : n[0]) == null ? void 0 : i.DataB64;
1380
- return e.shouldDecodeBase64 ? this.base64Decode({ DataB64: r }) : r;
1502
+ })), i = (o = n == null ? void 0 : n[0]) == null ? void 0 : o.DataB64;
1503
+ return e.shouldDecodeBase64 ? this.base64Decode({ DataB64: i }) : i;
1381
1504
  }));
1382
- o(this, "pkcs7FileEncryption", (e) => l(this, null, function* () {
1383
- var r, a;
1384
- const t = yield this.appendCertBase64(e, !1), n = yield (r = this.coreInstance) == null ? void 0 : r.pkcs7FileEncryption(t);
1385
- return (a = n == null ? void 0 : n[0]) == null ? void 0 : a.DataB64;
1505
+ a(this, "pkcs7FileEncryption", (e) => c(this, null, function* () {
1506
+ var i, r;
1507
+ const t = yield this.appendCertBase64(e, !1), n = yield (i = this.coreInstance) == null ? void 0 : i.pkcs7FileEncryption(t);
1508
+ return (r = n == null ? void 0 : n[0]) == null ? void 0 : r.DataB64;
1386
1509
  }));
1387
- o(this, "pkcs7FileDecryption", (e) => l(this, null, function* () {
1388
- var r, a, i;
1389
- const t = yield this.getEncryptionCert(), n = yield (a = this.coreInstance) == null ? void 0 : a.pkcs7FileDecryption({
1510
+ a(this, "pkcs7FileDecryption", (e) => c(this, null, function* () {
1511
+ var i, r, o;
1512
+ const t = yield this.getEncryptionCert(), n = yield (r = this.coreInstance) == null ? void 0 : r.pkcs7FileDecryption({
1390
1513
  SrcFile: e.SrcFile,
1391
- DstFile: (r = e.DstFile) != null ? r : e.SrcFile.slice(0, -4),
1514
+ DstFile: (i = e.DstFile) != null ? i : e.SrcFile.slice(0, -4),
1392
1515
  ContainerName: t == null ? void 0 : t.ContainerName
1393
1516
  });
1394
- return (i = n == null ? void 0 : n[0]) == null ? void 0 : i.DataB64;
1517
+ return (o = n == null ? void 0 : n[0]) == null ? void 0 : o.DataB64;
1395
1518
  }));
1396
- o(this, "asymmetricEncryption", (e) => l(this, null, function* () {
1397
- var r, a;
1398
- const t = yield this.appendCertBase64(e, !1), n = yield (r = this.coreInstance) == null ? void 0 : r.asymmetricEncryption(t);
1399
- return (a = n == null ? void 0 : n[0]) == null ? void 0 : a.Data;
1519
+ a(this, "asymmetricEncryption", (e) => c(this, null, function* () {
1520
+ var i, r;
1521
+ const t = yield this.appendCertBase64(e, !1), n = yield (i = this.coreInstance) == null ? void 0 : i.asymmetricEncryption(t);
1522
+ return (r = n == null ? void 0 : n[0]) == null ? void 0 : r.Data;
1400
1523
  }));
1401
- o(this, "asymmetricDecryption", (e, t) => l(this, null, function* () {
1402
- var a, i;
1403
- const n = yield this.getEncryptionCert(t), r = yield (a = this.coreInstance) == null ? void 0 : a.asymmetricDecryption(B(p({}, e != null ? e : {}), {
1524
+ a(this, "asymmetricDecryption", (e, t) => c(this, null, function* () {
1525
+ var r, o;
1526
+ const n = yield this.getEncryptionCert(t), i = yield (r = this.coreInstance) == null ? void 0 : r.asymmetricDecryption(_(m({}, e != null ? e : {}), {
1404
1527
  ContainerName: n == null ? void 0 : n.ContainerName
1405
1528
  }));
1406
- return (i = r == null ? void 0 : r[0]) == null ? void 0 : i.Data;
1529
+ return (o = i == null ? void 0 : i[0]) == null ? void 0 : o.Data;
1407
1530
  }));
1408
- o(this, "sm4Encryption", (e) => l(this, null, function* () {
1531
+ a(this, "sm4Encryption", (e) => c(this, null, function* () {
1409
1532
  var n;
1410
1533
  const t = yield (n = this.coreInstance) == null ? void 0 : n.sm4Encryption(e);
1411
1534
  return t == null ? void 0 : t[0];
1412
1535
  }));
1413
- o(this, "sm4Decryption", (e) => l(this, null, function* () {
1414
- var n, r;
1536
+ a(this, "sm4Decryption", (e) => c(this, null, function* () {
1537
+ var n, i;
1415
1538
  const t = yield (n = this.coreInstance) == null ? void 0 : n.sm4Decryption(e);
1416
- return (r = t == null ? void 0 : t[0]) == null ? void 0 : r.Data;
1539
+ return (i = t == null ? void 0 : t[0]) == null ? void 0 : i.Data;
1417
1540
  }));
1418
- o(this, "getCertInfo", (e) => l(this, null, function* () {
1419
- var n, r;
1541
+ a(this, "getCertInfo", (e) => c(this, null, function* () {
1542
+ var n, i;
1420
1543
  const t = yield (n = this.coreInstance) == null ? void 0 : n.getCertInfo(e);
1421
- return p({}, (r = t == null ? void 0 : t[0]) != null ? r : {});
1544
+ return m({}, (i = t == null ? void 0 : t[0]) != null ? i : {});
1422
1545
  }));
1423
- o(this, "getCertInfoByOid", (e) => l(this, null, function* () {
1424
- var n, r;
1425
- const t = yield (n = this.coreInstance) == null ? void 0 : n.getCertInfoByOid(p({}, e != null ? e : {}));
1426
- return (r = t == null ? void 0 : t[0]) == null ? void 0 : r.OidValue;
1546
+ a(this, "getCertInfoByOid", (e) => c(this, null, function* () {
1547
+ var n, i;
1548
+ const t = yield (n = this.coreInstance) == null ? void 0 : n.getCertInfoByOid(m({}, e != null ? e : {}));
1549
+ return (i = t == null ? void 0 : t[0]) == null ? void 0 : i.OidValue;
1427
1550
  }));
1428
- o(this, "getSealVendor", (e) => l(this, null, function* () {
1429
- var r;
1430
- const t = yield this.getSignatureCert(e), n = yield (r = this.coreInstance) == null ? void 0 : r.getSealVendor({
1551
+ a(this, "getSealVendor", (e) => c(this, null, function* () {
1552
+ var i;
1553
+ const t = yield this.getSignatureCert(e), n = yield (i = this.coreInstance) == null ? void 0 : i.getSealVendor({
1431
1554
  ContainerName: t == null ? void 0 : t.ContainerName
1432
1555
  });
1433
1556
  return n == null ? void 0 : n[0];
1434
1557
  }));
1435
- o(this, "deleteAllSealByVendor", (e, t) => l(this, null, function* () {
1436
- var a;
1437
- const n = yield this.getSignatureCert(t), r = yield (a = this.coreInstance) == null ? void 0 : a.deleteAllSealByVendor(B(p({}, e != null ? e : {}), {
1558
+ a(this, "deleteAllSealByVendor", (e, t) => c(this, null, function* () {
1559
+ var r;
1560
+ const n = yield this.getSignatureCert(t), i = yield (r = this.coreInstance) == null ? void 0 : r.deleteAllSealByVendor(_(m({}, e != null ? e : {}), {
1561
+ ContainerName: n == null ? void 0 : n.ContainerName
1562
+ }));
1563
+ return i == null ? void 0 : i[0];
1564
+ }));
1565
+ a(this, "getUKeyList", (e) => c(this, null, function* () {
1566
+ var i;
1567
+ if (e) return e;
1568
+ const t = yield (i = this.coreInstance) == null ? void 0 : i.getUKeyList();
1569
+ return yield O.open({
1570
+ title: "选择介质",
1571
+ data: t,
1572
+ columns: kt
1573
+ });
1574
+ }));
1575
+ a(this, "getUKeyInfo", (e) => c(this, null, function* () {
1576
+ var i;
1577
+ const t = yield this.getUKeyList(e), n = yield (i = this.coreInstance) == null ? void 0 : i.getUKeyInfo({
1578
+ manu: t == null ? void 0 : t.manu,
1579
+ sn: t == null ? void 0 : t.sn
1580
+ });
1581
+ return n == null ? void 0 : n[0];
1582
+ }));
1583
+ a(this, "applyCert", (e, t) => c(this, null, function* () {
1584
+ var o;
1585
+ const n = yield this.getUKeyList(t), i = yield this.getUKeyInfo(n);
1586
+ return yield (o = this.coreInstance) == null ? void 0 : o.applyCert(_(m({}, e != null ? e : {}), {
1587
+ manu: i == null ? void 0 : i.manu,
1588
+ sn: i == null ? void 0 : i.sn,
1589
+ ContainerName: i == null ? void 0 : i.keyid
1590
+ }));
1591
+ }));
1592
+ a(this, "resetPin", (e, t) => c(this, null, function* () {
1593
+ var r;
1594
+ const n = yield this.getSignatureCert(t);
1595
+ return yield (r = this.coreInstance) == null ? void 0 : r.resetPin(_(m({}, e != null ? e : {}), {
1596
+ manu: n == null ? void 0 : n.manu,
1597
+ sn: n == null ? void 0 : n.sn,
1438
1598
  ContainerName: n == null ? void 0 : n.ContainerName
1439
1599
  }));
1440
- return r == null ? void 0 : r[0];
1441
1600
  }));
1442
- return L.instance && !(e != null && e.isCreateNew) ? L.instance : (this.createGwsCore(e), L.instance = this, this);
1601
+ return $.instance && !(e != null && e.isCreateNew) ? $.instance : (this.createGwsCore(e), $.instance = this, this);
1443
1602
  }
1444
1603
  };
1445
- o(L, "instance", null);
1446
- let Z = L;
1447
- function wt(s) {
1604
+ a($, "instance", null);
1605
+ let H = $;
1606
+ function _t(s) {
1448
1607
  return new Promise((e, t) => {
1449
- if (Z.instance && !(s != null && s.isCreateNew))
1450
- e(Z.instance);
1608
+ if (H.instance && !(s != null && s.isCreateNew))
1609
+ e(H.instance);
1451
1610
  else {
1452
- const n = new Z(B(p({}, s != null ? s : {}), {
1453
- onOpen(r) {
1454
- var a;
1455
- e(n), (a = s == null ? void 0 : s.onOpen) == null || a.call(s, r);
1611
+ const n = new H(_(m({}, s != null ? s : {}), {
1612
+ onOpen(i) {
1613
+ var r;
1614
+ e(n), (r = s == null ? void 0 : s.onOpen) == null || r.call(s, i);
1456
1615
  },
1457
- onClose(r) {
1458
- var a;
1459
- t(r), (a = s == null ? void 0 : s.onClose) == null || a.call(s, r);
1616
+ onClose(i) {
1617
+ var r;
1618
+ t(i), (r = s == null ? void 0 : s.onClose) == null || r.call(s, i);
1460
1619
  }
1461
1620
  }));
1462
1621
  }
1463
1622
  });
1464
1623
  }
1465
1624
  export {
1466
- Z as GwsService,
1467
- wt as createService
1625
+ H as GwsService,
1626
+ _t as createService
1468
1627
  };