zigap-utils 0.0.461 → 0.0.462
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/package.json +2 -2
- package/dist/App.d.ts +0 -2
- package/dist/components/AddressProvideQR/AddressProvideQR.d.ts +0 -4
- package/dist/components/AddressProvideQR/AddressProvideQR.types.d.ts +0 -15
- package/dist/components/AddressProvideQR/index.d.ts +0 -2
- package/dist/components/LoginQR/LoginQR.d.ts +0 -4
- package/dist/components/LoginQR/LoginQR.types.d.ts +0 -33
- package/dist/components/LoginQR/index.d.ts +0 -2
- package/dist/components/index.d.ts +0 -2
- package/dist/cryptoUtils.cjs.js +0 -1
- package/dist/cryptoUtils.es.js +0 -5492
- package/dist/index.cjs.js +0 -42
- package/dist/index.cjs2.js +0 -14
- package/dist/index.cjs3.js +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.es.js +0 -1382
- package/dist/index.es2.js +0 -5025
- package/dist/index.es3.js +0 -2303
- package/dist/main.d.ts +0 -1
- package/dist/utils/addressProvide.d.ts +0 -9
- package/dist/utils/cryptoUtils.d.ts +0 -19
- package/dist/utils/login.d.ts +0 -11
- package/dist/utils/socketInstance.d.ts +0 -9
- package/dist/utils/types.d.ts +0 -23
- package/dist/xphere/enc.d.ts +0 -12
- package/dist/xphere/index.d.ts +0 -4
- package/dist/xphere/sign.d.ts +0 -18
- package/dist/xphere/util.d.ts +0 -10
- package/dist/xphere/validation.d.ts +0 -10
- package/dist/xphere.cjs.js +0 -1
- package/dist/xphere.es.js +0 -32
- package/dist/zigap/index.d.ts +0 -2
- package/dist/zigap/qr.d.ts +0 -7
- package/dist/zigap/types.d.ts +0 -4
- package/dist/zigap.cjs.js +0 -1
- package/dist/zigap.es.js +0 -5
package/dist/index.es.js
DELETED
|
@@ -1,1382 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import * as St from "react";
|
|
3
|
-
import ae, { useRef as ze, useState as ye, useEffect as W } from "react";
|
|
4
|
-
import { g as Tt } from "./index.es2.js";
|
|
5
|
-
import { c as Qe } from "./cryptoUtils.es.js";
|
|
6
|
-
import { S as j, Q as Ge } from "./index.es3.js";
|
|
7
|
-
var Ee = { exports: {} }, q = {};
|
|
8
|
-
const Ke = /* @__PURE__ */ Tt(St);
|
|
9
|
-
/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.production.min.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/
|
|
18
|
-
var Ye;
|
|
19
|
-
function Ot() {
|
|
20
|
-
if (Ye)
|
|
21
|
-
return q;
|
|
22
|
-
Ye = 1;
|
|
23
|
-
var v = Ke, i = Symbol.for("react.element"), u = Symbol.for("react.fragment"), l = Object.prototype.hasOwnProperty, m = v.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, h = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
24
|
-
function p(_, t, r) {
|
|
25
|
-
var n, o = {}, a = null, d = null;
|
|
26
|
-
r !== void 0 && (a = "" + r), t.key !== void 0 && (a = "" + t.key), t.ref !== void 0 && (d = t.ref);
|
|
27
|
-
for (n in t)
|
|
28
|
-
l.call(t, n) && !h.hasOwnProperty(n) && (o[n] = t[n]);
|
|
29
|
-
if (_ && _.defaultProps)
|
|
30
|
-
for (n in t = _.defaultProps, t)
|
|
31
|
-
o[n] === void 0 && (o[n] = t[n]);
|
|
32
|
-
return { $$typeof: i, type: _, key: a, ref: d, props: o, _owner: m.current };
|
|
33
|
-
}
|
|
34
|
-
return q.Fragment = u, q.jsx = p, q.jsxs = p, q;
|
|
35
|
-
}
|
|
36
|
-
var X = {};
|
|
37
|
-
/**
|
|
38
|
-
* @license React
|
|
39
|
-
* react-jsx-runtime.development.js
|
|
40
|
-
*
|
|
41
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
42
|
-
*
|
|
43
|
-
* This source code is licensed under the MIT license found in the
|
|
44
|
-
* LICENSE file in the root directory of this source tree.
|
|
45
|
-
*/
|
|
46
|
-
var Ve;
|
|
47
|
-
function It() {
|
|
48
|
-
return Ve || (Ve = 1, process.env.NODE_ENV !== "production" && function() {
|
|
49
|
-
var v = Ke, i = Symbol.for("react.element"), u = Symbol.for("react.portal"), l = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), h = Symbol.for("react.profiler"), p = Symbol.for("react.provider"), _ = Symbol.for("react.context"), t = Symbol.for("react.forward_ref"), r = Symbol.for("react.suspense"), n = Symbol.for("react.suspense_list"), o = Symbol.for("react.memo"), a = Symbol.for("react.lazy"), d = Symbol.for("react.offscreen"), f = Symbol.iterator, y = "@@iterator";
|
|
50
|
-
function E(e) {
|
|
51
|
-
if (e === null || typeof e != "object")
|
|
52
|
-
return null;
|
|
53
|
-
var s = f && e[f] || e[y];
|
|
54
|
-
return typeof s == "function" ? s : null;
|
|
55
|
-
}
|
|
56
|
-
var O = v.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
57
|
-
function b(e) {
|
|
58
|
-
{
|
|
59
|
-
for (var s = arguments.length, c = new Array(s > 1 ? s - 1 : 0), g = 1; g < s; g++)
|
|
60
|
-
c[g - 1] = arguments[g];
|
|
61
|
-
R("error", e, c);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
function R(e, s, c) {
|
|
65
|
-
{
|
|
66
|
-
var g = O.ReactDebugCurrentFrame, P = g.getStackAddendum();
|
|
67
|
-
P !== "" && (s += "%s", c = c.concat([P]));
|
|
68
|
-
var A = c.map(function(C) {
|
|
69
|
-
return String(C);
|
|
70
|
-
});
|
|
71
|
-
A.unshift("Warning: " + s), Function.prototype.apply.call(console[e], console, A);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
var M = !1, I = !1, U = !1, D = !1, B = !1, Q;
|
|
75
|
-
Q = Symbol.for("react.module.reference");
|
|
76
|
-
function Z(e) {
|
|
77
|
-
return !!(typeof e == "string" || typeof e == "function" || e === l || e === h || B || e === m || e === r || e === n || D || e === d || M || I || U || typeof e == "object" && e !== null && (e.$$typeof === a || e.$$typeof === o || e.$$typeof === p || e.$$typeof === _ || e.$$typeof === t || // This needs to include all possible module reference object
|
|
78
|
-
// types supported by any Flight configuration anywhere since
|
|
79
|
-
// we don't know which Flight build this will end up being used
|
|
80
|
-
// with.
|
|
81
|
-
e.$$typeof === Q || e.getModuleId !== void 0));
|
|
82
|
-
}
|
|
83
|
-
function ee(e, s, c) {
|
|
84
|
-
var g = e.displayName;
|
|
85
|
-
if (g)
|
|
86
|
-
return g;
|
|
87
|
-
var P = s.displayName || s.name || "";
|
|
88
|
-
return P !== "" ? c + "(" + P + ")" : c;
|
|
89
|
-
}
|
|
90
|
-
function te(e) {
|
|
91
|
-
return e.displayName || "Context";
|
|
92
|
-
}
|
|
93
|
-
function F(e) {
|
|
94
|
-
if (e == null)
|
|
95
|
-
return null;
|
|
96
|
-
if (typeof e.tag == "number" && b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
97
|
-
return e.displayName || e.name || null;
|
|
98
|
-
if (typeof e == "string")
|
|
99
|
-
return e;
|
|
100
|
-
switch (e) {
|
|
101
|
-
case l:
|
|
102
|
-
return "Fragment";
|
|
103
|
-
case u:
|
|
104
|
-
return "Portal";
|
|
105
|
-
case h:
|
|
106
|
-
return "Profiler";
|
|
107
|
-
case m:
|
|
108
|
-
return "StrictMode";
|
|
109
|
-
case r:
|
|
110
|
-
return "Suspense";
|
|
111
|
-
case n:
|
|
112
|
-
return "SuspenseList";
|
|
113
|
-
}
|
|
114
|
-
if (typeof e == "object")
|
|
115
|
-
switch (e.$$typeof) {
|
|
116
|
-
case _:
|
|
117
|
-
var s = e;
|
|
118
|
-
return te(s) + ".Consumer";
|
|
119
|
-
case p:
|
|
120
|
-
var c = e;
|
|
121
|
-
return te(c._context) + ".Provider";
|
|
122
|
-
case t:
|
|
123
|
-
return ee(e, e.render, "ForwardRef");
|
|
124
|
-
case o:
|
|
125
|
-
var g = e.displayName || null;
|
|
126
|
-
return g !== null ? g : F(e.type) || "Memo";
|
|
127
|
-
case a: {
|
|
128
|
-
var P = e, A = P._payload, C = P._init;
|
|
129
|
-
try {
|
|
130
|
-
return F(C(A));
|
|
131
|
-
} catch {
|
|
132
|
-
return null;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
return null;
|
|
137
|
-
}
|
|
138
|
-
var x = Object.assign, $ = 0, Re, we, _e, Ce, be, Pe, Ae;
|
|
139
|
-
function Me() {
|
|
140
|
-
}
|
|
141
|
-
Me.__reactDisabledLog = !0;
|
|
142
|
-
function tt() {
|
|
143
|
-
{
|
|
144
|
-
if ($ === 0) {
|
|
145
|
-
Re = console.log, we = console.info, _e = console.warn, Ce = console.error, be = console.group, Pe = console.groupCollapsed, Ae = console.groupEnd;
|
|
146
|
-
var e = {
|
|
147
|
-
configurable: !0,
|
|
148
|
-
enumerable: !0,
|
|
149
|
-
value: Me,
|
|
150
|
-
writable: !0
|
|
151
|
-
};
|
|
152
|
-
Object.defineProperties(console, {
|
|
153
|
-
info: e,
|
|
154
|
-
log: e,
|
|
155
|
-
warn: e,
|
|
156
|
-
error: e,
|
|
157
|
-
group: e,
|
|
158
|
-
groupCollapsed: e,
|
|
159
|
-
groupEnd: e
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
$++;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
function rt() {
|
|
166
|
-
{
|
|
167
|
-
if ($--, $ === 0) {
|
|
168
|
-
var e = {
|
|
169
|
-
configurable: !0,
|
|
170
|
-
enumerable: !0,
|
|
171
|
-
writable: !0
|
|
172
|
-
};
|
|
173
|
-
Object.defineProperties(console, {
|
|
174
|
-
log: x({}, e, {
|
|
175
|
-
value: Re
|
|
176
|
-
}),
|
|
177
|
-
info: x({}, e, {
|
|
178
|
-
value: we
|
|
179
|
-
}),
|
|
180
|
-
warn: x({}, e, {
|
|
181
|
-
value: _e
|
|
182
|
-
}),
|
|
183
|
-
error: x({}, e, {
|
|
184
|
-
value: Ce
|
|
185
|
-
}),
|
|
186
|
-
group: x({}, e, {
|
|
187
|
-
value: be
|
|
188
|
-
}),
|
|
189
|
-
groupCollapsed: x({}, e, {
|
|
190
|
-
value: Pe
|
|
191
|
-
}),
|
|
192
|
-
groupEnd: x({}, e, {
|
|
193
|
-
value: Ae
|
|
194
|
-
})
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
$ < 0 && b("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
var ue = O.ReactCurrentDispatcher, ce;
|
|
201
|
-
function re(e, s, c) {
|
|
202
|
-
{
|
|
203
|
-
if (ce === void 0)
|
|
204
|
-
try {
|
|
205
|
-
throw Error();
|
|
206
|
-
} catch (P) {
|
|
207
|
-
var g = P.stack.trim().match(/\n( *(at )?)/);
|
|
208
|
-
ce = g && g[1] || "";
|
|
209
|
-
}
|
|
210
|
-
return `
|
|
211
|
-
` + ce + e;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
var fe = !1, ne;
|
|
215
|
-
{
|
|
216
|
-
var nt = typeof WeakMap == "function" ? WeakMap : Map;
|
|
217
|
-
ne = new nt();
|
|
218
|
-
}
|
|
219
|
-
function Se(e, s) {
|
|
220
|
-
if (!e || fe)
|
|
221
|
-
return "";
|
|
222
|
-
{
|
|
223
|
-
var c = ne.get(e);
|
|
224
|
-
if (c !== void 0)
|
|
225
|
-
return c;
|
|
226
|
-
}
|
|
227
|
-
var g;
|
|
228
|
-
fe = !0;
|
|
229
|
-
var P = Error.prepareStackTrace;
|
|
230
|
-
Error.prepareStackTrace = void 0;
|
|
231
|
-
var A;
|
|
232
|
-
A = ue.current, ue.current = null, tt();
|
|
233
|
-
try {
|
|
234
|
-
if (s) {
|
|
235
|
-
var C = function() {
|
|
236
|
-
throw Error();
|
|
237
|
-
};
|
|
238
|
-
if (Object.defineProperty(C.prototype, "props", {
|
|
239
|
-
set: function() {
|
|
240
|
-
throw Error();
|
|
241
|
-
}
|
|
242
|
-
}), typeof Reflect == "object" && Reflect.construct) {
|
|
243
|
-
try {
|
|
244
|
-
Reflect.construct(C, []);
|
|
245
|
-
} catch (k) {
|
|
246
|
-
g = k;
|
|
247
|
-
}
|
|
248
|
-
Reflect.construct(e, [], C);
|
|
249
|
-
} else {
|
|
250
|
-
try {
|
|
251
|
-
C.call();
|
|
252
|
-
} catch (k) {
|
|
253
|
-
g = k;
|
|
254
|
-
}
|
|
255
|
-
e.call(C.prototype);
|
|
256
|
-
}
|
|
257
|
-
} else {
|
|
258
|
-
try {
|
|
259
|
-
throw Error();
|
|
260
|
-
} catch (k) {
|
|
261
|
-
g = k;
|
|
262
|
-
}
|
|
263
|
-
e();
|
|
264
|
-
}
|
|
265
|
-
} catch (k) {
|
|
266
|
-
if (k && g && typeof k.stack == "string") {
|
|
267
|
-
for (var w = k.stack.split(`
|
|
268
|
-
`), N = g.stack.split(`
|
|
269
|
-
`), S = w.length - 1, T = N.length - 1; S >= 1 && T >= 0 && w[S] !== N[T]; )
|
|
270
|
-
T--;
|
|
271
|
-
for (; S >= 1 && T >= 0; S--, T--)
|
|
272
|
-
if (w[S] !== N[T]) {
|
|
273
|
-
if (S !== 1 || T !== 1)
|
|
274
|
-
do
|
|
275
|
-
if (S--, T--, T < 0 || w[S] !== N[T]) {
|
|
276
|
-
var L = `
|
|
277
|
-
` + w[S].replace(" at new ", " at ");
|
|
278
|
-
return e.displayName && L.includes("<anonymous>") && (L = L.replace("<anonymous>", e.displayName)), typeof e == "function" && ne.set(e, L), L;
|
|
279
|
-
}
|
|
280
|
-
while (S >= 1 && T >= 0);
|
|
281
|
-
break;
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
} finally {
|
|
285
|
-
fe = !1, ue.current = A, rt(), Error.prepareStackTrace = P;
|
|
286
|
-
}
|
|
287
|
-
var H = e ? e.displayName || e.name : "", z = H ? re(H) : "";
|
|
288
|
-
return typeof e == "function" && ne.set(e, z), z;
|
|
289
|
-
}
|
|
290
|
-
function ot(e, s, c) {
|
|
291
|
-
return Se(e, !1);
|
|
292
|
-
}
|
|
293
|
-
function it(e) {
|
|
294
|
-
var s = e.prototype;
|
|
295
|
-
return !!(s && s.isReactComponent);
|
|
296
|
-
}
|
|
297
|
-
function oe(e, s, c) {
|
|
298
|
-
if (e == null)
|
|
299
|
-
return "";
|
|
300
|
-
if (typeof e == "function")
|
|
301
|
-
return Se(e, it(e));
|
|
302
|
-
if (typeof e == "string")
|
|
303
|
-
return re(e);
|
|
304
|
-
switch (e) {
|
|
305
|
-
case r:
|
|
306
|
-
return re("Suspense");
|
|
307
|
-
case n:
|
|
308
|
-
return re("SuspenseList");
|
|
309
|
-
}
|
|
310
|
-
if (typeof e == "object")
|
|
311
|
-
switch (e.$$typeof) {
|
|
312
|
-
case t:
|
|
313
|
-
return ot(e.render);
|
|
314
|
-
case o:
|
|
315
|
-
return oe(e.type, s, c);
|
|
316
|
-
case a: {
|
|
317
|
-
var g = e, P = g._payload, A = g._init;
|
|
318
|
-
try {
|
|
319
|
-
return oe(A(P), s, c);
|
|
320
|
-
} catch {
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
return "";
|
|
325
|
-
}
|
|
326
|
-
var G = Object.prototype.hasOwnProperty, Te = {}, Oe = O.ReactDebugCurrentFrame;
|
|
327
|
-
function ie(e) {
|
|
328
|
-
if (e) {
|
|
329
|
-
var s = e._owner, c = oe(e.type, e._source, s ? s.type : null);
|
|
330
|
-
Oe.setExtraStackFrame(c);
|
|
331
|
-
} else
|
|
332
|
-
Oe.setExtraStackFrame(null);
|
|
333
|
-
}
|
|
334
|
-
function at(e, s, c, g, P) {
|
|
335
|
-
{
|
|
336
|
-
var A = Function.call.bind(G);
|
|
337
|
-
for (var C in e)
|
|
338
|
-
if (A(e, C)) {
|
|
339
|
-
var w = void 0;
|
|
340
|
-
try {
|
|
341
|
-
if (typeof e[C] != "function") {
|
|
342
|
-
var N = Error((g || "React class") + ": " + c + " type `" + C + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[C] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
343
|
-
throw N.name = "Invariant Violation", N;
|
|
344
|
-
}
|
|
345
|
-
w = e[C](s, C, g, c, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
346
|
-
} catch (S) {
|
|
347
|
-
w = S;
|
|
348
|
-
}
|
|
349
|
-
w && !(w instanceof Error) && (ie(P), b("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", g || "React class", c, C, typeof w), ie(null)), w instanceof Error && !(w.message in Te) && (Te[w.message] = !0, ie(P), b("Failed %s type: %s", c, w.message), ie(null));
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
var st = Array.isArray;
|
|
354
|
-
function de(e) {
|
|
355
|
-
return st(e);
|
|
356
|
-
}
|
|
357
|
-
function lt(e) {
|
|
358
|
-
{
|
|
359
|
-
var s = typeof Symbol == "function" && Symbol.toStringTag, c = s && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
360
|
-
return c;
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
function ut(e) {
|
|
364
|
-
try {
|
|
365
|
-
return Ie(e), !1;
|
|
366
|
-
} catch {
|
|
367
|
-
return !0;
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
function Ie(e) {
|
|
371
|
-
return "" + e;
|
|
372
|
-
}
|
|
373
|
-
function Ne(e) {
|
|
374
|
-
if (ut(e))
|
|
375
|
-
return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", lt(e)), Ie(e);
|
|
376
|
-
}
|
|
377
|
-
var K = O.ReactCurrentOwner, ct = {
|
|
378
|
-
key: !0,
|
|
379
|
-
ref: !0,
|
|
380
|
-
__self: !0,
|
|
381
|
-
__source: !0
|
|
382
|
-
}, ke, Fe, he;
|
|
383
|
-
he = {};
|
|
384
|
-
function ft(e) {
|
|
385
|
-
if (G.call(e, "ref")) {
|
|
386
|
-
var s = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
387
|
-
if (s && s.isReactWarning)
|
|
388
|
-
return !1;
|
|
389
|
-
}
|
|
390
|
-
return e.ref !== void 0;
|
|
391
|
-
}
|
|
392
|
-
function dt(e) {
|
|
393
|
-
if (G.call(e, "key")) {
|
|
394
|
-
var s = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
395
|
-
if (s && s.isReactWarning)
|
|
396
|
-
return !1;
|
|
397
|
-
}
|
|
398
|
-
return e.key !== void 0;
|
|
399
|
-
}
|
|
400
|
-
function ht(e, s) {
|
|
401
|
-
if (typeof e.ref == "string" && K.current && s && K.current.stateNode !== s) {
|
|
402
|
-
var c = F(K.current.type);
|
|
403
|
-
he[c] || (b('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', F(K.current.type), e.ref), he[c] = !0);
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
function vt(e, s) {
|
|
407
|
-
{
|
|
408
|
-
var c = function() {
|
|
409
|
-
ke || (ke = !0, b("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", s));
|
|
410
|
-
};
|
|
411
|
-
c.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
412
|
-
get: c,
|
|
413
|
-
configurable: !0
|
|
414
|
-
});
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
function gt(e, s) {
|
|
418
|
-
{
|
|
419
|
-
var c = function() {
|
|
420
|
-
Fe || (Fe = !0, b("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", s));
|
|
421
|
-
};
|
|
422
|
-
c.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
423
|
-
get: c,
|
|
424
|
-
configurable: !0
|
|
425
|
-
});
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
var pt = function(e, s, c, g, P, A, C) {
|
|
429
|
-
var w = {
|
|
430
|
-
// This tag allows us to uniquely identify this as a React Element
|
|
431
|
-
$$typeof: i,
|
|
432
|
-
// Built-in properties that belong on the element
|
|
433
|
-
type: e,
|
|
434
|
-
key: s,
|
|
435
|
-
ref: c,
|
|
436
|
-
props: C,
|
|
437
|
-
// Record the component responsible for creating this element.
|
|
438
|
-
_owner: A
|
|
439
|
-
};
|
|
440
|
-
return w._store = {}, Object.defineProperty(w._store, "validated", {
|
|
441
|
-
configurable: !1,
|
|
442
|
-
enumerable: !1,
|
|
443
|
-
writable: !0,
|
|
444
|
-
value: !1
|
|
445
|
-
}), Object.defineProperty(w, "_self", {
|
|
446
|
-
configurable: !1,
|
|
447
|
-
enumerable: !1,
|
|
448
|
-
writable: !1,
|
|
449
|
-
value: g
|
|
450
|
-
}), Object.defineProperty(w, "_source", {
|
|
451
|
-
configurable: !1,
|
|
452
|
-
enumerable: !1,
|
|
453
|
-
writable: !1,
|
|
454
|
-
value: P
|
|
455
|
-
}), Object.freeze && (Object.freeze(w.props), Object.freeze(w)), w;
|
|
456
|
-
};
|
|
457
|
-
function mt(e, s, c, g, P) {
|
|
458
|
-
{
|
|
459
|
-
var A, C = {}, w = null, N = null;
|
|
460
|
-
c !== void 0 && (Ne(c), w = "" + c), dt(s) && (Ne(s.key), w = "" + s.key), ft(s) && (N = s.ref, ht(s, P));
|
|
461
|
-
for (A in s)
|
|
462
|
-
G.call(s, A) && !ct.hasOwnProperty(A) && (C[A] = s[A]);
|
|
463
|
-
if (e && e.defaultProps) {
|
|
464
|
-
var S = e.defaultProps;
|
|
465
|
-
for (A in S)
|
|
466
|
-
C[A] === void 0 && (C[A] = S[A]);
|
|
467
|
-
}
|
|
468
|
-
if (w || N) {
|
|
469
|
-
var T = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
470
|
-
w && vt(C, T), N && gt(C, T);
|
|
471
|
-
}
|
|
472
|
-
return pt(e, w, N, P, g, K.current, C);
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
var ve = O.ReactCurrentOwner, Le = O.ReactDebugCurrentFrame;
|
|
476
|
-
function V(e) {
|
|
477
|
-
if (e) {
|
|
478
|
-
var s = e._owner, c = oe(e.type, e._source, s ? s.type : null);
|
|
479
|
-
Le.setExtraStackFrame(c);
|
|
480
|
-
} else
|
|
481
|
-
Le.setExtraStackFrame(null);
|
|
482
|
-
}
|
|
483
|
-
var ge;
|
|
484
|
-
ge = !1;
|
|
485
|
-
function pe(e) {
|
|
486
|
-
return typeof e == "object" && e !== null && e.$$typeof === i;
|
|
487
|
-
}
|
|
488
|
-
function De() {
|
|
489
|
-
{
|
|
490
|
-
if (ve.current) {
|
|
491
|
-
var e = F(ve.current.type);
|
|
492
|
-
if (e)
|
|
493
|
-
return `
|
|
494
|
-
|
|
495
|
-
Check the render method of \`` + e + "`.";
|
|
496
|
-
}
|
|
497
|
-
return "";
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
function Et(e) {
|
|
501
|
-
return "";
|
|
502
|
-
}
|
|
503
|
-
var xe = {};
|
|
504
|
-
function yt(e) {
|
|
505
|
-
{
|
|
506
|
-
var s = De();
|
|
507
|
-
if (!s) {
|
|
508
|
-
var c = typeof e == "string" ? e : e.displayName || e.name;
|
|
509
|
-
c && (s = `
|
|
510
|
-
|
|
511
|
-
Check the top-level render call using <` + c + ">.");
|
|
512
|
-
}
|
|
513
|
-
return s;
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
function je(e, s) {
|
|
517
|
-
{
|
|
518
|
-
if (!e._store || e._store.validated || e.key != null)
|
|
519
|
-
return;
|
|
520
|
-
e._store.validated = !0;
|
|
521
|
-
var c = yt(s);
|
|
522
|
-
if (xe[c])
|
|
523
|
-
return;
|
|
524
|
-
xe[c] = !0;
|
|
525
|
-
var g = "";
|
|
526
|
-
e && e._owner && e._owner !== ve.current && (g = " It was passed a child from " + F(e._owner.type) + "."), V(e), b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', c, g), V(null);
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
function Ue(e, s) {
|
|
530
|
-
{
|
|
531
|
-
if (typeof e != "object")
|
|
532
|
-
return;
|
|
533
|
-
if (de(e))
|
|
534
|
-
for (var c = 0; c < e.length; c++) {
|
|
535
|
-
var g = e[c];
|
|
536
|
-
pe(g) && je(g, s);
|
|
537
|
-
}
|
|
538
|
-
else if (pe(e))
|
|
539
|
-
e._store && (e._store.validated = !0);
|
|
540
|
-
else if (e) {
|
|
541
|
-
var P = E(e);
|
|
542
|
-
if (typeof P == "function" && P !== e.entries)
|
|
543
|
-
for (var A = P.call(e), C; !(C = A.next()).done; )
|
|
544
|
-
pe(C.value) && je(C.value, s);
|
|
545
|
-
}
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
function Rt(e) {
|
|
549
|
-
{
|
|
550
|
-
var s = e.type;
|
|
551
|
-
if (s == null || typeof s == "string")
|
|
552
|
-
return;
|
|
553
|
-
var c;
|
|
554
|
-
if (typeof s == "function")
|
|
555
|
-
c = s.propTypes;
|
|
556
|
-
else if (typeof s == "object" && (s.$$typeof === t || // Note: Memo only checks outer props here.
|
|
557
|
-
// Inner props are checked in the reconciler.
|
|
558
|
-
s.$$typeof === o))
|
|
559
|
-
c = s.propTypes;
|
|
560
|
-
else
|
|
561
|
-
return;
|
|
562
|
-
if (c) {
|
|
563
|
-
var g = F(s);
|
|
564
|
-
at(c, e.props, "prop", g, e);
|
|
565
|
-
} else if (s.PropTypes !== void 0 && !ge) {
|
|
566
|
-
ge = !0;
|
|
567
|
-
var P = F(s);
|
|
568
|
-
b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", P || "Unknown");
|
|
569
|
-
}
|
|
570
|
-
typeof s.getDefaultProps == "function" && !s.getDefaultProps.isReactClassApproved && b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
|
-
function wt(e) {
|
|
574
|
-
{
|
|
575
|
-
for (var s = Object.keys(e.props), c = 0; c < s.length; c++) {
|
|
576
|
-
var g = s[c];
|
|
577
|
-
if (g !== "children" && g !== "key") {
|
|
578
|
-
V(e), b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", g), V(null);
|
|
579
|
-
break;
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
e.ref !== null && (V(e), b("Invalid attribute `ref` supplied to `React.Fragment`."), V(null));
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
|
-
var Be = {};
|
|
586
|
-
function $e(e, s, c, g, P, A) {
|
|
587
|
-
{
|
|
588
|
-
var C = Z(e);
|
|
589
|
-
if (!C) {
|
|
590
|
-
var w = "";
|
|
591
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (w += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
592
|
-
var N = Et();
|
|
593
|
-
N ? w += N : w += De();
|
|
594
|
-
var S;
|
|
595
|
-
e === null ? S = "null" : de(e) ? S = "array" : e !== void 0 && e.$$typeof === i ? (S = "<" + (F(e.type) || "Unknown") + " />", w = " Did you accidentally export a JSX literal instead of a component?") : S = typeof e, b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", S, w);
|
|
596
|
-
}
|
|
597
|
-
var T = mt(e, s, c, P, A);
|
|
598
|
-
if (T == null)
|
|
599
|
-
return T;
|
|
600
|
-
if (C) {
|
|
601
|
-
var L = s.children;
|
|
602
|
-
if (L !== void 0)
|
|
603
|
-
if (g)
|
|
604
|
-
if (de(L)) {
|
|
605
|
-
for (var H = 0; H < L.length; H++)
|
|
606
|
-
Ue(L[H], e);
|
|
607
|
-
Object.freeze && Object.freeze(L);
|
|
608
|
-
} else
|
|
609
|
-
b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
610
|
-
else
|
|
611
|
-
Ue(L, e);
|
|
612
|
-
}
|
|
613
|
-
if (G.call(s, "key")) {
|
|
614
|
-
var z = F(e), k = Object.keys(s).filter(function(Mt) {
|
|
615
|
-
return Mt !== "key";
|
|
616
|
-
}), me = k.length > 0 ? "{key: someKey, " + k.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
617
|
-
if (!Be[z + me]) {
|
|
618
|
-
var At = k.length > 0 ? "{" + k.join(": ..., ") + ": ...}" : "{}";
|
|
619
|
-
b(`A props object containing a "key" prop is being spread into JSX:
|
|
620
|
-
let props = %s;
|
|
621
|
-
<%s {...props} />
|
|
622
|
-
React keys must be passed directly to JSX without using spread:
|
|
623
|
-
let props = %s;
|
|
624
|
-
<%s key={someKey} {...props} />`, me, z, At, z), Be[z + me] = !0;
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
return e === l ? wt(T) : Rt(T), T;
|
|
628
|
-
}
|
|
629
|
-
}
|
|
630
|
-
function _t(e, s, c) {
|
|
631
|
-
return $e(e, s, c, !0);
|
|
632
|
-
}
|
|
633
|
-
function Ct(e, s, c) {
|
|
634
|
-
return $e(e, s, c, !1);
|
|
635
|
-
}
|
|
636
|
-
var bt = Ct, Pt = _t;
|
|
637
|
-
X.Fragment = l, X.jsx = bt, X.jsxs = Pt;
|
|
638
|
-
}()), X;
|
|
639
|
-
}
|
|
640
|
-
process.env.NODE_ENV === "production" ? Ee.exports = Ot() : Ee.exports = It();
|
|
641
|
-
var se = Ee.exports, Nt = Object.defineProperty, le = Object.getOwnPropertySymbols, qe = Object.prototype.hasOwnProperty, Xe = Object.prototype.propertyIsEnumerable, He = (v, i, u) => i in v ? Nt(v, i, { enumerable: !0, configurable: !0, writable: !0, value: u }) : v[i] = u, We = (v, i) => {
|
|
642
|
-
for (var u in i || (i = {}))
|
|
643
|
-
qe.call(i, u) && He(v, u, i[u]);
|
|
644
|
-
if (le)
|
|
645
|
-
for (var u of le(i))
|
|
646
|
-
Xe.call(i, u) && He(v, u, i[u]);
|
|
647
|
-
return v;
|
|
648
|
-
}, kt = (v, i) => {
|
|
649
|
-
var u = {};
|
|
650
|
-
for (var l in v)
|
|
651
|
-
qe.call(v, l) && i.indexOf(l) < 0 && (u[l] = v[l]);
|
|
652
|
-
if (v != null && le)
|
|
653
|
-
for (var l of le(v))
|
|
654
|
-
i.indexOf(l) < 0 && Xe.call(v, l) && (u[l] = v[l]);
|
|
655
|
-
return u;
|
|
656
|
-
};
|
|
657
|
-
/**
|
|
658
|
-
* @license QR Code generator library (TypeScript)
|
|
659
|
-
* Copyright (c) Project Nayuki.
|
|
660
|
-
* SPDX-License-Identifier: MIT
|
|
661
|
-
*/
|
|
662
|
-
var Y;
|
|
663
|
-
((v) => {
|
|
664
|
-
const i = class {
|
|
665
|
-
constructor(t, r, n, o) {
|
|
666
|
-
if (this.version = t, this.errorCorrectionLevel = r, this.modules = [], this.isFunction = [], t < i.MIN_VERSION || t > i.MAX_VERSION)
|
|
667
|
-
throw new RangeError("Version value out of range");
|
|
668
|
-
if (o < -1 || o > 7)
|
|
669
|
-
throw new RangeError("Mask value out of range");
|
|
670
|
-
this.size = t * 4 + 17;
|
|
671
|
-
let a = [];
|
|
672
|
-
for (let f = 0; f < this.size; f++)
|
|
673
|
-
a.push(!1);
|
|
674
|
-
for (let f = 0; f < this.size; f++)
|
|
675
|
-
this.modules.push(a.slice()), this.isFunction.push(a.slice());
|
|
676
|
-
this.drawFunctionPatterns();
|
|
677
|
-
const d = this.addEccAndInterleave(n);
|
|
678
|
-
if (this.drawCodewords(d), o == -1) {
|
|
679
|
-
let f = 1e9;
|
|
680
|
-
for (let y = 0; y < 8; y++) {
|
|
681
|
-
this.applyMask(y), this.drawFormatBits(y);
|
|
682
|
-
const E = this.getPenaltyScore();
|
|
683
|
-
E < f && (o = y, f = E), this.applyMask(y);
|
|
684
|
-
}
|
|
685
|
-
}
|
|
686
|
-
h(0 <= o && o <= 7), this.mask = o, this.applyMask(o), this.drawFormatBits(o), this.isFunction = [];
|
|
687
|
-
}
|
|
688
|
-
static encodeText(t, r) {
|
|
689
|
-
const n = v.QrSegment.makeSegments(t);
|
|
690
|
-
return i.encodeSegments(n, r);
|
|
691
|
-
}
|
|
692
|
-
static encodeBinary(t, r) {
|
|
693
|
-
const n = v.QrSegment.makeBytes(t);
|
|
694
|
-
return i.encodeSegments([n], r);
|
|
695
|
-
}
|
|
696
|
-
static encodeSegments(t, r, n = 1, o = 40, a = -1, d = !0) {
|
|
697
|
-
if (!(i.MIN_VERSION <= n && n <= o && o <= i.MAX_VERSION) || a < -1 || a > 7)
|
|
698
|
-
throw new RangeError("Invalid value");
|
|
699
|
-
let f, y;
|
|
700
|
-
for (f = n; ; f++) {
|
|
701
|
-
const R = i.getNumDataCodewords(f, r) * 8, M = _.getTotalBits(t, f);
|
|
702
|
-
if (M <= R) {
|
|
703
|
-
y = M;
|
|
704
|
-
break;
|
|
705
|
-
}
|
|
706
|
-
if (f >= o)
|
|
707
|
-
throw new RangeError("Data too long");
|
|
708
|
-
}
|
|
709
|
-
for (const R of [i.Ecc.MEDIUM, i.Ecc.QUARTILE, i.Ecc.HIGH])
|
|
710
|
-
d && y <= i.getNumDataCodewords(f, R) * 8 && (r = R);
|
|
711
|
-
let E = [];
|
|
712
|
-
for (const R of t) {
|
|
713
|
-
l(R.mode.modeBits, 4, E), l(R.numChars, R.mode.numCharCountBits(f), E);
|
|
714
|
-
for (const M of R.getData())
|
|
715
|
-
E.push(M);
|
|
716
|
-
}
|
|
717
|
-
h(E.length == y);
|
|
718
|
-
const O = i.getNumDataCodewords(f, r) * 8;
|
|
719
|
-
h(E.length <= O), l(0, Math.min(4, O - E.length), E), l(0, (8 - E.length % 8) % 8, E), h(E.length % 8 == 0);
|
|
720
|
-
for (let R = 236; E.length < O; R ^= 253)
|
|
721
|
-
l(R, 8, E);
|
|
722
|
-
let b = [];
|
|
723
|
-
for (; b.length * 8 < E.length; )
|
|
724
|
-
b.push(0);
|
|
725
|
-
return E.forEach((R, M) => b[M >>> 3] |= R << 7 - (M & 7)), new i(f, r, b, a);
|
|
726
|
-
}
|
|
727
|
-
getModule(t, r) {
|
|
728
|
-
return 0 <= t && t < this.size && 0 <= r && r < this.size && this.modules[r][t];
|
|
729
|
-
}
|
|
730
|
-
getModules() {
|
|
731
|
-
return this.modules;
|
|
732
|
-
}
|
|
733
|
-
drawFunctionPatterns() {
|
|
734
|
-
for (let n = 0; n < this.size; n++)
|
|
735
|
-
this.setFunctionModule(6, n, n % 2 == 0), this.setFunctionModule(n, 6, n % 2 == 0);
|
|
736
|
-
this.drawFinderPattern(3, 3), this.drawFinderPattern(this.size - 4, 3), this.drawFinderPattern(3, this.size - 4);
|
|
737
|
-
const t = this.getAlignmentPatternPositions(), r = t.length;
|
|
738
|
-
for (let n = 0; n < r; n++)
|
|
739
|
-
for (let o = 0; o < r; o++)
|
|
740
|
-
n == 0 && o == 0 || n == 0 && o == r - 1 || n == r - 1 && o == 0 || this.drawAlignmentPattern(t[n], t[o]);
|
|
741
|
-
this.drawFormatBits(0), this.drawVersion();
|
|
742
|
-
}
|
|
743
|
-
drawFormatBits(t) {
|
|
744
|
-
const r = this.errorCorrectionLevel.formatBits << 3 | t;
|
|
745
|
-
let n = r;
|
|
746
|
-
for (let a = 0; a < 10; a++)
|
|
747
|
-
n = n << 1 ^ (n >>> 9) * 1335;
|
|
748
|
-
const o = (r << 10 | n) ^ 21522;
|
|
749
|
-
h(o >>> 15 == 0);
|
|
750
|
-
for (let a = 0; a <= 5; a++)
|
|
751
|
-
this.setFunctionModule(8, a, m(o, a));
|
|
752
|
-
this.setFunctionModule(8, 7, m(o, 6)), this.setFunctionModule(8, 8, m(o, 7)), this.setFunctionModule(7, 8, m(o, 8));
|
|
753
|
-
for (let a = 9; a < 15; a++)
|
|
754
|
-
this.setFunctionModule(14 - a, 8, m(o, a));
|
|
755
|
-
for (let a = 0; a < 8; a++)
|
|
756
|
-
this.setFunctionModule(this.size - 1 - a, 8, m(o, a));
|
|
757
|
-
for (let a = 8; a < 15; a++)
|
|
758
|
-
this.setFunctionModule(8, this.size - 15 + a, m(o, a));
|
|
759
|
-
this.setFunctionModule(8, this.size - 8, !0);
|
|
760
|
-
}
|
|
761
|
-
drawVersion() {
|
|
762
|
-
if (this.version < 7)
|
|
763
|
-
return;
|
|
764
|
-
let t = this.version;
|
|
765
|
-
for (let n = 0; n < 12; n++)
|
|
766
|
-
t = t << 1 ^ (t >>> 11) * 7973;
|
|
767
|
-
const r = this.version << 12 | t;
|
|
768
|
-
h(r >>> 18 == 0);
|
|
769
|
-
for (let n = 0; n < 18; n++) {
|
|
770
|
-
const o = m(r, n), a = this.size - 11 + n % 3, d = Math.floor(n / 3);
|
|
771
|
-
this.setFunctionModule(a, d, o), this.setFunctionModule(d, a, o);
|
|
772
|
-
}
|
|
773
|
-
}
|
|
774
|
-
drawFinderPattern(t, r) {
|
|
775
|
-
for (let n = -4; n <= 4; n++)
|
|
776
|
-
for (let o = -4; o <= 4; o++) {
|
|
777
|
-
const a = Math.max(Math.abs(o), Math.abs(n)), d = t + o, f = r + n;
|
|
778
|
-
0 <= d && d < this.size && 0 <= f && f < this.size && this.setFunctionModule(d, f, a != 2 && a != 4);
|
|
779
|
-
}
|
|
780
|
-
}
|
|
781
|
-
drawAlignmentPattern(t, r) {
|
|
782
|
-
for (let n = -2; n <= 2; n++)
|
|
783
|
-
for (let o = -2; o <= 2; o++)
|
|
784
|
-
this.setFunctionModule(t + o, r + n, Math.max(Math.abs(o), Math.abs(n)) != 1);
|
|
785
|
-
}
|
|
786
|
-
setFunctionModule(t, r, n) {
|
|
787
|
-
this.modules[r][t] = n, this.isFunction[r][t] = !0;
|
|
788
|
-
}
|
|
789
|
-
addEccAndInterleave(t) {
|
|
790
|
-
const r = this.version, n = this.errorCorrectionLevel;
|
|
791
|
-
if (t.length != i.getNumDataCodewords(r, n))
|
|
792
|
-
throw new RangeError("Invalid argument");
|
|
793
|
-
const o = i.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][r], a = i.ECC_CODEWORDS_PER_BLOCK[n.ordinal][r], d = Math.floor(i.getNumRawDataModules(r) / 8), f = o - d % o, y = Math.floor(d / o);
|
|
794
|
-
let E = [];
|
|
795
|
-
const O = i.reedSolomonComputeDivisor(a);
|
|
796
|
-
for (let R = 0, M = 0; R < o; R++) {
|
|
797
|
-
let I = t.slice(M, M + y - a + (R < f ? 0 : 1));
|
|
798
|
-
M += I.length;
|
|
799
|
-
const U = i.reedSolomonComputeRemainder(I, O);
|
|
800
|
-
R < f && I.push(0), E.push(I.concat(U));
|
|
801
|
-
}
|
|
802
|
-
let b = [];
|
|
803
|
-
for (let R = 0; R < E[0].length; R++)
|
|
804
|
-
E.forEach((M, I) => {
|
|
805
|
-
(R != y - a || I >= f) && b.push(M[R]);
|
|
806
|
-
});
|
|
807
|
-
return h(b.length == d), b;
|
|
808
|
-
}
|
|
809
|
-
drawCodewords(t) {
|
|
810
|
-
if (t.length != Math.floor(i.getNumRawDataModules(this.version) / 8))
|
|
811
|
-
throw new RangeError("Invalid argument");
|
|
812
|
-
let r = 0;
|
|
813
|
-
for (let n = this.size - 1; n >= 1; n -= 2) {
|
|
814
|
-
n == 6 && (n = 5);
|
|
815
|
-
for (let o = 0; o < this.size; o++)
|
|
816
|
-
for (let a = 0; a < 2; a++) {
|
|
817
|
-
const d = n - a, y = (n + 1 & 2) == 0 ? this.size - 1 - o : o;
|
|
818
|
-
!this.isFunction[y][d] && r < t.length * 8 && (this.modules[y][d] = m(t[r >>> 3], 7 - (r & 7)), r++);
|
|
819
|
-
}
|
|
820
|
-
}
|
|
821
|
-
h(r == t.length * 8);
|
|
822
|
-
}
|
|
823
|
-
applyMask(t) {
|
|
824
|
-
if (t < 0 || t > 7)
|
|
825
|
-
throw new RangeError("Mask value out of range");
|
|
826
|
-
for (let r = 0; r < this.size; r++)
|
|
827
|
-
for (let n = 0; n < this.size; n++) {
|
|
828
|
-
let o;
|
|
829
|
-
switch (t) {
|
|
830
|
-
case 0:
|
|
831
|
-
o = (n + r) % 2 == 0;
|
|
832
|
-
break;
|
|
833
|
-
case 1:
|
|
834
|
-
o = r % 2 == 0;
|
|
835
|
-
break;
|
|
836
|
-
case 2:
|
|
837
|
-
o = n % 3 == 0;
|
|
838
|
-
break;
|
|
839
|
-
case 3:
|
|
840
|
-
o = (n + r) % 3 == 0;
|
|
841
|
-
break;
|
|
842
|
-
case 4:
|
|
843
|
-
o = (Math.floor(n / 3) + Math.floor(r / 2)) % 2 == 0;
|
|
844
|
-
break;
|
|
845
|
-
case 5:
|
|
846
|
-
o = n * r % 2 + n * r % 3 == 0;
|
|
847
|
-
break;
|
|
848
|
-
case 6:
|
|
849
|
-
o = (n * r % 2 + n * r % 3) % 2 == 0;
|
|
850
|
-
break;
|
|
851
|
-
case 7:
|
|
852
|
-
o = ((n + r) % 2 + n * r % 3) % 2 == 0;
|
|
853
|
-
break;
|
|
854
|
-
default:
|
|
855
|
-
throw new Error("Unreachable");
|
|
856
|
-
}
|
|
857
|
-
!this.isFunction[r][n] && o && (this.modules[r][n] = !this.modules[r][n]);
|
|
858
|
-
}
|
|
859
|
-
}
|
|
860
|
-
getPenaltyScore() {
|
|
861
|
-
let t = 0;
|
|
862
|
-
for (let a = 0; a < this.size; a++) {
|
|
863
|
-
let d = !1, f = 0, y = [0, 0, 0, 0, 0, 0, 0];
|
|
864
|
-
for (let E = 0; E < this.size; E++)
|
|
865
|
-
this.modules[a][E] == d ? (f++, f == 5 ? t += i.PENALTY_N1 : f > 5 && t++) : (this.finderPenaltyAddHistory(f, y), d || (t += this.finderPenaltyCountPatterns(y) * i.PENALTY_N3), d = this.modules[a][E], f = 1);
|
|
866
|
-
t += this.finderPenaltyTerminateAndCount(d, f, y) * i.PENALTY_N3;
|
|
867
|
-
}
|
|
868
|
-
for (let a = 0; a < this.size; a++) {
|
|
869
|
-
let d = !1, f = 0, y = [0, 0, 0, 0, 0, 0, 0];
|
|
870
|
-
for (let E = 0; E < this.size; E++)
|
|
871
|
-
this.modules[E][a] == d ? (f++, f == 5 ? t += i.PENALTY_N1 : f > 5 && t++) : (this.finderPenaltyAddHistory(f, y), d || (t += this.finderPenaltyCountPatterns(y) * i.PENALTY_N3), d = this.modules[E][a], f = 1);
|
|
872
|
-
t += this.finderPenaltyTerminateAndCount(d, f, y) * i.PENALTY_N3;
|
|
873
|
-
}
|
|
874
|
-
for (let a = 0; a < this.size - 1; a++)
|
|
875
|
-
for (let d = 0; d < this.size - 1; d++) {
|
|
876
|
-
const f = this.modules[a][d];
|
|
877
|
-
f == this.modules[a][d + 1] && f == this.modules[a + 1][d] && f == this.modules[a + 1][d + 1] && (t += i.PENALTY_N2);
|
|
878
|
-
}
|
|
879
|
-
let r = 0;
|
|
880
|
-
for (const a of this.modules)
|
|
881
|
-
r = a.reduce((d, f) => d + (f ? 1 : 0), r);
|
|
882
|
-
const n = this.size * this.size, o = Math.ceil(Math.abs(r * 20 - n * 10) / n) - 1;
|
|
883
|
-
return h(0 <= o && o <= 9), t += o * i.PENALTY_N4, h(0 <= t && t <= 2568888), t;
|
|
884
|
-
}
|
|
885
|
-
getAlignmentPatternPositions() {
|
|
886
|
-
if (this.version == 1)
|
|
887
|
-
return [];
|
|
888
|
-
{
|
|
889
|
-
const t = Math.floor(this.version / 7) + 2, r = this.version == 32 ? 26 : Math.ceil((this.version * 4 + 4) / (t * 2 - 2)) * 2;
|
|
890
|
-
let n = [6];
|
|
891
|
-
for (let o = this.size - 7; n.length < t; o -= r)
|
|
892
|
-
n.splice(1, 0, o);
|
|
893
|
-
return n;
|
|
894
|
-
}
|
|
895
|
-
}
|
|
896
|
-
static getNumRawDataModules(t) {
|
|
897
|
-
if (t < i.MIN_VERSION || t > i.MAX_VERSION)
|
|
898
|
-
throw new RangeError("Version number out of range");
|
|
899
|
-
let r = (16 * t + 128) * t + 64;
|
|
900
|
-
if (t >= 2) {
|
|
901
|
-
const n = Math.floor(t / 7) + 2;
|
|
902
|
-
r -= (25 * n - 10) * n - 55, t >= 7 && (r -= 36);
|
|
903
|
-
}
|
|
904
|
-
return h(208 <= r && r <= 29648), r;
|
|
905
|
-
}
|
|
906
|
-
static getNumDataCodewords(t, r) {
|
|
907
|
-
return Math.floor(i.getNumRawDataModules(t) / 8) - i.ECC_CODEWORDS_PER_BLOCK[r.ordinal][t] * i.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][t];
|
|
908
|
-
}
|
|
909
|
-
static reedSolomonComputeDivisor(t) {
|
|
910
|
-
if (t < 1 || t > 255)
|
|
911
|
-
throw new RangeError("Degree out of range");
|
|
912
|
-
let r = [];
|
|
913
|
-
for (let o = 0; o < t - 1; o++)
|
|
914
|
-
r.push(0);
|
|
915
|
-
r.push(1);
|
|
916
|
-
let n = 1;
|
|
917
|
-
for (let o = 0; o < t; o++) {
|
|
918
|
-
for (let a = 0; a < r.length; a++)
|
|
919
|
-
r[a] = i.reedSolomonMultiply(r[a], n), a + 1 < r.length && (r[a] ^= r[a + 1]);
|
|
920
|
-
n = i.reedSolomonMultiply(n, 2);
|
|
921
|
-
}
|
|
922
|
-
return r;
|
|
923
|
-
}
|
|
924
|
-
static reedSolomonComputeRemainder(t, r) {
|
|
925
|
-
let n = r.map((o) => 0);
|
|
926
|
-
for (const o of t) {
|
|
927
|
-
const a = o ^ n.shift();
|
|
928
|
-
n.push(0), r.forEach((d, f) => n[f] ^= i.reedSolomonMultiply(d, a));
|
|
929
|
-
}
|
|
930
|
-
return n;
|
|
931
|
-
}
|
|
932
|
-
static reedSolomonMultiply(t, r) {
|
|
933
|
-
if (t >>> 8 || r >>> 8)
|
|
934
|
-
throw new RangeError("Byte out of range");
|
|
935
|
-
let n = 0;
|
|
936
|
-
for (let o = 7; o >= 0; o--)
|
|
937
|
-
n = n << 1 ^ (n >>> 7) * 285, n ^= (r >>> o & 1) * t;
|
|
938
|
-
return h(n >>> 8 == 0), n;
|
|
939
|
-
}
|
|
940
|
-
finderPenaltyCountPatterns(t) {
|
|
941
|
-
const r = t[1];
|
|
942
|
-
h(r <= this.size * 3);
|
|
943
|
-
const n = r > 0 && t[2] == r && t[3] == r * 3 && t[4] == r && t[5] == r;
|
|
944
|
-
return (n && t[0] >= r * 4 && t[6] >= r ? 1 : 0) + (n && t[6] >= r * 4 && t[0] >= r ? 1 : 0);
|
|
945
|
-
}
|
|
946
|
-
finderPenaltyTerminateAndCount(t, r, n) {
|
|
947
|
-
return t && (this.finderPenaltyAddHistory(r, n), r = 0), r += this.size, this.finderPenaltyAddHistory(r, n), this.finderPenaltyCountPatterns(n);
|
|
948
|
-
}
|
|
949
|
-
finderPenaltyAddHistory(t, r) {
|
|
950
|
-
r[0] == 0 && (t += this.size), r.pop(), r.unshift(t);
|
|
951
|
-
}
|
|
952
|
-
};
|
|
953
|
-
let u = i;
|
|
954
|
-
u.MIN_VERSION = 1, u.MAX_VERSION = 40, u.PENALTY_N1 = 3, u.PENALTY_N2 = 3, u.PENALTY_N3 = 40, u.PENALTY_N4 = 10, u.ECC_CODEWORDS_PER_BLOCK = [
|
|
955
|
-
[-1, 7, 10, 15, 20, 26, 18, 20, 24, 30, 18, 20, 24, 26, 30, 22, 24, 28, 30, 28, 28, 28, 28, 30, 30, 26, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],
|
|
956
|
-
[-1, 10, 16, 26, 18, 24, 16, 18, 22, 22, 26, 30, 22, 22, 24, 24, 28, 28, 26, 26, 26, 26, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28],
|
|
957
|
-
[-1, 13, 22, 18, 26, 18, 24, 18, 22, 20, 24, 28, 26, 24, 20, 30, 24, 28, 28, 26, 30, 28, 30, 30, 30, 30, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],
|
|
958
|
-
[-1, 17, 28, 22, 16, 22, 28, 26, 26, 24, 28, 24, 28, 22, 24, 24, 30, 28, 28, 26, 28, 30, 24, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30]
|
|
959
|
-
], u.NUM_ERROR_CORRECTION_BLOCKS = [
|
|
960
|
-
[-1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 4, 4, 6, 6, 6, 6, 7, 8, 8, 9, 9, 10, 12, 12, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 24, 25],
|
|
961
|
-
[-1, 1, 1, 1, 2, 2, 4, 4, 4, 5, 5, 5, 8, 9, 9, 10, 10, 11, 13, 14, 16, 17, 17, 18, 20, 21, 23, 25, 26, 28, 29, 31, 33, 35, 37, 38, 40, 43, 45, 47, 49],
|
|
962
|
-
[-1, 1, 1, 2, 2, 4, 4, 6, 6, 8, 8, 8, 10, 12, 16, 12, 17, 16, 18, 21, 20, 23, 23, 25, 27, 29, 34, 34, 35, 38, 40, 43, 45, 48, 51, 53, 56, 59, 62, 65, 68],
|
|
963
|
-
[-1, 1, 1, 2, 4, 4, 4, 5, 6, 8, 8, 11, 11, 16, 16, 18, 16, 19, 21, 25, 25, 25, 34, 30, 32, 35, 37, 40, 42, 45, 48, 51, 54, 57, 60, 63, 66, 70, 74, 77, 81]
|
|
964
|
-
], v.QrCode = u;
|
|
965
|
-
function l(t, r, n) {
|
|
966
|
-
if (r < 0 || r > 31 || t >>> r)
|
|
967
|
-
throw new RangeError("Value out of range");
|
|
968
|
-
for (let o = r - 1; o >= 0; o--)
|
|
969
|
-
n.push(t >>> o & 1);
|
|
970
|
-
}
|
|
971
|
-
function m(t, r) {
|
|
972
|
-
return (t >>> r & 1) != 0;
|
|
973
|
-
}
|
|
974
|
-
function h(t) {
|
|
975
|
-
if (!t)
|
|
976
|
-
throw new Error("Assertion error");
|
|
977
|
-
}
|
|
978
|
-
const p = class {
|
|
979
|
-
constructor(t, r, n) {
|
|
980
|
-
if (this.mode = t, this.numChars = r, this.bitData = n, r < 0)
|
|
981
|
-
throw new RangeError("Invalid argument");
|
|
982
|
-
this.bitData = n.slice();
|
|
983
|
-
}
|
|
984
|
-
static makeBytes(t) {
|
|
985
|
-
let r = [];
|
|
986
|
-
for (const n of t)
|
|
987
|
-
l(n, 8, r);
|
|
988
|
-
return new p(p.Mode.BYTE, t.length, r);
|
|
989
|
-
}
|
|
990
|
-
static makeNumeric(t) {
|
|
991
|
-
if (!p.isNumeric(t))
|
|
992
|
-
throw new RangeError("String contains non-numeric characters");
|
|
993
|
-
let r = [];
|
|
994
|
-
for (let n = 0; n < t.length; ) {
|
|
995
|
-
const o = Math.min(t.length - n, 3);
|
|
996
|
-
l(parseInt(t.substr(n, o), 10), o * 3 + 1, r), n += o;
|
|
997
|
-
}
|
|
998
|
-
return new p(p.Mode.NUMERIC, t.length, r);
|
|
999
|
-
}
|
|
1000
|
-
static makeAlphanumeric(t) {
|
|
1001
|
-
if (!p.isAlphanumeric(t))
|
|
1002
|
-
throw new RangeError("String contains unencodable characters in alphanumeric mode");
|
|
1003
|
-
let r = [], n;
|
|
1004
|
-
for (n = 0; n + 2 <= t.length; n += 2) {
|
|
1005
|
-
let o = p.ALPHANUMERIC_CHARSET.indexOf(t.charAt(n)) * 45;
|
|
1006
|
-
o += p.ALPHANUMERIC_CHARSET.indexOf(t.charAt(n + 1)), l(o, 11, r);
|
|
1007
|
-
}
|
|
1008
|
-
return n < t.length && l(p.ALPHANUMERIC_CHARSET.indexOf(t.charAt(n)), 6, r), new p(p.Mode.ALPHANUMERIC, t.length, r);
|
|
1009
|
-
}
|
|
1010
|
-
static makeSegments(t) {
|
|
1011
|
-
return t == "" ? [] : p.isNumeric(t) ? [p.makeNumeric(t)] : p.isAlphanumeric(t) ? [p.makeAlphanumeric(t)] : [p.makeBytes(p.toUtf8ByteArray(t))];
|
|
1012
|
-
}
|
|
1013
|
-
static makeEci(t) {
|
|
1014
|
-
let r = [];
|
|
1015
|
-
if (t < 0)
|
|
1016
|
-
throw new RangeError("ECI assignment value out of range");
|
|
1017
|
-
if (t < 128)
|
|
1018
|
-
l(t, 8, r);
|
|
1019
|
-
else if (t < 16384)
|
|
1020
|
-
l(2, 2, r), l(t, 14, r);
|
|
1021
|
-
else if (t < 1e6)
|
|
1022
|
-
l(6, 3, r), l(t, 21, r);
|
|
1023
|
-
else
|
|
1024
|
-
throw new RangeError("ECI assignment value out of range");
|
|
1025
|
-
return new p(p.Mode.ECI, 0, r);
|
|
1026
|
-
}
|
|
1027
|
-
static isNumeric(t) {
|
|
1028
|
-
return p.NUMERIC_REGEX.test(t);
|
|
1029
|
-
}
|
|
1030
|
-
static isAlphanumeric(t) {
|
|
1031
|
-
return p.ALPHANUMERIC_REGEX.test(t);
|
|
1032
|
-
}
|
|
1033
|
-
getData() {
|
|
1034
|
-
return this.bitData.slice();
|
|
1035
|
-
}
|
|
1036
|
-
static getTotalBits(t, r) {
|
|
1037
|
-
let n = 0;
|
|
1038
|
-
for (const o of t) {
|
|
1039
|
-
const a = o.mode.numCharCountBits(r);
|
|
1040
|
-
if (o.numChars >= 1 << a)
|
|
1041
|
-
return 1 / 0;
|
|
1042
|
-
n += 4 + a + o.bitData.length;
|
|
1043
|
-
}
|
|
1044
|
-
return n;
|
|
1045
|
-
}
|
|
1046
|
-
static toUtf8ByteArray(t) {
|
|
1047
|
-
t = encodeURI(t);
|
|
1048
|
-
let r = [];
|
|
1049
|
-
for (let n = 0; n < t.length; n++)
|
|
1050
|
-
t.charAt(n) != "%" ? r.push(t.charCodeAt(n)) : (r.push(parseInt(t.substr(n + 1, 2), 16)), n += 2);
|
|
1051
|
-
return r;
|
|
1052
|
-
}
|
|
1053
|
-
};
|
|
1054
|
-
let _ = p;
|
|
1055
|
-
_.NUMERIC_REGEX = /^[0-9]*$/, _.ALPHANUMERIC_REGEX = /^[A-Z0-9 $%*+.\/:-]*$/, _.ALPHANUMERIC_CHARSET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:", v.QrSegment = _;
|
|
1056
|
-
})(Y || (Y = {}));
|
|
1057
|
-
((v) => {
|
|
1058
|
-
((i) => {
|
|
1059
|
-
const u = class {
|
|
1060
|
-
constructor(m, h) {
|
|
1061
|
-
this.ordinal = m, this.formatBits = h;
|
|
1062
|
-
}
|
|
1063
|
-
};
|
|
1064
|
-
let l = u;
|
|
1065
|
-
l.LOW = new u(0, 1), l.MEDIUM = new u(1, 0), l.QUARTILE = new u(2, 3), l.HIGH = new u(3, 2), i.Ecc = l;
|
|
1066
|
-
})(v.QrCode || (v.QrCode = {}));
|
|
1067
|
-
})(Y || (Y = {}));
|
|
1068
|
-
((v) => {
|
|
1069
|
-
((i) => {
|
|
1070
|
-
const u = class {
|
|
1071
|
-
constructor(m, h) {
|
|
1072
|
-
this.modeBits = m, this.numBitsCharCount = h;
|
|
1073
|
-
}
|
|
1074
|
-
numCharCountBits(m) {
|
|
1075
|
-
return this.numBitsCharCount[Math.floor((m + 7) / 17)];
|
|
1076
|
-
}
|
|
1077
|
-
};
|
|
1078
|
-
let l = u;
|
|
1079
|
-
l.NUMERIC = new u(1, [10, 12, 14]), l.ALPHANUMERIC = new u(2, [9, 11, 13]), l.BYTE = new u(4, [8, 16, 16]), l.KANJI = new u(8, [8, 10, 12]), l.ECI = new u(7, [0, 0, 0]), i.Mode = l;
|
|
1080
|
-
})(v.QrSegment || (v.QrSegment = {}));
|
|
1081
|
-
})(Y || (Y = {}));
|
|
1082
|
-
var J = Y;
|
|
1083
|
-
/**
|
|
1084
|
-
* @license qrcode.react
|
|
1085
|
-
* Copyright (c) Paul O'Shannessy
|
|
1086
|
-
* SPDX-License-Identifier: ISC
|
|
1087
|
-
*/
|
|
1088
|
-
var Ft = {
|
|
1089
|
-
L: J.QrCode.Ecc.LOW,
|
|
1090
|
-
M: J.QrCode.Ecc.MEDIUM,
|
|
1091
|
-
Q: J.QrCode.Ecc.QUARTILE,
|
|
1092
|
-
H: J.QrCode.Ecc.HIGH
|
|
1093
|
-
}, Lt = 128, Dt = "L", xt = "#FFFFFF", jt = "#000000", Ut = !1, Je = 4, Bt = 0.1;
|
|
1094
|
-
function $t(v, i = 0) {
|
|
1095
|
-
const u = [];
|
|
1096
|
-
return v.forEach(function(l, m) {
|
|
1097
|
-
let h = null;
|
|
1098
|
-
l.forEach(function(p, _) {
|
|
1099
|
-
if (!p && h !== null) {
|
|
1100
|
-
u.push(`M${h + i} ${m + i}h${_ - h}v1H${h + i}z`), h = null;
|
|
1101
|
-
return;
|
|
1102
|
-
}
|
|
1103
|
-
if (_ === l.length - 1) {
|
|
1104
|
-
if (!p)
|
|
1105
|
-
return;
|
|
1106
|
-
h === null ? u.push(`M${_ + i},${m + i} h1v1H${_ + i}z`) : u.push(`M${h + i},${m + i} h${_ + 1 - h}v1H${h + i}z`);
|
|
1107
|
-
return;
|
|
1108
|
-
}
|
|
1109
|
-
p && h === null && (h = _);
|
|
1110
|
-
});
|
|
1111
|
-
}), u.join("");
|
|
1112
|
-
}
|
|
1113
|
-
function zt(v, i) {
|
|
1114
|
-
return v.slice().map((u, l) => l < i.y || l >= i.y + i.h ? u : u.map((m, h) => h < i.x || h >= i.x + i.w ? m : !1));
|
|
1115
|
-
}
|
|
1116
|
-
function Yt(v, i, u, l) {
|
|
1117
|
-
if (l == null)
|
|
1118
|
-
return null;
|
|
1119
|
-
const m = u ? Je : 0, h = v.length + m * 2, p = Math.floor(i * Bt), _ = h / i, t = (l.width || p) * _, r = (l.height || p) * _, n = l.x == null ? v.length / 2 - t / 2 : l.x * _, o = l.y == null ? v.length / 2 - r / 2 : l.y * _;
|
|
1120
|
-
let a = null;
|
|
1121
|
-
if (l.excavate) {
|
|
1122
|
-
let d = Math.floor(n), f = Math.floor(o), y = Math.ceil(t + n - d), E = Math.ceil(r + o - f);
|
|
1123
|
-
a = { x: d, y: f, w: y, h: E };
|
|
1124
|
-
}
|
|
1125
|
-
return { x: n, y: o, h: r, w: t, excavation: a };
|
|
1126
|
-
}
|
|
1127
|
-
var Vt = function() {
|
|
1128
|
-
try {
|
|
1129
|
-
new Path2D().addPath(new Path2D());
|
|
1130
|
-
} catch {
|
|
1131
|
-
return !1;
|
|
1132
|
-
}
|
|
1133
|
-
return !0;
|
|
1134
|
-
}();
|
|
1135
|
-
function Ze(v) {
|
|
1136
|
-
const i = v, {
|
|
1137
|
-
value: u,
|
|
1138
|
-
size: l = Lt,
|
|
1139
|
-
level: m = Dt,
|
|
1140
|
-
bgColor: h = xt,
|
|
1141
|
-
fgColor: p = jt,
|
|
1142
|
-
includeMargin: _ = Ut,
|
|
1143
|
-
style: t,
|
|
1144
|
-
imageSettings: r
|
|
1145
|
-
} = i, n = kt(i, [
|
|
1146
|
-
"value",
|
|
1147
|
-
"size",
|
|
1148
|
-
"level",
|
|
1149
|
-
"bgColor",
|
|
1150
|
-
"fgColor",
|
|
1151
|
-
"includeMargin",
|
|
1152
|
-
"style",
|
|
1153
|
-
"imageSettings"
|
|
1154
|
-
]), o = r == null ? void 0 : r.src, a = ze(null), d = ze(null), [f, y] = ye(!1);
|
|
1155
|
-
W(() => {
|
|
1156
|
-
if (a.current != null) {
|
|
1157
|
-
const b = a.current, R = b.getContext("2d");
|
|
1158
|
-
if (!R)
|
|
1159
|
-
return;
|
|
1160
|
-
let M = J.QrCode.encodeText(u, Ft[m]).getModules();
|
|
1161
|
-
const I = _ ? Je : 0, U = M.length + I * 2, D = Yt(M, l, _, r), B = d.current, Q = D != null && B !== null && B.complete && B.naturalHeight !== 0 && B.naturalWidth !== 0;
|
|
1162
|
-
Q && D.excavation != null && (M = zt(M, D.excavation));
|
|
1163
|
-
const Z = window.devicePixelRatio || 1;
|
|
1164
|
-
b.height = b.width = l * Z;
|
|
1165
|
-
const ee = l / U * Z;
|
|
1166
|
-
R.scale(ee, ee), R.fillStyle = h, R.fillRect(0, 0, U, U), R.fillStyle = p, Vt ? R.fill(new Path2D($t(M, I))) : M.forEach(function(te, F) {
|
|
1167
|
-
te.forEach(function(x, $) {
|
|
1168
|
-
x && R.fillRect($ + I, F + I, 1, 1);
|
|
1169
|
-
});
|
|
1170
|
-
}), Q && R.drawImage(B, D.x + I, D.y + I, D.w, D.h);
|
|
1171
|
-
}
|
|
1172
|
-
}), W(() => {
|
|
1173
|
-
y(!1);
|
|
1174
|
-
}, [o]);
|
|
1175
|
-
const E = We({ height: l, width: l }, t);
|
|
1176
|
-
let O = null;
|
|
1177
|
-
return o != null && (O = /* @__PURE__ */ ae.createElement("img", {
|
|
1178
|
-
src: o,
|
|
1179
|
-
key: o,
|
|
1180
|
-
style: { display: "none" },
|
|
1181
|
-
onLoad: () => {
|
|
1182
|
-
y(!0);
|
|
1183
|
-
},
|
|
1184
|
-
ref: d
|
|
1185
|
-
})), /* @__PURE__ */ ae.createElement(ae.Fragment, null, /* @__PURE__ */ ae.createElement("canvas", We({
|
|
1186
|
-
style: E,
|
|
1187
|
-
height: l,
|
|
1188
|
-
width: l,
|
|
1189
|
-
ref: a
|
|
1190
|
-
}, n)), O);
|
|
1191
|
-
}
|
|
1192
|
-
class Ht {
|
|
1193
|
-
// 타입 가드 함수
|
|
1194
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1195
|
-
isAccountCryptoType(i) {
|
|
1196
|
-
return typeof i == "object" && i !== null && typeof i.signature == "string" && typeof i.publicKey == "string" && typeof i.address == "string" && typeof i.network == "string" && typeof i.nickName == "string" && typeof i.etc == "string";
|
|
1197
|
-
}
|
|
1198
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1199
|
-
// private isSignature(obj: any): obj is SignatureType {
|
|
1200
|
-
// return (
|
|
1201
|
-
// typeof obj === 'object' &&
|
|
1202
|
-
// obj !== null &&
|
|
1203
|
-
// typeof obj.r === 'string' &&
|
|
1204
|
-
// typeof obj.s === 'string' &&
|
|
1205
|
-
// (typeof obj.recoveryParam === 'number' || obj.recoveryParam === null)
|
|
1206
|
-
// );
|
|
1207
|
-
// }
|
|
1208
|
-
// string으로 넘어오는 경우 객체로 바꿔서 타입 체크할 경우 사용
|
|
1209
|
-
// ex) if (this.isJsonStringOfType<CryptoInfoType>(message, this.isCryptoInfoType)) {
|
|
1210
|
-
// private isJsonStringOfType<T>(str: string, isOfType: (obj: any) => obj is T) {
|
|
1211
|
-
// try {
|
|
1212
|
-
// const obj = JSON.parse(str);
|
|
1213
|
-
// return isOfType(obj);
|
|
1214
|
-
// } catch (e) {
|
|
1215
|
-
// return false;
|
|
1216
|
-
// }
|
|
1217
|
-
// }
|
|
1218
|
-
getAccountCrypto() {
|
|
1219
|
-
return new Promise((i, u) => {
|
|
1220
|
-
j.onMessageReceived("accountInfo", (l) => {
|
|
1221
|
-
this.isAccountCryptoType(l) ? i(l) : u(new Error("Invalid account crypto"));
|
|
1222
|
-
});
|
|
1223
|
-
});
|
|
1224
|
-
}
|
|
1225
|
-
reciveRequest() {
|
|
1226
|
-
return new Promise((i, u) => {
|
|
1227
|
-
j.onMessageReceived("requestMessage", (l) => {
|
|
1228
|
-
l.message === "Request Message" ? i(!0) : u(new Error("Request message is different"));
|
|
1229
|
-
});
|
|
1230
|
-
});
|
|
1231
|
-
}
|
|
1232
|
-
sendMessage(i, u) {
|
|
1233
|
-
return new Promise((l, m) => {
|
|
1234
|
-
j.confirmMessage(i, u).connected ? l() : m(new Error("Send failed"));
|
|
1235
|
-
});
|
|
1236
|
-
}
|
|
1237
|
-
async qrLogin(i, u, l) {
|
|
1238
|
-
try {
|
|
1239
|
-
if (await this.reciveRequest()) {
|
|
1240
|
-
u = `${u}
|
|
1241
|
-
|
|
1242
|
-
Nonce: ${l}`, await this.sendMessage(i, u);
|
|
1243
|
-
const { publicKey: h, signature: p, address: _, network: t, nickName: r } = await this.getAccountCrypto();
|
|
1244
|
-
if (!Qe.xphereVerify(u, h, p))
|
|
1245
|
-
throw new Error("Verification failed");
|
|
1246
|
-
return { address: _, network: t, signature: p, publicKey: h, nickName: r };
|
|
1247
|
-
} else
|
|
1248
|
-
throw new Error("Verification failed");
|
|
1249
|
-
} catch (m) {
|
|
1250
|
-
return Promise.reject(m);
|
|
1251
|
-
} finally {
|
|
1252
|
-
j.leaveRoom(i);
|
|
1253
|
-
}
|
|
1254
|
-
}
|
|
1255
|
-
}
|
|
1256
|
-
const Wt = new Ht(), et = "data:image/svg+xml,%3csvg%20width='167'%20height='166'%20viewBox='0%200%20167%20166'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M116.052%20115.296H166.355H166.36V0H51.0675V50.3042H0.759995V165.6H116.052V115.296ZM90.3366%2065.3428L40.21%20115.296H40.4307L40.2551%20115.471H101.014V150.561H15.7981V65.3428H90.3366ZM76.7327%20100.257H151.317V15.0386H66.1006V50.1536L109.424%2050.3042H126.684L126.624%2050.364L126.669%2050.3642L113.846%2063.1431L76.7327%20100.257Z'%20fill='url(%23paint0_linear_2322_66)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_2322_66'%20x1='167.74'%20y1='-2.07'%20x2='-3.37985'%20y2='172.5'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%231349F8'/%3e%3cstop%20offset='1'%20stop-color='%235C13F8'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e", Zt = ({
|
|
1257
|
-
availableNetworks: v,
|
|
1258
|
-
dapp: i,
|
|
1259
|
-
url: u,
|
|
1260
|
-
sigMessage: l,
|
|
1261
|
-
validTime: m,
|
|
1262
|
-
onReceive: h,
|
|
1263
|
-
isShowLogo: p = !1,
|
|
1264
|
-
logoSize: _ = 30,
|
|
1265
|
-
...t
|
|
1266
|
-
}) => {
|
|
1267
|
-
const [r, n] = ye(!0), o = Qe.generateNonce(16), { qrCode: a, roomId: d } = Ge.generateQrCode("login", i, u, v);
|
|
1268
|
-
return W(() => {
|
|
1269
|
-
const f = setTimeout(
|
|
1270
|
-
() => {
|
|
1271
|
-
j.leaveRoom(d), n(!1);
|
|
1272
|
-
},
|
|
1273
|
-
m * 60 * 1e3
|
|
1274
|
-
);
|
|
1275
|
-
return () => clearTimeout(f);
|
|
1276
|
-
}, [d, m]), W(() => {
|
|
1277
|
-
(async () => {
|
|
1278
|
-
try {
|
|
1279
|
-
console.log("roomId", d);
|
|
1280
|
-
const y = await Wt.qrLogin(d, l, o), E = `${l}
|
|
1281
|
-
|
|
1282
|
-
Nonce: ${o}`, O = {
|
|
1283
|
-
publicKey: y.publicKey,
|
|
1284
|
-
message: E
|
|
1285
|
-
}, R = {
|
|
1286
|
-
isSuccess: !0,
|
|
1287
|
-
account: {
|
|
1288
|
-
address: y.address,
|
|
1289
|
-
network: y.network,
|
|
1290
|
-
nickName: y.nickName
|
|
1291
|
-
},
|
|
1292
|
-
payload: O,
|
|
1293
|
-
signature: y.signature
|
|
1294
|
-
};
|
|
1295
|
-
h(R);
|
|
1296
|
-
} catch {
|
|
1297
|
-
h({
|
|
1298
|
-
isSuccess: !1
|
|
1299
|
-
});
|
|
1300
|
-
}
|
|
1301
|
-
})();
|
|
1302
|
-
}, [h, l]), r ? /* @__PURE__ */ se.jsx(
|
|
1303
|
-
Ze,
|
|
1304
|
-
{
|
|
1305
|
-
value: a,
|
|
1306
|
-
...p && { imageSettings: { src: et, width: _, height: _, excavate: !1 } },
|
|
1307
|
-
...t
|
|
1308
|
-
}
|
|
1309
|
-
) : /* @__PURE__ */ se.jsx("div", { children: "QR loading error" });
|
|
1310
|
-
};
|
|
1311
|
-
class Qt {
|
|
1312
|
-
// 타입 가드 함수
|
|
1313
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1314
|
-
isAccountType(i) {
|
|
1315
|
-
return typeof i == "object" && i !== null && typeof i.address == "string" && typeof i.network == "string" && typeof i.nickName == "string";
|
|
1316
|
-
}
|
|
1317
|
-
getAccount() {
|
|
1318
|
-
return new Promise((i, u) => {
|
|
1319
|
-
j.onMessageReceived("addressProvide", (l) => {
|
|
1320
|
-
this.isAccountType(l) ? i(l) : u(new Error("Invalid address"));
|
|
1321
|
-
});
|
|
1322
|
-
});
|
|
1323
|
-
}
|
|
1324
|
-
async qrAddressProvide(i) {
|
|
1325
|
-
try {
|
|
1326
|
-
return await this.getAccount();
|
|
1327
|
-
} catch (u) {
|
|
1328
|
-
return Promise.reject(u);
|
|
1329
|
-
} finally {
|
|
1330
|
-
j.leaveRoom(i);
|
|
1331
|
-
}
|
|
1332
|
-
}
|
|
1333
|
-
}
|
|
1334
|
-
const Gt = new Qt(), er = ({
|
|
1335
|
-
availableNetworks: v,
|
|
1336
|
-
dapp: i,
|
|
1337
|
-
url: u,
|
|
1338
|
-
validTime: l,
|
|
1339
|
-
onReceive: m,
|
|
1340
|
-
isShowLogo: h = !1,
|
|
1341
|
-
logoSize: p = 30,
|
|
1342
|
-
..._
|
|
1343
|
-
}) => {
|
|
1344
|
-
const [t, r] = ye(!0), { qrCode: n, roomId: o } = Ge.generateQrCode("provide", i, u, v);
|
|
1345
|
-
return W(() => {
|
|
1346
|
-
const a = setTimeout(
|
|
1347
|
-
() => {
|
|
1348
|
-
j.leaveRoom(o), r(!1);
|
|
1349
|
-
},
|
|
1350
|
-
l * 60 * 1e3
|
|
1351
|
-
);
|
|
1352
|
-
return () => clearTimeout(a);
|
|
1353
|
-
}, [o, l]), W(() => {
|
|
1354
|
-
(async () => {
|
|
1355
|
-
try {
|
|
1356
|
-
console.log("roomId22", o);
|
|
1357
|
-
const d = await Gt.qrAddressProvide(o), f = {
|
|
1358
|
-
isSuccess: !0,
|
|
1359
|
-
address: d.address,
|
|
1360
|
-
network: d.network,
|
|
1361
|
-
nickName: d.nickName
|
|
1362
|
-
};
|
|
1363
|
-
m(f);
|
|
1364
|
-
} catch {
|
|
1365
|
-
m({
|
|
1366
|
-
isSuccess: !1
|
|
1367
|
-
});
|
|
1368
|
-
}
|
|
1369
|
-
})();
|
|
1370
|
-
}, [m]), t ? /* @__PURE__ */ se.jsx(
|
|
1371
|
-
Ze,
|
|
1372
|
-
{
|
|
1373
|
-
value: n,
|
|
1374
|
-
...h && { imageSettings: { src: et, width: p, height: p, excavate: !1 } },
|
|
1375
|
-
..._
|
|
1376
|
-
}
|
|
1377
|
-
) : /* @__PURE__ */ se.jsx("div", { children: "QR loading error" });
|
|
1378
|
-
};
|
|
1379
|
-
export {
|
|
1380
|
-
er as AddressProvideQR,
|
|
1381
|
-
Zt as LoginQR
|
|
1382
|
-
};
|