@oliasoft-open-source/react-ui-library 7.0.1 → 7.0.2-beta-2
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/components/unit-input/hooks/use-synchronized-display-layer.d.ts +14 -0
- package/dist/components/unit-input/hooks/use-synchronized-display-layer.d.ts.map +1 -0
- package/dist/components/unit-input/unit-input.d.ts.map +1 -1
- package/dist/components/unit-input/unit-input.test-case.stories.d.ts +1 -0
- package/dist/components/unit-input/unit-input.test-case.stories.d.ts.map +1 -1
- package/dist/index.js +301 -298
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6548,31 +6548,17 @@ var Xa = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Za =
|
|
|
6548
6548
|
}), (t) => {
|
|
6549
6549
|
e.current = t;
|
|
6550
6550
|
};
|
|
6551
|
-
}, Ed = (e) => {
|
|
6552
|
-
let t = m(void 0);
|
|
6553
|
-
return l(() => {
|
|
6554
|
-
t.current = e;
|
|
6555
|
-
}, [e]), t.current;
|
|
6556
|
-
}, Dd = (e, t) => {
|
|
6557
|
-
let n = t == null ? void 0 : t[e];
|
|
6558
|
-
if (!n) {
|
|
6559
|
-
var r;
|
|
6560
|
-
return console.log(`Warning: 'unitTemplate' missing for '${e}'. Using initial unit, preferred unit or value unit.`), (r = ur(e)) == null ? "" : r;
|
|
6561
|
-
}
|
|
6562
|
-
return n;
|
|
6563
|
-
}, Od = /* @__PURE__ */ function(e) {
|
|
6564
|
-
return e.CUSTOM = "custom", e.PREDEFINED = "predefined", e;
|
|
6565
|
-
}({}), kd = (e) => e === "undefined" || e === void 0 || e === "" || e === "null" || e === null || e === "NaN" || isNaN(e), Ad = (e) => {
|
|
6551
|
+
}, Ed = (e) => e === "undefined" || e === void 0 || e === "" || e === "null" || e === null || e === "NaN" || isNaN(e), Dd = (e) => {
|
|
6566
6552
|
if (!e) return !1;
|
|
6567
6553
|
let t = Jn(e);
|
|
6568
6554
|
return !Hn.includes(t);
|
|
6569
|
-
},
|
|
6555
|
+
}, Od = ({ value: e, unitkey: t, toUnit: n }) => {
|
|
6570
6556
|
var r;
|
|
6571
6557
|
let i = Vn[t];
|
|
6572
6558
|
if (!i || i.length === 0 || !((r = dr(e)) != null && r.valid) || !i.includes(n)) return !1;
|
|
6573
6559
|
let a = Jn(String(e));
|
|
6574
6560
|
return !(a && !i.includes(a));
|
|
6575
|
-
},
|
|
6561
|
+
}, kd = ({ value: e, unitkey: t, toUnit: n, fromUnit: r, doNotConvertValue: i = !1, exactPrecision: a = !1 }) => {
|
|
6576
6562
|
var o;
|
|
6577
6563
|
let s = er(e) ? Xn(e) : e, c = [Infinity, -Infinity].includes(Number(s));
|
|
6578
6564
|
if (i || c) return {
|
|
@@ -6592,13 +6578,13 @@ var Xa = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Za =
|
|
|
6592
6578
|
value: void 0,
|
|
6593
6579
|
error: "Source unit is missing"
|
|
6594
6580
|
};
|
|
6595
|
-
if (
|
|
6581
|
+
if (Ed(s)) return {
|
|
6596
6582
|
value: void 0,
|
|
6597
6583
|
error: "Value is invalid for conversion"
|
|
6598
6584
|
};
|
|
6599
6585
|
try {
|
|
6600
6586
|
let e = pr(s, l);
|
|
6601
|
-
return
|
|
6587
|
+
return Od({
|
|
6602
6588
|
value: e,
|
|
6603
6589
|
toUnit: n,
|
|
6604
6590
|
unitkey: t
|
|
@@ -6615,13 +6601,13 @@ var Xa = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Za =
|
|
|
6615
6601
|
error: "Conversion not possible"
|
|
6616
6602
|
};
|
|
6617
6603
|
}
|
|
6618
|
-
},
|
|
6619
|
-
let a = Xn(e), o =
|
|
6620
|
-
return !
|
|
6604
|
+
}, Ad = ({ value: e = "", toUnit: t, unitkey: n, defaultFromUnit: r, doNotConvertValue: i }) => {
|
|
6605
|
+
let a = Xn(e), o = Ed(a);
|
|
6606
|
+
return !Od({
|
|
6621
6607
|
value: e,
|
|
6622
6608
|
unitkey: n,
|
|
6623
6609
|
toUnit: t
|
|
6624
|
-
}) ||
|
|
6610
|
+
}) || Dd(e) || o ? { value: a } : er(e) ? kd({
|
|
6625
6611
|
value: e,
|
|
6626
6612
|
unitkey: n,
|
|
6627
6613
|
toUnit: t,
|
|
@@ -6629,7 +6615,50 @@ var Xa = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Za =
|
|
|
6629
6615
|
doNotConvertValue: i,
|
|
6630
6616
|
exactPrecision: !0
|
|
6631
6617
|
}) : { value: e };
|
|
6632
|
-
},
|
|
6618
|
+
}, jd = ({ error: e, initDisplayUnit: t, noConversion: n, unitkey: r, value: i }) => {
|
|
6619
|
+
let [a = "", o = ""] = i === void 0 ? [] : or(i), c = f(() => ({
|
|
6620
|
+
error: e,
|
|
6621
|
+
initDisplayUnit: t,
|
|
6622
|
+
value: i
|
|
6623
|
+
}), [
|
|
6624
|
+
e,
|
|
6625
|
+
t,
|
|
6626
|
+
i
|
|
6627
|
+
]), l = (e) => {
|
|
6628
|
+
let { value: t } = Ad({
|
|
6629
|
+
value: i,
|
|
6630
|
+
toUnit: e,
|
|
6631
|
+
unitkey: r,
|
|
6632
|
+
defaultFromUnit: o,
|
|
6633
|
+
doNotConvertValue: n
|
|
6634
|
+
});
|
|
6635
|
+
return t === "" ? {
|
|
6636
|
+
value: a,
|
|
6637
|
+
unit: o
|
|
6638
|
+
} : {
|
|
6639
|
+
value: t,
|
|
6640
|
+
unit: e
|
|
6641
|
+
};
|
|
6642
|
+
}, [u, d] = h(() => ({
|
|
6643
|
+
displayLayer: l(t),
|
|
6644
|
+
externalState: c
|
|
6645
|
+
})), p = u.externalState.error !== e || u.externalState.initDisplayUnit !== t || u.externalState.value !== i, m = u.externalState.initDisplayUnit === t ? u.displayLayer.unit : t;
|
|
6646
|
+
return [p ? l(m) : u.displayLayer, s((e) => {
|
|
6647
|
+
d({
|
|
6648
|
+
displayLayer: e,
|
|
6649
|
+
externalState: c
|
|
6650
|
+
});
|
|
6651
|
+
}, [c])];
|
|
6652
|
+
}, Md = (e, t) => {
|
|
6653
|
+
let n = t == null ? void 0 : t[e];
|
|
6654
|
+
if (!n) {
|
|
6655
|
+
var r;
|
|
6656
|
+
return console.log(`Warning: 'unitTemplate' missing for '${e}'. Using initial unit, preferred unit or value unit.`), (r = ur(e)) == null ? "" : r;
|
|
6657
|
+
}
|
|
6658
|
+
return n;
|
|
6659
|
+
}, Nd = /* @__PURE__ */ function(e) {
|
|
6660
|
+
return e.CUSTOM = "custom", e.PREDEFINED = "predefined", e;
|
|
6661
|
+
}({}), Pd = (e) => fn(e) && !an(e) && !ln(e) ? rn(e, "fieldName", "") : typeof e == "string" ? e : "", Fd = (e = "") => Hn == null ? void 0 : Hn.includes(e), Id = (e, t) => {
|
|
6633
6662
|
let n = Jn(e || "");
|
|
6634
6663
|
return Fd(t) && Fd(n);
|
|
6635
6664
|
}, Ld = n(null), Rd = () => c(Ld), zd = !1, Bd = (e) => {
|
|
@@ -6643,35 +6672,29 @@ var Xa = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Za =
|
|
|
6643
6672
|
}), disabledValidation: j = !1, allowEmpty: M = !1, convertBackToStorageUnit: N = !1, enableCosmeticRounding: P = !0, enableDisplayRounding: F = !1, roundDisplayValue: I, selectOnFocus: L = !0, groupOrder: R, tooltip: z = null }) => {
|
|
6644
6673
|
let ee = Rd(), te = Td();
|
|
6645
6674
|
typeof c == "number" && (c = `${c}`);
|
|
6646
|
-
let [
|
|
6675
|
+
let [, ne = ""] = c === void 0 ? [] : or(c), re = f(() => Md(u, C || (ee == null ? void 0 : ee.unitTemplate)), [
|
|
6647
6676
|
u,
|
|
6648
6677
|
C,
|
|
6649
6678
|
ee == null ? void 0 : ee.unitTemplate
|
|
6650
|
-
]),
|
|
6651
|
-
|
|
6652
|
-
|
|
6679
|
+
]), B = Id(c, re), ie = d || re || ne, [ae, oe] = jd({
|
|
6680
|
+
error: i,
|
|
6681
|
+
initDisplayUnit: ie,
|
|
6682
|
+
noConversion: p,
|
|
6653
6683
|
unitkey: u,
|
|
6654
|
-
|
|
6655
|
-
|
|
6656
|
-
}), [ce, le] = h(se === "" ? {
|
|
6657
|
-
value: ne,
|
|
6658
|
-
unit: re
|
|
6659
|
-
} : {
|
|
6660
|
-
value: se,
|
|
6661
|
-
unit: ae
|
|
6662
|
-
}), ue = M || (ce == null ? void 0 : ce.value) === void 0, [de, fe] = h(D ? Od.PREDEFINED : Od.CUSTOM), pe = !!(j || n), me = E && E.find((e) => {
|
|
6684
|
+
value: c
|
|
6685
|
+
}), se = M || (ae == null ? void 0 : ae.value) === void 0, [ce, le] = h(D ? Nd.PREDEFINED : Nd.CUSTOM), ue = !!(j || n), de = E && E.find((e) => {
|
|
6663
6686
|
if (!(e != null && e.value)) return;
|
|
6664
6687
|
if (k) return k === e.valueKey;
|
|
6665
|
-
let t = er(e.value) ? Jn(e.value) : "", { value: n = c } =
|
|
6688
|
+
let t = er(e.value) ? Jn(e.value) : "", { value: n = c } = kd({
|
|
6666
6689
|
value: String(c),
|
|
6667
6690
|
unitkey: u,
|
|
6668
6691
|
toUnit: t
|
|
6669
6692
|
});
|
|
6670
6693
|
return pr(n, t) === e.value;
|
|
6671
|
-
}),
|
|
6694
|
+
}), fe = () => {
|
|
6672
6695
|
var e;
|
|
6673
|
-
let t = (e = c) == null ? "" : e, n =
|
|
6674
|
-
if (!
|
|
6696
|
+
let t = (e = c) == null ? "" : e, n = ae.unit;
|
|
6697
|
+
if (!Od({
|
|
6675
6698
|
value: t,
|
|
6676
6699
|
unitkey: u,
|
|
6677
6700
|
toUnit: n
|
|
@@ -6684,79 +6707,54 @@ var Xa = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Za =
|
|
|
6684
6707
|
} catch {
|
|
6685
6708
|
return null;
|
|
6686
6709
|
}
|
|
6687
|
-
},
|
|
6688
|
-
let n = Pd(e), r = t.target, { value: i, selectionStart: a } = r, o = pr(i, (
|
|
6710
|
+
}, pe = (t) => {
|
|
6711
|
+
let n = Pd(e), r = t.target, { value: i, selectionStart: a } = r, o = pr(i, (ae == null ? void 0 : ae.unit) || "");
|
|
6689
6712
|
m({ target: {
|
|
6690
|
-
value: N ? pr(Gn(o,
|
|
6713
|
+
value: N ? pr(Gn(o, ne), ne) : o,
|
|
6691
6714
|
name: n
|
|
6692
6715
|
} });
|
|
6693
6716
|
let [s, c] = or(o);
|
|
6694
|
-
|
|
6717
|
+
oe({
|
|
6695
6718
|
value: s,
|
|
6696
6719
|
unit: c
|
|
6697
6720
|
}), te(() => {
|
|
6698
6721
|
r.selectionStart = a, r.selectionEnd = a;
|
|
6699
6722
|
});
|
|
6700
|
-
},
|
|
6701
|
-
t ===
|
|
6723
|
+
}, me = (e, t) => {
|
|
6724
|
+
t === ae.unit || isNaN(Number(e)) || (oe({
|
|
6702
6725
|
value: e,
|
|
6703
6726
|
unit: t
|
|
6704
6727
|
}), S && S(t));
|
|
6705
6728
|
};
|
|
6706
6729
|
l(() => {
|
|
6707
|
-
|
|
6708
|
-
let e, t = "";
|
|
6709
|
-
if (oe !== ae) {
|
|
6710
|
-
let { value: n } = Nd({
|
|
6711
|
-
value: c,
|
|
6712
|
-
toUnit: ae,
|
|
6713
|
-
unitkey: u,
|
|
6714
|
-
defaultFromUnit: re,
|
|
6715
|
-
doNotConvertValue: p
|
|
6716
|
-
});
|
|
6717
|
-
e = n, t = ae;
|
|
6718
|
-
} else if (pr(ce.value, ce.unit) !== c) {
|
|
6719
|
-
let { value: n } = Nd({
|
|
6720
|
-
value: c,
|
|
6721
|
-
toUnit: ce.unit,
|
|
6722
|
-
unitkey: u,
|
|
6723
|
-
defaultFromUnit: re,
|
|
6724
|
-
doNotConvertValue: p
|
|
6725
|
-
});
|
|
6726
|
-
e = n, t = ce.unit;
|
|
6727
|
-
}
|
|
6728
|
-
e !== void 0 && le({
|
|
6729
|
-
value: e,
|
|
6730
|
-
unit: t
|
|
6731
|
-
}), fe(E && me && O ? Od.PREDEFINED : Od.CUSTOM);
|
|
6732
|
-
}
|
|
6730
|
+
ie && le(E && de && O ? Nd.PREDEFINED : Nd.CUSTOM);
|
|
6733
6731
|
}, [
|
|
6734
|
-
|
|
6735
|
-
|
|
6736
|
-
|
|
6732
|
+
de,
|
|
6733
|
+
ie,
|
|
6734
|
+
E,
|
|
6737
6735
|
O
|
|
6738
6736
|
]);
|
|
6739
|
-
let
|
|
6737
|
+
let he = fe(), ge = tr(ae.unit) || ae.unit || "", _e = p || !he || he && he.length === 1, ve = Pd(e), ye, be = (t) => {
|
|
6740
6738
|
let r = t != null && t.value ? t.value : "", [i = "", a = ""] = er(r) ? or(r) : [r], o = fr(r);
|
|
6741
|
-
if (
|
|
6739
|
+
if (Od({
|
|
6742
6740
|
value: r,
|
|
6743
6741
|
unitkey: u,
|
|
6744
6742
|
toUnit: a
|
|
6745
6743
|
})) {
|
|
6746
|
-
let { value: e = "" } =
|
|
6744
|
+
let { value: e = "" } = Ad({
|
|
6747
6745
|
value: r,
|
|
6748
|
-
toUnit:
|
|
6746
|
+
toUnit: re,
|
|
6749
6747
|
unitkey: u,
|
|
6750
6748
|
defaultFromUnit: a,
|
|
6751
6749
|
doNotConvertValue: p
|
|
6752
6750
|
});
|
|
6753
|
-
o = fr(pr(e,
|
|
6751
|
+
o = fr(pr(e, re));
|
|
6754
6752
|
}
|
|
6755
6753
|
return {
|
|
6756
6754
|
type: aa.OPTION,
|
|
6757
6755
|
inline: !0,
|
|
6758
6756
|
onClick: () => {
|
|
6759
|
-
dr(i).valid && !n && (
|
|
6757
|
+
dr(i).valid && !n && (le(Nd.PREDEFINED), m({ target: {
|
|
6760
6758
|
value: r,
|
|
6761
6759
|
name: typeof e == "string" ? e : (e == null ? void 0 : e.fieldName) || "",
|
|
6762
6760
|
predefinedSelected: !0,
|
|
@@ -6768,29 +6766,29 @@ var Xa = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Za =
|
|
|
6768
6766
|
height: "0"
|
|
6769
6767
|
})] }),
|
|
6770
6768
|
description: o,
|
|
6771
|
-
selected:
|
|
6769
|
+
selected: de === t && ce === Nd.PREDEFINED
|
|
6772
6770
|
};
|
|
6773
6771
|
};
|
|
6774
|
-
if (
|
|
6772
|
+
if (ye = [{
|
|
6775
6773
|
type: aa.OPTION,
|
|
6776
6774
|
inline: !0,
|
|
6777
6775
|
onClick: () => {
|
|
6778
|
-
|
|
6779
|
-
value: pr(
|
|
6776
|
+
ce !== Nd.CUSTOM && !n && m({ target: {
|
|
6777
|
+
value: pr(ae.value, ae.unit),
|
|
6780
6778
|
name: typeof e == "string" ? e : (e == null ? void 0 : e.fieldName) || ""
|
|
6781
6779
|
} });
|
|
6782
6780
|
},
|
|
6783
6781
|
label: "Custom",
|
|
6784
|
-
selected:
|
|
6782
|
+
selected: ce === Nd.CUSTOM
|
|
6785
6783
|
}], E != null && E.length) {
|
|
6786
|
-
let e = E.map(
|
|
6787
|
-
|
|
6784
|
+
let e = E.map(be);
|
|
6785
|
+
ye = [...ye, ...e];
|
|
6788
6786
|
}
|
|
6789
|
-
let
|
|
6787
|
+
let xe = (e) => {
|
|
6790
6788
|
if (er(e)) {
|
|
6791
|
-
let t = Jn(e), { value: n } =
|
|
6789
|
+
let t = Jn(e), { value: n } = Ad({
|
|
6792
6790
|
value: e,
|
|
6793
|
-
toUnit:
|
|
6791
|
+
toUnit: ae.unit,
|
|
6794
6792
|
unitkey: u,
|
|
6795
6793
|
defaultFromUnit: t,
|
|
6796
6794
|
doNotConvertValue: p
|
|
@@ -6798,9 +6796,9 @@ var Xa = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Za =
|
|
|
6798
6796
|
return n;
|
|
6799
6797
|
}
|
|
6800
6798
|
return e;
|
|
6801
|
-
},
|
|
6799
|
+
}, Se = !E && (!R || R === V.FIRST) ? V.FIRST : V.MIDDLE, Ce = !R || R === V.LAST ? V.LAST : V.MIDDLE;
|
|
6802
6800
|
return /* @__PURE__ */ y("div", {
|
|
6803
|
-
className:
|
|
6801
|
+
className: ce === Nd.PREDEFINED ? _(Hd.predefinedMenuActive) : "",
|
|
6804
6802
|
children: /* @__PURE__ */ b(Io, {
|
|
6805
6803
|
small: o,
|
|
6806
6804
|
width: s,
|
|
@@ -6815,65 +6813,65 @@ var Xa = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Za =
|
|
|
6815
6813
|
trigger: "Component",
|
|
6816
6814
|
component: /* @__PURE__ */ y(K, {
|
|
6817
6815
|
groupOrder: "first",
|
|
6818
|
-
active:
|
|
6819
|
-
icon:
|
|
6816
|
+
active: ce === Nd.PREDEFINED,
|
|
6817
|
+
icon: ce === Nd.PREDEFINED ? "link" : "unlink",
|
|
6820
6818
|
small: o
|
|
6821
6819
|
}),
|
|
6822
6820
|
small: o,
|
|
6823
|
-
sections:
|
|
6821
|
+
sections: ye
|
|
6824
6822
|
},
|
|
6825
|
-
tooltip:
|
|
6823
|
+
tooltip: ce === Nd.PREDEFINED ? de == null ? void 0 : de.label : ""
|
|
6826
6824
|
}),
|
|
6827
6825
|
/* @__PURE__ */ y("div", {
|
|
6828
6826
|
className: Hd.inputWrapper,
|
|
6829
6827
|
children: /* @__PURE__ */ y(Uc, {
|
|
6830
|
-
name:
|
|
6828
|
+
name: ve,
|
|
6831
6829
|
testId: w,
|
|
6832
6830
|
disabled: n,
|
|
6833
|
-
placeholder:
|
|
6834
|
-
value:
|
|
6835
|
-
onChange:
|
|
6831
|
+
placeholder: xe(t),
|
|
6832
|
+
value: ae.value,
|
|
6833
|
+
onChange: pe,
|
|
6836
6834
|
onFocus: x,
|
|
6837
6835
|
error: i === null ? void 0 : i,
|
|
6838
6836
|
warning: T === null ? void 0 : T,
|
|
6839
6837
|
left: a,
|
|
6840
|
-
allowEmpty:
|
|
6841
|
-
validationCallback: (e, t) => A(
|
|
6838
|
+
allowEmpty: se,
|
|
6839
|
+
validationCallback: (e, t) => A(ve, t),
|
|
6842
6840
|
enableCosmeticRounding: P,
|
|
6843
6841
|
enableDisplayRounding: F,
|
|
6844
6842
|
roundDisplayValue: I,
|
|
6845
|
-
groupOrder:
|
|
6846
|
-
disableInternalErrorValidationMessages:
|
|
6843
|
+
groupOrder: Se,
|
|
6844
|
+
disableInternalErrorValidationMessages: ue,
|
|
6847
6845
|
small: o,
|
|
6848
6846
|
selectOnFocus: L,
|
|
6849
6847
|
tooltip: z
|
|
6850
|
-
},
|
|
6848
|
+
}, ve)
|
|
6851
6849
|
}),
|
|
6852
|
-
|
|
6853
|
-
groupOrder:
|
|
6850
|
+
ge && (_e || !B ? /* @__PURE__ */ y(Ac, {
|
|
6851
|
+
groupOrder: Ce,
|
|
6854
6852
|
small: o,
|
|
6855
|
-
children:
|
|
6853
|
+
children: ge
|
|
6856
6854
|
}) : /* @__PURE__ */ y(Aa, {
|
|
6857
|
-
groupOrder:
|
|
6855
|
+
groupOrder: Ce,
|
|
6858
6856
|
maxHeight: 380,
|
|
6859
6857
|
disabled: r,
|
|
6860
6858
|
testId: w && `${w}-menu`,
|
|
6861
6859
|
tabIndex: -1,
|
|
6862
6860
|
menu: {
|
|
6863
|
-
label:
|
|
6861
|
+
label: ge,
|
|
6864
6862
|
trigger: "DropDownButton",
|
|
6865
6863
|
small: o,
|
|
6866
|
-
sections:
|
|
6864
|
+
sections: he.map(([e = "", t = "", n]) => {
|
|
6867
6865
|
let r = n || t || "", i = $n(e) ? e : "";
|
|
6868
6866
|
return {
|
|
6869
6867
|
type: "Option",
|
|
6870
6868
|
label: P ? Vd(i) : i,
|
|
6871
6869
|
inline: !0,
|
|
6872
6870
|
onClick: (n) => {
|
|
6873
|
-
n.stopPropagation(),
|
|
6871
|
+
n.stopPropagation(), me(e, t);
|
|
6874
6872
|
},
|
|
6875
6873
|
description: r,
|
|
6876
|
-
selected: r ===
|
|
6874
|
+
selected: r === ge,
|
|
6877
6875
|
testId: `${w}-unit-${r}`
|
|
6878
6876
|
};
|
|
6879
6877
|
})
|
|
@@ -7712,10 +7710,15 @@ var Xa = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Za =
|
|
|
7712
7710
|
})]
|
|
7713
7711
|
})
|
|
7714
7712
|
});
|
|
7715
|
-
}, Df =
|
|
7713
|
+
}, Df = (e) => {
|
|
7714
|
+
let t = m(void 0);
|
|
7715
|
+
return l(() => {
|
|
7716
|
+
t.current = e;
|
|
7717
|
+
}, [e]), t.current;
|
|
7718
|
+
}, Of = Object.freeze({
|
|
7716
7719
|
Translations: "translations",
|
|
7717
7720
|
LanguageKey: "languageKey"
|
|
7718
|
-
}),
|
|
7721
|
+
}), kf = {
|
|
7719
7722
|
unified: "Unified",
|
|
7720
7723
|
split: "Split",
|
|
7721
7724
|
changesTooLarge: "Changes are too large to be shown",
|
|
@@ -7737,29 +7740,29 @@ var Xa = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Za =
|
|
|
7737
7740
|
pluralChanges: "changes",
|
|
7738
7741
|
showAll: "Show all",
|
|
7739
7742
|
unknown: "Unknown"
|
|
7740
|
-
},
|
|
7743
|
+
}, Af = (e) => Object.keys(kf).reduce((t, n) => ({
|
|
7741
7744
|
...t,
|
|
7742
|
-
[n]: (e == null ? void 0 : e[n]) || (
|
|
7743
|
-
}), {}),
|
|
7744
|
-
[
|
|
7745
|
-
[
|
|
7746
|
-
},
|
|
7747
|
-
|
|
7748
|
-
},
|
|
7745
|
+
[n]: (e == null ? void 0 : e[n]) || (kf == null ? void 0 : kf[n])
|
|
7746
|
+
}), {}), jf = {
|
|
7747
|
+
[Of.Translations]: Af(),
|
|
7748
|
+
[Of.LanguageKey]: "en"
|
|
7749
|
+
}, Mf = (e) => e ? jf[e] : jf, Nf = (e, t) => {
|
|
7750
|
+
jf[e] = t;
|
|
7751
|
+
}, Pf = (e) => e.reduce(({ preferredUnits: e, storageUnits: t }, { unitKey: n, preferredUnit: r, storageUnit: i }) => {
|
|
7749
7752
|
var a;
|
|
7750
7753
|
let { unitTemplate: o = null } = (a = Rd()) == null ? {} : a;
|
|
7751
|
-
return e[n] = r == null ?
|
|
7754
|
+
return e[n] = r == null ? Md(n, o) : r, t[n] = i, {
|
|
7752
7755
|
preferredUnits: e,
|
|
7753
7756
|
storageUnits: t
|
|
7754
7757
|
};
|
|
7755
7758
|
}, {
|
|
7756
7759
|
preferredUnits: {},
|
|
7757
7760
|
storageUnits: {}
|
|
7758
|
-
}),
|
|
7761
|
+
}), Ff = ({ row: e, rowIndex: t, selectedUnits: n, storageUnits: r, convertBackToStorageUnit: i, enableCosmeticRounding: a, enableDisplayRounding: o }) => ({
|
|
7759
7762
|
...e,
|
|
7760
7763
|
cells: e.cells.map((e, s) => {
|
|
7761
7764
|
if ("autoUnit" in e && e != null && e.autoUnit && (typeof (e == null ? void 0 : e.value) == "string" || typeof (e == null ? void 0 : e.value) == "number")) {
|
|
7762
|
-
let { unitKey: c, value: l, formatDisplayValue: u } = e, d = o && "roundDisplayValue" in e ? e == null ? void 0 : e.roundDisplayValue : null, f = n[c], p = r[c], m = p && f !== p, { value: h = l } =
|
|
7765
|
+
let { unitKey: c, value: l, formatDisplayValue: u } = e, d = o && "roundDisplayValue" in e ? e == null ? void 0 : e.roundDisplayValue : null, f = n[c], p = r[c], m = p && f !== p, { value: h = l } = kd({
|
|
7763
7766
|
value: lr(l),
|
|
7764
7767
|
unitkey: c,
|
|
7765
7768
|
toUnit: f,
|
|
@@ -7773,7 +7776,7 @@ var Xa = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Za =
|
|
|
7773
7776
|
roundDisplayValue: d,
|
|
7774
7777
|
selectOnFocus: !0,
|
|
7775
7778
|
onChange: (n) => {
|
|
7776
|
-
let { value: r } = n.target, a = i ? p : f, { value: o = r } =
|
|
7779
|
+
let { value: r } = n.target, a = i ? p : f, { value: o = r } = kd({
|
|
7777
7780
|
value: String(r),
|
|
7778
7781
|
unitkey: c,
|
|
7779
7782
|
toUnit: a,
|
|
@@ -7797,8 +7800,8 @@ var Xa = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Za =
|
|
|
7797
7800
|
}
|
|
7798
7801
|
return e;
|
|
7799
7802
|
})
|
|
7800
|
-
}),
|
|
7801
|
-
let { translations: i } =
|
|
7803
|
+
}), If = ({ headers: e, selectedUnits: t, storageUnits: n, onChangeUnit: r }) => {
|
|
7804
|
+
let { translations: i } = Mf();
|
|
7802
7805
|
return e ? e.map((e) => ({
|
|
7803
7806
|
...e,
|
|
7804
7807
|
cells: e.cells.map((e) => {
|
|
@@ -7827,8 +7830,8 @@ var Xa = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Za =
|
|
|
7827
7830
|
return e;
|
|
7828
7831
|
})
|
|
7829
7832
|
})) : [];
|
|
7830
|
-
},
|
|
7831
|
-
let { headers: u, ...d } = e, { storageUnits: f, preferredUnits: p } =
|
|
7833
|
+
}, Lf = ({ table: e, unitConfig: t, convertBackToStorageUnit: n = !0, enableCosmeticRounding: r = !0, enableDisplayRounding: i = !0, onListReorder: a, canListReorder: o, beforeRenderRow: c }) => {
|
|
7834
|
+
let { headers: u, ...d } = e, { storageUnits: f, preferredUnits: p } = Pf(t), m = Df(p), [g, _] = h(p), v = ({ unitKey: e, value: n }) => {
|
|
7832
7835
|
_({
|
|
7833
7836
|
...g,
|
|
7834
7837
|
[e]: n
|
|
@@ -7839,7 +7842,7 @@ var Xa = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Za =
|
|
|
7839
7842
|
newUnit: n,
|
|
7840
7843
|
unitKey: e
|
|
7841
7844
|
});
|
|
7842
|
-
}, b = s(({ row: e, rowIndex: t }) =>
|
|
7845
|
+
}, b = s(({ row: e, rowIndex: t }) => Ff({
|
|
7843
7846
|
row: c ? c({
|
|
7844
7847
|
row: e,
|
|
7845
7848
|
rowIndex: t
|
|
@@ -7868,7 +7871,7 @@ var Xa = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Za =
|
|
|
7868
7871
|
}, [t]), /* @__PURE__ */ y(yl, {
|
|
7869
7872
|
table: {
|
|
7870
7873
|
...d,
|
|
7871
|
-
headers:
|
|
7874
|
+
headers: If({
|
|
7872
7875
|
headers: e.headers,
|
|
7873
7876
|
selectedUnits: g,
|
|
7874
7877
|
storageUnits: f,
|
|
@@ -7879,8 +7882,8 @@ var Xa = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Za =
|
|
|
7879
7882
|
canListReorder: o,
|
|
7880
7883
|
beforeRenderRow: b
|
|
7881
7884
|
});
|
|
7882
|
-
},
|
|
7883
|
-
let { translations: d } =
|
|
7885
|
+
}, Rf = { settingField: "_settingField_1x02n_1" }, zf = ({ helpText: t, disabled: n = !1, showCustom: r = !1, children: i, userValue: a = void 0, companyValue: o = void 0, noPermission: s = !1, selectedOption: c, handleSelectChange: l, testId: u }) => {
|
|
7886
|
+
let { translations: d } = Mf(), f = (t) => t.replace(/\\n/g, "\n").split(/\n/).map((t, n) => /* @__PURE__ */ b(e.Fragment, { children: [t, /* @__PURE__ */ y("br", {})] }, n)), p = [
|
|
7884
7887
|
...r ? [] : [{
|
|
7885
7888
|
label: d == null ? void 0 : d.allUsers,
|
|
7886
7889
|
value: !1
|
|
@@ -7895,7 +7898,7 @@ var Xa = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Za =
|
|
|
7895
7898
|
}] : []
|
|
7896
7899
|
], m = a !== void 0 && o !== void 0 && !cn(a, o);
|
|
7897
7900
|
return /* @__PURE__ */ b("div", {
|
|
7898
|
-
className:
|
|
7901
|
+
className: Rf.settingField,
|
|
7899
7902
|
"data-testid": u,
|
|
7900
7903
|
children: [/* @__PURE__ */ b(Nu, {
|
|
7901
7904
|
justifyContent: "space-between",
|
|
@@ -7927,19 +7930,19 @@ var Xa = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Za =
|
|
|
7927
7930
|
children: f(t)
|
|
7928
7931
|
})]
|
|
7929
7932
|
});
|
|
7930
|
-
},
|
|
7933
|
+
}, Bf = (e, t) => {
|
|
7931
7934
|
let n = e.replace(/\r\n/g, "\n").split("\n"), r = t.replace(/\r\n/g, "\n").split("\n"), i = r.length - n.length, a = n.length - r.length;
|
|
7932
7935
|
return {
|
|
7933
7936
|
added: Math.max(0, i),
|
|
7934
7937
|
removed: Math.max(0, a)
|
|
7935
7938
|
};
|
|
7936
|
-
},
|
|
7939
|
+
}, Vf = "split", Hf = "unified", Uf = ({ oldJson: e, newJson: t, viewType: n = Vf }) => {
|
|
7937
7940
|
var r, i;
|
|
7938
|
-
let { translations: a } =
|
|
7939
|
-
value:
|
|
7941
|
+
let { translations: a } = Mf(), [o, s] = h(n), c = [{
|
|
7942
|
+
value: Vf,
|
|
7940
7943
|
label: (r = a == null ? void 0 : a.split) == null ? "Split" : r
|
|
7941
7944
|
}, {
|
|
7942
|
-
value:
|
|
7945
|
+
value: Hf,
|
|
7943
7946
|
label: (i = a == null ? void 0 : a.unified) == null ? "Unified" : i
|
|
7944
7947
|
}];
|
|
7945
7948
|
l(() => {
|
|
@@ -7947,7 +7950,7 @@ var Xa = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Za =
|
|
|
7947
7950
|
}, [n]);
|
|
7948
7951
|
let u = ({ target: { value: e } }) => {
|
|
7949
7952
|
s(e);
|
|
7950
|
-
}, { added: d, removed: f } =
|
|
7953
|
+
}, { added: d, removed: f } = Bf(e, t), p = d + f > 3500;
|
|
7951
7954
|
return /* @__PURE__ */ y(v, { children: /* @__PURE__ */ y(Ba, {
|
|
7952
7955
|
bordered: !0,
|
|
7953
7956
|
heading: /* @__PURE__ */ b(Nu, {
|
|
@@ -7980,14 +7983,14 @@ var Xa = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Za =
|
|
|
7980
7983
|
}) : /* @__PURE__ */ y(ei, {
|
|
7981
7984
|
oldValue: e,
|
|
7982
7985
|
newValue: t,
|
|
7983
|
-
splitView: o ===
|
|
7986
|
+
splitView: o === Vf,
|
|
7984
7987
|
compareMethod: ti.WORDS
|
|
7985
7988
|
})
|
|
7986
7989
|
}) });
|
|
7987
7990
|
};
|
|
7988
7991
|
//#endregion
|
|
7989
7992
|
//#region src/helpers/date.ts
|
|
7990
|
-
function
|
|
7993
|
+
function Wf({ date: e, showTime: t, showSeconds: n, timeZone: r, showTimeZone: i, locale: a }) {
|
|
7991
7994
|
return e ? new Date(e).toLocaleString(a, {
|
|
7992
7995
|
year: "numeric",
|
|
7993
7996
|
month: "short",
|
|
@@ -8001,28 +8004,28 @@ function Uf({ date: e, showTime: t, showSeconds: n, timeZone: r, showTimeZone: i
|
|
|
8001
8004
|
}
|
|
8002
8005
|
//#endregion
|
|
8003
8006
|
//#region node_modules/.pnpm/jsondiffpatch@0.7.6/node_modules/jsondiffpatch/lib/clone.js
|
|
8004
|
-
function
|
|
8007
|
+
function Gf(e) {
|
|
8005
8008
|
var t;
|
|
8006
8009
|
let n = /^\/(.*)\/([gimyu]*)$/.exec(e.toString());
|
|
8007
8010
|
if (!n) throw Error("Invalid RegExp");
|
|
8008
8011
|
return new RegExp((t = n[1]) == null ? "" : t, n[2]);
|
|
8009
8012
|
}
|
|
8010
|
-
function
|
|
8013
|
+
function Kf(e) {
|
|
8011
8014
|
if (typeof e != "object") return e;
|
|
8012
8015
|
if (e === null) return null;
|
|
8013
|
-
if (Array.isArray(e)) return e.map(
|
|
8016
|
+
if (Array.isArray(e)) return e.map(Kf);
|
|
8014
8017
|
if (e instanceof Date) return new Date(e.getTime());
|
|
8015
|
-
if (e instanceof RegExp) return
|
|
8018
|
+
if (e instanceof RegExp) return Gf(e);
|
|
8016
8019
|
let t = {};
|
|
8017
|
-
for (let n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] =
|
|
8020
|
+
for (let n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = Kf(e[n]));
|
|
8018
8021
|
return t;
|
|
8019
8022
|
}
|
|
8020
8023
|
//#endregion
|
|
8021
8024
|
//#region node_modules/.pnpm/jsondiffpatch@0.7.6/node_modules/jsondiffpatch/lib/assertions/arrays.js
|
|
8022
|
-
function
|
|
8025
|
+
function qf(e, t) {
|
|
8023
8026
|
if (e.length === 0) throw Error(t || "Expected a non-empty array");
|
|
8024
8027
|
}
|
|
8025
|
-
var
|
|
8028
|
+
var Jf = (e) => e[e.length - 1], Yf = class {
|
|
8026
8029
|
setResult(e) {
|
|
8027
8030
|
return this.result = e, this.hasResult = !0, this;
|
|
8028
8031
|
}
|
|
@@ -8030,16 +8033,16 @@ var qf = (e) => e[e.length - 1], Jf = class {
|
|
|
8030
8033
|
return this.exiting = !0, this;
|
|
8031
8034
|
}
|
|
8032
8035
|
push(e, t) {
|
|
8033
|
-
return e.parent = this, t !== void 0 && (e.childName = t), e.root = this.root || this, e.options = e.options || this.options, this.children ? (
|
|
8036
|
+
return e.parent = this, t !== void 0 && (e.childName = t), e.root = this.root || this, e.options = e.options || this.options, this.children ? (qf(this.children), Jf(this.children).next = e, this.children.push(e)) : (this.children = [e], this.nextAfterChildren = this.next || null, this.next = e), e.next = this, this;
|
|
8034
8037
|
}
|
|
8035
|
-
},
|
|
8038
|
+
}, Xf = class extends Yf {
|
|
8036
8039
|
constructor(e, t) {
|
|
8037
8040
|
super(), this.left = e, this.right = t, this.pipe = "diff";
|
|
8038
8041
|
}
|
|
8039
8042
|
prepareDeltaResult(e) {
|
|
8040
8043
|
var t, n, r, i;
|
|
8041
8044
|
if (typeof e == "object" && ((t = this.options) != null && t.omitRemovedValues && Array.isArray(e) && e.length > 1 && (e.length === 2 || e[2] === 0 || e[2] === 3) && (e[0] = 0), (n = this.options) != null && n.cloneDiffValues)) {
|
|
8042
|
-
let t = typeof ((r = this.options) == null ? void 0 : r.cloneDiffValues) == "function" ? (i = this.options) == null ? void 0 : i.cloneDiffValues :
|
|
8045
|
+
let t = typeof ((r = this.options) == null ? void 0 : r.cloneDiffValues) == "function" ? (i = this.options) == null ? void 0 : i.cloneDiffValues : Kf;
|
|
8043
8046
|
typeof e[0] == "object" && (e[0] = t(e[0])), typeof e[1] == "object" && (e[1] = t(e[1]));
|
|
8044
8047
|
}
|
|
8045
8048
|
return e;
|
|
@@ -8047,15 +8050,15 @@ var qf = (e) => e[e.length - 1], Jf = class {
|
|
|
8047
8050
|
setResult(e) {
|
|
8048
8051
|
return this.prepareDeltaResult(e), super.setResult(e);
|
|
8049
8052
|
}
|
|
8050
|
-
},
|
|
8053
|
+
}, Zf = class extends Yf {
|
|
8051
8054
|
constructor(e, t) {
|
|
8052
8055
|
super(), this.left = e, this.delta = t, this.pipe = "patch";
|
|
8053
8056
|
}
|
|
8054
|
-
},
|
|
8057
|
+
}, Qf = class extends Yf {
|
|
8055
8058
|
constructor(e) {
|
|
8056
8059
|
super(), this.delta = e, this.pipe = "reverse";
|
|
8057
8060
|
}
|
|
8058
|
-
},
|
|
8061
|
+
}, $f = class {
|
|
8059
8062
|
constructor(e) {
|
|
8060
8063
|
this.name = e, this.filters = [];
|
|
8061
8064
|
}
|
|
@@ -8119,7 +8122,7 @@ var qf = (e) => e[e.length - 1], Jf = class {
|
|
|
8119
8122
|
}
|
|
8120
8123
|
}), this);
|
|
8121
8124
|
}
|
|
8122
|
-
},
|
|
8125
|
+
}, ep = class {
|
|
8123
8126
|
constructor(e) {
|
|
8124
8127
|
this.selfOptions = e || {}, this.pipes = {};
|
|
8125
8128
|
}
|
|
@@ -8146,7 +8149,7 @@ var qf = (e) => e[e.length - 1], Jf = class {
|
|
|
8146
8149
|
for (; r;) n.nextAfterChildren !== void 0 && (n.next = n.nextAfterChildren, n.nextAfterChildren = null), typeof r == "string" && (r = this.pipe(r)), r.process(n), i = r, r = null, n && n.next && (n = n.next, r = n.pipe || i);
|
|
8147
8150
|
return n.hasResult ? n.result : void 0;
|
|
8148
8151
|
}
|
|
8149
|
-
},
|
|
8152
|
+
}, tp = (e, t, n, r) => e[n] === t[r], np = (e, t, n, r) => {
|
|
8150
8153
|
var i, a, o;
|
|
8151
8154
|
let s = e.length, c = t.length, l, u, d = Array(s + 1);
|
|
8152
8155
|
for (l = 0; l < s + 1; l++) {
|
|
@@ -8162,7 +8165,7 @@ var qf = (e) => e[e.length - 1], Jf = class {
|
|
|
8162
8165
|
for (u = 1; u < c + 1; u++) n(e, t, l - 1, u - 1, r) ? s[u] = ((i = f[u - 1]) == null ? 0 : i) + 1 : s[u] = Math.max((a = f[u]) == null ? 0 : a, (o = s[u - 1]) == null ? 0 : o);
|
|
8163
8166
|
}
|
|
8164
8167
|
return d;
|
|
8165
|
-
},
|
|
8168
|
+
}, rp = (e, t, n, r) => {
|
|
8166
8169
|
let i = t.length, a = n.length, o = {
|
|
8167
8170
|
sequence: [],
|
|
8168
8171
|
indices1: [],
|
|
@@ -8184,11 +8187,11 @@ var qf = (e) => e[e.length - 1], Jf = class {
|
|
|
8184
8187
|
}
|
|
8185
8188
|
}
|
|
8186
8189
|
return o;
|
|
8187
|
-
},
|
|
8190
|
+
}, ip = { get: (e, t, n, r) => {
|
|
8188
8191
|
let i = r || {};
|
|
8189
|
-
return np(
|
|
8190
|
-
} },
|
|
8191
|
-
function
|
|
8192
|
+
return rp(np(e, t, n || tp, i), e, t, i);
|
|
8193
|
+
} }, ap = 3;
|
|
8194
|
+
function op(e, t, n, r) {
|
|
8192
8195
|
for (let i = 0; i < n; i++) {
|
|
8193
8196
|
let n = e[i];
|
|
8194
8197
|
for (let e = 0; e < r; e++) {
|
|
@@ -8198,7 +8201,7 @@ function ap(e, t, n, r) {
|
|
|
8198
8201
|
}
|
|
8199
8202
|
return !1;
|
|
8200
8203
|
}
|
|
8201
|
-
function
|
|
8204
|
+
function sp(e, t, n, r, i) {
|
|
8202
8205
|
let a = e[n], o = t[r];
|
|
8203
8206
|
if (a === o) return !0;
|
|
8204
8207
|
if (typeof a != "object" || typeof o != "object") return !1;
|
|
@@ -8211,15 +8214,15 @@ function op(e, t, n, r, i) {
|
|
|
8211
8214
|
let l = i.hashCache2[r];
|
|
8212
8215
|
return l === void 0 && (i.hashCache2[r] = l = s(o, r)), l === void 0 ? !1 : c === l;
|
|
8213
8216
|
}
|
|
8214
|
-
var
|
|
8217
|
+
var cp = function(e) {
|
|
8215
8218
|
var t, n, r, i, a;
|
|
8216
8219
|
if (!e.leftIsArray) return;
|
|
8217
8220
|
let o = {
|
|
8218
8221
|
objectHash: (t = e.options) == null ? void 0 : t.objectHash,
|
|
8219
8222
|
matchByPosition: (n = e.options) == null ? void 0 : n.matchByPosition
|
|
8220
8223
|
}, s = 0, c = 0, l, u, d, f = e.left, p = e.right, m = f.length, h = p.length, g;
|
|
8221
|
-
for (m > 0 && h > 0 && !o.objectHash && typeof o.matchByPosition != "boolean" && (o.matchByPosition = !
|
|
8222
|
-
for (; c + s < m && c + s < h &&
|
|
8224
|
+
for (m > 0 && h > 0 && !o.objectHash && typeof o.matchByPosition != "boolean" && (o.matchByPosition = !op(f, p, m, h)); s < m && s < h && sp(f, p, s, s, o);) l = s, g = new Xf(f[l], p[l]), e.push(g, l), s++;
|
|
8225
|
+
for (; c + s < m && c + s < h && sp(f, p, m - 1 - c, h - 1 - c, o);) u = m - 1 - c, d = h - 1 - c, g = new Xf(f[u], p[d]), e.push(g, d), c++;
|
|
8223
8226
|
let _;
|
|
8224
8227
|
if (s + c === m) {
|
|
8225
8228
|
if (m === h) {
|
|
@@ -8243,7 +8246,7 @@ var sp = function(e) {
|
|
|
8243
8246
|
return;
|
|
8244
8247
|
}
|
|
8245
8248
|
o.hashCache1 = void 0, o.hashCache2 = void 0;
|
|
8246
|
-
let v = f.slice(s, m - c), y = p.slice(s, h - c), b =
|
|
8249
|
+
let v = f.slice(s, m - c), y = p.slice(s, h - c), b = ip.get(v, y, sp, o), x = [];
|
|
8247
8250
|
for (_ = _ || { _t: "a" }, l = s; l < m - c; l++) if (b.indices1.indexOf(l - s) < 0) {
|
|
8248
8251
|
let t = `_${l}`;
|
|
8249
8252
|
_[t] = [
|
|
@@ -8264,8 +8267,8 @@ var sp = function(e) {
|
|
|
8264
8267
|
if (S && w > 0) for (let n = 0; n < w; n++) {
|
|
8265
8268
|
u = x[n];
|
|
8266
8269
|
let r = u === void 0 ? void 0 : _[`_${u}`];
|
|
8267
|
-
if (u !== void 0 && r &&
|
|
8268
|
-
r.splice(1, 2, l,
|
|
8270
|
+
if (u !== void 0 && r && sp(v, y, u - s, l - s, o)) {
|
|
8271
|
+
r.splice(1, 2, l, ap), r.splice(1, 2, l, ap), C || (r[0] = ""), d = l, g = new Xf(f[u], p[d]), e.push(g, d), x.splice(n, 1), t = !0;
|
|
8269
8272
|
break;
|
|
8270
8273
|
}
|
|
8271
8274
|
}
|
|
@@ -8273,20 +8276,20 @@ var sp = function(e) {
|
|
|
8273
8276
|
} else {
|
|
8274
8277
|
if (b.indices1[t] === void 0) throw Error(`Invalid indexOnArray2: ${t}, seq.indices1: ${b.indices1}`);
|
|
8275
8278
|
if (u = b.indices1[t] + s, b.indices2[t] === void 0) throw Error(`Invalid indexOnArray2: ${t}, seq.indices2: ${b.indices2}`);
|
|
8276
|
-
d = b.indices2[t] + s, g = new
|
|
8279
|
+
d = b.indices2[t] + s, g = new Xf(f[u], p[d]), e.push(g, d);
|
|
8277
8280
|
}
|
|
8278
8281
|
}
|
|
8279
8282
|
e.setResult(_).exit();
|
|
8280
8283
|
};
|
|
8281
|
-
|
|
8282
|
-
var
|
|
8284
|
+
cp.filterName = "arrays";
|
|
8285
|
+
var lp = {
|
|
8283
8286
|
numerically(e, t) {
|
|
8284
8287
|
return e - t;
|
|
8285
8288
|
},
|
|
8286
8289
|
numericallyBy(e) {
|
|
8287
8290
|
return (t, n) => t[e] - n[e];
|
|
8288
8291
|
}
|
|
8289
|
-
},
|
|
8292
|
+
}, up = function(e) {
|
|
8290
8293
|
var t;
|
|
8291
8294
|
if (!e.nested) return;
|
|
8292
8295
|
let n = e.delta;
|
|
@@ -8294,7 +8297,7 @@ var cp = {
|
|
|
8294
8297
|
let r, i, a = n, o = e.left, s = [], c = [], l = [];
|
|
8295
8298
|
for (r in a) if (r !== "_t") if (r[0] === "_") {
|
|
8296
8299
|
let e = r;
|
|
8297
|
-
if (a[e] !== void 0 && (a[e][2] === 0 || a[e][2] ===
|
|
8300
|
+
if (a[e] !== void 0 && (a[e][2] === 0 || a[e][2] === ap)) s.push(Number.parseInt(r.slice(1), 10));
|
|
8298
8301
|
else throw Error(`only removal or move can be applied at original array indices, invalid diff type: ${(t = a[e]) == null ? void 0 : t[2]}`);
|
|
8299
8302
|
} else {
|
|
8300
8303
|
let e = r;
|
|
@@ -8306,15 +8309,15 @@ var cp = {
|
|
|
8306
8309
|
delta: a[e]
|
|
8307
8310
|
});
|
|
8308
8311
|
}
|
|
8309
|
-
for (s = s.sort(
|
|
8312
|
+
for (s = s.sort(lp.numerically), r = s.length - 1; r >= 0; r--) {
|
|
8310
8313
|
if (i = s[r], i === void 0) continue;
|
|
8311
8314
|
let e = a[`_${i}`], t = o.splice(i, 1)[0];
|
|
8312
|
-
(e == null ? void 0 : e[2]) ===
|
|
8315
|
+
(e == null ? void 0 : e[2]) === ap && c.push({
|
|
8313
8316
|
index: e[1],
|
|
8314
8317
|
value: t
|
|
8315
8318
|
});
|
|
8316
8319
|
}
|
|
8317
|
-
c = c.sort(
|
|
8320
|
+
c = c.sort(lp.numericallyBy("index"));
|
|
8318
8321
|
let u = c.length;
|
|
8319
8322
|
for (r = 0; r < u; r++) {
|
|
8320
8323
|
let e = c[r];
|
|
@@ -8324,7 +8327,7 @@ var cp = {
|
|
|
8324
8327
|
if (d > 0) for (r = 0; r < d; r++) {
|
|
8325
8328
|
let t = l[r];
|
|
8326
8329
|
if (t === void 0) continue;
|
|
8327
|
-
let n = new
|
|
8330
|
+
let n = new Zf(o[t.index], t.delta);
|
|
8328
8331
|
e.push(n, t.index);
|
|
8329
8332
|
}
|
|
8330
8333
|
if (!e.children) {
|
|
@@ -8333,8 +8336,8 @@ var cp = {
|
|
|
8333
8336
|
}
|
|
8334
8337
|
e.exit();
|
|
8335
8338
|
};
|
|
8336
|
-
|
|
8337
|
-
var
|
|
8339
|
+
up.filterName = "arrays";
|
|
8340
|
+
var dp = function(e) {
|
|
8338
8341
|
if (!e || !e.children || e.delta._t !== "a") return;
|
|
8339
8342
|
let t = e.left, n = e.children.length;
|
|
8340
8343
|
for (let r = 0; r < n; r++) {
|
|
@@ -8345,16 +8348,16 @@ var up = function(e) {
|
|
|
8345
8348
|
}
|
|
8346
8349
|
e.setResult(t).exit();
|
|
8347
8350
|
};
|
|
8348
|
-
|
|
8349
|
-
var
|
|
8351
|
+
dp.filterName = "arraysCollectChildren";
|
|
8352
|
+
var fp = function(e) {
|
|
8350
8353
|
if (!e.nested) {
|
|
8351
8354
|
let t = e.delta;
|
|
8352
|
-
if (t[2] ===
|
|
8355
|
+
if (t[2] === ap) {
|
|
8353
8356
|
let n = t;
|
|
8354
8357
|
e.newName = `_${n[1]}`, e.setResult([
|
|
8355
8358
|
n[0],
|
|
8356
8359
|
Number.parseInt(e.childName.substring(1), 10),
|
|
8357
|
-
|
|
8360
|
+
ap
|
|
8358
8361
|
]).exit();
|
|
8359
8362
|
}
|
|
8360
8363
|
return;
|
|
@@ -8364,26 +8367,26 @@ var dp = function(e) {
|
|
|
8364
8367
|
let n = t;
|
|
8365
8368
|
for (let t in n) {
|
|
8366
8369
|
if (t === "_t") continue;
|
|
8367
|
-
let r = new
|
|
8370
|
+
let r = new Qf(n[t]);
|
|
8368
8371
|
e.push(r, t);
|
|
8369
8372
|
}
|
|
8370
8373
|
e.exit();
|
|
8371
8374
|
};
|
|
8372
|
-
|
|
8373
|
-
var
|
|
8375
|
+
fp.filterName = "arrays";
|
|
8376
|
+
var pp = (e, t, n) => {
|
|
8374
8377
|
if (typeof t == "string" && t[0] === "_") return Number.parseInt(t.substring(1), 10);
|
|
8375
8378
|
if (Array.isArray(n) && n[2] === 0) return `_${t}`;
|
|
8376
8379
|
let r = +t;
|
|
8377
8380
|
for (let n in e) {
|
|
8378
8381
|
let i = e[n];
|
|
8379
|
-
if (Array.isArray(i)) if (i[2] ===
|
|
8382
|
+
if (Array.isArray(i)) if (i[2] === ap) {
|
|
8380
8383
|
let e = Number.parseInt(n.substring(1), 10), a = i[1];
|
|
8381
8384
|
if (a === +t) return e;
|
|
8382
8385
|
e <= r && a > r ? r++ : e >= r && a < r && r--;
|
|
8383
8386
|
} else i[2] === 0 ? Number.parseInt(n.substring(1), 10) <= r && r++ : i.length === 1 && Number.parseInt(n, 10) <= r && r--;
|
|
8384
8387
|
}
|
|
8385
8388
|
return r;
|
|
8386
|
-
},
|
|
8389
|
+
}, mp = (e) => {
|
|
8387
8390
|
if (!e || !e.children) return;
|
|
8388
8391
|
let t = e.delta;
|
|
8389
8392
|
if (t._t !== "a") return;
|
|
@@ -8394,22 +8397,22 @@ var fp = (e, t, n) => {
|
|
|
8394
8397
|
let a = r.newName;
|
|
8395
8398
|
if (a === void 0) {
|
|
8396
8399
|
if (r.childName === void 0) throw Error("child.childName is undefined");
|
|
8397
|
-
a =
|
|
8400
|
+
a = pp(n, r.childName, r.result);
|
|
8398
8401
|
}
|
|
8399
8402
|
i[a] !== r.result && (i[a] = r.result);
|
|
8400
8403
|
}
|
|
8401
8404
|
e.setResult(i).exit();
|
|
8402
8405
|
};
|
|
8403
|
-
|
|
8406
|
+
mp.filterName = "arraysCollectChildren";
|
|
8404
8407
|
//#endregion
|
|
8405
8408
|
//#region node_modules/.pnpm/jsondiffpatch@0.7.6/node_modules/jsondiffpatch/lib/filters/dates.js
|
|
8406
|
-
var
|
|
8409
|
+
var hp = function(e) {
|
|
8407
8410
|
e.left instanceof Date ? (e.right instanceof Date && e.left.getTime() === e.right.getTime() ? e.setResult(void 0) : e.setResult([e.left, e.right]), e.exit()) : e.right instanceof Date && e.setResult([e.left, e.right]).exit();
|
|
8408
8411
|
};
|
|
8409
|
-
|
|
8412
|
+
hp.filterName = "dates";
|
|
8410
8413
|
//#endregion
|
|
8411
8414
|
//#region node_modules/.pnpm/jsondiffpatch@0.7.6/node_modules/jsondiffpatch/lib/filters/nested.js
|
|
8412
|
-
var
|
|
8415
|
+
var gp = new Set(["__proto__"]), _p = (e) => {
|
|
8413
8416
|
if (!e || !e.children) return;
|
|
8414
8417
|
let t = e.children.length, n = e.result;
|
|
8415
8418
|
for (let r = 0; r < t; r++) {
|
|
@@ -8421,18 +8424,18 @@ var hp = new Set(["__proto__"]), gp = (e) => {
|
|
|
8421
8424
|
}
|
|
8422
8425
|
n && e.leftIsArray && (n._t = "a"), e.setResult(n).exit();
|
|
8423
8426
|
};
|
|
8424
|
-
|
|
8425
|
-
var
|
|
8427
|
+
_p.filterName = "collectChildren";
|
|
8428
|
+
var vp = (e) => {
|
|
8426
8429
|
var t;
|
|
8427
8430
|
if (e.leftIsArray || e.leftType !== "object") return;
|
|
8428
8431
|
let n = e.left, r = e.right, i = (t = e.options) == null ? void 0 : t.propertyFilter;
|
|
8429
8432
|
for (let t in n) {
|
|
8430
8433
|
if (!Object.prototype.hasOwnProperty.call(n, t) || i && !i(t, e)) continue;
|
|
8431
|
-
let a = new
|
|
8434
|
+
let a = new Xf(n[t], r[t]);
|
|
8432
8435
|
e.push(a, t);
|
|
8433
8436
|
}
|
|
8434
8437
|
for (let t in r) if (Object.prototype.hasOwnProperty.call(r, t) && !(i && !i(t, e)) && n[t] === void 0) {
|
|
8435
|
-
let n = new
|
|
8438
|
+
let n = new Xf(void 0, r[t]);
|
|
8436
8439
|
e.push(n, t);
|
|
8437
8440
|
}
|
|
8438
8441
|
if (!e.children || e.children.length === 0) {
|
|
@@ -8441,15 +8444,15 @@ var _p = (e) => {
|
|
|
8441
8444
|
}
|
|
8442
8445
|
e.exit();
|
|
8443
8446
|
};
|
|
8444
|
-
|
|
8445
|
-
var
|
|
8447
|
+
vp.filterName = "objects";
|
|
8448
|
+
var yp = function(e) {
|
|
8446
8449
|
if (!e.nested) return;
|
|
8447
8450
|
let t = e.delta;
|
|
8448
8451
|
if (t._t) return;
|
|
8449
8452
|
let n = t, r = !1;
|
|
8450
8453
|
for (let t in n) {
|
|
8451
|
-
if (
|
|
8452
|
-
let i = e.left, a = new
|
|
8454
|
+
if (gp.has(t) || !Object.prototype.hasOwnProperty.call(n, t)) continue;
|
|
8455
|
+
let i = e.left, a = new Zf(typeof i == "object" && i && Object.prototype.hasOwnProperty.call(i, t) ? i[t] : void 0, n[t]);
|
|
8453
8456
|
e.push(a, t), r = !0;
|
|
8454
8457
|
}
|
|
8455
8458
|
if (!r) {
|
|
@@ -8458,8 +8461,8 @@ var vp = function(e) {
|
|
|
8458
8461
|
}
|
|
8459
8462
|
e.exit();
|
|
8460
8463
|
};
|
|
8461
|
-
|
|
8462
|
-
var
|
|
8464
|
+
yp.filterName = "objects";
|
|
8465
|
+
var bp = function(e) {
|
|
8463
8466
|
if (!e || !e.children || e.delta._t) return;
|
|
8464
8467
|
if (e.left === null || typeof e.left != "object") {
|
|
8465
8468
|
e.setResult(e.left).exit();
|
|
@@ -8470,17 +8473,17 @@ var yp = function(e) {
|
|
|
8470
8473
|
let n = e.children[r];
|
|
8471
8474
|
if (n === void 0) continue;
|
|
8472
8475
|
let i = n.childName;
|
|
8473
|
-
|
|
8476
|
+
gp.has(i) || (Object.prototype.hasOwnProperty.call(e.left, i) && n.result === void 0 ? delete t[i] : t[i] !== n.result && (t[i] = n.result));
|
|
8474
8477
|
}
|
|
8475
8478
|
e.setResult(t).exit();
|
|
8476
8479
|
};
|
|
8477
|
-
|
|
8478
|
-
var
|
|
8480
|
+
bp.filterName = "collectChildren";
|
|
8481
|
+
var xp = function(e) {
|
|
8479
8482
|
if (!e.nested || e.delta._t) return;
|
|
8480
8483
|
let t = e.delta, n = !1;
|
|
8481
8484
|
for (let r in t) {
|
|
8482
|
-
if (
|
|
8483
|
-
let i = new
|
|
8485
|
+
if (gp.has(r) || !Object.prototype.hasOwnProperty.call(t, r)) continue;
|
|
8486
|
+
let i = new Qf(t[r]);
|
|
8484
8487
|
e.push(i, r), n = !0;
|
|
8485
8488
|
}
|
|
8486
8489
|
if (!n) {
|
|
@@ -8489,25 +8492,25 @@ var bp = function(e) {
|
|
|
8489
8492
|
}
|
|
8490
8493
|
e.exit();
|
|
8491
8494
|
};
|
|
8492
|
-
|
|
8493
|
-
var
|
|
8495
|
+
xp.filterName = "objects";
|
|
8496
|
+
var Sp = (e) => {
|
|
8494
8497
|
if (!e || !e.children || e.delta._t) return;
|
|
8495
8498
|
let t = e.children.length, n = {};
|
|
8496
8499
|
for (let r = 0; r < t; r++) {
|
|
8497
8500
|
let t = e.children[r];
|
|
8498
8501
|
if (t === void 0) continue;
|
|
8499
8502
|
let i = t.childName;
|
|
8500
|
-
|
|
8503
|
+
gp.has(i) || n[i] !== t.result && (n[i] = t.result);
|
|
8501
8504
|
}
|
|
8502
8505
|
e.setResult(n).exit();
|
|
8503
8506
|
};
|
|
8504
|
-
|
|
8507
|
+
Sp.filterName = "collectChildren";
|
|
8505
8508
|
//#endregion
|
|
8506
8509
|
//#region node_modules/.pnpm/jsondiffpatch@0.7.6/node_modules/jsondiffpatch/lib/filters/texts.js
|
|
8507
|
-
var
|
|
8508
|
-
function
|
|
8510
|
+
var Cp = 2, wp = 60, Tp = null;
|
|
8511
|
+
function Ep(e, t) {
|
|
8509
8512
|
var n;
|
|
8510
|
-
if (!
|
|
8513
|
+
if (!Tp) {
|
|
8511
8514
|
let r;
|
|
8512
8515
|
if ((n = e == null ? void 0 : e.textDiff) != null && n.diffMatchPatch) r = new e.textDiff.diffMatchPatch();
|
|
8513
8516
|
else {
|
|
@@ -8515,7 +8518,7 @@ function Tp(e, t) {
|
|
|
8515
8518
|
let e = /* @__PURE__ */ Error("The diff-match-patch library was not provided. Pass the library in through the options or use the `jsondiffpatch/with-text-diffs` entry-point.");
|
|
8516
8519
|
throw e.diff_match_patch_not_found = !0, e;
|
|
8517
8520
|
}
|
|
8518
|
-
|
|
8521
|
+
Tp = {
|
|
8519
8522
|
diff: (e, t) => r.patch_toText(r.patch_make(e, t)),
|
|
8520
8523
|
patch: (e, t) => {
|
|
8521
8524
|
let n = r.patch_apply(r.patch_fromText(t), e);
|
|
@@ -8527,17 +8530,17 @@ function Tp(e, t) {
|
|
|
8527
8530
|
}
|
|
8528
8531
|
};
|
|
8529
8532
|
}
|
|
8530
|
-
return
|
|
8533
|
+
return Tp;
|
|
8531
8534
|
}
|
|
8532
|
-
var
|
|
8535
|
+
var Dp = function(e) {
|
|
8533
8536
|
var t, n;
|
|
8534
8537
|
if (e.leftType !== "string") return;
|
|
8535
|
-
let r = e.left, i = e.right, a = ((n = (t = e.options) == null ? void 0 : t.textDiff) == null ? void 0 : n.minLength) ||
|
|
8538
|
+
let r = e.left, i = e.right, a = ((n = (t = e.options) == null ? void 0 : t.textDiff) == null ? void 0 : n.minLength) || wp;
|
|
8536
8539
|
if (r.length < a || i.length < a) {
|
|
8537
8540
|
e.setResult([r, i]).exit();
|
|
8538
8541
|
return;
|
|
8539
8542
|
}
|
|
8540
|
-
let o =
|
|
8543
|
+
let o = Ep(e.options);
|
|
8541
8544
|
if (!o) {
|
|
8542
8545
|
e.setResult([r, i]).exit();
|
|
8543
8546
|
return;
|
|
@@ -8546,19 +8549,19 @@ var Ep = function(e) {
|
|
|
8546
8549
|
e.setResult([
|
|
8547
8550
|
s(r, i),
|
|
8548
8551
|
0,
|
|
8549
|
-
|
|
8552
|
+
Cp
|
|
8550
8553
|
]).exit();
|
|
8551
8554
|
};
|
|
8552
|
-
|
|
8553
|
-
var
|
|
8555
|
+
Dp.filterName = "texts";
|
|
8556
|
+
var Op = function(e) {
|
|
8554
8557
|
if (e.nested) return;
|
|
8555
8558
|
let t = e.delta;
|
|
8556
|
-
if (t[2] !==
|
|
8557
|
-
let n = t, r =
|
|
8559
|
+
if (t[2] !== Cp) return;
|
|
8560
|
+
let n = t, r = Ep(e.options, !0).patch;
|
|
8558
8561
|
e.setResult(r(e.left, n[0])).exit();
|
|
8559
8562
|
};
|
|
8560
|
-
|
|
8561
|
-
var
|
|
8563
|
+
Op.filterName = "texts";
|
|
8564
|
+
var kp = (e) => {
|
|
8562
8565
|
var t, n, r;
|
|
8563
8566
|
let i = /^@@ +-(\d+),(\d+) +\+(\d+),(\d+) +@@$/, a = e.split("\n");
|
|
8564
8567
|
for (let e = 0; e < a.length; e++) {
|
|
@@ -8579,21 +8582,21 @@ var Op = (e) => {
|
|
|
8579
8582
|
} else s === "-" && (a[e] = `+${(r = a[e]) == null ? void 0 : r.slice(1)}`);
|
|
8580
8583
|
}
|
|
8581
8584
|
return a.join("\n");
|
|
8582
|
-
},
|
|
8585
|
+
}, Ap = function(e) {
|
|
8583
8586
|
if (e.nested) return;
|
|
8584
8587
|
let t = e.delta;
|
|
8585
|
-
if (t[2] !==
|
|
8588
|
+
if (t[2] !== Cp) return;
|
|
8586
8589
|
let n = t;
|
|
8587
8590
|
e.setResult([
|
|
8588
|
-
|
|
8591
|
+
kp(n[0]),
|
|
8589
8592
|
0,
|
|
8590
|
-
|
|
8593
|
+
Cp
|
|
8591
8594
|
]).exit();
|
|
8592
8595
|
};
|
|
8593
|
-
|
|
8596
|
+
Ap.filterName = "texts";
|
|
8594
8597
|
//#endregion
|
|
8595
8598
|
//#region node_modules/.pnpm/jsondiffpatch@0.7.6/node_modules/jsondiffpatch/lib/filters/trivial.js
|
|
8596
|
-
var
|
|
8599
|
+
var jp = function(e) {
|
|
8597
8600
|
if (e.left === e.right) {
|
|
8598
8601
|
e.setResult(void 0).exit();
|
|
8599
8602
|
return;
|
|
@@ -8626,8 +8629,8 @@ var Ap = function(e) {
|
|
|
8626
8629
|
}
|
|
8627
8630
|
e.left instanceof RegExp && (e.right instanceof RegExp ? e.setResult([e.left.toString(), e.right.toString()]).exit() : e.setResult([e.left, e.right]).exit());
|
|
8628
8631
|
};
|
|
8629
|
-
|
|
8630
|
-
var
|
|
8632
|
+
jp.filterName = "trivial";
|
|
8633
|
+
var Mp = function(e) {
|
|
8631
8634
|
if (e.delta === void 0) {
|
|
8632
8635
|
e.setResult(e.left).exit();
|
|
8633
8636
|
return;
|
|
@@ -8651,8 +8654,8 @@ var jp = function(e) {
|
|
|
8651
8654
|
}
|
|
8652
8655
|
t.length === 3 && t[2] === 0 && e.setResult(void 0).exit();
|
|
8653
8656
|
};
|
|
8654
|
-
|
|
8655
|
-
var
|
|
8657
|
+
Mp.filterName = "trivial";
|
|
8658
|
+
var Np = function(e) {
|
|
8656
8659
|
if (e.delta === void 0) {
|
|
8657
8660
|
e.setResult(e.delta).exit();
|
|
8658
8661
|
return;
|
|
@@ -8673,36 +8676,36 @@ var Mp = function(e) {
|
|
|
8673
8676
|
}
|
|
8674
8677
|
t.length === 3 && t[2] === 0 && e.setResult([t[0]]).exit();
|
|
8675
8678
|
};
|
|
8676
|
-
|
|
8679
|
+
Np.filterName = "trivial";
|
|
8677
8680
|
//#endregion
|
|
8678
8681
|
//#region node_modules/.pnpm/jsondiffpatch@0.7.6/node_modules/jsondiffpatch/lib/diffpatcher.js
|
|
8679
|
-
var
|
|
8682
|
+
var Pp = class {
|
|
8680
8683
|
constructor(e) {
|
|
8681
|
-
this.processor = new
|
|
8684
|
+
this.processor = new ep(e), this.processor.pipe(new $f("diff").append(_p, jp, hp, Dp, vp, cp).shouldHaveResult()), this.processor.pipe(new $f("patch").append(bp, dp, Mp, Op, yp, up).shouldHaveResult()), this.processor.pipe(new $f("reverse").append(Sp, mp, Np, Ap, xp, fp).shouldHaveResult());
|
|
8682
8685
|
}
|
|
8683
8686
|
options(e) {
|
|
8684
8687
|
return this.processor.options(e);
|
|
8685
8688
|
}
|
|
8686
8689
|
diff(e, t) {
|
|
8687
|
-
return this.processor.process(new
|
|
8690
|
+
return this.processor.process(new Xf(e, t));
|
|
8688
8691
|
}
|
|
8689
8692
|
patch(e, t) {
|
|
8690
|
-
return this.processor.process(new
|
|
8693
|
+
return this.processor.process(new Zf(e, t));
|
|
8691
8694
|
}
|
|
8692
8695
|
reverse(e) {
|
|
8693
|
-
return this.processor.process(new
|
|
8696
|
+
return this.processor.process(new Qf(e));
|
|
8694
8697
|
}
|
|
8695
8698
|
unpatch(e, t) {
|
|
8696
8699
|
return this.patch(e, this.reverse(t));
|
|
8697
8700
|
}
|
|
8698
8701
|
clone(e) {
|
|
8699
|
-
return
|
|
8702
|
+
return Kf(e);
|
|
8700
8703
|
}
|
|
8701
8704
|
};
|
|
8702
8705
|
//#endregion
|
|
8703
8706
|
//#region node_modules/.pnpm/jsondiffpatch@0.7.6/node_modules/jsondiffpatch/lib/index.js
|
|
8704
|
-
function
|
|
8705
|
-
return new
|
|
8707
|
+
function Fp(e) {
|
|
8708
|
+
return new Pp(e);
|
|
8706
8709
|
}
|
|
8707
8710
|
//#endregion
|
|
8708
8711
|
//#region node_modules/.pnpm/@dmsnell+diff-match-patch@1.1.0/node_modules/@dmsnell/diff-match-patch/index.js
|
|
@@ -9275,46 +9278,46 @@ $.Diff = function(e, t) {
|
|
|
9275
9278
|
};
|
|
9276
9279
|
//#endregion
|
|
9277
9280
|
//#region src/components/audit-log/create-diff-patcher.tsx
|
|
9278
|
-
var
|
|
9281
|
+
var Ip = (e = {}) => Fp({
|
|
9279
9282
|
...e,
|
|
9280
9283
|
textDiff: {
|
|
9281
9284
|
diffMatchPatch: $,
|
|
9282
9285
|
minLength: 120
|
|
9283
9286
|
},
|
|
9284
9287
|
cloneDiffValues: !0
|
|
9285
|
-
}),
|
|
9288
|
+
}), Lp = ["user", "unittemplate"], Rp = Ip(), zp = (e, t, n) => {
|
|
9286
9289
|
let r = Object.fromEntries(e.map((e) => [e.sectionKey, e.sectionLabel]));
|
|
9287
9290
|
for (let e = t.length - 1; e >= 0; e--) {
|
|
9288
9291
|
let n = r[t[e]];
|
|
9289
9292
|
if (n) return n;
|
|
9290
9293
|
}
|
|
9291
9294
|
return n || "";
|
|
9292
|
-
},
|
|
9295
|
+
}, Bp = (e) => {
|
|
9293
9296
|
let t = (e) => er(e) ? fr(e) : String(e);
|
|
9294
9297
|
return Array.isArray(e) ? e.length === 0 ? "" : e.some((e) => e && typeof e == "object") ? "Multiple changes..." : e.map(t).join(", ") : e && typeof e == "object" ? Object.keys(e).length === 0 ? "" : "Multiple changes..." : t(e);
|
|
9295
|
-
},
|
|
9298
|
+
}, Vp = (e) => {
|
|
9296
9299
|
switch (e.length) {
|
|
9297
9300
|
case 1: {
|
|
9298
9301
|
let [t] = e;
|
|
9299
9302
|
return {
|
|
9300
9303
|
type: "created",
|
|
9301
9304
|
before: "",
|
|
9302
|
-
after:
|
|
9305
|
+
after: Bp(t)
|
|
9303
9306
|
};
|
|
9304
9307
|
}
|
|
9305
9308
|
case 2: {
|
|
9306
9309
|
let [t, n] = e;
|
|
9307
9310
|
return {
|
|
9308
9311
|
type: "modified",
|
|
9309
|
-
before:
|
|
9310
|
-
after:
|
|
9312
|
+
before: Bp(t),
|
|
9313
|
+
after: Bp(n)
|
|
9311
9314
|
};
|
|
9312
9315
|
}
|
|
9313
9316
|
case 3: {
|
|
9314
9317
|
let [t] = e;
|
|
9315
9318
|
return {
|
|
9316
9319
|
type: "deleted",
|
|
9317
|
-
before:
|
|
9320
|
+
before: Bp(t),
|
|
9318
9321
|
after: ""
|
|
9319
9322
|
};
|
|
9320
9323
|
}
|
|
@@ -9324,15 +9327,15 @@ var Fp = (e = {}) => Pp({
|
|
|
9324
9327
|
after: ""
|
|
9325
9328
|
};
|
|
9326
9329
|
}
|
|
9327
|
-
},
|
|
9328
|
-
let r =
|
|
9330
|
+
}, Hp = (e) => Array.isArray(e), Up = (e, t) => t ? Hp(t) ? t.length === 0 ? e : t.reduce((e, t) => Rp.unpatch($t(e), $t(t)), $t(e)) : Rp.unpatch($t(e), $t(t)) : e, Wp = (e) => e.createdAt || e.date, Gp = (e, t, n) => {
|
|
9331
|
+
let r = Wp(e);
|
|
9329
9332
|
if (!r) return {
|
|
9330
9333
|
oldJson: "",
|
|
9331
9334
|
newJson: "",
|
|
9332
9335
|
error: `Cannot create comparison view: missing date for audit log ${e.id}`
|
|
9333
9336
|
};
|
|
9334
9337
|
let i = t.filter((e) => {
|
|
9335
|
-
let t =
|
|
9338
|
+
let t = Wp(e);
|
|
9336
9339
|
return !!(e.diffs && t && t >= r);
|
|
9337
9340
|
}), a = Array.from({ length: i.length + 1 });
|
|
9338
9341
|
a[0] = $t(n);
|
|
@@ -9345,7 +9348,7 @@ var Fp = (e = {}) => Pp({
|
|
|
9345
9348
|
a[e + 1] = a[e];
|
|
9346
9349
|
continue;
|
|
9347
9350
|
}
|
|
9348
|
-
a[e + 1] =
|
|
9351
|
+
a[e + 1] = Up(a[e], t);
|
|
9349
9352
|
}
|
|
9350
9353
|
let e = i.length > 0 ? a[i.length - 1] : n, t = i.length > 0 ? a[i.length] : n;
|
|
9351
9354
|
o = JSON.stringify(t == null ? "" : t, null, 2), s = JSON.stringify(e == null ? "" : e, null, 2);
|
|
@@ -9360,10 +9363,10 @@ var Fp = (e = {}) => Pp({
|
|
|
9360
9363
|
oldJson: o,
|
|
9361
9364
|
newJson: s
|
|
9362
9365
|
};
|
|
9363
|
-
},
|
|
9366
|
+
}, Kp = (e, t, n = {}, r = []) => {
|
|
9364
9367
|
var i;
|
|
9365
9368
|
if (!e) return;
|
|
9366
|
-
let a = [...
|
|
9369
|
+
let a = [...Lp, ...(i = n.hiddenKeys) == null ? [] : i];
|
|
9367
9370
|
Object.keys(e).forEach((i) => {
|
|
9368
9371
|
var o;
|
|
9369
9372
|
let s = e[i];
|
|
@@ -9376,12 +9379,12 @@ var Fp = (e = {}) => Pp({
|
|
|
9376
9379
|
an(s) ? t.push({
|
|
9377
9380
|
deltaFormat: [...s],
|
|
9378
9381
|
path: c
|
|
9379
|
-
}) : fn(s) &&
|
|
9382
|
+
}) : fn(s) && Kp(s, t, n, c);
|
|
9380
9383
|
});
|
|
9381
|
-
},
|
|
9384
|
+
}, qp = (e, t = {}) => {
|
|
9382
9385
|
let n = [];
|
|
9383
|
-
return e ? (
|
|
9384
|
-
},
|
|
9386
|
+
return e ? (Kp(e, n, t), n) : [];
|
|
9387
|
+
}, Jp = (e) => e.replace(/\[\d+\]/g, "").replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]/g, " ").replace(/\s+/g, " ").trim().replace(/^./, (e) => e.toUpperCase()), Yp = (e) => {
|
|
9385
9388
|
if (e == null || e === "") return "empty";
|
|
9386
9389
|
if (typeof e == "boolean") return e ? "true" : "false";
|
|
9387
9390
|
if (typeof e == "string") return e;
|
|
@@ -9392,32 +9395,32 @@ var Fp = (e = {}) => Pp({
|
|
|
9392
9395
|
} catch {
|
|
9393
9396
|
return String(e);
|
|
9394
9397
|
}
|
|
9395
|
-
},
|
|
9398
|
+
}, Xp = (e, t = e.length - 1) => {
|
|
9396
9399
|
if (t >= e.length) return "Value";
|
|
9397
9400
|
let n = e[t];
|
|
9398
|
-
return !n || Zn(n) ?
|
|
9399
|
-
},
|
|
9400
|
-
let o =
|
|
9401
|
+
return !n || Zn(n) ? Xp(e, t - 1) : Jp(n);
|
|
9402
|
+
}, Zp = ({ userName: e, type: t, property: n, before: r, after: i, sectionName: a }) => {
|
|
9403
|
+
let o = Yp(r), s = Yp(i), c = a ? ` in ${a}` : "";
|
|
9401
9404
|
switch (t) {
|
|
9402
9405
|
case "modified": return `${e} updated ${n} from ${o} to ${s}${c}.`;
|
|
9403
9406
|
case "created": return `${e} created ${s}${c}.`;
|
|
9404
9407
|
case "deleted": return `${e} deleted ${o}${c}.`;
|
|
9405
9408
|
default: return `${e} changed ${n}${c}.`;
|
|
9406
9409
|
}
|
|
9407
|
-
},
|
|
9410
|
+
}, Qp = ({ sectionNames: e, userName: t, diffs: n, defaultSectionName: r }) => /* @__PURE__ */ y(yl, { table: {
|
|
9408
9411
|
headers: [{ cells: [{ value: "Changes" }] }],
|
|
9409
9412
|
rows: n.map((n) => {
|
|
9410
|
-
let { deltaFormat: i, path: a } = n, o =
|
|
9411
|
-
return { cells: [{ value:
|
|
9413
|
+
let { deltaFormat: i, path: a } = n, o = zp(e, a, r), { type: s, before: c, after: l } = Vp(i);
|
|
9414
|
+
return { cells: [{ value: Zp({
|
|
9412
9415
|
userName: t,
|
|
9413
9416
|
type: s,
|
|
9414
|
-
property:
|
|
9417
|
+
property: Xp(a),
|
|
9415
9418
|
before: c,
|
|
9416
9419
|
after: l,
|
|
9417
9420
|
sectionName: o
|
|
9418
9421
|
}) }] };
|
|
9419
9422
|
})
|
|
9420
|
-
} }),
|
|
9423
|
+
} }), $p = Object.freeze({
|
|
9421
9424
|
summary: {
|
|
9422
9425
|
label: "Summary",
|
|
9423
9426
|
value: "summary"
|
|
@@ -9426,13 +9429,13 @@ var Fp = (e = {}) => Pp({
|
|
|
9426
9429
|
label: "Compare",
|
|
9427
9430
|
value: "compare"
|
|
9428
9431
|
}
|
|
9429
|
-
}),
|
|
9430
|
-
let c = [
|
|
9432
|
+
}), em = ({ auditLog: e, auditLogs: t, data: n, isOpen: r, transformDiffsConfig: i, sectionNames: a, defaultSectionName: o, onClose: s }) => {
|
|
9433
|
+
let c = [$p.summary, $p.compare].map(({ label: e, value: t }) => ({
|
|
9431
9434
|
label: e,
|
|
9432
9435
|
value: t
|
|
9433
9436
|
})), [l, u] = h(c[0]), { diffs: d = void 0 } = e || {};
|
|
9434
9437
|
if (!d) return null;
|
|
9435
|
-
let { oldJson: f, newJson: p, error: m } =
|
|
9438
|
+
let { oldJson: f, newJson: p, error: m } = Gp(e, t, n);
|
|
9436
9439
|
return /* @__PURE__ */ y(Jo, {
|
|
9437
9440
|
visible: r,
|
|
9438
9441
|
centered: !0,
|
|
@@ -9444,15 +9447,15 @@ var Fp = (e = {}) => Pp({
|
|
|
9444
9447
|
onChange: (e) => u(c.find((t) => t.value === e.target.value)),
|
|
9445
9448
|
options: c,
|
|
9446
9449
|
value: l
|
|
9447
|
-
}), l.value === "summary" ? /* @__PURE__ */ y(
|
|
9450
|
+
}), l.value === "summary" ? /* @__PURE__ */ y(Qp, {
|
|
9448
9451
|
userName: e.userName,
|
|
9449
9452
|
sectionNames: a,
|
|
9450
|
-
diffs:
|
|
9453
|
+
diffs: qp(d, i),
|
|
9451
9454
|
defaultSectionName: o
|
|
9452
9455
|
}) : m ? /* @__PURE__ */ y("div", {
|
|
9453
9456
|
style: { padding: 16 },
|
|
9454
9457
|
children: m
|
|
9455
|
-
}) : /* @__PURE__ */ y(
|
|
9458
|
+
}) : /* @__PURE__ */ y(Uf, {
|
|
9456
9459
|
oldJson: f,
|
|
9457
9460
|
newJson: p
|
|
9458
9461
|
})] }),
|
|
@@ -9465,7 +9468,7 @@ var Fp = (e = {}) => Pp({
|
|
|
9465
9468
|
height: "90vh"
|
|
9466
9469
|
} })
|
|
9467
9470
|
});
|
|
9468
|
-
},
|
|
9471
|
+
}, tm = [
|
|
9469
9472
|
{
|
|
9470
9473
|
label: "10 / page",
|
|
9471
9474
|
value: 10
|
|
@@ -9478,8 +9481,8 @@ var Fp = (e = {}) => Pp({
|
|
|
9478
9481
|
label: "50 / page",
|
|
9479
9482
|
value: 50
|
|
9480
9483
|
}
|
|
9481
|
-
],
|
|
9482
|
-
let { diffs: n, userName: r, source: i, operation: a, operationMetaData: o } = e, s =
|
|
9484
|
+
], nm = (e, t = {}) => {
|
|
9485
|
+
let { diffs: n, userName: r, source: i, operation: a, operationMetaData: o } = e, s = qp(n, t).length, c = s ? `${s} change${s === 1 ? "" : "s"}` : "no field changes";
|
|
9483
9486
|
if (i === "API" && !r) return a === "Created" ? "Created through API" : "Changed through API";
|
|
9484
9487
|
switch (a) {
|
|
9485
9488
|
case "Created": return `Created by ${r}`;
|
|
@@ -9489,7 +9492,7 @@ var Fp = (e = {}) => Pp({
|
|
|
9489
9492
|
case "Updated": return `Updated by ${r} (${c})`;
|
|
9490
9493
|
default: return `Change by ${r}`;
|
|
9491
9494
|
}
|
|
9492
|
-
},
|
|
9495
|
+
}, rm = ({ logs: e, data: t, total: n, loading: r, selectedPage: i, rowsPerPage: a, sectionNames: o, defaultSectionName: s, filterToggles: c = [], transformDiffsConfig: l, onChangeRowsPerPage: u, onSelectPage: d, onClickSnapshot: f, snapshotLoading: p, getActions: m, isLogDisabled: g }) => {
|
|
9493
9496
|
let [_, x] = h(!1), [S, C] = h(null), w = (e) => {
|
|
9494
9497
|
if (e.snapshot) {
|
|
9495
9498
|
f == null || f(e.snapshot, e);
|
|
@@ -9508,7 +9511,7 @@ var Fp = (e = {}) => Pp({
|
|
|
9508
9511
|
return {
|
|
9509
9512
|
cells: [
|
|
9510
9513
|
{
|
|
9511
|
-
value: e.snapshot ? `Snapshot: ${e.snapshot}` :
|
|
9514
|
+
value: e.snapshot ? `Snapshot: ${e.snapshot}` : nm(e, l),
|
|
9512
9515
|
type: "Link",
|
|
9513
9516
|
disabled: n,
|
|
9514
9517
|
onClick: n ? void 0 : () => w(e),
|
|
@@ -9527,8 +9530,8 @@ var Fp = (e = {}) => Pp({
|
|
|
9527
9530
|
type: "Static"
|
|
9528
9531
|
},
|
|
9529
9532
|
{
|
|
9530
|
-
value:
|
|
9531
|
-
date:
|
|
9533
|
+
value: Wf({
|
|
9534
|
+
date: Wp(e),
|
|
9532
9535
|
showTime: !0
|
|
9533
9536
|
}),
|
|
9534
9537
|
type: "Static"
|
|
@@ -9571,14 +9574,14 @@ var Fp = (e = {}) => Pp({
|
|
|
9571
9574
|
onChange: (e) => {
|
|
9572
9575
|
u(Number(e.target.value));
|
|
9573
9576
|
},
|
|
9574
|
-
options:
|
|
9577
|
+
options: tm,
|
|
9575
9578
|
value: a
|
|
9576
9579
|
},
|
|
9577
9580
|
onSelectPage: (e) => d(e),
|
|
9578
9581
|
small: !0
|
|
9579
9582
|
} }
|
|
9580
9583
|
} })
|
|
9581
|
-
}), _ && S && S.diffs && /* @__PURE__ */ y(
|
|
9584
|
+
}), _ && S && S.diffs && /* @__PURE__ */ y(em, {
|
|
9582
9585
|
sectionNames: o,
|
|
9583
9586
|
isOpen: _,
|
|
9584
9587
|
onClose: () => x(!1),
|
|
@@ -9588,7 +9591,7 @@ var Fp = (e = {}) => Pp({
|
|
|
9588
9591
|
data: t,
|
|
9589
9592
|
transformDiffsConfig: l
|
|
9590
9593
|
})] });
|
|
9591
|
-
},
|
|
9594
|
+
}, im = ({ pathName: e, moduleName: t, onNavigate: n, onStartTimingEvent: r }) => {
|
|
9592
9595
|
let i = window.location.href, a = m(i);
|
|
9593
9596
|
return l(() => {
|
|
9594
9597
|
a.current = i;
|
|
@@ -9611,10 +9614,10 @@ var Fp = (e = {}) => Pp({
|
|
|
9611
9614
|
});
|
|
9612
9615
|
};
|
|
9613
9616
|
}, [e, t]), null;
|
|
9614
|
-
},
|
|
9615
|
-
|
|
9616
|
-
e ===
|
|
9617
|
+
}, am = (e) => typeof e == "string" || typeof e == "number" || typeof e == "boolean" || e === null, om = (e) => {
|
|
9618
|
+
Nf(Of.LanguageKey, e.languageKey), Object.entries(e).forEach(([e, t]) => {
|
|
9619
|
+
e === Of.Translations ? Nf(e, Af(t)) : Nf(e, am(t) ? t : { ...t });
|
|
9617
9620
|
});
|
|
9618
9621
|
};
|
|
9619
9622
|
//#endregion
|
|
9620
|
-
export { Ei as Accordion, Yi as AccordionWithDefaultToggle, Ma as Actions, ii as Align,
|
|
9623
|
+
export { Ei as Accordion, Yi as AccordionWithDefaultToggle, Ma as Actions, ii as Align, rm as AuditLog, va as Badge, Ia as Breadcrumb, Pa as BreadcrumbLinkType, K as Button, Ra as ButtonGroup, ai as ButtonPosition, $i as ButtonType, Ba as Card, Gi as CheckBox, bi as Chevron, Ci as Collapse, ri as Color, co as ColorInput, so as ColorInputPopover, mo as Column, Eo as Dialog, Uf as DiffViewer, U as DisabledContext, yo as Divider, No as Drawer, rf as ElementType, Al as Empty, Mu as Field, Ou as FileButton, Uo as FileInput, Nu as Flex, Fu as FormRow, qa as Grid, V as GroupOrder, Co as Heading, Wi as HelpIcon, W as Icon, H as IconType, Ro as Input, Io as InputGroup, Ac as InputGroupAddon, Bo as InputReaderMethods, ci as InputType, Au as Label, Ju as List, Lu as ListHeading, Uu as ListSubheading, Xu as Loader, Aa as Menu, oa as MenuCarat, aa as MenuType, ms as Message, cs as MessageType, Jo as Modal, bs as NativeSelect, Uc as NumberInput, rd as OptionDropdown, ad as Page, jc as Pagination, uf as PopConfirm, Ua as Popover, od as Portal, cd as PrintHeader, Zo as ProgressBar, ld as RadioButton, md as RichTextInput, gd as Row, wc as Select, zf as SettingField, xd as SideBar, Cd as Skeleton, $c as Slider, ns as SmartUploadModal, Wo as Spacer, Qi as Spinner, yl as Table, Du as TableImportExport, Xd as Tabs, _o as Text, $d as TextArea, Zd as TextLink, oi as TextTransform, si as Theme, Fr as Toaster, du as Toggle, G as Tooltip, sf as TopBar, mf as Tree, Ef as TreeTable, ni as TriggerType, Ud as UnitInput, qd as UnitSlider, Lf as UnitTable, im as UsageTracker, cu as dismissToast, Bd as initializeContext, om as initializeGuiLibrary, Vo as readFile, su as toast, xs as useFocus, Go as useKeyboardEvent, ws as useWindowWidth };
|