chunk.WHAC5BGZ.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791
  1. import {
  2. i
  3. } from "./chunk.DA3UDEH5.js";
  4. import {
  5. watch
  6. } from "./chunk.XX234VRK.js";
  7. import {
  8. T,
  9. e,
  10. h,
  11. n,
  12. o,
  13. r
  14. } from "./chunk.5PIDMFOE.js";
  15. import {
  16. __decorateClass
  17. } from "./chunk.IHGPZX35.js";
  18. // node_modules/qr-creator/dist/qr-creator.es6.min.js
  19. "use strict";
  20. var G = null;
  21. var H = class {
  22. };
  23. H.render = function(w, B) {
  24. G(w, B);
  25. };
  26. self.QrCreator = H;
  27. (function(w) {
  28. function B(t, c, a, e2) {
  29. var b = {}, h2 = w(a, c);
  30. h2.u(t);
  31. h2.J();
  32. e2 = e2 || 0;
  33. var r2 = h2.h(), d = h2.h() + 2 * e2;
  34. b.text = t;
  35. b.level = c;
  36. b.version = a;
  37. b.O = d;
  38. b.a = function(b2, a2) {
  39. b2 -= e2;
  40. a2 -= e2;
  41. return 0 > b2 || b2 >= r2 || 0 > a2 || a2 >= r2 ? false : h2.a(b2, a2);
  42. };
  43. return b;
  44. }
  45. function C(t, c, a, e2, b, h2, r2, d, g, x) {
  46. function u(b2, a2, f, c2, d2, r3, g2) {
  47. b2 ? (t.lineTo(a2 + r3, f + g2), t.arcTo(a2, f, c2, d2, h2)) : t.lineTo(a2, f);
  48. }
  49. r2 ? t.moveTo(c + h2, a) : t.moveTo(c, a);
  50. u(d, e2, a, e2, b, -h2, 0);
  51. u(g, e2, b, c, b, 0, -h2);
  52. u(x, c, b, c, a, h2, 0);
  53. u(r2, c, a, e2, a, 0, h2);
  54. }
  55. function z(t, c, a, e2, b, h2, r2, d, g, x) {
  56. function u(b2, a2, c2, d2) {
  57. t.moveTo(b2 + c2, a2);
  58. t.lineTo(b2, a2);
  59. t.lineTo(b2, a2 + d2);
  60. t.arcTo(b2, a2, b2 + c2, a2, h2);
  61. }
  62. r2 && u(c, a, h2, h2);
  63. d && u(e2, a, -h2, h2);
  64. g && u(e2, b, -h2, -h2);
  65. x && u(c, b, h2, -h2);
  66. }
  67. function A(t, c) {
  68. var a = c.fill;
  69. if (typeof a === "string")
  70. t.fillStyle = a;
  71. else {
  72. var e2 = a.type, b = a.colorStops;
  73. a = a.position.map((b2) => Math.round(b2 * c.size));
  74. if (e2 === "linear-gradient")
  75. var h2 = t.createLinearGradient.apply(t, a);
  76. else if (e2 === "radial-gradient")
  77. h2 = t.createRadialGradient.apply(t, a);
  78. else
  79. throw Error("Unsupported fill");
  80. b.forEach(([b2, a2]) => {
  81. h2.addColorStop(b2, a2);
  82. });
  83. t.fillStyle = h2;
  84. }
  85. }
  86. function y(t, c) {
  87. a: {
  88. var a = c.text, e2 = c.v, b = c.N, h2 = c.K, r2 = c.P;
  89. b = Math.max(1, b || 1);
  90. for (h2 = Math.min(40, h2 || 40); b <= h2; b += 1)
  91. try {
  92. var d = B(a, e2, b, r2);
  93. break a;
  94. } catch (J) {
  95. }
  96. d = void 0;
  97. }
  98. if (!d)
  99. return null;
  100. a = t.getContext("2d");
  101. c.background && (a.fillStyle = c.background, a.fillRect(c.left, c.top, c.size, c.size));
  102. e2 = d.O;
  103. h2 = c.size / e2;
  104. a.beginPath();
  105. for (r2 = 0; r2 < e2; r2 += 1)
  106. for (b = 0; b < e2; b += 1) {
  107. var g = a, x = c.left + b * h2, u = c.top + r2 * h2, p = r2, q = b, f = d.a, k = x + h2, m = u + h2, D = p - 1, E = p + 1, n2 = q - 1, l = q + 1, y2 = Math.floor(Math.min(0.5, Math.max(0, c.R)) * h2), v2 = f(p, q), I = f(D, n2), w2 = f(D, q);
  108. D = f(D, l);
  109. var F = f(p, l);
  110. l = f(E, l);
  111. q = f(E, q);
  112. E = f(E, n2);
  113. p = f(p, n2);
  114. x = Math.round(x);
  115. u = Math.round(u);
  116. k = Math.round(k);
  117. m = Math.round(m);
  118. v2 ? C(g, x, u, k, m, y2, !w2 && !p, !w2 && !F, !q && !F, !q && !p) : z(g, x, u, k, m, y2, w2 && p && I, w2 && F && D, q && F && l, q && p && E);
  119. }
  120. A(a, c);
  121. a.fill();
  122. return t;
  123. }
  124. var v = { minVersion: 1, maxVersion: 40, ecLevel: "L", left: 0, top: 0, size: 200, fill: "#000", background: null, text: "no text", radius: 0.5, quiet: 0 };
  125. G = function(t, c) {
  126. var a = {};
  127. Object.assign(a, v, t);
  128. a.N = a.minVersion;
  129. a.K = a.maxVersion;
  130. a.v = a.ecLevel;
  131. a.left = a.left;
  132. a.top = a.top;
  133. a.size = a.size;
  134. a.fill = a.fill;
  135. a.background = a.background;
  136. a.text = a.text;
  137. a.R = a.radius;
  138. a.P = a.quiet;
  139. if (c instanceof HTMLCanvasElement) {
  140. if (c.width !== a.size || c.height !== a.size)
  141. c.width = a.size, c.height = a.size;
  142. c.getContext("2d").clearRect(0, 0, c.width, c.height);
  143. y(c, a);
  144. } else
  145. t = document.createElement("canvas"), t.width = a.size, t.height = a.size, a = y(t, a), c.appendChild(a);
  146. };
  147. })(function() {
  148. function w(c) {
  149. var a = C.s(c);
  150. return { S: function() {
  151. return 4;
  152. }, b: function() {
  153. return a.length;
  154. }, write: function(c2) {
  155. for (var b = 0; b < a.length; b += 1)
  156. c2.put(a[b], 8);
  157. } };
  158. }
  159. function B() {
  160. var c = [], a = 0, e2 = {
  161. B: function() {
  162. return c;
  163. },
  164. c: function(b) {
  165. return (c[Math.floor(b / 8)] >>> 7 - b % 8 & 1) == 1;
  166. },
  167. put: function(b, h2) {
  168. for (var a2 = 0; a2 < h2; a2 += 1)
  169. e2.m((b >>> h2 - a2 - 1 & 1) == 1);
  170. },
  171. f: function() {
  172. return a;
  173. },
  174. m: function(b) {
  175. var h2 = Math.floor(a / 8);
  176. c.length <= h2 && c.push(0);
  177. b && (c[h2] |= 128 >>> a % 8);
  178. a += 1;
  179. }
  180. };
  181. return e2;
  182. }
  183. function C(c, a) {
  184. function e2(b2, h3) {
  185. for (var a2 = -1; 7 >= a2; a2 += 1)
  186. if (!(-1 >= b2 + a2 || d <= b2 + a2))
  187. for (var c2 = -1; 7 >= c2; c2 += 1)
  188. -1 >= h3 + c2 || d <= h3 + c2 || (r2[b2 + a2][h3 + c2] = 0 <= a2 && 6 >= a2 && (c2 == 0 || c2 == 6) || 0 <= c2 && 6 >= c2 && (a2 == 0 || a2 == 6) || 2 <= a2 && 4 >= a2 && 2 <= c2 && 4 >= c2 ? true : false);
  189. }
  190. function b(b2, a2) {
  191. for (var f = d = 4 * c + 17, k = Array(f), m = 0; m < f; m += 1) {
  192. k[m] = Array(f);
  193. for (var p = 0; p < f; p += 1)
  194. k[m][p] = null;
  195. }
  196. r2 = k;
  197. e2(0, 0);
  198. e2(d - 7, 0);
  199. e2(0, d - 7);
  200. f = y.G(c);
  201. for (k = 0; k < f.length; k += 1)
  202. for (m = 0; m < f.length; m += 1) {
  203. p = f[k];
  204. var q = f[m];
  205. if (r2[p][q] == null)
  206. for (var n2 = -2; 2 >= n2; n2 += 1)
  207. for (var l = -2; 2 >= l; l += 1)
  208. r2[p + n2][q + l] = n2 == -2 || n2 == 2 || l == -2 || l == 2 || n2 == 0 && l == 0;
  209. }
  210. for (f = 8; f < d - 8; f += 1)
  211. r2[f][6] == null && (r2[f][6] = f % 2 == 0);
  212. for (f = 8; f < d - 8; f += 1)
  213. r2[6][f] == null && (r2[6][f] = f % 2 == 0);
  214. f = y.w(h2 << 3 | a2);
  215. for (k = 0; 15 > k; k += 1)
  216. m = !b2 && (f >> k & 1) == 1, r2[6 > k ? k : 8 > k ? k + 1 : d - 15 + k][8] = m, r2[8][8 > k ? d - k - 1 : 9 > k ? 15 - k : 14 - k] = m;
  217. r2[d - 8][8] = !b2;
  218. if (7 <= c) {
  219. f = y.A(c);
  220. for (k = 0; 18 > k; k += 1)
  221. m = !b2 && (f >> k & 1) == 1, r2[Math.floor(k / 3)][k % 3 + d - 8 - 3] = m;
  222. for (k = 0; 18 > k; k += 1)
  223. m = !b2 && (f >> k & 1) == 1, r2[k % 3 + d - 8 - 3][Math.floor(k / 3)] = m;
  224. }
  225. if (g == null) {
  226. b2 = t.I(c, h2);
  227. f = B();
  228. for (k = 0; k < x.length; k += 1)
  229. m = x[k], f.put(4, 4), f.put(m.b(), y.f(4, c)), m.write(f);
  230. for (k = m = 0; k < b2.length; k += 1)
  231. m += b2[k].j;
  232. if (f.f() > 8 * m)
  233. throw Error("code length overflow. (" + f.f() + ">" + 8 * m + ")");
  234. for (f.f() + 4 <= 8 * m && f.put(0, 4); f.f() % 8 != 0; )
  235. f.m(false);
  236. for (; !(f.f() >= 8 * m); ) {
  237. f.put(236, 8);
  238. if (f.f() >= 8 * m)
  239. break;
  240. f.put(17, 8);
  241. }
  242. var u2 = 0;
  243. m = k = 0;
  244. p = Array(b2.length);
  245. q = Array(b2.length);
  246. for (n2 = 0; n2 < b2.length; n2 += 1) {
  247. var v2 = b2[n2].j, w2 = b2[n2].o - v2;
  248. k = Math.max(k, v2);
  249. m = Math.max(m, w2);
  250. p[n2] = Array(v2);
  251. for (l = 0; l < p[n2].length; l += 1)
  252. p[n2][l] = 255 & f.B()[l + u2];
  253. u2 += v2;
  254. l = y.C(w2);
  255. v2 = z(p[n2], l.b() - 1).l(l);
  256. q[n2] = Array(l.b() - 1);
  257. for (l = 0; l < q[n2].length; l += 1)
  258. w2 = l + v2.b() - q[n2].length, q[n2][l] = 0 <= w2 ? v2.c(w2) : 0;
  259. }
  260. for (l = f = 0; l < b2.length; l += 1)
  261. f += b2[l].o;
  262. f = Array(f);
  263. for (l = u2 = 0; l < k; l += 1)
  264. for (n2 = 0; n2 < b2.length; n2 += 1)
  265. l < p[n2].length && (f[u2] = p[n2][l], u2 += 1);
  266. for (l = 0; l < m; l += 1)
  267. for (n2 = 0; n2 < b2.length; n2 += 1)
  268. l < q[n2].length && (f[u2] = q[n2][l], u2 += 1);
  269. g = f;
  270. }
  271. b2 = g;
  272. f = -1;
  273. k = d - 1;
  274. m = 7;
  275. p = 0;
  276. a2 = y.F(a2);
  277. for (q = d - 1; 0 < q; q -= 2)
  278. for (q == 6 && --q; ; ) {
  279. for (n2 = 0; 2 > n2; n2 += 1)
  280. r2[k][q - n2] == null && (l = false, p < b2.length && (l = (b2[p] >>> m & 1) == 1), a2(k, q - n2) && (l = !l), r2[k][q - n2] = l, --m, m == -1 && (p += 1, m = 7));
  281. k += f;
  282. if (0 > k || d <= k) {
  283. k -= f;
  284. f = -f;
  285. break;
  286. }
  287. }
  288. }
  289. var h2 = A[a], r2 = null, d = 0, g = null, x = [], u = { u: function(b2) {
  290. b2 = w(b2);
  291. x.push(b2);
  292. g = null;
  293. }, a: function(b2, a2) {
  294. if (0 > b2 || d <= b2 || 0 > a2 || d <= a2)
  295. throw Error(b2 + "," + a2);
  296. return r2[b2][a2];
  297. }, h: function() {
  298. return d;
  299. }, J: function() {
  300. for (var a2 = 0, h3 = 0, c2 = 0; 8 > c2; c2 += 1) {
  301. b(true, c2);
  302. var d2 = y.D(u);
  303. if (c2 == 0 || a2 > d2)
  304. a2 = d2, h3 = c2;
  305. }
  306. b(false, h3);
  307. } };
  308. return u;
  309. }
  310. function z(c, a) {
  311. if (typeof c.length == "undefined")
  312. throw Error(c.length + "/" + a);
  313. var e2 = function() {
  314. for (var b2 = 0; b2 < c.length && c[b2] == 0; )
  315. b2 += 1;
  316. for (var r2 = Array(c.length - b2 + a), d = 0; d < c.length - b2; d += 1)
  317. r2[d] = c[d + b2];
  318. return r2;
  319. }(), b = { c: function(b2) {
  320. return e2[b2];
  321. }, b: function() {
  322. return e2.length;
  323. }, multiply: function(a2) {
  324. for (var h2 = Array(b.b() + a2.b() - 1), c2 = 0; c2 < b.b(); c2 += 1)
  325. for (var g = 0; g < a2.b(); g += 1)
  326. h2[c2 + g] ^= v.i(v.g(b.c(c2)) + v.g(a2.c(g)));
  327. return z(h2, 0);
  328. }, l: function(a2) {
  329. if (0 > b.b() - a2.b())
  330. return b;
  331. for (var c2 = v.g(b.c(0)) - v.g(a2.c(0)), h2 = Array(b.b()), g = 0; g < b.b(); g += 1)
  332. h2[g] = b.c(g);
  333. for (g = 0; g < a2.b(); g += 1)
  334. h2[g] ^= v.i(v.g(a2.c(g)) + c2);
  335. return z(h2, 0).l(a2);
  336. } };
  337. return b;
  338. }
  339. C.s = function(c) {
  340. for (var a = [], e2 = 0; e2 < c.length; e2++) {
  341. var b = c.charCodeAt(e2);
  342. 128 > b ? a.push(b) : 2048 > b ? a.push(192 | b >> 6, 128 | b & 63) : 55296 > b || 57344 <= b ? a.push(224 | b >> 12, 128 | b >> 6 & 63, 128 | b & 63) : (e2++, b = 65536 + ((b & 1023) << 10 | c.charCodeAt(e2) & 1023), a.push(240 | b >> 18, 128 | b >> 12 & 63, 128 | b >> 6 & 63, 128 | b & 63));
  343. }
  344. return a;
  345. };
  346. var A = { L: 1, M: 0, Q: 3, H: 2 }, y = function() {
  347. function c(b) {
  348. for (var a2 = 0; b != 0; )
  349. a2 += 1, b >>>= 1;
  350. return a2;
  351. }
  352. var a = [
  353. [],
  354. [6, 18],
  355. [6, 22],
  356. [6, 26],
  357. [6, 30],
  358. [6, 34],
  359. [6, 22, 38],
  360. [6, 24, 42],
  361. [6, 26, 46],
  362. [6, 28, 50],
  363. [6, 30, 54],
  364. [6, 32, 58],
  365. [6, 34, 62],
  366. [6, 26, 46, 66],
  367. [6, 26, 48, 70],
  368. [6, 26, 50, 74],
  369. [6, 30, 54, 78],
  370. [6, 30, 56, 82],
  371. [6, 30, 58, 86],
  372. [6, 34, 62, 90],
  373. [6, 28, 50, 72, 94],
  374. [6, 26, 50, 74, 98],
  375. [6, 30, 54, 78, 102],
  376. [6, 28, 54, 80, 106],
  377. [6, 32, 58, 84, 110],
  378. [6, 30, 58, 86, 114],
  379. [6, 34, 62, 90, 118],
  380. [6, 26, 50, 74, 98, 122],
  381. [6, 30, 54, 78, 102, 126],
  382. [6, 26, 52, 78, 104, 130],
  383. [6, 30, 56, 82, 108, 134],
  384. [6, 34, 60, 86, 112, 138],
  385. [6, 30, 58, 86, 114, 142],
  386. [6, 34, 62, 90, 118, 146],
  387. [6, 30, 54, 78, 102, 126, 150],
  388. [6, 24, 50, 76, 102, 128, 154],
  389. [6, 28, 54, 80, 106, 132, 158],
  390. [6, 32, 58, 84, 110, 136, 162],
  391. [6, 26, 54, 82, 110, 138, 166],
  392. [6, 30, 58, 86, 114, 142, 170]
  393. ], e2 = { w: function(b) {
  394. for (var a2 = b << 10; 0 <= c(a2) - c(1335); )
  395. a2 ^= 1335 << c(a2) - c(1335);
  396. return (b << 10 | a2) ^ 21522;
  397. }, A: function(b) {
  398. for (var a2 = b << 12; 0 <= c(a2) - c(7973); )
  399. a2 ^= 7973 << c(a2) - c(7973);
  400. return b << 12 | a2;
  401. }, G: function(b) {
  402. return a[b - 1];
  403. }, F: function(b) {
  404. switch (b) {
  405. case 0:
  406. return function(b2, a2) {
  407. return (b2 + a2) % 2 == 0;
  408. };
  409. case 1:
  410. return function(b2) {
  411. return b2 % 2 == 0;
  412. };
  413. case 2:
  414. return function(b2, a2) {
  415. return a2 % 3 == 0;
  416. };
  417. case 3:
  418. return function(b2, a2) {
  419. return (b2 + a2) % 3 == 0;
  420. };
  421. case 4:
  422. return function(b2, a2) {
  423. return (Math.floor(b2 / 2) + Math.floor(a2 / 3)) % 2 == 0;
  424. };
  425. case 5:
  426. return function(b2, a2) {
  427. return b2 * a2 % 2 + b2 * a2 % 3 == 0;
  428. };
  429. case 6:
  430. return function(b2, a2) {
  431. return (b2 * a2 % 2 + b2 * a2 % 3) % 2 == 0;
  432. };
  433. case 7:
  434. return function(b2, a2) {
  435. return (b2 * a2 % 3 + (b2 + a2) % 2) % 2 == 0;
  436. };
  437. default:
  438. throw Error("bad maskPattern:" + b);
  439. }
  440. }, C: function(b) {
  441. for (var a2 = z([1], 0), c2 = 0; c2 < b; c2 += 1)
  442. a2 = a2.multiply(z([1, v.i(c2)], 0));
  443. return a2;
  444. }, f: function(b, a2) {
  445. if (b != 4 || 1 > a2 || 40 < a2)
  446. throw Error("mode: " + b + "; type: " + a2);
  447. return 10 > a2 ? 8 : 16;
  448. }, D: function(b) {
  449. for (var a2 = b.h(), c2 = 0, d = 0; d < a2; d += 1)
  450. for (var g = 0; g < a2; g += 1) {
  451. for (var e3 = 0, t2 = b.a(d, g), p = -1; 1 >= p; p += 1)
  452. if (!(0 > d + p || a2 <= d + p))
  453. for (var q = -1; 1 >= q; q += 1)
  454. 0 > g + q || a2 <= g + q || (p != 0 || q != 0) && t2 == b.a(d + p, g + q) && (e3 += 1);
  455. 5 < e3 && (c2 += 3 + e3 - 5);
  456. }
  457. for (d = 0; d < a2 - 1; d += 1)
  458. for (g = 0; g < a2 - 1; g += 1)
  459. if (e3 = 0, b.a(d, g) && (e3 += 1), b.a(d + 1, g) && (e3 += 1), b.a(d, g + 1) && (e3 += 1), b.a(d + 1, g + 1) && (e3 += 1), e3 == 0 || e3 == 4)
  460. c2 += 3;
  461. for (d = 0; d < a2; d += 1)
  462. for (g = 0; g < a2 - 6; g += 1)
  463. b.a(d, g) && !b.a(d, g + 1) && b.a(d, g + 2) && b.a(d, g + 3) && b.a(d, g + 4) && !b.a(d, g + 5) && b.a(d, g + 6) && (c2 += 40);
  464. for (g = 0; g < a2; g += 1)
  465. for (d = 0; d < a2 - 6; d += 1)
  466. b.a(d, g) && !b.a(d + 1, g) && b.a(d + 2, g) && b.a(d + 3, g) && b.a(d + 4, g) && !b.a(d + 5, g) && b.a(d + 6, g) && (c2 += 40);
  467. for (g = e3 = 0; g < a2; g += 1)
  468. for (d = 0; d < a2; d += 1)
  469. b.a(d, g) && (e3 += 1);
  470. return c2 += Math.abs(100 * e3 / a2 / a2 - 50) / 5 * 10;
  471. } };
  472. return e2;
  473. }(), v = function() {
  474. for (var c = Array(256), a = Array(256), e2 = 0; 8 > e2; e2 += 1)
  475. c[e2] = 1 << e2;
  476. for (e2 = 8; 256 > e2; e2 += 1)
  477. c[e2] = c[e2 - 4] ^ c[e2 - 5] ^ c[e2 - 6] ^ c[e2 - 8];
  478. for (e2 = 0; 255 > e2; e2 += 1)
  479. a[c[e2]] = e2;
  480. return { g: function(b) {
  481. if (1 > b)
  482. throw Error("glog(" + b + ")");
  483. return a[b];
  484. }, i: function(b) {
  485. for (; 0 > b; )
  486. b += 255;
  487. for (; 256 <= b; )
  488. b -= 255;
  489. return c[b];
  490. } };
  491. }(), t = function() {
  492. function c(b, c2) {
  493. switch (c2) {
  494. case A.L:
  495. return a[4 * (b - 1)];
  496. case A.M:
  497. return a[4 * (b - 1) + 1];
  498. case A.Q:
  499. return a[4 * (b - 1) + 2];
  500. case A.H:
  501. return a[4 * (b - 1) + 3];
  502. }
  503. }
  504. var a = [
  505. [1, 26, 19],
  506. [1, 26, 16],
  507. [1, 26, 13],
  508. [1, 26, 9],
  509. [1, 44, 34],
  510. [1, 44, 28],
  511. [1, 44, 22],
  512. [1, 44, 16],
  513. [1, 70, 55],
  514. [1, 70, 44],
  515. [2, 35, 17],
  516. [2, 35, 13],
  517. [1, 100, 80],
  518. [2, 50, 32],
  519. [2, 50, 24],
  520. [4, 25, 9],
  521. [1, 134, 108],
  522. [2, 67, 43],
  523. [2, 33, 15, 2, 34, 16],
  524. [2, 33, 11, 2, 34, 12],
  525. [2, 86, 68],
  526. [4, 43, 27],
  527. [4, 43, 19],
  528. [4, 43, 15],
  529. [2, 98, 78],
  530. [4, 49, 31],
  531. [2, 32, 14, 4, 33, 15],
  532. [4, 39, 13, 1, 40, 14],
  533. [2, 121, 97],
  534. [2, 60, 38, 2, 61, 39],
  535. [4, 40, 18, 2, 41, 19],
  536. [4, 40, 14, 2, 41, 15],
  537. [2, 146, 116],
  538. [
  539. 3,
  540. 58,
  541. 36,
  542. 2,
  543. 59,
  544. 37
  545. ],
  546. [4, 36, 16, 4, 37, 17],
  547. [4, 36, 12, 4, 37, 13],
  548. [2, 86, 68, 2, 87, 69],
  549. [4, 69, 43, 1, 70, 44],
  550. [6, 43, 19, 2, 44, 20],
  551. [6, 43, 15, 2, 44, 16],
  552. [4, 101, 81],
  553. [1, 80, 50, 4, 81, 51],
  554. [4, 50, 22, 4, 51, 23],
  555. [3, 36, 12, 8, 37, 13],
  556. [2, 116, 92, 2, 117, 93],
  557. [6, 58, 36, 2, 59, 37],
  558. [4, 46, 20, 6, 47, 21],
  559. [7, 42, 14, 4, 43, 15],
  560. [4, 133, 107],
  561. [8, 59, 37, 1, 60, 38],
  562. [8, 44, 20, 4, 45, 21],
  563. [12, 33, 11, 4, 34, 12],
  564. [3, 145, 115, 1, 146, 116],
  565. [4, 64, 40, 5, 65, 41],
  566. [11, 36, 16, 5, 37, 17],
  567. [11, 36, 12, 5, 37, 13],
  568. [5, 109, 87, 1, 110, 88],
  569. [5, 65, 41, 5, 66, 42],
  570. [5, 54, 24, 7, 55, 25],
  571. [11, 36, 12, 7, 37, 13],
  572. [5, 122, 98, 1, 123, 99],
  573. [
  574. 7,
  575. 73,
  576. 45,
  577. 3,
  578. 74,
  579. 46
  580. ],
  581. [15, 43, 19, 2, 44, 20],
  582. [3, 45, 15, 13, 46, 16],
  583. [1, 135, 107, 5, 136, 108],
  584. [10, 74, 46, 1, 75, 47],
  585. [1, 50, 22, 15, 51, 23],
  586. [2, 42, 14, 17, 43, 15],
  587. [5, 150, 120, 1, 151, 121],
  588. [9, 69, 43, 4, 70, 44],
  589. [17, 50, 22, 1, 51, 23],
  590. [2, 42, 14, 19, 43, 15],
  591. [3, 141, 113, 4, 142, 114],
  592. [3, 70, 44, 11, 71, 45],
  593. [17, 47, 21, 4, 48, 22],
  594. [9, 39, 13, 16, 40, 14],
  595. [3, 135, 107, 5, 136, 108],
  596. [3, 67, 41, 13, 68, 42],
  597. [15, 54, 24, 5, 55, 25],
  598. [15, 43, 15, 10, 44, 16],
  599. [4, 144, 116, 4, 145, 117],
  600. [17, 68, 42],
  601. [17, 50, 22, 6, 51, 23],
  602. [19, 46, 16, 6, 47, 17],
  603. [2, 139, 111, 7, 140, 112],
  604. [17, 74, 46],
  605. [7, 54, 24, 16, 55, 25],
  606. [34, 37, 13],
  607. [
  608. 4,
  609. 151,
  610. 121,
  611. 5,
  612. 152,
  613. 122
  614. ],
  615. [4, 75, 47, 14, 76, 48],
  616. [11, 54, 24, 14, 55, 25],
  617. [16, 45, 15, 14, 46, 16],
  618. [6, 147, 117, 4, 148, 118],
  619. [6, 73, 45, 14, 74, 46],
  620. [11, 54, 24, 16, 55, 25],
  621. [30, 46, 16, 2, 47, 17],
  622. [8, 132, 106, 4, 133, 107],
  623. [8, 75, 47, 13, 76, 48],
  624. [7, 54, 24, 22, 55, 25],
  625. [22, 45, 15, 13, 46, 16],
  626. [10, 142, 114, 2, 143, 115],
  627. [19, 74, 46, 4, 75, 47],
  628. [28, 50, 22, 6, 51, 23],
  629. [33, 46, 16, 4, 47, 17],
  630. [8, 152, 122, 4, 153, 123],
  631. [22, 73, 45, 3, 74, 46],
  632. [8, 53, 23, 26, 54, 24],
  633. [12, 45, 15, 28, 46, 16],
  634. [3, 147, 117, 10, 148, 118],
  635. [3, 73, 45, 23, 74, 46],
  636. [4, 54, 24, 31, 55, 25],
  637. [11, 45, 15, 31, 46, 16],
  638. [7, 146, 116, 7, 147, 117],
  639. [21, 73, 45, 7, 74, 46],
  640. [1, 53, 23, 37, 54, 24],
  641. [19, 45, 15, 26, 46, 16],
  642. [5, 145, 115, 10, 146, 116],
  643. [19, 75, 47, 10, 76, 48],
  644. [15, 54, 24, 25, 55, 25],
  645. [23, 45, 15, 25, 46, 16],
  646. [13, 145, 115, 3, 146, 116],
  647. [2, 74, 46, 29, 75, 47],
  648. [42, 54, 24, 1, 55, 25],
  649. [23, 45, 15, 28, 46, 16],
  650. [17, 145, 115],
  651. [10, 74, 46, 23, 75, 47],
  652. [10, 54, 24, 35, 55, 25],
  653. [19, 45, 15, 35, 46, 16],
  654. [17, 145, 115, 1, 146, 116],
  655. [14, 74, 46, 21, 75, 47],
  656. [29, 54, 24, 19, 55, 25],
  657. [11, 45, 15, 46, 46, 16],
  658. [13, 145, 115, 6, 146, 116],
  659. [14, 74, 46, 23, 75, 47],
  660. [44, 54, 24, 7, 55, 25],
  661. [59, 46, 16, 1, 47, 17],
  662. [12, 151, 121, 7, 152, 122],
  663. [12, 75, 47, 26, 76, 48],
  664. [39, 54, 24, 14, 55, 25],
  665. [22, 45, 15, 41, 46, 16],
  666. [6, 151, 121, 14, 152, 122],
  667. [6, 75, 47, 34, 76, 48],
  668. [46, 54, 24, 10, 55, 25],
  669. [2, 45, 15, 64, 46, 16],
  670. [17, 152, 122, 4, 153, 123],
  671. [29, 74, 46, 14, 75, 47],
  672. [49, 54, 24, 10, 55, 25],
  673. [24, 45, 15, 46, 46, 16],
  674. [4, 152, 122, 18, 153, 123],
  675. [13, 74, 46, 32, 75, 47],
  676. [48, 54, 24, 14, 55, 25],
  677. [42, 45, 15, 32, 46, 16],
  678. [20, 147, 117, 4, 148, 118],
  679. [40, 75, 47, 7, 76, 48],
  680. [43, 54, 24, 22, 55, 25],
  681. [10, 45, 15, 67, 46, 16],
  682. [19, 148, 118, 6, 149, 119],
  683. [18, 75, 47, 31, 76, 48],
  684. [34, 54, 24, 34, 55, 25],
  685. [20, 45, 15, 61, 46, 16]
  686. ], e2 = { I: function(b, a2) {
  687. var e3 = c(b, a2);
  688. if (typeof e3 == "undefined")
  689. throw Error("bad rs block @ typeNumber:" + b + "/errorCorrectLevel:" + a2);
  690. b = e3.length / 3;
  691. a2 = [];
  692. for (var d = 0; d < b; d += 1)
  693. for (var g = e3[3 * d], h2 = e3[3 * d + 1], t2 = e3[3 * d + 2], p = 0; p < g; p += 1) {
  694. var q = t2, f = {};
  695. f.o = h2;
  696. f.j = q;
  697. a2.push(f);
  698. }
  699. return a2;
  700. } };
  701. return e2;
  702. }();
  703. return C;
  704. }());
  705. var qr_creator_es6_min_default = QrCreator;
  706. // _uyihdawu1:/Users/claviska/Projects/shoelace/src/components/qr-code/qr-code.scss
  707. var qr_code_default = ":host {\n position: relative;\n box-sizing: border-box;\n}\n:host *, :host *:before, :host *:after {\n box-sizing: inherit;\n}\n\n[hidden] {\n display: none !important;\n}\n\n:host {\n display: inline-block;\n}\n\n.qr-code {\n position: relative;\n}\n\ncanvas {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n}";
  708. // src/components/qr-code/qr-code.ts
  709. var SlQrCode = class extends h {
  710. constructor() {
  711. super(...arguments);
  712. this.value = "";
  713. this.label = "";
  714. this.size = 128;
  715. this.fill = "#000";
  716. this.background = "#fff";
  717. this.radius = 0;
  718. this.errorCorrection = "H";
  719. }
  720. firstUpdated() {
  721. this.generate();
  722. }
  723. generate() {
  724. qr_creator_es6_min_default.render({
  725. text: this.value,
  726. radius: this.radius,
  727. ecLevel: this.errorCorrection,
  728. fill: this.fill,
  729. background: this.background === "transparent" ? null : this.background,
  730. size: this.size * 2
  731. }, this.canvas);
  732. }
  733. render() {
  734. return T`
  735. <div
  736. class="qr-code"
  737. part="base"
  738. style=${i({
  739. width: `${this.size}px`,
  740. height: `${this.size}px`
  741. })}
  742. >
  743. <canvas role="img" aria-label=${this.label || this.value}></canvas>
  744. </div>
  745. `;
  746. }
  747. };
  748. SlQrCode.styles = r(qr_code_default);
  749. __decorateClass([
  750. o("canvas")
  751. ], SlQrCode.prototype, "canvas", 2);
  752. __decorateClass([
  753. e()
  754. ], SlQrCode.prototype, "value", 2);
  755. __decorateClass([
  756. e()
  757. ], SlQrCode.prototype, "label", 2);
  758. __decorateClass([
  759. e({ type: Number })
  760. ], SlQrCode.prototype, "size", 2);
  761. __decorateClass([
  762. e()
  763. ], SlQrCode.prototype, "fill", 2);
  764. __decorateClass([
  765. e()
  766. ], SlQrCode.prototype, "background", 2);
  767. __decorateClass([
  768. e({ type: Number })
  769. ], SlQrCode.prototype, "radius", 2);
  770. __decorateClass([
  771. e({ attribute: "error-correction" })
  772. ], SlQrCode.prototype, "errorCorrection", 2);
  773. __decorateClass([
  774. watch("background"),
  775. watch("errorCorrection"),
  776. watch("fill"),
  777. watch("radius"),
  778. watch("size"),
  779. watch("value")
  780. ], SlQrCode.prototype, "generate", 1);
  781. SlQrCode = __decorateClass([
  782. n("sl-qr-code")
  783. ], SlQrCode);
  784. var qr_code_default2 = SlQrCode;
  785. export {
  786. qr_code_default2 as qr_code_default
  787. };