@feedmepos/mf-payment 1.9.2 → 1.9.4-dev

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 (103) hide show
  1. package/dist/{Actions.vue_vue_type_script_setup_true_lang-7ni1-lKF.js → Actions.vue_vue_type_script_setup_true_lang-CkECWfJH.js} +1 -1
  2. package/dist/{AdminBusinessSelector.vue_vue_type_script_setup_true_lang-2vgQHqHT.js → AdminBusinessSelector.vue_vue_type_script_setup_true_lang-BO0JN_rh.js} +3 -3
  3. package/dist/{AdminRestaurantSelector.vue_vue_type_script_setup_true_lang-ByU0LzXW.js → AdminRestaurantSelector.vue_vue_type_script_setup_true_lang-Bnn4SxyN.js} +2 -2
  4. package/dist/{Chargeback-BqAfvr6y.js → Chargeback-b5GjZ9Mb.js} +5 -5
  5. package/dist/{DocumentViewer.vue_vue_type_script_setup_true_lang-_Xh7KYhJ.js → DocumentViewer.vue_vue_type_script_setup_true_lang-BviLk6nC.js} +1 -1
  6. package/dist/ExternalTerminal-DhoNW6qp.js +525 -0
  7. package/dist/{OnboardForm-nmVPX-mO.js → OnboardForm-Bq181JPX.js} +6 -6
  8. package/dist/{OnboardForm-fsUaxHxj.js → OnboardForm-CtgycClY.js} +6 -6
  9. package/dist/{OnboardSubmission-Bg8S8_29.js → OnboardSubmission-D-0Sas7U.js} +6 -6
  10. package/dist/{OnboardSubmission-Oa_LY3gM.js → OnboardSubmission-DXBjG3oR.js} +3 -3
  11. package/dist/{PayoutAccount-CXkLMuB9.js → PayoutAccount-D5giLt_J.js} +5 -5
  12. package/dist/{PayoutAccount-CcCcvM9g.js → PayoutAccount-Ddpq-rZp.js} +7 -7
  13. package/dist/{PayoutAccountSetting-DaT8zIz7.js → PayoutAccountSetting-5ik0IR2I.js} +6 -6
  14. package/dist/{Restaurant-DZAfaFb-.js → Restaurant-BG-2LYcJ.js} +4 -4
  15. package/dist/{RestaurantSetting-Bpx0v-wl.js → RestaurantSetting-CtnOR7kY.js} +3 -3
  16. package/dist/{Settlement-DS61FGow.js → Settlement-BzoTb2ks.js} +3 -3
  17. package/dist/{Settlement-CqFAhrhW.js → Settlement-CfU_5sp-.js} +4 -4
  18. package/dist/{SettlementTransactions-ZckC-PPM.js → SettlementTransactions-CmX9LDuK.js} +5 -5
  19. package/dist/{SettlementTransactions-DCPpL_ZG.js → SettlementTransactions-Dh-erDBh.js} +5 -5
  20. package/dist/{Status.vue_vue_type_script_setup_true_lang-b0WaQ7_a.js → Status.vue_vue_type_script_setup_true_lang-D3dpjdxR.js} +1 -1
  21. package/dist/Terminal-ZLduA0bd.js +1158 -0
  22. package/dist/{TerminalSetting-DHR02KO8.js → TerminalSetting-CvaUOBlA.js} +5 -5
  23. package/dist/{Transaction-BxRx9X8n.js → Transaction-BeNRIA2R.js} +10 -10
  24. package/dist/{Transaction-DKBQQYLJ.js → Transaction-Bpc_LdWE.js} +11 -11
  25. package/dist/{TransactionOld-BBC274Fu.js → TransactionOld-SaMACUtQ.js} +7 -7
  26. package/dist/{TransactionStatus.vue_vue_type_script_setup_true_lang-D0qx6l1Q.js → TransactionStatus.vue_vue_type_script_setup_true_lang-CuBa_qMU.js} +1 -1
  27. package/dist/api/external-terminal/index.d.ts +13 -0
  28. package/dist/{app-CcITI3hv.js → app-Cq04HfHW.js} +370 -352
  29. package/dist/app.js +1 -1
  30. package/dist/{assets-CKbXRAHk.js → assets-Cj91tAER.js} +1 -1
  31. package/dist/{grafana-BwS149zG.js → grafana-CuJUDQ26.js} +1 -1
  32. package/dist/{index-g4azevaB.js → index-BQijmIi-.js} +1 -1
  33. package/dist/{index-DJPzPOV6.js → index-BTMbNw68.js} +1 -1
  34. package/dist/{index-BW7HTfGj.js → index-C3dR6tpd.js} +1 -1
  35. package/dist/{index-CyZ1a0NP.js → index-C4EENmPN.js} +1 -1
  36. package/dist/{index-BHBGKw7s.js → index-Cj7KUaM0.js} +3080 -3021
  37. package/dist/{index-CcYiD96F.js → index-DVC9y-6t.js} +1 -1
  38. package/dist/{index-CjLA0aiV.js → index-DmC6nw2c.js} +1 -1
  39. package/dist/{index-DwfxhjAJ.js → index-JV44EPG0.js} +2 -2
  40. package/dist/{index-DW02o6U2.js → index-lfOPW24n.js} +1 -1
  41. package/dist/{index.vue_vue_type_script_setup_true_lang-BcM4GmNe.js → index.vue_vue_type_script_setup_true_lang-Cz6llWgj.js} +1 -1
  42. package/dist/{onboard-submission-tAwpwpF3.js → onboard-submission-ChLJrEtc.js} +1 -1
  43. package/dist/package.json +3 -3
  44. package/dist/{payout-account-Z__ouW7F.js → payout-account-Db0R_Isi.js} +3 -3
  45. package/dist/stores/payoutAccount.d.ts +20 -20
  46. package/dist/style.css +1 -1
  47. package/dist/tsconfig.app.tsbuildinfo +1 -1
  48. package/dist/views/admin/external-terminal/ExternalTerminal.vue.d.ts +2 -0
  49. package/dist/views/admin/external-terminal/ExternalTerminalPairDialog.vue.d.ts +67 -0
  50. package/dist/views/admin/external-terminal/ExternalTerminalSideSheet.vue.d.ts +86 -0
  51. package/dist/views/admin/external-terminal/cell/Actions.vue.d.ts +14 -0
  52. package/dist/views/admin/external-terminal/cell/ID.vue.d.ts +7 -0
  53. package/dist/views/admin/external-terminal/pair/BRITerminal.vue.d.ts +76 -0
  54. package/dist/views/admin/external-terminal/pair/BeamTerminal.vue.d.ts +76 -0
  55. package/dist/views/admin/payout-account/tabs/Information.vue.d.ts +20 -20
  56. package/dist/views/admin/payout-account/tabs/PaymentChannel.vue.d.ts +42 -42
  57. package/dist/views/admin/payout-account/tabs/PaymentGateway.vue.d.ts +42 -42
  58. package/dist/views/admin/payout-account/tabs/PaymentStatus.vue.d.ts +20 -20
  59. package/dist/views/admin/payout-account/tabs/Settlement.vue.d.ts +20 -20
  60. package/dist/views/admin/payout-account/tabs/TokenGateway.vue.d.ts +42 -42
  61. package/dist/views/admin/payout-account/tabs/gateway/AdyenGateway.vue.d.ts +2 -2
  62. package/dist/views/admin/payout-account/tabs/gateway/FiuuGateway.vue.d.ts +2 -2
  63. package/dist/views/admin/payout-account/tabs/gateway/KsherGateway.vue.d.ts +2 -2
  64. package/dist/views/admin/payout-account/tabs/gateway/MacauPassGateway.vue.d.ts +2 -2
  65. package/dist/views/admin/payout-account/tabs/token/ApplePayToken.vue.d.ts +2 -2
  66. package/dist/views/admin/payout-account/tabs/token/GooglePayToken.vue.d.ts +2 -2
  67. package/dist/views/admin/restaurant/tabs/gateway/AdyenGateway.vue.d.ts +2 -2
  68. package/dist/views/admin/restaurant/tabs/gateway/BeamGateway.vue.d.ts +2 -2
  69. package/dist/views/admin/restaurant/tabs/gateway/DigioGateway.vue.d.ts +2 -2
  70. package/dist/views/admin/restaurant/tabs/gateway/FiuuGateway.vue.d.ts +6 -6
  71. package/dist/views/admin/restaurant/tabs/gateway/GhlGateway.vue.d.ts +4 -4
  72. package/dist/views/admin/restaurant/tabs/gateway/GrabGateway.vue.d.ts +2 -2
  73. package/dist/views/admin/restaurant/tabs/gateway/KsherGateway.vue.d.ts +4 -4
  74. package/dist/views/admin/restaurant/tabs/gateway/MacauPassGateway.vue.d.ts +4 -4
  75. package/dist/views/admin/restaurant/tabs/gateway/MaybankGateway.vue.d.ts +2 -2
  76. package/dist/views/admin/restaurant/tabs/gateway/MonetapayGateway.vue.d.ts +2 -2
  77. package/dist/views/admin/restaurant/tabs/gateway/RevenueMonsterGateway.vue.d.ts +2 -2
  78. package/dist/views/admin/restaurant/tabs/gateway/SoftSpaceGateway.vue.d.ts +2 -2
  79. package/dist/views/admin/terminal/{TerminalDialog.vue.d.ts → TerminalSideSheet.vue.d.ts} +41 -22
  80. package/dist/views/admin/terminal/tabs/EcrGateway.vue.d.ts +18 -20
  81. package/dist/views/admin/terminal/tabs/Information.vue.d.ts +18 -20
  82. package/dist/views/admin/terminal/tabs/PaymentCheckout.vue.d.ts +18 -20
  83. package/dist/views/admin/terminal/tabs/QrGateway.vue.d.ts +18 -20
  84. package/dist/views/admin/terminal/tabs/SettingRequest.vue.d.ts +18 -20
  85. package/dist/views/admin/terminal/tabs/SoftposGateway.vue.d.ts +18 -20
  86. package/dist/views/admin/terminal/tabs/ecr/Ghl2Gateway.vue.d.ts +18 -20
  87. package/dist/views/admin/terminal/tabs/ecr/Ghl3Gateway.vue.d.ts +18 -20
  88. package/dist/views/admin/terminal/tabs/ecr/GhlGateway.vue.d.ts +18 -20
  89. package/dist/views/admin/terminal/tabs/ecr/GlobalPaymentsGateway.vue.d.ts +18 -20
  90. package/dist/views/admin/terminal/tabs/ecr/HlbbGateway.vue.d.ts +18 -20
  91. package/dist/views/admin/terminal/tabs/ecr/KBankGateway.vue.d.ts +18 -20
  92. package/dist/views/admin/terminal/tabs/ecr/Maybank2Gateway.vue.d.ts +18 -20
  93. package/dist/views/admin/terminal/tabs/ecr/Maybank3Gateway.vue.d.ts +18 -20
  94. package/dist/views/admin/terminal/tabs/ecr/MaybankGateway.vue.d.ts +18 -20
  95. package/dist/views/admin/terminal/tabs/ecr/NetsGateway.vue.d.ts +18 -20
  96. package/dist/views/admin/terminal/tabs/ecr/OmaGateway.vue.d.ts +18 -20
  97. package/dist/views/admin/terminal/tabs/ecr/RevenueGateway.vue.d.ts +18 -20
  98. package/dist/views/admin/terminal/tabs/ecr/TerminalGateway.vue.d.ts +18 -20
  99. package/dist/views/admin/terminal/tabs/qr/PromptPayGateway.vue.d.ts +18 -20
  100. package/dist/views/admin/terminal/tabs/settings/KioskMode.vue.d.ts +18 -20
  101. package/dist/views/payout-account/PayoutAccountTable.vue.d.ts +40 -40
  102. package/package.json +2 -2
  103. package/dist/Terminal-C3Ye7IE1.js +0 -1135
