@cling-se/widget 0.14.4 → 0.14.6

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 (129) hide show
  1. package/dist/AddClientCallout-C7abPZ87.js +46 -0
  2. package/dist/AnswerModal-CsA2pl2P.js +3874 -0
  3. package/dist/AttachmentItem-Da1-7xwf.js +78 -0
  4. package/dist/BaseDatePicker-k9zlSi5J.js +3183 -0
  5. package/dist/BaseUpload-BUrXX3fT.js +1977 -0
  6. package/dist/BlockMedia-CYI07qAn.js +76 -0
  7. package/dist/CCallout-Qwae66vo.js +59 -0
  8. package/dist/CCurrencyDropdown-Y_u0hgBx.js +246 -0
  9. package/dist/CDropdownItem-CXJ4xD8W.js +538 -0
  10. package/dist/CField.vue_vue_type_style_index_0_lang-l0sNRNKZ.js +1 -0
  11. package/dist/CFormField--m3PvQuT.js +241 -0
  12. package/dist/CPhoneFormat-Qg6MkDVP.js +62 -0
  13. package/dist/CPriceInput-Dlx44UrR.js +112 -0
  14. package/dist/CTabs.vue_vue_type_style_index_0_scoped_b7262014_lang-l0sNRNKZ.js +1 -0
  15. package/dist/ClientAutocomplete-BKKc_br6.js +78 -0
  16. package/dist/ClientModal-CVZFb1Br.js +625 -0
  17. package/dist/ColorPicker-Bo3s3Esp.js +2879 -0
  18. package/dist/CompanyModal-DadjAioS.js +141 -0
  19. package/dist/ContentWrapper-BC3ZBQW9.js +183 -0
  20. package/dist/CoverBlockSettings-B484eE4g.js +275 -0
  21. package/dist/DocAnswer-CcYryOWI.js +36 -0
  22. package/dist/DocDetails-BigsoEWL.js +246 -0
  23. package/dist/DocForm-DlN0eNWt.js +7273 -0
  24. package/dist/DocFormSend-TqKo210I.js +143 -0
  25. package/dist/DocLinks-DSo54vDn.js +38 -0
  26. package/dist/DocModalBase-XlM1SThW.js +28 -0
  27. package/dist/DocPrint-tD0Vd9Sw.js +240 -0
  28. package/dist/DocReceipt-CDHPrhXM.js +210 -0
  29. package/dist/DocSendReminder-C62RhltH.js +137 -0
  30. package/dist/DocTextEditor-VjhV9IRp.js +17181 -0
  31. package/dist/DocTimeline-LcW4z3nC.js +481 -0
  32. package/dist/DocumentClient-CqbTRdpB.js +136 -0
  33. package/dist/DocumentLayout-Dbf8_01r.js +4909 -0
  34. package/dist/DocumentLogotype-DXYnBedV.js +87 -0
  35. package/dist/DocumentVoided-vH1Ti5lZ.js +25 -0
  36. package/dist/EmbedInput-D9qP8OnY.js +113 -0
  37. package/dist/EmbedSettings-DISuNqJT.js +72 -0
  38. package/dist/ErrorCallout-CCtCVwSh.js +28 -0
  39. package/dist/FilePreviewModal-BjhNyb6L.js +81 -0
  40. package/dist/Flag-Dhukv9_J.js +114 -0
  41. package/dist/HeaderSettings-CK4SkB1x.js +392 -0
  42. package/dist/ImageSelectModal-DnvPZzXx.js +84 -0
  43. package/dist/ImageUploadWrapper-B7cNMu5a.js +1604 -0
  44. package/dist/Index-B3HoK_cZ.js +84 -0
  45. package/dist/Index-B3aucNji.js +25 -0
  46. package/dist/Index-B9H5MMHb.js +62 -0
  47. package/dist/Index-BAYdvT-t.js +754 -0
  48. package/dist/Index-BLeQprjq.js +46 -0
  49. package/dist/Index-BOyvQlng.js +154 -0
  50. package/dist/Index-BVsw2tak.js +70 -0
  51. package/dist/Index-BY1UKGEO.js +98 -0
  52. package/dist/Index-Bh0kMSsA.js +107 -0
  53. package/dist/Index-BlQSM7tC.js +144 -0
  54. package/dist/Index-BpcJBGGd.js +642 -0
  55. package/dist/Index-Bs8wprXw.js +58 -0
  56. package/dist/Index-BvZZAvFd.js +21 -0
  57. package/dist/Index-CFo-3Y5Q.js +26 -0
  58. package/dist/Index-CNvp5K3L.js +559 -0
  59. package/dist/Index-CPJVx14x.js +171 -0
  60. package/dist/Index-CQ325eVT.js +140 -0
  61. package/dist/Index-CWrDtcfT.js +49 -0
  62. package/dist/Index-CyJnSvDR.js +223 -0
  63. package/dist/Index-D6bc7lg4.js +52 -0
  64. package/dist/Index-DCR8ev4U.js +33 -0
  65. package/dist/Index-DGQSB9cH.js +24 -0
  66. package/dist/Index-DXAvlq74.js +292 -0
  67. package/dist/Index-D_rfst8y.js +45 -0
  68. package/dist/Index-Dm8xMFGg.js +61 -0
  69. package/dist/Index-DtSSgtxB.js +55 -0
  70. package/dist/Index-DuTw9vhb.js +77 -0
  71. package/dist/Index-Dw26jtGV.js +31 -0
  72. package/dist/Index-OxN73_fO.js +32 -0
  73. package/dist/Index-S-FHG7_k.js +2402 -0
  74. package/dist/Index-ZFkitzfq.js +69 -0
  75. package/dist/Index-dyWK9jgr.js +25 -0
  76. package/dist/Index-gb11ngPS.js +57 -0
  77. package/dist/Index-lKk_XKJ3.js +150 -0
  78. package/dist/InputToggleRow-DSSvhPKA.js +57 -0
  79. package/dist/ManualPopover-lpJYSkw5.js +58 -0
  80. package/dist/MediaWrapper-BQ22FA2B.js +23 -0
  81. package/dist/NotBindingText-JxwzZLPP.js +32 -0
  82. package/dist/PackageGroup-BLSMSUDz.js +699 -0
  83. package/dist/PdfTerms-DtutjM5Y.js +36 -0
  84. package/dist/PdfViewer-BsxcZI_x.js +374 -0
  85. package/dist/PlainHtml-BMPZs2fT.js +20 -0
  86. package/dist/PriceHeader-BRYY01H2.js +339 -0
  87. package/dist/SearchApi-6001iFxU.js +161 -0
  88. package/dist/Setup-cw6jMI9M.js +50 -0
  89. package/dist/SmartList-q6H-uLbm.js +83 -0
  90. package/dist/TermsSettings-DWvaPneu.js +102 -0
  91. package/dist/ThemeColorRow-BXWnvfz-.js +67 -0
  92. package/dist/ToggleBinding-DydtwpNG.js +38 -0
  93. package/dist/UploadModal-D_EDKHGD.js +95 -0
  94. package/dist/VideoPlayerInput-B9yzUeBW.js +93 -0
  95. package/dist/VideoPlayerSettings-Bvp9l0yj.js +61 -0
  96. package/dist/VideoSelectModal-DY3N4JiS.js +100 -0
  97. package/dist/anime.es-BrPTThYb.js +858 -0
  98. package/dist/answerDocumentMixin-BYZPU_R-.js +51 -0
  99. package/dist/color-TdtKxwVa.js +19 -0
  100. package/dist/debounce-BPnlzNwd.js +84 -0
  101. package/dist/dom-CJxkno7i.js +91 -0
  102. package/dist/favicon.ico +0 -0
  103. package/dist/focusDrawerMixin-DC9Oa1i7.js +22 -0
  104. package/dist/formComponentsInstall-CEW6TK6z.js +2499 -0
  105. package/dist/formDrawerState-CAzvSMiQ.js +20 -0
  106. package/dist/formValidationMixin-D7zXxCpC.js +49 -0
  107. package/dist/i18nMessages-Chz_lxGG.js +17 -0
  108. package/dist/index-B9WDC3Xe.js +166 -0
  109. package/dist/index-BCMaUC5r.js +3916 -0
  110. package/dist/index-BDMI4NVY.js +492 -0
  111. package/dist/index-BbscgdRg.js +81 -0
  112. package/dist/index-CLUljEDI.js +347 -0
  113. package/dist/index-SxyZvewN.js +102 -0
  114. package/dist/index.es.js +35 -0
  115. package/dist/index.umd.js +3148 -0
  116. package/dist/main-CQBEuZk9.js +56739 -0
  117. package/dist/mapFormMixin-DlFcgwhm.js +72 -0
  118. package/dist/omit-BWy0Zhd3.js +31 -0
  119. package/dist/publicSenderState-CvOcFv2U.js +21 -0
  120. package/dist/splitpanes-BHUVsCZF.js +382 -0
  121. package/dist/style.css +4 -0
  122. package/dist/throttle-BrC8eGjQ.js +18 -0
  123. package/dist/tinycolor-PhFP695w.js +633 -0
  124. package/dist/tippy.esm-7dmKOUvu.js +1799 -0
  125. package/dist/utils-NBLgNGHR.js +108 -0
  126. package/dist/vuedraggable.umd-ByfH7ZxC.js +3161 -0
  127. package/dist/vuex.esm-DKGl8mcw.js +467 -0
  128. package/package.json +1 -1
  129. package/vite.config.ts +0 -1
