@liquid-js/qr-code-styling 4.0.3 → 4.0.5

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.
@@ -12,68 +12,49 @@ import { DOMImplementation, XMLSerializer as XMLSerializer$1, DOMParser as DOMPa
12
12
 
13
13
  export { ErrorCorrectionLevel, Mode, TypeNumber } from "@liquid-js/qrcode-generator/lib/qrcode/QRCodeMinimal.js";
14
14
 
15
- let $isObject$$ = $obj$jscomp$26$$ => !!$obj$jscomp$26$$ && "object" == typeof $obj$jscomp$26$$ && !Array.isArray($obj$jscomp$26$$);
16
-
17
- function $mergeDeep$$($target$jscomp$92$$, ...$sources$$) {
18
- if (!$sources$$.length) return $target$jscomp$92$$;
19
- let $source$jscomp$16$$ = $sources$$.shift();
20
- return void 0 !== $source$jscomp$16$$ && $isObject$$($target$jscomp$92$$) && $isObject$$($source$jscomp$16$$) ? ($target$jscomp$92$$ = {
21
- ...$target$jscomp$92$$
22
- }, Object.keys($source$jscomp$16$$).forEach(($key$jscomp$37$$ => {
23
- let $targetValue$$ = $target$jscomp$92$$[$key$jscomp$37$$], $sourceValue$$ = $source$jscomp$16$$[$key$jscomp$37$$];
24
- Array.isArray($targetValue$$) && Array.isArray($sourceValue$$) ? $target$jscomp$92$$[$key$jscomp$37$$] = $sourceValue$$ : $isObject$$($targetValue$$) && $isObject$$($sourceValue$$) ? $target$jscomp$92$$[$key$jscomp$37$$] = $mergeDeep$$(Object.assign({}, $targetValue$$), $sourceValue$$) : $target$jscomp$92$$[$key$jscomp$37$$] = $sourceValue$$;
25
- })), $mergeDeep$$($target$jscomp$92$$, ...$sources$$)) : $target$jscomp$92$$;
15
+ let isObject = obj => !!obj && "object" == typeof obj && !Array.isArray(obj);
16
+
17
+ function mergeDeep(target, ...sources) {
18
+ if (!sources.length) return target;
19
+ let source = sources.shift();
20
+ return void 0 !== source && isObject(target) && isObject(source) ? (target = {
21
+ ...target
22
+ }, Object.keys(source).forEach((key => {
23
+ let targetValue = target[key], sourceValue = source[key];
24
+ Array.isArray(targetValue) && Array.isArray(sourceValue) ? target[key] = sourceValue : isObject(targetValue) && isObject(sourceValue) ? target[key] = mergeDeep(Object.assign({}, targetValue), sourceValue) : target[key] = sourceValue;
25
+ })), mergeDeep(target, ...sources)) : target;
26
26
  }
27
27
 
28
- var $GradientType$$, $GradientType$jscomp$inline_0$$ = $GradientType$$ || ($GradientType$$ = {});
29
-
30
- function $sanitizeGradient$$($gradient_newGradient$$) {
31
- if (!($gradient_newGradient$$ = {
32
- ...$gradient_newGradient$$
33
- }).colorStops || !$gradient_newGradient$$.colorStops.length) throw "Field 'colorStops' is required in gradient";
34
- return $gradient_newGradient$$.rotation = $gradient_newGradient$$.rotation ? Number($gradient_newGradient$$.rotation) : 0,
35
- $gradient_newGradient$$.colorStops = $gradient_newGradient$$.colorStops.map(($colorStop$$ => ({
36
- ...$colorStop$$,
37
- offset: Number($colorStop$$.offset)
38
- }))), $gradient_newGradient$$;
28
+ var GradientType, DotType, CornerDotType, CornerSquareType, ShapeType, ImageMode;
29
+
30
+ function sanitizeGradient(gradient_newGradient) {
31
+ if (!(gradient_newGradient = {
32
+ ...gradient_newGradient
33
+ }).colorStops || !gradient_newGradient.colorStops.length) throw "Field 'colorStops' is required in gradient";
34
+ return gradient_newGradient.rotation = gradient_newGradient.rotation ? Number(gradient_newGradient.rotation) : 0,
35
+ gradient_newGradient.colorStops = gradient_newGradient.colorStops.map((colorStop => ({
36
+ ...colorStop,
37
+ offset: Number(colorStop.offset)
38
+ }))), gradient_newGradient;
39
39
  }
40
40
 
41
- $GradientType$jscomp$inline_0$$.radial = "radial", $GradientType$jscomp$inline_0$$.linear = "linear";
42
-
43
- var $DotType$$, $DotType$jscomp$inline_2$$ = $DotType$$ || ($DotType$$ = {});
44
-
45
- $DotType$jscomp$inline_2$$.dot = "dot", $DotType$jscomp$inline_2$$.randomDot = "random-dot",
46
- $DotType$jscomp$inline_2$$.rounded = "rounded", $DotType$jscomp$inline_2$$.extraRounded = "extra-rounded",
47
- $DotType$jscomp$inline_2$$.verticalLine = "vertical-line", $DotType$jscomp$inline_2$$.horizontalLine = "horizontal-line",
48
- $DotType$jscomp$inline_2$$.classy = "classy", $DotType$jscomp$inline_2$$.classyRounded = "classy-rounded",
49
- $DotType$jscomp$inline_2$$.square = "square", $DotType$jscomp$inline_2$$.smallSquare = "small-square",
50
- $DotType$jscomp$inline_2$$.tinySquare = "tiny-square", $DotType$jscomp$inline_2$$.diamond = "diamond";
51
-
52
- var $CornerDotType$$, $CornerDotType$jscomp$inline_4$$ = $CornerDotType$$ || ($CornerDotType$$ = {});
53
-
54
- $CornerDotType$jscomp$inline_4$$.dot = "dot", $CornerDotType$jscomp$inline_4$$.square = "square",
55
- $CornerDotType$jscomp$inline_4$$.heart = "heart", $CornerDotType$jscomp$inline_4$$.extraRounded = "extra-rounded",
56
- $CornerDotType$jscomp$inline_4$$.classy = "classy", $CornerDotType$jscomp$inline_4$$.outpoint = "outpoint",
57
- $CornerDotType$jscomp$inline_4$$.inpoint = "inpoint";
58
-
59
- var $CornerSquareType$$, $CornerSquareType$jscomp$inline_6$$ = $CornerSquareType$$ || ($CornerSquareType$$ = {});
60
-
61
- $CornerSquareType$jscomp$inline_6$$.dot = "dot", $CornerSquareType$jscomp$inline_6$$.square = "square",
62
- $CornerSquareType$jscomp$inline_6$$.extraRounded = "extra-rounded", $CornerSquareType$jscomp$inline_6$$.classy = "classy",
63
- $CornerSquareType$jscomp$inline_6$$.outpoint = "outpoint", $CornerSquareType$jscomp$inline_6$$.inpoint = "inpoint";
64
-
65
- var $ShapeType$$, $ShapeType$jscomp$inline_8$$ = $ShapeType$$ || ($ShapeType$$ = {});
66
-
67
- $ShapeType$jscomp$inline_8$$.square = "square", $ShapeType$jscomp$inline_8$$.circle = "circle";
68
-
69
- var $ImageMode$$, $ImageMode$jscomp$inline_10$$ = $ImageMode$$ || ($ImageMode$$ = {});
70
-
71
- $ImageMode$jscomp$inline_10$$.center = "center", $ImageMode$jscomp$inline_10$$.overlay = "overlay",
72
- $ImageMode$jscomp$inline_10$$.background = "background";
73
-
74
- let $defaultOptions$$ = {
41
+ (GradientType = GradientType || (GradientType = {})).radial = "radial", GradientType.linear = "linear",
42
+ (DotType = DotType || (DotType = {})).dot = "dot", DotType.randomDot = "random-dot",
43
+ DotType.rounded = "rounded", DotType.extraRounded = "extra-rounded", DotType.verticalLine = "vertical-line",
44
+ DotType.horizontalLine = "horizontal-line", DotType.classy = "classy", DotType.classyRounded = "classy-rounded",
45
+ DotType.square = "square", DotType.smallSquare = "small-square", DotType.tinySquare = "tiny-square",
46
+ DotType.diamond = "diamond", (CornerDotType = CornerDotType || (CornerDotType = {})).dot = "dot",
47
+ CornerDotType.square = "square", CornerDotType.heart = "heart", CornerDotType.extraRounded = "extra-rounded",
48
+ CornerDotType.classy = "classy", CornerDotType.outpoint = "outpoint", CornerDotType.inpoint = "inpoint",
49
+ (CornerSquareType = CornerSquareType || (CornerSquareType = {})).dot = "dot", CornerSquareType.square = "square",
50
+ CornerSquareType.extraRounded = "extra-rounded", CornerSquareType.classy = "classy",
51
+ CornerSquareType.outpoint = "outpoint", CornerSquareType.inpoint = "inpoint", (ShapeType = ShapeType || (ShapeType = {})).square = "square",
52
+ ShapeType.circle = "circle", (ImageMode = ImageMode || (ImageMode = {})).center = "center",
53
+ ImageMode.overlay = "overlay", ImageMode.background = "background";
54
+
55
+ let defaultOptions = {
75
56
  document: void 0,
76
- shape: $ShapeType$$.square,
57
+ shape: ShapeType.square,
77
58
  width: void 0,
78
59
  height: void 0,
79
60
  data: "",
@@ -83,7 +64,7 @@ let $defaultOptions$$ = {
83
64
  errorCorrectionLevel: ErrorCorrectionLevel.Q
84
65
  },
85
66
  imageOptions: {
86
- mode: $ImageMode$$.center,
67
+ mode: ImageMode.center,
87
68
  imageSize: .4,
88
69
  crossOrigin: void 0,
89
70
  margin: 0,
@@ -92,779 +73,764 @@ let $defaultOptions$$ = {
92
73
  }
93
74
  },
94
75
  dotsOptions: {
95
- type: $DotType$$.square,
76
+ type: DotType.square,
96
77
  color: "#000",
97
78
  size: 10
98
79
  }
99
80
  };
100
81
 
101
- function $sanitizeOptions$$($newOptions_options$jscomp$34$$) {
102
- return ($newOptions_options$jscomp$34$$ = {
103
- ...$newOptions_options$jscomp$34$$
82
+ function sanitizeOptions(newOptions_options) {
83
+ return (newOptions_options = {
84
+ ...newOptions_options
104
85
  }).imageOptions = {
105
- ...$newOptions_options$jscomp$34$$.imageOptions,
106
- imageSize: Math.min(1, Number($newOptions_options$jscomp$34$$.imageOptions.imageSize)) || 1,
107
- margin: Number($newOptions_options$jscomp$34$$.imageOptions.margin),
86
+ ...newOptions_options.imageOptions,
87
+ imageSize: Math.min(1, Number(newOptions_options.imageOptions.imageSize)) || 1,
88
+ margin: Number(newOptions_options.imageOptions.margin),
108
89
  fill: {
109
- ...$newOptions_options$jscomp$34$$.imageOptions.fill
90
+ ...newOptions_options.imageOptions.fill
110
91
  }
111
- }, $newOptions_options$jscomp$34$$.imageOptions.mode == $ImageMode$$.overlay && ($newOptions_options$jscomp$34$$.imageOptions.margin = 0),
112
- $newOptions_options$jscomp$34$$.imageOptions.fill.gradient && ($newOptions_options$jscomp$34$$.imageOptions.fill.gradient = $sanitizeGradient$$($newOptions_options$jscomp$34$$.imageOptions.fill.gradient)),
113
- $newOptions_options$jscomp$34$$.dotsOptions = {
114
- ...$newOptions_options$jscomp$34$$.dotsOptions
115
- }, $newOptions_options$jscomp$34$$.dotsOptions.gradient && ($newOptions_options$jscomp$34$$.dotsOptions.gradient = $sanitizeGradient$$($newOptions_options$jscomp$34$$.dotsOptions.gradient)),
116
- $newOptions_options$jscomp$34$$.dotsOptions.size = Math.round(Math.max(0, $newOptions_options$jscomp$34$$.dotsOptions.size) || 10),
117
- $newOptions_options$jscomp$34$$.cornersSquareOptions && ($newOptions_options$jscomp$34$$.cornersSquareOptions = {
118
- ...$newOptions_options$jscomp$34$$.cornersSquareOptions
119
- }, $newOptions_options$jscomp$34$$.cornersSquareOptions.gradient && ($newOptions_options$jscomp$34$$.cornersSquareOptions.gradient = $sanitizeGradient$$($newOptions_options$jscomp$34$$.cornersSquareOptions.gradient))),
120
- $newOptions_options$jscomp$34$$.cornersDotOptions && ($newOptions_options$jscomp$34$$.cornersDotOptions = {
121
- ...$newOptions_options$jscomp$34$$.cornersDotOptions
122
- }, $newOptions_options$jscomp$34$$.cornersDotOptions.gradient && ($newOptions_options$jscomp$34$$.cornersDotOptions.gradient = $sanitizeGradient$$($newOptions_options$jscomp$34$$.cornersDotOptions.gradient))),
123
- $newOptions_options$jscomp$34$$.backgroundOptions && ($newOptions_options$jscomp$34$$.backgroundOptions = {
124
- ...$newOptions_options$jscomp$34$$.backgroundOptions
125
- }, $newOptions_options$jscomp$34$$.backgroundOptions.gradient && ($newOptions_options$jscomp$34$$.backgroundOptions.gradient = $sanitizeGradient$$($newOptions_options$jscomp$34$$.backgroundOptions.gradient))),
126
- $newOptions_options$jscomp$34$$.document || ($newOptions_options$jscomp$34$$.document = document),
127
- $newOptions_options$jscomp$34$$;
92
+ }, newOptions_options.imageOptions.mode == ImageMode.overlay && (newOptions_options.imageOptions.margin = 0),
93
+ newOptions_options.imageOptions.fill.gradient && (newOptions_options.imageOptions.fill.gradient = sanitizeGradient(newOptions_options.imageOptions.fill.gradient)),
94
+ newOptions_options.dotsOptions = {
95
+ ...newOptions_options.dotsOptions
96
+ }, newOptions_options.dotsOptions.gradient && (newOptions_options.dotsOptions.gradient = sanitizeGradient(newOptions_options.dotsOptions.gradient)),
97
+ newOptions_options.dotsOptions.size = Math.round(Math.max(0, newOptions_options.dotsOptions.size) || 10),
98
+ newOptions_options.cornersSquareOptions && (newOptions_options.cornersSquareOptions = {
99
+ ...newOptions_options.cornersSquareOptions
100
+ }, newOptions_options.cornersSquareOptions.gradient && (newOptions_options.cornersSquareOptions.gradient = sanitizeGradient(newOptions_options.cornersSquareOptions.gradient))),
101
+ newOptions_options.cornersDotOptions && (newOptions_options.cornersDotOptions = {
102
+ ...newOptions_options.cornersDotOptions
103
+ }, newOptions_options.cornersDotOptions.gradient && (newOptions_options.cornersDotOptions.gradient = sanitizeGradient(newOptions_options.cornersDotOptions.gradient))),
104
+ newOptions_options.backgroundOptions && (newOptions_options.backgroundOptions = {
105
+ ...newOptions_options.backgroundOptions
106
+ }, newOptions_options.backgroundOptions.gradient && (newOptions_options.backgroundOptions.gradient = sanitizeGradient(newOptions_options.backgroundOptions.gradient))),
107
+ newOptions_options.document || (newOptions_options.document = document), newOptions_options;
128
108
  }
129
109
 
130
- let $ErrorCorrectionPercents$$ = {
110
+ let ErrorCorrectionPercents = {
131
111
  [ErrorCorrectionLevel.L]: .07,
132
112
  [ErrorCorrectionLevel.M]: .15,
133
113
  [ErrorCorrectionLevel.Q]: .25,
134
114
  [ErrorCorrectionLevel.H]: .3
135
115
  };
136
116
 
137
- let $rx$$ = /\.?0+$/;
117
+ let rx = /\.?0+$/;
138
118
 
139
- function $numToAttr$$($value$jscomp$91$$) {
140
- return $value$jscomp$91$$.toFixed(7).replace($rx$$, "");
119
+ function numToAttr(value) {
120
+ return value.toFixed(7).replace(rx, "");
141
121
  }
142
122
 
143
- function $svgPath$$($strings$$, ...$values$jscomp$10$$) {
144
- return $strings$$.reduce((($t$$, $v$$, $i$jscomp$3$$) => {
145
- let $p$$ = "";
146
- return $i$jscomp$3$$ && ($p$$ = $values$jscomp$10$$[$i$jscomp$3$$ - 1]), "number" == typeof $p$$ && ($p$$ = $numToAttr$$($p$$)),
147
- `${$t$$}${$p$$}${$v$$}`;
123
+ function svgPath(strings, ...values) {
124
+ return strings.reduce(((t, v, i) => {
125
+ let p = "";
126
+ return i && (p = values[i - 1]), "number" == typeof p && (p = numToAttr(p)), `${t}${p}${v}`;
148
127
  }), "").trim().replace(/[\s\n\r]+/gim, " ");
149
128
  }
150
129
 
151
- class $QRCornerDot$$ {
130
+ class QRCornerDot {
152
131
  get element() {
153
132
  return this._element;
154
133
  }
155
- constructor($type$jscomp$150$$, $document$jscomp$2$$) {
156
- this.type = $type$jscomp$150$$, this.document = $document$jscomp$2$$;
134
+ constructor(type, document) {
135
+ this.type = type, this.document = document;
157
136
  }
158
- draw($args$$) {
159
- let $drawFunction$$;
137
+ draw(args) {
138
+ let drawFunction;
160
139
  switch (this.type) {
161
- case $CornerDotType$$.square:
162
- $drawFunction$$ = this.drawSquare;
140
+ case CornerDotType.square:
141
+ drawFunction = this.drawSquare;
163
142
  break;
164
143
 
165
- case $CornerDotType$$.heart:
166
- $drawFunction$$ = this.drawHeart;
144
+ case CornerDotType.heart:
145
+ drawFunction = this.drawHeart;
167
146
  break;
168
147
 
169
- case $CornerDotType$$.extraRounded:
170
- $drawFunction$$ = this.drawRounded;
148
+ case CornerDotType.extraRounded:
149
+ drawFunction = this.drawRounded;
171
150
  break;
172
151
 
173
- case $CornerDotType$$.classy:
174
- $drawFunction$$ = this.drawClassy;
152
+ case CornerDotType.classy:
153
+ drawFunction = this.drawClassy;
175
154
  break;
176
155
 
177
- case $CornerDotType$$.inpoint:
178
- $drawFunction$$ = this.drawInpoint;
156
+ case CornerDotType.inpoint:
157
+ drawFunction = this.drawInpoint;
179
158
  break;
180
159
 
181
- case $CornerDotType$$.outpoint:
182
- $drawFunction$$ = this.drawOutpoint;
160
+ case CornerDotType.outpoint:
161
+ drawFunction = this.drawOutpoint;
183
162
  break;
184
163
 
185
164
  default:
186
- $drawFunction$$ = this.drawDot;
165
+ drawFunction = this.drawDot;
187
166
  }
188
- $drawFunction$$.call(this, $args$$);
167
+ drawFunction.call(this, args);
189
168
  }
190
- rotateFigure({x: $cx_x$jscomp$88$$, y: $cy_y$jscomp$73$$, size: $size$jscomp$21$$, rotation: $rotation$jscomp$3$$ = 0, draw: $draw$$}) {
191
- $cx_x$jscomp$88$$ += $size$jscomp$21$$ / 2, $cy_y$jscomp$73$$ += $size$jscomp$21$$ / 2,
192
- $draw$$(), this._element?.setAttribute("transform", `rotate(${$numToAttr$$(180 * $rotation$jscomp$3$$ / Math.PI)},${$cx_x$jscomp$88$$},${$cy_y$jscomp$73$$})`);
169
+ rotateFigure({x: cx_x, y: cy_y, size, rotation = 0, draw}) {
170
+ cx_x += size / 2, cy_y += size / 2, draw(), this._element?.setAttribute("transform", `rotate(${numToAttr(180 * rotation / Math.PI)},${cx_x},${cy_y})`);
193
171
  }
194
- basicDot($args$jscomp$1$$) {
195
- let {size: $size$jscomp$22$$, x: $x$jscomp$89$$, y: $y$jscomp$74$$} = $args$jscomp$1$$;
172
+ basicDot(args) {
173
+ let {size, x, y} = args;
196
174
  this.rotateFigure({
197
- ...$args$jscomp$1$$,
175
+ ...args,
198
176
  draw: () => {
199
177
  this._element = this.document.createElementNS("http://www.w3.org/2000/svg", "circle"),
200
- this._element.setAttribute("cx", $numToAttr$$($x$jscomp$89$$ + $size$jscomp$22$$ / 2)),
201
- this._element.setAttribute("cy", $numToAttr$$($y$jscomp$74$$ + $size$jscomp$22$$ / 2)),
202
- this._element.setAttribute("r", $numToAttr$$($size$jscomp$22$$ / 2));
178
+ this._element.setAttribute("cx", numToAttr(x + size / 2)), this._element.setAttribute("cy", numToAttr(y + size / 2)),
179
+ this._element.setAttribute("r", numToAttr(size / 2));
203
180
  }
204
181
  });
205
182
  }
206
- basicSquare($args$jscomp$2$$) {
207
- let {size: $size$jscomp$23$$, x: $x$jscomp$90$$, y: $y$jscomp$75$$} = $args$jscomp$2$$;
183
+ basicSquare(args) {
184
+ let {size, x, y} = args;
208
185
  this.rotateFigure({
209
- ...$args$jscomp$2$$,
186
+ ...args,
210
187
  draw: () => {
211
188
  this._element = this.document.createElementNS("http://www.w3.org/2000/svg", "rect"),
212
- this._element.setAttribute("x", $numToAttr$$($x$jscomp$90$$)), this._element.setAttribute("y", $numToAttr$$($y$jscomp$75$$)),
213
- this._element.setAttribute("width", $numToAttr$$($size$jscomp$23$$)), this._element.setAttribute("height", $numToAttr$$($size$jscomp$23$$));
189
+ this._element.setAttribute("x", numToAttr(x)), this._element.setAttribute("y", numToAttr(y)),
190
+ this._element.setAttribute("width", numToAttr(size)), this._element.setAttribute("height", numToAttr(size));
214
191
  }
215
192
  });
216
193
  }
217
- basicHeart($args$jscomp$3$$) {
218
- let {size: $size$jscomp$24$$, x: $x$jscomp$91$$, y: $y$jscomp$76$$} = $args$jscomp$3$$;
194
+ basicHeart(args) {
195
+ let {size, x, y} = args;
219
196
  this._element = this.document.createElementNS("http://www.w3.org/2000/svg", "path");
220
- let $move$$ = !1, $i$jscomp$4$$ = 0;
221
- this._element.setAttribute("d", [ "M", 1, .3262506, "c", 0, .0383376, -.0064626, .0758377, -.0193751, .1125001, "s", -.0356247, .076875, -.0681248, .1206252, "c", -.0325, .0437499, -.0762503, .0931247, -.1312501, .1481249, "C", .7262502, .7625008, .6566626, .8279132, .5724999, .9037505, "L", .5, .9687506, "L", .4275001, .9037505, "C", .3433374, .8279132, .2737499, .7625005, .21875, .7075007, "C", .1637501, .6525008, .1199999, .6031258, .0874999, .5593758, "S", .0322876, .4754133, .0193751, .4387506, "S", 0, .3645881, 0, .3262506, "c", 0, -.0783374, .0262499, -.1437498, .07875, -.1962499, "s", .1179124, -.07875, .1962499, -.07875, "c", .0433376, 0, .0845875, .0091625, .12375, .0274999, "S", .4716623, .1229131, .5, .1562506, "c", .0283374, -.0333375, .0620874, -.0591625, .1012502, -.0775, "c", .0391627, -.0183375, .0804126, -.0274999, .12375, -.0274999, "c", .0783374, 0, .1437497, .0262499, .1962501, .07875, "S", 1, .2479131, 1, .3262506, "z" ].map(($v$jscomp$1$$ => "string" == typeof $v$jscomp$1$$ ? ($i$jscomp$4$$ = 0,
222
- $move$$ = $v$jscomp$1$$.toUpperCase() == $v$jscomp$1$$, $v$jscomp$1$$) : ($i$jscomp$4$$++,
223
- $v$jscomp$1$$ *= $size$jscomp$24$$, $move$$ && ($v$jscomp$1$$ += 1 == $i$jscomp$4$$ % 2 ? $x$jscomp$91$$ : $y$jscomp$76$$),
224
- $numToAttr$$($v$jscomp$1$$)))).join(" "));
225
- }
226
- basicRounded($args$jscomp$4$$) {
227
- let {size: $size$jscomp$25$$, x: $x$jscomp$92$$, y: $y$jscomp$77$$} = $args$jscomp$4$$;
197
+ let move = !1, i = 0;
198
+ this._element.setAttribute("d", [ "M", 1, .3262506, "c", 0, .0383376, -.0064626, .0758377, -.0193751, .1125001, "s", -.0356247, .076875, -.0681248, .1206252, "c", -.0325, .0437499, -.0762503, .0931247, -.1312501, .1481249, "C", .7262502, .7625008, .6566626, .8279132, .5724999, .9037505, "L", .5, .9687506, "L", .4275001, .9037505, "C", .3433374, .8279132, .2737499, .7625005, .21875, .7075007, "C", .1637501, .6525008, .1199999, .6031258, .0874999, .5593758, "S", .0322876, .4754133, .0193751, .4387506, "S", 0, .3645881, 0, .3262506, "c", 0, -.0783374, .0262499, -.1437498, .07875, -.1962499, "s", .1179124, -.07875, .1962499, -.07875, "c", .0433376, 0, .0845875, .0091625, .12375, .0274999, "S", .4716623, .1229131, .5, .1562506, "c", .0283374, -.0333375, .0620874, -.0591625, .1012502, -.0775, "c", .0391627, -.0183375, .0804126, -.0274999, .12375, -.0274999, "c", .0783374, 0, .1437497, .0262499, .1962501, .07875, "S", 1, .2479131, 1, .3262506, "z" ].map((v => "string" == typeof v ? (i = 0,
199
+ move = v.toUpperCase() == v, v) : (i++, v *= size, move && (v += 1 == i % 2 ? x : y),
200
+ numToAttr(v)))).join(" "));
201
+ }
202
+ basicRounded(args) {
203
+ let {size, x, y} = args;
228
204
  this.rotateFigure({
229
- ...$args$jscomp$4$$,
205
+ ...args,
230
206
  draw: () => {
231
207
  this._element = this.document.createElementNS("http://www.w3.org/2000/svg", "rect"),
232
- this._element.setAttribute("x", $numToAttr$$($x$jscomp$92$$)), this._element.setAttribute("y", $numToAttr$$($y$jscomp$77$$)),
233
- this._element.setAttribute("width", $numToAttr$$($size$jscomp$25$$)), this._element.setAttribute("height", $numToAttr$$($size$jscomp$25$$)),
234
- this._element.setAttribute("rx", $numToAttr$$($size$jscomp$25$$ / 4)), this._element.setAttribute("ry", $numToAttr$$($size$jscomp$25$$ / 4));
208
+ this._element.setAttribute("x", numToAttr(x)), this._element.setAttribute("y", numToAttr(y)),
209
+ this._element.setAttribute("width", numToAttr(size)), this._element.setAttribute("height", numToAttr(size)),
210
+ this._element.setAttribute("rx", numToAttr(size / 4)), this._element.setAttribute("ry", numToAttr(size / 4));
235
211
  }
236
212
  });
237
213
  }
238
- basicClassy($args$jscomp$5$$) {
239
- let {size: $size$jscomp$26$$, x: $x$jscomp$93$$, y: $y$jscomp$78$$} = $args$jscomp$5$$, $dotSize$$ = $size$jscomp$26$$ / 7;
214
+ basicClassy(args) {
215
+ let {size, x, y} = args, dotSize = size / 7;
240
216
  this.rotateFigure({
241
- ...$args$jscomp$5$$,
217
+ ...args,
242
218
  draw: () => {
243
219
  this._element = this.document.createElementNS("http://www.w3.org/2000/svg", "path"),
244
- this._element.setAttribute("clip-rule", "evenodd"), this._element.setAttribute("d", $svgPath$$`M ${$x$jscomp$93$$} ${$y$jscomp$78$$ + 2.5 * $dotSize$$} v ${2 * $dotSize$$} a ${2.5 * $dotSize$$} ${2.5 * $dotSize$$}, 0, 0, 0, ${2.5 * $dotSize$$} ${2.5 * $dotSize$$} h ${4.5 * $dotSize$$} v ${-4.5 * $dotSize$$} a ${2.5 * $dotSize$$} ${2.5 * $dotSize$$}, 0, 0, 0, ${2.5 * -$dotSize$$} ${2.5 * -$dotSize$$} h ${-2 * $dotSize$$} H ${$x$jscomp$93$$} z`);
220
+ this._element.setAttribute("clip-rule", "evenodd"), this._element.setAttribute("d", svgPath`M ${x} ${y + 2.5 * dotSize} v ${2 * dotSize} a ${2.5 * dotSize} ${2.5 * dotSize}, 0, 0, 0, ${2.5 * dotSize} ${2.5 * dotSize} h ${4.5 * dotSize} v ${-4.5 * dotSize} a ${2.5 * dotSize} ${2.5 * dotSize}, 0, 0, 0, ${2.5 * -dotSize} ${2.5 * -dotSize} h ${-2 * dotSize} H ${x} z`);
245
221
  }
246
222
  });
247
223
  }
248
- basicInpoint($args$jscomp$6$$) {
249
- let {size: $size$jscomp$27$$, x: $x$jscomp$94$$, y: $y$jscomp$79$$} = $args$jscomp$6$$;
224
+ basicInpoint(args) {
225
+ let {size, x, y} = args;
250
226
  this.rotateFigure({
251
- ...$args$jscomp$6$$,
227
+ ...args,
252
228
  draw: () => {
253
229
  this._element = this.document.createElementNS("http://www.w3.org/2000/svg", "path"),
254
- this._element.setAttribute("clip-rule", "evenodd"), this._element.setAttribute("d", $svgPath$$`M ${$x$jscomp$94$$} ${$y$jscomp$79$$ + $size$jscomp$27$$ / 2} v ${$size$jscomp$27$$ / 4} a ${$size$jscomp$27$$ / 4}, ${$size$jscomp$27$$ / 4} 0 0 0 ${$size$jscomp$27$$ / 4}, ${$size$jscomp$27$$ / 4} h ${$size$jscomp$27$$ / 4 * 3} v ${-$size$jscomp$27$$ / 4 * 3} a ${$size$jscomp$27$$ / 4}, ${$size$jscomp$27$$ / 4} 0 0 0 ${-$size$jscomp$27$$ / 4}, ${-$size$jscomp$27$$ / 4} h ${-$size$jscomp$27$$ / 2} a ${$size$jscomp$27$$ / 4}, ${$size$jscomp$27$$ / 4} 0 0 0 ${-$size$jscomp$27$$ / 4}, ${$size$jscomp$27$$ / 4} z`);
230
+ this._element.setAttribute("clip-rule", "evenodd"), this._element.setAttribute("d", svgPath`M ${x} ${y + size / 2} v ${size / 4} a ${size / 4}, ${size / 4} 0 0 0 ${size / 4}, ${size / 4} h ${size / 4 * 3} v ${-size / 4 * 3} a ${size / 4}, ${size / 4} 0 0 0 ${-size / 4}, ${-size / 4} h ${-size / 2} a ${size / 4}, ${size / 4} 0 0 0 ${-size / 4}, ${size / 4} z`);
255
231
  }
256
232
  });
257
233
  }
258
- drawDot({x: $x$jscomp$95$$, y: $y$jscomp$80$$, size: $size$jscomp$28$$, rotation: $rotation$jscomp$4$$}) {
234
+ drawDot({x, y, size, rotation}) {
259
235
  this.basicDot({
260
- x: $x$jscomp$95$$,
261
- y: $y$jscomp$80$$,
262
- size: $size$jscomp$28$$,
263
- rotation: $rotation$jscomp$4$$
236
+ x,
237
+ y,
238
+ size,
239
+ rotation
264
240
  });
265
241
  }
266
- drawSquare({x: $x$jscomp$96$$, y: $y$jscomp$81$$, size: $size$jscomp$29$$, rotation: $rotation$jscomp$5$$}) {
242
+ drawSquare({x, y, size, rotation}) {
267
243
  this.basicSquare({
268
- x: $x$jscomp$96$$,
269
- y: $y$jscomp$81$$,
270
- size: $size$jscomp$29$$,
271
- rotation: $rotation$jscomp$5$$
244
+ x,
245
+ y,
246
+ size,
247
+ rotation
272
248
  });
273
249
  }
274
- drawHeart({x: $x$jscomp$97$$, y: $y$jscomp$82$$, size: $size$jscomp$30$$, rotation: $rotation$jscomp$6$$}) {
250
+ drawHeart({x, y, size, rotation}) {
275
251
  this.basicHeart({
276
- x: $x$jscomp$97$$,
277
- y: $y$jscomp$82$$,
278
- size: $size$jscomp$30$$,
279
- rotation: $rotation$jscomp$6$$
252
+ x,
253
+ y,
254
+ size,
255
+ rotation
280
256
  });
281
257
  }
282
- drawRounded({x: $x$jscomp$98$$, y: $y$jscomp$83$$, size: $size$jscomp$31$$, rotation: $rotation$jscomp$7$$}) {
258
+ drawRounded({x, y, size, rotation}) {
283
259
  this.basicRounded({
284
- x: $x$jscomp$98$$,
285
- y: $y$jscomp$83$$,
286
- size: $size$jscomp$31$$,
287
- rotation: $rotation$jscomp$7$$
260
+ x,
261
+ y,
262
+ size,
263
+ rotation
288
264
  });
289
265
  }
290
- drawClassy({x: $x$jscomp$99$$, y: $y$jscomp$84$$, size: $size$jscomp$32$$, rotation: $rotation$jscomp$8$$}) {
266
+ drawClassy({x, y, size, rotation}) {
291
267
  this.basicClassy({
292
- x: $x$jscomp$99$$,
293
- y: $y$jscomp$84$$,
294
- size: $size$jscomp$32$$,
295
- rotation: $rotation$jscomp$8$$
268
+ x,
269
+ y,
270
+ size,
271
+ rotation
296
272
  });
297
273
  }
298
- drawInpoint({x: $x$jscomp$100$$, y: $y$jscomp$85$$, size: $size$jscomp$33$$, rotation: $rotation$jscomp$9$$}) {
274
+ drawInpoint({x, y, size, rotation}) {
299
275
  this.basicInpoint({
300
- x: $x$jscomp$100$$,
301
- y: $y$jscomp$85$$,
302
- size: $size$jscomp$33$$,
303
- rotation: $rotation$jscomp$9$$
276
+ x,
277
+ y,
278
+ size,
279
+ rotation
304
280
  });
305
281
  }
306
- drawOutpoint({x: $x$jscomp$101$$, y: $y$jscomp$86$$, size: $size$jscomp$34$$, rotation: $rotation$jscomp$10$$}) {
282
+ drawOutpoint({x, y, size, rotation}) {
307
283
  this.basicInpoint({
308
- x: $x$jscomp$101$$,
309
- y: $y$jscomp$86$$,
310
- size: $size$jscomp$34$$,
311
- rotation: ($rotation$jscomp$10$$ || 0) + Math.PI
284
+ x,
285
+ y,
286
+ size,
287
+ rotation: (rotation || 0) + Math.PI
312
288
  });
313
289
  }
314
290
  }
315
291
 
316
- class $QRCornerSquare$$ {
292
+ class QRCornerSquare {
317
293
  get element() {
318
294
  return this._element;
319
295
  }
320
296
  get fill() {
321
297
  return this._fill;
322
298
  }
323
- constructor($type$jscomp$152$$, $document$jscomp$3$$) {
324
- this.type = $type$jscomp$152$$, this.document = $document$jscomp$3$$;
299
+ constructor(type, document) {
300
+ this.type = type, this.document = document;
325
301
  }
326
- draw($args$jscomp$7$$) {
327
- let $drawFunction$jscomp$1$$;
302
+ draw(args) {
303
+ let drawFunction;
328
304
  switch (this.type) {
329
- case $CornerSquareType$$.square:
330
- $drawFunction$jscomp$1$$ = this.drawSquare;
305
+ case CornerSquareType.square:
306
+ drawFunction = this.drawSquare;
331
307
  break;
332
308
 
333
- case $CornerSquareType$$.extraRounded:
334
- $drawFunction$jscomp$1$$ = this.drawExtraRounded;
309
+ case CornerSquareType.extraRounded:
310
+ drawFunction = this.drawExtraRounded;
335
311
  break;
336
312
 
337
- case $CornerSquareType$$.classy:
338
- $drawFunction$jscomp$1$$ = this.drawClassy;
313
+ case CornerSquareType.classy:
314
+ drawFunction = this.drawClassy;
339
315
  break;
340
316
 
341
- case $CornerSquareType$$.outpoint:
342
- $drawFunction$jscomp$1$$ = this.drawOutpoint;
317
+ case CornerSquareType.outpoint:
318
+ drawFunction = this.drawOutpoint;
343
319
  break;
344
320
 
345
- case $CornerSquareType$$.inpoint:
346
- $drawFunction$jscomp$1$$ = this.drawInpoint;
321
+ case CornerSquareType.inpoint:
322
+ drawFunction = this.drawInpoint;
347
323
  break;
348
324
 
349
325
  default:
350
- $drawFunction$jscomp$1$$ = this.drawDot;
326
+ drawFunction = this.drawDot;
351
327
  }
352
- $drawFunction$jscomp$1$$.call(this, $args$jscomp$7$$);
328
+ drawFunction.call(this, args);
353
329
  }
354
- rotateFigure({x: $cx$jscomp$1_x$jscomp$102$$, y: $cy$jscomp$1_y$jscomp$87$$, size: $size$jscomp$35$$, rotation: $rotation$jscomp$11$$ = 0, draw: $draw$jscomp$1$$}) {
355
- $cx$jscomp$1_x$jscomp$102$$ += $size$jscomp$35$$ / 2, $cy$jscomp$1_y$jscomp$87$$ += $size$jscomp$35$$ / 2,
356
- $draw$jscomp$1$$(), this._element?.setAttribute("transform", `rotate(${$numToAttr$$(180 * $rotation$jscomp$11$$ / Math.PI)},${$cx$jscomp$1_x$jscomp$102$$},${$cy$jscomp$1_y$jscomp$87$$})`),
357
- this._fill?.setAttribute("transform", `rotate(${$numToAttr$$(180 * $rotation$jscomp$11$$ / Math.PI)},${$cx$jscomp$1_x$jscomp$102$$},${$cy$jscomp$1_y$jscomp$87$$})`);
330
+ rotateFigure({x: cx, y: cy, size, rotation = 0, draw}) {
331
+ cx += size / 2, cy += size / 2, draw(), this._element?.setAttribute("transform", `rotate(${numToAttr(180 * rotation / Math.PI)},${cx},${cy})`),
332
+ this._fill?.setAttribute("transform", `rotate(${numToAttr(180 * rotation / Math.PI)},${cx},${cy})`);
358
333
  }
359
- basicDot($args$jscomp$8$$) {
360
- let {size: $size$jscomp$36$$, x: $x$jscomp$103$$, y: $y$jscomp$88$$} = $args$jscomp$8$$, $dotSize$jscomp$2$$ = $size$jscomp$36$$ / 7;
334
+ basicDot(args) {
335
+ let {size, x, y} = args, dotSize = size / 7;
361
336
  this.rotateFigure({
362
- ...$args$jscomp$8$$,
337
+ ...args,
363
338
  draw: () => {
364
339
  this._element = this.document.createElementNS("http://www.w3.org/2000/svg", "path"),
365
- this._element.setAttribute("clip-rule", "evenodd"), this._element.setAttribute("d", $svgPath$$`M ${$x$jscomp$103$$ + $size$jscomp$36$$ / 2} ${$y$jscomp$88$$} a ${$size$jscomp$36$$ / 2} ${$size$jscomp$36$$ / 2} 0 1 0 0.1 0 z m 0 ${$dotSize$jscomp$2$$} a ${$size$jscomp$36$$ / 2 - $dotSize$jscomp$2$$} ${$size$jscomp$36$$ / 2 - $dotSize$jscomp$2$$} 0 1 1 -0.1 0 Z`),
340
+ this._element.setAttribute("clip-rule", "evenodd"), this._element.setAttribute("d", svgPath`M ${x + size / 2} ${y} a ${size / 2} ${size / 2} 0 1 0 0.1 0 z m 0 ${dotSize} a ${size / 2 - dotSize} ${size / 2 - dotSize} 0 1 1 -0.1 0 Z`),
366
341
  this._fill = this.document.createElementNS("http://www.w3.org/2000/svg", "path"),
367
- this._fill.setAttribute("clip-rule", "evenodd"), this._fill.setAttribute("d", $svgPath$$`M ${$x$jscomp$103$$ + $size$jscomp$36$$ / 2} ${$y$jscomp$88$$ - $dotSize$jscomp$2$$} a ${$size$jscomp$36$$ / 2 + $dotSize$jscomp$2$$} ${$size$jscomp$36$$ / 2 + $dotSize$jscomp$2$$} 0 1 0 0.1 0 z`);
342
+ this._fill.setAttribute("clip-rule", "evenodd"), this._fill.setAttribute("d", svgPath`M ${x + size / 2} ${y - dotSize} a ${size / 2 + dotSize} ${size / 2 + dotSize} 0 1 0 0.1 0 z`);
368
343
  }
369
344
  });
370
345
  }
371
- basicSquare($args$jscomp$9$$) {
372
- let {size: $size$jscomp$37$$, x: $x$jscomp$104$$, y: $y$jscomp$89$$} = $args$jscomp$9$$, $dotSize$jscomp$3$$ = $size$jscomp$37$$ / 7;
346
+ basicSquare(args) {
347
+ let {size, x, y} = args, dotSize = size / 7;
373
348
  this.rotateFigure({
374
- ...$args$jscomp$9$$,
349
+ ...args,
375
350
  draw: () => {
376
351
  this._element = this.document.createElementNS("http://www.w3.org/2000/svg", "path"),
377
- this._element.setAttribute("clip-rule", "evenodd"), this._element.setAttribute("d", $svgPath$$`M ${$x$jscomp$104$$} ${$y$jscomp$89$$} v ${$size$jscomp$37$$} h ${$size$jscomp$37$$} v ${-$size$jscomp$37$$} z M ${$x$jscomp$104$$ + $dotSize$jscomp$3$$} ${$y$jscomp$89$$ + $dotSize$jscomp$3$$} h ${$size$jscomp$37$$ - 2 * $dotSize$jscomp$3$$} v ${$size$jscomp$37$$ - 2 * $dotSize$jscomp$3$$} h ${2 * $dotSize$jscomp$3$$ - $size$jscomp$37$$} z`),
352
+ this._element.setAttribute("clip-rule", "evenodd"), this._element.setAttribute("d", svgPath`M ${x} ${y} v ${size} h ${size} v ${-size} z M ${x + dotSize} ${y + dotSize} h ${size - 2 * dotSize} v ${size - 2 * dotSize} h ${2 * dotSize - size} z`),
378
353
  this._fill = this.document.createElementNS("http://www.w3.org/2000/svg", "path"),
379
- this._fill.setAttribute("clip-rule", "evenodd"), this._fill.setAttribute("d", $svgPath$$`M ${$x$jscomp$104$$ - $dotSize$jscomp$3$$} ${$y$jscomp$89$$ - $dotSize$jscomp$3$$} h ${$size$jscomp$37$$ + 2 * $dotSize$jscomp$3$$} v ${$size$jscomp$37$$ + 2 * $dotSize$jscomp$3$$} h ${-$size$jscomp$37$$ - 2 * $dotSize$jscomp$3$$} z`);
354
+ this._fill.setAttribute("clip-rule", "evenodd"), this._fill.setAttribute("d", svgPath`M ${x - dotSize} ${y - dotSize} h ${size + 2 * dotSize} v ${size + 2 * dotSize} h ${-size - 2 * dotSize} z`);
380
355
  }
381
356
  });
382
357
  }
383
- basicExtraRounded($args$jscomp$10$$) {
384
- let {size: $size$jscomp$38$$, x: $x$jscomp$105$$, y: $y$jscomp$90$$} = $args$jscomp$10$$, $dotSize$jscomp$4$$ = $size$jscomp$38$$ / 7;
358
+ basicExtraRounded(args) {
359
+ let {size, x, y} = args, dotSize = size / 7;
385
360
  this.rotateFigure({
386
- ...$args$jscomp$10$$,
361
+ ...args,
387
362
  draw: () => {
388
363
  this._element = this.document.createElementNS("http://www.w3.org/2000/svg", "path"),
389
- this._element.setAttribute("clip-rule", "evenodd"), this._element.setAttribute("d", $svgPath$$`M ${$x$jscomp$105$$} ${$y$jscomp$90$$ + 2.5 * $dotSize$jscomp$4$$} v ${2 * $dotSize$jscomp$4$$} a ${2.5 * $dotSize$jscomp$4$$} ${2.5 * $dotSize$jscomp$4$$}, 0, 0, 0, ${2.5 * $dotSize$jscomp$4$$} ${2.5 * $dotSize$jscomp$4$$} h ${2 * $dotSize$jscomp$4$$} a ${2.5 * $dotSize$jscomp$4$$} ${2.5 * $dotSize$jscomp$4$$}, 0, 0, 0, ${2.5 * $dotSize$jscomp$4$$} ${2.5 * -$dotSize$jscomp$4$$} v ${-2 * $dotSize$jscomp$4$$} a ${2.5 * $dotSize$jscomp$4$$} ${2.5 * $dotSize$jscomp$4$$}, 0, 0, 0, ${2.5 * -$dotSize$jscomp$4$$} ${2.5 * -$dotSize$jscomp$4$$} h ${-2 * $dotSize$jscomp$4$$} a ${2.5 * $dotSize$jscomp$4$$} ${2.5 * $dotSize$jscomp$4$$}, 0, 0, 0, ${2.5 * -$dotSize$jscomp$4$$} ${2.5 * $dotSize$jscomp$4$$} z M ${$x$jscomp$105$$ + 2.5 * $dotSize$jscomp$4$$} ${$y$jscomp$90$$ + $dotSize$jscomp$4$$} h ${2 * $dotSize$jscomp$4$$} a ${1.5 * $dotSize$jscomp$4$$} ${1.5 * $dotSize$jscomp$4$$}, 0, 0, 1, ${1.5 * $dotSize$jscomp$4$$} ${1.5 * $dotSize$jscomp$4$$} v ${2 * $dotSize$jscomp$4$$} a ${1.5 * $dotSize$jscomp$4$$} ${1.5 * $dotSize$jscomp$4$$}, 0, 0, 1, ${1.5 * -$dotSize$jscomp$4$$} ${1.5 * $dotSize$jscomp$4$$} h ${-2 * $dotSize$jscomp$4$$} a ${1.5 * $dotSize$jscomp$4$$} ${1.5 * $dotSize$jscomp$4$$}, 0, 0, 1, ${1.5 * -$dotSize$jscomp$4$$} ${1.5 * -$dotSize$jscomp$4$$} v ${-2 * $dotSize$jscomp$4$$} a ${1.5 * $dotSize$jscomp$4$$} ${1.5 * $dotSize$jscomp$4$$}, 0, 0, 1, ${1.5 * $dotSize$jscomp$4$$} ${1.5 * -$dotSize$jscomp$4$$} z`),
364
+ this._element.setAttribute("clip-rule", "evenodd"), this._element.setAttribute("d", svgPath`M ${x} ${y + 2.5 * dotSize} v ${2 * dotSize} a ${2.5 * dotSize} ${2.5 * dotSize}, 0, 0, 0, ${2.5 * dotSize} ${2.5 * dotSize} h ${2 * dotSize} a ${2.5 * dotSize} ${2.5 * dotSize}, 0, 0, 0, ${2.5 * dotSize} ${2.5 * -dotSize} v ${-2 * dotSize} a ${2.5 * dotSize} ${2.5 * dotSize}, 0, 0, 0, ${2.5 * -dotSize} ${2.5 * -dotSize} h ${-2 * dotSize} a ${2.5 * dotSize} ${2.5 * dotSize}, 0, 0, 0, ${2.5 * -dotSize} ${2.5 * dotSize} z M ${x + 2.5 * dotSize} ${y + dotSize} h ${2 * dotSize} a ${1.5 * dotSize} ${1.5 * dotSize}, 0, 0, 1, ${1.5 * dotSize} ${1.5 * dotSize} v ${2 * dotSize} a ${1.5 * dotSize} ${1.5 * dotSize}, 0, 0, 1, ${1.5 * -dotSize} ${1.5 * dotSize} h ${-2 * dotSize} a ${1.5 * dotSize} ${1.5 * dotSize}, 0, 0, 1, ${1.5 * -dotSize} ${1.5 * -dotSize} v ${-2 * dotSize} a ${1.5 * dotSize} ${1.5 * dotSize}, 0, 0, 1, ${1.5 * dotSize} ${1.5 * -dotSize} z`),
390
365
  this._fill = this.document.createElementNS("http://www.w3.org/2000/svg", "path"),
391
- this._fill.setAttribute("clip-rule", "evenodd"), this._fill.setAttribute("d", $svgPath$$`M ${$x$jscomp$105$$ - $dotSize$jscomp$4$$} ${$y$jscomp$90$$ + 2.5 * $dotSize$jscomp$4$$} v ${2 * $dotSize$jscomp$4$$} a ${3.5 * $dotSize$jscomp$4$$} ${3.5 * $dotSize$jscomp$4$$}, 0, 0, 0, ${3.5 * $dotSize$jscomp$4$$} ${3.5 * $dotSize$jscomp$4$$} h ${2 * $dotSize$jscomp$4$$} a ${3.5 * $dotSize$jscomp$4$$} ${3.5 * $dotSize$jscomp$4$$}, 0, 0, 0, ${3.5 * $dotSize$jscomp$4$$} ${3.5 * -$dotSize$jscomp$4$$} v ${-2 * $dotSize$jscomp$4$$} a ${3.5 * $dotSize$jscomp$4$$} ${3.5 * $dotSize$jscomp$4$$}, 0, 0, 0, ${3.5 * -$dotSize$jscomp$4$$} ${3.5 * -$dotSize$jscomp$4$$} h ${-2 * $dotSize$jscomp$4$$} a ${3.5 * $dotSize$jscomp$4$$} ${3.5 * $dotSize$jscomp$4$$}, 0, 0, 0, ${3.5 * -$dotSize$jscomp$4$$} ${3.5 * $dotSize$jscomp$4$$} z`);
366
+ this._fill.setAttribute("clip-rule", "evenodd"), this._fill.setAttribute("d", svgPath`M ${x - dotSize} ${y + 2.5 * dotSize} v ${2 * dotSize} a ${3.5 * dotSize} ${3.5 * dotSize}, 0, 0, 0, ${3.5 * dotSize} ${3.5 * dotSize} h ${2 * dotSize} a ${3.5 * dotSize} ${3.5 * dotSize}, 0, 0, 0, ${3.5 * dotSize} ${3.5 * -dotSize} v ${-2 * dotSize} a ${3.5 * dotSize} ${3.5 * dotSize}, 0, 0, 0, ${3.5 * -dotSize} ${3.5 * -dotSize} h ${-2 * dotSize} a ${3.5 * dotSize} ${3.5 * dotSize}, 0, 0, 0, ${3.5 * -dotSize} ${3.5 * dotSize} z`);
392
367
  }
393
368
  });
394
369
  }
395
- basicClassy($args$jscomp$11$$) {
396
- let {size: $size$jscomp$39$$, x: $x$jscomp$106$$, y: $y$jscomp$91$$} = $args$jscomp$11$$, $dotSize$jscomp$5$$ = $size$jscomp$39$$ / 7;
370
+ basicClassy(args) {
371
+ let {size, x, y} = args, dotSize = size / 7;
397
372
  this.rotateFigure({
398
- ...$args$jscomp$11$$,
373
+ ...args,
399
374
  draw: () => {
400
375
  this._element = this.document.createElementNS("http://www.w3.org/2000/svg", "path"),
401
- this._element.setAttribute("clip-rule", "evenodd"), this._element.setAttribute("d", $svgPath$$`M ${$x$jscomp$106$$} ${$y$jscomp$91$$ + 2.5 * $dotSize$jscomp$5$$} v ${2 * $dotSize$jscomp$5$$} a ${2.5 * $dotSize$jscomp$5$$} ${2.5 * $dotSize$jscomp$5$$}, 0, 0, 0, ${2.5 * $dotSize$jscomp$5$$} ${2.5 * $dotSize$jscomp$5$$} h ${4.5 * $dotSize$jscomp$5$$} v ${-4.5 * $dotSize$jscomp$5$$} a ${2.5 * $dotSize$jscomp$5$$} ${2.5 * $dotSize$jscomp$5$$}, 0, 0, 0, ${2.5 * -$dotSize$jscomp$5$$} ${2.5 * -$dotSize$jscomp$5$$} h ${-2 * $dotSize$jscomp$5$$} H ${$x$jscomp$106$$} z M ${$x$jscomp$106$$ + 2.5 * $dotSize$jscomp$5$$} ${$y$jscomp$91$$ + $dotSize$jscomp$5$$} h ${2 * $dotSize$jscomp$5$$} a ${1.5 * $dotSize$jscomp$5$$} ${1.5 * $dotSize$jscomp$5$$}, 0, 0, 1, ${1.5 * $dotSize$jscomp$5$$} ${1.5 * $dotSize$jscomp$5$$} v ${3.5 * $dotSize$jscomp$5$$} h ${-3.5 * $dotSize$jscomp$5$$} a ${1.5 * $dotSize$jscomp$5$$} ${1.5 * $dotSize$jscomp$5$$}, 0, 0, 1, ${1.5 * -$dotSize$jscomp$5$$} ${1.5 * -$dotSize$jscomp$5$$} v ${-3.5 * $dotSize$jscomp$5$$} z`),
376
+ this._element.setAttribute("clip-rule", "evenodd"), this._element.setAttribute("d", svgPath`M ${x} ${y + 2.5 * dotSize} v ${2 * dotSize} a ${2.5 * dotSize} ${2.5 * dotSize}, 0, 0, 0, ${2.5 * dotSize} ${2.5 * dotSize} h ${4.5 * dotSize} v ${-4.5 * dotSize} a ${2.5 * dotSize} ${2.5 * dotSize}, 0, 0, 0, ${2.5 * -dotSize} ${2.5 * -dotSize} h ${-2 * dotSize} H ${x} z M ${x + 2.5 * dotSize} ${y + dotSize} h ${2 * dotSize} a ${1.5 * dotSize} ${1.5 * dotSize}, 0, 0, 1, ${1.5 * dotSize} ${1.5 * dotSize} v ${3.5 * dotSize} h ${-3.5 * dotSize} a ${1.5 * dotSize} ${1.5 * dotSize}, 0, 0, 1, ${1.5 * -dotSize} ${1.5 * -dotSize} v ${-3.5 * dotSize} z`),
402
377
  this._fill = this.document.createElementNS("http://www.w3.org/2000/svg", "path"),
403
- this._fill.setAttribute("clip-rule", "evenodd"), this._fill.setAttribute("d", $svgPath$$`M ${$x$jscomp$106$$ + .5 * $dotSize$jscomp$5$$} ${$y$jscomp$91$$ - $dotSize$jscomp$5$$} h ${4 * $dotSize$jscomp$5$$} a ${3.5 * $dotSize$jscomp$5$$} ${3.5 * $dotSize$jscomp$5$$}, 0, 0, 1, ${3.5 * $dotSize$jscomp$5$$} ${3.5 * $dotSize$jscomp$5$$} v ${5.5 * $dotSize$jscomp$5$$} h ${-5.5 * $dotSize$jscomp$5$$} a ${3.5 * $dotSize$jscomp$5$$} ${3.5 * $dotSize$jscomp$5$$}, 0, 0, 1, ${3.5 * -$dotSize$jscomp$5$$} ${3.5 * -$dotSize$jscomp$5$$} v ${-5.5 * $dotSize$jscomp$5$$} z`);
378
+ this._fill.setAttribute("clip-rule", "evenodd"), this._fill.setAttribute("d", svgPath`M ${x + .5 * dotSize} ${y - dotSize} h ${4 * dotSize} a ${3.5 * dotSize} ${3.5 * dotSize}, 0, 0, 1, ${3.5 * dotSize} ${3.5 * dotSize} v ${5.5 * dotSize} h ${-5.5 * dotSize} a ${3.5 * dotSize} ${3.5 * dotSize}, 0, 0, 1, ${3.5 * -dotSize} ${3.5 * -dotSize} v ${-5.5 * dotSize} z`);
404
379
  }
405
380
  });
406
381
  }
407
- basicInpoint($args$jscomp$12$$) {
408
- let {size: $size$jscomp$40$$, x: $x$jscomp$107$$, y: $y$jscomp$92$$} = $args$jscomp$12$$, $dotSize$jscomp$6$$ = $size$jscomp$40$$ / 7;
382
+ basicInpoint(args) {
383
+ let {size, x, y} = args, dotSize = size / 7;
409
384
  this.rotateFigure({
410
- ...$args$jscomp$12$$,
385
+ ...args,
411
386
  draw: () => {
412
387
  this._element = this.document.createElementNS("http://www.w3.org/2000/svg", "path"),
413
- this._element.setAttribute("clip-rule", "evenodd"), this._element.setAttribute("d", $svgPath$$`M ${$x$jscomp$107$$} ${$y$jscomp$92$$ + 2.5 * $dotSize$jscomp$6$$} v ${2 * $dotSize$jscomp$6$$} a ${2.5 * $dotSize$jscomp$6$$} ${2.5 * $dotSize$jscomp$6$$}, 0, 0, 0, ${2.5 * $dotSize$jscomp$6$$} ${2.5 * $dotSize$jscomp$6$$} h ${4.5 * $dotSize$jscomp$6$$} v ${-4.5 * $dotSize$jscomp$6$$} a ${2.5 * $dotSize$jscomp$6$$} ${2.5 * $dotSize$jscomp$6$$}, 0, 0, 0, ${2.5 * -$dotSize$jscomp$6$$} ${2.5 * -$dotSize$jscomp$6$$} h ${-2 * $dotSize$jscomp$6$$} a ${2.5 * $dotSize$jscomp$6$$} ${2.5 * $dotSize$jscomp$6$$}, 0, 0, 0, ${2.5 * -$dotSize$jscomp$6$$} ${2.5 * $dotSize$jscomp$6$$} z M ${$x$jscomp$107$$ + 2.5 * $dotSize$jscomp$6$$} ${$y$jscomp$92$$ + $dotSize$jscomp$6$$} h ${2 * $dotSize$jscomp$6$$} a ${1.5 * $dotSize$jscomp$6$$} ${1.5 * $dotSize$jscomp$6$$}, 0, 0, 1, ${1.5 * $dotSize$jscomp$6$$} ${1.5 * $dotSize$jscomp$6$$} v ${3.5 * $dotSize$jscomp$6$$} h ${-3.5 * $dotSize$jscomp$6$$} a ${1.5 * $dotSize$jscomp$6$$} ${1.5 * $dotSize$jscomp$6$$}, 0, 0, 1, ${1.5 * -$dotSize$jscomp$6$$} ${1.5 * -$dotSize$jscomp$6$$} v ${-2 * $dotSize$jscomp$6$$} a ${1.5 * $dotSize$jscomp$6$$} ${1.5 * $dotSize$jscomp$6$$}, 0, 0, 1, ${1.5 * $dotSize$jscomp$6$$} ${1.5 * -$dotSize$jscomp$6$$} z`),
388
+ this._element.setAttribute("clip-rule", "evenodd"), this._element.setAttribute("d", svgPath`M ${x} ${y + 2.5 * dotSize} v ${2 * dotSize} a ${2.5 * dotSize} ${2.5 * dotSize}, 0, 0, 0, ${2.5 * dotSize} ${2.5 * dotSize} h ${4.5 * dotSize} v ${-4.5 * dotSize} a ${2.5 * dotSize} ${2.5 * dotSize}, 0, 0, 0, ${2.5 * -dotSize} ${2.5 * -dotSize} h ${-2 * dotSize} a ${2.5 * dotSize} ${2.5 * dotSize}, 0, 0, 0, ${2.5 * -dotSize} ${2.5 * dotSize} z M ${x + 2.5 * dotSize} ${y + dotSize} h ${2 * dotSize} a ${1.5 * dotSize} ${1.5 * dotSize}, 0, 0, 1, ${1.5 * dotSize} ${1.5 * dotSize} v ${3.5 * dotSize} h ${-3.5 * dotSize} a ${1.5 * dotSize} ${1.5 * dotSize}, 0, 0, 1, ${1.5 * -dotSize} ${1.5 * -dotSize} v ${-2 * dotSize} a ${1.5 * dotSize} ${1.5 * dotSize}, 0, 0, 1, ${1.5 * dotSize} ${1.5 * -dotSize} z`),
414
389
  this._fill = this.document.createElementNS("http://www.w3.org/2000/svg", "path"),
415
- this._fill.setAttribute("clip-rule", "evenodd"), this._fill.setAttribute("d", $svgPath$$`M ${$x$jscomp$107$$ + .5 * $dotSize$jscomp$6$$} ${$y$jscomp$92$$ - $dotSize$jscomp$6$$} h ${4 * $dotSize$jscomp$6$$} a ${3.5 * $dotSize$jscomp$6$$} ${3.5 * $dotSize$jscomp$6$$}, 0, 0, 1, ${3.5 * $dotSize$jscomp$6$$} ${3.5 * $dotSize$jscomp$6$$} v ${5.5 * $dotSize$jscomp$6$$} h ${-5.5 * $dotSize$jscomp$6$$} a ${3.5 * $dotSize$jscomp$6$$} ${3.5 * $dotSize$jscomp$6$$}, 0, 0, 1, ${3.5 * -$dotSize$jscomp$6$$} ${3.5 * -$dotSize$jscomp$6$$} v ${-2 * $dotSize$jscomp$6$$} a ${3.5 * $dotSize$jscomp$6$$} ${3.5 * $dotSize$jscomp$6$$}, 0, 0, 1, ${3.5 * $dotSize$jscomp$6$$} ${3.5 * -$dotSize$jscomp$6$$} z`);
390
+ this._fill.setAttribute("clip-rule", "evenodd"), this._fill.setAttribute("d", svgPath`M ${x + .5 * dotSize} ${y - dotSize} h ${4 * dotSize} a ${3.5 * dotSize} ${3.5 * dotSize}, 0, 0, 1, ${3.5 * dotSize} ${3.5 * dotSize} v ${5.5 * dotSize} h ${-5.5 * dotSize} a ${3.5 * dotSize} ${3.5 * dotSize}, 0, 0, 1, ${3.5 * -dotSize} ${3.5 * -dotSize} v ${-2 * dotSize} a ${3.5 * dotSize} ${3.5 * dotSize}, 0, 0, 1, ${3.5 * dotSize} ${3.5 * -dotSize} z`);
416
391
  }
417
392
  });
418
393
  }
419
- drawDot({x: $x$jscomp$108$$, y: $y$jscomp$93$$, size: $size$jscomp$41$$, rotation: $rotation$jscomp$12$$}) {
394
+ drawDot({x, y, size, rotation}) {
420
395
  this.basicDot({
421
- x: $x$jscomp$108$$,
422
- y: $y$jscomp$93$$,
423
- size: $size$jscomp$41$$,
424
- rotation: $rotation$jscomp$12$$
396
+ x,
397
+ y,
398
+ size,
399
+ rotation
425
400
  });
426
401
  }
427
- drawSquare({x: $x$jscomp$109$$, y: $y$jscomp$94$$, size: $size$jscomp$42$$, rotation: $rotation$jscomp$13$$}) {
402
+ drawSquare({x, y, size, rotation}) {
428
403
  this.basicSquare({
429
- x: $x$jscomp$109$$,
430
- y: $y$jscomp$94$$,
431
- size: $size$jscomp$42$$,
432
- rotation: $rotation$jscomp$13$$
404
+ x,
405
+ y,
406
+ size,
407
+ rotation
433
408
  });
434
409
  }
435
- drawExtraRounded({x: $x$jscomp$110$$, y: $y$jscomp$95$$, size: $size$jscomp$43$$, rotation: $rotation$jscomp$14$$}) {
410
+ drawExtraRounded({x, y, size, rotation}) {
436
411
  this.basicExtraRounded({
437
- x: $x$jscomp$110$$,
438
- y: $y$jscomp$95$$,
439
- size: $size$jscomp$43$$,
440
- rotation: $rotation$jscomp$14$$
412
+ x,
413
+ y,
414
+ size,
415
+ rotation
441
416
  });
442
417
  }
443
- drawClassy({x: $x$jscomp$111$$, y: $y$jscomp$96$$, size: $size$jscomp$44$$, rotation: $rotation$jscomp$15$$}) {
418
+ drawClassy({x, y, size, rotation}) {
444
419
  this.basicClassy({
445
- x: $x$jscomp$111$$,
446
- y: $y$jscomp$96$$,
447
- size: $size$jscomp$44$$,
448
- rotation: $rotation$jscomp$15$$
420
+ x,
421
+ y,
422
+ size,
423
+ rotation
449
424
  });
450
425
  }
451
- drawInpoint({x: $x$jscomp$112$$, y: $y$jscomp$97$$, size: $size$jscomp$45$$, rotation: $rotation$jscomp$16$$}) {
426
+ drawInpoint({x, y, size, rotation}) {
452
427
  this.basicInpoint({
453
- x: $x$jscomp$112$$,
454
- y: $y$jscomp$97$$,
455
- size: $size$jscomp$45$$,
456
- rotation: $rotation$jscomp$16$$
428
+ x,
429
+ y,
430
+ size,
431
+ rotation
457
432
  });
458
433
  }
459
- drawOutpoint({x: $x$jscomp$113$$, y: $y$jscomp$98$$, size: $size$jscomp$46$$, rotation: $rotation$jscomp$17$$}) {
434
+ drawOutpoint({x, y, size, rotation}) {
460
435
  this.basicInpoint({
461
- x: $x$jscomp$113$$,
462
- y: $y$jscomp$98$$,
463
- size: $size$jscomp$46$$,
464
- rotation: ($rotation$jscomp$17$$ || 0) + Math.PI
436
+ x,
437
+ y,
438
+ size,
439
+ rotation: (rotation || 0) + Math.PI
465
440
  });
466
441
  }
467
442
  }
468
443
 
469
- class $QRDot$$ {
444
+ class QRDot {
470
445
  get element() {
471
446
  return this._element;
472
447
  }
473
- constructor($type$jscomp$154$$, $document$jscomp$4$$) {
474
- this.type = $type$jscomp$154$$, this.document = $document$jscomp$4$$;
448
+ constructor(type, document) {
449
+ this.type = type, this.document = document;
475
450
  }
476
- draw($args$jscomp$13$$) {
477
- let $drawFunction$jscomp$2$$;
451
+ draw(args) {
452
+ let drawFunction;
478
453
  switch (this.type) {
479
- case $DotType$$.dot:
480
- $drawFunction$jscomp$2$$ = this.drawDot;
454
+ case DotType.dot:
455
+ drawFunction = this.drawDot;
481
456
  break;
482
457
 
483
- case $DotType$$.randomDot:
484
- $drawFunction$jscomp$2$$ = this.drawRandomDot;
458
+ case DotType.randomDot:
459
+ drawFunction = this.drawRandomDot;
485
460
  break;
486
461
 
487
- case $DotType$$.classy:
488
- $drawFunction$jscomp$2$$ = this.drawClassy;
462
+ case DotType.classy:
463
+ drawFunction = this.drawClassy;
489
464
  break;
490
465
 
491
- case $DotType$$.classyRounded:
492
- $drawFunction$jscomp$2$$ = this.drawClassyRounded;
466
+ case DotType.classyRounded:
467
+ drawFunction = this.drawClassyRounded;
493
468
  break;
494
469
 
495
- case $DotType$$.rounded:
496
- $drawFunction$jscomp$2$$ = this.drawRounded;
470
+ case DotType.rounded:
471
+ drawFunction = this.drawRounded;
497
472
  break;
498
473
 
499
- case $DotType$$.verticalLine:
500
- $drawFunction$jscomp$2$$ = this.drawVerticalLine;
474
+ case DotType.verticalLine:
475
+ drawFunction = this.drawVerticalLine;
501
476
  break;
502
477
 
503
- case $DotType$$.horizontalLine:
504
- $drawFunction$jscomp$2$$ = this.drawHorizontalLine;
478
+ case DotType.horizontalLine:
479
+ drawFunction = this.drawHorizontalLine;
505
480
  break;
506
481
 
507
- case $DotType$$.extraRounded:
508
- $drawFunction$jscomp$2$$ = this.drawExtraRounded;
482
+ case DotType.extraRounded:
483
+ drawFunction = this.drawExtraRounded;
509
484
  break;
510
485
 
511
- case $DotType$$.diamond:
512
- $drawFunction$jscomp$2$$ = this.drawDiamond;
486
+ case DotType.diamond:
487
+ drawFunction = this.drawDiamond;
513
488
  break;
514
489
 
515
- case $DotType$$.smallSquare:
516
- $drawFunction$jscomp$2$$ = this.drawSmallSquare;
490
+ case DotType.smallSquare:
491
+ drawFunction = this.drawSmallSquare;
517
492
  break;
518
493
 
519
- case $DotType$$.tinySquare:
520
- $drawFunction$jscomp$2$$ = this.drawTinySquare;
494
+ case DotType.tinySquare:
495
+ drawFunction = this.drawTinySquare;
521
496
  break;
522
497
 
523
498
  default:
524
- $drawFunction$jscomp$2$$ = this.drawSquare;
499
+ drawFunction = this.drawSquare;
525
500
  }
526
- $drawFunction$jscomp$2$$.call(this, $args$jscomp$13$$);
501
+ drawFunction.call(this, args);
527
502
  }
528
- rotateFigure({x: $cx$jscomp$2_x$jscomp$114$$, y: $cy$jscomp$2_y$jscomp$99$$, size: $size$jscomp$47$$, rotation: $rotation$jscomp$18$$ = 0, draw: $draw$jscomp$2$$}) {
529
- $cx$jscomp$2_x$jscomp$114$$ += $size$jscomp$47$$ / 2, $cy$jscomp$2_y$jscomp$99$$ += $size$jscomp$47$$ / 2,
530
- $draw$jscomp$2$$(), this._element?.setAttribute("transform", `rotate(${$numToAttr$$(180 * $rotation$jscomp$18$$ / Math.PI)},${$cx$jscomp$2_x$jscomp$114$$},${$cy$jscomp$2_y$jscomp$99$$})`);
503
+ rotateFigure({x: cx, y: cy, size, rotation = 0, draw}) {
504
+ cx += size / 2, cy += size / 2, draw(), this._element?.setAttribute("transform", `rotate(${numToAttr(180 * rotation / Math.PI)},${cx},${cy})`);
531
505
  }
532
- basicDot($args$jscomp$14$$) {
533
- let {size: $size$jscomp$48$$, x: $x$jscomp$115$$, y: $y$jscomp$100$$} = $args$jscomp$14$$;
506
+ basicDot(args) {
507
+ let {size, x, y} = args;
534
508
  this.rotateFigure({
535
- ...$args$jscomp$14$$,
509
+ ...args,
536
510
  draw: () => {
537
511
  this._element = this.document.createElementNS("http://www.w3.org/2000/svg", "circle"),
538
- this._element.setAttribute("cx", $numToAttr$$($x$jscomp$115$$ + $size$jscomp$48$$ / 2)),
539
- this._element.setAttribute("cy", $numToAttr$$($y$jscomp$100$$ + $size$jscomp$48$$ / 2)),
540
- this._element.setAttribute("r", $numToAttr$$($size$jscomp$48$$ / 2));
512
+ this._element.setAttribute("cx", numToAttr(x + size / 2)), this._element.setAttribute("cy", numToAttr(y + size / 2)),
513
+ this._element.setAttribute("r", numToAttr(size / 2));
541
514
  }
542
515
  });
543
516
  }
544
- basicSquare($args$jscomp$15$$) {
545
- let {size: $size$jscomp$49$$, x: $x$jscomp$116$$, y: $y$jscomp$101$$} = $args$jscomp$15$$;
517
+ basicSquare(args) {
518
+ let {size, x, y} = args;
546
519
  this.rotateFigure({
547
- ...$args$jscomp$15$$,
520
+ ...args,
548
521
  draw: () => {
549
522
  this._element = this.document.createElementNS("http://www.w3.org/2000/svg", "rect"),
550
- this._element.setAttribute("x", $numToAttr$$($x$jscomp$116$$)), this._element.setAttribute("y", $numToAttr$$($y$jscomp$101$$)),
551
- this._element.setAttribute("width", $numToAttr$$($size$jscomp$49$$)), this._element.setAttribute("height", $numToAttr$$($size$jscomp$49$$));
523
+ this._element.setAttribute("x", numToAttr(x)), this._element.setAttribute("y", numToAttr(y)),
524
+ this._element.setAttribute("width", numToAttr(size)), this._element.setAttribute("height", numToAttr(size));
552
525
  }
553
526
  });
554
527
  }
555
- basicSideRounded($args$jscomp$16$$) {
556
- let {size: $size$jscomp$50$$, x: $x$jscomp$117$$, y: $y$jscomp$102$$} = $args$jscomp$16$$;
528
+ basicSideRounded(args) {
529
+ let {size, x, y} = args;
557
530
  this.rotateFigure({
558
- ...$args$jscomp$16$$,
531
+ ...args,
559
532
  draw: () => {
560
533
  this._element = this.document.createElementNS("http://www.w3.org/2000/svg", "path"),
561
- this._element.setAttribute("d", $svgPath$$`M ${$x$jscomp$117$$} ${$y$jscomp$102$$} v ${$size$jscomp$50$$} h ${$size$jscomp$50$$ / 2} a ${$size$jscomp$50$$ / 2} ${$size$jscomp$50$$ / 2}, 0, 0, 0, 0 ${-$size$jscomp$50$$} z`);
534
+ this._element.setAttribute("d", svgPath`M ${x} ${y} v ${size} h ${size / 2} a ${size / 2} ${size / 2}, 0, 0, 0, 0 ${-size} z`);
562
535
  }
563
536
  });
564
537
  }
565
- basicCornerRounded($args$jscomp$17$$) {
566
- let {size: $size$jscomp$51$$, x: $x$jscomp$118$$, y: $y$jscomp$103$$} = $args$jscomp$17$$;
538
+ basicCornerRounded(args) {
539
+ let {size, x, y} = args;
567
540
  this.rotateFigure({
568
- ...$args$jscomp$17$$,
541
+ ...args,
569
542
  draw: () => {
570
543
  this._element = this.document.createElementNS("http://www.w3.org/2000/svg", "path"),
571
- this._element.setAttribute("d", $svgPath$$`M ${$x$jscomp$118$$} ${$y$jscomp$103$$} v ${$size$jscomp$51$$} h ${$size$jscomp$51$$} v ${-$size$jscomp$51$$ / 2} a ${$size$jscomp$51$$ / 2} ${$size$jscomp$51$$ / 2}, 0, 0, 0, ${-$size$jscomp$51$$ / 2} ${-$size$jscomp$51$$ / 2} z`);
544
+ this._element.setAttribute("d", svgPath`M ${x} ${y} v ${size} h ${size} v ${-size / 2} a ${size / 2} ${size / 2}, 0, 0, 0, ${-size / 2} ${-size / 2} z`);
572
545
  }
573
546
  });
574
547
  }
575
- basicCornerExtraRounded($args$jscomp$18$$) {
576
- let {size: $size$jscomp$52$$, x: $x$jscomp$119$$, y: $y$jscomp$104$$} = $args$jscomp$18$$;
548
+ basicCornerExtraRounded(args) {
549
+ let {size, x, y} = args;
577
550
  this.rotateFigure({
578
- ...$args$jscomp$18$$,
551
+ ...args,
579
552
  draw: () => {
580
553
  this._element = this.document.createElementNS("http://www.w3.org/2000/svg", "path"),
581
- this._element.setAttribute("d", $svgPath$$`M ${$x$jscomp$119$$} ${$y$jscomp$104$$} v ${$size$jscomp$52$$} h ${$size$jscomp$52$$} a ${$size$jscomp$52$$} ${$size$jscomp$52$$}, 0, 0, 0, ${-$size$jscomp$52$$} ${-$size$jscomp$52$$} z`);
554
+ this._element.setAttribute("d", svgPath`M ${x} ${y} v ${size} h ${size} a ${size} ${size}, 0, 0, 0, ${-size} ${-size} z`);
582
555
  }
583
556
  });
584
557
  }
585
- basicCornersRounded($args$jscomp$19$$) {
586
- let {size: $size$jscomp$53$$, x: $x$jscomp$120$$, y: $y$jscomp$105$$} = $args$jscomp$19$$;
558
+ basicCornersRounded(args) {
559
+ let {size, x, y} = args;
587
560
  this.rotateFigure({
588
- ...$args$jscomp$19$$,
561
+ ...args,
589
562
  draw: () => {
590
563
  this._element = this.document.createElementNS("http://www.w3.org/2000/svg", "path"),
591
- this._element.setAttribute("d", $svgPath$$`M ${$x$jscomp$120$$} ${$y$jscomp$105$$} v ${$size$jscomp$53$$ / 2} a ${$size$jscomp$53$$ / 2} ${$size$jscomp$53$$ / 2}, 0, 0, 0, ${$size$jscomp$53$$ / 2} ${$size$jscomp$53$$ / 2} h ${$size$jscomp$53$$ / 2} v ${-$size$jscomp$53$$ / 2} a ${$size$jscomp$53$$ / 2} ${$size$jscomp$53$$ / 2}, 0, 0, 0, ${-$size$jscomp$53$$ / 2} ${-$size$jscomp$53$$ / 2} z`);
564
+ this._element.setAttribute("d", svgPath`M ${x} ${y} v ${size / 2} a ${size / 2} ${size / 2}, 0, 0, 0, ${size / 2} ${size / 2} h ${size / 2} v ${-size / 2} a ${size / 2} ${size / 2}, 0, 0, 0, ${-size / 2} ${-size / 2} z`);
592
565
  }
593
566
  });
594
567
  }
595
- drawDot({x: $x$jscomp$121$$, y: $y$jscomp$106$$, size: $size$jscomp$54$$}) {
568
+ drawDot({x, y, size}) {
596
569
  this.basicDot({
597
- x: $x$jscomp$121$$,
598
- y: $y$jscomp$106$$,
599
- size: $size$jscomp$54$$,
570
+ x,
571
+ y,
572
+ size,
600
573
  rotation: 0
601
574
  });
602
575
  }
603
- drawRandomDot({x: $x$jscomp$122$$, y: $y$jscomp$107$$, size: $size$jscomp$55$$}) {
576
+ drawRandomDot({x, y, size}) {
604
577
  this.basicDot({
605
- x: $x$jscomp$122$$,
606
- y: $y$jscomp$107$$,
607
- size: $size$jscomp$55$$ * (.25 * Math.random() + .75),
578
+ x,
579
+ y,
580
+ size: size * (.25 * Math.random() + .75),
608
581
  rotation: 0
609
582
  });
610
583
  }
611
- drawSquare({x: $x$jscomp$123$$, y: $y$jscomp$108$$, size: $size$jscomp$56$$}) {
584
+ drawSquare({x, y, size}) {
612
585
  this.basicSquare({
613
- x: $x$jscomp$123$$,
614
- y: $y$jscomp$108$$,
615
- size: $size$jscomp$56$$,
586
+ x,
587
+ y,
588
+ size,
616
589
  rotation: 0
617
590
  });
618
591
  }
619
- drawSmallSquare({x: $x$jscomp$124$$, y: $y$jscomp$109$$, size: $size$jscomp$57$$}) {
592
+ drawSmallSquare({x, y, size}) {
620
593
  this.basicSquare({
621
- x: $x$jscomp$124$$ + .15 * $size$jscomp$57$$,
622
- y: $y$jscomp$109$$ + .15 * $size$jscomp$57$$,
623
- size: .7 * $size$jscomp$57$$,
594
+ x: x + .15 * size,
595
+ y: y + .15 * size,
596
+ size: .7 * size,
624
597
  rotation: 0
625
598
  });
626
599
  }
627
- drawTinySquare({x: $x$jscomp$125$$, y: $y$jscomp$110$$, size: $size$jscomp$58$$}) {
600
+ drawTinySquare({x, y, size}) {
628
601
  this.basicSquare({
629
- x: $x$jscomp$125$$ + .35 * $size$jscomp$58$$,
630
- y: $y$jscomp$110$$ + .35 * $size$jscomp$58$$,
631
- size: .3 * $size$jscomp$58$$,
602
+ x: x + .35 * size,
603
+ y: y + .35 * size,
604
+ size: .3 * size,
632
605
  rotation: 0
633
606
  });
634
607
  }
635
- drawDiamond({x: $x$jscomp$126$$, y: $y$jscomp$111$$, size: $size$jscomp$59$$}) {
608
+ drawDiamond({x, y, size}) {
636
609
  this.basicSquare({
637
- x: $x$jscomp$126$$,
638
- y: $y$jscomp$111$$,
639
- size: $size$jscomp$59$$,
610
+ x,
611
+ y,
612
+ size,
640
613
  rotation: Math.PI / 4
641
614
  });
642
615
  }
643
- drawRounded({x: $x$jscomp$127$$, y: $y$jscomp$112$$, size: $size$jscomp$60$$, getNeighbor: $bottomNeighbor_getNeighbor$$}) {
644
- var $leftNeighbor_rotation$jscomp$20$$ = $bottomNeighbor_getNeighbor$$ ? +$bottomNeighbor_getNeighbor$$(-1, 0) : 0;
645
- let $rightNeighbor$$ = $bottomNeighbor_getNeighbor$$ ? +$bottomNeighbor_getNeighbor$$(1, 0) : 0, $topNeighbor$$ = $bottomNeighbor_getNeighbor$$ ? +$bottomNeighbor_getNeighbor$$(0, -1) : 0;
646
- var $neighborsCount_rotation$jscomp$19$$ = $leftNeighbor_rotation$jscomp$20$$ + $rightNeighbor$$ + $topNeighbor$$ + ($bottomNeighbor_getNeighbor$$ = $bottomNeighbor_getNeighbor$$ ? +$bottomNeighbor_getNeighbor$$(0, 1) : 0);
647
- 0 === $neighborsCount_rotation$jscomp$19$$ ? this.basicDot({
648
- x: $x$jscomp$127$$,
649
- y: $y$jscomp$112$$,
650
- size: $size$jscomp$60$$,
616
+ drawRounded({x, y, size, getNeighbor: bottomNeighbor_getNeighbor}) {
617
+ var leftNeighbor_rotation = bottomNeighbor_getNeighbor ? +bottomNeighbor_getNeighbor(-1, 0) : 0;
618
+ let rightNeighbor = bottomNeighbor_getNeighbor ? +bottomNeighbor_getNeighbor(1, 0) : 0, topNeighbor = bottomNeighbor_getNeighbor ? +bottomNeighbor_getNeighbor(0, -1) : 0;
619
+ var neighborsCount_rotation = leftNeighbor_rotation + rightNeighbor + topNeighbor + (bottomNeighbor_getNeighbor = bottomNeighbor_getNeighbor ? +bottomNeighbor_getNeighbor(0, 1) : 0);
620
+ 0 === neighborsCount_rotation ? this.basicDot({
621
+ x,
622
+ y,
623
+ size,
651
624
  rotation: 0
652
- }) : 2 < $neighborsCount_rotation$jscomp$19$$ || $leftNeighbor_rotation$jscomp$20$$ && $rightNeighbor$$ || $topNeighbor$$ && $bottomNeighbor_getNeighbor$$ ? this.basicSquare({
653
- x: $x$jscomp$127$$,
654
- y: $y$jscomp$112$$,
655
- size: $size$jscomp$60$$,
625
+ }) : 2 < neighborsCount_rotation || leftNeighbor_rotation && rightNeighbor || topNeighbor && bottomNeighbor_getNeighbor ? this.basicSquare({
626
+ x,
627
+ y,
628
+ size,
656
629
  rotation: 0
657
- }) : 2 === $neighborsCount_rotation$jscomp$19$$ ? ($neighborsCount_rotation$jscomp$19$$ = 0,
658
- $leftNeighbor_rotation$jscomp$20$$ && $topNeighbor$$ ? $neighborsCount_rotation$jscomp$19$$ = Math.PI / 2 : $topNeighbor$$ && $rightNeighbor$$ ? $neighborsCount_rotation$jscomp$19$$ = Math.PI : $rightNeighbor$$ && $bottomNeighbor_getNeighbor$$ && ($neighborsCount_rotation$jscomp$19$$ = -Math.PI / 2),
630
+ }) : 2 === neighborsCount_rotation ? (neighborsCount_rotation = 0, leftNeighbor_rotation && topNeighbor ? neighborsCount_rotation = Math.PI / 2 : topNeighbor && rightNeighbor ? neighborsCount_rotation = Math.PI : rightNeighbor && bottomNeighbor_getNeighbor && (neighborsCount_rotation = -Math.PI / 2),
659
631
  this.basicCornerRounded({
660
- x: $x$jscomp$127$$,
661
- y: $y$jscomp$112$$,
662
- size: $size$jscomp$60$$,
663
- rotation: $neighborsCount_rotation$jscomp$19$$
664
- })) : 1 === $neighborsCount_rotation$jscomp$19$$ && ($leftNeighbor_rotation$jscomp$20$$ = 0,
665
- $topNeighbor$$ ? $leftNeighbor_rotation$jscomp$20$$ = Math.PI / 2 : $rightNeighbor$$ ? $leftNeighbor_rotation$jscomp$20$$ = Math.PI : $bottomNeighbor_getNeighbor$$ && ($leftNeighbor_rotation$jscomp$20$$ = -Math.PI / 2),
632
+ x,
633
+ y,
634
+ size,
635
+ rotation: neighborsCount_rotation
636
+ })) : 1 === neighborsCount_rotation && (leftNeighbor_rotation = 0, topNeighbor ? leftNeighbor_rotation = Math.PI / 2 : rightNeighbor ? leftNeighbor_rotation = Math.PI : bottomNeighbor_getNeighbor && (leftNeighbor_rotation = -Math.PI / 2),
666
637
  this.basicSideRounded({
667
- x: $x$jscomp$127$$,
668
- y: $y$jscomp$112$$,
669
- size: $size$jscomp$60$$,
670
- rotation: $leftNeighbor_rotation$jscomp$20$$
638
+ x,
639
+ y,
640
+ size,
641
+ rotation: leftNeighbor_rotation
671
642
  }));
672
643
  }
673
- drawVerticalLine({x: $x$jscomp$128$$, y: $y$jscomp$113$$, size: $size$jscomp$61$$, getNeighbor: $bottomNeighbor$jscomp$1_getNeighbor$jscomp$1$$}) {
674
- let $leftNeighbor$jscomp$1$$ = $bottomNeighbor$jscomp$1_getNeighbor$jscomp$1$$ ? +$bottomNeighbor$jscomp$1_getNeighbor$jscomp$1$$(-1, 0) : 0, $rightNeighbor$jscomp$1$$ = $bottomNeighbor$jscomp$1_getNeighbor$jscomp$1$$ ? +$bottomNeighbor$jscomp$1_getNeighbor$jscomp$1$$(1, 0) : 0, $topNeighbor$jscomp$1$$ = $bottomNeighbor$jscomp$1_getNeighbor$jscomp$1$$ ? +$bottomNeighbor$jscomp$1_getNeighbor$jscomp$1$$(0, -1) : 0;
675
- 0 === $leftNeighbor$jscomp$1$$ + $rightNeighbor$jscomp$1$$ + $topNeighbor$jscomp$1$$ + ($bottomNeighbor$jscomp$1_getNeighbor$jscomp$1$$ = $bottomNeighbor$jscomp$1_getNeighbor$jscomp$1$$ ? +$bottomNeighbor$jscomp$1_getNeighbor$jscomp$1$$(0, 1) : 0) || $leftNeighbor$jscomp$1$$ && !$topNeighbor$jscomp$1$$ && !$bottomNeighbor$jscomp$1_getNeighbor$jscomp$1$$ || $rightNeighbor$jscomp$1$$ && !$topNeighbor$jscomp$1$$ && !$bottomNeighbor$jscomp$1_getNeighbor$jscomp$1$$ ? this.basicDot({
676
- x: $x$jscomp$128$$,
677
- y: $y$jscomp$113$$,
678
- size: $size$jscomp$61$$,
644
+ drawVerticalLine({x, y, size, getNeighbor: bottomNeighbor}) {
645
+ let leftNeighbor = bottomNeighbor ? +bottomNeighbor(-1, 0) : 0, rightNeighbor = bottomNeighbor ? +bottomNeighbor(1, 0) : 0, topNeighbor = bottomNeighbor ? +bottomNeighbor(0, -1) : 0;
646
+ 0 === leftNeighbor + rightNeighbor + topNeighbor + (bottomNeighbor = bottomNeighbor ? +bottomNeighbor(0, 1) : 0) || leftNeighbor && !topNeighbor && !bottomNeighbor || rightNeighbor && !topNeighbor && !bottomNeighbor ? this.basicDot({
647
+ x,
648
+ y,
649
+ size,
679
650
  rotation: 0
680
- }) : $topNeighbor$jscomp$1$$ && $bottomNeighbor$jscomp$1_getNeighbor$jscomp$1$$ ? this.basicSquare({
681
- x: $x$jscomp$128$$,
682
- y: $y$jscomp$113$$,
683
- size: $size$jscomp$61$$,
651
+ }) : topNeighbor && bottomNeighbor ? this.basicSquare({
652
+ x,
653
+ y,
654
+ size,
684
655
  rotation: 0
685
- }) : $topNeighbor$jscomp$1$$ && !$bottomNeighbor$jscomp$1_getNeighbor$jscomp$1$$ ? this.basicSideRounded({
686
- x: $x$jscomp$128$$,
687
- y: $y$jscomp$113$$,
688
- size: $size$jscomp$61$$,
656
+ }) : topNeighbor && !bottomNeighbor ? this.basicSideRounded({
657
+ x,
658
+ y,
659
+ size,
689
660
  rotation: Math.PI / 2
690
- }) : $bottomNeighbor$jscomp$1_getNeighbor$jscomp$1$$ && !$topNeighbor$jscomp$1$$ && this.basicSideRounded({
691
- x: $x$jscomp$128$$,
692
- y: $y$jscomp$113$$,
693
- size: $size$jscomp$61$$,
661
+ }) : bottomNeighbor && !topNeighbor && this.basicSideRounded({
662
+ x,
663
+ y,
664
+ size,
694
665
  rotation: -Math.PI / 2
695
666
  });
696
667
  }
697
- drawHorizontalLine({x: $x$jscomp$129$$, y: $y$jscomp$114$$, size: $size$jscomp$62$$, getNeighbor: $bottomNeighbor$jscomp$2_getNeighbor$jscomp$2$$}) {
698
- let $leftNeighbor$jscomp$2$$ = $bottomNeighbor$jscomp$2_getNeighbor$jscomp$2$$ ? +$bottomNeighbor$jscomp$2_getNeighbor$jscomp$2$$(-1, 0) : 0, $rightNeighbor$jscomp$2$$ = $bottomNeighbor$jscomp$2_getNeighbor$jscomp$2$$ ? +$bottomNeighbor$jscomp$2_getNeighbor$jscomp$2$$(1, 0) : 0, $topNeighbor$jscomp$2$$ = $bottomNeighbor$jscomp$2_getNeighbor$jscomp$2$$ ? +$bottomNeighbor$jscomp$2_getNeighbor$jscomp$2$$(0, -1) : 0;
699
- 0 === $leftNeighbor$jscomp$2$$ + $rightNeighbor$jscomp$2$$ + $topNeighbor$jscomp$2$$ + ($bottomNeighbor$jscomp$2_getNeighbor$jscomp$2$$ = $bottomNeighbor$jscomp$2_getNeighbor$jscomp$2$$ ? +$bottomNeighbor$jscomp$2_getNeighbor$jscomp$2$$(0, 1) : 0) || $topNeighbor$jscomp$2$$ && !$leftNeighbor$jscomp$2$$ && !$rightNeighbor$jscomp$2$$ || $bottomNeighbor$jscomp$2_getNeighbor$jscomp$2$$ && !$leftNeighbor$jscomp$2$$ && !$rightNeighbor$jscomp$2$$ ? this.basicDot({
700
- x: $x$jscomp$129$$,
701
- y: $y$jscomp$114$$,
702
- size: $size$jscomp$62$$,
668
+ drawHorizontalLine({x, y, size, getNeighbor: bottomNeighbor}) {
669
+ let leftNeighbor = bottomNeighbor ? +bottomNeighbor(-1, 0) : 0, rightNeighbor = bottomNeighbor ? +bottomNeighbor(1, 0) : 0, topNeighbor = bottomNeighbor ? +bottomNeighbor(0, -1) : 0;
670
+ 0 === leftNeighbor + rightNeighbor + topNeighbor + (bottomNeighbor = bottomNeighbor ? +bottomNeighbor(0, 1) : 0) || topNeighbor && !leftNeighbor && !rightNeighbor || bottomNeighbor && !leftNeighbor && !rightNeighbor ? this.basicDot({
671
+ x,
672
+ y,
673
+ size,
703
674
  rotation: 0
704
- }) : $leftNeighbor$jscomp$2$$ && $rightNeighbor$jscomp$2$$ ? this.basicSquare({
705
- x: $x$jscomp$129$$,
706
- y: $y$jscomp$114$$,
707
- size: $size$jscomp$62$$,
675
+ }) : leftNeighbor && rightNeighbor ? this.basicSquare({
676
+ x,
677
+ y,
678
+ size,
708
679
  rotation: 0
709
- }) : $leftNeighbor$jscomp$2$$ && !$rightNeighbor$jscomp$2$$ ? this.basicSideRounded({
710
- x: $x$jscomp$129$$,
711
- y: $y$jscomp$114$$,
712
- size: $size$jscomp$62$$,
680
+ }) : leftNeighbor && !rightNeighbor ? this.basicSideRounded({
681
+ x,
682
+ y,
683
+ size,
713
684
  rotation: 0
714
- }) : $rightNeighbor$jscomp$2$$ && !$leftNeighbor$jscomp$2$$ && this.basicSideRounded({
715
- x: $x$jscomp$129$$,
716
- y: $y$jscomp$114$$,
717
- size: $size$jscomp$62$$,
685
+ }) : rightNeighbor && !leftNeighbor && this.basicSideRounded({
686
+ x,
687
+ y,
688
+ size,
718
689
  rotation: Math.PI
719
690
  });
720
691
  }
721
- drawExtraRounded({x: $x$jscomp$130$$, y: $y$jscomp$115$$, size: $size$jscomp$63$$, getNeighbor: $bottomNeighbor$jscomp$3_getNeighbor$jscomp$3$$}) {
722
- var $leftNeighbor$jscomp$3_rotation$jscomp$26$$ = $bottomNeighbor$jscomp$3_getNeighbor$jscomp$3$$ ? +$bottomNeighbor$jscomp$3_getNeighbor$jscomp$3$$(-1, 0) : 0;
723
- let $rightNeighbor$jscomp$3$$ = $bottomNeighbor$jscomp$3_getNeighbor$jscomp$3$$ ? +$bottomNeighbor$jscomp$3_getNeighbor$jscomp$3$$(1, 0) : 0, $topNeighbor$jscomp$3$$ = $bottomNeighbor$jscomp$3_getNeighbor$jscomp$3$$ ? +$bottomNeighbor$jscomp$3_getNeighbor$jscomp$3$$(0, -1) : 0;
724
- var $neighborsCount$jscomp$3_rotation$jscomp$25$$ = $leftNeighbor$jscomp$3_rotation$jscomp$26$$ + $rightNeighbor$jscomp$3$$ + $topNeighbor$jscomp$3$$ + ($bottomNeighbor$jscomp$3_getNeighbor$jscomp$3$$ = $bottomNeighbor$jscomp$3_getNeighbor$jscomp$3$$ ? +$bottomNeighbor$jscomp$3_getNeighbor$jscomp$3$$(0, 1) : 0);
725
- 0 === $neighborsCount$jscomp$3_rotation$jscomp$25$$ ? this.basicDot({
726
- x: $x$jscomp$130$$,
727
- y: $y$jscomp$115$$,
728
- size: $size$jscomp$63$$,
692
+ drawExtraRounded({x, y, size, getNeighbor: bottomNeighbor}) {
693
+ var leftNeighbor = bottomNeighbor ? +bottomNeighbor(-1, 0) : 0;
694
+ let rightNeighbor = bottomNeighbor ? +bottomNeighbor(1, 0) : 0, topNeighbor = bottomNeighbor ? +bottomNeighbor(0, -1) : 0;
695
+ var neighborsCount = leftNeighbor + rightNeighbor + topNeighbor + (bottomNeighbor = bottomNeighbor ? +bottomNeighbor(0, 1) : 0);
696
+ 0 === neighborsCount ? this.basicDot({
697
+ x,
698
+ y,
699
+ size,
729
700
  rotation: 0
730
- }) : 2 < $neighborsCount$jscomp$3_rotation$jscomp$25$$ || $leftNeighbor$jscomp$3_rotation$jscomp$26$$ && $rightNeighbor$jscomp$3$$ || $topNeighbor$jscomp$3$$ && $bottomNeighbor$jscomp$3_getNeighbor$jscomp$3$$ ? this.basicSquare({
731
- x: $x$jscomp$130$$,
732
- y: $y$jscomp$115$$,
733
- size: $size$jscomp$63$$,
701
+ }) : 2 < neighborsCount || leftNeighbor && rightNeighbor || topNeighbor && bottomNeighbor ? this.basicSquare({
702
+ x,
703
+ y,
704
+ size,
734
705
  rotation: 0
735
- }) : 2 === $neighborsCount$jscomp$3_rotation$jscomp$25$$ ? ($neighborsCount$jscomp$3_rotation$jscomp$25$$ = 0,
736
- $leftNeighbor$jscomp$3_rotation$jscomp$26$$ && $topNeighbor$jscomp$3$$ ? $neighborsCount$jscomp$3_rotation$jscomp$25$$ = Math.PI / 2 : $topNeighbor$jscomp$3$$ && $rightNeighbor$jscomp$3$$ ? $neighborsCount$jscomp$3_rotation$jscomp$25$$ = Math.PI : $rightNeighbor$jscomp$3$$ && $bottomNeighbor$jscomp$3_getNeighbor$jscomp$3$$ && ($neighborsCount$jscomp$3_rotation$jscomp$25$$ = -Math.PI / 2),
706
+ }) : 2 === neighborsCount ? (neighborsCount = 0, leftNeighbor && topNeighbor ? neighborsCount = Math.PI / 2 : topNeighbor && rightNeighbor ? neighborsCount = Math.PI : rightNeighbor && bottomNeighbor && (neighborsCount = -Math.PI / 2),
737
707
  this.basicCornerExtraRounded({
738
- x: $x$jscomp$130$$,
739
- y: $y$jscomp$115$$,
740
- size: $size$jscomp$63$$,
741
- rotation: $neighborsCount$jscomp$3_rotation$jscomp$25$$
742
- })) : 1 === $neighborsCount$jscomp$3_rotation$jscomp$25$$ && ($leftNeighbor$jscomp$3_rotation$jscomp$26$$ = 0,
743
- $topNeighbor$jscomp$3$$ ? $leftNeighbor$jscomp$3_rotation$jscomp$26$$ = Math.PI / 2 : $rightNeighbor$jscomp$3$$ ? $leftNeighbor$jscomp$3_rotation$jscomp$26$$ = Math.PI : $bottomNeighbor$jscomp$3_getNeighbor$jscomp$3$$ && ($leftNeighbor$jscomp$3_rotation$jscomp$26$$ = -Math.PI / 2),
708
+ x,
709
+ y,
710
+ size,
711
+ rotation: neighborsCount
712
+ })) : 1 === neighborsCount && (leftNeighbor = 0, topNeighbor ? leftNeighbor = Math.PI / 2 : rightNeighbor ? leftNeighbor = Math.PI : bottomNeighbor && (leftNeighbor = -Math.PI / 2),
744
713
  this.basicSideRounded({
745
- x: $x$jscomp$130$$,
746
- y: $y$jscomp$115$$,
747
- size: $size$jscomp$63$$,
748
- rotation: $leftNeighbor$jscomp$3_rotation$jscomp$26$$
714
+ x,
715
+ y,
716
+ size,
717
+ rotation: leftNeighbor
749
718
  }));
750
719
  }
751
- drawClassy({x: $x$jscomp$131$$, y: $y$jscomp$116$$, size: $size$jscomp$64$$, getNeighbor: $bottomNeighbor$jscomp$4_getNeighbor$jscomp$4$$}) {
752
- let $leftNeighbor$jscomp$4$$ = $bottomNeighbor$jscomp$4_getNeighbor$jscomp$4$$ ? +$bottomNeighbor$jscomp$4_getNeighbor$jscomp$4$$(-1, 0) : 0, $rightNeighbor$jscomp$4$$ = $bottomNeighbor$jscomp$4_getNeighbor$jscomp$4$$ ? +$bottomNeighbor$jscomp$4_getNeighbor$jscomp$4$$(1, 0) : 0, $topNeighbor$jscomp$4$$ = $bottomNeighbor$jscomp$4_getNeighbor$jscomp$4$$ ? +$bottomNeighbor$jscomp$4_getNeighbor$jscomp$4$$(0, -1) : 0;
753
- 0 === $leftNeighbor$jscomp$4$$ + $rightNeighbor$jscomp$4$$ + $topNeighbor$jscomp$4$$ + ($bottomNeighbor$jscomp$4_getNeighbor$jscomp$4$$ = $bottomNeighbor$jscomp$4_getNeighbor$jscomp$4$$ ? +$bottomNeighbor$jscomp$4_getNeighbor$jscomp$4$$(0, 1) : 0) ? this.basicCornersRounded({
754
- x: $x$jscomp$131$$,
755
- y: $y$jscomp$116$$,
756
- size: $size$jscomp$64$$,
720
+ drawClassy({x, y, size, getNeighbor: bottomNeighbor}) {
721
+ let leftNeighbor = bottomNeighbor ? +bottomNeighbor(-1, 0) : 0, rightNeighbor = bottomNeighbor ? +bottomNeighbor(1, 0) : 0, topNeighbor = bottomNeighbor ? +bottomNeighbor(0, -1) : 0;
722
+ 0 === leftNeighbor + rightNeighbor + topNeighbor + (bottomNeighbor = bottomNeighbor ? +bottomNeighbor(0, 1) : 0) ? this.basicCornersRounded({
723
+ x,
724
+ y,
725
+ size,
757
726
  rotation: Math.PI / 2
758
- }) : $leftNeighbor$jscomp$4$$ || $topNeighbor$jscomp$4$$ ? $rightNeighbor$jscomp$4$$ || $bottomNeighbor$jscomp$4_getNeighbor$jscomp$4$$ ? this.basicSquare({
759
- x: $x$jscomp$131$$,
760
- y: $y$jscomp$116$$,
761
- size: $size$jscomp$64$$,
727
+ }) : leftNeighbor || topNeighbor ? rightNeighbor || bottomNeighbor ? this.basicSquare({
728
+ x,
729
+ y,
730
+ size,
762
731
  rotation: 0
763
732
  }) : this.basicCornerRounded({
764
- x: $x$jscomp$131$$,
765
- y: $y$jscomp$116$$,
766
- size: $size$jscomp$64$$,
733
+ x,
734
+ y,
735
+ size,
767
736
  rotation: Math.PI / 2
768
737
  }) : this.basicCornerRounded({
769
- x: $x$jscomp$131$$,
770
- y: $y$jscomp$116$$,
771
- size: $size$jscomp$64$$,
738
+ x,
739
+ y,
740
+ size,
772
741
  rotation: -Math.PI / 2
773
742
  });
774
743
  }
775
- drawClassyRounded({x: $x$jscomp$132$$, y: $y$jscomp$117$$, size: $size$jscomp$65$$, getNeighbor: $bottomNeighbor$jscomp$5_getNeighbor$jscomp$5$$}) {
776
- let $leftNeighbor$jscomp$5$$ = $bottomNeighbor$jscomp$5_getNeighbor$jscomp$5$$ ? +$bottomNeighbor$jscomp$5_getNeighbor$jscomp$5$$(-1, 0) : 0, $rightNeighbor$jscomp$5$$ = $bottomNeighbor$jscomp$5_getNeighbor$jscomp$5$$ ? +$bottomNeighbor$jscomp$5_getNeighbor$jscomp$5$$(1, 0) : 0, $topNeighbor$jscomp$5$$ = $bottomNeighbor$jscomp$5_getNeighbor$jscomp$5$$ ? +$bottomNeighbor$jscomp$5_getNeighbor$jscomp$5$$(0, -1) : 0;
777
- 0 === $leftNeighbor$jscomp$5$$ + $rightNeighbor$jscomp$5$$ + $topNeighbor$jscomp$5$$ + ($bottomNeighbor$jscomp$5_getNeighbor$jscomp$5$$ = $bottomNeighbor$jscomp$5_getNeighbor$jscomp$5$$ ? +$bottomNeighbor$jscomp$5_getNeighbor$jscomp$5$$(0, 1) : 0) ? this.basicCornersRounded({
778
- x: $x$jscomp$132$$,
779
- y: $y$jscomp$117$$,
780
- size: $size$jscomp$65$$,
744
+ drawClassyRounded({x, y, size, getNeighbor: bottomNeighbor}) {
745
+ let leftNeighbor = bottomNeighbor ? +bottomNeighbor(-1, 0) : 0, rightNeighbor = bottomNeighbor ? +bottomNeighbor(1, 0) : 0, topNeighbor = bottomNeighbor ? +bottomNeighbor(0, -1) : 0;
746
+ 0 === leftNeighbor + rightNeighbor + topNeighbor + (bottomNeighbor = bottomNeighbor ? +bottomNeighbor(0, 1) : 0) ? this.basicCornersRounded({
747
+ x,
748
+ y,
749
+ size,
781
750
  rotation: Math.PI / 2
782
- }) : $leftNeighbor$jscomp$5$$ || $topNeighbor$jscomp$5$$ ? $rightNeighbor$jscomp$5$$ || $bottomNeighbor$jscomp$5_getNeighbor$jscomp$5$$ ? this.basicSquare({
783
- x: $x$jscomp$132$$,
784
- y: $y$jscomp$117$$,
785
- size: $size$jscomp$65$$,
751
+ }) : leftNeighbor || topNeighbor ? rightNeighbor || bottomNeighbor ? this.basicSquare({
752
+ x,
753
+ y,
754
+ size,
786
755
  rotation: 0
787
756
  }) : this.basicCornerExtraRounded({
788
- x: $x$jscomp$132$$,
789
- y: $y$jscomp$117$$,
790
- size: $size$jscomp$65$$,
757
+ x,
758
+ y,
759
+ size,
791
760
  rotation: Math.PI / 2
792
761
  }) : this.basicCornerExtraRounded({
793
- x: $x$jscomp$132$$,
794
- y: $y$jscomp$117$$,
795
- size: $size$jscomp$65$$,
762
+ x,
763
+ y,
764
+ size,
796
765
  rotation: -Math.PI / 2
797
766
  });
798
767
  }
799
768
  }
800
769
 
801
- let $browserImageTools$$ = {
802
- toDataURL: $url$jscomp$22$$ => "string" == typeof $url$jscomp$22$$ && $url$jscomp$22$$.startsWith("data:") ? Promise.resolve($url$jscomp$22$$) : new Promise((($resolve$$, $reject$$) => {
803
- if ("string" == typeof $url$jscomp$22$$) {
804
- const $xhr$$ = new XMLHttpRequest;
805
- $xhr$$.onload = function() {
806
- const $reader$$ = new FileReader;
807
- $reader$$.onloadend = function() {
808
- $resolve$$($reader$$.result);
809
- }, $reader$$.readAsDataURL($xhr$$.response);
810
- }, $xhr$$.onerror = $xhr$$.onabort = $xhr$$.ontimeout = $reject$$, $xhr$$.open("GET", $url$jscomp$22$$, !0),
811
- $xhr$$.responseType = "blob", $xhr$$.send();
770
+ let browserImageTools = {
771
+ toDataURL: url => "string" == typeof url && url.startsWith("data:") ? Promise.resolve(url) : new Promise(((resolve, reject) => {
772
+ if ("string" == typeof url) {
773
+ const xhr = new XMLHttpRequest;
774
+ xhr.onload = function() {
775
+ const reader = new FileReader;
776
+ reader.onloadend = function() {
777
+ resolve(reader.result);
778
+ }, reader.readAsDataURL(xhr.response);
779
+ }, xhr.onerror = xhr.onabort = xhr.ontimeout = reject, xhr.open("GET", url, !0),
780
+ xhr.responseType = "blob", xhr.send();
812
781
  } else {
813
- const $reader$jscomp$1$$ = new FileReader;
814
- $reader$jscomp$1$$.onloadend = function() {
815
- $resolve$$($reader$jscomp$1$$.result);
816
- }, $reader$jscomp$1$$.readAsDataURL($url$jscomp$22$$);
782
+ const reader = new FileReader;
783
+ reader.onloadend = function() {
784
+ resolve(reader.result);
785
+ }, reader.readAsDataURL(url);
817
786
  }
818
787
  })),
819
- getSize: ($src$jscomp$4$$, $crossOrigin$$) => new Promise((($resolve$jscomp$1$$, $reject$jscomp$1$$) => {
820
- const $image$jscomp$3$$ = new Image;
821
- "string" === $crossOrigin$$ && ($image$jscomp$3$$.crossOrigin = $crossOrigin$$),
822
- $image$jscomp$3$$.onload = () => {
823
- $resolve$jscomp$1$$({
824
- width: $image$jscomp$3$$.width,
825
- height: $image$jscomp$3$$.height
788
+ getSize: (src, crossOrigin) => new Promise(((resolve, reject) => {
789
+ const image = new Image;
790
+ "string" === crossOrigin && (image.crossOrigin = crossOrigin), image.onload = () => {
791
+ resolve({
792
+ width: image.width,
793
+ height: image.height
826
794
  });
827
- }, $image$jscomp$3$$.onerror = $image$jscomp$3$$.onabort = $reject$jscomp$1$$, "string" == typeof $src$jscomp$4$$ ? $image$jscomp$3$$.src = $src$jscomp$4$$ : $browserImageTools$$.toDataURL($src$jscomp$4$$).then(($url$jscomp$23$$ => $image$jscomp$3$$.src = $url$jscomp$23$$)).catch($reject$jscomp$1$$);
795
+ }, image.onerror = image.onabort = reject, "string" == typeof src ? image.src = src : browserImageTools.toDataURL(src).then((url => image.src = url)).catch(reject);
828
796
  }))
829
797
  };
830
798
 
831
- function $parseColor$$($base$jscomp$3_cstr$$) {
832
- var $m_parts$$ = [];
833
- let $alpha$jscomp$3$$ = 1;
834
- if ("#" === ($base$jscomp$3_cstr$$ = $base$jscomp$3_cstr$$.toLowerCase())[0]) {
835
- let $size$jscomp$66$$ = ($base$jscomp$3_cstr$$ = $base$jscomp$3_cstr$$.slice(1)).length;
836
- 4 >= $size$jscomp$66$$ ? ($m_parts$$ = [ parseInt($base$jscomp$3_cstr$$[0] + $base$jscomp$3_cstr$$[0], 16), parseInt($base$jscomp$3_cstr$$[1] + $base$jscomp$3_cstr$$[1], 16), parseInt($base$jscomp$3_cstr$$[2] + $base$jscomp$3_cstr$$[2], 16) ],
837
- 4 === $size$jscomp$66$$ && ($alpha$jscomp$3$$ = parseInt($base$jscomp$3_cstr$$[3] + $base$jscomp$3_cstr$$[3], 16) / 255)) : ($m_parts$$ = [ parseInt($base$jscomp$3_cstr$$[0] + $base$jscomp$3_cstr$$[1], 16), parseInt($base$jscomp$3_cstr$$[2] + $base$jscomp$3_cstr$$[3], 16), parseInt($base$jscomp$3_cstr$$[4] + $base$jscomp$3_cstr$$[5], 16) ],
838
- 8 === $size$jscomp$66$$ && ($alpha$jscomp$3$$ = parseInt($base$jscomp$3_cstr$$[6] + $base$jscomp$3_cstr$$[7], 16) / 255)),
839
- $m_parts$$[0] || ($m_parts$$[0] = 0), $m_parts$$[1] || ($m_parts$$[1] = 0), $m_parts$$[2] || ($m_parts$$[2] = 0);
799
+ function parseColor(base) {
800
+ var m_parts = [];
801
+ let alpha = 1;
802
+ if ("#" === (base = base.toLowerCase())[0]) {
803
+ let size = (base = base.slice(1)).length;
804
+ 4 >= size ? (m_parts = [ parseInt(base[0] + base[0], 16), parseInt(base[1] + base[1], 16), parseInt(base[2] + base[2], 16) ],
805
+ 4 === size && (alpha = parseInt(base[3] + base[3], 16) / 255)) : (m_parts = [ parseInt(base[0] + base[1], 16), parseInt(base[2] + base[3], 16), parseInt(base[4] + base[5], 16) ],
806
+ 8 === size && (alpha = parseInt(base[6] + base[7], 16) / 255)), m_parts[0] || (m_parts[0] = 0),
807
+ m_parts[1] || (m_parts[1] = 0), m_parts[2] || (m_parts[2] = 0);
840
808
  } else {
841
- if (!($m_parts$$ = /^((?:rgba?))\s*\(([^)]*)\)/.exec($base$jscomp$3_cstr$$))) return {
842
- value: $base$jscomp$3_cstr$$,
843
- alpha: $alpha$jscomp$3$$
809
+ if (!(m_parts = /^((?:rgba?))\s*\(([^)]*)\)/.exec(base))) return {
810
+ value: base,
811
+ alpha
844
812
  };
845
- $alpha$jscomp$3$$ = 3 < ($m_parts$$ = ($m_parts$$ = $m_parts$$[2].trim().split(/\s*[,/]\s*|\s+/)).map((($v$jscomp$2_x$jscomp$133$$, $i$jscomp$5$$) => "%" === $v$jscomp$2_x$jscomp$133$$[$v$jscomp$2_x$jscomp$133$$.length - 1] ? ($v$jscomp$2_x$jscomp$133$$ = parseFloat($v$jscomp$2_x$jscomp$133$$) / 100,
846
- 3 === $i$jscomp$5$$ ? $v$jscomp$2_x$jscomp$133$$ : 255 * $v$jscomp$2_x$jscomp$133$$) : "none" === $v$jscomp$2_x$jscomp$133$$ ? 0 : parseFloat($v$jscomp$2_x$jscomp$133$$)))).length ? $m_parts$$.pop() : 1;
813
+ alpha = 3 < (m_parts = (m_parts = m_parts[2].trim().split(/\s*[,/]\s*|\s+/)).map(((v, i) => "%" === v[v.length - 1] ? (v = parseFloat(v) / 100,
814
+ 3 === i ? v : 255 * v) : "none" === v ? 0 : parseFloat(v)))).length ? m_parts.pop() : 1;
847
815
  }
848
816
  return {
849
- value: "#" + $m_parts$$.map(($v$jscomp$3$$ => Math.max(0, Math.min(255, $v$jscomp$3$$)).toString(16).padStart(2, "0"))).join(""),
850
- alpha: Math.max(0, Math.min(1, $alpha$jscomp$3$$))
817
+ value: "#" + m_parts.map((v => Math.max(0, Math.min(255, v)).toString(16).padStart(2, "0"))).join(""),
818
+ alpha: Math.max(0, Math.min(1, alpha))
851
819
  };
852
820
  }
853
821
 
854
- let $squareMask$$ = [ [ 1, 1, 1, 1, 1, 1, 1 ], [ 1, 0, 0, 0, 0, 0, 1 ], [ 1, 0, 0, 0, 0, 0, 1 ], [ 1, 0, 0, 0, 0, 0, 1 ], [ 1, 0, 0, 0, 0, 0, 1 ], [ 1, 0, 0, 0, 0, 0, 1 ], [ 1, 1, 1, 1, 1, 1, 1 ] ], $dotMask$$ = [ [ 0, 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 0, 0 ], [ 0, 0, 1, 1, 1, 0, 0 ], [ 0, 0, 1, 1, 1, 0, 0 ], [ 0, 0, 1, 1, 1, 0, 0 ], [ 0, 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 0, 0 ] ];
822
+ let squareMask = [ [ 1, 1, 1, 1, 1, 1, 1 ], [ 1, 0, 0, 0, 0, 0, 1 ], [ 1, 0, 0, 0, 0, 0, 1 ], [ 1, 0, 0, 0, 0, 0, 1 ], [ 1, 0, 0, 0, 0, 0, 1 ], [ 1, 0, 0, 0, 0, 0, 1 ], [ 1, 1, 1, 1, 1, 1, 1 ] ], dotMask = [ [ 0, 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 0, 0 ], [ 0, 0, 1, 1, 1, 0, 0 ], [ 0, 0, 1, 1, 1, 0, 0 ], [ 0, 0, 1, 1, 1, 0, 0 ], [ 0, 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 0, 0 ] ];
855
823
 
856
- class $QRSVG$$ {
824
+ class QRSVG {
857
825
  get element() {
858
826
  return this._element;
859
827
  }
860
- constructor($options$jscomp$35$$) {
861
- this.options = $options$jscomp$35$$, this.document = $options$jscomp$35$$.document,
862
- this._element = this.document.createElementNS("http://www.w3.org/2000/svg", "svg");
863
- let $width$jscomp$28$$ = $numToAttr$$($options$jscomp$35$$.width), $height$jscomp$25$$ = $numToAttr$$($options$jscomp$35$$.height);
864
- this._element.setAttribute("width", $width$jscomp$28$$), this._element.setAttribute("height", $height$jscomp$25$$),
865
- this._element.setAttribute("viewBox", `0 0 ${$width$jscomp$28$$} ${$height$jscomp$25$$}`),
866
- this.defs = this.document.createElementNS("http://www.w3.org/2000/svg", "defs"),
867
- this._element.appendChild(this.defs), this.imageTools = $options$jscomp$35$$.imageTools || $browserImageTools$$;
828
+ constructor(options) {
829
+ this.options = options, this.document = options.document, this._element = this.document.createElementNS("http://www.w3.org/2000/svg", "svg");
830
+ let width = numToAttr(options.width), height = numToAttr(options.height);
831
+ this._element.setAttribute("width", width), this._element.setAttribute("height", height),
832
+ this._element.setAttribute("viewBox", `0 0 ${width} ${height}`), this.defs = this.document.createElementNS("http://www.w3.org/2000/svg", "defs"),
833
+ this._element.appendChild(this.defs), this.imageTools = options.imageTools || browserImageTools;
868
834
  }
869
835
  get width() {
870
836
  return this.options.width;
@@ -872,365 +838,343 @@ class $QRSVG$$ {
872
838
  get height() {
873
839
  return this.options.height;
874
840
  }
875
- async drawQR($qr_size$jscomp$69$$) {
876
- let $count$jscomp$39$$ = $qr_size$jscomp$69$$.getModuleCount();
877
- var $alignment_maxWidth_typeNumber$$ = parseInt((($count$jscomp$39$$ - 17) / 4).toFixed(0), 10);
878
- let $dotSize$jscomp$8$$ = this.options.dotsOptions.size, $drawImageSize$$ = {
841
+ async drawQR(qr_size) {
842
+ let count = qr_size.getModuleCount();
843
+ var alignment_maxWidth_typeNumber = parseInt(((count - 17) / 4).toFixed(0), 10);
844
+ let dotSize = this.options.dotsOptions.size, drawImageSize = {
879
845
  hideXDots: 0,
880
846
  hideYDots: 0,
881
847
  width: 0,
882
848
  height: 0
883
849
  };
884
- if (this.qr = $qr_size$jscomp$69$$, this.options.image) {
885
- $qr_size$jscomp$69$$ = await this.imageTools.getSize(this.options.image, this.options.imageOptions.crossOrigin);
886
- let {imageOptions: $imageOptions$$, errorCorrectionPercent: $errorCorrectionPercent$$} = this.options;
887
- if ($imageOptions$$.mode == $ImageMode$$.background) {
888
- var $coverLevel_margin$jscomp$1_maxHeight$$ = this.options.backgroundOptions && this.options.backgroundOptions.margin || 0;
889
- $alignment_maxWidth_typeNumber$$ = (this.options.width - 2 * $coverLevel_margin$jscomp$1_maxHeight$$ * $dotSize$jscomp$8$$) * $imageOptions$$.imageSize,
890
- $coverLevel_margin$jscomp$1_maxHeight$$ = (this.options.height - 2 * $coverLevel_margin$jscomp$1_maxHeight$$ * $dotSize$jscomp$8$$) * $imageOptions$$.imageSize;
891
- let {width: $width$jscomp$29$$, height: $height$jscomp$26$$} = $qr_size$jscomp$69$$;
892
- $height$jscomp$26$$ = $height$jscomp$26$$ / $width$jscomp$29$$ * $alignment_maxWidth_typeNumber$$,
893
- $width$jscomp$29$$ = $alignment_maxWidth_typeNumber$$, $height$jscomp$26$$ > $coverLevel_margin$jscomp$1_maxHeight$$ && ($width$jscomp$29$$ = $width$jscomp$29$$ / $height$jscomp$26$$ * $coverLevel_margin$jscomp$1_maxHeight$$,
894
- $height$jscomp$26$$ = $coverLevel_margin$jscomp$1_maxHeight$$), $drawImageSize$$ = {
850
+ if (this.qr = qr_size, this.options.image) {
851
+ qr_size = await this.imageTools.getSize(this.options.image, this.options.imageOptions.crossOrigin);
852
+ let {imageOptions, errorCorrectionPercent} = this.options;
853
+ if (imageOptions.mode == ImageMode.background) {
854
+ var coverLevel_margin = this.options.backgroundOptions && this.options.backgroundOptions.margin || 0;
855
+ alignment_maxWidth_typeNumber = (this.options.width - 2 * coverLevel_margin * dotSize) * imageOptions.imageSize,
856
+ coverLevel_margin = (this.options.height - 2 * coverLevel_margin * dotSize) * imageOptions.imageSize;
857
+ let {width, height} = qr_size;
858
+ height = height / width * alignment_maxWidth_typeNumber, width = alignment_maxWidth_typeNumber,
859
+ height > coverLevel_margin && (width = width / height * coverLevel_margin, height = coverLevel_margin),
860
+ drawImageSize = {
895
861
  hideXDots: 0,
896
862
  hideYDots: 0,
897
- width: $width$jscomp$29$$,
898
- height: $height$jscomp$26$$
863
+ width,
864
+ height
899
865
  };
900
- } else $coverLevel_margin$jscomp$1_maxHeight$$ = $imageOptions$$.imageSize * $errorCorrectionPercent$$,
901
- $alignment_maxWidth_typeNumber$$ = QRUtil.getPatternPosition($alignment_maxWidth_typeNumber$$),
902
- $drawImageSize$$ = function({originalHeight: $originalHeight$$, originalWidth: $originalWidth$$, maxHiddenDots: $JSCompiler_object_inline_x_16_hideMax_maxHiddenDots$$, maxHiddenAxisDots: $JSCompiler_object_inline_y_17_maxHiddenAxisDots_maxW_upper$$, dotSize: $dotSize$jscomp$7$$, margin: $margin$$}) {
903
- if (0 >= $originalHeight$$ || 0 >= $originalWidth$$ || 0 >= $JSCompiler_object_inline_x_16_hideMax_maxHiddenDots$$ || 0 >= $dotSize$jscomp$7$$ || 4 * $margin$$ ** 2 > $JSCompiler_object_inline_x_16_hideMax_maxHiddenDots$$) return {
866
+ } else coverLevel_margin = imageOptions.imageSize * errorCorrectionPercent, alignment_maxWidth_typeNumber = QRUtil.getPatternPosition(alignment_maxWidth_typeNumber),
867
+ drawImageSize = function({originalHeight, originalWidth, maxHiddenDots: JSCompiler_object_inline_x_16_hideMax_maxHiddenDots, maxHiddenAxisDots: JSCompiler_object_inline_y_17_maxHiddenAxisDots_maxW_upper, dotSize, margin}) {
868
+ if (0 >= originalHeight || 0 >= originalWidth || 0 >= JSCompiler_object_inline_x_16_hideMax_maxHiddenDots || 0 >= dotSize || 4 * margin ** 2 > JSCompiler_object_inline_x_16_hideMax_maxHiddenDots) return {
904
869
  height: 0,
905
870
  width: 0,
906
871
  hideYDots: 0,
907
872
  hideXDots: 0
908
873
  };
909
- $JSCompiler_object_inline_y_17_maxHiddenAxisDots_maxW_upper$$ && 0 == $JSCompiler_object_inline_y_17_maxHiddenAxisDots_maxW_upper$$ % 2 && ($JSCompiler_object_inline_y_17_maxHiddenAxisDots_maxW_upper$$ = Math.max(1, $JSCompiler_object_inline_y_17_maxHiddenAxisDots_maxW_upper$$ - 1));
910
- var $JSCompiler_object_inline_x_14_dimMax$$ = Math.max($originalWidth$$, $originalHeight$$), $JSCompiler_object_inline_y_15_dimMin_hideMin$$ = Math.min($originalWidth$$, $originalHeight$$), $lower_maxH_size$jscomp$67$$ = 0;
911
- $JSCompiler_object_inline_y_17_maxHiddenAxisDots_maxW_upper$$ = ($JSCompiler_object_inline_y_17_maxHiddenAxisDots_maxW_upper$$ || $JSCompiler_object_inline_x_16_hideMax_maxHiddenDots$$) - 2 * $margin$$;
874
+ JSCompiler_object_inline_y_17_maxHiddenAxisDots_maxW_upper && 0 == JSCompiler_object_inline_y_17_maxHiddenAxisDots_maxW_upper % 2 && (JSCompiler_object_inline_y_17_maxHiddenAxisDots_maxW_upper = Math.max(1, JSCompiler_object_inline_y_17_maxHiddenAxisDots_maxW_upper - 1));
875
+ var JSCompiler_object_inline_x_14_dimMax = Math.max(originalWidth, originalHeight), JSCompiler_object_inline_y_15_dimMin_hideMin = Math.min(originalWidth, originalHeight), lower_maxH_size = 0;
876
+ JSCompiler_object_inline_y_17_maxHiddenAxisDots_maxW_upper = (JSCompiler_object_inline_y_17_maxHiddenAxisDots_maxW_upper || JSCompiler_object_inline_x_16_hideMax_maxHiddenDots) - 2 * margin;
912
877
  do {
913
- let $size$jscomp$68$$ = $lower_maxH_size$jscomp$67$$ + ($JSCompiler_object_inline_y_17_maxHiddenAxisDots_maxW_upper$$ - $lower_maxH_size$jscomp$67$$) / 2, $dotsMax$$ = Math.max(1, Math.ceil($size$jscomp$68$$ + 2 * $margin$$));
914
- 0 == $dotsMax$$ % 2 && $dotsMax$$++;
915
- let $dotsMin$$ = Math.max(1, Math.ceil($size$jscomp$68$$ * $JSCompiler_object_inline_y_15_dimMin_hideMin$$ / $JSCompiler_object_inline_x_14_dimMax$$ + 2 * $margin$$));
916
- 0 == $dotsMin$$ % 2 && $dotsMin$$++, $dotsMax$$ * $dotsMin$$ > $JSCompiler_object_inline_x_16_hideMax_maxHiddenDots$$ ? $JSCompiler_object_inline_y_17_maxHiddenAxisDots_maxW_upper$$ = $size$jscomp$68$$ : $lower_maxH_size$jscomp$67$$ = $size$jscomp$68$$;
917
- } while (.001 < Math.abs($lower_maxH_size$jscomp$67$$ - $JSCompiler_object_inline_y_17_maxHiddenAxisDots_maxW_upper$$));
918
- return 0 == ($JSCompiler_object_inline_x_16_hideMax_maxHiddenDots$$ = Math.max(1, Math.ceil($lower_maxH_size$jscomp$67$$ + 2 * $margin$$))) % 2 && $JSCompiler_object_inline_x_16_hideMax_maxHiddenDots$$++,
919
- 0 == ($JSCompiler_object_inline_y_15_dimMin_hideMin$$ = Math.max(1, Math.ceil($lower_maxH_size$jscomp$67$$ * $JSCompiler_object_inline_y_15_dimMin_hideMin$$ / $JSCompiler_object_inline_x_14_dimMax$$ + 2 * $margin$$))) % 2 && $JSCompiler_object_inline_y_15_dimMin_hideMin$$++,
920
- $originalWidth$$ > $originalHeight$$ ? $JSCompiler_object_inline_x_14_dimMax$$ = $JSCompiler_object_inline_x_16_hideMax_maxHiddenDots$$ : ($JSCompiler_object_inline_x_14_dimMax$$ = $JSCompiler_object_inline_y_15_dimMin_hideMin$$,
921
- $JSCompiler_object_inline_y_15_dimMin_hideMin$$ = $JSCompiler_object_inline_x_16_hideMax_maxHiddenDots$$),
922
- $JSCompiler_object_inline_x_16_hideMax_maxHiddenDots$$ = $JSCompiler_object_inline_y_17_maxHiddenAxisDots_maxW_upper$$ = ($JSCompiler_object_inline_x_14_dimMax$$ - 2 * $margin$$) * $dotSize$jscomp$7$$,
923
- ($JSCompiler_object_inline_y_17_maxHiddenAxisDots_maxW_upper$$ = $JSCompiler_object_inline_y_17_maxHiddenAxisDots_maxW_upper$$ * $originalHeight$$ / $originalWidth$$) > ($lower_maxH_size$jscomp$67$$ = ($JSCompiler_object_inline_y_15_dimMin_hideMin$$ - 2 * $margin$$) * $dotSize$jscomp$7$$) && ($JSCompiler_object_inline_y_17_maxHiddenAxisDots_maxW_upper$$ = $lower_maxH_size$jscomp$67$$,
924
- $JSCompiler_object_inline_x_16_hideMax_maxHiddenDots$$ = $lower_maxH_size$jscomp$67$$ * $originalWidth$$ / $originalHeight$$),
878
+ let size = lower_maxH_size + (JSCompiler_object_inline_y_17_maxHiddenAxisDots_maxW_upper - lower_maxH_size) / 2, dotsMax = Math.max(1, Math.ceil(size + 2 * margin));
879
+ 0 == dotsMax % 2 && dotsMax++;
880
+ let dotsMin = Math.max(1, Math.ceil(size * JSCompiler_object_inline_y_15_dimMin_hideMin / JSCompiler_object_inline_x_14_dimMax + 2 * margin));
881
+ 0 == dotsMin % 2 && dotsMin++, dotsMax * dotsMin > JSCompiler_object_inline_x_16_hideMax_maxHiddenDots ? JSCompiler_object_inline_y_17_maxHiddenAxisDots_maxW_upper = size : lower_maxH_size = size;
882
+ } while (.001 < Math.abs(lower_maxH_size - JSCompiler_object_inline_y_17_maxHiddenAxisDots_maxW_upper));
883
+ return 0 == (JSCompiler_object_inline_x_16_hideMax_maxHiddenDots = Math.max(1, Math.ceil(lower_maxH_size + 2 * margin))) % 2 && JSCompiler_object_inline_x_16_hideMax_maxHiddenDots++,
884
+ 0 == (JSCompiler_object_inline_y_15_dimMin_hideMin = Math.max(1, Math.ceil(lower_maxH_size * JSCompiler_object_inline_y_15_dimMin_hideMin / JSCompiler_object_inline_x_14_dimMax + 2 * margin))) % 2 && JSCompiler_object_inline_y_15_dimMin_hideMin++,
885
+ originalWidth > originalHeight ? JSCompiler_object_inline_x_14_dimMax = JSCompiler_object_inline_x_16_hideMax_maxHiddenDots : (JSCompiler_object_inline_x_14_dimMax = JSCompiler_object_inline_y_15_dimMin_hideMin,
886
+ JSCompiler_object_inline_y_15_dimMin_hideMin = JSCompiler_object_inline_x_16_hideMax_maxHiddenDots),
887
+ JSCompiler_object_inline_x_16_hideMax_maxHiddenDots = JSCompiler_object_inline_y_17_maxHiddenAxisDots_maxW_upper = (JSCompiler_object_inline_x_14_dimMax - 2 * margin) * dotSize,
888
+ (JSCompiler_object_inline_y_17_maxHiddenAxisDots_maxW_upper = JSCompiler_object_inline_y_17_maxHiddenAxisDots_maxW_upper * originalHeight / originalWidth) > (lower_maxH_size = (JSCompiler_object_inline_y_15_dimMin_hideMin - 2 * margin) * dotSize) && (JSCompiler_object_inline_y_17_maxHiddenAxisDots_maxW_upper = lower_maxH_size,
889
+ JSCompiler_object_inline_x_16_hideMax_maxHiddenDots = lower_maxH_size * originalWidth / originalHeight),
925
890
  {
926
- height: Math.round($JSCompiler_object_inline_y_17_maxHiddenAxisDots_maxW_upper$$ + 2 * $margin$$ * $dotSize$jscomp$7$$),
927
- width: Math.round($JSCompiler_object_inline_x_16_hideMax_maxHiddenDots$$ + 2 * $margin$$ * $dotSize$jscomp$7$$),
928
- hideYDots: $JSCompiler_object_inline_y_15_dimMin_hideMin$$,
929
- hideXDots: $JSCompiler_object_inline_x_14_dimMax$$
891
+ height: Math.round(JSCompiler_object_inline_y_17_maxHiddenAxisDots_maxW_upper + 2 * margin * dotSize),
892
+ width: Math.round(JSCompiler_object_inline_x_16_hideMax_maxHiddenDots + 2 * margin * dotSize),
893
+ hideYDots: JSCompiler_object_inline_y_15_dimMin_hideMin,
894
+ hideXDots: JSCompiler_object_inline_x_14_dimMax
930
895
  };
931
896
  }({
932
- originalWidth: $qr_size$jscomp$69$$.width,
933
- originalHeight: $qr_size$jscomp$69$$.height,
934
- maxHiddenDots: Math.floor($coverLevel_margin$jscomp$1_maxHeight$$ * ($count$jscomp$39$$ * $count$jscomp$39$$ - 192 - 2 * ($count$jscomp$39$$ - 16) - 25 * $alignment_maxWidth_typeNumber$$.length ** 2)),
935
- maxHiddenAxisDots: $count$jscomp$39$$ - 14,
936
- dotSize: $dotSize$jscomp$8$$,
937
- margin: $imageOptions$$.margin
897
+ originalWidth: qr_size.width,
898
+ originalHeight: qr_size.height,
899
+ maxHiddenDots: Math.floor(coverLevel_margin * (count * count - 192 - 2 * (count - 16) - 25 * alignment_maxWidth_typeNumber.length ** 2)),
900
+ maxHiddenAxisDots: count - 14,
901
+ dotSize,
902
+ margin: imageOptions.margin
938
903
  });
939
904
  }
940
- this.drawBackground(), this.options.imageOptions.mode != $ImageMode$$.overlay && this.options.image && 0 < $drawImageSize$$.width && 0 < $drawImageSize$$.height && await this.drawImage({
941
- width: $drawImageSize$$.width,
942
- height: $drawImageSize$$.height,
943
- count: $count$jscomp$39$$,
944
- dotSize: $dotSize$jscomp$8$$
945
- }), this.drawDots((($i$jscomp$6$$, $j$$) => !(this.options.imageOptions.mode == $ImageMode$$.center && $i$jscomp$6$$ >= ($count$jscomp$39$$ - $drawImageSize$$.hideXDots) / 2 && $i$jscomp$6$$ < ($count$jscomp$39$$ + $drawImageSize$$.hideXDots) / 2 && $j$$ >= ($count$jscomp$39$$ - $drawImageSize$$.hideYDots) / 2 && $j$$ < ($count$jscomp$39$$ + $drawImageSize$$.hideYDots) / 2 || 8 > $i$jscomp$6$$ && 8 > $j$$ || $i$jscomp$6$$ >= $count$jscomp$39$$ - 8 && 8 > $j$$ || $j$$ >= $count$jscomp$39$$ - 8 && 8 > $i$jscomp$6$$))),
946
- this.options.imageOptions.mode == $ImageMode$$.overlay && this.options.image && 0 < $drawImageSize$$.width && 0 < $drawImageSize$$.height && await this.drawImage({
947
- width: $drawImageSize$$.width,
948
- height: $drawImageSize$$.height,
949
- count: $count$jscomp$39$$,
950
- dotSize: $dotSize$jscomp$8$$
905
+ this.drawBackground(), this.options.imageOptions.mode != ImageMode.overlay && this.options.image && 0 < drawImageSize.width && 0 < drawImageSize.height && await this.drawImage({
906
+ width: drawImageSize.width,
907
+ height: drawImageSize.height,
908
+ count,
909
+ dotSize
910
+ }), this.drawDots(((i, j) => !(this.options.imageOptions.mode == ImageMode.center && i >= (count - drawImageSize.hideXDots) / 2 && i < (count + drawImageSize.hideXDots) / 2 && j >= (count - drawImageSize.hideYDots) / 2 && j < (count + drawImageSize.hideYDots) / 2 || 8 > i && 8 > j || i >= count - 8 && 8 > j || j >= count - 8 && 8 > i))),
911
+ this.options.imageOptions.mode == ImageMode.overlay && this.options.image && 0 < drawImageSize.width && 0 < drawImageSize.height && await this.drawImage({
912
+ width: drawImageSize.width,
913
+ height: drawImageSize.height,
914
+ count,
915
+ dotSize
951
916
  }), this.drawCorners();
952
917
  }
953
918
  drawBackground() {
954
- let $options$jscomp$36$$ = this.options;
955
- if (this._element && $options$jscomp$36$$.backgroundOptions) {
919
+ let options = this.options;
920
+ if (this._element && options.backgroundOptions) {
956
921
  this.createColor({
957
- options: $options$jscomp$36$$.backgroundOptions.gradient,
958
- color: $options$jscomp$36$$.backgroundOptions.color,
922
+ options: options.backgroundOptions.gradient,
923
+ color: options.backgroundOptions.color,
959
924
  additionalRotation: 0,
960
925
  x: 0,
961
926
  y: 0,
962
- height: $options$jscomp$36$$.height,
963
- width: $options$jscomp$36$$.width,
927
+ height: options.height,
928
+ width: options.width,
964
929
  name: "background-color"
965
930
  });
966
- let $size$jscomp$70$$ = Math.min($options$jscomp$36$$.width, $options$jscomp$36$$.height), $element$jscomp$9$$ = this.document.createElementNS("http://www.w3.org/2000/svg", "rect");
931
+ let size = Math.min(options.width, options.height), element = this.document.createElementNS("http://www.w3.org/2000/svg", "rect");
967
932
  [this.backgroundMask, this.backgroundMaskGroup] = this.createMask("mask-background-color"),
968
- this.defs.appendChild(this.backgroundMask), $element$jscomp$9$$.setAttribute("x", $numToAttr$$(($options$jscomp$36$$.width - $size$jscomp$70$$) / 2)),
969
- $element$jscomp$9$$.setAttribute("y", $numToAttr$$(($options$jscomp$36$$.height - $size$jscomp$70$$) / 2)),
970
- $element$jscomp$9$$.setAttribute("width", $numToAttr$$($size$jscomp$70$$)), $element$jscomp$9$$.setAttribute("height", $numToAttr$$($size$jscomp$70$$)),
971
- $element$jscomp$9$$.setAttribute("rx", $numToAttr$$($size$jscomp$70$$ / 2 * ($options$jscomp$36$$.backgroundOptions.round || 0))),
972
- this.backgroundMaskGroup.appendChild($element$jscomp$9$$);
933
+ this.defs.appendChild(this.backgroundMask), element.setAttribute("x", numToAttr((options.width - size) / 2)),
934
+ element.setAttribute("y", numToAttr((options.height - size) / 2)), element.setAttribute("width", numToAttr(size)),
935
+ element.setAttribute("height", numToAttr(size)), element.setAttribute("rx", numToAttr(size / 2 * (options.backgroundOptions.round || 0))),
936
+ this.backgroundMaskGroup.appendChild(element);
973
937
  }
974
938
  }
975
- drawDots($alignment$jscomp$1_filter$jscomp$3$$) {
939
+ drawDots(alignment) {
976
940
  if (!this.qr) throw "QR code is not defined";
977
- let $options$jscomp$37$$ = this.options;
978
- var $count$jscomp$40_iAlign$$ = this.qr.getModuleCount();
979
- if ($count$jscomp$40_iAlign$$ > $options$jscomp$37$$.width || $count$jscomp$40_iAlign$$ > $options$jscomp$37$$.height) throw "The canvas is too small.";
980
- let $dotSize$jscomp$9$$ = this.options.dotsOptions.size;
981
- var $minSize_xFakeBeginning$$ = Math.min($options$jscomp$37$$.width, $options$jscomp$37$$.height);
982
- $options$jscomp$37$$.imageOptions.mode == $ImageMode$$.background && ($minSize_xFakeBeginning$$ -= 2 * $dotSize$jscomp$9$$ * ($options$jscomp$37$$.imageOptions.margin || 0));
983
- var $colorCount_xBeginning$$ = Math.floor(($options$jscomp$37$$.width - $count$jscomp$40_iAlign$$ * $dotSize$jscomp$9$$) / 2), $yBeginning_yFakeBeginning$$ = Math.floor(($options$jscomp$37$$.height - $count$jscomp$40_iAlign$$ * $dotSize$jscomp$9$$) / 2);
984
- let $dot$$ = new $QRDot$$($options$jscomp$37$$.dotsOptions.type, this.document), $overlayDot$$ = new $QRDot$$($DotType$$.tinySquare, this.document), $markerDot$$ = new $QRDot$$($DotType$$.square, this.document);
941
+ let options = this.options;
942
+ var count = this.qr.getModuleCount();
943
+ if (count > options.width || count > options.height) throw "The canvas is too small.";
944
+ let dotSize = this.options.dotsOptions.size;
945
+ var minSize_xFakeBeginning = Math.min(options.width, options.height);
946
+ options.imageOptions.mode == ImageMode.background && (minSize_xFakeBeginning -= 2 * dotSize * (options.imageOptions.margin || 0));
947
+ var colorCount_xBeginning = Math.floor((options.width - count * dotSize) / 2), yBeginning_yFakeBeginning = Math.floor((options.height - count * dotSize) / 2);
948
+ let dot = new QRDot(options.dotsOptions.type, this.document), overlayDot = new QRDot(DotType.tinySquare, this.document), markerDot = new QRDot(DotType.square, this.document);
985
949
  [this.dotsMask, this.dotsMaskGroup] = this.createMask("mask-dot-color"), this.defs.appendChild(this.dotsMask),
986
- $options$jscomp$37$$.imageOptions.mode == $ImageMode$$.background && ([this.lightDotsMask, this.lightDotsMaskGroup] = this.createMask("mask-light-dot-color"),
950
+ options.imageOptions.mode == ImageMode.background && ([this.lightDotsMask, this.lightDotsMaskGroup] = this.createMask("mask-light-dot-color"),
987
951
  this.defs.appendChild(this.lightDotsMask));
988
- var $fakeCount_margin$jscomp$2$$ = 0;
989
- let $additionalDots$$ = 0;
990
- $fakeCount_margin$jscomp$2$$ = $count$jscomp$40_iAlign$$, $options$jscomp$37$$.shape === $ShapeType$$.circle ? ($fakeCount_margin$jscomp$2$$ = this.options.backgroundOptions && this.options.backgroundOptions.margin || 0,
991
- $additionalDots$$ = Math.floor(($minSize_xFakeBeginning$$ / $dotSize$jscomp$9$$ - $count$jscomp$40_iAlign$$ - 2 * $fakeCount_margin$jscomp$2$$) / 2),
992
- $fakeCount_margin$jscomp$2$$ = $count$jscomp$40_iAlign$$ + 2 * $additionalDots$$) : $options$jscomp$37$$.imageOptions.mode == $ImageMode$$.background && ($additionalDots$$ = 1,
993
- $fakeCount_margin$jscomp$2$$ = $count$jscomp$40_iAlign$$ + 2 * $additionalDots$$),
994
- $minSize_xFakeBeginning$$ = $colorCount_xBeginning$$ - $additionalDots$$ * $dotSize$jscomp$9$$,
995
- $yBeginning_yFakeBeginning$$ -= $additionalDots$$ * $dotSize$jscomp$9$$, $colorCount_xBeginning$$ = $count$jscomp$40_iAlign$$ + 2 * $additionalDots$$;
996
- let $fakeMatrix$$ = Array($fakeCount_margin$jscomp$2$$);
997
- var $center_jAlign$$ = Math.floor($fakeCount_margin$jscomp$2$$ / 2);
998
- for (let $i$jscomp$7$$ = 0; $i$jscomp$7$$ < $fakeCount_margin$jscomp$2$$; $i$jscomp$7$$++) {
999
- $fakeMatrix$$[$i$jscomp$7$$] = Array($fakeCount_margin$jscomp$2$$);
1000
- for (let $j$jscomp$1$$ = 0; $j$jscomp$1$$ < $fakeCount_margin$jscomp$2$$; $j$jscomp$1$$++) if ($i$jscomp$7$$ > $additionalDots$$ - 1 && $i$jscomp$7$$ < $fakeCount_margin$jscomp$2$$ - $additionalDots$$ && $j$jscomp$1$$ > $additionalDots$$ - 1 && $j$jscomp$1$$ < $fakeCount_margin$jscomp$2$$ - $additionalDots$$) {
1001
- let $ii$$ = $i$jscomp$7$$ - $additionalDots$$, $jj$$ = $j$jscomp$1$$ - $additionalDots$$;
1002
- $alignment$jscomp$1_filter$jscomp$3$$ && !$alignment$jscomp$1_filter$jscomp$3$$($ii$$, $jj$$) ? $fakeMatrix$$[$i$jscomp$7$$][$j$jscomp$1$$] = void 0 : $fakeMatrix$$[$i$jscomp$7$$][$j$jscomp$1$$] = !!this.qr.isDark($jj$$, $ii$$);
1003
- } else $fakeMatrix$$[$i$jscomp$7$$][$j$jscomp$1$$] = $options$jscomp$37$$.shape === $ShapeType$$.circle && Math.sqrt(($i$jscomp$7$$ - $center_jAlign$$) * ($i$jscomp$7$$ - $center_jAlign$$) + ($j$jscomp$1$$ - $center_jAlign$$) * ($j$jscomp$1$$ - $center_jAlign$$)) > $center_jAlign$$ ? void 0 : $i$jscomp$7$$ == $additionalDots$$ - 1 || $i$jscomp$7$$ == $fakeCount_margin$jscomp$2$$ - $additionalDots$$ || $j$jscomp$1$$ == $additionalDots$$ - 1 || $j$jscomp$1$$ == $fakeCount_margin$jscomp$2$$ - $additionalDots$$ ? ($j$jscomp$1$$ == $additionalDots$$ - 1 && ($i$jscomp$7$$ < $additionalDots$$ + 8 || $i$jscomp$7$$ > $fakeCount_margin$jscomp$2$$ - $additionalDots$$ - 9) || $j$jscomp$1$$ == $fakeCount_margin$jscomp$2$$ - $additionalDots$$ && $i$jscomp$7$$ < $additionalDots$$ + 8 || $i$jscomp$7$$ == $additionalDots$$ - 1 && ($j$jscomp$1$$ < $additionalDots$$ + 8 || $j$jscomp$1$$ > $fakeCount_margin$jscomp$2$$ - $additionalDots$$ - 9) || $i$jscomp$7$$ == $fakeCount_margin$jscomp$2$$ - $additionalDots$$ && $j$jscomp$1$$ < $additionalDots$$ + 8) && void 0 : this.qr.isDark(0 > $j$jscomp$1$$ - 2 * $additionalDots$$ ? $j$jscomp$1$$ : $j$jscomp$1$$ >= $count$jscomp$40_iAlign$$ ? $j$jscomp$1$$ - 2 * $additionalDots$$ : $j$jscomp$1$$ - $additionalDots$$, 0 > $i$jscomp$7$$ - 2 * $additionalDots$$ ? $i$jscomp$7$$ : $i$jscomp$7$$ >= $count$jscomp$40_iAlign$$ ? $i$jscomp$7$$ - 2 * $additionalDots$$ : $i$jscomp$7$$ - $additionalDots$$);
952
+ var fakeCount_margin = 0;
953
+ let additionalDots = 0;
954
+ fakeCount_margin = count, options.shape === ShapeType.circle ? (fakeCount_margin = this.options.backgroundOptions && this.options.backgroundOptions.margin || 0,
955
+ additionalDots = Math.floor((minSize_xFakeBeginning / dotSize - count - 2 * fakeCount_margin) / 2),
956
+ fakeCount_margin = count + 2 * additionalDots) : options.imageOptions.mode == ImageMode.background && (additionalDots = 1,
957
+ fakeCount_margin = count + 2 * additionalDots), minSize_xFakeBeginning = colorCount_xBeginning - additionalDots * dotSize,
958
+ yBeginning_yFakeBeginning -= additionalDots * dotSize, colorCount_xBeginning = count + 2 * additionalDots;
959
+ let fakeMatrix = Array(fakeCount_margin);
960
+ var center_jAlign = Math.floor(fakeCount_margin / 2);
961
+ for (let i = 0; i < fakeCount_margin; i++) {
962
+ fakeMatrix[i] = Array(fakeCount_margin);
963
+ for (let j = 0; j < fakeCount_margin; j++) if (i > additionalDots - 1 && i < fakeCount_margin - additionalDots && j > additionalDots - 1 && j < fakeCount_margin - additionalDots) {
964
+ let ii = i - additionalDots, jj = j - additionalDots;
965
+ alignment && !alignment(ii, jj) ? fakeMatrix[i][j] = void 0 : fakeMatrix[i][j] = !!this.qr.isDark(jj, ii);
966
+ } else fakeMatrix[i][j] = options.shape === ShapeType.circle && Math.sqrt((i - center_jAlign) * (i - center_jAlign) + (j - center_jAlign) * (j - center_jAlign)) > center_jAlign ? void 0 : i == additionalDots - 1 || i == fakeCount_margin - additionalDots || j == additionalDots - 1 || j == fakeCount_margin - additionalDots ? (j == additionalDots - 1 && (i < additionalDots + 8 || i > fakeCount_margin - additionalDots - 9) || j == fakeCount_margin - additionalDots && i < additionalDots + 8 || i == additionalDots - 1 && (j < additionalDots + 8 || j > fakeCount_margin - additionalDots - 9) || i == fakeCount_margin - additionalDots && j < additionalDots + 8) && void 0 : this.qr.isDark(0 > j - 2 * additionalDots ? j : j >= count ? j - 2 * additionalDots : j - additionalDots, 0 > i - 2 * additionalDots ? i : i >= count ? i - 2 * additionalDots : i - additionalDots);
1004
967
  }
1005
- $alignment$jscomp$1_filter$jscomp$3$$ = QRUtil.getPatternPosition(($count$jscomp$40_iAlign$$ - 17) / 4);
1006
- for (let $i$jscomp$8$$ = 0; $i$jscomp$8$$ < $fakeCount_margin$jscomp$2$$; $i$jscomp$8$$++) {
1007
- $count$jscomp$40_iAlign$$ = $alignment$jscomp$1_filter$jscomp$3$$.find(($v$jscomp$4$$ => $i$jscomp$8$$ - $additionalDots$$ > $v$jscomp$4$$ - 3 && $i$jscomp$8$$ - $additionalDots$$ < $v$jscomp$4$$ + 3));
1008
- for (let $j$jscomp$2$$ = 0; $j$jscomp$2$$ < $fakeCount_margin$jscomp$2$$; $j$jscomp$2$$++) $center_jAlign$$ = $alignment$jscomp$1_filter$jscomp$3$$.find(($v$jscomp$5$$ => $j$jscomp$2$$ - $additionalDots$$ > $v$jscomp$5$$ - 3 && $j$jscomp$2$$ - $additionalDots$$ < $v$jscomp$5$$ + 3)),
1009
- null != $fakeMatrix$$[$i$jscomp$8$$][$j$jscomp$2$$] && (this.lightDotsMask && ($dot$$ = $count$jscomp$40_iAlign$$ && $center_jAlign$$ && ($count$jscomp$40_iAlign$$ != $alignment$jscomp$1_filter$jscomp$3$$[0] && $center_jAlign$$ != $alignment$jscomp$1_filter$jscomp$3$$[0] || $center_jAlign$$ != $alignment$jscomp$1_filter$jscomp$3$$[0] && $center_jAlign$$ != $alignment$jscomp$1_filter$jscomp$3$$[$alignment$jscomp$1_filter$jscomp$3$$.length - 1] || $count$jscomp$40_iAlign$$ != $alignment$jscomp$1_filter$jscomp$3$$[0] && $count$jscomp$40_iAlign$$ != $alignment$jscomp$1_filter$jscomp$3$$[$alignment$jscomp$1_filter$jscomp$3$$.length - 1]) ? $markerDot$$ : $overlayDot$$),
1010
- $fakeMatrix$$[$i$jscomp$8$$][$j$jscomp$2$$] ? ($dot$$.draw({
1011
- x: $minSize_xFakeBeginning$$ + $i$jscomp$8$$ * $dotSize$jscomp$9$$,
1012
- y: $yBeginning_yFakeBeginning$$ + $j$jscomp$2$$ * $dotSize$jscomp$9$$,
1013
- size: $dotSize$jscomp$9$$,
1014
- getNeighbor: ($xOffset$jscomp$1$$, $yOffset$jscomp$1$$) => !0 === $fakeMatrix$$[$i$jscomp$8$$ + $xOffset$jscomp$1$$]?.[$j$jscomp$2$$ + $yOffset$jscomp$1$$]
1015
- }), $dot$$.element && this.dotsMaskGroup && this.dotsMaskGroup.appendChild($dot$$.element)) : this.lightDotsMask && ($dot$$.draw({
1016
- x: $minSize_xFakeBeginning$$ + $i$jscomp$8$$ * $dotSize$jscomp$9$$,
1017
- y: $yBeginning_yFakeBeginning$$ + $j$jscomp$2$$ * $dotSize$jscomp$9$$,
1018
- size: $dotSize$jscomp$9$$,
1019
- getNeighbor: ($xOffset$$, $yOffset$$) => !1 === $fakeMatrix$$[$i$jscomp$8$$ + $xOffset$$]?.[$j$jscomp$2$$ + $yOffset$$]
1020
- }), $dot$$.element && this.lightDotsMaskGroup && this.lightDotsMaskGroup.appendChild($dot$$.element)));
968
+ alignment = QRUtil.getPatternPosition((count - 17) / 4);
969
+ for (let i = 0; i < fakeCount_margin; i++) {
970
+ count = alignment.find((v => i - additionalDots > v - 3 && i - additionalDots < v + 3));
971
+ for (let j = 0; j < fakeCount_margin; j++) center_jAlign = alignment.find((v => j - additionalDots > v - 3 && j - additionalDots < v + 3)),
972
+ null != fakeMatrix[i][j] && (this.lightDotsMask && (dot = count && center_jAlign && (count != alignment[0] && center_jAlign != alignment[0] || center_jAlign != alignment[0] && center_jAlign != alignment[alignment.length - 1] || count != alignment[0] && count != alignment[alignment.length - 1]) ? markerDot : overlayDot),
973
+ fakeMatrix[i][j] ? (dot.draw({
974
+ x: minSize_xFakeBeginning + i * dotSize,
975
+ y: yBeginning_yFakeBeginning + j * dotSize,
976
+ size: dotSize,
977
+ getNeighbor: (xOffset, yOffset) => !0 === fakeMatrix[i + xOffset]?.[j + yOffset]
978
+ }), dot.element && this.dotsMaskGroup && this.dotsMaskGroup.appendChild(dot.element)) : this.lightDotsMask && (dot.draw({
979
+ x: minSize_xFakeBeginning + i * dotSize,
980
+ y: yBeginning_yFakeBeginning + j * dotSize,
981
+ size: dotSize,
982
+ getNeighbor: (xOffset, yOffset) => !1 === fakeMatrix[i + xOffset]?.[j + yOffset]
983
+ }), dot.element && this.lightDotsMaskGroup && this.lightDotsMaskGroup.appendChild(dot.element)));
1021
984
  }
1022
985
  this.lightDotsMask && this.createColor({
1023
- options: $options$jscomp$37$$.imageOptions.fill.gradient,
1024
- color: $options$jscomp$37$$.imageOptions.fill.color,
986
+ options: options.imageOptions.fill.gradient,
987
+ color: options.imageOptions.fill.color,
1025
988
  additionalRotation: 0,
1026
- x: $minSize_xFakeBeginning$$,
1027
- y: $yBeginning_yFakeBeginning$$,
1028
- height: $colorCount_xBeginning$$ * $dotSize$jscomp$9$$,
1029
- width: $colorCount_xBeginning$$ * $dotSize$jscomp$9$$,
989
+ x: minSize_xFakeBeginning,
990
+ y: yBeginning_yFakeBeginning,
991
+ height: colorCount_xBeginning * dotSize,
992
+ width: colorCount_xBeginning * dotSize,
1030
993
  name: "light-dot-color"
1031
994
  }), this.createColor({
1032
- options: $options$jscomp$37$$.dotsOptions?.gradient,
1033
- color: $options$jscomp$37$$.dotsOptions.color,
995
+ options: options.dotsOptions?.gradient,
996
+ color: options.dotsOptions.color,
1034
997
  additionalRotation: 0,
1035
- x: $minSize_xFakeBeginning$$,
1036
- y: $yBeginning_yFakeBeginning$$,
1037
- height: $colorCount_xBeginning$$ * $dotSize$jscomp$9$$,
1038
- width: $colorCount_xBeginning$$ * $dotSize$jscomp$9$$,
998
+ x: minSize_xFakeBeginning,
999
+ y: yBeginning_yFakeBeginning,
1000
+ height: colorCount_xBeginning * dotSize,
1001
+ width: colorCount_xBeginning * dotSize,
1039
1002
  name: "dot-color"
1040
1003
  });
1041
1004
  }
1042
1005
  drawCorners() {
1043
1006
  if (!this.qr) throw "QR code is not defined";
1044
- let $options$jscomp$38$$ = this.options;
1007
+ let options = this.options;
1045
1008
  if (!this._element) throw "Element code is not defined";
1046
- let $count$jscomp$41$$ = this.qr.getModuleCount(), $dotSize$jscomp$10$$ = this.options.dotsOptions.size, $cornersSquareSize$$ = 7 * $dotSize$jscomp$10$$, $cornersDotSize$$ = 3 * $dotSize$jscomp$10$$, $xBeginning$jscomp$1$$ = Math.floor(($options$jscomp$38$$.width - $count$jscomp$41$$ * $dotSize$jscomp$10$$) / 2), $yBeginning$jscomp$1$$ = Math.floor(($options$jscomp$38$$.height - $count$jscomp$41$$ * $dotSize$jscomp$10$$) / 2);
1047
- [ [ 0, 0, 0 ], [ 1, 0, Math.PI / 2 ], [ 0, 1, -Math.PI / 2 ] ].forEach((([$column_cornersDot$$, $row$$, $dot$jscomp$2_rotation$jscomp$27$$]) => {
1048
- let $x$jscomp$134$$ = $xBeginning$jscomp$1$$ + $column_cornersDot$$ * $dotSize$jscomp$10$$ * ($count$jscomp$41$$ - 7), $y$jscomp$118$$ = $yBeginning$jscomp$1$$ + $row$$ * $dotSize$jscomp$10$$ * ($count$jscomp$41$$ - 7);
1049
- var $cornersDotMaskGroup_cornersSquareMask$$ = this.dotsMask;
1050
- let $cornersSquareMaskGroup$$ = this.dotsMaskGroup;
1051
- var $cornersDotMask_cornersSquare_dot$jscomp$1$$ = this.dotsMask;
1052
- if ($cornersDotMaskGroup_cornersSquareMask$$ = this.dotsMaskGroup, ($options$jscomp$38$$.cornersSquareOptions?.gradient || $options$jscomp$38$$.cornersSquareOptions?.color) && ([$cornersDotMaskGroup_cornersSquareMask$$, $cornersSquareMaskGroup$$] = this.createMask(`mask-corners-square-color-${$column_cornersDot$$}-${$row$$}`),
1053
- this.defs.appendChild($cornersDotMaskGroup_cornersSquareMask$$), $cornersDotMask_cornersSquare_dot$jscomp$1$$ = $cornersDotMaskGroup_cornersSquareMask$$,
1054
- $cornersDotMaskGroup_cornersSquareMask$$ = $cornersSquareMaskGroup$$, this.createColor({
1055
- options: $options$jscomp$38$$.cornersSquareOptions?.gradient,
1056
- color: $options$jscomp$38$$.cornersSquareOptions?.color,
1057
- additionalRotation: $dot$jscomp$2_rotation$jscomp$27$$,
1058
- x: $x$jscomp$134$$,
1059
- y: $y$jscomp$118$$,
1060
- height: $cornersSquareSize$$,
1061
- width: $cornersSquareSize$$,
1062
- name: `corners-square-color-${$column_cornersDot$$}-${$row$$}`
1063
- })), $options$jscomp$38$$.cornersSquareOptions?.type) ($cornersDotMask_cornersSquare_dot$jscomp$1$$ = new $QRCornerSquare$$($options$jscomp$38$$.cornersSquareOptions.type, this.document)).draw({
1064
- x: $x$jscomp$134$$,
1065
- y: $y$jscomp$118$$,
1066
- size: $cornersSquareSize$$,
1067
- rotation: $dot$jscomp$2_rotation$jscomp$27$$
1068
- }), $cornersDotMask_cornersSquare_dot$jscomp$1$$.element && $cornersSquareMaskGroup$$ && $cornersSquareMaskGroup$$.appendChild($cornersDotMask_cornersSquare_dot$jscomp$1$$.element),
1069
- $cornersDotMask_cornersSquare_dot$jscomp$1$$.fill && this.lightDotsMaskGroup && this.lightDotsMaskGroup.appendChild($cornersDotMask_cornersSquare_dot$jscomp$1$$.fill); else {
1070
- $cornersDotMask_cornersSquare_dot$jscomp$1$$ = new $QRDot$$($options$jscomp$38$$.dotsOptions.type, this.document);
1071
- for (let $i$jscomp$9$$ = 0; $i$jscomp$9$$ < $squareMask$$.length; $i$jscomp$9$$++) for (let $j$jscomp$3$$ = 0; $j$jscomp$3$$ < $squareMask$$[$i$jscomp$9$$].length; $j$jscomp$3$$++) $squareMask$$[$i$jscomp$9$$]?.[$j$jscomp$3$$] ? ($cornersDotMask_cornersSquare_dot$jscomp$1$$.draw({
1072
- x: $x$jscomp$134$$ + $i$jscomp$9$$ * $dotSize$jscomp$10$$,
1073
- y: $y$jscomp$118$$ + $j$jscomp$3$$ * $dotSize$jscomp$10$$,
1074
- size: $dotSize$jscomp$10$$,
1075
- getNeighbor: ($xOffset$jscomp$3$$, $yOffset$jscomp$3$$) => !!$squareMask$$[$i$jscomp$9$$ + $xOffset$jscomp$3$$]?.[$j$jscomp$3$$ + $yOffset$jscomp$3$$]
1076
- }), $cornersDotMask_cornersSquare_dot$jscomp$1$$.element && $cornersSquareMaskGroup$$ && $cornersSquareMaskGroup$$.appendChild($cornersDotMask_cornersSquare_dot$jscomp$1$$.element)) : this.lightDotsMask && !$dotMask$$[$i$jscomp$9$$]?.[$j$jscomp$3$$] && ($cornersDotMask_cornersSquare_dot$jscomp$1$$.draw({
1077
- x: $x$jscomp$134$$ + $i$jscomp$9$$ * $dotSize$jscomp$10$$,
1078
- y: $y$jscomp$118$$ + $j$jscomp$3$$ * $dotSize$jscomp$10$$,
1079
- size: $dotSize$jscomp$10$$,
1080
- getNeighbor: ($xOffset$jscomp$2$$, $yOffset$jscomp$2$$) => !$squareMask$$[$i$jscomp$9$$ + $xOffset$jscomp$2$$]?.[$j$jscomp$3$$ + $yOffset$jscomp$2$$] && !$dotMask$$[$i$jscomp$9$$ + $xOffset$jscomp$2$$]?.[$j$jscomp$3$$ + $yOffset$jscomp$2$$]
1081
- }), $cornersDotMask_cornersSquare_dot$jscomp$1$$.element && this.lightDotsMaskGroup && this.lightDotsMaskGroup.appendChild($cornersDotMask_cornersSquare_dot$jscomp$1$$.element));
1082
- if (this.lightDotsMask) for (let $i$jscomp$10$$ = -1; 8 > $i$jscomp$10$$; $i$jscomp$10$$++) for (let $j$jscomp$4$$ = -1; 8 > $j$jscomp$4$$; $j$jscomp$4$$++) -1 != $i$jscomp$10$$ && 7 != $i$jscomp$10$$ && -1 != $j$jscomp$4$$ && 7 != $j$jscomp$4$$ || ($cornersDotMask_cornersSquare_dot$jscomp$1$$.draw({
1083
- x: $x$jscomp$134$$ + $i$jscomp$10$$ * $dotSize$jscomp$10$$,
1084
- y: $y$jscomp$118$$ + $j$jscomp$4$$ * $dotSize$jscomp$10$$,
1085
- size: $dotSize$jscomp$10$$,
1086
- getNeighbor: ($ii$jscomp$1_xOffset$jscomp$4$$, $jj$jscomp$1_yOffset$jscomp$4$$) => ($jj$jscomp$1_yOffset$jscomp$4$$ = $j$jscomp$4$$ + $jj$jscomp$1_yOffset$jscomp$4$$,
1087
- -1 <= ($ii$jscomp$1_xOffset$jscomp$4$$ = $i$jscomp$10$$ + $ii$jscomp$1_xOffset$jscomp$4$$) && 7 >= $ii$jscomp$1_xOffset$jscomp$4$$ && -1 <= $jj$jscomp$1_yOffset$jscomp$4$$ && 7 >= $jj$jscomp$1_yOffset$jscomp$4$$ && (-1 == $ii$jscomp$1_xOffset$jscomp$4$$ || 7 == $ii$jscomp$1_xOffset$jscomp$4$$ || -1 == $jj$jscomp$1_yOffset$jscomp$4$$ || 7 == $jj$jscomp$1_yOffset$jscomp$4$$))
1088
- }), $cornersDotMask_cornersSquare_dot$jscomp$1$$.element && this.lightDotsMaskGroup && this.lightDotsMaskGroup.appendChild($cornersDotMask_cornersSquare_dot$jscomp$1$$.element));
1009
+ let count = this.qr.getModuleCount(), dotSize = this.options.dotsOptions.size, cornersSquareSize = 7 * dotSize, cornersDotSize = 3 * dotSize, xBeginning = Math.floor((options.width - count * dotSize) / 2), yBeginning = Math.floor((options.height - count * dotSize) / 2);
1010
+ [ [ 0, 0, 0 ], [ 1, 0, Math.PI / 2 ], [ 0, 1, -Math.PI / 2 ] ].forEach((([column_cornersDot, row, dot]) => {
1011
+ let x = xBeginning + column_cornersDot * dotSize * (count - 7), y = yBeginning + row * dotSize * (count - 7);
1012
+ var cornersDotMaskGroup_cornersSquareMask = this.dotsMask;
1013
+ let cornersSquareMaskGroup = this.dotsMaskGroup;
1014
+ var cornersDotMask_cornersSquare_dot = this.dotsMask;
1015
+ if (cornersDotMaskGroup_cornersSquareMask = this.dotsMaskGroup, (options.cornersSquareOptions?.gradient || options.cornersSquareOptions?.color) && ([cornersDotMaskGroup_cornersSquareMask, cornersSquareMaskGroup] = this.createMask(`mask-corners-square-color-${column_cornersDot}-${row}`),
1016
+ this.defs.appendChild(cornersDotMaskGroup_cornersSquareMask), cornersDotMask_cornersSquare_dot = cornersDotMaskGroup_cornersSquareMask,
1017
+ cornersDotMaskGroup_cornersSquareMask = cornersSquareMaskGroup, this.createColor({
1018
+ options: options.cornersSquareOptions?.gradient,
1019
+ color: options.cornersSquareOptions?.color,
1020
+ additionalRotation: dot,
1021
+ x,
1022
+ y,
1023
+ height: cornersSquareSize,
1024
+ width: cornersSquareSize,
1025
+ name: `corners-square-color-${column_cornersDot}-${row}`
1026
+ })), options.cornersSquareOptions?.type) (cornersDotMask_cornersSquare_dot = new QRCornerSquare(options.cornersSquareOptions.type, this.document)).draw({
1027
+ x,
1028
+ y,
1029
+ size: cornersSquareSize,
1030
+ rotation: dot
1031
+ }), cornersDotMask_cornersSquare_dot.element && cornersSquareMaskGroup && cornersSquareMaskGroup.appendChild(cornersDotMask_cornersSquare_dot.element),
1032
+ cornersDotMask_cornersSquare_dot.fill && this.lightDotsMaskGroup && this.lightDotsMaskGroup.appendChild(cornersDotMask_cornersSquare_dot.fill); else {
1033
+ cornersDotMask_cornersSquare_dot = new QRDot(options.dotsOptions.type, this.document);
1034
+ for (let i = 0; i < squareMask.length; i++) for (let j = 0; j < squareMask[i].length; j++) squareMask[i]?.[j] ? (cornersDotMask_cornersSquare_dot.draw({
1035
+ x: x + i * dotSize,
1036
+ y: y + j * dotSize,
1037
+ size: dotSize,
1038
+ getNeighbor: (xOffset, yOffset) => !!squareMask[i + xOffset]?.[j + yOffset]
1039
+ }), cornersDotMask_cornersSquare_dot.element && cornersSquareMaskGroup && cornersSquareMaskGroup.appendChild(cornersDotMask_cornersSquare_dot.element)) : this.lightDotsMask && !dotMask[i]?.[j] && (cornersDotMask_cornersSquare_dot.draw({
1040
+ x: x + i * dotSize,
1041
+ y: y + j * dotSize,
1042
+ size: dotSize,
1043
+ getNeighbor: (xOffset, yOffset) => !squareMask[i + xOffset]?.[j + yOffset] && !dotMask[i + xOffset]?.[j + yOffset]
1044
+ }), cornersDotMask_cornersSquare_dot.element && this.lightDotsMaskGroup && this.lightDotsMaskGroup.appendChild(cornersDotMask_cornersSquare_dot.element));
1045
+ if (this.lightDotsMask) for (let i = -1; 8 > i; i++) for (let j = -1; 8 > j; j++) -1 != i && 7 != i && -1 != j && 7 != j || (cornersDotMask_cornersSquare_dot.draw({
1046
+ x: x + i * dotSize,
1047
+ y: y + j * dotSize,
1048
+ size: dotSize,
1049
+ getNeighbor: (ii, jj) => (jj = j + jj, -1 <= (ii = i + ii) && 7 >= ii && -1 <= jj && 7 >= jj && (-1 == ii || 7 == ii || -1 == jj || 7 == jj))
1050
+ }), cornersDotMask_cornersSquare_dot.element && this.lightDotsMaskGroup && this.lightDotsMaskGroup.appendChild(cornersDotMask_cornersSquare_dot.element));
1089
1051
  }
1090
- if (($options$jscomp$38$$.cornersDotOptions?.gradient || $options$jscomp$38$$.cornersDotOptions?.color) && ([$cornersDotMask_cornersSquare_dot$jscomp$1$$, $cornersDotMaskGroup_cornersSquareMask$$] = this.createMask(`mask-corners-dot-color-${$column_cornersDot$$}-${$row$$}`),
1091
- this.defs.appendChild($cornersDotMask_cornersSquare_dot$jscomp$1$$), this.createColor({
1092
- options: $options$jscomp$38$$.cornersDotOptions?.gradient,
1093
- color: $options$jscomp$38$$.cornersDotOptions?.color,
1094
- additionalRotation: $dot$jscomp$2_rotation$jscomp$27$$,
1095
- x: $x$jscomp$134$$ + 2 * $dotSize$jscomp$10$$,
1096
- y: $y$jscomp$118$$ + 2 * $dotSize$jscomp$10$$,
1097
- height: $cornersDotSize$$,
1098
- width: $cornersDotSize$$,
1099
- name: `corners-dot-color-${$column_cornersDot$$}-${$row$$}`
1100
- })), $options$jscomp$38$$.cornersDotOptions?.type) ($column_cornersDot$$ = new $QRCornerDot$$($options$jscomp$38$$.cornersDotOptions.type, this.document)).draw({
1101
- x: $x$jscomp$134$$ + 2 * $dotSize$jscomp$10$$,
1102
- y: $y$jscomp$118$$ + 2 * $dotSize$jscomp$10$$,
1103
- size: $cornersDotSize$$,
1104
- rotation: $dot$jscomp$2_rotation$jscomp$27$$
1105
- }), $column_cornersDot$$.element && $cornersDotMaskGroup_cornersSquareMask$$ && $cornersDotMaskGroup_cornersSquareMask$$.appendChild($column_cornersDot$$.element); else {
1106
- $dot$jscomp$2_rotation$jscomp$27$$ = new $QRDot$$($options$jscomp$38$$.dotsOptions.type, this.document);
1107
- for (let $i$jscomp$11$$ = 0; $i$jscomp$11$$ < $dotMask$$.length; $i$jscomp$11$$++) for (let $j$jscomp$5$$ = 0; $j$jscomp$5$$ < $dotMask$$[$i$jscomp$11$$].length; $j$jscomp$5$$++) $dotMask$$[$i$jscomp$11$$]?.[$j$jscomp$5$$] && ($dot$jscomp$2_rotation$jscomp$27$$.draw({
1108
- x: $x$jscomp$134$$ + $i$jscomp$11$$ * $dotSize$jscomp$10$$,
1109
- y: $y$jscomp$118$$ + $j$jscomp$5$$ * $dotSize$jscomp$10$$,
1110
- size: $dotSize$jscomp$10$$,
1111
- getNeighbor: ($xOffset$jscomp$5$$, $yOffset$jscomp$5$$) => !!$dotMask$$[$i$jscomp$11$$ + $xOffset$jscomp$5$$]?.[$j$jscomp$5$$ + $yOffset$jscomp$5$$]
1112
- }), $dot$jscomp$2_rotation$jscomp$27$$.element && $cornersDotMaskGroup_cornersSquareMask$$ && $cornersDotMaskGroup_cornersSquareMask$$.appendChild($dot$jscomp$2_rotation$jscomp$27$$.element));
1052
+ if ((options.cornersDotOptions?.gradient || options.cornersDotOptions?.color) && ([cornersDotMask_cornersSquare_dot, cornersDotMaskGroup_cornersSquareMask] = this.createMask(`mask-corners-dot-color-${column_cornersDot}-${row}`),
1053
+ this.defs.appendChild(cornersDotMask_cornersSquare_dot), this.createColor({
1054
+ options: options.cornersDotOptions?.gradient,
1055
+ color: options.cornersDotOptions?.color,
1056
+ additionalRotation: dot,
1057
+ x: x + 2 * dotSize,
1058
+ y: y + 2 * dotSize,
1059
+ height: cornersDotSize,
1060
+ width: cornersDotSize,
1061
+ name: `corners-dot-color-${column_cornersDot}-${row}`
1062
+ })), options.cornersDotOptions?.type) (column_cornersDot = new QRCornerDot(options.cornersDotOptions.type, this.document)).draw({
1063
+ x: x + 2 * dotSize,
1064
+ y: y + 2 * dotSize,
1065
+ size: cornersDotSize,
1066
+ rotation: dot
1067
+ }), column_cornersDot.element && cornersDotMaskGroup_cornersSquareMask && cornersDotMaskGroup_cornersSquareMask.appendChild(column_cornersDot.element); else {
1068
+ dot = new QRDot(options.dotsOptions.type, this.document);
1069
+ for (let i = 0; i < dotMask.length; i++) for (let j = 0; j < dotMask[i].length; j++) dotMask[i]?.[j] && (dot.draw({
1070
+ x: x + i * dotSize,
1071
+ y: y + j * dotSize,
1072
+ size: dotSize,
1073
+ getNeighbor: (xOffset, yOffset) => !!dotMask[i + xOffset]?.[j + yOffset]
1074
+ }), dot.element && cornersDotMaskGroup_cornersSquareMask && cornersDotMaskGroup_cornersSquareMask.appendChild(dot.element));
1113
1075
  }
1114
1076
  }));
1115
1077
  }
1116
- async drawImage({width: $dw_width$jscomp$30$$, height: $dh_height$jscomp$27$$, count: $count$jscomp$42_dy$jscomp$4$$, dotSize: $dotSize$jscomp$11_i$jscomp$12$$}) {
1117
- var $image$jscomp$4_options$jscomp$39$$ = this.options, $dx$jscomp$4_xBeginning$jscomp$2$$ = Math.floor(($image$jscomp$4_options$jscomp$39$$.width - $count$jscomp$42_dy$jscomp$4$$ * $dotSize$jscomp$11_i$jscomp$12$$) / 2), $encoding$jscomp$3_yBeginning$jscomp$2$$ = Math.floor(($image$jscomp$4_options$jscomp$39$$.height - $count$jscomp$42_dy$jscomp$4$$ * $dotSize$jscomp$11_i$jscomp$12$$) / 2), $container_data$jscomp$80_imageUrl_margin$jscomp$3_rootEl$$ = $image$jscomp$4_options$jscomp$39$$.imageOptions.margin * $dotSize$jscomp$11_i$jscomp$12$$;
1118
- if ($image$jscomp$4_options$jscomp$39$$.imageOptions.mode == $ImageMode$$.background && ($container_data$jscomp$80_imageUrl_margin$jscomp$3_rootEl$$ = 0),
1119
- $dx$jscomp$4_xBeginning$jscomp$2$$ = $dx$jscomp$4_xBeginning$jscomp$2$$ + $container_data$jscomp$80_imageUrl_margin$jscomp$3_rootEl$$ + ($count$jscomp$42_dy$jscomp$4$$ * $dotSize$jscomp$11_i$jscomp$12$$ - $dw_width$jscomp$30$$) / 2,
1120
- $count$jscomp$42_dy$jscomp$4$$ = $encoding$jscomp$3_yBeginning$jscomp$2$$ + $container_data$jscomp$80_imageUrl_margin$jscomp$3_rootEl$$ + ($count$jscomp$42_dy$jscomp$4$$ * $dotSize$jscomp$11_i$jscomp$12$$ - $dh_height$jscomp$27$$) / 2,
1121
- $dw_width$jscomp$30$$ -= 2 * $container_data$jscomp$80_imageUrl_margin$jscomp$3_rootEl$$,
1122
- $dh_height$jscomp$27$$ -= 2 * $container_data$jscomp$80_imageUrl_margin$jscomp$3_rootEl$$,
1123
- $container_data$jscomp$80_imageUrl_margin$jscomp$3_rootEl$$ = await this.imageTools.toDataURL($image$jscomp$4_options$jscomp$39$$.image || ""),
1124
- ($image$jscomp$4_options$jscomp$39$$ = this.document.createElementNS("http://www.w3.org/2000/svg", "image")).setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href", $container_data$jscomp$80_imageUrl_margin$jscomp$3_rootEl$$ || ""),
1125
- $container_data$jscomp$80_imageUrl_margin$jscomp$3_rootEl$$.startsWith("data:image/svg+xml;")) {
1126
- if ($dotSize$jscomp$11_i$jscomp$12$$ = ($container_data$jscomp$80_imageUrl_margin$jscomp$3_rootEl$$ = $container_data$jscomp$80_imageUrl_margin$jscomp$3_rootEl$$.substring(19)).indexOf(","),
1127
- $encoding$jscomp$3_yBeginning$jscomp$2$$ = $container_data$jscomp$80_imageUrl_margin$jscomp$3_rootEl$$.substring(0, $dotSize$jscomp$11_i$jscomp$12$$),
1128
- $container_data$jscomp$80_imageUrl_margin$jscomp$3_rootEl$$ = $container_data$jscomp$80_imageUrl_margin$jscomp$3_rootEl$$.substring($dotSize$jscomp$11_i$jscomp$12$$ + 1),
1129
- "base64" === $encoding$jscomp$3_yBeginning$jscomp$2$$) $container_data$jscomp$80_imageUrl_margin$jscomp$3_rootEl$$ = "function" == typeof atob ? atob($container_data$jscomp$80_imageUrl_margin$jscomp$3_rootEl$$) : Buffer.from($container_data$jscomp$80_imageUrl_margin$jscomp$3_rootEl$$, "base64").toString("utf8"); else $container_data$jscomp$80_imageUrl_margin$jscomp$3_rootEl$$ = "";
1130
- $container_data$jscomp$80_imageUrl_margin$jscomp$3_rootEl$$ && ($container_data$jscomp$80_imageUrl_margin$jscomp$3_rootEl$$ = (new DOMParser).parseFromString($container_data$jscomp$80_imageUrl_margin$jscomp$3_rootEl$$, "text/xml"),
1131
- ($container_data$jscomp$80_imageUrl_margin$jscomp$3_rootEl$$ = Array.from($container_data$jscomp$80_imageUrl_margin$jscomp$3_rootEl$$.getElementsByTagName("svg"))).length && ($image$jscomp$4_options$jscomp$39$$ = $container_data$jscomp$80_imageUrl_margin$jscomp$3_rootEl$$[0]).setAttribute("overflow", "visible"));
1078
+ async drawImage({width: dw_width, height: dh_height, count, dotSize}) {
1079
+ var image = this.options, dx = Math.floor((image.width - count * dotSize) / 2), encoding = Math.floor((image.height - count * dotSize) / 2), container_data = image.imageOptions.margin * dotSize;
1080
+ if (image.imageOptions.mode == ImageMode.background && (container_data = 0), dx = dx + container_data + (count * dotSize - dw_width) / 2,
1081
+ count = encoding + container_data + (count * dotSize - dh_height) / 2, dw_width -= 2 * container_data,
1082
+ dh_height -= 2 * container_data, container_data = await this.imageTools.toDataURL(image.image || ""),
1083
+ (image = this.document.createElementNS("http://www.w3.org/2000/svg", "image")).setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href", container_data || ""),
1084
+ container_data.startsWith("data:image/svg+xml;")) {
1085
+ if (dotSize = (container_data = container_data.substring(19)).indexOf(","), encoding = container_data.substring(0, dotSize),
1086
+ container_data = container_data.substring(dotSize + 1), "base64" === encoding) container_data = "function" == typeof atob ? atob(container_data) : Buffer.from(container_data, "base64").toString("utf8"); else container_data = "";
1087
+ container_data && (container_data = (new DOMParser).parseFromString(container_data, "text/xml"),
1088
+ (container_data = Array.from(container_data.getElementsByTagName("svg"))).length && (image = container_data[0]).setAttribute("overflow", "visible"));
1132
1089
  }
1133
- $image$jscomp$4_options$jscomp$39$$.setAttribute("x", $numToAttr$$($dx$jscomp$4_xBeginning$jscomp$2$$)),
1134
- $image$jscomp$4_options$jscomp$39$$.setAttribute("y", $numToAttr$$($count$jscomp$42_dy$jscomp$4$$)),
1135
- $image$jscomp$4_options$jscomp$39$$.setAttribute("width", `${$numToAttr$$($dw_width$jscomp$30$$)}px`),
1136
- $image$jscomp$4_options$jscomp$39$$.setAttribute("height", `${$numToAttr$$($dh_height$jscomp$27$$)}px`),
1137
- this._element.appendChild($image$jscomp$4_options$jscomp$39$$);
1138
- }
1139
- createColor({options: $options$jscomp$40_parsed$jscomp$1$$, color: $color$jscomp$3_rotation$jscomp$28$$, additionalRotation: $additionalRotation_positiveRotation$$, x: $x$jscomp$135_x1$jscomp$5$$, y: $y$jscomp$119_y1$jscomp$5$$, height: $height$jscomp$28$$, width: $width$jscomp$31$$, name: $name$jscomp$73$$}) {
1140
- var $size$jscomp$71_x0$jscomp$2$$ = $width$jscomp$31$$ > $height$jscomp$28$$ ? $width$jscomp$31$$ : $height$jscomp$28$$;
1141
- let $rect$$ = this.document.createElementNS("http://www.w3.org/2000/svg", "rect");
1142
- if ($rect$$.setAttribute("x", $numToAttr$$($x$jscomp$135_x1$jscomp$5$$)), $rect$$.setAttribute("y", $numToAttr$$($y$jscomp$119_y1$jscomp$5$$)),
1143
- $rect$$.setAttribute("height", $numToAttr$$($height$jscomp$28$$)), $rect$$.setAttribute("width", $numToAttr$$($width$jscomp$31$$)),
1144
- $rect$$.setAttribute("style", `mask:url(#mask-${$name$jscomp$73$$})`), $options$jscomp$40_parsed$jscomp$1$$) {
1145
- let $gradient$jscomp$1$$;
1146
- if ($options$jscomp$40_parsed$jscomp$1$$.type === $GradientType$$.radial) $gradient$jscomp$1$$ = this.document.createElementNS("http://www.w3.org/2000/svg", "radialGradient"),
1147
- $gradient$jscomp$1$$.setAttribute("id", $name$jscomp$73$$), $gradient$jscomp$1$$.setAttribute("gradientUnits", "userSpaceOnUse"),
1148
- $gradient$jscomp$1$$.setAttribute("fx", $numToAttr$$($x$jscomp$135_x1$jscomp$5$$ + $width$jscomp$31$$ / 2)),
1149
- $gradient$jscomp$1$$.setAttribute("fy", $numToAttr$$($y$jscomp$119_y1$jscomp$5$$ + $height$jscomp$28$$ / 2)),
1150
- $gradient$jscomp$1$$.setAttribute("cx", $numToAttr$$($x$jscomp$135_x1$jscomp$5$$ + $width$jscomp$31$$ / 2)),
1151
- $gradient$jscomp$1$$.setAttribute("cy", $numToAttr$$($y$jscomp$119_y1$jscomp$5$$ + $height$jscomp$28$$ / 2)),
1152
- $gradient$jscomp$1$$.setAttribute("r", $numToAttr$$($size$jscomp$71_x0$jscomp$2$$ / 2)); else {
1153
- $size$jscomp$71_x0$jscomp$2$$ = $x$jscomp$135_x1$jscomp$5$$ + $width$jscomp$31$$ / 2;
1154
- let $y0$jscomp$2$$ = $y$jscomp$119_y1$jscomp$5$$ + $height$jscomp$28$$ / 2;
1155
- $x$jscomp$135_x1$jscomp$5$$ += $width$jscomp$31$$ / 2, $y$jscomp$119_y1$jscomp$5$$ += $height$jscomp$28$$ / 2,
1156
- 0 <= ($additionalRotation_positiveRotation$$ = (($color$jscomp$3_rotation$jscomp$28$$ = (($options$jscomp$40_parsed$jscomp$1$$.rotation || 0) + $additionalRotation_positiveRotation$$) % (2 * Math.PI)) + 2 * Math.PI) % (2 * Math.PI)) && $additionalRotation_positiveRotation$$ <= .25 * Math.PI || $additionalRotation_positiveRotation$$ > 1.75 * Math.PI && $additionalRotation_positiveRotation$$ <= 2 * Math.PI ? ($size$jscomp$71_x0$jscomp$2$$ -= $width$jscomp$31$$ / 2,
1157
- $y0$jscomp$2$$ -= $height$jscomp$28$$ / 2 * Math.tan($color$jscomp$3_rotation$jscomp$28$$),
1158
- $x$jscomp$135_x1$jscomp$5$$ += $width$jscomp$31$$ / 2, $y$jscomp$119_y1$jscomp$5$$ += $height$jscomp$28$$ / 2 * Math.tan($color$jscomp$3_rotation$jscomp$28$$)) : $additionalRotation_positiveRotation$$ > .25 * Math.PI && $additionalRotation_positiveRotation$$ <= .75 * Math.PI ? ($y0$jscomp$2$$ -= $height$jscomp$28$$ / 2,
1159
- $size$jscomp$71_x0$jscomp$2$$ -= $width$jscomp$31$$ / 2 / Math.tan($color$jscomp$3_rotation$jscomp$28$$),
1160
- $y$jscomp$119_y1$jscomp$5$$ += $height$jscomp$28$$ / 2, $x$jscomp$135_x1$jscomp$5$$ += $width$jscomp$31$$ / 2 / Math.tan($color$jscomp$3_rotation$jscomp$28$$)) : $additionalRotation_positiveRotation$$ > .75 * Math.PI && $additionalRotation_positiveRotation$$ <= 1.25 * Math.PI ? ($size$jscomp$71_x0$jscomp$2$$ += $width$jscomp$31$$ / 2,
1161
- $y0$jscomp$2$$ += $height$jscomp$28$$ / 2 * Math.tan($color$jscomp$3_rotation$jscomp$28$$),
1162
- $x$jscomp$135_x1$jscomp$5$$ -= $width$jscomp$31$$ / 2, $y$jscomp$119_y1$jscomp$5$$ -= $height$jscomp$28$$ / 2 * Math.tan($color$jscomp$3_rotation$jscomp$28$$)) : $additionalRotation_positiveRotation$$ > 1.25 * Math.PI && $additionalRotation_positiveRotation$$ <= 1.75 * Math.PI && ($y0$jscomp$2$$ += $height$jscomp$28$$ / 2,
1163
- $size$jscomp$71_x0$jscomp$2$$ += $width$jscomp$31$$ / 2 / Math.tan($color$jscomp$3_rotation$jscomp$28$$),
1164
- $y$jscomp$119_y1$jscomp$5$$ -= $height$jscomp$28$$ / 2, $x$jscomp$135_x1$jscomp$5$$ -= $width$jscomp$31$$ / 2 / Math.tan($color$jscomp$3_rotation$jscomp$28$$)),
1165
- $gradient$jscomp$1$$ = this.document.createElementNS("http://www.w3.org/2000/svg", "linearGradient"),
1166
- $gradient$jscomp$1$$.setAttribute("id", $name$jscomp$73$$), $gradient$jscomp$1$$.setAttribute("gradientUnits", "userSpaceOnUse"),
1167
- $gradient$jscomp$1$$.setAttribute("x1", $numToAttr$$($size$jscomp$71_x0$jscomp$2$$)),
1168
- $gradient$jscomp$1$$.setAttribute("y1", $numToAttr$$($y0$jscomp$2$$)), $gradient$jscomp$1$$.setAttribute("x2", $numToAttr$$($x$jscomp$135_x1$jscomp$5$$)),
1169
- $gradient$jscomp$1$$.setAttribute("y2", $numToAttr$$($y$jscomp$119_y1$jscomp$5$$));
1090
+ image.setAttribute("x", numToAttr(dx)), image.setAttribute("y", numToAttr(count)),
1091
+ image.setAttribute("width", `${numToAttr(dw_width)}px`), image.setAttribute("height", `${numToAttr(dh_height)}px`),
1092
+ this._element.appendChild(image);
1093
+ }
1094
+ createColor({options, color, additionalRotation: additionalRotation_positiveRotation, x, y, height, width, name}) {
1095
+ var size = width > height ? width : height;
1096
+ let rect = this.document.createElementNS("http://www.w3.org/2000/svg", "rect");
1097
+ if (rect.setAttribute("x", numToAttr(x)), rect.setAttribute("y", numToAttr(y)),
1098
+ rect.setAttribute("height", numToAttr(height)), rect.setAttribute("width", numToAttr(width)),
1099
+ rect.setAttribute("style", `mask:url(#mask-${name})`), options) {
1100
+ let gradient;
1101
+ if (options.type === GradientType.radial) gradient = this.document.createElementNS("http://www.w3.org/2000/svg", "radialGradient"),
1102
+ gradient.setAttribute("id", name), gradient.setAttribute("gradientUnits", "userSpaceOnUse"),
1103
+ gradient.setAttribute("fx", numToAttr(x + width / 2)), gradient.setAttribute("fy", numToAttr(y + height / 2)),
1104
+ gradient.setAttribute("cx", numToAttr(x + width / 2)), gradient.setAttribute("cy", numToAttr(y + height / 2)),
1105
+ gradient.setAttribute("r", numToAttr(size / 2)); else {
1106
+ size = x + width / 2;
1107
+ let y0 = y + height / 2;
1108
+ x += width / 2, y += height / 2, 0 <= (additionalRotation_positiveRotation = ((color = ((options.rotation || 0) + additionalRotation_positiveRotation) % (2 * Math.PI)) + 2 * Math.PI) % (2 * Math.PI)) && additionalRotation_positiveRotation <= .25 * Math.PI || additionalRotation_positiveRotation > 1.75 * Math.PI && additionalRotation_positiveRotation <= 2 * Math.PI ? (size -= width / 2,
1109
+ y0 -= height / 2 * Math.tan(color), x += width / 2, y += height / 2 * Math.tan(color)) : additionalRotation_positiveRotation > .25 * Math.PI && additionalRotation_positiveRotation <= .75 * Math.PI ? (y0 -= height / 2,
1110
+ size -= width / 2 / Math.tan(color), y += height / 2, x += width / 2 / Math.tan(color)) : additionalRotation_positiveRotation > .75 * Math.PI && additionalRotation_positiveRotation <= 1.25 * Math.PI ? (size += width / 2,
1111
+ y0 += height / 2 * Math.tan(color), x -= width / 2, y -= height / 2 * Math.tan(color)) : additionalRotation_positiveRotation > 1.25 * Math.PI && additionalRotation_positiveRotation <= 1.75 * Math.PI && (y0 += height / 2,
1112
+ size += width / 2 / Math.tan(color), y -= height / 2, x -= width / 2 / Math.tan(color)),
1113
+ gradient = this.document.createElementNS("http://www.w3.org/2000/svg", "linearGradient"),
1114
+ gradient.setAttribute("id", name), gradient.setAttribute("gradientUnits", "userSpaceOnUse"),
1115
+ gradient.setAttribute("x1", numToAttr(size)), gradient.setAttribute("y1", numToAttr(y0)),
1116
+ gradient.setAttribute("x2", numToAttr(x)), gradient.setAttribute("y2", numToAttr(y));
1170
1117
  }
1171
- $options$jscomp$40_parsed$jscomp$1$$.colorStops.forEach((({offset: $offset$jscomp$26_parsed$$, color: $color$jscomp$4$$}) => {
1172
- let $stop$$ = this.document.createElementNS("http://www.w3.org/2000/svg", "stop");
1173
- $stop$$.setAttribute("offset", `${$numToAttr$$(100 * $offset$jscomp$26_parsed$$)}%`),
1174
- $offset$jscomp$26_parsed$$ = $parseColor$$($color$jscomp$4$$), $stop$$.setAttribute("stop-color", $offset$jscomp$26_parsed$$.value),
1175
- 1 > $offset$jscomp$26_parsed$$.alpha && $stop$$.setAttribute("stop-opacity", $offset$jscomp$26_parsed$$.alpha.toFixed(7)),
1176
- $gradient$jscomp$1$$.appendChild($stop$$);
1177
- })), $rect$$.setAttribute("fill", `url(#${$name$jscomp$73$$})`), this.defs.appendChild($gradient$jscomp$1$$);
1178
- } else $color$jscomp$3_rotation$jscomp$28$$ && ($options$jscomp$40_parsed$jscomp$1$$ = $parseColor$$($color$jscomp$3_rotation$jscomp$28$$),
1179
- $rect$$.setAttribute("fill", $options$jscomp$40_parsed$jscomp$1$$.value), 1 > $options$jscomp$40_parsed$jscomp$1$$.alpha && $rect$$.setAttribute("opacity", $options$jscomp$40_parsed$jscomp$1$$.alpha.toFixed(7)));
1180
- this._element.appendChild($rect$$);
1181
- }
1182
- createMask($group_id$jscomp$5$$) {
1183
- let $options$jscomp$41$$ = this.options, $mask$jscomp$7$$ = this.document.createElementNS("http://www.w3.org/2000/svg", "mask");
1184
- return $mask$jscomp$7$$.setAttribute("id", $group_id$jscomp$5$$), $mask$jscomp$7$$.setAttribute("maskUnits", "userSpaceOnUse"),
1185
- $mask$jscomp$7$$.setAttribute("x", "0"), $mask$jscomp$7$$.setAttribute("y", "0"),
1186
- $mask$jscomp$7$$.setAttribute("width", $numToAttr$$($options$jscomp$41$$.width)),
1187
- $mask$jscomp$7$$.setAttribute("height", $numToAttr$$($options$jscomp$41$$.height)),
1188
- ($group_id$jscomp$5$$ = this.document.createElementNS("http://www.w3.org/2000/svg", "g")).setAttribute("fill", "#fff"),
1189
- $mask$jscomp$7$$.appendChild($group_id$jscomp$5$$), [ $mask$jscomp$7$$, $group_id$jscomp$5$$ ];
1118
+ options.colorStops.forEach((({offset, color}) => {
1119
+ let stop = this.document.createElementNS("http://www.w3.org/2000/svg", "stop");
1120
+ stop.setAttribute("offset", `${numToAttr(100 * offset)}%`), offset = parseColor(color),
1121
+ stop.setAttribute("stop-color", offset.value), 1 > offset.alpha && stop.setAttribute("stop-opacity", offset.alpha.toFixed(7)),
1122
+ gradient.appendChild(stop);
1123
+ })), rect.setAttribute("fill", `url(#${name})`), this.defs.appendChild(gradient);
1124
+ } else color && (options = parseColor(color), rect.setAttribute("fill", options.value),
1125
+ 1 > options.alpha && rect.setAttribute("opacity", options.alpha.toFixed(7)));
1126
+ this._element.appendChild(rect);
1127
+ }
1128
+ createMask(group_id) {
1129
+ let options = this.options, mask = this.document.createElementNS("http://www.w3.org/2000/svg", "mask");
1130
+ return mask.setAttribute("id", group_id), mask.setAttribute("maskUnits", "userSpaceOnUse"),
1131
+ mask.setAttribute("x", "0"), mask.setAttribute("y", "0"), mask.setAttribute("width", numToAttr(options.width)),
1132
+ mask.setAttribute("height", numToAttr(options.height)), (group_id = this.document.createElementNS("http://www.w3.org/2000/svg", "g")).setAttribute("fill", "#fff"),
1133
+ mask.appendChild(group_id), [ mask, group_id ];
1190
1134
  }
1191
1135
  }
1192
1136
 
1193
1137
  Object.assign(QRCodeMinimal.stringToBytesFuncs, stringToBytes_UTF8);
1194
1138
 
1195
- let $QRCodeStyling$1$$ = class {
1139
+ let QRCodeStyling$1 = class {
1196
1140
  get size() {
1197
1141
  if (this.qrSVG) return {
1198
1142
  width: this.qrSVG.width,
1199
1143
  height: this.qrSVG.height
1200
1144
  };
1201
1145
  }
1202
- constructor($options$jscomp$42$$) {
1203
- this.options = $options$jscomp$42$$ ? $sanitizeOptions$$($mergeDeep$$($defaultOptions$$, $options$jscomp$42$$)) : $defaultOptions$$,
1146
+ constructor(options) {
1147
+ this.options = options ? sanitizeOptions(mergeDeep(defaultOptions, options)) : defaultOptions,
1204
1148
  this.update();
1205
1149
  }
1206
- update($mode$jscomp$15_options$jscomp$43$$) {
1207
- this.container && (this.container.innerHTML = ""), this.options = $mode$jscomp$15_options$jscomp$43$$ ? $sanitizeOptions$$($mergeDeep$$(this.options, $mode$jscomp$15_options$jscomp$43$$)) : this.options,
1150
+ update(mode) {
1151
+ this.container && (this.container.innerHTML = ""), this.options = mode ? sanitizeOptions(mergeDeep(this.options, mode)) : this.options,
1208
1152
  this.options.data && (this.options.stringToBytesFuncs && (Object.assign(QRCodeMinimal.stringToBytesFuncs, this.options.stringToBytesFuncs),
1209
1153
  delete this.options.stringToBytesFuncs), this.qr = new QRCodeMinimal(this.options.qrOptions.typeNumber, this.options.qrOptions.errorCorrectionLevel),
1210
- $mode$jscomp$15_options$jscomp$43$$ = this.options.qrOptions.mode || function($data$jscomp$79$$) {
1154
+ mode = this.options.qrOptions.mode || function(data) {
1211
1155
  switch (!0) {
1212
- case /^[0-9]*$/.test($data$jscomp$79$$):
1156
+ case /^[0-9]*$/.test(data):
1213
1157
  return Mode.numeric;
1214
1158
 
1215
- case /^[0-9A-Z $%*+\-./:]*$/.test($data$jscomp$79$$):
1159
+ case /^[0-9A-Z $%*+\-./:]*$/.test(data):
1216
1160
  return Mode.alphanumeric;
1217
1161
 
1218
- case /[^\u0000-\u00ff]/.test($data$jscomp$79$$):
1162
+ case /[^\u0000-\u00ff]/.test(data):
1219
1163
  return Mode.unicode;
1220
1164
 
1221
1165
  default:
1222
1166
  return Mode.byte;
1223
1167
  }
1224
- }(this.options.data), this.qr.addData(this.options.data, $mode$jscomp$15_options$jscomp$43$$),
1225
- this.qr.make(), this.setupSvg(), this.append(this.container));
1168
+ }(this.options.data), this.qr.addData(this.options.data, mode), this.qr.make(),
1169
+ this.setupSvg(), this.append(this.container));
1226
1170
  }
1227
- append($container$jscomp$1$$) {
1228
- $container$jscomp$1$$ && (this.qrSVG?.element && $container$jscomp$1$$.appendChild(this.qrSVG.element),
1229
- this.container = $container$jscomp$1$$);
1171
+ append(container) {
1172
+ container && (this.qrSVG?.element && container.appendChild(this.qrSVG.element),
1173
+ this.container = container);
1230
1174
  }
1231
- applyExtension($extension$$) {
1232
- if (!$extension$$) throw "Extension function should be defined.";
1233
- this.extension = $extension$$, this.update();
1175
+ applyExtension(extension) {
1176
+ if (!extension) throw "Extension function should be defined.";
1177
+ this.extension = extension, this.update();
1234
1178
  }
1235
1179
  deleteExtension() {
1236
1180
  this.extension = void 0, this.update();
@@ -1242,17 +1186,16 @@ let $QRCodeStyling$1$$ = class {
1242
1186
  }
1243
1187
  setupSvg() {
1244
1188
  if (this.qr) {
1245
- var $count$jscomp$43_moduleCount_size$jscomp$72$$ = this.qr.getModuleCount();
1246
- this.options.imageOptions.mode == $ImageMode$$.background && this.options.shape != $ShapeType$$.circle && ($count$jscomp$43_moduleCount_size$jscomp$72$$ += 2),
1247
- 0 == ($count$jscomp$43_moduleCount_size$jscomp$72$$ = Math.ceil((this.options.shape == $ShapeType$$.circle ? Math.sqrt(2) : 1) * $count$jscomp$43_moduleCount_size$jscomp$72$$)) % 2 && --$count$jscomp$43_moduleCount_size$jscomp$72$$;
1248
- var $margin$jscomp$4$$ = this.options.backgroundOptions && this.options.backgroundOptions.margin || 0;
1249
- this.options.imageOptions.mode == $ImageMode$$.background && ($margin$jscomp$4$$ += this.options.imageOptions.margin || 0),
1250
- $count$jscomp$43_moduleCount_size$jscomp$72$$ = Math.ceil(this.options.dotsOptions.size * ($count$jscomp$43_moduleCount_size$jscomp$72$$ + 2 * $margin$jscomp$4$$)),
1251
- this.qrSVG = new $QRSVG$$({
1189
+ var count = this.qr.getModuleCount();
1190
+ this.options.imageOptions.mode == ImageMode.background && this.options.shape != ShapeType.circle && (count += 2),
1191
+ 0 == (count = Math.ceil((this.options.shape == ShapeType.circle ? Math.sqrt(2) : 1) * count)) % 2 && --count;
1192
+ var margin = this.options.backgroundOptions && this.options.backgroundOptions.margin || 0;
1193
+ this.options.imageOptions.mode == ImageMode.background && (margin += this.options.imageOptions.margin || 0),
1194
+ count = Math.ceil(this.options.dotsOptions.size * (count + 2 * margin)), this.qrSVG = new QRSVG({
1252
1195
  ...this.options,
1253
- width: $count$jscomp$43_moduleCount_size$jscomp$72$$,
1254
- height: $count$jscomp$43_moduleCount_size$jscomp$72$$,
1255
- errorCorrectionPercent: $ErrorCorrectionPercents$$[this.options.qrOptions.errorCorrectionLevel]
1196
+ width: count,
1197
+ height: count,
1198
+ errorCorrectionPercent: ErrorCorrectionPercents[this.options.qrOptions.errorCorrectionLevel]
1256
1199
  }), this.svgDrawingPromise = this.qrSVG.drawQR(this.qr).then((() => {
1257
1200
  this.qrSVG?.element && this.extension?.(this.qrSVG.element, this.options);
1258
1201
  }));
@@ -1260,38 +1203,37 @@ let $QRCodeStyling$1$$ = class {
1260
1203
  }
1261
1204
  };
1262
1205
 
1263
- var $FileExtension$$, $FileExtension$jscomp$inline_12$$ = $FileExtension$$ || ($FileExtension$$ = {});
1206
+ var FileExtension;
1264
1207
 
1265
- $FileExtension$jscomp$inline_12$$.svg = "svg", $FileExtension$jscomp$inline_12$$.png = "png",
1266
- $FileExtension$jscomp$inline_12$$.jpeg = "jpeg", $FileExtension$jscomp$inline_12$$.webp = "webp";
1208
+ (FileExtension = FileExtension || (FileExtension = {})).svg = "svg", FileExtension.png = "png",
1209
+ FileExtension.jpeg = "jpeg", FileExtension.webp = "webp";
1267
1210
 
1268
- class $QRCodeStyling$$ extends $QRCodeStyling$1$$ {
1269
- constructor($options$jscomp$44$$) {
1270
- async function $loadImage$$($buff$jscomp$1_url$jscomp$24$$) {
1271
- if ("string" == typeof $buff$jscomp$1_url$jscomp$24$$) {
1272
- let $pr$$ = $imageCache$$.get($buff$jscomp$1_url$jscomp$24$$);
1273
- return $pr$$ || ($pr$$ = fetch($buff$jscomp$1_url$jscomp$24$$).then(($res$$ => $res$$.arrayBuffer().then(($buff$$ => Buffer.from($buff$$))).then((async $data$jscomp$81$$ => ({
1274
- contentType: $res$$.headers.get("Content-Type") || await fileTypeFromBuffer($data$jscomp$81$$).then(($r$jscomp$1$$ => $r$jscomp$1$$?.mime)),
1275
- data: $data$jscomp$81$$
1276
- }))))), $imageCache$$.set($buff$jscomp$1_url$jscomp$24$$, $pr$$), $pr$$);
1211
+ class QRCodeStyling extends QRCodeStyling$1 {
1212
+ constructor(options) {
1213
+ async function loadImage(buff) {
1214
+ if ("string" == typeof buff) {
1215
+ let pr = imageCache.get(buff);
1216
+ return pr || (pr = fetch(buff).then((res => res.arrayBuffer().then((buff => Buffer.from(buff))).then((async data => ({
1217
+ contentType: res.headers.get("Content-Type") || await fileTypeFromBuffer(data).then((r => r?.mime)),
1218
+ data
1219
+ }))))), imageCache.set(buff, pr), pr);
1277
1220
  }
1278
- return $buff$jscomp$1_url$jscomp$24$$ = Buffer.from($buff$jscomp$1_url$jscomp$24$$),
1279
- {
1280
- contentType: await fileTypeFromBuffer($buff$jscomp$1_url$jscomp$24$$).then(($r$jscomp$2$$ => $r$jscomp$2$$?.mime)),
1281
- data: $buff$jscomp$1_url$jscomp$24$$
1221
+ return buff = Buffer.from(buff), {
1222
+ contentType: await fileTypeFromBuffer(buff).then((r => r?.mime)),
1223
+ data: buff
1282
1224
  };
1283
1225
  }
1284
- let $dom$$ = (new DOMImplementation).createDocument(null, ""), $imageCache$$ = new Map;
1226
+ let dom = (new DOMImplementation).createDocument(null, ""), imageCache = new Map;
1285
1227
  global.XMLSerializer = XMLSerializer$1, global.DOMParser = DOMParser$1, super({
1286
- ...$options$jscomp$44$$,
1287
- document: $options$jscomp$44$$.document || $dom$$,
1288
- imageTools: $options$jscomp$44$$.imageTools || {
1289
- toDataURL: $url$jscomp$25$$ => "string" == typeof $url$jscomp$25$$ && $url$jscomp$25$$.startsWith("data:") ? Promise.resolve($url$jscomp$25$$) : $loadImage$$($url$jscomp$25$$).then((({contentType: $contentType$jscomp$4$$, data: $data$jscomp$82$$}) => `data:${$contentType$jscomp$4$$?.replace("application/xml", "image/svg+xml")};base64,${$data$jscomp$82$$.toString("base64")}`)),
1290
- getSize: async $data$jscomp$83_meta_src$jscomp$5$$ => (({data: $data$jscomp$83_meta_src$jscomp$5$$} = Buffer.isBuffer($options$jscomp$44$$.image) ? {
1291
- data: $options$jscomp$44$$.image
1292
- } : await $loadImage$$($data$jscomp$83_meta_src$jscomp$5$$)), {
1293
- width: ($data$jscomp$83_meta_src$jscomp$5$$ = await sharp($data$jscomp$83_meta_src$jscomp$5$$).metadata()).width,
1294
- height: $data$jscomp$83_meta_src$jscomp$5$$.height
1228
+ ...options,
1229
+ document: options.document || dom,
1230
+ imageTools: options.imageTools || {
1231
+ toDataURL: url => "string" == typeof url && url.startsWith("data:") ? Promise.resolve(url) : loadImage(url).then((({contentType, data}) => `data:${contentType?.replace("application/xml", "image/svg+xml")};base64,${data.toString("base64")}`)),
1232
+ getSize: async data => (({data} = Buffer.isBuffer(options.image) ? {
1233
+ data: options.image
1234
+ } : await loadImage(data)), {
1235
+ width: (data = await sharp(data).metadata()).width,
1236
+ height: data.height
1295
1237
  })
1296
1238
  }
1297
1239
  });
@@ -1300,5 +1242,5 @@ class $QRCodeStyling$$ extends $QRCodeStyling$1$$ {
1300
1242
 
1301
1243
  var browserUtils = void 0;
1302
1244
 
1303
- export { $CornerDotType$$ as CornerDotType, $CornerSquareType$$ as CornerSquareType, $DotType$$ as DotType, $ErrorCorrectionPercents$$ as ErrorCorrectionPercents, $FileExtension$$ as FileExtension, $GradientType$$ as GradientType, $ImageMode$$ as ImageMode, $QRCodeStyling$$ as QRCodeStyling, $ShapeType$$ as ShapeType, browserUtils };
1245
+ export { CornerDotType, CornerSquareType, DotType, ErrorCorrectionPercents, FileExtension, GradientType, ImageMode, QRCodeStyling, ShapeType, browserUtils };
1304
1246
  //# sourceMappingURL=qr-code-styling-node.js.map