@jsdev_ninja/core 0.13.55 → 0.13.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core.cjs +1 -1
- package/dist/core.cjs.map +1 -1
- package/dist/core.es.js +178 -178
- package/dist/core.es.js.map +1 -1
- package/dist/core.umd.js +1 -1
- package/dist/core.umd.js.map +1 -1
- package/dist/lib/entities/SupplierInvoice.d.ts +18 -0
- package/dist/lib/entities/SupplierInvoice.d.ts.map +1 -1
- package/dist/lib/entities/SupplierInvoice.js +3 -0
- package/dist/lib/firebase-api/index.d.ts +6 -12
- package/dist/lib/firebase-api/index.d.ts.map +1 -1
- package/dist/lib/firebase-api/index.js +2 -4
- package/dist/lib/utils/index.d.ts.map +1 -1
- package/dist/lib/utils/index.js +2 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/core.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var Me = (n, e, t) =>
|
|
1
|
+
var ct = Object.defineProperty;
|
|
2
|
+
var ut = (n, e, t) => e in n ? ct(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var Me = (n, e, t) => ut(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
var x;
|
|
5
5
|
(function(n) {
|
|
6
6
|
n.assertEqual = (s) => s;
|
|
@@ -104,7 +104,7 @@ const p = x.arrayToEnum([
|
|
|
104
104
|
"invalid_intersection_types",
|
|
105
105
|
"not_multiple_of",
|
|
106
106
|
"not_finite"
|
|
107
|
-
]),
|
|
107
|
+
]), dt = (n) => JSON.stringify(n, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
108
108
|
class N extends Error {
|
|
109
109
|
get errors() {
|
|
110
110
|
return this.issues;
|
|
@@ -165,7 +165,7 @@ class N extends Error {
|
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
N.create = (n) => new N(n);
|
|
168
|
-
const
|
|
168
|
+
const G = (n, e) => {
|
|
169
169
|
let t;
|
|
170
170
|
switch (n.code) {
|
|
171
171
|
case d.invalid_type:
|
|
@@ -221,8 +221,8 @@ const J = (n, e) => {
|
|
|
221
221
|
}
|
|
222
222
|
return { message: t };
|
|
223
223
|
};
|
|
224
|
-
let Ue =
|
|
225
|
-
function
|
|
224
|
+
let Ue = G;
|
|
225
|
+
function lt(n) {
|
|
226
226
|
Ue = n;
|
|
227
227
|
}
|
|
228
228
|
function ve() {
|
|
@@ -248,7 +248,7 @@ const _e = (n) => {
|
|
|
248
248
|
path: i,
|
|
249
249
|
message: c
|
|
250
250
|
};
|
|
251
|
-
},
|
|
251
|
+
}, mt = [];
|
|
252
252
|
function m(n, e) {
|
|
253
253
|
const t = ve(), r = _e({
|
|
254
254
|
issueData: e,
|
|
@@ -261,7 +261,7 @@ function m(n, e) {
|
|
|
261
261
|
// then schema-bound map if available
|
|
262
262
|
t,
|
|
263
263
|
// then global override map
|
|
264
|
-
t ===
|
|
264
|
+
t === G ? void 0 : G
|
|
265
265
|
// then global default map
|
|
266
266
|
].filter((s) => !!s)
|
|
267
267
|
});
|
|
@@ -579,14 +579,14 @@ class _ {
|
|
|
579
579
|
return this.safeParse(null).success;
|
|
580
580
|
}
|
|
581
581
|
}
|
|
582
|
-
const
|
|
582
|
+
const pt = /^c[^\s-]{8,}$/i, ft = /^[0-9a-z]+$/, ht = /^[0-9A-HJKMNP-TV-Z]{26}$/i, gt = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, yt = /^[a-z0-9_-]{21}$/i, vt = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, _t = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, bt = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, xt = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
583
583
|
let Ze;
|
|
584
|
-
const
|
|
584
|
+
const kt = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, wt = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, Tt = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, St = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, It = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Nt = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, qe = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", At = new RegExp(`^${qe}$`);
|
|
585
585
|
function Be(n) {
|
|
586
586
|
let e = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
587
587
|
return n.precision ? e = `${e}\\.\\d{${n.precision}}` : n.precision == null && (e = `${e}(\\.\\d+)?`), e;
|
|
588
588
|
}
|
|
589
|
-
function
|
|
589
|
+
function Ct(n) {
|
|
590
590
|
return new RegExp(`^${Be(n)}$`);
|
|
591
591
|
}
|
|
592
592
|
function We(n) {
|
|
@@ -594,11 +594,11 @@ function We(n) {
|
|
|
594
594
|
const t = [];
|
|
595
595
|
return t.push(n.local ? "Z?" : "Z"), n.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
596
596
|
}
|
|
597
|
-
function Ct(n, e) {
|
|
598
|
-
return !!((e === "v4" || !e) && xt.test(n) || (e === "v6" || !e) && wt.test(n));
|
|
599
|
-
}
|
|
600
597
|
function Zt(n, e) {
|
|
601
|
-
|
|
598
|
+
return !!((e === "v4" || !e) && kt.test(n) || (e === "v6" || !e) && Tt.test(n));
|
|
599
|
+
}
|
|
600
|
+
function jt(n, e) {
|
|
601
|
+
if (!vt.test(n))
|
|
602
602
|
return !1;
|
|
603
603
|
try {
|
|
604
604
|
const [t] = n.split("."), r = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), s = JSON.parse(atob(r));
|
|
@@ -607,8 +607,8 @@ function Zt(n, e) {
|
|
|
607
607
|
return !1;
|
|
608
608
|
}
|
|
609
609
|
}
|
|
610
|
-
function
|
|
611
|
-
return !!((e === "v4" || !e) &&
|
|
610
|
+
function Dt(n, e) {
|
|
611
|
+
return !!((e === "v4" || !e) && wt.test(n) || (e === "v6" || !e) && St.test(n));
|
|
612
612
|
}
|
|
613
613
|
class A extends _ {
|
|
614
614
|
_parse(e) {
|
|
@@ -659,43 +659,43 @@ class A extends _ {
|
|
|
659
659
|
message: i.message
|
|
660
660
|
}), r.dirty());
|
|
661
661
|
} else if (i.kind === "email")
|
|
662
|
-
|
|
662
|
+
bt.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
663
663
|
validation: "email",
|
|
664
664
|
code: d.invalid_string,
|
|
665
665
|
message: i.message
|
|
666
666
|
}), r.dirty());
|
|
667
667
|
else if (i.kind === "emoji")
|
|
668
|
-
Ze || (Ze = new RegExp(
|
|
668
|
+
Ze || (Ze = new RegExp(xt, "u")), Ze.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
669
669
|
validation: "emoji",
|
|
670
670
|
code: d.invalid_string,
|
|
671
671
|
message: i.message
|
|
672
672
|
}), r.dirty());
|
|
673
673
|
else if (i.kind === "uuid")
|
|
674
|
-
|
|
674
|
+
gt.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
675
675
|
validation: "uuid",
|
|
676
676
|
code: d.invalid_string,
|
|
677
677
|
message: i.message
|
|
678
678
|
}), r.dirty());
|
|
679
679
|
else if (i.kind === "nanoid")
|
|
680
|
-
|
|
680
|
+
yt.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
681
681
|
validation: "nanoid",
|
|
682
682
|
code: d.invalid_string,
|
|
683
683
|
message: i.message
|
|
684
684
|
}), r.dirty());
|
|
685
685
|
else if (i.kind === "cuid")
|
|
686
|
-
|
|
686
|
+
pt.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
687
687
|
validation: "cuid",
|
|
688
688
|
code: d.invalid_string,
|
|
689
689
|
message: i.message
|
|
690
690
|
}), r.dirty());
|
|
691
691
|
else if (i.kind === "cuid2")
|
|
692
|
-
|
|
692
|
+
ft.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
693
693
|
validation: "cuid2",
|
|
694
694
|
code: d.invalid_string,
|
|
695
695
|
message: i.message
|
|
696
696
|
}), r.dirty());
|
|
697
697
|
else if (i.kind === "ulid")
|
|
698
|
-
|
|
698
|
+
ht.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
699
699
|
validation: "ulid",
|
|
700
700
|
code: d.invalid_string,
|
|
701
701
|
message: i.message
|
|
@@ -730,35 +730,35 @@ class A extends _ {
|
|
|
730
730
|
code: d.invalid_string,
|
|
731
731
|
validation: "datetime",
|
|
732
732
|
message: i.message
|
|
733
|
-
}), r.dirty()) : i.kind === "date" ?
|
|
733
|
+
}), r.dirty()) : i.kind === "date" ? At.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
734
734
|
code: d.invalid_string,
|
|
735
735
|
validation: "date",
|
|
736
736
|
message: i.message
|
|
737
|
-
}), r.dirty()) : i.kind === "time" ?
|
|
737
|
+
}), r.dirty()) : i.kind === "time" ? Ct(i).test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
738
738
|
code: d.invalid_string,
|
|
739
739
|
validation: "time",
|
|
740
740
|
message: i.message
|
|
741
|
-
}), r.dirty()) : i.kind === "duration" ?
|
|
741
|
+
}), r.dirty()) : i.kind === "duration" ? _t.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
742
742
|
validation: "duration",
|
|
743
743
|
code: d.invalid_string,
|
|
744
744
|
message: i.message
|
|
745
|
-
}), r.dirty()) : i.kind === "ip" ?
|
|
745
|
+
}), r.dirty()) : i.kind === "ip" ? Zt(e.data, i.version) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
746
746
|
validation: "ip",
|
|
747
747
|
code: d.invalid_string,
|
|
748
748
|
message: i.message
|
|
749
|
-
}), r.dirty()) : i.kind === "jwt" ?
|
|
749
|
+
}), r.dirty()) : i.kind === "jwt" ? jt(e.data, i.alg) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
750
750
|
validation: "jwt",
|
|
751
751
|
code: d.invalid_string,
|
|
752
752
|
message: i.message
|
|
753
|
-
}), r.dirty()) : i.kind === "cidr" ?
|
|
753
|
+
}), r.dirty()) : i.kind === "cidr" ? Dt(e.data, i.version) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
754
754
|
validation: "cidr",
|
|
755
755
|
code: d.invalid_string,
|
|
756
756
|
message: i.message
|
|
757
|
-
}), r.dirty()) : i.kind === "base64" ?
|
|
757
|
+
}), r.dirty()) : i.kind === "base64" ? It.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
758
758
|
validation: "base64",
|
|
759
759
|
code: d.invalid_string,
|
|
760
760
|
message: i.message
|
|
761
|
-
}), r.dirty()) : i.kind === "base64url" ?
|
|
761
|
+
}), r.dirty()) : i.kind === "base64url" ? Nt.test(e.data) || (s = this._getOrReturnCtx(e, s), m(s, {
|
|
762
762
|
validation: "base64url",
|
|
763
763
|
code: d.invalid_string,
|
|
764
764
|
message: i.message
|
|
@@ -997,7 +997,7 @@ A.create = (n) => {
|
|
|
997
997
|
...v(n)
|
|
998
998
|
});
|
|
999
999
|
};
|
|
1000
|
-
function
|
|
1000
|
+
function Ot(n, e) {
|
|
1001
1001
|
const t = (n.toString().split(".")[1] || "").length, r = (e.toString().split(".")[1] || "").length, s = t > r ? t : r, i = parseInt(n.toFixed(s).replace(".", "")), o = parseInt(e.toFixed(s).replace(".", ""));
|
|
1002
1002
|
return i % o / Math.pow(10, s);
|
|
1003
1003
|
}
|
|
@@ -1036,7 +1036,7 @@ class V extends _ {
|
|
|
1036
1036
|
inclusive: i.inclusive,
|
|
1037
1037
|
exact: !1,
|
|
1038
1038
|
message: i.message
|
|
1039
|
-
}), s.dirty()) : i.kind === "multipleOf" ?
|
|
1039
|
+
}), s.dirty()) : i.kind === "multipleOf" ? Ot(e.data, i.value) !== 0 && (r = this._getOrReturnCtx(e, r), m(r, {
|
|
1040
1040
|
code: d.not_multiple_of,
|
|
1041
1041
|
multipleOf: i.value,
|
|
1042
1042
|
message: i.message
|
|
@@ -1456,7 +1456,7 @@ oe.create = (n) => new oe({
|
|
|
1456
1456
|
typeName: g.ZodNull,
|
|
1457
1457
|
...v(n)
|
|
1458
1458
|
});
|
|
1459
|
-
class
|
|
1459
|
+
class J extends _ {
|
|
1460
1460
|
constructor() {
|
|
1461
1461
|
super(...arguments), this._any = !0;
|
|
1462
1462
|
}
|
|
@@ -1464,7 +1464,7 @@ class G extends _ {
|
|
|
1464
1464
|
return S(e.data);
|
|
1465
1465
|
}
|
|
1466
1466
|
}
|
|
1467
|
-
|
|
1467
|
+
J.create = (n) => new J({
|
|
1468
1468
|
typeName: g.ZodAny,
|
|
1469
1469
|
...v(n)
|
|
1470
1470
|
});
|
|
@@ -2310,7 +2310,7 @@ class X extends _ {
|
|
|
2310
2310
|
t.common.contextualErrorMap,
|
|
2311
2311
|
t.schemaErrorMap,
|
|
2312
2312
|
ve(),
|
|
2313
|
-
|
|
2313
|
+
G
|
|
2314
2314
|
].filter((u) => !!u),
|
|
2315
2315
|
issueData: {
|
|
2316
2316
|
code: d.invalid_arguments,
|
|
@@ -2326,7 +2326,7 @@ class X extends _ {
|
|
|
2326
2326
|
t.common.contextualErrorMap,
|
|
2327
2327
|
t.schemaErrorMap,
|
|
2328
2328
|
ve(),
|
|
2329
|
-
|
|
2329
|
+
G
|
|
2330
2330
|
].filter((u) => !!u),
|
|
2331
2331
|
issueData: {
|
|
2332
2332
|
code: d.invalid_return_type,
|
|
@@ -2745,7 +2745,7 @@ Te.create = (n) => new Te({
|
|
|
2745
2745
|
typeName: g.ZodNaN,
|
|
2746
2746
|
...v(n)
|
|
2747
2747
|
});
|
|
2748
|
-
const
|
|
2748
|
+
const Pt = Symbol("zod_brand");
|
|
2749
2749
|
class Ee extends _ {
|
|
2750
2750
|
_parse(e) {
|
|
2751
2751
|
const { ctx: t } = this._processInputParams(e), r = t.data;
|
|
@@ -2818,7 +2818,7 @@ function Ve(n, e) {
|
|
|
2818
2818
|
return typeof t == "string" ? { message: t } : t;
|
|
2819
2819
|
}
|
|
2820
2820
|
function Ye(n, e = {}, t) {
|
|
2821
|
-
return n ?
|
|
2821
|
+
return n ? J.create().superRefine((r, s) => {
|
|
2822
2822
|
var i, o;
|
|
2823
2823
|
const c = n(r);
|
|
2824
2824
|
if (c instanceof Promise)
|
|
@@ -2833,18 +2833,18 @@ function Ye(n, e = {}, t) {
|
|
|
2833
2833
|
const l = Ve(e, r), u = (o = (i = l.fatal) !== null && i !== void 0 ? i : t) !== null && o !== void 0 ? o : !0;
|
|
2834
2834
|
s.addIssue({ code: "custom", ...l, fatal: u });
|
|
2835
2835
|
}
|
|
2836
|
-
}) :
|
|
2836
|
+
}) : J.create();
|
|
2837
2837
|
}
|
|
2838
|
-
const
|
|
2838
|
+
const Et = {
|
|
2839
2839
|
object: k.lazycreate
|
|
2840
2840
|
};
|
|
2841
2841
|
var g;
|
|
2842
2842
|
(function(n) {
|
|
2843
2843
|
n.ZodString = "ZodString", n.ZodNumber = "ZodNumber", n.ZodNaN = "ZodNaN", n.ZodBigInt = "ZodBigInt", n.ZodBoolean = "ZodBoolean", n.ZodDate = "ZodDate", n.ZodSymbol = "ZodSymbol", n.ZodUndefined = "ZodUndefined", n.ZodNull = "ZodNull", n.ZodAny = "ZodAny", n.ZodUnknown = "ZodUnknown", n.ZodNever = "ZodNever", n.ZodVoid = "ZodVoid", n.ZodArray = "ZodArray", n.ZodObject = "ZodObject", n.ZodUnion = "ZodUnion", n.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", n.ZodIntersection = "ZodIntersection", n.ZodTuple = "ZodTuple", n.ZodRecord = "ZodRecord", n.ZodMap = "ZodMap", n.ZodSet = "ZodSet", n.ZodFunction = "ZodFunction", n.ZodLazy = "ZodLazy", n.ZodLiteral = "ZodLiteral", n.ZodEnum = "ZodEnum", n.ZodEffects = "ZodEffects", n.ZodNativeEnum = "ZodNativeEnum", n.ZodOptional = "ZodOptional", n.ZodNullable = "ZodNullable", n.ZodDefault = "ZodDefault", n.ZodCatch = "ZodCatch", n.ZodPromise = "ZodPromise", n.ZodBranded = "ZodBranded", n.ZodPipeline = "ZodPipeline", n.ZodReadonly = "ZodReadonly";
|
|
2844
2844
|
})(g || (g = {}));
|
|
2845
|
-
const
|
|
2845
|
+
const Rt = (n, e = {
|
|
2846
2846
|
message: `Input not instance of ${n.name}`
|
|
2847
|
-
}) => Ye((t) => t instanceof n, e), Xe = A.create,
|
|
2847
|
+
}) => Ye((t) => t instanceof n, e), Xe = A.create, Ge = V.create, Mt = Te.create, $t = z.create, Je = ae.create, Vt = B.create, zt = xe.create, Ft = ie.create, Ut = oe.create, Lt = J.create, qt = L.create, Bt = $.create, Wt = ke.create, Qt = C.create, Yt = k.create, Xt = k.strictCreate, Gt = ce.create, Jt = Se.create, Ht = ue.create, Kt = P.create, en = de.create, tn = we.create, nn = W.create, rn = X.create, sn = le.create, an = me.create, on = F.create, cn = pe.create, un = H.create, ze = Z.create, dn = D.create, ln = U.create, mn = Z.createWithPreprocess, pn = ye.create, fn = () => Xe().optional(), hn = () => Ge().optional(), gn = () => Je().optional(), yn = {
|
|
2848
2848
|
string: (n) => A.create({ ...n, coerce: !0 }),
|
|
2849
2849
|
number: (n) => V.create({ ...n, coerce: !0 }),
|
|
2850
2850
|
boolean: (n) => ae.create({
|
|
@@ -2853,14 +2853,14 @@ const Et = (n, e = {
|
|
|
2853
2853
|
}),
|
|
2854
2854
|
bigint: (n) => z.create({ ...n, coerce: !0 }),
|
|
2855
2855
|
date: (n) => B.create({ ...n, coerce: !0 })
|
|
2856
|
-
},
|
|
2856
|
+
}, vn = y;
|
|
2857
2857
|
var a = /* @__PURE__ */ Object.freeze({
|
|
2858
2858
|
__proto__: null,
|
|
2859
|
-
defaultErrorMap:
|
|
2860
|
-
setErrorMap:
|
|
2859
|
+
defaultErrorMap: G,
|
|
2860
|
+
setErrorMap: lt,
|
|
2861
2861
|
getErrorMap: ve,
|
|
2862
2862
|
makeIssue: _e,
|
|
2863
|
-
EMPTY_PATH:
|
|
2863
|
+
EMPTY_PATH: mt,
|
|
2864
2864
|
addIssueToContext: m,
|
|
2865
2865
|
ParseStatus: T,
|
|
2866
2866
|
INVALID: y,
|
|
@@ -2888,7 +2888,7 @@ var a = /* @__PURE__ */ Object.freeze({
|
|
|
2888
2888
|
ZodSymbol: xe,
|
|
2889
2889
|
ZodUndefined: ie,
|
|
2890
2890
|
ZodNull: oe,
|
|
2891
|
-
ZodAny:
|
|
2891
|
+
ZodAny: J,
|
|
2892
2892
|
ZodUnknown: L,
|
|
2893
2893
|
ZodNever: $,
|
|
2894
2894
|
ZodVoid: ke,
|
|
@@ -2914,60 +2914,60 @@ var a = /* @__PURE__ */ Object.freeze({
|
|
|
2914
2914
|
ZodDefault: fe,
|
|
2915
2915
|
ZodCatch: he,
|
|
2916
2916
|
ZodNaN: Te,
|
|
2917
|
-
BRAND:
|
|
2917
|
+
BRAND: Pt,
|
|
2918
2918
|
ZodBranded: Ee,
|
|
2919
2919
|
ZodPipeline: ye,
|
|
2920
2920
|
ZodReadonly: ge,
|
|
2921
2921
|
custom: Ye,
|
|
2922
2922
|
Schema: _,
|
|
2923
2923
|
ZodSchema: _,
|
|
2924
|
-
late:
|
|
2924
|
+
late: Et,
|
|
2925
2925
|
get ZodFirstPartyTypeKind() {
|
|
2926
2926
|
return g;
|
|
2927
2927
|
},
|
|
2928
|
-
coerce:
|
|
2929
|
-
any:
|
|
2930
|
-
array:
|
|
2931
|
-
bigint:
|
|
2932
|
-
boolean:
|
|
2933
|
-
date:
|
|
2928
|
+
coerce: yn,
|
|
2929
|
+
any: Lt,
|
|
2930
|
+
array: Qt,
|
|
2931
|
+
bigint: $t,
|
|
2932
|
+
boolean: Je,
|
|
2933
|
+
date: Vt,
|
|
2934
2934
|
discriminatedUnion: Jt,
|
|
2935
2935
|
effect: ze,
|
|
2936
|
-
enum:
|
|
2937
|
-
function:
|
|
2938
|
-
instanceof:
|
|
2939
|
-
intersection:
|
|
2940
|
-
lazy:
|
|
2941
|
-
literal:
|
|
2942
|
-
map:
|
|
2943
|
-
nan:
|
|
2944
|
-
nativeEnum:
|
|
2945
|
-
never:
|
|
2946
|
-
null:
|
|
2947
|
-
nullable:
|
|
2948
|
-
number:
|
|
2949
|
-
object:
|
|
2950
|
-
oboolean:
|
|
2951
|
-
onumber:
|
|
2952
|
-
optional:
|
|
2953
|
-
ostring:
|
|
2954
|
-
pipeline:
|
|
2955
|
-
preprocess:
|
|
2956
|
-
promise:
|
|
2957
|
-
record:
|
|
2958
|
-
set:
|
|
2959
|
-
strictObject:
|
|
2936
|
+
enum: on,
|
|
2937
|
+
function: rn,
|
|
2938
|
+
instanceof: Rt,
|
|
2939
|
+
intersection: Ht,
|
|
2940
|
+
lazy: sn,
|
|
2941
|
+
literal: an,
|
|
2942
|
+
map: tn,
|
|
2943
|
+
nan: Mt,
|
|
2944
|
+
nativeEnum: cn,
|
|
2945
|
+
never: Bt,
|
|
2946
|
+
null: Ut,
|
|
2947
|
+
nullable: ln,
|
|
2948
|
+
number: Ge,
|
|
2949
|
+
object: Yt,
|
|
2950
|
+
oboolean: gn,
|
|
2951
|
+
onumber: hn,
|
|
2952
|
+
optional: dn,
|
|
2953
|
+
ostring: fn,
|
|
2954
|
+
pipeline: pn,
|
|
2955
|
+
preprocess: mn,
|
|
2956
|
+
promise: un,
|
|
2957
|
+
record: en,
|
|
2958
|
+
set: nn,
|
|
2959
|
+
strictObject: Xt,
|
|
2960
2960
|
string: Xe,
|
|
2961
|
-
symbol:
|
|
2961
|
+
symbol: zt,
|
|
2962
2962
|
transformer: ze,
|
|
2963
|
-
tuple:
|
|
2964
|
-
undefined:
|
|
2965
|
-
union:
|
|
2966
|
-
unknown:
|
|
2967
|
-
void:
|
|
2968
|
-
NEVER:
|
|
2963
|
+
tuple: Kt,
|
|
2964
|
+
undefined: Ft,
|
|
2965
|
+
union: Gt,
|
|
2966
|
+
unknown: qt,
|
|
2967
|
+
void: Wt,
|
|
2968
|
+
NEVER: vn,
|
|
2969
2969
|
ZodIssueCode: d,
|
|
2970
|
-
quotelessJson:
|
|
2970
|
+
quotelessJson: dt,
|
|
2971
2971
|
ZodError: N
|
|
2972
2972
|
});
|
|
2973
2973
|
const Ie = a.object({
|
|
@@ -2978,14 +2978,14 @@ const Ie = a.object({
|
|
|
2978
2978
|
floor: a.string().optional(),
|
|
2979
2979
|
apartmentEnterNumber: a.string().optional(),
|
|
2980
2980
|
apartmentNumber: a.string().optional()
|
|
2981
|
-
}), M = a.string().min(1, { message: "שדה חובה" }),
|
|
2982
|
-
function
|
|
2981
|
+
}), M = a.string().min(1, { message: "שדה חובה" }), $n = a.string().regex(/^\d+$/, "Must be a numeric string"), Vn = a.object({ url: a.string().url(), id: a.string() });
|
|
2982
|
+
function zn(n) {
|
|
2983
2983
|
return !!(n != null && n.url);
|
|
2984
2984
|
}
|
|
2985
2985
|
const re = a.object({
|
|
2986
2986
|
lang: a.enum(["he"]),
|
|
2987
2987
|
value: a.string()
|
|
2988
|
-
}),
|
|
2988
|
+
}), Fn = a.array(re), He = a.object({
|
|
2989
2989
|
id: a.string().min(1),
|
|
2990
2990
|
companyId: a.string().min(1),
|
|
2991
2991
|
storeId: a.string().min(1),
|
|
@@ -2995,7 +2995,7 @@ const re = a.object({
|
|
|
2995
2995
|
depth: a.number()
|
|
2996
2996
|
}), Re = He.extend({
|
|
2997
2997
|
children: a.lazy(() => Re.array())
|
|
2998
|
-
}),
|
|
2998
|
+
}), Un = He.extend({
|
|
2999
2999
|
index: a.number(),
|
|
3000
3000
|
depth: a.number(),
|
|
3001
3001
|
collapsed: a.boolean().optional(),
|
|
@@ -3053,7 +3053,7 @@ const re = a.object({
|
|
|
3053
3053
|
}).optional(),
|
|
3054
3054
|
// @deprecated
|
|
3055
3055
|
categoryNames: a.array(a.string()).optional()
|
|
3056
|
-
}),
|
|
3056
|
+
}), Ln = Ke.extend({
|
|
3057
3057
|
image: a.instanceof(File).optional()
|
|
3058
3058
|
}), et = a.object({
|
|
3059
3059
|
product: Ke,
|
|
@@ -3061,7 +3061,7 @@ const re = a.object({
|
|
|
3061
3061
|
finalPrice: a.number().optional(),
|
|
3062
3062
|
finalDiscount: a.number().optional(),
|
|
3063
3063
|
amount: a.number().positive({ message: "Quantity must be a positive number." })
|
|
3064
|
-
}),
|
|
3064
|
+
}), qn = a.object({
|
|
3065
3065
|
type: a.literal("Cart"),
|
|
3066
3066
|
id: a.string().uuid(),
|
|
3067
3067
|
companyId: a.string().uuid(),
|
|
@@ -3069,18 +3069,18 @@ const re = a.object({
|
|
|
3069
3069
|
userId: a.string().uuid(),
|
|
3070
3070
|
status: a.enum(["active", "draft", "completed"]),
|
|
3071
3071
|
items: a.array(et)
|
|
3072
|
-
}),
|
|
3072
|
+
}), Bn = a.object({
|
|
3073
3073
|
id: a.string(),
|
|
3074
3074
|
name: a.string(),
|
|
3075
3075
|
websiteDomains: a.array(a.string())
|
|
3076
|
-
}),
|
|
3076
|
+
}), Wn = a.object({
|
|
3077
3077
|
type: a.literal("FavoriteProduct"),
|
|
3078
3078
|
id: a.string().uuid(),
|
|
3079
3079
|
companyId: a.string().uuid(),
|
|
3080
3080
|
storeId: a.string().uuid(),
|
|
3081
3081
|
userId: a.string().uuid(),
|
|
3082
3082
|
productId: a.string().uuid()
|
|
3083
|
-
}), Ne = a.enum(["external", "j5", "none"]),
|
|
3083
|
+
}), Ne = a.enum(["external", "j5", "none"]), _n = a.object({
|
|
3084
3084
|
type: a.literal("Profile"),
|
|
3085
3085
|
id: M,
|
|
3086
3086
|
companyId: M,
|
|
@@ -3111,7 +3111,7 @@ const re = a.object({
|
|
|
3111
3111
|
price_discount_in_currency: a.number(),
|
|
3112
3112
|
price_total: a.string().regex(/^\d+\.\d{2}$/, "Price total must be in format XX.XX"),
|
|
3113
3113
|
price_total_in_currency: a.number().positive()
|
|
3114
|
-
}),
|
|
3114
|
+
}), bn = a.object({
|
|
3115
3115
|
doc_uuid: a.string().uuid("Document UUID must be a valid UUID"),
|
|
3116
3116
|
pdf_link: a.string().url("PDF link must be a valid URL"),
|
|
3117
3117
|
pdf_link_copy: a.string().url("PDF copy link must be a valid URL"),
|
|
@@ -3122,7 +3122,7 @@ const re = a.object({
|
|
|
3122
3122
|
calculatedData: tt,
|
|
3123
3123
|
warning: a.string().optional(),
|
|
3124
3124
|
date: a.number().optional()
|
|
3125
|
-
}),
|
|
3125
|
+
}), xn = a.object({
|
|
3126
3126
|
id: a.string().min(1, "ID is required"),
|
|
3127
3127
|
number: a.string().min(1, "Number is required"),
|
|
3128
3128
|
date: a.number().min(1, "Date is required"),
|
|
@@ -3155,7 +3155,7 @@ const re = a.object({
|
|
|
3155
3155
|
number: a.string(),
|
|
3156
3156
|
name: a.string(),
|
|
3157
3157
|
id: a.string()
|
|
3158
|
-
}),
|
|
3158
|
+
}), kn = a.object({
|
|
3159
3159
|
id: a.string(),
|
|
3160
3160
|
name: a.string(),
|
|
3161
3161
|
discountPercentage: a.number().positive().min(0).max(100).optional(),
|
|
@@ -3165,7 +3165,7 @@ const re = a.object({
|
|
|
3165
3165
|
companyNumber: a.string().optional(),
|
|
3166
3166
|
address: Ie.optional(),
|
|
3167
3167
|
groupId: a.string().optional()
|
|
3168
|
-
}),
|
|
3168
|
+
}), Qn = kn.omit({ id: !0 }), wn = a.object({
|
|
3169
3169
|
doc_uuid: a.string().uuid("Document UUID must be a valid UUID"),
|
|
3170
3170
|
pdf_link: a.string().url("PDF link must be a valid URL"),
|
|
3171
3171
|
pdf_link_copy: a.string().url("PDF copy link must be a valid URL"),
|
|
@@ -3176,7 +3176,7 @@ const re = a.object({
|
|
|
3176
3176
|
calculatedData: tt,
|
|
3177
3177
|
warning: a.string().optional(),
|
|
3178
3178
|
date: a.number().optional()
|
|
3179
|
-
}),
|
|
3179
|
+
}), Tn = a.object({
|
|
3180
3180
|
id: a.string().min(1, "ID is required"),
|
|
3181
3181
|
number: a.string().min(1, "Number is required"),
|
|
3182
3182
|
date: a.string().min(1, "Date is required"),
|
|
@@ -3205,7 +3205,7 @@ const re = a.object({
|
|
|
3205
3205
|
total: a.number().min(1, "Total is required").optional(),
|
|
3206
3206
|
vat: a.number().min(1, "VAT is required").optional(),
|
|
3207
3207
|
link: a.string().url("Link must be a valid URL").optional()
|
|
3208
|
-
}),
|
|
3208
|
+
}), Yn = a.object({
|
|
3209
3209
|
type: a.literal("Order"),
|
|
3210
3210
|
createdBy: a.enum(["user", "admin"]).optional(),
|
|
3211
3211
|
id: M,
|
|
@@ -3249,7 +3249,7 @@ const re = a.object({
|
|
|
3249
3249
|
// what store charge
|
|
3250
3250
|
date: a.number(),
|
|
3251
3251
|
deliveryDate: a.coerce.number(),
|
|
3252
|
-
client:
|
|
3252
|
+
client: _n.optional(),
|
|
3253
3253
|
address: Ie.optional(),
|
|
3254
3254
|
nameOnInvoice: a.string().optional(),
|
|
3255
3255
|
emailOnInvoice: a.string().email().optional(),
|
|
@@ -3257,11 +3257,11 @@ const re = a.object({
|
|
|
3257
3257
|
clientComment: a.string().optional(),
|
|
3258
3258
|
organizationId: a.string().optional(),
|
|
3259
3259
|
billingAccount: nt.optional(),
|
|
3260
|
-
deliveryNote:
|
|
3261
|
-
invoice:
|
|
3262
|
-
ezInvoice:
|
|
3263
|
-
ezDeliveryNote:
|
|
3264
|
-
}),
|
|
3260
|
+
deliveryNote: xn.optional(),
|
|
3261
|
+
invoice: Tn.optional(),
|
|
3262
|
+
ezInvoice: wn.optional(),
|
|
3263
|
+
ezDeliveryNote: bn.optional()
|
|
3264
|
+
}), Sn = a.enum(["individual", "company"]), Xn = a.object({
|
|
3265
3265
|
id: a.string(),
|
|
3266
3266
|
companyId: a.string(),
|
|
3267
3267
|
name: a.string(),
|
|
@@ -3272,17 +3272,17 @@ const re = a.object({
|
|
|
3272
3272
|
paymentType: Ne,
|
|
3273
3273
|
allowAnonymousClients: a.boolean(),
|
|
3274
3274
|
isVatIncludedInPrice: a.boolean(),
|
|
3275
|
-
clientTypes: a.array(
|
|
3275
|
+
clientTypes: a.array(Sn),
|
|
3276
3276
|
minimumOrder: a.number().optional(),
|
|
3277
3277
|
freeDeliveryPrice: a.number().optional(),
|
|
3278
3278
|
deliveryPrice: a.number().optional(),
|
|
3279
3279
|
address: Ie.optional(),
|
|
3280
3280
|
companyNumber: a.string().optional()
|
|
3281
3281
|
// חפ של החברה
|
|
3282
|
-
}),
|
|
3282
|
+
}), In = a.object({
|
|
3283
3283
|
minSpend: a.number().positive().optional(),
|
|
3284
3284
|
stackable: a.boolean().default(!1)
|
|
3285
|
-
}).optional(),
|
|
3285
|
+
}).optional(), Nn = a.discriminatedUnion("variantType", [
|
|
3286
3286
|
a.object({
|
|
3287
3287
|
variantType: a.literal("bundle"),
|
|
3288
3288
|
productsId: a.array(a.string().nonempty()).min(1),
|
|
@@ -3292,7 +3292,7 @@ const re = a.object({
|
|
|
3292
3292
|
bundlePrice: a.number().positive()
|
|
3293
3293
|
// Total price for the bundle (e.g., $25)
|
|
3294
3294
|
})
|
|
3295
|
-
]),
|
|
3295
|
+
]), Gn = a.object({
|
|
3296
3296
|
type: a.literal("Discount"),
|
|
3297
3297
|
storeId: a.string().min(1),
|
|
3298
3298
|
companyId: a.string().min(1),
|
|
@@ -3301,10 +3301,10 @@ const re = a.object({
|
|
|
3301
3301
|
active: a.boolean(),
|
|
3302
3302
|
startDate: a.number(),
|
|
3303
3303
|
endDate: a.number(),
|
|
3304
|
-
variant:
|
|
3305
|
-
conditions:
|
|
3304
|
+
variant: Nn,
|
|
3305
|
+
conditions: In
|
|
3306
3306
|
});
|
|
3307
|
-
class
|
|
3307
|
+
class An {
|
|
3308
3308
|
canApply(e, t) {
|
|
3309
3309
|
if (e.variant.variantType !== "bundle" || !this.isDiscountActive(e)) return !1;
|
|
3310
3310
|
const { productsId: r, requiredQuantity: s } = e.variant;
|
|
@@ -3372,9 +3372,9 @@ class rt {
|
|
|
3372
3372
|
}
|
|
3373
3373
|
}
|
|
3374
3374
|
Me(rt, "strategies", /* @__PURE__ */ new Map([
|
|
3375
|
-
["bundle", new
|
|
3375
|
+
["bundle", new An()]
|
|
3376
3376
|
]));
|
|
3377
|
-
class
|
|
3377
|
+
class Cn {
|
|
3378
3378
|
static calculateDiscounts(e, t, r) {
|
|
3379
3379
|
var u, f;
|
|
3380
3380
|
const s = {
|
|
@@ -3443,24 +3443,24 @@ function st(n) {
|
|
|
3443
3443
|
function Jn(n) {
|
|
3444
3444
|
return n.toFixed(2);
|
|
3445
3445
|
}
|
|
3446
|
-
function
|
|
3446
|
+
function Hn(n) {
|
|
3447
3447
|
return Math.max(0, st(n));
|
|
3448
3448
|
}
|
|
3449
|
-
function
|
|
3449
|
+
function Kn(n, e) {
|
|
3450
3450
|
if (n <= 0) return 0;
|
|
3451
3451
|
const t = n - e;
|
|
3452
3452
|
return st(t / n * 100);
|
|
3453
3453
|
}
|
|
3454
|
-
const
|
|
3454
|
+
const Zn = a.object({
|
|
3455
3455
|
id: a.string(),
|
|
3456
3456
|
name: a.string()
|
|
3457
|
-
}),
|
|
3457
|
+
}), er = Zn.omit({ id: !0 }), at = a.object({
|
|
3458
3458
|
type: a.literal("Supplier"),
|
|
3459
3459
|
id: a.string(),
|
|
3460
3460
|
name: a.string(),
|
|
3461
3461
|
code: a.string()
|
|
3462
3462
|
// supplier code number
|
|
3463
|
-
}),
|
|
3463
|
+
}), tr = at.omit({ id: !0 }), jn = a.object({
|
|
3464
3464
|
type: a.literal("SupplierInvoice"),
|
|
3465
3465
|
id: a.string(),
|
|
3466
3466
|
supplier: at,
|
|
@@ -3497,15 +3497,18 @@ const Cn = a.object({
|
|
|
3497
3497
|
oldProfitPercentage: a.number(),
|
|
3498
3498
|
newProfitPercentage: a.number()
|
|
3499
3499
|
})
|
|
3500
|
-
)
|
|
3501
|
-
|
|
3500
|
+
),
|
|
3501
|
+
total: a.number().optional(),
|
|
3502
|
+
totalBeforeVat: a.number().optional(),
|
|
3503
|
+
vat: a.number().optional()
|
|
3504
|
+
}), nr = jn.omit({ id: !0 }), Fe = {
|
|
3502
3505
|
VAT: 18
|
|
3503
3506
|
};
|
|
3504
|
-
function
|
|
3507
|
+
function Dn(n) {
|
|
3505
3508
|
var e, t;
|
|
3506
3509
|
return ((e = n.discount) == null ? void 0 : e.type) === "percent" ? n.price * (n.discount.value ?? 100) / 100 : ((t = n.discount) == null ? void 0 : t.type) === "number" ? n.discount.value ?? 0 : 0;
|
|
3507
3510
|
}
|
|
3508
|
-
function
|
|
3511
|
+
function On(n) {
|
|
3509
3512
|
var e, t;
|
|
3510
3513
|
if (((e = n.discount) == null ? void 0 : e.type) === "percent") {
|
|
3511
3514
|
const r = n.price * n.discount.value / 100;
|
|
@@ -3513,7 +3516,7 @@ function Dn(n) {
|
|
|
3513
3516
|
}
|
|
3514
3517
|
return ((t = n.discount) == null ? void 0 : t.type) === "number" ? n.price - n.discount.value : n.price;
|
|
3515
3518
|
}
|
|
3516
|
-
function
|
|
3519
|
+
function rr({
|
|
3517
3520
|
cart: n,
|
|
3518
3521
|
discounts: e,
|
|
3519
3522
|
deliveryPrice: t = 0,
|
|
@@ -3526,14 +3529,14 @@ function nr({
|
|
|
3526
3529
|
id: u.product.id,
|
|
3527
3530
|
price: u.product.price
|
|
3528
3531
|
}
|
|
3529
|
-
})), o =
|
|
3532
|
+
})), o = Cn.calculateDiscounts(i, e), c = n.map((u, f) => {
|
|
3530
3533
|
const b = o.items[f];
|
|
3531
3534
|
return {
|
|
3532
3535
|
amount: u.amount,
|
|
3533
3536
|
product: { ...u.product },
|
|
3534
3537
|
originalPrice: u.product.price,
|
|
3535
|
-
finalPrice: b ? b.finalPrice :
|
|
3536
|
-
finalDiscount: b ? b.finalDiscount :
|
|
3538
|
+
finalPrice: b ? b.finalPrice : On(u.product),
|
|
3539
|
+
finalDiscount: b ? b.finalDiscount : Dn(u.product)
|
|
3537
3540
|
};
|
|
3538
3541
|
}), l = c.reduce(
|
|
3539
3542
|
(u, f) => {
|
|
@@ -3542,8 +3545,8 @@ function nr({
|
|
|
3542
3545
|
if (b.vat) {
|
|
3543
3546
|
let Ce = 0;
|
|
3544
3547
|
if (s) {
|
|
3545
|
-
const it = I
|
|
3546
|
-
j = Number(
|
|
3548
|
+
const it = Number((I / (1 + Fe.VAT / 100)).toFixed(2)), ot = I - it;
|
|
3549
|
+
j = Number(ot.toFixed(2)), j = j * w, Ce = Number(j.toFixed(2));
|
|
3547
3550
|
} else
|
|
3548
3551
|
j = I * Fe.VAT / 100, j = j * w, Ce = Number(j.toFixed(2));
|
|
3549
3552
|
u.vat = Number((u.vat + Ce).toFixed(2));
|
|
@@ -3562,10 +3565,10 @@ function nr({
|
|
|
3562
3565
|
);
|
|
3563
3566
|
return l.deliveryPrice && l.productsCost >= r ? l.deliveryPrice = 0 : l.finalCost += l.deliveryPrice, console.log("cartDetails", l), { items: c, ...l };
|
|
3564
3567
|
}
|
|
3565
|
-
const
|
|
3568
|
+
const Pn = {
|
|
3566
3569
|
stores: "STORES",
|
|
3567
3570
|
companies: "COMPANIES"
|
|
3568
|
-
},
|
|
3571
|
+
}, En = {
|
|
3569
3572
|
products: "products",
|
|
3570
3573
|
"favorite-products": "favorite-products",
|
|
3571
3574
|
profiles: "profiles",
|
|
@@ -3577,17 +3580,14 @@ const On = {
|
|
|
3577
3580
|
settings: "settings",
|
|
3578
3581
|
discounts: "discounts",
|
|
3579
3582
|
organizations: "organizations",
|
|
3580
|
-
organizationGroups: "
|
|
3581
|
-
// todo remove
|
|
3582
|
-
"organization-groups": "organization-groups",
|
|
3583
|
+
organizationGroups: "organizationGroups",
|
|
3583
3584
|
// todo remove
|
|
3584
3585
|
invoices: "invoices",
|
|
3585
3586
|
suppliers: "suppliers",
|
|
3586
|
-
supplierInvoices: "
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
storeCollections: Pn,
|
|
3587
|
+
supplierInvoices: "supplierInvoices"
|
|
3588
|
+
}, Rn = {
|
|
3589
|
+
systemCollections: Pn,
|
|
3590
|
+
storeCollections: En,
|
|
3591
3591
|
// for client and server
|
|
3592
3592
|
getPath: ({
|
|
3593
3593
|
companyId: n,
|
|
@@ -3597,54 +3597,54 @@ const On = {
|
|
|
3597
3597
|
}) => `${n}/${e}/${t}${r ? `/${r}` : ""}`,
|
|
3598
3598
|
// for firestore events
|
|
3599
3599
|
getDocPath: (n) => `{companyId}/{storeId}/${n}/{id}`
|
|
3600
|
-
},
|
|
3601
|
-
firestore:
|
|
3600
|
+
}, sr = {
|
|
3601
|
+
firestore: Rn
|
|
3602
3602
|
};
|
|
3603
3603
|
export {
|
|
3604
3604
|
Ie as AddressSchema,
|
|
3605
3605
|
He as BaseCategorySchema,
|
|
3606
3606
|
nt as BillingAccountSchema,
|
|
3607
|
-
|
|
3607
|
+
An as BundleDiscountStrategy,
|
|
3608
3608
|
tt as CalculatedDataSchema,
|
|
3609
3609
|
et as CartItemProductSchema,
|
|
3610
|
-
|
|
3610
|
+
qn as CartSchema,
|
|
3611
3611
|
Re as CategorySchema,
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3612
|
+
Bn as CompanySchema,
|
|
3613
|
+
xn as DeliveryNoteSchema,
|
|
3614
|
+
In as DiscountConditionsSchema,
|
|
3615
|
+
Cn as DiscountEngine,
|
|
3616
|
+
Gn as DiscountSchema,
|
|
3617
3617
|
rt as DiscountStrategyFactory,
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3618
|
+
Nn as DiscountVariantSchema,
|
|
3619
|
+
bn as EzDeliveryNoteSchema,
|
|
3620
|
+
Wn as FavoriteProductSchema,
|
|
3621
|
+
Vn as FileSchema,
|
|
3622
|
+
sr as FirebaseAPI,
|
|
3623
3623
|
re as LocaleSchema,
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3624
|
+
Fn as LocaleValueSchema,
|
|
3625
|
+
er as NewOrganizationGroupSchema,
|
|
3626
|
+
Qn as NewOrganizationSchema,
|
|
3627
|
+
Ln as NewProductSchema,
|
|
3628
|
+
nr as NewSupplierInvoiceSchema,
|
|
3629
|
+
tr as NewSupplierSchema,
|
|
3630
|
+
Yn as OrderSchema,
|
|
3631
|
+
Zn as OrganizationGroupSchema,
|
|
3632
|
+
kn as OrganizationSchema,
|
|
3633
3633
|
Ne as PaymentTypeSchema,
|
|
3634
3634
|
Ke as ProductSchema,
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3635
|
+
_n as ProfileSchema,
|
|
3636
|
+
Xn as StoreSchema,
|
|
3637
|
+
jn as SupplierInvoiceSchema,
|
|
3638
3638
|
at as SupplierSchema,
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3639
|
+
Un as TFlattenCategorySchema,
|
|
3640
|
+
Kn as calculatePercentageDiscount,
|
|
3641
|
+
Sn as clientTypesSchema,
|
|
3642
|
+
Hn as ensureNonNegative,
|
|
3643
3643
|
st as formatCurrency,
|
|
3644
3644
|
Jn as formatCurrencyString,
|
|
3645
|
-
|
|
3646
|
-
|
|
3645
|
+
rr as getCartCost,
|
|
3646
|
+
zn as isFile,
|
|
3647
3647
|
M as notEmptyTextSchema,
|
|
3648
|
-
|
|
3648
|
+
$n as numericTextSchema
|
|
3649
3649
|
};
|
|
3650
3650
|
//# sourceMappingURL=core.es.js.map
|