@jigowatts/jigowatts-ui 2.1.2 → 2.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.
@@ -1,8 +1,8 @@
1
- import { jsxs as N, jsx as C } from "react/jsx-runtime";
2
- import b, { useState as H, useEffect as ge, useCallback as Z } from "react";
3
- import { CheckCircleOutline as pe, HelpOutline as Ee } from "@mui/icons-material";
4
- import { Dialog as Ce, DialogTitle as we, DialogContent as Me, Box as z, Typography as I, Divider as ye, Link as Re, IconButton as be, DialogActions as ve } from "@mui/material";
5
- import { useForm as Ae } from "react-hook-form";
1
+ import { jsxs as I, jsx as C } from "react/jsx-runtime";
2
+ import v, { useState as H, useEffect as pe, useCallback as Z } from "react";
3
+ import { CheckCircleOutline as ge, HelpOutline as Ee } from "@mui/icons-material";
4
+ import { Dialog as Ce, DialogTitle as we, DialogContent as Me, Box as F, Typography as N, Divider as ye, Link as Re, IconButton as ve, DialogActions as Ae } from "@mui/material";
5
+ import { useForm as be } from "react-hook-form";
6
6
  import { Button as G } from "../Button/index.es.js";
7
7
  import { CopyableBox as Se, CopyIcon as Pe } from "../CopyableBox/index.es.js";
8
8
  import { ScrollableDialog as Ie } from "../ScrollableDialog/index.es.js";
@@ -30,14 +30,14 @@ var _e = Object.defineProperty, $ = Object.getOwnPropertySymbols, q = Object.pro
30
30
  */
31
31
  var T;
