@feedmepos/mf-connect 0.1.47-prod → 0.1.49-prod
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/{Analytic-AnuRQDA4.js → Analytic-ibBD_21m.js} +113 -113
- package/dist/{App-DP_jCyej.js → App-CDjwWK8a.js} +632 -622
- package/dist/{Bin-tL4lF6PB.js → Bin-DCaG0YGW.js} +9 -9
- package/dist/Broadcast-CbF3d_N7.js +233 -0
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BgPJCH02.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BqYusgBO.js} +18 -18
- package/dist/{Card-Bi-ODgCc.js → Card-CDNE85po.js} +239 -239
- package/dist/{Collections-JHWotZ1I.js → Collections-DHn__E9U.js} +31 -31
- package/dist/Credit-DiTnwnFe.js +228 -0
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-hxuYl-OQ.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BJEAsRON.js} +756 -753
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-ECkaQxuI.js → EffectSheet.vue_vue_type_style_index_0_lang-CU9XpMjd.js} +96 -96
- package/dist/Experience-CjMVeGsX.js +229 -0
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
- package/dist/{Game-DUCx2Dl9.js → Game-D3gANFAo.js} +98 -92
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-D1KQpDGg.js +144 -0
- package/dist/{Index-zynxjOOr.js → Index-DEF_a5Mu.js} +54 -54
- package/dist/{Marketing-BBHDVRkR.js → Marketing-BeED4Y7H.js} +24 -24
- package/dist/{Member-B09bj6C3.js → Member-CA4hnHJY.js} +63 -63
- package/dist/MemberList-CZtriA_Q.js +1606 -0
- package/dist/MemberOverview-wL_ailso.js +58 -0
- package/dist/{MemberTransactions-DERMSs7o.js → MemberTransactions-BVrvf4AM.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CAADF6vv.js → MessageInput.vue_vue_type_script_setup_true_lang-BqTDGnOG.js} +2286 -2220
- package/dist/{Mission-DAv0e_ZH.js → Mission-CDSMpqnG.js} +113 -107
- package/dist/{Overview-D0rBTEtP.js → Overview-ArineqY4.js} +337 -337
- package/dist/Point-51MD49EM.js +232 -0
- package/dist/{Promotion-BSPU5hP9.js → Promotion-BVrofYd6.js} +43 -43
- package/dist/{Queue-C5IFJ3iE.js → Queue-Q-aEeZ8w.js} +13 -13
- package/dist/{Record-CoFSrv7j.js → Record-DaVcschI.js} +10 -10
- package/dist/{Reward-COIOBOl-.js → Reward-DTtFuqOZ.js} +173 -173
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-B9Tl7hqv.js → RewardGroup.vue_vue_type_script_setup_true_lang-P_gNd6ZP.js} +11 -11
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-BzsYC3k2.js → RuleGroup.vue_vue_type_script_setup_true_lang-CVy_kDmy.js} +381 -381
- package/dist/{Segment-DF5SrucQ.js → Segment-DIy4RERw.js} +327 -327
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-BSSfQu3F.js → SelectItems.vue_vue_type_script_setup_true_lang-D3KIZJLo.js} +14 -14
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-DoL_gTKy.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-bSi6_uqi.js} +11 -11
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-Cijyol1Q.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BsNLkA2v.js} +3 -3
- package/dist/Setting-DGDgmP84.js +1936 -0
- package/dist/{Store-E2_0EIy8.js → Store-Dh2uVHGY.js} +238 -238
- package/dist/StoreRewards-DFF_0g59.js +423 -0
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-DuatzcJ8.js → StoreTransactions.vue_vue_type_script_setup_true_lang-PrFhYJXc.js} +186 -186
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-D_r8I0h7.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-VcU2Asjy.js} +1 -1
- package/dist/{Tier-CEEHsXkC.js → Tier-yKvE4mRW.js} +106 -106
- package/dist/{Title-BMAWlGeW.js → Title-DWWSC02W.js} +95 -95
- package/dist/{Transaction-CLsceq-O.js → Transaction-ru7M0PKE.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CFLekn9O.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BSkv6hMH.js} +6 -6
- package/dist/{Voucher-Cd293WYY.js → Voucher-DmuaThKv.js} +37 -37
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-Db_aeyc1.js +419 -0
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-B8HHh8HU.js → ZodTextField.vue_vue_type_script_setup_true_lang-B5co0F__.js} +1 -1
- package/dist/app-DaFoFS2V.js +57962 -0
- package/dist/{app-aVXsWATU.js → app-ja_XST5q.js} +31 -31
- package/dist/app.js +1 -1
- package/dist/{business-DVlHPzaL.js → business-BSP_3iNl.js} +11 -8
- package/dist/{campaign-D9KeUWA7.js → campaign-C1hWNRWr.js} +2 -2
- package/dist/{campaign-l-u9A514.js → campaign-DMZnXtyb.js} +10 -10
- package/dist/{campaign.enum-Cud82tES.js → campaign.enum-Bfsz7Aon.js} +1 -1
- package/dist/campaign.fn-B-xvcbEb.js +758 -0
- package/dist/{collectible.enum-PrlUDScv.js → collectible.enum-BRkrN4Bi.js} +1 -1
- package/dist/{collection.fn-yR-xnV4g.js → collection.fn-D03AXdUn.js} +2 -2
- package/dist/{dto-Cua1OHMY.js → dto-DpRkSGg6.js} +4 -4
- package/dist/{effect-B5-eXNEr.js → effect-BW1-I1J4.js} +1 -1
- package/dist/{email-addresses-BeYh5fr5.js → email-addresses-BLVkwSkP.js} +1 -1
- package/dist/{export-BUF4_DUz.js → export-DOfDownW.js} +4 -4
- package/dist/{helper-CGwOThAl.js → helper-BzfjLXgi.js} +1 -1
- package/dist/{index-DlFVLRKG.js → index-BBi9jDD1.js} +3 -3
- package/dist/{index-Cx8-ipee.js → index-BJl_HxaB.js} +6 -6
- package/dist/{index-1BGPM6Uy.js → index-Ba5-z1MU.js} +1 -1
- package/dist/{index-BmL_b0IR.js → index-Bp8F6U9V.js} +1 -1
- package/dist/{index-C-d_4n-1.js → index-C6fpU8-G.js} +1 -1
- package/dist/{index-knuJv0ti.js → index-COoQSeE7.js} +4 -4
- package/dist/{index-aMDi62-C.js → index-DTnzjEWu.js} +1 -1
- package/dist/{index-BLdVWQId.js → index-DWBeauin.js} +3 -3
- package/dist/{index-Cl2iYM2F.js → index-Da1qz9oA.js} +1 -1
- package/dist/{index-CB8iWT_p.js → index-Dve1-uYX.js} +1 -1
- package/dist/{index-ng2IXlL1.js → index-P6ISAxfQ.js} +1 -1
- package/dist/{index-hX2mE0gQ.js → index-cpWgtd-c.js} +1 -1
- package/dist/{index-D5KIp8ZB.js → index-sFyvCun2.js} +1023 -1023
- package/dist/{index-DNTd-FNx.js → index-zyVYgteg.js} +2 -2
- package/dist/{index.esm2017-D8stWFci.js → index.esm2017-DT0awUwa.js} +40 -40
- package/dist/{loading-c4b7n9Xp.js → loading-CZH88Duq.js} +1 -1
- package/dist/{membership-oBIs4sbL.js → membership-GNRX1fEK.js} +3 -3
- package/dist/{moment-BWErdI6_.js → moment-D7p2TMB-.js} +6 -1
- package/dist/{money-AP24H0gk.js → money-Xe5mDYRC.js} +1 -1
- package/dist/{number-CwsAYC_2.js → number-CAjqc2Pu.js} +1 -1
- package/dist/objectid-BQJRv_jX.js +145 -0
- package/dist/{plugins-Dn7JDHi7.js → plugins-Z2YcDTj8.js} +2 -2
- package/dist/{reward-4wdoZeXw.js → reward-G656rbLJ.js} +1 -1
- package/dist/{rule-_OJza6tn.js → rule-BJ5blBZp.js} +4 -4
- package/dist/{rule-builder-DmlhHAED.js → rule-builder-CursBigG.js} +1 -1
- package/dist/{template-BSQLFHf4.js → template-BnyUm8is.js} +63 -63
- package/dist/timezone-B64-HrWi.js +1150 -0
- package/dist/{trigger-DC9tDnI2.js → trigger-C_ih51ky.js} +4 -4
- package/dist/usePagination-Ds-cuHop.js +223 -0
- package/dist/{user-CCVOptFD.js → user-BZc_OAUj.js} +1 -1
- package/dist/{vue-i18n--_Wu1nMj.js → vue-i18n-2D47GxQX.js} +401 -401
- package/dist/{xlsx-BVMaOi8M.js → xlsx-BEk5qawh.js} +226 -226
- package/package.json +5 -4
- package/dist/Broadcast-T2a5tN8R.js +0 -227
- package/dist/Credit-DQQCXqS0.js +0 -222
- package/dist/Experience-DzTV21vX.js +0 -223
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-d8rh38tD.js +0 -114
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js +0 -144
- package/dist/MemberList-DLSLGQ02.js +0 -1606
- package/dist/MemberOverview-C2n9oJZh.js +0 -58
- package/dist/Point-BeBYi1BT.js +0 -226
- package/dist/Setting-Dt0sG_hk.js +0 -1936
- package/dist/StoreRewards-DuSsWnTE.js +0 -423
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-Qc5cCqh5.js +0 -419
- package/dist/app-jRT7vsk_.js +0 -33357
- package/dist/campaign.fn-C-UojhHv.js +0 -758
- package/dist/objectid-CVDLTdni.js +0 -145
- package/dist/usePagination-JoYaROkV.js +0 -223
package/dist/Setting-Dt0sG_hk.js
DELETED
|
@@ -1,1936 +0,0 @@
|
|
|
1
|
-
import { defineComponent as Xe, ref as z, computed as ge, onMounted as Ze, resolveComponent as F, openBlock as x, createBlock as me, withCtx as ne, createElementVNode as y, createVNode as S, unref as c, isRef as et, createElementBlock as q, Fragment as ue, toDisplayString as k, createTextVNode as oe, createCommentVNode as te, renderList as Ye } from "vue";
|
|
2
|
-
import { h as Et } from "./moment-BWErdI6_.js";
|
|
3
|
-
import { Z as je } from "./zod-Bg2FbC-D.js";
|
|
4
|
-
import { useDialog as tt } from "@feedmepos/ui-library";
|
|
5
|
-
import { u as At } from "./loading-c4b7n9Xp.js";
|
|
6
|
-
import { u as Bt } from "./app-wDQR6dpb.js";
|
|
7
|
-
import { u as Ie, l as nt } from "./business-DVlHPzaL.js";
|
|
8
|
-
import { u as ot } from "./membership-oBIs4sbL.js";
|
|
9
|
-
import "./index-D5KIp8ZB.js";
|
|
10
|
-
import { s as Mt, k as St } from "./index-knuJv0ti.js";
|
|
11
|
-
import { _ as It } from "./ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js";
|
|
12
|
-
import { a as rt, p as Pt, f as G } from "./plugins-Dn7JDHi7.js";
|
|
13
|
-
import { _ as Tt } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-D_r8I0h7.js";
|
|
14
|
-
import { M as Nt, _ as Ut } from "./MessageInput.vue_vue_type_script_setup_true_lang-CAADF6vv.js";
|
|
15
|
-
import { u as Lt } from "./vue-i18n--_Wu1nMj.js";
|
|
16
|
-
import { useCoreStore as Ft } from "@feedmepos/mf-common";
|
|
17
|
-
import { m as Je } from "./index-aMDi62-C.js";
|
|
18
|
-
import { S as qe } from "./index-BLdVWQId.js";
|
|
19
|
-
import { o as Rt } from "./objectId-dwaoBfJX.js";
|
|
20
|
-
import { a as kt } from "./object-qECH92oz.js";
|
|
21
|
-
var ie = {}, Dt = function() {
|
|
22
|
-
return typeof Promise == "function" && Promise.prototype && Promise.prototype.then;
|
|
23
|
-
}, st = {}, U = {};
|
|
24
|
-
let Le;
|
|
25
|
-
const Vt = [
|
|
26
|
-
0,
|
|
27
|
-
// Not used
|
|
28
|
-
26,
|
|
29
|
-
44,
|
|
30
|
-
70,
|
|
31
|
-
100,
|
|
32
|
-
134,
|
|
33
|
-
172,
|
|
34
|
-
196,
|
|
35
|
-
242,
|
|
36
|
-
292,
|
|
37
|
-
346,
|
|
38
|
-
404,
|
|
39
|
-
466,
|
|
40
|
-
532,
|
|
41
|
-
581,
|
|
42
|
-
655,
|
|
43
|
-
733,
|
|
44
|
-
815,
|
|
45
|
-
901,
|
|
46
|
-
991,
|
|
47
|
-
1085,
|
|
48
|
-
1156,
|
|
49
|
-
1258,
|
|
50
|
-
1364,
|
|
51
|
-
1474,
|
|
52
|
-
1588,
|
|
53
|
-
1706,
|
|
54
|
-
1828,
|
|
55
|
-
1921,
|
|
56
|
-
2051,
|
|
57
|
-
2185,
|
|
58
|
-
2323,
|
|
59
|
-
2465,
|
|
60
|
-
2611,
|
|
61
|
-
2761,
|
|
62
|
-
2876,
|
|
63
|
-
3034,
|
|
64
|
-
3196,
|
|
65
|
-
3362,
|
|
66
|
-
3532,
|
|
67
|
-
3706
|
|
68
|
-
];
|
|
69
|
-
U.getSymbolSize = function(e) {
|
|
70
|
-
if (!e) throw new Error('"version" cannot be null or undefined');
|
|
71
|
-
if (e < 1 || e > 40) throw new Error('"version" should be in range from 1 to 40');
|
|
72
|
-
return e * 4 + 17;
|
|
73
|
-
};
|
|
74
|
-
U.getSymbolTotalCodewords = function(e) {
|
|
75
|
-
return Vt[e];
|
|
76
|
-
};
|
|
77
|
-
U.getBCHDigit = function(t) {
|
|
78
|
-
let e = 0;
|
|
79
|
-
for (; t !== 0; )
|
|
80
|
-
e++, t >>>= 1;
|
|
81
|
-
return e;
|
|
82
|
-
};
|
|
83
|
-
U.setToSJISFunction = function(e) {
|
|
84
|
-
if (typeof e != "function")
|
|
85
|
-
throw new Error('"toSJISFunc" is not a valid function.');
|
|
86
|
-
Le = e;
|
|
87
|
-
};
|
|
88
|
-
U.isKanjiModeEnabled = function() {
|
|
89
|
-
return typeof Le < "u";
|
|
90
|
-
};
|
|
91
|
-
U.toSJIS = function(e) {
|
|
92
|
-
return Le(e);
|
|
93
|
-
};
|
|
94
|
-
var ye = {};
|
|
95
|
-
(function(t) {
|
|
96
|
-
t.L = { bit: 1 }, t.M = { bit: 0 }, t.Q = { bit: 3 }, t.H = { bit: 2 };
|
|
97
|
-
function e(s) {
|
|
98
|
-
if (typeof s != "string")
|
|
99
|
-
throw new Error("Param is not a string");
|
|
100
|
-
switch (s.toLowerCase()) {
|
|
101
|
-
case "l":
|
|
102
|
-
case "low":
|
|
103
|
-
return t.L;
|
|
104
|
-
case "m":
|
|
105
|
-
case "medium":
|
|
106
|
-
return t.M;
|
|
107
|
-
case "q":
|
|
108
|
-
case "quartile":
|
|
109
|
-
return t.Q;
|
|
110
|
-
case "h":
|
|
111
|
-
case "high":
|
|
112
|
-
return t.H;
|
|
113
|
-
default:
|
|
114
|
-
throw new Error("Unknown EC Level: " + s);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
t.isValid = function(r) {
|
|
118
|
-
return r && typeof r.bit < "u" && r.bit >= 0 && r.bit < 4;
|
|
119
|
-
}, t.from = function(r, o) {
|
|
120
|
-
if (t.isValid(r))
|
|
121
|
-
return r;
|
|
122
|
-
try {
|
|
123
|
-
return e(r);
|
|
124
|
-
} catch {
|
|
125
|
-
return o;
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
})(ye);
|
|
129
|
-
function it() {
|
|
130
|
-
this.buffer = [], this.length = 0;
|
|
131
|
-
}
|
|
132
|
-
it.prototype = {
|
|
133
|
-
get: function(t) {
|
|
134
|
-
const e = Math.floor(t / 8);
|
|
135
|
-
return (this.buffer[e] >>> 7 - t % 8 & 1) === 1;
|
|
136
|
-
},
|
|
137
|
-
put: function(t, e) {
|
|
138
|
-
for (let s = 0; s < e; s++)
|
|
139
|
-
this.putBit((t >>> e - s - 1 & 1) === 1);
|
|
140
|
-
},
|
|
141
|
-
getLengthInBits: function() {
|
|
142
|
-
return this.length;
|
|
143
|
-
},
|
|
144
|
-
putBit: function(t) {
|
|
145
|
-
const e = Math.floor(this.length / 8);
|
|
146
|
-
this.buffer.length <= e && this.buffer.push(0), t && (this.buffer[e] |= 128 >>> this.length % 8), this.length++;
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
var xt = it;
|
|
150
|
-
function ae(t) {
|
|
151
|
-
if (!t || t < 1)
|
|
152
|
-
throw new Error("BitMatrix size must be defined and greater than 0");
|
|
153
|
-
this.size = t, this.data = new Uint8Array(t * t), this.reservedBit = new Uint8Array(t * t);
|
|
154
|
-
}
|
|
155
|
-
ae.prototype.set = function(t, e, s, r) {
|
|
156
|
-
const o = t * this.size + e;
|
|
157
|
-
this.data[o] = s, r && (this.reservedBit[o] = !0);
|
|
158
|
-
};
|
|
159
|
-
ae.prototype.get = function(t, e) {
|
|
160
|
-
return this.data[t * this.size + e];
|
|
161
|
-
};
|
|
162
|
-
ae.prototype.xor = function(t, e, s) {
|
|
163
|
-
this.data[t * this.size + e] ^= s;
|
|
164
|
-
};
|
|
165
|
-
ae.prototype.isReserved = function(t, e) {
|
|
166
|
-
return this.reservedBit[t * this.size + e];
|
|
167
|
-
};
|
|
168
|
-
var $t = ae, at = {};
|
|
169
|
-
(function(t) {
|
|
170
|
-
const e = U.getSymbolSize;
|
|
171
|
-
t.getRowColCoords = function(r) {
|
|
172
|
-
if (r === 1) return [];
|
|
173
|
-
const o = Math.floor(r / 7) + 2, n = e(r), a = n === 145 ? 26 : Math.ceil((n - 13) / (2 * o - 2)) * 2, l = [n - 7];
|
|
174
|
-
for (let i = 1; i < o - 1; i++)
|
|
175
|
-
l[i] = l[i - 1] - a;
|
|
176
|
-
return l.push(6), l.reverse();
|
|
177
|
-
}, t.getPositions = function(r) {
|
|
178
|
-
const o = [], n = t.getRowColCoords(r), a = n.length;
|
|
179
|
-
for (let l = 0; l < a; l++)
|
|
180
|
-
for (let i = 0; i < a; i++)
|
|
181
|
-
l === 0 && i === 0 || // top-left
|
|
182
|
-
l === 0 && i === a - 1 || // bottom-left
|
|
183
|
-
l === a - 1 && i === 0 || o.push([n[l], n[i]]);
|
|
184
|
-
return o;
|
|
185
|
-
};
|
|
186
|
-
})(at);
|
|
187
|
-
var lt = {};
|
|
188
|
-
const zt = U.getSymbolSize, Ge = 7;
|
|
189
|
-
lt.getPositions = function(e) {
|
|
190
|
-
const s = zt(e);
|
|
191
|
-
return [
|
|
192
|
-
// top-left
|
|
193
|
-
[0, 0],
|
|
194
|
-
// top-right
|
|
195
|
-
[s - Ge, 0],
|
|
196
|
-
// bottom-left
|
|
197
|
-
[0, s - Ge]
|
|
198
|
-
];
|
|
199
|
-
};
|
|
200
|
-
var ct = {};
|
|
201
|
-
(function(t) {
|
|
202
|
-
t.Patterns = {
|
|
203
|
-
PATTERN000: 0,
|
|
204
|
-
PATTERN001: 1,
|
|
205
|
-
PATTERN010: 2,
|
|
206
|
-
PATTERN011: 3,
|
|
207
|
-
PATTERN100: 4,
|
|
208
|
-
PATTERN101: 5,
|
|
209
|
-
PATTERN110: 6,
|
|
210
|
-
PATTERN111: 7
|
|
211
|
-
};
|
|
212
|
-
const e = {
|
|
213
|
-
N1: 3,
|
|
214
|
-
N2: 3,
|
|
215
|
-
N3: 40,
|
|
216
|
-
N4: 10
|
|
217
|
-
};
|
|
218
|
-
t.isValid = function(o) {
|
|
219
|
-
return o != null && o !== "" && !isNaN(o) && o >= 0 && o <= 7;
|
|
220
|
-
}, t.from = function(o) {
|
|
221
|
-
return t.isValid(o) ? parseInt(o, 10) : void 0;
|
|
222
|
-
}, t.getPenaltyN1 = function(o) {
|
|
223
|
-
const n = o.size;
|
|
224
|
-
let a = 0, l = 0, i = 0, u = null, f = null;
|
|
225
|
-
for (let A = 0; A < n; A++) {
|
|
226
|
-
l = i = 0, u = f = null;
|
|
227
|
-
for (let m = 0; m < n; m++) {
|
|
228
|
-
let d = o.get(A, m);
|
|
229
|
-
d === u ? l++ : (l >= 5 && (a += e.N1 + (l - 5)), u = d, l = 1), d = o.get(m, A), d === f ? i++ : (i >= 5 && (a += e.N1 + (i - 5)), f = d, i = 1);
|
|
230
|
-
}
|
|
231
|
-
l >= 5 && (a += e.N1 + (l - 5)), i >= 5 && (a += e.N1 + (i - 5));
|
|
232
|
-
}
|
|
233
|
-
return a;
|
|
234
|
-
}, t.getPenaltyN2 = function(o) {
|
|
235
|
-
const n = o.size;
|
|
236
|
-
let a = 0;
|
|
237
|
-
for (let l = 0; l < n - 1; l++)
|
|
238
|
-
for (let i = 0; i < n - 1; i++) {
|
|
239
|
-
const u = o.get(l, i) + o.get(l, i + 1) + o.get(l + 1, i) + o.get(l + 1, i + 1);
|
|
240
|
-
(u === 4 || u === 0) && a++;
|
|
241
|
-
}
|
|
242
|
-
return a * e.N2;
|
|
243
|
-
}, t.getPenaltyN3 = function(o) {
|
|
244
|
-
const n = o.size;
|
|
245
|
-
let a = 0, l = 0, i = 0;
|
|
246
|
-
for (let u = 0; u < n; u++) {
|
|
247
|
-
l = i = 0;
|
|
248
|
-
for (let f = 0; f < n; f++)
|
|
249
|
-
l = l << 1 & 2047 | o.get(u, f), f >= 10 && (l === 1488 || l === 93) && a++, i = i << 1 & 2047 | o.get(f, u), f >= 10 && (i === 1488 || i === 93) && a++;
|
|
250
|
-
}
|
|
251
|
-
return a * e.N3;
|
|
252
|
-
}, t.getPenaltyN4 = function(o) {
|
|
253
|
-
let n = 0;
|
|
254
|
-
const a = o.data.length;
|
|
255
|
-
for (let i = 0; i < a; i++) n += o.data[i];
|
|
256
|
-
return Math.abs(Math.ceil(n * 100 / a / 5) - 10) * e.N4;
|
|
257
|
-
};
|
|
258
|
-
function s(r, o, n) {
|
|
259
|
-
switch (r) {
|
|
260
|
-
case t.Patterns.PATTERN000:
|
|
261
|
-
return (o + n) % 2 === 0;
|
|
262
|
-
case t.Patterns.PATTERN001:
|
|
263
|
-
return o % 2 === 0;
|
|
264
|
-
case t.Patterns.PATTERN010:
|
|
265
|
-
return n % 3 === 0;
|
|
266
|
-
case t.Patterns.PATTERN011:
|
|
267
|
-
return (o + n) % 3 === 0;
|
|
268
|
-
case t.Patterns.PATTERN100:
|
|
269
|
-
return (Math.floor(o / 2) + Math.floor(n / 3)) % 2 === 0;
|
|
270
|
-
case t.Patterns.PATTERN101:
|
|
271
|
-
return o * n % 2 + o * n % 3 === 0;
|
|
272
|
-
case t.Patterns.PATTERN110:
|
|
273
|
-
return (o * n % 2 + o * n % 3) % 2 === 0;
|
|
274
|
-
case t.Patterns.PATTERN111:
|
|
275
|
-
return (o * n % 3 + (o + n) % 2) % 2 === 0;
|
|
276
|
-
default:
|
|
277
|
-
throw new Error("bad maskPattern:" + r);
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
t.applyMask = function(o, n) {
|
|
281
|
-
const a = n.size;
|
|
282
|
-
for (let l = 0; l < a; l++)
|
|
283
|
-
for (let i = 0; i < a; i++)
|
|
284
|
-
n.isReserved(i, l) || n.xor(i, l, s(o, i, l));
|
|
285
|
-
}, t.getBestMask = function(o, n) {
|
|
286
|
-
const a = Object.keys(t.Patterns).length;
|
|
287
|
-
let l = 0, i = 1 / 0;
|
|
288
|
-
for (let u = 0; u < a; u++) {
|
|
289
|
-
n(u), t.applyMask(u, o);
|
|
290
|
-
const f = t.getPenaltyN1(o) + t.getPenaltyN2(o) + t.getPenaltyN3(o) + t.getPenaltyN4(o);
|
|
291
|
-
t.applyMask(u, o), f < i && (i = f, l = u);
|
|
292
|
-
}
|
|
293
|
-
return l;
|
|
294
|
-
};
|
|
295
|
-
})(ct);
|
|
296
|
-
var we = {};
|
|
297
|
-
const K = ye, de = [
|
|
298
|
-
// L M Q H
|
|
299
|
-
1,
|
|
300
|
-
1,
|
|
301
|
-
1,
|
|
302
|
-
1,
|
|
303
|
-
1,
|
|
304
|
-
1,
|
|
305
|
-
1,
|
|
306
|
-
1,
|
|
307
|
-
1,
|
|
308
|
-
1,
|
|
309
|
-
2,
|
|
310
|
-
2,
|
|
311
|
-
1,
|
|
312
|
-
2,
|
|
313
|
-
2,
|
|
314
|
-
4,
|
|
315
|
-
1,
|
|
316
|
-
2,
|
|
317
|
-
4,
|
|
318
|
-
4,
|
|
319
|
-
2,
|
|
320
|
-
4,
|
|
321
|
-
4,
|
|
322
|
-
4,
|
|
323
|
-
2,
|
|
324
|
-
4,
|
|
325
|
-
6,
|
|
326
|
-
5,
|
|
327
|
-
2,
|
|
328
|
-
4,
|
|
329
|
-
6,
|
|
330
|
-
6,
|
|
331
|
-
2,
|
|
332
|
-
5,
|
|
333
|
-
8,
|
|
334
|
-
8,
|
|
335
|
-
4,
|
|
336
|
-
5,
|
|
337
|
-
8,
|
|
338
|
-
8,
|
|
339
|
-
4,
|
|
340
|
-
5,
|
|
341
|
-
8,
|
|
342
|
-
11,
|
|
343
|
-
4,
|
|
344
|
-
8,
|
|
345
|
-
10,
|
|
346
|
-
11,
|
|
347
|
-
4,
|
|
348
|
-
9,
|
|
349
|
-
12,
|
|
350
|
-
16,
|
|
351
|
-
4,
|
|
352
|
-
9,
|
|
353
|
-
16,
|
|
354
|
-
16,
|
|
355
|
-
6,
|
|
356
|
-
10,
|
|
357
|
-
12,
|
|
358
|
-
18,
|
|
359
|
-
6,
|
|
360
|
-
10,
|
|
361
|
-
17,
|
|
362
|
-
16,
|
|
363
|
-
6,
|
|
364
|
-
11,
|
|
365
|
-
16,
|
|
366
|
-
19,
|
|
367
|
-
6,
|
|
368
|
-
13,
|
|
369
|
-
18,
|
|
370
|
-
21,
|
|
371
|
-
7,
|
|
372
|
-
14,
|
|
373
|
-
21,
|
|
374
|
-
25,
|
|
375
|
-
8,
|
|
376
|
-
16,
|
|
377
|
-
20,
|
|
378
|
-
25,
|
|
379
|
-
8,
|
|
380
|
-
17,
|
|
381
|
-
23,
|
|
382
|
-
25,
|
|
383
|
-
9,
|
|
384
|
-
17,
|
|
385
|
-
23,
|
|
386
|
-
34,
|
|
387
|
-
9,
|
|
388
|
-
18,
|
|
389
|
-
25,
|
|
390
|
-
30,
|
|
391
|
-
10,
|
|
392
|
-
20,
|
|
393
|
-
27,
|
|
394
|
-
32,
|
|
395
|
-
12,
|
|
396
|
-
21,
|
|
397
|
-
29,
|
|
398
|
-
35,
|
|
399
|
-
12,
|
|
400
|
-
23,
|
|
401
|
-
34,
|
|
402
|
-
37,
|
|
403
|
-
12,
|
|
404
|
-
25,
|
|
405
|
-
34,
|
|
406
|
-
40,
|
|
407
|
-
13,
|
|
408
|
-
26,
|
|
409
|
-
35,
|
|
410
|
-
42,
|
|
411
|
-
14,
|
|
412
|
-
28,
|
|
413
|
-
38,
|
|
414
|
-
45,
|
|
415
|
-
15,
|
|
416
|
-
29,
|
|
417
|
-
40,
|
|
418
|
-
48,
|
|
419
|
-
16,
|
|
420
|
-
31,
|
|
421
|
-
43,
|
|
422
|
-
51,
|
|
423
|
-
17,
|
|
424
|
-
33,
|
|
425
|
-
45,
|
|
426
|
-
54,
|
|
427
|
-
18,
|
|
428
|
-
35,
|
|
429
|
-
48,
|
|
430
|
-
57,
|
|
431
|
-
19,
|
|
432
|
-
37,
|
|
433
|
-
51,
|
|
434
|
-
60,
|
|
435
|
-
19,
|
|
436
|
-
38,
|
|
437
|
-
53,
|
|
438
|
-
63,
|
|
439
|
-
20,
|
|
440
|
-
40,
|
|
441
|
-
56,
|
|
442
|
-
66,
|
|
443
|
-
21,
|
|
444
|
-
43,
|
|
445
|
-
59,
|
|
446
|
-
70,
|
|
447
|
-
22,
|
|
448
|
-
45,
|
|
449
|
-
62,
|
|
450
|
-
74,
|
|
451
|
-
24,
|
|
452
|
-
47,
|
|
453
|
-
65,
|
|
454
|
-
77,
|
|
455
|
-
25,
|
|
456
|
-
49,
|
|
457
|
-
68,
|
|
458
|
-
81
|
|
459
|
-
], fe = [
|
|
460
|
-
// L M Q H
|
|
461
|
-
7,
|
|
462
|
-
10,
|
|
463
|
-
13,
|
|
464
|
-
17,
|
|
465
|
-
10,
|
|
466
|
-
16,
|
|
467
|
-
22,
|
|
468
|
-
28,
|
|
469
|
-
15,
|
|
470
|
-
26,
|
|
471
|
-
36,
|
|
472
|
-
44,
|
|
473
|
-
20,
|
|
474
|
-
36,
|
|
475
|
-
52,
|
|
476
|
-
64,
|
|
477
|
-
26,
|
|
478
|
-
48,
|
|
479
|
-
72,
|
|
480
|
-
88,
|
|
481
|
-
36,
|
|
482
|
-
64,
|
|
483
|
-
96,
|
|
484
|
-
112,
|
|
485
|
-
40,
|
|
486
|
-
72,
|
|
487
|
-
108,
|
|
488
|
-
130,
|
|
489
|
-
48,
|
|
490
|
-
88,
|
|
491
|
-
132,
|
|
492
|
-
156,
|
|
493
|
-
60,
|
|
494
|
-
110,
|
|
495
|
-
160,
|
|
496
|
-
192,
|
|
497
|
-
72,
|
|
498
|
-
130,
|
|
499
|
-
192,
|
|
500
|
-
224,
|
|
501
|
-
80,
|
|
502
|
-
150,
|
|
503
|
-
224,
|
|
504
|
-
264,
|
|
505
|
-
96,
|
|
506
|
-
176,
|
|
507
|
-
260,
|
|
508
|
-
308,
|
|
509
|
-
104,
|
|
510
|
-
198,
|
|
511
|
-
288,
|
|
512
|
-
352,
|
|
513
|
-
120,
|
|
514
|
-
216,
|
|
515
|
-
320,
|
|
516
|
-
384,
|
|
517
|
-
132,
|
|
518
|
-
240,
|
|
519
|
-
360,
|
|
520
|
-
432,
|
|
521
|
-
144,
|
|
522
|
-
280,
|
|
523
|
-
408,
|
|
524
|
-
480,
|
|
525
|
-
168,
|
|
526
|
-
308,
|
|
527
|
-
448,
|
|
528
|
-
532,
|
|
529
|
-
180,
|
|
530
|
-
338,
|
|
531
|
-
504,
|
|
532
|
-
588,
|
|
533
|
-
196,
|
|
534
|
-
364,
|
|
535
|
-
546,
|
|
536
|
-
650,
|
|
537
|
-
224,
|
|
538
|
-
416,
|
|
539
|
-
600,
|
|
540
|
-
700,
|
|
541
|
-
224,
|
|
542
|
-
442,
|
|
543
|
-
644,
|
|
544
|
-
750,
|
|
545
|
-
252,
|
|
546
|
-
476,
|
|
547
|
-
690,
|
|
548
|
-
816,
|
|
549
|
-
270,
|
|
550
|
-
504,
|
|
551
|
-
750,
|
|
552
|
-
900,
|
|
553
|
-
300,
|
|
554
|
-
560,
|
|
555
|
-
810,
|
|
556
|
-
960,
|
|
557
|
-
312,
|
|
558
|
-
588,
|
|
559
|
-
870,
|
|
560
|
-
1050,
|
|
561
|
-
336,
|
|
562
|
-
644,
|
|
563
|
-
952,
|
|
564
|
-
1110,
|
|
565
|
-
360,
|
|
566
|
-
700,
|
|
567
|
-
1020,
|
|
568
|
-
1200,
|
|
569
|
-
390,
|
|
570
|
-
728,
|
|
571
|
-
1050,
|
|
572
|
-
1260,
|
|
573
|
-
420,
|
|
574
|
-
784,
|
|
575
|
-
1140,
|
|
576
|
-
1350,
|
|
577
|
-
450,
|
|
578
|
-
812,
|
|
579
|
-
1200,
|
|
580
|
-
1440,
|
|
581
|
-
480,
|
|
582
|
-
868,
|
|
583
|
-
1290,
|
|
584
|
-
1530,
|
|
585
|
-
510,
|
|
586
|
-
924,
|
|
587
|
-
1350,
|
|
588
|
-
1620,
|
|
589
|
-
540,
|
|
590
|
-
980,
|
|
591
|
-
1440,
|
|
592
|
-
1710,
|
|
593
|
-
570,
|
|
594
|
-
1036,
|
|
595
|
-
1530,
|
|
596
|
-
1800,
|
|
597
|
-
570,
|
|
598
|
-
1064,
|
|
599
|
-
1590,
|
|
600
|
-
1890,
|
|
601
|
-
600,
|
|
602
|
-
1120,
|
|
603
|
-
1680,
|
|
604
|
-
1980,
|
|
605
|
-
630,
|
|
606
|
-
1204,
|
|
607
|
-
1770,
|
|
608
|
-
2100,
|
|
609
|
-
660,
|
|
610
|
-
1260,
|
|
611
|
-
1860,
|
|
612
|
-
2220,
|
|
613
|
-
720,
|
|
614
|
-
1316,
|
|
615
|
-
1950,
|
|
616
|
-
2310,
|
|
617
|
-
750,
|
|
618
|
-
1372,
|
|
619
|
-
2040,
|
|
620
|
-
2430
|
|
621
|
-
];
|
|
622
|
-
we.getBlocksCount = function(e, s) {
|
|
623
|
-
switch (s) {
|
|
624
|
-
case K.L:
|
|
625
|
-
return de[(e - 1) * 4 + 0];
|
|
626
|
-
case K.M:
|
|
627
|
-
return de[(e - 1) * 4 + 1];
|
|
628
|
-
case K.Q:
|
|
629
|
-
return de[(e - 1) * 4 + 2];
|
|
630
|
-
case K.H:
|
|
631
|
-
return de[(e - 1) * 4 + 3];
|
|
632
|
-
default:
|
|
633
|
-
return;
|
|
634
|
-
}
|
|
635
|
-
};
|
|
636
|
-
we.getTotalCodewordsCount = function(e, s) {
|
|
637
|
-
switch (s) {
|
|
638
|
-
case K.L:
|
|
639
|
-
return fe[(e - 1) * 4 + 0];
|
|
640
|
-
case K.M:
|
|
641
|
-
return fe[(e - 1) * 4 + 1];
|
|
642
|
-
case K.Q:
|
|
643
|
-
return fe[(e - 1) * 4 + 2];
|
|
644
|
-
case K.H:
|
|
645
|
-
return fe[(e - 1) * 4 + 3];
|
|
646
|
-
default:
|
|
647
|
-
return;
|
|
648
|
-
}
|
|
649
|
-
};
|
|
650
|
-
var ut = {}, be = {};
|
|
651
|
-
const re = new Uint8Array(512), he = new Uint8Array(256);
|
|
652
|
-
(function() {
|
|
653
|
-
let e = 1;
|
|
654
|
-
for (let s = 0; s < 255; s++)
|
|
655
|
-
re[s] = e, he[e] = s, e <<= 1, e & 256 && (e ^= 285);
|
|
656
|
-
for (let s = 255; s < 512; s++)
|
|
657
|
-
re[s] = re[s - 255];
|
|
658
|
-
})();
|
|
659
|
-
be.log = function(e) {
|
|
660
|
-
if (e < 1) throw new Error("log(" + e + ")");
|
|
661
|
-
return he[e];
|
|
662
|
-
};
|
|
663
|
-
be.exp = function(e) {
|
|
664
|
-
return re[e];
|
|
665
|
-
};
|
|
666
|
-
be.mul = function(e, s) {
|
|
667
|
-
return e === 0 || s === 0 ? 0 : re[he[e] + he[s]];
|
|
668
|
-
};
|
|
669
|
-
(function(t) {
|
|
670
|
-
const e = be;
|
|
671
|
-
t.mul = function(r, o) {
|
|
672
|
-
const n = new Uint8Array(r.length + o.length - 1);
|
|
673
|
-
for (let a = 0; a < r.length; a++)
|
|
674
|
-
for (let l = 0; l < o.length; l++)
|
|
675
|
-
n[a + l] ^= e.mul(r[a], o[l]);
|
|
676
|
-
return n;
|
|
677
|
-
}, t.mod = function(r, o) {
|
|
678
|
-
let n = new Uint8Array(r);
|
|
679
|
-
for (; n.length - o.length >= 0; ) {
|
|
680
|
-
const a = n[0];
|
|
681
|
-
for (let i = 0; i < o.length; i++)
|
|
682
|
-
n[i] ^= e.mul(o[i], a);
|
|
683
|
-
let l = 0;
|
|
684
|
-
for (; l < n.length && n[l] === 0; ) l++;
|
|
685
|
-
n = n.slice(l);
|
|
686
|
-
}
|
|
687
|
-
return n;
|
|
688
|
-
}, t.generateECPolynomial = function(r) {
|
|
689
|
-
let o = new Uint8Array([1]);
|
|
690
|
-
for (let n = 0; n < r; n++)
|
|
691
|
-
o = t.mul(o, new Uint8Array([1, e.exp(n)]));
|
|
692
|
-
return o;
|
|
693
|
-
};
|
|
694
|
-
})(ut);
|
|
695
|
-
const dt = ut;
|
|
696
|
-
function Fe(t) {
|
|
697
|
-
this.genPoly = void 0, this.degree = t, this.degree && this.initialize(this.degree);
|
|
698
|
-
}
|
|
699
|
-
Fe.prototype.initialize = function(e) {
|
|
700
|
-
this.degree = e, this.genPoly = dt.generateECPolynomial(this.degree);
|
|
701
|
-
};
|
|
702
|
-
Fe.prototype.encode = function(e) {
|
|
703
|
-
if (!this.genPoly)
|
|
704
|
-
throw new Error("Encoder not initialized");
|
|
705
|
-
const s = new Uint8Array(e.length + this.degree);
|
|
706
|
-
s.set(e);
|
|
707
|
-
const r = dt.mod(s, this.genPoly), o = this.degree - r.length;
|
|
708
|
-
if (o > 0) {
|
|
709
|
-
const n = new Uint8Array(this.degree);
|
|
710
|
-
return n.set(r, o), n;
|
|
711
|
-
}
|
|
712
|
-
return r;
|
|
713
|
-
};
|
|
714
|
-
var Ht = Fe, ft = {}, O = {}, Re = {};
|
|
715
|
-
Re.isValid = function(e) {
|
|
716
|
-
return !isNaN(e) && e >= 1 && e <= 40;
|
|
717
|
-
};
|
|
718
|
-
var $ = {};
|
|
719
|
-
const mt = "[0-9]+", Kt = "[A-Z $%*+\\-./:]+";
|
|
720
|
-
let se = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";
|
|
721
|
-
se = se.replace(/u/g, "\\u");
|
|
722
|
-
const Ot = "(?:(?![A-Z0-9 $%*+\\-./:]|" + se + `)(?:.|[\r
|
|
723
|
-
]))+`;
|
|
724
|
-
$.KANJI = new RegExp(se, "g");
|
|
725
|
-
$.BYTE_KANJI = new RegExp("[^A-Z0-9 $%*+\\-./:]+", "g");
|
|
726
|
-
$.BYTE = new RegExp(Ot, "g");
|
|
727
|
-
$.NUMERIC = new RegExp(mt, "g");
|
|
728
|
-
$.ALPHANUMERIC = new RegExp(Kt, "g");
|
|
729
|
-
const Yt = new RegExp("^" + se + "$"), jt = new RegExp("^" + mt + "$"), Jt = new RegExp("^[A-Z0-9 $%*+\\-./:]+$");
|
|
730
|
-
$.testKanji = function(e) {
|
|
731
|
-
return Yt.test(e);
|
|
732
|
-
};
|
|
733
|
-
$.testNumeric = function(e) {
|
|
734
|
-
return jt.test(e);
|
|
735
|
-
};
|
|
736
|
-
$.testAlphanumeric = function(e) {
|
|
737
|
-
return Jt.test(e);
|
|
738
|
-
};
|
|
739
|
-
(function(t) {
|
|
740
|
-
const e = Re, s = $;
|
|
741
|
-
t.NUMERIC = {
|
|
742
|
-
id: "Numeric",
|
|
743
|
-
bit: 1,
|
|
744
|
-
ccBits: [10, 12, 14]
|
|
745
|
-
}, t.ALPHANUMERIC = {
|
|
746
|
-
id: "Alphanumeric",
|
|
747
|
-
bit: 2,
|
|
748
|
-
ccBits: [9, 11, 13]
|
|
749
|
-
}, t.BYTE = {
|
|
750
|
-
id: "Byte",
|
|
751
|
-
bit: 4,
|
|
752
|
-
ccBits: [8, 16, 16]
|
|
753
|
-
}, t.KANJI = {
|
|
754
|
-
id: "Kanji",
|
|
755
|
-
bit: 8,
|
|
756
|
-
ccBits: [8, 10, 12]
|
|
757
|
-
}, t.MIXED = {
|
|
758
|
-
bit: -1
|
|
759
|
-
}, t.getCharCountIndicator = function(n, a) {
|
|
760
|
-
if (!n.ccBits) throw new Error("Invalid mode: " + n);
|
|
761
|
-
if (!e.isValid(a))
|
|
762
|
-
throw new Error("Invalid version: " + a);
|
|
763
|
-
return a >= 1 && a < 10 ? n.ccBits[0] : a < 27 ? n.ccBits[1] : n.ccBits[2];
|
|
764
|
-
}, t.getBestModeForData = function(n) {
|
|
765
|
-
return s.testNumeric(n) ? t.NUMERIC : s.testAlphanumeric(n) ? t.ALPHANUMERIC : s.testKanji(n) ? t.KANJI : t.BYTE;
|
|
766
|
-
}, t.toString = function(n) {
|
|
767
|
-
if (n && n.id) return n.id;
|
|
768
|
-
throw new Error("Invalid mode");
|
|
769
|
-
}, t.isValid = function(n) {
|
|
770
|
-
return n && n.bit && n.ccBits;
|
|
771
|
-
};
|
|
772
|
-
function r(o) {
|
|
773
|
-
if (typeof o != "string")
|
|
774
|
-
throw new Error("Param is not a string");
|
|
775
|
-
switch (o.toLowerCase()) {
|
|
776
|
-
case "numeric":
|
|
777
|
-
return t.NUMERIC;
|
|
778
|
-
case "alphanumeric":
|
|
779
|
-
return t.ALPHANUMERIC;
|
|
780
|
-
case "kanji":
|
|
781
|
-
return t.KANJI;
|
|
782
|
-
case "byte":
|
|
783
|
-
return t.BYTE;
|
|
784
|
-
default:
|
|
785
|
-
throw new Error("Unknown mode: " + o);
|
|
786
|
-
}
|
|
787
|
-
}
|
|
788
|
-
t.from = function(n, a) {
|
|
789
|
-
if (t.isValid(n))
|
|
790
|
-
return n;
|
|
791
|
-
try {
|
|
792
|
-
return r(n);
|
|
793
|
-
} catch {
|
|
794
|
-
return a;
|
|
795
|
-
}
|
|
796
|
-
};
|
|
797
|
-
})(O);
|
|
798
|
-
(function(t) {
|
|
799
|
-
const e = U, s = we, r = ye, o = O, n = Re, a = 7973, l = e.getBCHDigit(a);
|
|
800
|
-
function i(m, d, v) {
|
|
801
|
-
for (let C = 1; C <= 40; C++)
|
|
802
|
-
if (d <= t.getCapacity(C, v, m))
|
|
803
|
-
return C;
|
|
804
|
-
}
|
|
805
|
-
function u(m, d) {
|
|
806
|
-
return o.getCharCountIndicator(m, d) + 4;
|
|
807
|
-
}
|
|
808
|
-
function f(m, d) {
|
|
809
|
-
let v = 0;
|
|
810
|
-
return m.forEach(function(C) {
|
|
811
|
-
const I = u(C.mode, d);
|
|
812
|
-
v += I + C.getBitsLength();
|
|
813
|
-
}), v;
|
|
814
|
-
}
|
|
815
|
-
function A(m, d) {
|
|
816
|
-
for (let v = 1; v <= 40; v++)
|
|
817
|
-
if (f(m, v) <= t.getCapacity(v, d, o.MIXED))
|
|
818
|
-
return v;
|
|
819
|
-
}
|
|
820
|
-
t.from = function(d, v) {
|
|
821
|
-
return n.isValid(d) ? parseInt(d, 10) : v;
|
|
822
|
-
}, t.getCapacity = function(d, v, C) {
|
|
823
|
-
if (!n.isValid(d))
|
|
824
|
-
throw new Error("Invalid QR Code version");
|
|
825
|
-
typeof C > "u" && (C = o.BYTE);
|
|
826
|
-
const I = e.getSymbolTotalCodewords(d), p = s.getTotalCodewordsCount(d, v), b = (I - p) * 8;
|
|
827
|
-
if (C === o.MIXED) return b;
|
|
828
|
-
const g = b - u(C, d);
|
|
829
|
-
switch (C) {
|
|
830
|
-
case o.NUMERIC:
|
|
831
|
-
return Math.floor(g / 10 * 3);
|
|
832
|
-
case o.ALPHANUMERIC:
|
|
833
|
-
return Math.floor(g / 11 * 2);
|
|
834
|
-
case o.KANJI:
|
|
835
|
-
return Math.floor(g / 13);
|
|
836
|
-
case o.BYTE:
|
|
837
|
-
default:
|
|
838
|
-
return Math.floor(g / 8);
|
|
839
|
-
}
|
|
840
|
-
}, t.getBestVersionForData = function(d, v) {
|
|
841
|
-
let C;
|
|
842
|
-
const I = r.from(v, r.M);
|
|
843
|
-
if (Array.isArray(d)) {
|
|
844
|
-
if (d.length > 1)
|
|
845
|
-
return A(d, I);
|
|
846
|
-
if (d.length === 0)
|
|
847
|
-
return 1;
|
|
848
|
-
C = d[0];
|
|
849
|
-
} else
|
|
850
|
-
C = d;
|
|
851
|
-
return i(C.mode, C.getLength(), I);
|
|
852
|
-
}, t.getEncodedBits = function(d) {
|
|
853
|
-
if (!n.isValid(d) || d < 7)
|
|
854
|
-
throw new Error("Invalid QR Code version");
|
|
855
|
-
let v = d << 12;
|
|
856
|
-
for (; e.getBCHDigit(v) - l >= 0; )
|
|
857
|
-
v ^= a << e.getBCHDigit(v) - l;
|
|
858
|
-
return d << 12 | v;
|
|
859
|
-
};
|
|
860
|
-
})(ft);
|
|
861
|
-
var gt = {};
|
|
862
|
-
const Pe = U, ht = 1335, qt = 21522, Qe = Pe.getBCHDigit(ht);
|
|
863
|
-
gt.getEncodedBits = function(e, s) {
|
|
864
|
-
const r = e.bit << 3 | s;
|
|
865
|
-
let o = r << 10;
|
|
866
|
-
for (; Pe.getBCHDigit(o) - Qe >= 0; )
|
|
867
|
-
o ^= ht << Pe.getBCHDigit(o) - Qe;
|
|
868
|
-
return (r << 10 | o) ^ qt;
|
|
869
|
-
};
|
|
870
|
-
var pt = {};
|
|
871
|
-
const Gt = O;
|
|
872
|
-
function Q(t) {
|
|
873
|
-
this.mode = Gt.NUMERIC, this.data = t.toString();
|
|
874
|
-
}
|
|
875
|
-
Q.getBitsLength = function(e) {
|
|
876
|
-
return 10 * Math.floor(e / 3) + (e % 3 ? e % 3 * 3 + 1 : 0);
|
|
877
|
-
};
|
|
878
|
-
Q.prototype.getLength = function() {
|
|
879
|
-
return this.data.length;
|
|
880
|
-
};
|
|
881
|
-
Q.prototype.getBitsLength = function() {
|
|
882
|
-
return Q.getBitsLength(this.data.length);
|
|
883
|
-
};
|
|
884
|
-
Q.prototype.write = function(e) {
|
|
885
|
-
let s, r, o;
|
|
886
|
-
for (s = 0; s + 3 <= this.data.length; s += 3)
|
|
887
|
-
r = this.data.substr(s, 3), o = parseInt(r, 10), e.put(o, 10);
|
|
888
|
-
const n = this.data.length - s;
|
|
889
|
-
n > 0 && (r = this.data.substr(s), o = parseInt(r, 10), e.put(o, n * 3 + 1));
|
|
890
|
-
};
|
|
891
|
-
var Qt = Q;
|
|
892
|
-
const Wt = O, _e = [
|
|
893
|
-
"0",
|
|
894
|
-
"1",
|
|
895
|
-
"2",
|
|
896
|
-
"3",
|
|
897
|
-
"4",
|
|
898
|
-
"5",
|
|
899
|
-
"6",
|
|
900
|
-
"7",
|
|
901
|
-
"8",
|
|
902
|
-
"9",
|
|
903
|
-
"A",
|
|
904
|
-
"B",
|
|
905
|
-
"C",
|
|
906
|
-
"D",
|
|
907
|
-
"E",
|
|
908
|
-
"F",
|
|
909
|
-
"G",
|
|
910
|
-
"H",
|
|
911
|
-
"I",
|
|
912
|
-
"J",
|
|
913
|
-
"K",
|
|
914
|
-
"L",
|
|
915
|
-
"M",
|
|
916
|
-
"N",
|
|
917
|
-
"O",
|
|
918
|
-
"P",
|
|
919
|
-
"Q",
|
|
920
|
-
"R",
|
|
921
|
-
"S",
|
|
922
|
-
"T",
|
|
923
|
-
"U",
|
|
924
|
-
"V",
|
|
925
|
-
"W",
|
|
926
|
-
"X",
|
|
927
|
-
"Y",
|
|
928
|
-
"Z",
|
|
929
|
-
" ",
|
|
930
|
-
"$",
|
|
931
|
-
"%",
|
|
932
|
-
"*",
|
|
933
|
-
"+",
|
|
934
|
-
"-",
|
|
935
|
-
".",
|
|
936
|
-
"/",
|
|
937
|
-
":"
|
|
938
|
-
];
|
|
939
|
-
function W(t) {
|
|
940
|
-
this.mode = Wt.ALPHANUMERIC, this.data = t;
|
|
941
|
-
}
|
|
942
|
-
W.getBitsLength = function(e) {
|
|
943
|
-
return 11 * Math.floor(e / 2) + 6 * (e % 2);
|
|
944
|
-
};
|
|
945
|
-
W.prototype.getLength = function() {
|
|
946
|
-
return this.data.length;
|
|
947
|
-
};
|
|
948
|
-
W.prototype.getBitsLength = function() {
|
|
949
|
-
return W.getBitsLength(this.data.length);
|
|
950
|
-
};
|
|
951
|
-
W.prototype.write = function(e) {
|
|
952
|
-
let s;
|
|
953
|
-
for (s = 0; s + 2 <= this.data.length; s += 2) {
|
|
954
|
-
let r = _e.indexOf(this.data[s]) * 45;
|
|
955
|
-
r += _e.indexOf(this.data[s + 1]), e.put(r, 11);
|
|
956
|
-
}
|
|
957
|
-
this.data.length % 2 && e.put(_e.indexOf(this.data[s]), 6);
|
|
958
|
-
};
|
|
959
|
-
var Xt = W, Zt = function(e) {
|
|
960
|
-
for (var s = [], r = e.length, o = 0; o < r; o++) {
|
|
961
|
-
var n = e.charCodeAt(o);
|
|
962
|
-
if (n >= 55296 && n <= 56319 && r > o + 1) {
|
|
963
|
-
var a = e.charCodeAt(o + 1);
|
|
964
|
-
a >= 56320 && a <= 57343 && (n = (n - 55296) * 1024 + a - 56320 + 65536, o += 1);
|
|
965
|
-
}
|
|
966
|
-
if (n < 128) {
|
|
967
|
-
s.push(n);
|
|
968
|
-
continue;
|
|
969
|
-
}
|
|
970
|
-
if (n < 2048) {
|
|
971
|
-
s.push(n >> 6 | 192), s.push(n & 63 | 128);
|
|
972
|
-
continue;
|
|
973
|
-
}
|
|
974
|
-
if (n < 55296 || n >= 57344 && n < 65536) {
|
|
975
|
-
s.push(n >> 12 | 224), s.push(n >> 6 & 63 | 128), s.push(n & 63 | 128);
|
|
976
|
-
continue;
|
|
977
|
-
}
|
|
978
|
-
if (n >= 65536 && n <= 1114111) {
|
|
979
|
-
s.push(n >> 18 | 240), s.push(n >> 12 & 63 | 128), s.push(n >> 6 & 63 | 128), s.push(n & 63 | 128);
|
|
980
|
-
continue;
|
|
981
|
-
}
|
|
982
|
-
s.push(239, 191, 189);
|
|
983
|
-
}
|
|
984
|
-
return new Uint8Array(s).buffer;
|
|
985
|
-
};
|
|
986
|
-
const en = Zt, tn = O;
|
|
987
|
-
function X(t) {
|
|
988
|
-
this.mode = tn.BYTE, typeof t == "string" && (t = en(t)), this.data = new Uint8Array(t);
|
|
989
|
-
}
|
|
990
|
-
X.getBitsLength = function(e) {
|
|
991
|
-
return e * 8;
|
|
992
|
-
};
|
|
993
|
-
X.prototype.getLength = function() {
|
|
994
|
-
return this.data.length;
|
|
995
|
-
};
|
|
996
|
-
X.prototype.getBitsLength = function() {
|
|
997
|
-
return X.getBitsLength(this.data.length);
|
|
998
|
-
};
|
|
999
|
-
X.prototype.write = function(t) {
|
|
1000
|
-
for (let e = 0, s = this.data.length; e < s; e++)
|
|
1001
|
-
t.put(this.data[e], 8);
|
|
1002
|
-
};
|
|
1003
|
-
var nn = X;
|
|
1004
|
-
const on = O, rn = U;
|
|
1005
|
-
function Z(t) {
|
|
1006
|
-
this.mode = on.KANJI, this.data = t;
|
|
1007
|
-
}
|
|
1008
|
-
Z.getBitsLength = function(e) {
|
|
1009
|
-
return e * 13;
|
|
1010
|
-
};
|
|
1011
|
-
Z.prototype.getLength = function() {
|
|
1012
|
-
return this.data.length;
|
|
1013
|
-
};
|
|
1014
|
-
Z.prototype.getBitsLength = function() {
|
|
1015
|
-
return Z.getBitsLength(this.data.length);
|
|
1016
|
-
};
|
|
1017
|
-
Z.prototype.write = function(t) {
|
|
1018
|
-
let e;
|
|
1019
|
-
for (e = 0; e < this.data.length; e++) {
|
|
1020
|
-
let s = rn.toSJIS(this.data[e]);
|
|
1021
|
-
if (s >= 33088 && s <= 40956)
|
|
1022
|
-
s -= 33088;
|
|
1023
|
-
else if (s >= 57408 && s <= 60351)
|
|
1024
|
-
s -= 49472;
|
|
1025
|
-
else
|
|
1026
|
-
throw new Error(
|
|
1027
|
-
"Invalid SJIS character: " + this.data[e] + `
|
|
1028
|
-
Make sure your charset is UTF-8`
|
|
1029
|
-
);
|
|
1030
|
-
s = (s >>> 8 & 255) * 192 + (s & 255), t.put(s, 13);
|
|
1031
|
-
}
|
|
1032
|
-
};
|
|
1033
|
-
var sn = Z, yt = { exports: {} };
|
|
1034
|
-
(function(t) {
|
|
1035
|
-
var e = {
|
|
1036
|
-
single_source_shortest_paths: function(s, r, o) {
|
|
1037
|
-
var n = {}, a = {};
|
|
1038
|
-
a[r] = 0;
|
|
1039
|
-
var l = e.PriorityQueue.make();
|
|
1040
|
-
l.push(r, 0);
|
|
1041
|
-
for (var i, u, f, A, m, d, v, C, I; !l.empty(); ) {
|
|
1042
|
-
i = l.pop(), u = i.value, A = i.cost, m = s[u] || {};
|
|
1043
|
-
for (f in m)
|
|
1044
|
-
m.hasOwnProperty(f) && (d = m[f], v = A + d, C = a[f], I = typeof a[f] > "u", (I || C > v) && (a[f] = v, l.push(f, v), n[f] = u));
|
|
1045
|
-
}
|
|
1046
|
-
if (typeof o < "u" && typeof a[o] > "u") {
|
|
1047
|
-
var p = ["Could not find a path from ", r, " to ", o, "."].join("");
|
|
1048
|
-
throw new Error(p);
|
|
1049
|
-
}
|
|
1050
|
-
return n;
|
|
1051
|
-
},
|
|
1052
|
-
extract_shortest_path_from_predecessor_list: function(s, r) {
|
|
1053
|
-
for (var o = [], n = r; n; )
|
|
1054
|
-
o.push(n), s[n], n = s[n];
|
|
1055
|
-
return o.reverse(), o;
|
|
1056
|
-
},
|
|
1057
|
-
find_path: function(s, r, o) {
|
|
1058
|
-
var n = e.single_source_shortest_paths(s, r, o);
|
|
1059
|
-
return e.extract_shortest_path_from_predecessor_list(
|
|
1060
|
-
n,
|
|
1061
|
-
o
|
|
1062
|
-
);
|
|
1063
|
-
},
|
|
1064
|
-
/**
|
|
1065
|
-
* A very naive priority queue implementation.
|
|
1066
|
-
*/
|
|
1067
|
-
PriorityQueue: {
|
|
1068
|
-
make: function(s) {
|
|
1069
|
-
var r = e.PriorityQueue, o = {}, n;
|
|
1070
|
-
s = s || {};
|
|
1071
|
-
for (n in r)
|
|
1072
|
-
r.hasOwnProperty(n) && (o[n] = r[n]);
|
|
1073
|
-
return o.queue = [], o.sorter = s.sorter || r.default_sorter, o;
|
|
1074
|
-
},
|
|
1075
|
-
default_sorter: function(s, r) {
|
|
1076
|
-
return s.cost - r.cost;
|
|
1077
|
-
},
|
|
1078
|
-
/**
|
|
1079
|
-
* Add a new item to the queue and ensure the highest priority element
|
|
1080
|
-
* is at the front of the queue.
|
|
1081
|
-
*/
|
|
1082
|
-
push: function(s, r) {
|
|
1083
|
-
var o = { value: s, cost: r };
|
|
1084
|
-
this.queue.push(o), this.queue.sort(this.sorter);
|
|
1085
|
-
},
|
|
1086
|
-
/**
|
|
1087
|
-
* Return the highest priority element in the queue.
|
|
1088
|
-
*/
|
|
1089
|
-
pop: function() {
|
|
1090
|
-
return this.queue.shift();
|
|
1091
|
-
},
|
|
1092
|
-
empty: function() {
|
|
1093
|
-
return this.queue.length === 0;
|
|
1094
|
-
}
|
|
1095
|
-
}
|
|
1096
|
-
};
|
|
1097
|
-
t.exports = e;
|
|
1098
|
-
})(yt);
|
|
1099
|
-
var an = yt.exports;
|
|
1100
|
-
(function(t) {
|
|
1101
|
-
const e = O, s = Qt, r = Xt, o = nn, n = sn, a = $, l = U, i = an;
|
|
1102
|
-
function u(p) {
|
|
1103
|
-
return unescape(encodeURIComponent(p)).length;
|
|
1104
|
-
}
|
|
1105
|
-
function f(p, b, g) {
|
|
1106
|
-
const w = [];
|
|
1107
|
-
let B;
|
|
1108
|
-
for (; (B = p.exec(g)) !== null; )
|
|
1109
|
-
w.push({
|
|
1110
|
-
data: B[0],
|
|
1111
|
-
index: B.index,
|
|
1112
|
-
mode: b,
|
|
1113
|
-
length: B[0].length
|
|
1114
|
-
});
|
|
1115
|
-
return w;
|
|
1116
|
-
}
|
|
1117
|
-
function A(p) {
|
|
1118
|
-
const b = f(a.NUMERIC, e.NUMERIC, p), g = f(a.ALPHANUMERIC, e.ALPHANUMERIC, p);
|
|
1119
|
-
let w, B;
|
|
1120
|
-
return l.isKanjiModeEnabled() ? (w = f(a.BYTE, e.BYTE, p), B = f(a.KANJI, e.KANJI, p)) : (w = f(a.BYTE_KANJI, e.BYTE, p), B = []), b.concat(g, w, B).sort(function(P, N) {
|
|
1121
|
-
return P.index - N.index;
|
|
1122
|
-
}).map(function(P) {
|
|
1123
|
-
return {
|
|
1124
|
-
data: P.data,
|
|
1125
|
-
mode: P.mode,
|
|
1126
|
-
length: P.length
|
|
1127
|
-
};
|
|
1128
|
-
});
|
|
1129
|
-
}
|
|
1130
|
-
function m(p, b) {
|
|
1131
|
-
switch (b) {
|
|
1132
|
-
case e.NUMERIC:
|
|
1133
|
-
return s.getBitsLength(p);
|
|
1134
|
-
case e.ALPHANUMERIC:
|
|
1135
|
-
return r.getBitsLength(p);
|
|
1136
|
-
case e.KANJI:
|
|
1137
|
-
return n.getBitsLength(p);
|
|
1138
|
-
case e.BYTE:
|
|
1139
|
-
return o.getBitsLength(p);
|
|
1140
|
-
}
|
|
1141
|
-
}
|
|
1142
|
-
function d(p) {
|
|
1143
|
-
return p.reduce(function(b, g) {
|
|
1144
|
-
const w = b.length - 1 >= 0 ? b[b.length - 1] : null;
|
|
1145
|
-
return w && w.mode === g.mode ? (b[b.length - 1].data += g.data, b) : (b.push(g), b);
|
|
1146
|
-
}, []);
|
|
1147
|
-
}
|
|
1148
|
-
function v(p) {
|
|
1149
|
-
const b = [];
|
|
1150
|
-
for (let g = 0; g < p.length; g++) {
|
|
1151
|
-
const w = p[g];
|
|
1152
|
-
switch (w.mode) {
|
|
1153
|
-
case e.NUMERIC:
|
|
1154
|
-
b.push([
|
|
1155
|
-
w,
|
|
1156
|
-
{ data: w.data, mode: e.ALPHANUMERIC, length: w.length },
|
|
1157
|
-
{ data: w.data, mode: e.BYTE, length: w.length }
|
|
1158
|
-
]);
|
|
1159
|
-
break;
|
|
1160
|
-
case e.ALPHANUMERIC:
|
|
1161
|
-
b.push([
|
|
1162
|
-
w,
|
|
1163
|
-
{ data: w.data, mode: e.BYTE, length: w.length }
|
|
1164
|
-
]);
|
|
1165
|
-
break;
|
|
1166
|
-
case e.KANJI:
|
|
1167
|
-
b.push([
|
|
1168
|
-
w,
|
|
1169
|
-
{ data: w.data, mode: e.BYTE, length: u(w.data) }
|
|
1170
|
-
]);
|
|
1171
|
-
break;
|
|
1172
|
-
case e.BYTE:
|
|
1173
|
-
b.push([
|
|
1174
|
-
{ data: w.data, mode: e.BYTE, length: u(w.data) }
|
|
1175
|
-
]);
|
|
1176
|
-
}
|
|
1177
|
-
}
|
|
1178
|
-
return b;
|
|
1179
|
-
}
|
|
1180
|
-
function C(p, b) {
|
|
1181
|
-
const g = {}, w = { start: {} };
|
|
1182
|
-
let B = ["start"];
|
|
1183
|
-
for (let M = 0; M < p.length; M++) {
|
|
1184
|
-
const P = p[M], N = [];
|
|
1185
|
-
for (let D = 0; D < P.length; D++) {
|
|
1186
|
-
const L = P[D], Y = "" + M + D;
|
|
1187
|
-
N.push(Y), g[Y] = { node: L, lastCount: 0 }, w[Y] = {};
|
|
1188
|
-
for (let E = 0; E < B.length; E++) {
|
|
1189
|
-
const h = B[E];
|
|
1190
|
-
g[h] && g[h].node.mode === L.mode ? (w[h][Y] = m(g[h].lastCount + L.length, L.mode) - m(g[h].lastCount, L.mode), g[h].lastCount += L.length) : (g[h] && (g[h].lastCount = L.length), w[h][Y] = m(L.length, L.mode) + 4 + e.getCharCountIndicator(L.mode, b));
|
|
1191
|
-
}
|
|
1192
|
-
}
|
|
1193
|
-
B = N;
|
|
1194
|
-
}
|
|
1195
|
-
for (let M = 0; M < B.length; M++)
|
|
1196
|
-
w[B[M]].end = 0;
|
|
1197
|
-
return { map: w, table: g };
|
|
1198
|
-
}
|
|
1199
|
-
function I(p, b) {
|
|
1200
|
-
let g;
|
|
1201
|
-
const w = e.getBestModeForData(p);
|
|
1202
|
-
if (g = e.from(b, w), g !== e.BYTE && g.bit < w.bit)
|
|
1203
|
-
throw new Error('"' + p + '" cannot be encoded with mode ' + e.toString(g) + `.
|
|
1204
|
-
Suggested mode is: ` + e.toString(w));
|
|
1205
|
-
switch (g === e.KANJI && !l.isKanjiModeEnabled() && (g = e.BYTE), g) {
|
|
1206
|
-
case e.NUMERIC:
|
|
1207
|
-
return new s(p);
|
|
1208
|
-
case e.ALPHANUMERIC:
|
|
1209
|
-
return new r(p);
|
|
1210
|
-
case e.KANJI:
|
|
1211
|
-
return new n(p);
|
|
1212
|
-
case e.BYTE:
|
|
1213
|
-
return new o(p);
|
|
1214
|
-
}
|
|
1215
|
-
}
|
|
1216
|
-
t.fromArray = function(b) {
|
|
1217
|
-
return b.reduce(function(g, w) {
|
|
1218
|
-
return typeof w == "string" ? g.push(I(w, null)) : w.data && g.push(I(w.data, w.mode)), g;
|
|
1219
|
-
}, []);
|
|
1220
|
-
}, t.fromString = function(b, g) {
|
|
1221
|
-
const w = A(b, l.isKanjiModeEnabled()), B = v(w), M = C(B, g), P = i.find_path(M.map, "start", "end"), N = [];
|
|
1222
|
-
for (let D = 1; D < P.length - 1; D++)
|
|
1223
|
-
N.push(M.table[P[D]].node);
|
|
1224
|
-
return t.fromArray(d(N));
|
|
1225
|
-
}, t.rawSplit = function(b) {
|
|
1226
|
-
return t.fromArray(
|
|
1227
|
-
A(b, l.isKanjiModeEnabled())
|
|
1228
|
-
);
|
|
1229
|
-
};
|
|
1230
|
-
})(pt);
|
|
1231
|
-
const ve = U, Ee = ye, ln = xt, cn = $t, un = at, dn = lt, Te = ct, Ne = we, fn = Ht, pe = ft, mn = gt, gn = O, Ae = pt;
|
|
1232
|
-
function hn(t, e) {
|
|
1233
|
-
const s = t.size, r = dn.getPositions(e);
|
|
1234
|
-
for (let o = 0; o < r.length; o++) {
|
|
1235
|
-
const n = r[o][0], a = r[o][1];
|
|
1236
|
-
for (let l = -1; l <= 7; l++)
|
|
1237
|
-
if (!(n + l <= -1 || s <= n + l))
|
|
1238
|
-
for (let i = -1; i <= 7; i++)
|
|
1239
|
-
a + i <= -1 || s <= a + i || (l >= 0 && l <= 6 && (i === 0 || i === 6) || i >= 0 && i <= 6 && (l === 0 || l === 6) || l >= 2 && l <= 4 && i >= 2 && i <= 4 ? t.set(n + l, a + i, !0, !0) : t.set(n + l, a + i, !1, !0));
|
|
1240
|
-
}
|
|
1241
|
-
}
|
|
1242
|
-
function pn(t) {
|
|
1243
|
-
const e = t.size;
|
|
1244
|
-
for (let s = 8; s < e - 8; s++) {
|
|
1245
|
-
const r = s % 2 === 0;
|
|
1246
|
-
t.set(s, 6, r, !0), t.set(6, s, r, !0);
|
|
1247
|
-
}
|
|
1248
|
-
}
|
|
1249
|
-
function yn(t, e) {
|
|
1250
|
-
const s = un.getPositions(e);
|
|
1251
|
-
for (let r = 0; r < s.length; r++) {
|
|
1252
|
-
const o = s[r][0], n = s[r][1];
|
|
1253
|
-
for (let a = -2; a <= 2; a++)
|
|
1254
|
-
for (let l = -2; l <= 2; l++)
|
|
1255
|
-
a === -2 || a === 2 || l === -2 || l === 2 || a === 0 && l === 0 ? t.set(o + a, n + l, !0, !0) : t.set(o + a, n + l, !1, !0);
|
|
1256
|
-
}
|
|
1257
|
-
}
|
|
1258
|
-
function wn(t, e) {
|
|
1259
|
-
const s = t.size, r = pe.getEncodedBits(e);
|
|
1260
|
-
let o, n, a;
|
|
1261
|
-
for (let l = 0; l < 18; l++)
|
|
1262
|
-
o = Math.floor(l / 3), n = l % 3 + s - 8 - 3, a = (r >> l & 1) === 1, t.set(o, n, a, !0), t.set(n, o, a, !0);
|
|
1263
|
-
}
|
|
1264
|
-
function Be(t, e, s) {
|
|
1265
|
-
const r = t.size, o = mn.getEncodedBits(e, s);
|
|
1266
|
-
let n, a;
|
|
1267
|
-
for (n = 0; n < 15; n++)
|
|
1268
|
-
a = (o >> n & 1) === 1, n < 6 ? t.set(n, 8, a, !0) : n < 8 ? t.set(n + 1, 8, a, !0) : t.set(r - 15 + n, 8, a, !0), n < 8 ? t.set(8, r - n - 1, a, !0) : n < 9 ? t.set(8, 15 - n - 1 + 1, a, !0) : t.set(8, 15 - n - 1, a, !0);
|
|
1269
|
-
t.set(r - 8, 8, 1, !0);
|
|
1270
|
-
}
|
|
1271
|
-
function bn(t, e) {
|
|
1272
|
-
const s = t.size;
|
|
1273
|
-
let r = -1, o = s - 1, n = 7, a = 0;
|
|
1274
|
-
for (let l = s - 1; l > 0; l -= 2)
|
|
1275
|
-
for (l === 6 && l--; ; ) {
|
|
1276
|
-
for (let i = 0; i < 2; i++)
|
|
1277
|
-
if (!t.isReserved(o, l - i)) {
|
|
1278
|
-
let u = !1;
|
|
1279
|
-
a < e.length && (u = (e[a] >>> n & 1) === 1), t.set(o, l - i, u), n--, n === -1 && (a++, n = 7);
|
|
1280
|
-
}
|
|
1281
|
-
if (o += r, o < 0 || s <= o) {
|
|
1282
|
-
o -= r, r = -r;
|
|
1283
|
-
break;
|
|
1284
|
-
}
|
|
1285
|
-
}
|
|
1286
|
-
}
|
|
1287
|
-
function vn(t, e, s) {
|
|
1288
|
-
const r = new ln();
|
|
1289
|
-
s.forEach(function(i) {
|
|
1290
|
-
r.put(i.mode.bit, 4), r.put(i.getLength(), gn.getCharCountIndicator(i.mode, t)), i.write(r);
|
|
1291
|
-
});
|
|
1292
|
-
const o = ve.getSymbolTotalCodewords(t), n = Ne.getTotalCodewordsCount(t, e), a = (o - n) * 8;
|
|
1293
|
-
for (r.getLengthInBits() + 4 <= a && r.put(0, 4); r.getLengthInBits() % 8 !== 0; )
|
|
1294
|
-
r.putBit(0);
|
|
1295
|
-
const l = (a - r.getLengthInBits()) / 8;
|
|
1296
|
-
for (let i = 0; i < l; i++)
|
|
1297
|
-
r.put(i % 2 ? 17 : 236, 8);
|
|
1298
|
-
return Cn(r, t, e);
|
|
1299
|
-
}
|
|
1300
|
-
function Cn(t, e, s) {
|
|
1301
|
-
const r = ve.getSymbolTotalCodewords(e), o = Ne.getTotalCodewordsCount(e, s), n = r - o, a = Ne.getBlocksCount(e, s), l = r % a, i = a - l, u = Math.floor(r / a), f = Math.floor(n / a), A = f + 1, m = u - f, d = new fn(m);
|
|
1302
|
-
let v = 0;
|
|
1303
|
-
const C = new Array(a), I = new Array(a);
|
|
1304
|
-
let p = 0;
|
|
1305
|
-
const b = new Uint8Array(t.buffer);
|
|
1306
|
-
for (let P = 0; P < a; P++) {
|
|
1307
|
-
const N = P < i ? f : A;
|
|
1308
|
-
C[P] = b.slice(v, v + N), I[P] = d.encode(C[P]), v += N, p = Math.max(p, N);
|
|
1309
|
-
}
|
|
1310
|
-
const g = new Uint8Array(r);
|
|
1311
|
-
let w = 0, B, M;
|
|
1312
|
-
for (B = 0; B < p; B++)
|
|
1313
|
-
for (M = 0; M < a; M++)
|
|
1314
|
-
B < C[M].length && (g[w++] = C[M][B]);
|
|
1315
|
-
for (B = 0; B < m; B++)
|
|
1316
|
-
for (M = 0; M < a; M++)
|
|
1317
|
-
g[w++] = I[M][B];
|
|
1318
|
-
return g;
|
|
1319
|
-
}
|
|
1320
|
-
function _n(t, e, s, r) {
|
|
1321
|
-
let o;
|
|
1322
|
-
if (Array.isArray(t))
|
|
1323
|
-
o = Ae.fromArray(t);
|
|
1324
|
-
else if (typeof t == "string") {
|
|
1325
|
-
let u = e;
|
|
1326
|
-
if (!u) {
|
|
1327
|
-
const f = Ae.rawSplit(t);
|
|
1328
|
-
u = pe.getBestVersionForData(f, s);
|
|
1329
|
-
}
|
|
1330
|
-
o = Ae.fromString(t, u || 40);
|
|
1331
|
-
} else
|
|
1332
|
-
throw new Error("Invalid data");
|
|
1333
|
-
const n = pe.getBestVersionForData(o, s);
|
|
1334
|
-
if (!n)
|
|
1335
|
-
throw new Error("The amount of data is too big to be stored in a QR Code");
|
|
1336
|
-
if (!e)
|
|
1337
|
-
e = n;
|
|
1338
|
-
else if (e < n)
|
|
1339
|
-
throw new Error(
|
|
1340
|
-
`
|
|
1341
|
-
The chosen QR Code version cannot contain this amount of data.
|
|
1342
|
-
Minimum version required to store current data is: ` + n + `.
|
|
1343
|
-
`
|
|
1344
|
-
);
|
|
1345
|
-
const a = vn(e, s, o), l = ve.getSymbolSize(e), i = new cn(l);
|
|
1346
|
-
return hn(i, e), pn(i), yn(i, e), Be(i, s, 0), e >= 7 && wn(i, e), bn(i, a), isNaN(r) && (r = Te.getBestMask(
|
|
1347
|
-
i,
|
|
1348
|
-
Be.bind(null, i, s)
|
|
1349
|
-
)), Te.applyMask(r, i), Be(i, s, r), {
|
|
1350
|
-
modules: i,
|
|
1351
|
-
version: e,
|
|
1352
|
-
errorCorrectionLevel: s,
|
|
1353
|
-
maskPattern: r,
|
|
1354
|
-
segments: o
|
|
1355
|
-
};
|
|
1356
|
-
}
|
|
1357
|
-
st.create = function(e, s) {
|
|
1358
|
-
if (typeof e > "u" || e === "")
|
|
1359
|
-
throw new Error("No input text");
|
|
1360
|
-
let r = Ee.M, o, n;
|
|
1361
|
-
return typeof s < "u" && (r = Ee.from(s.errorCorrectionLevel, Ee.M), o = pe.from(s.version), n = Te.from(s.maskPattern), s.toSJISFunc && ve.setToSJISFunction(s.toSJISFunc)), _n(e, o, r, n);
|
|
1362
|
-
};
|
|
1363
|
-
var wt = {}, ke = {};
|
|
1364
|
-
(function(t) {
|
|
1365
|
-
function e(s) {
|
|
1366
|
-
if (typeof s == "number" && (s = s.toString()), typeof s != "string")
|
|
1367
|
-
throw new Error("Color should be defined as hex string");
|
|
1368
|
-
let r = s.slice().replace("#", "").split("");
|
|
1369
|
-
if (r.length < 3 || r.length === 5 || r.length > 8)
|
|
1370
|
-
throw new Error("Invalid hex color: " + s);
|
|
1371
|
-
(r.length === 3 || r.length === 4) && (r = Array.prototype.concat.apply([], r.map(function(n) {
|
|
1372
|
-
return [n, n];
|
|
1373
|
-
}))), r.length === 6 && r.push("F", "F");
|
|
1374
|
-
const o = parseInt(r.join(""), 16);
|
|
1375
|
-
return {
|
|
1376
|
-
r: o >> 24 & 255,
|
|
1377
|
-
g: o >> 16 & 255,
|
|
1378
|
-
b: o >> 8 & 255,
|
|
1379
|
-
a: o & 255,
|
|
1380
|
-
hex: "#" + r.slice(0, 6).join("")
|
|
1381
|
-
};
|
|
1382
|
-
}
|
|
1383
|
-
t.getOptions = function(r) {
|
|
1384
|
-
r || (r = {}), r.color || (r.color = {});
|
|
1385
|
-
const o = typeof r.margin > "u" || r.margin === null || r.margin < 0 ? 4 : r.margin, n = r.width && r.width >= 21 ? r.width : void 0, a = r.scale || 4;
|
|
1386
|
-
return {
|
|
1387
|
-
width: n,
|
|
1388
|
-
scale: n ? 4 : a,
|
|
1389
|
-
margin: o,
|
|
1390
|
-
color: {
|
|
1391
|
-
dark: e(r.color.dark || "#000000ff"),
|
|
1392
|
-
light: e(r.color.light || "#ffffffff")
|
|
1393
|
-
},
|
|
1394
|
-
type: r.type,
|
|
1395
|
-
rendererOpts: r.rendererOpts || {}
|
|
1396
|
-
};
|
|
1397
|
-
}, t.getScale = function(r, o) {
|
|
1398
|
-
return o.width && o.width >= r + o.margin * 2 ? o.width / (r + o.margin * 2) : o.scale;
|
|
1399
|
-
}, t.getImageWidth = function(r, o) {
|
|
1400
|
-
const n = t.getScale(r, o);
|
|
1401
|
-
return Math.floor((r + o.margin * 2) * n);
|
|
1402
|
-
}, t.qrToImageData = function(r, o, n) {
|
|
1403
|
-
const a = o.modules.size, l = o.modules.data, i = t.getScale(a, n), u = Math.floor((a + n.margin * 2) * i), f = n.margin * i, A = [n.color.light, n.color.dark];
|
|
1404
|
-
for (let m = 0; m < u; m++)
|
|
1405
|
-
for (let d = 0; d < u; d++) {
|
|
1406
|
-
let v = (m * u + d) * 4, C = n.color.light;
|
|
1407
|
-
if (m >= f && d >= f && m < u - f && d < u - f) {
|
|
1408
|
-
const I = Math.floor((m - f) / i), p = Math.floor((d - f) / i);
|
|
1409
|
-
C = A[l[I * a + p] ? 1 : 0];
|
|
1410
|
-
}
|
|
1411
|
-
r[v++] = C.r, r[v++] = C.g, r[v++] = C.b, r[v] = C.a;
|
|
1412
|
-
}
|
|
1413
|
-
};
|
|
1414
|
-
})(ke);
|
|
1415
|
-
(function(t) {
|
|
1416
|
-
const e = ke;
|
|
1417
|
-
function s(o, n, a) {
|
|
1418
|
-
o.clearRect(0, 0, n.width, n.height), n.style || (n.style = {}), n.height = a, n.width = a, n.style.height = a + "px", n.style.width = a + "px";
|
|
1419
|
-
}
|
|
1420
|
-
function r() {
|
|
1421
|
-
try {
|
|
1422
|
-
return document.createElement("canvas");
|
|
1423
|
-
} catch {
|
|
1424
|
-
throw new Error("You need to specify a canvas element");
|
|
1425
|
-
}
|
|
1426
|
-
}
|
|
1427
|
-
t.render = function(n, a, l) {
|
|
1428
|
-
let i = l, u = a;
|
|
1429
|
-
typeof i > "u" && (!a || !a.getContext) && (i = a, a = void 0), a || (u = r()), i = e.getOptions(i);
|
|
1430
|
-
const f = e.getImageWidth(n.modules.size, i), A = u.getContext("2d"), m = A.createImageData(f, f);
|
|
1431
|
-
return e.qrToImageData(m.data, n, i), s(A, u, f), A.putImageData(m, 0, 0), u;
|
|
1432
|
-
}, t.renderToDataURL = function(n, a, l) {
|
|
1433
|
-
let i = l;
|
|
1434
|
-
typeof i > "u" && (!a || !a.getContext) && (i = a, a = void 0), i || (i = {});
|
|
1435
|
-
const u = t.render(n, a, i), f = i.type || "image/png", A = i.rendererOpts || {};
|
|
1436
|
-
return u.toDataURL(f, A.quality);
|
|
1437
|
-
};
|
|
1438
|
-
})(wt);
|
|
1439
|
-
var bt = {};
|
|
1440
|
-
const En = ke;
|
|
1441
|
-
function We(t, e) {
|
|
1442
|
-
const s = t.a / 255, r = e + '="' + t.hex + '"';
|
|
1443
|
-
return s < 1 ? r + " " + e + '-opacity="' + s.toFixed(2).slice(1) + '"' : r;
|
|
1444
|
-
}
|
|
1445
|
-
function Me(t, e, s) {
|
|
1446
|
-
let r = t + e;
|
|
1447
|
-
return typeof s < "u" && (r += " " + s), r;
|
|
1448
|
-
}
|
|
1449
|
-
function An(t, e, s) {
|
|
1450
|
-
let r = "", o = 0, n = !1, a = 0;
|
|
1451
|
-
for (let l = 0; l < t.length; l++) {
|
|
1452
|
-
const i = Math.floor(l % e), u = Math.floor(l / e);
|
|
1453
|
-
!i && !n && (n = !0), t[l] ? (a++, l > 0 && i > 0 && t[l - 1] || (r += n ? Me("M", i + s, 0.5 + u + s) : Me("m", o, 0), o = 0, n = !1), i + 1 < e && t[l + 1] || (r += Me("h", a), a = 0)) : o++;
|
|
1454
|
-
}
|
|
1455
|
-
return r;
|
|
1456
|
-
}
|
|
1457
|
-
bt.render = function(e, s, r) {
|
|
1458
|
-
const o = En.getOptions(s), n = e.modules.size, a = e.modules.data, l = n + o.margin * 2, i = o.color.light.a ? "<path " + We(o.color.light, "fill") + ' d="M0 0h' + l + "v" + l + 'H0z"/>' : "", u = "<path " + We(o.color.dark, "stroke") + ' d="' + An(a, n, o.margin) + '"/>', f = 'viewBox="0 0 ' + l + " " + l + '"', m = '<svg xmlns="http://www.w3.org/2000/svg" ' + (o.width ? 'width="' + o.width + '" height="' + o.width + '" ' : "") + f + ' shape-rendering="crispEdges">' + i + u + `</svg>
|
|
1459
|
-
`;
|
|
1460
|
-
return typeof r == "function" && r(null, m), m;
|
|
1461
|
-
};
|
|
1462
|
-
const Bn = Dt, Ue = st, vt = wt, Mn = bt;
|
|
1463
|
-
function De(t, e, s, r, o) {
|
|
1464
|
-
const n = [].slice.call(arguments, 1), a = n.length, l = typeof n[a - 1] == "function";
|
|
1465
|
-
if (!l && !Bn())
|
|
1466
|
-
throw new Error("Callback required as last argument");
|
|
1467
|
-
if (l) {
|
|
1468
|
-
if (a < 2)
|
|
1469
|
-
throw new Error("Too few arguments provided");
|
|
1470
|
-
a === 2 ? (o = s, s = e, e = r = void 0) : a === 3 && (e.getContext && typeof o > "u" ? (o = r, r = void 0) : (o = r, r = s, s = e, e = void 0));
|
|
1471
|
-
} else {
|
|
1472
|
-
if (a < 1)
|
|
1473
|
-
throw new Error("Too few arguments provided");
|
|
1474
|
-
return a === 1 ? (s = e, e = r = void 0) : a === 2 && !e.getContext && (r = s, s = e, e = void 0), new Promise(function(i, u) {
|
|
1475
|
-
try {
|
|
1476
|
-
const f = Ue.create(s, r);
|
|
1477
|
-
i(t(f, e, r));
|
|
1478
|
-
} catch (f) {
|
|
1479
|
-
u(f);
|
|
1480
|
-
}
|
|
1481
|
-
});
|
|
1482
|
-
}
|
|
1483
|
-
try {
|
|
1484
|
-
const i = Ue.create(s, r);
|
|
1485
|
-
o(null, t(i, e, r));
|
|
1486
|
-
} catch (i) {
|
|
1487
|
-
o(i);
|
|
1488
|
-
}
|
|
1489
|
-
}
|
|
1490
|
-
ie.create = Ue.create;
|
|
1491
|
-
ie.toCanvas = De.bind(null, vt.render);
|
|
1492
|
-
ie.toDataURL = De.bind(null, vt.renderToDataURL);
|
|
1493
|
-
ie.toString = De.bind(null, function(t, e, s) {
|
|
1494
|
-
return Mn.render(t, s);
|
|
1495
|
-
});
|
|
1496
|
-
async function Sn(t, e = 350) {
|
|
1497
|
-
try {
|
|
1498
|
-
return await ie.toDataURL(t, {
|
|
1499
|
-
width: e,
|
|
1500
|
-
margin: 0
|
|
1501
|
-
});
|
|
1502
|
-
} catch (s) {
|
|
1503
|
-
console.error(s);
|
|
1504
|
-
}
|
|
1505
|
-
}
|
|
1506
|
-
var In = { authUrl: "https://portal-v2.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "member.feedme.cc", crmUrl: "crm.feedme.cc", paymentPortalUrl: "https://portal.feedme.cc/payment/payout-account", licensePortalUrl: "https://license.feedme.cc/", marketingV1Portal: "https://marketing-v1.feedme.cc" };
|
|
1507
|
-
const Pn = { class: "flex items-start" }, Tn = /* @__PURE__ */ y("div", null, [
|
|
1508
|
-
/* @__PURE__ */ y("div", { class: "fm-typo-en-title-sm-800" }, "Link device"),
|
|
1509
|
-
/* @__PURE__ */ y("div", { class: "fm-typo-en-body-sm-400" }, " Open your camera on your device to link counter app. ")
|
|
1510
|
-
], -1), Nn = { class: "flex flex-col gap-16 mt-16" }, Un = ["src"], Ln = /* @__PURE__ */ Xe({
|
|
1511
|
-
__name: "LinkDeviceDialog",
|
|
1512
|
-
setup(t) {
|
|
1513
|
-
const e = Ie(), s = ot(), r = tt(), o = z(), n = z(), a = In.crmUrl, l = z(), i = ge(() => s.membership), u = ge(() => {
|
|
1514
|
-
var m, d;
|
|
1515
|
-
return `https://${(m = i.value) != null && m.url ? i.value.url : (d = i.value) == null ? void 0 : d.business}.${a}`;
|
|
1516
|
-
});
|
|
1517
|
-
async function f(m) {
|
|
1518
|
-
const d = await nt.getOtp(m);
|
|
1519
|
-
return `${u.value}?link-device=${d.otp}`;
|
|
1520
|
-
}
|
|
1521
|
-
async function A(m) {
|
|
1522
|
-
const d = await f(m);
|
|
1523
|
-
l.value = d, o.value = await Sn(d);
|
|
1524
|
-
}
|
|
1525
|
-
return Ze(async () => {
|
|
1526
|
-
if (await e.readLocations(), !e.locations.length) {
|
|
1527
|
-
r.close();
|
|
1528
|
-
return;
|
|
1529
|
-
}
|
|
1530
|
-
const m = e.locations[0]._id;
|
|
1531
|
-
n.value = m, await A(m);
|
|
1532
|
-
}), (m, d) => {
|
|
1533
|
-
const v = F("FmIcon"), C = F("FmSelect"), I = F("FmButton"), p = F("FmCard");
|
|
1534
|
-
return x(), me(p, { class: "p-24 max-w-[350px]" }, {
|
|
1535
|
-
default: ne(() => [
|
|
1536
|
-
y("div", Pn, [
|
|
1537
|
-
Tn,
|
|
1538
|
-
S(v, {
|
|
1539
|
-
name: "close",
|
|
1540
|
-
onClick: d[0] || (d[0] = (b) => c(r).close()),
|
|
1541
|
-
class: "cursor-pointer"
|
|
1542
|
-
})
|
|
1543
|
-
]),
|
|
1544
|
-
y("div", Nn, [
|
|
1545
|
-
S(C, {
|
|
1546
|
-
modelValue: c(n),
|
|
1547
|
-
"onUpdate:modelValue": [
|
|
1548
|
-
d[1] || (d[1] = (b) => et(n) ? n.value = b : null),
|
|
1549
|
-
A
|
|
1550
|
-
],
|
|
1551
|
-
label: "Select Location",
|
|
1552
|
-
items: c(e).locationItems.filter((b) => !!b.value)
|
|
1553
|
-
}, null, 8, ["modelValue", "items"]),
|
|
1554
|
-
y("img", {
|
|
1555
|
-
src: c(o),
|
|
1556
|
-
class: "aspect-square w-full"
|
|
1557
|
-
}, null, 8, Un),
|
|
1558
|
-
S(I, {
|
|
1559
|
-
class: "mx-auto",
|
|
1560
|
-
variant: "plain",
|
|
1561
|
-
icon: "content_copy",
|
|
1562
|
-
onClick: d[2] || (d[2] = (b) => c(rt)(c(l)))
|
|
1563
|
-
})
|
|
1564
|
-
])
|
|
1565
|
-
]),
|
|
1566
|
-
_: 1
|
|
1567
|
-
});
|
|
1568
|
-
};
|
|
1569
|
-
}
|
|
1570
|
-
});
|
|
1571
|
-
var Se = { authUrl: "https://portal-v2.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "member.feedme.cc", crmUrl: "crm.feedme.cc", paymentPortalUrl: "https://portal.feedme.cc/payment/payout-account", licensePortalUrl: "https://license.feedme.cc/", marketingV1Portal: "https://marketing-v1.feedme.cc" };
|
|
1572
|
-
const Fn = { class: "hidden xs:flex items-center justify-between px-16 py-12 border-b border-fm-color-neutral-gray-100" }, Rn = { class: "fm-typo-en-title-md-800" }, kn = {
|
|
1573
|
-
key: 0,
|
|
1574
|
-
class: "px-24 gap-32 grid grid-cols-3 xs:pt-16"
|
|
1575
|
-
}, Dn = { class: "col-span-2 flex flex-col xs:col-span-3 space-y-8" }, Vn = { class: "fm-typo-en-title-sm-800" }, xn = { class: "space-y-24" }, $n = { class: "space-y-8" }, zn = { class: "fm-typo-en-title-sm-800" }, Hn = { class: "fm-typo-body-lg-400" }, Kn = { class: "fm-typo-body-md-400 text-fm-color-typo-secondary" }, On = { class: "fm-typo-body-md-400 text-fm-color-typo-secondary" }, Yn = { class: "space-y-8" }, jn = { class: "fm-typo-en-title-sm-800 flex items-center gap-8" }, Jn = { class: "space-y-8" }, qn = /* @__PURE__ */ y("div", { class: "fm-typo-en-title-sm-800" }, "SMS", -1), Gn = { class: "space-y-8" }, Qn = /* @__PURE__ */ y("div", { class: "fm-typo-en-title-sm-800" }, "Email", -1), Wn = /* @__PURE__ */ y("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Email address that will be used to send email broadcast ", -1), Xn = { class: "space-y-8" }, Zn = /* @__PURE__ */ y("div", { class: "fm-typo-en-title-sm-800" }, "Whatsapp Channel", -1), eo = /* @__PURE__ */ y("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Whatsapp phone number that will be used to send whatsapp broadcast ", -1), to = { class: "space-y-8" }, no = /* @__PURE__ */ y("div", { class: "fm-typo-en-title-sm-800" }, [
|
|
1576
|
-
/* @__PURE__ */ oe(" Free Credit as Discount "),
|
|
1577
|
-
/* @__PURE__ */ y("span", { class: "fm-typo-en-body-md-400 text-fm-color-typo-error" }, "*POS v6.56 or above")
|
|
1578
|
-
], -1), oo = { class: "space-y-8" }, ro = { class: "fm-typo-en-title-sm-800 flex items-center gap-8" }, so = { class: "space-y-8" }, io = /* @__PURE__ */ y("div", { class: "fm-typo-en-title-sm-800" }, "Activation Location", -1), ao = { class: "flex justify-end pb-24" }, lo = { class: "col-span-1 space-y-8 xs:hidden" }, co = /* @__PURE__ */ y("div", { class: "fm-typo-en-body-lg-600" }, "Loyalty setting summary", -1), uo = /* @__PURE__ */ y("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Name ", -1), fo = { class: "fm-typo-en-body-lg-600" }, mo = /* @__PURE__ */ y("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Advertisement ", -1), go = { class: "fm-typo-en-body-lg-600" }, ho = /* @__PURE__ */ y("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Free Credit as Discount ", -1), po = { class: "fm-typo-en-body-lg-600" }, yo = /* @__PURE__ */ y("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Activated locations ", -1), wo = { class: "fm-typo-en-body-lg-600" }, xo = /* @__PURE__ */ Xe({
|
|
1579
|
-
__name: "Setting",
|
|
1580
|
-
setup(t) {
|
|
1581
|
-
const e = Bt(), s = Ft(), r = Ie(), o = ot(), { global: n, minor: a } = At, l = tt(), i = z(), u = z(!1), f = z([]), A = z(null), m = Mt, d = [
|
|
1582
|
-
(E) => !E || E.length >= 6 || "Invalid URL format, please enter at least 6 characters",
|
|
1583
|
-
(E) => !E || new RegExp(/^[a-z0-9][a-z0-9\-]{4,}[a-z0-9]$/).test(E) || "Invalid URL format, url should start with a letter or number and can only include lowercase letters, numbers, or hyphens"
|
|
1584
|
-
], v = Se.appUrl, C = ge(() => {
|
|
1585
|
-
var E;
|
|
1586
|
-
return `https://${(E = i.value) == null ? void 0 : E.business}.${v}`;
|
|
1587
|
-
}), I = z(), p = z([]), b = ge(() => {
|
|
1588
|
-
var E, h;
|
|
1589
|
-
return Math.min((((h = (E = i.value) == null ? void 0 : E.advertisements) == null ? void 0 : h.length) ?? 0) + 1, 5);
|
|
1590
|
-
}), { t: g } = Lt(), w = s.currentCountry.value || "MY", B = [
|
|
1591
|
-
"user.name",
|
|
1592
|
-
"user.gender",
|
|
1593
|
-
"user.birthday",
|
|
1594
|
-
"user.phoneNumber",
|
|
1595
|
-
"membership.url"
|
|
1596
|
-
].filter(
|
|
1597
|
-
(E) => {
|
|
1598
|
-
var h;
|
|
1599
|
-
return !((h = Nt[w]) != null && h.includes(E));
|
|
1600
|
-
}
|
|
1601
|
-
);
|
|
1602
|
-
async function M() {
|
|
1603
|
-
l.open({
|
|
1604
|
-
title: "",
|
|
1605
|
-
dialogComponent: Ln,
|
|
1606
|
-
closeButton: !1
|
|
1607
|
-
});
|
|
1608
|
-
}
|
|
1609
|
-
async function P(E) {
|
|
1610
|
-
await Pt.remove(
|
|
1611
|
-
"Are you sure you want to unlink this device?",
|
|
1612
|
-
"Unlink device",
|
|
1613
|
-
"Unlink"
|
|
1614
|
-
) && await a(
|
|
1615
|
-
async () => {
|
|
1616
|
-
await nt.unregisterDevice(E), await r.readLocationDevices();
|
|
1617
|
-
},
|
|
1618
|
-
{
|
|
1619
|
-
message: "Unlinking device",
|
|
1620
|
-
successMessage: "Unlinked device successfully"
|
|
1621
|
-
}
|
|
1622
|
-
);
|
|
1623
|
-
}
|
|
1624
|
-
async function N() {
|
|
1625
|
-
await a(
|
|
1626
|
-
async () => {
|
|
1627
|
-
var le;
|
|
1628
|
-
const E = kt(i.value);
|
|
1629
|
-
E.welcomeMessage && !((le = E.welcomeMessage) != null && le.content) && (E.welcomeMessage.content = "Hi there, you have been invited to join our membership");
|
|
1630
|
-
const h = St.parse(E);
|
|
1631
|
-
I.value === null && h.image ? await G.delete(G.coverImagePath()) : I.value && (h.image = await G.update(
|
|
1632
|
-
G.coverImagePath(),
|
|
1633
|
-
I.value
|
|
1634
|
-
)), u.value ? h.advertisements = (await Promise.all(
|
|
1635
|
-
new Array(b.value - 1).fill(null).map(async (V, H) => {
|
|
1636
|
-
var ee;
|
|
1637
|
-
const j = p.value[H];
|
|
1638
|
-
return j ? await G.update(
|
|
1639
|
-
G.advertisementPath(H, j),
|
|
1640
|
-
j
|
|
1641
|
-
) : (ee = h.advertisements) == null ? void 0 : ee[H];
|
|
1642
|
-
})
|
|
1643
|
-
)).filter((V) => V) : h.advertisements = [], await Je.update(h), await o.readMembership(), i.value = o.membership;
|
|
1644
|
-
},
|
|
1645
|
-
{
|
|
1646
|
-
message: "Updating membership",
|
|
1647
|
-
successMessage: "Membership updated successfully"
|
|
1648
|
-
}
|
|
1649
|
-
);
|
|
1650
|
-
}
|
|
1651
|
-
async function D() {
|
|
1652
|
-
const E = await Je.getEmailAddresses();
|
|
1653
|
-
console.log(E), f.value = E, A.value = E.find((h) => h.default.includes("Marketing"));
|
|
1654
|
-
}
|
|
1655
|
-
async function L() {
|
|
1656
|
-
window.open(
|
|
1657
|
-
`${Se.licensePortalUrl}business/${qe.businessId}/settings`,
|
|
1658
|
-
"_blank"
|
|
1659
|
-
);
|
|
1660
|
-
}
|
|
1661
|
-
async function Y() {
|
|
1662
|
-
const E = `${Se.licensePortalUrl}settings?businessId=${qe.businessId}`;
|
|
1663
|
-
console.log("Opening", E), window.open(E, "_blank");
|
|
1664
|
-
}
|
|
1665
|
-
return Ze(async () => {
|
|
1666
|
-
await n(async () => {
|
|
1667
|
-
var E, h;
|
|
1668
|
-
await r.readPremium(), await r.readLocations(), await r.readLocationDevices(), await o.readMembership(), await D(), i.value = o.membership, u.value = (((E = i.value.advertisements) == null ? void 0 : E.length) ?? 0) > 0, p.value = ((h = i.value.advertisements) == null ? void 0 : h.map(() => null)) ?? [];
|
|
1669
|
-
});
|
|
1670
|
-
}), (E, h) => {
|
|
1671
|
-
var Ve, xe, $e, ze, He, Ke, Oe;
|
|
1672
|
-
const le = F("FmPageHead"), V = F("FmButton"), H = F("FmTextField"), j = F("FmCard"), ee = F("FmPill"), Ce = F("FmSwitch"), Ct = F("FmSelect"), _t = F("FmMenuDivider");
|
|
1673
|
-
return x(), q(ue, null, [
|
|
1674
|
-
S(le, {
|
|
1675
|
-
title: c(g)("connect.setting.title"),
|
|
1676
|
-
class: "xs:hidden"
|
|
1677
|
-
}, null, 8, ["title"]),
|
|
1678
|
-
y("div", Fn, [
|
|
1679
|
-
y("div", Rn, k(c(g)("connect.setting.basicInfo.title")), 1),
|
|
1680
|
-
S(V, {
|
|
1681
|
-
icon: "info",
|
|
1682
|
-
variant: "tertiary"
|
|
1683
|
-
})
|
|
1684
|
-
]),
|
|
1685
|
-
c(i) ? (x(), q("div", kn, [
|
|
1686
|
-
y("div", Dn, [
|
|
1687
|
-
y("div", Vn, k(c(g)("connect.setting.basicInfo.title")), 1),
|
|
1688
|
-
y("div", xn, [
|
|
1689
|
-
S(H, {
|
|
1690
|
-
label: c(g)("connect.setting.basicInfo.membershipTitle"),
|
|
1691
|
-
modelValue: c(i).name,
|
|
1692
|
-
"onUpdate:modelValue": h[0] || (h[0] = (_) => c(i).name = _)
|
|
1693
|
-
}, null, 8, ["label", "modelValue"]),
|
|
1694
|
-
S(H, {
|
|
1695
|
-
disabled: !0,
|
|
1696
|
-
"model-value": c(i).business,
|
|
1697
|
-
rules: d,
|
|
1698
|
-
required: !0,
|
|
1699
|
-
label: c(g)("connect.setting.basicInfo.memberAppUrl"),
|
|
1700
|
-
"helper-text": c(C),
|
|
1701
|
-
placeholder: c(i).business.toString(),
|
|
1702
|
-
"onUpdate:modelValue": h[2] || (h[2] = (_) => c(i).url = _)
|
|
1703
|
-
}, {
|
|
1704
|
-
prepend: ne(() => [
|
|
1705
|
-
oe(" https:// ")
|
|
1706
|
-
]),
|
|
1707
|
-
append: ne(() => [
|
|
1708
|
-
oe(" ." + k(c(v)) + " ", 1),
|
|
1709
|
-
S(V, {
|
|
1710
|
-
icon: "content_copy",
|
|
1711
|
-
variant: "tertiary",
|
|
1712
|
-
onClick: h[1] || (h[1] = (_) => c(rt)(c(C)))
|
|
1713
|
-
})
|
|
1714
|
-
]),
|
|
1715
|
-
_: 1
|
|
1716
|
-
}, 8, ["model-value", "label", "helper-text", "placeholder"]),
|
|
1717
|
-
te("", !0),
|
|
1718
|
-
y("div", $n, [
|
|
1719
|
-
y("div", zn, k(c(g)("connect.setting.counterApp.title")), 1),
|
|
1720
|
-
S(V, {
|
|
1721
|
-
variant: "plain",
|
|
1722
|
-
icon: "link",
|
|
1723
|
-
label: c(g)("connect.setting.counterApp.linkDevice"),
|
|
1724
|
-
onClick: M
|
|
1725
|
-
}, null, 8, ["label"]),
|
|
1726
|
-
(x(!0), q(ue, null, Ye(c(r).locationDevices, (_, T) => (x(), me(j, {
|
|
1727
|
-
key: T,
|
|
1728
|
-
variant: "outlined",
|
|
1729
|
-
class: "flex items-center justify-between px-16 py-12"
|
|
1730
|
-
}, {
|
|
1731
|
-
default: ne(() => [
|
|
1732
|
-
y("div", null, [
|
|
1733
|
-
y("p", Hn, k(_.name || `Device ${_._id}`), 1),
|
|
1734
|
-
y("p", Kn, " Activation date: " + k(c(Et)(c(Rt)(_._id.toString())).format(
|
|
1735
|
-
"D MMM YYYY"
|
|
1736
|
-
)), 1),
|
|
1737
|
-
y("p", On, " Linked location: " + k(c(r).locations.find((R) => R._id == _.location).name), 1)
|
|
1738
|
-
]),
|
|
1739
|
-
S(V, {
|
|
1740
|
-
icon: "link_off",
|
|
1741
|
-
variant: "tertiary",
|
|
1742
|
-
onClick: (R) => P(_._id)
|
|
1743
|
-
}, null, 8, ["onClick"])
|
|
1744
|
-
]),
|
|
1745
|
-
_: 2
|
|
1746
|
-
}, 1024))), 128))
|
|
1747
|
-
]),
|
|
1748
|
-
y("div", Yn, [
|
|
1749
|
-
y("div", jn, [
|
|
1750
|
-
oe(" Advertisement "),
|
|
1751
|
-
S(ee, { variant: "premium" })
|
|
1752
|
-
]),
|
|
1753
|
-
S(Ce, {
|
|
1754
|
-
modelValue: c(u),
|
|
1755
|
-
"onUpdate:modelValue": h[4] || (h[4] = (_) => et(u) ? u.value = _ : null),
|
|
1756
|
-
label: "Advertisement",
|
|
1757
|
-
sublabel: "This will be show on FeedMe ordering app",
|
|
1758
|
-
"label-placement": "right",
|
|
1759
|
-
disabled: !c(r).isPremium,
|
|
1760
|
-
value: ""
|
|
1761
|
-
}, null, 8, ["modelValue", "disabled"]),
|
|
1762
|
-
c(u) ? (x(), q("div", {
|
|
1763
|
-
class: "flex items-center gap-8 flex-wrap xs:grid xs:grid-cols-2 xs:overflow-x-scroll xs:w-full",
|
|
1764
|
-
key: c(b)
|
|
1765
|
-
}, [
|
|
1766
|
-
(x(!0), q(ue, null, Ye(c(b), (_, T) => {
|
|
1767
|
-
var R, J;
|
|
1768
|
-
return x(), me(It, {
|
|
1769
|
-
class: "w-[200px]",
|
|
1770
|
-
"image-fit": "cover",
|
|
1771
|
-
label: "",
|
|
1772
|
-
"aspect-ratio": "2/3",
|
|
1773
|
-
thumbnail: (J = (R = c(i)) == null ? void 0 : R.advertisements) == null ? void 0 : J[T],
|
|
1774
|
-
accept: ".png, .jpg, .jpeg, .mp4, .gif",
|
|
1775
|
-
"recommended-size": "Recommended 4:5 ratio / 1080px x 1350px",
|
|
1776
|
-
file: c(p)[T] ?? void 0,
|
|
1777
|
-
"onUpdate:file": (ce) => {
|
|
1778
|
-
c(i).advertisements || (c(i).advertisements = []), ce ? (c(i).advertisements[T] = "", c(p)[T] = ce) : (c(i).advertisements.splice(T, 1), c(p).splice(T, 1));
|
|
1779
|
-
}
|
|
1780
|
-
}, null, 8, ["thumbnail", "file", "onUpdate:file"]);
|
|
1781
|
-
}), 256))
|
|
1782
|
-
])) : te("", !0)
|
|
1783
|
-
]),
|
|
1784
|
-
y("div", Jn, [
|
|
1785
|
-
qn,
|
|
1786
|
-
S(H, {
|
|
1787
|
-
"model-value": ((Ve = c(i)) == null ? void 0 : Ve.brand) || "",
|
|
1788
|
-
"max-length": 15,
|
|
1789
|
-
label: "Brand Name",
|
|
1790
|
-
"show-word-count": "",
|
|
1791
|
-
"helper-text": `RM 0 ${((xe = c(i)) == null ? void 0 : xe.brand) || ""}: YOUR CUSTOMER MESSAGE`,
|
|
1792
|
-
"onUpdate:modelValue": h[5] || (h[5] = (_) => c(i).brand = _)
|
|
1793
|
-
}, null, 8, ["model-value", "helper-text"]),
|
|
1794
|
-
S(Ut, {
|
|
1795
|
-
modelValue: c(i).welcomeMessage,
|
|
1796
|
-
"onUpdate:modelValue": h[6] || (h[6] = (_) => c(i).welcomeMessage = _),
|
|
1797
|
-
variables: c(B),
|
|
1798
|
-
placeholder: "Hi there, you have been invited to join membership"
|
|
1799
|
-
}, null, 8, ["modelValue", "variables"])
|
|
1800
|
-
]),
|
|
1801
|
-
y("div", Gn, [
|
|
1802
|
-
Qn,
|
|
1803
|
-
Wn,
|
|
1804
|
-
c(f).length ? te("", !0) : (x(), me(V, {
|
|
1805
|
-
key: 0,
|
|
1806
|
-
onClick: L,
|
|
1807
|
-
label: "Add new email address"
|
|
1808
|
-
})),
|
|
1809
|
-
c(f).length ? (x(), q(ue, { key: 1 }, [
|
|
1810
|
-
S(Ct, {
|
|
1811
|
-
"model-value": ((ze = ($e = c(i)) == null ? void 0 : $e.email) == null ? void 0 : ze.from) || null,
|
|
1812
|
-
label: "From Address",
|
|
1813
|
-
items: c(f).map((_) => ({
|
|
1814
|
-
label: _.emailAddress,
|
|
1815
|
-
value: _.emailAddress
|
|
1816
|
-
})),
|
|
1817
|
-
placeholder: c(A) ? c(A).emailAddress : "No email address available",
|
|
1818
|
-
"onUpdate:modelValue": h[7] || (h[7] = (_) => {
|
|
1819
|
-
var T, R;
|
|
1820
|
-
(T = c(i)) != null && T.email || (c(i).email = {
|
|
1821
|
-
from: _,
|
|
1822
|
-
name: (R = c(f).find((J) => J.emailAddress == _)) == null ? void 0 : R.name
|
|
1823
|
-
}), c(i).email.from = _ || null;
|
|
1824
|
-
}),
|
|
1825
|
-
rules: [c(je).ruleAtPath(c(m), "email.from")]
|
|
1826
|
-
}, null, 8, ["model-value", "items", "placeholder", "rules"]),
|
|
1827
|
-
S(H, {
|
|
1828
|
-
"model-value": ((Ke = (He = c(i)) == null ? void 0 : He.email) == null ? void 0 : Ke.name) || null,
|
|
1829
|
-
label: "Sender name",
|
|
1830
|
-
disabled: "",
|
|
1831
|
-
placeholder: ((Oe = c(A)) == null ? void 0 : Oe.name) || null,
|
|
1832
|
-
"onUpdate:modelValue": h[8] || (h[8] = (_) => {
|
|
1833
|
-
var T;
|
|
1834
|
-
(T = c(i)) != null && T.email || (c(i).email = {
|
|
1835
|
-
name: _
|
|
1836
|
-
}), c(i).email.name = _ || null;
|
|
1837
|
-
}),
|
|
1838
|
-
rules: [c(je).ruleAtPath(c(m), "email.name")]
|
|
1839
|
-
}, null, 8, ["model-value", "placeholder", "rules"])
|
|
1840
|
-
], 64)) : te("", !0)
|
|
1841
|
-
]),
|
|
1842
|
-
y("div", Xn, [
|
|
1843
|
-
Zn,
|
|
1844
|
-
eo,
|
|
1845
|
-
S(V, {
|
|
1846
|
-
label: "Manage Whatsapp Channel",
|
|
1847
|
-
icon: "open_in_new",
|
|
1848
|
-
onClick: h[9] || (h[9] = (_) => Y())
|
|
1849
|
-
})
|
|
1850
|
-
]),
|
|
1851
|
-
y("div", to, [
|
|
1852
|
-
no,
|
|
1853
|
-
S(Ce, {
|
|
1854
|
-
"model-value": c(i).freeCreditAsDiscount ?? !1,
|
|
1855
|
-
"onUpdate:modelValue": h[10] || (h[10] = (_) => c(i).freeCreditAsDiscount = _),
|
|
1856
|
-
label: "Free Credit as Discount",
|
|
1857
|
-
sublabel: "When enabled, this will allow free credit to be used as discount in the bill (POS >=v6.56)",
|
|
1858
|
-
"label-placement": "right",
|
|
1859
|
-
value: ""
|
|
1860
|
-
}, null, 8, ["model-value"])
|
|
1861
|
-
]),
|
|
1862
|
-
y("div", oo, [
|
|
1863
|
-
y("div", ro, [
|
|
1864
|
-
oe(" Member Card "),
|
|
1865
|
-
S(ee, { variant: "premium" })
|
|
1866
|
-
]),
|
|
1867
|
-
S(Ce, {
|
|
1868
|
-
"model-value": c(i).cardEnable ?? !1,
|
|
1869
|
-
"onUpdate:modelValue": h[11] || (h[11] = (_) => c(i).cardEnable = _),
|
|
1870
|
-
label: "",
|
|
1871
|
-
sublabel: "Allow member to bind card via member app",
|
|
1872
|
-
"label-placement": "right",
|
|
1873
|
-
value: "",
|
|
1874
|
-
disabled: !c(r).isPremium
|
|
1875
|
-
}, null, 8, ["model-value", "disabled"])
|
|
1876
|
-
]),
|
|
1877
|
-
y("div", so, [
|
|
1878
|
-
io,
|
|
1879
|
-
S(Tt, {
|
|
1880
|
-
label: "Select restaurant",
|
|
1881
|
-
"model-value": c(i).targetLocation ?? null,
|
|
1882
|
-
"onUpdate:modelValue": h[12] || (h[12] = (_) => c(i).targetLocation = _)
|
|
1883
|
-
}, null, 8, ["model-value"])
|
|
1884
|
-
]),
|
|
1885
|
-
y("div", ao, [
|
|
1886
|
-
S(V, {
|
|
1887
|
-
label: "Update",
|
|
1888
|
-
type: "button",
|
|
1889
|
-
onClick: N,
|
|
1890
|
-
disabled: !!c(e).loadingQueue.length,
|
|
1891
|
-
loading: !!c(e).loadingQueue.length
|
|
1892
|
-
}, null, 8, ["disabled", "loading"])
|
|
1893
|
-
])
|
|
1894
|
-
])
|
|
1895
|
-
]),
|
|
1896
|
-
y("div", lo, [
|
|
1897
|
-
S(j, {
|
|
1898
|
-
variant: "outlined",
|
|
1899
|
-
class: "flex flex-col p-24 gap-8"
|
|
1900
|
-
}, {
|
|
1901
|
-
default: ne(() => {
|
|
1902
|
-
var _, T, R;
|
|
1903
|
-
return [
|
|
1904
|
-
co,
|
|
1905
|
-
S(_t, { class: "my-4" }),
|
|
1906
|
-
y("div", null, [
|
|
1907
|
-
uo,
|
|
1908
|
-
y("div", fo, k(c(i).name), 1)
|
|
1909
|
-
]),
|
|
1910
|
-
y("div", null, [
|
|
1911
|
-
mo,
|
|
1912
|
-
y("div", go, k((((_ = c(i).advertisements) == null ? void 0 : _.length) ?? 0) || "No advertisments"), 1)
|
|
1913
|
-
]),
|
|
1914
|
-
y("div", null, [
|
|
1915
|
-
ho,
|
|
1916
|
-
y("div", po, k(c(i).freeCreditAsDiscount ? "Enabled" : "Disabled"), 1)
|
|
1917
|
-
]),
|
|
1918
|
-
y("div", null, [
|
|
1919
|
-
yo,
|
|
1920
|
-
y("div", wo, k(!c(i).targetLocation || c(i).targetLocation.length == c(Ie)().locations.length ? "All locations" : (R = (T = c(i)) == null ? void 0 : T.targetLocation) == null ? void 0 : R.map(
|
|
1921
|
-
(J) => c(r).locations.find((ce) => ce._id == J).name
|
|
1922
|
-
).join(", ")), 1)
|
|
1923
|
-
])
|
|
1924
|
-
];
|
|
1925
|
-
}),
|
|
1926
|
-
_: 1
|
|
1927
|
-
})
|
|
1928
|
-
])
|
|
1929
|
-
])) : te("", !0)
|
|
1930
|
-
], 64);
|
|
1931
|
-
};
|
|
1932
|
-
}
|
|
1933
|
-
});
|
|
1934
|
-
export {
|
|
1935
|
-
xo as default
|
|
1936
|
-
};
|