@emailmaker/filemanager 0.10.81 → 0.10.83

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.
Files changed (496) hide show
  1. package/129.533eb7b36d92578d2ead.js +3893 -0
  2. package/583.177f1aa2edb14f5f073e.js +2978 -0
  3. package/assets/image-editor/images/samples/sample4.json +871 -871
  4. package/assets/image-editor/images/stickers/beach/0.svg +25 -25
  5. package/assets/image-editor/images/stickers/beach/1.svg +14 -14
  6. package/assets/image-editor/images/stickers/beach/10.svg +34 -34
  7. package/assets/image-editor/images/stickers/beach/11.svg +27 -27
  8. package/assets/image-editor/images/stickers/beach/12.svg +10 -10
  9. package/assets/image-editor/images/stickers/beach/13.svg +25 -25
  10. package/assets/image-editor/images/stickers/beach/14.svg +16 -16
  11. package/assets/image-editor/images/stickers/beach/15.svg +14 -14
  12. package/assets/image-editor/images/stickers/beach/16.svg +44 -44
  13. package/assets/image-editor/images/stickers/beach/17.svg +35 -35
  14. package/assets/image-editor/images/stickers/beach/18.svg +32 -32
  15. package/assets/image-editor/images/stickers/beach/19.svg +23 -23
  16. package/assets/image-editor/images/stickers/beach/2.svg +14 -14
  17. package/assets/image-editor/images/stickers/beach/20.svg +24 -24
  18. package/assets/image-editor/images/stickers/beach/21.svg +11 -11
  19. package/assets/image-editor/images/stickers/beach/3.svg +26 -26
  20. package/assets/image-editor/images/stickers/beach/4.svg +25 -25
  21. package/assets/image-editor/images/stickers/beach/5.svg +22 -22
  22. package/assets/image-editor/images/stickers/beach/6.svg +20 -20
  23. package/assets/image-editor/images/stickers/beach/7.svg +32 -32
  24. package/assets/image-editor/images/stickers/beach/8.svg +28 -28
  25. package/assets/image-editor/images/stickers/beach/9.svg +18 -18
  26. package/assets/image-editor/images/stickers/categories/beach.svg +17 -17
  27. package/assets/image-editor/images/stickers/categories/clouds.svg +14 -14
  28. package/assets/image-editor/images/stickers/categories/doodles.svg +12 -12
  29. package/assets/image-editor/images/stickers/categories/emoticon.svg +9 -9
  30. package/assets/image-editor/images/stickers/categories/landmark.svg +19 -19
  31. package/assets/image-editor/images/stickers/categories/speech-bubble.svg +5 -5
  32. package/assets/image-editor/images/stickers/categories/star.svg +5 -5
  33. package/assets/image-editor/images/stickers/categories/transportation.svg +17 -17
  34. package/assets/image-editor/images/stickers/doodles/0.svg +201 -201
  35. package/assets/image-editor/images/stickers/doodles/1.svg +255 -255
  36. package/assets/image-editor/images/stickers/doodles/10.svg +160 -160
  37. package/assets/image-editor/images/stickers/doodles/11.svg +393 -393
  38. package/assets/image-editor/images/stickers/doodles/12.svg +293 -293
  39. package/assets/image-editor/images/stickers/doodles/13.svg +251 -251
  40. package/assets/image-editor/images/stickers/doodles/14.svg +370 -370
  41. package/assets/image-editor/images/stickers/doodles/15.svg +194 -194
  42. package/assets/image-editor/images/stickers/doodles/16.svg +383 -383
  43. package/assets/image-editor/images/stickers/doodles/17.svg +346 -346
  44. package/assets/image-editor/images/stickers/doodles/18.svg +286 -286
  45. package/assets/image-editor/images/stickers/doodles/19.svg +241 -241
  46. package/assets/image-editor/images/stickers/doodles/2.svg +227 -227
  47. package/assets/image-editor/images/stickers/doodles/20.svg +330 -330
  48. package/assets/image-editor/images/stickers/doodles/21.svg +200 -200
  49. package/assets/image-editor/images/stickers/doodles/22.svg +308 -308
  50. package/assets/image-editor/images/stickers/doodles/23.svg +518 -518
  51. package/assets/image-editor/images/stickers/doodles/24.svg +207 -207
  52. package/assets/image-editor/images/stickers/doodles/25.svg +260 -260
  53. package/assets/image-editor/images/stickers/doodles/26.svg +380 -380
  54. package/assets/image-editor/images/stickers/doodles/27.svg +222 -222
  55. package/assets/image-editor/images/stickers/doodles/28.svg +164 -164
  56. package/assets/image-editor/images/stickers/doodles/29.svg +271 -271
  57. package/assets/image-editor/images/stickers/doodles/3.svg +272 -272
  58. package/assets/image-editor/images/stickers/doodles/30.svg +283 -283
  59. package/assets/image-editor/images/stickers/doodles/31.svg +257 -257
  60. package/assets/image-editor/images/stickers/doodles/32.svg +276 -276
  61. package/assets/image-editor/images/stickers/doodles/33.svg +198 -198
  62. package/assets/image-editor/images/stickers/doodles/34.svg +314 -314
  63. package/assets/image-editor/images/stickers/doodles/35.svg +236 -236
  64. package/assets/image-editor/images/stickers/doodles/36.svg +273 -273
  65. package/assets/image-editor/images/stickers/doodles/37.svg +284 -284
  66. package/assets/image-editor/images/stickers/doodles/38.svg +167 -167
  67. package/assets/image-editor/images/stickers/doodles/39.svg +381 -381
  68. package/assets/image-editor/images/stickers/doodles/4.svg +216 -216
  69. package/assets/image-editor/images/stickers/doodles/40.svg +198 -198
  70. package/assets/image-editor/images/stickers/doodles/41.svg +259 -259
  71. package/assets/image-editor/images/stickers/doodles/42.svg +371 -371
  72. package/assets/image-editor/images/stickers/doodles/43.svg +198 -198
  73. package/assets/image-editor/images/stickers/doodles/44.svg +174 -174
  74. package/assets/image-editor/images/stickers/doodles/45.svg +178 -178
  75. package/assets/image-editor/images/stickers/doodles/46.svg +211 -211
  76. package/assets/image-editor/images/stickers/doodles/47.svg +195 -195
  77. package/assets/image-editor/images/stickers/doodles/48.svg +293 -293
  78. package/assets/image-editor/images/stickers/doodles/49.svg +191 -191
  79. package/assets/image-editor/images/stickers/doodles/5.svg +179 -179
  80. package/assets/image-editor/images/stickers/doodles/50.svg +323 -323
  81. package/assets/image-editor/images/stickers/doodles/51.svg +308 -308
  82. package/assets/image-editor/images/stickers/doodles/52.svg +162 -162
  83. package/assets/image-editor/images/stickers/doodles/53.svg +263 -263
  84. package/assets/image-editor/images/stickers/doodles/54.svg +175 -175
  85. package/assets/image-editor/images/stickers/doodles/55.svg +177 -177
  86. package/assets/image-editor/images/stickers/doodles/56.svg +160 -160
  87. package/assets/image-editor/images/stickers/doodles/57.svg +115 -115
  88. package/assets/image-editor/images/stickers/doodles/58.svg +327 -327
  89. package/assets/image-editor/images/stickers/doodles/59.svg +197 -197
  90. package/assets/image-editor/images/stickers/doodles/6.svg +388 -388
  91. package/assets/image-editor/images/stickers/doodles/60.svg +414 -414
  92. package/assets/image-editor/images/stickers/doodles/61.svg +287 -287
  93. package/assets/image-editor/images/stickers/doodles/62.svg +193 -193
  94. package/assets/image-editor/images/stickers/doodles/63.svg +329 -329
  95. package/assets/image-editor/images/stickers/doodles/64.svg +150 -150
  96. package/assets/image-editor/images/stickers/doodles/65.svg +275 -275
  97. package/assets/image-editor/images/stickers/doodles/66.svg +174 -174
  98. package/assets/image-editor/images/stickers/doodles/67.svg +343 -343
  99. package/assets/image-editor/images/stickers/doodles/68.svg +242 -242
  100. package/assets/image-editor/images/stickers/doodles/69.svg +160 -160
  101. package/assets/image-editor/images/stickers/doodles/7.svg +194 -194
  102. package/assets/image-editor/images/stickers/doodles/70.svg +365 -365
  103. package/assets/image-editor/images/stickers/doodles/71.svg +454 -454
  104. package/assets/image-editor/images/stickers/doodles/72.svg +162 -162
  105. package/assets/image-editor/images/stickers/doodles/73.svg +393 -393
  106. package/assets/image-editor/images/stickers/doodles/74.svg +206 -206
  107. package/assets/image-editor/images/stickers/doodles/75.svg +275 -275
  108. package/assets/image-editor/images/stickers/doodles/76.svg +350 -350
  109. package/assets/image-editor/images/stickers/doodles/77.svg +323 -323
  110. package/assets/image-editor/images/stickers/doodles/78.svg +316 -316
  111. package/assets/image-editor/images/stickers/doodles/79.svg +503 -503
  112. package/assets/image-editor/images/stickers/doodles/8.svg +185 -185
  113. package/assets/image-editor/images/stickers/doodles/80.svg +235 -235
  114. package/assets/image-editor/images/stickers/doodles/81.svg +184 -184
  115. package/assets/image-editor/images/stickers/doodles/82.svg +246 -246
  116. package/assets/image-editor/images/stickers/doodles/83.svg +125 -125
  117. package/assets/image-editor/images/stickers/doodles/84.svg +168 -168
  118. package/assets/image-editor/images/stickers/doodles/85.svg +138 -138
  119. package/assets/image-editor/images/stickers/doodles/86.svg +223 -223
  120. package/assets/image-editor/images/stickers/doodles/87.svg +475 -475
  121. package/assets/image-editor/images/stickers/doodles/88.svg +172 -172
  122. package/assets/image-editor/images/stickers/doodles/89.svg +199 -199
  123. package/assets/image-editor/images/stickers/doodles/9.svg +368 -368
  124. package/assets/image-editor/images/stickers/doodles/90.svg +298 -298
  125. package/assets/image-editor/images/stickers/doodles/91.svg +176 -176
  126. package/assets/image-editor/images/stickers/doodles/92.svg +152 -152
  127. package/assets/image-editor/images/stickers/doodles/93.svg +206 -206
  128. package/assets/image-editor/images/stickers/doodles/94.svg +202 -202
  129. package/assets/image-editor/images/stickers/doodles/95.svg +114 -114
  130. package/assets/image-editor/images/stickers/doodles/96.svg +149 -149
  131. package/assets/image-editor/images/stickers/doodles/97.svg +197 -197
  132. package/assets/image-editor/images/stickers/doodles/98.svg +397 -397
  133. package/assets/image-editor/images/stickers/doodles/99.svg +502 -502
  134. package/assets/image-editor/images/stickers/emoticons/afro-1.svg +122 -122
  135. package/assets/image-editor/images/stickers/emoticons/afro.svg +85 -85
  136. package/assets/image-editor/images/stickers/emoticons/agent.svg +114 -114
  137. package/assets/image-editor/images/stickers/emoticons/alien-1.svg +60 -60
  138. package/assets/image-editor/images/stickers/emoticons/alien.svg +64 -64
  139. package/assets/image-editor/images/stickers/emoticons/angel.svg +47 -47
  140. package/assets/image-editor/images/stickers/emoticons/angry-1.svg +83 -83
  141. package/assets/image-editor/images/stickers/emoticons/angry-2.svg +48 -48
  142. package/assets/image-editor/images/stickers/emoticons/angry-3.svg +45 -45
  143. package/assets/image-editor/images/stickers/emoticons/angry-4.svg +52 -52
  144. package/assets/image-editor/images/stickers/emoticons/angry-5.svg +62 -62
  145. package/assets/image-editor/images/stickers/emoticons/angry.svg +78 -78
  146. package/assets/image-editor/images/stickers/emoticons/arguing.svg +49 -49
  147. package/assets/image-editor/images/stickers/emoticons/arrogant.svg +98 -98
  148. package/assets/image-editor/images/stickers/emoticons/asian-1.svg +52 -52
  149. package/assets/image-editor/images/stickers/emoticons/asian.svg +54 -54
  150. package/assets/image-editor/images/stickers/emoticons/avatar.svg +49 -49
  151. package/assets/image-editor/images/stickers/emoticons/baby-1.svg +51 -51
  152. package/assets/image-editor/images/stickers/emoticons/baby-2.svg +54 -54
  153. package/assets/image-editor/images/stickers/emoticons/baby.svg +66 -66
  154. package/assets/image-editor/images/stickers/emoticons/bully.svg +68 -68
  155. package/assets/image-editor/images/stickers/emoticons/burglar.svg +75 -75
  156. package/assets/image-editor/images/stickers/emoticons/businessman.svg +52 -52
  157. package/assets/image-editor/images/stickers/emoticons/cheeky-1.svg +83 -83
  158. package/assets/image-editor/images/stickers/emoticons/cheeky.svg +73 -73
  159. package/assets/image-editor/images/stickers/emoticons/clown.svg +75 -75
  160. package/assets/image-editor/images/stickers/emoticons/confused-1.svg +74 -74
  161. package/assets/image-editor/images/stickers/emoticons/confused-2.svg +55 -55
  162. package/assets/image-editor/images/stickers/emoticons/confused-3.svg +45 -45
  163. package/assets/image-editor/images/stickers/emoticons/confused.svg +66 -66
  164. package/assets/image-editor/images/stickers/emoticons/creepy.svg +60 -60
  165. package/assets/image-editor/images/stickers/emoticons/crying-1.svg +55 -55
  166. package/assets/image-editor/images/stickers/emoticons/crying-2.svg +83 -83
  167. package/assets/image-editor/images/stickers/emoticons/crying-3.svg +53 -53
  168. package/assets/image-editor/images/stickers/emoticons/crying.svg +59 -59
  169. package/assets/image-editor/images/stickers/emoticons/dazed-1.svg +63 -63
  170. package/assets/image-editor/images/stickers/emoticons/dazed-2.svg +51 -51
  171. package/assets/image-editor/images/stickers/emoticons/dazed-3.svg +55 -55
  172. package/assets/image-editor/images/stickers/emoticons/dazed.svg +56 -56
  173. package/assets/image-editor/images/stickers/emoticons/dead-1.svg +61 -61
  174. package/assets/image-editor/images/stickers/emoticons/dead-2.svg +80 -80
  175. package/assets/image-editor/images/stickers/emoticons/dead-3.svg +66 -66
  176. package/assets/image-editor/images/stickers/emoticons/dead-4.svg +54 -54
  177. package/assets/image-editor/images/stickers/emoticons/dead-5.svg +52 -52
  178. package/assets/image-editor/images/stickers/emoticons/dead-6.svg +53 -53
  179. package/assets/image-editor/images/stickers/emoticons/dead.svg +54 -54
  180. package/assets/image-editor/images/stickers/emoticons/desperate-1.svg +47 -47
  181. package/assets/image-editor/images/stickers/emoticons/desperate.svg +75 -75
  182. package/assets/image-editor/images/stickers/emoticons/detective.svg +75 -75
  183. package/assets/image-editor/images/stickers/emoticons/dissapointment.svg +70 -70
  184. package/assets/image-editor/images/stickers/emoticons/doctor.svg +61 -61
  185. package/assets/image-editor/images/stickers/emoticons/drunk.svg +55 -55
  186. package/assets/image-editor/images/stickers/emoticons/dumb.svg +50 -50
  187. package/assets/image-editor/images/stickers/emoticons/emo-1.svg +104 -104
  188. package/assets/image-editor/images/stickers/emoticons/emo-2.svg +111 -111
  189. package/assets/image-editor/images/stickers/emoticons/emo.svg +56 -56
  190. package/assets/image-editor/images/stickers/emoticons/emoticon.svg +84 -84
  191. package/assets/image-editor/images/stickers/emoticons/evil.svg +59 -59
  192. package/assets/image-editor/images/stickers/emoticons/faint-1.svg +75 -75
  193. package/assets/image-editor/images/stickers/emoticons/faint.svg +84 -84
  194. package/assets/image-editor/images/stickers/emoticons/flirt-1.svg +81 -81
  195. package/assets/image-editor/images/stickers/emoticons/flirt-2.svg +68 -68
  196. package/assets/image-editor/images/stickers/emoticons/flirt.svg +71 -71
  197. package/assets/image-editor/images/stickers/emoticons/flirty.svg +60 -60
  198. package/assets/image-editor/images/stickers/emoticons/gangster.svg +54 -54
  199. package/assets/image-editor/images/stickers/emoticons/geek-1.svg +76 -76
  200. package/assets/image-editor/images/stickers/emoticons/geek.svg +69 -69
  201. package/assets/image-editor/images/stickers/emoticons/gentleman-1.svg +82 -82
  202. package/assets/image-editor/images/stickers/emoticons/gentleman-2.svg +58 -58
  203. package/assets/image-editor/images/stickers/emoticons/gentleman-3.svg +54 -54
  204. package/assets/image-editor/images/stickers/emoticons/gentleman-4.svg +59 -59
  205. package/assets/image-editor/images/stickers/emoticons/gentleman.svg +57 -57
  206. package/assets/image-editor/images/stickers/emoticons/ginger.svg +55 -55
  207. package/assets/image-editor/images/stickers/emoticons/girl-1.svg +70 -70
  208. package/assets/image-editor/images/stickers/emoticons/girl.svg +73 -73
  209. package/assets/image-editor/images/stickers/emoticons/goofy-1.svg +46 -46
  210. package/assets/image-editor/images/stickers/emoticons/goofy-2.svg +79 -79
  211. package/assets/image-editor/images/stickers/emoticons/goofy-3.svg +79 -79
  212. package/assets/image-editor/images/stickers/emoticons/goofy-4.svg +46 -46
  213. package/assets/image-editor/images/stickers/emoticons/goofy.svg +79 -79
  214. package/assets/image-editor/images/stickers/emoticons/grubby-1.svg +114 -114
  215. package/assets/image-editor/images/stickers/emoticons/grubby.svg +165 -165
  216. package/assets/image-editor/images/stickers/emoticons/happy-1.svg +49 -49
  217. package/assets/image-editor/images/stickers/emoticons/happy-10.svg +62 -62
  218. package/assets/image-editor/images/stickers/emoticons/happy-11.svg +55 -55
  219. package/assets/image-editor/images/stickers/emoticons/happy-12.svg +53 -53
  220. package/assets/image-editor/images/stickers/emoticons/happy-13.svg +58 -58
  221. package/assets/image-editor/images/stickers/emoticons/happy-14.svg +62 -62
  222. package/assets/image-editor/images/stickers/emoticons/happy-15.svg +49 -49
  223. package/assets/image-editor/images/stickers/emoticons/happy-16.svg +49 -49
  224. package/assets/image-editor/images/stickers/emoticons/happy-2.svg +71 -71
  225. package/assets/image-editor/images/stickers/emoticons/happy-3.svg +74 -74
  226. package/assets/image-editor/images/stickers/emoticons/happy-4.svg +77 -77
  227. package/assets/image-editor/images/stickers/emoticons/happy-5.svg +52 -52
  228. package/assets/image-editor/images/stickers/emoticons/happy-6.svg +54 -54
  229. package/assets/image-editor/images/stickers/emoticons/happy-7.svg +58 -58
  230. package/assets/image-editor/images/stickers/emoticons/happy-8.svg +42 -42
  231. package/assets/image-editor/images/stickers/emoticons/happy-9.svg +45 -45
  232. package/assets/image-editor/images/stickers/emoticons/happy.svg +48 -48
  233. package/assets/image-editor/images/stickers/emoticons/harry-potter.svg +68 -68
  234. package/assets/image-editor/images/stickers/emoticons/heisenberg.svg +80 -80
  235. package/assets/image-editor/images/stickers/emoticons/hipster-1.svg +118 -118
  236. package/assets/image-editor/images/stickers/emoticons/hipster-2.svg +49 -49
  237. package/assets/image-editor/images/stickers/emoticons/hipster.svg +48 -48
  238. package/assets/image-editor/images/stickers/emoticons/in-love-1.svg +62 -62
  239. package/assets/image-editor/images/stickers/emoticons/in-love-2.svg +48 -48
  240. package/assets/image-editor/images/stickers/emoticons/in-love-3.svg +49 -49
  241. package/assets/image-editor/images/stickers/emoticons/in-love-4.svg +50 -50
  242. package/assets/image-editor/images/stickers/emoticons/in-love-5.svg +49 -49
  243. package/assets/image-editor/images/stickers/emoticons/in-love-6.svg +53 -53
  244. package/assets/image-editor/images/stickers/emoticons/in-love.svg +57 -57
  245. package/assets/image-editor/images/stickers/emoticons/japan.svg +79 -79
  246. package/assets/image-editor/images/stickers/emoticons/jew.svg +83 -83
  247. package/assets/image-editor/images/stickers/emoticons/joyful-1.svg +72 -72
  248. package/assets/image-editor/images/stickers/emoticons/joyful-2.svg +45 -45
  249. package/assets/image-editor/images/stickers/emoticons/joyful.svg +47 -47
  250. package/assets/image-editor/images/stickers/emoticons/kiss-1.svg +48 -48
  251. package/assets/image-editor/images/stickers/emoticons/kiss-2.svg +59 -59
  252. package/assets/image-editor/images/stickers/emoticons/kiss-3.svg +53 -53
  253. package/assets/image-editor/images/stickers/emoticons/kiss-4.svg +59 -59
  254. package/assets/image-editor/images/stickers/emoticons/kiss.svg +67 -67
  255. package/assets/image-editor/images/stickers/emoticons/laughing-1.svg +54 -54
  256. package/assets/image-editor/images/stickers/emoticons/laughing-2.svg +57 -57
  257. package/assets/image-editor/images/stickers/emoticons/laughing-3.svg +55 -55
  258. package/assets/image-editor/images/stickers/emoticons/laughing.svg +56 -56
  259. package/assets/image-editor/images/stickers/emoticons/listening.svg +55 -55
  260. package/assets/image-editor/images/stickers/emoticons/love.svg +74 -74
  261. package/assets/image-editor/images/stickers/emoticons/manly.svg +75 -75
  262. package/assets/image-editor/images/stickers/emoticons/miserly-1.svg +90 -90
  263. package/assets/image-editor/images/stickers/emoticons/miserly.svg +82 -82
  264. package/assets/image-editor/images/stickers/emoticons/nerd-1.svg +88 -88
  265. package/assets/image-editor/images/stickers/emoticons/nerd-2.svg +73 -73
  266. package/assets/image-editor/images/stickers/emoticons/nerd-3.svg +60 -60
  267. package/assets/image-editor/images/stickers/emoticons/nerd-4.svg +70 -70
  268. package/assets/image-editor/images/stickers/emoticons/nerd.svg +88 -88
  269. package/assets/image-editor/images/stickers/emoticons/ninja.svg +51 -51
  270. package/assets/image-editor/images/stickers/emoticons/pirate-1.svg +92 -92
  271. package/assets/image-editor/images/stickers/emoticons/pirate-2.svg +48 -48
  272. package/assets/image-editor/images/stickers/emoticons/pirate.svg +286 -286
  273. package/assets/image-editor/images/stickers/emoticons/punk-1.svg +134 -134
  274. package/assets/image-editor/images/stickers/emoticons/punk-2.svg +153 -153
  275. package/assets/image-editor/images/stickers/emoticons/punk.svg +82 -82
  276. package/assets/image-editor/images/stickers/emoticons/rapper.svg +51 -51
  277. package/assets/image-editor/images/stickers/emoticons/relieved.svg +56 -56
  278. package/assets/image-editor/images/stickers/emoticons/rich-1.svg +59 -59
  279. package/assets/image-editor/images/stickers/emoticons/rich-2.svg +93 -93
  280. package/assets/image-editor/images/stickers/emoticons/rich.svg +88 -88
  281. package/assets/image-editor/images/stickers/emoticons/rockstar.svg +177 -177
  282. package/assets/image-editor/images/stickers/emoticons/sad-1.svg +43 -43
  283. package/assets/image-editor/images/stickers/emoticons/sad-2.svg +49 -49
  284. package/assets/image-editor/images/stickers/emoticons/sad-3.svg +49 -49
  285. package/assets/image-editor/images/stickers/emoticons/sad-4.svg +49 -49
  286. package/assets/image-editor/images/stickers/emoticons/sad-5.svg +45 -45
  287. package/assets/image-editor/images/stickers/emoticons/sad-6.svg +47 -47
  288. package/assets/image-editor/images/stickers/emoticons/sad.svg +47 -47
  289. package/assets/image-editor/images/stickers/emoticons/scared-1.svg +79 -79
  290. package/assets/image-editor/images/stickers/emoticons/scared-2.svg +59 -59
  291. package/assets/image-editor/images/stickers/emoticons/scared-3.svg +52 -52
  292. package/assets/image-editor/images/stickers/emoticons/scared.svg +45 -45
  293. package/assets/image-editor/images/stickers/emoticons/sceptic-1.svg +59 -59
  294. package/assets/image-editor/images/stickers/emoticons/sceptic-2.svg +80 -80
  295. package/assets/image-editor/images/stickers/emoticons/sceptic-3.svg +59 -59
  296. package/assets/image-editor/images/stickers/emoticons/sceptic-4.svg +46 -46
  297. package/assets/image-editor/images/stickers/emoticons/sceptic-5.svg +43 -43
  298. package/assets/image-editor/images/stickers/emoticons/sceptic-6.svg +42 -42
  299. package/assets/image-editor/images/stickers/emoticons/sceptic-7.svg +50 -50
  300. package/assets/image-editor/images/stickers/emoticons/sceptic.svg +44 -44
  301. package/assets/image-editor/images/stickers/emoticons/secret.svg +48 -48
  302. package/assets/image-editor/images/stickers/emoticons/shocked-1.svg +67 -67
  303. package/assets/image-editor/images/stickers/emoticons/shocked-2.svg +44 -44
  304. package/assets/image-editor/images/stickers/emoticons/shocked-3.svg +48 -48
  305. package/assets/image-editor/images/stickers/emoticons/shocked.svg +46 -46
  306. package/assets/image-editor/images/stickers/emoticons/sick-1.svg +55 -55
  307. package/assets/image-editor/images/stickers/emoticons/sick-2.svg +48 -48
  308. package/assets/image-editor/images/stickers/emoticons/sick-3.svg +49 -49
  309. package/assets/image-editor/images/stickers/emoticons/sick-4.svg +52 -52
  310. package/assets/image-editor/images/stickers/emoticons/sick.svg +52 -52
  311. package/assets/image-editor/images/stickers/emoticons/silent.svg +43 -43
  312. package/assets/image-editor/images/stickers/emoticons/skeleton.svg +64 -64
  313. package/assets/image-editor/images/stickers/emoticons/smile.svg +43 -43
  314. package/assets/image-editor/images/stickers/emoticons/smiling-1.svg +47 -47
  315. package/assets/image-editor/images/stickers/emoticons/smiling.svg +75 -75
  316. package/assets/image-editor/images/stickers/emoticons/smoked.svg +131 -131
  317. package/assets/image-editor/images/stickers/emoticons/smug-1.svg +74 -74
  318. package/assets/image-editor/images/stickers/emoticons/smug-2.svg +82 -82
  319. package/assets/image-editor/images/stickers/emoticons/smug-3.svg +71 -71
  320. package/assets/image-editor/images/stickers/emoticons/smug-4.svg +50 -50
  321. package/assets/image-editor/images/stickers/emoticons/smug-5.svg +64 -64
  322. package/assets/image-editor/images/stickers/emoticons/smug-6.svg +82 -82
  323. package/assets/image-editor/images/stickers/emoticons/smug.svg +96 -96
  324. package/assets/image-editor/images/stickers/emoticons/sporty.svg +68 -68
  325. package/assets/image-editor/images/stickers/emoticons/stunned.svg +72 -72
  326. package/assets/image-editor/images/stickers/emoticons/superhero-1.svg +60 -60
  327. package/assets/image-editor/images/stickers/emoticons/superhero-2.svg +47 -47
  328. package/assets/image-editor/images/stickers/emoticons/superhero-3.svg +48 -48
  329. package/assets/image-editor/images/stickers/emoticons/superhero-4.svg +52 -52
  330. package/assets/image-editor/images/stickers/emoticons/superhero.svg +45 -45
  331. package/assets/image-editor/images/stickers/emoticons/surprised-1.svg +47 -47
  332. package/assets/image-editor/images/stickers/emoticons/surprised.svg +58 -58
  333. package/assets/image-editor/images/stickers/emoticons/thinking.svg +43 -43
  334. package/assets/image-editor/images/stickers/emoticons/tired-1.svg +78 -78
  335. package/assets/image-editor/images/stickers/emoticons/tired-2.svg +65 -65
  336. package/assets/image-editor/images/stickers/emoticons/tired-3.svg +59 -59
  337. package/assets/image-editor/images/stickers/emoticons/tired.svg +83 -83
  338. package/assets/image-editor/images/stickers/emoticons/tough-1.svg +65 -65
  339. package/assets/image-editor/images/stickers/emoticons/tough.svg +158 -158
  340. package/assets/image-editor/images/stickers/emoticons/trendy.svg +57 -57
  341. package/assets/image-editor/images/stickers/emoticons/vampire-1.svg +56 -56
  342. package/assets/image-editor/images/stickers/emoticons/vampire.svg +59 -59
  343. package/assets/image-editor/images/stickers/emoticons/wink-1.svg +54 -54
  344. package/assets/image-editor/images/stickers/emoticons/wink-2.svg +64 -64
  345. package/assets/image-editor/images/stickers/emoticons/wink.svg +73 -73
  346. package/assets/image-editor/images/stickers/emoticons/winking-1.svg +52 -52
  347. package/assets/image-editor/images/stickers/emoticons/winking.svg +43 -43
  348. package/assets/image-editor/images/stickers/emoticons/yawning-1.svg +62 -62
  349. package/assets/image-editor/images/stickers/emoticons/yawning-2.svg +51 -51
  350. package/assets/image-editor/images/stickers/emoticons/yawning-3.svg +51 -51
  351. package/assets/image-editor/images/stickers/emoticons/yawning.svg +73 -73
  352. package/assets/image-editor/images/stickers/emoticons/yelling.svg +80 -80
  353. package/assets/image-editor/images/stickers/emoticons/zombie.svg +65 -65
  354. package/assets/image-editor/images/stickers/landmarks/0.svg +38 -38
  355. package/assets/image-editor/images/stickers/landmarks/1.svg +46 -46
  356. package/assets/image-editor/images/stickers/landmarks/10.svg +18 -18
  357. package/assets/image-editor/images/stickers/landmarks/11.svg +81 -81
  358. package/assets/image-editor/images/stickers/landmarks/12.svg +77 -77
  359. package/assets/image-editor/images/stickers/landmarks/13.svg +42 -42
  360. package/assets/image-editor/images/stickers/landmarks/14.svg +78 -78
  361. package/assets/image-editor/images/stickers/landmarks/15.svg +84 -84
  362. package/assets/image-editor/images/stickers/landmarks/16.svg +87 -87
  363. package/assets/image-editor/images/stickers/landmarks/17.svg +60 -60
  364. package/assets/image-editor/images/stickers/landmarks/18.svg +30 -30
  365. package/assets/image-editor/images/stickers/landmarks/19.svg +36 -36
  366. package/assets/image-editor/images/stickers/landmarks/2.svg +28 -28
  367. package/assets/image-editor/images/stickers/landmarks/20.svg +137 -137
  368. package/assets/image-editor/images/stickers/landmarks/21.svg +63 -63
  369. package/assets/image-editor/images/stickers/landmarks/22.svg +26 -26
  370. package/assets/image-editor/images/stickers/landmarks/23.svg +52 -52
  371. package/assets/image-editor/images/stickers/landmarks/24.svg +56 -56
  372. package/assets/image-editor/images/stickers/landmarks/25.svg +40 -40
  373. package/assets/image-editor/images/stickers/landmarks/26.svg +34 -34
  374. package/assets/image-editor/images/stickers/landmarks/27.svg +32 -32
  375. package/assets/image-editor/images/stickers/landmarks/28.svg +19 -19
  376. package/assets/image-editor/images/stickers/landmarks/29.svg +23 -23
  377. package/assets/image-editor/images/stickers/landmarks/3.svg +36 -36
  378. package/assets/image-editor/images/stickers/landmarks/30.svg +36 -36
  379. package/assets/image-editor/images/stickers/landmarks/31.svg +27 -27
  380. package/assets/image-editor/images/stickers/landmarks/32.svg +25 -25
  381. package/assets/image-editor/images/stickers/landmarks/33.svg +29 -29
  382. package/assets/image-editor/images/stickers/landmarks/34.svg +72 -72
  383. package/assets/image-editor/images/stickers/landmarks/35.svg +18 -18
  384. package/assets/image-editor/images/stickers/landmarks/36.svg +45 -45
  385. package/assets/image-editor/images/stickers/landmarks/37.svg +46 -46
  386. package/assets/image-editor/images/stickers/landmarks/38.svg +44 -44
  387. package/assets/image-editor/images/stickers/landmarks/39.svg +23 -23
  388. package/assets/image-editor/images/stickers/landmarks/4.svg +33 -33
  389. package/assets/image-editor/images/stickers/landmarks/40.svg +25 -25
  390. package/assets/image-editor/images/stickers/landmarks/41.svg +69 -69
  391. package/assets/image-editor/images/stickers/landmarks/42.svg +75 -75
  392. package/assets/image-editor/images/stickers/landmarks/43.svg +44 -44
  393. package/assets/image-editor/images/stickers/landmarks/44.svg +65 -65
  394. package/assets/image-editor/images/stickers/landmarks/45.svg +19 -19
  395. package/assets/image-editor/images/stickers/landmarks/46.svg +47 -47
  396. package/assets/image-editor/images/stickers/landmarks/47.svg +544 -544
  397. package/assets/image-editor/images/stickers/landmarks/48.svg +162 -162
  398. package/assets/image-editor/images/stickers/landmarks/49.svg +70 -70
  399. package/assets/image-editor/images/stickers/landmarks/5.svg +36 -36
  400. package/assets/image-editor/images/stickers/landmarks/50.svg +52 -52
  401. package/assets/image-editor/images/stickers/landmarks/51.svg +110 -110
  402. package/assets/image-editor/images/stickers/landmarks/52.svg +41 -41
  403. package/assets/image-editor/images/stickers/landmarks/53.svg +74 -74
  404. package/assets/image-editor/images/stickers/landmarks/54.svg +36 -36
  405. package/assets/image-editor/images/stickers/landmarks/55.svg +84 -84
  406. package/assets/image-editor/images/stickers/landmarks/56.svg +93 -93
  407. package/assets/image-editor/images/stickers/landmarks/57.svg +67 -67
  408. package/assets/image-editor/images/stickers/landmarks/58.svg +101 -101
  409. package/assets/image-editor/images/stickers/landmarks/59.svg +47 -47
  410. package/assets/image-editor/images/stickers/landmarks/6.svg +59 -59
  411. package/assets/image-editor/images/stickers/landmarks/60.svg +134 -134
  412. package/assets/image-editor/images/stickers/landmarks/61.svg +79 -79
  413. package/assets/image-editor/images/stickers/landmarks/62.svg +43 -43
  414. package/assets/image-editor/images/stickers/landmarks/63.svg +83 -83
  415. package/assets/image-editor/images/stickers/landmarks/64.svg +99 -99
  416. package/assets/image-editor/images/stickers/landmarks/65.svg +79 -79
  417. package/assets/image-editor/images/stickers/landmarks/66.svg +37 -37
  418. package/assets/image-editor/images/stickers/landmarks/67.svg +82 -82
  419. package/assets/image-editor/images/stickers/landmarks/68.svg +216 -216
  420. package/assets/image-editor/images/stickers/landmarks/69.svg +17 -17
  421. package/assets/image-editor/images/stickers/landmarks/7.svg +16 -16
  422. package/assets/image-editor/images/stickers/landmarks/70.svg +45 -45
  423. package/assets/image-editor/images/stickers/landmarks/71.svg +37 -37
  424. package/assets/image-editor/images/stickers/landmarks/72.svg +28 -28
  425. package/assets/image-editor/images/stickers/landmarks/73.svg +25 -25
  426. package/assets/image-editor/images/stickers/landmarks/74.svg +23 -23
  427. package/assets/image-editor/images/stickers/landmarks/75.svg +88 -88
  428. package/assets/image-editor/images/stickers/landmarks/76.svg +25 -25
  429. package/assets/image-editor/images/stickers/landmarks/77.svg +23 -23
  430. package/assets/image-editor/images/stickers/landmarks/78.svg +63 -63
  431. package/assets/image-editor/images/stickers/landmarks/79.svg +25 -25
  432. package/assets/image-editor/images/stickers/landmarks/8.svg +52 -52
  433. package/assets/image-editor/images/stickers/landmarks/80.svg +29 -29
  434. package/assets/image-editor/images/stickers/landmarks/81.svg +44 -44
  435. package/assets/image-editor/images/stickers/landmarks/82.svg +83 -83
  436. package/assets/image-editor/images/stickers/landmarks/83.svg +65 -65
  437. package/assets/image-editor/images/stickers/landmarks/84.svg +31 -31
  438. package/assets/image-editor/images/stickers/landmarks/85.svg +30 -30
  439. package/assets/image-editor/images/stickers/landmarks/86.svg +26 -26
  440. package/assets/image-editor/images/stickers/landmarks/87.svg +132 -132
  441. package/assets/image-editor/images/stickers/landmarks/88.svg +93 -93
  442. package/assets/image-editor/images/stickers/landmarks/89.svg +91 -91
  443. package/assets/image-editor/images/stickers/landmarks/9.svg +70 -70
  444. package/assets/image-editor/images/stickers/landmarks/90.svg +65 -65
  445. package/assets/image-editor/images/stickers/landmarks/91.svg +36 -36
  446. package/assets/image-editor/images/stickers/landmarks/92.svg +66 -66
  447. package/assets/image-editor/images/stickers/landmarks/93.svg +65 -65
  448. package/assets/image-editor/images/stickers/landmarks/94.svg +28 -28
  449. package/assets/image-editor/images/stickers/landmarks/95.svg +31 -31
  450. package/assets/image-editor/images/stickers/landmarks/96.svg +25 -25
  451. package/assets/image-editor/images/stickers/landmarks/97.svg +31 -31
  452. package/assets/image-editor/images/stickers/landmarks/98.svg +52 -52
  453. package/assets/image-editor/images/stickers/landmarks/99.svg +56 -56
  454. package/assets/image-editor/images/stickers/transportation/0.svg +26 -26
  455. package/assets/image-editor/images/stickers/transportation/1.svg +10 -10
  456. package/assets/image-editor/images/stickers/transportation/10.svg +16 -16
  457. package/assets/image-editor/images/stickers/transportation/11.svg +30 -30
  458. package/assets/image-editor/images/stickers/transportation/12.svg +22 -22
  459. package/assets/image-editor/images/stickers/transportation/13.svg +24 -24
  460. package/assets/image-editor/images/stickers/transportation/14.svg +19 -19
  461. package/assets/image-editor/images/stickers/transportation/15.svg +23 -23
  462. package/assets/image-editor/images/stickers/transportation/16.svg +25 -25
  463. package/assets/image-editor/images/stickers/transportation/17.svg +34 -34
  464. package/assets/image-editor/images/stickers/transportation/18.svg +29 -29
  465. package/assets/image-editor/images/stickers/transportation/19.svg +24 -24
  466. package/assets/image-editor/images/stickers/transportation/2.svg +27 -27
  467. package/assets/image-editor/images/stickers/transportation/20.svg +25 -25
  468. package/assets/image-editor/images/stickers/transportation/21.svg +22 -22
  469. package/assets/image-editor/images/stickers/transportation/3.svg +18 -18
  470. package/assets/image-editor/images/stickers/transportation/4.svg +24 -24
  471. package/assets/image-editor/images/stickers/transportation/5.svg +15 -15
  472. package/assets/image-editor/images/stickers/transportation/6.svg +25 -25
  473. package/assets/image-editor/images/stickers/transportation/7.svg +17 -17
  474. package/assets/image-editor/images/stickers/transportation/8.svg +28 -28
  475. package/assets/image-editor/images/stickers/transportation/9.svg +23 -23
  476. package/components/ImageCodeGenerator/ImageCodeGenerator.d.ts +4 -0
  477. package/constants/index.d.ts +2 -0
  478. package/debug-script.js +445 -445
  479. package/file-manager-IconsTab-ww_epetO.js +2 -0
  480. package/file-manager-ImageCodeGenerator-BxkI9HtY.js +2 -0
  481. package/file-manager-JsBarcode-CMRzMjTV.js +2 -0
  482. package/file-manager-index-CqMa6hmd.js +2 -0
  483. package/{file-manager-index-C27hSl1b.js → file-manager-index-Du1En8uk.js} +9 -9
  484. package/file-manager.css +160 -6
  485. package/file-manager.esm.js +1 -1
  486. package/file-manager.js +45820 -45720
  487. package/{fm-icons-tab.4e78e0d23b307449840c.js → fm-icons-tab.60bc2670cf092ed76cd0.js} +16 -12
  488. package/fm-image-code-generator.1f6c519dd7ec020319ad.js +371 -0
  489. package/mockServiceWorker.js +344 -344
  490. package/notification.d.ts +636 -636
  491. package/package.json +30 -30
  492. package/sample-files.json +104 -104
  493. package/suppress-resize-observer-errors.js +60 -60
  494. package/test-pixie-loading.html +108 -108
  495. package/types.d.ts +20 -2
  496. package/file-manager-IconsTab-DBlHkjOe.js +0 -2