32
32
  ((u) => {
33
- const l = class p {
33
+ const l = class g {
34
34
  /*-- Constructor (low level) and fields --*/
35
35
  // Creates a new QR Code with the given version number,
36
36
  // error correction level, data codeword bytes, and mask number.
37
37
  // This is a low-level API that most users should not use directly.
38
38
  // A mid-level API is the encodeSegments() function.
39
39
  constructor(e, o, t, r) {
40
- if (this.version = e, this.errorCorrectionLevel = o, this.modules = [], this.isFunction = [], e < p.MIN_VERSION || e > p.MAX_VERSION)
40
+ if (this.version = e, this.errorCorrectionLevel = o, this.modules = [], this.isFunction = [], e < g.MIN_VERSION || e > g.MAX_VERSION)
41
41
  throw new RangeError("Version value out of range");
42
42
  if (r < -1 || r > 7)
43
43
  throw new RangeError("Mask value out of range");
@@ -57,7 +57,7 @@ var T;
57
57
  h < s && (r = m, s = h), this.applyMask(m);
58
58
  }
59
59
  }
60
- g(0 <= r && r <= 7), this.mask = r, this.applyMask(r), this.drawFormatBits(r), this.isFunction = [];
60
+ p(0 <= r && r <= 7), this.mask = r, this.applyMask(r), this.drawFormatBits(r), this.isFunction = [];
61
61
  }
62
62
  /*-- Static factory functions (high level) --*/
63
63
  // Returns a QR Code representing the given Unicode text string at the given error correction level.
@@ -67,7 +67,7 @@ var T;
67
67
  // ecl argument if it can be done without increasing the version.
68
68
  static encodeText(e, o) {
69
69
  const t = u.QrSegment.makeSegments(e);
70
- return p.encodeSegments(t, o);
70
+ return g.encodeSegments(t, o);
71
71
  }
72
72
  // Returns a QR Code representing the given binary data at the given error correction level.
73
73
  // This function always encodes using the binary segment mode, not any text mode. The maximum number of
@@ -75,7 +75,7 @@ var T;
75
75
  // The ECC level of the result may be higher than the ecl argument if it can be done without increasing the version.
76
76
  static encodeBinary(e, o) {
77
77
  const t = u.QrSegment.makeBytes(e);
78
- return p.encodeSegments([t], o);
78
+ return g.encodeSegments([t], o);
79
79
  }
80
80
  /*-- Static factory functions (mid level) --*/
81
81
  // Returns a QR Code representing the given segments with the given encoding parameters.
@@ -88,11 +88,11 @@ var T;
88
88
  // between modes (such as alphanumeric and byte) to encode text in less space.
89
89
  // This is a mid-level API; the high-level API is encodeText() and encodeBinary().
90
90
  static encodeSegments(e, o, t = 1, r = 40, n = -1, a = !0) {
91
- if (!(p.MIN_VERSION <= t && t <= r && r <= p.MAX_VERSION) || n < -1 || n > 7)
91
+ if (!(g.MIN_VERSION <= t && t <= r && r <= g.MAX_VERSION) || n < -1 || n > 7)
92
92
  throw new RangeError("Invalid value");
93
93
  let s, m;
94
94
  for (s = t; ; s++) {
95
- const f = p.getNumDataCodewords(s, o) * 8, M = w.getTotalBits(e, s);
95
+ const f = g.getNumDataCodewords(s, o) * 8, M = w.getTotalBits(e, s);
96
96
  if (M <= f) {
97
97
  m = M;
98
98
  break;
@@ -100,23 +100,23 @@ var T;
100
100
  if (s >= r)
101
101
  throw new RangeError("Data too long");
102
102
  }
103
- for (const f of [p.Ecc.MEDIUM, p.Ecc.QUARTILE, p.Ecc.HIGH])
104
- a && m <= p.getNumDataCodewords(s, f) * 8 && (o = f);
103
+ for (const f of [g.Ecc.MEDIUM, g.Ecc.QUARTILE, g.Ecc.HIGH])
104
+ a && m <= g.getNumDataCodewords(s, f) * 8 && (o = f);
105
105
  let h = [];
106
106
  for (const f of e) {
107
107
  i(f.mode.modeBits, 4, h), i(f.numChars, f.mode.numCharCountBits(s), h);
108
108
  for (const M of f.getData())
109
109
  h.push(M);
110
110
  }
111
- g(h.length == m);
112
- const A = p.getNumDataCodewords(s, o) * 8;
113
- g(h.length <= A), i(0, Math.min(4, A - h.length), h), i(0, (8 - h.length % 8) % 8, h), g(h.length % 8 == 0);
114
- for (let f = 236; h.length < A; f ^= 253)
111
+ p(h.length == m);
112
+ const b = g.getNumDataCodewords(s, o) * 8;
113
+ p(h.length <= b), i(0, Math.min(4, b - h.length), h), i(0, (8 - h.length % 8) % 8, h), p(h.length % 8 == 0);
114
+ for (let f = 236; h.length < b; f ^= 253)
115
115
  i(f, 8, h);
116
116
  let R = [];
117
117
  for (; R.length * 8 < h.length; )
118
118
  R.push(0);
119
- return h.forEach((f, M) => R[M >>> 3] |= f << 7 - (M & 7)), new p(s, o, R, n);
119
+ return h.forEach((f, M) => R[M >>> 3] |= f << 7 - (M & 7)), new g(s, o, R, n);
120
120
  }
121
121
  /*-- Accessor methods --*/
122
122
  // Returns the color of the module (pixel) at the given coordinates, which is false
@@ -149,7 +149,7 @@ var T;
149
149
  for (let n = 0; n < 10; n++)
150
150
  t = t << 1 ^ (t >>> 9) * 1335;
151
151
  const r = (o << 10 | t) ^ 21522;
152
- g(r >>> 15 == 0);
152
+ p(r >>> 15 == 0);
153
153
  for (let n = 0; n <= 5; n++)
154
154
  this.setFunctionModule(8, n, c(r, n));
155
155
  this.setFunctionModule(8, 7, c(r, 6)), this.setFunctionModule(8, 8, c(r, 7)), this.setFunctionModule(7, 8, c(r, 8));
@@ -170,7 +170,7 @@ var T;
170
170
  for (let t = 0; t < 12; t++)
171
171
  e = e << 1 ^ (e >>> 11) * 7973;
172
172
  const o = this.version << 12 | e;
173
- g(o >>> 18 == 0);
173
+ p(o >>> 18 == 0);
174
174
  for (let t = 0; t < 18; t++) {
175
175
  const r = c(o, t), n = this.size - 11 + t % 3, a = Math.floor(t / 3);
176
176
  this.setFunctionModule(n, a, r), this.setFunctionModule(a, n, r);
@@ -202,15 +202,15 @@ var T;
202
202
  // codewords appended to it, based on this object's version and error correction level.
203
203
  addEccAndInterleave(e) {
204
204
  const o = this.version, t = this.errorCorrectionLevel;
205
- if (e.length != p.getNumDataCodewords(o, t))
205
+ if (e.length != g.getNumDataCodewords(o, t))
206
206
  throw new RangeError("Invalid argument");
207
- const r = p.NUM_ERROR_CORRECTION_BLOCKS[t.ordinal][o], n = p.ECC_CODEWORDS_PER_BLOCK[t.ordinal][o], a = Math.floor(p.getNumRawDataModules(o) / 8), s = r - a % r, m = Math.floor(a / r);
207
+ const r = g.NUM_ERROR_CORRECTION_BLOCKS[t.ordinal][o], n = g.ECC_CODEWORDS_PER_BLOCK[t.ordinal][o], a = Math.floor(g.getNumRawDataModules(o) / 8), s = r - a % r, m = Math.floor(a / r);
208
208
  let h = [];
209
- const A = p.reedSolomonComputeDivisor(n);
209
+ const b = g.reedSolomonComputeDivisor(n);
210
210
  for (let f = 0, M = 0; f < r; f++) {
211
211
  let P = e.slice(M, M + m - n + (f < s ? 0 : 1));
212
212
  M += P.length;
213
- const D = p.reedSolomonComputeRemainder(P, A);
213
+ const D = g.reedSolomonComputeRemainder(P, b);
214
214
  f < s && P.push(0), h.push(P.concat(D));
215
215
  }
216
216
  let R = [];
@@ -218,12 +218,12 @@ var T;
218
218
  h.forEach((M, P) => {
219
219
  (f != m - n || P >= s) && R.push(M[f]);
220
220
  });
221
- return g(R.length == a), R;
221
+ return p(R.length == a), R;
222
222
  }
223
223
  // Draws the given sequence of 8-bit codewords (data and error correction) onto the entire
224
224
  // data area of this QR Code. Function modules need to be marked off before this is called.
225
225
  drawCodewords(e) {
226
- if (e.length != Math.floor(p.getNumRawDataModules(this.version) / 8))
226
+ if (e.length != Math.floor(g.getNumRawDataModules(this.version) / 8))
227
227
  throw new RangeError("Invalid argument");
228
228
  let o = 0;
229
229
  for (let t = this.size - 1; t >= 1; t -= 2) {
@@ -234,7 +234,7 @@ var T;
234
234
  !this.isFunction[m][a] && o < e.length * 8 && (this.modules[m][a] = c(e[o >>> 3], 7 - (o & 7)), o++);
235
235
  }
236
236
  }
237
- g(o == e.length * 8);
237
+ p(o == e.length * 8);
238
238
  }
239
239
  // XORs the codeword modules in this QR Code with the given mask pattern.
240
240
  // The function modules must be marked and the codeword bits must be drawn
@@ -285,25 +285,25 @@ var T;
285
285
  for (let n = 0; n < this.size; n++) {
286
286
  let a = !1, s = 0, m = [0, 0, 0, 0, 0, 0, 0];
287
287
  for (let h = 0; h < this.size; h++)
288
- this.modules[n][h] == a ? (s++, s == 5 ? e += p.PENALTY_N1 : s > 5 && e++) : (this.finderPenaltyAddHistory(s, m), a || (e += this.finderPenaltyCountPatterns(m) * p.PENALTY_N3), a = this.modules[n][h], s = 1);
289
- e += this.finderPenaltyTerminateAndCount(a, s, m) * p.PENALTY_N3;
288
+ this.modules[n][h] == a ? (s++, s == 5 ? e += g.PENALTY_N1 : s > 5 && e++) : (this.finderPenaltyAddHistory(s, m), a || (e += this.finderPenaltyCountPatterns(m) * g.PENALTY_N3), a = this.modules[n][h], s = 1);
289
+ e += this.finderPenaltyTerminateAndCount(a, s, m) * g.PENALTY_N3;
290
290
  }
291
291
  for (let n = 0; n < this.size; n++) {
292
292
  let a = !1, s = 0, m = [0, 0, 0, 0, 0, 0, 0];
293
293
  for (let h = 0; h < this.size; h++)
294
- this.modules[h][n] == a ? (s++, s == 5 ? e += p.PENALTY_N1 : s > 5 && e++) : (this.finderPenaltyAddHistory(s, m), a || (e += this.finderPenaltyCountPatterns(m) * p.PENALTY_N3), a = this.modules[h][n], s = 1);
295
- e += this.finderPenaltyTerminateAndCount(a, s, m) * p.PENALTY_N3;
294
+ this.modules[h][n] == a ? (s++, s == 5 ? e += g.PENALTY_N1 : s > 5 && e++) : (this.finderPenaltyAddHistory(s, m), a || (e += this.finderPenaltyCountPatterns(m) * g.PENALTY_N3), a = this.modules[h][n], s = 1);
295
+ e += this.finderPenaltyTerminateAndCount(a, s, m) * g.PENALTY_N3;
296
296
  }
297
297
  for (let n = 0; n < this.size - 1; n++)
298
298
  for (let a = 0; a < this.size - 1; a++) {
299
299
  const s = this.modules[n][a];
300
- s == this.modules[n][a + 1] && s == this.modules[n + 1][a] && s == this.modules[n + 1][a + 1] && (e += p.PENALTY_N2);
300
+ s == this.modules[n][a + 1] && s == this.modules[n + 1][a] && s == this.modules[n + 1][a + 1] && (e += g.PENALTY_N2);
301
301
  }
302
302
  let o = 0;
303
303
  for (const n of this.modules)
304
304
  o = n.reduce((a, s) => a + (s ? 1 : 0), o);
305
305
  const t = this.size * this.size, r = Math.ceil(Math.abs(o * 20 - t * 10) / t) - 1;
306
- return g(0 <= r && r <= 9), e += r * p.PENALTY_N4, g(0 <= e && e <= 2568888), e;
306
+ return p(0 <= r && r <= 9), e += r * g.PENALTY_N4, p(0 <= e && e <= 2568888), e;
307
307
  }
308
308
  /*-- Private helper functions --*/
309
309
  // Returns an ascending list of positions of alignment patterns for this version number.
@@ -324,20 +324,20 @@ var T;
324
324
  // all function modules are excluded. This includes remainder bits, so it might not be a multiple of 8.
325
325
  // The result is in the range [208, 29648]. This could be implemented as a 40-entry lookup table.
326
326
  static getNumRawDataModules(e) {
327
- if (e < p.MIN_VERSION || e > p.MAX_VERSION)
327
+ if (e < g.MIN_VERSION || e > g.MAX_VERSION)
328
328
  throw new RangeError("Version number out of range");
329
329
  let o = (16 * e + 128) * e + 64;
330
330
  if (e >= 2) {
331
331
  const t = Math.floor(e / 7) + 2;
332
332
  o -= (25 * t - 10) * t - 55, e >= 7 && (o -= 36);
333
333
  }
334
- return g(208 <= o && o <= 29648), o;
334
+ return p(208 <= o && o <= 29648), o;
335
335
  }
336
336
  // Returns the number of 8-bit data (i.e. not error correction) codewords contained in any
337
337
  // QR Code of the given version number and error correction level, with remainder bits discarded.
338
338
  // This stateless pure function could be implemented as a (40*4)-cell lookup table.
339
339
  static getNumDataCodewords(e, o) {
340
- return Math.floor(p.getNumRawDataModules(e) / 8) - p.ECC_CODEWORDS_PER_BLOCK[o.ordinal][e] * p.NUM_ERROR_CORRECTION_BLOCKS[o.ordinal][e];
340
+ return Math.floor(g.getNumRawDataModules(e) / 8) - g.ECC_CODEWORDS_PER_BLOCK[o.ordinal][e] * g.NUM_ERROR_CORRECTION_BLOCKS[o.ordinal][e];
341
341
  }
342
342
  // Returns a Reed-Solomon ECC generator polynomial for the given degree. This could be
343
343
  // implemented as a lookup table over all possible parameter values, instead of as an algorithm.
@@ -351,8 +351,8 @@ var T;
351
351
  let t = 1;
352
352
  for (let r = 0; r < e; r++) {
353
353
  for (let n = 0; n < o.length; n++)
354
- o[n] = p.reedSolomonMultiply(o[n], t), n + 1 < o.length && (o[n] ^= o[n + 1]);
355
- t = p.reedSolomonMultiply(t, 2);
354
+ o[n] = g.reedSolomonMultiply(o[n], t), n + 1 < o.length && (o[n] ^= o[n + 1]);
355
+ t = g.reedSolomonMultiply(t, 2);
356
356
  }
357
357
  return o;
358
358
  }
@@ -361,7 +361,7 @@ var T;
361
361
  let t = o.map((r) => 0);
362
362
  for (const r of e) {
363
363
  const n = r ^ t.shift();
364
- t.push(0), o.forEach((a, s) => t[s] ^= p.reedSolomonMultiply(a, n));
364
+ t.push(0), o.forEach((a, s) => t[s] ^= g.reedSolomonMultiply(a, n));
365
365
  }
366
366
  return t;
367
367
  }