@@ -0,0 +1,1158 @@
1
+ import { defineComponent as z, h as M, ref as _, onMounted as pe, watchEffect as Ce, Fragment as le, computed as U, openBlock as I, createElementBlock as J, createElementVNode as b, createTextVNode as re, toDisplayString as se, createVNode as P, resolveComponent as N, normalizeClass as we, withCtx as q, createBlock as x, createCommentVNode as $, useModel as ye, watch as Z, unref as L, mergeModels as ae, isRef as Ee } from "vue";
2
+ import { e as Se } from "./index-Cj7KUaM0.js";
3
+ import { h as Me } from "./moment-h96o7c8I.js";
4
+ import { u as Re } from "./index-BQijmIi-.js";
5
+ import { _ as be } from "./index.vue_vue_type_script_setup_true_lang-Cz6llWgj.js";
6
+ import { _ as Ae } from "./AdminLayout.vue_vue_type_script_setup_true_lang-0Mf1MhAL.js";
7
+ import { useSnackbar as j, useDialog as Pe } from "@feedmepos/ui-library";
8
+ import { t as K } from "./index-BTMbNw68.js";
9
+ import { c as ue } from "./clipboard-4jh1WteU.js";
10
+ import { useCoreStore as Te } from "@feedmepos/mf-common";
11
+ import { g as Ie } from "./grafana-CuJUDQ26.js";
12
+ import { u as X } from "./error-K1CakhA9.js";
13
+ import { z as ne, a as oe } from "./validator-CTlVogBQ.js";
14
+ import { _ as Ne } from "./AdminRestaurantSelector.vue_vue_type_script_setup_true_lang-Bnn4SxyN.js";
15
+ import { w as ie } from "./Modal-DB8M9o1T.js";
16
+ import { useRouter as _e } from "vue-router";
17
+ /*!
18
+ * qrcode.vue v3.8.0
19
+ * A Vue.js component to generate QRCode. Both support Vue 2 and Vue 3
20
+ * © 2017-PRESENT @scopewu(https://github.com/scopewu)
21
+ * MIT License.
22
+ */
23
+ var A = function() {
24
+ return A = Object.assign || function(f) {
25
+ for (var u, l = 1, v = arguments.length; l < v; l++) {
26
+ u = arguments[l];
27
+ for (var d in u) Object.prototype.hasOwnProperty.call(u, d) && (f[d] = u[d]);
28
+ }
29
+ return f;
30
+ }, A.apply(this, arguments);
31
+ };
32
+ var Q;
33
+ (function(o) {
34
+ var f = (
35
+ /** @class */
36
+ function() {
37
+ function r(e, t, a, n) {
38
+ if (this.version = e, this.errorCorrectionLevel = t, this.modules = [], this.isFunction = [], e < r.MIN_VERSION || e > r.MAX_VERSION)
39
+ throw new RangeError("Version value out of range");
40
+ if (n < -1 || n > 7)
41
+ throw new RangeError("Mask value out of range");
42
+ this.size = e * 4 + 17;
43
+ for (var i = [], s = 0; s < this.size; s++)
44
+ i.push(!1);
45
+ for (var s = 0; s < this.size; s++)
46
+ this.modules.push(i.slice()), this.isFunction.push(i.slice());
47
+ this.drawFunctionPatterns();
48
+ var g = this.addEccAndInterleave(a);
49
+ if (this.drawCodewords(g), n == -1)
50
+ for (var C = 1e9, s = 0; s < 8; s++) {
51
+ this.applyMask(s), this.drawFormatBits(s);
52
+ var w = this.getPenaltyScore();
53
+ w < C && (n = s, C = w), this.applyMask(s);
54
+ }
55
+ v(0 <= n && n <= 7), this.mask = n, this.applyMask(n), this.drawFormatBits(n), this.isFunction = [];
56
+ }
57
+ return r.encodeText = function(e, t) {
58
+ var a = o.QrSegment.makeSegments(e);
59
+ return r.encodeSegments(a, t);
60
+ }, r.encodeBinary = function(e, t) {
61
+ var a = o.QrSegment.makeBytes(e);
62
+ return r.encodeSegments([a], t);
63
+ }, r.encodeSegments = function(e, t, a, n, i, s) {
64
+ if (a === void 0 && (a = 1), n === void 0 && (n = 40), i === void 0 && (i = -1), s === void 0 && (s = !0), !(r.MIN_VERSION <= a && a <= n && n <= r.MAX_VERSION) || i < -1 || i > 7)
65
+ throw new RangeError("Invalid value");
66
+ var g, C;
67
+ for (g = a; ; g++) {
68
+ var w = r.getNumDataCodewords(g, t) * 8, E = d.getTotalBits(e, g);
69
+ if (E <= w) {
70
+ C = E;
71
+ break;
72
+ }
73
+ if (g >= n)
74
+ throw new RangeError("Data too long");
75
+ }
76
+ for (var p = 0, h = [r.Ecc.MEDIUM, r.Ecc.QUARTILE, r.Ecc.HIGH]; p < h.length; p++) {
77
+ var m = h[p];
78
+ s && C <= r.getNumDataCodewords(g, m) * 8 && (t = m);
79
+ }
80
+ for (var c = [], S = 0, y = e; S < y.length; S++) {
81
+ var R = y[S];
82
+ u(R.mode.modeBits, 4, c), u(R.numChars, R.mode.numCharCountBits(g), c);
83
+ for (var k = 0, T = R.getData(); k < T.length; k++) {
84
+ var W = T[k];
85
+ c.push(W);
86
+ }
87
+ }
88
+ v(c.length == C);
89
+ var V = r.getNumDataCodewords(g, t) * 8;
90
+ v(c.length <= V), u(0, Math.min(4, V - c.length), c), u(0, (8 - c.length % 8) % 8, c), v(c.length % 8 == 0);
91
+ for (var F = 236; c.length < V; F ^= 253)
92
+ u(F, 8, c);
93
+ for (var O = []; O.length * 8 < c.length; )
94
+ O.push(0);
95
+ return c.forEach(function(B, D) {
96
+ return O[D >>> 3] |= B << 7 - (D & 7);
97
+ }), new r(g, t, O, i);
98
+ }, r.prototype.getModule = function(e, t) {
99
+ return 0 <= e && e < this.size && 0 <= t && t < this.size && this.modules[t][e];
100
+ }, r.prototype.getModules = function() {
101
+ return this.modules;
102
+ }, r.prototype.drawFunctionPatterns = function() {
103
+ for (var e = 0; e < this.size; e++)
104
+ this.setFunctionModule(6, e, e % 2 == 0), this.setFunctionModule(e, 6, e % 2 == 0);
105
+ this.drawFinderPattern(3, 3), this.drawFinderPattern(this.size - 4, 3), this.drawFinderPattern(3, this.size - 4);
106
+ for (var t = this.getAlignmentPatternPositions(), a = t.length, e = 0; e < a; e++)
107
+ for (var n = 0; n < a; n++)
108
+ e == 0 && n == 0 || e == 0 && n == a - 1 || e == a - 1 && n == 0 || this.drawAlignmentPattern(t[e], t[n]);
109
+ this.drawFormatBits(0), this.drawVersion();
110
+ }, r.prototype.drawFormatBits = function(e) {
111
+ for (var t = this.errorCorrectionLevel.formatBits << 3 | e, a = t, n = 0; n < 10; n++)
112
+ a = a << 1 ^ (a >>> 9) * 1335;
113
+ var i = (t << 10 | a) ^ 21522;
114
+ v(i >>> 15 == 0);
115
+ for (var n = 0; n <= 5; n++)
116
+ this.setFunctionModule(8, n, l(i, n));
117
+ this.setFunctionModule(8, 7, l(i, 6)), this.setFunctionModule(8, 8, l(i, 7)), this.setFunctionModule(7, 8, l(i, 8));
118
+ for (var n = 9; n < 15; n++)
119
+ this.setFunctionModule(14 - n, 8, l(i, n));
120
+ for (var n = 0; n < 8; n++)
121
+ this.setFunctionModule(this.size - 1 - n, 8, l(i, n));
122
+ for (var n = 8; n < 15; n++)
123
+ this.setFunctionModule(8, this.size - 15 + n, l(i, n));
124
+ this.setFunctionModule(8, this.size - 8, !0);
125
+ }, r.prototype.drawVersion = function() {
126
+ if (!(this.version < 7)) {
127
+ for (var e = this.version, t = 0; t < 12; t++)
128
+ e = e << 1 ^ (e >>> 11) * 7973;
129
+ var a = this.version << 12 | e;
130
+ v(a >>> 18 == 0);
131
+ for (var t = 0; t < 18; t++) {
132
+ var n = l(a, t), i = this.size - 11 + t % 3, s = Math.floor(t / 3);
133
+ this.setFunctionModule(i, s, n), this.setFunctionModule(s, i, n);
134
+ }
135
+ }
136
+ }, r.prototype.drawFinderPattern = function(e, t) {
137
+ for (var a = -4; a <= 4; a++)
138
+ for (var n = -4; n <= 4; n++) {
139
+ var i = Math.max(Math.abs(n), Math.abs(a)), s = e + n, g = t + a;
140
+ 0 <= s && s < this.size && 0 <= g && g < this.size && this.setFunctionModule(s, g, i != 2 && i != 4);
141
+ }
142
+ }, r.prototype.drawAlignmentPattern = function(e, t) {
143
+ for (var a = -2; a <= 2; a++)
144
+ for (var n = -2; n <= 2; n++)
145
+ this.setFunctionModule(e + n, t + a, Math.max(Math.abs(n), Math.abs(a)) != 1);
146
+ }, r.prototype.setFunctionModule = function(e, t, a) {
147
+ this.modules[t][e] = a, this.isFunction[t][e] = !0;
148
+ }, r.prototype.addEccAndInterleave = function(e) {
149
+ var t = this.version, a = this.errorCorrectionLevel;
150
+ if (e.length != r.getNumDataCodewords(t, a))
151
+ throw new RangeError("Invalid argument");
152
+ for (var n = r.NUM_ERROR_CORRECTION_BLOCKS[a.ordinal][t], i = r.ECC_CODEWORDS_PER_BLOCK[a.ordinal][t], s = Math.floor(r.getNumRawDataModules(t) / 8), g = n - s % n, C = Math.floor(s / n), w = [], E = r.reedSolomonComputeDivisor(i), p = 0, h = 0; p < n; p++) {
153
+ var m = e.slice(h, h + C - i + (p < g ? 0 : 1));
154
+ h += m.length;
155
+ var c = r.reedSolomonComputeRemainder(m, E);
156
+ p < g && m.push(0), w.push(m.concat(c));
157
+ }
158
+ for (var S = [], y = function(R) {
159
+ w.forEach(function(k, T) {
160
+ (R != C - i || T >= g) && S.push(k[R]);
161
+ });
162
+ }, p = 0; p < w[0].length; p++)
163
+ y(p);
164
+ return v(S.length == s), S;
165
+ }, r.prototype.drawCodewords = function(e) {
166
+ if (e.length != Math.floor(r.getNumRawDataModules(this.version) / 8))
167
+ throw new RangeError("Invalid argument");
168
+ for (var t = 0, a = this.size - 1; a >= 1; a -= 2) {
169
+ a == 6 && (a = 5);
170
+ for (var n = 0; n < this.size; n++)
171
+ for (var i = 0; i < 2; i++) {
172
+ var s = a - i, g = (a + 1 & 2) == 0, C = g ? this.size - 1 - n : n;
173
+ !this.isFunction[C][s] && t < e.length * 8 && (this.modules[C][s] = l(e[t >>> 3], 7 - (t & 7)), t++);
174
+ }
175
+ }
176
+ v(t == e.length * 8);
177
+ }, r.prototype.applyMask = function(e) {
178
+ if (e < 0 || e > 7)
179
+ throw new RangeError("Mask value out of range");
180
+ for (var t = 0; t < this.size; t++)
181
+ for (var a = 0; a < this.size; a++) {
182
+ var n = void 0;
183
+ switch (e) {
184
+ case 0:
185
+ n = (a + t) % 2 == 0;
186
+ break;
187
+ case 1:
188
+ n = t % 2 == 0;
189
+ break;
190
+ case 2:
191
+ n = a % 3 == 0;
192
+ break;
193
+ case 3:
194
+ n = (a + t) % 3 == 0;
195
+ break;
196
+ case 4:
197
+ n = (Math.floor(a / 3) + Math.floor(t / 2)) % 2 == 0;
198
+ break;
199
+ case 5:
200
+ n = a * t % 2 + a * t % 3 == 0;
201
+ break;
202
+ case 6:
203
+ n = (a * t % 2 + a * t % 3) % 2 == 0;
204
+ break;
205
+ case 7:
206
+ n = ((a + t) % 2 + a * t % 3) % 2 == 0;
207
+ break;
208
+ default:
209
+ throw new Error("Unreachable");
210
+ }
211
+ !this.isFunction[t][a] && n && (this.modules[t][a] = !this.modules[t][a]);
212
+ }
213
+ }, r.prototype.getPenaltyScore = function() {
214
+ for (var e = 0, t = 0; t < this.size; t++) {
215
+ for (var a = !1, n = 0, i = [0, 0, 0, 0, 0, 0, 0], s = 0; s < this.size; s++)
216
+ this.modules[t][s] == a ? (n++, n == 5 ? e += r.PENALTY_N1 : n > 5 && e++) : (this.finderPenaltyAddHistory(n, i), a || (e += this.finderPenaltyCountPatterns(i) * r.PENALTY_N3), a = this.modules[t][s], n = 1);
217
+ e += this.finderPenaltyTerminateAndCount(a, n, i) * r.PENALTY_N3;
218
+ }
219
+ for (var s = 0; s < this.size; s++) {
220
+ for (var a = !1, g = 0, i = [0, 0, 0, 0, 0, 0, 0], t = 0; t < this.size; t++)
221
+ this.modules[t][s] == a ? (g++, g == 5 ? e += r.PENALTY_N1 : g > 5 && e++) : (this.finderPenaltyAddHistory(g, i), a || (e += this.finderPenaltyCountPatterns(i) * r.PENALTY_N3), a = this.modules[t][s], g = 1);
222
+ e += this.finderPenaltyTerminateAndCount(a, g, i) * r.PENALTY_N3;
223
+ }
224
+ for (var t = 0; t < this.size - 1; t++)
225
+ for (var s = 0; s < this.size - 1; s++) {
226
+ var C = this.modules[t][s];
227
+ C == this.modules[t][s + 1] && C == this.modules[t + 1][s] && C == this.modules[t + 1][s + 1] && (e += r.PENALTY_N2);
228
+ }
229
+ for (var w = 0, E = 0, p = this.modules; E < p.length; E++) {
230
+ var h = p[E];
231
+ w = h.reduce(function(S, y) {
232
+ return S + (y ? 1 : 0);
233
+ }, w);
234
+ }
235
+ var m = this.size * this.size, c = Math.ceil(Math.abs(w * 20 - m * 10) / m) - 1;
236
+ return v(0 <= c && c <= 9), e += c * r.PENALTY_N4, v(0 <= e && e <= 2568888), e;
237
+ }, r.prototype.getAlignmentPatternPositions = function() {
238
+ if (this.version == 1)
239
+ return [];
240
+ for (var e = Math.floor(this.version / 7) + 2, t = Math.floor((this.version * 8 + e * 3 + 5) / (e * 4 - 4)) * 2, a = [6], n = this.size - 7; a.length < e; n -= t)
241
+ a.splice(1, 0, n);
242
+ return a;
243
+ }, r.getNumRawDataModules = function(e) {
244
+ if (e < r.MIN_VERSION || e > r.MAX_VERSION)
245
+ throw new RangeError("Version number out of range");
246
+ var t = (16 * e + 128) * e + 64;
247
+ if (e >= 2) {
248
+ var a = Math.floor(e / 7) + 2;
249
+ t -= (25 * a - 10) * a - 55, e >= 7 && (t -= 36);
250
+ }
251
+ return v(208 <= t && t <= 29648), t;
252
+ }, r.getNumDataCodewords = function(e, t) {
253
+ return Math.floor(r.getNumRawDataModules(e) / 8) - r.ECC_CODEWORDS_PER_BLOCK[t.ordinal][e] * r.NUM_ERROR_CORRECTION_BLOCKS[t.ordinal][e];
254
+ }, r.reedSolomonComputeDivisor = function(e) {
255
+ if (e < 1 || e > 255)
256
+ throw new RangeError("Degree out of range");
257
+ for (var t = [], a = 0; a < e - 1; a++)
258
+ t.push(0);
259
+ t.push(1);
260
+ for (var n = 1, a = 0; a < e; a++) {
261
+ for (var i = 0; i < t.length; i++)
262
+ t[i] = r.reedSolomonMultiply(t[i], n), i + 1 < t.length && (t[i] ^= t[i + 1]);
263
+ n = r.reedSolomonMultiply(n, 2);
264
+ }
265
+ return t;
266
+ }, r.reedSolomonComputeRemainder = function(e, t) {
267
+ for (var a = t.map(function(C) {
268
+ return 0;
269
+ }), n = function(C) {
270
+ var w = C ^ a.shift();
271
+ a.push(0), t.forEach(function(E, p) {
272
+ return a[p] ^= r.reedSolomonMultiply(E, w);
273
+ });
274
+ }, i = 0, s = e; i < s.length; i++) {
275
+ var g = s[i];
276
+ n(g);
277
+ }
278
+ return a;
279
+ }, r.reedSolomonMultiply = function(e, t) {
280
+ if (e >>> 8 || t >>> 8)
281
+ throw new RangeError("Byte out of range");
282
+ for (var a = 0, n = 7; n >= 0; n--)
283
+ a = a << 1 ^ (a >>> 7) * 285, a ^= (t >>> n & 1) * e;
284
+ return v(a >>> 8 == 0), a;
285
+ }, r.prototype.finderPenaltyCountPatterns = function(e) {
286
+ var t = e[1];
287
+ v(t <= this.size * 3);
288
+ var a = t > 0 && e[2] == t && e[3] == t * 3 && e[4] == t && e[5] == t;
289
+ return (a && e[0] >= t * 4 && e[6] >= t ? 1 : 0) + (a && e[6] >= t * 4 && e[0] >= t ? 1 : 0);
290
+ }, r.prototype.finderPenaltyTerminateAndCount = function(e, t, a) {
291
+ return e && (this.finderPenaltyAddHistory(t, a), t = 0), t += this.size, this.finderPenaltyAddHistory(t, a), this.finderPenaltyCountPatterns(a);
292
+ }, r.prototype.finderPenaltyAddHistory = function(e, t) {
293
+ t[0] == 0 && (e += this.size), t.pop(), t.unshift(e);
294
+ }, r.MIN_VERSION = 1, r.MAX_VERSION = 40, r.PENALTY_N1 = 3, r.PENALTY_N2 = 3, r.PENALTY_N3 = 40, r.PENALTY_N4 = 10, r.ECC_CODEWORDS_PER_BLOCK = [
295
+ // Version: (note that index 0 is for padding, and is set to an illegal value)
296
+ //0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level
297
+ [-1, 7, 10, 15, 20, 26, 18, 20, 24, 30, 18, 20, 24, 26, 30, 22, 24, 28, 30, 28, 28, 28, 28, 30, 30, 26, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],
298
+ // Low
299
+ [-1, 10, 16, 26, 18, 24, 16, 18, 22, 22, 26, 30, 22, 22, 24, 24, 28, 28, 26, 26, 26, 26, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28],
300
+ // Medium
301
+ [-1, 13, 22, 18, 26, 18, 24, 18, 22, 20, 24, 28, 26, 24, 20, 30, 24, 28, 28, 26, 30, 28, 30, 30, 30, 30, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30],
302
+ // Quartile
303
+ [-1, 17, 28, 22, 16, 22, 28, 26, 26, 24, 28, 24, 28, 22, 24, 24, 30, 28, 28, 26, 28, 30, 24, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30]
304
+ // High
305
+ ], r.NUM_ERROR_CORRECTION_BLOCKS = [
306
+ // Version: (note that index 0 is for padding, and is set to an illegal value)
307
+ //0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 Error correction level
308
+ [-1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 4, 4, 6, 6, 6, 6, 7, 8, 8, 9, 9, 10, 12, 12, 12, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 22, 24, 25],
309
+ // Low
310
+ [-1, 1, 1, 1, 2, 2, 4, 4, 4, 5, 5, 5, 8, 9, 9, 10, 10, 11, 13, 14, 16, 17, 17, 18, 20, 21, 23, 25, 26, 28, 29, 31, 33, 35, 37, 38, 40, 43, 45, 47, 49],
311
+ // Medium
312
+ [-1, 1, 1, 2, 2, 4, 4, 6, 6, 8, 8, 8, 10, 12, 16, 12, 17, 16, 18, 21, 20, 23, 23, 25, 27, 29, 34, 34, 35, 38, 40, 43, 45, 48, 51, 53, 56, 59, 62, 65, 68],
313
+ // Quartile
314
+ [-1, 1, 1, 2, 4, 4, 4, 5, 6, 8, 8, 11, 11, 16, 16, 18, 16, 19, 21, 25, 25, 25, 34, 30, 32, 35, 37, 40, 42, 45, 48, 51, 54, 57, 60, 63, 66, 70, 74, 77, 81]
315
+ // High
316
+ ], r;
317
+ }()
318
+ );
319
+ o.QrCode = f;
320
+ function u(r, e, t) {
321
+ if (e < 0 || e > 31 || r >>> e)
322
+ throw new RangeError("Value out of range");
323
+ for (var a = e - 1; a >= 0; a--)
324
+ t.push(r >>> a & 1);
325
+ }
326
+ function l(r, e) {
327
+ return (r >>> e & 1) != 0;
328
+ }
329
+ function v(r) {
330
+ if (!r)
331
+ throw new Error("Assertion error");
332
+ }
333
+ var d = (
334
+ /** @class */
335
+ function() {
336
+ function r(e, t, a) {
337
+ if (this.mode = e, this.numChars = t, this.bitData = a, t < 0)
338
+ throw new RangeError("Invalid argument");
339
+ this.bitData = a.slice();
340
+ }
341
+ return r.makeBytes = function(e) {
342
+ for (var t = [], a = 0, n = e; a < n.length; a++) {
343
+ var i = n[a];
344
+ u(i, 8, t);
345
+ }
346
+ return new r(r.Mode.BYTE, e.length, t);
347
+ }, r.makeNumeric = function(e) {
348
+ if (!r.isNumeric(e))
349
+ throw new RangeError("String contains non-numeric characters");
350
+ for (var t = [], a = 0; a < e.length; ) {
351
+ var n = Math.min(e.length - a, 3);
352
+ u(parseInt(e.substring(a, a + n), 10), n * 3 + 1, t), a += n;
353
+ }
354
+ return new r(r.Mode.NUMERIC, e.length, t);
355
+ }, r.makeAlphanumeric = function(e) {
356
+ if (!r.isAlphanumeric(e))
357
+ throw new RangeError("String contains unencodable characters in alphanumeric mode");
358
+ var t = [], a;
359
+ for (a = 0; a + 2 <= e.length; a += 2) {
360
+ var n = r.ALPHANUMERIC_CHARSET.indexOf(e.charAt(a)) * 45;
361
+ n += r.ALPHANUMERIC_CHARSET.indexOf(e.charAt(a + 1)), u(n, 11, t);
362
+ }
363
+ return a < e.length && u(r.ALPHANUMERIC_CHARSET.indexOf(e.charAt(a)), 6, t), new r(r.Mode.ALPHANUMERIC, e.length, t);
364
+ }, r.makeSegments = function(e) {
365
+ return e == "" ? [] : r.isNumeric(e) ? [r.makeNumeric(e)] : r.isAlphanumeric(e) ? [r.makeAlphanumeric(e)] : [r.makeBytes(r.toUtf8ByteArray(e))];
366
+ }, r.makeEci = function(e) {
367
+ var t = [];
368
+ if (e < 0)
369
+ throw new RangeError("ECI assignment value out of range");
370
+ if (e < 128)
371
+ u(e, 8, t);
372
+ else if (e < 16384)
373
+ u(2, 2, t), u(e, 14, t);
374
+ else if (e < 1e6)
375
+ u(6, 3, t), u(e, 21, t);
376
+ else
377
+ throw new RangeError("ECI assignment value out of range");
378
+ return new r(r.Mode.ECI, 0, t);
379
+ }, r.isNumeric = function(e) {
380
+ return r.NUMERIC_REGEX.test(e);
381
+ }, r.isAlphanumeric = function(e) {
382
+ return r.ALPHANUMERIC_REGEX.test(e);
383
+ }, r.prototype.getData = function() {
384
+ return this.bitData.slice();
385
+ }, r.getTotalBits = function(e, t) {
386
+ for (var a = 0, n = 0, i = e; n < i.length; n++) {
387
+ var s = i[n], g = s.mode.numCharCountBits(t);
388
+ if (s.numChars >= 1 << g)
389
+ return 1 / 0;
390
+ a += 4 + g + s.bitData.length;
391
+ }
392
+ return a;
393
+ }, r.toUtf8ByteArray = function(e) {
394
+ e = encodeURI(e);
395
+ for (var t = [], a = 0; a < e.length; a++)
396
+ e.charAt(a) != "%" ? t.push(e.charCodeAt(a)) : (t.push(parseInt(e.substring(a + 1, a + 3), 16)), a += 2);
397
+ return t;
398
+ }, r.NUMERIC_REGEX = /^[0-9]*$/, r.ALPHANUMERIC_REGEX = /^[A-Z0-9 $%*+.\/:-]*$/, r.ALPHANUMERIC_CHARSET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:", r;
399
+ }()
400
+ );
401
+ o.QrSegment = d;
402
+ })(Q || (Q = {}));
403
+ (function(o) {
404
+ (function(f) {
405
+ var u = (
406
+ /** @class */
407
+ function() {
408
+ function l(v, d) {
409
+ this.ordinal = v, this.formatBits = d;
410
+ }
411
+ return l.LOW = new l(0, 1), l.MEDIUM = new l(1, 0), l.QUARTILE = new l(2, 3), l.HIGH = new l(3, 2), l;
412
+ }()
413
+ );
414
+ f.Ecc = u;
415
+ })(o.QrCode || (o.QrCode = {}));
416
+ })(Q || (Q = {}));
417
+ (function(o) {
418
+ (function(f) {
419
+ var u = (
420
+ /** @class */
421
+ function() {
422
+ function l(v, d) {
423
+ this.modeBits = v, this.numBitsCharCount = d;
424
+ }
425
+ return l.prototype.numCharCountBits = function(v) {
426
+ return this.numBitsCharCount[Math.floor((v + 7) / 17)];
427
+ }, l.NUMERIC = new l(1, [10, 12, 14]), l.ALPHANUMERIC = new l(2, [9, 11, 13]), l.BYTE = new l(4, [8, 16, 16]), l.KANJI = new l(8, [8, 10, 12]), l.ECI = new l(7, [0, 0, 0]), l;
428
+ }()
429
+ );
430
+ f.Mode = u;
431
+ })(o.QrSegment || (o.QrSegment = {}));
432
+ })(Q || (Q = {}));
433
+ var H = Q, de = "L", ke = 100, ce = 0, Fe = 0.1, Be = 2, fe = {
434
+ L: H.QrCode.Ecc.LOW,
435
+ M: H.QrCode.Ecc.MEDIUM,
436
+ Q: H.QrCode.Ecc.QUARTILE,
437
+ H: H.QrCode.Ecc.HIGH
438
+ }, Le = function() {
439
+ try {
440
+ new Path2D().addPath(new Path2D());
441
+ } catch {
442
+ return !1;
443
+ }
444
+ return !0;
445
+ }();
446
+ function ve(o) {
447
+ return o in fe;
448
+ }
449
+ function he(o, f) {
450
+ f === void 0 && (f = 0);
451
+ var u = "";
452
+ return o.forEach(function(l, v) {
453
+ var d = null;
454
+ l.forEach(function(r, e) {
455
+ if (!r && d !== null) {
456
+ u += "M".concat(d + f, " ").concat(v + f, "h").concat(e - d, "v1H").concat(d + f, "z"), d = null;
457
+ return;
458
+ }
459
+ if (e === l.length - 1) {
460
+ if (!r)
461
+ return;
462
+ d === null ? u += "M".concat(e + f, ",").concat(v + f, " h1v1H").concat(e + f, "z") : u += "M".concat(d + f, ",").concat(v + f, " h").concat(e + 1 - d, "v1H").concat(d + f, "z");
463
+ return;
464
+ }
465
+ r && d === null && (d = e);
466
+ });
467
+ }), u;
468
+ }
469
+ function ze(o, f, u, l) {
470
+ var v = l.width, d = l.height, r = l.x, e = l.y, t = o.length + u * 2, a = Math.floor(f * Fe), n = t / f, i = (v || a) * n, s = (d || a) * n, g = r == null ? o.length / 2 - i / 2 : r * n, C = e == null ? o.length / 2 - s / 2 : e * n, w = (l.borderRadius || 0) * n, E = null;
471
+ if (l.excavate) {
472
+ var p = Math.floor(g), h = Math.floor(C), m = Math.ceil(i + g - p), c = Math.ceil(s + C - h);
473
+ E = { x: p, y: h, w: m, h: c };
474
+ }
475
+ return { x: g, y: C, h: s, w: i, borderRadius: w, excavation: E };
476
+ }
477
+ function me(o) {
478
+ var f = U(function() {
479
+ var e;
480
+ return ((e = o.margin) !== null && e !== void 0 ? e : ce) >>> 0;
481
+ }), u = U(function() {
482
+ var e = ve(o.level) ? o.level : de;
483
+ return H.QrCode.encodeText(o.value, fe[e]).getModules();
484
+ }), l = U(function() {
485
+ return u.value.length + f.value * 2;
486
+ }), v = U(function() {
487
+ return he(u.value, f.value);
488
+ }), d = U(function() {
489
+ if (!o.imageSettings.src)
490
+ return { x: 0, y: 0, width: 0, height: 0, borderRadius: 0 };
491
+ var e = ze(u.value, o.size, f.value, o.imageSettings);
492
+ return {
493
+ x: e.x + f.value,
494
+ y: e.y + f.value,
495
+ width: e.w,
496
+ height: e.h,
497
+ borderRadius: e.borderRadius
498
+ };
499
+ }), r = U(function() {
500
+ if (!o.imageSettings.excavate || !o.imageSettings.src)
501
+ return null;
502
+ var e = Be / (o.size / l.value);
503
+ return {
504
+ x: d.value.x - e,
505
+ y: d.value.y - e,
506
+ width: d.value.width + e * 2,
507
+ height: d.value.height + e * 2,
508
+ borderRadius: d.value.borderRadius
509
+ };
510
+ });
511
+ return { margin: f, numCells: l, cells: u, fgPath: v, imageProps: d, imageBorderProps: r };
512
+ }
513
+ var ee = {
514
+ value: {
515
+ type: String,
516
+ required: !0,
517
+ default: ""
518
+ },
519
+ size: {
520
+ type: Number,
521
+ default: ke
522
+ },
523
+ level: {
524
+ type: String,
525
+ default: de,
526
+ validator: function(o) {
527
+ return ve(o);
528
+ }
529
+ },
530
+ background: {
531
+ type: String,
532
+ default: "#fff"
533
+ },
534
+ foreground: {
535
+ type: String,
536
+ default: "#000"
537
+ },
538
+ margin: {
539
+ type: Number,
540
+ required: !1,
541
+ default: ce
542
+ },
543
+ imageSettings: {
544
+ type: Object,
545
+ required: !1,
546
+ default: function() {
547
+ return {};
548
+ }
549
+ },
550
+ gradient: {
551
+ type: Boolean,
552
+ required: !1,
553
+ default: !1
554
+ },
555
+ gradientType: {
556
+ type: String,
557
+ required: !1,
558
+ default: "linear",
559
+ validator: function(o) {
560
+ return ["linear", "radial"].indexOf(o) > -1;
561
+ }
562
+ },
563
+ gradientStartColor: {
564
+ type: String,
565
+ required: !1,
566
+ default: "#000"
567
+ },
568
+ gradientEndColor: {
569
+ type: String,
570
+ required: !1,
571
+ default: "#fff"
572
+ }
573
+ }, Oe = A(A({}, ee), { renderAs: {
574
+ type: String,
575
+ required: !1,
576
+ default: "canvas",
577
+ validator: function(o) {
578
+ return ["canvas", "svg"].indexOf(o) > -1;
579
+ }
580
+ } }), De = z({
581
+ name: "QRCodeSvg",
582
+ props: ee,
583
+ setup: function(o) {
584
+ var f = me(o), u = f.numCells, l = f.fgPath, v = f.imageProps, d = f.imageBorderProps, r = "qrcode.vue-gradient", e = function() {
585
+ if (!o.gradient)
586
+ return null;
587
+ var n = o.gradientType === "linear" ? {
588
+ x1: "0%",
589
+ y1: "0%",
590
+ x2: "100%",
591
+ y2: "100%"
592
+ } : {
593
+ cx: "50%",
594
+ cy: "50%",
595
+ r: "50%",
596
+ fx: "50%",
597
+ fy: "50%"
598
+ };
599
+ return M(o.gradientType === "linear" ? "linearGradient" : "radialGradient", A({ id: r }, n), [
600
+ M("stop", {
601
+ offset: "0%",
602
+ style: { stopColor: o.gradientStartColor }
603
+ }),
604
+ M("stop", {
605
+ offset: "100%",
606
+ style: { stopColor: o.gradientEndColor }
607
+ })
608
+ ]);
609
+ }, t = "qrcode.vue-logo-clip-path", a = function() {
610
+ var n = v.value.borderRadius;
611
+ return !o.imageSettings.src || n <= 0 ? null : M("clipPath", { id: t }, [
612
+ M("rect", {
613
+ x: v.value.x,
614
+ y: v.value.y,
615
+ width: v.value.width,
616
+ height: v.value.height,
617
+ rx: n,
618
+ ry: n
619
+ })
620
+ ]);
621
+ };
622
+ return function() {
623
+ return M("svg", {
624
+ width: o.size,
625
+ height: o.size,
626
+ "shape-rendering": "crispEdges",
627
+ xmlns: "http://www.w3.org/2000/svg",
628
+ viewBox: "0 0 ".concat(u.value, " ").concat(u.value)
629
+ }, [
630
+ M("defs", {}, [e(), a()]),
631
+ M("rect", {
632
+ width: "100%",
633
+ height: "100%",
634
+ fill: o.background
635
+ }),
636
+ M("path", {
637
+ fill: o.gradient ? "url(#".concat(r, ")") : o.foreground,
638
+ d: l.value
639
+ }),
640
+ d.value && M("rect", {
641
+ x: d.value.x,
642
+ y: d.value.y,
643
+ width: d.value.width,
644
+ height: d.value.height,
645
+ fill: o.background,
646
+ rx: d.value.borderRadius,
647
+ ry: d.value.borderRadius
648
+ }),
649
+ o.imageSettings.src && M("image", A(A({ href: o.imageSettings.src }, v.value), v.value.borderRadius > 0 ? { "clip-path": "url(#".concat(t, ")") } : {}))
650
+ ]);
651
+ };
652
+ }
653
+ }), Ue = z({
654
+ name: "QRCodeCanvas",
655
+ props: ee,
656
+ setup: function(o, f) {
657
+ var u = me(o), l = u.margin, v = u.cells, d = u.numCells, r = u.imageProps, e = u.imageBorderProps, t = _(null), a = _(null), n = function() {
658
+ var s = o.size, g = o.background, C = o.foreground, w = o.gradient, E = o.gradientType, p = o.gradientStartColor, h = o.gradientEndColor, m = t.value;
659
+ if (m) {
660
+ var c = m.getContext("2d");
661
+ if (c) {
662
+ var S = v.value, y = a.value, R = typeof window < "u" && window.devicePixelRatio || 1, k = s / d.value * R;
663
+ if (m.height = m.width = s * R, c.scale(k, k), c.fillStyle = g, c.fillRect(0, 0, d.value, d.value), w) {
664
+ var T = void 0;
665
+ E === "linear" ? T = c.createLinearGradient(0, 0, d.value, d.value) : T = c.createRadialGradient(d.value / 2, d.value / 2, 0, d.value / 2, d.value / 2, d.value / 2), T.addColorStop(0, p), T.addColorStop(1, h), c.fillStyle = T;
666
+ } else
667
+ c.fillStyle = C;
668
+ Le ? c.fill(new Path2D(he(S, l.value))) : S.forEach(function(B, D) {
669
+ B.forEach(function(G, Y) {
670
+ G && c.fillRect(Y + l.value, D + l.value, 1, 1);
671
+ });
672
+ });
673
+ var W = o.imageSettings.src && y && y.naturalWidth !== 0 && y.naturalHeight !== 0;
674
+ if (W) {
675
+ var V = function(B, D, G, Y, te, ge) {
676
+ B.beginPath(), B.roundRect ? B.roundRect(D, G, Y, te, ge) : B.rect(D, G, Y, te);
677
+ };
678
+ if (e.value) {
679
+ var F = e.value;
680
+ c.fillStyle = o.background, V(c, F.x, F.y, F.width, F.height, F.borderRadius), c.fill();
681
+ }
682
+ var O = r.value.borderRadius;
683
+ O > 0 ? (c.save(), V(c, r.value.x, r.value.y, r.value.width, r.value.height, O), c.clip(), c.drawImage(y, r.value.x, r.value.y, r.value.width, r.value.height), c.restore()) : c.drawImage(y, r.value.x, r.value.y, r.value.width, r.value.height);
684
+ }
685
+ }
686
+ }
687
+ };
688
+ pe(n), Ce(n);
689
+ var i = f.attrs.style;
690
+ return function() {
691
+ return M(le, [
692
+ M("canvas", A(A({}, f.attrs), { ref: t, style: A(A({}, i), { width: "".concat(o.size, "px"), height: "".concat(o.size, "px") }) })),
693
+ o.imageSettings.src && M("img", {
694
+ ref: a,
695
+ src: o.imageSettings.src,
696
+ style: { display: "none" },
697
+ onLoad: n
698
+ })
699
+ ]);
700
+ };
701
+ }
702
+ }), xe = z({
703
+ name: "Qrcode",
704
+ render: function() {
705
+ var o = this.$props, f = o.renderAs, u = o.value, l = o.size, v = o.margin, d = o.level, r = o.background, e = o.foreground, t = o.imageSettings, a = o.gradient, n = o.gradientType, i = o.gradientStartColor, s = o.gradientEndColor;
706
+ return M(f === "svg" ? De : Ue, {
707
+ value: u,
708
+ size: l,
709
+ margin: v,
710
+ level: d,
711
+ background: r,
712
+ foreground: e,
713
+ imageSettings: t,
714
+ gradient: a,
715
+ gradientType: n,
716
+ gradientStartColor: i,
717
+ gradientEndColor: s
718
+ });
719
+ },
720
+ props: Oe
721
+ });
722
+ const Qe = { class: "t-caption" }, Ve = { class: "t-caption" }, Ke = { class: "my-6 justify-items-center" }, He = /* @__PURE__ */ z({
723
+ __name: "TerminalBindCodeDialog",
724
+ props: {
725
+ code: {
726
+ type: String,
727
+ required: !0
728
+ }
729
+ },
730
+ setup(o) {
731
+ const f = o, u = j(), l = Te();
732
+ function v() {
733
+ try {
734
+ ue(f.code), u.open({ title: "Text copied to clipboard." }, 1e3);
735
+ } catch {
736
+ u.open({ title: "Clipboard API incompatible." }, 1e3);
737
+ }
738
+ }
739
+ const d = l.namespace.value === "dev" ? "development" : "production", r = U(() => `${d},${(l.currentCountry.value ?? Se.F_COUNTRY.enum.MY).toLowerCase()},${f.code}`);
740
+ return (e, t) => (I(), J(le, null, [
741
+ b("div", Qe, [
742
+ t[1] || (t[1] = re(" Enter the binding code below on your device to link it with this terminal and apply the configuration. ", -1)),
743
+ b("div", {
744
+ class: "my-6 text-center fm-typo-en-title-md-800 tracking-[0.3rem] cursor-pointer hover:text-fm-color-neutral-gray-300",
745
+ onClick: t[0] || (t[0] = (a) => {
746
+ a.stopPropagation(), v();
747
+ })
748
+ }, se(o.code), 1)
749
+ ]),
750
+ t[3] || (t[3] = b("div", { class: "flex items-center my-4" }, [
751
+ b("div", { class: "flex-grow border-t border-gray-300" }),
752
+ b("span", { class: "px-4 text-gray-500 text-sm font-medium" }, "OR"),
753
+ b("div", { class: "flex-grow border-t border-gray-300" })
754
+ ], -1)),
755
+ b("div", Ve, [
756
+ t[2] || (t[2] = re(" Scan the binding code below on your device to link it with this terminal and apply the configuration. ", -1)),
757
+ b("div", Ke, [
758
+ P(xe, { value: r.value }, null, 8, ["value"])
759
+ ])
760
+ ])
761
+ ], 64));
762
+ }
763
+ }), $e = /* @__PURE__ */ z({
764
+ __name: "ID",
765
+ props: {
766
+ row: {},
767
+ data: {}
768
+ },
769
+ setup(o) {
770
+ const f = o, u = j();
771
+ function l() {
772
+ return f.row.original.status === "Active" ? "!w-[16px] !h-[16px] bg-green-400" : "!w-[16px] !h-[16px] bg-red-400";
773
+ }
774
+ function v() {
775
+ try {
776
+ ue(f.data), u.open({ title: "Text copied to clipboard." }, 1e3);
777
+ } catch {
778
+ u.open({ title: "Clipboard API incompatible." }, 1e3);
779
+ }
780
+ f.data;
781
+ }
782
+ return (d, r) => {
783
+ const e = N("FmBadge");
784
+ return I(), J("div", {
785
+ onClick: r[0] || (r[0] = (t) => {
786
+ t.stopPropagation(), v();
787
+ })
788
+ }, [
789
+ P(e, {
790
+ inline: "",
791
+ class: we(l())
792
+ }, {
793
+ default: q(() => [
794
+ b("div", null, se(o.data), 1)
795
+ ]),
796
+ _: 1
797
+ }, 8, ["class"])
798
+ ]);
799
+ };
800
+ }
801
+ }), Ge = { class: "flex" }, Ye = /* @__PURE__ */ z({
802
+ __name: "Actions",
803
+ props: {
804
+ data: {}
805
+ },
806
+ emits: ["link", "unlink", "edit", "delete"],
807
+ setup(o, { emit: f }) {
808
+ const u = o, l = f;
809
+ function v() {
810
+ const d = Ie([
811
+ {
812
+ type: "span",
813
+ queryKey: "terminal.id",
814
+ queryValue: u.data._id
815
+ }
816
+ ]);
817
+ window.open(d, "_blank");
818
+ }
819
+ return (d, r) => {
820
+ const e = N("FmButton");
821
+ return I(), J("div", Ge, [
822
+ P(e, {
823
+ variant: "plain",
824
+ "prepend-icon": "history",
825
+ onClick: r[0] || (r[0] = (t) => {
826
+ t.stopPropagation(), v();
827
+ })
828
+ }),
829
+ o.data.deviceType === "TERMINAL" && !o.data.deviceId ? (I(), x(e, {
830
+ key: 0,
831
+ variant: "plain",
832
+ "prepend-icon": "link",
833
+ onClick: r[1] || (r[1] = (t) => {
834
+ t.stopPropagation(), l("link");
835
+ })
836
+ })) : $("", !0),
837
+ o.data.deviceType === "TERMINAL" && o.data.deviceId ? (I(), x(e, {
838
+ key: 1,
839
+ variant: "plain",
840
+ "prepend-icon": "link_off",
841
+ onClick: r[2] || (r[2] = (t) => {
842
+ t.stopPropagation(), l("unlink");
843
+ })
844
+ })) : $("", !0),
845
+ P(e, {
846
+ variant: "plain",
847
+ "prepend-icon": "edit",
848
+ onClick: r[3] || (r[3] = (t) => {
849
+ t.stopPropagation(), l("edit");
850
+ })
851
+ }),
852
+ P(e, {
853
+ variant: "plain",
854
+ "prepend-icon": "delete",
855
+ onClick: r[4] || (r[4] = (t) => {
856
+ t.stopPropagation(), l("delete");
857
+ })
858
+ })
859
+ ]);
860
+ };
861
+ }
862
+ }), qe = /* @__PURE__ */ z({
863
+ __name: "TerminalSideSheet",
864
+ props: /* @__PURE__ */ ae({
865
+ terminal: {
866
+ type: Object
867
+ }
868
+ }, {
869
+ modelValue: { type: Boolean, default: !1 },
870
+ modelModifiers: {}
871
+ }),
872
+ emits: /* @__PURE__ */ ae(["submit"], ["update:modelValue"]),
873
+ setup(o, { emit: f }) {
874
+ const u = o, l = f, v = ye(o, "modelValue"), d = _(), r = _(""), e = _(""), t = _(!1);
875
+ Z(v, (n) => {
876
+ var i, s, g;
877
+ n && (r.value = ((i = u.terminal) == null ? void 0 : i.name) ?? "", e.value = ((s = u.terminal) == null ? void 0 : s.referenceId) ?? "", t.value = ((g = u.terminal) == null ? void 0 : g.status) === "Active");
878
+ });
879
+ function a() {
880
+ l("submit", {
881
+ name: r.value,
882
+ referenceId: e.value,
883
+ status: t.value ? "Active" : "Inactive"
884
+ }), v.value = !1;
885
+ }
886
+ return (n, i) => {
887
+ const s = N("FmTextField"), g = N("FmSwitch"), C = N("FmButton"), w = N("FmForm"), E = N("FmSideSheet");
888
+ return I(), x(E, {
889
+ modelValue: v.value,
890
+ "onUpdate:modelValue": i[3] || (i[3] = (p) => v.value = p),
891
+ header: u.terminal ? "Update Terminal" : "Create New Terminal",
892
+ "close-button": ""
893
+ }, {
894
+ default: q(() => [
895
+ P(w, {
896
+ ref: d.value,
897
+ class: "flex flex-col gap-16 px-4 py-6",
898
+ onValidationSuccess: a
899
+ }, {
900
+ default: q(() => [
901
+ u.terminal ? $("", !0) : (I(), x(Ne, {
902
+ key: 0,
903
+ modelValue: e.value,
904
+ "onUpdate:modelValue": i[0] || (i[0] = (p) => e.value = p),
905
+ label: "Restaurant",
906
+ "label-mark": "required",
907
+ placeholder: "Select restaurant",
908
+ "search-placeholder": "Search restaurants",
909
+ rules: L(ne)(L(oe).string().min(1, "Restaurant is required"))
910
+ }, null, 8, ["modelValue", "rules"])),
911
+ P(s, {
912
+ modelValue: r.value,
913
+ "onUpdate:modelValue": i[1] || (i[1] = (p) => r.value = p),
914
+ label: "Terminal Name",
915
+ rules: L(ne)(L(oe).string().min(1))
916
+ }, null, 8, ["modelValue", "rules"]),
917
+ u.terminal ? (I(), x(g, {
918
+ key: 1,
919
+ modelValue: t.value,
920
+ "onUpdate:modelValue": i[2] || (i[2] = (p) => t.value = p),
921
+ label: "Status"
922
+ }, null, 8, ["modelValue"])) : $("", !0),
923
+ P(C, {
924
+ type: "submit",
925
+ label: u.terminal ? "Update" : "Create"
926
+ }, null, 8, ["label"])
927
+ ]),
928
+ _: 1
929
+ }, 512)
930
+ ]),
931
+ _: 1
932
+ }, 8, ["modelValue", "header"]);
933
+ };
934
+ }
935
+ }), We = { class: "flex justify-between mb-6 items-center" }, Xe = { class: "flex space-x-4" }, Ze = { class: "flex space-x-4" }, ht = /* @__PURE__ */ z({
936
+ __name: "Terminal",
937
+ props: {
938
+ type: {}
939
+ },
940
+ setup(o) {
941
+ const f = o, u = _(), { searchKey: l, deviceType: v } = Re({
942
+ searchKey: "",
943
+ deviceType: void 0
944
+ });
945
+ Z(v, () => {
946
+ var h;
947
+ return (h = u.value) == null ? void 0 : h.reset();
948
+ });
949
+ let d;
950
+ Z(l, async () => {
951
+ d && clearTimeout(d), d = setTimeout(
952
+ () => {
953
+ var h;
954
+ return (h = u.value) == null ? void 0 : h.reset();
955
+ },
956
+ 700
957
+ );
958
+ });
959
+ const r = _e(), e = Pe(), t = j();
960
+ async function a(h) {
961
+ ie(
962
+ e,
963
+ "Terminal Unbind",
964
+ "Are you sure to unbind terminal from device? This action cannot be revert and device will be logged out!",
965
+ async () => {
966
+ var m;
967
+ try {
968
+ await K.unbind(h), (m = u.value) == null || m.reset(), t.open({
969
+ type: "success",
970
+ message: "Terminal unbind successfully"
971
+ });
972
+ } catch (c) {
973
+ t.open({
974
+ type: "error",
975
+ title: "Error occurs when unbind terminal",
976
+ message: X(c)
977
+ });
978
+ }
979
+ }
980
+ );
981
+ }
982
+ async function n(h) {
983
+ const m = await K.getBindCode(h);
984
+ e.open({
985
+ title: "Terminal Binding",
986
+ closeButton: !0,
987
+ overlay: !0,
988
+ contentComponent: He,
989
+ contentComponentProps: { code: m }
990
+ });
991
+ }
992
+ const i = _(!1), s = _();
993
+ function g(h) {
994
+ s.value = h, i.value = !0;
995
+ }
996
+ async function C(h) {
997
+ var c;
998
+ const m = s.value;
999
+ try {
1000
+ await (m ? K.updateById(m._id, { ...h, ecrs: m.ecrs ?? [], gateways: m.gateways ?? [] }) : K.create(h)), (c = u.value) == null || c.reset(), t.open({
1001
+ type: "success",
1002
+ message: m ? "Terminal udpated successfully" : "Terminal created successfully."
1003
+ });
1004
+ } catch (S) {
1005
+ t.open({
1006
+ type: "error",
1007
+ title: "Error occurs when create terminal",
1008
+ message: X(S)
1009
+ });
1010
+ }
1011
+ }
1012
+ async function w(h) {
1013
+ ie(
1014
+ e,
1015
+ "Delete Terminal",
1016
+ "Are you sure to delete terminal? This action cannot be revert and device will be logged out!",
1017
+ async () => {
1018
+ var m;
1019
+ try {
1020
+ await K.delete(h), (m = u.value) == null || m.reset(), t.open({
1021
+ type: "success",
1022
+ message: "Terminal delete successfully"
1023
+ });
1024
+ } catch (c) {
1025
+ t.open({
1026
+ type: "error",
1027
+ title: "Error occurs when delete terminal",
1028
+ message: X(c)
1029
+ });
1030
+ }
1031
+ }
1032
+ );
1033
+ }
1034
+ const E = function(h) {
1035
+ var c, S;
1036
+ let m = h.name;
1037
+ return h.deviceType === "POS" && ((c = h.name) != null && c.includes("@")) && (m = h.restaurant.profile.name), h.deviceType === "KIOSK" && ((S = h.name) != null && S.includes("-")) && (m = h.restaurant.profile.name), {
1038
+ id: h._id,
1039
+ status: h.status,
1040
+ referenceId: h.referenceId,
1041
+ name: m,
1042
+ deviceId: h.deviceId,
1043
+ deviceType: h.deviceType,
1044
+ updatedAt: Me(h.updatedAt).format("YYYY-MM-DD HH:mm:ss"),
1045
+ posVersion: h.restaurant.posVersion,
1046
+ gateways: h.gateways,
1047
+ ecrs: h.ecrs
1048
+ };
1049
+ }, p = [
1050
+ {
1051
+ accessorKey: "id",
1052
+ header: () => "Terminal ID",
1053
+ meta: {
1054
+ textAlign: "right"
1055
+ },
1056
+ cell: ({ cell: h, row: m }) => M($e, { row: m, data: h.getValue() })
1057
+ },
1058
+ {
1059
+ accessorKey: "name",
1060
+ header: () => "Name",
1061
+ meta: {
1062
+ textAlign: "left"
1063
+ }
1064
+ },
1065
+ {
1066
+ accessorKey: "posVersion",
1067
+ header: () => "POS Version",
1068
+ meta: {
1069
+ textAlign: "left"
1070
+ }
1071
+ },
1072
+ {
1073
+ accessorKey: "deviceId",
1074
+ header: () => "Device ID",
1075
+ meta: {
1076
+ textAlign: "left"
1077
+ }
1078
+ },
1079
+ {
1080
+ accessorKey: "updatedAt",
1081
+ header: () => "Last Updated",
1082
+ meta: {
1083
+ textAlign: "left"
1084
+ }
1085
+ },
1086
+ {
1087
+ accessorKey: "id",
1088
+ header: () => "Actions",
1089
+ meta: {
1090
+ textAlign: "center"
1091
+ },
1092
+ cell: ({ row: h }) => {
1093
+ var c;
1094
+ const m = (c = u.value) == null ? void 0 : c.pageData().at(h.index);
1095
+ return M(Ye, {
1096
+ data: m,
1097
+ onLink: () => n(m._id),
1098
+ onUnlink: () => a(m._id),
1099
+ onEdit: () => g(m),
1100
+ onDelete: () => w(m._id)
1101
+ });
1102
+ }
1103
+ }
1104
+ ];
1105
+ return (h, m) => {
1106
+ const c = N("FmSearch"), S = N("FmButton");
1107
+ return I(), x(Ae, {
1108
+ title: f.type,
1109
+ loading: !1
1110
+ }, {
1111
+ default: q(() => [
1112
+ b("div", We, [
1113
+ b("div", Xe, [
1114
+ P(c, {
1115
+ "model-value": L(l),
1116
+ "onUpdate:modelValue": m[0] || (m[0] = (y) => Ee(l) ? l.value = y : null),
1117
+ class: "mr-8",
1118
+ label: "Search",
1119
+ placeholder: "Search ..."
1120
+ }, null, 8, ["model-value"])
1121
+ ]),
1122
+ b("div", Ze, [
1123
+ f.type === "TERMINAL" ? (I(), x(S, {
1124
+ key: 0,
1125
+ label: "Create",
1126
+ icon: "add",
1127
+ onClick: m[1] || (m[1] = () => g())
1128
+ })) : $("", !0)
1129
+ ])
1130
+ ]),
1131
+ P(be, {
1132
+ ref_key: "controller",
1133
+ ref: u,
1134
+ "column-defs": p,
1135
+ "rows-defs": E,
1136
+ paginate: (y, R) => L(K).read({ searchKey: L(l), deviceType: f.type, limit: y, cursor: R }),
1137
+ onRowClick: m[2] || (m[2] = (y) => L(r).push({
1138
+ name: `mf-payment-admin.${f.type.toLowerCase()}-setting`,
1139
+ params: {
1140
+ terminalId: y._id
1141
+ }
1142
+ }))
1143
+ }, null, 8, ["paginate"]),
1144
+ P(qe, {
1145
+ modelValue: i.value,
1146
+ "onUpdate:modelValue": m[3] || (m[3] = (y) => i.value = y),
1147
+ terminal: s.value,
1148
+ onSubmit: C
1149
+ }, null, 8, ["modelValue", "terminal"])
1150
+ ]),
1151
+ _: 1
1152
+ }, 8, ["title"]);
1153
+ };
1154
+ }
1155
+ });
1156
+ export {
1157
+ ht as default
1158
+ };