@@ -0,0 +1,2978 @@
1
+ (Object(typeof self !== "undefined" ? self : this)["webpackChunkfileManager"] = Object(typeof self !== "undefined" ? self : this)["webpackChunkfileManager"] || []).push([[583],{
2
+
3
+ /***/ 157:
4
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5
+
6
+ const Utils = __webpack_require__(6886)
7
+ const ECLevel = __webpack_require__(9953)
8
+ const BitBuffer = __webpack_require__(9899)
9
+ const BitMatrix = __webpack_require__(8820)
10
+ const AlignmentPattern = __webpack_require__(6421)
11
+ const FinderPattern = __webpack_require__(7756)
12
+ const MaskPattern = __webpack_require__(1332)
13
+ const ECCode = __webpack_require__(7518)
14
+ const ReedSolomonEncoder = __webpack_require__(4764)
15
+ const Version = __webpack_require__(1427)
16
+ const FormatInfo = __webpack_require__(4565)
17
+ const Mode = __webpack_require__(208)
18
+ const Segments = __webpack_require__(9801)
19
+
20
+ /**
21
+ * QRCode for JavaScript
22
+ *
23
+ * modified by Ryan Day for nodejs support
24
+ * Copyright (c) 2011 Ryan Day
25
+ *
26
+ * Licensed under the MIT license:
27
+ * http://www.opensource.org/licenses/mit-license.php
28
+ *
29
+ //---------------------------------------------------------------------
30
+ // QRCode for JavaScript
31
+ //
32
+ // Copyright (c) 2009 Kazuhiko Arase
33
+ //
34
+ // URL: http://www.d-project.com/
35
+ //
36
+ // Licensed under the MIT license:
37
+ // http://www.opensource.org/licenses/mit-license.php
38
+ //
39
+ // The word "QR Code" is registered trademark of
40
+ // DENSO WAVE INCORPORATED
41
+ // http://www.denso-wave.com/qrcode/faqpatent-e.html
42
+ //
43
+ //---------------------------------------------------------------------
44
+ */
45
+
46
+ /**
47
+ * Add finder patterns bits to matrix
48
+ *
49
+ * @param {BitMatrix} matrix Modules matrix
50
+ * @param {Number} version QR Code version
51
+ */
52
+ function setupFinderPattern (matrix, version) {
53
+ const size = matrix.size
54
+ const pos = FinderPattern.getPositions(version)
55
+
56
+ for (let i = 0; i < pos.length; i++) {
57
+ const row = pos[i][0]
58
+ const col = pos[i][1]
59
+
60
+ for (let r = -1; r <= 7; r++) {
61
+ if (row + r <= -1 || size <= row + r) continue
62
+
63
+ for (let c = -1; c <= 7; c++) {
64
+ if (col + c <= -1 || size <= col + c) continue
65
+
66
+ if ((r >= 0 && r <= 6 && (c === 0 || c === 6)) ||
67
+ (c >= 0 && c <= 6 && (r === 0 || r === 6)) ||
68
+ (r >= 2 && r <= 4 && c >= 2 && c <= 4)) {
69
+ matrix.set(row + r, col + c, true, true)
70
+ } else {
71
+ matrix.set(row + r, col + c, false, true)
72
+ }
73
+ }
74
+ }
75
+ }
76
+ }
77
+
78
+ /**
79
+ * Add timing pattern bits to matrix
80
+ *
81
+ * Note: this function must be called before {@link setupAlignmentPattern}
82
+ *
83
+ * @param {BitMatrix} matrix Modules matrix
84
+ */
85
+ function setupTimingPattern (matrix) {
86
+ const size = matrix.size
87
+
88
+ for (let r = 8; r < size - 8; r++) {
89
+ const value = r % 2 === 0
90
+ matrix.set(r, 6, value, true)
91
+ matrix.set(6, r, value, true)
92
+ }
93
+ }
94
+
95
+ /**
96
+ * Add alignment patterns bits to matrix
97
+ *
98
+ * Note: this function must be called after {@link setupTimingPattern}
99
+ *
100
+ * @param {BitMatrix} matrix Modules matrix
101
+ * @param {Number} version QR Code version
102
+ */
103
+ function setupAlignmentPattern (matrix, version) {
104
+ const pos = AlignmentPattern.getPositions(version)
105
+
106
+ for (let i = 0; i < pos.length; i++) {
107
+ const row = pos[i][0]
108
+ const col = pos[i][1]
109
+
110
+ for (let r = -2; r <= 2; r++) {
111
+ for (let c = -2; c <= 2; c++) {
112
+ if (r === -2 || r === 2 || c === -2 || c === 2 ||
113
+ (r === 0 && c === 0)) {
114
+ matrix.set(row + r, col + c, true, true)
115
+ } else {
116
+ matrix.set(row + r, col + c, false, true)
117
+ }
118
+ }
119
+ }
120
+ }
121
+ }
122
+
123
+ /**
124
+ * Add version info bits to matrix
125
+ *
126
+ * @param {BitMatrix} matrix Modules matrix
127
+ * @param {Number} version QR Code version
128
+ */
129
+ function setupVersionInfo (matrix, version) {
130
+ const size = matrix.size
131
+ const bits = Version.getEncodedBits(version)
132
+ let row, col, mod
133
+
134
+ for (let i = 0; i < 18; i++) {
135
+ row = Math.floor(i / 3)
136
+ col = i % 3 + size - 8 - 3
137
+ mod = ((bits >> i) & 1) === 1
138
+
139
+ matrix.set(row, col, mod, true)
140
+ matrix.set(col, row, mod, true)
141
+ }
142
+ }
143
+
144
+ /**
145
+ * Add format info bits to matrix
146
+ *
147
+ * @param {BitMatrix} matrix Modules matrix
148
+ * @param {ErrorCorrectionLevel} errorCorrectionLevel Error correction level
149
+ * @param {Number} maskPattern Mask pattern reference value
150
+ */
151
+ function setupFormatInfo (matrix, errorCorrectionLevel, maskPattern) {
152
+ const size = matrix.size
153
+ const bits = FormatInfo.getEncodedBits(errorCorrectionLevel, maskPattern)
154
+ let i, mod
155
+
156
+ for (i = 0; i < 15; i++) {
157
+ mod = ((bits >> i) & 1) === 1
158
+
159
+ // vertical
160
+ if (i < 6) {
161
+ matrix.set(i, 8, mod, true)
162
+ } else if (i < 8) {
163
+ matrix.set(i + 1, 8, mod, true)
164
+ } else {
165
+ matrix.set(size - 15 + i, 8, mod, true)
166
+ }
167
+
168
+ // horizontal
169
+ if (i < 8) {
170
+ matrix.set(8, size - i - 1, mod, true)
171
+ } else if (i < 9) {
172
+ matrix.set(8, 15 - i - 1 + 1, mod, true)
173
+ } else {
174
+ matrix.set(8, 15 - i - 1, mod, true)
175
+ }
176
+ }
177
+
178
+ // fixed module
179
+ matrix.set(size - 8, 8, 1, true)
180
+ }
181
+
182
+ /**
183
+ * Add encoded data bits to matrix
184
+ *
185
+ * @param {BitMatrix} matrix Modules matrix
186
+ * @param {Uint8Array} data Data codewords
187
+ */
188
+ function setupData (matrix, data) {
189
+ const size = matrix.size
190
+ let inc = -1
191
+ let row = size - 1
192
+ let bitIndex = 7
193
+ let byteIndex = 0
194
+
195
+ for (let col = size - 1; col > 0; col -= 2) {
196
+ if (col === 6) col--
197
+
198
+ while (true) {
199
+ for (let c = 0; c < 2; c++) {
200
+ if (!matrix.isReserved(row, col - c)) {
201
+ let dark = false
202
+
203
+ if (byteIndex < data.length) {
204
+ dark = (((data[byteIndex] >>> bitIndex) & 1) === 1)
205
+ }
206
+
207
+ matrix.set(row, col - c, dark)
208
+ bitIndex--
209
+
210
+ if (bitIndex === -1) {
211
+ byteIndex++
212
+ bitIndex = 7
213
+ }
214
+ }
215
+ }
216
+
217
+ row += inc
218
+
219
+ if (row < 0 || size <= row) {
220
+ row -= inc
221
+ inc = -inc
222
+ break
223
+ }
224
+ }
225
+ }
226
+ }
227
+
228
+ /**
229
+ * Create encoded codewords from data input
230
+ *
231
+ * @param {Number} version QR Code version
232
+ * @param {ErrorCorrectionLevel} errorCorrectionLevel Error correction level
233
+ * @param {ByteData} data Data input
234
+ * @return {Uint8Array} Buffer containing encoded codewords
235
+ */
236
+ function createData (version, errorCorrectionLevel, segments) {
237
+ // Prepare data buffer
238
+ const buffer = new BitBuffer()
239
+
240
+ segments.forEach(function (data) {
241
+ // prefix data with mode indicator (4 bits)
242
+ buffer.put(data.mode.bit, 4)
243
+
244
+ // Prefix data with character count indicator.
245
+ // The character count indicator is a string of bits that represents the
246
+ // number of characters that are being encoded.
247
+ // The character count indicator must be placed after the mode indicator
248
+ // and must be a certain number of bits long, depending on the QR version
249
+ // and data mode
250
+ // @see {@link Mode.getCharCountIndicator}.
251
+ buffer.put(data.getLength(), Mode.getCharCountIndicator(data.mode, version))
252
+
253
+ // add binary data sequence to buffer
254
+ data.write(buffer)
255
+ })
256
+
257
+ // Calculate required number of bits
258
+ const totalCodewords = Utils.getSymbolTotalCodewords(version)
259
+ const ecTotalCodewords = ECCode.getTotalCodewordsCount(version, errorCorrectionLevel)
260
+ const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8
261
+
262
+ // Add a terminator.
263
+ // If the bit string is shorter than the total number of required bits,
264
+ // a terminator of up to four 0s must be added to the right side of the string.
265
+ // If the bit string is more than four bits shorter than the required number of bits,
266
+ // add four 0s to the end.
267
+ if (buffer.getLengthInBits() + 4 <= dataTotalCodewordsBits) {
268
+ buffer.put(0, 4)
269
+ }
270
+
271
+ // If the bit string is fewer than four bits shorter, add only the number of 0s that
272
+ // are needed to reach the required number of bits.
273
+
274
+ // After adding the terminator, if the number of bits in the string is not a multiple of 8,
275
+ // pad the string on the right with 0s to make the string's length a multiple of 8.
276
+ while (buffer.getLengthInBits() % 8 !== 0) {
277
+ buffer.putBit(0)
278
+ }
279
+
280
+ // Add pad bytes if the string is still shorter than the total number of required bits.
281
+ // Extend the buffer to fill the data capacity of the symbol corresponding to
282
+ // the Version and Error Correction Level by adding the Pad Codewords 11101100 (0xEC)
283
+ // and 00010001 (0x11) alternately.
284
+ const remainingByte = (dataTotalCodewordsBits - buffer.getLengthInBits()) / 8
285
+ for (let i = 0; i < remainingByte; i++) {
286
+ buffer.put(i % 2 ? 0x11 : 0xEC, 8)
287
+ }
288
+
289
+ return createCodewords(buffer, version, errorCorrectionLevel)
290
+ }
291
+
292
+ /**
293
+ * Encode input data with Reed-Solomon and return codewords with
294
+ * relative error correction bits
295
+ *
296
+ * @param {BitBuffer} bitBuffer Data to encode
297
+ * @param {Number} version QR Code version
298
+ * @param {ErrorCorrectionLevel} errorCorrectionLevel Error correction level
299
+ * @return {Uint8Array} Buffer containing encoded codewords
300
+ */
301
+ function createCodewords (bitBuffer, version, errorCorrectionLevel) {
302
+ // Total codewords for this QR code version (Data + Error correction)
303
+ const totalCodewords = Utils.getSymbolTotalCodewords(version)
304
+
305
+ // Total number of error correction codewords
306
+ const ecTotalCodewords = ECCode.getTotalCodewordsCount(version, errorCorrectionLevel)
307
+
308
+ // Total number of data codewords
309
+ const dataTotalCodewords = totalCodewords - ecTotalCodewords
310
+
311
+ // Total number of blocks
312
+ const ecTotalBlocks = ECCode.getBlocksCount(version, errorCorrectionLevel)
313
+
314
+ // Calculate how many blocks each group should contain
315
+ const blocksInGroup2 = totalCodewords % ecTotalBlocks
316
+ const blocksInGroup1 = ecTotalBlocks - blocksInGroup2
317
+
318
+ const totalCodewordsInGroup1 = Math.floor(totalCodewords / ecTotalBlocks)
319
+
320
+ const dataCodewordsInGroup1 = Math.floor(dataTotalCodewords / ecTotalBlocks)
321
+ const dataCodewordsInGroup2 = dataCodewordsInGroup1 + 1
322
+
323
+ // Number of EC codewords is the same for both groups
324
+ const ecCount = totalCodewordsInGroup1 - dataCodewordsInGroup1
325
+
326
+ // Initialize a Reed-Solomon encoder with a generator polynomial of degree ecCount
327
+ const rs = new ReedSolomonEncoder(ecCount)
328
+
329
+ let offset = 0
330
+ const dcData = new Array(ecTotalBlocks)
331
+ const ecData = new Array(ecTotalBlocks)
332
+ let maxDataSize = 0
333
+ const buffer = new Uint8Array(bitBuffer.buffer)
334
+
335
+ // Divide the buffer into the required number of blocks
336
+ for (let b = 0; b < ecTotalBlocks; b++) {
337
+ const dataSize = b < blocksInGroup1 ? dataCodewordsInGroup1 : dataCodewordsInGroup2
338
+
339
+ // extract a block of data from buffer
340
+ dcData[b] = buffer.slice(offset, offset + dataSize)
341
+
342
+ // Calculate EC codewords for this data block
343
+ ecData[b] = rs.encode(dcData[b])
344
+
345
+ offset += dataSize
346
+ maxDataSize = Math.max(maxDataSize, dataSize)
347
+ }
348
+
349
+ // Create final data
350
+ // Interleave the data and error correction codewords from each block
351
+ const data = new Uint8Array(totalCodewords)
352
+ let index = 0
353
+ let i, r
354
+
355
+ // Add data codewords
356
+ for (i = 0; i < maxDataSize; i++) {
357
+ for (r = 0; r < ecTotalBlocks; r++) {
358
+ if (i < dcData[r].length) {
359
+ data[index++] = dcData[r][i]
360
+ }
361
+ }
362
+ }
363
+
364
+ // Apped EC codewords
365
+ for (i = 0; i < ecCount; i++) {
366
+ for (r = 0; r < ecTotalBlocks; r++) {
367
+ data[index++] = ecData[r][i]
368
+ }
369
+ }
370
+
371
+ return data
372
+ }
373
+
374
+ /**
375
+ * Build QR Code symbol
376
+ *
377
+ * @param {String} data Input string
378
+ * @param {Number} version QR Code version
379
+ * @param {ErrorCorretionLevel} errorCorrectionLevel Error level
380
+ * @param {MaskPattern} maskPattern Mask pattern
381
+ * @return {Object} Object containing symbol data
382
+ */
383
+ function createSymbol (data, version, errorCorrectionLevel, maskPattern) {
384
+ let segments
385
+
386
+ if (Array.isArray(data)) {
387
+ segments = Segments.fromArray(data)
388
+ } else if (typeof data === 'string') {
389
+ let estimatedVersion = version
390
+
391
+ if (!estimatedVersion) {
392
+ const rawSegments = Segments.rawSplit(data)
393
+
394
+ // Estimate best version that can contain raw splitted segments
395
+ estimatedVersion = Version.getBestVersionForData(rawSegments, errorCorrectionLevel)
396
+ }
397
+
398
+ // Build optimized segments
399
+ // If estimated version is undefined, try with the highest version
400
+ segments = Segments.fromString(data, estimatedVersion || 40)
401
+ } else {
402
+ throw new Error('Invalid data')
403
+ }
404
+
405
+ // Get the min version that can contain data
406
+ const bestVersion = Version.getBestVersionForData(segments, errorCorrectionLevel)
407
+
408
+ // If no version is found, data cannot be stored
409
+ if (!bestVersion) {
410
+ throw new Error('The amount of data is too big to be stored in a QR Code')
411
+ }
412
+
413
+ // If not specified, use min version as default
414
+ if (!version) {
415
+ version = bestVersion
416
+
417
+ // Check if the specified version can contain the data
418
+ } else if (version < bestVersion) {
419
+ throw new Error('\n' +
420
+ 'The chosen QR Code version cannot contain this amount of data.\n' +
421
+ 'Minimum version required to store current data is: ' + bestVersion + '.\n'
422
+ )
423
+ }
424
+
425
+ const dataBits = createData(version, errorCorrectionLevel, segments)
426
+
427
+ // Allocate matrix buffer
428
+ const moduleCount = Utils.getSymbolSize(version)
429
+ const modules = new BitMatrix(moduleCount)
430
+
431
+ // Add function modules
432
+ setupFinderPattern(modules, version)
433
+ setupTimingPattern(modules)
434
+ setupAlignmentPattern(modules, version)
435
+
436
+ // Add temporary dummy bits for format info just to set them as reserved.
437
+ // This is needed to prevent these bits from being masked by {@link MaskPattern.applyMask}
438
+ // since the masking operation must be performed only on the encoding region.
439
+ // These blocks will be replaced with correct values later in code.
440
+ setupFormatInfo(modules, errorCorrectionLevel, 0)
441
+
442
+ if (version >= 7) {
443
+ setupVersionInfo(modules, version)
444
+ }
445
+
446
+ // Add data codewords
447
+ setupData(modules, dataBits)
448
+
449
+ if (isNaN(maskPattern)) {
450
+ // Find best mask pattern
451
+ maskPattern = MaskPattern.getBestMask(modules,
452
+ setupFormatInfo.bind(null, modules, errorCorrectionLevel))
453
+ }
454
+
455
+ // Apply mask pattern
456
+ MaskPattern.applyMask(maskPattern, modules)
457
+
458
+ // Replace format info bits with correct values
459
+ setupFormatInfo(modules, errorCorrectionLevel, maskPattern)
460
+
461
+ return {
462
+ modules: modules,
463
+ version: version,
464
+ errorCorrectionLevel: errorCorrectionLevel,
465
+ maskPattern: maskPattern,
466
+ segments: segments
467
+ }
468
+ }
469
+
470
+ /**
471
+ * QR Code
472
+ *
473
+ * @param {String | Array} data Input data
474
+ * @param {Object} options Optional configurations
475
+ * @param {Number} options.version QR Code version
476
+ * @param {String} options.errorCorrectionLevel Error correction level
477
+ * @param {Function} options.toSJISFunc Helper func to convert utf8 to sjis
478
+ */
479
+ exports.create = function create (data, options) {
480
+ if (typeof data === 'undefined' || data === '') {
481
+ throw new Error('No input text')
482
+ }
483
+
484
+ let errorCorrectionLevel = ECLevel.M
485
+ let version
486
+ let mask
487
+
488
+ if (typeof options !== 'undefined') {
489
+ // Use higher error correction level as default
490
+ errorCorrectionLevel = ECLevel.from(options.errorCorrectionLevel, ECLevel.M)
491
+ version = Version.from(options.version)
492
+ mask = MaskPattern.from(options.maskPattern)
493
+
494
+ if (options.toSJISFunc) {
495
+ Utils.setToSJISFunction(options.toSJISFunc)
496
+ }
497
+ }
498
+
499
+ return createSymbol(data, version, errorCorrectionLevel, mask)
500
+ }
501
+
502
+
503
+ /***/ }),
504
+
505
+ /***/ 208:
506
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
507
+
508
+ const VersionCheck = __webpack_require__(1878)
509
+ const Regex = __webpack_require__(7044)
510
+
511
+ /**
512
+ * Numeric mode encodes data from the decimal digit set (0 - 9)
513
+ * (byte values 30HEX to 39HEX).
514
+ * Normally, 3 data characters are represented by 10 bits.
515
+ *
516
+ * @type {Object}
517
+ */
518
+ exports.NUMERIC = {
519
+ id: 'Numeric',
520
+ bit: 1 << 0,
521
+ ccBits: [10, 12, 14]
522
+ }
523
+
524
+ /**
525
+ * Alphanumeric mode encodes data from a set of 45 characters,
526
+ * i.e. 10 numeric digits (0 - 9),
527
+ * 26 alphabetic characters (A - Z),
528
+ * and 9 symbols (SP, $, %, *, +, -, ., /, :).
529
+ * Normally, two input characters are represented by 11 bits.
530
+ *
531
+ * @type {Object}
532
+ */
533
+ exports.ALPHANUMERIC = {
534
+ id: 'Alphanumeric',
535
+ bit: 1 << 1,
536
+ ccBits: [9, 11, 13]
537
+ }
538
+
539
+ /**
540
+ * In byte mode, data is encoded at 8 bits per character.
541
+ *
542
+ * @type {Object}
543
+ */
544
+ exports.BYTE = {
545
+ id: 'Byte',
546
+ bit: 1 << 2,
547
+ ccBits: [8, 16, 16]
548
+ }
549
+
550
+ /**
551
+ * The Kanji mode efficiently encodes Kanji characters in accordance with
552
+ * the Shift JIS system based on JIS X 0208.
553
+ * The Shift JIS values are shifted from the JIS X 0208 values.
554
+ * JIS X 0208 gives details of the shift coded representation.
555
+ * Each two-byte character value is compacted to a 13-bit binary codeword.
556
+ *
557
+ * @type {Object}
558
+ */
559
+ exports.KANJI = {
560
+ id: 'Kanji',
561
+ bit: 1 << 3,
562
+ ccBits: [8, 10, 12]
563
+ }
564
+
565
+ /**
566
+ * Mixed mode will contain a sequences of data in a combination of any of
567
+ * the modes described above
568
+ *
569
+ * @type {Object}
570
+ */
571
+ exports.MIXED = {
572
+ bit: -1
573
+ }
574
+
575
+ /**
576
+ * Returns the number of bits needed to store the data length
577
+ * according to QR Code specifications.
578
+ *
579
+ * @param {Mode} mode Data mode
580
+ * @param {Number} version QR Code version
581
+ * @return {Number} Number of bits
582
+ */
583
+ exports.getCharCountIndicator = function getCharCountIndicator (mode, version) {
584
+ if (!mode.ccBits) throw new Error('Invalid mode: ' + mode)
585
+
586
+ if (!VersionCheck.isValid(version)) {
587
+ throw new Error('Invalid version: ' + version)
588
+ }
589
+
590
+ if (version >= 1 && version < 10) return mode.ccBits[0]
591
+ else if (version < 27) return mode.ccBits[1]
592
+ return mode.ccBits[2]
593
+ }
594
+
595
+ /**
596
+ * Returns the most efficient mode to store the specified data
597
+ *
598
+ * @param {String} dataStr Input data string
599
+ * @return {Mode} Best mode
600
+ */
601
+ exports.getBestModeForData = function getBestModeForData (dataStr) {
602
+ if (Regex.testNumeric(dataStr)) return exports.NUMERIC
603
+ else if (Regex.testAlphanumeric(dataStr)) return exports.ALPHANUMERIC
604
+ else if (Regex.testKanji(dataStr)) return exports.KANJI
605
+ else return exports.BYTE
606
+ }
607
+
608
+ /**
609
+ * Return mode name as string
610
+ *
611
+ * @param {Mode} mode Mode object
612
+ * @returns {String} Mode name
613
+ */
614
+ exports.toString = function toString (mode) {
615
+ if (mode && mode.id) return mode.id
616
+ throw new Error('Invalid mode')
617
+ }
618
+
619
+ /**
620
+ * Check if input param is a valid mode object
621
+ *
622
+ * @param {Mode} mode Mode object
623
+ * @returns {Boolean} True if valid mode, false otherwise
624
+ */
625
+ exports.isValid = function isValid (mode) {
626
+ return mode && mode.bit && mode.ccBits
627
+ }
628
+
629
+ /**
630
+ * Get mode object from its name
631
+ *
632
+ * @param {String} string Mode name
633
+ * @returns {Mode} Mode object
634
+ */
635
+ function fromString (string) {
636
+ if (typeof string !== 'string') {
637
+ throw new Error('Param is not a string')
638
+ }
639
+
640
+ const lcStr = string.toLowerCase()
641
+
642
+ switch (lcStr) {
643
+ case 'numeric':
644
+ return exports.NUMERIC
645
+ case 'alphanumeric':
646
+ return exports.ALPHANUMERIC
647
+ case 'kanji':
648
+ return exports.KANJI
649
+ case 'byte':
650
+ return exports.BYTE
651
+ default:
652
+ throw new Error('Unknown mode: ' + string)
653
+ }
654
+ }
655
+
656
+ /**
657
+ * Returns mode from a value.
658
+ * If value is not a valid mode, returns defaultValue
659
+ *
660
+ * @param {Mode|String} value Encoding mode
661
+ * @param {Mode} defaultValue Fallback value
662
+ * @return {Mode} Encoding mode
663
+ */
664
+ exports.from = function from (value, defaultValue) {
665
+ if (exports.isValid(value)) {
666
+ return value
667
+ }
668
+
669
+ try {
670
+ return fromString(value)
671
+ } catch (e) {
672
+ return defaultValue
673
+ }
674
+ }
675
+
676
+
677
+ /***/ }),
678
+
679
+ /***/ 1332:
680
+ /***/ ((__unused_webpack_module, exports) => {
681
+
682
+ /**
683
+ * Data mask pattern reference
684
+ * @type {Object}
685
+ */
686
+ exports.Patterns = {
687
+ PATTERN000: 0,
688
+ PATTERN001: 1,
689
+ PATTERN010: 2,
690
+ PATTERN011: 3,
691
+ PATTERN100: 4,
692
+ PATTERN101: 5,
693
+ PATTERN110: 6,
694
+ PATTERN111: 7
695
+ }
696
+
697
+ /**
698
+ * Weighted penalty scores for the undesirable features
699
+ * @type {Object}
700
+ */
701
+ const PenaltyScores = {
702
+ N1: 3,
703
+ N2: 3,
704
+ N3: 40,
705
+ N4: 10
706
+ }
707
+
708
+ /**
709
+ * Check if mask pattern value is valid
710
+ *
711
+ * @param {Number} mask Mask pattern
712
+ * @return {Boolean} true if valid, false otherwise
713
+ */
714
+ exports.isValid = function isValid (mask) {
715
+ return mask != null && mask !== '' && !isNaN(mask) && mask >= 0 && mask <= 7
716
+ }
717
+
718
+ /**
719
+ * Returns mask pattern from a value.
720
+ * If value is not valid, returns undefined
721
+ *
722
+ * @param {Number|String} value Mask pattern value
723
+ * @return {Number} Valid mask pattern or undefined
724
+ */
725
+ exports.from = function from (value) {
726
+ return exports.isValid(value) ? parseInt(value, 10) : undefined
727
+ }
728
+
729
+ /**
730
+ * Find adjacent modules in row/column with the same color
731
+ * and assign a penalty value.
732
+ *
733
+ * Points: N1 + i
734
+ * i is the amount by which the number of adjacent modules of the same color exceeds 5
735
+ */
736
+ exports.getPenaltyN1 = function getPenaltyN1 (data) {
737
+ const size = data.size
738
+ let points = 0
739
+ let sameCountCol = 0
740
+ let sameCountRow = 0
741
+ let lastCol = null
742
+ let lastRow = null
743
+
744
+ for (let row = 0; row < size; row++) {
745
+ sameCountCol = sameCountRow = 0
746
+ lastCol = lastRow = null
747
+
748
+ for (let col = 0; col < size; col++) {
749
+ let module = data.get(row, col)
750
+ if (module === lastCol) {
751
+ sameCountCol++
752
+ } else {
753
+ if (sameCountCol >= 5) points += PenaltyScores.N1 + (sameCountCol - 5)
754
+ lastCol = module
755
+ sameCountCol = 1
756
+ }
757
+
758
+ module = data.get(col, row)
759
+ if (module === lastRow) {
760
+ sameCountRow++
761
+ } else {
762
+ if (sameCountRow >= 5) points += PenaltyScores.N1 + (sameCountRow - 5)
763
+ lastRow = module
764
+ sameCountRow = 1
765
+ }
766
+ }
767
+
768
+ if (sameCountCol >= 5) points += PenaltyScores.N1 + (sameCountCol - 5)
769
+ if (sameCountRow >= 5) points += PenaltyScores.N1 + (sameCountRow - 5)
770
+ }
771
+
772
+ return points
773
+ }
774
+
775
+ /**
776
+ * Find 2x2 blocks with the same color and assign a penalty value
777
+ *
778
+ * Points: N2 * (m - 1) * (n - 1)
779
+ */
780
+ exports.getPenaltyN2 = function getPenaltyN2 (data) {
781
+ const size = data.size
782
+ let points = 0
783
+
784
+ for (let row = 0; row < size - 1; row++) {
785
+ for (let col = 0; col < size - 1; col++) {
786
+ const last = data.get(row, col) +
787
+ data.get(row, col + 1) +
788
+ data.get(row + 1, col) +
789
+ data.get(row + 1, col + 1)
790
+
791
+ if (last === 4 || last === 0) points++
792
+ }
793
+ }
794
+
795
+ return points * PenaltyScores.N2
796
+ }
797
+
798
+ /**
799
+ * Find 1:1:3:1:1 ratio (dark:light:dark:light:dark) pattern in row/column,
800
+ * preceded or followed by light area 4 modules wide
801
+ *
802
+ * Points: N3 * number of pattern found
803
+ */
804
+ exports.getPenaltyN3 = function getPenaltyN3 (data) {
805
+ const size = data.size
806
+ let points = 0
807
+ let bitsCol = 0
808
+ let bitsRow = 0
809
+
810
+ for (let row = 0; row < size; row++) {
811
+ bitsCol = bitsRow = 0
812
+ for (let col = 0; col < size; col++) {
813
+ bitsCol = ((bitsCol << 1) & 0x7FF) | data.get(row, col)
814
+ if (col >= 10 && (bitsCol === 0x5D0 || bitsCol === 0x05D)) points++
815
+
816
+ bitsRow = ((bitsRow << 1) & 0x7FF) | data.get(col, row)
817
+ if (col >= 10 && (bitsRow === 0x5D0 || bitsRow === 0x05D)) points++
818
+ }
819
+ }
820
+
821
+ return points * PenaltyScores.N3
822
+ }
823
+
824
+ /**
825
+ * Calculate proportion of dark modules in entire symbol
826
+ *
827
+ * Points: N4 * k
828
+ *
829
+ * k is the rating of the deviation of the proportion of dark modules
830
+ * in the symbol from 50% in steps of 5%
831
+ */
832
+ exports.getPenaltyN4 = function getPenaltyN4 (data) {
833
+ let darkCount = 0
834
+ const modulesCount = data.data.length
835
+
836
+ for (let i = 0; i < modulesCount; i++) darkCount += data.data[i]
837
+
838
+ const k = Math.abs(Math.ceil((darkCount * 100 / modulesCount) / 5) - 10)
839
+
840
+ return k * PenaltyScores.N4
841
+ }
842
+
843
+ /**
844
+ * Return mask value at given position
845
+ *
846
+ * @param {Number} maskPattern Pattern reference value
847
+ * @param {Number} i Row
848
+ * @param {Number} j Column
849
+ * @return {Boolean} Mask value
850
+ */
851
+ function getMaskAt (maskPattern, i, j) {
852
+ switch (maskPattern) {
853
+ case exports.Patterns.PATTERN000: return (i + j) % 2 === 0
854
+ case exports.Patterns.PATTERN001: return i % 2 === 0
855
+ case exports.Patterns.PATTERN010: return j % 3 === 0
856
+ case exports.Patterns.PATTERN011: return (i + j) % 3 === 0
857
+ case exports.Patterns.PATTERN100: return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 === 0
858
+ case exports.Patterns.PATTERN101: return (i * j) % 2 + (i * j) % 3 === 0
859
+ case exports.Patterns.PATTERN110: return ((i * j) % 2 + (i * j) % 3) % 2 === 0
860
+ case exports.Patterns.PATTERN111: return ((i * j) % 3 + (i + j) % 2) % 2 === 0
861
+
862
+ default: throw new Error('bad maskPattern:' + maskPattern)
863
+ }
864
+ }
865
+
866
+ /**
867
+ * Apply a mask pattern to a BitMatrix
868
+ *
869
+ * @param {Number} pattern Pattern reference number
870
+ * @param {BitMatrix} data BitMatrix data
871
+ */
872
+ exports.applyMask = function applyMask (pattern, data) {
873
+ const size = data.size
874
+
875
+ for (let col = 0; col < size; col++) {
876
+ for (let row = 0; row < size; row++) {
877
+ if (data.isReserved(row, col)) continue
878
+ data.xor(row, col, getMaskAt(pattern, row, col))
879
+ }
880
+ }
881
+ }
882
+
883
+ /**
884
+ * Returns the best mask pattern for data
885
+ *
886
+ * @param {BitMatrix} data
887
+ * @return {Number} Mask pattern reference number
888
+ */
889
+ exports.getBestMask = function getBestMask (data, setupFormatFunc) {
890
+ const numPatterns = Object.keys(exports.Patterns).length
891
+ let bestPattern = 0
892
+ let lowerPenalty = Infinity
893
+
894
+ for (let p = 0; p < numPatterns; p++) {
895
+ setupFormatFunc(p)
896
+ exports.applyMask(p, data)
897
+
898
+ // Calculate penalty
899
+ const penalty =
900
+ exports.getPenaltyN1(data) +
901
+ exports.getPenaltyN2(data) +
902
+ exports.getPenaltyN3(data) +
903
+ exports.getPenaltyN4(data)
904
+
905
+ // Undo previously applied mask
906
+ exports.applyMask(p, data)
907
+
908
+ if (penalty < lowerPenalty) {
909
+ lowerPenalty = penalty
910
+ bestPattern = p
911
+ }
912
+ }
913
+
914
+ return bestPattern
915
+ }
916
+
917
+
918
+ /***/ }),
919
+
920
+ /***/ 1333:
921
+ /***/ ((module) => {
922
+
923
+ // can-promise has a crash in some versions of react native that dont have
924
+ // standard global objects
925
+ // https://github.com/soldair/node-qrcode/issues/157
926
+
927
+ module.exports = function () {
928
+ return typeof Promise === 'function' && Promise.prototype && Promise.prototype.then
929
+ }
930
+
931
+
932
+ /***/ }),
933
+
934
+ /***/ 1427:
935
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
936
+
937
+ const Utils = __webpack_require__(6886)
938
+ const ECCode = __webpack_require__(7518)
939
+ const ECLevel = __webpack_require__(9953)
940
+ const Mode = __webpack_require__(208)
941
+ const VersionCheck = __webpack_require__(1878)
942
+
943
+ // Generator polynomial used to encode version information
944
+ const G18 = (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0)
945
+ const G18_BCH = Utils.getBCHDigit(G18)
946
+
947
+ function getBestVersionForDataLength (mode, length, errorCorrectionLevel) {
948
+ for (let currentVersion = 1; currentVersion <= 40; currentVersion++) {
949
+ if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel, mode)) {
950
+ return currentVersion
951
+ }
952
+ }
953
+
954
+ return undefined
955
+ }
956
+
957
+ function getReservedBitsCount (mode, version) {
958
+ // Character count indicator + mode indicator bits
959
+ return Mode.getCharCountIndicator(mode, version) + 4
960
+ }
961
+
962
+ function getTotalBitsFromDataArray (segments, version) {
963
+ let totalBits = 0
964
+
965
+ segments.forEach(function (data) {
966
+ const reservedBits = getReservedBitsCount(data.mode, version)
967
+ totalBits += reservedBits + data.getBitsLength()
968
+ })
969
+
970
+ return totalBits
971
+ }
972
+
973
+ function getBestVersionForMixedData (segments, errorCorrectionLevel) {
974
+ for (let currentVersion = 1; currentVersion <= 40; currentVersion++) {
975
+ const length = getTotalBitsFromDataArray(segments, currentVersion)
976
+ if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel, Mode.MIXED)) {
977
+ return currentVersion
978
+ }
979
+ }
980
+
981
+ return undefined
982
+ }
983
+
984
+ /**
985
+ * Returns version number from a value.
986
+ * If value is not a valid version, returns defaultValue
987
+ *
988
+ * @param {Number|String} value QR Code version
989
+ * @param {Number} defaultValue Fallback value
990
+ * @return {Number} QR Code version number
991
+ */
992
+ exports.from = function from (value, defaultValue) {
993
+ if (VersionCheck.isValid(value)) {
994
+ return parseInt(value, 10)
995
+ }
996
+
997
+ return defaultValue
998
+ }
999
+
1000
+ /**
1001
+ * Returns how much data can be stored with the specified QR code version
1002
+ * and error correction level
1003
+ *
1004
+ * @param {Number} version QR Code version (1-40)
1005
+ * @param {Number} errorCorrectionLevel Error correction level
1006
+ * @param {Mode} mode Data mode
1007
+ * @return {Number} Quantity of storable data
1008
+ */
1009
+ exports.getCapacity = function getCapacity (version, errorCorrectionLevel, mode) {
1010
+ if (!VersionCheck.isValid(version)) {
1011
+ throw new Error('Invalid QR Code version')
1012
+ }
1013
+
1014
+ // Use Byte mode as default
1015
+ if (typeof mode === 'undefined') mode = Mode.BYTE
1016
+
1017
+ // Total codewords for this QR code version (Data + Error correction)
1018
+ const totalCodewords = Utils.getSymbolTotalCodewords(version)
1019
+
1020
+ // Total number of error correction codewords
1021
+ const ecTotalCodewords = ECCode.getTotalCodewordsCount(version, errorCorrectionLevel)
1022
+
1023
+ // Total number of data codewords
1024
+ const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8
1025
+
1026
+ if (mode === Mode.MIXED) return dataTotalCodewordsBits
1027
+
1028
+ const usableBits = dataTotalCodewordsBits - getReservedBitsCount(mode, version)
1029
+
1030
+ // Return max number of storable codewords
1031
+ switch (mode) {
1032
+ case Mode.NUMERIC:
1033
+ return Math.floor((usableBits / 10) * 3)
1034
+
1035
+ case Mode.ALPHANUMERIC:
1036
+ return Math.floor((usableBits / 11) * 2)
1037
+
1038
+ case Mode.KANJI:
1039
+ return Math.floor(usableBits / 13)
1040
+
1041
+ case Mode.BYTE:
1042
+ default:
1043
+ return Math.floor(usableBits / 8)
1044
+ }
1045
+ }
1046
+
1047
+ /**
1048
+ * Returns the minimum version needed to contain the amount of data
1049
+ *
1050
+ * @param {Segment} data Segment of data
1051
+ * @param {Number} [errorCorrectionLevel=H] Error correction level
1052
+ * @param {Mode} mode Data mode
1053
+ * @return {Number} QR Code version
1054
+ */
1055
+ exports.getBestVersionForData = function getBestVersionForData (data, errorCorrectionLevel) {
1056
+ let seg
1057
+
1058
+ const ecl = ECLevel.from(errorCorrectionLevel, ECLevel.M)
1059
+
1060
+ if (Array.isArray(data)) {
1061
+ if (data.length > 1) {
1062
+ return getBestVersionForMixedData(data, ecl)
1063
+ }
1064
+
1065
+ if (data.length === 0) {
1066
+ return 1
1067
+ }
1068
+
1069
+ seg = data[0]
1070
+ } else {
1071
+ seg = data
1072
+ }
1073
+
1074
+ return getBestVersionForDataLength(seg.mode, seg.getLength(), ecl)
1075
+ }
1076
+
1077
+ /**
1078
+ * Returns version information with relative error correction bits
1079
+ *
1080
+ * The version information is included in QR Code symbols of version 7 or larger.
1081
+ * It consists of an 18-bit sequence containing 6 data bits,
1082
+ * with 12 error correction bits calculated using the (18, 6) Golay code.
1083
+ *
1084
+ * @param {Number} version QR Code version
1085
+ * @return {Number} Encoded version info bits
1086
+ */
1087
+ exports.getEncodedBits = function getEncodedBits (version) {
1088
+ if (!VersionCheck.isValid(version) || version < 7) {
1089
+ throw new Error('Invalid QR Code version')
1090
+ }
1091
+
1092
+ let d = version << 12
1093
+
1094
+ while (Utils.getBCHDigit(d) - G18_BCH >= 0) {
1095
+ d ^= (G18 << (Utils.getBCHDigit(d) - G18_BCH))
1096
+ }
1097
+
1098
+ return (version << 12) | d
1099
+ }
1100
+
1101
+
1102
+ /***/ }),
1103
+
1104
+ /***/ 1433:
1105
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1106
+
1107
+ const Mode = __webpack_require__(208)
1108
+
1109
+ /**
1110
+ * Array of characters available in alphanumeric mode
1111
+ *
1112
+ * As per QR Code specification, to each character
1113
+ * is assigned a value from 0 to 44 which in this case coincides
1114
+ * with the array index
1115
+ *
1116
+ * @type {Array}
1117
+ */
1118
+ const ALPHA_NUM_CHARS = [
1119
+ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
1120
+ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
1121
+ 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
1122
+ ' ', '$', '%', '*', '+', '-', '.', '/', ':'
1123
+ ]
1124
+
1125
+ function AlphanumericData (data) {
1126
+ this.mode = Mode.ALPHANUMERIC
1127
+ this.data = data
1128
+ }
1129
+
1130
+ AlphanumericData.getBitsLength = function getBitsLength (length) {
1131
+ return 11 * Math.floor(length / 2) + 6 * (length % 2)
1132
+ }
1133
+
1134
+ AlphanumericData.prototype.getLength = function getLength () {
1135
+ return this.data.length
1136
+ }
1137
+
1138
+ AlphanumericData.prototype.getBitsLength = function getBitsLength () {
1139
+ return AlphanumericData.getBitsLength(this.data.length)
1140
+ }
1141
+
1142
+ AlphanumericData.prototype.write = function write (bitBuffer) {
1143
+ let i
1144
+
1145
+ // Input data characters are divided into groups of two characters
1146
+ // and encoded as 11-bit binary codes.
1147
+ for (i = 0; i + 2 <= this.data.length; i += 2) {
1148
+ // The character value of the first character is multiplied by 45
1149
+ let value = ALPHA_NUM_CHARS.indexOf(this.data[i]) * 45
1150
+
1151
+ // The character value of the second digit is added to the product
1152
+ value += ALPHA_NUM_CHARS.indexOf(this.data[i + 1])
1153
+
1154
+ // The sum is then stored as 11-bit binary number
1155
+ bitBuffer.put(value, 11)
1156
+ }
1157
+
1158
+ // If the number of input data characters is not a multiple of two,
1159
+ // the character value of the final character is encoded as a 6-bit binary number.
1160
+ if (this.data.length % 2) {
1161
+ bitBuffer.put(ALPHA_NUM_CHARS.indexOf(this.data[i]), 6)
1162
+ }
1163
+ }
1164
+
1165
+ module.exports = AlphanumericData
1166
+
1167
+
1168
+ /***/ }),
1169
+
1170
+ /***/ 1878:
1171
+ /***/ ((__unused_webpack_module, exports) => {
1172
+
1173
+ /**
1174
+ * Check if QR Code version is valid
1175
+ *
1176
+ * @param {Number} version QR Code version
1177
+ * @return {Boolean} true if valid version, false otherwise
1178
+ */
1179
+ exports.isValid = function isValid (version) {
1180
+ return !isNaN(version) && version >= 1 && version <= 40
1181
+ }
1182
+
1183
+
1184
+ /***/ }),
1185
+
1186
+ /***/ 2726:
1187
+ /***/ ((__unused_webpack_module, exports) => {
1188
+
1189
+ function hex2rgba (hex) {
1190
+ if (typeof hex === 'number') {
1191
+ hex = hex.toString()
1192
+ }
1193
+
1194
+ if (typeof hex !== 'string') {
1195
+ throw new Error('Color should be defined as hex string')
1196
+ }
1197
+
1198
+ let hexCode = hex.slice().replace('#', '').split('')
1199
+ if (hexCode.length < 3 || hexCode.length === 5 || hexCode.length > 8) {
1200
+ throw new Error('Invalid hex color: ' + hex)
1201
+ }
1202
+
1203
+ // Convert from short to long form (fff -> ffffff)
1204
+ if (hexCode.length === 3 || hexCode.length === 4) {
1205
+ hexCode = Array.prototype.concat.apply([], hexCode.map(function (c) {
1206
+ return [c, c]
1207
+ }))
1208
+ }
1209
+
1210
+ // Add default alpha value
1211
+ if (hexCode.length === 6) hexCode.push('F', 'F')
1212
+
1213
+ const hexValue = parseInt(hexCode.join(''), 16)
1214
+
1215
+ return {
1216
+ r: (hexValue >> 24) & 255,
1217
+ g: (hexValue >> 16) & 255,
1218
+ b: (hexValue >> 8) & 255,
1219
+ a: hexValue & 255,
1220
+ hex: '#' + hexCode.slice(0, 6).join('')
1221
+ }
1222
+ }
1223
+
1224
+ exports.getOptions = function getOptions (options) {
1225
+ if (!options) options = {}
1226
+ if (!options.color) options.color = {}
1227
+
1228
+ const margin = typeof options.margin === 'undefined' ||
1229
+ options.margin === null ||
1230
+ options.margin < 0
1231
+ ? 4
1232
+ : options.margin
1233
+
1234
+ const width = options.width && options.width >= 21 ? options.width : undefined
1235
+ const scale = options.scale || 4
1236
+
1237
+ return {
1238
+ width: width,
1239
+ scale: width ? 4 : scale,
1240
+ margin: margin,
1241
+ color: {
1242
+ dark: hex2rgba(options.color.dark || '#000000ff'),
1243
+ light: hex2rgba(options.color.light || '#ffffffff')
1244
+ },
1245
+ type: options.type,
1246
+ rendererOpts: options.rendererOpts || {}
1247
+ }
1248
+ }
1249
+
1250
+ exports.getScale = function getScale (qrSize, opts) {
1251
+ return opts.width && opts.width >= qrSize + opts.margin * 2
1252
+ ? opts.width / (qrSize + opts.margin * 2)
1253
+ : opts.scale
1254
+ }
1255
+
1256
+ exports.getImageWidth = function getImageWidth (qrSize, opts) {
1257
+ const scale = exports.getScale(qrSize, opts)
1258
+ return Math.floor((qrSize + opts.margin * 2) * scale)
1259
+ }
1260
+
1261
+ exports.qrToImageData = function qrToImageData (imgData, qr, opts) {
1262
+ const size = qr.modules.size
1263
+ const data = qr.modules.data
1264
+ const scale = exports.getScale(size, opts)
1265
+ const symbolSize = Math.floor((size + opts.margin * 2) * scale)
1266
+ const scaledMargin = opts.margin * scale
1267
+ const palette = [opts.color.light, opts.color.dark]
1268
+
1269
+ for (let i = 0; i < symbolSize; i++) {
1270
+ for (let j = 0; j < symbolSize; j++) {
1271
+ let posDst = (i * symbolSize + j) * 4
1272
+ let pxColor = opts.color.light
1273
+
1274
+ if (i >= scaledMargin && j >= scaledMargin &&
1275
+ i < symbolSize - scaledMargin && j < symbolSize - scaledMargin) {
1276
+ const iSrc = Math.floor((i - scaledMargin) / scale)
1277
+ const jSrc = Math.floor((j - scaledMargin) / scale)
1278
+ pxColor = palette[data[iSrc * size + jSrc] ? 1 : 0]
1279
+ }
1280
+
1281
+ imgData[posDst++] = pxColor.r
1282
+ imgData[posDst++] = pxColor.g
1283
+ imgData[posDst++] = pxColor.b
1284
+ imgData[posDst] = pxColor.a
1285
+ }
1286
+ }
1287
+ }
1288
+
1289
+
1290
+ /***/ }),
1291
+
1292
+ /***/ 2731:
1293
+ /***/ ((__unused_webpack_module, exports) => {
1294
+
1295
+ const EXP_TABLE = new Uint8Array(512)
1296
+ const LOG_TABLE = new Uint8Array(256)
1297
+ /**
1298
+ * Precompute the log and anti-log tables for faster computation later
1299
+ *
1300
+ * For each possible value in the galois field 2^8, we will pre-compute
1301
+ * the logarithm and anti-logarithm (exponential) of this value
1302
+ *
1303
+ * ref {@link https://en.wikiversity.org/wiki/Reed%E2%80%93Solomon_codes_for_coders#Introduction_to_mathematical_fields}
1304
+ */
1305
+ ;(function initTables () {
1306
+ let x = 1
1307
+ for (let i = 0; i < 255; i++) {
1308
+ EXP_TABLE[i] = x
1309
+ LOG_TABLE[x] = i
1310
+
1311
+ x <<= 1 // multiply by 2
1312
+
1313
+ // The QR code specification says to use byte-wise modulo 100011101 arithmetic.
1314
+ // This means that when a number is 256 or larger, it should be XORed with 0x11D.
1315
+ if (x & 0x100) { // similar to x >= 256, but a lot faster (because 0x100 == 256)
1316
+ x ^= 0x11D
1317
+ }
1318
+ }
1319
+
1320
+ // Optimization: double the size of the anti-log table so that we don't need to mod 255 to
1321
+ // stay inside the bounds (because we will mainly use this table for the multiplication of
1322
+ // two GF numbers, no more).
1323
+ // @see {@link mul}
1324
+ for (let i = 255; i < 512; i++) {
1325
+ EXP_TABLE[i] = EXP_TABLE[i - 255]
1326
+ }
1327
+ }())
1328
+
1329
+ /**
1330
+ * Returns log value of n inside Galois Field
1331
+ *
1332
+ * @param {Number} n
1333
+ * @return {Number}
1334
+ */
1335
+ exports.log = function log (n) {
1336
+ if (n < 1) throw new Error('log(' + n + ')')
1337
+ return LOG_TABLE[n]
1338
+ }
1339
+
1340
+ /**
1341
+ * Returns anti-log value of n inside Galois Field
1342
+ *
1343
+ * @param {Number} n
1344
+ * @return {Number}
1345
+ */
1346
+ exports.exp = function exp (n) {
1347
+ return EXP_TABLE[n]
1348
+ }
1349
+
1350
+ /**
1351
+ * Multiplies two number inside Galois Field
1352
+ *
1353
+ * @param {Number} x
1354
+ * @param {Number} y
1355
+ * @return {Number}
1356
+ */
1357
+ exports.mul = function mul (x, y) {
1358
+ if (x === 0 || y === 0) return 0
1359
+
1360
+ // should be EXP_TABLE[(LOG_TABLE[x] + LOG_TABLE[y]) % 255] if EXP_TABLE wasn't oversized
1361
+ // @see {@link initTables}
1362
+ return EXP_TABLE[LOG_TABLE[x] + LOG_TABLE[y]]
1363
+ }
1364
+
1365
+
1366
+ /***/ }),
1367
+
1368
+ /***/ 4357:
1369
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1370
+
1371
+ const Mode = __webpack_require__(208)
1372
+
1373
+ function NumericData (data) {
1374
+ this.mode = Mode.NUMERIC
1375
+ this.data = data.toString()
1376
+ }
1377
+
1378
+ NumericData.getBitsLength = function getBitsLength (length) {
1379
+ return 10 * Math.floor(length / 3) + ((length % 3) ? ((length % 3) * 3 + 1) : 0)
1380
+ }
1381
+
1382
+ NumericData.prototype.getLength = function getLength () {
1383
+ return this.data.length
1384
+ }
1385
+
1386
+ NumericData.prototype.getBitsLength = function getBitsLength () {
1387
+ return NumericData.getBitsLength(this.data.length)
1388
+ }
1389
+
1390
+ NumericData.prototype.write = function write (bitBuffer) {
1391
+ let i, group, value
1392
+
1393
+ // The input data string is divided into groups of three digits,
1394
+ // and each group is converted to its 10-bit binary equivalent.
1395
+ for (i = 0; i + 3 <= this.data.length; i += 3) {
1396
+ group = this.data.substr(i, 3)
1397
+ value = parseInt(group, 10)
1398
+
1399
+ bitBuffer.put(value, 10)
1400
+ }
1401
+
1402
+ // If the number of input digits is not an exact multiple of three,
1403
+ // the final one or two digits are converted to 4 or 7 bits respectively.
1404
+ const remainingNum = this.data.length - i
1405
+ if (remainingNum > 0) {
1406
+ group = this.data.substr(i)
1407
+ value = parseInt(group, 10)
1408
+
1409
+ bitBuffer.put(value, remainingNum * 3 + 1)
1410
+ }
1411
+ }
1412
+
1413
+ module.exports = NumericData
1414
+
1415
+
1416
+ /***/ }),
1417
+
1418
+ /***/ 4565:
1419
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1420
+
1421
+ const Utils = __webpack_require__(6886)
1422
+
1423
+ const G15 = (1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0)
1424
+ const G15_MASK = (1 << 14) | (1 << 12) | (1 << 10) | (1 << 4) | (1 << 1)
1425
+ const G15_BCH = Utils.getBCHDigit(G15)
1426
+
1427
+ /**
1428
+ * Returns format information with relative error correction bits
1429
+ *
1430
+ * The format information is a 15-bit sequence containing 5 data bits,
1431
+ * with 10 error correction bits calculated using the (15, 5) BCH code.
1432
+ *
1433
+ * @param {Number} errorCorrectionLevel Error correction level
1434
+ * @param {Number} mask Mask pattern
1435
+ * @return {Number} Encoded format information bits
1436
+ */
1437
+ exports.getEncodedBits = function getEncodedBits (errorCorrectionLevel, mask) {
1438
+ const data = ((errorCorrectionLevel.bit << 3) | mask)
1439
+ let d = data << 10
1440
+
1441
+ while (Utils.getBCHDigit(d) - G15_BCH >= 0) {
1442
+ d ^= (G15 << (Utils.getBCHDigit(d) - G15_BCH))
1443
+ }
1444
+
1445
+ // xor final data with mask pattern in order to ensure that
1446
+ // no combination of Error Correction Level and data mask pattern
1447
+ // will result in an all-zero data string
1448
+ return ((data << 10) | d) ^ G15_MASK
1449
+ }
1450
+
1451
+
1452
+ /***/ }),
1453
+
1454
+ /***/ 4713:
1455
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1456
+
1457
+ const GF = __webpack_require__(2731)
1458
+
1459
+ /**
1460
+ * Multiplies two polynomials inside Galois Field
1461
+ *
1462
+ * @param {Uint8Array} p1 Polynomial
1463
+ * @param {Uint8Array} p2 Polynomial
1464
+ * @return {Uint8Array} Product of p1 and p2
1465
+ */
1466
+ exports.mul = function mul (p1, p2) {
1467
+ const coeff = new Uint8Array(p1.length + p2.length - 1)
1468
+
1469
+ for (let i = 0; i < p1.length; i++) {
1470
+ for (let j = 0; j < p2.length; j++) {
1471
+ coeff[i + j] ^= GF.mul(p1[i], p2[j])
1472
+ }
1473
+ }
1474
+
1475
+ return coeff
1476
+ }
1477
+
1478
+ /**
1479
+ * Calculate the remainder of polynomials division
1480
+ *
1481
+ * @param {Uint8Array} divident Polynomial
1482
+ * @param {Uint8Array} divisor Polynomial
1483
+ * @return {Uint8Array} Remainder
1484
+ */
1485
+ exports.mod = function mod (divident, divisor) {
1486
+ let result = new Uint8Array(divident)
1487
+
1488
+ while ((result.length - divisor.length) >= 0) {
1489
+ const coeff = result[0]
1490
+
1491
+ for (let i = 0; i < divisor.length; i++) {
1492
+ result[i] ^= GF.mul(divisor[i], coeff)
1493
+ }
1494
+
1495
+ // remove all zeros from buffer head
1496
+ let offset = 0
1497
+ while (offset < result.length && result[offset] === 0) offset++
1498
+ result = result.slice(offset)
1499
+ }
1500
+
1501
+ return result
1502
+ }
1503
+
1504
+ /**
1505
+ * Generate an irreducible generator polynomial of specified degree
1506
+ * (used by Reed-Solomon encoder)
1507
+ *
1508
+ * @param {Number} degree Degree of the generator polynomial
1509
+ * @return {Uint8Array} Buffer containing polynomial coefficients
1510
+ */
1511
+ exports.generateECPolynomial = function generateECPolynomial (degree) {
1512
+ let poly = new Uint8Array([1])
1513
+ for (let i = 0; i < degree; i++) {
1514
+ poly = exports.mul(poly, new Uint8Array([1, GF.exp(i)]))
1515
+ }
1516
+
1517
+ return poly
1518
+ }
1519
+
1520
+
1521
+ /***/ }),
1522
+
1523
+ /***/ 4764:
1524
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1525
+
1526
+ const Polynomial = __webpack_require__(4713)
1527
+
1528
+ function ReedSolomonEncoder (degree) {
1529
+ this.genPoly = undefined
1530
+ this.degree = degree
1531
+
1532
+ if (this.degree) this.initialize(this.degree)
1533
+ }
1534
+
1535
+ /**
1536
+ * Initialize the encoder.
1537
+ * The input param should correspond to the number of error correction codewords.
1538
+ *
1539
+ * @param {Number} degree
1540
+ */
1541
+ ReedSolomonEncoder.prototype.initialize = function initialize (degree) {
1542
+ // create an irreducible generator polynomial
1543
+ this.degree = degree
1544
+ this.genPoly = Polynomial.generateECPolynomial(this.degree)
1545
+ }
1546
+
1547
+ /**
1548
+ * Encodes a chunk of data
1549
+ *
1550
+ * @param {Uint8Array} data Buffer containing input data
1551
+ * @return {Uint8Array} Buffer containing encoded data
1552
+ */
1553
+ ReedSolomonEncoder.prototype.encode = function encode (data) {
1554
+ if (!this.genPoly) {
1555
+ throw new Error('Encoder not initialized')
1556
+ }
1557
+
1558
+ // Calculate EC for this data block
1559
+ // extends data size to data+genPoly size
1560
+ const paddedData = new Uint8Array(data.length + this.degree)
1561
+ paddedData.set(data)
1562
+
1563
+ // The error correction codewords are the remainder after dividing the data codewords
1564
+ // by a generator polynomial
1565
+ const remainder = Polynomial.mod(paddedData, this.genPoly)
1566
+
1567
+ // return EC data blocks (last n byte, where n is the degree of genPoly)
1568
+ // If coefficients number in remainder are less than genPoly degree,
1569
+ // pad with 0s to the left to reach the needed number of coefficients
1570
+ const start = this.degree - remainder.length
1571
+ if (start > 0) {
1572
+ const buff = new Uint8Array(this.degree)
1573
+ buff.set(remainder, start)
1574
+
1575
+ return buff
1576
+ }
1577
+
1578
+ return remainder
1579
+ }
1580
+
1581
+ module.exports = ReedSolomonEncoder
1582
+
1583
+
1584
+ /***/ }),
1585
+
1586
+ /***/ 4861:
1587
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1588
+
1589
+ const Mode = __webpack_require__(208)
1590
+ const Utils = __webpack_require__(6886)
1591
+
1592
+ function KanjiData (data) {
1593
+ this.mode = Mode.KANJI
1594
+ this.data = data
1595
+ }
1596
+
1597
+ KanjiData.getBitsLength = function getBitsLength (length) {
1598
+ return length * 13
1599
+ }
1600
+
1601
+ KanjiData.prototype.getLength = function getLength () {
1602
+ return this.data.length
1603
+ }
1604
+
1605
+ KanjiData.prototype.getBitsLength = function getBitsLength () {
1606
+ return KanjiData.getBitsLength(this.data.length)
1607
+ }
1608
+
1609
+ KanjiData.prototype.write = function (bitBuffer) {
1610
+ let i
1611
+
1612
+ // In the Shift JIS system, Kanji characters are represented by a two byte combination.
1613
+ // These byte values are shifted from the JIS X 0208 values.
1614
+ // JIS X 0208 gives details of the shift coded representation.
1615
+ for (i = 0; i < this.data.length; i++) {
1616
+ let value = Utils.toSJIS(this.data[i])
1617
+
1618
+ // For characters with Shift JIS values from 0x8140 to 0x9FFC:
1619
+ if (value >= 0x8140 && value <= 0x9FFC) {
1620
+ // Subtract 0x8140 from Shift JIS value
1621
+ value -= 0x8140
1622
+
1623
+ // For characters with Shift JIS values from 0xE040 to 0xEBBF
1624
+ } else if (value >= 0xE040 && value <= 0xEBBF) {
1625
+ // Subtract 0xC140 from Shift JIS value
1626
+ value -= 0xC140
1627
+ } else {
1628
+ throw new Error(
1629
+ 'Invalid SJIS character: ' + this.data[i] + '\n' +
1630
+ 'Make sure your charset is UTF-8')
1631
+ }
1632
+
1633
+ // Multiply most significant byte of result by 0xC0
1634
+ // and add least significant byte to product
1635
+ value = (((value >>> 8) & 0xff) * 0xC0) + (value & 0xff)
1636
+
1637
+ // Convert result to a 13-bit binary string
1638
+ bitBuffer.put(value, 13)
1639
+ }
1640
+ }
1641
+
1642
+ module.exports = KanjiData
1643
+
1644
+
1645
+ /***/ }),
1646
+
1647
+ /***/ 5822:
1648
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1649
+
1650
+ const Mode = __webpack_require__(208)
1651
+
1652
+ function ByteData (data) {
1653
+ this.mode = Mode.BYTE
1654
+ if (typeof (data) === 'string') {
1655
+ this.data = new TextEncoder().encode(data)
1656
+ } else {
1657
+ this.data = new Uint8Array(data)
1658
+ }
1659
+ }
1660
+
1661
+ ByteData.getBitsLength = function getBitsLength (length) {
1662
+ return length * 8
1663
+ }
1664
+
1665
+ ByteData.prototype.getLength = function getLength () {
1666
+ return this.data.length
1667
+ }
1668
+
1669
+ ByteData.prototype.getBitsLength = function getBitsLength () {
1670
+ return ByteData.getBitsLength(this.data.length)
1671
+ }
1672
+
1673
+ ByteData.prototype.write = function (bitBuffer) {
1674
+ for (let i = 0, l = this.data.length; i < l; i++) {
1675
+ bitBuffer.put(this.data[i], 8)
1676
+ }
1677
+ }
1678
+
1679
+ module.exports = ByteData
1680
+
1681
+
1682
+ /***/ }),
1683
+
1684
+ /***/ 6320:
1685
+ /***/ ((module) => {
1686
+
1687
+ "use strict";
1688
+
1689
+
1690
+ /******************************************************************************
1691
+ * Created 2008-08-19.
1692
+ *
1693
+ * Dijkstra path-finding functions. Adapted from the Dijkstar Python project.
1694
+ *
1695
+ * Copyright (C) 2008
1696
+ * Wyatt Baldwin <self@wyattbaldwin.com>
1697
+ * All rights reserved
1698
+ *
1699
+ * Licensed under the MIT license.
1700
+ *
1701
+ * http://www.opensource.org/licenses/mit-license.php
1702
+ *
1703
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1704
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1705
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1706
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1707
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1708
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1709
+ * THE SOFTWARE.
1710
+ *****************************************************************************/
1711
+ var dijkstra = {
1712
+ single_source_shortest_paths: function(graph, s, d) {
1713
+ // Predecessor map for each node that has been encountered.
1714
+ // node ID => predecessor node ID
1715
+ var predecessors = {};
1716
+
1717
+ // Costs of shortest paths from s to all nodes encountered.
1718
+ // node ID => cost
1719
+ var costs = {};
1720
+ costs[s] = 0;
1721
+
1722
+ // Costs of shortest paths from s to all nodes encountered; differs from
1723
+ // `costs` in that it provides easy access to the node that currently has
1724
+ // the known shortest path from s.
1725
+ // XXX: Do we actually need both `costs` and `open`?
1726
+ var open = dijkstra.PriorityQueue.make();
1727
+ open.push(s, 0);
1728
+
1729
+ var closest,
1730
+ u, v,
1731
+ cost_of_s_to_u,
1732
+ adjacent_nodes,
1733
+ cost_of_e,
1734
+ cost_of_s_to_u_plus_cost_of_e,
1735
+ cost_of_s_to_v,
1736
+ first_visit;
1737
+ while (!open.empty()) {
1738
+ // In the nodes remaining in graph that have a known cost from s,
1739
+ // find the node, u, that currently has the shortest path from s.
1740
+ closest = open.pop();
1741
+ u = closest.value;
1742
+ cost_of_s_to_u = closest.cost;
1743
+
1744
+ // Get nodes adjacent to u...
1745
+ adjacent_nodes = graph[u] || {};
1746
+
1747
+ // ...and explore the edges that connect u to those nodes, updating
1748
+ // the cost of the shortest paths to any or all of those nodes as
1749
+ // necessary. v is the node across the current edge from u.
1750
+ for (v in adjacent_nodes) {
1751
+ if (adjacent_nodes.hasOwnProperty(v)) {
1752
+ // Get the cost of the edge running from u to v.
1753
+ cost_of_e = adjacent_nodes[v];
1754
+
1755
+ // Cost of s to u plus the cost of u to v across e--this is *a*
1756
+ // cost from s to v that may or may not be less than the current
1757
+ // known cost to v.
1758
+ cost_of_s_to_u_plus_cost_of_e = cost_of_s_to_u + cost_of_e;
1759
+
1760
+ // If we haven't visited v yet OR if the current known cost from s to
1761
+ // v is greater than the new cost we just found (cost of s to u plus
1762
+ // cost of u to v across e), update v's cost in the cost list and
1763
+ // update v's predecessor in the predecessor list (it's now u).
1764
+ cost_of_s_to_v = costs[v];
1765
+ first_visit = (typeof costs[v] === 'undefined');
1766
+ if (first_visit || cost_of_s_to_v > cost_of_s_to_u_plus_cost_of_e) {
1767
+ costs[v] = cost_of_s_to_u_plus_cost_of_e;
1768
+ open.push(v, cost_of_s_to_u_plus_cost_of_e);
1769
+ predecessors[v] = u;
1770
+ }
1771
+ }
1772
+ }
1773
+ }
1774
+
1775
+ if (typeof d !== 'undefined' && typeof costs[d] === 'undefined') {
1776
+ var msg = ['Could not find a path from ', s, ' to ', d, '.'].join('');
1777
+ throw new Error(msg);
1778
+ }
1779
+
1780
+ return predecessors;
1781
+ },
1782
+
1783
+ extract_shortest_path_from_predecessor_list: function(predecessors, d) {
1784
+ var nodes = [];
1785
+ var u = d;
1786
+ var predecessor;
1787
+ while (u) {
1788
+ nodes.push(u);
1789
+ predecessor = predecessors[u];
1790
+ u = predecessors[u];
1791
+ }
1792
+ nodes.reverse();
1793
+ return nodes;
1794
+ },
1795
+
1796
+ find_path: function(graph, s, d) {
1797
+ var predecessors = dijkstra.single_source_shortest_paths(graph, s, d);
1798
+ return dijkstra.extract_shortest_path_from_predecessor_list(
1799
+ predecessors, d);
1800
+ },
1801
+
1802
+ /**
1803
+ * A very naive priority queue implementation.
1804
+ */
1805
+ PriorityQueue: {
1806
+ make: function (opts) {
1807
+ var T = dijkstra.PriorityQueue,
1808
+ t = {},
1809
+ key;
1810
+ opts = opts || {};
1811
+ for (key in T) {
1812
+ if (T.hasOwnProperty(key)) {
1813
+ t[key] = T[key];
1814
+ }
1815
+ }
1816
+ t.queue = [];
1817
+ t.sorter = opts.sorter || T.default_sorter;
1818
+ return t;
1819
+ },
1820
+
1821
+ default_sorter: function (a, b) {
1822
+ return a.cost - b.cost;
1823
+ },
1824
+
1825
+ /**
1826
+ * Add a new item to the queue and ensure the highest priority element
1827
+ * is at the front of the queue.
1828
+ */
1829
+ push: function (value, cost) {
1830
+ var item = {value: value, cost: cost};
1831
+ this.queue.push(item);
1832
+ this.queue.sort(this.sorter);
1833
+ },
1834
+
1835
+ /**
1836
+ * Return the highest priority element in the queue.
1837
+ */
1838
+ pop: function () {
1839
+ return this.queue.shift();
1840
+ },
1841
+
1842
+ empty: function () {
1843
+ return this.queue.length === 0;
1844
+ }
1845
+ }
1846
+ };
1847
+
1848
+
1849
+ // node.js module exports
1850
+ if (true) {
1851
+ module.exports = dijkstra;
1852
+ }
1853
+
1854
+
1855
+ /***/ }),
1856
+
1857
+ /***/ 6421:
1858
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1859
+
1860
+ /**
1861
+ * Alignment pattern are fixed reference pattern in defined positions
1862
+ * in a matrix symbology, which enables the decode software to re-synchronise
1863
+ * the coordinate mapping of the image modules in the event of moderate amounts
1864
+ * of distortion of the image.
1865
+ *
1866
+ * Alignment patterns are present only in QR Code symbols of version 2 or larger
1867
+ * and their number depends on the symbol version.
1868
+ */
1869
+
1870
+ const getSymbolSize = (__webpack_require__(6886).getSymbolSize)
1871
+
1872
+ /**
1873
+ * Calculate the row/column coordinates of the center module of each alignment pattern
1874
+ * for the specified QR Code version.
1875
+ *
1876
+ * The alignment patterns are positioned symmetrically on either side of the diagonal
1877
+ * running from the top left corner of the symbol to the bottom right corner.
1878
+ *
1879
+ * Since positions are simmetrical only half of the coordinates are returned.
1880
+ * Each item of the array will represent in turn the x and y coordinate.
1881
+ * @see {@link getPositions}
1882
+ *
1883
+ * @param {Number} version QR Code version
1884
+ * @return {Array} Array of coordinate
1885
+ */
1886
+ exports.getRowColCoords = function getRowColCoords (version) {
1887
+ if (version === 1) return []
1888
+
1889
+ const posCount = Math.floor(version / 7) + 2
1890
+ const size = getSymbolSize(version)
1891
+ const intervals = size === 145 ? 26 : Math.ceil((size - 13) / (2 * posCount - 2)) * 2
1892
+ const positions = [size - 7] // Last coord is always (size - 7)
1893
+
1894
+ for (let i = 1; i < posCount - 1; i++) {
1895
+ positions[i] = positions[i - 1] - intervals
1896
+ }
1897
+
1898
+ positions.push(6) // First coord is always 6
1899
+
1900
+ return positions.reverse()
1901
+ }
1902
+
1903
+ /**
1904
+ * Returns an array containing the positions of each alignment pattern.
1905
+ * Each array's element represent the center point of the pattern as (x, y) coordinates
1906
+ *
1907
+ * Coordinates are calculated expanding the row/column coordinates returned by {@link getRowColCoords}
1908
+ * and filtering out the items that overlaps with finder pattern
1909
+ *
1910
+ * @example
1911
+ * For a Version 7 symbol {@link getRowColCoords} returns values 6, 22 and 38.
1912
+ * The alignment patterns, therefore, are to be centered on (row, column)
1913
+ * positions (6,22), (22,6), (22,22), (22,38), (38,22), (38,38).
1914
+ * Note that the coordinates (6,6), (6,38), (38,6) are occupied by finder patterns
1915
+ * and are not therefore used for alignment patterns.
1916
+ *
1917
+ * let pos = getPositions(7)
1918
+ * // [[6,22], [22,6], [22,22], [22,38], [38,22], [38,38]]
1919
+ *
1920
+ * @param {Number} version QR Code version
1921
+ * @return {Array} Array of coordinates
1922
+ */
1923
+ exports.getPositions = function getPositions (version) {
1924
+ const coords = []
1925
+ const pos = exports.getRowColCoords(version)
1926
+ const posLength = pos.length
1927
+
1928
+ for (let i = 0; i < posLength; i++) {
1929
+ for (let j = 0; j < posLength; j++) {
1930
+ // Skip if position is occupied by finder patterns
1931
+ if ((i === 0 && j === 0) || // top-left
1932
+ (i === 0 && j === posLength - 1) || // bottom-left
1933
+ (i === posLength - 1 && j === 0)) { // top-right
1934
+ continue
1935
+ }
1936
+
1937
+ coords.push([pos[i], pos[j]])
1938
+ }
1939
+ }
1940
+
1941
+ return coords
1942
+ }
1943
+
1944
+
1945
+ /***/ }),
1946
+
1947
+ /***/ 6756:
1948
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1949
+
1950
+ const Utils = __webpack_require__(2726)
1951
+
1952
+ function getColorAttrib (color, attrib) {
1953
+ const alpha = color.a / 255
1954
+ const str = attrib + '="' + color.hex + '"'
1955
+
1956
+ return alpha < 1
1957
+ ? str + ' ' + attrib + '-opacity="' + alpha.toFixed(2).slice(1) + '"'
1958
+ : str
1959
+ }
1960
+
1961
+ function svgCmd (cmd, x, y) {
1962
+ let str = cmd + x
1963
+ if (typeof y !== 'undefined') str += ' ' + y
1964
+
1965
+ return str
1966
+ }
1967
+
1968
+ function qrToPath (data, size, margin) {
1969
+ let path = ''
1970
+ let moveBy = 0
1971
+ let newRow = false
1972
+ let lineLength = 0
1973
+
1974
+ for (let i = 0; i < data.length; i++) {
1975
+ const col = Math.floor(i % size)
1976
+ const row = Math.floor(i / size)
1977
+
1978
+ if (!col && !newRow) newRow = true
1979
+
1980
+ if (data[i]) {
1981
+ lineLength++
1982
+
1983
+ if (!(i > 0 && col > 0 && data[i - 1])) {
1984
+ path += newRow
1985
+ ? svgCmd('M', col + margin, 0.5 + row + margin)
1986
+ : svgCmd('m', moveBy, 0)
1987
+
1988
+ moveBy = 0
1989
+ newRow = false
1990
+ }
1991
+
1992
+ if (!(col + 1 < size && data[i + 1])) {
1993
+ path += svgCmd('h', lineLength)
1994
+ lineLength = 0
1995
+ }
1996
+ } else {
1997
+ moveBy++
1998
+ }
1999
+ }
2000
+
2001
+ return path
2002
+ }
2003
+
2004
+ exports.render = function render (qrData, options, cb) {
2005
+ const opts = Utils.getOptions(options)
2006
+ const size = qrData.modules.size
2007
+ const data = qrData.modules.data
2008
+ const qrcodesize = size + opts.margin * 2
2009
+
2010
+ const bg = !opts.color.light.a
2011
+ ? ''
2012
+ : '<path ' + getColorAttrib(opts.color.light, 'fill') +
2013
+ ' d="M0 0h' + qrcodesize + 'v' + qrcodesize + 'H0z"/>'
2014
+
2015
+ const path =
2016
+ '<path ' + getColorAttrib(opts.color.dark, 'stroke') +
2017
+ ' d="' + qrToPath(data, size, opts.margin) + '"/>'
2018
+
2019
+ const viewBox = 'viewBox="' + '0 0 ' + qrcodesize + ' ' + qrcodesize + '"'
2020
+
2021
+ const width = !opts.width ? '' : 'width="' + opts.width + '" height="' + opts.width + '" '
2022
+
2023
+ const svgTag = '<svg xmlns="http://www.w3.org/2000/svg" ' + width + viewBox + ' shape-rendering="crispEdges">' + bg + path + '</svg>\n'
2024
+
2025
+ if (typeof cb === 'function') {
2026
+ cb(null, svgTag)
2027
+ }
2028
+
2029
+ return svgTag
2030
+ }
2031
+
2032
+
2033
+ /***/ }),
2034
+
2035
+ /***/ 6886:
2036
+ /***/ ((__unused_webpack_module, exports) => {
2037
+
2038
+ let toSJISFunction
2039
+ const CODEWORDS_COUNT = [
2040
+ 0, // Not used
2041
+ 26, 44, 70, 100, 134, 172, 196, 242, 292, 346,
2042
+ 404, 466, 532, 581, 655, 733, 815, 901, 991, 1085,
2043
+ 1156, 1258, 1364, 1474, 1588, 1706, 1828, 1921, 2051, 2185,
2044
+ 2323, 2465, 2611, 2761, 2876, 3034, 3196, 3362, 3532, 3706
2045
+ ]
2046
+
2047
+ /**
2048
+ * Returns the QR Code size for the specified version
2049
+ *
2050
+ * @param {Number} version QR Code version
2051
+ * @return {Number} size of QR code
2052
+ */
2053
+ exports.getSymbolSize = function getSymbolSize (version) {
2054
+ if (!version) throw new Error('"version" cannot be null or undefined')
2055
+ if (version < 1 || version > 40) throw new Error('"version" should be in range from 1 to 40')
2056
+ return version * 4 + 17
2057
+ }
2058
+
2059
+ /**
2060
+ * Returns the total number of codewords used to store data and EC information.
2061
+ *
2062
+ * @param {Number} version QR Code version
2063
+ * @return {Number} Data length in bits
2064
+ */
2065
+ exports.getSymbolTotalCodewords = function getSymbolTotalCodewords (version) {
2066
+ return CODEWORDS_COUNT[version]
2067
+ }
2068
+
2069
+ /**
2070
+ * Encode data with Bose-Chaudhuri-Hocquenghem
2071
+ *
2072
+ * @param {Number} data Value to encode
2073
+ * @return {Number} Encoded value
2074
+ */
2075
+ exports.getBCHDigit = function (data) {
2076
+ let digit = 0
2077
+
2078
+ while (data !== 0) {
2079
+ digit++
2080
+ data >>>= 1
2081
+ }
2082
+
2083
+ return digit
2084
+ }
2085
+
2086
+ exports.setToSJISFunction = function setToSJISFunction (f) {
2087
+ if (typeof f !== 'function') {
2088
+ throw new Error('"toSJISFunc" is not a valid function.')
2089
+ }
2090
+
2091
+ toSJISFunction = f
2092
+ }
2093
+
2094
+ exports.isKanjiModeEnabled = function () {
2095
+ return typeof toSJISFunction !== 'undefined'
2096
+ }
2097
+
2098
+ exports.toSJIS = function toSJIS (kanji) {
2099
+ return toSJISFunction(kanji)
2100
+ }
2101
+
2102
+
2103
+ /***/ }),
2104
+
2105
+ /***/ 7044:
2106
+ /***/ ((__unused_webpack_module, exports) => {
2107
+
2108
+ const numeric = '[0-9]+'
2109
+ const alphanumeric = '[A-Z $%*+\\-./:]+'
2110
+ let kanji = '(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|' +
2111
+ '[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|' +
2112
+ '[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|' +
2113
+ '[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+'
2114
+ kanji = kanji.replace(/u/g, '\\u')
2115
+
2116
+ const byte = '(?:(?![A-Z0-9 $%*+\\-./:]|' + kanji + ')(?:.|[\r\n]))+'
2117
+
2118
+ exports.KANJI = new RegExp(kanji, 'g')
2119
+ exports.BYTE_KANJI = new RegExp('[^A-Z0-9 $%*+\\-./:]+', 'g')
2120
+ exports.BYTE = new RegExp(byte, 'g')
2121
+ exports.NUMERIC = new RegExp(numeric, 'g')
2122
+ exports.ALPHANUMERIC = new RegExp(alphanumeric, 'g')
2123
+
2124
+ const TEST_KANJI = new RegExp('^' + kanji + '$')
2125
+ const TEST_NUMERIC = new RegExp('^' + numeric + '$')
2126
+ const TEST_ALPHANUMERIC = new RegExp('^[A-Z0-9 $%*+\\-./:]+$')
2127
+
2128
+ exports.testKanji = function testKanji (str) {
2129
+ return TEST_KANJI.test(str)
2130
+ }
2131
+
2132
+ exports.testNumeric = function testNumeric (str) {
2133
+ return TEST_NUMERIC.test(str)
2134
+ }
2135
+
2136
+ exports.testAlphanumeric = function testAlphanumeric (str) {
2137
+ return TEST_ALPHANUMERIC.test(str)
2138
+ }
2139
+
2140
+
2141
+ /***/ }),
2142
+
2143
+ /***/ 7518:
2144
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2145
+
2146
+ const ECLevel = __webpack_require__(9953)
2147
+
2148
+ const EC_BLOCKS_TABLE = [
2149
+ // L M Q H
2150
+ 1, 1, 1, 1,
2151
+ 1, 1, 1, 1,
2152
+ 1, 1, 2, 2,
2153
+ 1, 2, 2, 4,
2154
+ 1, 2, 4, 4,
2155
+ 2, 4, 4, 4,
2156
+ 2, 4, 6, 5,
2157
+ 2, 4, 6, 6,
2158
+ 2, 5, 8, 8,
2159
+ 4, 5, 8, 8,
2160
+ 4, 5, 8, 11,
2161
+ 4, 8, 10, 11,
2162
+ 4, 9, 12, 16,
2163
+ 4, 9, 16, 16,
2164
+ 6, 10, 12, 18,
2165
+ 6, 10, 17, 16,
2166
+ 6, 11, 16, 19,
2167
+ 6, 13, 18, 21,
2168
+ 7, 14, 21, 25,
2169
+ 8, 16, 20, 25,
2170
+ 8, 17, 23, 25,
2171
+ 9, 17, 23, 34,
2172
+ 9, 18, 25, 30,
2173
+ 10, 20, 27, 32,
2174
+ 12, 21, 29, 35,
2175
+ 12, 23, 34, 37,
2176
+ 12, 25, 34, 40,
2177
+ 13, 26, 35, 42,
2178
+ 14, 28, 38, 45,
2179
+ 15, 29, 40, 48,
2180
+ 16, 31, 43, 51,
2181
+ 17, 33, 45, 54,
2182
+ 18, 35, 48, 57,
2183
+ 19, 37, 51, 60,
2184
+ 19, 38, 53, 63,
2185
+ 20, 40, 56, 66,
2186
+ 21, 43, 59, 70,
2187
+ 22, 45, 62, 74,
2188
+ 24, 47, 65, 77,
2189
+ 25, 49, 68, 81
2190
+ ]
2191
+
2192
+ const EC_CODEWORDS_TABLE = [
2193
+ // L M Q H
2194
+ 7, 10, 13, 17,
2195
+ 10, 16, 22, 28,
2196
+ 15, 26, 36, 44,
2197
+ 20, 36, 52, 64,
2198
+ 26, 48, 72, 88,
2199
+ 36, 64, 96, 112,
2200
+ 40, 72, 108, 130,
2201
+ 48, 88, 132, 156,
2202
+ 60, 110, 160, 192,
2203
+ 72, 130, 192, 224,
2204
+ 80, 150, 224, 264,
2205
+ 96, 176, 260, 308,
2206
+ 104, 198, 288, 352,
2207
+ 120, 216, 320, 384,
2208
+ 132, 240, 360, 432,
2209
+ 144, 280, 408, 480,
2210
+ 168, 308, 448, 532,
2211
+ 180, 338, 504, 588,
2212
+ 196, 364, 546, 650,
2213
+ 224, 416, 600, 700,
2214
+ 224, 442, 644, 750,
2215
+ 252, 476, 690, 816,
2216
+ 270, 504, 750, 900,
2217
+ 300, 560, 810, 960,
2218
+ 312, 588, 870, 1050,
2219
+ 336, 644, 952, 1110,
2220
+ 360, 700, 1020, 1200,
2221
+ 390, 728, 1050, 1260,
2222
+ 420, 784, 1140, 1350,
2223
+ 450, 812, 1200, 1440,
2224
+ 480, 868, 1290, 1530,
2225
+ 510, 924, 1350, 1620,
2226
+ 540, 980, 1440, 1710,
2227
+ 570, 1036, 1530, 1800,
2228
+ 570, 1064, 1590, 1890,
2229
+ 600, 1120, 1680, 1980,
2230
+ 630, 1204, 1770, 2100,
2231
+ 660, 1260, 1860, 2220,
2232
+ 720, 1316, 1950, 2310,
2233
+ 750, 1372, 2040, 2430
2234
+ ]
2235
+
2236
+ /**
2237
+ * Returns the number of error correction block that the QR Code should contain
2238
+ * for the specified version and error correction level.
2239
+ *
2240
+ * @param {Number} version QR Code version
2241
+ * @param {Number} errorCorrectionLevel Error correction level
2242
+ * @return {Number} Number of error correction blocks
2243
+ */
2244
+ exports.getBlocksCount = function getBlocksCount (version, errorCorrectionLevel) {
2245
+ switch (errorCorrectionLevel) {
2246
+ case ECLevel.L:
2247
+ return EC_BLOCKS_TABLE[(version - 1) * 4 + 0]
2248
+ case ECLevel.M:
2249
+ return EC_BLOCKS_TABLE[(version - 1) * 4 + 1]
2250
+ case ECLevel.Q:
2251
+ return EC_BLOCKS_TABLE[(version - 1) * 4 + 2]
2252
+ case ECLevel.H:
2253
+ return EC_BLOCKS_TABLE[(version - 1) * 4 + 3]
2254
+ default:
2255
+ return undefined
2256
+ }
2257
+ }
2258
+
2259
+ /**
2260
+ * Returns the number of error correction codewords to use for the specified
2261
+ * version and error correction level.
2262
+ *
2263
+ * @param {Number} version QR Code version
2264
+ * @param {Number} errorCorrectionLevel Error correction level
2265
+ * @return {Number} Number of error correction codewords
2266
+ */
2267
+ exports.getTotalCodewordsCount = function getTotalCodewordsCount (version, errorCorrectionLevel) {
2268
+ switch (errorCorrectionLevel) {
2269
+ case ECLevel.L:
2270
+ return EC_CODEWORDS_TABLE[(version - 1) * 4 + 0]
2271
+ case ECLevel.M:
2272
+ return EC_CODEWORDS_TABLE[(version - 1) * 4 + 1]
2273
+ case ECLevel.Q:
2274
+ return EC_CODEWORDS_TABLE[(version - 1) * 4 + 2]
2275
+ case ECLevel.H:
2276
+ return EC_CODEWORDS_TABLE[(version - 1) * 4 + 3]
2277
+ default:
2278
+ return undefined
2279
+ }
2280
+ }
2281
+
2282
+
2283
+ /***/ }),
2284
+
2285
+ /***/ 7583:
2286
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2287
+
2288
+
2289
+ const canPromise = __webpack_require__(1333)
2290
+
2291
+ const QRCode = __webpack_require__(157)
2292
+ const CanvasRenderer = __webpack_require__(7899)
2293
+ const SvgRenderer = __webpack_require__(6756)
2294
+
2295
+ function renderCanvas (renderFunc, canvas, text, opts, cb) {
2296
+ const args = [].slice.call(arguments, 1)
2297
+ const argsNum = args.length
2298
+ const isLastArgCb = typeof args[argsNum - 1] === 'function'
2299
+
2300
+ if (!isLastArgCb && !canPromise()) {
2301
+ throw new Error('Callback required as last argument')
2302
+ }
2303
+
2304
+ if (isLastArgCb) {
2305
+ if (argsNum < 2) {
2306
+ throw new Error('Too few arguments provided')
2307
+ }
2308
+
2309
+ if (argsNum === 2) {
2310
+ cb = text
2311
+ text = canvas
2312
+ canvas = opts = undefined
2313
+ } else if (argsNum === 3) {
2314
+ if (canvas.getContext && typeof cb === 'undefined') {
2315
+ cb = opts
2316
+ opts = undefined
2317
+ } else {
2318
+ cb = opts
2319
+ opts = text
2320
+ text = canvas
2321
+ canvas = undefined
2322
+ }
2323
+ }
2324
+ } else {
2325
+ if (argsNum < 1) {
2326
+ throw new Error('Too few arguments provided')
2327
+ }
2328
+
2329
+ if (argsNum === 1) {
2330
+ text = canvas
2331
+ canvas = opts = undefined
2332
+ } else if (argsNum === 2 && !canvas.getContext) {
2333
+ opts = text
2334
+ text = canvas
2335
+ canvas = undefined
2336
+ }
2337
+
2338
+ return new Promise(function (resolve, reject) {
2339
+ try {
2340
+ const data = QRCode.create(text, opts)
2341
+ resolve(renderFunc(data, canvas, opts))
2342
+ } catch (e) {
2343
+ reject(e)
2344
+ }
2345
+ })
2346
+ }
2347
+
2348
+ try {
2349
+ const data = QRCode.create(text, opts)
2350
+ cb(null, renderFunc(data, canvas, opts))
2351
+ } catch (e) {
2352
+ cb(e)
2353
+ }
2354
+ }
2355
+
2356
+ exports.create = QRCode.create
2357
+ exports.toCanvas = renderCanvas.bind(null, CanvasRenderer.render)
2358
+ exports.toDataURL = renderCanvas.bind(null, CanvasRenderer.renderToDataURL)
2359
+
2360
+ // only svg for now.
2361
+ exports.toString = renderCanvas.bind(null, function (data, _, opts) {
2362
+ return SvgRenderer.render(data, opts)
2363
+ })
2364
+
2365
+
2366
+ /***/ }),
2367
+
2368
+ /***/ 7756:
2369
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2370
+
2371
+ const getSymbolSize = (__webpack_require__(6886).getSymbolSize)
2372
+ const FINDER_PATTERN_SIZE = 7
2373
+
2374
+ /**
2375
+ * Returns an array containing the positions of each finder pattern.
2376
+ * Each array's element represent the top-left point of the pattern as (x, y) coordinates
2377
+ *
2378
+ * @param {Number} version QR Code version
2379
+ * @return {Array} Array of coordinates
2380
+ */
2381
+ exports.getPositions = function getPositions (version) {
2382
+ const size = getSymbolSize(version)
2383
+
2384
+ return [
2385
+ // top-left
2386
+ [0, 0],
2387
+ // top-right
2388
+ [size - FINDER_PATTERN_SIZE, 0],
2389
+ // bottom-left
2390
+ [0, size - FINDER_PATTERN_SIZE]
2391
+ ]
2392
+ }
2393
+
2394
+
2395
+ /***/ }),
2396
+
2397
+ /***/ 7899:
2398
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2399
+
2400
+ const Utils = __webpack_require__(2726)
2401
+
2402
+ function clearCanvas (ctx, canvas, size) {
2403
+ ctx.clearRect(0, 0, canvas.width, canvas.height)
2404
+
2405
+ if (!canvas.style) canvas.style = {}
2406
+ canvas.height = size
2407
+ canvas.width = size
2408
+ canvas.style.height = size + 'px'
2409
+ canvas.style.width = size + 'px'
2410
+ }
2411
+
2412
+ function getCanvasElement () {
2413
+ try {
2414
+ return document.createElement('canvas')
2415
+ } catch (e) {
2416
+ throw new Error('You need to specify a canvas element')
2417
+ }
2418
+ }
2419
+
2420
+ exports.render = function render (qrData, canvas, options) {
2421
+ let opts = options
2422
+ let canvasEl = canvas
2423
+
2424
+ if (typeof opts === 'undefined' && (!canvas || !canvas.getContext)) {
2425
+ opts = canvas
2426
+ canvas = undefined
2427
+ }
2428
+
2429
+ if (!canvas) {
2430
+ canvasEl = getCanvasElement()
2431
+ }
2432
+
2433
+ opts = Utils.getOptions(opts)
2434
+ const size = Utils.getImageWidth(qrData.modules.size, opts)
2435
+
2436
+ const ctx = canvasEl.getContext('2d')
2437
+ const image = ctx.createImageData(size, size)
2438
+ Utils.qrToImageData(image.data, qrData, opts)
2439
+
2440
+ clearCanvas(ctx, canvasEl, size)
2441
+ ctx.putImageData(image, 0, 0)
2442
+
2443
+ return canvasEl
2444
+ }
2445
+
2446
+ exports.renderToDataURL = function renderToDataURL (qrData, canvas, options) {
2447
+ let opts = options
2448
+
2449
+ if (typeof opts === 'undefined' && (!canvas || !canvas.getContext)) {
2450
+ opts = canvas
2451
+ canvas = undefined
2452
+ }
2453
+
2454
+ if (!opts) opts = {}
2455
+
2456
+ const canvasEl = exports.render(qrData, canvas, opts)
2457
+
2458
+ const type = opts.type || 'image/png'
2459
+ const rendererOpts = opts.rendererOpts || {}
2460
+
2461
+ return canvasEl.toDataURL(type, rendererOpts.quality)
2462
+ }
2463
+
2464
+
2465
+ /***/ }),
2466
+
2467
+ /***/ 8820:
2468
+ /***/ ((module) => {
2469
+
2470
+ /**
2471
+ * Helper class to handle QR Code symbol modules
2472
+ *
2473
+ * @param {Number} size Symbol size
2474
+ */
2475
+ function BitMatrix (size) {
2476
+ if (!size || size < 1) {
2477
+ throw new Error('BitMatrix size must be defined and greater than 0')
2478
+ }
2479
+
2480
+ this.size = size
2481
+ this.data = new Uint8Array(size * size)
2482
+ this.reservedBit = new Uint8Array(size * size)
2483
+ }
2484
+
2485
+ /**
2486
+ * Set bit value at specified location
2487
+ * If reserved flag is set, this bit will be ignored during masking process
2488
+ *
2489
+ * @param {Number} row
2490
+ * @param {Number} col
2491
+ * @param {Boolean} value
2492
+ * @param {Boolean} reserved
2493
+ */
2494
+ BitMatrix.prototype.set = function (row, col, value, reserved) {
2495
+ const index = row * this.size + col
2496
+ this.data[index] = value
2497
+ if (reserved) this.reservedBit[index] = true
2498
+ }
2499
+
2500
+ /**
2501
+ * Returns bit value at specified location
2502
+ *
2503
+ * @param {Number} row
2504
+ * @param {Number} col
2505
+ * @return {Boolean}
2506
+ */
2507
+ BitMatrix.prototype.get = function (row, col) {
2508
+ return this.data[row * this.size + col]
2509
+ }
2510
+
2511
+ /**
2512
+ * Applies xor operator at specified location
2513
+ * (used during masking process)
2514
+ *
2515
+ * @param {Number} row
2516
+ * @param {Number} col
2517
+ * @param {Boolean} value
2518
+ */
2519
+ BitMatrix.prototype.xor = function (row, col, value) {
2520
+ this.data[row * this.size + col] ^= value
2521
+ }
2522
+
2523
+ /**
2524
+ * Check if bit at specified location is reserved
2525
+ *
2526
+ * @param {Number} row
2527
+ * @param {Number} col
2528
+ * @return {Boolean}
2529
+ */
2530
+ BitMatrix.prototype.isReserved = function (row, col) {
2531
+ return this.reservedBit[row * this.size + col]
2532
+ }
2533
+
2534
+ module.exports = BitMatrix
2535
+
2536
+
2537
+ /***/ }),
2538
+
2539
+ /***/ 9801:
2540
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2541
+
2542
+ const Mode = __webpack_require__(208)
2543
+ const NumericData = __webpack_require__(4357)
2544
+ const AlphanumericData = __webpack_require__(1433)
2545
+ const ByteData = __webpack_require__(5822)
2546
+ const KanjiData = __webpack_require__(4861)
2547
+ const Regex = __webpack_require__(7044)
2548
+ const Utils = __webpack_require__(6886)
2549
+ const dijkstra = __webpack_require__(6320)
2550
+
2551
+ /**
2552
+ * Returns UTF8 byte length
2553
+ *
2554
+ * @param {String} str Input string
2555
+ * @return {Number} Number of byte
2556
+ */
2557
+ function getStringByteLength (str) {
2558
+ return unescape(encodeURIComponent(str)).length
2559
+ }
2560
+
2561
+ /**
2562
+ * Get a list of segments of the specified mode
2563
+ * from a string
2564
+ *
2565
+ * @param {Mode} mode Segment mode
2566
+ * @param {String} str String to process
2567
+ * @return {Array} Array of object with segments data
2568
+ */
2569
+ function getSegments (regex, mode, str) {
2570
+ const segments = []
2571
+ let result
2572
+
2573
+ while ((result = regex.exec(str)) !== null) {
2574
+ segments.push({
2575
+ data: result[0],
2576
+ index: result.index,
2577
+ mode: mode,
2578
+ length: result[0].length
2579
+ })
2580
+ }
2581
+
2582
+ return segments
2583
+ }
2584
+
2585
+ /**
2586
+ * Extracts a series of segments with the appropriate
2587
+ * modes from a string
2588
+ *
2589
+ * @param {String} dataStr Input string
2590
+ * @return {Array} Array of object with segments data
2591
+ */
2592
+ function getSegmentsFromString (dataStr) {
2593
+ const numSegs = getSegments(Regex.NUMERIC, Mode.NUMERIC, dataStr)
2594
+ const alphaNumSegs = getSegments(Regex.ALPHANUMERIC, Mode.ALPHANUMERIC, dataStr)
2595
+ let byteSegs
2596
+ let kanjiSegs
2597
+
2598
+ if (Utils.isKanjiModeEnabled()) {
2599
+ byteSegs = getSegments(Regex.BYTE, Mode.BYTE, dataStr)
2600
+ kanjiSegs = getSegments(Regex.KANJI, Mode.KANJI, dataStr)
2601
+ } else {
2602
+ byteSegs = getSegments(Regex.BYTE_KANJI, Mode.BYTE, dataStr)
2603
+ kanjiSegs = []
2604
+ }
2605
+
2606
+ const segs = numSegs.concat(alphaNumSegs, byteSegs, kanjiSegs)
2607
+
2608
+ return segs
2609
+ .sort(function (s1, s2) {
2610
+ return s1.index - s2.index
2611
+ })
2612
+ .map(function (obj) {
2613
+ return {
2614
+ data: obj.data,
2615
+ mode: obj.mode,
2616
+ length: obj.length
2617
+ }
2618
+ })
2619
+ }
2620
+
2621
+ /**
2622
+ * Returns how many bits are needed to encode a string of
2623
+ * specified length with the specified mode
2624
+ *
2625
+ * @param {Number} length String length
2626
+ * @param {Mode} mode Segment mode
2627
+ * @return {Number} Bit length
2628
+ */
2629
+ function getSegmentBitsLength (length, mode) {
2630
+ switch (mode) {
2631
+ case Mode.NUMERIC:
2632
+ return NumericData.getBitsLength(length)
2633
+ case Mode.ALPHANUMERIC:
2634
+ return AlphanumericData.getBitsLength(length)
2635
+ case Mode.KANJI:
2636
+ return KanjiData.getBitsLength(length)
2637
+ case Mode.BYTE:
2638
+ return ByteData.getBitsLength(length)
2639
+ }
2640
+ }
2641
+
2642
+ /**
2643
+ * Merges adjacent segments which have the same mode
2644
+ *
2645
+ * @param {Array} segs Array of object with segments data
2646
+ * @return {Array} Array of object with segments data
2647
+ */
2648
+ function mergeSegments (segs) {
2649
+ return segs.reduce(function (acc, curr) {
2650
+ const prevSeg = acc.length - 1 >= 0 ? acc[acc.length - 1] : null
2651
+ if (prevSeg && prevSeg.mode === curr.mode) {
2652
+ acc[acc.length - 1].data += curr.data
2653
+ return acc
2654
+ }
2655
+
2656
+ acc.push(curr)
2657
+ return acc
2658
+ }, [])
2659
+ }
2660
+
2661
+ /**
2662
+ * Generates a list of all possible nodes combination which
2663
+ * will be used to build a segments graph.
2664
+ *
2665
+ * Nodes are divided by groups. Each group will contain a list of all the modes
2666
+ * in which is possible to encode the given text.
2667
+ *
2668
+ * For example the text '12345' can be encoded as Numeric, Alphanumeric or Byte.
2669
+ * The group for '12345' will contain then 3 objects, one for each
2670
+ * possible encoding mode.
2671
+ *
2672
+ * Each node represents a possible segment.
2673
+ *
2674
+ * @param {Array} segs Array of object with segments data
2675
+ * @return {Array} Array of object with segments data
2676
+ */
2677
+ function buildNodes (segs) {
2678
+ const nodes = []
2679
+ for (let i = 0; i < segs.length; i++) {
2680
+ const seg = segs[i]
2681
+
2682
+ switch (seg.mode) {
2683
+ case Mode.NUMERIC:
2684
+ nodes.push([seg,
2685
+ { data: seg.data, mode: Mode.ALPHANUMERIC, length: seg.length },
2686
+ { data: seg.data, mode: Mode.BYTE, length: seg.length }
2687
+ ])
2688
+ break
2689
+ case Mode.ALPHANUMERIC:
2690
+ nodes.push([seg,
2691
+ { data: seg.data, mode: Mode.BYTE, length: seg.length }
2692
+ ])
2693
+ break
2694
+ case Mode.KANJI:
2695
+ nodes.push([seg,
2696
+ { data: seg.data, mode: Mode.BYTE, length: getStringByteLength(seg.data) }
2697
+ ])
2698
+ break
2699
+ case Mode.BYTE:
2700
+ nodes.push([
2701
+ { data: seg.data, mode: Mode.BYTE, length: getStringByteLength(seg.data) }
2702
+ ])
2703
+ }
2704
+ }
2705
+
2706
+ return nodes
2707
+ }
2708
+
2709
+ /**
2710
+ * Builds a graph from a list of nodes.
2711
+ * All segments in each node group will be connected with all the segments of
2712
+ * the next group and so on.
2713
+ *
2714
+ * At each connection will be assigned a weight depending on the
2715
+ * segment's byte length.
2716
+ *
2717
+ * @param {Array} nodes Array of object with segments data
2718
+ * @param {Number} version QR Code version
2719
+ * @return {Object} Graph of all possible segments
2720
+ */
2721
+ function buildGraph (nodes, version) {
2722
+ const table = {}
2723
+ const graph = { start: {} }
2724
+ let prevNodeIds = ['start']
2725
+
2726
+ for (let i = 0; i < nodes.length; i++) {
2727
+ const nodeGroup = nodes[i]
2728
+ const currentNodeIds = []
2729
+
2730
+ for (let j = 0; j < nodeGroup.length; j++) {
2731
+ const node = nodeGroup[j]
2732
+ const key = '' + i + j
2733
+
2734
+ currentNodeIds.push(key)
2735
+ table[key] = { node: node, lastCount: 0 }
2736
+ graph[key] = {}
2737
+
2738
+ for (let n = 0; n < prevNodeIds.length; n++) {
2739
+ const prevNodeId = prevNodeIds[n]
2740
+
2741
+ if (table[prevNodeId] && table[prevNodeId].node.mode === node.mode) {
2742
+ graph[prevNodeId][key] =
2743
+ getSegmentBitsLength(table[prevNodeId].lastCount + node.length, node.mode) -
2744
+ getSegmentBitsLength(table[prevNodeId].lastCount, node.mode)
2745
+
2746
+ table[prevNodeId].lastCount += node.length
2747
+ } else {
2748
+ if (table[prevNodeId]) table[prevNodeId].lastCount = node.length
2749
+
2750
+ graph[prevNodeId][key] = getSegmentBitsLength(node.length, node.mode) +
2751
+ 4 + Mode.getCharCountIndicator(node.mode, version) // switch cost
2752
+ }
2753
+ }
2754
+ }
2755
+
2756
+ prevNodeIds = currentNodeIds
2757
+ }
2758
+
2759
+ for (let n = 0; n < prevNodeIds.length; n++) {
2760
+ graph[prevNodeIds[n]].end = 0
2761
+ }
2762
+
2763
+ return { map: graph, table: table }
2764
+ }
2765
+
2766
+ /**
2767
+ * Builds a segment from a specified data and mode.
2768
+ * If a mode is not specified, the more suitable will be used.
2769
+ *
2770
+ * @param {String} data Input data
2771
+ * @param {Mode | String} modesHint Data mode
2772
+ * @return {Segment} Segment
2773
+ */
2774
+ function buildSingleSegment (data, modesHint) {
2775
+ let mode
2776
+ const bestMode = Mode.getBestModeForData(data)
2777
+
2778
+ mode = Mode.from(modesHint, bestMode)
2779
+
2780
+ // Make sure data can be encoded
2781
+ if (mode !== Mode.BYTE && mode.bit < bestMode.bit) {
2782
+ throw new Error('"' + data + '"' +
2783
+ ' cannot be encoded with mode ' + Mode.toString(mode) +
2784
+ '.\n Suggested mode is: ' + Mode.toString(bestMode))
2785
+ }
2786
+
2787
+ // Use Mode.BYTE if Kanji support is disabled
2788
+ if (mode === Mode.KANJI && !Utils.isKanjiModeEnabled()) {
2789
+ mode = Mode.BYTE
2790
+ }
2791
+
2792
+ switch (mode) {
2793
+ case Mode.NUMERIC:
2794
+ return new NumericData(data)
2795
+
2796
+ case Mode.ALPHANUMERIC:
2797
+ return new AlphanumericData(data)
2798
+
2799
+ case Mode.KANJI:
2800
+ return new KanjiData(data)
2801
+
2802
+ case Mode.BYTE:
2803
+ return new ByteData(data)
2804
+ }
2805
+ }
2806
+
2807
+ /**
2808
+ * Builds a list of segments from an array.
2809
+ * Array can contain Strings or Objects with segment's info.
2810
+ *
2811
+ * For each item which is a string, will be generated a segment with the given
2812
+ * string and the more appropriate encoding mode.
2813
+ *
2814
+ * For each item which is an object, will be generated a segment with the given
2815
+ * data and mode.
2816
+ * Objects must contain at least the property "data".
2817
+ * If property "mode" is not present, the more suitable mode will be used.
2818
+ *
2819
+ * @param {Array} array Array of objects with segments data
2820
+ * @return {Array} Array of Segments
2821
+ */
2822
+ exports.fromArray = function fromArray (array) {
2823
+ return array.reduce(function (acc, seg) {
2824
+ if (typeof seg === 'string') {
2825
+ acc.push(buildSingleSegment(seg, null))
2826
+ } else if (seg.data) {
2827
+ acc.push(buildSingleSegment(seg.data, seg.mode))
2828
+ }
2829
+
2830
+ return acc
2831
+ }, [])
2832
+ }
2833
+
2834
+ /**
2835
+ * Builds an optimized sequence of segments from a string,
2836
+ * which will produce the shortest possible bitstream.
2837
+ *
2838
+ * @param {String} data Input string
2839
+ * @param {Number} version QR Code version
2840
+ * @return {Array} Array of segments
2841
+ */
2842
+ exports.fromString = function fromString (data, version) {
2843
+ const segs = getSegmentsFromString(data, Utils.isKanjiModeEnabled())
2844
+
2845
+ const nodes = buildNodes(segs)
2846
+ const graph = buildGraph(nodes, version)
2847
+ const path = dijkstra.find_path(graph.map, 'start', 'end')
2848
+
2849
+ const optimizedSegs = []
2850
+ for (let i = 1; i < path.length - 1; i++) {
2851
+ optimizedSegs.push(graph.table[path[i]].node)
2852
+ }
2853
+
2854
+ return exports.fromArray(mergeSegments(optimizedSegs))
2855
+ }
2856
+
2857
+ /**
2858
+ * Splits a string in various segments with the modes which
2859
+ * best represent their content.
2860
+ * The produced segments are far from being optimized.
2861
+ * The output of this function is only used to estimate a QR Code version
2862
+ * which may contain the data.
2863
+ *
2864
+ * @param {string} data Input string
2865
+ * @return {Array} Array of segments
2866
+ */
2867
+ exports.rawSplit = function rawSplit (data) {
2868
+ return exports.fromArray(
2869
+ getSegmentsFromString(data, Utils.isKanjiModeEnabled())
2870
+ )
2871
+ }
2872
+
2873
+
2874
+ /***/ }),
2875
+
2876
+ /***/ 9899:
2877
+ /***/ ((module) => {
2878
+
2879
+ function BitBuffer () {
2880
+ this.buffer = []
2881
+ this.length = 0
2882
+ }
2883
+
2884
+ BitBuffer.prototype = {
2885
+
2886
+ get: function (index) {
2887
+ const bufIndex = Math.floor(index / 8)
2888
+ return ((this.buffer[bufIndex] >>> (7 - index % 8)) & 1) === 1
2889
+ },
2890
+
2891
+ put: function (num, length) {
2892
+ for (let i = 0; i < length; i++) {
2893
+ this.putBit(((num >>> (length - i - 1)) & 1) === 1)
2894
+ }
2895
+ },
2896
+
2897
+ getLengthInBits: function () {
2898
+ return this.length
2899
+ },
2900
+
2901
+ putBit: function (bit) {
2902
+ const bufIndex = Math.floor(this.length / 8)
2903
+ if (this.buffer.length <= bufIndex) {
2904
+ this.buffer.push(0)
2905
+ }
2906
+
2907
+ if (bit) {
2908
+ this.buffer[bufIndex] |= (0x80 >>> (this.length % 8))
2909
+ }
2910
+
2911
+ this.length++
2912
+ }
2913
+ }
2914
+
2915
+ module.exports = BitBuffer
2916
+
2917
+
2918
+ /***/ }),
2919
+
2920
+ /***/ 9953:
2921
+ /***/ ((__unused_webpack_module, exports) => {
2922
+
2923
+ exports.L = { bit: 1 }
2924
+ exports.M = { bit: 0 }
2925
+ exports.Q = { bit: 3 }
2926
+ exports.H = { bit: 2 }
2927
+
2928
+ function fromString (string) {
2929
+ if (typeof string !== 'string') {
2930
+ throw new Error('Param is not a string')
2931
+ }
2932
+
2933
+ const lcStr = string.toLowerCase()
2934
+
2935
+ switch (lcStr) {
2936
+ case 'l':
2937
+ case 'low':
2938
+ return exports.L
2939
+
2940
+ case 'm':
2941
+ case 'medium':
2942
+ return exports.M
2943
+
2944
+ case 'q':
2945
+ case 'quartile':
2946
+ return exports.Q
2947
+
2948
+ case 'h':
2949
+ case 'high':
2950
+ return exports.H
2951
+
2952
+ default:
2953
+ throw new Error('Unknown EC Level: ' + string)
2954
+ }
2955
+ }
2956
+
2957
+ exports.isValid = function isValid (level) {
2958
+ return level && typeof level.bit !== 'undefined' &&
2959
+ level.bit >= 0 && level.bit < 4
2960
+ }
2961
+
2962
+ exports.from = function from (value, defaultValue) {
2963
+ if (exports.isValid(value)) {
2964
+ return value
2965
+ }
2966
+
2967
+ try {
2968
+ return fromString(value)
2969
+ } catch (e) {
2970
+ return defaultValue
2971
+ }
2972
+ }
2973
+
2974
+
2975
+ /***/ })
2976
+
2977
+ }]);
2978
+ //# sourceMappingURL=583.177f1aa2edb14f5f073e.js.map