@@ -373,13 +373,13 @@ var T;
373
373
  let t = 0;
374
374
  for (let r = 7; r >= 0; r--)
375
375
  t = t << 1 ^ (t >>> 7) * 285, t ^= (o >>> r & 1) * e;
376
- return g(t >>> 8 == 0), t;
376
+ return p(t >>> 8 == 0), t;
377
377
  }
378
378
  // Can only be called immediately after a light run is added, and
379
379
  // returns either 0, 1, or 2. A helper function for getPenaltyScore().
380
380
  finderPenaltyCountPatterns(e) {
381
381
  const o = e[1];
382
- g(o <= this.size * 3);
382
+ p(o <= this.size * 3);
383
383
  const t = o > 0 && e[2] == o && e[3] == o * 3 && e[4] == o && e[5] == o;
384
384
  return (t && e[0] >= o * 4 && e[6] >= o ? 1 : 0) + (t && e[6] >= o * 4 && e[0] >= o ? 1 : 0);
385
385
  }
@@ -424,7 +424,7 @@ var T;
424
424
  function c(E, e) {
425
425
  return (E >>> e & 1) != 0;
426
426
  }
427
- function g(E) {
427
+ function p(E) {
428
428
  if (!E)
429
429
  throw new Error("Assertion error");
430
430
  }
@@ -539,8 +539,8 @@ var T;
539
539
  const i = class {
540
540
  // The QR Code can tolerate about 30% erroneous codewords
541
541
  /*-- Constructor and fields --*/
542
- constructor(g, d) {
543
- this.ordinal = g, this.formatBits = d;
542
+ constructor(p, d) {
543
+ this.ordinal = p, this.formatBits = d;
544
544
  }
545
545
  };
546
546
  i.LOW = new i(0, 1), i.MEDIUM = new i(1, 0), i.QUARTILE = new i(2, 3), i.HIGH = new i(3, 2), l.Ecc = i;
@@ -550,47 +550,47 @@ var T;
550
550
  ((l) => {
551
551
  const i = class {
552
552
  /*-- Constructor and fields --*/
553
- constructor(g, d) {
554
- this.modeBits = g, this.numBitsCharCount = d;
553
+ constructor(p, d) {
554
+ this.modeBits = p, this.numBitsCharCount = d;
555
555
  }
556
556
  /*-- Method --*/
557
557
  // (Package-private) Returns the bit width of the character count field for a segment in
558
558
  // this mode in a QR Code at the given version number. The result is in the range [0, 16].
559
- numCharCountBits(g) {
560
- return this.numBitsCharCount[Math.floor((g + 7) / 17)];
559
+ numCharCountBits(p) {
560
+ return this.numBitsCharCount[Math.floor((p + 7) / 17)];
561
561
  }
562
562
  };
563
563
  i.NUMERIC = new i(1, [10, 12, 14]), i.ALPHANUMERIC = new i(2, [9, 11, 13]), i.BYTE = new i(4, [8, 16, 16]), i.KANJI = new i(8, [8, 10, 12]), i.ECI = new i(7, [0, 0, 0]), l.Mode = i;
564
564
  })(u.QrSegment || (u.QrSegment = {}));
565
565
  })(T || (T = {}));
566
- var F = T;
566
+ var B = T;
567
567
  /**
568
568
  * @license qrcode.react
569
569
  * Copyright (c) Paul O'Shannessy
570
570
  * SPDX-License-Identifier: ISC
571
571
  */
572
572
  var Oe = {
573
- L: F.QrCode.Ecc.LOW,
574
- M: F.QrCode.Ecc.MEDIUM,
575
- Q: F.QrCode.Ecc.QUARTILE,
576
- H: F.QrCode.Ecc.HIGH
573
+ L: B.QrCode.Ecc.LOW,
574
+ M: B.QrCode.Ecc.MEDIUM,
575
+ Q: B.QrCode.Ecc.QUARTILE,
576
+ H: B.QrCode.Ecc.HIGH
577
577
  }, te = 128, oe = "L", re = "#FFFFFF", ne = "#000000", ie = !1, se = 1, De = 4, Le = 0, Te = 0.1;
578
578
  function le(u, l = 0) {
579
579
  const i = [];
580
- return u.forEach(function(c, g) {
580
+ return u.forEach(function(c, p) {
581
581
  let d = null;
582
582
  c.forEach(function(w, E) {
583
583
  if (!w && d !== null) {
584
584
  i.push(
585
- `M${d + l} ${g + l}h${E - d}v1H${d + l}z`
585
+ `M${d + l} ${p + l}h${E - d}v1H${d + l}z`
586
586
  ), d = null;
587
587
  return;
588
588
  }
589
589
  if (E === c.length - 1) {
590
590
  if (!w)
591
591
  return;
592
- d === null ? i.push(`M${E + l},${g + l} h1v1H${E + l}z`) : i.push(
593
- `M${d + l},${g + l} h${E + 1 - d}v1H${d + l}z`
592
+ d === null ? i.push(`M${E + l},${p + l} h1v1H${E + l}z`) : i.push(
593
+ `M${d + l},${p + l} h${E + 1 - d}v1H${d + l}z`
594
594
  );
595
595
  return;
596
596
  }
@@ -599,16 +599,16 @@ function le(u, l = 0) {
599
599
  }), i.join("");
600
600
  }
601
601
  function ae(u, l) {
602
- return u.slice().map((i, c) => c < l.y || c >= l.y + l.h ? i : i.map((g, d) => d < l.x || d >= l.x + l.w ? g : !1));
602
+ return u.slice().map((i, c) => c < l.y || c >= l.y + l.h ? i : i.map((p, d) => d < l.x || d >= l.x + l.w ? p : !1));
603
603
  }
604
604
  function xe(u, l, i, c) {
605
605
  if (c == null)
606
606
  return null;
607
- const g = u.length + i * 2, d = Math.floor(l * Te), w = g / l, E = (c.width || d) * w, e = (c.height || d) * w, o = c.x == null ? u.length / 2 - E / 2 : c.x * w, t = c.y == null ? u.length / 2 - e / 2 : c.y * w, r = c.opacity == null ? 1 : c.opacity;
607
+ const p = u.length + i * 2, d = Math.floor(l * Te), w = p / l, E = (c.width || d) * w, e = (c.height || d) * w, o = c.x == null ? u.length / 2 - E / 2 : c.x * w, t = c.y == null ? u.length / 2 - e / 2 : c.y * w, r = c.opacity == null ? 1 : c.opacity;
608
608
  let n = null;
609
609
  if (c.excavate) {
610
- let s = Math.floor(o), m = Math.floor(t), h = Math.ceil(E + o - s), A = Math.ceil(e + t - m);
611
- n = { x: s, y: m, w: h, h: A };
610
+ let s = Math.floor(o), m = Math.floor(t), h = Math.ceil(E + o - s), b = Math.ceil(e + t - m);
611
+ n = { x: s, y: m, w: h, h: b };
612
612
  }
613
613
  const a = c.crossOrigin;
614
614
  return { x: o, y: t, h: e, w: E, excavation: n, opacity: r, crossOrigin: a };
@@ -621,14 +621,14 @@ function ce({
621
621
  level: l,
622
622
  minVersion: i,
623
623
  includeMargin: c,
624
- marginSize: g,
624
+ marginSize: p,
625
625
  imageSettings: d,
626
626
  size: w,
627
627
  boostLevel: E
628
628
  }) {
629
- let e = b.useMemo(() => {
630
- const s = (Array.isArray(u) ? u : [u]).reduce((m, h) => (m.push(...F.QrSegment.makeSegments(h)), m), []);
631
- return F.QrCode.encodeSegments(
629
+ let e = v.useMemo(() => {
630
+ const s = (Array.isArray(u) ? u : [u]).reduce((m, h) => (m.push(...B.QrSegment.makeSegments(h)), m), []);
631
+ return B.QrCode.encodeSegments(
632
632
  s,
633
633
  Oe[l],
634
634
  i,
@@ -637,9 +637,9 @@ function ce({
637
637
  E
638
638
  );
639
639
  }, [u, l, i, E]);
640
- const { cells: o, margin: t, numCells: r, calculatedImageSettings: n } = b.useMemo(() => {
640
+ const { cells: o, margin: t, numCells: r, calculatedImageSettings: n } = v.useMemo(() => {
641
641
  let a = e.getModules();
642
- const s = Fe(c, g), m = a.length + s * 2, h = xe(
642
+ const s = Fe(c, p), m = a.length + s * 2, h = xe(
643
643
  a,
644
644
  w,
645
645
  s,
@@ -651,7 +651,7 @@ function ce({
651
651
  numCells: m,
652
652
  calculatedImageSettings: h
653
653
  };
654
- }, [e, w, d, c, g]);
654
+ }, [e, w, d, c, p]);
655
655
  return {
656
656
  qrcode: e,
657
657
  margin: t,
@@ -667,10 +667,10 @@ var Be = function() {
667
667
  return !1;
668
668
  }
669
669
  return !0;
670
- }(), ke = b.forwardRef(
670
+ }(), ke = v.forwardRef(
671
671
  function(l, i) {
672
672
  const c = l, {
673
- value: g,
673
+ value: p,
674
674
  size: d = te,
675
675
  level: w = oe,
676
676
  bgColor: E = re,
@@ -691,13 +691,13 @@ var Be = function() {
691
691
  "boostLevel",
692
692
  "marginSize",
693
693
  "imageSettings"
694
- ]), { style: h } = m, A = Y(m, ["style"]), R = a == null ? void 0 : a.src, f = b.useRef(null), M = b.useRef(null), P = b.useCallback(
695
- (v) => {
696
- f.current = v, typeof i == "function" ? i(v) : i && (i.current = v);
694
+ ]), { style: h } = m, b = Y(m, ["style"]), R = a == null ? void 0 : a.src, f = v.useRef(null), M = v.useRef(null), P = v.useCallback(
695
+ (A) => {
696
+ f.current = A, typeof i == "function" ? i(A) : i && (i.current = A);
697
697
  },
698
698
  [i]
699
- ), [D, U] = b.useState(!1), { margin: O, cells: B, numCells: x, calculatedImageSettings: S } = ce({
700
- value: g,
699
+ ), [D, U] = v.useState(!1), { margin: O, cells: k, numCells: x, calculatedImageSettings: S } = ce({
700
+ value: p,
701
701
  level: w,
702
702
  minVersion: t,
703
703
  boostLevel: r,
@@ -706,38 +706,38 @@ var Be = function() {
706
706
  imageSettings: a,
707
707
  size: d
708
708
  });
709
- b.useEffect(() => {
709
+ v.useEffect(() => {
710
710
  if (f.current != null) {
711
- const v = f.current, _ = v.getContext("2d");
711
+ const A = f.current, _ = A.getContext("2d");
712
712
  if (!_)
713
713
  return;
714
- let W = B;
715
- const k = M.current, X = S != null && k !== null && k.complete && k.naturalHeight !== 0 && k.naturalWidth !== 0;
714
+ let W = k;
715
+ const z = M.current, X = S != null && z !== null && z.complete && z.naturalHeight !== 0 && z.naturalWidth !== 0;
716
716
  X && S.excavation != null && (W = ae(
717
- B,
717
+ k,
718
718
  S.excavation
719
719
  ));
720
720
  const j = window.devicePixelRatio || 1;
721
- v.height = v.width = d * j;
721
+ A.height = A.width = d * j;
722
722
  const K = d / x * j;
723
- _.scale(K, K), _.fillStyle = E, _.fillRect(0, 0, x, x), _.fillStyle = e, Be ? _.fill(new Path2D(le(W, O))) : B.forEach(function(he, de) {
723
+ _.scale(K, K), _.fillStyle = E, _.fillRect(0, 0, x, x), _.fillStyle = e, Be ? _.fill(new Path2D(le(W, O))) : k.forEach(function(he, de) {
724
724
  he.forEach(function(fe, me) {
725
725
  fe && _.fillRect(me + O, de + O, 1, 1);
726
726
  });
727
727
  }), S && (_.globalAlpha = S.opacity), X && _.drawImage(
728
- k,
728
+ z,
729
729
  S.x + O,
730
730
  S.y + O,
731
731
  S.w,
732
732
  S.h
733
733
  );
734
734
  }
735
- }), b.useEffect(() => {
735
+ }), v.useEffect(() => {
736
736
  U(!1);
737
737
  }, [R]);
738
738
  const Q = V({ height: d, width: d }, h);
739
739
  let L = null;
740
- return R != null && (L = /* @__PURE__ */ b.createElement(
740
+ return R != null && (L = /* @__PURE__ */ v.createElement(
741
741
  "img",
742
742
  {
743
743
  src: R,
@@ -749,7 +749,7 @@ var Be = function() {
749
749
  ref: M,
750
750
  crossOrigin: S == null ? void 0 : S.crossOrigin
751
751
  }
752
- )), /* @__PURE__ */ b.createElement(b.Fragment, null, /* @__PURE__ */ b.createElement(
752
+ )), /* @__PURE__ */ v.createElement(v.Fragment, null, /* @__PURE__ */ v.createElement(
753
753
  "canvas",
754
754
  V({
755
755
  style: Q,
@@ -757,15 +757,15 @@ var Be = function() {
757
757
  width: d,
758
758
  ref: P,
759
759
  role: "img"
760
- }, A)
760
+ }, b)
761
761
  ), L);
762
762
  }
763
763
  );
764
764
  ke.displayName = "QRCodeCanvas";
765
- var ue = b.forwardRef(
765
+ var ue = v.forwardRef(
766
766
  function(l, i) {
767
767
  const c = l, {
768
- value: g,
768
+ value: p,
769
769
  size: d = te,
770
770
  level: w = oe,
771
771
  bgColor: E = re,
@@ -788,8 +788,8 @@ var ue = b.forwardRef(
788
788
  "title",
789
789
  "marginSize",
790
790
  "imageSettings"
791
- ]), { margin: h, cells: A, numCells: R, calculatedImageSettings: f } = ce({
792
- value: g,
791
+ ]), { margin: h, cells: b, numCells: R, calculatedImageSettings: f } = ce({
792
+ value: p,
793
793
  level: w,
794
794
  minVersion: t,
795
795
  boostLevel: r,
@@ -798,11 +798,11 @@ var ue = b.forwardRef(
798
798
  imageSettings: s,
799
799
  size: d
800
800
  });
801
- let M = A, P = null;
801
+ let M = b, P = null;
802
802
  s != null && f != null && (f.excavation != null && (M = ae(
803
- A,
803
+ b,
804
804
  f.excavation
805
- )), P = /* @__PURE__ */ b.createElement(
805
+ )), P = /* @__PURE__ */ v.createElement(
806
806
  "image",
807
807
  {
808
808
  href: s.src,
@@ -816,7 +816,7 @@ var ue = b.forwardRef(
816
816
  }
817
817
  ));
818
818
  const D = le(M, h);
819
- return /* @__PURE__ */ b.createElement(
819
+ return /* @__PURE__ */ v.createElement(
820
820
  "svg",
821
821
  V({
822
822
  height: d,
@@ -825,8 +825,8 @@ var ue = b.forwardRef(
825
825
  ref: i,
826
826
  role: "img"
827
827
  }, m),
828
- !!n && /* @__PURE__ */ b.createElement("title", null, n),
829
- /* @__PURE__ */ b.createElement(
828
+ !!n && /* @__PURE__ */ v.createElement("title", null, n),
829
+ /* @__PURE__ */ v.createElement(
830
830
  "path",
831
831
  {
832
832
  fill: E,
@@ -834,7 +834,7 @@ var ue = b.forwardRef(
834
834
  shapeRendering: "crispEdges"
835
835
  }
836
836
  ),
837
- /* @__PURE__ */ b.createElement("path", { fill: e, d: D, shapeRendering: "crispEdges" }),
837
+ /* @__PURE__ */ v.createElement("path", { fill: e, d: D, shapeRendering: "crispEdges" }),
838
838
  P
839
839
  );
840
840
  }
@@ -872,7 +872,7 @@ const ze = {
872
872
  open: l,
873
873
  qrUrl: i,
874
874
  secretKey: c,
875
- onCloseDialog: g,
875
+ onCloseDialog: p,
876
876
  onSubmit: d,
877
877
  showSkipButton: w = !1,
878
878
  dictionary: E
@@ -883,65 +883,65 @@ const ze = {
883
883
  setError: n,
884
884
  watch: a,
885
885
  formState: { errors: s }
886
- } = Ae({
886
+ } = be({
887
887
  defaultValues: { code: Array(6).fill("") },
888
888
  mode: "onSubmit"
889
- }), [m, h] = H(!1), [A, R] = H(""), [f, M] = H(!1), [P, D] = H(!1), U = (L) => {
889
+ }), [m, h] = H(!1), [b, R] = H(""), [f, M] = H(!1), [P, D] = H(!1), U = (L) => {
890
890
  n("root.server", {
891
891
  type: "serverError",
892
892
  message: L
893
893
  });
894
894
  };
895
- ge(() => {
895
+ pe(() => {
896
896
  l && (r({ code: Array(6).fill("") }), h(!1), M(!1));
897
897
  }, [l, r]);
898
898
  const O = Z(async () => {
899
899
  const L = a("code").join("");
900
900
  M(!0);
901
901
  try {
902
- const v = await d(L);
903
- v !== void 0 && v !== "" && (R(v), h(!0));
904
- } catch (v) {
902
+ const A = await d(L);
903
+ A !== void 0 && A !== "" && (R(A), h(!0));
904
+ } catch (A) {
905
905
  r({ code: Array(6).fill("") }), U(
906
- v instanceof Error ? v.message : "予期せぬエラーが発生しました"
906
+ A instanceof Error ? A.message : "予期せぬエラーが発生しました"
907
907
  );
908
908
  } finally {
909
909
  M(!1);
910
910
  }
911
- }, [d, r, a]), B = Z(
912
- (L, v) => {
913
- (w || f) && v === "backdropClick" || g("cancel");
911
+ }, [d, r, a]), k = Z(
912
+ (L, A) => {
913
+ (w || f) && A === "backdropClick" || p("cancel");
914
914
  },
915
- [w, f, g]
915
+ [w, f, p]
916
916
  ), x = () => {
917
917
  D(!0);
918
918
  }, S = () => {
919
919
  D(!1);
920
920
  };
921
- return /* @__PURE__ */ N(
921
+ return /* @__PURE__ */ I(
922
922
  Ce,
923
923
  {
924
924
  open: l,
925
- onClose: B,
925
+ onClose: k,
926
926
  scroll: "paper",
927
927
  "aria-labelledby": "scroll-dialog-title",
928
928
  "aria-describedby": "scroll-dialog-description",
929
929
  children: [
930
930
  /* @__PURE__ */ C(we, { id: "scroll-dialog-title", children: e.dialog_title }),
931
- /* @__PURE__ */ N("form", { onSubmit: t(O), children: [
931
+ /* @__PURE__ */ I("form", { onSubmit: t(O), children: [
932
932
  /* @__PURE__ */ C(Me, { dividers: !0, children: m ? (
933
933
  // バックアップコード表示画面
934
- /* @__PURE__ */ N(
935
- z,
934
+ /* @__PURE__ */ I(
935
+ F,
936
936
  {
937
937
  sx: { maxWidth: "400px", margin: "0 auto", textAlign: "center" },
938
938
  children: [
939
- /* @__PURE__ */ C(pe, { color: "success", sx: { fontSize: 100 } }),
940
- /* @__PURE__ */ C(I, { variant: "h6", children: e.two_fa_complete }),
939
+ /* @__PURE__ */ C(ge, { color: "success", sx: { fontSize: 100 } }),
940
+ /* @__PURE__ */ C(N, { variant: "h6", children: e.two_fa_complete }),
941
941
  /* @__PURE__ */ C(ye, { sx: { margin: "16px 0" } }),
942
- /* @__PURE__ */ C(I, { variant: "h6", children: e.backup_code_info }),
942
+ /* @__PURE__ */ C(N, { variant: "h6", children: e.backup_code_info }),
943
943
  /* @__PURE__ */ C(
944
- I,
944
+ N,
945
945
  {
946
946
  variant: "body2",
947
947
  align: "left",
@@ -949,15 +949,15 @@ const ze = {
949
949
  children: e.backup_code_description
950
950
  }
951
951
  ),
952
- /* @__PURE__ */ C(Se, { text: A })
952
+ /* @__PURE__ */ C(Se, { text: b })
953
953
  ]
954
954
  }
955
955
  )
956
956
  ) : (
957
957
  // 二段階認証適用画面
958
- /* @__PURE__ */ N(z, { sx: { maxWidth: "400px", margin: "0 auto" }, children: [
958
+ /* @__PURE__ */ I(F, { sx: { maxWidth: "400px", margin: "0 auto" }, children: [
959
959
  /* @__PURE__ */ C(
960
- I,
960
+ N,
961
961
  {
962
962
  variant: "body1",
963
963
  align: "left",
@@ -965,8 +965,8 @@ const ze = {
965
965
  children: e.step1
966
966
  }
967
967
  ),
968
- /* @__PURE__ */ N(
969
- I,
968
+ /* @__PURE__ */ I(
969
+ N,
970
970
  {
971
971
  "data-testid": "step1-description",
972
972
  variant: "body2",
@@ -984,7 +984,7 @@ const ze = {
984
984
  }
985
985
  ),
986
986
  /* @__PURE__ */ C(
987
- be,
987
+ ve,
988
988
  {
989
989
  "aria-label": "help",
990
990
  size: "small",
@@ -998,8 +998,8 @@ const ze = {
998
998
  ]
999
999
  }
1000
1000
  ),
1001
- /* @__PURE__ */ N(
1002
- z,
1001
+ /* @__PURE__ */ I(
1002
+ F,
1003
1003
  {
1004
1004
  sx: {
1005
1005
  display: "flex",
@@ -1013,7 +1013,7 @@ const ze = {
1013
1013
  },
1014
1014
  children: [
1015
1015
  /* @__PURE__ */ C(ue, { value: i }),
1016
- /* @__PURE__ */ N(I, { variant: "body2", sx: { marginTop: "16px" }, children: [
1016
+ /* @__PURE__ */ I(N, { variant: "body2", sx: { marginTop: "16px" }, children: [
1017
1017
  c,
1018
1018
  /* @__PURE__ */ C(Pe, { text: c })
1019
1019
  ] })
@@ -1021,7 +1021,7 @@ const ze = {
1021
1021
  }
1022
1022
  ),
1023
1023
  /* @__PURE__ */ C(
1024
- I,
1024
+ N,
1025
1025
  {
1026
1026
  variant: "body1",
1027
1027
  align: "left",
@@ -1030,7 +1030,7 @@ const ze = {
1030
1030
  }
1031
1031
  ),
1032
1032
  /* @__PURE__ */ C(
1033
- I,
1033
+ N,
1034
1034
  {
1035
1035
  variant: "body2",
1036
1036
  align: "left",
@@ -1038,8 +1038,8 @@ const ze = {
1038
1038
  children: e.step2_description
1039
1039
  }
1040
1040
  ),
1041
- /* @__PURE__ */ N(z, { sx: { padding: "16px 0" }, children: [
1042
- /* @__PURE__ */ N(z, { mb: 2, children: [
1041
+ /* @__PURE__ */ I(F, { sx: { padding: "16px 0" }, children: [
1042
+ /* @__PURE__ */ I(F, { mb: 2, children: [
1043
1043
  /* @__PURE__ */ C(
1044
1044
  Ne,
1045
1045
  {
@@ -1051,7 +1051,7 @@ const ze = {
1051
1051
  }
1052
1052
  ),
1053
1053
  ((Q = s.root) == null ? void 0 : Q.server) && /* @__PURE__ */ C(
1054
- I,
1054
+ N,
1055
1055
  {
1056
1056
  variant: "body2",
1057
1057
  color: "error",
@@ -1062,7 +1062,7 @@ const ze = {
1062
1062
  )
1063
1063
  ] }),
1064
1064
  w && /* @__PURE__ */ C(
1065
- I,
1065
+ N,
1066
1066
  {
1067
1067
  variant: "caption",
1068
1068
  align: "center",
@@ -1075,14 +1075,14 @@ const ze = {
1075
1075
  ] })
1076
1076
  ] })
1077
1077
  ) }),
1078
- /* @__PURE__ */ N(ve, { children: [
1078
+ /* @__PURE__ */ I(Ae, { children: [
1079
1079
  /* @__PURE__ */ C(
1080
1080
  G,
1081
1081
  {
1082
1082
  type: "button",
1083
1083
  color: "normal",
1084
1084
  disabled: f,
1085
- onClick: () => g(
1085
+ onClick: () => p(
1086
1086
  m ? "cancel" : w ? "skip" : "cancel"
1087
1087
  ),
1088
1088
  children: m ? e.close : w ? e.skip : e.cancel
@@ -1108,9 +1108,9 @@ const ze = {
1108
1108
  onCloseDialog: S,
1109
1109
  dialogTitle: e.help_dialog_title,
1110
1110
  dialogContent: /* @__PURE__ */ C(
1111
- I,
1111
+ F,
1112
1112
  {
1113
- variant: "body1",
1113
+ component: "div",
1114
1114
  id: "help-dialog-description",
1115
1115
  sx: { whiteSpace: "pre-line" },
1116
1116
  children: e.help_dialog_description