qr 0.5.5 โ†’ 0.6.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/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  Minimal 0-dependency QR code generator & reader.
4
4
 
5
5
  - ๐Ÿ”’ Auditable, 0-dependency
6
- - ๐ŸŽ Fast: [faster](#speed) than all JS implementations
6
+ - ๐ŸŽ [Fast](#speed): aims to be faster than all JS implementations
7
7
  - ๐Ÿ” Reliable: 100MB+ of extensive test vectors ensure correctness
8
8
  - ๐Ÿž๏ธ Encoding (generating) supports ASCII, term, gif, svg and png codes
9
9
  - ๐Ÿ“ท Decoding (reading) supports camera feed input, files and non-browser environments
@@ -76,25 +76,30 @@ const larger = encodeQR(txt, 'gif', { scale: 4 });
76
76
  // };
77
77
 
78
78
  console.log(ascii);
79
- > โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ
80
- > โ–ˆโ–ˆ โ–„โ–„โ–„โ–„โ–„ โ–ˆ โ–€โ–„โ–„โ–ˆ โ–ˆโ–ˆโ–€โ–„โ–„โ–„โ–„โ–ˆ โ–€โ–ˆ โ–„โ–„โ–„โ–„โ–„ โ–ˆโ–ˆ
81
- > โ–ˆโ–ˆ โ–ˆ โ–ˆ โ–ˆโ–€โ–„โ–€โ–„ โ–„โ–„โ–ˆโ–„โ–ˆ โ–ˆโ–ˆโ–€โ–ˆโ–€โ–€โ–ˆ โ–ˆ โ–ˆ โ–ˆโ–ˆ
82
- > โ–ˆโ–ˆ โ–ˆโ–„โ–„โ–„โ–ˆ โ–ˆโ–ˆ โ–„โ–„โ–ˆโ–„โ–€โ–€ โ–€ โ–ˆโ–ˆ โ–„ โ–„โ–ˆ โ–ˆโ–„โ–„โ–„โ–ˆ โ–ˆโ–ˆ
83
- > โ–ˆโ–ˆโ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–ˆ โ–€ โ–€ โ–ˆโ–„โ–€ โ–€ โ–€โ–„โ–ˆ โ–ˆ โ–ˆโ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–ˆโ–ˆ
84
- > โ–ˆโ–ˆ โ–ˆ โ–€ โ–„โ–„โ–€โ–€โ–€ โ–ˆโ–€ โ–„ โ–€โ–€โ–„โ–€ โ–„โ–ˆ โ–€โ–ˆ โ–€โ–„โ–„โ–ˆโ–ˆ
85
- > โ–ˆโ–ˆโ–€โ–€โ–€ โ–€โ–„โ–„โ–ˆโ–ˆโ–„โ–€โ–€โ–„โ–ˆโ–€ โ–€โ–„โ–ˆ โ–€โ–€โ–€ โ–„ โ–ˆโ–„โ–„โ–ˆโ–ˆ
86
- > โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–„โ–€โ–€โ–„โ–„โ–ˆโ–ˆ โ–€ โ–€ โ–„โ–„โ–ˆโ–ˆโ–„ โ–„โ–„ โ–„ โ–ˆโ–€โ–ˆ โ–ˆ โ–ˆโ–ˆโ–ˆ
87
- > โ–ˆโ–ˆโ–ˆ โ–„โ–€โ–„โ–ˆโ–„โ–„โ–„โ–ˆ โ–€โ–ˆโ–ˆโ–„โ–„โ–„โ–€โ–€โ–ˆโ–„โ–€ โ–„โ–ˆโ–€ โ–ˆโ–ˆโ–ˆโ–ˆ
88
- > โ–ˆโ–ˆโ–€โ–€ โ–„ โ–€โ–„ โ–„โ–„โ–ˆโ–ˆโ–€โ–„โ–€โ–€โ–ˆโ–ˆโ–ˆโ–ˆโ–„โ–„โ–„ โ–ˆโ–„ โ–ˆ โ–ˆโ–€โ–€โ–ˆโ–ˆ
89
- > โ–ˆโ–ˆโ–€โ–€โ–„ โ–„โ–€โ–„ โ–€โ–€โ–ˆโ–„โ–€โ–€โ–„โ–„โ–€โ–€ โ–ˆโ–„โ–„โ–€โ–ˆโ–€ โ–€โ–„ โ–ˆโ–„ โ–€โ–ˆโ–ˆ
90
- > โ–ˆโ–ˆโ–€โ–„โ–€โ–ˆโ–ˆ โ–„โ–„ โ–€โ–ˆโ–„โ–ˆโ–€ โ–€ โ–€โ–ˆโ–„โ–€โ–€ โ–ˆโ–„โ–€โ–€ โ–ˆ โ–ˆ โ–ˆโ–ˆ
91
- > โ–ˆโ–ˆโ–ˆโ–€โ–ˆโ–„โ–€โ–„โ–„ โ–ˆ โ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–„ โ–ˆ โ–„โ–„โ–„ โ–„โ–€โ–€โ–„โ–„ โ–ˆโ–ˆ
92
- > โ–ˆโ–ˆโ–„โ–ˆโ–„โ–„โ–„โ–ˆโ–„โ–ˆ โ–„ โ–„โ–€โ–ˆโ–€โ–€ โ–„โ–€ โ–ˆโ–€ โ–„ โ–„โ–„โ–„ โ–€โ–„โ–€โ–„โ–ˆโ–ˆ
93
- > โ–ˆโ–ˆ โ–„โ–„โ–„โ–„โ–„ โ–ˆ โ–„โ–ˆโ–„โ–€โ–€ โ–€โ–ˆ โ–ˆโ–„โ–ˆ โ–ˆโ–„โ–ˆ โ–€โ–€โ–„โ–€โ–ˆโ–ˆ
94
- > โ–ˆโ–ˆ โ–ˆ โ–ˆ โ–ˆโ–€ โ–„โ–€โ–ˆ โ–ˆโ–ˆ โ–„โ–„โ–€โ–ˆโ–ˆ โ–„โ–„ โ–„โ–ˆ โ–ˆโ–ˆ
95
- > โ–ˆโ–ˆ โ–ˆโ–„โ–„โ–„โ–ˆ โ–ˆโ–„ โ–ˆโ–ˆโ–€ โ–„โ–„ โ–€โ–ˆ โ–„ โ–€โ–„โ–„โ–ˆโ–€โ–ˆโ–ˆ
96
- > โ–ˆโ–ˆโ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–ˆโ–„โ–ˆโ–ˆโ–ˆโ–„โ–ˆโ–„โ–ˆโ–„โ–„โ–„โ–„โ–ˆโ–„โ–ˆโ–„โ–ˆโ–ˆโ–ˆโ–ˆโ–„โ–„โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ
97
- > โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€
79
+ ```
80
+
81
+ Example output:
82
+
83
+ ```text
84
+ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ
85
+ โ–ˆโ–ˆ โ–„โ–„โ–„โ–„โ–„ โ–ˆ โ–€โ–„โ–„โ–ˆ โ–ˆโ–ˆโ–€โ–„โ–„โ–„โ–„โ–ˆ โ–€โ–ˆ โ–„โ–„โ–„โ–„โ–„ โ–ˆโ–ˆ
86
+ โ–ˆโ–ˆ โ–ˆ โ–ˆ โ–ˆโ–€โ–„โ–€โ–„ โ–„โ–„โ–ˆโ–„โ–ˆ โ–ˆโ–ˆโ–€โ–ˆโ–€โ–€โ–ˆ โ–ˆ โ–ˆ โ–ˆโ–ˆ
87
+ โ–ˆโ–ˆ โ–ˆโ–„โ–„โ–„โ–ˆ โ–ˆโ–ˆ โ–„โ–„โ–ˆโ–„โ–€โ–€ โ–€ โ–ˆโ–ˆ โ–„ โ–„โ–ˆ โ–ˆโ–„โ–„โ–„โ–ˆ โ–ˆโ–ˆ
88
+ โ–ˆโ–ˆโ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–ˆ โ–€ โ–€ โ–ˆโ–„โ–€ โ–€ โ–€โ–„โ–ˆ โ–ˆ โ–ˆโ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–ˆโ–ˆ
89
+ โ–ˆโ–ˆ โ–ˆ โ–€ โ–„โ–„โ–€โ–€โ–€ โ–ˆโ–€ โ–„ โ–€โ–€โ–„โ–€ โ–„โ–ˆ โ–€โ–ˆ โ–€โ–„โ–„โ–ˆโ–ˆ
90
+ โ–ˆโ–ˆโ–€โ–€โ–€ โ–€โ–„โ–„โ–ˆโ–ˆโ–„โ–€โ–€โ–„โ–ˆโ–€ โ–€โ–„โ–ˆ โ–€โ–€โ–€ โ–„ โ–ˆโ–„โ–„โ–ˆโ–ˆ
91
+ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–„โ–€โ–€โ–„โ–„โ–ˆโ–ˆ โ–€ โ–€ โ–„โ–„โ–ˆโ–ˆโ–„ โ–„โ–„ โ–„ โ–ˆโ–€โ–ˆ โ–ˆ โ–ˆโ–ˆโ–ˆ
92
+ โ–ˆโ–ˆโ–ˆ โ–„โ–€โ–„โ–ˆโ–„โ–„โ–„โ–ˆ โ–€โ–ˆโ–ˆโ–„โ–„โ–„โ–€โ–€โ–ˆโ–„โ–€ โ–„โ–ˆโ–€ โ–ˆโ–ˆโ–ˆโ–ˆ
93
+ โ–ˆโ–ˆโ–€โ–€ โ–„ โ–€โ–„ โ–„โ–„โ–ˆโ–ˆโ–€โ–„โ–€โ–€โ–ˆโ–ˆโ–ˆโ–ˆโ–„โ–„โ–„ โ–ˆโ–„ โ–ˆ โ–ˆโ–€โ–€โ–ˆโ–ˆ
94
+ โ–ˆโ–ˆโ–€โ–€โ–„ โ–„โ–€โ–„ โ–€โ–€โ–ˆโ–„โ–€โ–€โ–„โ–„โ–€โ–€ โ–ˆโ–„โ–„โ–€โ–ˆโ–€ โ–€โ–„ โ–ˆโ–„ โ–€โ–ˆโ–ˆ
95
+ โ–ˆโ–ˆโ–€โ–„โ–€โ–ˆโ–ˆ โ–„โ–„ โ–€โ–ˆโ–„โ–ˆโ–€ โ–€ โ–€โ–ˆโ–„โ–€โ–€ โ–ˆโ–„โ–€โ–€ โ–ˆ โ–ˆ โ–ˆโ–ˆ
96
+ โ–ˆโ–ˆโ–ˆโ–€โ–ˆโ–„โ–€โ–„โ–„ โ–ˆ โ–ˆ โ–ˆโ–ˆ โ–ˆโ–ˆ โ–„ โ–ˆ โ–„โ–„โ–„ โ–„โ–€โ–€โ–„โ–„ โ–ˆโ–ˆ
97
+ โ–ˆโ–ˆโ–„โ–ˆโ–„โ–„โ–„โ–ˆโ–„โ–ˆ โ–„ โ–„โ–€โ–ˆโ–€โ–€ โ–„โ–€ โ–ˆโ–€ โ–„ โ–„โ–„โ–„ โ–€โ–„โ–€โ–„โ–ˆโ–ˆ
98
+ โ–ˆโ–ˆ โ–„โ–„โ–„โ–„โ–„ โ–ˆ โ–„โ–ˆโ–„โ–€โ–€ โ–€โ–ˆ โ–ˆโ–„โ–ˆ โ–ˆโ–„โ–ˆ โ–€โ–€โ–„โ–€โ–ˆโ–ˆ
99
+ โ–ˆโ–ˆ โ–ˆ โ–ˆ โ–ˆโ–€ โ–„โ–€โ–ˆ โ–ˆโ–ˆ โ–„โ–„โ–€โ–ˆโ–ˆ โ–„โ–„ โ–„โ–ˆ โ–ˆโ–ˆ
100
+ โ–ˆโ–ˆ โ–ˆโ–„โ–„โ–„โ–ˆ โ–ˆโ–„ โ–ˆโ–ˆโ–€ โ–„โ–„ โ–€โ–ˆ โ–„ โ–€โ–„โ–„โ–ˆโ–€โ–ˆโ–ˆ
101
+ โ–ˆโ–ˆโ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–ˆโ–„โ–ˆโ–ˆโ–ˆโ–„โ–ˆโ–„โ–ˆโ–„โ–„โ–„โ–„โ–ˆโ–„โ–ˆโ–„โ–ˆโ–ˆโ–ˆโ–ˆโ–„โ–„โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ
102
+ โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€
98
103
  ```
99
104
 
100
105
  ## Decoding
@@ -143,21 +148,23 @@ function decodeWithExternal() {
143
148
  ### Decoding options
144
149
 
145
150
  ```ts
146
- export type Point4 = { x: number; y: number }[];
147
- export type Image = {
151
+ type Point = { x: number; y: number };
152
+ type Pattern = Point & { moduleSize: number; count: number };
153
+ type FinderPoints = [Pattern, Pattern, Point, Pattern];
154
+ type Image = {
148
155
  height: number;
149
156
  width: number;
150
157
  data: Uint8Array | Uint8ClampedArray | number[];
151
158
  };
152
- export type DecodeOpts = {
153
- // By default we assume that image has 4 channel per pixel (RGBA). isRGB: true will force to use only one
154
- isRGB?: boolean;
155
- // Returns 4 center (3 finder pattern + 1 alignment pattern) points if detected
156
- detectFn?: (points: Point4) => void;
157
- // Returns RGBA image of detected QR code
158
- qrFn?: (img: Image) => void;
159
+ type DecodeOpts = {
160
+ cropToSquare?: boolean;
161
+ textDecoder?: (bytes: Uint8Array) => string;
162
+ pointsOnDetect?: (points: FinderPoints) => void;
163
+ imageOnBitmap?: (img: Image) => void;
164
+ imageOnDetect?: (img: Image) => void;
165
+ imageOnResult?: (img: Image) => void;
159
166
  };
160
- export default function decodeQR(img: Image, opts: DecodeOpts = {});
167
+ declare function decodeQR(img: Image, opts?: DecodeOpts): string;
161
168
  ```
162
169
 
163
170
  ### Decoding algorithm
package/decode.d.ts CHANGED
@@ -17,13 +17,11 @@ limitations under the License.
17
17
  /**
18
18
  * Methods for decoding (reading) QR code patterns.
19
19
  * @module
20
- * @example
21
- ```js
22
-
23
- ```
24
20
  */
25
- import type { Image, Point } from './index.ts';
21
+ import type { Image, Point, TArg, TRet } from './index.ts';
26
22
  import { Bitmap } from './index.ts';
23
+ type Point4 = [Point, Point, Point, Point];
24
+ /** Finder and alignment points returned by the detector. */
27
25
  export type FinderPoints = [Pattern, Pattern, Point, Pattern];
28
26
  /**
29
27
  * Convert to grayscale. The function is the most expensive part of decoding:
@@ -43,31 +41,106 @@ export type FinderPoints = [Pattern, Pattern, Point, Pattern];
43
41
  * bitmap where finder patterns survive perspective / blur / highlights while
44
42
  * keeping false dark regions low enough for downstream finder selection.
45
43
  */
46
- declare function toBitmap(img: Image): Bitmap;
44
+ declare function toBitmap(img: TArg<Image>): TRet<Bitmap>;
47
45
  type Pattern = Point & {
48
46
  moduleSize: number;
49
47
  count: number;
50
48
  };
51
- declare function findFinder(b: Bitmap): {
49
+ declare function findFinder(b: TArg<Bitmap>): {
52
50
  bl: Pattern;
53
51
  tl: Pattern;
54
52
  tr: Pattern;
55
53
  };
56
- declare function detect(b: Bitmap): {
54
+ declare function findAlignment(b: TArg<Bitmap>, est: Pattern, allowanceFactor: number): Pattern;
55
+ declare function detect(b: TArg<Bitmap>): TRet<{
57
56
  bits: Bitmap;
58
57
  points: FinderPoints;
59
- };
60
- declare function decodeBitmap(b: Bitmap, decoder?: (bytes: Uint8Array, eci: number) => string): string;
58
+ }>;
59
+ declare function transform(b: TArg<Bitmap>, size: number, from: Point4, to: Point4): TRet<Bitmap>;
60
+ declare function decodeBitmap(b: TArg<Bitmap>, decoder?: TArg<(bytes: Uint8Array, eci: number) => string>): string;
61
+ /** QR decoding hooks and image preprocessing options. */
61
62
  export type DecodeOpts = {
63
+ /** Crop rectangular inputs to a centered square before decoding. */
62
64
  cropToSquare?: boolean;
63
- textDecoder?: (bytes: Uint8Array) => string;
65
+ /**
66
+ * Custom byte-to-text decoder used for byte segments.
67
+ *
68
+ * Receives the byte segment and, when needed, the active ECI designator.
69
+ * ISO/IEC 18004:2024 ยง7.4.3.4 keeps ECIs active "until the end of
70
+ * the encoded data or a change of ECI", so callers need the active
71
+ * designator to apply their own charset policy.
72
+ * @param bytes - Byte segment payload to decode.
73
+ * @param eci - Active ECI designator for the byte segment.
74
+ * @returns Decoded text for the byte segment.
75
+ */
76
+ textDecoder?: TArg<(bytes: Uint8Array, eci?: number) => string>;
77
+ /**
78
+ * Callback invoked with finder/alignment points after detection succeeds.
79
+ *
80
+ * Receives finder and alignment points returned by the detector.
81
+ * @param points - Finder and alignment points returned by the detector.
82
+ */
64
83
  pointsOnDetect?: (points: FinderPoints) => void;
84
+ /**
85
+ * Callback invoked with the grayscale bitmap that the detector sees.
86
+ *
87
+ * Receives the grayscale image generated during bitmap conversion.
88
+ * @param img - Grayscale image generated during bitmap conversion.
89
+ */
65
90
  imageOnBitmap?: (img: Image) => void;
91
+ /**
92
+ * Callback invoked with the perspective-corrected QR image.
93
+ *
94
+ * Receives the perspective-corrected QR image.
95
+ * @param img - Perspective-corrected QR image.
96
+ */
66
97
  imageOnDetect?: (img: Image) => void;
98
+ /**
99
+ * Callback invoked with the final decoded QR image.
100
+ *
101
+ * Receives the final QR image used to decode the payload.
102
+ * @param img - Final QR image used to decode the payload.
103
+ */
67
104
  imageOnResult?: (img: Image) => void;
68
105
  };
69
- export declare function decodeQR(img: Image, opts?: DecodeOpts): string;
106
+ /**
107
+ * Decode text from a QR image.
108
+ * @param img - RGB or RGBA image data that contains a QR code.
109
+ * @param opts - Decoder hooks and image preprocessing options. See {@link DecodeOpts}.
110
+ * @returns Decoded QR payload as a string.
111
+ * @throws If the image, decoder options, or QR contents are invalid. {@link Error}
112
+ * @example
113
+ * Decode text from a QR image.
114
+ * ```ts
115
+ * import encodeQR, { Bitmap } from 'qr';
116
+ * import decodeQR from 'qr/decode.js';
117
+ * const bits = encodeQR('Hello world', 'raw', { scale: 4 });
118
+ * const bm = new Bitmap({ width: bits[0].length, height: bits.length }, bits);
119
+ * const text = decodeQR(bm.toImage());
120
+ * ```
121
+ */
122
+ export declare function decodeQR(img: TArg<Image>, opts?: TArg<DecodeOpts>): string;
123
+ /**
124
+ * Default export alias for {@link decodeQR}.
125
+ * @param img - RGB or RGBA image data that contains a QR code.
126
+ * @param opts - Decoder hooks and image preprocessing options. See {@link DecodeOpts}.
127
+ * @returns Decoded QR payload as a string.
128
+ * @throws If the image, decoder options, or QR contents are invalid. {@link Error}
129
+ * @example
130
+ * Decode a rendered QR image via the default decoder export.
131
+ * ```ts
132
+ * import encodeQR, { Bitmap } from 'qr';
133
+ * import decodeQR from 'qr/decode.js';
134
+ * const bits = encodeQR('Hello world', 'raw', { scale: 4 });
135
+ * const bm = new Bitmap({ width: bits[0].length, height: bits.length }, bits);
136
+ * decodeQR(bm.toImage());
137
+ * ```
138
+ */
70
139
  export default decodeQR;
140
+ export declare const _TESTS: {
141
+ findAlignment: typeof findAlignment;
142
+ transform: typeof transform;
143
+ };
71
144
  export declare const _tests: {
72
145
  toBitmap: typeof toBitmap;
73
146
  decodeBitmap: typeof decodeBitmap;
package/decode.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"decode.d.ts","sourceRoot":"","sources":["src/decode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;EAeE;AACF;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAiC,KAAK,EAAQ,KAAK,EAAE,MAAM,YAAY,CAAC;AACpF,OAAO,EAAE,MAAM,EAAS,MAAM,YAAY,CAAC;AA6B3C,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;AAoC9D;;;;;;;;;;;;;;;;;GAiBG;AACH,iBAAS,QAAQ,CAAC,GAAG,EAAE,KAAK,GAAG,MAAM,CA2TpC;AAGD,KAAK,OAAO,GAAG,KAAK,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AA8K7D,iBAAS,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG;IAC9B,EAAE,EAAE,OAAO,CAAC;IACZ,EAAE,EAAE,OAAO,CAAC;IACZ,EAAE,EAAE,OAAO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