@@ -0,0 +1,3874 @@
1
+ import { m as ft } from "./mapFormMixin-DlFcgwhm.js";
2
+ import { at as It, O as Tt, h as Et, au as Mt, av as Rt, aw as $t, n as ot, ax as Dt, g as yt, e as At, M as Bt } from "./main-CQBEuZk9.js";
3
+ import { a as nt } from "./anime.es-BrPTThYb.js";
4
+ import { a as Ut } from "./vuex.esm-DKGl8mcw.js";
5
+ import { C as Lt } from "./CFormField--m3PvQuT.js";
6
+ /*!
7
+ * vue-qrcode v1.0.2
8
+ * https://fengyuanchen.github.io/vue-qrcode
9
+ *
10
+ * Copyright 2018-present Chen Fengyuan
11
+ * Released under the MIT license
12
+ *
13
+ * Date: 2020-01-18T06:04:33.222Z
14
+ */
15
+ function gt() {
16
+ throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs");
17
+ }
18
+ function Nt(v, r) {
19
+ return r = { exports: {} }, v(r, r.exports), r.exports;
20
+ }
21
+ var xt = Nt(function(v, r) {
22
+ (function(n) {
23
+ v.exports = n();
24
+ })(function() {
25
+ return (/* @__PURE__ */ function() {
26
+ function n(g, u, h) {
27
+ function d(s, f) {
28
+ if (!u[s]) {
29
+ if (!g[s]) {
30
+ var a = typeof gt == "function" && gt;
31
+ if (!f && a)
32
+ return a(s, !0);
33
+ if (l)
34
+ return l(s, !0);
35
+ var y = new Error("Cannot find module '" + s + "'");
36
+ throw y.code = "MODULE_NOT_FOUND", y;
37
+ }
38
+ var x = u[s] = { exports: {} };
39
+ g[s][0].call(x.exports, function(b) {
40
+ var A = g[s][1][b];
41
+ return d(A || b);
42
+ }, x, x.exports, n, g, u, h);
43
+ }
44
+ return u[s].exports;
45
+ }
46
+ for (var l = typeof gt == "function" && gt, i = 0; i < h.length; i++)
47
+ d(h[i]);
48
+ return d;
49
+ }
50
+ return n;
51
+ }())({ 1: [function(n, g, u) {
52
+ g.exports = function() {
53
+ return typeof Promise == "function" && Promise.prototype && Promise.prototype.then;
54
+ };
55
+ }, {}], 2: [function(n, g, u) {
56
+ var h = n("./utils").getSymbolSize;
57
+ u.getRowColCoords = function(l) {
58
+ if (l === 1)
59
+ return [];
60
+ for (var i = Math.floor(l / 7) + 2, s = h(l), f = s === 145 ? 26 : Math.ceil((s - 13) / (2 * i - 2)) * 2, a = [s - 7], y = 1; y < i - 1; y++)
61
+ a[y] = a[y - 1] - f;
62
+ return a.push(6), a.reverse();
63
+ }, u.getPositions = function(l) {
64
+ for (var i = [], s = u.getRowColCoords(l), f = s.length, a = 0; a < f; a++)
65
+ for (var y = 0; y < f; y++)
66
+ a === 0 && y === 0 || // top-left
67
+ a === 0 && y === f - 1 || // bottom-left
68
+ a === f - 1 && y === 0 || i.push([s[a], s[y]]);
69
+ return i;
70
+ };
71
+ }, { "./utils": 21 }], 3: [function(n, g, u) {
72
+ var h = n("./mode"), d = [
73
+ "0",
74
+ "1",
75
+ "2",
76
+ "3",
77
+ "4",
78
+ "5",
79
+ "6",
80
+ "7",
81
+ "8",
82
+ "9",
83
+ "A",
84
+ "B",
85
+ "C",
86
+ "D",
87
+ "E",
88
+ "F",
89
+ "G",
90
+ "H",
91
+ "I",
92
+ "J",
93
+ "K",
94
+ "L",
95
+ "M",
96
+ "N",
97
+ "O",
98
+ "P",
99
+ "Q",
100
+ "R",
101
+ "S",
102
+ "T",
103
+ "U",
104
+ "V",
105
+ "W",
106
+ "X",
107
+ "Y",
108
+ "Z",
109
+ " ",
110
+ "$",
111
+ "%",
112
+ "*",
113
+ "+",
114
+ "-",
115
+ ".",
116
+ "/",
117
+ ":"
118
+ ];
119
+ function l(i) {
120
+ this.mode = h.ALPHANUMERIC, this.data = i;
121
+ }
122
+ l.getBitsLength = function(s) {
123
+ return 11 * Math.floor(s / 2) + 6 * (s % 2);
124
+ }, l.prototype.getLength = function() {
125
+ return this.data.length;
126
+ }, l.prototype.getBitsLength = function() {
127
+ return l.getBitsLength(this.data.length);
128
+ }, l.prototype.write = function(s) {
129
+ var f;
130
+ for (f = 0; f + 2 <= this.data.length; f += 2) {
131
+ var a = d.indexOf(this.data[f]) * 45;
132
+ a += d.indexOf(this.data[f + 1]), s.put(a, 11);
133
+ }
134
+ this.data.length % 2 && s.put(d.indexOf(this.data[f]), 6);
135
+ }, g.exports = l;
136
+ }, { "./mode": 14 }], 4: [function(n, g, u) {
137
+ function h() {
138
+ this.buffer = [], this.length = 0;
139
+ }
140
+ h.prototype = {
141
+ get: function(d) {
142
+ var l = Math.floor(d / 8);
143
+ return (this.buffer[l] >>> 7 - d % 8 & 1) === 1;
144
+ },
145
+ put: function(d, l) {
146
+ for (var i = 0; i < l; i++)
147
+ this.putBit((d >>> l - i - 1 & 1) === 1);
148
+ },
149
+ getLengthInBits: function() {
150
+ return this.length;
151
+ },
152
+ putBit: function(d) {
153
+ var l = Math.floor(this.length / 8);
154
+ this.buffer.length <= l && this.buffer.push(0), d && (this.buffer[l] |= 128 >>> this.length % 8), this.length++;
155
+ }
156
+ }, g.exports = h;
157
+ }, {}], 5: [function(n, g, u) {
158
+ var h = n("../utils/buffer");
159
+ function d(l) {
160
+ if (!l || l < 1)
161
+ throw new Error("BitMatrix size must be defined and greater than 0");
162
+ this.size = l, this.data = h.alloc(l * l), this.reservedBit = h.alloc(l * l);
163
+ }
164
+ d.prototype.set = function(l, i, s, f) {
165
+ var a = l * this.size + i;
166
+ this.data[a] = s, f && (this.reservedBit[a] = !0);
167
+ }, d.prototype.get = function(l, i) {
168
+ return this.data[l * this.size + i];
169
+ }, d.prototype.xor = function(l, i, s) {
170
+ this.data[l * this.size + i] ^= s;
171
+ }, d.prototype.isReserved = function(l, i) {
172
+ return this.reservedBit[l * this.size + i];
173
+ }, g.exports = d;
174
+ }, { "../utils/buffer": 28 }], 6: [function(n, g, u) {
175
+ var h = n("../utils/buffer"), d = n("./mode");
176
+ function l(i) {
177
+ this.mode = d.BYTE, this.data = h.from(i);
178
+ }
179
+ l.getBitsLength = function(s) {
180
+ return s * 8;
181
+ }, l.prototype.getLength = function() {
182
+ return this.data.length;
183
+ }, l.prototype.getBitsLength = function() {
184
+ return l.getBitsLength(this.data.length);
185
+ }, l.prototype.write = function(i) {
186
+ for (var s = 0, f = this.data.length; s < f; s++)
187
+ i.put(this.data[s], 8);
188
+ }, g.exports = l;
189
+ }, { "../utils/buffer": 28, "./mode": 14 }], 7: [function(n, g, u) {
190
+ var h = n("./error-correction-level"), d = [
191
+ // L M Q H
192
+ 1,
193
+ 1,
194
+ 1,
195
+ 1,
196
+ 1,
197
+ 1,
198
+ 1,
199
+ 1,
200
+ 1,
201
+ 1,
202
+ 2,
203
+ 2,
204
+ 1,
205
+ 2,
206
+ 2,
207
+ 4,
208
+ 1,
209
+ 2,
210
+ 4,
211
+ 4,
212
+ 2,
213
+ 4,
214
+ 4,
215
+ 4,
216
+ 2,
217
+ 4,
218
+ 6,
219
+ 5,
220
+ 2,
221
+ 4,
222
+ 6,
223
+ 6,
224
+ 2,
225
+ 5,
226
+ 8,
227
+ 8,
228
+ 4,
229
+ 5,
230
+ 8,
231
+ 8,
232
+ 4,
233
+ 5,
234
+ 8,
235
+ 11,
236
+ 4,
237
+ 8,
238
+ 10,
239
+ 11,
240
+ 4,
241
+ 9,
242
+ 12,
243
+ 16,
244
+ 4,
245
+ 9,
246
+ 16,
247
+ 16,
248
+ 6,
249
+ 10,
250
+ 12,
251
+ 18,
252
+ 6,
253
+ 10,
254
+ 17,
255
+ 16,
256
+ 6,
257
+ 11,
258
+ 16,
259
+ 19,
260
+ 6,
261
+ 13,
262
+ 18,
263
+ 21,
264
+ 7,
265
+ 14,
266
+ 21,
267
+ 25,
268
+ 8,
269
+ 16,
270
+ 20,
271
+ 25,
272
+ 8,
273
+ 17,
274
+ 23,
275
+ 25,
276
+ 9,
277
+ 17,
278
+ 23,
279
+ 34,
280
+ 9,
281
+ 18,
282
+ 25,
283
+ 30,
284
+ 10,
285
+ 20,
286
+ 27,
287
+ 32,
288
+ 12,
289
+ 21,
290
+ 29,
291
+ 35,
292
+ 12,
293
+ 23,
294
+ 34,
295
+ 37,
296
+ 12,
297
+ 25,
298
+ 34,
299
+ 40,
300
+ 13,
301
+ 26,
302
+ 35,
303
+ 42,
304
+ 14,
305
+ 28,
306
+ 38,
307
+ 45,
308
+ 15,
309
+ 29,
310
+ 40,
311
+ 48,
312
+ 16,
313
+ 31,
314
+ 43,
315
+ 51,
316
+ 17,
317
+ 33,
318
+ 45,
319
+ 54,
320
+ 18,
321
+ 35,
322
+ 48,
323
+ 57,
324
+ 19,
325
+ 37,
326
+ 51,
327
+ 60,
328
+ 19,
329
+ 38,
330
+ 53,
331
+ 63,
332
+ 20,
333
+ 40,
334
+ 56,
335
+ 66,
336
+ 21,
337
+ 43,
338
+ 59,
339
+ 70,
340
+ 22,
341
+ 45,
342
+ 62,
343
+ 74,
344
+ 24,
345
+ 47,
346
+ 65,
347
+ 77,
348
+ 25,
349
+ 49,
350
+ 68,
351
+ 81
352
+ ], l = [
353
+ // L M Q H
354
+ 7,
355
+ 10,
356
+ 13,
357
+ 17,
358
+ 10,
359
+ 16,
360
+ 22,
361
+ 28,
362
+ 15,
363
+ 26,
364
+ 36,
365
+ 44,
366
+ 20,
367
+ 36,
368
+ 52,
369
+ 64,
370
+ 26,
371
+ 48,
372
+ 72,
373
+ 88,
374
+ 36,
375
+ 64,
376
+ 96,
377
+ 112,
378
+ 40,
379
+ 72,
380
+ 108,
381
+ 130,
382
+ 48,
383
+ 88,
384
+ 132,
385
+ 156,
386
+ 60,
387
+ 110,
388
+ 160,
389
+ 192,
390
+ 72,
391
+ 130,
392
+ 192,
393
+ 224,
394
+ 80,
395
+ 150,
396
+ 224,
397
+ 264,
398
+ 96,
399
+ 176,
400
+ 260,
401
+ 308,
402
+ 104,
403
+ 198,
404
+ 288,
405
+ 352,
406
+ 120,
407
+ 216,
408
+ 320,
409
+ 384,
410
+ 132,
411
+ 240,
412
+ 360,
413
+ 432,
414
+ 144,
415
+ 280,
416
+ 408,
417
+ 480,
418
+ 168,
419
+ 308,
420
+ 448,
421
+ 532,
422
+ 180,
423
+ 338,
424
+ 504,
425
+ 588,
426
+ 196,
427
+ 364,
428
+ 546,
429
+ 650,
430
+ 224,
431
+ 416,
432
+ 600,
433
+ 700,
434
+ 224,
435
+ 442,
436
+ 644,
437
+ 750,
438
+ 252,
439
+ 476,
440
+ 690,
441
+ 816,
442
+ 270,
443
+ 504,
444
+ 750,
445
+ 900,
446
+ 300,
447
+ 560,
448
+ 810,
449
+ 960,
450
+ 312,
451
+ 588,
452
+ 870,
453
+ 1050,
454
+ 336,
455
+ 644,
456
+ 952,
457
+ 1110,
458
+ 360,
459
+ 700,
460
+ 1020,
461
+ 1200,
462
+ 390,
463
+ 728,
464
+ 1050,
465
+ 1260,
466
+ 420,
467
+ 784,
468
+ 1140,
469
+ 1350,
470
+ 450,
471
+ 812,
472
+ 1200,
473
+ 1440,
474
+ 480,
475
+ 868,
476
+ 1290,
477
+ 1530,
478
+ 510,
479
+ 924,
480
+ 1350,
481
+ 1620,
482
+ 540,
483
+ 980,
484
+ 1440,
485
+ 1710,
486
+ 570,
487
+ 1036,
488
+ 1530,
489
+ 1800,
490
+ 570,
491
+ 1064,
492
+ 1590,
493
+ 1890,
494
+ 600,
495
+ 1120,
496
+ 1680,
497
+ 1980,
498
+ 630,
499
+ 1204,
500
+ 1770,
501
+ 2100,
502
+ 660,
503
+ 1260,
504
+ 1860,
505
+ 2220,
506
+ 720,
507
+ 1316,
508
+ 1950,
509
+ 2310,
510
+ 750,
511
+ 1372,
512
+ 2040,
513
+ 2430
514
+ ];
515
+ u.getBlocksCount = function(s, f) {
516
+ switch (f) {
517
+ case h.L:
518
+ return d[(s - 1) * 4 + 0];
519
+ case h.M:
520
+ return d[(s - 1) * 4 + 1];
521
+ case h.Q:
522
+ return d[(s - 1) * 4 + 2];
523
+ case h.H:
524
+ return d[(s - 1) * 4 + 3];
525
+ default:
526
+ return;
527
+ }
528
+ }, u.getTotalCodewordsCount = function(s, f) {
529
+ switch (f) {
530
+ case h.L:
531
+ return l[(s - 1) * 4 + 0];
532
+ case h.M:
533
+ return l[(s - 1) * 4 + 1];
534
+ case h.Q:
535
+ return l[(s - 1) * 4 + 2];
536
+ case h.H:
537
+ return l[(s - 1) * 4 + 3];
538
+ default:
539
+ return;
540
+ }
541
+ };
542
+ }, { "./error-correction-level": 8 }], 8: [function(n, g, u) {
543
+ u.L = { bit: 1 }, u.M = { bit: 0 }, u.Q = { bit: 3 }, u.H = { bit: 2 };
544
+ function h(d) {
545
+ if (typeof d != "string")
546
+ throw new Error("Param is not a string");
547
+ var l = d.toLowerCase();
548
+ switch (l) {
549
+ case "l":
550
+ case "low":
551
+ return u.L;
552
+ case "m":
553
+ case "medium":
554
+ return u.M;
555
+ case "q":
556
+ case "quartile":
557
+ return u.Q;
558
+ case "h":
559
+ case "high":
560
+ return u.H;
561
+ default:
562
+ throw new Error("Unknown EC Level: " + d);
563
+ }
564
+ }
565
+ u.isValid = function(l) {
566
+ return l && typeof l.bit < "u" && l.bit >= 0 && l.bit < 4;
567
+ }, u.from = function(l, i) {
568
+ if (u.isValid(l))
569
+ return l;
570
+ try {
571
+ return h(l);
572
+ } catch {
573
+ return i;
574
+ }
575
+ };
576
+ }, {}], 9: [function(n, g, u) {
577
+ var h = n("./utils").getSymbolSize, d = 7;
578
+ u.getPositions = function(i) {
579
+ var s = h(i);
580
+ return [
581
+ // top-left
582
+ [0, 0],
583
+ // top-right
584
+ [s - d, 0],
585
+ // bottom-left
586
+ [0, s - d]
587
+ ];
588
+ };
589
+ }, { "./utils": 21 }], 10: [function(n, g, u) {
590
+ var h = n("./utils"), d = 1335, l = 21522, i = h.getBCHDigit(d);
591
+ u.getEncodedBits = function(f, a) {
592
+ for (var y = f.bit << 3 | a, x = y << 10; h.getBCHDigit(x) - i >= 0; )
593
+ x ^= d << h.getBCHDigit(x) - i;
594
+ return (y << 10 | x) ^ l;
595
+ };
596
+ }, { "./utils": 21 }], 11: [function(n, g, u) {
597
+ var h = n("../utils/buffer"), d = h.alloc(512), l = h.alloc(256);
598
+ (function() {
599
+ for (var s = 1, f = 0; f < 255; f++)
600
+ d[f] = s, l[s] = f, s <<= 1, s & 256 && (s ^= 285);
601
+ for (f = 255; f < 512; f++)
602
+ d[f] = d[f - 255];
603
+ })(), u.log = function(s) {
604
+ if (s < 1)
605
+ throw new Error("log(" + s + ")");
606
+ return l[s];
607
+ }, u.exp = function(s) {
608
+ return d[s];
609
+ }, u.mul = function(s, f) {
610
+ return s === 0 || f === 0 ? 0 : d[l[s] + l[f]];
611
+ };
612
+ }, { "../utils/buffer": 28 }], 12: [function(n, g, u) {
613
+ var h = n("./mode"), d = n("./utils");
614
+ function l(i) {
615
+ this.mode = h.KANJI, this.data = i;
616
+ }
617
+ l.getBitsLength = function(s) {
618
+ return s * 13;
619
+ }, l.prototype.getLength = function() {
620
+ return this.data.length;
621
+ }, l.prototype.getBitsLength = function() {
622
+ return l.getBitsLength(this.data.length);
623
+ }, l.prototype.write = function(i) {
624
+ var s;
625
+ for (s = 0; s < this.data.length; s++) {
626
+ var f = d.toSJIS(this.data[s]);
627
+ if (f >= 33088 && f <= 40956)
628
+ f -= 33088;
629
+ else if (f >= 57408 && f <= 60351)
630
+ f -= 49472;
631
+ else
632
+ throw new Error(
633
+ "Invalid SJIS character: " + this.data[s] + `
634
+ Make sure your charset is UTF-8`
635
+ );
636
+ f = (f >>> 8 & 255) * 192 + (f & 255), i.put(f, 13);
637
+ }
638
+ }, g.exports = l;
639
+ }, { "./mode": 14, "./utils": 21 }], 13: [function(n, g, u) {
640
+ u.Patterns = {
641
+ PATTERN000: 0,
642
+ PATTERN001: 1,
643
+ PATTERN010: 2,
644
+ PATTERN011: 3,
645
+ PATTERN100: 4,
646
+ PATTERN101: 5,
647
+ PATTERN110: 6,
648
+ PATTERN111: 7
649
+ };
650
+ var h = {
651
+ N1: 3,
652
+ N2: 3,
653
+ N3: 40,
654
+ N4: 10
655
+ };
656
+ u.isValid = function(i) {
657
+ return i != null && i !== "" && !isNaN(i) && i >= 0 && i <= 7;
658
+ }, u.from = function(i) {
659
+ return u.isValid(i) ? parseInt(i, 10) : void 0;
660
+ }, u.getPenaltyN1 = function(i) {
661
+ for (var s = i.size, f = 0, a = 0, y = 0, x = null, b = null, A = 0; A < s; A++) {
662
+ a = y = 0, x = b = null;
663
+ for (var F = 0; F < s; F++) {
664
+ var M = i.get(A, F);
665
+ M === x ? a++ : (a >= 5 && (f += h.N1 + (a - 5)), x = M, a = 1), M = i.get(F, A), M === b ? y++ : (y >= 5 && (f += h.N1 + (y - 5)), b = M, y = 1);
666
+ }
667
+ a >= 5 && (f += h.N1 + (a - 5)), y >= 5 && (f += h.N1 + (y - 5));
668
+ }
669
+ return f;
670
+ }, u.getPenaltyN2 = function(i) {
671
+ for (var s = i.size, f = 0, a = 0; a < s - 1; a++)
672
+ for (var y = 0; y < s - 1; y++) {
673
+ var x = i.get(a, y) + i.get(a, y + 1) + i.get(a + 1, y) + i.get(a + 1, y + 1);
674
+ (x === 4 || x === 0) && f++;
675
+ }
676
+ return f * h.N2;
677
+ }, u.getPenaltyN3 = function(i) {
678
+ for (var s = i.size, f = 0, a = 0, y = 0, x = 0; x < s; x++) {
679
+ a = y = 0;
680
+ for (var b = 0; b < s; b++)
681
+ a = a << 1 & 2047 | i.get(x, b), b >= 10 && (a === 1488 || a === 93) && f++, y = y << 1 & 2047 | i.get(b, x), b >= 10 && (y === 1488 || y === 93) && f++;
682
+ }
683
+ return f * h.N3;
684
+ }, u.getPenaltyN4 = function(i) {
685
+ for (var s = 0, f = i.data.length, a = 0; a < f; a++)
686
+ s += i.data[a];
687
+ var y = Math.abs(Math.ceil(s * 100 / f / 5) - 10);
688
+ return y * h.N4;
689
+ };
690
+ function d(l, i, s) {
691
+ switch (l) {
692
+ case u.Patterns.PATTERN000:
693
+ return (i + s) % 2 === 0;
694
+ case u.Patterns.PATTERN001:
695
+ return i % 2 === 0;
696
+ case u.Patterns.PATTERN010:
697
+ return s % 3 === 0;
698
+ case u.Patterns.PATTERN011:
699
+ return (i + s) % 3 === 0;
700
+ case u.Patterns.PATTERN100:
701
+ return (Math.floor(i / 2) + Math.floor(s / 3)) % 2 === 0;
702
+ case u.Patterns.PATTERN101:
703
+ return i * s % 2 + i * s % 3 === 0;
704
+ case u.Patterns.PATTERN110:
705
+ return (i * s % 2 + i * s % 3) % 2 === 0;
706
+ case u.Patterns.PATTERN111:
707
+ return (i * s % 3 + (i + s) % 2) % 2 === 0;
708
+ default:
709
+ throw new Error("bad maskPattern:" + l);
710
+ }
711
+ }
712
+ u.applyMask = function(i, s) {
713
+ for (var f = s.size, a = 0; a < f; a++)
714
+ for (var y = 0; y < f; y++)
715
+ s.isReserved(y, a) || s.xor(y, a, d(i, y, a));
716
+ }, u.getBestMask = function(i, s) {
717
+ for (var f = Object.keys(u.Patterns).length, a = 0, y = 1 / 0, x = 0; x < f; x++) {
718
+ s(x), u.applyMask(x, i);
719
+ var b = u.getPenaltyN1(i) + u.getPenaltyN2(i) + u.getPenaltyN3(i) + u.getPenaltyN4(i);
720
+ u.applyMask(x, i), b < y && (y = b, a = x);
721
+ }
722
+ return a;
723
+ };
724
+ }, {}], 14: [function(n, g, u) {
725
+ var h = n("./version-check"), d = n("./regex");
726
+ u.NUMERIC = {
727
+ id: "Numeric",
728
+ bit: 1,
729
+ ccBits: [10, 12, 14]
730
+ }, u.ALPHANUMERIC = {
731
+ id: "Alphanumeric",
732
+ bit: 2,
733
+ ccBits: [9, 11, 13]
734
+ }, u.BYTE = {
735
+ id: "Byte",
736
+ bit: 4,
737
+ ccBits: [8, 16, 16]
738
+ }, u.KANJI = {
739
+ id: "Kanji",
740
+ bit: 8,
741
+ ccBits: [8, 10, 12]
742
+ }, u.MIXED = {
743
+ bit: -1
744
+ }, u.getCharCountIndicator = function(s, f) {
745
+ if (!s.ccBits)
746
+ throw new Error("Invalid mode: " + s);
747
+ if (!h.isValid(f))
748
+ throw new Error("Invalid version: " + f);
749
+ return f >= 1 && f < 10 ? s.ccBits[0] : f < 27 ? s.ccBits[1] : s.ccBits[2];
750
+ }, u.getBestModeForData = function(s) {
751
+ return d.testNumeric(s) ? u.NUMERIC : d.testAlphanumeric(s) ? u.ALPHANUMERIC : d.testKanji(s) ? u.KANJI : u.BYTE;
752
+ }, u.toString = function(s) {
753
+ if (s && s.id)
754
+ return s.id;
755
+ throw new Error("Invalid mode");
756
+ }, u.isValid = function(s) {
757
+ return s && s.bit && s.ccBits;
758
+ };
759
+ function l(i) {
760
+ if (typeof i != "string")
761
+ throw new Error("Param is not a string");
762
+ var s = i.toLowerCase();
763
+ switch (s) {
764
+ case "numeric":
765
+ return u.NUMERIC;
766
+ case "alphanumeric":
767
+ return u.ALPHANUMERIC;
768
+ case "kanji":
769
+ return u.KANJI;
770
+ case "byte":
771
+ return u.BYTE;
772
+ default:
773
+ throw new Error("Unknown mode: " + i);
774
+ }
775
+ }
776
+ u.from = function(s, f) {
777
+ if (u.isValid(s))
778
+ return s;
779
+ try {
780
+ return l(s);
781
+ } catch {
782
+ return f;
783
+ }
784
+ };
785
+ }, { "./regex": 19, "./version-check": 22 }], 15: [function(n, g, u) {
786
+ var h = n("./mode");
787
+ function d(l) {
788
+ this.mode = h.NUMERIC, this.data = l.toString();
789
+ }
790
+ d.getBitsLength = function(i) {
791
+ return 10 * Math.floor(i / 3) + (i % 3 ? i % 3 * 3 + 1 : 0);
792
+ }, d.prototype.getLength = function() {
793
+ return this.data.length;
794
+ }, d.prototype.getBitsLength = function() {
795
+ return d.getBitsLength(this.data.length);
796
+ }, d.prototype.write = function(i) {
797
+ var s, f, a;
798
+ for (s = 0; s + 3 <= this.data.length; s += 3)
799
+ f = this.data.substr(s, 3), a = parseInt(f, 10), i.put(a, 10);
800
+ var y = this.data.length - s;
801
+ y > 0 && (f = this.data.substr(s), a = parseInt(f, 10), i.put(a, y * 3 + 1));
802
+ }, g.exports = d;
803
+ }, { "./mode": 14 }], 16: [function(n, g, u) {
804
+ var h = n("../utils/buffer"), d = n("./galois-field");
805
+ u.mul = function(i, s) {
806
+ for (var f = h.alloc(i.length + s.length - 1), a = 0; a < i.length; a++)
807
+ for (var y = 0; y < s.length; y++)
808
+ f[a + y] ^= d.mul(i[a], s[y]);
809
+ return f;
810
+ }, u.mod = function(i, s) {
811
+ for (var f = h.from(i); f.length - s.length >= 0; ) {
812
+ for (var a = f[0], y = 0; y < s.length; y++)
813
+ f[y] ^= d.mul(s[y], a);
814
+ for (var x = 0; x < f.length && f[x] === 0; )
815
+ x++;
816
+ f = f.slice(x);
817
+ }
818
+ return f;
819
+ }, u.generateECPolynomial = function(i) {
820
+ for (var s = h.from([1]), f = 0; f < i; f++)
821
+ s = u.mul(s, [1, d.exp(f)]);
822
+ return s;
823
+ };
824
+ }, { "../utils/buffer": 28, "./galois-field": 11 }], 17: [function(n, g, u) {
825
+ var h = n("../utils/buffer"), d = n("./utils"), l = n("./error-correction-level"), i = n("./bit-buffer"), s = n("./bit-matrix"), f = n("./alignment-pattern"), a = n("./finder-pattern"), y = n("./mask-pattern"), x = n("./error-correction-code"), b = n("./reed-solomon-encoder"), A = n("./version"), F = n("./format-info"), M = n("./mode"), E = n("./segments"), B = n("isarray");
826
+ function I($, D) {
827
+ for (var U = $.size, R = a.getPositions(D), O = 0; O < R.length; O++)
828
+ for (var z = R[O][0], N = R[O][1], Y = -1; Y <= 7; Y++)
829
+ if (!(z + Y <= -1 || U <= z + Y))
830
+ for (var j = -1; j <= 7; j++)
831
+ N + j <= -1 || U <= N + j || (Y >= 0 && Y <= 6 && (j === 0 || j === 6) || j >= 0 && j <= 6 && (Y === 0 || Y === 6) || Y >= 2 && Y <= 4 && j >= 2 && j <= 4 ? $.set(z + Y, N + j, !0, !0) : $.set(z + Y, N + j, !1, !0));
832
+ }
833
+ function k($) {
834
+ for (var D = $.size, U = 8; U < D - 8; U++) {
835
+ var R = U % 2 === 0;
836
+ $.set(U, 6, R, !0), $.set(6, U, R, !0);
837
+ }
838
+ }
839
+ function _($, D) {
840
+ for (var U = f.getPositions(D), R = 0; R < U.length; R++)
841
+ for (var O = U[R][0], z = U[R][1], N = -2; N <= 2; N++)
842
+ for (var Y = -2; Y <= 2; Y++)
843
+ N === -2 || N === 2 || Y === -2 || Y === 2 || N === 0 && Y === 0 ? $.set(O + N, z + Y, !0, !0) : $.set(O + N, z + Y, !1, !0);
844
+ }
845
+ function m($, D) {
846
+ for (var U = $.size, R = A.getEncodedBits(D), O, z, N, Y = 0; Y < 18; Y++)
847
+ O = Math.floor(Y / 3), z = Y % 3 + U - 8 - 3, N = (R >> Y & 1) === 1, $.set(O, z, N, !0), $.set(z, O, N, !0);
848
+ }
849
+ function p($, D, U) {
850
+ var R = $.size, O = F.getEncodedBits(D, U), z, N;
851
+ for (z = 0; z < 15; z++)
852
+ N = (O >> z & 1) === 1, z < 6 ? $.set(z, 8, N, !0) : z < 8 ? $.set(z + 1, 8, N, !0) : $.set(R - 15 + z, 8, N, !0), z < 8 ? $.set(8, R - z - 1, N, !0) : z < 9 ? $.set(8, 15 - z - 1 + 1, N, !0) : $.set(8, 15 - z - 1, N, !0);
853
+ $.set(R - 8, 8, 1, !0);
854
+ }
855
+ function C($, D) {
856
+ for (var U = $.size, R = -1, O = U - 1, z = 7, N = 0, Y = U - 1; Y > 0; Y -= 2)
857
+ for (Y === 6 && Y--; ; ) {
858
+ for (var j = 0; j < 2; j++)
859
+ if (!$.isReserved(O, Y - j)) {
860
+ var et = !1;
861
+ N < D.length && (et = (D[N] >>> z & 1) === 1), $.set(O, Y - j, et), z--, z === -1 && (N++, z = 7);
862
+ }
863
+ if (O += R, O < 0 || U <= O) {
864
+ O -= R, R = -R;
865
+ break;
866
+ }
867
+ }
868
+ }
869
+ function T($, D, U) {
870
+ var R = new i();
871
+ U.forEach(function(et) {
872
+ R.put(et.mode.bit, 4), R.put(et.getLength(), M.getCharCountIndicator(et.mode, $)), et.write(R);
873
+ });
874
+ var O = d.getSymbolTotalCodewords($), z = x.getTotalCodewordsCount($, D), N = (O - z) * 8;
875
+ for (R.getLengthInBits() + 4 <= N && R.put(0, 4); R.getLengthInBits() % 8 !== 0; )
876
+ R.putBit(0);
877
+ for (var Y = (N - R.getLengthInBits()) / 8, j = 0; j < Y; j++)
878
+ R.put(j % 2 ? 17 : 236, 8);
879
+ return L(R, $, D);
880
+ }
881
+ function L($, D, U) {
882
+ for (var R = d.getSymbolTotalCodewords(D), O = x.getTotalCodewordsCount(D, U), z = R - O, N = x.getBlocksCount(D, U), Y = R % N, j = N - Y, et = Math.floor(R / N), X = Math.floor(z / N), mt = X + 1, J = et - X, q = new b(J), at = 0, it = new Array(N), st = new Array(N), ut = 0, vt = h.from($.buffer), rt = 0; rt < N; rt++) {
883
+ var ct = rt < j ? X : mt;
884
+ it[rt] = vt.slice(at, at + ct), st[rt] = q.encode(it[rt]), at += ct, ut = Math.max(ut, ct);
885
+ }
886
+ var lt = h.alloc(R), ht = 0, tt, Q;
887
+ for (tt = 0; tt < ut; tt++)
888
+ for (Q = 0; Q < N; Q++)
889
+ tt < it[Q].length && (lt[ht++] = it[Q][tt]);
890
+ for (tt = 0; tt < J; tt++)
891
+ for (Q = 0; Q < N; Q++)
892
+ lt[ht++] = st[Q][tt];
893
+ return lt;
894
+ }
895
+ function W($, D, U, R) {
896
+ var O;
897
+ if (B($))
898
+ O = E.fromArray($);
899
+ else if (typeof $ == "string") {
900
+ var z = D;
901
+ if (!z) {
902
+ var N = E.rawSplit($);
903
+ z = A.getBestVersionForData(
904
+ N,
905
+ U
906
+ );
907
+ }
908
+ O = E.fromString($, z || 40);
909
+ } else
910
+ throw new Error("Invalid data");
911
+ var Y = A.getBestVersionForData(
912
+ O,
913
+ U
914
+ );
915
+ if (!Y)
916
+ throw new Error("The amount of data is too big to be stored in a QR Code");
917
+ if (!D)
918
+ D = Y;
919
+ else if (D < Y)
920
+ throw new Error(
921
+ `
922
+ The chosen QR Code version cannot contain this amount of data.
923
+ Minimum version required to store current data is: ` + Y + `.
924
+ `
925
+ );
926
+ var j = T(D, U, O), et = d.getSymbolSize(D), X = new s(et);
927
+ return I(X, D), k(X), _(X, D), p(X, U, 0), D >= 7 && m(X, D), C(X, j), isNaN(R) && (R = y.getBestMask(
928
+ X,
929
+ p.bind(null, X, U)
930
+ )), y.applyMask(R, X), p(X, U, R), {
931
+ modules: X,
932
+ version: D,
933
+ errorCorrectionLevel: U,
934
+ maskPattern: R,
935
+ segments: O
936
+ };
937
+ }
938
+ u.create = function(D, U) {
939
+ if (typeof D > "u" || D === "")
940
+ throw new Error("No input text");
941
+ var R = l.M, O, z;
942
+ return typeof U < "u" && (R = l.from(U.errorCorrectionLevel, l.M), O = A.from(U.version), z = y.from(U.maskPattern), U.toSJISFunc && d.setToSJISFunction(U.toSJISFunc)), W(D, O, R, z);
943
+ };
944
+ }, { "../utils/buffer": 28, "./alignment-pattern": 2, "./bit-buffer": 4, "./bit-matrix": 5, "./error-correction-code": 7, "./error-correction-level": 8, "./finder-pattern": 9, "./format-info": 10, "./mask-pattern": 13, "./mode": 14, "./reed-solomon-encoder": 18, "./segments": 20, "./utils": 21, "./version": 23, isarray: 33 }], 18: [function(n, g, u) {
945
+ var h = n("../utils/buffer"), d = n("./polynomial"), l = n("buffer").Buffer;
946
+ function i(s) {
947
+ this.genPoly = void 0, this.degree = s, this.degree && this.initialize(this.degree);
948
+ }
949
+ i.prototype.initialize = function(f) {
950
+ this.degree = f, this.genPoly = d.generateECPolynomial(this.degree);
951
+ }, i.prototype.encode = function(f) {
952
+ if (!this.genPoly)
953
+ throw new Error("Encoder not initialized");
954
+ var a = h.alloc(this.degree), y = l.concat([f, a], f.length + this.degree), x = d.mod(y, this.genPoly), b = this.degree - x.length;
955
+ if (b > 0) {
956
+ var A = h.alloc(this.degree);
957
+ return x.copy(A, b), A;
958
+ }
959
+ return x;
960
+ }, g.exports = i;
961
+ }, { "../utils/buffer": 28, "./polynomial": 16, buffer: 30 }], 19: [function(n, g, u) {
962
+ var h = "[0-9]+", d = "[A-Z $%*+\\-./:]+", l = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";
963
+ l = l.replace(/u/g, "\\u");
964
+ var i = "(?:(?![A-Z0-9 $%*+\\-./:]|" + l + `)(?:.|[\r
965
+ ]))+`;
966
+ u.KANJI = new RegExp(l, "g"), u.BYTE_KANJI = new RegExp("[^A-Z0-9 $%*+\\-./:]+", "g"), u.BYTE = new RegExp(i, "g"), u.NUMERIC = new RegExp(h, "g"), u.ALPHANUMERIC = new RegExp(d, "g");
967
+ var s = new RegExp("^" + l + "$"), f = new RegExp("^" + h + "$"), a = new RegExp("^[A-Z0-9 $%*+\\-./:]+$");
968
+ u.testKanji = function(x) {
969
+ return s.test(x);
970
+ }, u.testNumeric = function(x) {
971
+ return f.test(x);
972
+ }, u.testAlphanumeric = function(x) {
973
+ return a.test(x);
974
+ };
975
+ }, {}], 20: [function(n, g, u) {
976
+ var h = n("./mode"), d = n("./numeric-data"), l = n("./alphanumeric-data"), i = n("./byte-data"), s = n("./kanji-data"), f = n("./regex"), a = n("./utils"), y = n("dijkstrajs");
977
+ function x(k) {
978
+ return unescape(encodeURIComponent(k)).length;
979
+ }
980
+ function b(k, _, m) {
981
+ for (var p = [], C; (C = k.exec(m)) !== null; )
982
+ p.push({
983
+ data: C[0],
984
+ index: C.index,
985
+ mode: _,
986
+ length: C[0].length
987
+ });
988
+ return p;
989
+ }
990
+ function A(k) {
991
+ var _ = b(f.NUMERIC, h.NUMERIC, k), m = b(f.ALPHANUMERIC, h.ALPHANUMERIC, k), p, C;
992
+ a.isKanjiModeEnabled() ? (p = b(f.BYTE, h.BYTE, k), C = b(f.KANJI, h.KANJI, k)) : (p = b(f.BYTE_KANJI, h.BYTE, k), C = []);
993
+ var T = _.concat(m, p, C);
994
+ return T.sort(function(L, W) {
995
+ return L.index - W.index;
996
+ }).map(function(L) {
997
+ return {
998
+ data: L.data,
999
+ mode: L.mode,
1000
+ length: L.length
1001
+ };
1002
+ });
1003
+ }
1004
+ function F(k, _) {
1005
+ switch (_) {
1006
+ case h.NUMERIC:
1007
+ return d.getBitsLength(k);
1008
+ case h.ALPHANUMERIC:
1009
+ return l.getBitsLength(k);
1010
+ case h.KANJI:
1011
+ return s.getBitsLength(k);
1012
+ case h.BYTE:
1013
+ return i.getBitsLength(k);
1014
+ }
1015
+ }
1016
+ function M(k) {
1017
+ return k.reduce(function(_, m) {
1018
+ var p = _.length - 1 >= 0 ? _[_.length - 1] : null;
1019
+ return p && p.mode === m.mode ? (_[_.length - 1].data += m.data, _) : (_.push(m), _);
1020
+ }, []);
1021
+ }
1022
+ function E(k) {
1023
+ for (var _ = [], m = 0; m < k.length; m++) {
1024
+ var p = k[m];
1025
+ switch (p.mode) {
1026
+ case h.NUMERIC:
1027
+ _.push([
1028
+ p,
1029
+ { data: p.data, mode: h.ALPHANUMERIC, length: p.length },
1030
+ { data: p.data, mode: h.BYTE, length: p.length }
1031
+ ]);
1032
+ break;
1033
+ case h.ALPHANUMERIC:
1034
+ _.push([
1035
+ p,
1036
+ { data: p.data, mode: h.BYTE, length: p.length }
1037
+ ]);
1038
+ break;
1039
+ case h.KANJI:
1040
+ _.push([
1041
+ p,
1042
+ { data: p.data, mode: h.BYTE, length: x(p.data) }
1043
+ ]);
1044
+ break;
1045
+ case h.BYTE:
1046
+ _.push([
1047
+ { data: p.data, mode: h.BYTE, length: x(p.data) }
1048
+ ]);
1049
+ }
1050
+ }
1051
+ return _;
1052
+ }
1053
+ function B(k, _) {
1054
+ for (var m = {}, p = { start: {} }, C = ["start"], T = 0; T < k.length; T++) {
1055
+ for (var L = k[T], W = [], $ = 0; $ < L.length; $++) {
1056
+ var D = L[$], U = "" + T + $;
1057
+ W.push(U), m[U] = { node: D, lastCount: 0 }, p[U] = {};
1058
+ for (var R = 0; R < C.length; R++) {
1059
+ var O = C[R];
1060
+ m[O] && m[O].node.mode === D.mode ? (p[O][U] = F(m[O].lastCount + D.length, D.mode) - F(m[O].lastCount, D.mode), m[O].lastCount += D.length) : (m[O] && (m[O].lastCount = D.length), p[O][U] = F(D.length, D.mode) + 4 + h.getCharCountIndicator(D.mode, _));
1061
+ }
1062
+ }
1063
+ C = W;
1064
+ }
1065
+ for (R = 0; R < C.length; R++)
1066
+ p[C[R]].end = 0;
1067
+ return { map: p, table: m };
1068
+ }
1069
+ function I(k, _) {
1070
+ var m, p = h.getBestModeForData(k);
1071
+ if (m = h.from(_, p), m !== h.BYTE && m.bit < p.bit)
1072
+ throw new Error('"' + k + '" cannot be encoded with mode ' + h.toString(m) + `.
1073
+ Suggested mode is: ` + h.toString(p));
1074
+ switch (m === h.KANJI && !a.isKanjiModeEnabled() && (m = h.BYTE), m) {
1075
+ case h.NUMERIC:
1076
+ return new d(k);
1077
+ case h.ALPHANUMERIC:
1078
+ return new l(k);
1079
+ case h.KANJI:
1080
+ return new s(k);
1081
+ case h.BYTE:
1082
+ return new i(k);
1083
+ }
1084
+ }
1085
+ u.fromArray = function(_) {
1086
+ return _.reduce(function(m, p) {
1087
+ return typeof p == "string" ? m.push(I(p, null)) : p.data && m.push(I(p.data, p.mode)), m;
1088
+ }, []);
1089
+ }, u.fromString = function(_, m) {
1090
+ for (var p = A(_, a.isKanjiModeEnabled()), C = E(p), T = B(C, m), L = y.find_path(T.map, "start", "end"), W = [], $ = 1; $ < L.length - 1; $++)
1091
+ W.push(T.table[L[$]].node);
1092
+ return u.fromArray(M(W));
1093
+ }, u.rawSplit = function(_) {
1094
+ return u.fromArray(
1095
+ A(_, a.isKanjiModeEnabled())
1096
+ );
1097
+ };
1098
+ }, { "./alphanumeric-data": 3, "./byte-data": 6, "./kanji-data": 12, "./mode": 14, "./numeric-data": 15, "./regex": 19, "./utils": 21, dijkstrajs: 31 }], 21: [function(n, g, u) {
1099
+ var h, d = [
1100
+ 0,
1101
+ // Not used
1102
+ 26,
1103
+ 44,
1104
+ 70,
1105
+ 100,
1106
+ 134,
1107
+ 172,
1108
+ 196,
1109
+ 242,
1110
+ 292,
1111
+ 346,
1112
+ 404,
1113
+ 466,
1114
+ 532,
1115
+ 581,
1116
+ 655,
1117
+ 733,
1118
+ 815,
1119
+ 901,
1120
+ 991,
1121
+ 1085,
1122
+ 1156,
1123
+ 1258,
1124
+ 1364,
1125
+ 1474,
1126
+ 1588,
1127
+ 1706,
1128
+ 1828,
1129
+ 1921,
1130
+ 2051,
1131
+ 2185,
1132
+ 2323,
1133
+ 2465,
1134
+ 2611,
1135
+ 2761,
1136
+ 2876,
1137
+ 3034,
1138
+ 3196,
1139
+ 3362,
1140
+ 3532,
1141
+ 3706
1142
+ ];
1143
+ u.getSymbolSize = function(i) {
1144
+ if (!i)
1145
+ throw new Error('"version" cannot be null or undefined');
1146
+ if (i < 1 || i > 40)
1147
+ throw new Error('"version" should be in range from 1 to 40');
1148
+ return i * 4 + 17;
1149
+ }, u.getSymbolTotalCodewords = function(i) {
1150
+ return d[i];
1151
+ }, u.getBCHDigit = function(l) {
1152
+ for (var i = 0; l !== 0; )
1153
+ i++, l >>>= 1;
1154
+ return i;
1155
+ }, u.setToSJISFunction = function(i) {
1156
+ if (typeof i != "function")
1157
+ throw new Error('"toSJISFunc" is not a valid function.');
1158
+ h = i;
1159
+ }, u.isKanjiModeEnabled = function() {
1160
+ return typeof h < "u";
1161
+ }, u.toSJIS = function(i) {
1162
+ return h(i);
1163
+ };
1164
+ }, {}], 22: [function(n, g, u) {
1165
+ u.isValid = function(d) {
1166
+ return !isNaN(d) && d >= 1 && d <= 40;
1167
+ };
1168
+ }, {}], 23: [function(n, g, u) {
1169
+ var h = n("./utils"), d = n("./error-correction-code"), l = n("./error-correction-level"), i = n("./mode"), s = n("./version-check"), f = n("isarray"), a = 7973, y = h.getBCHDigit(a);
1170
+ function x(M, E, B) {
1171
+ for (var I = 1; I <= 40; I++)
1172
+ if (E <= u.getCapacity(I, B, M))
1173
+ return I;
1174
+ }
1175
+ function b(M, E) {
1176
+ return i.getCharCountIndicator(M, E) + 4;
1177
+ }
1178
+ function A(M, E) {
1179
+ var B = 0;
1180
+ return M.forEach(function(I) {
1181
+ var k = b(I.mode, E);
1182
+ B += k + I.getBitsLength();
1183
+ }), B;
1184
+ }
1185
+ function F(M, E) {
1186
+ for (var B = 1; B <= 40; B++) {
1187
+ var I = A(M, B);
1188
+ if (I <= u.getCapacity(B, E, i.MIXED))
1189
+ return B;
1190
+ }
1191
+ }
1192
+ u.from = function(E, B) {
1193
+ return s.isValid(E) ? parseInt(E, 10) : B;
1194
+ }, u.getCapacity = function(E, B, I) {
1195
+ if (!s.isValid(E))
1196
+ throw new Error("Invalid QR Code version");
1197
+ typeof I > "u" && (I = i.BYTE);
1198
+ var k = h.getSymbolTotalCodewords(E), _ = d.getTotalCodewordsCount(E, B), m = (k - _) * 8;
1199
+ if (I === i.MIXED)
1200
+ return m;
1201
+ var p = m - b(I, E);
1202
+ switch (I) {
1203
+ case i.NUMERIC:
1204
+ return Math.floor(p / 10 * 3);
1205
+ case i.ALPHANUMERIC:
1206
+ return Math.floor(p / 11 * 2);
1207
+ case i.KANJI:
1208
+ return Math.floor(p / 13);
1209
+ case i.BYTE:
1210
+ default:
1211
+ return Math.floor(p / 8);
1212
+ }
1213
+ }, u.getBestVersionForData = function(E, B) {
1214
+ var I, k = l.from(B, l.M);
1215
+ if (f(E)) {
1216
+ if (E.length > 1)
1217
+ return F(E, k);
1218
+ if (E.length === 0)
1219
+ return 1;
1220
+ I = E[0];
1221
+ } else
1222
+ I = E;
1223
+ return x(I.mode, I.getLength(), k);
1224
+ }, u.getEncodedBits = function(E) {
1225
+ if (!s.isValid(E) || E < 7)
1226
+ throw new Error("Invalid QR Code version");
1227
+ for (var B = E << 12; h.getBCHDigit(B) - y >= 0; )
1228
+ B ^= a << h.getBCHDigit(B) - y;
1229
+ return E << 12 | B;
1230
+ };
1231
+ }, { "./error-correction-code": 7, "./error-correction-level": 8, "./mode": 14, "./utils": 21, "./version-check": 22, isarray: 33 }], 24: [function(n, g, u) {
1232
+ var h = n("./can-promise"), d = n("./core/qrcode"), l = n("./renderer/canvas"), i = n("./renderer/svg-tag.js");
1233
+ function s(f, a, y, x, b) {
1234
+ var A = [].slice.call(arguments, 1), F = A.length, M = typeof A[F - 1] == "function";
1235
+ if (!M && !h())
1236
+ throw new Error("Callback required as last argument");
1237
+ if (M) {
1238
+ if (F < 2)
1239
+ throw new Error("Too few arguments provided");
1240
+ F === 2 ? (b = y, y = a, a = x = void 0) : F === 3 && (a.getContext && typeof b > "u" ? (b = x, x = void 0) : (b = x, x = y, y = a, a = void 0));
1241
+ } else {
1242
+ if (F < 1)
1243
+ throw new Error("Too few arguments provided");
1244
+ return F === 1 ? (y = a, a = x = void 0) : F === 2 && !a.getContext && (x = y, y = a, a = void 0), new Promise(function(B, I) {
1245
+ try {
1246
+ var k = d.create(y, x);
1247
+ B(f(k, a, x));
1248
+ } catch (_) {
1249
+ I(_);
1250
+ }
1251
+ });
1252
+ }
1253
+ try {
1254
+ var E = d.create(y, x);
1255
+ b(null, f(E, a, x));
1256
+ } catch (B) {
1257
+ b(B);
1258
+ }
1259
+ }
1260
+ u.create = d.create, u.toCanvas = s.bind(null, l.render), u.toDataURL = s.bind(null, l.renderToDataURL), u.toString = s.bind(null, function(f, a, y) {
1261
+ return i.render(f, y);
1262
+ });
1263
+ }, { "./can-promise": 1, "./core/qrcode": 17, "./renderer/canvas": 25, "./renderer/svg-tag.js": 26 }], 25: [function(n, g, u) {
1264
+ var h = n("./utils");
1265
+ function d(i, s, f) {
1266
+ i.clearRect(0, 0, s.width, s.height), s.style || (s.style = {}), s.height = f, s.width = f, s.style.height = f + "px", s.style.width = f + "px";
1267
+ }
1268
+ function l() {
1269
+ try {
1270
+ return document.createElement("canvas");
1271
+ } catch {
1272
+ throw new Error("You need to specify a canvas element");
1273
+ }
1274
+ }
1275
+ u.render = function(s, f, a) {
1276
+ var y = a, x = f;
1277
+ typeof y > "u" && (!f || !f.getContext) && (y = f, f = void 0), f || (x = l()), y = h.getOptions(y);
1278
+ var b = h.getImageWidth(s.modules.size, y), A = x.getContext("2d"), F = A.createImageData(b, b);
1279
+ return h.qrToImageData(F.data, s, y), d(A, x, b), A.putImageData(F, 0, 0), x;
1280
+ }, u.renderToDataURL = function(s, f, a) {
1281
+ var y = a;
1282
+ typeof y > "u" && (!f || !f.getContext) && (y = f, f = void 0), y || (y = {});
1283
+ var x = u.render(s, f, y), b = y.type || "image/png", A = y.rendererOpts || {};
1284
+ return x.toDataURL(b, A.quality);
1285
+ };
1286
+ }, { "./utils": 27 }], 26: [function(n, g, u) {
1287
+ var h = n("./utils");
1288
+ function d(s, f) {
1289
+ var a = s.a / 255, y = f + '="' + s.hex + '"';
1290
+ return a < 1 ? y + " " + f + '-opacity="' + a.toFixed(2).slice(1) + '"' : y;
1291
+ }
1292
+ function l(s, f, a) {
1293
+ var y = s + f;
1294
+ return typeof a < "u" && (y += " " + a), y;
1295
+ }
1296
+ function i(s, f, a) {
1297
+ for (var y = "", x = 0, b = !1, A = 0, F = 0; F < s.length; F++) {
1298
+ var M = Math.floor(F % f), E = Math.floor(F / f);
1299
+ !M && !b && (b = !0), s[F] ? (A++, F > 0 && M > 0 && s[F - 1] || (y += b ? l("M", M + a, 0.5 + E + a) : l("m", x, 0), x = 0, b = !1), M + 1 < f && s[F + 1] || (y += l("h", A), A = 0)) : x++;
1300
+ }
1301
+ return y;
1302
+ }
1303
+ u.render = function(f, a, y) {
1304
+ var x = h.getOptions(a), b = f.modules.size, A = f.modules.data, F = b + x.margin * 2, M = x.color.light.a ? "<path " + d(x.color.light, "fill") + ' d="M0 0h' + F + "v" + F + 'H0z"/>' : "", E = "<path " + d(x.color.dark, "stroke") + ' d="' + i(A, b, x.margin) + '"/>', B = 'viewBox="0 0 ' + F + " " + F + '"', I = x.width ? 'width="' + x.width + '" height="' + x.width + '" ' : "", k = '<svg xmlns="http://www.w3.org/2000/svg" ' + I + B + ' shape-rendering="crispEdges">' + M + E + `</svg>
1305
+ `;
1306
+ return typeof y == "function" && y(null, k), k;
1307
+ };
1308
+ }, { "./utils": 27 }], 27: [function(n, g, u) {
1309
+ function h(d) {
1310
+ if (typeof d == "number" && (d = d.toString()), typeof d != "string")
1311
+ throw new Error("Color should be defined as hex string");
1312
+ var l = d.slice().replace("#", "").split("");
1313
+ if (l.length < 3 || l.length === 5 || l.length > 8)
1314
+ throw new Error("Invalid hex color: " + d);
1315
+ (l.length === 3 || l.length === 4) && (l = Array.prototype.concat.apply([], l.map(function(s) {
1316
+ return [s, s];
1317
+ }))), l.length === 6 && l.push("F", "F");
1318
+ var i = parseInt(l.join(""), 16);
1319
+ return {
1320
+ r: i >> 24 & 255,
1321
+ g: i >> 16 & 255,
1322
+ b: i >> 8 & 255,
1323
+ a: i & 255,
1324
+ hex: "#" + l.slice(0, 6).join("")
1325
+ };
1326
+ }
1327
+ u.getOptions = function(l) {
1328
+ l || (l = {}), l.color || (l.color = {});
1329
+ var i = typeof l.margin > "u" || l.margin === null || l.margin < 0 ? 4 : l.margin, s = l.width && l.width >= 21 ? l.width : void 0, f = l.scale || 4;
1330
+ return {
1331
+ width: s,
1332
+ scale: s ? 4 : f,
1333
+ margin: i,
1334
+ color: {
1335
+ dark: h(l.color.dark || "#000000ff"),
1336
+ light: h(l.color.light || "#ffffffff")
1337
+ },
1338
+ type: l.type,
1339
+ rendererOpts: l.rendererOpts || {}
1340
+ };
1341
+ }, u.getScale = function(l, i) {
1342
+ return i.width && i.width >= l + i.margin * 2 ? i.width / (l + i.margin * 2) : i.scale;
1343
+ }, u.getImageWidth = function(l, i) {
1344
+ var s = u.getScale(l, i);
1345
+ return Math.floor((l + i.margin * 2) * s);
1346
+ }, u.qrToImageData = function(l, i, s) {
1347
+ for (var f = i.modules.size, a = i.modules.data, y = u.getScale(f, s), x = Math.floor((f + s.margin * 2) * y), b = s.margin * y, A = [s.color.light, s.color.dark], F = 0; F < x; F++)
1348
+ for (var M = 0; M < x; M++) {
1349
+ var E = (F * x + M) * 4, B = s.color.light;
1350
+ if (F >= b && M >= b && F < x - b && M < x - b) {
1351
+ var I = Math.floor((F - b) / y), k = Math.floor((M - b) / y);
1352
+ B = A[a[I * f + k] ? 1 : 0];
1353
+ }
1354
+ l[E++] = B.r, l[E++] = B.g, l[E++] = B.b, l[E] = B.a;
1355
+ }
1356
+ };
1357
+ }, {}], 28: [function(n, g, u) {
1358
+ var h = n("isarray");
1359
+ function d() {
1360
+ try {
1361
+ var _ = new Uint8Array(1);
1362
+ return _.__proto__ = { __proto__: Uint8Array.prototype, foo: function() {
1363
+ return 42;
1364
+ } }, _.foo() === 42;
1365
+ } catch {
1366
+ return !1;
1367
+ }
1368
+ }
1369
+ i.TYPED_ARRAY_SUPPORT = d();
1370
+ var l = i.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823;
1371
+ function i(_, m, p) {
1372
+ return !i.TYPED_ARRAY_SUPPORT && !(this instanceof i) ? new i(_, m, p) : typeof _ == "number" ? y(this, _) : k(this, _, m, p);
1373
+ }
1374
+ i.TYPED_ARRAY_SUPPORT && (i.prototype.__proto__ = Uint8Array.prototype, i.__proto__ = Uint8Array, typeof Symbol < "u" && Symbol.species && i[Symbol.species] === i && Object.defineProperty(i, Symbol.species, {
1375
+ value: null,
1376
+ configurable: !0,
1377
+ enumerable: !1,
1378
+ writable: !1
1379
+ }));
1380
+ function s(_) {
1381
+ if (_ >= l)
1382
+ throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + l.toString(16) + " bytes");
1383
+ return _ | 0;
1384
+ }
1385
+ function f(_) {
1386
+ return _ !== _;
1387
+ }
1388
+ function a(_, m) {
1389
+ var p;
1390
+ return i.TYPED_ARRAY_SUPPORT ? (p = new Uint8Array(m), p.__proto__ = i.prototype) : (p = _, p === null && (p = new i(m)), p.length = m), p;
1391
+ }
1392
+ function y(_, m) {
1393
+ var p = a(_, m < 0 ? 0 : s(m) | 0);
1394
+ if (!i.TYPED_ARRAY_SUPPORT)
1395
+ for (var C = 0; C < m; ++C)
1396
+ p[C] = 0;
1397
+ return p;
1398
+ }
1399
+ function x(_, m) {
1400
+ var p = E(m) | 0, C = a(_, p), T = C.write(m);
1401
+ return T !== p && (C = C.slice(0, T)), C;
1402
+ }
1403
+ function b(_, m) {
1404
+ for (var p = m.length < 0 ? 0 : s(m.length) | 0, C = a(_, p), T = 0; T < p; T += 1)
1405
+ C[T] = m[T] & 255;
1406
+ return C;
1407
+ }
1408
+ function A(_, m, p, C) {
1409
+ if (p < 0 || m.byteLength < p)
1410
+ throw new RangeError("'offset' is out of bounds");
1411
+ if (m.byteLength < p + (C || 0))
1412
+ throw new RangeError("'length' is out of bounds");
1413
+ var T;
1414
+ return p === void 0 && C === void 0 ? T = new Uint8Array(m) : C === void 0 ? T = new Uint8Array(m, p) : T = new Uint8Array(m, p, C), i.TYPED_ARRAY_SUPPORT ? T.__proto__ = i.prototype : T = b(_, T), T;
1415
+ }
1416
+ function F(_, m) {
1417
+ if (i.isBuffer(m)) {
1418
+ var p = s(m.length) | 0, C = a(_, p);
1419
+ return C.length === 0 || m.copy(C, 0, 0, p), C;
1420
+ }
1421
+ if (m) {
1422
+ if (typeof ArrayBuffer < "u" && m.buffer instanceof ArrayBuffer || "length" in m)
1423
+ return typeof m.length != "number" || f(m.length) ? a(_, 0) : b(_, m);
1424
+ if (m.type === "Buffer" && Array.isArray(m.data))
1425
+ return b(_, m.data);
1426
+ }
1427
+ throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.");
1428
+ }
1429
+ function M(_, m) {
1430
+ m = m || 1 / 0;
1431
+ for (var p, C = _.length, T = null, L = [], W = 0; W < C; ++W) {
1432
+ if (p = _.charCodeAt(W), p > 55295 && p < 57344) {
1433
+ if (!T) {
1434
+ if (p > 56319) {
1435
+ (m -= 3) > -1 && L.push(239, 191, 189);
1436
+ continue;
1437
+ } else if (W + 1 === C) {
1438
+ (m -= 3) > -1 && L.push(239, 191, 189);
1439
+ continue;
1440
+ }
1441
+ T = p;
1442
+ continue;
1443
+ }
1444
+ if (p < 56320) {
1445
+ (m -= 3) > -1 && L.push(239, 191, 189), T = p;
1446
+ continue;
1447
+ }
1448
+ p = (T - 55296 << 10 | p - 56320) + 65536;
1449
+ } else
1450
+ T && (m -= 3) > -1 && L.push(239, 191, 189);
1451
+ if (T = null, p < 128) {
1452
+ if ((m -= 1) < 0)
1453
+ break;
1454
+ L.push(p);
1455
+ } else if (p < 2048) {
1456
+ if ((m -= 2) < 0)
1457
+ break;
1458
+ L.push(
1459
+ p >> 6 | 192,
1460
+ p & 63 | 128
1461
+ );
1462
+ } else if (p < 65536) {
1463
+ if ((m -= 3) < 0)
1464
+ break;
1465
+ L.push(
1466
+ p >> 12 | 224,
1467
+ p >> 6 & 63 | 128,
1468
+ p & 63 | 128
1469
+ );
1470
+ } else if (p < 1114112) {
1471
+ if ((m -= 4) < 0)
1472
+ break;
1473
+ L.push(
1474
+ p >> 18 | 240,
1475
+ p >> 12 & 63 | 128,
1476
+ p >> 6 & 63 | 128,
1477
+ p & 63 | 128
1478
+ );
1479
+ } else
1480
+ throw new Error("Invalid code point");
1481
+ }
1482
+ return L;
1483
+ }
1484
+ function E(_) {
1485
+ if (i.isBuffer(_))
1486
+ return _.length;
1487
+ if (typeof ArrayBuffer < "u" && typeof ArrayBuffer.isView == "function" && (ArrayBuffer.isView(_) || _ instanceof ArrayBuffer))
1488
+ return _.byteLength;
1489
+ typeof _ != "string" && (_ = "" + _);
1490
+ var m = _.length;
1491
+ return m === 0 ? 0 : M(_).length;
1492
+ }
1493
+ function B(_, m, p, C) {
1494
+ for (var T = 0; T < C && !(T + p >= m.length || T >= _.length); ++T)
1495
+ m[T + p] = _[T];
1496
+ return T;
1497
+ }
1498
+ function I(_, m, p, C) {
1499
+ return B(M(m, _.length - p), _, p, C);
1500
+ }
1501
+ function k(_, m, p, C) {
1502
+ if (typeof m == "number")
1503
+ throw new TypeError('"value" argument must not be a number');
1504
+ return typeof ArrayBuffer < "u" && m instanceof ArrayBuffer ? A(_, m, p, C) : typeof m == "string" ? x(_, m) : F(_, m);
1505
+ }
1506
+ i.prototype.write = function(m, p, C) {
1507
+ p === void 0 ? (C = this.length, p = 0) : C === void 0 && typeof p == "string" ? (C = this.length, p = 0) : isFinite(p) && (p = p | 0, isFinite(C) ? C = C | 0 : C = void 0);
1508
+ var T = this.length - p;
1509
+ if ((C === void 0 || C > T) && (C = T), m.length > 0 && (C < 0 || p < 0) || p > this.length)
1510
+ throw new RangeError("Attempt to write outside buffer bounds");
1511
+ return I(this, m, p, C);
1512
+ }, i.prototype.slice = function(m, p) {
1513
+ var C = this.length;
1514
+ m = ~~m, p = p === void 0 ? C : ~~p, m < 0 ? (m += C, m < 0 && (m = 0)) : m > C && (m = C), p < 0 ? (p += C, p < 0 && (p = 0)) : p > C && (p = C), p < m && (p = m);
1515
+ var T;
1516
+ if (i.TYPED_ARRAY_SUPPORT)
1517
+ T = this.subarray(m, p), T.__proto__ = i.prototype;
1518
+ else {
1519
+ var L = p - m;
1520
+ T = new i(L, void 0);
1521
+ for (var W = 0; W < L; ++W)
1522
+ T[W] = this[W + m];
1523
+ }
1524
+ return T;
1525
+ }, i.prototype.copy = function(m, p, C, T) {
1526
+ if (C || (C = 0), !T && T !== 0 && (T = this.length), p >= m.length && (p = m.length), p || (p = 0), T > 0 && T < C && (T = C), T === C || m.length === 0 || this.length === 0)
1527
+ return 0;
1528
+ if (p < 0)
1529
+ throw new RangeError("targetStart out of bounds");
1530
+ if (C < 0 || C >= this.length)
1531
+ throw new RangeError("sourceStart out of bounds");
1532
+ if (T < 0)
1533
+ throw new RangeError("sourceEnd out of bounds");
1534
+ T > this.length && (T = this.length), m.length - p < T - C && (T = m.length - p + C);
1535
+ var L = T - C, W;
1536
+ if (this === m && C < p && p < T)
1537
+ for (W = L - 1; W >= 0; --W)
1538
+ m[W + p] = this[W + C];
1539
+ else if (L < 1e3 || !i.TYPED_ARRAY_SUPPORT)
1540
+ for (W = 0; W < L; ++W)
1541
+ m[W + p] = this[W + C];
1542
+ else
1543
+ Uint8Array.prototype.set.call(
1544
+ m,
1545
+ this.subarray(C, C + L),
1546
+ p
1547
+ );
1548
+ return L;
1549
+ }, i.prototype.fill = function(m, p, C) {
1550
+ if (typeof m == "string") {
1551
+ if (typeof p == "string" ? (p = 0, C = this.length) : typeof C == "string" && (C = this.length), m.length === 1) {
1552
+ var T = m.charCodeAt(0);
1553
+ T < 256 && (m = T);
1554
+ }
1555
+ } else
1556
+ typeof m == "number" && (m = m & 255);
1557
+ if (p < 0 || this.length < p || this.length < C)
1558
+ throw new RangeError("Out of range index");
1559
+ if (C <= p)
1560
+ return this;
1561
+ p = p >>> 0, C = C === void 0 ? this.length : C >>> 0, m || (m = 0);
1562
+ var L;
1563
+ if (typeof m == "number")
1564
+ for (L = p; L < C; ++L)
1565
+ this[L] = m;
1566
+ else {
1567
+ var W = i.isBuffer(m) ? m : new i(m), $ = W.length;
1568
+ for (L = 0; L < C - p; ++L)
1569
+ this[L + p] = W[L % $];
1570
+ }
1571
+ return this;
1572
+ }, i.concat = function(m, p) {
1573
+ if (!h(m))
1574
+ throw new TypeError('"list" argument must be an Array of Buffers');
1575
+ if (m.length === 0)
1576
+ return a(null, 0);
1577
+ var C;
1578
+ if (p === void 0)
1579
+ for (p = 0, C = 0; C < m.length; ++C)
1580
+ p += m[C].length;
1581
+ var T = y(null, p), L = 0;
1582
+ for (C = 0; C < m.length; ++C) {
1583
+ var W = m[C];
1584
+ if (!i.isBuffer(W))
1585
+ throw new TypeError('"list" argument must be an Array of Buffers');
1586
+ W.copy(T, L), L += W.length;
1587
+ }
1588
+ return T;
1589
+ }, i.byteLength = E, i.prototype._isBuffer = !0, i.isBuffer = function(m) {
1590
+ return !!(m != null && m._isBuffer);
1591
+ }, g.exports.alloc = function(_) {
1592
+ var m = new i(_);
1593
+ return m.fill(0), m;
1594
+ }, g.exports.from = function(_) {
1595
+ return new i(_);
1596
+ };
1597
+ }, { isarray: 33 }], 29: [function(n, g, u) {
1598
+ u.byteLength = y, u.toByteArray = b, u.fromByteArray = M;
1599
+ for (var h = [], d = [], l = typeof Uint8Array < "u" ? Uint8Array : Array, i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", s = 0, f = i.length; s < f; ++s)
1600
+ h[s] = i[s], d[i.charCodeAt(s)] = s;
1601
+ d[45] = 62, d[95] = 63;
1602
+ function a(E) {
1603
+ var B = E.length;
1604
+ if (B % 4 > 0)
1605
+ throw new Error("Invalid string. Length must be a multiple of 4");
1606
+ var I = E.indexOf("=");
1607
+ I === -1 && (I = B);
1608
+ var k = I === B ? 0 : 4 - I % 4;
1609
+ return [I, k];
1610
+ }
1611
+ function y(E) {
1612
+ var B = a(E), I = B[0], k = B[1];
1613
+ return (I + k) * 3 / 4 - k;
1614
+ }
1615
+ function x(E, B, I) {
1616
+ return (B + I) * 3 / 4 - I;
1617
+ }
1618
+ function b(E) {
1619
+ var B, I = a(E), k = I[0], _ = I[1], m = new l(x(E, k, _)), p = 0, C = _ > 0 ? k - 4 : k, T;
1620
+ for (T = 0; T < C; T += 4)
1621
+ B = d[E.charCodeAt(T)] << 18 | d[E.charCodeAt(T + 1)] << 12 | d[E.charCodeAt(T + 2)] << 6 | d[E.charCodeAt(T + 3)], m[p++] = B >> 16 & 255, m[p++] = B >> 8 & 255, m[p++] = B & 255;
1622
+ return _ === 2 && (B = d[E.charCodeAt(T)] << 2 | d[E.charCodeAt(T + 1)] >> 4, m[p++] = B & 255), _ === 1 && (B = d[E.charCodeAt(T)] << 10 | d[E.charCodeAt(T + 1)] << 4 | d[E.charCodeAt(T + 2)] >> 2, m[p++] = B >> 8 & 255, m[p++] = B & 255), m;
1623
+ }
1624
+ function A(E) {
1625
+ return h[E >> 18 & 63] + h[E >> 12 & 63] + h[E >> 6 & 63] + h[E & 63];
1626
+ }
1627
+ function F(E, B, I) {
1628
+ for (var k, _ = [], m = B; m < I; m += 3)
1629
+ k = (E[m] << 16 & 16711680) + (E[m + 1] << 8 & 65280) + (E[m + 2] & 255), _.push(A(k));
1630
+ return _.join("");
1631
+ }
1632
+ function M(E) {
1633
+ for (var B, I = E.length, k = I % 3, _ = [], m = 16383, p = 0, C = I - k; p < C; p += m)
1634
+ _.push(F(
1635
+ E,
1636
+ p,
1637
+ p + m > C ? C : p + m
1638
+ ));
1639
+ return k === 1 ? (B = E[I - 1], _.push(
1640
+ h[B >> 2] + h[B << 4 & 63] + "=="
1641
+ )) : k === 2 && (B = (E[I - 2] << 8) + E[I - 1], _.push(
1642
+ h[B >> 10] + h[B >> 4 & 63] + h[B << 2 & 63] + "="
1643
+ )), _.join("");
1644
+ }
1645
+ }, {}], 30: [function(n, g, u) {
1646
+ var h = n("base64-js"), d = n("ieee754"), l = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
1647
+ u.Buffer = a, u.SlowBuffer = k, u.INSPECT_MAX_BYTES = 50;
1648
+ var i = 2147483647;
1649
+ u.kMaxLength = i, a.TYPED_ARRAY_SUPPORT = s(), !a.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
1650
+ "This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."
1651
+ );
1652
+ function s() {
1653
+ try {
1654
+ var o = new Uint8Array(1), t = { foo: function() {
1655
+ return 42;
1656
+ } };
1657
+ return Object.setPrototypeOf(t, Uint8Array.prototype), Object.setPrototypeOf(o, t), o.foo() === 42;
1658
+ } catch {
1659
+ return !1;
1660
+ }
1661
+ }
1662
+ Object.defineProperty(a.prototype, "parent", {
1663
+ enumerable: !0,
1664
+ get: function() {
1665
+ if (a.isBuffer(this))
1666
+ return this.buffer;
1667
+ }
1668
+ }), Object.defineProperty(a.prototype, "offset", {
1669
+ enumerable: !0,
1670
+ get: function() {
1671
+ if (a.isBuffer(this))
1672
+ return this.byteOffset;
1673
+ }
1674
+ });
1675
+ function f(o) {
1676
+ if (o > i)
1677
+ throw new RangeError('The value "' + o + '" is invalid for option "size"');
1678
+ var t = new Uint8Array(o);
1679
+ return Object.setPrototypeOf(t, a.prototype), t;
1680
+ }
1681
+ function a(o, t, e) {
1682
+ if (typeof o == "number") {
1683
+ if (typeof t == "string")
1684
+ throw new TypeError(
1685
+ 'The "string" argument must be of type string. Received type number'
1686
+ );
1687
+ return A(o);
1688
+ }
1689
+ return y(o, t, e);
1690
+ }
1691
+ typeof Symbol < "u" && Symbol.species != null && a[Symbol.species] === a && Object.defineProperty(a, Symbol.species, {
1692
+ value: null,
1693
+ configurable: !0,
1694
+ enumerable: !1,
1695
+ writable: !1
1696
+ }), a.poolSize = 8192;
1697
+ function y(o, t, e) {
1698
+ if (typeof o == "string")
1699
+ return F(o, t);
1700
+ if (ArrayBuffer.isView(o))
1701
+ return M(o);
1702
+ if (o == null)
1703
+ throw new TypeError(
1704
+ "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof o
1705
+ );
1706
+ if (Q(o, ArrayBuffer) || o && Q(o.buffer, ArrayBuffer))
1707
+ return E(o, t, e);
1708
+ if (typeof o == "number")
1709
+ throw new TypeError(
1710
+ 'The "value" argument must not be of type number. Received type number'
1711
+ );
1712
+ var c = o.valueOf && o.valueOf();
1713
+ if (c != null && c !== o)
1714
+ return a.from(c, t, e);
1715
+ var w = B(o);
1716
+ if (w)
1717
+ return w;
1718
+ if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof o[Symbol.toPrimitive] == "function")
1719
+ return a.from(
1720
+ o[Symbol.toPrimitive]("string"),
1721
+ t,
1722
+ e
1723
+ );
1724
+ throw new TypeError(
1725
+ "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof o
1726
+ );
1727
+ }
1728
+ a.from = function(o, t, e) {
1729
+ return y(o, t, e);
1730
+ }, Object.setPrototypeOf(a.prototype, Uint8Array.prototype), Object.setPrototypeOf(a, Uint8Array);
1731
+ function x(o) {
1732
+ if (typeof o != "number")
1733
+ throw new TypeError('"size" argument must be of type number');
1734
+ if (o < 0)
1735
+ throw new RangeError('The value "' + o + '" is invalid for option "size"');
1736
+ }
1737
+ function b(o, t, e) {
1738
+ return x(o), o <= 0 ? f(o) : t !== void 0 ? typeof e == "string" ? f(o).fill(t, e) : f(o).fill(t) : f(o);
1739
+ }
1740
+ a.alloc = function(o, t, e) {
1741
+ return b(o, t, e);
1742
+ };
1743
+ function A(o) {
1744
+ return x(o), f(o < 0 ? 0 : I(o) | 0);
1745
+ }
1746
+ a.allocUnsafe = function(o) {
1747
+ return A(o);
1748
+ }, a.allocUnsafeSlow = function(o) {
1749
+ return A(o);
1750
+ };
1751
+ function F(o, t) {
1752
+ if ((typeof t != "string" || t === "") && (t = "utf8"), !a.isEncoding(t))
1753
+ throw new TypeError("Unknown encoding: " + t);
1754
+ var e = _(o, t) | 0, c = f(e), w = c.write(o, t);
1755
+ return w !== e && (c = c.slice(0, w)), c;
1756
+ }
1757
+ function M(o) {
1758
+ for (var t = o.length < 0 ? 0 : I(o.length) | 0, e = f(t), c = 0; c < t; c += 1)
1759
+ e[c] = o[c] & 255;
1760
+ return e;
1761
+ }
1762
+ function E(o, t, e) {
1763
+ if (t < 0 || o.byteLength < t)
1764
+ throw new RangeError('"offset" is outside of buffer bounds');
1765
+ if (o.byteLength < t + (e || 0))
1766
+ throw new RangeError('"length" is outside of buffer bounds');
1767
+ var c;
1768
+ return t === void 0 && e === void 0 ? c = new Uint8Array(o) : e === void 0 ? c = new Uint8Array(o, t) : c = new Uint8Array(o, t, e), Object.setPrototypeOf(c, a.prototype), c;
1769
+ }
1770
+ function B(o) {
1771
+ if (a.isBuffer(o)) {
1772
+ var t = I(o.length) | 0, e = f(t);
1773
+ return e.length === 0 || o.copy(e, 0, 0, t), e;
1774
+ }
1775
+ if (o.length !== void 0)
1776
+ return typeof o.length != "number" || wt(o.length) ? f(0) : M(o);
1777
+ if (o.type === "Buffer" && Array.isArray(o.data))
1778
+ return M(o.data);
1779
+ }
1780
+ function I(o) {
1781
+ if (o >= i)
1782
+ throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + i.toString(16) + " bytes");
1783
+ return o | 0;
1784
+ }
1785
+ function k(o) {
1786
+ return +o != o && (o = 0), a.alloc(+o);
1787
+ }
1788
+ a.isBuffer = function(t) {
1789
+ return t != null && t._isBuffer === !0 && t !== a.prototype;
1790
+ }, a.compare = function(t, e) {
1791
+ if (Q(t, Uint8Array) && (t = a.from(t, t.offset, t.byteLength)), Q(e, Uint8Array) && (e = a.from(e, e.offset, e.byteLength)), !a.isBuffer(t) || !a.isBuffer(e))
1792
+ throw new TypeError(
1793
+ 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
1794
+ );
1795
+ if (t === e)
1796
+ return 0;
1797
+ for (var c = t.length, w = e.length, P = 0, S = Math.min(c, w); P < S; ++P)
1798
+ if (t[P] !== e[P]) {
1799
+ c = t[P], w = e[P];
1800
+ break;
1801
+ }
1802
+ return c < w ? -1 : w < c ? 1 : 0;
1803
+ }, a.isEncoding = function(t) {
1804
+ switch (String(t).toLowerCase()) {
1805
+ case "hex":
1806
+ case "utf8":
1807
+ case "utf-8":
1808
+ case "ascii":
1809
+ case "latin1":
1810
+ case "binary":
1811
+ case "base64":
1812
+ case "ucs2":
1813
+ case "ucs-2":
1814
+ case "utf16le":
1815
+ case "utf-16le":
1816
+ return !0;
1817
+ default:
1818
+ return !1;
1819
+ }
1820
+ }, a.concat = function(t, e) {
1821
+ if (!Array.isArray(t))
1822
+ throw new TypeError('"list" argument must be an Array of Buffers');
1823
+ if (t.length === 0)
1824
+ return a.alloc(0);
1825
+ var c;
1826
+ if (e === void 0)
1827
+ for (e = 0, c = 0; c < t.length; ++c)
1828
+ e += t[c].length;
1829
+ var w = a.allocUnsafe(e), P = 0;
1830
+ for (c = 0; c < t.length; ++c) {
1831
+ var S = t[c];
1832
+ if (Q(S, Uint8Array) && (S = a.from(S)), !a.isBuffer(S))
1833
+ throw new TypeError('"list" argument must be an Array of Buffers');
1834
+ S.copy(w, P), P += S.length;
1835
+ }
1836
+ return w;
1837
+ };
1838
+ function _(o, t) {
1839
+ if (a.isBuffer(o))
1840
+ return o.length;
1841
+ if (ArrayBuffer.isView(o) || Q(o, ArrayBuffer))
1842
+ return o.byteLength;
1843
+ if (typeof o != "string")
1844
+ throw new TypeError(
1845
+ 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof o
1846
+ );
1847
+ var e = o.length, c = arguments.length > 2 && arguments[2] === !0;
1848
+ if (!c && e === 0)
1849
+ return 0;
1850
+ for (var w = !1; ; )
1851
+ switch (t) {
1852
+ case "ascii":
1853
+ case "latin1":
1854
+ case "binary":
1855
+ return e;
1856
+ case "utf8":
1857
+ case "utf-8":
1858
+ return rt(o).length;
1859
+ case "ucs2":
1860
+ case "ucs-2":
1861
+ case "utf16le":
1862
+ case "utf-16le":
1863
+ return e * 2;
1864
+ case "hex":
1865
+ return e >>> 1;
1866
+ case "base64":
1867
+ return ht(o).length;
1868
+ default:
1869
+ if (w)
1870
+ return c ? -1 : rt(o).length;
1871
+ t = ("" + t).toLowerCase(), w = !0;
1872
+ }
1873
+ }
1874
+ a.byteLength = _;
1875
+ function m(o, t, e) {
1876
+ var c = !1;
1877
+ if ((t === void 0 || t < 0) && (t = 0), t > this.length || ((e === void 0 || e > this.length) && (e = this.length), e <= 0) || (e >>>= 0, t >>>= 0, e <= t))
1878
+ return "";
1879
+ for (o || (o = "utf8"); ; )
1880
+ switch (o) {
1881
+ case "hex":
1882
+ return X(this, t, e);
1883
+ case "utf8":
1884
+ case "utf-8":
1885
+ return z(this, t, e);
1886
+ case "ascii":
1887
+ return j(this, t, e);
1888
+ case "latin1":
1889
+ case "binary":
1890
+ return et(this, t, e);
1891
+ case "base64":
1892
+ return O(this, t, e);
1893
+ case "ucs2":
1894
+ case "ucs-2":
1895
+ case "utf16le":
1896
+ case "utf-16le":
1897
+ return mt(this, t, e);
1898
+ default:
1899
+ if (c)
1900
+ throw new TypeError("Unknown encoding: " + o);
1901
+ o = (o + "").toLowerCase(), c = !0;
1902
+ }
1903
+ }
1904
+ a.prototype._isBuffer = !0;
1905
+ function p(o, t, e) {
1906
+ var c = o[t];
1907
+ o[t] = o[e], o[e] = c;
1908
+ }
1909
+ a.prototype.swap16 = function() {
1910
+ var t = this.length;
1911
+ if (t % 2 !== 0)
1912
+ throw new RangeError("Buffer size must be a multiple of 16-bits");
1913
+ for (var e = 0; e < t; e += 2)
1914
+ p(this, e, e + 1);
1915
+ return this;
1916
+ }, a.prototype.swap32 = function() {
1917
+ var t = this.length;
1918
+ if (t % 4 !== 0)
1919
+ throw new RangeError("Buffer size must be a multiple of 32-bits");
1920
+ for (var e = 0; e < t; e += 4)
1921
+ p(this, e, e + 3), p(this, e + 1, e + 2);
1922
+ return this;
1923
+ }, a.prototype.swap64 = function() {
1924
+ var t = this.length;
1925
+ if (t % 8 !== 0)
1926
+ throw new RangeError("Buffer size must be a multiple of 64-bits");
1927
+ for (var e = 0; e < t; e += 8)
1928
+ p(this, e, e + 7), p(this, e + 1, e + 6), p(this, e + 2, e + 5), p(this, e + 3, e + 4);
1929
+ return this;
1930
+ }, a.prototype.toString = function() {
1931
+ var t = this.length;
1932
+ return t === 0 ? "" : arguments.length === 0 ? z(this, 0, t) : m.apply(this, arguments);
1933
+ }, a.prototype.toLocaleString = a.prototype.toString, a.prototype.equals = function(t) {
1934
+ if (!a.isBuffer(t))
1935
+ throw new TypeError("Argument must be a Buffer");
1936
+ return this === t ? !0 : a.compare(this, t) === 0;
1937
+ }, a.prototype.inspect = function() {
1938
+ var t = "", e = u.INSPECT_MAX_BYTES;
1939
+ return t = this.toString("hex", 0, e).replace(/(.{2})/g, "$1 ").trim(), this.length > e && (t += " ... "), "<Buffer " + t + ">";
1940
+ }, l && (a.prototype[l] = a.prototype.inspect), a.prototype.compare = function(t, e, c, w, P) {
1941
+ if (Q(t, Uint8Array) && (t = a.from(t, t.offset, t.byteLength)), !a.isBuffer(t))
1942
+ throw new TypeError(
1943
+ 'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof t
1944
+ );
1945
+ if (e === void 0 && (e = 0), c === void 0 && (c = t ? t.length : 0), w === void 0 && (w = 0), P === void 0 && (P = this.length), e < 0 || c > t.length || w < 0 || P > this.length)
1946
+ throw new RangeError("out of range index");
1947
+ if (w >= P && e >= c)
1948
+ return 0;
1949
+ if (w >= P)
1950
+ return -1;
1951
+ if (e >= c)
1952
+ return 1;
1953
+ if (e >>>= 0, c >>>= 0, w >>>= 0, P >>>= 0, this === t)
1954
+ return 0;
1955
+ for (var S = P - w, H = c - e, G = Math.min(S, H), K = this.slice(w, P), Z = t.slice(e, c), V = 0; V < G; ++V)
1956
+ if (K[V] !== Z[V]) {
1957
+ S = K[V], H = Z[V];
1958
+ break;
1959
+ }
1960
+ return S < H ? -1 : H < S ? 1 : 0;
1961
+ };
1962
+ function C(o, t, e, c, w) {
1963
+ if (o.length === 0)
1964
+ return -1;
1965
+ if (typeof e == "string" ? (c = e, e = 0) : e > 2147483647 ? e = 2147483647 : e < -2147483648 && (e = -2147483648), e = +e, wt(e) && (e = w ? 0 : o.length - 1), e < 0 && (e = o.length + e), e >= o.length) {
1966
+ if (w)
1967
+ return -1;
1968
+ e = o.length - 1;
1969
+ } else if (e < 0)
1970
+ if (w)
1971
+ e = 0;
1972
+ else
1973
+ return -1;
1974
+ if (typeof t == "string" && (t = a.from(t, c)), a.isBuffer(t))
1975
+ return t.length === 0 ? -1 : T(o, t, e, c, w);
1976
+ if (typeof t == "number")
1977
+ return t = t & 255, typeof Uint8Array.prototype.indexOf == "function" ? w ? Uint8Array.prototype.indexOf.call(o, t, e) : Uint8Array.prototype.lastIndexOf.call(o, t, e) : T(o, [t], e, c, w);
1978
+ throw new TypeError("val must be string, number or Buffer");
1979
+ }
1980
+ function T(o, t, e, c, w) {
1981
+ var P = 1, S = o.length, H = t.length;
1982
+ if (c !== void 0 && (c = String(c).toLowerCase(), c === "ucs2" || c === "ucs-2" || c === "utf16le" || c === "utf-16le")) {
1983
+ if (o.length < 2 || t.length < 2)
1984
+ return -1;
1985
+ P = 2, S /= 2, H /= 2, e /= 2;
1986
+ }
1987
+ function G(Pt, St) {
1988
+ return P === 1 ? Pt[St] : Pt.readUInt16BE(St * P);
1989
+ }
1990
+ var K;
1991
+ if (w) {
1992
+ var Z = -1;
1993
+ for (K = e; K < S; K++)
1994
+ if (G(o, K) === G(t, Z === -1 ? 0 : K - Z)) {
1995
+ if (Z === -1 && (Z = K), K - Z + 1 === H)
1996
+ return Z * P;
1997
+ } else
1998
+ Z !== -1 && (K -= K - Z), Z = -1;
1999
+ } else
2000
+ for (e + H > S && (e = S - H), K = e; K >= 0; K--) {
2001
+ for (var V = !0, dt = 0; dt < H; dt++)
2002
+ if (G(o, K + dt) !== G(t, dt)) {
2003
+ V = !1;
2004
+ break;
2005
+ }
2006
+ if (V)
2007
+ return K;
2008
+ }
2009
+ return -1;
2010
+ }
2011
+ a.prototype.includes = function(t, e, c) {
2012
+ return this.indexOf(t, e, c) !== -1;
2013
+ }, a.prototype.indexOf = function(t, e, c) {
2014
+ return C(this, t, e, c, !0);
2015
+ }, a.prototype.lastIndexOf = function(t, e, c) {
2016
+ return C(this, t, e, c, !1);
2017
+ };
2018
+ function L(o, t, e, c) {
2019
+ e = Number(e) || 0;
2020
+ var w = o.length - e;
2021
+ c ? (c = Number(c), c > w && (c = w)) : c = w;
2022
+ var P = t.length;
2023
+ c > P / 2 && (c = P / 2);
2024
+ for (var S = 0; S < c; ++S) {
2025
+ var H = parseInt(t.substr(S * 2, 2), 16);
2026
+ if (wt(H))
2027
+ return S;
2028
+ o[e + S] = H;
2029
+ }
2030
+ return S;
2031
+ }
2032
+ function W(o, t, e, c) {
2033
+ return tt(rt(t, o.length - e), o, e, c);
2034
+ }
2035
+ function $(o, t, e, c) {
2036
+ return tt(ct(t), o, e, c);
2037
+ }
2038
+ function D(o, t, e, c) {
2039
+ return $(o, t, e, c);
2040
+ }
2041
+ function U(o, t, e, c) {
2042
+ return tt(ht(t), o, e, c);
2043
+ }
2044
+ function R(o, t, e, c) {
2045
+ return tt(lt(t, o.length - e), o, e, c);
2046
+ }
2047
+ a.prototype.write = function(t, e, c, w) {
2048
+ if (e === void 0)
2049
+ w = "utf8", c = this.length, e = 0;
2050
+ else if (c === void 0 && typeof e == "string")
2051
+ w = e, c = this.length, e = 0;
2052
+ else if (isFinite(e))
2053
+ e = e >>> 0, isFinite(c) ? (c = c >>> 0, w === void 0 && (w = "utf8")) : (w = c, c = void 0);
2054
+ else
2055
+ throw new Error(
2056
+ "Buffer.write(string, encoding, offset[, length]) is no longer supported"
2057
+ );
2058
+ var P = this.length - e;
2059
+ if ((c === void 0 || c > P) && (c = P), t.length > 0 && (c < 0 || e < 0) || e > this.length)
2060
+ throw new RangeError("Attempt to write outside buffer bounds");
2061
+ w || (w = "utf8");
2062
+ for (var S = !1; ; )
2063
+ switch (w) {
2064
+ case "hex":
2065
+ return L(this, t, e, c);
2066
+ case "utf8":
2067
+ case "utf-8":
2068
+ return W(this, t, e, c);
2069
+ case "ascii":
2070
+ return $(this, t, e, c);
2071
+ case "latin1":
2072
+ case "binary":
2073
+ return D(this, t, e, c);
2074
+ case "base64":
2075
+ return U(this, t, e, c);
2076
+ case "ucs2":
2077
+ case "ucs-2":
2078
+ case "utf16le":
2079
+ case "utf-16le":
2080
+ return R(this, t, e, c);
2081
+ default:
2082
+ if (S)
2083
+ throw new TypeError("Unknown encoding: " + w);
2084
+ w = ("" + w).toLowerCase(), S = !0;
2085
+ }
2086
+ }, a.prototype.toJSON = function() {
2087
+ return {
2088
+ type: "Buffer",
2089
+ data: Array.prototype.slice.call(this._arr || this, 0)
2090
+ };
2091
+ };
2092
+ function O(o, t, e) {
2093
+ return t === 0 && e === o.length ? h.fromByteArray(o) : h.fromByteArray(o.slice(t, e));
2094
+ }
2095
+ function z(o, t, e) {
2096
+ e = Math.min(o.length, e);
2097
+ for (var c = [], w = t; w < e; ) {
2098
+ var P = o[w], S = null, H = P > 239 ? 4 : P > 223 ? 3 : P > 191 ? 2 : 1;
2099
+ if (w + H <= e) {
2100
+ var G, K, Z, V;
2101
+ switch (H) {
2102
+ case 1:
2103
+ P < 128 && (S = P);
2104
+ break;
2105
+ case 2:
2106
+ G = o[w + 1], (G & 192) === 128 && (V = (P & 31) << 6 | G & 63, V > 127 && (S = V));
2107
+ break;
2108
+ case 3:
2109
+ G = o[w + 1], K = o[w + 2], (G & 192) === 128 && (K & 192) === 128 && (V = (P & 15) << 12 | (G & 63) << 6 | K & 63, V > 2047 && (V < 55296 || V > 57343) && (S = V));
2110
+ break;
2111
+ case 4:
2112
+ G = o[w + 1], K = o[w + 2], Z = o[w + 3], (G & 192) === 128 && (K & 192) === 128 && (Z & 192) === 128 && (V = (P & 15) << 18 | (G & 63) << 12 | (K & 63) << 6 | Z & 63, V > 65535 && V < 1114112 && (S = V));
2113
+ }
2114
+ }
2115
+ S === null ? (S = 65533, H = 1) : S > 65535 && (S -= 65536, c.push(S >>> 10 & 1023 | 55296), S = 56320 | S & 1023), c.push(S), w += H;
2116
+ }
2117
+ return Y(c);
2118
+ }
2119
+ var N = 4096;
2120
+ function Y(o) {
2121
+ var t = o.length;
2122
+ if (t <= N)
2123
+ return String.fromCharCode.apply(String, o);
2124
+ for (var e = "", c = 0; c < t; )
2125
+ e += String.fromCharCode.apply(
2126
+ String,
2127
+ o.slice(c, c += N)
2128
+ );
2129
+ return e;
2130
+ }
2131
+ function j(o, t, e) {
2132
+ var c = "";
2133
+ e = Math.min(o.length, e);
2134
+ for (var w = t; w < e; ++w)
2135
+ c += String.fromCharCode(o[w] & 127);
2136
+ return c;
2137
+ }
2138
+ function et(o, t, e) {
2139
+ var c = "";
2140
+ e = Math.min(o.length, e);
2141
+ for (var w = t; w < e; ++w)
2142
+ c += String.fromCharCode(o[w]);
2143
+ return c;
2144
+ }
2145
+ function X(o, t, e) {
2146
+ var c = o.length;
2147
+ (!t || t < 0) && (t = 0), (!e || e < 0 || e > c) && (e = c);
2148
+ for (var w = "", P = t; P < e; ++P)
2149
+ w += kt[o[P]];
2150
+ return w;
2151
+ }
2152
+ function mt(o, t, e) {
2153
+ for (var c = o.slice(t, e), w = "", P = 0; P < c.length; P += 2)
2154
+ w += String.fromCharCode(c[P] + c[P + 1] * 256);
2155
+ return w;
2156
+ }
2157
+ a.prototype.slice = function(t, e) {
2158
+ var c = this.length;
2159
+ t = ~~t, e = e === void 0 ? c : ~~e, t < 0 ? (t += c, t < 0 && (t = 0)) : t > c && (t = c), e < 0 ? (e += c, e < 0 && (e = 0)) : e > c && (e = c), e < t && (e = t);
2160
+ var w = this.subarray(t, e);
2161
+ return Object.setPrototypeOf(w, a.prototype), w;
2162
+ };
2163
+ function J(o, t, e) {
2164
+ if (o % 1 !== 0 || o < 0)
2165
+ throw new RangeError("offset is not uint");
2166
+ if (o + t > e)
2167
+ throw new RangeError("Trying to access beyond buffer length");
2168
+ }
2169
+ a.prototype.readUIntLE = function(t, e, c) {
2170
+ t = t >>> 0, e = e >>> 0, c || J(t, e, this.length);
2171
+ for (var w = this[t], P = 1, S = 0; ++S < e && (P *= 256); )
2172
+ w += this[t + S] * P;
2173
+ return w;
2174
+ }, a.prototype.readUIntBE = function(t, e, c) {
2175
+ t = t >>> 0, e = e >>> 0, c || J(t, e, this.length);
2176
+ for (var w = this[t + --e], P = 1; e > 0 && (P *= 256); )
2177
+ w += this[t + --e] * P;
2178
+ return w;
2179
+ }, a.prototype.readUInt8 = function(t, e) {
2180
+ return t = t >>> 0, e || J(t, 1, this.length), this[t];
2181
+ }, a.prototype.readUInt16LE = function(t, e) {
2182
+ return t = t >>> 0, e || J(t, 2, this.length), this[t] | this[t + 1] << 8;
2183
+ }, a.prototype.readUInt16BE = function(t, e) {
2184
+ return t = t >>> 0, e || J(t, 2, this.length), this[t] << 8 | this[t + 1];
2185
+ }, a.prototype.readUInt32LE = function(t, e) {
2186
+ return t = t >>> 0, e || J(t, 4, this.length), (this[t] | this[t + 1] << 8 | this[t + 2] << 16) + this[t + 3] * 16777216;
2187
+ }, a.prototype.readUInt32BE = function(t, e) {
2188
+ return t = t >>> 0, e || J(t, 4, this.length), this[t] * 16777216 + (this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3]);
2189
+ }, a.prototype.readIntLE = function(t, e, c) {
2190
+ t = t >>> 0, e = e >>> 0, c || J(t, e, this.length);
2191
+ for (var w = this[t], P = 1, S = 0; ++S < e && (P *= 256); )
2192
+ w += this[t + S] * P;
2193
+ return P *= 128, w >= P && (w -= Math.pow(2, 8 * e)), w;
2194
+ }, a.prototype.readIntBE = function(t, e, c) {
2195
+ t = t >>> 0, e = e >>> 0, c || J(t, e, this.length);
2196
+ for (var w = e, P = 1, S = this[t + --w]; w > 0 && (P *= 256); )
2197
+ S += this[t + --w] * P;
2198
+ return P *= 128, S >= P && (S -= Math.pow(2, 8 * e)), S;
2199
+ }, a.prototype.readInt8 = function(t, e) {
2200
+ return t = t >>> 0, e || J(t, 1, this.length), this[t] & 128 ? (255 - this[t] + 1) * -1 : this[t];
2201
+ }, a.prototype.readInt16LE = function(t, e) {
2202
+ t = t >>> 0, e || J(t, 2, this.length);
2203
+ var c = this[t] | this[t + 1] << 8;
2204
+ return c & 32768 ? c | 4294901760 : c;
2205
+ }, a.prototype.readInt16BE = function(t, e) {
2206
+ t = t >>> 0, e || J(t, 2, this.length);
2207
+ var c = this[t + 1] | this[t] << 8;
2208
+ return c & 32768 ? c | 4294901760 : c;
2209
+ }, a.prototype.readInt32LE = function(t, e) {
2210
+ return t = t >>> 0, e || J(t, 4, this.length), this[t] | this[t + 1] << 8 | this[t + 2] << 16 | this[t + 3] << 24;
2211
+ }, a.prototype.readInt32BE = function(t, e) {
2212
+ return t = t >>> 0, e || J(t, 4, this.length), this[t] << 24 | this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3];
2213
+ }, a.prototype.readFloatLE = function(t, e) {
2214
+ return t = t >>> 0, e || J(t, 4, this.length), d.read(this, t, !0, 23, 4);
2215
+ }, a.prototype.readFloatBE = function(t, e) {
2216
+ return t = t >>> 0, e || J(t, 4, this.length), d.read(this, t, !1, 23, 4);
2217
+ }, a.prototype.readDoubleLE = function(t, e) {
2218
+ return t = t >>> 0, e || J(t, 8, this.length), d.read(this, t, !0, 52, 8);
2219
+ }, a.prototype.readDoubleBE = function(t, e) {
2220
+ return t = t >>> 0, e || J(t, 8, this.length), d.read(this, t, !1, 52, 8);
2221
+ };
2222
+ function q(o, t, e, c, w, P) {
2223
+ if (!a.isBuffer(o))
2224
+ throw new TypeError('"buffer" argument must be a Buffer instance');
2225
+ if (t > w || t < P)
2226
+ throw new RangeError('"value" argument is out of bounds');
2227
+ if (e + c > o.length)
2228
+ throw new RangeError("Index out of range");
2229
+ }
2230
+ a.prototype.writeUIntLE = function(t, e, c, w) {
2231
+ if (t = +t, e = e >>> 0, c = c >>> 0, !w) {
2232
+ var P = Math.pow(2, 8 * c) - 1;
2233
+ q(this, t, e, c, P, 0);
2234
+ }
2235
+ var S = 1, H = 0;
2236
+ for (this[e] = t & 255; ++H < c && (S *= 256); )
2237
+ this[e + H] = t / S & 255;
2238
+ return e + c;
2239
+ }, a.prototype.writeUIntBE = function(t, e, c, w) {
2240
+ if (t = +t, e = e >>> 0, c = c >>> 0, !w) {
2241
+ var P = Math.pow(2, 8 * c) - 1;
2242
+ q(this, t, e, c, P, 0);
2243
+ }
2244
+ var S = c - 1, H = 1;
2245
+ for (this[e + S] = t & 255; --S >= 0 && (H *= 256); )
2246
+ this[e + S] = t / H & 255;
2247
+ return e + c;
2248
+ }, a.prototype.writeUInt8 = function(t, e, c) {
2249
+ return t = +t, e = e >>> 0, c || q(this, t, e, 1, 255, 0), this[e] = t & 255, e + 1;
2250
+ }, a.prototype.writeUInt16LE = function(t, e, c) {
2251
+ return t = +t, e = e >>> 0, c || q(this, t, e, 2, 65535, 0), this[e] = t & 255, this[e + 1] = t >>> 8, e + 2;
2252
+ }, a.prototype.writeUInt16BE = function(t, e, c) {
2253
+ return t = +t, e = e >>> 0, c || q(this, t, e, 2, 65535, 0), this[e] = t >>> 8, this[e + 1] = t & 255, e + 2;
2254
+ }, a.prototype.writeUInt32LE = function(t, e, c) {
2255
+ return t = +t, e = e >>> 0, c || q(this, t, e, 4, 4294967295, 0), this[e + 3] = t >>> 24, this[e + 2] = t >>> 16, this[e + 1] = t >>> 8, this[e] = t & 255, e + 4;
2256
+ }, a.prototype.writeUInt32BE = function(t, e, c) {
2257
+ return t = +t, e = e >>> 0, c || q(this, t, e, 4, 4294967295, 0), this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = t & 255, e + 4;
2258
+ }, a.prototype.writeIntLE = function(t, e, c, w) {
2259
+ if (t = +t, e = e >>> 0, !w) {
2260
+ var P = Math.pow(2, 8 * c - 1);
2261
+ q(this, t, e, c, P - 1, -P);
2262
+ }
2263
+ var S = 0, H = 1, G = 0;
2264
+ for (this[e] = t & 255; ++S < c && (H *= 256); )
2265
+ t < 0 && G === 0 && this[e + S - 1] !== 0 && (G = 1), this[e + S] = (t / H >> 0) - G & 255;
2266
+ return e + c;
2267
+ }, a.prototype.writeIntBE = function(t, e, c, w) {
2268
+ if (t = +t, e = e >>> 0, !w) {
2269
+ var P = Math.pow(2, 8 * c - 1);
2270
+ q(this, t, e, c, P - 1, -P);
2271
+ }
2272
+ var S = c - 1, H = 1, G = 0;
2273
+ for (this[e + S] = t & 255; --S >= 0 && (H *= 256); )
2274
+ t < 0 && G === 0 && this[e + S + 1] !== 0 && (G = 1), this[e + S] = (t / H >> 0) - G & 255;
2275
+ return e + c;
2276
+ }, a.prototype.writeInt8 = function(t, e, c) {
2277
+ return t = +t, e = e >>> 0, c || q(this, t, e, 1, 127, -128), t < 0 && (t = 255 + t + 1), this[e] = t & 255, e + 1;
2278
+ }, a.prototype.writeInt16LE = function(t, e, c) {
2279
+ return t = +t, e = e >>> 0, c || q(this, t, e, 2, 32767, -32768), this[e] = t & 255, this[e + 1] = t >>> 8, e + 2;
2280
+ }, a.prototype.writeInt16BE = function(t, e, c) {
2281
+ return t = +t, e = e >>> 0, c || q(this, t, e, 2, 32767, -32768), this[e] = t >>> 8, this[e + 1] = t & 255, e + 2;
2282
+ }, a.prototype.writeInt32LE = function(t, e, c) {
2283
+ return t = +t, e = e >>> 0, c || q(this, t, e, 4, 2147483647, -2147483648), this[e] = t & 255, this[e + 1] = t >>> 8, this[e + 2] = t >>> 16, this[e + 3] = t >>> 24, e + 4;
2284
+ }, a.prototype.writeInt32BE = function(t, e, c) {
2285
+ return t = +t, e = e >>> 0, c || q(this, t, e, 4, 2147483647, -2147483648), t < 0 && (t = 4294967295 + t + 1), this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = t & 255, e + 4;
2286
+ };
2287
+ function at(o, t, e, c, w, P) {
2288
+ if (e + c > o.length)
2289
+ throw new RangeError("Index out of range");
2290
+ if (e < 0)
2291
+ throw new RangeError("Index out of range");
2292
+ }
2293
+ function it(o, t, e, c, w) {
2294
+ return t = +t, e = e >>> 0, w || at(o, t, e, 4), d.write(o, t, e, c, 23, 4), e + 4;
2295
+ }
2296
+ a.prototype.writeFloatLE = function(t, e, c) {
2297
+ return it(this, t, e, !0, c);
2298
+ }, a.prototype.writeFloatBE = function(t, e, c) {
2299
+ return it(this, t, e, !1, c);
2300
+ };
2301
+ function st(o, t, e, c, w) {
2302
+ return t = +t, e = e >>> 0, w || at(o, t, e, 8), d.write(o, t, e, c, 52, 8), e + 8;
2303
+ }
2304
+ a.prototype.writeDoubleLE = function(t, e, c) {
2305
+ return st(this, t, e, !0, c);
2306
+ }, a.prototype.writeDoubleBE = function(t, e, c) {
2307
+ return st(this, t, e, !1, c);
2308
+ }, a.prototype.copy = function(t, e, c, w) {
2309
+ if (!a.isBuffer(t))
2310
+ throw new TypeError("argument should be a Buffer");
2311
+ if (c || (c = 0), !w && w !== 0 && (w = this.length), e >= t.length && (e = t.length), e || (e = 0), w > 0 && w < c && (w = c), w === c || t.length === 0 || this.length === 0)
2312
+ return 0;
2313
+ if (e < 0)
2314
+ throw new RangeError("targetStart out of bounds");
2315
+ if (c < 0 || c >= this.length)
2316
+ throw new RangeError("Index out of range");
2317
+ if (w < 0)
2318
+ throw new RangeError("sourceEnd out of bounds");
2319
+ w > this.length && (w = this.length), t.length - e < w - c && (w = t.length - e + c);
2320
+ var P = w - c;
2321
+ if (this === t && typeof Uint8Array.prototype.copyWithin == "function")
2322
+ this.copyWithin(e, c, w);
2323
+ else if (this === t && c < e && e < w)
2324
+ for (var S = P - 1; S >= 0; --S)
2325
+ t[S + e] = this[S + c];
2326
+ else
2327
+ Uint8Array.prototype.set.call(
2328
+ t,
2329
+ this.subarray(c, w),
2330
+ e
2331
+ );
2332
+ return P;
2333
+ }, a.prototype.fill = function(t, e, c, w) {
2334
+ if (typeof t == "string") {
2335
+ if (typeof e == "string" ? (w = e, e = 0, c = this.length) : typeof c == "string" && (w = c, c = this.length), w !== void 0 && typeof w != "string")
2336
+ throw new TypeError("encoding must be a string");
2337
+ if (typeof w == "string" && !a.isEncoding(w))
2338
+ throw new TypeError("Unknown encoding: " + w);
2339
+ if (t.length === 1) {
2340
+ var P = t.charCodeAt(0);
2341
+ (w === "utf8" && P < 128 || w === "latin1") && (t = P);
2342
+ }
2343
+ } else
2344
+ typeof t == "number" ? t = t & 255 : typeof t == "boolean" && (t = Number(t));
2345
+ if (e < 0 || this.length < e || this.length < c)
2346
+ throw new RangeError("Out of range index");
2347
+ if (c <= e)
2348
+ return this;
2349
+ e = e >>> 0, c = c === void 0 ? this.length : c >>> 0, t || (t = 0);
2350
+ var S;
2351
+ if (typeof t == "number")
2352
+ for (S = e; S < c; ++S)
2353
+ this[S] = t;
2354
+ else {
2355
+ var H = a.isBuffer(t) ? t : a.from(t, w), G = H.length;
2356
+ if (G === 0)
2357
+ throw new TypeError('The value "' + t + '" is invalid for argument "value"');
2358
+ for (S = 0; S < c - e; ++S)
2359
+ this[S + e] = H[S % G];
2360
+ }
2361
+ return this;
2362
+ };
2363
+ var ut = /[^+/0-9A-Za-z-_]/g;
2364
+ function vt(o) {
2365
+ if (o = o.split("=")[0], o = o.trim().replace(ut, ""), o.length < 2)
2366
+ return "";
2367
+ for (; o.length % 4 !== 0; )
2368
+ o = o + "=";
2369
+ return o;
2370
+ }
2371
+ function rt(o, t) {
2372
+ t = t || 1 / 0;
2373
+ for (var e, c = o.length, w = null, P = [], S = 0; S < c; ++S) {
2374
+ if (e = o.charCodeAt(S), e > 55295 && e < 57344) {
2375
+ if (!w) {
2376
+ if (e > 56319) {
2377
+ (t -= 3) > -1 && P.push(239, 191, 189);
2378
+ continue;
2379
+ } else if (S + 1 === c) {
2380
+ (t -= 3) > -1 && P.push(239, 191, 189);
2381
+ continue;
2382
+ }
2383
+ w = e;
2384
+ continue;
2385
+ }
2386
+ if (e < 56320) {
2387
+ (t -= 3) > -1 && P.push(239, 191, 189), w = e;
2388
+ continue;
2389
+ }
2390
+ e = (w - 55296 << 10 | e - 56320) + 65536;
2391
+ } else
2392
+ w && (t -= 3) > -1 && P.push(239, 191, 189);
2393
+ if (w = null, e < 128) {
2394
+ if ((t -= 1) < 0)
2395
+ break;
2396
+ P.push(e);
2397
+ } else if (e < 2048) {
2398
+ if ((t -= 2) < 0)
2399
+ break;
2400
+ P.push(
2401
+ e >> 6 | 192,
2402
+ e & 63 | 128
2403
+ );
2404
+ } else if (e < 65536) {
2405
+ if ((t -= 3) < 0)
2406
+ break;
2407
+ P.push(
2408
+ e >> 12 | 224,
2409
+ e >> 6 & 63 | 128,
2410
+ e & 63 | 128
2411
+ );
2412
+ } else if (e < 1114112) {
2413
+ if ((t -= 4) < 0)
2414
+ break;
2415
+ P.push(
2416
+ e >> 18 | 240,
2417
+ e >> 12 & 63 | 128,
2418
+ e >> 6 & 63 | 128,
2419
+ e & 63 | 128
2420
+ );
2421
+ } else
2422
+ throw new Error("Invalid code point");
2423
+ }
2424
+ return P;
2425
+ }
2426
+ function ct(o) {
2427
+ for (var t = [], e = 0; e < o.length; ++e)
2428
+ t.push(o.charCodeAt(e) & 255);
2429
+ return t;
2430
+ }
2431
+ function lt(o, t) {
2432
+ for (var e, c, w, P = [], S = 0; S < o.length && !((t -= 2) < 0); ++S)
2433
+ e = o.charCodeAt(S), c = e >> 8, w = e % 256, P.push(w), P.push(c);
2434
+ return P;
2435
+ }
2436
+ function ht(o) {
2437
+ return h.toByteArray(vt(o));
2438
+ }
2439
+ function tt(o, t, e, c) {
2440
+ for (var w = 0; w < c && !(w + e >= t.length || w >= o.length); ++w)
2441
+ t[w + e] = o[w];
2442
+ return w;
2443
+ }
2444
+ function Q(o, t) {
2445
+ return o instanceof t || o != null && o.constructor != null && o.constructor.name != null && o.constructor.name === t.name;
2446
+ }
2447
+ function wt(o) {
2448
+ return o !== o;
2449
+ }
2450
+ var kt = function() {
2451
+ for (var o = "0123456789abcdef", t = new Array(256), e = 0; e < 16; ++e)
2452
+ for (var c = e * 16, w = 0; w < 16; ++w)
2453
+ t[c + w] = o[e] + o[w];
2454
+ return t;
2455
+ }();
2456
+ }, { "base64-js": 29, ieee754: 32 }], 31: [function(n, g, u) {
2457
+ var h = {
2458
+ single_source_shortest_paths: function(d, l, i) {
2459
+ var s = {}, f = {};
2460
+ f[l] = 0;
2461
+ var a = h.PriorityQueue.make();
2462
+ a.push(l, 0);
2463
+ for (var y, x, b, A, F, M, E, B, I; !a.empty(); ) {
2464
+ y = a.pop(), x = y.value, A = y.cost, F = d[x] || {};
2465
+ for (b in F)
2466
+ F.hasOwnProperty(b) && (M = F[b], E = A + M, B = f[b], I = typeof f[b] > "u", (I || B > E) && (f[b] = E, a.push(b, E), s[b] = x));
2467
+ }
2468
+ if (typeof i < "u" && typeof f[i] > "u") {
2469
+ var k = ["Could not find a path from ", l, " to ", i, "."].join("");
2470
+ throw new Error(k);
2471
+ }
2472
+ return s;
2473
+ },
2474
+ extract_shortest_path_from_predecessor_list: function(d, l) {
2475
+ for (var i = [], s = l; s; )
2476
+ i.push(s), d[s], s = d[s];
2477
+ return i.reverse(), i;
2478
+ },
2479
+ find_path: function(d, l, i) {
2480
+ var s = h.single_source_shortest_paths(d, l, i);
2481
+ return h.extract_shortest_path_from_predecessor_list(
2482
+ s,
2483
+ i
2484
+ );
2485
+ },
2486
+ /**
2487
+ * A very naive priority queue implementation.
2488
+ */
2489
+ PriorityQueue: {
2490
+ make: function(d) {
2491
+ var l = h.PriorityQueue, i = {}, s;
2492
+ d = d || {};
2493
+ for (s in l)
2494
+ l.hasOwnProperty(s) && (i[s] = l[s]);
2495
+ return i.queue = [], i.sorter = d.sorter || l.default_sorter, i;
2496
+ },
2497
+ default_sorter: function(d, l) {
2498
+ return d.cost - l.cost;
2499
+ },
2500
+ /**
2501
+ * Add a new item to the queue and ensure the highest priority element
2502
+ * is at the front of the queue.
2503
+ */
2504
+ push: function(d, l) {
2505
+ var i = { value: d, cost: l };
2506
+ this.queue.push(i), this.queue.sort(this.sorter);
2507
+ },
2508
+ /**
2509
+ * Return the highest priority element in the queue.
2510
+ */
2511
+ pop: function() {
2512
+ return this.queue.shift();
2513
+ },
2514
+ empty: function() {
2515
+ return this.queue.length === 0;
2516
+ }
2517
+ }
2518
+ };
2519
+ typeof g < "u" && (g.exports = h);
2520
+ }, {}], 32: [function(n, g, u) {
2521
+ u.read = function(h, d, l, i, s) {
2522
+ var f, a, y = s * 8 - i - 1, x = (1 << y) - 1, b = x >> 1, A = -7, F = l ? s - 1 : 0, M = l ? -1 : 1, E = h[d + F];
2523
+ for (F += M, f = E & (1 << -A) - 1, E >>= -A, A += y; A > 0; f = f * 256 + h[d + F], F += M, A -= 8)
2524
+ ;
2525
+ for (a = f & (1 << -A) - 1, f >>= -A, A += i; A > 0; a = a * 256 + h[d + F], F += M, A -= 8)
2526
+ ;
2527
+ if (f === 0)
2528
+ f = 1 - b;
2529
+ else {
2530
+ if (f === x)
2531
+ return a ? NaN : (E ? -1 : 1) * (1 / 0);
2532
+ a = a + Math.pow(2, i), f = f - b;
2533
+ }
2534
+ return (E ? -1 : 1) * a * Math.pow(2, f - i);
2535
+ }, u.write = function(h, d, l, i, s, f) {
2536
+ var a, y, x, b = f * 8 - s - 1, A = (1 << b) - 1, F = A >> 1, M = s === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, E = i ? 0 : f - 1, B = i ? 1 : -1, I = d < 0 || d === 0 && 1 / d < 0 ? 1 : 0;
2537
+ for (d = Math.abs(d), isNaN(d) || d === 1 / 0 ? (y = isNaN(d) ? 1 : 0, a = A) : (a = Math.floor(Math.log(d) / Math.LN2), d * (x = Math.pow(2, -a)) < 1 && (a--, x *= 2), a + F >= 1 ? d += M / x : d += M * Math.pow(2, 1 - F), d * x >= 2 && (a++, x /= 2), a + F >= A ? (y = 0, a = A) : a + F >= 1 ? (y = (d * x - 1) * Math.pow(2, s), a = a + F) : (y = d * Math.pow(2, F - 1) * Math.pow(2, s), a = 0)); s >= 8; h[l + E] = y & 255, E += B, y /= 256, s -= 8)
2538
+ ;
2539
+ for (a = a << s | y, b += s; b > 0; h[l + E] = a & 255, E += B, a /= 256, b -= 8)
2540
+ ;
2541
+ h[l + E - B] |= I * 128;
2542
+ };
2543
+ }, {}], 33: [function(n, g, u) {
2544
+ var h = {}.toString;
2545
+ g.exports = Array.isArray || function(d) {
2546
+ return h.call(d) == "[object Array]";
2547
+ };
2548
+ }, {}] }, {}, [24])(24);
2549
+ });
2550
+ }), Ot = {
2551
+ name: "qrcode",
2552
+ props: {
2553
+ /**
2554
+ * The value of the QR code.
2555
+ */
2556
+ value: null,
2557
+ /**
2558
+ * The options for the QR code generator.
2559
+ * {@link https://github.com/soldair/node-qrcode#qr-code-options}
2560
+ */
2561
+ options: Object,
2562
+ /**
2563
+ * The tag name of the component's root element.
2564
+ */
2565
+ tag: {
2566
+ type: String,
2567
+ default: "canvas"
2568
+ }
2569
+ },
2570
+ render: function(r) {
2571
+ return r(this.tag, this.$slots.default);
2572
+ },
2573
+ watch: {
2574
+ $props: {
2575
+ deep: !0,
2576
+ immediate: !0,
2577
+ /**
2578
+ * Update the QR code when props changed.
2579
+ */
2580
+ handler: function() {
2581
+ this.$el && this.generate();
2582
+ }
2583
+ }
2584
+ },
2585
+ methods: {
2586
+ /**
2587
+ * Generate QR code.
2588
+ */
2589
+ generate: function() {
2590
+ var r = this, n = this.options, g = this.tag, u = String(this.value);
2591
+ g === "canvas" ? xt.toCanvas(this.$el, u, n, function(h) {
2592
+ if (h)
2593
+ throw h;
2594
+ }) : g === "img" ? xt.toDataURL(u, n, function(h, d) {
2595
+ if (h)
2596
+ throw h;
2597
+ r.$el.src = d;
2598
+ }) : xt.toString(u, n, function(h, d) {
2599
+ if (h)
2600
+ throw h;
2601
+ r.$el.innerHTML = d;
2602
+ });
2603
+ }
2604
+ },
2605
+ mounted: function() {
2606
+ this.generate();
2607
+ }
2608
+ };
2609
+ class zt {
2610
+ constructor() {
2611
+ this._activePolls = {}, this._pollingInterval = 1e3;
2612
+ }
2613
+ _startPolling(r) {
2614
+ const { handler: n, interval: g } = this._activePolls[r], u = async () => {
2615
+ var h;
2616
+ await n(), (h = this._activePolls[r]) != null && h.pollActive && setTimeout(u, g || this._pollingInterval);
2617
+ };
2618
+ u();
2619
+ }
2620
+ /**
2621
+ * Add a new poll to the active polls list.
2622
+ * @param {string} options.id - Unique identifier for the poll.
2623
+ * @param {function} options.handler - Function to be executed when the poll is activated.
2624
+ * @param {number} options.interval - Time interval in milliseconds at which the poll should run.
2625
+ * @param {number} [options.removeAfterMs=0] - Optional. Time in milliseconds after which the poll should be automatically removed.
2626
+ * @param {boolean} [options.startImmediately=true] - Optional. If true, the poll will start immediately after being added.
2627
+ * @param {*} [options.data] - Optional. Additional data associated with the poll.
2628
+ * @returns {function} - A function that can be used to manually remove the poll from the active polls list.
2629
+ */
2630
+ addPoll({
2631
+ id: r,
2632
+ handler: n,
2633
+ interval: g,
2634
+ removeAfterMs: u = 0,
2635
+ startImmediately: h = !0,
2636
+ data: d
2637
+ }) {
2638
+ if (!r || typeof n != "function")
2639
+ throw new Error("Invalid poll definition");
2640
+ if (this._activePolls[r])
2641
+ throw new Error("Poll with the same ID already exists");
2642
+ return this._activePolls[r] = { handler: n, interval: g, pollActive: !1, data: d }, h && setTimeout(() => {
2643
+ this.activatePoll(r);
2644
+ }, 0), u && setTimeout(() => {
2645
+ this._activePolls[r] && this.removePoll(r);
2646
+ }, u), () => this.removePoll(r);
2647
+ }
2648
+ activatePoll(r) {
2649
+ if (!this._activePolls[r])
2650
+ throw new Error("Poll not found");
2651
+ this._activePolls[r].pollActive || (this._activePolls[r].pollActive = !0, this._startPolling(r));
2652
+ }
2653
+ deactivatePoll(r) {
2654
+ if (!this._activePolls[r]) {
2655
+ console.warn("[deactivatePoll] Poll not found");
2656
+ return;
2657
+ }
2658
+ this._activePolls[r].pollActive = !1;
2659
+ }
2660
+ removePoll(r) {
2661
+ if (!this._activePolls[r]) {
2662
+ console.warn("[removePoll] Poll not found");
2663
+ return;
2664
+ }
2665
+ delete this._activePolls[r];
2666
+ }
2667
+ }
2668
+ let _t = null;
2669
+ function Ft() {
2670
+ return _t || (_t = new zt()), _t;
2671
+ }
2672
+ function Yt(v) {
2673
+ window.history.replaceState({}, "", window.location.href);
2674
+ let r = "";
2675
+ const n = (navigator == null ? void 0 : navigator.userAgent) || "";
2676
+ return n.match("CriOS") ? r = "googlechromes://" : n.match("FxiOS") ? r = "firefox://" : n.match("GSA") && (r = "googleapp://open-url?url="), r + encodeURIComponent(`${window.location.href}#${v}`);
2677
+ }
2678
+ const Wt = {
2679
+ name: "BankIdAnswer",
2680
+ components: {
2681
+ QrCode: Ot
2682
+ },
2683
+ mixins: [ft([])],
2684
+ props: {
2685
+ onCompleteFunc: {
2686
+ type: Function,
2687
+ default: null
2688
+ }
2689
+ },
2690
+ data() {
2691
+ return {
2692
+ signAnswerId: null,
2693
+ view: "form",
2694
+ errorMessage: "",
2695
+ isLoading: !1,
2696
+ qrCode: null,
2697
+ autoStartToken: null,
2698
+ isMobile: !1
2699
+ };
2700
+ },
2701
+ computed: {
2702
+ viewText() {
2703
+ const v = (r) => this._document.$t(`answerModal.bankId.component.viewText.${r}`);
2704
+ return {
2705
+ new: {
2706
+ title: v("new.title"),
2707
+ text: v("new.text"),
2708
+ spinnerText: v("new.spinnerText")
2709
+ },
2710
+ waiting: {
2711
+ title: v("waiting.title"),
2712
+ text: v("waiting.text"),
2713
+ spinnerText: v("waiting.spinnerText")
2714
+ },
2715
+ started: {
2716
+ title: v("waiting.title"),
2717
+ text: v("waiting.text"),
2718
+ spinnerText: v("waiting.spinnerText")
2719
+ },
2720
+ signing: {
2721
+ title: v("signing.title"),
2722
+ text: v("signing.text"),
2723
+ spinnerText: v("signing.spinnerText")
2724
+ },
2725
+ error: {
2726
+ title: v("error.title"),
2727
+ text: v("error.text")
2728
+ },
2729
+ canceled: {
2730
+ title: v("canceled.title"),
2731
+ text: v("canceled.text")
2732
+ }
2733
+ };
2734
+ }
2735
+ },
2736
+ watch: {
2737
+ isLoading(v) {
2738
+ this.$emit("loading", v);
2739
+ }
2740
+ },
2741
+ created() {
2742
+ this.isMobile = It(), this.tryResumeSigningSession();
2743
+ },
2744
+ methods: {
2745
+ tryResumeSigningSession() {
2746
+ var n, g;
2747
+ const v = Ft(), r = Object.keys(v._activePolls).find(
2748
+ (u) => u.includes("bankId-")
2749
+ );
2750
+ try {
2751
+ if (r) {
2752
+ const { signAnswerId: u, autoStartToken: h, qrCode: d } = ((n = v._activePolls[r]) == null ? void 0 : n.data) || {};
2753
+ this.signAnswerId = u, this.autoStartToken = h, this.qrCode = d, v.removePoll(r), (g = window.location) != null && g.hash && window.history.replaceState(
2754
+ {},
2755
+ "",
2756
+ window.location.pathname
2757
+ // clears search + hash
2758
+ ), this.isLoading = !0, this.startPolling();
2759
+ }
2760
+ } catch {
2761
+ const h = this._document.$t(
2762
+ "answerModal.bankId.component.viewText.error.text"
2763
+ );
2764
+ Tt("error", h);
2765
+ }
2766
+ },
2767
+ async submit({ answer: v }) {
2768
+ try {
2769
+ this.isLoading = !0;
2770
+ const { id: r, autoStartToken: n, qrCodeData: g } = await v({
2771
+ body: { isAccepted: !0 }
2772
+ });
2773
+ n && (this.autoStartToken = n), g && (this.qrCode = g), this.signAnswerId = r, this.startPolling(), this.isMobile && this.triggerAutoStart();
2774
+ return;
2775
+ } catch (r) {
2776
+ this.onError(r);
2777
+ }
2778
+ },
2779
+ async startPolling() {
2780
+ if (!this.signAnswerId)
2781
+ throw Error("Missing signAnswerId");
2782
+ const v = Ft(), r = `bankId-${this.signAnswerId}`, n = async () => {
2783
+ if (!this.signAnswerId)
2784
+ throw Error("Missing signAnswerId");
2785
+ const g = () => {
2786
+ this.clearSignState(), v.removePoll(r);
2787
+ };
2788
+ try {
2789
+ const { data: u } = await Rt.get(this.signAnswerId);
2790
+ u.qrCodeData && (this.qrCode = u.qrCodeData), ["completed", "canceled"].includes(u.status) && g(), u.status === "completed" ? this.onComplete() : u.status === "canceled" ? this.onCanceled() : this.view = u.status;
2791
+ } catch (u) {
2792
+ this.onError(u), g();
2793
+ }
2794
+ };
2795
+ try {
2796
+ v.addPoll({
2797
+ id: r,
2798
+ handler: n,
2799
+ interval: 1e3,
2800
+ data: {
2801
+ signAnswerId: this.signAnswerId,
2802
+ autoStartToken: this.autoStartToken,
2803
+ qrCode: this.qrCode
2804
+ }
2805
+ });
2806
+ } catch {
2807
+ this.clearSignState();
2808
+ const u = this._document.$t(
2809
+ "answerModal.bankId.component.viewText.error.text"
2810
+ );
2811
+ Tt("error", u);
2812
+ }
2813
+ },
2814
+ clearSignState() {
2815
+ this.autoStartToken = null, this.qrCode = null, this.isLoading = !1;
2816
+ },
2817
+ onComplete() {
2818
+ typeof this.onCompleteFunc == "function" && this.onCompleteFunc();
2819
+ },
2820
+ onCanceled() {
2821
+ this.view = "canceled", this.errorMessage = this._document.$t(
2822
+ "answerModal.bankId.component.signingInterrupted"
2823
+ );
2824
+ },
2825
+ onError(v) {
2826
+ var n, g;
2827
+ if (v.httpStatusCode === 409)
2828
+ throw v;
2829
+ this.$emit("error"), this.view = "error";
2830
+ const r = (g = (n = v.response) == null ? void 0 : n.data) == null ? void 0 : g.errorCode;
2831
+ switch (r) {
2832
+ case 9001:
2833
+ case 9002:
2834
+ case 9003:
2835
+ case 9004:
2836
+ case 9005:
2837
+ case 9006:
2838
+ case 9007:
2839
+ Mt.warn(v);
2840
+ break;
2841
+ case 9009:
2842
+ this.$emit("complete");
2843
+ break;
2844
+ default:
2845
+ Et(v, { showMessage: !1 });
2846
+ }
2847
+ this.errorMessage = this.$i18n.te(`errors:${r}`) && this._document.$t(`answerModal.bankId.component.errors.${r}`) || this._document.$t("answerModal.bankId.component.defaultError");
2848
+ },
2849
+ triggerAutoStart() {
2850
+ if (!this.autoStartToken)
2851
+ return;
2852
+ let v = "bankid://", r = "null";
2853
+ if (this.isMobile) {
2854
+ const g = $t(), u = (navigator == null ? void 0 : navigator.userAgent) || (navigator == null ? void 0 : navigator.vendor) || (window == null ? void 0 : window.opera), h = g === "iOS" && (/Version\/[\d.]+.*Safari/.test(u) || /GSA/.test(u)), d = g === "Android" && /Version\/[\d.]+.*Chrome/.test(u);
2855
+ (h || d) && (v = "https://app.bankid.com"), g === "iOS" && this.$view !== "widget" && (r = Yt(this.signAnswerId));
2856
+ }
2857
+ const n = `${v}/?autostarttoken=${this.autoStartToken}&redirect=${r}`;
2858
+ this.isMobile ? document.location = n : this.$refs.autoStartFrame.src = n;
2859
+ }
2860
+ }
2861
+ };
2862
+ var Ht = function() {
2863
+ var g;
2864
+ var r = this, n = r._self._c;
2865
+ return n("div", { staticClass: "-my-4 flex flex-col items-center" }, [n("iframe", { ref: "autoStartFrame", staticClass: "hidden", attrs: { height: "0", width: "0" } }), ["form", "signing", "error", "canceled"].includes(r.view) ? n("div", { staticClass: "flex h-[250px] w-[250px] items-center justify-center rounded-xl bg-gray-100" }, [n("CIcon", { staticClass: "text-gray-500", attrs: { type: "bankId", size: "50" } })], 1) : r._e(), ["new", "waiting", "started"].includes(r.view) ? [r.qrCode ? n("QrCode", { attrs: { value: r.qrCode, options: {
2866
+ width: 250,
2867
+ errorCorrectionLevel: "L",
2868
+ color: { dark: "#000000" }
2869
+ } } }) : r._e()] : r._e(), n("Animation", { staticClass: "w-full" }, [n("div", { key: "a", staticClass: "min-h-[20px] pt-4 text-sm text-gray-500", domProps: { textContent: r._s((g = r.viewText[r.view]) == null ? void 0 : g.spinnerText) } }), !r.isMobile && ["new", "waiting", "started"].includes(r.view) ? n("CButton", { key: "b", staticClass: "mt-4", attrs: { type: "none", pattern: "secondary", size: "small" }, on: { click: r.triggerAutoStart } }, [r._v(" " + r._s(r._document.$t("answerModal.bankId.component.startOnThisDevice")) + " ")]) : r._e()], 1), ["form", "new", "waiting", "started"].includes(r.view) ? r._e() : n("div", [n("transition", { attrs: { name: "pop-in" } }, [n("div", { staticClass: "bankid-popup", on: { click: () => {
2870
+ r.view = "form", r.isLoading = !1;
2871
+ } } }, [n("div", { staticClass: "flex flex-col items-center justify-center", staticStyle: { "background-color": "#183e4f", padding: "calc(2.5 * var(--rem)) calc(3 * var(--rem))" } }, [n("CIcon", { staticClass: "text-white", attrs: { type: "bankId", size: "34" } }), n("div", { staticClass: "pt-4 text-sm font-medium text-white opacity-75", domProps: { textContent: r._s(r.viewText[r.view].text) } })], 1), n("div", { staticClass: "flex w-full flex-col items-center justify-center text-center", staticStyle: { padding: "calc(3 * var(--rem)) calc(2 * var(--rem))" } }, [r.view === "signing" ? [n("div", { staticClass: "spinner" }), n("div", { staticClass: "pt-8 text-gray-500", domProps: { textContent: r._s(r.viewText[r.view].spinnerText) } })] : ["error", "canceled"].includes(r.view) ? [n("CIcon", { staticClass: "mb-2.5 text-gray-400", attrs: { type: "error", size: "22" } }), n("div", { staticStyle: { "font-size": "14px" }, domProps: { textContent: r._s(r.errorMessage) } }), n("CButton", { staticStyle: { "margin-top": "calc(2.5 * var(--rem))", padding: "1em", height: "initial" }, attrs: { loading: r.isLoading, type: "none", pattern: "secondary", size: "small" }, on: { click: function(u) {
2872
+ r.view = "form";
2873
+ } } }, [r._v(" " + r._s(r._document.$t("tryAgain")) + " ")])] : r._e()], 2)])])], 1)], 2);
2874
+ }, jt = [], Gt = /* @__PURE__ */ ot(
2875
+ Wt,
2876
+ Ht,
2877
+ jt,
2878
+ !1,
2879
+ null,
2880
+ "091e7765"
2881
+ );
2882
+ const Kt = Gt.exports, Vt = {
2883
+ name: "DenyAnswer",
2884
+ mixins: [ft([])],
2885
+ props: {
2886
+ onCompleteFunc: {
2887
+ type: Function,
2888
+ default: null
2889
+ }
2890
+ },
2891
+ data() {
2892
+ return {
2893
+ rejectReason: ""
2894
+ };
2895
+ },
2896
+ methods: {
2897
+ async submit({ update: v, answer: r }) {
2898
+ const n = [];
2899
+ this.rejectReason && n.push({
2900
+ key: "unclear-other",
2901
+ category: "misc",
2902
+ description: this.rejectReason,
2903
+ sentAt: this._document.lastSentAt
2904
+ }), await v({ body: { "data.rejectReasons": n } }), await r({ body: { isAccepted: !1 } }), typeof this.onCompleteFunc == "function" && this.onCompleteFunc();
2905
+ }
2906
+ }
2907
+ };
2908
+ var Jt = function() {
2909
+ var r = this, n = r._self._c;
2910
+ return n("div", { staticClass: "text-left" }, [n("label", [r._v(r._s(r._document.$t("answerModal.decline.component.label")))]), n("CInput", { staticStyle: { "margin-bottom": "calc(1.5 * var(--rem))" }, attrs: { type: "textarea", filled: "", "custom-class": "decline-input" }, model: { value: r.rejectReason, callback: function(g) {
2911
+ r.rejectReason = g;
2912
+ }, expression: "rejectReason" } })], 1);
2913
+ }, Xt = [], Qt = /* @__PURE__ */ ot(
2914
+ Vt,
2915
+ Jt,
2916
+ Xt,
2917
+ !1,
2918
+ null,
2919
+ null
2920
+ );
2921
+ const qt = Qt.exports;
2922
+ /*!
2923
+ * Signature Pad v4.0.10 | https://github.com/szimek/signature_pad
2924
+ * (c) 2022 Szymon Nowak | Released under the MIT license
2925
+ */
2926
+ class pt {
2927
+ constructor(r, n, g, u) {
2928
+ if (isNaN(r) || isNaN(n))
2929
+ throw new Error(`Point is invalid: (${r}, ${n})`);
2930
+ this.x = +r, this.y = +n, this.pressure = g || 0, this.time = u || Date.now();
2931
+ }
2932
+ distanceTo(r) {
2933
+ return Math.sqrt(Math.pow(this.x - r.x, 2) + Math.pow(this.y - r.y, 2));
2934
+ }
2935
+ equals(r) {
2936
+ return this.x === r.x && this.y === r.y && this.pressure === r.pressure && this.time === r.time;
2937
+ }
2938
+ velocityFrom(r) {
2939
+ return this.time !== r.time ? this.distanceTo(r) / (this.time - r.time) : 0;
2940
+ }
2941
+ }
2942
+ class bt {
2943
+ constructor(r, n, g, u, h, d) {
2944
+ this.startPoint = r, this.control2 = n, this.control1 = g, this.endPoint = u, this.startWidth = h, this.endWidth = d;
2945
+ }
2946
+ static fromPoints(r, n) {
2947
+ const g = this.calculateControlPoints(r[0], r[1], r[2]).c2, u = this.calculateControlPoints(r[1], r[2], r[3]).c1;
2948
+ return new bt(r[1], g, u, r[2], n.start, n.end);
2949
+ }
2950
+ static calculateControlPoints(r, n, g) {
2951
+ const u = r.x - n.x, h = r.y - n.y, d = n.x - g.x, l = n.y - g.y, i = { x: (r.x + n.x) / 2, y: (r.y + n.y) / 2 }, s = { x: (n.x + g.x) / 2, y: (n.y + g.y) / 2 }, f = Math.sqrt(u * u + h * h), a = Math.sqrt(d * d + l * l), y = i.x - s.x, x = i.y - s.y, b = a / (f + a), A = { x: s.x + y * b, y: s.y + x * b }, F = n.x - A.x, M = n.y - A.y;
2952
+ return {
2953
+ c1: new pt(i.x + F, i.y + M),
2954
+ c2: new pt(s.x + F, s.y + M)
2955
+ };
2956
+ }
2957
+ length() {
2958
+ let n = 0, g, u;
2959
+ for (let h = 0; h <= 10; h += 1) {
2960
+ const d = h / 10, l = this.point(d, this.startPoint.x, this.control1.x, this.control2.x, this.endPoint.x), i = this.point(d, this.startPoint.y, this.control1.y, this.control2.y, this.endPoint.y);
2961
+ if (h > 0) {
2962
+ const s = l - g, f = i - u;
2963
+ n += Math.sqrt(s * s + f * f);
2964
+ }
2965
+ g = l, u = i;
2966
+ }
2967
+ return n;
2968
+ }
2969
+ point(r, n, g, u, h) {
2970
+ return n * (1 - r) * (1 - r) * (1 - r) + 3 * g * (1 - r) * (1 - r) * r + 3 * u * (1 - r) * r * r + h * r * r * r;
2971
+ }
2972
+ }
2973
+ class Zt {
2974
+ constructor() {
2975
+ try {
2976
+ this._et = new EventTarget();
2977
+ } catch {
2978
+ this._et = document;
2979
+ }
2980
+ }
2981
+ addEventListener(r, n, g) {
2982
+ this._et.addEventListener(r, n, g);
2983
+ }
2984
+ dispatchEvent(r) {
2985
+ return this._et.dispatchEvent(r);
2986
+ }
2987
+ removeEventListener(r, n, g) {
2988
+ this._et.removeEventListener(r, n, g);
2989
+ }
2990
+ }
2991
+ function te(v, r = 250) {
2992
+ let n = 0, g = null, u, h, d;
2993
+ const l = () => {
2994
+ n = Date.now(), g = null, u = v.apply(h, d), g || (h = null, d = []);
2995
+ };
2996
+ return function(...s) {
2997
+ const f = Date.now(), a = r - (f - n);
2998
+ return h = this, d = s, a <= 0 || a > r ? (g && (clearTimeout(g), g = null), n = f, u = v.apply(h, d), g || (h = null, d = [])) : g || (g = window.setTimeout(l, a)), u;
2999
+ };
3000
+ }
3001
+ let ee = class Ct extends Zt {
3002
+ constructor(r, n = {}) {
3003
+ super(), this.canvas = r, this._handleMouseDown = (g) => {
3004
+ g.buttons === 1 && (this._drawningStroke = !0, this._strokeBegin(g));
3005
+ }, this._handleMouseMove = (g) => {
3006
+ this._drawningStroke && this._strokeMoveUpdate(g);
3007
+ }, this._handleMouseUp = (g) => {
3008
+ g.buttons === 1 && this._drawningStroke && (this._drawningStroke = !1, this._strokeEnd(g));
3009
+ }, this._handleTouchStart = (g) => {
3010
+ if (g.cancelable && g.preventDefault(), g.targetTouches.length === 1) {
3011
+ const u = g.changedTouches[0];
3012
+ this._strokeBegin(u);
3013
+ }
3014
+ }, this._handleTouchMove = (g) => {
3015
+ g.cancelable && g.preventDefault();
3016
+ const u = g.targetTouches[0];
3017
+ this._strokeMoveUpdate(u);
3018
+ }, this._handleTouchEnd = (g) => {
3019
+ if (g.target === this.canvas) {
3020
+ g.cancelable && g.preventDefault();
3021
+ const h = g.changedTouches[0];
3022
+ this._strokeEnd(h);
3023
+ }
3024
+ }, this._handlePointerStart = (g) => {
3025
+ this._drawningStroke = !0, g.preventDefault(), this._strokeBegin(g);
3026
+ }, this._handlePointerMove = (g) => {
3027
+ this._drawningStroke && (g.preventDefault(), this._strokeMoveUpdate(g));
3028
+ }, this._handlePointerEnd = (g) => {
3029
+ this._drawningStroke && (g.preventDefault(), this._drawningStroke = !1, this._strokeEnd(g));
3030
+ }, this.velocityFilterWeight = n.velocityFilterWeight || 0.7, this.minWidth = n.minWidth || 0.5, this.maxWidth = n.maxWidth || 2.5, this.throttle = "throttle" in n ? n.throttle : 16, this.minDistance = "minDistance" in n ? n.minDistance : 5, this.dotSize = n.dotSize || 0, this.penColor = n.penColor || "black", this.backgroundColor = n.backgroundColor || "rgba(0,0,0,0)", this._strokeMoveUpdate = this.throttle ? te(Ct.prototype._strokeUpdate, this.throttle) : Ct.prototype._strokeUpdate, this._ctx = r.getContext("2d"), this.clear(), this.on();
3031
+ }
3032
+ clear() {
3033
+ const { _ctx: r, canvas: n } = this;
3034
+ r.fillStyle = this.backgroundColor, r.clearRect(0, 0, n.width, n.height), r.fillRect(0, 0, n.width, n.height), this._data = [], this._reset(this._getPointGroupOptions()), this._isEmpty = !0;
3035
+ }
3036
+ fromDataURL(r, n = {}) {
3037
+ return new Promise((g, u) => {
3038
+ const h = new Image(), d = n.ratio || window.devicePixelRatio || 1, l = n.width || this.canvas.width / d, i = n.height || this.canvas.height / d, s = n.xOffset || 0, f = n.yOffset || 0;
3039
+ this._reset(this._getPointGroupOptions()), h.onload = () => {
3040
+ this._ctx.drawImage(h, s, f, l, i), g();
3041
+ }, h.onerror = (a) => {
3042
+ u(a);
3043
+ }, h.crossOrigin = "anonymous", h.src = r, this._isEmpty = !1;
3044
+ });
3045
+ }
3046
+ toDataURL(r = "image/png", n) {
3047
+ switch (r) {
3048
+ case "image/svg+xml":
3049
+ return this._toSVG();
3050
+ default:
3051
+ return this.canvas.toDataURL(r, n);
3052
+ }
3053
+ }
3054
+ on() {
3055
+ this.canvas.style.touchAction = "none", this.canvas.style.msTouchAction = "none", this.canvas.style.userSelect = "none";
3056
+ const r = /Macintosh/.test(navigator.userAgent) && "ontouchstart" in document;
3057
+ window.PointerEvent && !r ? this._handlePointerEvents() : (this._handleMouseEvents(), "ontouchstart" in window && this._handleTouchEvents());
3058
+ }
3059
+ off() {
3060
+ this.canvas.style.touchAction = "auto", this.canvas.style.msTouchAction = "auto", this.canvas.style.userSelect = "auto", this.canvas.removeEventListener("pointerdown", this._handlePointerStart), this.canvas.removeEventListener("pointermove", this._handlePointerMove), this.canvas.ownerDocument.removeEventListener("pointerup", this._handlePointerEnd), this.canvas.removeEventListener("mousedown", this._handleMouseDown), this.canvas.removeEventListener("mousemove", this._handleMouseMove), this.canvas.ownerDocument.removeEventListener("mouseup", this._handleMouseUp), this.canvas.removeEventListener("touchstart", this._handleTouchStart), this.canvas.removeEventListener("touchmove", this._handleTouchMove), this.canvas.removeEventListener("touchend", this._handleTouchEnd);
3061
+ }
3062
+ isEmpty() {
3063
+ return this._isEmpty;
3064
+ }
3065
+ fromData(r, { clear: n = !0 } = {}) {
3066
+ n && this.clear(), this._fromData(r, this._drawCurve.bind(this), this._drawDot.bind(this)), this._data = this._data.concat(r);
3067
+ }
3068
+ toData() {
3069
+ return this._data;
3070
+ }
3071
+ _getPointGroupOptions(r) {
3072
+ return {
3073
+ penColor: r && "penColor" in r ? r.penColor : this.penColor,
3074
+ dotSize: r && "dotSize" in r ? r.dotSize : this.dotSize,
3075
+ minWidth: r && "minWidth" in r ? r.minWidth : this.minWidth,
3076
+ maxWidth: r && "maxWidth" in r ? r.maxWidth : this.maxWidth,
3077
+ velocityFilterWeight: r && "velocityFilterWeight" in r ? r.velocityFilterWeight : this.velocityFilterWeight
3078
+ };
3079
+ }
3080
+ _strokeBegin(r) {
3081
+ this.dispatchEvent(new CustomEvent("beginStroke", { detail: r }));
3082
+ const n = this._getPointGroupOptions(), g = Object.assign(Object.assign({}, n), { points: [] });
3083
+ this._data.push(g), this._reset(n), this._strokeUpdate(r);
3084
+ }
3085
+ _strokeUpdate(r) {
3086
+ if (this._data.length === 0) {
3087
+ this._strokeBegin(r);
3088
+ return;
3089
+ }
3090
+ this.dispatchEvent(new CustomEvent("beforeUpdateStroke", { detail: r }));
3091
+ const n = r.clientX, g = r.clientY, u = r.pressure !== void 0 ? r.pressure : r.force !== void 0 ? r.force : 0, h = this._createPoint(n, g, u), d = this._data[this._data.length - 1], l = d.points, i = l.length > 0 && l[l.length - 1], s = i ? h.distanceTo(i) <= this.minDistance : !1, f = this._getPointGroupOptions(d);
3092
+ if (!i || !(i && s)) {
3093
+ const a = this._addPoint(h, f);
3094
+ i ? a && this._drawCurve(a, f) : this._drawDot(h, f), l.push({
3095
+ time: h.time,
3096
+ x: h.x,
3097
+ y: h.y,
3098
+ pressure: h.pressure
3099
+ });
3100
+ }
3101
+ this.dispatchEvent(new CustomEvent("afterUpdateStroke", { detail: r }));
3102
+ }
3103
+ _strokeEnd(r) {
3104
+ this._strokeUpdate(r), this.dispatchEvent(new CustomEvent("endStroke", { detail: r }));
3105
+ }
3106
+ _handlePointerEvents() {
3107
+ this._drawningStroke = !1, this.canvas.addEventListener("pointerdown", this._handlePointerStart), this.canvas.addEventListener("pointermove", this._handlePointerMove), this.canvas.ownerDocument.addEventListener("pointerup", this._handlePointerEnd);
3108
+ }
3109
+ _handleMouseEvents() {
3110
+ this._drawningStroke = !1, this.canvas.addEventListener("mousedown", this._handleMouseDown), this.canvas.addEventListener("mousemove", this._handleMouseMove), this.canvas.ownerDocument.addEventListener("mouseup", this._handleMouseUp);
3111
+ }
3112
+ _handleTouchEvents() {
3113
+ this.canvas.addEventListener("touchstart", this._handleTouchStart), this.canvas.addEventListener("touchmove", this._handleTouchMove), this.canvas.addEventListener("touchend", this._handleTouchEnd);
3114
+ }
3115
+ _reset(r) {
3116
+ this._lastPoints = [], this._lastVelocity = 0, this._lastWidth = (r.minWidth + r.maxWidth) / 2, this._ctx.fillStyle = r.penColor;
3117
+ }
3118
+ _createPoint(r, n, g) {
3119
+ const u = this.canvas.getBoundingClientRect();
3120
+ return new pt(r - u.left, n - u.top, g, (/* @__PURE__ */ new Date()).getTime());
3121
+ }
3122
+ _addPoint(r, n) {
3123
+ const { _lastPoints: g } = this;
3124
+ if (g.push(r), g.length > 2) {
3125
+ g.length === 3 && g.unshift(g[0]);
3126
+ const u = this._calculateCurveWidths(g[1], g[2], n), h = bt.fromPoints(g, u);
3127
+ return g.shift(), h;
3128
+ }
3129
+ return null;
3130
+ }
3131
+ _calculateCurveWidths(r, n, g) {
3132
+ const u = g.velocityFilterWeight * n.velocityFrom(r) + (1 - g.velocityFilterWeight) * this._lastVelocity, h = this._strokeWidth(u, g), d = {
3133
+ end: h,
3134
+ start: this._lastWidth
3135
+ };
3136
+ return this._lastVelocity = u, this._lastWidth = h, d;
3137
+ }
3138
+ _strokeWidth(r, n) {
3139
+ return Math.max(n.maxWidth / (r + 1), n.minWidth);
3140
+ }
3141
+ _drawCurveSegment(r, n, g) {
3142
+ const u = this._ctx;
3143
+ u.moveTo(r, n), u.arc(r, n, g, 0, 2 * Math.PI, !1), this._isEmpty = !1;
3144
+ }
3145
+ _drawCurve(r, n) {
3146
+ const g = this._ctx, u = r.endWidth - r.startWidth, h = Math.ceil(r.length()) * 2;
3147
+ g.beginPath(), g.fillStyle = n.penColor;
3148
+ for (let d = 0; d < h; d += 1) {
3149
+ const l = d / h, i = l * l, s = i * l, f = 1 - l, a = f * f, y = a * f;
3150
+ let x = y * r.startPoint.x;
3151
+ x += 3 * a * l * r.control1.x, x += 3 * f * i * r.control2.x, x += s * r.endPoint.x;
3152
+ let b = y * r.startPoint.y;
3153
+ b += 3 * a * l * r.control1.y, b += 3 * f * i * r.control2.y, b += s * r.endPoint.y;
3154
+ const A = Math.min(r.startWidth + s * u, n.maxWidth);
3155
+ this._drawCurveSegment(x, b, A);
3156
+ }
3157
+ g.closePath(), g.fill();
3158
+ }
3159
+ _drawDot(r, n) {
3160
+ const g = this._ctx, u = n.dotSize > 0 ? n.dotSize : (n.minWidth + n.maxWidth) / 2;
3161
+ g.beginPath(), this._drawCurveSegment(r.x, r.y, u), g.closePath(), g.fillStyle = n.penColor, g.fill();
3162
+ }
3163
+ _fromData(r, n, g) {
3164
+ for (const u of r) {
3165
+ const { points: h } = u, d = this._getPointGroupOptions(u);
3166
+ if (h.length > 1)
3167
+ for (let l = 0; l < h.length; l += 1) {
3168
+ const i = h[l], s = new pt(i.x, i.y, i.pressure, i.time);
3169
+ l === 0 && this._reset(d);
3170
+ const f = this._addPoint(s, d);
3171
+ f && n(f, d);
3172
+ }
3173
+ else
3174
+ this._reset(d), g(h[0], d);
3175
+ }
3176
+ }
3177
+ _toSVG() {
3178
+ const r = this._data, n = Math.max(window.devicePixelRatio || 1, 1), g = 0, u = 0, h = this.canvas.width / n, d = this.canvas.height / n, l = document.createElementNS("http://www.w3.org/2000/svg", "svg");
3179
+ l.setAttribute("width", this.canvas.width.toString()), l.setAttribute("height", this.canvas.height.toString()), this._fromData(r, (x, { penColor: b }) => {
3180
+ const A = document.createElement("path");
3181
+ if (!isNaN(x.control1.x) && !isNaN(x.control1.y) && !isNaN(x.control2.x) && !isNaN(x.control2.y)) {
3182
+ const F = `M ${x.startPoint.x.toFixed(3)},${x.startPoint.y.toFixed(3)} C ${x.control1.x.toFixed(3)},${x.control1.y.toFixed(3)} ${x.control2.x.toFixed(3)},${x.control2.y.toFixed(3)} ${x.endPoint.x.toFixed(3)},${x.endPoint.y.toFixed(3)}`;
3183
+ A.setAttribute("d", F), A.setAttribute("stroke-width", (x.endWidth * 2.25).toFixed(3)), A.setAttribute("stroke", b), A.setAttribute("fill", "none"), A.setAttribute("stroke-linecap", "round"), l.appendChild(A);
3184
+ }
3185
+ }, (x, { penColor: b, dotSize: A, minWidth: F, maxWidth: M }) => {
3186
+ const E = document.createElement("circle"), B = A > 0 ? A : (F + M) / 2;
3187
+ E.setAttribute("r", B.toString()), E.setAttribute("cx", x.x.toString()), E.setAttribute("cy", x.y.toString()), E.setAttribute("fill", b), l.appendChild(E);
3188
+ });
3189
+ const i = "data:image/svg+xml;base64,", s = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="${g} ${u} ${h} ${d}" width="${h}" height="${d}">`;
3190
+ let f = l.innerHTML;
3191
+ if (f === void 0) {
3192
+ const x = document.createElement("dummy"), b = l.childNodes;
3193
+ x.innerHTML = "";
3194
+ for (let A = 0; A < b.length; A += 1)
3195
+ x.appendChild(b[A].cloneNode(!0));
3196
+ f = x.innerHTML;
3197
+ }
3198
+ const y = s + f + "</svg>";
3199
+ return i + btoa(y);
3200
+ }
3201
+ }, re = class extends ee {
3202
+ fromText(r, n = {}) {
3203
+ if (this.clear(), !r)
3204
+ return;
3205
+ const { font: g, x: u = 10, y: h = 50 } = n;
3206
+ let { maxWidth: d } = n;
3207
+ if (!d) {
3208
+ const { clientWidth: l = 300 } = this.canvas;
3209
+ d = Math.floor(l - 2 * u);
3210
+ }
3211
+ this._ctx.font = g, this._ctx.fillText(r, u, h, d), this._isEmpty = !1;
3212
+ }
3213
+ };
3214
+ const ne = {
3215
+ name: "SignaturePad",
3216
+ props: {
3217
+ type: {
3218
+ type: String,
3219
+ default: "text",
3220
+ validator: (v) => ["text", "draw"].includes(v)
3221
+ },
3222
+ text: {
3223
+ type: String,
3224
+ default: ""
3225
+ },
3226
+ width: {
3227
+ type: String,
3228
+ default: "100%"
3229
+ },
3230
+ height: {
3231
+ type: String,
3232
+ default: "100%"
3233
+ },
3234
+ customStyle: {
3235
+ type: Object,
3236
+ default: () => ({})
3237
+ },
3238
+ options: {
3239
+ type: Object,
3240
+ default: () => ({})
3241
+ },
3242
+ /**
3243
+ * Obj on format like {
3244
+ beginStroke: () => {},
3245
+ endStroke: () => {},
3246
+ },
3247
+ */
3248
+ signEvents: {
3249
+ type: Object,
3250
+ default: () => ({})
3251
+ },
3252
+ images: {
3253
+ type: Array,
3254
+ default: () => []
3255
+ }
3256
+ },
3257
+ data() {
3258
+ return {
3259
+ signaturePad: {},
3260
+ onResizeHandler: null,
3261
+ signatureData: "",
3262
+ defaultOptions: {
3263
+ dotSize: 1.5,
3264
+ minWidth: 0.5,
3265
+ maxWidth: 2.5,
3266
+ throttle: 16,
3267
+ minDistance: 3,
3268
+ backgroundColor: "rgba(0,0,0,0)",
3269
+ penColor: "black",
3270
+ velocityFilterWeight: 0.5
3271
+ },
3272
+ validTypes: ["image/png", "image/jpeg", "image/svg+xml"]
3273
+ };
3274
+ },
3275
+ watch: {
3276
+ type() {
3277
+ this.initType();
3278
+ },
3279
+ text(v) {
3280
+ this.drawText(v);
3281
+ }
3282
+ },
3283
+ mounted() {
3284
+ const { options: v, defaultOptions: r } = this, n = this.$refs.signaturePadCanvas;
3285
+ this.signaturePad = new re(n, {
3286
+ ...r,
3287
+ ...v
3288
+ }), this.onResizeHandler = this.resizeCanvas.bind(this), window.addEventListener("resize", this.onResizeHandler, !1), Object.keys(this.signEvents).forEach((g) => {
3289
+ this.signaturePad.addEventListener(g, () => {
3290
+ this.signEvents[g]();
3291
+ });
3292
+ }), this.initType(), this.resizeCanvas();
3293
+ },
3294
+ beforeDestroy() {
3295
+ this.onResizeHandler && window.removeEventListener("resize", this.onResizeHandler, !1);
3296
+ },
3297
+ methods: {
3298
+ initType() {
3299
+ this.type === "draw" ? this.openSignaturePad() : this.lockSignaturePad();
3300
+ },
3301
+ resizeCanvas() {
3302
+ const v = this.$refs.signaturePadCanvas, r = Math.max(window.devicePixelRatio || 1, 1);
3303
+ if (v.width = v.offsetWidth * r, v.height = v.offsetHeight * r, v.getContext("2d").scale(r, r), this.signaturePad.clear(), this.signatureData = "", this.type === "draw") {
3304
+ const n = this.signaturePad.toData();
3305
+ n != null && n.length && this.signaturePad.fromData(n);
3306
+ } else
3307
+ this.type === "text" && this.drawText(this.text);
3308
+ },
3309
+ saveSignature(v = {}) {
3310
+ const { type: r = "image/png", trim: n = !0, encoderOptions: g } = v || {}, u = { isEmpty: !1, data: void 0 };
3311
+ if (!this.validTypes.includes(r)) {
3312
+ const h = this.validTypes.join(", ");
3313
+ throw new Error(
3314
+ `The Image type is incorrect! We only support ${h} types.`
3315
+ );
3316
+ }
3317
+ if (this.signaturePad.isEmpty())
3318
+ return { ...u, isEmpty: !0 };
3319
+ if (n) {
3320
+ const h = this.$refs.signaturePadCanvas, d = h ? this.trimCanvas(h) : null;
3321
+ this.signatureData = d ? d.toDataURL(r, g) : "";
3322
+ } else
3323
+ this.signatureData = this.signaturePad.toDataURL(r, g);
3324
+ return {
3325
+ ...u,
3326
+ data: this.signatureData
3327
+ };
3328
+ },
3329
+ undoSignature() {
3330
+ const { signaturePad: v } = this, r = v.toData();
3331
+ r && v.fromData(r.slice(0, -1));
3332
+ },
3333
+ drawText(v) {
3334
+ this.signaturePad.fromText(v, {
3335
+ font: '40px "Nothing You Could Do"',
3336
+ x: 10,
3337
+ y: 100
3338
+ });
3339
+ },
3340
+ // Extend of module methods
3341
+ fromText(...v) {
3342
+ return this.signaturePad.fromText(...v);
3343
+ },
3344
+ fromDataURL(...v) {
3345
+ return this.signaturePad.fromDataURL(...v);
3346
+ },
3347
+ fromData(...v) {
3348
+ return this.signaturePad.fromData(...v);
3349
+ },
3350
+ toData(...v) {
3351
+ return this.signaturePad.toData(...v);
3352
+ },
3353
+ lockSignaturePad() {
3354
+ return this.signaturePad.off();
3355
+ },
3356
+ openSignaturePad() {
3357
+ return this.signaturePad.on();
3358
+ },
3359
+ isEmpty() {
3360
+ return this.signaturePad.isEmpty();
3361
+ },
3362
+ clearSignature() {
3363
+ return this.signaturePad.clear();
3364
+ },
3365
+ trimCanvas(v) {
3366
+ const r = document.createElement("canvas"), n = r.getContext("2d");
3367
+ r.width = v.width, r.height = v.height, n.drawImage(v, 0, 0);
3368
+ let g = r.width, u = r.height;
3369
+ const h = { x: [], y: [] }, d = n.getImageData(
3370
+ 0,
3371
+ 0,
3372
+ r.width,
3373
+ r.height
3374
+ );
3375
+ let l = 0;
3376
+ for (let f = 0; f < u; f++)
3377
+ for (let a = 0; a < g; a++)
3378
+ l = (f * g + a) * 4, d.data[l + 3] > 0 && (h.x.push(a), h.y.push(f));
3379
+ h.x.sort((f, a) => f - a), h.y.sort((f, a) => f - a);
3380
+ const i = h.x.length - 1;
3381
+ g = h.x[i] - h.x[0], u = h.y[i] - h.y[0];
3382
+ const s = n.getImageData(h.x[0], h.y[0], g, u);
3383
+ return r.height = u, n.putImageData(s, 0, 0), r;
3384
+ }
3385
+ },
3386
+ render(v) {
3387
+ const { width: r, height: n, customStyle: g } = this;
3388
+ return v(
3389
+ "div",
3390
+ {
3391
+ style: {
3392
+ width: r,
3393
+ height: n,
3394
+ ...g
3395
+ }
3396
+ },
3397
+ [
3398
+ v("canvas", {
3399
+ style: {
3400
+ width: "100%",
3401
+ height: "100%"
3402
+ },
3403
+ ref: "signaturePadCanvas"
3404
+ })
3405
+ ]
3406
+ );
3407
+ }
3408
+ }, ie = null, ae = null;
3409
+ var oe = /* @__PURE__ */ ot(
3410
+ ne,
3411
+ ie,
3412
+ ae,
3413
+ !1,
3414
+ null,
3415
+ null
3416
+ );
3417
+ const se = oe.exports;
3418
+ function ue({ rel: v, href: r, crossorigin: n = !1 }) {
3419
+ const g = document.createElement("link");
3420
+ g.rel = v, g.href = r, g.crossorigin = n, document.head.appendChild(g);
3421
+ }
3422
+ const ce = [
3423
+ { rel: "preconnect", href: "https://fonts.googleapis.com" },
3424
+ { rel: "preconnect", href: "https://fonts.gstatic.com", crossorigin: !0 },
3425
+ {
3426
+ rel: "stylesheet",
3427
+ href: "https://fonts.googleapis.com/css2?family=Nothing+You+Could+Do&display=swap"
3428
+ }
3429
+ ], le = {
3430
+ name: "SignatureAnswer",
3431
+ components: {
3432
+ CField: Lt,
3433
+ SignaturePad: se
3434
+ },
3435
+ mixins: [ft([])],
3436
+ props: {
3437
+ onCompleteFunc: {
3438
+ type: Function,
3439
+ default: null
3440
+ }
3441
+ },
3442
+ data() {
3443
+ return {
3444
+ mode: "text",
3445
+ text: "",
3446
+ isEmpty: !0,
3447
+ penColor: "hsl(220, 100%, 50%)"
3448
+ };
3449
+ },
3450
+ watch: {
3451
+ mode(v) {
3452
+ this.reset(), this.$refs.signaturePad && v === "text" && this.focusName();
3453
+ },
3454
+ text() {
3455
+ this.$refs.signaturePad && this.$nextTick(() => {
3456
+ this.isEmpty = this.$refs.signaturePad.isEmpty();
3457
+ });
3458
+ },
3459
+ isEmpty: {
3460
+ immediate: !0,
3461
+ handler(v) {
3462
+ this.$emit("invalid", v);
3463
+ }
3464
+ }
3465
+ },
3466
+ created() {
3467
+ ce.forEach(ue);
3468
+ },
3469
+ mounted() {
3470
+ this.focusName();
3471
+ },
3472
+ methods: {
3473
+ reset() {
3474
+ this.$refs.signaturePad && (this.$refs.signaturePad.clearSignature(), this.text && (this.text = ""), this.isEmpty = this.$refs.signaturePad.isEmpty());
3475
+ },
3476
+ undo() {
3477
+ this.$refs.signaturePad && (this.mode === "text" && this.text ? this.text = this.text.slice(0, this.text.length - 1) : this.$refs.signaturePad.undoSignature(), this.isEmpty = this.$refs.signaturePad.isEmpty());
3478
+ },
3479
+ getSignatureData() {
3480
+ let v = { type: "image/png", trim: !0 };
3481
+ this.mode === "draw" && (v = { type: "image/svg+xml", trim: !1 });
3482
+ const { isEmpty: r, data: n } = this.$refs.signaturePad ? this.$refs.signaturePad.saveSignature(v) : {};
3483
+ if (r || !n)
3484
+ throw Error("Missing signatureData");
3485
+ return n;
3486
+ },
3487
+ async submit({ answer: v }) {
3488
+ const r = this.getSignatureData();
3489
+ await v({ body: { isAccepted: !0, signatureDataURL: r } }), typeof this.onCompleteFunc == "function" && this.onCompleteFunc();
3490
+ },
3491
+ focusName() {
3492
+ this.$nextTick(
3493
+ () => this.$refs.nameInput ? this.$refs.nameInput.focus() : null
3494
+ );
3495
+ }
3496
+ }
3497
+ };
3498
+ var he = function() {
3499
+ var r = this, n = r._self._c;
3500
+ return n("div", { staticStyle: { "text-align": "left" } }, [n("div", { staticClass: "flex w-full items-center justify-between", staticStyle: { "font-size": "16px", "padding-bottom": "1em", "font-weight": "500", color: "hsl(0, 0%, 11%)" } }, [n("div", [r._v(r._s(r._document.$t("answerModal.signature.component.subTitle")))]), n("div", { staticClass: "sign-toggle" }, [n("div", { staticClass: "sign-toggle-button", class: { active: r.mode === "text" }, on: { click: function(g) {
3501
+ r.mode = "text";
3502
+ } } }, [r._v(" " + r._s(r._document.$t("answerModal.signature.component.text.tab")) + " ")]), n("div", { staticClass: "sign-toggle-button", class: { active: r.mode === "draw" }, on: { click: function(g) {
3503
+ r.mode = "draw";
3504
+ } } }, [r._v(" " + r._s(r._document.$t("answerModal.signature.component.draw.tab")) + " ")])])]), r.mode === "text" ? n("CField", { attrs: { label: r._document.$t("answerModal.signature.component.text.nameLabel") } }, [n("CInput", { ref: "nameInput", attrs: { placeholder: r._document.$t("answerModal.signature.component.text.namePlaceholder") }, model: { value: r.text, callback: function(g) {
3505
+ r.text = g;
3506
+ }, expression: "text" } })], 1) : r._e(), n("div", { staticClass: "wrapper", staticStyle: { "padding-bottom": "5px" } }, [n("div", { staticClass: "background-image" }, [n("svg", { attrs: { xmlns: "http://www.w3.org/2000/svg", width: "100%", height: "100%" } }, [n("line", { attrs: { x1: "0", y1: "75%", x2: "100%", y2: "75%", stroke: "hsl(0,0%, 70%)", "stroke-width": "1", "stroke-linecap": "round", "stroke-dasharray": "3", "shape-rendering": "crispEdges", "pointer-events": "none" } })])]), n("div", { staticStyle: { position: "absolute", left: "1em", top: "0.75em", "font-size": "12px", color: "hsl(0, 0%, 50%)" } }, [r._v(" " + r._s(r._document.$t(`answerModal.signature.component.${r.mode}.canvasLabel`)) + " ")]), n("span", { staticStyle: { "font-family": "'Nothing You Could Do', cursive" } }), n("SignaturePad", { ref: "signaturePad", staticClass: "signature-pad", attrs: { type: r.mode, text: r.text, options: {
3507
+ penColor: r.penColor
3508
+ }, "sign-events": {
3509
+ endStroke: () => {
3510
+ r.isEmpty = r.$refs.signaturePad ? r.$refs.signaturePad.isEmpty() : !0;
3511
+ }
3512
+ } } })], 1), n("div", { directives: [{ name: "show", rawName: "v-show", value: r.mode === "draw", expression: "mode === 'draw'" }], staticClass: "flex w-full justify-end" }, [n("CButton", { attrs: { disabled: r.isEmpty, type: "text", size: "small", pattern: "tertiary", circle: "", icon: "trash" }, on: { click: r.reset } }), n("CButton", { attrs: { disabled: r.isEmpty, type: "text", size: "small", pattern: "tertiary", circle: "", icon: "rotate-left" }, on: { click: r.undo } })], 1), n("div", { staticClass: "text-center", staticStyle: { "font-size": "12px", color: "hsl(0, 0%, 45%)", "padding-top": "10px" } }, [r._v(" " + r._s(r._document.$t("answerModal.signature.component.terms")) + " ")])], 1);
3513
+ }, fe = [], de = /* @__PURE__ */ ot(
3514
+ le,
3515
+ he,
3516
+ fe,
3517
+ !1,
3518
+ null,
3519
+ "e30cd56b"
3520
+ );
3521
+ const ge = de.exports, pe = () => {
3522
+ const v = window.location.host.split(".");
3523
+ return v && v[0];
3524
+ }, me = pe() === "fortnox", ve = [
3525
+ "enjoyedExperience",
3526
+ // boolean value
3527
+ "whatToImprove"
3528
+ // string value
3529
+ ], we = {
3530
+ mixins: [ft([])],
3531
+ props: {
3532
+ publicId: {
3533
+ type: String,
3534
+ default: ""
3535
+ }
3536
+ },
3537
+ data() {
3538
+ return {
3539
+ page: "start",
3540
+ whatToImprove: ""
3541
+ };
3542
+ },
3543
+ computed: {
3544
+ showFeedback() {
3545
+ return this.$view !== "widget";
3546
+ }
3547
+ },
3548
+ created() {
3549
+ this.$nextTick(() => {
3550
+ this.startAnimation();
3551
+ });
3552
+ },
3553
+ methods: {
3554
+ async submitFeedback({ type: v, data: r }) {
3555
+ if (!this.publicId)
3556
+ throw Error("Missing param publicId");
3557
+ if (!v)
3558
+ throw Error("Missing param type");
3559
+ if (!ve.includes(v))
3560
+ throw Error("Invalid feedback type");
3561
+ if (!r)
3562
+ throw Error("Missing param data");
3563
+ let n = "positive";
3564
+ try {
3565
+ Dt.feedback(this.publicId, { type: v, data: r }), v === "enjoyedExperience" && !r.value && (n = "negative"), v === "whatToImprove" && (n = "negative.success"), me && n !== "negative" && (n = "custom");
3566
+ } catch (g) {
3567
+ Et(g, { showMessage: !1 });
3568
+ } finally {
3569
+ this.goTo(n);
3570
+ }
3571
+ },
3572
+ async goTo(v) {
3573
+ if (this.$emit("page", v), v === "positive" || v === "negative") {
3574
+ this.$refs.start.style.opacity = 0, this.page = "intermediate", setTimeout(() => {
3575
+ this.page = v;
3576
+ }, 2e3);
3577
+ return;
3578
+ }
3579
+ this.page = v;
3580
+ },
3581
+ startAnimation() {
3582
+ const v = this.$refs.feedbackBg;
3583
+ v.gradOneXPos = 0, v.gradOneYPos = 0, v.gradTwoXPos = 80, v.gradTwoYPos = 20, v.gradThreeXPos = 20, v.gradThreeYPos = 80, v.gradFourXPos = 80, v.gradFourYPos = 80, nt({
3584
+ targets: v,
3585
+ duration: 12e3,
3586
+ direction: "alternate",
3587
+ easing: "linear",
3588
+ loop: !0,
3589
+ gradOneXPos: [10, 5, 0, -10],
3590
+ gradOneYPos: [10, 20, 25, 30],
3591
+ gradTwoXPos: [25, 20, 15, 10, 25],
3592
+ gradTwoYPos: [65, 55, 40, 65, 80],
3593
+ gradThreeXPos: [25, 20, 10, 15, 25],
3594
+ gradThreeYPos: [65, 50, 45, 60, 80],
3595
+ gradFourXPos: [85, 80, 75, 70, 95],
3596
+ gradFourYPos: [90, 100, 120, 100, 85],
3597
+ update() {
3598
+ v.style.setProperty(
3599
+ "--gradOneXPos",
3600
+ `${v.gradOneXPos}%`
3601
+ ), v.style.setProperty(
3602
+ "--gradOneYPos",
3603
+ `${v.gradOneYPos}%`
3604
+ ), v.style.setProperty(
3605
+ "--gradTwoXPos",
3606
+ `${v.gradTwoXPos}%`
3607
+ ), v.style.setProperty(
3608
+ "--gradTwoYPos",
3609
+ `${v.gradTwoYPos}%`
3610
+ ), v.style.setProperty(
3611
+ "--gradThreeXPos",
3612
+ `${v.gradThreeXPos}%`
3613
+ ), v.style.setProperty(
3614
+ "--gradThreeYPos",
3615
+ `${v.gradThreeYPos}%`
3616
+ ), v.style.setProperty(
3617
+ "--gradFourXPos",
3618
+ `${v.gradFourXPos}%`
3619
+ ), v.style.setProperty(
3620
+ "--gradFourYPos",
3621
+ `${v.gradFourYPos}%`
3622
+ );
3623
+ }
3624
+ });
3625
+ },
3626
+ // animations
3627
+ leave(v, r) {
3628
+ nt({
3629
+ targets: v,
3630
+ // height: 0,
3631
+ // opacity: [1, 0],
3632
+ opacity: 0,
3633
+ duration: 500,
3634
+ easing: "easeInOutCubic",
3635
+ complete: r
3636
+ });
3637
+ },
3638
+ enter(v, r) {
3639
+ nt({
3640
+ targets: v,
3641
+ delay: this.page === "intermediate" ? 250 : 0,
3642
+ duration: 500,
3643
+ opacity: [0, 1],
3644
+ easing: "easeInOutCubic",
3645
+ complete: r
3646
+ });
3647
+ }
3648
+ }
3649
+ };
3650
+ var ye = function() {
3651
+ var r = this, n = r._self._c;
3652
+ return n("div", { staticClass: "f-feedback" }, [n("div", { ref: "feedbackBg", staticClass: "f-bg" }), n("div", { staticClass: "f-container" }, [n("transition", { attrs: { css: !1, mode: "out-in" }, on: { enter: r.enter, leave: r.leave } }, [r.page === "start" ? n("div", { key: "start", ref: "start", staticClass: "flex w-full flex-col items-center justify-center", staticStyle: { transition: "opacity 250ms" } }, [n("div", { staticStyle: { "padding-bottom": "calc(1.5 * var(--rem))", "font-size": "14px", "font-weight": "500" }, domProps: { textContent: r._s(r._document.$t("answerFeedback.start.title")) } }), n("div", [n("CButton", { staticClass: "feedback-btn", attrs: { "icon-left": "thumbsdown", size: "small", pattern: "secondary" }, on: { click: function(g) {
3653
+ return r.submitFeedback({
3654
+ type: "enjoyedExperience",
3655
+ data: { value: !1 }
3656
+ });
3657
+ } } }, [r._v(r._s(r._document.$t("answerFeedback.start.no")))]), n("CButton", { staticClass: "feedback-btn", staticStyle: { "margin-left": "calc(0.75 * var(--rem))" }, attrs: { "icon-left": "thumbsup", size: "small", pattern: "secondary" }, on: { click: function(g) {
3658
+ return r.submitFeedback({
3659
+ type: "enjoyedExperience",
3660
+ data: { value: !0 }
3661
+ });
3662
+ } } }, [r._v(r._s(r._document.$t("answerFeedback.start.yes")))])], 1)]) : r.page === "intermediate" ? n("div", { key: "intermediate", staticStyle: { height: "100%", display: "flex", "flex-direction": "column" } }, [n("div", { staticStyle: { flex: "1 1 auto", display: "flex", "flex-direction": "column", "justify-content": "center", "align-items": "center" } }, [n("div", { staticClass: "f-title", domProps: { textContent: r._s(r._document.$t("answerFeedback.intermediate.title")) } })])]) : r.page === "positive" && r.showFeedback ? n("div", { key: "positive", staticStyle: { height: "100%", display: "flex", "flex-direction": "column" } }, [n("div", { staticStyle: { flex: "1 1 auto", display: "flex", "flex-direction": "column", "justify-content": "center", "align-items": "center" } }, [n("div", { staticClass: "f-title", domProps: { textContent: r._s(r._document.$t("answerFeedback.yes.title")) } }), n("div", { domProps: { textContent: r._s(r._document.$t("answerFeedback.yes.text")) } })]), n("CButton", { staticClass: "a-btn", staticStyle: { "margin-bottom": "0.5em" }, attrs: { type: "secondary", wide: "", tag: "a", href: "/register?utm_source=document&utm_medium=feedback-modal&utm_campaign=signup&utm_content=positive-exp", target: "_blank" }, domProps: { textContent: r._s(r._document.$t("answerFeedback.yes.action")) } }), n("CButton", { staticClass: "a-btn", attrs: { wide: "", tag: "a", href: `https://${r.$t(
3663
+ "_common:brand.domain"
3664
+ )}?utm_source=document&utm_medium=feedback-modal&utm_campaign=learn-more&utm_content=positive-exp`, target: "_blank" }, domProps: { textContent: r._s(r._document.$t("answerFeedback.yes.secondary")) } })], 1) : r.page === "negative" ? n("div", { key: "negative", staticStyle: { height: "100%", display: "flex", "flex-direction": "column" } }, [n("div", { staticStyle: { flex: "1 1 auto", display: "flex", "flex-direction": "column", "justify-content": "center", "align-items": "center" } }, [n("div", { staticClass: "f-title", domProps: { textContent: r._s(r._document.$t("answerFeedback.no.start.title")) } }), n("div", { domProps: { textContent: r._s(r._document.$t("answerFeedback.no.start.text")) } }), n("CInput", { staticClass: "input-style", staticStyle: { margin: "2em 0" }, attrs: { placeholder: r._document.$t("answerFeedback.no.start.placeholder"), type: "textarea" }, model: { value: r.whatToImprove, callback: function(g) {
3665
+ r.whatToImprove = g;
3666
+ }, expression: "whatToImprove" } })], 1), n("CButton", { staticClass: "a-btn", attrs: { wide: "" }, domProps: { textContent: r._s(r._document.$t("answerFeedback.no.start.action")) }, on: { click: function(g) {
3667
+ return r.submitFeedback({
3668
+ type: "whatToImprove",
3669
+ data: { value: r.whatToImprove }
3670
+ });
3671
+ } } })], 1) : r.page === "negative.success" ? n("div", { key: "success", staticStyle: { height: "100%", display: "flex", "flex-direction": "column" } }, [n("div", { staticStyle: { flex: "1 1 auto", display: "flex", "flex-direction": "column", "justify-content": "center", "align-items": "center" } }, [n("div", { staticClass: "f-title", domProps: { textContent: r._s(r._document.$t("answerFeedback.no.success.title")) } }), n("div", { domProps: { textContent: r._s(r._document.$t("answerFeedback.no.success.text")) } })]), n("CButton", { staticClass: "a-btn", staticStyle: { "margin-bottom": "0.5em" }, attrs: { tag: "a", href: `https://${r.$t(
3672
+ "_common:brand.domain"
3673
+ )}?utm_source=document&utm_medium=feedback-modal&utm_campaign=learn-more&utm_content=negative-exp`, target: "_blank", wide: "", type: "secondary" }, domProps: { textContent: r._s(r._document.$t("answerFeedback.no.success.action")) } }), n("CButton", { staticClass: "a-btn", attrs: { wide: "" }, domProps: { textContent: r._s(r._document.$t("answerFeedback.no.success.secondary")) }, on: { click: function(g) {
3674
+ return r.$emit("close");
3675
+ } } })], 1) : r.page === "custom" ? n("div", { key: "success", staticStyle: { height: "100%", display: "flex", "flex-direction": "column" } }, [n("div", { staticStyle: { flex: "1 1 auto", display: "flex", "flex-direction": "column", "justify-content": "center", "align-items": "center" } }, [n("div", { staticClass: "f-title", domProps: { textContent: r._s(r._document.$t("answerFeedback.custom.title")) } }), n("div", { domProps: { textContent: r._s(r._document.$t("answerFeedback.custom.text")) } })]), n("CButton", { staticClass: "a-btn", attrs: { type: "secondary", wide: "" }, domProps: { textContent: r._s(r._document.$t("answerFeedback.custom.action")) }, on: { click: function(g) {
3676
+ return r.$emit("close");
3677
+ } } })], 1) : r._e()])], 1)]);
3678
+ }, xe = [], _e = /* @__PURE__ */ ot(
3679
+ we,
3680
+ ye,
3681
+ xe,
3682
+ !1,
3683
+ null,
3684
+ "b3b609e2"
3685
+ );
3686
+ const Ce = _e.exports, Ee = {
3687
+ components: {
3688
+ Feedback: Ce,
3689
+ Signature: ge,
3690
+ BankId: Kt,
3691
+ Deny: qt
3692
+ },
3693
+ mixins: [ft([])],
3694
+ i18nOptions: {
3695
+ namespaces: "temporary",
3696
+ messages: {
3697
+ en: {
3698
+ previewMode: "Preview answer mode"
3699
+ },
3700
+ sv: {
3701
+ previewMode: "Demo - Förhandsgranska"
3702
+ }
3703
+ }
3704
+ },
3705
+ props: {
3706
+ mode: { type: String, default: "accept" },
3707
+ // 'accept', 'decline'
3708
+ isSender: { type: Boolean, default: !1 },
3709
+ fullScreen: { type: Boolean, default: !1 },
3710
+ senderActions: { type: Object, default: () => ({}) },
3711
+ calcHeight: { type: Boolean, default: !1 }
3712
+ },
3713
+ data() {
3714
+ return {
3715
+ page: "start",
3716
+ // start | intermediate | success | versionError
3717
+ isFeedbackInitiated: !1,
3718
+ isPosting: !1,
3719
+ actionInvalid: !1
3720
+ };
3721
+ },
3722
+ computed: {
3723
+ answerComponentName() {
3724
+ return this.mode === "decline" ? "Deny" : this.answerMethod === "bankId" ? "BankId" : "Signature";
3725
+ },
3726
+ answerType() {
3727
+ return this.mode === "decline" ? "decline" : this.answerMethod === "bankId" ? "bankId" : "signature";
3728
+ },
3729
+ signee() {
3730
+ return this.isSender ? this._document.senderClient : this._document.viewer;
3731
+ },
3732
+ answerMethod() {
3733
+ var v;
3734
+ return (v = this.signee.answerMethod) == null ? void 0 : v.accept;
3735
+ },
3736
+ successStrings() {
3737
+ const v = this.signee.email ? this._document.$t(`answerModal.${this.answerType}.success.text`, {
3738
+ email: this.signee.email
3739
+ }) : this._document.$t(
3740
+ `answerModal.${this.answerType}.success.textFallback`
3741
+ ), r = this.signee.email ? this._document.$t("answerModal.successTextSingle", {
3742
+ email: this.signee.email
3743
+ }) : this._document.$t("answerModal.successTextFallbackSingle"), n = this._document.remainingSignatures === 0 ? r : v;
3744
+ return {
3745
+ title: this._document.$t(
3746
+ `answerModal.${this.answerType}.success.title`
3747
+ ),
3748
+ text: n
3749
+ };
3750
+ }
3751
+ },
3752
+ created() {
3753
+ this.calcHeight && this.$nextTick(() => this.setFixedHeight());
3754
+ },
3755
+ methods: {
3756
+ ...Ut({
3757
+ answerCurrentDoc: yt.ANSWER_CURRENT_PUBLIC_DOCUMENT,
3758
+ putCurrentDoc: yt.PUT_CURRENT_PUBLIC_DOCUMENT,
3759
+ reloadCurrentDocument: yt.RELOAD_CURRENT_DOCUMENT
3760
+ }),
3761
+ async onSubmit() {
3762
+ this.setFixedHeight(), await this.submit();
3763
+ },
3764
+ async submit() {
3765
+ if (!this.isPosting) {
3766
+ this.isPosting = !0;
3767
+ try {
3768
+ const { submit: v } = this.$refs.answerComponent;
3769
+ if (typeof v != "function")
3770
+ throw Error("Missing answer type submit method");
3771
+ await v({
3772
+ update: (r) => this.putCurrentDoc({ includeChanges: !0, ...r }),
3773
+ answer: this.answerCurrentDoc,
3774
+ ...this.isSender ? this.senderActions : null
3775
+ });
3776
+ } catch (v) {
3777
+ this.isPosting = !1, v.httpStatusCode === 409 ? this.page = "versionError" : Et(v);
3778
+ }
3779
+ }
3780
+ },
3781
+ onComplete() {
3782
+ return (async () => {
3783
+ var n;
3784
+ if (this.isSender && this.senderActions.send) {
3785
+ this.$emit("close"), await this.senderActions.send();
3786
+ return;
3787
+ }
3788
+ const r = this.mode === "accept";
3789
+ this.mode === "accept" && this.answerMethod === "bankId" ? setTimeout(
3790
+ () => this.reloadCurrentDocument().then(
3791
+ () => {
3792
+ var g;
3793
+ return At.trigger("document:answer", {
3794
+ id: (g = this._document) == null ? void 0 : g.id,
3795
+ didAccept: r
3796
+ });
3797
+ }
3798
+ ),
3799
+ 1e3
3800
+ ) : At.trigger("document:answer", {
3801
+ id: (n = this._document) == null ? void 0 : n.id,
3802
+ didAccept: r
3803
+ }), await Bt(800), this.page = "intermediate", await Bt(2e3), this.page = "success", this.isPosting = !1;
3804
+ })();
3805
+ },
3806
+ reload() {
3807
+ window.location.reload();
3808
+ },
3809
+ setFixedHeight() {
3810
+ this.$el.style.minHeight = `${this.$el.offsetHeight}px`;
3811
+ },
3812
+ minimizeHeight(v, r) {
3813
+ nt({
3814
+ targets: v,
3815
+ height: 0,
3816
+ flexGrow: [1, 0],
3817
+ opacity: [1, 0],
3818
+ duration: 900,
3819
+ easing: "easeOutQuint",
3820
+ complete: r
3821
+ }), nt({
3822
+ targets: this.$refs.feedback.$el,
3823
+ height: 0,
3824
+ flexGrow: 1,
3825
+ duration: 900,
3826
+ easing: "easeOutQuint"
3827
+ });
3828
+ },
3829
+ enterAnim(v, r) {
3830
+ nt({
3831
+ targets: v.querySelectorAll(".stagger-anim"),
3832
+ opacity: [0, 1],
3833
+ delay: nt.stagger(180, { start: 800 }),
3834
+ duration: 340,
3835
+ easing: "linear",
3836
+ complete: r
3837
+ });
3838
+ },
3839
+ leaveAnim(v, r) {
3840
+ v.style.position = "absolute", nt({
3841
+ targets: v.querySelectorAll(".stagger-anim"),
3842
+ opacity: 0,
3843
+ delay: nt.stagger(200),
3844
+ duration: 200,
3845
+ easing: "linear",
3846
+ complete: r
3847
+ });
3848
+ }
3849
+ }
3850
+ };
3851
+ var be = function() {
3852
+ var g;
3853
+ var r = this, n = r._self._c;
3854
+ return n("transition-group", { staticClass: "a-root font-inter", attrs: { tag: "div", css: !1, mode: "out-in" }, on: { enter: r.enterAnim, leave: r.leaveAnim } }, [n("CButton", { key: "btn", staticClass: "text-[hsl(0, 0%, 45%)] absolute right-5 top-5 z-[9]", attrs: { icon: "x", circle: "" }, on: { click: function(u) {
3855
+ r.$parent.$emit("cancel"), r.$emit("close");
3856
+ } } }), r.page === "start" ? n("div", { key: "start", staticClass: "root-padding flex-grow" }, [n("div", { staticClass: "stagger-anim", staticStyle: { "padding-bottom": "40px" } }, [n("div", { staticClass: "a-title", domProps: { textContent: r._s(r._document.$t(`answerModal.${r.answerType}.start.title`)) } }), n("div", { staticStyle: { color: "hsl(0, 0%, 40%)" }, domProps: { textContent: r._s(r._document.$t(`answerModal.${r.answerType}.start.text`)) } })]), n(r.answerComponentName, { ref: "answerComponent", tag: "component", staticClass: "stagger-anim", attrs: { _document: r._document, signee: r.signee, "on-complete-func": r.onComplete }, on: { invalid: function(u) {
3857
+ r.actionInvalid = u;
3858
+ }, loading: function(u) {
3859
+ r.isPosting = u;
3860
+ } } }), n("div", { staticClass: "stagger-anim", staticStyle: { "padding-top": "3em" } }, [n("CButton", { staticClass: "a-btn", attrs: { loading: r.isPosting, disabled: r.actionInvalid, type: r.mode === "decline" ? "text" : "secondary", icon: r.answerType === "bankId" ? "bankId" : "" }, on: { click: r.onSubmit } }, [r._v(" " + r._s(r._document.$t(`answerModal.${r.answerType}.start.action`)) + " ")])], 1)], 1) : r.page === "intermediate" ? n("div", { key: "intermediate", staticClass: "flex w-full flex-grow flex-col items-center justify-center text-center", staticStyle: { height: "100%" } }, [n("div", { staticClass: "a-title stagger-anim", domProps: { textContent: r._s(r._document.$t("answerModal.answerSuccess")) } })]) : r.page === "success" ? n("div", { key: "success", staticClass: "flex w-full flex-grow flex-col", staticStyle: { height: "100%" } }, [n("transition", { attrs: { css: !1 }, on: { leave: r.minimizeHeight } }, [r.isFeedbackInitiated ? r._e() : n("div", { staticClass: "flex w-full flex-grow flex-col items-center justify-center", staticStyle: { overflow: "hidden" } }, [n("div", { staticClass: "root-padding flex w-full flex-col items-center justify-center", staticStyle: { height: "100%" } }, [n("div", { staticClass: "a-title stagger-anim", staticStyle: { padding: "calc(2.5 * var(--rem)) 0 calc(2 * var(--rem))" } }, [n("div", { domProps: { textContent: r._s(r.successStrings.title) } })]), n("div", { staticClass: "stagger-anim", domProps: { textContent: r._s(r.successStrings.text) } })])])]), n("Feedback", { ref: "feedback", staticClass: "stagger-anim", staticStyle: { flex: "0 0", overflow: "hidden", "min-height": "200px" }, attrs: { "public-id": (g = r._document.viewer) == null ? void 0 : g.publicDocumentId, _document: r._document }, on: { page: () => r.isFeedbackInitiated = !0, close: function(u) {
3861
+ return r.$emit("close");
3862
+ } } })], 1) : r.page === "versionError" ? n("div", { key: "versionError", staticClass: "root-padding flex flex-grow flex-col items-center justify-center text-center" }, [n("div", { staticClass: "stagger-anim" }, [n("div", { staticClass: "flex items-center justify-center", staticStyle: { padding: "20px 0" } }, [n("div", { staticClass: "flex items-center justify-center", staticStyle: { width: "52px", height: "52px", "border-radius": "50%" } }, [n("CIcon", { attrs: { size: 30, type: "error" } })], 1)]), n("div", { staticClass: "a-title", domProps: { textContent: r._s(r._document.$t(`answerModal.versionError.${r.mode}.title`)) } }), n("div", { domProps: { textContent: r._s(r._document.$t("answerModal.versionError.text")) } })]), n("div", { staticClass: "stagger-anim", staticStyle: { "padding-top": "3em" } }, [n("CButton", { staticClass: "a-btn", attrs: { loading: r.isPosting, type: "none" }, on: { click: r.reload } }, [r._v(" " + r._s(r._document.$t("answerModal.versionError.btn")) + " ")])], 1)]) : r._e()], 1);
3863
+ }, Pe = [], Se = /* @__PURE__ */ ot(
3864
+ Ee,
3865
+ be,
3866
+ Pe,
3867
+ !1,
3868
+ null,
3869
+ "67dcb365"
3870
+ );
3871
+ const Me = Se.exports;
3872
+ export {
3873
+ Me as default
3874
+ };