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