@invoice-sdk/widget 1.105.4 → 1.105.5

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.
@@ -35,7 +35,7 @@ var V = (g, A, E) => new Promise((C, B) => {
35
35
  }, n = (I) => I.done ? C(I.value) : Promise.resolve(I.value).then(Q, t);
36
36
  n((E = E.apply(g, A)).next());
37
37
  });
38
- import { t as e, g as TB, a as wQ, b as oQ, C as aQ, G as iQ, c as sQ, d as dB, e as sg, f as uQ, h as DQ, i as Sg, O as fQ, j as rQ, s as tg, k as Kg, l as mQ, m as PQ, n as qQ, o as vQ, p as MQ, q as lQ, v as TQ } from "./index-CAX2hguE.js";
38
+ import { t as e, g as TB, a as wQ, b as oQ, C as aQ, G as iQ, c as sQ, d as dB, e as sg, f as uQ, h as DQ, i as Sg, O as fQ, j as rQ, s as tg, k as Kg, l as mQ, m as PQ, n as qQ, o as vQ, p as MQ, q as lQ, v as TQ } from "./index-BRmCeoUr.js";
39
39
  import { g as pC } from "./_commonjsHelpers-bAxELxBV.js";
40
40
  function cC({ steps: g = [], currentStep: A = 1 } = {}) {
41
41
  const E = document.createElement("div");
@@ -302,14 +302,14 @@ function xQ({
302
302
  f.className = "wgt:w-[1px] wgt:h-8 wgt:bg-border-light";
303
303
  const H = document.createElement("label");
304
304
  H.className = "wgt:text-base wgt:font-semibold wgt:leading-5 wgt:text-black wgt:uppercase", H.innerText = c.name, o.appendChild(u), o.appendChild(f), o.appendChild(H);
305
- const { container: X } = pg({
305
+ const { container: J } = pg({
306
306
  checked: s,
307
- onChange: (J) => {
308
- J && (A = c.route, typeof E == "function" && E(c), t());
307
+ onChange: (F) => {
308
+ F && (A = c.route, typeof E == "function" && E(c), t());
309
309
  },
310
310
  disabled: !1
311
311
  });
312
- i.appendChild(o), i.appendChild(X), Q.appendChild(i);
312
+ i.appendChild(o), i.appendChild(J), Q.appendChild(i);
313
313
  });
314
314
  }
315
315
  t();
@@ -432,13 +432,13 @@ function _g({
432
432
  u.className = "wgt:absolute wgt:top-full wgt:left-0 wgt:right-0 wgt:bg-white wgt:border wgt:border-gray-300 wgt:rounded wgt:shadow-lg wgt:z-50 wgt:hidden wgt:max-h-[500px] wgt:overflow-y-auto";
433
433
  const f = document.createElement("div");
434
434
  f.className = "wgt:divide-y wgt:divide-gray-200";
435
- let H = A, X = null, J = [...E];
435
+ let H = A, J = null, F = [...E];
436
436
  const r = () => {
437
- const P = E.find((q) => q.id ? q.id === X : q.value === H);
437
+ const P = E.find((q) => q.id ? q.id === J : q.value === H);
438
438
  return P ? P.label : "";
439
439
  };
440
440
  o.value = r();
441
- const D = (P = J) => {
441
+ const D = (P = F) => {
442
442
  if (f.innerHTML = "", P.length === 0) {
443
443
  const q = document.createElement("div");
444
444
  q.className = "wgt:px-3 wgt:py-2 wgt:text-gray-500 wgt:text-sm", q.innerText = `${e("noResults", "Không tìm thấy kết quả")}`, f.appendChild(q);
@@ -452,9 +452,9 @@ function _g({
452
452
  "wgt:cursor-pointer",
453
453
  "wgt:hover:bg-gray-100",
454
454
  "wgt:text-sm",
455
- q.id ? X === q.id ? "wgt:bg-blue-50 wgt:text-blue-700" : "" : H === q.value ? "wgt:bg-blue-50 wgt:text-blue-700" : ""
455
+ q.id ? J === q.id ? "wgt:bg-blue-50 wgt:text-blue-700" : "" : H === q.value ? "wgt:bg-blue-50 wgt:text-blue-700" : ""
456
456
  ].filter(Boolean).join(" "), M.innerText = q.label, M.dataset.value = q.value, M.addEventListener("click", () => {
457
- if (q.id && (X = q.id), H = q.value, o.value = q.label, u.classList.add("wgt:hidden"), typeof t == "function") {
457
+ if (q.id && (J = q.id), H = q.value, o.value = q.label, u.classList.add("wgt:hidden"), typeof t == "function") {
458
458
  const Y = { target: { value: q.value } };
459
459
  q.id && (Y.target.id = q.id), t(Y);
460
460
  }
@@ -463,9 +463,9 @@ function _g({
463
463
  };
464
464
  o.addEventListener("input", (P) => {
465
465
  const q = P.target.value.toLowerCase();
466
- J = E.filter(
466
+ F = E.filter(
467
467
  (M) => M.label.toLowerCase().includes(q)
468
- ), D(J), u.classList.contains("wgt:hidden") || u.classList.remove("wgt:hidden");
468
+ ), D(F), u.classList.contains("wgt:hidden") || u.classList.remove("wgt:hidden");
469
469
  }), o.addEventListener("focus", () => {
470
470
  u.classList.remove("wgt:hidden"), D();
471
471
  }), document.addEventListener("click", (P) => {
@@ -489,12 +489,12 @@ function _g({
489
489
  return H;
490
490
  },
491
491
  setValue(P, q, M) {
492
- X = M || null, H = P || "";
492
+ J = M || null, H = P || "";
493
493
  const Y = E.find((x) => x.id ? x.id === M : x.value === P);
494
494
  Y ? (o.value = Y.label, T.value = P, D()) : (o.value = q || "", T.value = P || "", D());
495
495
  },
496
496
  setOptions(P) {
497
- for (E.splice(0, E.length, ...P), J = [...P]; T.options.length > 0; )
497
+ for (E.splice(0, E.length, ...P), F = [...P]; T.options.length > 0; )
498
498
  T.remove(0);
499
499
  P.forEach((q) => {
500
500
  const M = document.createElement("option");
@@ -542,8 +542,8 @@ function _g({
542
542
  for (; i.options.length > 1; )
543
543
  i.remove(1);
544
544
  f.forEach((H) => {
545
- const X = document.createElement("option");
546
- X.value = H.value, X.innerText = H.label, i.appendChild(X);
545
+ const J = document.createElement("option");
546
+ J.value = H.value, J.innerText = H.label, i.appendChild(J);
547
547
  });
548
548
  },
549
549
  setDisabled(f) {
@@ -637,13 +637,13 @@ function eC({
637
637
  const T = 1024, d = Math.max(0, D), P = ["Bytes", "KB", "MB", "GB", "TB"], q = Math.floor(Math.log(r) / Math.log(T));
638
638
  return parseFloat((r / Math.pow(T, q)).toFixed(d)) + " " + P[q];
639
639
  }
640
- function X(r) {
640
+ function J(r) {
641
641
  const D = r.type.toLowerCase(), T = "." + r.name.split(".").pop().toLowerCase();
642
642
  return c.accept.split(",").map((P) => P.trim().toLowerCase()).filter(Boolean).some((P) => P.startsWith(".") ? P === T : P.endsWith("/*") ? D.startsWith(P.replace("/*", "")) : D === P);
643
643
  }
644
- function J(r) {
644
+ function F(r) {
645
645
  if (s.innerHTML = "", u(null), r) {
646
- X(r) || u(`File không hợp lệ. Chỉ chấp nhận: ${c.accept}`), r.size <= 500 * 1024 || u("Dung lượng file vượt quá 500KB.");
646
+ J(r) || u(`File không hợp lệ. Chỉ chấp nhận: ${c.accept}`), r.size <= 500 * 1024 || u("Dung lượng file vượt quá 500KB.");
647
647
  const T = document.createElement("div");
648
648
  if (T.className = "wgt:flex wgt:items-center wgt:gap-4", T.addEventListener("click", () => {
649
649
  c.click();
@@ -664,17 +664,17 @@ function eC({
664
664
  }
665
665
  return c.addEventListener("change", (r) => {
666
666
  const D = r.target.files && r.target.files[0] ? r.target.files[0] : null;
667
- D && (J(D), typeof C == "function" && C(D));
668
- }), J(E), h.appendChild(s), h.appendChild(c), t.appendChild(h), t.appendChild(i), {
667
+ D && (F(D), typeof C == "function" && C(D));
668
+ }), F(E), h.appendChild(s), h.appendChild(c), t.appendChild(h), t.appendChild(i), {
669
669
  container: t,
670
670
  getValues() {
671
671
  return E;
672
672
  },
673
673
  setFile(r) {
674
- E = r, J(r), typeof C == "function" && C(r);
674
+ E = r, F(r), typeof C == "function" && C(r);
675
675
  },
676
676
  clearFile() {
677
- E = null, J(null), typeof C == "function" && C(null);
677
+ E = null, F(null), typeof C == "function" && C(null);
678
678
  },
679
679
  getError: () => o
680
680
  };
@@ -777,12 +777,12 @@ function wC({
777
777
  u = D, D ? (o.innerText = D, o.style.display = "block", typeof B == "function" && B(D)) : (o.innerText = "", o.style.display = "none", typeof B == "function" && B(null));
778
778
  }
779
779
  let H = g || null;
780
- function X(D, T = 2) {
780
+ function J(D, T = 2) {
781
781
  if (D === 0) return "0 Bytes";
782
782
  const d = 1024, P = Math.max(0, T), q = ["Bytes", "KB", "MB", "GB", "TB"], M = Math.floor(Math.log(D) / Math.log(d));
783
783
  return parseFloat((D / Math.pow(d, M)).toFixed(P)) + " " + q[M];
784
784
  }
785
- function J(D) {
785
+ function F(D) {
786
786
  n.innerHTML = "", f(null);
787
787
  const T = document.createElement("img");
788
788
  if (T.alt = A, T.className = "wgt:max-w-full wgt:max-h-full wgt:object-contain", r(D) || f(`File không hợp lệ. Chỉ chấp nhận: ${I.accept}`), D.size <= 500 * 1024 || f("Dung lượng file vượt quá 500KB."), D.type.startsWith("image/")) {
@@ -798,7 +798,7 @@ function wC({
798
798
  const M = document.createElement("p");
799
799
  M.className = "wgt:text-sm wgt:font-medium wgt:text-gray-800", M.innerText = D.name;
800
800
  const Y = document.createElement("p");
801
- Y.className = "wgt:text-sm wgt:text-gray-500", Y.innerText = X(D.size), q.appendChild(M), q.appendChild(Y), P.appendChild(q), n.appendChild(P), typeof C == "function" && C(null, D);
801
+ Y.className = "wgt:text-sm wgt:text-gray-500", Y.innerText = J(D.size), q.appendChild(M), q.appendChild(Y), P.appendChild(q), n.appendChild(P), typeof C == "function" && C(null, D);
802
802
  }
803
803
  }
804
804
  function r(D) {
@@ -808,8 +808,8 @@ function wC({
808
808
  return I.addEventListener("change", () => {
809
809
  var T;
810
810
  const D = (T = I.files) == null ? void 0 : T[0];
811
- D && (H = D, J(D));
812
- }), n.addEventListener("click", () => I.click()), g && J(g), {
811
+ D && (H = D, F(D));
812
+ }), n.addEventListener("click", () => I.click()), g && F(g), {
813
813
  container: t,
814
814
  getFile: () => H,
815
815
  getError: () => u,
@@ -855,11 +855,11 @@ const JQ = ({
855
855
  } = {}) => {
856
856
  Array.from(
857
857
  { length: 26 },
858
- (v, F) => String.fromCharCode(65 + F)
858
+ (v, X) => String.fromCharCode(65 + X)
859
859
  );
860
860
  const C = (/* @__PURE__ */ new Date()).getFullYear(), B = Array.from(
861
861
  { length: 2 },
862
- (v, F) => String(C + F).slice(-2)
862
+ (v, X) => String(C + X).slice(-2)
863
863
  ), Q = ["1", "2", "3", "4", "5", "6", "7", "8", "9"], t = ["C", "K"], n = ["T", "D", "L", "M", "N", "B", "G", "H", "X"], I = document.createElement("div");
864
864
  I.className = "wgt:w-full wgt:flex wgt:flex-col wgt:items-start wgt:space-y-2";
865
865
  const h = document.createElement("span");
@@ -888,7 +888,7 @@ const JQ = ({
888
888
  f.className = "wgt:text-red-500 wgt:ml-1", f.innerText = "*", u.appendChild(f), o.appendChild(u);
889
889
  const H = document.createElement("select");
890
890
  H.className = `${i} wgt:@max-2xl:w-full wgt:w-48`, H.title = e("sampleNumberTooltip", "Mẫu số hóa đơn (1-9)");
891
- const X = {
891
+ const J = {
892
892
  1: e("invoiceTemplateTypes.1"),
893
893
  2: e("invoiceTemplateTypes.2"),
894
894
  3: e("invoiceTemplateTypes.3"),
@@ -900,19 +900,19 @@ const JQ = ({
900
900
  9: e("invoiceTemplateTypes.9")
901
901
  };
902
902
  Q.forEach((v) => {
903
- H.append(new Option(X[v], v));
903
+ H.append(new Option(J[v], v));
904
904
  }), o.appendChild(H), s.append(o);
905
- const J = document.createElement("div");
906
- J.className = "wgt:w-full wgt:flex wgt:flex-col wgt:items-start wgt:space-y-2";
905
+ const F = document.createElement("div");
906
+ F.className = "wgt:w-full wgt:flex wgt:flex-col wgt:items-start wgt:space-y-2";
907
907
  const r = document.createElement("span");
908
908
  r.className = "wgt:font-medium wgt:text-text-black wgt:whitespace-nowrap wgt:col-span-2 wgt:@max-2xl:whitespace-normal wgt:@max-2xl:block wgt:hidden", r.textContent = e("codeType");
909
909
  const D = document.createElement("span");
910
- D.className = "wgt:text-red-500 wgt:ml-1", D.innerText = "*", r.appendChild(D), J.appendChild(r);
910
+ D.className = "wgt:text-red-500 wgt:ml-1", D.innerText = "*", r.appendChild(D), F.appendChild(r);
911
911
  const T = document.createElement("select");
912
912
  T.className = `${i} wgt:@max-2xl:w-full wgt:w-40`, T.title = e("codeTypeTooltip", "C: Có mã CQT, K: Không mã"), t.forEach((v) => {
913
- const F = v === "C" ? e("codeTypeC", "C (Có mã CQT)") : e("codeTypeK", "K (Không mã)");
914
- T.append(new Option(F, v));
915
- }), J.appendChild(T), s.append(J);
913
+ const X = v === "C" ? e("codeTypeC", "C (Có mã CQT)") : e("codeTypeK", "K (Không mã)");
914
+ T.append(new Option(X, v));
915
+ }), F.appendChild(T), s.append(F);
916
916
  const d = document.createElement("div");
917
917
  d.className = "wgt:w-full wgt:flex wgt:flex-col wgt:items-start wgt:space-y-2";
918
918
  const P = document.createElement("span");
@@ -1072,16 +1072,16 @@ function GQ() {
1072
1072
  return w === 0 || w === 6;
1073
1073
  }, H = function(a) {
1074
1074
  return a % 4 === 0 && a % 100 !== 0 || a % 400 === 0;
1075
- }, X = function(a, w) {
1075
+ }, J = function(a, w) {
1076
1076
  return [31, H(a) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][w];
1077
- }, J = function(a) {
1077
+ }, F = function(a) {
1078
1078
  u(a) && a.setHours(0, 0, 0, 0);
1079
1079
  }, r = function(a, w) {
1080
1080
  return a.getTime() === w.getTime();
1081
1081
  }, D = function(a, w, R) {
1082
- var v, F;
1082
+ var v, X;
1083
1083
  for (v in w)
1084
- F = a[v] !== void 0, F && typeof w[v] == "object" && w[v] !== null && w[v].nodeName === void 0 ? u(w[v]) ? R && (a[v] = new Date(w[v].getTime())) : o(w[v]) ? R && (a[v] = w[v].slice(0)) : a[v] = D({}, w[v], R) : (R || !F) && (a[v] = w[v]);
1084
+ X = a[v] !== void 0, X && typeof w[v] == "object" && w[v] !== null && w[v].nodeName === void 0 ? u(w[v]) ? R && (a[v] = new Date(w[v].getTime())) : o(w[v]) ? R && (a[v] = w[v].slice(0)) : a[v] = D({}, w[v], R) : (R || !X) && (a[v] = w[v]);
1085
1085
  return a;
1086
1086
  }, T = function(a, w, R) {
1087
1087
  var v;
@@ -1186,14 +1186,14 @@ function GQ() {
1186
1186
  return a.isDisabled && w.push("is-disabled"), a.isToday && w.push("is-today"), a.isSelected && (w.push("is-selected"), R = "true"), a.hasEvent && w.push("has-event"), a.isInRange && w.push("is-inrange"), a.isStartRange && w.push("is-startrange"), a.isEndRange && w.push("is-endrange"), '<td data-day="' + a.day + '" class="' + w.join(" ") + '" aria-selected="' + R + '"><button class="pika-button pika-day" type="button" data-pika-year="' + a.year + '" data-pika-month="' + a.month + '" data-pika-day="' + a.day + '">' + a.day + "</button></td>";
1187
1187
  }, Y = function(a, w) {
1188
1188
  a.setHours(0, 0, 0, 0);
1189
- var R = a.getDate(), v = a.getDay(), F = w, j = F - 1, l = 7, b = function(iA) {
1189
+ var R = a.getDate(), v = a.getDay(), X = w, j = X - 1, l = 7, b = function(iA) {
1190
1190
  return (iA + l - 1) % l;
1191
1191
  };
1192
1192
  a.setDate(R + j - b(v));
1193
- var L = new Date(a.getFullYear(), 0, F), y = 1440 * 60 * 1e3, CA = (a.getTime() - L.getTime()) / y, AA = 1 + Math.round((CA - j + b(L.getDay())) / l);
1194
- return AA;
1193
+ var L = new Date(a.getFullYear(), 0, X), y = 1440 * 60 * 1e3, CA = (a.getTime() - L.getTime()) / y, $ = 1 + Math.round((CA - j + b(L.getDay())) / l);
1194
+ return $;
1195
1195
  }, x = function(a, w, R, v) {
1196
- var F = new Date(R, w, a), j = C ? E(F).isoWeek() : Y(F, v);
1196
+ var X = new Date(R, w, a), j = C ? E(X).isoWeek() : Y(X, v);
1197
1197
  return '<td class="pika-week">' + j + "</td>";
1198
1198
  }, k = function(a, w, R, v) {
1199
1199
  return '<tr class="pika-row' + (R ? " pick-whole-week" : "") + (v ? " is-selected" : "") + '">' + (w ? a.reverse() : a).join("") + "</tr>";
@@ -1204,38 +1204,38 @@ function GQ() {
1204
1204
  for (a.showWeekNumber && R.push("<th></th>"), w = 0; w < 7; w++)
1205
1205
  R.push('<th scope="col"><abbr title="' + q(a, w) + '">' + q(a, w, !0) + "</abbr></th>");
1206
1206
  return "<thead><tr>" + (a.isRTL ? R.reverse() : R).join("") + "</tr></thead>";
1207
- }, S = function(a, w, R, v, F, j) {
1208
- var l, b, L, y = a._o, CA = R === y.minYear, AA = R === y.maxYear, iA = '<div id="' + j + '" class="pika-title" role="heading" aria-live="assertive">', UA, GA, FA = !0, bA = !0;
1207
+ }, S = function(a, w, R, v, X, j) {
1208
+ var l, b, L, y = a._o, CA = R === y.minYear, $ = R === y.maxYear, iA = '<div id="' + j + '" class="pika-title" role="heading" aria-live="assertive">', SA, GA, FA = !0, bA = !0;
1209
1209
  for (L = [], l = 0; l < 12; l++)
1210
- L.push('<option value="' + (R === F ? l - w : 12 + l - w) + '"' + (l === v ? ' selected="selected"' : "") + (CA && l < y.minMonth || AA && l > y.maxMonth ? ' disabled="disabled"' : "") + ">" + y.i18n.months[l] + "</option>");
1211
- for (UA = '<div class="pika-label">' + y.i18n.months[v] + '<select class="pika-select pika-select-month" tabindex="-1">' + L.join("") + "</select></div>", o(y.yearRange) ? (l = y.yearRange[0], b = y.yearRange[1] + 1) : (l = R - y.yearRange, b = 1 + R + y.yearRange), L = []; l < b && l <= y.maxYear; l++)
1210
+ L.push('<option value="' + (R === X ? l - w : 12 + l - w) + '"' + (l === v ? ' selected="selected"' : "") + (CA && l < y.minMonth || $ && l > y.maxMonth ? ' disabled="disabled"' : "") + ">" + y.i18n.months[l] + "</option>");
1211
+ for (SA = '<div class="pika-label">' + y.i18n.months[v] + '<select class="pika-select pika-select-month" tabindex="-1">' + L.join("") + "</select></div>", o(y.yearRange) ? (l = y.yearRange[0], b = y.yearRange[1] + 1) : (l = R - y.yearRange, b = 1 + R + y.yearRange), L = []; l < b && l <= y.maxYear; l++)
1212
1212
  l >= y.minYear && L.push('<option value="' + l + '"' + (l === R ? ' selected="selected"' : "") + ">" + l + "</option>");
1213
- return GA = '<div class="pika-label">' + R + y.yearSuffix + '<select class="pika-select pika-select-year" tabindex="-1">' + L.join("") + "</select></div>", y.showMonthAfterYear ? iA += GA + UA : iA += UA + GA, CA && (v === 0 || y.minMonth >= v) && (FA = !1), AA && (v === 11 || y.maxMonth <= v) && (bA = !1), w === 0 && (iA += '<button class="pika-prev' + (FA ? "" : " is-disabled") + '" type="button">' + y.i18n.previousMonth + "</button>"), w === a._o.numberOfMonths - 1 && (iA += '<button class="pika-next' + (bA ? "" : " is-disabled") + '" type="button">' + y.i18n.nextMonth + "</button>"), iA += "</div>";
1213
+ return GA = '<div class="pika-label">' + R + y.yearSuffix + '<select class="pika-select pika-select-year" tabindex="-1">' + L.join("") + "</select></div>", y.showMonthAfterYear ? iA += GA + SA : iA += SA + GA, CA && (v === 0 || y.minMonth >= v) && (FA = !1), $ && (v === 11 || y.maxMonth <= v) && (bA = !1), w === 0 && (iA += '<button class="pika-prev' + (FA ? "" : " is-disabled") + '" type="button">' + y.i18n.previousMonth + "</button>"), w === a._o.numberOfMonths - 1 && (iA += '<button class="pika-next' + (bA ? "" : " is-disabled") + '" type="button">' + y.i18n.nextMonth + "</button>"), iA += "</div>";
1214
1214
  }, K = function(a, w, R) {
1215
1215
  return '<table cellpadding="0" cellspacing="0" class="pika-table" role="grid" aria-labelledby="' + R + '">' + z(a) + m(w) + "</table>";
1216
1216
  }, p = function(a) {
1217
1217
  var w = this, R = w.config(a);
1218
- w._onMouseDown = function(F) {
1218
+ w._onMouseDown = function(X) {
1219
1219
  if (w._v) {
1220
- F = F || window.event;
1221
- var j = F.target || F.srcElement;
1220
+ X = X || window.event;
1221
+ var j = X.target || X.srcElement;
1222
1222
  if (j)
1223
1223
  if (c(j, "is-disabled") || (c(j, "pika-button") && !c(j, "is-empty") && !c(j.parentNode, "is-disabled") ? (w.setDate(new Date(j.getAttribute("data-pika-year"), j.getAttribute("data-pika-month"), j.getAttribute("data-pika-day"))), R.bound && t(function() {
1224
1224
  w.hide(), R.blurFieldOnSelect && R.field && R.field.blur();
1225
1225
  }, 100)) : c(j, "pika-prev") ? w.prevMonth() : c(j, "pika-next") && w.nextMonth()), c(j, "pika-select"))
1226
1226
  w._c = !0;
1227
- else if (F.preventDefault)
1228
- F.preventDefault();
1227
+ else if (X.preventDefault)
1228
+ X.preventDefault();
1229
1229
  else
1230
- return F.returnValue = !1, !1;
1230
+ return X.returnValue = !1, !1;
1231
1231
  }
1232
- }, w._onChange = function(F) {
1233
- F = F || window.event;
1234
- var j = F.target || F.srcElement;
1232
+ }, w._onChange = function(X) {
1233
+ X = X || window.event;
1234
+ var j = X.target || X.srcElement;
1235
1235
  j && (c(j, "pika-select-month") ? w.gotoMonth(j.value) : c(j, "pika-select-year") && w.gotoYear(j.value));
1236
- }, w._onKeyChange = function(F) {
1237
- if (F = F || window.event, w.isVisible())
1238
- switch (F.keyCode) {
1236
+ }, w._onKeyChange = function(X) {
1237
+ if (X = X || window.event, w.isVisible())
1238
+ switch (X.keyCode) {
1239
1239
  case 13:
1240
1240
  case 27:
1241
1241
  R.field && R.field.blur();
@@ -1261,29 +1261,29 @@ function GQ() {
1261
1261
  if (R.parse)
1262
1262
  return R.parse(R.field.value, R.format);
1263
1263
  if (C) {
1264
- var F = E(R.field.value, R.format, R.formatStrict);
1265
- return F && F.isValid() ? F.toDate() : null;
1264
+ var X = E(R.field.value, R.format, R.formatStrict);
1265
+ return X && X.isValid() ? X.toDate() : null;
1266
1266
  } else
1267
1267
  return new Date(Date.parse(R.field.value));
1268
- }, w._onInputChange = function(F) {
1268
+ }, w._onInputChange = function(X) {
1269
1269
  var j;
1270
- F.firedBy !== w && (j = w._parseFieldValue(), u(j) && w.setDate(j), w._v || w.show());
1270
+ X.firedBy !== w && (j = w._parseFieldValue(), u(j) && w.setDate(j), w._v || w.show());
1271
1271
  }, w._onInputFocus = function() {
1272
1272
  w.show();
1273
1273
  }, w._onInputClick = function() {
1274
1274
  w.show();
1275
1275
  }, w._onInputBlur = function() {
1276
- var F = Q.activeElement;
1276
+ var X = Q.activeElement;
1277
1277
  do
1278
- if (c(F, "pika-single"))
1278
+ if (c(X, "pika-single"))
1279
1279
  return;
1280
- while (F = F.parentNode);
1280
+ while (X = X.parentNode);
1281
1281
  w._c || (w._b = t(function() {
1282
1282
  w.hide();
1283
1283
  }, 50)), w._c = !1;
1284
- }, w._onClick = function(F) {
1285
- F = F || window.event;
1286
- var j = F.target || F.srcElement, l = j;
1284
+ }, w._onClick = function(X) {
1285
+ X = X || window.event;
1286
+ var j = X.target || X.srcElement, l = j;
1287
1287
  if (j) {
1288
1288
  !B && c(j, "pika-select") && (j.onchange || (j.setAttribute("onchange", "return;"), n(j, "change", w._onChange)));
1289
1289
  do
@@ -1344,7 +1344,7 @@ function GQ() {
1344
1344
  return this._d = null, this._o.field && (this._o.field.value = "", T(this._o.field, "change", { firedBy: this })), this.draw();
1345
1345
  if (typeof a == "string" && (a = new Date(Date.parse(a))), !!u(a)) {
1346
1346
  var R = this._o.minDate, v = this._o.maxDate;
1347
- u(R) && a < R ? a = R : u(v) && a > v && (a = v), this._d = new Date(a.getTime()), J(this._d), this.gotoDate(this._d), this._o.field && (this._o.field.value = this.toString(), T(this._o.field, "change", { firedBy: this })), !w && typeof this._o.onSelect == "function" && this._o.onSelect.call(this, this.getDate());
1347
+ u(R) && a < R ? a = R : u(v) && a > v && (a = v), this._d = new Date(a.getTime()), F(this._d), this.gotoDate(this._d), this._o.field && (this._o.field.value = this.toString(), T(this._o.field, "change", { firedBy: this })), !w && typeof this._o.onSelect == "function" && this._o.onSelect.call(this, this.getDate());
1348
1348
  }
1349
1349
  },
1350
1350
  /**
@@ -1360,8 +1360,8 @@ function GQ() {
1360
1360
  var w = !0;
1361
1361
  if (u(a)) {
1362
1362
  if (this.calendars) {
1363
- var R = new Date(this.calendars[0].year, this.calendars[0].month, 1), v = new Date(this.calendars[this.calendars.length - 1].year, this.calendars[this.calendars.length - 1].month, 1), F = a.getTime();
1364
- v.setMonth(v.getMonth() + 1), v.setDate(v.getDate() - 1), w = F < R.getTime() || v.getTime() < F;
1363
+ var R = new Date(this.calendars[0].year, this.calendars[0].month, 1), v = new Date(this.calendars[this.calendars.length - 1].year, this.calendars[this.calendars.length - 1].month, 1), X = a.getTime();
1364
+ v.setMonth(v.getMonth() + 1), v.setDate(v.getDate() - 1), w = X < R.getTime() || v.getTime() < X;
1365
1365
  }
1366
1366
  w && (this.calendars = [{
1367
1367
  month: a.getMonth(),
@@ -1370,8 +1370,8 @@ function GQ() {
1370
1370
  }
1371
1371
  },
1372
1372
  adjustDate: function(a, w) {
1373
- var R = this.getDate() || /* @__PURE__ */ new Date(), v = parseInt(w) * 24 * 60 * 60 * 1e3, F;
1374
- a === "add" ? F = new Date(R.valueOf() + v) : a === "subtract" && (F = new Date(R.valueOf() - v)), this.setDate(F);
1373
+ var R = this.getDate() || /* @__PURE__ */ new Date(), v = parseInt(w) * 24 * 60 * 60 * 1e3, X;
1374
+ a === "add" ? X = new Date(R.valueOf() + v) : a === "subtract" && (X = new Date(R.valueOf() - v)), this.setDate(X);
1375
1375
  },
1376
1376
  adjustCalendars: function() {
1377
1377
  this.calendars[0] = d(this.calendars[0]);
@@ -1407,13 +1407,13 @@ function GQ() {
1407
1407
  * change the minDate
1408
1408
  */
1409
1409
  setMinDate: function(a) {
1410
- a instanceof Date ? (J(a), this._o.minDate = a, this._o.minYear = a.getFullYear(), this._o.minMonth = a.getMonth()) : (this._o.minDate = P.minDate, this._o.minYear = P.minYear, this._o.minMonth = P.minMonth, this._o.startRange = P.startRange), this.draw();
1410
+ a instanceof Date ? (F(a), this._o.minDate = a, this._o.minYear = a.getFullYear(), this._o.minMonth = a.getMonth()) : (this._o.minDate = P.minDate, this._o.minYear = P.minYear, this._o.minMonth = P.minMonth, this._o.startRange = P.startRange), this.draw();
1411
1411
  },
1412
1412
  /**
1413
1413
  * change the maxDate
1414
1414
  */
1415
1415
  setMaxDate: function(a) {
1416
- a instanceof Date ? (J(a), this._o.maxDate = a, this._o.maxYear = a.getFullYear(), this._o.maxMonth = a.getMonth()) : (this._o.maxDate = P.maxDate, this._o.maxYear = P.maxYear, this._o.maxMonth = P.maxMonth, this._o.endRange = P.endRange), this.draw();
1416
+ a instanceof Date ? (F(a), this._o.maxDate = a, this._o.maxYear = a.getFullYear(), this._o.maxMonth = a.getMonth()) : (this._o.maxDate = P.maxDate, this._o.maxYear = P.maxYear, this._o.maxMonth = P.maxMonth, this._o.endRange = P.endRange), this.draw();
1417
1417
  },
1418
1418
  setStartRange: function(a) {
1419
1419
  this._o.startRange = a;
@@ -1426,8 +1426,8 @@ function GQ() {
1426
1426
  */
1427
1427
  draw: function(a) {
1428
1428
  if (!(!this._v && !a)) {
1429
- var w = this._o, R = w.minYear, v = w.maxYear, F = w.minMonth, j = w.maxMonth, l = "", b;
1430
- this._y <= R && (this._y = R, !isNaN(F) && this._m < F && (this._m = F)), this._y >= v && (this._y = v, !isNaN(j) && this._m > j && (this._m = j));
1429
+ var w = this._o, R = w.minYear, v = w.maxYear, X = w.minMonth, j = w.maxMonth, l = "", b;
1430
+ this._y <= R && (this._y = R, !isNaN(X) && this._m < X && (this._m = X)), this._y >= v && (this._y = v, !isNaN(j) && this._m > j && (this._m = j));
1431
1431
  for (var L = 0; L < w.numberOfMonths; L++)
1432
1432
  b = "pika-title-" + Math.random().toString(36).replace(/[^a-z]+/g, "").substr(0, 2), l += '<div class="pika-lendar">' + S(this, L, this.calendars[L].year, this.calendars[L].month, this.calendars[0].year, b) + this.render(this.calendars[L].year, this.calendars[L].month, b) + "</div>";
1433
1433
  this.el.innerHTML = l, w.bound && w.field.type !== "hidden" && t(function() {
@@ -1436,33 +1436,33 @@ function GQ() {
1436
1436
  }
1437
1437
  },
1438
1438
  adjustPosition: function() {
1439
- var a, w, R, v, F, j, l, b, L, y, CA, AA;
1439
+ var a, w, R, v, X, j, l, b, L, y, CA, $;
1440
1440
  if (!this._o.container) {
1441
- if (this.el.style.position = "absolute", a = this._o.trigger, w = a, R = this.el.offsetWidth, v = this.el.offsetHeight, F = window.innerWidth || Q.documentElement.clientWidth, j = window.innerHeight || Q.documentElement.clientHeight, l = window.pageYOffset || Q.body.scrollTop || Q.documentElement.scrollTop, CA = !0, AA = !0, typeof a.getBoundingClientRect == "function")
1441
+ if (this.el.style.position = "absolute", a = this._o.trigger, w = a, R = this.el.offsetWidth, v = this.el.offsetHeight, X = window.innerWidth || Q.documentElement.clientWidth, j = window.innerHeight || Q.documentElement.clientHeight, l = window.pageYOffset || Q.body.scrollTop || Q.documentElement.scrollTop, CA = !0, $ = !0, typeof a.getBoundingClientRect == "function")
1442
1442
  y = a.getBoundingClientRect(), b = y.left + window.pageXOffset, L = y.bottom + window.pageYOffset;
1443
1443
  else
1444
1444
  for (b = w.offsetLeft, L = w.offsetTop + w.offsetHeight; w = w.offsetParent; )
1445
1445
  b += w.offsetLeft, L += w.offsetTop;
1446
- (this._o.reposition && b + R > F || this._o.position.indexOf("right") > -1 && b - R + a.offsetWidth > 0) && (b = b - R + a.offsetWidth, CA = !1), (this._o.reposition && L + v > j + l || this._o.position.indexOf("top") > -1 && L - v - a.offsetHeight > 0) && (L = L - v - a.offsetHeight, AA = !1), this.el.style.left = b + "px", this.el.style.top = L + "px", s(this.el, CA ? "left-aligned" : "right-aligned"), s(this.el, AA ? "bottom-aligned" : "top-aligned"), i(this.el, CA ? "right-aligned" : "left-aligned"), i(this.el, AA ? "top-aligned" : "bottom-aligned");
1446
+ (this._o.reposition && b + R > X || this._o.position.indexOf("right") > -1 && b - R + a.offsetWidth > 0) && (b = b - R + a.offsetWidth, CA = !1), (this._o.reposition && L + v > j + l || this._o.position.indexOf("top") > -1 && L - v - a.offsetHeight > 0) && (L = L - v - a.offsetHeight, $ = !1), this.el.style.left = b + "px", this.el.style.top = L + "px", s(this.el, CA ? "left-aligned" : "right-aligned"), s(this.el, $ ? "bottom-aligned" : "top-aligned"), i(this.el, CA ? "right-aligned" : "left-aligned"), i(this.el, $ ? "top-aligned" : "bottom-aligned");
1447
1447
  }
1448
1448
  },
1449
1449
  /**
1450
1450
  * render HTML for a particular month
1451
1451
  */
1452
1452
  render: function(a, w, R) {
1453
- var v = this._o, F = /* @__PURE__ */ new Date(), j = X(a, w), l = new Date(a, w, 1).getDay(), b = [], L = [];
1454
- J(F), v.firstDay > 0 && (l -= v.firstDay, l < 0 && (l += 7));
1455
- for (var y = w === 0 ? 11 : w - 1, CA = w === 11 ? 0 : w + 1, AA = w === 0 ? a - 1 : a, iA = w === 11 ? a + 1 : a, UA = X(AA, y), GA = j + l, FA = GA; FA > 7; )
1453
+ var v = this._o, X = /* @__PURE__ */ new Date(), j = J(a, w), l = new Date(a, w, 1).getDay(), b = [], L = [];
1454
+ F(X), v.firstDay > 0 && (l -= v.firstDay, l < 0 && (l += 7));
1455
+ for (var y = w === 0 ? 11 : w - 1, CA = w === 11 ? 0 : w + 1, $ = w === 0 ? a - 1 : a, iA = w === 11 ? a + 1 : a, SA = J($, y), GA = j + l, FA = GA; FA > 7; )
1456
1456
  FA -= 7;
1457
1457
  GA += 7 - FA;
1458
1458
  for (var bA = !1, uA = 0, jA = 0; uA < GA; uA++) {
1459
- var qA = new Date(a, w, 1 + (uA - l)), Bg = u(this._d) ? r(qA, this._d) : !1, lA = r(qA, F), SA = v.events.indexOf(qA.toDateString()) !== -1, yA = uA < l || uA >= j + l, dA = 1 + (uA - l), JA = w, KA = a, $A = v.startRange && r(v.startRange, qA), wg = v.endRange && r(v.endRange, qA), rg = v.startRange && v.endRange && v.startRange < qA && qA < v.endRange, mg = v.minDate && qA < v.minDate || v.maxDate && qA > v.maxDate || v.disableWeekends && f(qA) || v.disableDayFn && v.disableDayFn(qA);
1460
- yA && (uA < l ? (dA = UA + dA, JA = y, KA = AA) : (dA = dA - j, JA = CA, KA = iA));
1459
+ var qA = new Date(a, w, 1 + (uA - l)), Bg = u(this._d) ? r(qA, this._d) : !1, lA = r(qA, X), pA = v.events.indexOf(qA.toDateString()) !== -1, yA = uA < l || uA >= j + l, dA = 1 + (uA - l), JA = w, KA = a, $A = v.startRange && r(v.startRange, qA), wg = v.endRange && r(v.endRange, qA), rg = v.startRange && v.endRange && v.startRange < qA && qA < v.endRange, mg = v.minDate && qA < v.minDate || v.maxDate && qA > v.maxDate || v.disableWeekends && f(qA) || v.disableDayFn && v.disableDayFn(qA);
1460
+ yA && (uA < l ? (dA = SA + dA, JA = y, KA = $) : (dA = dA - j, JA = CA, KA = iA));
1461
1461
  var Cg = {
1462
1462
  day: dA,
1463
1463
  month: JA,
1464
1464
  year: KA,
1465
- hasEvent: SA,
1465
+ hasEvent: pA,
1466
1466
  isSelected: Bg,
1467
1467
  isToday: lA,
1468
1468
  isDisabled: mg,
@@ -1775,7 +1775,7 @@ function gE(g, A, E = 200) {
1775
1775
  const o = BE();
1776
1776
  t.setTransform(...o), t.drawImage(C, 0, 0), t.setTransform(1, 0, 0, 1, 0, 0);
1777
1777
  } else if (A.length === 4) {
1778
- const [o, u, f, H] = A, X = f - o, J = H - u, r = X * 0.05, D = J * 0.05, T = Math.max(0, o - r), d = Math.max(0, u - D), P = Math.min(C.width, f + r), q = Math.min(C.height, H + D), M = P - T, Y = q - d;
1778
+ const [o, u, f, H] = A, J = f - o, F = H - u, r = J * 0.05, D = F * 0.05, T = Math.max(0, o - r), d = Math.max(0, u - D), P = Math.min(C.width, f + r), q = Math.min(C.height, H + D), M = P - T, Y = q - d;
1779
1779
  t.drawImage(
1780
1780
  C,
1781
1781
  T,
@@ -1796,8 +1796,8 @@ function gE(g, A, E = 200) {
1796
1796
  E
1797
1797
  ), I = new ImageData(E, E), h = n.data, c = I.data;
1798
1798
  for (let o = 0; o < h.length; o += 4) {
1799
- const u = h[o], f = h[o + 1], H = h[o + 2], X = 0.2989 * u + 0.587 * f + 0.114 * H;
1800
- c[o] = c[o + 1] = c[o + 2] = X, c[o + 3] = 255;
1799
+ const u = h[o], f = h[o + 1], H = h[o + 2], J = 0.2989 * u + 0.587 * f + 0.114 * H;
1800
+ c[o] = c[o + 1] = c[o + 2] = J, c[o + 3] = 255;
1801
1801
  }
1802
1802
  const s = new ImageData(E, E), i = CE(c, E, E, 10);
1803
1803
  return s.data.set(i), {
@@ -1859,16 +1859,16 @@ function IE(g, A, E, C, B = 0.5) {
1859
1859
  for (let n = 0; n < t; n++) {
1860
1860
  const I = g.data[n * 37 + 4];
1861
1861
  if (I < B) continue;
1862
- const h = g.data[n * 37], c = g.data[n * 37 + 1], s = g.data[n * 37 + 2], i = g.data[n * 37 + 3], o = 1, u = 1, f = [h, c, s, i], H = g.data.slice(n * 37 + 5, n * 37 + 37), X = new Float32Array(25600);
1862
+ const h = g.data[n * 37], c = g.data[n * 37 + 1], s = g.data[n * 37 + 2], i = g.data[n * 37 + 3], o = 1, u = 1, f = [h, c, s, i], H = g.data.slice(n * 37 + 5, n * 37 + 37), J = new Float32Array(25600);
1863
1863
  for (let m = 0; m < 160; m++)
1864
1864
  for (let z = 0; z < 160; z++) {
1865
1865
  let S = 0;
1866
1866
  for (let K = 0; K < 32; K++)
1867
1867
  S += H[K] * A.data[K * 160 * 160 + m * 160 + z];
1868
- X[m * 160 + z] = S > 0 ? 1 : 0;
1868
+ J[m * 160 + z] = S > 0 ? 1 : 0;
1869
1869
  }
1870
- const J = EE();
1871
- let r = J.length > 0 ? J[0] : [], D = r.length >= 4 ? r.slice(0, 4) : f;
1870
+ const F = EE();
1871
+ let r = F.length > 0 ? F[0] : [], D = r.length >= 4 ? r.slice(0, 4) : f;
1872
1872
  D = D.map((m) => [m[0] * o, m[1] * u]);
1873
1873
  const T = 0.1, d = Math.min(...D.map((m) => m[0])), P = Math.max(...D.map((m) => m[0])), q = Math.min(...D.map((m) => m[1])), M = Math.max(...D.map((m) => m[1])), Y = P - d, x = M - q, k = D.map((m) => [
1874
1874
  m[0] + (m[0] < (d + P) / 2 ? -T * Y : T * Y),
@@ -2011,25 +2011,25 @@ function eE(o) {
2011
2011
  function H() {
2012
2012
  u && u.parentNode && (u.parentNode.removeChild(u), u = null);
2013
2013
  }
2014
- function X() {
2014
+ function J() {
2015
2015
  typeof window != "undefined" && window.scrollTo({
2016
2016
  top: 0,
2017
2017
  behavior: "smooth"
2018
- }), J && J.scrollIntoView && J.scrollIntoView({
2018
+ }), F && F.scrollIntoView && F.scrollIntoView({
2019
2019
  behavior: "smooth",
2020
2020
  block: "start"
2021
2021
  });
2022
2022
  }
2023
- const J = document.createElement("div");
2024
- J.className = "wgt:flex wgt:flex-col wgt:gap-4 wgt:w-full";
2023
+ const F = document.createElement("div");
2024
+ F.className = "wgt:flex wgt:flex-col wgt:gap-4 wgt:w-full";
2025
2025
  const r = document.createElement("form");
2026
2026
  r.className = "wgt:w-full wgt:max-w-[1072px] wgt:mx-auto wgt:space-y-4", r.addEventListener("submit", (N) => {
2027
2027
  if (N.preventDefault(), !lg()) return;
2028
2028
  const G = BA();
2029
2029
  typeof g == "function" && g(G);
2030
- }), J.appendChild(r);
2031
- let D, T, d, P, q, M, Y, x, k, m, z, S, K, p, a, w, R, v, F, j, l, b, L, y, CA;
2032
- const AA = document.createElement("button");
2030
+ }), F.appendChild(r);
2031
+ let D, T, d, P, q, M, Y, x, k, m, z, S, K, p, a, w, R, v, X, j, l, b, L, y, CA;
2032
+ const $ = document.createElement("button");
2033
2033
  D = YA({
2034
2034
  name: "taxCode",
2035
2035
  label: e("taxCode"),
@@ -2137,12 +2137,12 @@ function eE(o) {
2137
2137
  readOnly: !0,
2138
2138
  value: ((RB = (kB = A == null ? void 0 : A.eInvoiceRegistration) == null ? void 0 : kB.legalRepresentative) == null ? void 0 : RB.dob) || ""
2139
2139
  });
2140
- let UA = new NQ({
2140
+ let SA = new NQ({
2141
2141
  field: m.inputEl,
2142
2142
  format: "DD/MM/YYYY",
2143
2143
  toString(N) {
2144
- const G = String(N.getMonth() + 1).padStart(2, "0"), $ = String(N.getDate()).padStart(2, "0"), nA = N.getFullYear();
2145
- return `${$}/${G}/${nA}`;
2144
+ const G = String(N.getMonth() + 1).padStart(2, "0"), _ = String(N.getDate()).padStart(2, "0"), nA = N.getFullYear();
2145
+ return `${_}/${G}/${nA}`;
2146
2146
  },
2147
2147
  onSelect: (N) => {
2148
2148
  m.setError(null), O();
@@ -2155,7 +2155,7 @@ function eE(o) {
2155
2155
  showYearDropdown: !0,
2156
2156
  yearRange: [1900, (/* @__PURE__ */ new Date()).getFullYear()]
2157
2157
  });
2158
- n(UA), z = _g({
2158
+ n(SA), z = _g({
2159
2159
  name: "repGender",
2160
2160
  label: e("gender"),
2161
2161
  options: oC.map((N) => ({
@@ -2179,8 +2179,8 @@ function eE(o) {
2179
2179
  value: ((FB = (XB = A == null ? void 0 : A.eInvoiceRegistration) == null ? void 0 : XB.legalRepresentative) == null ? void 0 : FB.idCard) || "",
2180
2180
  onInput: (N) => {
2181
2181
  let G = N.target.value;
2182
- const $ = G.replace(/[^0-9]/g, "");
2183
- if ($ !== G && (N.target.value = $, G = $), G.trim() === "") {
2182
+ const _ = G.replace(/[^0-9]/g, "");
2183
+ if (_ !== G && (N.target.value = _, G = _), G.trim() === "") {
2184
2184
  K.setError(e("errorRequired"));
2185
2185
  return;
2186
2186
  }
@@ -2206,8 +2206,8 @@ function eE(o) {
2206
2206
  value: ((NB = (LB = A == null ? void 0 : A.eInvoiceRegistration) == null ? void 0 : LB.legalRepresentative) == null ? void 0 : NB.phone) || "",
2207
2207
  onInput: (N) => {
2208
2208
  let G = N.target.value;
2209
- const $ = G.replace(/[^\d+().\-\s]/g, ""), nA = $.replace(/[\s.\-()]/g, "");
2210
- if ($ !== G && (N.target.value = $, G = $), nA.trim() === "") {
2209
+ const _ = G.replace(/[^\d+().\-\s]/g, ""), nA = _.replace(/[\s.\-()]/g, "");
2210
+ if (_ !== G && (N.target.value = _, G = _), nA.trim() === "") {
2211
2211
  S.setError(e("errorRequired", "Số điện thoại bắt buộc"));
2212
2212
  return;
2213
2213
  }
@@ -2293,14 +2293,14 @@ function eE(o) {
2293
2293
  );
2294
2294
  return;
2295
2295
  }
2296
- const $ = new RegExp("^(?!\\.)(?!.*\\.\\.)[A-Za-z0-9.!#$%&'*+/=?^_`{|}~-]{1,64}(?<!\\.)@(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\\.)+[A-Za-z0-9-]{2,63}$");
2296
+ const _ = new RegExp("^(?!\\.)(?!.*\\.\\.)[A-Za-z0-9.!#$%&'*+/=?^_`{|}~-]{1,64}(?<!\\.)@(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\\.)+[A-Za-z0-9-]{2,63}$");
2297
2297
  if (G.length > 254) {
2298
2298
  M.setError(
2299
2299
  e("errorInvalidEmailLength", "Email quá dài (tối đa 254 ký tự).")
2300
2300
  );
2301
2301
  return;
2302
2302
  }
2303
- $.test(G) ? M.setError(null) : M.setError(
2303
+ _.test(G) ? M.setError(null) : M.setError(
2304
2304
  e("errorInvalidEmail", "Email không hợp lệ")
2305
2305
  );
2306
2306
  }
@@ -2314,8 +2314,8 @@ function eE(o) {
2314
2314
  value: ((VB = (ZB = A == null ? void 0 : A.eInvoiceRegistration) == null ? void 0 : ZB.contactPerson) == null ? void 0 : VB.phone) || "",
2315
2315
  onInput: (N) => {
2316
2316
  let G = N.target.value;
2317
- const $ = G.replace(/[^\d+().\-\s]/g, ""), nA = $.replace(/[\s.\-()]/g, "");
2318
- if ($ !== G && (N.target.value = $, G = $), nA.trim() === "") {
2317
+ const _ = G.replace(/[^\d+().\-\s]/g, ""), nA = _.replace(/[\s.\-()]/g, "");
2318
+ if (_ !== G && (N.target.value = _, G = _), nA.trim() === "") {
2319
2319
  Y.setError(
2320
2320
  e("errorRequired", "Số điện thoại bắt buộc")
2321
2321
  );
@@ -2366,8 +2366,8 @@ function eE(o) {
2366
2366
  GA.inputEl.value = N, O();
2367
2367
  }
2368
2368
  }), v = document.createElement("input"), v.type = "checkbox", v.name = "hasUsedEInvoiceCB", v.className = "wgt:cursor-pointer", v.checked = (gC = A == null ? void 0 : A.eInvoiceRegistration) == null ? void 0 : gC.hasUsedEInvoice, v.addEventListener("change", (N) => {
2369
- N.target.checked ? (Z.appendChild(hA), Z.appendChild(tA)) : (F.checked = !1, l.inputEl.value = "", l.setError(null), j && (j.inputEl.value = "", j.setError(null), tA.contains(j.container) && tA.removeChild(j.container)), Z.removeChild(hA), Z.removeChild(tA));
2370
- }), F = document.createElement("input"), F.type = "checkbox", F.name = "hasUsedEInvoiceBeforeCB", F.className = "wgt:cursor-pointer", F.checked = (BC = A == null ? void 0 : A.eInvoiceRegistration) == null ? void 0 : BC.isUsedEInvoiceBefore, F.addEventListener("change", (N) => {
2369
+ N.target.checked ? (Z.appendChild(hA), Z.appendChild(tA)) : (X.checked = !1, l.inputEl.value = "", l.setError(null), j && (j.inputEl.value = "", j.setError(null), tA.contains(j.container) && tA.removeChild(j.container)), Z.removeChild(hA), Z.removeChild(tA));
2370
+ }), X = document.createElement("input"), X.type = "checkbox", X.name = "hasUsedEInvoiceBeforeCB", X.className = "wgt:cursor-pointer", X.checked = (BC = A == null ? void 0 : A.eInvoiceRegistration) == null ? void 0 : BC.isUsedEInvoiceBefore, X.addEventListener("change", (N) => {
2371
2371
  N.target.checked ? tA.appendChild(j.container) : (j.inputEl.value = "", j.setError(null), tA.contains(j.container) && tA.removeChild(j.container));
2372
2372
  }), j = YA({
2373
2373
  name: "previousOtherProviderNameField",
@@ -2424,7 +2424,7 @@ function eE(o) {
2424
2424
  const G = ++FA;
2425
2425
  D.setError(null);
2426
2426
  try {
2427
- const $ = yield XQ(N);
2427
+ const _ = yield XQ(N);
2428
2428
  let nA = {
2429
2429
  name: "",
2430
2430
  address: "",
@@ -2433,10 +2433,10 @@ function eE(o) {
2433
2433
  };
2434
2434
  if (G !== FA)
2435
2435
  return;
2436
- if ($.error)
2436
+ if (_.error)
2437
2437
  return T.inputEl.value = "", d.inputEl.value = "", P.setValue && P.setValue("", "", ""), P.setDisabled(!1), D.setError(e("errorInvalidTaxCode", "Mã số thuế không hợp lệ")), nA;
2438
- if (D.setError(null), T.inputEl.value = $.ten_cty || "", d.inputEl.value = $.dia_chi || "", $.cqthue_ql) {
2439
- const rA = (LA) => LA.toLowerCase().replace(/phường\s+/i, "").replace(/xã\s+/i, "").replace(/quận\s+/i, "").trim(), cA = rA($.cqthue_ql), mA = iA.find((LA) => {
2438
+ if (D.setError(null), T.inputEl.value = _.ten_cty || "", d.inputEl.value = _.dia_chi || "", _.cqthue_ql) {
2439
+ const rA = (LA) => LA.toLowerCase().replace(/phường\s+/i, "").replace(/xã\s+/i, "").replace(/quận\s+/i, "").trim(), cA = rA(_.cqthue_ql), mA = iA.find((LA) => {
2440
2440
  const ag = rA(LA.label);
2441
2441
  return ag.includes(cA) || cA.includes(ag);
2442
2442
  });
@@ -2447,8 +2447,8 @@ function eE(o) {
2447
2447
  ), nA.taxAuthority = mA.id || "", P.setDisabled(!1));
2448
2448
  } else
2449
2449
  P.setValue && P.setValue("", "", ""), P.setDisabled(!1);
2450
- return nA.name = $.ten_cty || "", nA.address = $.dia_chi || "", nA.taxCode = N, D.setError(null), nA;
2451
- } catch ($) {
2450
+ return nA.name = _.ten_cty || "", nA.address = _.dia_chi || "", nA.taxCode = N, D.setError(null), nA;
2451
+ } catch (_) {
2452
2452
  G === FA && (hg.error(
2453
2453
  e("errorFetchTaxInfo", "Lỗi khi lấy thông tin mã số thuế."),
2454
2454
  {
@@ -2474,11 +2474,11 @@ function eE(o) {
2474
2474
  Bg.className = "wgt:w-full wgt:grid wgt:grid-cols-1 wgt:@min-2xl:grid-cols-2 wgt:space-x-4", uA.appendChild(Bg), Bg.appendChild(b.container), r.appendChild(uA);
2475
2475
  const lA = document.createElement("div");
2476
2476
  lA.className = "wgt:space-y-4";
2477
- const SA = document.createElement("h3");
2478
- SA.className = "wgt:text-lg wgt:font-semibold wgt:mb-4", SA.innerText = e(
2477
+ const pA = document.createElement("h3");
2478
+ pA.className = "wgt:text-lg wgt:font-semibold wgt:mb-4", pA.innerText = e(
2479
2479
  "legalRepInfo",
2480
2480
  "2. Thông tin người đại diện pháp luật:"
2481
- ), lA.appendChild(SA);
2481
+ ), lA.appendChild(pA);
2482
2482
  const yA = document.createElement("div");
2483
2483
  yA.className = "wgt:grid wgt:grid-cols-1 wgt:@min-2xl:grid-cols-2 wgt:gap-4 wgt:space-y-2";
2484
2484
  let dA = !1, JA = !1;
@@ -2495,7 +2495,7 @@ function eE(o) {
2495
2495
  function wg(N) {
2496
2496
  return new Promise((G) => {
2497
2497
  dA = !1, JA = !1, $A();
2498
- const $ = () => {
2498
+ const _ = () => {
2499
2499
  K.inputEl.value = "", k.inputEl.value = "", m.inputEl.value = "", w.inputEl.value = "", z.selectEl.value = "", a.selectEl.value = "", K.setError(null), k.setError(null), m.setError(null), w.setError(null), z.setError(null), a.setError(null), t && typeof t.setDate == "function" && t.setDate(null);
2500
2500
  }, nA = (cA) => {
2501
2501
  if (!cA) return "";
@@ -2510,13 +2510,13 @@ function eE(o) {
2510
2510
  }, rA = new Image();
2511
2511
  rA.src = URL.createObjectURL(N), rA.onload = () => V(null, null, function* () {
2512
2512
  try {
2513
- const cA = yield cE(rA).then((mA) => JSON.parse(mA).status !== "success" ? (dA = !0, JA = !1, $(), $A(), null) : JSON.parse(mA).data);
2513
+ const cA = yield cE(rA).then((mA) => JSON.parse(mA).status !== "success" ? (dA = !0, JA = !1, _(), $A(), null) : JSON.parse(mA).data);
2514
2514
  if (cA || G({ success: !1, reason: "No data detected" }), cA) {
2515
2515
  dA = !1, JA = !0, $A();
2516
2516
  const LA = Object.values(cA).every((ig) => !ig);
2517
- $(), LA && (Pg(
2517
+ _(), LA && (Pg(
2518
2518
  e("errorInvalidCard", "Vui lòng tải lên ảnh CMND/CCCD hợp lệ")
2519
- ), $(), G({ success: !1, reason: "Invalid card data" }));
2519
+ ), _(), G({ success: !1, reason: "Invalid card data" }));
2520
2520
  const { address: ag, date_of_birth: dg, full_name: Zg, id_number: Rg, sex: Gg } = cA;
2521
2521
  if (!Rg || !/^\d{12}$/.test(Rg) ? (Pg(
2522
2522
  e("errorInvalidCard", "Số CCCD phải có 12 chữ số")
@@ -2536,7 +2536,7 @@ function eE(o) {
2536
2536
  });
2537
2537
  });
2538
2538
  }
2539
- function rg(N, G, $) {
2539
+ function rg(N, G, _) {
2540
2540
  const nA = new Image();
2541
2541
  nA.src = URL.createObjectURL(N), nA.onload = () => V(null, null, function* () {
2542
2542
  yield QE(nA).then((rA) => {
@@ -2544,7 +2544,7 @@ function eE(o) {
2544
2544
  const cA = JSON.parse(rA);
2545
2545
  G && !((mA = cA == null ? void 0 : cA.data) != null && mA.isFront) ? Pg(
2546
2546
  e("errorInvalidCard", "Vui lòng tải lên ảnh CMND/CCCD hợp lệ")
2547
- ) : $ && !((LA = cA == null ? void 0 : cA.data) != null && LA.isBack) && og(
2547
+ ) : _ && !((LA = cA == null ? void 0 : cA.data) != null && LA.isBack) && og(
2548
2548
  e("errorInvalidCard", "Vui lòng tải lên ảnh CMND/CCCD hợp lệ")
2549
2549
  );
2550
2550
  });
@@ -2562,12 +2562,12 @@ function eE(o) {
2562
2562
  frontFile: A == null ? void 0 : A.idCard,
2563
2563
  backFile: A == null ? void 0 : A.idCardBack,
2564
2564
  onFrontChange: (N) => V(null, null, function* () {
2565
- var $, nA;
2565
+ var _, nA;
2566
2566
  if (y = N, rg(N, !0, !1), Cg() || Qg() || !qg()) {
2567
2567
  dA = !1, JA = !1, $A(), O();
2568
2568
  return;
2569
2569
  }
2570
- if ((nA = ($ = A == null ? void 0 : A.eInvoiceRegistration) == null ? void 0 : $.legalRepresentative) == null ? void 0 : nA.idCard) {
2570
+ if ((nA = (_ = A == null ? void 0 : A.eInvoiceRegistration) == null ? void 0 : _.legalRepresentative) == null ? void 0 : nA.idCard) {
2571
2571
  O();
2572
2572
  return;
2573
2573
  }
@@ -2592,8 +2592,8 @@ function eE(o) {
2592
2592
  Ag.className = "wgt:space-y-4", Ag.appendChild(k.container);
2593
2593
  const OA = document.createElement("div");
2594
2594
  OA.className = "wgt:grid wgt:grid-cols-1 wgt:@min-2xl:grid-cols-2 wgt:gap-4", Ag.appendChild(OA), OA.appendChild(m.container), OA.appendChild(z.container), yA.appendChild(Ag);
2595
- const pA = document.createElement("div");
2596
- pA.className = "wgt:grid wgt:grid-cols-1 wgt:@min-2xl:grid-cols-4 wgt:gap-4 wgt:items-start", pA.appendChild(K.container), pA.appendChild(p.container), pA.appendChild(S.container), pA.appendChild(a.container), lA.appendChild(yA), lA.appendChild(pA), lA.appendChild(w.container), lA.appendChild(L.container);
2595
+ const UA = document.createElement("div");
2596
+ UA.className = "wgt:grid wgt:grid-cols-1 wgt:@min-2xl:grid-cols-4 wgt:gap-4 wgt:items-start", UA.appendChild(K.container), UA.appendChild(p.container), UA.appendChild(S.container), UA.appendChild(a.container), lA.appendChild(yA), lA.appendChild(UA), lA.appendChild(w.container), lA.appendChild(L.container);
2597
2597
  const vg = document.createElement("ul");
2598
2598
  vg.className = "wgt:list-inside wgt:list-disc wgt:-mt-2";
2599
2599
  const ZA = document.createElement("li");
@@ -2615,16 +2615,16 @@ function eE(o) {
2615
2615
  IA.className = "wgt:w-full wgt:flex wgt:gap-4 wgt:items-start wgt:flex-row wgt:@max-4xl:flex-col", IA.appendChild(R.container), IA.appendChild(GA.container), QA.appendChild(IA);
2616
2616
  const Z = document.createElement("div");
2617
2617
  Z.className = "wgt:flex wgt:flex-col wgt:space-y-4 wgt:border wgt:border-soft-200 wgt:px-6 wgt:py-4 wgt:rounded-xl", i || r.appendChild(Z);
2618
- const W = document.createElement("div");
2619
- W.className = "wgt:flex wgt:gap-3 wgt:items-center wgt:text-sm wgt:text-strong-950 ", W.appendChild(v);
2620
- const _ = document.createElement("h4");
2621
- _.className = "wgt:font-semibold wgt:italic", _.innerText = e(
2618
+ const AA = document.createElement("div");
2619
+ AA.className = "wgt:flex wgt:gap-3 wgt:items-center wgt:text-sm wgt:text-strong-950 ", AA.appendChild(v);
2620
+ const W = document.createElement("h4");
2621
+ W.className = "wgt:font-semibold wgt:italic", W.innerText = e(
2622
2622
  "hasUsedEInvoice",
2623
2623
  "Bạn đã sử dụng hoá đơn điện tử?"
2624
- ), W.appendChild(_), i || Z.appendChild(W), v.checked = i, v.disabled = i;
2624
+ ), AA.appendChild(W), i || Z.appendChild(AA), v.checked = i, v.disabled = i;
2625
2625
  const hA = document.createElement("div");
2626
2626
  if (hA.className = "wgt:flex wgt:gap-3 wgt:items-center wgt:text-sm wgt:text-strong-950 ", !i) {
2627
- hA.appendChild(F);
2627
+ hA.appendChild(X);
2628
2628
  const N = document.createElement("h4");
2629
2629
  N.className = "wgt:font-semibold wgt:italic", N.innerText = e(
2630
2630
  "hasUsedEInvoiceBefore",
@@ -2664,8 +2664,8 @@ function eE(o) {
2664
2664
  );
2665
2665
  const Fg = (N) => {
2666
2666
  const G = document.createElement("button");
2667
- return G.className = "wgt:text-primary wgt:font-semibold wgt:hover:underline wgt:cursor-pointer", G.textContent = N, G.onclick = ($) => {
2668
- $.preventDefault(), typeof C == "function" && C();
2667
+ return G.className = "wgt:text-primary wgt:font-semibold wgt:hover:underline wgt:cursor-pointer", G.textContent = N, G.onclick = (_) => {
2668
+ _.preventDefault(), typeof C == "function" && C();
2669
2669
  }, G;
2670
2670
  }, Og = kQ(E);
2671
2671
  Ig.appendChild(
@@ -2674,7 +2674,7 @@ function eE(o) {
2674
2674
  xA = !xA, xA ? (XA.classList.add("wgt:bg-primary"), gg.classList.remove("wgt:hidden")) : (XA.classList.remove("wgt:bg-primary"), gg.classList.add("wgt:hidden")), O();
2675
2675
  });
2676
2676
  const Mg = document.createElement("div");
2677
- Mg.className = "wgt:flex wgt:mt-6 wgt:items-center wgt:justify-end wgt:gap-2 ", AA.type = "submit", AA.innerText = e("next"), AA.className = [
2677
+ Mg.className = "wgt:flex wgt:mt-6 wgt:items-center wgt:justify-end wgt:gap-2 ", $.type = "submit", $.innerText = e("next"), $.className = [
2678
2678
  "wgt:bg-primary",
2679
2679
  "wgt:hover:bg-primary-dark",
2680
2680
  "wgt:text-text-primary",
@@ -2685,7 +2685,7 @@ function eE(o) {
2685
2685
  "wgt:disabled:cursor-not-allowed",
2686
2686
  "wgt:cursor-pointer",
2687
2687
  "wgt:hover:text-primary-hover-text"
2688
- ].join(" "), Mg.appendChild(AA), J.appendChild(Mg);
2688
+ ].join(" "), Mg.appendChild($), F.appendChild(Mg);
2689
2689
  function lg() {
2690
2690
  const N = BA(), G = N.eInvoiceRegistration;
2691
2691
  if (!G.contactPerson.address || !G.organization.name || !G.organization.address || !G.organization.taxCode || !G.organization.taxAuthority || !G.contactPerson.name || !G.contactPerson.email || !G.contactPerson.phone || !G.legalRepresentative.name || !G.legalRepresentative.dob || !G.legalRepresentative.gender || !G.legalRepresentative.phone || !G.legalRepresentative.idCard || !G.legalRepresentative.permanentAddress || !G.invoiceSymbol || !i && G.hasUsedEInvoice && !G.taxAuthorityCode || G.isUsedEInvoiceBefore && !G.previousEInvoiceProvider || !Ng(G.contactPerson.name) || !Ng(G.legalRepresentative.name) || !/^[\p{L}0-9\s,.\-/()]*$/u.test(G.contactPerson.address) || !/^[\p{L}0-9\s,.\-/()]*$/u.test(
@@ -2703,7 +2703,7 @@ function eE(o) {
2703
2703
  }
2704
2704
  function O() {
2705
2705
  const N = E === "bvb" && !i && !A._userHasEditedTaxCode;
2706
- AA.disabled = !lg() || !xA || Cg() || Qg() || b.getError() || L.getError() || N;
2706
+ $.disabled = !lg() || !xA || Cg() || Qg() || b.getError() || L.getError() || N;
2707
2707
  }
2708
2708
  function BA() {
2709
2709
  var N, G;
@@ -2734,7 +2734,7 @@ function eE(o) {
2734
2734
  permanentAddress: w == null ? void 0 : w.getValue()
2735
2735
  },
2736
2736
  hasUsedEInvoice: i ? !0 : (v == null ? void 0 : v.checked) || !1,
2737
- isUsedEInvoiceBefore: (F == null ? void 0 : F.checked) || !1,
2737
+ isUsedEInvoiceBefore: (X == null ? void 0 : X.checked) || !1,
2738
2738
  invoiceSymbol: R == null ? void 0 : R.getValue()
2739
2739
  },
2740
2740
  license: L == null ? void 0 : L.getValues(),
@@ -2762,9 +2762,9 @@ function eE(o) {
2762
2762
  N.inputEl.addEventListener("input", O);
2763
2763
  }), [z, P].forEach((N) => {
2764
2764
  N.selectEl.addEventListener("change", O);
2765
- }), [v, F].forEach((N) => {
2765
+ }), [v, X].forEach((N) => {
2766
2766
  N.addEventListener("change", O);
2767
- }), AA.addEventListener("click", (N) => V(null, null, function* () {
2767
+ }), $.addEventListener("click", (N) => V(null, null, function* () {
2768
2768
  if (N.preventDefault(), !lg()) return;
2769
2769
  const G = D.getValue().trim();
2770
2770
  if (G.length < 10) {
@@ -2779,11 +2779,11 @@ function eE(o) {
2779
2779
  g(BA());
2780
2780
  return;
2781
2781
  }
2782
- AA.disabled = !0;
2783
- let $ = null, nA = !1;
2782
+ $.disabled = !0;
2783
+ let _ = null, nA = !1;
2784
2784
  try {
2785
2785
  const rA = (A == null ? void 0 : A.provider) || "m-invoice";
2786
- if (console.log("Current theme:", E), console.log("Provider being used:", rA), $ = (yield ZC(rA, G, "HDTT")).isNewCustomer, $)
2786
+ if (console.log("Current theme:", E), console.log("Provider being used:", rA), _ = (yield ZC(rA, G, "HDTT")).isNewCustomer, _)
2787
2787
  H();
2788
2788
  else {
2789
2789
  A._userHasEditedTaxCode = !1;
@@ -2795,7 +2795,7 @@ function eE(o) {
2795
2795
  }
2796
2796
  requestAnimationFrame(() => {
2797
2797
  requestAnimationFrame(() => {
2798
- X(), requestAnimationFrame(() => {
2798
+ J(), requestAnimationFrame(() => {
2799
2799
  u.style.opacity = "1";
2800
2800
  });
2801
2801
  });
@@ -2804,13 +2804,13 @@ function eE(o) {
2804
2804
  } catch (rA) {
2805
2805
  nA = !0, console.error("Error checking customer:", rA);
2806
2806
  } finally {
2807
- AA.disabled = !1, AA.innerText = e("next");
2807
+ $.disabled = !1, $.innerText = e("next");
2808
2808
  }
2809
- nA || $ === !1 || $ === !0 && g(BA());
2809
+ nA || _ === !1 || _ === !0 && g(BA());
2810
2810
  }));
2811
2811
  const eA = (((IC = (EC = A == null ? void 0 : A.eInvoiceRegistration) == null ? void 0 : EC.organization) == null ? void 0 : IC.taxCode) || "").trim();
2812
2812
  return eA.length >= 10 && bA(eA), $C(dB(), TB().invoiceHubBaseUrl), A != null && A.idCard && (y = A == null ? void 0 : A.idCard), O(), {
2813
- container: J,
2813
+ container: F,
2814
2814
  getValues: BA
2815
2815
  };
2816
2816
  });
@@ -2916,15 +2916,15 @@ function aE({
2916
2916
  o.appendChild(f), I.appendChild(o);
2917
2917
  const H = document.createElement("div");
2918
2918
  H.className = "wgt:mt-4";
2919
- const X = document.createElement("span");
2920
- X.className = [
2919
+ const J = document.createElement("span");
2920
+ J.className = [
2921
2921
  "wgt:block",
2922
2922
  "wgt:text-2xl",
2923
2923
  "wgt:font-bold",
2924
2924
  B ? "wgt:text-primary" : "wgt:text-text-sub-600"
2925
2925
  ].join(" ");
2926
- let J = t ? (D = g == null ? void 0 : g.renewPrice) != null ? D : 0 : (T = g == null ? void 0 : g.price) != null ? T : 0;
2927
- X.innerText = RA((g == null ? void 0 : g.limit) * J), H.appendChild(X);
2926
+ let F = t ? (D = g == null ? void 0 : g.renewPrice) != null ? D : 0 : (T = g == null ? void 0 : g.price) != null ? T : 0;
2927
+ J.innerText = RA((g == null ? void 0 : g.limit) * F), H.appendChild(J);
2928
2928
  const r = document.createElement("span");
2929
2929
  return r.className = "wgt:text-sm wgt:text-text-sub-600", r.innerText = `VND/${e("package")}`, H.appendChild(r), n.appendChild(H), { container: n };
2930
2930
  }
@@ -2957,7 +2957,7 @@ function iC({
2957
2957
  ].join(" "), h.style.scrollSnapType = "x mandatory", h.style.overflowX = "auto", h.style.scrollBehavior = "smooth", h.style.scrollbarWidth = "none", h.style.msOverflowStyle = "none", h.style.WebkitOverflowScrolling = "touch", h.style.scrollbarWidth = "none", h.style.overflowY = "hidden", I.appendChild(h);
2958
2958
  function c() {
2959
2959
  h.innerHTML = "", A.forEach((u) => {
2960
- const f = u._id === B, H = E.includes(u.code), { container: X } = aE({
2960
+ const f = u._id === B, H = E.includes(u.code), { container: J } = aE({
2961
2961
  pkg: u,
2962
2962
  type: g,
2963
2963
  isDiscounted: H,
@@ -2968,7 +2968,7 @@ function iC({
2968
2968
  typeof t == "function" && t((Q || n) && f ? "" : u._id);
2969
2969
  }
2970
2970
  });
2971
- h.appendChild(X);
2971
+ h.appendChild(J);
2972
2972
  });
2973
2973
  }
2974
2974
  c();
@@ -2993,7 +2993,7 @@ function iC({
2993
2993
  }
2994
2994
  };
2995
2995
  }
2996
- const iE = "1.105.4";
2996
+ const iE = "1.105.5";
2997
2997
  function sE(E) {
2998
2998
  return V(this, arguments, function* ({ search: g, bank: A }) {
2999
2999
  return (yield zA.get(`${Sg}`, {
@@ -3215,10 +3215,10 @@ function ME({
3215
3215
  return V(this, null, function* () {
3216
3216
  A && clearTimeout(A), E !== "" ? A = setTimeout(() => V(null, null, function* () {
3217
3217
  try {
3218
- const J = E.trim().toLowerCase().replace(/\B(?=(\d{3})+(?!\d))/g, "."), r = yield sE({ search: J, bank: g });
3218
+ const F = E.trim().toLowerCase().replace(/\B(?=(\d{3})+(?!\d))/g, "."), r = yield sE({ search: F, bank: g });
3219
3219
  r && (Q = r), C && C();
3220
- } catch (J) {
3221
- console.error("Error searching packages:", J), hg.error(e("errorSearchingPackages"), {
3220
+ } catch (F) {
3221
+ console.error("Error searching packages:", F), hg.error(e("errorSearchingPackages"), {
3222
3222
  autoClose: 5e3,
3223
3223
  closeButton: !0,
3224
3224
  icon: !0
@@ -3230,8 +3230,8 @@ function ME({
3230
3230
  const s = oE({
3231
3231
  value: "",
3232
3232
  placeholder: e("searchUnits"),
3233
- onInputChange: (J) => {
3234
- E = J.target.value.replace(/\D/g, ""), c();
3233
+ onInputChange: (F) => {
3234
+ E = F.target.value.replace(/\D/g, ""), c();
3235
3235
  }
3236
3236
  });
3237
3237
  n.appendChild(s.container);
@@ -3248,25 +3248,25 @@ function ME({
3248
3248
  <span class="wgt:text-sm wgt:text-text-sub-600">${e("loading")}...</span>
3249
3249
  </div>
3250
3250
  `, u.appendChild(f);
3251
- function H(J) {
3252
- return B.find((r) => r._id === J) || null;
3251
+ function H(F) {
3252
+ return B.find((r) => r._id === F) || null;
3253
3253
  }
3254
- function X() {
3254
+ function J() {
3255
3255
  u.contains(f) && u.removeChild(f);
3256
3256
  }
3257
3257
  return {
3258
3258
  container: t,
3259
3259
  invoiceSelectorWrapper: u,
3260
- setInvoicePackages: (J) => {
3261
- B = J;
3260
+ setInvoicePackages: (F) => {
3261
+ B = F;
3262
3262
  },
3263
- setFilteredInvoiceOptions: (J) => {
3264
- Q = J;
3263
+ setFilteredInvoiceOptions: (F) => {
3264
+ Q = F;
3265
3265
  },
3266
3266
  getInvoicePackages: () => B,
3267
3267
  getFilteredInvoiceOptions: () => Q,
3268
3268
  findInvoiceById: H,
3269
- removeLoading: X
3269
+ removeLoading: J
3270
3270
  };
3271
3271
  }
3272
3272
  function sC(g = !1) {
@@ -3379,8 +3379,8 @@ function xE(d) {
3379
3379
  registrationData: u,
3380
3380
  setSelectedPromotions: f,
3381
3381
  setPackages: H,
3382
- setPromotionCodes: X,
3383
- isNewCustomer: J,
3382
+ setPromotionCodes: J,
3383
+ isNewCustomer: F,
3384
3384
  savedQuantities: r,
3385
3385
  setSavedQuantities: D,
3386
3386
  isRenewal: T
@@ -3399,20 +3399,20 @@ function xE(d) {
3399
3399
  const v = document.createElement("div");
3400
3400
  v.className = "wgt:relative wgt:flex wgt:w-full wgt:h-full wgt:flex-col wgt:gap-8 wgt:py-8";
3401
3401
  const {
3402
- container: F,
3402
+ container: X,
3403
3403
  open: j,
3404
3404
  close: l
3405
3405
  } = xB();
3406
- v.appendChild(F);
3406
+ v.appendChild(X);
3407
3407
  const b = document.createElement("div");
3408
3408
  b.className = "wgt:mx-auto wgt:w-full wgt:max-w-[1072px] wgt:flex wgt:flex-col wgt:gap-8 wgt:rounded-3xl wgt:bg-weak-50 wgt:px-6 wgt:py-4 wgt:@max-2xl:px-3 wgt:@max-2xl:py-3 wgt:@max-2xl:gap-6 wgt:@max-2xl:rounded-none", v.appendChild(b);
3409
3409
  const {
3410
3410
  container: L,
3411
3411
  invoiceSelectorWrapper: y,
3412
3412
  setInvoicePackages: CA,
3413
- getInvoicePackages: AA,
3413
+ getInvoicePackages: $,
3414
3414
  getFilteredInvoiceOptions: iA,
3415
- setFilteredInvoiceOptions: UA,
3415
+ setFilteredInvoiceOptions: SA,
3416
3416
  findInvoiceById: GA,
3417
3417
  removeLoading: FA
3418
3418
  } = ME({
@@ -3424,8 +3424,12 @@ function xE(d) {
3424
3424
  }
3425
3425
  });
3426
3426
  b.appendChild(L);
3427
- const { container: bA, signatureSelectorWrapper: uA } = sC(!J);
3428
- sC(!J), b.appendChild(bA);
3427
+ const { container: bA, signatureSelectorWrapper: uA } = (
3428
+ // createSignatureList(!isNewCustomer);
3429
+ // createSignatureList(!isNewCustomer);
3430
+ sC(T)
3431
+ );
3432
+ sC(T), b.appendChild(bA);
3429
3433
  const jA = document.createElement("div");
3430
3434
  jA.className = "wgt:flex wgt:items-center wgt:justify-center wgt:py-4", jA.innerHTML = `
3431
3435
  <div class="wgt:flex wgt:flex-col wgt:items-center wgt:gap-2">
@@ -3433,12 +3437,12 @@ function xE(d) {
3433
3437
  <span class="wgt:text-sm wgt:text-text-sub-600">${e("loading")}...</span>
3434
3438
  </div>
3435
3439
  `, b.appendChild(jA);
3436
- const { container: qA } = lE(), { container: Bg, tbody: lA } = TE(), SA = document.createElement("div");
3437
- SA.className = "wgt:hidden wgt:@max-2xl:flex wgt:items-center wgt:justify-between wgt:w-full wgt:bg-white wgt:border wgt:border-soft-200 wgt:rounded-lg wgt:px-6 wgt:py-5 wgt:shadow-lg";
3440
+ const { container: qA } = lE(), { container: Bg, tbody: lA } = TE(), pA = document.createElement("div");
3441
+ pA.className = "wgt:hidden wgt:@max-2xl:flex wgt:items-center wgt:justify-between wgt:w-full wgt:bg-white wgt:border wgt:border-soft-200 wgt:rounded-lg wgt:px-6 wgt:py-5 wgt:shadow-lg";
3438
3442
  const yA = document.createElement("span");
3439
- yA.className = "wgt:text-lg wgt:font-bold wgt:text-strong-950", yA.innerText = e("total"), SA.appendChild(yA);
3443
+ yA.className = "wgt:text-lg wgt:font-bold wgt:text-strong-950", yA.innerText = e("total"), pA.appendChild(yA);
3440
3444
  const dA = document.createElement("span");
3441
- dA.className = "wgt:text-xl wgt:font-bold wgt:text-primary", dA.innerText = "0 VND", SA.appendChild(dA);
3445
+ dA.className = "wgt:text-xl wgt:font-bold wgt:text-primary", dA.innerText = "0 VND", pA.appendChild(dA);
3442
3446
  const JA = document.createElement("div");
3443
3447
  JA.className = "wgt:flex wgt:justify-between wgt:gap-2", v.appendChild(JA);
3444
3448
  const KA = cg({
@@ -3450,28 +3454,28 @@ function xE(d) {
3450
3454
  JA.appendChild(KA);
3451
3455
  const $A = (U, gA, QA, EA) => V(null, null, function* () {
3452
3456
  j();
3453
- const _ = u.eInvoiceRegistration, { isUsedEInvoiceBefore: IA } = _, Z = Wg(_, ["isUsedEInvoiceBefore"]);
3454
- let W = [
3457
+ const W = u.eInvoiceRegistration, { isUsedEInvoiceBefore: IA } = W, Z = Wg(W, ["isUsedEInvoiceBefore"]);
3458
+ let AA = [
3455
3459
  {
3456
3460
  code: gA.code,
3457
3461
  quantity: gA.quantity
3458
3462
  }
3459
3463
  ];
3460
- QA && W.push({
3464
+ QA && AA.push({
3461
3465
  code: QA.code,
3462
3466
  quantity: QA.quantity
3463
- }), U && W.push({
3467
+ }), U && AA.push({
3464
3468
  code: U.code,
3465
3469
  quantity: U.quantity
3466
3470
  }), EA.length > 0 && EA.forEach((hA) => {
3467
3471
  const tA = m[hA];
3468
3472
  tA.reward.packageCodes.length > 0 && tA.reward.packageCodes.forEach((DA) => {
3469
- W.push({
3473
+ AA.push({
3470
3474
  code: DA,
3471
3475
  quantity: 1
3472
3476
  });
3473
3477
  });
3474
- }), H(W), X(EA);
3478
+ }), H(AA), J(EA);
3475
3479
  try {
3476
3480
  const hA = yield gQ({
3477
3481
  eInvoiceRegistration: MA({}, Z),
@@ -3483,7 +3487,7 @@ function xE(d) {
3483
3487
  u.idCard,
3484
3488
  u.idCardBack
3485
3489
  ],
3486
- packages: W,
3490
+ packages: AA,
3487
3491
  promotionCodes: EA,
3488
3492
  isRenew: T
3489
3493
  }), tA = hA.orderId, DA = hA.amount || 0;
@@ -3497,12 +3501,12 @@ function xE(d) {
3497
3501
  title: e("next"),
3498
3502
  className: "wgt:text-text-primary wgt:bg-primary",
3499
3503
  handleClick: () => V(null, null, function* () {
3500
- const U = AA().find(
3504
+ const U = $().find(
3501
3505
  (Z) => Z._id === q
3502
3506
  ), gA = x.find(
3503
3507
  (Z) => Z._id === M
3504
3508
  );
3505
- if (J && !gA) {
3509
+ if (!T && !gA) {
3506
3510
  hg.error(e("errorSelectSignature") || "Vui lòng chọn gói chữ ký số");
3507
3511
  return;
3508
3512
  }
@@ -3547,31 +3551,29 @@ function xE(d) {
3547
3551
  EA.reason
3548
3552
  ), hg.error(
3549
3553
  e("errorLoadingInitPackages") || "Failed to load registration packages"
3550
- ), k = []), QA.status === "fulfilled" ? (((U = QA == null ? void 0 : QA.value) == null ? void 0 : U.length) > 0 && QA.value.forEach((W) => {
3551
- W.codes.length > 0 && (m[W.codes[0].code] = {
3552
- id: W.id,
3553
- name: W.name,
3554
- nameEn: W.nameEn,
3555
- appliedPackages: W.condition.packageCodes,
3556
- code: W.codes[0].code,
3557
- limit: W.codes[0].limit,
3558
- used: W.codes[0].used,
3559
- bank: W.campaign.bank,
3560
- isActive: W.isActive,
3561
- type: W.type,
3562
- expiredAt: W.toDate,
3554
+ ), k = []), QA.status === "fulfilled" ? (((U = QA == null ? void 0 : QA.value) == null ? void 0 : U.length) > 0 && QA.value.forEach((AA) => {
3555
+ AA.codes.length > 0 && (m[AA.codes[0].code] = {
3556
+ id: AA.id,
3557
+ name: AA.name,
3558
+ nameEn: AA.nameEn,
3559
+ appliedPackages: AA.condition.packageCodes,
3560
+ code: AA.codes[0].code,
3561
+ limit: AA.codes[0].limit,
3562
+ used: AA.codes[0].used,
3563
+ bank: AA.campaign.bank,
3564
+ isActive: AA.isActive,
3565
+ type: AA.type,
3566
+ expiredAt: AA.toDate,
3563
3567
  isDisabled: !1,
3564
- reward: W.reward
3568
+ reward: AA.reward
3565
3569
  });
3566
- }), Object.keys(m).length > 0 && (Y = o ? [...o] : Object.keys(m).filter(
3567
- (W) => m[W].bank === s && m[W].expiredAt >= (/* @__PURE__ */ new Date()).toISOString() && m[W].limit > m[W].used
3568
- ), vg())) : console.error("Failed to load promotions:", QA.reason), IA.status === "fulfilled") {
3569
- const W = T ? IA.value.filter((_) => _.renewPrice !== 0) : IA.value;
3570
- if (CA(W || []), IA.value.length > 0) {
3571
- const _ = IA.value.find(
3570
+ }), Object.keys(m).length > 0 && (Y = o ? [...o] : [], vg())) : console.error("Failed to load promotions:", QA.reason), IA.status === "fulfilled") {
3571
+ const AA = T ? IA.value.filter((W) => W.renewPrice !== 0) : IA.value;
3572
+ if (CA(AA || []), IA.value.length > 0) {
3573
+ const W = IA.value.find(
3572
3574
  (hA) => z.includes(hA.code)
3573
3575
  );
3574
- q = C ? C._id : _ ? _._id : W == null ? void 0 : W[0]._id, UA(W);
3576
+ q = C ? C._id : W ? W._id : AA == null ? void 0 : AA[0]._id, SA(AA);
3575
3577
  }
3576
3578
  FA();
3577
3579
  } else
@@ -3583,14 +3585,17 @@ function xE(d) {
3583
3585
  ), CA([]), FA();
3584
3586
  if (Z.status === "fulfilled")
3585
3587
  if (x = Z.value || [], x.length > 0) {
3586
- const W = x.find(
3587
- (_) => z.includes(_.code)
3588
+ const AA = x.find(
3589
+ (W) => z.includes(W.code)
3588
3590
  );
3589
- J ? M = B ? B._id : W ? W._id : J ? (gA = x == null ? void 0 : x.filter((_) => !_.isBonusPackage)[0]) == null ? void 0 : gA._id : null : M = B ? B._id : (
3591
+ T ? M = B ? B._id : (
3590
3592
  // : promotionPkg
3591
3593
  // ? promotionPkg._id
3592
3594
  // : signaturePackages?.filter((p) => !p.isBonusPackage)[0]?._id;
3593
3595
  null
3596
+ ) : M = B ? B._id : AA ? AA._id : (
3597
+ // : isNewCustomer
3598
+ T ? null : (gA = x == null ? void 0 : x.filter((W) => !W.isBonusPackage)[0]) == null ? void 0 : gA._id
3594
3599
  );
3595
3600
  } else
3596
3601
  console.error(
@@ -3610,23 +3615,23 @@ function xE(d) {
3610
3615
  });
3611
3616
  }
3612
3617
  function mg() {
3613
- Pg(), Xg(), Ag(), ZA(), TA();
3618
+ UA(), Pg(), Xg(), Ag(), ZA(), TA();
3614
3619
  }
3615
3620
  function Cg(U, gA, QA) {
3616
3621
  const EA = Object.values(m).find(
3617
- (_) => _.bank === s && _.appliedPackages.includes(U)
3622
+ (W) => W.bank === s && W.appliedPackages.includes(U)
3618
3623
  ), IA = EA && !EA.isDisabled && !(EA.expiredAt < (/* @__PURE__ */ new Date()).toISOString()) && EA.limit !== EA.used, Z = Object.values(m).find(
3619
- (_) => _.bank === s && _.appliedPackages.includes(gA)
3620
- ), W = Z && !Z.isDisabled && !(Z.expiredAt < (/* @__PURE__ */ new Date()).toISOString()) && Z.limit !== Z.used;
3621
- if (IA && !W) {
3622
- const { container: _, open: hA } = Kg({
3624
+ (W) => W.bank === s && W.appliedPackages.includes(gA)
3625
+ ), AA = Z && !Z.isDisabled && !(Z.expiredAt < (/* @__PURE__ */ new Date()).toISOString()) && Z.limit !== Z.used;
3626
+ if (IA && !AA) {
3627
+ const { container: W, open: hA } = Kg({
3623
3628
  message: e("errorDiscountPackage"),
3624
3629
  okLabel: e("ok"),
3625
3630
  cancelLabel: e("cancel"),
3626
3631
  onClose: QA,
3627
3632
  isSuccess: !1
3628
3633
  });
3629
- v.appendChild(_), hA();
3634
+ v.appendChild(W), hA();
3630
3635
  } else
3631
3636
  QA();
3632
3637
  }
@@ -3643,11 +3648,11 @@ function xE(d) {
3643
3648
  isRenew: T,
3644
3649
  handlePackageSelect: (U) => {
3645
3650
  var EA, IA;
3646
- let gA = (EA = AA().find(
3651
+ let gA = (EA = $().find(
3647
3652
  (Z) => Z._id === q
3648
- )) == null ? void 0 : EA.code, QA = (IA = AA().find((Z) => Z._id === U)) == null ? void 0 : IA.code;
3653
+ )) == null ? void 0 : EA.code, QA = (IA = $().find((Z) => Z._id === U)) == null ? void 0 : IA.code;
3649
3654
  Cg(gA, QA, () => {
3650
- q = U, Qg.setSelectedPackageId(U), pA(), Ag(), ZA(), TA();
3655
+ q = U, Qg.setSelectedPackageId(U), UA(), Ag(), ZA(), TA();
3651
3656
  });
3652
3657
  }
3653
3658
  }), y.appendChild(Qg.container);
@@ -3665,18 +3670,19 @@ function xE(d) {
3665
3670
  disCountedPackages: z,
3666
3671
  promotion: e("gift"),
3667
3672
  selectedPackageId: M,
3668
- allowDeselect: !J,
3673
+ // allowDeselect: !isNewCustomer,
3674
+ allowDeselect: T,
3669
3675
  handlePackageSelect: (U) => {
3670
3676
  var EA, IA;
3671
3677
  let gA = (EA = x.find(
3672
3678
  (Z) => Z._id === M
3673
3679
  )) == null ? void 0 : EA.code, QA = (IA = x.find((Z) => Z._id === U)) == null ? void 0 : IA.code;
3674
- if (!J && M === U) {
3675
- M = null, og.setSelectedPackageId(null), pA(), Ag(), ZA(), TA();
3680
+ if (T && M === U) {
3681
+ M = null, og.setSelectedPackageId(null), UA(), Ag(), ZA(), TA();
3676
3682
  return;
3677
3683
  }
3678
3684
  Cg(gA, QA, () => {
3679
- M = U, og.setSelectedPackageId(U), UA(AA()), pA(), Ag(), ZA(), TA();
3685
+ M = U, og.setSelectedPackageId(U), SA($()), UA(), Ag(), ZA(), TA();
3680
3686
  });
3681
3687
  }
3682
3688
  }), uA.appendChild(og.container);
@@ -3689,7 +3695,7 @@ function xE(d) {
3689
3695
  qg.className = "wgt:w-full", b.appendChild(qg);
3690
3696
  function Ag() {
3691
3697
  jA.remove(), qg.innerHTML = "";
3692
- const U = AA().find(
3698
+ const U = $().find(
3693
3699
  (gA) => gA._id === q
3694
3700
  );
3695
3701
  if (k.length > 0) {
@@ -3712,8 +3718,8 @@ function xE(d) {
3712
3718
  }
3713
3719
  const OA = document.createElement("div");
3714
3720
  OA.className = "promotion-wrapper wgt:w-full wgt:flex wgt:flex-col wgt:gap-4";
3715
- function pA() {
3716
- const U = AA().find(
3721
+ function UA() {
3722
+ const U = $().find(
3717
3723
  (IA) => IA._id === q
3718
3724
  ), gA = x.find(
3719
3725
  (IA) => IA._id === M
@@ -3727,9 +3733,9 @@ function xE(d) {
3727
3733
  );
3728
3734
  return;
3729
3735
  }
3730
- const W = Z.expiredAt < (/* @__PURE__ */ new Date()).toISOString(), _ = Z.limit <= Z.used, hA = !Z.isActive, DA = ((xA = Z.appliedPackages) == null ? void 0 : xA.some(
3736
+ const AA = Z.expiredAt < (/* @__PURE__ */ new Date()).toISOString(), W = Z.limit <= Z.used, hA = !Z.isActive, DA = ((xA = Z.appliedPackages) == null ? void 0 : xA.some(
3731
3737
  (XA) => EA.includes(XA)
3732
- )) && !W && !_ && !hA;
3738
+ )) && !AA && !W && !hA;
3733
3739
  Z.isDisabled = !DA, DA ? DA && !Y.includes(Z.code) && Y.push(Z.code) : Y = Y.filter(
3734
3740
  (XA) => XA !== Z.code
3735
3741
  );
@@ -3742,7 +3748,7 @@ function xE(d) {
3742
3748
  }
3743
3749
  function ZA() {
3744
3750
  if (Object.values(m).filter(
3745
- (_) => _.bank === s
3751
+ (W) => W.bank === s
3746
3752
  ).length === 0) {
3747
3753
  b.contains(OA) && b.removeChild(OA);
3748
3754
  return;
@@ -3787,32 +3793,32 @@ function xE(d) {
3787
3793
  QA.appendChild(IA), OA.appendChild(QA);
3788
3794
  const Z = document.createElement("div");
3789
3795
  Z.className = "wgt:w-full wgt:grid wgt:grid-cols-3 wgt:gap-4 wgt:@max-2xl:flex wgt:@max-2xl:flex-col", OA.appendChild(Z);
3790
- const W = Object.values(m).filter(
3791
- (_) => _.bank === s
3796
+ const AA = Object.values(m).filter(
3797
+ (W) => W.bank === s
3792
3798
  );
3793
- if (W.length > 0)
3794
- W.forEach((_) => {
3799
+ if (AA.length > 0)
3800
+ AA.forEach((W) => {
3795
3801
  const { container: hA } = vE({
3796
- promotion: NA(MA({}, _), {
3797
- isSelected: Y.includes(_.code)
3802
+ promotion: NA(MA({}, W), {
3803
+ isSelected: Y.includes(W.code)
3798
3804
  }),
3799
3805
  onSelect: (tA, DA) => {
3800
3806
  DA ? Y.push(tA) : Y = Y.filter(
3801
3807
  (xA) => xA !== tA
3802
3808
  ), ZA(), TA();
3803
3809
  },
3804
- isDisabled: _.isDisabled || _.expiredAt < (/* @__PURE__ */ new Date()).toISOString() || _.limit === _.used
3810
+ isDisabled: W.isDisabled || W.expiredAt < (/* @__PURE__ */ new Date()).toISOString() || W.limit === W.used
3805
3811
  });
3806
3812
  Z.appendChild(hA);
3807
3813
  });
3808
3814
  else {
3809
- const _ = document.createElement("span");
3810
- _.className = "wgt:text-text-sub-600", _.innerText = e("noPromotionFound"), OA.appendChild(_);
3815
+ const W = document.createElement("span");
3816
+ W.className = "wgt:text-text-sub-600", W.innerText = e("noPromotionFound"), OA.appendChild(W);
3811
3817
  }
3812
3818
  }
3813
3819
  function TA() {
3814
3820
  var XA, kg, gg, Eg, Ig, Fg, Og, Mg, lg;
3815
- if (w(), lA.innerHTML = "", b.appendChild(Bg), b.appendChild(SA), b.appendChild(qA), AA().length === 0 && x.length === 0) {
3821
+ if (w(), lA.innerHTML = "", b.appendChild(Bg), b.appendChild(pA), b.appendChild(qA), $().length === 0 && x.length === 0) {
3816
3822
  const O = document.createElement("tr");
3817
3823
  O.innerHTML = `
3818
3824
  <td colspan="5" class="wgt:px-3 wgt:py-8 wgt:text-center wgt:text-text-sub-600 wgt:@max-2xl:col-span-5">
@@ -3821,7 +3827,7 @@ function xE(d) {
3821
3827
  `, lA.appendChild(O), h(0);
3822
3828
  return;
3823
3829
  }
3824
- const U = AA().find(
3830
+ const U = $().find(
3825
3831
  (O) => O._id === q
3826
3832
  );
3827
3833
  if (!T && (k == null ? void 0 : k.length) > 0 && !(U != null && U.withoutInitialFee)) {
@@ -3881,7 +3887,7 @@ function xE(d) {
3881
3887
  wA.className = "wgt:w-full wgt:justify-between wgt:inline-flex wgt:items-center wgt:border wgt:border-soft-200 wgt:rounded-lg wgt:@max-2xl:w-full wgt:@max-2xl:max-w-[200px] wgt:@max-2xl:mx-auto";
3882
3888
  const oA = document.createElement("button");
3883
3889
  oA.type = "button", oA.ariaLabel = e("decrease");
3884
- const aA = J ? (Ig = O == null ? void 0 : O.price) != null ? Ig : 0 : (Fg = O == null ? void 0 : O.renewPrice) != null ? Fg : 0;
3890
+ const aA = F ? (Ig = O == null ? void 0 : O.price) != null ? Ig : 0 : (Fg = O == null ? void 0 : O.renewPrice) != null ? Fg : 0;
3885
3891
  oA.disabled = p <= 1 || aA === 0, oA.className = "wgt:flex wgt:h-8 wgt:w-8 wgt:items-center wgt:justify-center wgt:rounded-lg wgt:bg-weak-50 wgt:text-strong-950 wgt:disabled:cursor-not-allowed wgt:disabled:opacity-50 wgt:@max-2xl:h-12 wgt:@max-2xl:w-12 wgt:@max-2xl:text-lg wgt:@max-2xl:font-bold", oA.innerText = "–", oA.addEventListener("click", () => {
3886
3892
  p > 1 && (p -= 1, TA());
3887
3893
  }), wA.appendChild(oA);
@@ -3983,7 +3989,7 @@ function xE(d) {
3983
3989
  "package"
3984
3990
  )} ${(kA = (fA = O == null ? void 0 : O.reward) == null ? void 0 : fA.packageCodes) == null ? void 0 : kA.join(", ")}`, sA.style.color = "#12B76A") : sA.innerText = "", BA.appendChild(sA), lA.appendChild(BA);
3985
3991
  });
3986
- const EA = !T && k.length > 0 && !(U != null && U.withoutInitialFee) ? ((Og = k[0]) == null ? void 0 : Og.price) * K : 0, IA = GA(q), Z = IA ? T ? (lg = IA.renewPrice) != null ? lg : 0 : (Mg = IA.price) != null ? Mg : 0 : 0, W = IA ? Z * IA.limit * p : 0, _ = R(M), hA = _ ? _.price * _.limit * a : 0, tA = EA + W + hA, DA = Math.min(QA, tA), xA = Math.max(tA - DA, 0);
3992
+ const EA = !T && k.length > 0 && !(U != null && U.withoutInitialFee) ? ((Og = k[0]) == null ? void 0 : Og.price) * K : 0, IA = GA(q), Z = IA ? T ? (lg = IA.renewPrice) != null ? lg : 0 : (Mg = IA.price) != null ? Mg : 0 : 0, AA = IA ? Z * IA.limit * p : 0, W = R(M), hA = W ? W.price * W.limit * a : 0, tA = EA + AA + hA, DA = Math.min(QA, tA), xA = Math.max(tA - DA, 0);
3987
3993
  h(xA);
3988
3994
  {
3989
3995
  const O = document.createElement("tr");
@@ -4029,18 +4035,18 @@ function HE({
4029
4035
  const k = document.createElement("img");
4030
4036
  k.src = x, k.alt = "Logo", k.className = `wgt:w-${I === "ocb" ? "28" : "8"} wgt:object-contain`, H.appendChild(k);
4031
4037
  }), i.appendChild(H);
4032
- const X = document.createElement("div");
4033
- X.className = "wgt:text-center wgt:flex wgt:flex-col wgt:gap-1";
4034
- const J = document.createElement("h3");
4035
- J.className = "wgt:text-lg wgt:font-bold wgt:text-text-black", J.innerText = C, X.appendChild(J);
4038
+ const J = document.createElement("div");
4039
+ J.className = "wgt:text-center wgt:flex wgt:flex-col wgt:gap-1";
4040
+ const F = document.createElement("h3");
4041
+ F.className = "wgt:text-lg wgt:font-bold wgt:text-text-black", F.innerText = C, J.appendChild(F);
4036
4042
  const r = document.createElement("p");
4037
4043
  r.className = "wgt:text-sm wgt:text-grey-8", r.innerHTML = `${e(
4038
4044
  "accountNumber"
4039
- )}: <span class="wgt:font-medium">${B}</span>`, X.appendChild(r);
4045
+ )}: <span class="wgt:font-medium">${B}</span>`, J.appendChild(r);
4040
4046
  const D = document.createElement("p");
4041
4047
  D.className = "wgt:text-sm wgt:text-grey-8", D.innerHTML = `${e(
4042
4048
  "beneficiaryBank"
4043
- )}: <span class="wgt:font-medium">${Q}</span>`, X.appendChild(D), i.appendChild(X), c.appendChild(i), h.appendChild(c);
4049
+ )}: <span class="wgt:font-medium">${Q}</span>`, J.appendChild(D), i.appendChild(J), c.appendChild(i), h.appendChild(c);
4044
4050
  const T = document.createElement("div");
4045
4051
  T.className = "wgt:flex wgt:flex-col wgt:justify-between wgt:@min-2xl:w-1/2";
4046
4052
  const d = document.createElement("div"), P = document.createElement("h3");
@@ -4067,7 +4073,7 @@ function HE({
4067
4073
  x.qrSrc != null && (f.src = x.qrSrc), x.logos && (H.innerHTML = "", x.logos.forEach((k) => {
4068
4074
  const m = document.createElement("img");
4069
4075
  m.src = k, m.alt = "Logo", m.className = "wgt:w-8 wgt:object-contain", H.appendChild(m);
4070
- })), x.accountName != null && (J.innerText = x.accountName), x.accountNumber != null && (r.innerHTML = `${e(
4076
+ })), x.accountName != null && (F.innerText = x.accountName), x.accountNumber != null && (r.innerHTML = `${e(
4071
4077
  "accountNumber"
4072
4078
  )}: <span class="wgt:font-medium">${x.accountNumber}</span>`), x.bankName != null && (D.innerHTML = `${e(
4073
4079
  "beneficiaryBank"
@@ -4173,28 +4179,28 @@ function JE({
4173
4179
  "wgt:gap-10",
4174
4180
  "wgt:shadow-[0px_2px_6px_0px_rgba(31,34,41,0.04)]"
4175
4181
  ].join(" ");
4176
- const X = document.createElement("div");
4177
- X.className = "wgt:w-full wgt:flex wgt:flex-col wgt:gap-4";
4178
- const J = document.createElement("h2");
4179
- J.className = "wgt:text-xl wgt:font-semibold wgt:leading-6 wgt:text-black", J.innerText = e("orderInfo"), X.appendChild(J);
4182
+ const J = document.createElement("div");
4183
+ J.className = "wgt:w-full wgt:flex wgt:flex-col wgt:gap-4";
4184
+ const F = document.createElement("h2");
4185
+ F.className = "wgt:text-xl wgt:font-semibold wgt:leading-6 wgt:text-black", F.innerText = e("orderInfo"), J.appendChild(F);
4180
4186
  const r = document.createElement("div");
4181
4187
  r.className = "wgt:w-full wgt:flex wgt:items-center wgt:justify-between";
4182
4188
  const D = document.createElement("h4");
4183
4189
  D.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", D.innerText = e("provider");
4184
4190
  const T = document.createElement("img");
4185
- g && g.logoUrl && (T.src = g.logoUrl, T.alt = g.name, T.className = "wgt:h-6 wgt:object-contain"), r.appendChild(D), r.appendChild(T), X.appendChild(r);
4191
+ g && g.logoUrl && (T.src = g.logoUrl, T.alt = g.name, T.className = "wgt:h-6 wgt:object-contain"), r.appendChild(D), r.appendChild(T), J.appendChild(r);
4186
4192
  const d = document.createElement("div");
4187
4193
  d.className = "wgt:w-full wgt:flex wgt:items-center wgt:justify-between";
4188
4194
  const P = document.createElement("h4");
4189
4195
  P.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", P.innerText = e("subscriptionPackage");
4190
4196
  const q = document.createElement("span");
4191
- q.className = "wgt:text-base wgt:font-semibold wgt:leading-6 wgt:text-text-black", q.innerText = A ? `${String(A == null ? void 0 : A.code)}` : "", d.appendChild(P), d.appendChild(q), X.appendChild(d);
4197
+ q.className = "wgt:text-base wgt:font-semibold wgt:leading-6 wgt:text-text-black", q.innerText = A ? `${String(A == null ? void 0 : A.code)}` : "", d.appendChild(P), d.appendChild(q), J.appendChild(d);
4192
4198
  const M = document.createElement("div");
4193
4199
  M.className = "wgt:w-full wgt:flex wgt:items-center wgt:justify-between";
4194
4200
  const Y = document.createElement("h4");
4195
4201
  Y.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", Y.innerText = e("digitalSignaturePackage");
4196
4202
  const x = document.createElement("span");
4197
- if (x.className = "wgt:text-base wgt:font-semibold wgt:leading-6 wgt:text-text-black", x.innerText = E ? `${String(E == null ? void 0 : E.code)}` : "", M.appendChild(Y), M.appendChild(x), X.appendChild(M), Q && Q.length > 0) {
4203
+ if (x.className = "wgt:text-base wgt:font-semibold wgt:leading-6 wgt:text-text-black", x.innerText = E ? `${String(E == null ? void 0 : E.code)}` : "", M.appendChild(Y), M.appendChild(x), J.appendChild(M), Q && Q.length > 0) {
4198
4204
  const l = document.createElement("div");
4199
4205
  l.className = "wgt:w-full wgt:flex wgt:items-start wgt:justify-between wgt:gap-[0.5rem]";
4200
4206
  const b = document.createElement("h4");
@@ -4203,16 +4209,16 @@ function JE({
4203
4209
  L.className = "wgt:flex wgt:items-center wgt:justify-end wgt:flex-wrap wgt:gap-2", Q.forEach((y) => {
4204
4210
  const CA = document.createElement("div");
4205
4211
  CA.className = "wgt:w-fit wgt:px-3 wgt:py-1 wgt:text-xs wgt:font-normal wgt:text-primary wgt:border wgt:border-primary", CA.innerText = y, L.appendChild(CA);
4206
- }), l.appendChild(b), l.appendChild(L), X.appendChild(l);
4212
+ }), l.appendChild(b), l.appendChild(L), J.appendChild(l);
4207
4213
  }
4208
4214
  const k = document.createElement("hr");
4209
- X.appendChild(k);
4215
+ J.appendChild(k);
4210
4216
  const m = document.createElement("div");
4211
4217
  m.className = "wgt:w-full wgt:flex wgt:items-center wgt:justify-between";
4212
4218
  const z = document.createElement("h4");
4213
4219
  z.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#475467]", z.innerText = e("paymentAmount");
4214
4220
  const S = document.createElement("span");
4215
- S.className = "wgt:text-2xl wgt:font-bold wgt:leading-6 wgt:text-[#ED1C24]", S.innerText = typeof B == "number" ? B.toLocaleString("vi-VN") + " VND" : B, m.appendChild(z), m.appendChild(S), X.appendChild(m), H.appendChild(X);
4221
+ S.className = "wgt:text-2xl wgt:font-bold wgt:leading-6 wgt:text-[#ED1C24]", S.innerText = typeof B == "number" ? B.toLocaleString("vi-VN") + " VND" : B, m.appendChild(z), m.appendChild(S), J.appendChild(m), H.appendChild(J);
4216
4222
  const K = document.createElement("div");
4217
4223
  K.className = "wgt:w-full wgt:flex wgt:flex-col wgt:gap-2 wgt:p-4 wgt:rounded-lg wgt:mt-8", K.style.backgroundColor = "#47c2ff29";
4218
4224
  const p = document.createElement("div");
@@ -4228,11 +4234,11 @@ function JE({
4228
4234
  R.className = "wgt:flex wgt:items-start wgt:gap-2";
4229
4235
  const v = document.createElement("img");
4230
4236
  v.src = YE, v.alt = "support", v.className = "wgt:w-4 wgt:h-4";
4231
- const F = document.createElement("p");
4232
- F.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#344054]", F.innerHTML = e(
4237
+ const X = document.createElement("p");
4238
+ X.className = "wgt:text-sm wgt:font-normal wgt:leading-5 wgt:text-[#344054]", X.innerHTML = e(
4233
4239
  "contact_info",
4234
4240
  'Thông tin liên hệ: <a href="mailto:hotro247@atomsolution.vn" class="wgt:font-semibold wgt:underline">hotro247@atomsolution.vn</a>'
4235
- ), R.appendChild(v), R.appendChild(F), K.appendChild(p), K.appendChild(R), X.appendChild(K);
4241
+ ), R.appendChild(v), R.appendChild(X), K.appendChild(p), K.appendChild(R), J.appendChild(K);
4236
4242
  const j = cg({
4237
4243
  title: e("cancelTransaction"),
4238
4244
  className: "wgt:bg-transparent wgt:border wgt:border-primary wgt:text-primary wgt:hover:bg-transparent",
@@ -4267,13 +4273,13 @@ function JE({
4267
4273
  b && (b.innerText = l ? String((y = (L = l.code) != null ? L : l.limit) != null ? y : "") : "");
4268
4274
  },
4269
4275
  setSelectedSignaturePackage(l) {
4270
- var y, CA, AA;
4276
+ var y, CA, $;
4271
4277
  E = l;
4272
4278
  const b = n.querySelectorAll(
4273
4279
  ".wgt:text-base.wgt:font-semibold.wgt:leading-6.wgt:text-text-black"
4274
4280
  ), L = b == null ? void 0 : b[1];
4275
4281
  if (L) {
4276
- const iA = l ? String((AA = (CA = l.code) != null ? CA : (y = l.name) == null ? void 0 : y.split("-")[1]) != null ? AA : "") : "";
4282
+ const iA = l ? String(($ = (CA = l.code) != null ? CA : (y = l.name) == null ? void 0 : y.split("-")[1]) != null ? $ : "") : "";
4277
4283
  L.innerText = iA;
4278
4284
  }
4279
4285
  },
@@ -4327,15 +4333,15 @@ function XE({
4327
4333
  u.className = "wgt:text-sm wgt:text-grey-8", u.innerText = e("freeOrderDescription") || "Bạn không cần thanh toán cho đơn hàng này. Vui lòng xác nhận để hoàn tất đăng ký.", i.appendChild(u), I.appendChild(i), t.appendChild(I), Q.appendChild(t);
4328
4334
  const f = document.createElement("div");
4329
4335
  f.className = "wgt:flex wgt:flex-col wgt:justify-between wgt:@min-2xl:w-1/2";
4330
- const H = document.createElement("div"), X = document.createElement("h3");
4331
- X.className = "wgt:text-lg wgt:font-semibold wgt:text-gray-800 wgt:mb-4", X.innerText = e("freeOrderStepsTitle") || "Các bước tiếp theo", H.appendChild(X);
4332
- const J = [
4336
+ const H = document.createElement("div"), J = document.createElement("h3");
4337
+ J.className = "wgt:text-lg wgt:font-semibold wgt:text-gray-800 wgt:mb-4", J.innerText = e("freeOrderStepsTitle") || "Các bước tiếp theo", H.appendChild(J);
4338
+ const F = [
4333
4339
  e("freeOrderStep1") || "Nhấn nút 'Xác nhận đơn hàng' bên trái để hoàn tất",
4334
4340
  e("freeOrderStep2") || "Hệ thống sẽ tự động xử lý đơn hàng của bạn",
4335
4341
  e("freeOrderStep3") || "Bạn sẽ được chuyển đến trang xác nhận sau khi hoàn tất",
4336
4342
  e("freeOrderStep4") || "Kiểm tra email để nhận thông tin đăng ký"
4337
4343
  ], r = document.createElement("ol");
4338
- r.className = "wgt:space-y-4", J.forEach((d, P) => {
4344
+ r.className = "wgt:space-y-4", F.forEach((d, P) => {
4339
4345
  const q = document.createElement("li");
4340
4346
  q.className = "wgt:flex wgt:items-start";
4341
4347
  const M = document.createElement("div");
@@ -5212,9 +5218,9 @@ function KE() {
5212
5218
  if (!Q.isValid(o))
5213
5219
  throw new Error("Invalid QR Code version");
5214
5220
  typeof f == "undefined" && (f = B.BYTE);
5215
- const H = A.getSymbolTotalCodewords(o), X = E.getTotalCodewordsCount(o, u), J = (H - X) * 8;
5216
- if (f === B.MIXED) return J;
5217
- const r = J - h(f, o);
5221
+ const H = A.getSymbolTotalCodewords(o), J = E.getTotalCodewordsCount(o, u), F = (H - J) * 8;
5222
+ if (f === B.MIXED) return F;
5223
+ const r = F - h(f, o);
5218
5224
  switch (f) {
5219
5225
  case B.NUMERIC:
5220
5226
  return Math.floor(r / 10 * 3);
@@ -5417,8 +5423,8 @@ function WE() {
5417
5423
  i.hasOwnProperty(c) && (o = i[c], u = s + o, f = t[c], H = typeof t[c] == "undefined", (H || f > u) && (t[c] = u, n.push(c, u), Q[c] = h));
5418
5424
  }
5419
5425
  if (typeof B != "undefined" && typeof t[B] == "undefined") {
5420
- var X = ["Could not find a path from ", C, " to ", B, "."].join("");
5421
- throw new Error(X);
5426
+ var J = ["Could not find a path from ", C, " to ", B, "."].join("");
5427
+ throw new Error(J);
5422
5428
  }
5423
5429
  return Q;
5424
5430
  },
@@ -5474,25 +5480,25 @@ var LC;
5474
5480
  function _E() {
5475
5481
  return LC || (LC = 1, function(g) {
5476
5482
  const A = fg(), E = SE(), C = pE(), B = ZE(), Q = VE(), t = QQ(), n = Dg(), I = WE();
5477
- function h(X) {
5478
- return unescape(encodeURIComponent(X)).length;
5483
+ function h(J) {
5484
+ return unescape(encodeURIComponent(J)).length;
5479
5485
  }
5480
- function c(X, J, r) {
5486
+ function c(J, F, r) {
5481
5487
  const D = [];
5482
5488
  let T;
5483
- for (; (T = X.exec(r)) !== null; )
5489
+ for (; (T = J.exec(r)) !== null; )
5484
5490
  D.push({
5485
5491
  data: T[0],
5486
5492
  index: T.index,
5487
- mode: J,
5493
+ mode: F,
5488
5494
  length: T[0].length
5489
5495
  });
5490
5496
  return D;
5491
5497
  }
5492
- function s(X) {
5493
- const J = c(t.NUMERIC, A.NUMERIC, X), r = c(t.ALPHANUMERIC, A.ALPHANUMERIC, X);
5498
+ function s(J) {
5499
+ const F = c(t.NUMERIC, A.NUMERIC, J), r = c(t.ALPHANUMERIC, A.ALPHANUMERIC, J);
5494
5500
  let D, T;
5495
- return n.isKanjiModeEnabled() ? (D = c(t.BYTE, A.BYTE, X), T = c(t.KANJI, A.KANJI, X)) : (D = c(t.BYTE_KANJI, A.BYTE, X), T = []), J.concat(r, D, T).sort(function(P, q) {
5501
+ return n.isKanjiModeEnabled() ? (D = c(t.BYTE, A.BYTE, J), T = c(t.KANJI, A.KANJI, J)) : (D = c(t.BYTE_KANJI, A.BYTE, J), T = []), F.concat(r, D, T).sort(function(P, q) {
5496
5502
  return P.index - q.index;
5497
5503
  }).map(function(P) {
5498
5504
  return {
@@ -5502,67 +5508,67 @@ function _E() {
5502
5508
  };
5503
5509
  });
5504
5510
  }
5505
- function i(X, J) {
5506
- switch (J) {
5511
+ function i(J, F) {
5512
+ switch (F) {
5507
5513
  case A.NUMERIC:
5508
- return E.getBitsLength(X);
5514
+ return E.getBitsLength(J);
5509
5515
  case A.ALPHANUMERIC:
5510
- return C.getBitsLength(X);
5516
+ return C.getBitsLength(J);
5511
5517
  case A.KANJI:
5512
- return Q.getBitsLength(X);
5518
+ return Q.getBitsLength(J);
5513
5519
  case A.BYTE:
5514
- return B.getBitsLength(X);
5520
+ return B.getBitsLength(J);
5515
5521
  }
5516
5522
  }
5517
- function o(X) {
5518
- return X.reduce(function(J, r) {
5519
- const D = J.length - 1 >= 0 ? J[J.length - 1] : null;
5520
- return D && D.mode === r.mode ? (J[J.length - 1].data += r.data, J) : (J.push(r), J);
5523
+ function o(J) {
5524
+ return J.reduce(function(F, r) {
5525
+ const D = F.length - 1 >= 0 ? F[F.length - 1] : null;
5526
+ return D && D.mode === r.mode ? (F[F.length - 1].data += r.data, F) : (F.push(r), F);
5521
5527
  }, []);
5522
5528
  }
5523
- function u(X) {
5524
- const J = [];
5525
- for (let r = 0; r < X.length; r++) {
5526
- const D = X[r];
5529
+ function u(J) {
5530
+ const F = [];
5531
+ for (let r = 0; r < J.length; r++) {
5532
+ const D = J[r];
5527
5533
  switch (D.mode) {
5528
5534
  case A.NUMERIC:
5529
- J.push([
5535
+ F.push([
5530
5536
  D,
5531
5537
  { data: D.data, mode: A.ALPHANUMERIC, length: D.length },
5532
5538
  { data: D.data, mode: A.BYTE, length: D.length }
5533
5539
  ]);
5534
5540
  break;
5535
5541
  case A.ALPHANUMERIC:
5536
- J.push([
5542
+ F.push([
5537
5543
  D,
5538
5544
  { data: D.data, mode: A.BYTE, length: D.length }
5539
5545
  ]);
5540
5546
  break;
5541
5547
  case A.KANJI:
5542
- J.push([
5548
+ F.push([
5543
5549
  D,
5544
5550
  { data: D.data, mode: A.BYTE, length: h(D.data) }
5545
5551
  ]);
5546
5552
  break;
5547
5553
  case A.BYTE:
5548
- J.push([
5554
+ F.push([
5549
5555
  { data: D.data, mode: A.BYTE, length: h(D.data) }
5550
5556
  ]);
5551
5557
  }
5552
5558
  }
5553
- return J;
5559
+ return F;
5554
5560
  }
5555
- function f(X, J) {
5561
+ function f(J, F) {
5556
5562
  const r = {}, D = { start: {} };
5557
5563
  let T = ["start"];
5558
- for (let d = 0; d < X.length; d++) {
5559
- const P = X[d], q = [];
5564
+ for (let d = 0; d < J.length; d++) {
5565
+ const P = J[d], q = [];
5560
5566
  for (let M = 0; M < P.length; M++) {
5561
5567
  const Y = P[M], x = "" + d + M;
5562
5568
  q.push(x), r[x] = { node: Y, lastCount: 0 }, D[x] = {};
5563
5569
  for (let k = 0; k < T.length; k++) {
5564
5570
  const m = T[k];
5565
- r[m] && r[m].node.mode === Y.mode ? (D[m][x] = i(r[m].lastCount + Y.length, Y.mode) - i(r[m].lastCount, Y.mode), r[m].lastCount += Y.length) : (r[m] && (r[m].lastCount = Y.length), D[m][x] = i(Y.length, Y.mode) + 4 + A.getCharCountIndicator(Y.mode, J));
5571
+ r[m] && r[m].node.mode === Y.mode ? (D[m][x] = i(r[m].lastCount + Y.length, Y.mode) - i(r[m].lastCount, Y.mode), r[m].lastCount += Y.length) : (r[m] && (r[m].lastCount = Y.length), D[m][x] = i(Y.length, Y.mode) + 4 + A.getCharCountIndicator(Y.mode, F));
5566
5572
  }
5567
5573
  }
5568
5574
  T = q;
@@ -5571,35 +5577,35 @@ function _E() {
5571
5577
  D[T[d]].end = 0;
5572
5578
  return { map: D, table: r };
5573
5579
  }
5574
- function H(X, J) {
5580
+ function H(J, F) {
5575
5581
  let r;
5576
- const D = A.getBestModeForData(X);
5577
- if (r = A.from(J, D), r !== A.BYTE && r.bit < D.bit)
5578
- throw new Error('"' + X + '" cannot be encoded with mode ' + A.toString(r) + `.
5582
+ const D = A.getBestModeForData(J);
5583
+ if (r = A.from(F, D), r !== A.BYTE && r.bit < D.bit)
5584
+ throw new Error('"' + J + '" cannot be encoded with mode ' + A.toString(r) + `.
5579
5585
  Suggested mode is: ` + A.toString(D));
5580
5586
  switch (r === A.KANJI && !n.isKanjiModeEnabled() && (r = A.BYTE), r) {
5581
5587
  case A.NUMERIC:
5582
- return new E(X);
5588
+ return new E(J);
5583
5589
  case A.ALPHANUMERIC:
5584
- return new C(X);
5590
+ return new C(J);
5585
5591
  case A.KANJI:
5586
- return new Q(X);
5592
+ return new Q(J);
5587
5593
  case A.BYTE:
5588
- return new B(X);
5594
+ return new B(J);
5589
5595
  }
5590
5596
  }
5591
- g.fromArray = function(J) {
5592
- return J.reduce(function(r, D) {
5597
+ g.fromArray = function(F) {
5598
+ return F.reduce(function(r, D) {
5593
5599
  return typeof D == "string" ? r.push(H(D, null)) : D.data && r.push(H(D.data, D.mode)), r;
5594
5600
  }, []);
5595
- }, g.fromString = function(J, r) {
5596
- const D = s(J, n.isKanjiModeEnabled()), T = u(D), d = f(T, r), P = I.find_path(d.map, "start", "end"), q = [];
5601
+ }, g.fromString = function(F, r) {
5602
+ const D = s(F, n.isKanjiModeEnabled()), T = u(D), d = f(T, r), P = I.find_path(d.map, "start", "end"), q = [];
5597
5603
  for (let M = 1; M < P.length - 1; M++)
5598
5604
  q.push(d.table[P[M]].node);
5599
5605
  return g.fromArray(o(q));
5600
- }, g.rawSplit = function(J) {
5606
+ }, g.rawSplit = function(F) {
5601
5607
  return g.fromArray(
5602
- s(J, n.isKanjiModeEnabled())
5608
+ s(F, n.isKanjiModeEnabled())
5603
5609
  );
5604
5610
  };
5605
5611
  }(aB)), aB;
@@ -5641,14 +5647,14 @@ function $E() {
5641
5647
  for (let m = 0; m < 18; m++)
5642
5648
  Y = Math.floor(m / 3), x = m % 3 + q - 8 - 3, k = (M >> m & 1) === 1, d.set(Y, x, k, !0), d.set(x, Y, k, !0);
5643
5649
  }
5644
- function X(d, P, q) {
5650
+ function J(d, P, q) {
5645
5651
  const M = d.size, Y = c.getEncodedBits(P, q);
5646
5652
  let x, k;
5647
5653
  for (x = 0; x < 15; x++)
5648
5654
  k = (Y >> x & 1) === 1, x < 6 ? d.set(x, 8, k, !0) : x < 8 ? d.set(x + 1, 8, k, !0) : d.set(M - 15 + x, 8, k, !0), x < 8 ? d.set(8, M - x - 1, k, !0) : x < 9 ? d.set(8, 15 - x - 1 + 1, k, !0) : d.set(8, 15 - x - 1, k, !0);
5649
5655
  d.set(M - 8, 8, 1, !0);
5650
5656
  }
5651
- function J(d, P) {
5657
+ function F(d, P) {
5652
5658
  const q = d.size;
5653
5659
  let M = -1, Y = q - 1, x = 7, k = 0;
5654
5660
  for (let m = q - 1; m > 0; m -= 2)
@@ -5680,12 +5686,12 @@ function $E() {
5680
5686
  function D(d, P, q) {
5681
5687
  const M = g.getSymbolTotalCodewords(P), Y = n.getTotalCodewordsCount(P, q), x = M - Y, k = n.getBlocksCount(P, q), m = M % k, z = k - m, S = Math.floor(M / k), K = Math.floor(x / k), p = K + 1, a = S - K, w = new I(a);
5682
5688
  let R = 0;
5683
- const v = new Array(k), F = new Array(k);
5689
+ const v = new Array(k), X = new Array(k);
5684
5690
  let j = 0;
5685
5691
  const l = new Uint8Array(d.buffer);
5686
- for (let AA = 0; AA < k; AA++) {
5687
- const iA = AA < z ? K : p;
5688
- v[AA] = l.slice(R, R + iA), F[AA] = w.encode(v[AA]), R += iA, j = Math.max(j, iA);
5692
+ for (let $ = 0; $ < k; $++) {
5693
+ const iA = $ < z ? K : p;
5694
+ v[$] = l.slice(R, R + iA), X[$] = w.encode(v[$]), R += iA, j = Math.max(j, iA);
5689
5695
  }
5690
5696
  const b = new Uint8Array(M);
5691
5697
  let L = 0, y, CA;
@@ -5694,7 +5700,7 @@ function $E() {
5694
5700
  y < v[CA].length && (b[L++] = v[CA][y]);
5695
5701
  for (y = 0; y < a; y++)
5696
5702
  for (CA = 0; CA < k; CA++)
5697
- b[L++] = F[CA][y];
5703
+ b[L++] = X[CA][y];
5698
5704
  return b;
5699
5705
  }
5700
5706
  function T(d, P, q, M) {
@@ -5723,10 +5729,10 @@ Minimum version required to store current data is: ` + x + `.
5723
5729
  `
5724
5730
  );
5725
5731
  const k = r(P, q, Y), m = g.getSymbolSize(P), z = new C(m);
5726
- return o(z, P), u(z), f(z, P), X(z, q, 0), P >= 7 && H(z, P), J(z, k), isNaN(M) && (M = t.getBestMask(
5732
+ return o(z, P), u(z), f(z, P), J(z, q, 0), P >= 7 && H(z, P), F(z, k), isNaN(M) && (M = t.getBestMask(
5727
5733
  z,
5728
- X.bind(null, z, q)
5729
- )), t.applyMask(M, z), X(z, q, M), {
5734
+ J.bind(null, z, q)
5735
+ )), t.applyMask(M, z), J(z, q, M), {
5730
5736
  modules: z,
5731
5737
  version: P,
5732
5738
  errorCorrectionLevel: q,
@@ -5787,8 +5793,8 @@ function EQ() {
5787
5793
  for (let o = 0; o < h; o++) {
5788
5794
  let u = (i * h + o) * 4, f = Q.color.light;
5789
5795
  if (i >= c && o >= c && i < h - c && o < h - c) {
5790
- const H = Math.floor((i - c) / I), X = Math.floor((o - c) / I);
5791
- f = s[n[H * t + X] ? 1 : 0];
5796
+ const H = Math.floor((i - c) / I), J = Math.floor((o - c) / I);
5797
+ f = s[n[H * t + J] ? 1 : 0];
5792
5798
  }
5793
5799
  C[u++] = f.r, C[u++] = f.g, C[u++] = f.b, C[u] = f.a;
5794
5800
  }
@@ -6026,16 +6032,16 @@ function tI({
6026
6032
  /{email}/g,
6027
6033
  H
6028
6034
  ), s.appendChild(f);
6029
- const X = document.createElement("div");
6030
- X.style.cssText = `
6035
+ const J = document.createElement("div");
6036
+ J.style.cssText = `
6031
6037
  background-color: #232A751A;
6032
6038
  border-radius: 0.5rem;
6033
6039
  padding: 1rem 1rem 1rem 1.25rem;
6034
6040
  margin-bottom: 1rem;
6035
6041
 
6036
- `, s.appendChild(X);
6037
- const J = document.createElement("ul");
6038
- J.style.cssText = `
6042
+ `, s.appendChild(J);
6043
+ const F = document.createElement("ul");
6044
+ F.style.cssText = `
6039
6045
  margin: 0;
6040
6046
  padding-left: 1.25rem;
6041
6047
  font-size: 0.875rem;
@@ -6043,11 +6049,11 @@ function tI({
6043
6049
  line-height: 1.8;
6044
6050
  font-size: 0.875rem;
6045
6051
 
6046
- `, J.style.listStyleType = "disc", J.innerHTML = `
6052
+ `, F.style.listStyleType = "disc", F.innerHTML = `
6047
6053
  <li style="color: #1e3a8a;">${e("taxOrCompany")}</li>
6048
6054
  <li style="color: #1e3a8a;">${e("transactionAmountTime")}</li>
6049
6055
  <li style="color: #1e3a8a;">${e("transactionIdReceipt")}</li>
6050
- `, X.appendChild(J);
6056
+ `, J.appendChild(F);
6051
6057
  const r = document.createElement("div");
6052
6058
  r.style.cssText = `
6053
6059
  text-align: center;
@@ -6127,11 +6133,11 @@ function cI(n) {
6127
6133
  const H = document.createElement("div");
6128
6134
  H.className = "wgt:flex wgt:flex-col wgt:gap-6 wgt:relative";
6129
6135
  const {
6130
- container: X,
6131
- open: J,
6136
+ container: J,
6137
+ open: F,
6132
6138
  close: r
6133
6139
  } = xB();
6134
- H.appendChild(X);
6140
+ H.appendChild(J);
6135
6141
  const D = document.createElement("div");
6136
6142
  D.className = "wgt:w-full wgt:flex wgt:items-start wgt:gap-6 wgt:@max-2xl:flex-col-reverse";
6137
6143
  const T = document.createElement("div");
@@ -6145,16 +6151,16 @@ function cI(n) {
6145
6151
  onSuccess: () => V(null, null, function* () {
6146
6152
  K();
6147
6153
  }),
6148
- onError: (F) => {
6154
+ onError: (X) => {
6149
6155
  var l, b;
6150
- const j = ((b = (l = F.response) == null ? void 0 : l.data) == null ? void 0 : b.message) || F.message || e("errorConfirmingFreeOrder") || "Không thể xác nhận đơn hàng miễn phí. Vui lòng thử lại.";
6156
+ const j = ((b = (l = X.response) == null ? void 0 : l.data) == null ? void 0 : b.message) || X.message || e("errorConfirmingFreeOrder") || "Không thể xác nhận đơn hàng miễn phí. Vui lòng thử lại.";
6151
6157
  tg(j);
6152
6158
  },
6153
6159
  illustrationSrc: (C == null ? void 0 : C.illustrationSrc) || "",
6154
6160
  theme: t
6155
6161
  }), T.appendChild(Y.container);
6156
6162
  else {
6157
- const F = kE(NA(MA({
6163
+ const X = kE(NA(MA({
6158
6164
  qrSrc: "",
6159
6165
  accountName: "",
6160
6166
  accountNumber: "",
@@ -6163,7 +6169,7 @@ function cI(n) {
6163
6169
  instructions: P,
6164
6170
  theme: t
6165
6171
  }));
6166
- q = F.container, M = F.update, T.appendChild(q);
6172
+ q = X.container, M = X.update, T.appendChild(q);
6167
6173
  }
6168
6174
  }
6169
6175
  x(), D.appendChild(T);
@@ -6186,7 +6192,7 @@ function cI(n) {
6186
6192
  });
6187
6193
  z.appendChild(S), H.appendChild(z);
6188
6194
  function K() {
6189
- const F = Kg({
6195
+ const X = Kg({
6190
6196
  message: e("freeOrderSuccess") || "Đơn hàng miễn phí đã được xác nhận thành công!",
6191
6197
  okLabel: e("next") || "Tiếp tục",
6192
6198
  theme: t,
@@ -6196,26 +6202,26 @@ function cI(n) {
6196
6202
  },
6197
6203
  preventClose: !0
6198
6204
  });
6199
- H.appendChild(F.container), F.open(), setTimeout(() => {
6200
- F.close && F.close(), g();
6205
+ H.appendChild(X.container), X.open(), setTimeout(() => {
6206
+ X.close && X.close(), g();
6201
6207
  }, 2e3);
6202
6208
  }
6203
6209
  function p() {
6204
6210
  return V(this, null, function* () {
6205
- const { registrationData: F } = B, b = F.eInvoiceRegistration, { isUsedEInvoiceBefore: j } = b, l = Wg(b, ["isUsedEInvoiceBefore"]);
6211
+ const { registrationData: X } = B, b = X.eInvoiceRegistration, { isUsedEInvoiceBefore: j } = b, l = Wg(b, ["isUsedEInvoiceBefore"]);
6206
6212
  try {
6207
6213
  const L = yield gQ({
6208
6214
  eInvoiceRegistration: MA({}, l),
6209
- bank: F.bank,
6210
- provider: F.provider,
6211
- logo: F.logo,
6212
- organizationRegistrationCert: F.license,
6215
+ bank: X.bank,
6216
+ provider: X.provider,
6217
+ logo: X.logo,
6218
+ organizationRegistrationCert: X.license,
6213
6219
  legalRepresentativeIdCard: [
6214
- F.idCard,
6215
- F.idCardBack
6220
+ X.idCard,
6221
+ X.idCardBack
6216
6222
  ],
6217
- packages: F.packages,
6218
- promotionCodes: F.promotionCodes
6223
+ packages: X.packages,
6224
+ promotionCodes: X.promotionCodes
6219
6225
  }), y = L.orderId, CA = L.amount || 0;
6220
6226
  f = CA, u = CA === 0, y !== s && (s = y, Q(y), x(), u ? console.log("") : yield w(y), m());
6221
6227
  } catch (L) {
@@ -6228,18 +6234,18 @@ function cI(n) {
6228
6234
  }
6229
6235
  function a() {
6230
6236
  return V(this, null, function* () {
6231
- const F = (B == null ? void 0 : B.totalAmountText) || 0;
6232
- f = F, u = F === 0, x(), u ? r() : s && (yield w(s));
6237
+ const X = (B == null ? void 0 : B.totalAmountText) || 0;
6238
+ f = X, u = X === 0, x(), u ? r() : s && (yield w(s));
6233
6239
  });
6234
6240
  }
6235
- function w(F) {
6241
+ function w(X) {
6236
6242
  return V(this, null, function* () {
6237
6243
  var j, l, b, L;
6238
6244
  if (!i && !u) {
6239
- i = !0, J();
6245
+ i = !0, F();
6240
6246
  try {
6241
6247
  if (I = yield mQ({
6242
- orderId: F != null ? F : B == null ? void 0 : B.orderId,
6248
+ orderId: X != null ? X : B == null ? void 0 : B.orderId,
6243
6249
  amount: f,
6244
6250
  baseURL: HQ(t)
6245
6251
  }), !(I != null && I.qr_string))
@@ -6298,7 +6304,7 @@ function cI(n) {
6298
6304
  }
6299
6305
  function v() {
6300
6306
  u || (c && (clearInterval(c), c = null), c = setInterval(() => V(null, null, function* () {
6301
- var F, j;
6307
+ var X, j;
6302
6308
  try {
6303
6309
  const l = yield rE(s);
6304
6310
  if (l.paymentStatus === "pending")
@@ -6332,7 +6338,7 @@ function cI(n) {
6332
6338
  });
6333
6339
  },
6334
6340
  isOffline: !0
6335
- }) : ((F = l.response) == null ? void 0 : F.status) === 404 ? tg(e("errorOrderNotFound"), {
6341
+ }) : ((X = l.response) == null ? void 0 : X.status) === 404 ? tg(e("errorOrderNotFound"), {
6336
6342
  okLabel: e("tryAgain"),
6337
6343
  onClose: function() {
6338
6344
  return V(this, null, function* () {
@@ -6389,10 +6395,10 @@ function eI({
6389
6395
  f.className = "wgt:text-sm wgt:leading-relaxed wgt:text-strong-950", f.innerText = e("notice2"), u.appendChild(f);
6390
6396
  const H = document.createElement("div");
6391
6397
  H.className = "wgt:w-full wgt:flex wgt:flex-col wgt:gap-2 wgt:rounded-lg wgt:bg-weak-50 wgt:px-4 wgt:py-3", u.appendChild(H);
6392
- const X = document.createElement("div");
6393
- X.className = "wgt:flex wgt:items-center wgt:gap-2 wgt:text-sm wgt:text-strong-950", H.appendChild(X);
6394
6398
  const J = document.createElement("div");
6395
- J.innerHTML = `
6399
+ J.className = "wgt:flex wgt:items-center wgt:gap-2 wgt:text-sm wgt:text-strong-950", H.appendChild(J);
6400
+ const F = document.createElement("div");
6401
+ F.innerHTML = `
6396
6402
  <svg
6397
6403
  width="14"
6398
6404
  height="14"
@@ -6410,9 +6416,9 @@ function eI({
6410
6416
  stroke-linejoin="round"
6411
6417
  />
6412
6418
  </svg>
6413
- `, X.appendChild(J);
6419
+ `, J.appendChild(F);
6414
6420
  const r = PQ(dB(), C, Q), D = document.createElement("span");
6415
- D.innerHTML = `${e("hotlineDomestic")} <b>${(r == null ? void 0 : r.hotline) || ""}</b> ${e("hotlineDesc")} `, X.appendChild(D);
6421
+ D.innerHTML = `${e("hotlineDomestic")} <b>${(r == null ? void 0 : r.hotline) || ""}</b> ${e("hotlineDesc")} `, J.appendChild(D);
6416
6422
  const T = document.createElement("div");
6417
6423
  T.className = "wgt:flex wgt:items-center wgt:gap-2 wgt:text-sm wgt:text-strong-950", H.appendChild(T);
6418
6424
  const d = document.createElement("div");
@@ -6729,20 +6735,20 @@ function qI({
6729
6735
  word-wrap: break-word;
6730
6736
  white-space: normal;
6731
6737
  `, H.innerText = Q, o.appendChild(H);
6732
- const X = document.createElement("div");
6733
- X.style.cssText = `
6738
+ const J = document.createElement("div");
6739
+ J.style.cssText = `
6734
6740
  margin: 0 0 1.5rem 0;
6735
6741
  text-align: center;
6736
6742
  font-size: 0.9rem;
6737
6743
  color: #4b5563;
6738
6744
  line-height: 1.6;
6739
- `, X.innerHTML = s, o.appendChild(X);
6740
- const J = document.createElement("div");
6741
- J.style.cssText = `
6745
+ `, J.innerHTML = s, o.appendChild(J);
6746
+ const F = document.createElement("div");
6747
+ F.style.cssText = `
6742
6748
  display: flex;
6743
6749
  gap: 0.75rem;
6744
6750
  justify-content: center;
6745
- `, o.appendChild(J);
6751
+ `, o.appendChild(F);
6746
6752
  const r = document.createElement("button");
6747
6753
  r.type = "button", r.innerText = t, r.style.cssText = `
6748
6754
  flex: 1;
@@ -6765,7 +6771,7 @@ function qI({
6765
6771
  ), r.addEventListener(
6766
6772
  "focus",
6767
6773
  () => r.style.outline = "none"
6768
- ), J.appendChild(r);
6774
+ ), F.appendChild(r);
6769
6775
  const D = document.createElement("button");
6770
6776
  D.type = "button", D.innerText = n, D.style.cssText = `
6771
6777
  flex: 1;
@@ -6783,7 +6789,7 @@ function qI({
6783
6789
  D.style.backgroundColor = `${c}10`;
6784
6790
  }), D.addEventListener("mouseleave", () => {
6785
6791
  D.style.backgroundColor = "white";
6786
- }), D.addEventListener("focus", () => D.style.outline = "none"), J.appendChild(D);
6792
+ }), D.addEventListener("focus", () => D.style.outline = "none"), F.appendChild(D);
6787
6793
  let T = !1, d = !1;
6788
6794
  const P = (m) => {
6789
6795
  m.target === i && !C && k(!1);
@@ -6850,7 +6856,7 @@ function qB(g, A, E, C = !1, B = "ocb", Q = "") {
6850
6856
  }
6851
6857
  function TI(g, A, E, C, B, Q) {
6852
6858
  return V(this, null, function* () {
6853
- var F, j;
6859
+ var X, j;
6854
6860
  const n = [
6855
6861
  { name: "M-Invoice", route: "m-invoice", logoUrl: vQ },
6856
6862
  { name: "Misa", route: "misa", logoUrl: MQ },
@@ -6906,7 +6912,7 @@ function TI(g, A, E, C, B, Q) {
6906
6912
  idCardBack: null,
6907
6913
  packages: [],
6908
6914
  promotionCodes: []
6909
- }, H = !0, X = null, J = null, r = null, D = null, T = null, d = 0, P = 0, q = null, M = null, Y = null, x = {
6915
+ }, H = !0, J = null, F = null, r = null, D = null, T = null, d = 0, P = 0, q = null, M = null, Y = null, x = {
6910
6916
  qtyRegFee: 1,
6911
6917
  qtyInvoicePkg: 1,
6912
6918
  qtySignaturePkg: 1
@@ -6950,7 +6956,7 @@ function TI(g, A, E, C, B, Q) {
6950
6956
  idCardBack: null,
6951
6957
  packages: [],
6952
6958
  promotionCodes: []
6953
- }, J = null, r = null, D = null, T = null, d = 0, Y = null, x = {
6959
+ }, F = null, r = null, D = null, T = null, d = 0, Y = null, x = {
6954
6960
  qtyRegFee: 1,
6955
6961
  qtyInvoicePkg: 1,
6956
6962
  qtySignaturePkg: 1
@@ -7026,7 +7032,7 @@ function TI(g, A, E, C, B, Q) {
7026
7032
  return V(this, null, function* () {
7027
7033
  if (l === 1) {
7028
7034
  const { container: b } = yield wE({
7029
- isNewCustomer: X,
7035
+ isNewCustomer: J,
7030
7036
  isRenewal: Q,
7031
7037
  providerProps: {
7032
7038
  providers: n,
@@ -7036,8 +7042,8 @@ function TI(g, A, E, C, B, Q) {
7036
7042
  u = L, yield qB(
7037
7043
  L.route,
7038
7044
  (CA = (y = f == null ? void 0 : f.eInvoiceRegistration) == null ? void 0 : y.organization) == null ? void 0 : CA.taxCode,
7039
- (AA, iA) => {
7040
- X = AA, K(iA);
7045
+ ($, iA) => {
7046
+ J = $, K(iA);
7041
7047
  },
7042
7048
  Q,
7043
7049
  B,
@@ -7062,7 +7068,7 @@ function TI(g, A, E, C, B, Q) {
7062
7068
  // ...data.eInvoiceRegistration,
7063
7069
  // };
7064
7070
  formProps: {
7065
- isNewCustomer: X,
7071
+ isNewCustomer: J,
7066
7072
  isRenewal: Q,
7067
7073
  handleCheckNewCustomer: qB,
7068
7074
  updateRegistrationData: K,
@@ -7106,7 +7112,7 @@ function TI(g, A, E, C, B, Q) {
7106
7112
  T = L;
7107
7113
  },
7108
7114
  setOrderId: (L) => {
7109
- J = L;
7115
+ F = L;
7110
7116
  },
7111
7117
  setTotalAmount: (L) => {
7112
7118
  d = L;
@@ -7130,7 +7136,7 @@ function TI(g, A, E, C, B, Q) {
7130
7136
  theme: B,
7131
7137
  selectedProvider: u,
7132
7138
  registrationData: f,
7133
- isNewCustomer: X,
7139
+ isNewCustomer: J,
7134
7140
  savedQuantities: x,
7135
7141
  isRenewal: Q,
7136
7142
  setSavedQuantities: (L) => {
@@ -7155,7 +7161,7 @@ function TI(g, A, E, C, B, Q) {
7155
7161
  theme: B || "ocb",
7156
7162
  orderInfoProps: {
7157
7163
  registrationData: f,
7158
- orderId: J || "",
7164
+ orderId: F || "",
7159
7165
  selectedProvider: u || { name: "", logo: "" },
7160
7166
  selectedInvoiceOtp: D || { unitsPerMonth: 0 },
7161
7167
  selectedSignatureOtp: T || { durationYears: 0 },
@@ -7168,13 +7174,13 @@ function TI(g, A, E, C, B, Q) {
7168
7174
  onResetToStep1: z
7169
7175
  },
7170
7176
  setOrderId: (L) => {
7171
- J = L;
7177
+ F = L;
7172
7178
  }
7173
7179
  });
7174
7180
  i(b);
7175
7181
  } else if (l === 4) {
7176
7182
  const { container: b } = eI({
7177
- orderId: J || "",
7183
+ orderId: F || "",
7178
7184
  onPrev: () => {
7179
7185
  o = 3, s(o, I()), p(o), S();
7180
7186
  },
@@ -7194,9 +7200,9 @@ function TI(g, A, E, C, B, Q) {
7194
7200
  const { container: a, open: w } = xB();
7195
7201
  H && (i(a), w()), yield qB(
7196
7202
  u.route,
7197
- (j = (F = f == null ? void 0 : f.eInvoiceRegistration) == null ? void 0 : F.organization) == null ? void 0 : j.taxCode,
7203
+ (j = (X = f == null ? void 0 : f.eInvoiceRegistration) == null ? void 0 : X.organization) == null ? void 0 : j.taxCode,
7198
7204
  (l, b) => V(null, null, function* () {
7199
- H = !1, X = l, K(b), h.updateTitle(
7205
+ H = !1, J = l, K(b), h.updateTitle(
7200
7206
  Q ? e("eInvoiceRenewal") : e("eInvoiceRegister")
7201
7207
  );
7202
7208
  }),