etudes 27.2.2 → 27.4.0
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/build/etudes.js +742 -733
- package/build/etudes.umd.cjs +6 -6
- package/build/index.d.ts +2 -0
- package/build/utils/measureIntrinsicSize.d.ts +2 -0
- package/build/utils/setStyles.d.ts +21 -0
- package/package.json +1 -1
package/build/etudes.js
CHANGED
|
@@ -874,7 +874,8 @@ function ne() {
|
|
|
874
874
|
let [e, t] = f(G.zero);
|
|
875
875
|
return l(() => {
|
|
876
876
|
let e = () => {
|
|
877
|
-
|
|
877
|
+
let e = K.size(K.fromViewport());
|
|
878
|
+
t((t) => G.isEqual(t, e) ? t : e);
|
|
878
879
|
};
|
|
879
880
|
return window.addEventListener("resize", e), e(), () => {
|
|
880
881
|
window.removeEventListener("resize", e);
|
|
@@ -886,13 +887,17 @@ function ne() {
|
|
|
886
887
|
function re(e) {
|
|
887
888
|
let [t, n] = f(K.zero), r = ne();
|
|
888
889
|
return te(e, (e) => {
|
|
889
|
-
|
|
890
|
+
let t = K.from(e);
|
|
891
|
+
n((e) => K.isEqual(e, t) ? e : t);
|
|
890
892
|
}), ee(e, (e) => {
|
|
891
|
-
|
|
893
|
+
let t = K.from(e);
|
|
894
|
+
n((e) => K.isEqual(e, t) ? e : t);
|
|
892
895
|
}), l(() => {
|
|
893
896
|
let t = e && "current" in e ? e.current : e;
|
|
894
|
-
|
|
895
|
-
|
|
897
|
+
if (!t) return;
|
|
898
|
+
let r = K.from(t);
|
|
899
|
+
n((e) => K.isEqual(e, r) ? e : r);
|
|
900
|
+
}, [e, r]), t;
|
|
896
901
|
}
|
|
897
902
|
//#endregion
|
|
898
903
|
//#region src/types/ImageSource.ts
|
|
@@ -5805,220 +5810,224 @@ var $e = /* @__PURE__ */ a(({ children: e, ...n }, r) => (Array.isArray(e) && co
|
|
|
5805
5810
|
})));
|
|
5806
5811
|
process.env.NODE_ENV === "development" && ($e.displayName = "ExtractChild");
|
|
5807
5812
|
//#endregion
|
|
5813
|
+
//#region src/utils/measureIntrinsicSize.ts
|
|
5814
|
+
function et(e, t) {
|
|
5815
|
+
if (typeof window > "u") return G.zero;
|
|
5816
|
+
let n = e.cloneNode(!0);
|
|
5817
|
+
n.style.position = "fixed", n.style.visibility = "hidden", n.style.width = t === void 0 ? "auto" : `${t}px`, n.style.whiteSpace = t === void 0 ? "pre" : "normal";
|
|
5818
|
+
let r = e.parentNode ?? document.body;
|
|
5819
|
+
try {
|
|
5820
|
+
r.insertBefore(n, e.nextSibling);
|
|
5821
|
+
let t = n.getBoundingClientRect();
|
|
5822
|
+
return G.make(t.width, t.height);
|
|
5823
|
+
} finally {
|
|
5824
|
+
n.remove();
|
|
5825
|
+
}
|
|
5826
|
+
}
|
|
5827
|
+
//#endregion
|
|
5828
|
+
//#region src/utils/setStyles.ts
|
|
5829
|
+
function tt(e, { target: t } = {}) {
|
|
5830
|
+
if (typeof window > "u") return;
|
|
5831
|
+
let n = t ?? window.document.documentElement;
|
|
5832
|
+
Object.keys(e).forEach((t) => {
|
|
5833
|
+
n.style[t] = e[t];
|
|
5834
|
+
});
|
|
5835
|
+
}
|
|
5836
|
+
//#endregion
|
|
5808
5837
|
//#region src/hocs/WithTooltip.tsx
|
|
5809
|
-
function
|
|
5810
|
-
let p = d(null), m = d(null), h =
|
|
5811
|
-
let a =
|
|
5812
|
-
|
|
5813
|
-
let s =
|
|
5814
|
-
|
|
5815
|
-
arrowSize: G.make(i, r),
|
|
5816
|
-
fullDialogWidth: c.width,
|
|
5817
|
-
gap: o,
|
|
5818
|
-
maxDialogWidth: u,
|
|
5819
|
-
targetWidth: h.width
|
|
5820
|
-
}), m = P(t, d.dialog);
|
|
5821
|
-
Object.keys(m).forEach((e) => a.style[e] = m[e]);
|
|
5822
|
-
let g = window.document.createElement("span");
|
|
5823
|
-
return Object.keys(d.arrow).forEach((e) => g.style[e] = d.arrow[e]), a.appendChild(g), a;
|
|
5838
|
+
function nt({ className: e = "", style: t, alignment: n, arrowHeight: r = 6, arrowWidth: i = 12, children: a, gap: o = 4, hint: l, maxWidth: u = 200, threshold: f = 100 }) {
|
|
5839
|
+
let p = d(null), m = d(null), h = d(null), g = d(void 0), _ = s(() => {
|
|
5840
|
+
let e = p.current, a = m.current, s = h.current;
|
|
5841
|
+
if (!e || !a || !s) return;
|
|
5842
|
+
let c = K.from(s), l = G.make(i, r), d = et(e, u), g = n ?? it(c, f), _ = at(g, d, l, o, c), v = ot(g, d, l, c);
|
|
5843
|
+
tt(P(t, _), { target: e }), tt(v, { target: a });
|
|
5824
5844
|
}, [
|
|
5825
|
-
e,
|
|
5826
5845
|
n,
|
|
5827
|
-
l,
|
|
5828
5846
|
u,
|
|
5829
|
-
|
|
5830
|
-
h.width,
|
|
5847
|
+
t,
|
|
5831
5848
|
f,
|
|
5832
5849
|
r,
|
|
5833
5850
|
i,
|
|
5834
5851
|
o
|
|
5835
|
-
]),
|
|
5836
|
-
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
|
|
5852
|
+
]), v = s(() => {
|
|
5853
|
+
let e = p.current, t = h.current;
|
|
5854
|
+
if (!e || !t) return;
|
|
5855
|
+
let n = new IntersectionObserver((e) => {
|
|
5856
|
+
for (let n of e) if (n.target === t) {
|
|
5857
|
+
_();
|
|
5858
|
+
break;
|
|
5859
|
+
}
|
|
5860
|
+
});
|
|
5861
|
+
n.observe(t), g.current = n, window.addEventListener("resize", _), e.style.opacity = "1", e.ariaHidden = "false", _();
|
|
5862
|
+
}, [_]), y = s(() => {
|
|
5863
|
+
let e = p.current;
|
|
5864
|
+
e && (e.style.opacity = "0", e.ariaHidden = "true", g.current?.disconnect(), g.current = void 0, window.removeEventListener("resize", _));
|
|
5865
|
+
}, [_]);
|
|
5840
5866
|
return c(() => {
|
|
5841
|
-
let
|
|
5842
|
-
return
|
|
5843
|
-
p.current?.
|
|
5867
|
+
let { arrow: t, dialog: n } = rt(e, l);
|
|
5868
|
+
return m.current = t, p.current = n, window.document.body.appendChild(n), y(), () => {
|
|
5869
|
+
window.document.body.removeChild(n), m.current = null, p.current = null, g.current?.disconnect(), g.current = void 0, window.removeEventListener("resize", _);
|
|
5844
5870
|
};
|
|
5845
|
-
}, [
|
|
5846
|
-
ref:
|
|
5847
|
-
onMouseEnter:
|
|
5848
|
-
onMouseLeave:
|
|
5871
|
+
}, [e, l]), /* @__PURE__ */ (0, D.jsx)($e, {
|
|
5872
|
+
ref: h,
|
|
5873
|
+
onMouseEnter: v,
|
|
5874
|
+
onMouseLeave: y,
|
|
5849
5875
|
children: a
|
|
5850
5876
|
});
|
|
5851
5877
|
}
|
|
5852
|
-
function
|
|
5853
|
-
|
|
5854
|
-
|
|
5855
|
-
|
|
5856
|
-
|
|
5857
|
-
|
|
5878
|
+
function rt(e, t) {
|
|
5879
|
+
let n = window.document.createElement("span");
|
|
5880
|
+
n.className = e, n.innerHTML = t, n.role = "tooltip", tt({
|
|
5881
|
+
boxSizing: "border-box",
|
|
5882
|
+
height: "auto",
|
|
5883
|
+
margin: "0",
|
|
5884
|
+
pointerEvents: "none",
|
|
5885
|
+
position: "fixed",
|
|
5886
|
+
userSelect: "none",
|
|
5887
|
+
zIndex: 100
|
|
5888
|
+
}, { target: n });
|
|
5889
|
+
let r = window.document.createElement("span");
|
|
5890
|
+
return tt({
|
|
5891
|
+
background: "inherit",
|
|
5892
|
+
position: "absolute"
|
|
5893
|
+
}, { target: r }), n.appendChild(r), {
|
|
5894
|
+
arrow: r,
|
|
5895
|
+
dialog: n
|
|
5896
|
+
};
|
|
5858
5897
|
}
|
|
5859
|
-
function
|
|
5860
|
-
let n = K.fromViewport(), r =
|
|
5861
|
-
return
|
|
5898
|
+
function it(e, t) {
|
|
5899
|
+
let n = K.fromViewport(), r = e.left - n.left < t, i = n.right - e.right < t, a = e.top - n.top < t, o = n.bottom - e.bottom < t;
|
|
5900
|
+
return r && a ? "br" : r && o ? "tr" : i && a ? "bl" : i && o ? "tl" : r ? "cr" : i ? "cl" : "tc";
|
|
5862
5901
|
}
|
|
5863
|
-
function
|
|
5864
|
-
let
|
|
5902
|
+
function at(e, t, n, r, i) {
|
|
5903
|
+
let a = t.width, o = i.width > a, s = i.left + i.width / 2, c = i.top + i.height / 2, l = { width: `${a}px` };
|
|
5865
5904
|
switch (e) {
|
|
5866
5905
|
case "bc": return {
|
|
5867
|
-
|
|
5868
|
-
|
|
5906
|
+
...l,
|
|
5907
|
+
left: `${s}px`,
|
|
5908
|
+
top: `${i.bottom + n.height + r}px`,
|
|
5869
5909
|
transform: "translateX(-50%)"
|
|
5870
5910
|
};
|
|
5871
5911
|
case "bl": return {
|
|
5872
|
-
|
|
5873
|
-
|
|
5874
|
-
top:
|
|
5875
|
-
transform:
|
|
5912
|
+
...l,
|
|
5913
|
+
left: o ? `${s}px` : `${i.right}px`,
|
|
5914
|
+
top: `${i.bottom + n.height + r}px`,
|
|
5915
|
+
transform: o ? "translateX(-50%)" : "translateX(-100%)"
|
|
5876
5916
|
};
|
|
5877
5917
|
case "br": return {
|
|
5878
|
-
|
|
5879
|
-
|
|
5880
|
-
|
|
5918
|
+
...l,
|
|
5919
|
+
left: o ? `${s}px` : `${i.left}px`,
|
|
5920
|
+
top: `${i.bottom + n.height + r}px`,
|
|
5921
|
+
transform: o ? "translateX(-50%)" : ""
|
|
5881
5922
|
};
|
|
5882
5923
|
case "cl": return {
|
|
5883
|
-
|
|
5884
|
-
|
|
5885
|
-
|
|
5924
|
+
...l,
|
|
5925
|
+
left: `${i.left - n.height - r}px`,
|
|
5926
|
+
top: `${c}px`,
|
|
5927
|
+
transform: "translate(-100%, -50%)"
|
|
5886
5928
|
};
|
|
5887
5929
|
case "cr": return {
|
|
5888
|
-
|
|
5889
|
-
|
|
5890
|
-
|
|
5930
|
+
...l,
|
|
5931
|
+
left: `${i.right + n.height + r}px`,
|
|
5932
|
+
top: `${c}px`,
|
|
5933
|
+
transform: "translateY(-50%)"
|
|
5891
5934
|
};
|
|
5892
5935
|
case "tc": return {
|
|
5893
|
-
|
|
5894
|
-
left:
|
|
5895
|
-
|
|
5936
|
+
...l,
|
|
5937
|
+
left: `${s}px`,
|
|
5938
|
+
top: `${i.top - n.height - r}px`,
|
|
5939
|
+
transform: "translate(-50%, -100%)"
|
|
5896
5940
|
};
|
|
5897
5941
|
case "tl": return {
|
|
5898
|
-
|
|
5899
|
-
left:
|
|
5900
|
-
|
|
5901
|
-
transform:
|
|
5942
|
+
...l,
|
|
5943
|
+
left: o ? `${s}px` : `${i.right}px`,
|
|
5944
|
+
top: `${i.top - n.height - r}px`,
|
|
5945
|
+
transform: o ? "translate(-50%, -100%)" : "translate(-100%, -100%)"
|
|
5902
5946
|
};
|
|
5903
5947
|
case "tr": return {
|
|
5904
|
-
|
|
5905
|
-
left:
|
|
5906
|
-
|
|
5948
|
+
...l,
|
|
5949
|
+
left: o ? `${s}px` : `${i.left}px`,
|
|
5950
|
+
top: `${i.top - n.height - r}px`,
|
|
5951
|
+
transform: o ? "translate(-50%, -100%)" : "translateY(-100%)"
|
|
5907
5952
|
};
|
|
5908
5953
|
default: return console.error(`[etudes::WithTooltip] Invalid alignment: ${e}`), {};
|
|
5909
5954
|
}
|
|
5910
5955
|
}
|
|
5911
|
-
function
|
|
5912
|
-
let a = i >
|
|
5956
|
+
function ot(e, t, n, r) {
|
|
5957
|
+
let i = r.width, a = i > t.width, o = {
|
|
5958
|
+
bottom: "auto",
|
|
5959
|
+
height: `${n.height}px`,
|
|
5960
|
+
left: "auto",
|
|
5961
|
+
right: "auto",
|
|
5962
|
+
top: "auto",
|
|
5963
|
+
width: `${n.width}px`
|
|
5964
|
+
};
|
|
5913
5965
|
switch (e) {
|
|
5914
5966
|
case "bc": return {
|
|
5967
|
+
...o,
|
|
5915
5968
|
clipPath: "polygon(50% 0,100% 100%,0 100%)",
|
|
5916
|
-
height: `${t.height}px`,
|
|
5917
5969
|
left: "50%",
|
|
5918
5970
|
top: "0",
|
|
5919
|
-
transform: "translate(-50%, -100%)"
|
|
5920
|
-
width: `${t.width}px`
|
|
5971
|
+
transform: "translate(-50%, -100%)"
|
|
5921
5972
|
};
|
|
5922
5973
|
case "bl": return {
|
|
5974
|
+
...o,
|
|
5923
5975
|
clipPath: "polygon(50% 0,100% 100%,0 100%)",
|
|
5924
|
-
height: `${t.height}px`,
|
|
5925
5976
|
left: a ? "50%" : "",
|
|
5926
|
-
right: a ? "" : `${i -
|
|
5977
|
+
right: a ? "" : `${i - n.width / 2 - i / 2}px`,
|
|
5927
5978
|
top: "0",
|
|
5928
|
-
transform: `translate(${a ? "-50%" : "0"}, -100%)
|
|
5929
|
-
width: `${t.width}px`
|
|
5979
|
+
transform: `translate(${a ? "-50%" : "0"}, -100%)`
|
|
5930
5980
|
};
|
|
5931
5981
|
case "br": return {
|
|
5982
|
+
...o,
|
|
5932
5983
|
clipPath: "polygon(50% 0,100% 100%,0 100%)",
|
|
5933
|
-
|
|
5934
|
-
left: a ? "50%" : `${i - t.width / 2 - i / 2}px`,
|
|
5984
|
+
left: a ? "50%" : `${i - n.width / 2 - i / 2}px`,
|
|
5935
5985
|
top: "0",
|
|
5936
|
-
transform: `translate(${a ? "-50%" : "0"}, -100%)
|
|
5937
|
-
width: `${t.width}px`
|
|
5986
|
+
transform: `translate(${a ? "-50%" : "0"}, -100%)`
|
|
5938
5987
|
};
|
|
5939
5988
|
case "cl": return {
|
|
5989
|
+
...o,
|
|
5940
5990
|
clipPath: "polygon(0 0,100% 50%,0 100%)",
|
|
5941
|
-
height: `${t.width}px`,
|
|
5942
5991
|
right: "0",
|
|
5943
5992
|
top: "50%",
|
|
5944
|
-
transform: "translate(100%, -50%)"
|
|
5945
|
-
width: `${t.height}px`
|
|
5993
|
+
transform: "translate(100%, -50%)"
|
|
5946
5994
|
};
|
|
5947
5995
|
case "cr": return {
|
|
5996
|
+
...o,
|
|
5948
5997
|
clipPath: "polygon(100% 0,0 50%,100% 100%)",
|
|
5949
|
-
height: `${t.width}px`,
|
|
5950
5998
|
left: "0",
|
|
5951
5999
|
top: "50%",
|
|
5952
|
-
transform: "translate(-100%, -50%)"
|
|
5953
|
-
width: `${t.height}px`
|
|
6000
|
+
transform: "translate(-100%, -50%)"
|
|
5954
6001
|
};
|
|
5955
6002
|
case "tc": return {
|
|
6003
|
+
...o,
|
|
5956
6004
|
bottom: 0,
|
|
5957
|
-
clipPath: "polygon(50% 100%,100% 0,0 0)",
|
|
5958
|
-
height: `${t.height}px`,
|
|
6005
|
+
clipPath: "polygon(50% 100%, 100% 0, 0 0)",
|
|
5959
6006
|
left: "50%",
|
|
5960
|
-
transform: "translate(-50%, 100%)"
|
|
5961
|
-
width: `${t.width}px`
|
|
6007
|
+
transform: "translate(-50%, 100%)"
|
|
5962
6008
|
};
|
|
5963
6009
|
case "tl": return {
|
|
6010
|
+
...o,
|
|
5964
6011
|
bottom: 0,
|
|
5965
|
-
clipPath: "polygon(50% 100%,100% 0,0 0)",
|
|
5966
|
-
height: `${t.height}px`,
|
|
6012
|
+
clipPath: "polygon(50% 100%, 100% 0, 0 0)",
|
|
5967
6013
|
left: a ? "50%" : "",
|
|
5968
|
-
right: a ? "" : `${i -
|
|
5969
|
-
transform: `translate(${a ? "-50%" : "0"}, 100%)
|
|
5970
|
-
width: `${t.width}px`
|
|
6014
|
+
right: a ? "" : `${i - n.width / 2 - i / 2}px`,
|
|
6015
|
+
transform: `translate(${a ? "-50%" : "0"}, 100%)`
|
|
5971
6016
|
};
|
|
5972
6017
|
case "tr": return {
|
|
6018
|
+
...o,
|
|
5973
6019
|
bottom: 0,
|
|
5974
|
-
clipPath: "polygon(50% 100%,100% 0,0 0)",
|
|
5975
|
-
|
|
5976
|
-
|
|
5977
|
-
transform: `translate(${a ? "-50%" : "0"}, 100%)`,
|
|
5978
|
-
width: `${t.width}px`
|
|
6020
|
+
clipPath: "polygon(50% 100%, 100% 0, 0 0)",
|
|
6021
|
+
left: a ? "50%" : `${i - n.width / 2 - i / 2}px`,
|
|
6022
|
+
transform: `translate(${a ? "-50%" : "0"}, 100%)`
|
|
5979
6023
|
};
|
|
5980
6024
|
default: return console.error(`[etudes::WithTooltip] Invalid alignment: ${e}`), {};
|
|
5981
6025
|
}
|
|
5982
6026
|
}
|
|
5983
|
-
|
|
5984
|
-
return j({
|
|
5985
|
-
arrow: {
|
|
5986
|
-
background: "inherit",
|
|
5987
|
-
position: "absolute",
|
|
5988
|
-
...it({
|
|
5989
|
-
alignment: e,
|
|
5990
|
-
arrowSize: t,
|
|
5991
|
-
fullDialogWidth: n,
|
|
5992
|
-
gap: r,
|
|
5993
|
-
maxDialogWidth: i,
|
|
5994
|
-
targetWidth: a
|
|
5995
|
-
})
|
|
5996
|
-
},
|
|
5997
|
-
dialog: {
|
|
5998
|
-
boxSizing: "border-box",
|
|
5999
|
-
height: "auto",
|
|
6000
|
-
margin: "0",
|
|
6001
|
-
opacity: "0",
|
|
6002
|
-
pointerEvents: "none",
|
|
6003
|
-
position: "absolute",
|
|
6004
|
-
userSelect: "none",
|
|
6005
|
-
whiteSpace: n > i ? "normal" : "pre",
|
|
6006
|
-
width: n > i ? `${i}px` : "",
|
|
6007
|
-
...rt({
|
|
6008
|
-
alignment: e,
|
|
6009
|
-
arrowSize: t,
|
|
6010
|
-
fullDialogWidth: n,
|
|
6011
|
-
gap: r,
|
|
6012
|
-
maxDialogWidth: i,
|
|
6013
|
-
targetWidth: a
|
|
6014
|
-
})
|
|
6015
|
-
}
|
|
6016
|
-
});
|
|
6017
|
-
}
|
|
6018
|
-
process.env.NODE_ENV === "development" && (et.displayName = "WithTooltip");
|
|
6027
|
+
process.env.NODE_ENV === "development" && (nt.displayName = "WithTooltip");
|
|
6019
6028
|
//#endregion
|
|
6020
6029
|
//#region src/hooks/useClassName.ts
|
|
6021
|
-
function
|
|
6030
|
+
function st(e, { target: t, isEnabled: n = !0 } = {}) {
|
|
6022
6031
|
l(() => {
|
|
6023
6032
|
if (!n) return;
|
|
6024
6033
|
let r = t ?? window.document.documentElement, i = r.classList.contains(e);
|
|
@@ -6033,7 +6042,7 @@ function ot(e, { target: t, isEnabled: n = !0 } = {}) {
|
|
|
6033
6042
|
}
|
|
6034
6043
|
//#endregion
|
|
6035
6044
|
//#region src/hooks/useClickOutside.ts
|
|
6036
|
-
function
|
|
6045
|
+
function ct(e, t, { isEnabled: n = !0 } = {}) {
|
|
6037
6046
|
let r = J(t), i = J([].concat(e));
|
|
6038
6047
|
c(() => {
|
|
6039
6048
|
if (!n) return;
|
|
@@ -6049,7 +6058,7 @@ function st(e, t, { isEnabled: n = !0 } = {}) {
|
|
|
6049
6058
|
}
|
|
6050
6059
|
//#endregion
|
|
6051
6060
|
//#region src/hooks/useCopyBlobToClipboard.ts
|
|
6052
|
-
function
|
|
6061
|
+
function lt() {
|
|
6053
6062
|
return s(async (e) => {
|
|
6054
6063
|
let t = e.type, n = new ClipboardItem({ [t]: e });
|
|
6055
6064
|
try {
|
|
@@ -6061,7 +6070,7 @@ function ct() {
|
|
|
6061
6070
|
}
|
|
6062
6071
|
//#endregion
|
|
6063
6072
|
//#region src/hooks/useDownloadBlob.ts
|
|
6064
|
-
function
|
|
6073
|
+
function ut() {
|
|
6065
6074
|
return s((e, t) => {
|
|
6066
6075
|
let n = URL.createObjectURL(e), r = document.createElement("a");
|
|
6067
6076
|
r.href = n, r.download = t, document.body.appendChild(r), r.click(), document.body.removeChild(r), URL.revokeObjectURL(n);
|
|
@@ -6069,17 +6078,17 @@ function lt() {
|
|
|
6069
6078
|
}
|
|
6070
6079
|
//#endregion
|
|
6071
6080
|
//#region src/utils/getDPR.ts
|
|
6072
|
-
function
|
|
6081
|
+
function dt() {
|
|
6073
6082
|
return typeof window > "u" ? 1 : window.devicePixelRatio || 1;
|
|
6074
6083
|
}
|
|
6075
6084
|
//#endregion
|
|
6076
6085
|
//#region src/hooks/useDPR.ts
|
|
6077
|
-
function
|
|
6078
|
-
return u(() =>
|
|
6086
|
+
function ft() {
|
|
6087
|
+
return u(() => dt(), []);
|
|
6079
6088
|
}
|
|
6080
6089
|
//#endregion
|
|
6081
6090
|
//#region src/hooks/useDrag.ts
|
|
6082
|
-
function
|
|
6091
|
+
function pt(e, { isEnabled: t = !0, shouldUpdateCursor: n = !0, onDragEnd: r, onDragMove: i, onDragStart: a }) {
|
|
6083
6092
|
let o = d(void 0), c = d(void 0), u = J(a), f = J(i), p = J(r), m = s((e) => {
|
|
6084
6093
|
if (!o.current) return;
|
|
6085
6094
|
let t = U.make(e.clientX, e.clientY), n = U.subtract(t, c.current ?? o.current);
|
|
@@ -6131,7 +6140,7 @@ function ft(e, { isEnabled: t = !0, shouldUpdateCursor: n = !0, onDragEnd: r, on
|
|
|
6131
6140
|
}
|
|
6132
6141
|
//#endregion
|
|
6133
6142
|
//#region src/hooks/useDropzone.ts
|
|
6134
|
-
function
|
|
6143
|
+
function mt(e) {
|
|
6135
6144
|
let t = J(e), [n, r] = f(!1), i = s((e) => {
|
|
6136
6145
|
e.preventDefault(), e.stopPropagation(), r(!0);
|
|
6137
6146
|
}, []);
|
|
@@ -6150,7 +6159,7 @@ function pt(e) {
|
|
|
6150
6159
|
}
|
|
6151
6160
|
//#endregion
|
|
6152
6161
|
//#region src/hooks/useInterval.ts
|
|
6153
|
-
function
|
|
6162
|
+
function ht(e, { shouldAutoStart: t = !0, shouldInvokeInitially: n = !1, onInterval: r }, i = []) {
|
|
6154
6163
|
let a = d(void 0), o = J(r), l = s(() => {
|
|
6155
6164
|
clearInterval(a.current), a.current = void 0;
|
|
6156
6165
|
}, []), u = s(() => {
|
|
@@ -6175,7 +6184,7 @@ function mt(e, { shouldAutoStart: t = !0, shouldInvokeInitially: n = !1, onInter
|
|
|
6175
6184
|
}
|
|
6176
6185
|
//#endregion
|
|
6177
6186
|
//#region src/hooks/useIsMounted.ts
|
|
6178
|
-
function
|
|
6187
|
+
function gt() {
|
|
6179
6188
|
let [e, t] = f(!1);
|
|
6180
6189
|
return c(() => (t(!0), () => {
|
|
6181
6190
|
t(!1);
|
|
@@ -6183,17 +6192,17 @@ function ht() {
|
|
|
6183
6192
|
}
|
|
6184
6193
|
//#endregion
|
|
6185
6194
|
//#region src/utils/isTouchDevice.ts
|
|
6186
|
-
function
|
|
6195
|
+
function _t() {
|
|
6187
6196
|
return typeof window > "u" ? !1 : !!(window.navigator !== void 0 && (window.navigator.maxTouchPoints > 0 || "msMaxTouchPoints" in window.navigator && window.navigator.msMaxTouchPoints > 0) || window.matchMedia("(pointer: coarse)").matches || window.matchMedia("(hover: none)").matches || "ontouchstart" in window || "ontouchstart" in window.document.documentElement);
|
|
6188
6197
|
}
|
|
6189
6198
|
//#endregion
|
|
6190
6199
|
//#region src/hooks/useIsTouchDevice.ts
|
|
6191
|
-
function
|
|
6192
|
-
return u(() =>
|
|
6200
|
+
function vt() {
|
|
6201
|
+
return u(() => _t(), []);
|
|
6193
6202
|
}
|
|
6194
6203
|
//#endregion
|
|
6195
6204
|
//#region src/hooks/useKeyboardShortcut.ts
|
|
6196
|
-
function
|
|
6205
|
+
function yt(e, t, { capture: n = !1, preventsDefault: r = !0, stopsPropagation: i = !0, target: a, isEnabled: o = !0 } = {}) {
|
|
6197
6206
|
let s = J(t), l = Array.isArray(e) ? e : [e], d = u(() => l.map((e) => e.toLowerCase()).sort(), [l.join(",")]);
|
|
6198
6207
|
c(() => {
|
|
6199
6208
|
if (!o || d.length === 0) return;
|
|
@@ -6222,46 +6231,46 @@ function vt(e, t, { capture: n = !1, preventsDefault: r = !0, stopsPropagation:
|
|
|
6222
6231
|
}
|
|
6223
6232
|
//#endregion
|
|
6224
6233
|
//#region src/utils/createLocalCache.ts
|
|
6225
|
-
var
|
|
6226
|
-
function
|
|
6234
|
+
var bt = typeof window < "u" ? window.localStorage : void 0;
|
|
6235
|
+
function xt({ defaultTTL: e = 300 } = {}) {
|
|
6227
6236
|
return {
|
|
6228
|
-
get:
|
|
6229
|
-
invalidate:
|
|
6230
|
-
set: (t, n, r = e) =>
|
|
6237
|
+
get: wt,
|
|
6238
|
+
invalidate: St,
|
|
6239
|
+
set: (t, n, r = e) => Tt(t, n, r)
|
|
6231
6240
|
};
|
|
6232
6241
|
}
|
|
6233
|
-
function xt(e) {
|
|
6234
|
-
yt?.removeItem(e);
|
|
6235
|
-
}
|
|
6236
6242
|
function St(e) {
|
|
6243
|
+
bt?.removeItem(e);
|
|
6244
|
+
}
|
|
6245
|
+
function Ct(e) {
|
|
6237
6246
|
let { timestamp: t, ttl: n } = e;
|
|
6238
6247
|
return (Date.now() - t) / 1e3 >= n;
|
|
6239
6248
|
}
|
|
6240
|
-
function
|
|
6241
|
-
let t =
|
|
6249
|
+
function wt(e) {
|
|
6250
|
+
let t = bt?.getItem(e);
|
|
6242
6251
|
if (!t) return;
|
|
6243
6252
|
let n = JSON.parse(t);
|
|
6244
|
-
if (n) if (
|
|
6245
|
-
|
|
6253
|
+
if (n) if (Ct(n)) {
|
|
6254
|
+
St(e);
|
|
6246
6255
|
return;
|
|
6247
6256
|
} else return n.value;
|
|
6248
6257
|
}
|
|
6249
|
-
function
|
|
6258
|
+
function Tt(e, t, n) {
|
|
6250
6259
|
let r = {
|
|
6251
6260
|
timestamp: Date.now(),
|
|
6252
6261
|
ttl: n,
|
|
6253
6262
|
value: e
|
|
6254
6263
|
};
|
|
6255
|
-
return
|
|
6264
|
+
return bt?.setItem(t, JSON.stringify(r)), e;
|
|
6256
6265
|
}
|
|
6257
6266
|
//#endregion
|
|
6258
6267
|
//#region src/hooks/useLocalCache.ts
|
|
6259
|
-
function
|
|
6260
|
-
return u(() =>
|
|
6268
|
+
function Et(e) {
|
|
6269
|
+
return u(() => xt({ defaultTTL: e }), [e]);
|
|
6261
6270
|
}
|
|
6262
6271
|
//#endregion
|
|
6263
6272
|
//#region src/hooks/useMouseEnter.ts
|
|
6264
|
-
function
|
|
6273
|
+
function Dt(e, t, { isEnabled: n = !0 } = {}) {
|
|
6265
6274
|
let r = J(t);
|
|
6266
6275
|
l(() => {
|
|
6267
6276
|
if (!n) return;
|
|
@@ -6276,7 +6285,7 @@ function Et(e, t, { isEnabled: n = !0 } = {}) {
|
|
|
6276
6285
|
}
|
|
6277
6286
|
//#endregion
|
|
6278
6287
|
//#region src/hooks/useMouseLeave.ts
|
|
6279
|
-
function
|
|
6288
|
+
function Ot(e, t, { isEnabled: n = !0 } = {}) {
|
|
6280
6289
|
let r = J(t);
|
|
6281
6290
|
l(() => {
|
|
6282
6291
|
if (!n) return;
|
|
@@ -6291,7 +6300,7 @@ function Dt(e, t, { isEnabled: n = !0 } = {}) {
|
|
|
6291
6300
|
}
|
|
6292
6301
|
//#endregion
|
|
6293
6302
|
//#region src/hooks/useOS.ts
|
|
6294
|
-
function
|
|
6303
|
+
function kt() {
|
|
6295
6304
|
let e = navigator.userAgent || navigator.vendor || window.opera;
|
|
6296
6305
|
return u(() => {
|
|
6297
6306
|
switch (!0) {
|
|
@@ -6306,7 +6315,7 @@ function Ot() {
|
|
|
6306
6315
|
}
|
|
6307
6316
|
//#endregion
|
|
6308
6317
|
//#region src/hooks/usePrevious.ts
|
|
6309
|
-
function
|
|
6318
|
+
function At(e) {
|
|
6310
6319
|
let t = d(void 0);
|
|
6311
6320
|
return c(() => {
|
|
6312
6321
|
t.current = e;
|
|
@@ -6314,11 +6323,11 @@ function kt(e) {
|
|
|
6314
6323
|
}
|
|
6315
6324
|
//#endregion
|
|
6316
6325
|
//#region src/hooks/useScrollPosition.ts
|
|
6317
|
-
function
|
|
6326
|
+
function jt(...e) {
|
|
6318
6327
|
let t = typeof e[0] == "function" ? void 0 : e[0], n = typeof e[0] == "function" ? e[0] : e[1], r = typeof e[0] == "function" ? e[1] ?? [] : e[2] ?? [], i = J(n), a = d(void 0), o = d(!1);
|
|
6319
6328
|
l(() => {
|
|
6320
|
-
let e =
|
|
6321
|
-
let t = e ?
|
|
6329
|
+
let e = Mt(t), n = () => {
|
|
6330
|
+
let t = e ? Pt(e) : Nt();
|
|
6322
6331
|
t && (i.current(t, a.current), a.current = t);
|
|
6323
6332
|
}, r = () => {
|
|
6324
6333
|
o.current || typeof requestAnimationFrame == "function" && (o.current = !0, requestAnimationFrame(() => {
|
|
@@ -6330,10 +6339,10 @@ function At(...e) {
|
|
|
6330
6339
|
};
|
|
6331
6340
|
}, [...r]);
|
|
6332
6341
|
}
|
|
6333
|
-
function
|
|
6342
|
+
function Mt(e) {
|
|
6334
6343
|
if (e != null) return e instanceof HTMLElement ? e : e.current ?? void 0;
|
|
6335
6344
|
}
|
|
6336
|
-
function
|
|
6345
|
+
function Nt() {
|
|
6337
6346
|
let e = window.scrollX, t = window.scrollY, n = document.documentElement.scrollWidth - window.innerWidth, r = document.documentElement.scrollHeight - window.innerHeight;
|
|
6338
6347
|
return {
|
|
6339
6348
|
current: U.make(e, t),
|
|
@@ -6342,7 +6351,7 @@ function Mt() {
|
|
|
6342
6351
|
start: U.make(0, 0)
|
|
6343
6352
|
};
|
|
6344
6353
|
}
|
|
6345
|
-
function
|
|
6354
|
+
function Pt(e) {
|
|
6346
6355
|
let t = e.scrollLeft, n = e.scrollTop, r = e.scrollWidth - e.clientWidth, i = e.scrollHeight - e.clientHeight;
|
|
6347
6356
|
return {
|
|
6348
6357
|
current: U.make(t, n),
|
|
@@ -6353,46 +6362,46 @@ function Nt(e) {
|
|
|
6353
6362
|
}
|
|
6354
6363
|
//#endregion
|
|
6355
6364
|
//#region src/utils/createSessionCache.ts
|
|
6356
|
-
var
|
|
6357
|
-
function
|
|
6365
|
+
var Ft = typeof window < "u" ? window.sessionStorage : void 0;
|
|
6366
|
+
function It({ defaultTTL: e = 300 } = {}) {
|
|
6358
6367
|
return {
|
|
6359
|
-
get:
|
|
6360
|
-
invalidate:
|
|
6361
|
-
set: (t, n, r = e) =>
|
|
6368
|
+
get: zt,
|
|
6369
|
+
invalidate: Lt,
|
|
6370
|
+
set: (t, n, r = e) => Bt(t, n, r)
|
|
6362
6371
|
};
|
|
6363
6372
|
}
|
|
6364
|
-
function It(e) {
|
|
6365
|
-
Pt?.removeItem(e);
|
|
6366
|
-
}
|
|
6367
6373
|
function Lt(e) {
|
|
6374
|
+
Ft?.removeItem(e);
|
|
6375
|
+
}
|
|
6376
|
+
function Rt(e) {
|
|
6368
6377
|
let { timestamp: t, ttl: n } = e;
|
|
6369
6378
|
return (Date.now() - t) / 1e3 >= n;
|
|
6370
6379
|
}
|
|
6371
|
-
function
|
|
6372
|
-
let t =
|
|
6380
|
+
function zt(e) {
|
|
6381
|
+
let t = Ft?.getItem(e);
|
|
6373
6382
|
if (!t) return;
|
|
6374
6383
|
let n = JSON.parse(t);
|
|
6375
|
-
if (n) if (
|
|
6376
|
-
|
|
6384
|
+
if (n) if (Rt(n)) {
|
|
6385
|
+
Lt(e);
|
|
6377
6386
|
return;
|
|
6378
6387
|
} else return n.value;
|
|
6379
6388
|
}
|
|
6380
|
-
function
|
|
6389
|
+
function Bt(e, t, n) {
|
|
6381
6390
|
let r = {
|
|
6382
6391
|
timestamp: Date.now(),
|
|
6383
6392
|
ttl: n,
|
|
6384
6393
|
value: e
|
|
6385
6394
|
};
|
|
6386
|
-
return
|
|
6395
|
+
return Ft?.setItem(t, JSON.stringify(r)), e;
|
|
6387
6396
|
}
|
|
6388
6397
|
//#endregion
|
|
6389
6398
|
//#region src/hooks/useSessionCache.ts
|
|
6390
|
-
function
|
|
6391
|
-
return u(() =>
|
|
6399
|
+
function Vt(e) {
|
|
6400
|
+
return u(() => It({ defaultTTL: e }), [e]);
|
|
6392
6401
|
}
|
|
6393
6402
|
//#endregion
|
|
6394
6403
|
//#region src/hooks/useSize.ts
|
|
6395
|
-
function
|
|
6404
|
+
function Ht(e) {
|
|
6396
6405
|
let [t, n] = f(G.zero);
|
|
6397
6406
|
return te(e, (e) => {
|
|
6398
6407
|
let t = K.from(e), r = K.size(t);
|
|
@@ -6401,29 +6410,29 @@ function Vt(e) {
|
|
|
6401
6410
|
}
|
|
6402
6411
|
//#endregion
|
|
6403
6412
|
//#region src/utils/getStyle.ts
|
|
6404
|
-
function
|
|
6413
|
+
function Ut(e, { computed: t, target: n }) {
|
|
6405
6414
|
if (typeof window > "u") return;
|
|
6406
6415
|
let r = n ?? window.document.documentElement;
|
|
6407
6416
|
return t ? window.getComputedStyle(r).getPropertyValue(e) || void 0 : r.style.getPropertyValue(e) || void 0;
|
|
6408
6417
|
}
|
|
6409
6418
|
//#endregion
|
|
6410
6419
|
//#region src/utils/setStyle.ts
|
|
6411
|
-
function
|
|
6420
|
+
function Wt(e, t, { target: n } = {}) {
|
|
6412
6421
|
if (typeof window > "u") return;
|
|
6413
6422
|
let r = n ?? window.document.documentElement;
|
|
6414
6423
|
t === void 0 ? r.style.removeProperty(e) : r.style.setProperty(e, t);
|
|
6415
6424
|
}
|
|
6416
6425
|
//#endregion
|
|
6417
6426
|
//#region src/hooks/useStyle.ts
|
|
6418
|
-
function
|
|
6427
|
+
function Gt(e, t, { target: n, isEnabled: r = !0 } = {}) {
|
|
6419
6428
|
l(() => {
|
|
6420
6429
|
if (!r) return;
|
|
6421
|
-
let i = n ?? window.document.documentElement, a =
|
|
6430
|
+
let i = n ?? window.document.documentElement, a = Ut(e, {
|
|
6422
6431
|
computed: !1,
|
|
6423
6432
|
target: i
|
|
6424
6433
|
});
|
|
6425
|
-
return
|
|
6426
|
-
|
|
6434
|
+
return Wt(e, t, { target: i }), () => {
|
|
6435
|
+
Wt(e, a, { target: i });
|
|
6427
6436
|
};
|
|
6428
6437
|
}, [
|
|
6429
6438
|
e,
|
|
@@ -6434,7 +6443,7 @@ function Wt(e, t, { target: n, isEnabled: r = !0 } = {}) {
|
|
|
6434
6443
|
}
|
|
6435
6444
|
//#endregion
|
|
6436
6445
|
//#region src/hooks/useSystemColorScheme.ts
|
|
6437
|
-
function
|
|
6446
|
+
function Kt(e = "light") {
|
|
6438
6447
|
let [t, n] = f(e);
|
|
6439
6448
|
return l(() => {
|
|
6440
6449
|
let e = window.matchMedia("(prefers-color-scheme: dark)");
|
|
@@ -6448,7 +6457,7 @@ function Gt(e = "light") {
|
|
|
6448
6457
|
}
|
|
6449
6458
|
//#endregion
|
|
6450
6459
|
//#region src/hooks/useTimeout.ts
|
|
6451
|
-
function
|
|
6460
|
+
function qt(e, { shouldAutoStart: t = !0, onTimeout: n }, r = []) {
|
|
6452
6461
|
let i = d(void 0), a = J(n), o = s(() => {
|
|
6453
6462
|
i.current !== void 0 && (clearTimeout(i.current), i.current = void 0);
|
|
6454
6463
|
}, []), l = s(() => {
|
|
@@ -6469,8 +6478,8 @@ function Kt(e, { shouldAutoStart: t = !0, onTimeout: n }, r = []) {
|
|
|
6469
6478
|
}
|
|
6470
6479
|
//#endregion
|
|
6471
6480
|
//#region src/primitives/Collection.tsx
|
|
6472
|
-
var
|
|
6473
|
-
let x =
|
|
6481
|
+
var Jt = /* @__PURE__ */ a(({ className: e, style: t, children: n, ItemComponent: r, itemLength: i, itemPadding: a = 0, items: o = [], layout: s = "list", numSegments: l = 1, orientation: u = "vertical", selection: d, selectionMode: f = "none", isSelectionTogglable: p = !1, onActivateAt: m, onCustomEvent: h, onDeselectAt: g, onSelectAt: _, onSelectionChange: v, ...y }, b) => {
|
|
6482
|
+
let x = Qt(d ?? [], o), S = en({
|
|
6474
6483
|
itemLength: i,
|
|
6475
6484
|
itemPadding: a,
|
|
6476
6485
|
layout: s,
|
|
@@ -6483,7 +6492,7 @@ var qt = /* @__PURE__ */ a(({ className: e, style: t, children: n, ItemComponent
|
|
|
6483
6492
|
let t;
|
|
6484
6493
|
switch (f) {
|
|
6485
6494
|
case "multiple":
|
|
6486
|
-
t = (t) =>
|
|
6495
|
+
t = (t) => $t([...t.filter((t) => t !== e), e]);
|
|
6487
6496
|
break;
|
|
6488
6497
|
case "single":
|
|
6489
6498
|
t = (t) => [e];
|
|
@@ -6515,7 +6524,7 @@ var qt = /* @__PURE__ */ a(({ className: e, style: t, children: n, ItemComponent
|
|
|
6515
6524
|
}
|
|
6516
6525
|
j(e, t);
|
|
6517
6526
|
}, [f]);
|
|
6518
|
-
let M = A(n, { item:
|
|
6527
|
+
let M = A(n, { item: Yt });
|
|
6519
6528
|
return /* @__PURE__ */ (0, D.jsx)("div", {
|
|
6520
6529
|
...y,
|
|
6521
6530
|
className: C(e),
|
|
@@ -6545,7 +6554,7 @@ var qt = /* @__PURE__ */ a(({ className: e, style: t, children: n, ItemComponent
|
|
|
6545
6554
|
className: C({ active: i }),
|
|
6546
6555
|
style: c,
|
|
6547
6556
|
"aria-selected": i,
|
|
6548
|
-
element: M.item ?? /* @__PURE__ */ (0, D.jsx)(
|
|
6557
|
+
element: M.item ?? /* @__PURE__ */ (0, D.jsx)(Yt, {}),
|
|
6549
6558
|
role: n,
|
|
6550
6559
|
selectionMode: f,
|
|
6551
6560
|
onActivateAt: m,
|
|
@@ -6555,23 +6564,23 @@ var qt = /* @__PURE__ */ a(({ className: e, style: t, children: n, ItemComponent
|
|
|
6555
6564
|
}
|
|
6556
6565
|
})
|
|
6557
6566
|
});
|
|
6558
|
-
}),
|
|
6567
|
+
}), Yt = ({ children: e, selectionMode: t, onActivateAt: n, ...r }) => n || t === "single" || t === "multiple" ? /* @__PURE__ */ (0, D.jsx)("button", {
|
|
6559
6568
|
...r,
|
|
6560
6569
|
children: e
|
|
6561
6570
|
}) : /* @__PURE__ */ (0, D.jsx)("div", {
|
|
6562
6571
|
...r,
|
|
6563
6572
|
children: e
|
|
6564
|
-
}),
|
|
6565
|
-
function
|
|
6573
|
+
}), Xt = /* @__PURE__ */ Object.assign(Jt, { Item: Yt });
|
|
6574
|
+
function Zt(e, t) {
|
|
6566
6575
|
return !!(isNaN(e) || e >= t.length || e < 0);
|
|
6567
6576
|
}
|
|
6568
|
-
function
|
|
6569
|
-
return
|
|
6577
|
+
function Qt(e, t) {
|
|
6578
|
+
return $t(e).filter((e) => !Zt(e, t));
|
|
6570
6579
|
}
|
|
6571
|
-
function
|
|
6580
|
+
function $t(e) {
|
|
6572
6581
|
return e.sort((e, t) => e - t);
|
|
6573
6582
|
}
|
|
6574
|
-
function
|
|
6583
|
+
function en({ itemLength: e = NaN, itemPadding: t = 0, layout: n = "collection", numSegments: r = 1, orientation: i = "vertical" }) {
|
|
6575
6584
|
return j({
|
|
6576
6585
|
item: {
|
|
6577
6586
|
counterIncrement: "item-counter",
|
|
@@ -6609,11 +6618,11 @@ function $t({ itemLength: e = NaN, itemPadding: t = 0, layout: n = "collection",
|
|
|
6609
6618
|
}
|
|
6610
6619
|
});
|
|
6611
6620
|
}
|
|
6612
|
-
process.env.NODE_ENV === "development" && (
|
|
6621
|
+
process.env.NODE_ENV === "development" && (Jt.displayName = "Collection", Yt.displayName = "Collection.Item");
|
|
6613
6622
|
//#endregion
|
|
6614
6623
|
//#region src/primitives/Accordion.tsx
|
|
6615
|
-
var
|
|
6616
|
-
let w =
|
|
6624
|
+
var tn = /* @__PURE__ */ a(({ style: e, children: t, expandedSectionIndices: n, HeaderComponent: r, ItemComponent: i, orientation: a = "vertical", sectionPadding: o = 0, sections: s, selection: c, selectionMode: l = "single", shouldAutoCollapse: u = !1, onActivateAt: f, onCollapseSectionAt: p, onDeselectAt: m, onExpandedSectionsChange: h, onExpandSectionAt: g, onHeaderCustomEvent: _, onItemCustomEvent: v, onSelectAt: y, onSelectionChange: b, ...x }, S) => {
|
|
6625
|
+
let w = dn(c ?? {}, s), T = un(n ?? [], s), E = pn({ orientation: a }), O = s.map(() => d(null)), k = O.map(Ht), j = (e, t) => (w[t]?.indexOf(e) ?? -1) >= 0, M = (e) => T.indexOf(e) >= 0, F = (e) => {
|
|
6617
6626
|
let t;
|
|
6618
6627
|
t = M(e) ? (t) => t.filter((t) => t !== e) : u ? (t) => [e] : (t) => [...t.filter((t) => t !== e), e], R(T, t(T));
|
|
6619
6628
|
}, I = (e, t) => {
|
|
@@ -6623,7 +6632,7 @@ var en = /* @__PURE__ */ a(({ style: e, children: t, expandedSectionIndices: n,
|
|
|
6623
6632
|
case "multiple":
|
|
6624
6633
|
n = (n) => ({
|
|
6625
6634
|
...n,
|
|
6626
|
-
[t]:
|
|
6635
|
+
[t]: fn([...(n[t] ?? []).filter((t) => t !== e), e])
|
|
6627
6636
|
});
|
|
6628
6637
|
break;
|
|
6629
6638
|
case "single":
|
|
@@ -6650,11 +6659,11 @@ var en = /* @__PURE__ */ a(({ style: e, children: t, expandedSectionIndices: n,
|
|
|
6650
6659
|
}
|
|
6651
6660
|
r.forEach((e) => m?.(e[0], e[1])), i.forEach((e) => y?.(e[0], e[1])), b?.(t);
|
|
6652
6661
|
}, B = A(t, {
|
|
6653
|
-
collapseIcon:
|
|
6654
|
-
expandIcon:
|
|
6655
|
-
header:
|
|
6656
|
-
item:
|
|
6657
|
-
section:
|
|
6662
|
+
collapseIcon: an,
|
|
6663
|
+
expandIcon: rn,
|
|
6664
|
+
header: nn,
|
|
6665
|
+
item: sn,
|
|
6666
|
+
section: on
|
|
6658
6667
|
});
|
|
6659
6668
|
return /* @__PURE__ */ (0, D.jsx)("div", {
|
|
6660
6669
|
ref: S,
|
|
@@ -6672,7 +6681,7 @@ var en = /* @__PURE__ */ a(({ style: e, children: t, expandedSectionIndices: n,
|
|
|
6672
6681
|
marginLeft: t === 0 ? "0px" : `${o}px`,
|
|
6673
6682
|
...S.width > 0 ? { width: `${T}px` } : { visibility: "hidden" }
|
|
6674
6683
|
}),
|
|
6675
|
-
element: B.section ?? /* @__PURE__ */ (0, D.jsx)(
|
|
6684
|
+
element: B.section ?? /* @__PURE__ */ (0, D.jsx)(on, {}),
|
|
6676
6685
|
children: [/* @__PURE__ */ (0, D.jsx)("div", {
|
|
6677
6686
|
ref: O[t],
|
|
6678
6687
|
style: P(E.headerContainer),
|
|
@@ -6696,7 +6705,7 @@ var en = /* @__PURE__ */ a(({ style: e, children: t, expandedSectionIndices: n,
|
|
|
6696
6705
|
}),
|
|
6697
6706
|
style: P(E.header),
|
|
6698
6707
|
"aria-expanded": !x,
|
|
6699
|
-
element: B.header ?? /* @__PURE__ */ (0, D.jsx)(
|
|
6708
|
+
element: B.header ?? /* @__PURE__ */ (0, D.jsx)(nn, {}),
|
|
6700
6709
|
role: "button",
|
|
6701
6710
|
onClick: () => F(t),
|
|
6702
6711
|
children: [/* @__PURE__ */ (0, D.jsx)("span", { dangerouslySetInnerHTML: { __html: e.label } }), B.expandIcon && /* @__PURE__ */ (0, D.jsx)(N, {
|
|
@@ -6721,7 +6730,7 @@ var en = /* @__PURE__ */ a(({ style: e, children: t, expandedSectionIndices: n,
|
|
|
6721
6730
|
width: `${b}px`
|
|
6722
6731
|
}),
|
|
6723
6732
|
role: "region",
|
|
6724
|
-
children: /* @__PURE__ */ (0, D.jsx)(
|
|
6733
|
+
children: /* @__PURE__ */ (0, D.jsx)(Xt, {
|
|
6725
6734
|
className: C({
|
|
6726
6735
|
collapsed: x,
|
|
6727
6736
|
expanded: !x
|
|
@@ -6741,54 +6750,54 @@ var en = /* @__PURE__ */ a(({ style: e, children: t, expandedSectionIndices: n,
|
|
|
6741
6750
|
onCustomEvent: (e, n, r) => v?.(e, t, n, r),
|
|
6742
6751
|
onDeselectAt: (e) => L(e, t),
|
|
6743
6752
|
onSelectAt: (e) => I(e, t),
|
|
6744
|
-
children: !i && (B.item ?? /* @__PURE__ */ (0, D.jsx)(
|
|
6753
|
+
children: !i && (B.item ?? /* @__PURE__ */ (0, D.jsx)(sn, {}))
|
|
6745
6754
|
})
|
|
6746
6755
|
})]
|
|
6747
6756
|
});
|
|
6748
6757
|
}
|
|
6749
6758
|
})
|
|
6750
6759
|
});
|
|
6751
|
-
}),
|
|
6760
|
+
}), nn = ({ children: e, ...t }) => /* @__PURE__ */ (0, D.jsx)("button", {
|
|
6752
6761
|
...t,
|
|
6753
6762
|
children: e
|
|
6754
|
-
}),
|
|
6763
|
+
}), rn = ({ children: e, ...t }) => /* @__PURE__ */ (0, D.jsx)("figure", {
|
|
6755
6764
|
...t,
|
|
6756
6765
|
children: e
|
|
6757
|
-
}),
|
|
6766
|
+
}), an = ({ children: e, ...t }) => /* @__PURE__ */ (0, D.jsx)("figure", {
|
|
6758
6767
|
...t,
|
|
6759
6768
|
children: e
|
|
6760
|
-
}),
|
|
6769
|
+
}), on = ({ children: e, ...t }) => /* @__PURE__ */ (0, D.jsx)("div", {
|
|
6761
6770
|
...t,
|
|
6762
6771
|
children: e
|
|
6763
|
-
}),
|
|
6764
|
-
Header:
|
|
6765
|
-
ExpandIcon:
|
|
6766
|
-
CollapseIcon:
|
|
6767
|
-
Section:
|
|
6768
|
-
Item:
|
|
6772
|
+
}), sn = Xt.Item, cn = /* @__PURE__ */ Object.assign(tn, {
|
|
6773
|
+
Header: nn,
|
|
6774
|
+
ExpandIcon: rn,
|
|
6775
|
+
CollapseIcon: an,
|
|
6776
|
+
Section: on,
|
|
6777
|
+
Item: sn
|
|
6769
6778
|
});
|
|
6770
|
-
function
|
|
6779
|
+
function X(e, t) {
|
|
6771
6780
|
return e >= t.length || e < 0;
|
|
6772
6781
|
}
|
|
6773
|
-
function
|
|
6774
|
-
return !!(
|
|
6775
|
-
}
|
|
6776
|
-
function ln(e, t) {
|
|
6777
|
-
return dn(e).filter((e) => !cn(e, t));
|
|
6782
|
+
function ln(e, t, n) {
|
|
6783
|
+
return !!(X(t, n) || e >= (n[t].items ?? []).length || e < 0);
|
|
6778
6784
|
}
|
|
6779
6785
|
function un(e, t) {
|
|
6786
|
+
return fn(e).filter((e) => !X(e, t));
|
|
6787
|
+
}
|
|
6788
|
+
function dn(e, t) {
|
|
6780
6789
|
let n = {};
|
|
6781
6790
|
for (let r in t) {
|
|
6782
6791
|
if (!Object.hasOwn(t, r)) continue;
|
|
6783
|
-
let i =
|
|
6784
|
-
n[Number(r)] =
|
|
6792
|
+
let i = fn([...e[r] ?? []]);
|
|
6793
|
+
n[Number(r)] = fn(i).filter((e) => !ln(e, Number(r), t));
|
|
6785
6794
|
}
|
|
6786
6795
|
return n;
|
|
6787
6796
|
}
|
|
6788
|
-
function
|
|
6797
|
+
function fn(e) {
|
|
6789
6798
|
return e.sort((e, t) => e - t);
|
|
6790
6799
|
}
|
|
6791
|
-
function
|
|
6800
|
+
function pn({ orientation: e = "vertical" }) {
|
|
6792
6801
|
return j({
|
|
6793
6802
|
collapseIcon: {
|
|
6794
6803
|
pointerEvents: "none",
|
|
@@ -6840,11 +6849,11 @@ function fn({ orientation: e = "vertical" }) {
|
|
|
6840
6849
|
}
|
|
6841
6850
|
});
|
|
6842
6851
|
}
|
|
6843
|
-
process.env.NODE_ENV === "development" && (
|
|
6852
|
+
process.env.NODE_ENV === "development" && (tn.displayName = "Accordion", nn.displayName = "Accordion.Header", rn.displayName = "Accordion.ExpandIcon", an.displayName = "Accordion.CollapseIcon", sn.displayName = "Accordion.Item");
|
|
6844
6853
|
//#endregion
|
|
6845
6854
|
//#region src/primitives/Carousel.tsx
|
|
6846
|
-
var
|
|
6847
|
-
let _ = d(void 0), v = d(null), y = d(void 0), b = d(void 0), x = d(void 0), S = 1e3, C = J(u), w = J(p), T = J(m), E = d(U.zero), O = d(!1), k = d(!1), A =
|
|
6855
|
+
var mn = /* @__PURE__ */ a(({ autoAdvanceInterval: e = 0, dragSpeed: t = 1, index: n = 0, ItemComponent: r, items: i = [], orientation: a = "horizontal", isDragEnabled: o = !0, shouldTrackExposure: c = !1, onAutoAdvancePause: u, onAutoAdvanceResume: p, onIndexChange: m, ...h }, g) => {
|
|
6856
|
+
let _ = d(void 0), v = d(null), y = d(void 0), b = d(void 0), x = d(void 0), S = 1e3, C = J(u), w = J(p), T = J(m), E = d(U.zero), O = d(!1), k = d(!1), A = vt(), [j, M] = f(gn(v, a)), [N, F] = f(!1), I = vn({
|
|
6848
6857
|
orientation: a,
|
|
6849
6858
|
scrollSnapEnabled: A || !N
|
|
6850
6859
|
}), L = e > 0, R = s(() => {
|
|
@@ -6854,9 +6863,9 @@ var pn = /* @__PURE__ */ a(({ autoAdvanceInterval: e = 0, dragSpeed: t = 1, inde
|
|
|
6854
6863
|
clearTimeout(x.current), x.current = void 0;
|
|
6855
6864
|
}, S);
|
|
6856
6865
|
}, [S, R]), B = s(() => {
|
|
6857
|
-
|
|
6866
|
+
hn(v, n, a), z();
|
|
6858
6867
|
}, [n, a]), V = s(() => {
|
|
6859
|
-
M(
|
|
6868
|
+
M(gn(v, a));
|
|
6860
6869
|
}, [a]), H = s((e) => {
|
|
6861
6870
|
A || (y.current = U.make(e.clientX, e.clientY), F(!0));
|
|
6862
6871
|
}, [A]), W = s((e) => {
|
|
@@ -6904,10 +6913,10 @@ var pn = /* @__PURE__ */ a(({ autoAdvanceInterval: e = 0, dragSpeed: t = 1, inde
|
|
|
6904
6913
|
c,
|
|
6905
6914
|
V
|
|
6906
6915
|
]);
|
|
6907
|
-
return
|
|
6916
|
+
return pt(v, {
|
|
6908
6917
|
isEnabled: !A && o && i.length > 1,
|
|
6909
6918
|
onDragMove: q
|
|
6910
|
-
}),
|
|
6919
|
+
}), ht(N || !L ? -1 : e, { onInterval: K }, [n]), l(() => {
|
|
6911
6920
|
!L || A || (N ? C.current?.() : w.current?.());
|
|
6912
6921
|
}, [
|
|
6913
6922
|
A,
|
|
@@ -6953,7 +6962,7 @@ var pn = /* @__PURE__ */ a(({ autoAdvanceInterval: e = 0, dragSpeed: t = 1, inde
|
|
|
6953
6962
|
})
|
|
6954
6963
|
});
|
|
6955
6964
|
});
|
|
6956
|
-
function
|
|
6965
|
+
function hn(e, t, n) {
|
|
6957
6966
|
let r = e?.current;
|
|
6958
6967
|
if (!r) return;
|
|
6959
6968
|
let i = n === "horizontal" ? 0 : r.clientHeight * t, a = n === "horizontal" ? r.clientWidth * t : 0;
|
|
@@ -6963,14 +6972,14 @@ function mn(e, t, n) {
|
|
|
6963
6972
|
top: i
|
|
6964
6973
|
});
|
|
6965
6974
|
}
|
|
6966
|
-
function
|
|
6975
|
+
function gn(e, t) {
|
|
6967
6976
|
let n = e?.current;
|
|
6968
6977
|
if (!n) return;
|
|
6969
6978
|
let r = [];
|
|
6970
|
-
for (let i = 0; i < n.children.length; i++) r.push(
|
|
6979
|
+
for (let i = 0; i < n.children.length; i++) r.push(_n(i, e, t));
|
|
6971
6980
|
return r;
|
|
6972
6981
|
}
|
|
6973
|
-
function
|
|
6982
|
+
function _n(e, t, n) {
|
|
6974
6983
|
let r = t?.current, i = r?.children[e];
|
|
6975
6984
|
if (!i) return 0;
|
|
6976
6985
|
let a = K.intersecting(i, r);
|
|
@@ -6980,7 +6989,7 @@ function gn(e, t, n) {
|
|
|
6980
6989
|
default: return console.error(`[etudes::Carousel] Unsupported orientation: ${n}`), NaN;
|
|
6981
6990
|
}
|
|
6982
6991
|
}
|
|
6983
|
-
function
|
|
6992
|
+
function vn({ orientation: e = "horizontal", scrollSnapEnabled: t = !1 }) {
|
|
6984
6993
|
return j({
|
|
6985
6994
|
item: {
|
|
6986
6995
|
height: "100%",
|
|
@@ -7016,15 +7025,15 @@ function _n({ orientation: e = "horizontal", scrollSnapEnabled: t = !1 }) {
|
|
|
7016
7025
|
}
|
|
7017
7026
|
});
|
|
7018
7027
|
}
|
|
7019
|
-
process.env.NODE_ENV === "development" && (
|
|
7028
|
+
process.env.NODE_ENV === "development" && (mn.displayName = "Carousel");
|
|
7020
7029
|
//#endregion
|
|
7021
7030
|
//#region src/primitives/CodeInput.tsx
|
|
7022
|
-
var
|
|
7023
|
-
let h =
|
|
7031
|
+
var yn = /* @__PURE__ */ a(({ style: e, autoComplete: t = "one-time-code", autoFocus: n = !1, children: r, inputMode: i = "numeric", placeholder: a, size: o, value: s, isDisabled: l = !1, isRequired: u = !0, onChange: f, ...p }, m) => {
|
|
7032
|
+
let h = Cn(s, o), g = d([]), _ = Sn(), v = A(r, { field: bn }), y = (e) => {
|
|
7024
7033
|
e < 0 ? g.current[0]?.focus() : e >= o ? g.current[o - 1]?.focus() : g.current[e]?.focus();
|
|
7025
7034
|
}, b = (e) => (t) => {
|
|
7026
|
-
let n = h[e], r =
|
|
7027
|
-
f(
|
|
7035
|
+
let n = h[e], r = Tn(t.target.value, n);
|
|
7036
|
+
f(wn(h.slice(), r.split("").slice(0, o), e)), y(Math.min(e + r.length, o - 1));
|
|
7028
7037
|
}, x = (e) => (t) => {
|
|
7029
7038
|
switch (t.key) {
|
|
7030
7039
|
case "ArrowLeft":
|
|
@@ -7044,7 +7053,7 @@ var vn = /* @__PURE__ */ a(({ style: e, autoComplete: t = "one-time-code", autoF
|
|
|
7044
7053
|
}, S = (e) => (t) => {
|
|
7045
7054
|
t.preventDefault();
|
|
7046
7055
|
let n = t.clipboardData.getData("text").trim();
|
|
7047
|
-
f(
|
|
7056
|
+
f(wn(h.slice(), n.split("").slice(0, o), e)), y(Math.min(e + n.length, o - 1));
|
|
7048
7057
|
};
|
|
7049
7058
|
return c(() => {
|
|
7050
7059
|
if (!n) return;
|
|
@@ -7063,7 +7072,7 @@ var vn = /* @__PURE__ */ a(({ style: e, autoComplete: t = "one-time-code", autoF
|
|
|
7063
7072
|
"aria-required": u,
|
|
7064
7073
|
autoComplete: t,
|
|
7065
7074
|
disabled: l,
|
|
7066
|
-
element: v.field ?? /* @__PURE__ */ (0, D.jsx)(
|
|
7075
|
+
element: v.field ?? /* @__PURE__ */ (0, D.jsx)(bn, {}),
|
|
7067
7076
|
inputMode: i,
|
|
7068
7077
|
placeholder: a,
|
|
7069
7078
|
required: u,
|
|
@@ -7074,13 +7083,13 @@ var vn = /* @__PURE__ */ a(({ style: e, autoComplete: t = "one-time-code", autoF
|
|
|
7074
7083
|
})
|
|
7075
7084
|
})
|
|
7076
7085
|
});
|
|
7077
|
-
}),
|
|
7086
|
+
}), bn = ({ ...e }) => /* @__PURE__ */ (0, D.jsx)("input", {
|
|
7078
7087
|
...e,
|
|
7079
7088
|
autoCapitalize: "off",
|
|
7080
7089
|
autoCorrect: "off",
|
|
7081
7090
|
type: "text"
|
|
7082
|
-
}),
|
|
7083
|
-
function
|
|
7091
|
+
}), xn = /* @__PURE__ */ Object.assign(yn, { Field: bn });
|
|
7092
|
+
function Sn() {
|
|
7084
7093
|
return j({
|
|
7085
7094
|
field: {
|
|
7086
7095
|
caretColor: "transparent",
|
|
@@ -7094,24 +7103,24 @@ function xn() {
|
|
|
7094
7103
|
}
|
|
7095
7104
|
});
|
|
7096
7105
|
}
|
|
7097
|
-
function
|
|
7106
|
+
function Cn(e, t) {
|
|
7098
7107
|
let n = e.slice(0, t);
|
|
7099
7108
|
for (; n.length < t;) n.push("");
|
|
7100
7109
|
return n;
|
|
7101
7110
|
}
|
|
7102
|
-
function
|
|
7111
|
+
function wn(e, t, n = 0) {
|
|
7103
7112
|
let r = n, i = 0;
|
|
7104
7113
|
for (; i < t.length && r < e.length;) e[r] = t[i], r++, i++;
|
|
7105
7114
|
for (; i < t.length;) e.shift(), e.push(t[i]), i++;
|
|
7106
7115
|
return e;
|
|
7107
7116
|
}
|
|
7108
|
-
function
|
|
7117
|
+
function Tn(e, t) {
|
|
7109
7118
|
return t === "" ? e : e.startsWith(t) ? e.slice(t.length) : e.endsWith(t) ? e.slice(0, -t.length) : e;
|
|
7110
7119
|
}
|
|
7111
|
-
process.env.NODE_ENV === "development" && (
|
|
7120
|
+
process.env.NODE_ENV === "development" && (yn.displayName = "CodeInput", bn.displayName = "CodeInput.Field");
|
|
7112
7121
|
//#endregion
|
|
7113
7122
|
//#region src/primitives/TextField.tsx
|
|
7114
|
-
var
|
|
7123
|
+
var En = /* @__PURE__ */ a(({ className: e, emptyValue: t = "", formatter: n, placeholder: r, type: i = "text", value: a, isDisabled: o = !1, isRequired: c = !1, onChange: l, onFocus: u, onUnfocus: d, ...f }, p) => {
|
|
7115
7124
|
let m = s((e) => {
|
|
7116
7125
|
let r = (n?.(e) ?? e) || t;
|
|
7117
7126
|
l?.(r);
|
|
@@ -7133,10 +7142,10 @@ var Tn = /* @__PURE__ */ a(({ className: e, emptyValue: t = "", formatter: n, pl
|
|
|
7133
7142
|
onFocus: ({ target: e }) => u?.(e.value)
|
|
7134
7143
|
});
|
|
7135
7144
|
});
|
|
7136
|
-
process.env.NODE_ENV === "development" && (
|
|
7145
|
+
process.env.NODE_ENV === "development" && (En.displayName = "TextField");
|
|
7137
7146
|
//#endregion
|
|
7138
7147
|
//#region src/primitives/Counter.tsx
|
|
7139
|
-
var
|
|
7148
|
+
var Dn = /* @__PURE__ */ a(({ style: e, allowsInput: t = !0, children: n, max: r = NaN, min: i = NaN, quantity: a = 0, onChange: o, ...s }, l) => {
|
|
7140
7149
|
let u = () => {
|
|
7141
7150
|
o?.(_(a - 1));
|
|
7142
7151
|
}, d = () => {
|
|
@@ -7152,7 +7161,7 @@ var En = /* @__PURE__ */ a(({ style: e, allowsInput: t = !0, children: n, max: r
|
|
|
7152
7161
|
}, _ = (e) => {
|
|
7153
7162
|
let t = e;
|
|
7154
7163
|
return isNaN(i) || (t = Math.max(i, t)), isNaN(r) || (t = Math.min(r, t)), t;
|
|
7155
|
-
}, [v, y] = f(h(a)), b =
|
|
7164
|
+
}, [v, y] = f(h(a)), b = At(a), x = !isNaN(r) && a + 1 > r, S = !isNaN(i) && a - 1 < i;
|
|
7156
7165
|
c(() => {
|
|
7157
7166
|
b === void 0 || b === a || y(h(_(a)));
|
|
7158
7167
|
}, [
|
|
@@ -7161,24 +7170,24 @@ var En = /* @__PURE__ */ a(({ style: e, allowsInput: t = !0, children: n, max: r
|
|
|
7161
7170
|
r
|
|
7162
7171
|
]);
|
|
7163
7172
|
let w = A(n, {
|
|
7164
|
-
addButton:
|
|
7165
|
-
subscribeButton:
|
|
7166
|
-
textField:
|
|
7173
|
+
addButton: kn,
|
|
7174
|
+
subscribeButton: An,
|
|
7175
|
+
textField: On
|
|
7167
7176
|
});
|
|
7168
7177
|
return /* @__PURE__ */ (0, D.jsxs)("div", {
|
|
7169
7178
|
...s,
|
|
7170
7179
|
ref: l,
|
|
7171
|
-
style: P(e,
|
|
7180
|
+
style: P(e, Mn.root),
|
|
7172
7181
|
children: [
|
|
7173
7182
|
/* @__PURE__ */ (0, D.jsx)(N, {
|
|
7174
7183
|
className: C({ disabled: S }),
|
|
7175
|
-
style: P(
|
|
7176
|
-
element: w.subscribeButton ?? /* @__PURE__ */ (0, D.jsx)(
|
|
7184
|
+
style: P(Mn.subtract),
|
|
7185
|
+
element: w.subscribeButton ?? /* @__PURE__ */ (0, D.jsx)(An, {}),
|
|
7177
7186
|
onClick: () => u()
|
|
7178
7187
|
}),
|
|
7179
7188
|
/* @__PURE__ */ (0, D.jsx)(N, {
|
|
7180
|
-
style: P(
|
|
7181
|
-
element: w.textField ?? /* @__PURE__ */ (0, D.jsx)(
|
|
7189
|
+
style: P(Mn.textField),
|
|
7190
|
+
element: w.textField ?? /* @__PURE__ */ (0, D.jsx)(On, {}),
|
|
7182
7191
|
value: v,
|
|
7183
7192
|
isDisabled: !t,
|
|
7184
7193
|
onChange: p,
|
|
@@ -7186,23 +7195,23 @@ var En = /* @__PURE__ */ a(({ style: e, allowsInput: t = !0, children: n, max: r
|
|
|
7186
7195
|
}),
|
|
7187
7196
|
/* @__PURE__ */ (0, D.jsx)(N, {
|
|
7188
7197
|
className: C({ disabled: x }),
|
|
7189
|
-
style: P(
|
|
7190
|
-
element: w.addButton ?? /* @__PURE__ */ (0, D.jsx)(
|
|
7198
|
+
style: P(Mn.add),
|
|
7199
|
+
element: w.addButton ?? /* @__PURE__ */ (0, D.jsx)(kn, {}),
|
|
7191
7200
|
onClick: () => d()
|
|
7192
7201
|
})
|
|
7193
7202
|
]
|
|
7194
7203
|
});
|
|
7195
|
-
}),
|
|
7204
|
+
}), On = ({ ...e }) => /* @__PURE__ */ (0, D.jsx)(En, { ...e }), kn = ({ children: e, ...t }) => /* @__PURE__ */ (0, D.jsx)("button", {
|
|
7196
7205
|
...t,
|
|
7197
7206
|
children: e
|
|
7198
|
-
}),
|
|
7207
|
+
}), An = ({ children: e, ...t }) => /* @__PURE__ */ (0, D.jsx)("button", {
|
|
7199
7208
|
...t,
|
|
7200
7209
|
children: e
|
|
7201
|
-
}),
|
|
7202
|
-
TextField:
|
|
7203
|
-
AddButton:
|
|
7204
|
-
SubtractButton:
|
|
7205
|
-
}),
|
|
7210
|
+
}), jn = /* @__PURE__ */ Object.assign(Dn, {
|
|
7211
|
+
TextField: On,
|
|
7212
|
+
AddButton: kn,
|
|
7213
|
+
SubtractButton: An
|
|
7214
|
+
}), Mn = j({
|
|
7206
7215
|
add: { flex: "0 0 auto" },
|
|
7207
7216
|
root: {
|
|
7208
7217
|
alignItems: "stretch",
|
|
@@ -7213,14 +7222,14 @@ var En = /* @__PURE__ */ a(({ style: e, allowsInput: t = !0, children: n, max: r
|
|
|
7213
7222
|
subtract: { flex: "0 0 auto" },
|
|
7214
7223
|
textField: { width: "100%" }
|
|
7215
7224
|
});
|
|
7216
|
-
process.env.NODE_ENV === "development" && (
|
|
7225
|
+
process.env.NODE_ENV === "development" && (Dn.displayName = "Counter", kn.displayName = "Counter.AddButton", An.displayName = "Counter.SubtractButton", On.displayName = "Counter.TextField");
|
|
7217
7226
|
//#endregion
|
|
7218
7227
|
//#region src/primitives/Dial.tsx
|
|
7219
|
-
var
|
|
7228
|
+
var Nn = /* @__PURE__ */ a(({ style: e, angle: t = 0, children: n, knobLength: r = 30, knobThickness: i = 10, radius: a = 50, trackGap: o = 0, trackThickness: s = 2, ...c }, l) => {
|
|
7220
7229
|
let u = a * 2, d = Math.max(0, Math.min(360, r)), f = A(n, {
|
|
7221
|
-
knob:
|
|
7222
|
-
track:
|
|
7223
|
-
}), p =
|
|
7230
|
+
knob: Fn,
|
|
7231
|
+
track: Pn
|
|
7232
|
+
}), p = zn({
|
|
7224
7233
|
angle: t,
|
|
7225
7234
|
diameter: u
|
|
7226
7235
|
});
|
|
@@ -7238,7 +7247,7 @@ var Mn = /* @__PURE__ */ a(({ style: e, angle: t = 0, children: n, knobLength: r
|
|
|
7238
7247
|
children: /* @__PURE__ */ (0, D.jsx)(N, {
|
|
7239
7248
|
cx: a,
|
|
7240
7249
|
cy: a,
|
|
7241
|
-
element: f.track ?? /* @__PURE__ */ (0, D.jsx)(
|
|
7250
|
+
element: f.track ?? /* @__PURE__ */ (0, D.jsx)(Pn, {}),
|
|
7242
7251
|
fill: "none",
|
|
7243
7252
|
r: a - s / 2,
|
|
7244
7253
|
strokeDasharray: o,
|
|
@@ -7252,27 +7261,27 @@ var Mn = /* @__PURE__ */ a(({ style: e, angle: t = 0, children: n, knobLength: r
|
|
|
7252
7261
|
viewBox: `0 0 ${u} ${u}`,
|
|
7253
7262
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7254
7263
|
children: /* @__PURE__ */ (0, D.jsx)(N, {
|
|
7255
|
-
d:
|
|
7256
|
-
element: f.knob ?? /* @__PURE__ */ (0, D.jsx)(
|
|
7264
|
+
d: Rn(a, a, a - i / 2 - (s - i) / 2, -d / 2, d / 2),
|
|
7265
|
+
element: f.knob ?? /* @__PURE__ */ (0, D.jsx)(Fn, {}),
|
|
7257
7266
|
fill: "none",
|
|
7258
7267
|
strokeWidth: i
|
|
7259
7268
|
})
|
|
7260
7269
|
})
|
|
7261
7270
|
})]
|
|
7262
7271
|
});
|
|
7263
|
-
}),
|
|
7264
|
-
Track:
|
|
7265
|
-
Knob:
|
|
7272
|
+
}), Pn = ({ ...e }) => /* @__PURE__ */ (0, D.jsx)("circle", { ...e }), Fn = ({ ...e }) => /* @__PURE__ */ (0, D.jsx)("path", { ...e }), In = /* @__PURE__ */ Object.assign(Nn, {
|
|
7273
|
+
Track: Pn,
|
|
7274
|
+
Knob: Fn
|
|
7266
7275
|
});
|
|
7267
|
-
function
|
|
7276
|
+
function Ln(e, t, n, r) {
|
|
7268
7277
|
let i = (r - 90) * Math.PI / 180;
|
|
7269
7278
|
return {
|
|
7270
7279
|
x: e + n * Math.cos(i),
|
|
7271
7280
|
y: t + n * Math.sin(i)
|
|
7272
7281
|
};
|
|
7273
7282
|
}
|
|
7274
|
-
function
|
|
7275
|
-
let a =
|
|
7283
|
+
function Rn(e, t, n, r, i) {
|
|
7284
|
+
let a = Ln(e, t, n, i), o = Ln(e, t, n, r), s = i - r <= 180 ? "0" : "1";
|
|
7276
7285
|
return [
|
|
7277
7286
|
"M",
|
|
7278
7287
|
a.x,
|
|
@@ -7287,7 +7296,7 @@ function Ln(e, t, n, r, i) {
|
|
|
7287
7296
|
o.y
|
|
7288
7297
|
].join(" ");
|
|
7289
7298
|
}
|
|
7290
|
-
function
|
|
7299
|
+
function zn({ angle: e = 0, diameter: t = 0 }) {
|
|
7291
7300
|
return j({
|
|
7292
7301
|
knobContainer: {
|
|
7293
7302
|
backgroundPosition: "center",
|
|
@@ -7321,11 +7330,11 @@ function Rn({ angle: e = 0, diameter: t = 0 }) {
|
|
|
7321
7330
|
}
|
|
7322
7331
|
});
|
|
7323
7332
|
}
|
|
7324
|
-
process.env.NODE_ENV === "development" && (
|
|
7333
|
+
process.env.NODE_ENV === "development" && (In.displayName = "Dial", Pn.displayName = "Dial.Track", Fn.displayName = "Dial.Knob");
|
|
7325
7334
|
//#endregion
|
|
7326
7335
|
//#region src/primitives/Dropdown.tsx
|
|
7327
|
-
var
|
|
7328
|
-
let L = d(null), R = re(L), z = s.length, B =
|
|
7336
|
+
var Bn = /* @__PURE__ */ a(({ className: e, style: t, children: n, collectionPadding: r = 0, ItemComponent: i, itemLength: a, itemPadding: o = 0, items: s = [], label: l, layout: u = "list", maxVisibleItems: p = -1, numSegments: m = 1, orientation: h = "vertical", selection: g = [], selectionMode: _ = "single", ToggleComponent: v, isCollapsed: y, isInverted: b = !1, isSelectionTogglable: x = !1, shouldCollapseOnSelect: S = !0, onActivateAt: w, onCollapse: T, onDeselectAt: E, onExpand: O, onSelectAt: k, onSelectionChange: j, onToggleCustomEvent: M, ...F }, I) => {
|
|
7337
|
+
let L = d(null), R = re(L), z = s.length, B = Xn(s, p, m, u), V = a ?? (h === "vertical" ? R.height : R.width), H = V * B + o * (B - 1), U = Jn(g, s), [W, G] = f(y ?? !0), K = Zn({
|
|
7329
7338
|
collectionPadding: r,
|
|
7330
7339
|
maxVisibleItems: p,
|
|
7331
7340
|
menuLength: H,
|
|
@@ -7334,11 +7343,11 @@ var zn = /* @__PURE__ */ a(({ className: e, style: t, children: n, collectionPad
|
|
|
7334
7343
|
isCollapsed: W,
|
|
7335
7344
|
isInverted: b
|
|
7336
7345
|
}), q = A(n, {
|
|
7337
|
-
collapseIcon:
|
|
7338
|
-
collection:
|
|
7339
|
-
expandIcon:
|
|
7340
|
-
item:
|
|
7341
|
-
toggle:
|
|
7346
|
+
collapseIcon: Wn,
|
|
7347
|
+
collection: Vn,
|
|
7348
|
+
expandIcon: Gn,
|
|
7349
|
+
item: Hn,
|
|
7350
|
+
toggle: Un
|
|
7342
7351
|
}), J = () => {
|
|
7343
7352
|
W && (G(!1), O?.());
|
|
7344
7353
|
}, ee = () => {
|
|
@@ -7396,7 +7405,7 @@ var zn = /* @__PURE__ */ a(({ className: e, style: t, children: n, collectionPad
|
|
|
7396
7405
|
style: P(K.toggle),
|
|
7397
7406
|
"aria-expanded": !W,
|
|
7398
7407
|
"aria-haspopup": "listbox",
|
|
7399
|
-
element: q.toggle ?? /* @__PURE__ */ (0, D.jsx)(
|
|
7408
|
+
element: q.toggle ?? /* @__PURE__ */ (0, D.jsx)(Un, {}),
|
|
7400
7409
|
onClick: te,
|
|
7401
7410
|
children: [/* @__PURE__ */ (0, D.jsx)("span", { dangerouslySetInnerHTML: { __html: l?.(U) ?? (U.length > 0 ? U.map((e) => s[e]).join(", ") : "") } }), q.expandIcon && /* @__PURE__ */ (0, D.jsx)(N, {
|
|
7402
7411
|
className: C({
|
|
@@ -7408,7 +7417,7 @@ var zn = /* @__PURE__ */ a(({ className: e, style: t, children: n, collectionPad
|
|
|
7408
7417
|
})]
|
|
7409
7418
|
}), /* @__PURE__ */ (0, D.jsx)(N, {
|
|
7410
7419
|
style: P(K.collection),
|
|
7411
|
-
element: q.collection ?? /* @__PURE__ */ (0, D.jsx)(
|
|
7420
|
+
element: q.collection ?? /* @__PURE__ */ (0, D.jsx)(Vn, {}),
|
|
7412
7421
|
ItemComponent: i,
|
|
7413
7422
|
itemLength: V,
|
|
7414
7423
|
itemPadding: o,
|
|
@@ -7423,38 +7432,38 @@ var zn = /* @__PURE__ */ a(({ className: e, style: t, children: n, collectionPad
|
|
|
7423
7432
|
onDeselectAt: E,
|
|
7424
7433
|
onSelectAt: ne,
|
|
7425
7434
|
onSelectionChange: j,
|
|
7426
|
-
children: !i && (q.item ?? /* @__PURE__ */ (0, D.jsx)(
|
|
7435
|
+
children: !i && (q.item ?? /* @__PURE__ */ (0, D.jsx)(Hn, {}))
|
|
7427
7436
|
})]
|
|
7428
7437
|
})
|
|
7429
7438
|
});
|
|
7430
|
-
}),
|
|
7439
|
+
}), Vn = Xt, Hn = Xt.Item, Un = ({ children: e, ...t }) => /* @__PURE__ */ (0, D.jsx)("button", {
|
|
7431
7440
|
...t,
|
|
7432
7441
|
children: e
|
|
7433
|
-
}),
|
|
7442
|
+
}), Wn = ({ children: e, ...t }) => /* @__PURE__ */ (0, D.jsx)("figure", {
|
|
7434
7443
|
...t,
|
|
7435
7444
|
"aria-hidden": !0,
|
|
7436
7445
|
children: e
|
|
7437
|
-
}),
|
|
7446
|
+
}), Gn = ({ children: e, ...t }) => /* @__PURE__ */ (0, D.jsx)("figure", {
|
|
7438
7447
|
...t,
|
|
7439
7448
|
"aria-hidden": !0,
|
|
7440
7449
|
children: e
|
|
7441
|
-
}),
|
|
7442
|
-
Collection:
|
|
7443
|
-
CollapseIcon:
|
|
7444
|
-
ExpandIcon:
|
|
7445
|
-
Item:
|
|
7446
|
-
Toggle:
|
|
7450
|
+
}), Kn = /* @__PURE__ */ Object.assign(Bn, {
|
|
7451
|
+
Collection: Vn,
|
|
7452
|
+
CollapseIcon: Wn,
|
|
7453
|
+
ExpandIcon: Gn,
|
|
7454
|
+
Item: Hn,
|
|
7455
|
+
Toggle: Un
|
|
7447
7456
|
});
|
|
7448
|
-
function
|
|
7457
|
+
function qn(e, t) {
|
|
7449
7458
|
return !!(isNaN(e) || e >= t.length || e < 0);
|
|
7450
7459
|
}
|
|
7451
|
-
function
|
|
7452
|
-
return
|
|
7460
|
+
function Jn(e, t) {
|
|
7461
|
+
return Yn(e).filter((e) => !qn(e, t));
|
|
7453
7462
|
}
|
|
7454
|
-
function
|
|
7463
|
+
function Yn(e) {
|
|
7455
7464
|
return e.sort((e, t) => e - t);
|
|
7456
7465
|
}
|
|
7457
|
-
function
|
|
7466
|
+
function Xn(e, t, n, r) {
|
|
7458
7467
|
let i = e.length;
|
|
7459
7468
|
switch (r) {
|
|
7460
7469
|
case "grid": {
|
|
@@ -7464,7 +7473,7 @@ function Yn(e, t, n, r) {
|
|
|
7464
7473
|
default: return t < 0 ? i : Math.min(i, t);
|
|
7465
7474
|
}
|
|
7466
7475
|
}
|
|
7467
|
-
function
|
|
7476
|
+
function Zn({ collectionPadding: e = 0, maxVisibleItems: t = 0, menuLength: n = NaN, numItems: r = 0, orientation: i = "vertical", isCollapsed: a = !0, isInverted: o = !1 }) {
|
|
7468
7477
|
return j({
|
|
7469
7478
|
body: {
|
|
7470
7479
|
height: "100%",
|
|
@@ -7523,13 +7532,13 @@ function Xn({ collectionPadding: e = 0, maxVisibleItems: t = 0, menuLength: n =
|
|
|
7523
7532
|
}
|
|
7524
7533
|
});
|
|
7525
7534
|
}
|
|
7526
|
-
process.env.NODE_ENV === "development" && (
|
|
7535
|
+
process.env.NODE_ENV === "development" && (Bn.displayName = "Dropdown", Vn.displayName = "Dropdown.Collection", Wn.displayName = "Dropdown.CollapseIcon", Gn.displayName = "Dropdown.ExpandIcon", Hn.displayName = "Dropdown.Item", Un.displayName = "Dropdown.Toggle");
|
|
7527
7536
|
//#endregion
|
|
7528
7537
|
//#region node_modules/fast-xml-parser/src/util.js
|
|
7529
|
-
var
|
|
7530
|
-
|
|
7531
|
-
var
|
|
7532
|
-
function
|
|
7538
|
+
var Qn = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
|
|
7539
|
+
Qn + "";
|
|
7540
|
+
var $n = "[" + Qn + "][:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*", er = RegExp("^" + $n + "$");
|
|
7541
|
+
function tr(e, t) {
|
|
7533
7542
|
let n = [], r = t.exec(e);
|
|
7534
7543
|
for (; r;) {
|
|
7535
7544
|
let i = [];
|
|
@@ -7540,13 +7549,13 @@ function er(e, t) {
|
|
|
7540
7549
|
}
|
|
7541
7550
|
return n;
|
|
7542
7551
|
}
|
|
7543
|
-
var
|
|
7544
|
-
return
|
|
7552
|
+
var nr = function(e) {
|
|
7553
|
+
return er.exec(e) != null;
|
|
7545
7554
|
};
|
|
7546
|
-
function
|
|
7555
|
+
function rr(e) {
|
|
7547
7556
|
return e !== void 0;
|
|
7548
7557
|
}
|
|
7549
|
-
var
|
|
7558
|
+
var ir = [
|
|
7550
7559
|
"hasOwnProperty",
|
|
7551
7560
|
"toString",
|
|
7552
7561
|
"valueOf",
|
|
@@ -7554,41 +7563,41 @@ var rr = [
|
|
|
7554
7563
|
"__defineSetter__",
|
|
7555
7564
|
"__lookupGetter__",
|
|
7556
7565
|
"__lookupSetter__"
|
|
7557
|
-
],
|
|
7566
|
+
], ar = [
|
|
7558
7567
|
"__proto__",
|
|
7559
7568
|
"constructor",
|
|
7560
7569
|
"prototype"
|
|
7561
|
-
],
|
|
7570
|
+
], or = {
|
|
7562
7571
|
allowBooleanAttributes: !1,
|
|
7563
7572
|
unpairedTags: []
|
|
7564
7573
|
};
|
|
7565
|
-
function
|
|
7566
|
-
t = Object.assign({},
|
|
7574
|
+
function sr(e, t) {
|
|
7575
|
+
t = Object.assign({}, or, t);
|
|
7567
7576
|
let n = [], r = !1, i = !1;
|
|
7568
7577
|
e[0] === "" && (e = e.substr(1));
|
|
7569
7578
|
for (let a = 0; a < e.length; a++) if (e[a] === "<" && e[a + 1] === "?") {
|
|
7570
|
-
if (a += 2, a =
|
|
7579
|
+
if (a += 2, a = lr(e, a), a.err) return a;
|
|
7571
7580
|
} else if (e[a] === "<") {
|
|
7572
7581
|
let o = a;
|
|
7573
7582
|
if (a++, e[a] === "!") {
|
|
7574
|
-
a =
|
|
7583
|
+
a = ur(e, a);
|
|
7575
7584
|
continue;
|
|
7576
7585
|
} else {
|
|
7577
7586
|
let s = !1;
|
|
7578
7587
|
e[a] === "/" && (s = !0, a++);
|
|
7579
7588
|
let c = "";
|
|
7580
7589
|
for (; a < e.length && e[a] !== ">" && e[a] !== " " && e[a] !== " " && e[a] !== "\n" && e[a] !== "\r"; a++) c += e[a];
|
|
7581
|
-
if (c = c.trim(), c[c.length - 1] === "/" && (c = c.substring(0, c.length - 1), a--), !
|
|
7590
|
+
if (c = c.trim(), c[c.length - 1] === "/" && (c = c.substring(0, c.length - 1), a--), !yr(c)) {
|
|
7582
7591
|
let t;
|
|
7583
7592
|
return t = c.trim().length === 0 ? "Invalid space after '<'." : "Tag '" + c + "' is an invalid name.", Z("InvalidTag", t, Q(e, a));
|
|
7584
7593
|
}
|
|
7585
|
-
let l =
|
|
7594
|
+
let l = pr(e, a);
|
|
7586
7595
|
if (l === !1) return Z("InvalidAttr", "Attributes for '" + c + "' have open quote.", Q(e, a));
|
|
7587
7596
|
let u = l.value;
|
|
7588
7597
|
if (a = l.index, u[u.length - 1] === "/") {
|
|
7589
7598
|
let n = a - u.length;
|
|
7590
7599
|
u = u.substring(0, u.length - 1);
|
|
7591
|
-
let i =
|
|
7600
|
+
let i = hr(u, t);
|
|
7592
7601
|
if (i === !0) r = !0;
|
|
7593
7602
|
else return Z(i.err.code, i.err.msg, Q(e, n + i.err.line));
|
|
7594
7603
|
} else if (s) {
|
|
@@ -7604,7 +7613,7 @@ function or(e, t) {
|
|
|
7604
7613
|
n.length == 0 && (i = !0);
|
|
7605
7614
|
}
|
|
7606
7615
|
} else {
|
|
7607
|
-
let s =
|
|
7616
|
+
let s = hr(u, t);
|
|
7608
7617
|
if (s !== !0) return Z(s.err.code, s.err.msg, Q(e, a - u.length + s.err.line));
|
|
7609
7618
|
if (i === !0) return Z("InvalidXml", "Multiple possible root nodes found.", Q(e, a));
|
|
7610
7619
|
t.unpairedTags.indexOf(c) !== -1 || n.push({
|
|
@@ -7613,20 +7622,20 @@ function or(e, t) {
|
|
|
7613
7622
|
}), r = !0;
|
|
7614
7623
|
}
|
|
7615
7624
|
for (a++; a < e.length; a++) if (e[a] === "<") if (e[a + 1] === "!") {
|
|
7616
|
-
a++, a =
|
|
7625
|
+
a++, a = ur(e, a);
|
|
7617
7626
|
continue;
|
|
7618
7627
|
} else if (e[a + 1] === "?") {
|
|
7619
|
-
if (a =
|
|
7628
|
+
if (a = lr(e, ++a), a.err) return a;
|
|
7620
7629
|
} else break;
|
|
7621
7630
|
else if (e[a] === "&") {
|
|
7622
|
-
let t =
|
|
7631
|
+
let t = _r(e, a);
|
|
7623
7632
|
if (t == -1) return Z("InvalidChar", "char '&' is not expected.", Q(e, a));
|
|
7624
7633
|
a = t;
|
|
7625
|
-
} else if (i === !0 && !
|
|
7634
|
+
} else if (i === !0 && !cr(e[a])) return Z("InvalidXml", "Extra text at the end", Q(e, a));
|
|
7626
7635
|
e[a] === "<" && a--;
|
|
7627
7636
|
}
|
|
7628
7637
|
} else {
|
|
7629
|
-
if (
|
|
7638
|
+
if (cr(e[a])) continue;
|
|
7630
7639
|
return Z("InvalidChar", "char '" + e[a] + "' is not expected.", Q(e, a));
|
|
7631
7640
|
}
|
|
7632
7641
|
return r ? n.length == 1 ? Z("InvalidTag", "Unclosed tag '" + n[0].tagName + "'.", Q(e, n[0].tagStartPos)) : n.length > 0 ? Z("InvalidXml", "Invalid '" + JSON.stringify(n.map((e) => e.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", {
|
|
@@ -7634,10 +7643,10 @@ function or(e, t) {
|
|
|
7634
7643
|
col: 1
|
|
7635
7644
|
}) : !0 : Z("InvalidXml", "Start tag expected.", 1);
|
|
7636
7645
|
}
|
|
7637
|
-
function
|
|
7646
|
+
function cr(e) {
|
|
7638
7647
|
return e === " " || e === " " || e === "\n" || e === "\r";
|
|
7639
7648
|
}
|
|
7640
|
-
function
|
|
7649
|
+
function lr(e, t) {
|
|
7641
7650
|
let n = t;
|
|
7642
7651
|
for (; t < e.length; t++) if (e[t] == "?" || e[t] == " ") {
|
|
7643
7652
|
let r = e.substr(n, t - n);
|
|
@@ -7649,7 +7658,7 @@ function cr(e, t) {
|
|
|
7649
7658
|
}
|
|
7650
7659
|
return t;
|
|
7651
7660
|
}
|
|
7652
|
-
function
|
|
7661
|
+
function ur(e, t) {
|
|
7653
7662
|
if (e.length > t + 5 && e[t + 1] === "-" && e[t + 2] === "-") {
|
|
7654
7663
|
for (t += 3; t < e.length; t++) if (e[t] === "-" && e[t + 1] === "-" && e[t + 2] === ">") {
|
|
7655
7664
|
t += 2;
|
|
@@ -7667,11 +7676,11 @@ function lr(e, t) {
|
|
|
7667
7676
|
}
|
|
7668
7677
|
return t;
|
|
7669
7678
|
}
|
|
7670
|
-
var
|
|
7671
|
-
function
|
|
7679
|
+
var dr = "\"", fr = "'";
|
|
7680
|
+
function pr(e, t) {
|
|
7672
7681
|
let n = "", r = "", i = !1;
|
|
7673
7682
|
for (; t < e.length; t++) {
|
|
7674
|
-
if (e[t] ===
|
|
7683
|
+
if (e[t] === dr || e[t] === fr) r === "" ? r = e[t] : r !== e[t] || (r = "");
|
|
7675
7684
|
else if (e[t] === ">" && r === "") {
|
|
7676
7685
|
i = !0;
|
|
7677
7686
|
break;
|
|
@@ -7684,21 +7693,21 @@ function fr(e, t) {
|
|
|
7684
7693
|
tagClosed: i
|
|
7685
7694
|
} : !1;
|
|
7686
7695
|
}
|
|
7687
|
-
var
|
|
7688
|
-
function
|
|
7689
|
-
let n =
|
|
7696
|
+
var mr = /* @__PURE__ */ RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?", "g");
|
|
7697
|
+
function hr(e, t) {
|
|
7698
|
+
let n = tr(e, mr), r = {};
|
|
7690
7699
|
for (let e = 0; e < n.length; e++) {
|
|
7691
|
-
if (n[e][1].length === 0) return Z("InvalidAttr", "Attribute '" + n[e][2] + "' has no space in starting.",
|
|
7692
|
-
if (n[e][3] !== void 0 && n[e][4] === void 0) return Z("InvalidAttr", "Attribute '" + n[e][2] + "' is without value.",
|
|
7693
|
-
if (n[e][3] === void 0 && !t.allowBooleanAttributes) return Z("InvalidAttr", "boolean attribute '" + n[e][2] + "' is not allowed.",
|
|
7700
|
+
if (n[e][1].length === 0) return Z("InvalidAttr", "Attribute '" + n[e][2] + "' has no space in starting.", br(n[e]));
|
|
7701
|
+
if (n[e][3] !== void 0 && n[e][4] === void 0) return Z("InvalidAttr", "Attribute '" + n[e][2] + "' is without value.", br(n[e]));
|
|
7702
|
+
if (n[e][3] === void 0 && !t.allowBooleanAttributes) return Z("InvalidAttr", "boolean attribute '" + n[e][2] + "' is not allowed.", br(n[e]));
|
|
7694
7703
|
let i = n[e][2];
|
|
7695
|
-
if (!
|
|
7704
|
+
if (!vr(i)) return Z("InvalidAttr", "Attribute '" + i + "' is an invalid name.", br(n[e]));
|
|
7696
7705
|
if (!Object.prototype.hasOwnProperty.call(r, i)) r[i] = 1;
|
|
7697
|
-
else return Z("InvalidAttr", "Attribute '" + i + "' is repeated.",
|
|
7706
|
+
else return Z("InvalidAttr", "Attribute '" + i + "' is repeated.", br(n[e]));
|
|
7698
7707
|
}
|
|
7699
7708
|
return !0;
|
|
7700
7709
|
}
|
|
7701
|
-
function
|
|
7710
|
+
function gr(e, t) {
|
|
7702
7711
|
let n = /\d/;
|
|
7703
7712
|
for (e[t] === "x" && (t++, n = /[\da-fA-F]/); t < e.length; t++) {
|
|
7704
7713
|
if (e[t] === ";") return t;
|
|
@@ -7706,9 +7715,9 @@ function hr(e, t) {
|
|
|
7706
7715
|
}
|
|
7707
7716
|
return -1;
|
|
7708
7717
|
}
|
|
7709
|
-
function
|
|
7718
|
+
function _r(e, t) {
|
|
7710
7719
|
if (t++, e[t] === ";") return -1;
|
|
7711
|
-
if (e[t] === "#") return t++,
|
|
7720
|
+
if (e[t] === "#") return t++, gr(e, t);
|
|
7712
7721
|
let n = 0;
|
|
7713
7722
|
for (; t < e.length; t++, n++) if (!(e[t].match(/\w/) && n < 20)) {
|
|
7714
7723
|
if (e[t] === ";") break;
|
|
@@ -7724,11 +7733,11 @@ function Z(e, t, n) {
|
|
|
7724
7733
|
col: n.col
|
|
7725
7734
|
} };
|
|
7726
7735
|
}
|
|
7727
|
-
function _r(e) {
|
|
7728
|
-
return tr(e);
|
|
7729
|
-
}
|
|
7730
7736
|
function vr(e) {
|
|
7731
|
-
return
|
|
7737
|
+
return nr(e);
|
|
7738
|
+
}
|
|
7739
|
+
function yr(e) {
|
|
7740
|
+
return nr(e);
|
|
7732
7741
|
}
|
|
7733
7742
|
function Q(e, t) {
|
|
7734
7743
|
let n = e.substring(0, t).split(/\r?\n/);
|
|
@@ -7737,12 +7746,12 @@ function Q(e, t) {
|
|
|
7737
7746
|
col: n[n.length - 1].length + 1
|
|
7738
7747
|
};
|
|
7739
7748
|
}
|
|
7740
|
-
function
|
|
7749
|
+
function br(e) {
|
|
7741
7750
|
return e.startIndex + e[1].length;
|
|
7742
7751
|
}
|
|
7743
7752
|
//#endregion
|
|
7744
7753
|
//#region node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js
|
|
7745
|
-
var
|
|
7754
|
+
var xr = (e) => ir.includes(e) ? "__" + e : e, Sr = {
|
|
7746
7755
|
preserveOrder: !1,
|
|
7747
7756
|
attributeNamePrefix: "@_",
|
|
7748
7757
|
attributesGroupName: !1,
|
|
@@ -7783,14 +7792,14 @@ var br = (e) => rr.includes(e) ? "__" + e : e, xr = {
|
|
|
7783
7792
|
maxNestedTags: 100,
|
|
7784
7793
|
strictReservedNames: !0,
|
|
7785
7794
|
jPath: !0,
|
|
7786
|
-
onDangerousProperty:
|
|
7795
|
+
onDangerousProperty: xr
|
|
7787
7796
|
};
|
|
7788
|
-
function
|
|
7797
|
+
function Cr(e, t) {
|
|
7789
7798
|
if (typeof e != "string") return;
|
|
7790
7799
|
let n = e.toLowerCase();
|
|
7791
|
-
if (
|
|
7800
|
+
if (ir.some((e) => n === e.toLowerCase()) || ar.some((e) => n === e.toLowerCase())) throw Error(`[SECURITY] Invalid ${t}: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`);
|
|
7792
7801
|
}
|
|
7793
|
-
function
|
|
7802
|
+
function wr(e) {
|
|
7794
7803
|
return typeof e == "boolean" ? {
|
|
7795
7804
|
enabled: e,
|
|
7796
7805
|
maxEntitySize: 1e4,
|
|
@@ -7809,10 +7818,10 @@ function Cr(e) {
|
|
|
7809
7818
|
maxEntityCount: Math.max(1, e.maxEntityCount ?? 100),
|
|
7810
7819
|
allowedTags: e.allowedTags ?? null,
|
|
7811
7820
|
tagFilter: e.tagFilter ?? null
|
|
7812
|
-
} :
|
|
7821
|
+
} : wr(!0);
|
|
7813
7822
|
}
|
|
7814
|
-
var
|
|
7815
|
-
let t = Object.assign({},
|
|
7823
|
+
var Tr = function(e) {
|
|
7824
|
+
let t = Object.assign({}, Sr, e), n = [
|
|
7816
7825
|
{
|
|
7817
7826
|
value: t.attributeNamePrefix,
|
|
7818
7827
|
name: "attributeNamePrefix"
|
|
@@ -7834,9 +7843,9 @@ var wr = function(e) {
|
|
|
7834
7843
|
name: "commentPropName"
|
|
7835
7844
|
}
|
|
7836
7845
|
];
|
|
7837
|
-
for (let { value: e, name: t } of n) e &&
|
|
7838
|
-
return t.onDangerousProperty === null && (t.onDangerousProperty =
|
|
7839
|
-
},
|
|
7846
|
+
for (let { value: e, name: t } of n) e && Cr(e, t);
|
|
7847
|
+
return t.onDangerousProperty === null && (t.onDangerousProperty = xr), t.processEntities = wr(t.processEntities), t.stopNodes && Array.isArray(t.stopNodes) && (t.stopNodes = t.stopNodes.map((e) => typeof e == "string" && e.startsWith("*.") ? ".." + e.substring(2) : e)), t;
|
|
7848
|
+
}, Er = typeof Symbol == "function" ? Symbol("XML Node Metadata") : "@@xmlMetadata", Dr = class {
|
|
7840
7849
|
constructor(e) {
|
|
7841
7850
|
this.tagname = e, this.child = [], this[":@"] = Object.create(null);
|
|
7842
7851
|
}
|
|
@@ -7847,12 +7856,12 @@ var wr = function(e) {
|
|
|
7847
7856
|
e.tagname === "__proto__" && (e.tagname = "#__proto__"), e[":@"] && Object.keys(e[":@"]).length > 0 ? this.child.push({
|
|
7848
7857
|
[e.tagname]: e.child,
|
|
7849
7858
|
":@": e[":@"]
|
|
7850
|
-
}) : this.child.push({ [e.tagname]: e.child }), t !== void 0 && (this.child[this.child.length - 1][
|
|
7859
|
+
}) : this.child.push({ [e.tagname]: e.child }), t !== void 0 && (this.child[this.child.length - 1][Er] = { startIndex: t });
|
|
7851
7860
|
}
|
|
7852
7861
|
static getMetaDataSymbol() {
|
|
7853
|
-
return
|
|
7862
|
+
return Er;
|
|
7854
7863
|
}
|
|
7855
|
-
},
|
|
7864
|
+
}, Or = class {
|
|
7856
7865
|
constructor(e) {
|
|
7857
7866
|
this.suppressValidationErr = !e, this.options = e;
|
|
7858
7867
|
}
|
|
@@ -7862,7 +7871,7 @@ var wr = function(e) {
|
|
|
7862
7871
|
t += 9;
|
|
7863
7872
|
let i = 1, a = !1, o = !1, s = "";
|
|
7864
7873
|
for (; t < e.length; t++) if (e[t] === "<" && !o) {
|
|
7865
|
-
if (a &&
|
|
7874
|
+
if (a && kr(e, "!ENTITY", t)) {
|
|
7866
7875
|
t += 7;
|
|
7867
7876
|
let i, a;
|
|
7868
7877
|
if ([i, a, t] = this.readEntityExp(e, t + 1, this.suppressValidationErr), a.indexOf("&") === -1) {
|
|
@@ -7873,16 +7882,16 @@ var wr = function(e) {
|
|
|
7873
7882
|
val: a
|
|
7874
7883
|
}, r++;
|
|
7875
7884
|
}
|
|
7876
|
-
} else if (a &&
|
|
7885
|
+
} else if (a && kr(e, "!ELEMENT", t)) {
|
|
7877
7886
|
t += 8;
|
|
7878
7887
|
let { index: n } = this.readElementExp(e, t + 1);
|
|
7879
7888
|
t = n;
|
|
7880
|
-
} else if (a &&
|
|
7881
|
-
else if (a &&
|
|
7889
|
+
} else if (a && kr(e, "!ATTLIST", t)) t += 8;
|
|
7890
|
+
else if (a && kr(e, "!NOTATION", t)) {
|
|
7882
7891
|
t += 9;
|
|
7883
7892
|
let { index: n } = this.readNotationExp(e, t + 1, this.suppressValidationErr);
|
|
7884
7893
|
t = n;
|
|
7885
|
-
} else if (
|
|
7894
|
+
} else if (kr(e, "!--", t)) o = !0;
|
|
7886
7895
|
else throw Error("Invalid DOCTYPE");
|
|
7887
7896
|
i++, s = "";
|
|
7888
7897
|
} else if (e[t] === ">") {
|
|
@@ -7900,7 +7909,7 @@ var wr = function(e) {
|
|
|
7900
7909
|
let n = t;
|
|
7901
7910
|
for (; t < e.length && !/\s/.test(e[t]) && e[t] !== "\"" && e[t] !== "'";) t++;
|
|
7902
7911
|
let r = e.substring(n, t);
|
|
7903
|
-
if (
|
|
7912
|
+
if (Ar(r), t = $(e, t), !this.suppressValidationErr) {
|
|
7904
7913
|
if (e.substring(t, t + 6).toUpperCase() === "SYSTEM") throw Error("External entities are not supported");
|
|
7905
7914
|
if (e[t] === "%") throw Error("Parameter entities are not supported");
|
|
7906
7915
|
}
|
|
@@ -7917,7 +7926,7 @@ var wr = function(e) {
|
|
|
7917
7926
|
let n = t;
|
|
7918
7927
|
for (; t < e.length && !/\s/.test(e[t]);) t++;
|
|
7919
7928
|
let r = e.substring(n, t);
|
|
7920
|
-
!this.suppressValidationErr &&
|
|
7929
|
+
!this.suppressValidationErr && Ar(r), t = $(e, t);
|
|
7921
7930
|
let i = e.substring(t, t + 6).toUpperCase();
|
|
7922
7931
|
if (!this.suppressValidationErr && i !== "SYSTEM" && i !== "PUBLIC") throw Error(`Expected SYSTEM or PUBLIC, found "${i}"`);
|
|
7923
7932
|
t += i.length, t = $(e, t);
|
|
@@ -7945,11 +7954,11 @@ var wr = function(e) {
|
|
|
7945
7954
|
let n = t;
|
|
7946
7955
|
for (; t < e.length && !/\s/.test(e[t]);) t++;
|
|
7947
7956
|
let r = e.substring(n, t);
|
|
7948
|
-
if (!this.suppressValidationErr && !
|
|
7957
|
+
if (!this.suppressValidationErr && !nr(r)) throw Error(`Invalid element name: "${r}"`);
|
|
7949
7958
|
t = $(e, t);
|
|
7950
7959
|
let i = "";
|
|
7951
|
-
if (e[t] === "E" &&
|
|
7952
|
-
else if (e[t] === "A" &&
|
|
7960
|
+
if (e[t] === "E" && kr(e, "MPTY", t)) t += 4;
|
|
7961
|
+
else if (e[t] === "A" && kr(e, "NY", t)) t += 2;
|
|
7953
7962
|
else if (e[t] === "(") {
|
|
7954
7963
|
t++;
|
|
7955
7964
|
let n = t;
|
|
@@ -7967,9 +7976,9 @@ var wr = function(e) {
|
|
|
7967
7976
|
let n = t;
|
|
7968
7977
|
for (; t < e.length && !/\s/.test(e[t]);) t++;
|
|
7969
7978
|
let r = e.substring(n, t);
|
|
7970
|
-
for (
|
|
7979
|
+
for (Ar(r), t = $(e, t), n = t; t < e.length && !/\s/.test(e[t]);) t++;
|
|
7971
7980
|
let i = e.substring(n, t);
|
|
7972
|
-
if (!
|
|
7981
|
+
if (!Ar(i)) throw Error(`Invalid attribute name: "${i}"`);
|
|
7973
7982
|
t = $(e, t);
|
|
7974
7983
|
let a = "";
|
|
7975
7984
|
if (e.substring(t, t + 8).toUpperCase() === "NOTATION") {
|
|
@@ -7980,7 +7989,7 @@ var wr = function(e) {
|
|
|
7980
7989
|
let r = t;
|
|
7981
7990
|
for (; t < e.length && e[t] !== "|" && e[t] !== ")";) t++;
|
|
7982
7991
|
let i = e.substring(r, t);
|
|
7983
|
-
if (i = i.trim(), !
|
|
7992
|
+
if (i = i.trim(), !Ar(i)) throw Error(`Invalid notation name: "${i}"`);
|
|
7984
7993
|
n.push(i), e[t] === "|" && (t++, t = $(e, t));
|
|
7985
7994
|
}
|
|
7986
7995
|
if (e[t] !== ")") throw Error("Unterminated list of notations");
|
|
@@ -8013,35 +8022,35 @@ var wr = function(e) {
|
|
|
8013
8022
|
for (; t < e.length && /\s/.test(e[t]);) t++;
|
|
8014
8023
|
return t;
|
|
8015
8024
|
};
|
|
8016
|
-
function
|
|
8025
|
+
function kr(e, t, n) {
|
|
8017
8026
|
for (let r = 0; r < t.length; r++) if (t[r] !== e[n + r + 1]) return !1;
|
|
8018
8027
|
return !0;
|
|
8019
8028
|
}
|
|
8020
|
-
function
|
|
8021
|
-
if (
|
|
8029
|
+
function Ar(e) {
|
|
8030
|
+
if (nr(e)) return e;
|
|
8022
8031
|
throw Error(`Invalid entity name ${e}`);
|
|
8023
8032
|
}
|
|
8024
8033
|
//#endregion
|
|
8025
8034
|
//#region node_modules/strnum/strnum.js
|
|
8026
|
-
var
|
|
8035
|
+
var jr = /^[-+]?0x[a-fA-F0-9]+$/, Mr = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, Nr = {
|
|
8027
8036
|
hex: !0,
|
|
8028
8037
|
leadingZeros: !0,
|
|
8029
8038
|
decimalPoint: ".",
|
|
8030
8039
|
eNotation: !0,
|
|
8031
8040
|
infinity: "original"
|
|
8032
8041
|
};
|
|
8033
|
-
function
|
|
8034
|
-
if (t = Object.assign({},
|
|
8042
|
+
function Pr(e, t = {}) {
|
|
8043
|
+
if (t = Object.assign({}, Nr, t), !e || typeof e != "string") return e;
|
|
8035
8044
|
let n = e.trim();
|
|
8036
8045
|
if (n.length === 0 || t.skipLike !== void 0 && t.skipLike.test(n)) return e;
|
|
8037
8046
|
if (n === "0") return 0;
|
|
8038
|
-
if (t.hex &&
|
|
8039
|
-
if (!isFinite(n)) return
|
|
8040
|
-
if (n.includes("e") || n.includes("E")) return
|
|
8047
|
+
if (t.hex && jr.test(n)) return Rr(n, 16);
|
|
8048
|
+
if (!isFinite(n)) return zr(e, Number(n), t);
|
|
8049
|
+
if (n.includes("e") || n.includes("E")) return Ir(e, n, t);
|
|
8041
8050
|
{
|
|
8042
|
-
let r =
|
|
8051
|
+
let r = Mr.exec(n);
|
|
8043
8052
|
if (r) {
|
|
8044
|
-
let i = r[1] || "", a = r[2], o =
|
|
8053
|
+
let i = r[1] || "", a = r[2], o = Lr(r[3]), s = i ? e[a.length + 1] === "." : e[a.length] === ".";
|
|
8045
8054
|
if (!t.leadingZeros && (a.length > 1 || a.length === 1 && !s)) return e;
|
|
8046
8055
|
{
|
|
8047
8056
|
let r = Number(n), s = String(r);
|
|
@@ -8054,25 +8063,25 @@ function Nr(e, t = {}) {
|
|
|
8054
8063
|
} else return e;
|
|
8055
8064
|
}
|
|
8056
8065
|
}
|
|
8057
|
-
var
|
|
8058
|
-
function
|
|
8066
|
+
var Fr = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;
|
|
8067
|
+
function Ir(e, t, n) {
|
|
8059
8068
|
if (!n.eNotation) return e;
|
|
8060
|
-
let r = t.match(
|
|
8069
|
+
let r = t.match(Fr);
|
|
8061
8070
|
if (r) {
|
|
8062
8071
|
let i = r[1] || "", a = r[3].indexOf("e") === -1 ? "E" : "e", o = r[2], s = i ? e[o.length + 1] === a : e[o.length] === a;
|
|
8063
8072
|
return o.length > 1 && s ? e : o.length === 1 && (r[3].startsWith(`.${a}`) || r[3][0] === a) ? Number(t) : o.length > 0 ? n.leadingZeros && !s ? (t = (r[1] || "") + r[3], Number(t)) : e : Number(t);
|
|
8064
8073
|
} else return e;
|
|
8065
8074
|
}
|
|
8066
|
-
function
|
|
8075
|
+
function Lr(e) {
|
|
8067
8076
|
return e && e.indexOf(".") !== -1 ? (e = e.replace(/0+$/, ""), e === "." ? e = "0" : e[0] === "." ? e = "0" + e : e[e.length - 1] === "." && (e = e.substring(0, e.length - 1)), e) : e;
|
|
8068
8077
|
}
|
|
8069
|
-
function
|
|
8078
|
+
function Rr(e, t) {
|
|
8070
8079
|
if (parseInt) return parseInt(e, t);
|
|
8071
8080
|
if (Number.parseInt) return Number.parseInt(e, t);
|
|
8072
8081
|
if (window && window.parseInt) return window.parseInt(e, t);
|
|
8073
8082
|
throw Error("parseInt, Number.parseInt, window.parseInt are not supported");
|
|
8074
8083
|
}
|
|
8075
|
-
function
|
|
8084
|
+
function zr(e, t, n) {
|
|
8076
8085
|
let r = t === Infinity;
|
|
8077
8086
|
switch (n.infinity.toLowerCase()) {
|
|
8078
8087
|
case "null": return null;
|
|
@@ -8083,14 +8092,14 @@ function Rr(e, t, n) {
|
|
|
8083
8092
|
}
|
|
8084
8093
|
//#endregion
|
|
8085
8094
|
//#region node_modules/fast-xml-parser/src/ignoreAttributes.js
|
|
8086
|
-
function
|
|
8095
|
+
function Br(e) {
|
|
8087
8096
|
return typeof e == "function" ? e : Array.isArray(e) ? (t) => {
|
|
8088
8097
|
for (let n of e) if (typeof n == "string" && t === n || n instanceof RegExp && n.test(t)) return !0;
|
|
8089
8098
|
} : () => !1;
|
|
8090
8099
|
}
|
|
8091
8100
|
//#endregion
|
|
8092
8101
|
//#region node_modules/path-expression-matcher/src/Expression.js
|
|
8093
|
-
var
|
|
8102
|
+
var Vr = class {
|
|
8094
8103
|
constructor(e, t = {}) {
|
|
8095
8104
|
this.pattern = e, this.separator = t.separator || ".", this.segments = this._parse(e), this._hasDeepWildcard = this.segments.some((e) => e.type === "deep-wildcard"), this._hasAttributeCondition = this.segments.some((e) => e.attrName !== void 0), this._hasPositionSelector = this.segments.some((e) => e.position !== void 0);
|
|
8096
8105
|
}
|
|
@@ -8146,13 +8155,13 @@ var Br = class {
|
|
|
8146
8155
|
toString() {
|
|
8147
8156
|
return this.pattern;
|
|
8148
8157
|
}
|
|
8149
|
-
},
|
|
8158
|
+
}, Hr = new Set([
|
|
8150
8159
|
"push",
|
|
8151
8160
|
"pop",
|
|
8152
8161
|
"reset",
|
|
8153
8162
|
"updateCurrent",
|
|
8154
8163
|
"restore"
|
|
8155
|
-
]),
|
|
8164
|
+
]), Ur = class {
|
|
8156
8165
|
constructor(e = {}) {
|
|
8157
8166
|
this.separator = e.separator || ".", this.path = [], this.siblingStacks = [];
|
|
8158
8167
|
}
|
|
@@ -8283,7 +8292,7 @@ var Br = class {
|
|
|
8283
8292
|
readOnly() {
|
|
8284
8293
|
return new Proxy(this, {
|
|
8285
8294
|
get(e, t, n) {
|
|
8286
|
-
if (
|
|
8295
|
+
if (Hr.has(t)) return () => {
|
|
8287
8296
|
throw TypeError(`Cannot call '${t}' on a read-only Matcher. Obtain a writable instance to mutate state.`);
|
|
8288
8297
|
};
|
|
8289
8298
|
let r = Reflect.get(e, t, n);
|
|
@@ -8300,7 +8309,7 @@ var Br = class {
|
|
|
8300
8309
|
};
|
|
8301
8310
|
//#endregion
|
|
8302
8311
|
//#region node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js
|
|
8303
|
-
function
|
|
8312
|
+
function Wr(e, t) {
|
|
8304
8313
|
if (!e) return {};
|
|
8305
8314
|
let n = t.attributesGroupName ? e[t.attributesGroupName] : e;
|
|
8306
8315
|
if (!n) return {};
|
|
@@ -8311,7 +8320,7 @@ function Ur(e, t) {
|
|
|
8311
8320
|
} else r[e] = n[e];
|
|
8312
8321
|
return r;
|
|
8313
8322
|
}
|
|
8314
|
-
function
|
|
8323
|
+
function Gr(e) {
|
|
8315
8324
|
if (!e || typeof e != "string") return;
|
|
8316
8325
|
let t = e.indexOf(":");
|
|
8317
8326
|
if (t !== -1 && t > 0) {
|
|
@@ -8319,7 +8328,7 @@ function Wr(e) {
|
|
|
8319
8328
|
if (n !== "xmlns") return n;
|
|
8320
8329
|
}
|
|
8321
8330
|
}
|
|
8322
|
-
var
|
|
8331
|
+
var Kr = class {
|
|
8323
8332
|
constructor(e) {
|
|
8324
8333
|
if (this.options = e, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = {
|
|
8325
8334
|
apos: {
|
|
@@ -8376,22 +8385,22 @@ var Gr = class {
|
|
|
8376
8385
|
},
|
|
8377
8386
|
num_dec: {
|
|
8378
8387
|
regex: /&#([0-9]{1,7});/g,
|
|
8379
|
-
val: (e, t) =>
|
|
8388
|
+
val: (e, t) => ci(t, 10, "&#")
|
|
8380
8389
|
},
|
|
8381
8390
|
num_hex: {
|
|
8382
8391
|
regex: /&#x([0-9a-fA-F]{1,6});/g,
|
|
8383
|
-
val: (e, t) =>
|
|
8392
|
+
val: (e, t) => ci(t, 16, "&#x")
|
|
8384
8393
|
}
|
|
8385
|
-
}, this.addExternalEntities =
|
|
8394
|
+
}, this.addExternalEntities = qr, this.parseXml = Qr, this.parseTextData = Jr, this.resolveNameSpace = Yr, this.buildAttributesMap = Zr, this.isItStopNode = ni, this.replaceEntitiesValue = ei, this.readStopNodeData = oi, this.saveTextToParentTag = ti, this.addChild = $r, this.ignoreAttributesFn = Br(this.options.ignoreAttributes), this.entityExpansionCount = 0, this.currentExpandedLength = 0, this.matcher = new Ur(), this.readonlyMatcher = this.matcher.readOnly(), this.isCurrentNodeStopNode = !1, this.options.stopNodes && this.options.stopNodes.length > 0) {
|
|
8386
8395
|
this.stopNodeExpressions = [];
|
|
8387
8396
|
for (let e = 0; e < this.options.stopNodes.length; e++) {
|
|
8388
8397
|
let t = this.options.stopNodes[e];
|
|
8389
|
-
typeof t == "string" ? this.stopNodeExpressions.push(new
|
|
8398
|
+
typeof t == "string" ? this.stopNodeExpressions.push(new Vr(t)) : t instanceof Vr && this.stopNodeExpressions.push(t);
|
|
8390
8399
|
}
|
|
8391
8400
|
}
|
|
8392
8401
|
}
|
|
8393
8402
|
};
|
|
8394
|
-
function
|
|
8403
|
+
function qr(e) {
|
|
8395
8404
|
let t = Object.keys(e);
|
|
8396
8405
|
for (let n = 0; n < t.length; n++) {
|
|
8397
8406
|
let r = t[n], i = r.replace(/[.\-+*:]/g, "\\.");
|
|
@@ -8401,14 +8410,14 @@ function Kr(e) {
|
|
|
8401
8410
|
};
|
|
8402
8411
|
}
|
|
8403
8412
|
}
|
|
8404
|
-
function
|
|
8413
|
+
function Jr(e, t, n, r, i, a, o) {
|
|
8405
8414
|
if (e !== void 0 && (this.options.trimValues && !r && (e = e.trim()), e.length > 0)) {
|
|
8406
8415
|
o || (e = this.replaceEntitiesValue(e, t, n));
|
|
8407
8416
|
let r = this.options.jPath ? n.toString() : n, s = this.options.tagValueProcessor(t, e, r, i, a);
|
|
8408
|
-
return s == null ? e : typeof s != typeof e || s !== e ? s : this.options.trimValues || e.trim() === e ?
|
|
8417
|
+
return s == null ? e : typeof s != typeof e || s !== e ? s : this.options.trimValues || e.trim() === e ? si(e, this.options.parseTagValue, this.options.numberParseOptions) : e;
|
|
8409
8418
|
}
|
|
8410
8419
|
}
|
|
8411
|
-
function
|
|
8420
|
+
function Yr(e) {
|
|
8412
8421
|
if (this.options.removeNSPrefix) {
|
|
8413
8422
|
let t = e.split(":"), n = e.charAt(0) === "/" ? "/" : "";
|
|
8414
8423
|
if (t[0] === "xmlns") return "";
|
|
@@ -8416,10 +8425,10 @@ function Jr(e) {
|
|
|
8416
8425
|
}
|
|
8417
8426
|
return e;
|
|
8418
8427
|
}
|
|
8419
|
-
var
|
|
8420
|
-
function
|
|
8428
|
+
var Xr = /* @__PURE__ */ RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?", "gm");
|
|
8429
|
+
function Zr(e, t, n) {
|
|
8421
8430
|
if (this.options.ignoreAttributes !== !0 && typeof e == "string") {
|
|
8422
|
-
let r =
|
|
8431
|
+
let r = tr(e, Xr), i = r.length, a = {}, o = {};
|
|
8423
8432
|
for (let e = 0; e < i; e++) {
|
|
8424
8433
|
let t = this.resolveNameSpace(r[e][1]), i = r[e][4];
|
|
8425
8434
|
if (t.length && i !== void 0) {
|
|
@@ -8432,10 +8441,10 @@ function Xr(e, t, n) {
|
|
|
8432
8441
|
let i = this.resolveNameSpace(r[e][1]), o = this.options.jPath ? t.toString() : this.readonlyMatcher;
|
|
8433
8442
|
if (this.ignoreAttributesFn(i, o)) continue;
|
|
8434
8443
|
let s = r[e][4], c = this.options.attributeNamePrefix + i;
|
|
8435
|
-
if (i.length) if (this.options.transformAttributeName && (c = this.options.transformAttributeName(c)), c =
|
|
8444
|
+
if (i.length) if (this.options.transformAttributeName && (c = this.options.transformAttributeName(c)), c = ui(c, this.options), s !== void 0) {
|
|
8436
8445
|
this.options.trimValues && (s = s.trim()), s = this.replaceEntitiesValue(s, n, this.readonlyMatcher);
|
|
8437
8446
|
let e = this.options.jPath ? t.toString() : this.readonlyMatcher, r = this.options.attributeValueProcessor(i, s, e);
|
|
8438
|
-
r == null ? a[c] = s : typeof r != typeof s || r !== s ? a[c] = r : a[c] =
|
|
8447
|
+
r == null ? a[c] = s : typeof r != typeof s || r !== s ? a[c] = r : a[c] = si(s, this.options.parseAttributeValue, this.options.numberParseOptions);
|
|
8439
8448
|
} else this.options.allowBooleanAttributes && (a[c] = !0);
|
|
8440
8449
|
}
|
|
8441
8450
|
if (!Object.keys(a).length) return;
|
|
@@ -8446,31 +8455,31 @@ function Xr(e, t, n) {
|
|
|
8446
8455
|
return a;
|
|
8447
8456
|
}
|
|
8448
8457
|
}
|
|
8449
|
-
var
|
|
8458
|
+
var Qr = function(e) {
|
|
8450
8459
|
e = e.replace(/\r\n?/g, "\n");
|
|
8451
|
-
let t = new
|
|
8460
|
+
let t = new Dr("!xml"), n = t, r = "";
|
|
8452
8461
|
this.matcher.reset(), this.entityExpansionCount = 0, this.currentExpandedLength = 0;
|
|
8453
|
-
let i = new
|
|
8462
|
+
let i = new Or(this.options.processEntities);
|
|
8454
8463
|
for (let a = 0; a < e.length; a++) if (e[a] === "<") if (e[a + 1] === "/") {
|
|
8455
|
-
let t =
|
|
8464
|
+
let t = ii(e, ">", a, "Closing Tag is not closed."), i = e.substring(a + 2, t).trim();
|
|
8456
8465
|
if (this.options.removeNSPrefix) {
|
|
8457
8466
|
let e = i.indexOf(":");
|
|
8458
8467
|
e !== -1 && (i = i.substr(e + 1));
|
|
8459
8468
|
}
|
|
8460
|
-
i =
|
|
8469
|
+
i = li(this.options.transformTagName, i, "", this.options).tagName, n && (r = this.saveTextToParentTag(r, n, this.readonlyMatcher));
|
|
8461
8470
|
let o = this.matcher.getCurrentTag();
|
|
8462
8471
|
if (i && this.options.unpairedTags.indexOf(i) !== -1) throw Error(`Unpaired tag can not be used as closing tag: </${i}>`);
|
|
8463
8472
|
o && this.options.unpairedTags.indexOf(o) !== -1 && (this.matcher.pop(), this.tagsNodeStack.pop()), this.matcher.pop(), this.isCurrentNodeStopNode = !1, n = this.tagsNodeStack.pop(), r = "", a = t;
|
|
8464
8473
|
} else if (e[a + 1] === "?") {
|
|
8465
|
-
let t =
|
|
8474
|
+
let t = ai(e, a, !1, "?>");
|
|
8466
8475
|
if (!t) throw Error("Pi Tag is not closed.");
|
|
8467
8476
|
if (r = this.saveTextToParentTag(r, n, this.readonlyMatcher), !(this.options.ignoreDeclaration && t.tagName === "?xml" || this.options.ignorePiTags)) {
|
|
8468
|
-
let e = new
|
|
8477
|
+
let e = new Dr(t.tagName);
|
|
8469
8478
|
e.add(this.options.textNodeName, ""), t.tagName !== t.tagExp && t.attrExpPresent && (e[":@"] = this.buildAttributesMap(t.tagExp, this.matcher, t.tagName)), this.addChild(n, e, this.readonlyMatcher, a);
|
|
8470
8479
|
}
|
|
8471
8480
|
a = t.closeIndex + 1;
|
|
8472
8481
|
} else if (e.substr(a + 1, 3) === "!--") {
|
|
8473
|
-
let t =
|
|
8482
|
+
let t = ii(e, "-->", a + 4, "Comment is not closed.");
|
|
8474
8483
|
if (this.options.commentPropName) {
|
|
8475
8484
|
let i = e.substring(a + 4, t - 2);
|
|
8476
8485
|
r = this.saveTextToParentTag(r, n, this.readonlyMatcher), n.add(this.options.commentPropName, [{ [this.options.textNodeName]: i }]);
|
|
@@ -8480,25 +8489,25 @@ var Zr = function(e) {
|
|
|
8480
8489
|
let t = i.readDocType(e, a);
|
|
8481
8490
|
this.docTypeEntities = t.entities, a = t.i;
|
|
8482
8491
|
} else if (e.substr(a + 1, 2) === "![") {
|
|
8483
|
-
let t =
|
|
8492
|
+
let t = ii(e, "]]>", a, "CDATA is not closed.") - 2, i = e.substring(a + 9, t);
|
|
8484
8493
|
r = this.saveTextToParentTag(r, n, this.readonlyMatcher);
|
|
8485
8494
|
let o = this.parseTextData(i, n.tagname, this.readonlyMatcher, !0, !1, !0, !0);
|
|
8486
8495
|
o ??= "", this.options.cdataPropName ? n.add(this.options.cdataPropName, [{ [this.options.textNodeName]: i }]) : n.add(this.options.textNodeName, o), a = t + 2;
|
|
8487
8496
|
} else {
|
|
8488
|
-
let i =
|
|
8497
|
+
let i = ai(e, a, this.options.removeNSPrefix);
|
|
8489
8498
|
if (!i) {
|
|
8490
8499
|
let t = e.substring(Math.max(0, a - 50), Math.min(e.length, a + 50));
|
|
8491
8500
|
throw Error(`readTagExp returned undefined at position ${a}. Context: "${t}"`);
|
|
8492
8501
|
}
|
|
8493
8502
|
let o = i.tagName, s = i.rawTagName, c = i.tagExp, l = i.attrExpPresent, u = i.closeIndex;
|
|
8494
|
-
if ({tagName: o, tagExp: c} =
|
|
8503
|
+
if ({tagName: o, tagExp: c} = li(this.options.transformTagName, o, c, this.options), this.options.strictReservedNames && (o === this.options.commentPropName || o === this.options.cdataPropName || o === this.options.textNodeName || o === this.options.attributesGroupName)) throw Error(`Invalid tag name: ${o}`);
|
|
8495
8504
|
n && r && n.tagname !== "!xml" && (r = this.saveTextToParentTag(r, n, this.readonlyMatcher, !1));
|
|
8496
8505
|
let d = n;
|
|
8497
8506
|
d && this.options.unpairedTags.indexOf(d.tagname) !== -1 && (n = this.tagsNodeStack.pop(), this.matcher.pop());
|
|
8498
8507
|
let f = !1;
|
|
8499
8508
|
c.length > 0 && c.lastIndexOf("/") === c.length - 1 && (f = !0, o[o.length - 1] === "/" ? (o = o.substr(0, o.length - 1), c = o) : c = c.substr(0, c.length - 1), l = o !== c);
|
|
8500
8509
|
let p = null, m;
|
|
8501
|
-
m =
|
|
8510
|
+
m = Gr(s), o !== t.tagname && this.matcher.push(o, {}, m), o !== c && l && (p = this.buildAttributesMap(c, this.matcher, o), p && Wr(p, this.options)), o !== t.tagname && (this.isCurrentNodeStopNode = this.isItStopNode(this.stopNodeExpressions, this.matcher));
|
|
8502
8511
|
let h = a;
|
|
8503
8512
|
if (this.isCurrentNodeStopNode) {
|
|
8504
8513
|
let t = "";
|
|
@@ -8509,19 +8518,19 @@ var Zr = function(e) {
|
|
|
8509
8518
|
if (!n) throw Error(`Unexpected end of ${s}`);
|
|
8510
8519
|
a = n.i, t = n.tagContent;
|
|
8511
8520
|
}
|
|
8512
|
-
let r = new
|
|
8521
|
+
let r = new Dr(o);
|
|
8513
8522
|
p && (r[":@"] = p), r.add(this.options.textNodeName, t), this.matcher.pop(), this.isCurrentNodeStopNode = !1, this.addChild(n, r, this.readonlyMatcher, h);
|
|
8514
8523
|
} else {
|
|
8515
8524
|
if (f) {
|
|
8516
|
-
({tagName: o, tagExp: c} =
|
|
8517
|
-
let e = new
|
|
8525
|
+
({tagName: o, tagExp: c} = li(this.options.transformTagName, o, c, this.options));
|
|
8526
|
+
let e = new Dr(o);
|
|
8518
8527
|
p && (e[":@"] = p), this.addChild(n, e, this.readonlyMatcher, h), this.matcher.pop(), this.isCurrentNodeStopNode = !1;
|
|
8519
8528
|
} else if (this.options.unpairedTags.indexOf(o) !== -1) {
|
|
8520
|
-
let e = new
|
|
8529
|
+
let e = new Dr(o);
|
|
8521
8530
|
p && (e[":@"] = p), this.addChild(n, e, this.readonlyMatcher, h), this.matcher.pop(), this.isCurrentNodeStopNode = !1, a = i.closeIndex;
|
|
8522
8531
|
continue;
|
|
8523
8532
|
} else {
|
|
8524
|
-
let e = new
|
|
8533
|
+
let e = new Dr(o);
|
|
8525
8534
|
if (this.tagsNodeStack.length > this.options.maxNestedTags) throw Error("Maximum nested tags exceeded");
|
|
8526
8535
|
this.tagsNodeStack.push(n), p && (e[":@"] = p), this.addChild(n, e, this.readonlyMatcher, h), n = e;
|
|
8527
8536
|
}
|
|
@@ -8531,12 +8540,12 @@ var Zr = function(e) {
|
|
|
8531
8540
|
else r += e[a];
|
|
8532
8541
|
return t.child;
|
|
8533
8542
|
};
|
|
8534
|
-
function
|
|
8543
|
+
function $r(e, t, n, r) {
|
|
8535
8544
|
this.options.captureMetaData || (r = void 0);
|
|
8536
8545
|
let i = this.options.jPath ? n.toString() : n, a = this.options.updateTag(t.tagname, i, t[":@"]);
|
|
8537
8546
|
a === !1 || (typeof a == "string" && (t.tagname = a), e.addChild(t, r));
|
|
8538
8547
|
}
|
|
8539
|
-
function
|
|
8548
|
+
function ei(e, t, n) {
|
|
8540
8549
|
let r = this.options.processEntities;
|
|
8541
8550
|
if (!r || !r.enabled) return e;
|
|
8542
8551
|
if (r.allowedTags) {
|
|
@@ -8568,15 +8577,15 @@ function $r(e, t, n) {
|
|
|
8568
8577
|
}
|
|
8569
8578
|
return e = e.replace(this.ampEntity.regex, this.ampEntity.val), e;
|
|
8570
8579
|
}
|
|
8571
|
-
function
|
|
8580
|
+
function ti(e, t, n, r) {
|
|
8572
8581
|
return e &&= (r === void 0 && (r = t.child.length === 0), e = this.parseTextData(e, t.tagname, n, !1, t[":@"] ? Object.keys(t[":@"]).length !== 0 : !1, r), e !== void 0 && e !== "" && t.add(this.options.textNodeName, e), ""), e;
|
|
8573
8582
|
}
|
|
8574
|
-
function
|
|
8583
|
+
function ni(e, t) {
|
|
8575
8584
|
if (!e || e.length === 0) return !1;
|
|
8576
8585
|
for (let n = 0; n < e.length; n++) if (t.matches(e[n])) return !0;
|
|
8577
8586
|
return !1;
|
|
8578
8587
|
}
|
|
8579
|
-
function
|
|
8588
|
+
function ri(e, t, n = ">") {
|
|
8580
8589
|
let r, i = "";
|
|
8581
8590
|
for (let a = t; a < e.length; a++) {
|
|
8582
8591
|
let t = e[a];
|
|
@@ -8595,13 +8604,13 @@ function ni(e, t, n = ">") {
|
|
|
8595
8604
|
i += t;
|
|
8596
8605
|
}
|
|
8597
8606
|
}
|
|
8598
|
-
function
|
|
8607
|
+
function ii(e, t, n, r) {
|
|
8599
8608
|
let i = e.indexOf(t, n);
|
|
8600
8609
|
if (i === -1) throw Error(r);
|
|
8601
8610
|
return i + t.length - 1;
|
|
8602
8611
|
}
|
|
8603
|
-
function
|
|
8604
|
-
let i =
|
|
8612
|
+
function ai(e, t, n, r = ">") {
|
|
8613
|
+
let i = ri(e, t + 1, r);
|
|
8605
8614
|
if (!i) return;
|
|
8606
8615
|
let a = i.data, o = i.index, s = a.search(/\s/), c = a, l = !0;
|
|
8607
8616
|
s !== -1 && (c = a.substring(0, s), a = a.substring(s + 1).trimStart());
|
|
@@ -8618,52 +8627,52 @@ function ii(e, t, n, r = ">") {
|
|
|
8618
8627
|
rawTagName: u
|
|
8619
8628
|
};
|
|
8620
8629
|
}
|
|
8621
|
-
function
|
|
8630
|
+
function oi(e, t, n) {
|
|
8622
8631
|
let r = n, i = 1;
|
|
8623
8632
|
for (; n < e.length; n++) if (e[n] === "<") if (e[n + 1] === "/") {
|
|
8624
|
-
let a =
|
|
8633
|
+
let a = ii(e, ">", n, `${t} is not closed`);
|
|
8625
8634
|
if (e.substring(n + 2, a).trim() === t && (i--, i === 0)) return {
|
|
8626
8635
|
tagContent: e.substring(r, n),
|
|
8627
8636
|
i: a
|
|
8628
8637
|
};
|
|
8629
8638
|
n = a;
|
|
8630
|
-
} else if (e[n + 1] === "?") n =
|
|
8631
|
-
else if (e.substr(n + 1, 3) === "!--") n =
|
|
8632
|
-
else if (e.substr(n + 1, 2) === "![") n =
|
|
8639
|
+
} else if (e[n + 1] === "?") n = ii(e, "?>", n + 1, "StopNode is not closed.");
|
|
8640
|
+
else if (e.substr(n + 1, 3) === "!--") n = ii(e, "-->", n + 3, "StopNode is not closed.");
|
|
8641
|
+
else if (e.substr(n + 1, 2) === "![") n = ii(e, "]]>", n, "StopNode is not closed.") - 2;
|
|
8633
8642
|
else {
|
|
8634
|
-
let r =
|
|
8643
|
+
let r = ai(e, n, ">");
|
|
8635
8644
|
r && ((r && r.tagName) === t && r.tagExp[r.tagExp.length - 1] !== "/" && i++, n = r.closeIndex);
|
|
8636
8645
|
}
|
|
8637
8646
|
}
|
|
8638
|
-
function
|
|
8647
|
+
function si(e, t, n) {
|
|
8639
8648
|
if (t && typeof e == "string") {
|
|
8640
8649
|
let t = e.trim();
|
|
8641
|
-
return t === "true" ? !0 : t === "false" ? !1 :
|
|
8642
|
-
} else if (
|
|
8650
|
+
return t === "true" ? !0 : t === "false" ? !1 : Pr(e, n);
|
|
8651
|
+
} else if (rr(e)) return e;
|
|
8643
8652
|
else return "";
|
|
8644
8653
|
}
|
|
8645
|
-
function
|
|
8654
|
+
function ci(e, t, n) {
|
|
8646
8655
|
let r = Number.parseInt(e, t);
|
|
8647
8656
|
return r >= 0 && r <= 1114111 ? String.fromCodePoint(r) : n + e + ";";
|
|
8648
8657
|
}
|
|
8649
|
-
function
|
|
8658
|
+
function li(e, t, n, r) {
|
|
8650
8659
|
if (e) {
|
|
8651
8660
|
let r = e(t);
|
|
8652
8661
|
n === t && (n = r), t = r;
|
|
8653
8662
|
}
|
|
8654
|
-
return t =
|
|
8663
|
+
return t = ui(t, r), {
|
|
8655
8664
|
tagName: t,
|
|
8656
8665
|
tagExp: n
|
|
8657
8666
|
};
|
|
8658
8667
|
}
|
|
8659
|
-
function
|
|
8660
|
-
if (
|
|
8661
|
-
return
|
|
8668
|
+
function ui(e, t) {
|
|
8669
|
+
if (ar.includes(e)) throw Error(`[SECURITY] Invalid name: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`);
|
|
8670
|
+
return ir.includes(e) ? t.onDangerousProperty(e) : e;
|
|
8662
8671
|
}
|
|
8663
8672
|
//#endregion
|
|
8664
8673
|
//#region node_modules/fast-xml-parser/src/xmlparser/node2json.js
|
|
8665
|
-
var
|
|
8666
|
-
function
|
|
8674
|
+
var di = Dr.getMetaDataSymbol();
|
|
8675
|
+
function fi(e, t) {
|
|
8667
8676
|
if (!e || typeof e != "object") return {};
|
|
8668
8677
|
if (!t) return e;
|
|
8669
8678
|
let n = {};
|
|
@@ -8673,22 +8682,22 @@ function di(e, t) {
|
|
|
8673
8682
|
} else n[r] = e[r];
|
|
8674
8683
|
return n;
|
|
8675
8684
|
}
|
|
8676
|
-
function fi(e, t, n, r) {
|
|
8677
|
-
return pi(e, t, n, r);
|
|
8678
|
-
}
|
|
8679
8685
|
function pi(e, t, n, r) {
|
|
8686
|
+
return mi(e, t, n, r);
|
|
8687
|
+
}
|
|
8688
|
+
function mi(e, t, n, r) {
|
|
8680
8689
|
let i, a = {};
|
|
8681
8690
|
for (let o = 0; o < e.length; o++) {
|
|
8682
|
-
let s = e[o], c =
|
|
8691
|
+
let s = e[o], c = hi(s);
|
|
8683
8692
|
if (c !== void 0 && c !== t.textNodeName) {
|
|
8684
|
-
let e =
|
|
8693
|
+
let e = fi(s[":@"] || {}, t.attributeNamePrefix);
|
|
8685
8694
|
n.push(c, e);
|
|
8686
8695
|
}
|
|
8687
8696
|
if (c === t.textNodeName) i === void 0 ? i = s[c] : i += "" + s[c];
|
|
8688
8697
|
else if (c === void 0) continue;
|
|
8689
8698
|
else if (s[c]) {
|
|
8690
|
-
let e =
|
|
8691
|
-
if (s[":@"] ?
|
|
8699
|
+
let e = mi(s[c], t, n, r), i = _i(e, t);
|
|
8700
|
+
if (s[":@"] ? gi(e, s[":@"], r, t) : Object.keys(e).length === 1 && e[t.textNodeName] !== void 0 && !t.alwaysCreateTextNode ? e = e[t.textNodeName] : Object.keys(e).length === 0 && (t.alwaysCreateTextNode ? e[t.textNodeName] = "" : e = ""), s[di] !== void 0 && typeof e == "object" && e && (e[di] = s[di]), a[c] !== void 0 && Object.prototype.hasOwnProperty.call(a, c)) Array.isArray(a[c]) || (a[c] = [a[c]]), a[c].push(e);
|
|
8692
8701
|
else {
|
|
8693
8702
|
let n = t.jPath ? r.toString() : r;
|
|
8694
8703
|
t.isArray(c, n, i) ? a[c] = [e] : a[c] = e;
|
|
@@ -8698,14 +8707,14 @@ function pi(e, t, n, r) {
|
|
|
8698
8707
|
}
|
|
8699
8708
|
return typeof i == "string" ? i.length > 0 && (a[t.textNodeName] = i) : i !== void 0 && (a[t.textNodeName] = i), a;
|
|
8700
8709
|
}
|
|
8701
|
-
function
|
|
8710
|
+
function hi(e) {
|
|
8702
8711
|
let t = Object.keys(e);
|
|
8703
8712
|
for (let e = 0; e < t.length; e++) {
|
|
8704
8713
|
let n = t[e];
|
|
8705
8714
|
if (n !== ":@") return n;
|
|
8706
8715
|
}
|
|
8707
8716
|
}
|
|
8708
|
-
function
|
|
8717
|
+
function gi(e, t, n, r) {
|
|
8709
8718
|
if (t) {
|
|
8710
8719
|
let i = Object.keys(t), a = i.length;
|
|
8711
8720
|
for (let o = 0; o < a; o++) {
|
|
@@ -8714,28 +8723,28 @@ function hi(e, t, n, r) {
|
|
|
8714
8723
|
}
|
|
8715
8724
|
}
|
|
8716
8725
|
}
|
|
8717
|
-
function
|
|
8726
|
+
function _i(e, t) {
|
|
8718
8727
|
let { textNodeName: n } = t, r = Object.keys(e).length;
|
|
8719
8728
|
return !!(r === 0 || r === 1 && (e[n] || typeof e[n] == "boolean" || e[n] === 0));
|
|
8720
8729
|
}
|
|
8721
8730
|
//#endregion
|
|
8722
8731
|
//#region node_modules/fast-xml-parser/src/xmlparser/XMLParser.js
|
|
8723
|
-
var
|
|
8732
|
+
var vi = class {
|
|
8724
8733
|
constructor(e) {
|
|
8725
|
-
this.externalEntities = {}, this.options =
|
|
8734
|
+
this.externalEntities = {}, this.options = Tr(e);
|
|
8726
8735
|
}
|
|
8727
8736
|
parse(e, t) {
|
|
8728
8737
|
if (typeof e != "string" && e.toString) e = e.toString();
|
|
8729
8738
|
else if (typeof e != "string") throw Error("XML data is accepted in String or Bytes[] form.");
|
|
8730
8739
|
if (t) {
|
|
8731
8740
|
t === !0 && (t = {});
|
|
8732
|
-
let n =
|
|
8741
|
+
let n = sr(e, t);
|
|
8733
8742
|
if (n !== !0) throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`);
|
|
8734
8743
|
}
|
|
8735
|
-
let n = new
|
|
8744
|
+
let n = new Kr(this.options);
|
|
8736
8745
|
n.addExternalEntities(this.externalEntities);
|
|
8737
8746
|
let r = n.parseXml(e);
|
|
8738
|
-
return this.options.preserveOrder || r === void 0 ? r :
|
|
8747
|
+
return this.options.preserveOrder || r === void 0 ? r : pi(r, this.options, n.matcher, n.readonlyMatcher);
|
|
8739
8748
|
}
|
|
8740
8749
|
addEntity(e, t) {
|
|
8741
8750
|
if (t.indexOf("&") !== -1) throw Error("Entity value can't have '&'");
|
|
@@ -8744,39 +8753,39 @@ var _i = class {
|
|
|
8744
8753
|
this.externalEntities[e] = t;
|
|
8745
8754
|
}
|
|
8746
8755
|
static getMetaDataSymbol() {
|
|
8747
|
-
return
|
|
8756
|
+
return Dr.getMetaDataSymbol();
|
|
8748
8757
|
}
|
|
8749
|
-
},
|
|
8750
|
-
function
|
|
8758
|
+
}, yi = "\n";
|
|
8759
|
+
function bi(e, t) {
|
|
8751
8760
|
let n = "";
|
|
8752
|
-
t.format && t.indentBy.length > 0 && (n =
|
|
8761
|
+
t.format && t.indentBy.length > 0 && (n = yi);
|
|
8753
8762
|
let r = [];
|
|
8754
8763
|
if (t.stopNodes && Array.isArray(t.stopNodes)) for (let e = 0; e < t.stopNodes.length; e++) {
|
|
8755
8764
|
let n = t.stopNodes[e];
|
|
8756
|
-
typeof n == "string" ? r.push(new
|
|
8765
|
+
typeof n == "string" ? r.push(new Vr(n)) : n instanceof Vr && r.push(n);
|
|
8757
8766
|
}
|
|
8758
|
-
let i = new
|
|
8759
|
-
return
|
|
8767
|
+
let i = new Ur();
|
|
8768
|
+
return xi(e, t, n, i, r);
|
|
8760
8769
|
}
|
|
8761
|
-
function
|
|
8770
|
+
function xi(e, t, n, r, i) {
|
|
8762
8771
|
let a = "", o = !1;
|
|
8763
8772
|
if (t.maxNestedTags && r.getDepth() > t.maxNestedTags) throw Error("Maximum nested tags exceeded");
|
|
8764
8773
|
if (!Array.isArray(e)) {
|
|
8765
8774
|
if (e != null) {
|
|
8766
8775
|
let n = e.toString();
|
|
8767
|
-
return n =
|
|
8776
|
+
return n = Oi(n, t), n;
|
|
8768
8777
|
}
|
|
8769
8778
|
return "";
|
|
8770
8779
|
}
|
|
8771
8780
|
for (let s = 0; s < e.length; s++) {
|
|
8772
|
-
let c = e[s], l =
|
|
8781
|
+
let c = e[s], l = Ti(c);
|
|
8773
8782
|
if (l === void 0) continue;
|
|
8774
|
-
let u =
|
|
8783
|
+
let u = Si(c[":@"], t);
|
|
8775
8784
|
r.push(l, u);
|
|
8776
|
-
let d =
|
|
8785
|
+
let d = Di(r, i);
|
|
8777
8786
|
if (l === t.textNodeName) {
|
|
8778
8787
|
let e = c[l];
|
|
8779
|
-
d || (e = t.tagValueProcessor(l, e), e =
|
|
8788
|
+
d || (e = t.tagValueProcessor(l, e), e = Oi(e, t)), o && (a += n), a += e, o = !1, r.pop();
|
|
8780
8789
|
continue;
|
|
8781
8790
|
} else if (l === t.cdataPropName) {
|
|
8782
8791
|
o && (a += n), a += `<![CDATA[${c[l][0][t.textNodeName]}]]>`, o = !1, r.pop();
|
|
@@ -8785,18 +8794,18 @@ function bi(e, t, n, r, i) {
|
|
|
8785
8794
|
a += n + `<!--${c[l][0][t.textNodeName]}-->`, o = !0, r.pop();
|
|
8786
8795
|
continue;
|
|
8787
8796
|
} else if (l[0] === "?") {
|
|
8788
|
-
let e =
|
|
8797
|
+
let e = Ei(c[":@"], t, d), i = l === "?xml" ? "" : n, s = c[l][0][t.textNodeName];
|
|
8789
8798
|
s = s.length === 0 ? "" : " " + s, a += i + `<${l}${s}${e}?>`, o = !0, r.pop();
|
|
8790
8799
|
continue;
|
|
8791
8800
|
}
|
|
8792
8801
|
let f = n;
|
|
8793
8802
|
f !== "" && (f += t.indentBy);
|
|
8794
|
-
let p = n + `<${l}${
|
|
8795
|
-
m = d ?
|
|
8803
|
+
let p = n + `<${l}${Ei(c[":@"], t, d)}`, m;
|
|
8804
|
+
m = d ? Ci(c[l], t) : xi(c[l], t, f, r, i), t.unpairedTags.indexOf(l) === -1 ? (!m || m.length === 0) && t.suppressEmptyNode ? a += p + "/>" : m && m.endsWith(">") ? a += p + `>${m}${n}</${l}>` : (a += p + ">", m && n !== "" && (m.includes("/>") || m.includes("</")) ? a += n + t.indentBy + m + n : a += m, a += `</${l}>`) : t.suppressUnpairedNode ? a += p + ">" : a += p + "/>", o = !0, r.pop();
|
|
8796
8805
|
}
|
|
8797
8806
|
return a;
|
|
8798
8807
|
}
|
|
8799
|
-
function
|
|
8808
|
+
function Si(e, t) {
|
|
8800
8809
|
if (!e || t.ignoreAttributes) return null;
|
|
8801
8810
|
let n = {}, r = !1;
|
|
8802
8811
|
for (let i in e) {
|
|
@@ -8806,23 +8815,23 @@ function xi(e, t) {
|
|
|
8806
8815
|
}
|
|
8807
8816
|
return r ? n : null;
|
|
8808
8817
|
}
|
|
8809
|
-
function
|
|
8818
|
+
function Ci(e, t) {
|
|
8810
8819
|
if (!Array.isArray(e)) return e == null ? "" : e.toString();
|
|
8811
8820
|
let n = "";
|
|
8812
8821
|
for (let r = 0; r < e.length; r++) {
|
|
8813
|
-
let i = e[r], a =
|
|
8822
|
+
let i = e[r], a = Ti(i);
|
|
8814
8823
|
if (a === t.textNodeName) n += i[a];
|
|
8815
8824
|
else if (a === t.cdataPropName) n += i[a][0][t.textNodeName];
|
|
8816
8825
|
else if (a === t.commentPropName) n += i[a][0][t.textNodeName];
|
|
8817
8826
|
else if (a && a[0] === "?") continue;
|
|
8818
8827
|
else if (a) {
|
|
8819
|
-
let e =
|
|
8828
|
+
let e = wi(i[":@"], t), r = Ci(i[a], t);
|
|
8820
8829
|
!r || r.length === 0 ? n += `<${a}${e}/>` : n += `<${a}${e}>${r}</${a}>`;
|
|
8821
8830
|
}
|
|
8822
8831
|
}
|
|
8823
8832
|
return n;
|
|
8824
8833
|
}
|
|
8825
|
-
function
|
|
8834
|
+
function wi(e, t) {
|
|
8826
8835
|
let n = "";
|
|
8827
8836
|
if (e && !t.ignoreAttributes) for (let r in e) {
|
|
8828
8837
|
if (!Object.prototype.hasOwnProperty.call(e, r)) continue;
|
|
@@ -8831,28 +8840,28 @@ function Ci(e, t) {
|
|
|
8831
8840
|
}
|
|
8832
8841
|
return n;
|
|
8833
8842
|
}
|
|
8834
|
-
function
|
|
8843
|
+
function Ti(e) {
|
|
8835
8844
|
let t = Object.keys(e);
|
|
8836
8845
|
for (let n = 0; n < t.length; n++) {
|
|
8837
8846
|
let r = t[n];
|
|
8838
8847
|
if (Object.prototype.hasOwnProperty.call(e, r) && r !== ":@") return r;
|
|
8839
8848
|
}
|
|
8840
8849
|
}
|
|
8841
|
-
function
|
|
8850
|
+
function Ei(e, t, n) {
|
|
8842
8851
|
let r = "";
|
|
8843
8852
|
if (e && !t.ignoreAttributes) for (let i in e) {
|
|
8844
8853
|
if (!Object.prototype.hasOwnProperty.call(e, i)) continue;
|
|
8845
8854
|
let a;
|
|
8846
|
-
n ? a = e[i] : (a = t.attributeValueProcessor(i, e[i]), a =
|
|
8855
|
+
n ? a = e[i] : (a = t.attributeValueProcessor(i, e[i]), a = Oi(a, t)), a === !0 && t.suppressBooleanAttributes ? r += ` ${i.substr(t.attributeNamePrefix.length)}` : r += ` ${i.substr(t.attributeNamePrefix.length)}="${a}"`;
|
|
8847
8856
|
}
|
|
8848
8857
|
return r;
|
|
8849
8858
|
}
|
|
8850
|
-
function
|
|
8859
|
+
function Di(e, t) {
|
|
8851
8860
|
if (!t || t.length === 0) return !1;
|
|
8852
8861
|
for (let n = 0; n < t.length; n++) if (e.matches(t[n])) return !0;
|
|
8853
8862
|
return !1;
|
|
8854
8863
|
}
|
|
8855
|
-
function
|
|
8864
|
+
function Oi(e, t) {
|
|
8856
8865
|
if (e && e.length > 0 && t.processEntities) for (let n = 0; n < t.entities.length; n++) {
|
|
8857
8866
|
let r = t.entities[n];
|
|
8858
8867
|
e = e.replace(r.regex, r.val);
|
|
@@ -8861,14 +8870,14 @@ function Di(e, t) {
|
|
|
8861
8870
|
}
|
|
8862
8871
|
//#endregion
|
|
8863
8872
|
//#region node_modules/fast-xml-builder/src/ignoreAttributes.js
|
|
8864
|
-
function
|
|
8873
|
+
function ki(e) {
|
|
8865
8874
|
return typeof e == "function" ? e : Array.isArray(e) ? (t) => {
|
|
8866
8875
|
for (let n of e) if (typeof n == "string" && t === n || n instanceof RegExp && n.test(t)) return !0;
|
|
8867
8876
|
} : () => !1;
|
|
8868
8877
|
}
|
|
8869
8878
|
//#endregion
|
|
8870
8879
|
//#region node_modules/fast-xml-builder/src/fxb.js
|
|
8871
|
-
var
|
|
8880
|
+
var Ai = {
|
|
8872
8881
|
attributeNamePrefix: "@_",
|
|
8873
8882
|
attributesGroupName: !1,
|
|
8874
8883
|
textNodeName: "#text",
|
|
@@ -8916,25 +8925,25 @@ var ki = {
|
|
|
8916
8925
|
maxNestedTags: 100,
|
|
8917
8926
|
jPath: !0
|
|
8918
8927
|
};
|
|
8919
|
-
function
|
|
8920
|
-
if (this.options = Object.assign({},
|
|
8928
|
+
function ji(e) {
|
|
8929
|
+
if (this.options = Object.assign({}, Ai, e), this.options.stopNodes && Array.isArray(this.options.stopNodes) && (this.options.stopNodes = this.options.stopNodes.map((e) => typeof e == "string" && e.startsWith("*.") ? ".." + e.substring(2) : e)), this.stopNodeExpressions = [], this.options.stopNodes && Array.isArray(this.options.stopNodes)) for (let e = 0; e < this.options.stopNodes.length; e++) {
|
|
8921
8930
|
let t = this.options.stopNodes[e];
|
|
8922
|
-
typeof t == "string" ? this.stopNodeExpressions.push(new
|
|
8931
|
+
typeof t == "string" ? this.stopNodeExpressions.push(new Vr(t)) : t instanceof Vr && this.stopNodeExpressions.push(t);
|
|
8923
8932
|
}
|
|
8924
8933
|
this.options.ignoreAttributes === !0 || this.options.attributesGroupName ? this.isAttribute = function() {
|
|
8925
8934
|
return !1;
|
|
8926
|
-
} : (this.ignoreAttributesFn =
|
|
8935
|
+
} : (this.ignoreAttributesFn = ki(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = Pi), this.processTextOrObjNode = Mi, this.options.format ? (this.indentate = Ni, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() {
|
|
8927
8936
|
return "";
|
|
8928
8937
|
}, this.tagEndChar = ">", this.newLine = "");
|
|
8929
8938
|
}
|
|
8930
|
-
|
|
8931
|
-
if (this.options.preserveOrder) return
|
|
8939
|
+
ji.prototype.build = function(e) {
|
|
8940
|
+
if (this.options.preserveOrder) return bi(e, this.options);
|
|
8932
8941
|
{
|
|
8933
8942
|
Array.isArray(e) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (e = { [this.options.arrayNodeName]: e });
|
|
8934
|
-
let t = new
|
|
8943
|
+
let t = new Ur();
|
|
8935
8944
|
return this.j2x(e, 0, t).val;
|
|
8936
8945
|
}
|
|
8937
|
-
},
|
|
8946
|
+
}, ji.prototype.j2x = function(e, t, n) {
|
|
8938
8947
|
let r = "", i = "";
|
|
8939
8948
|
if (this.options.maxNestedTags && n.getDepth() >= this.options.maxNestedTags) throw Error("Maximum nested tags exceeded");
|
|
8940
8949
|
let a = this.options.jPath ? n.toString() : n, o = this.checkStopNode(n);
|
|
@@ -8986,10 +8995,10 @@ Ai.prototype.build = function(e) {
|
|
|
8986
8995
|
attrStr: r,
|
|
8987
8996
|
val: i
|
|
8988
8997
|
};
|
|
8989
|
-
},
|
|
8998
|
+
}, ji.prototype.buildAttrPairStr = function(e, t, n) {
|
|
8990
8999
|
return n || (t = this.options.attributeValueProcessor(e, "" + t), t = this.replaceEntitiesValue(t)), this.options.suppressBooleanAttributes && t === "true" ? " " + e : " " + e + "=\"" + t + "\"";
|
|
8991
9000
|
};
|
|
8992
|
-
function
|
|
9001
|
+
function Mi(e, t, n, r) {
|
|
8993
9002
|
let i = this.extractAttributes(e);
|
|
8994
9003
|
if (r.push(t, i), this.checkStopNode(r)) {
|
|
8995
9004
|
let i = this.buildRawContent(e), a = this.buildAttributesForStopNode(e);
|
|
@@ -8998,7 +9007,7 @@ function ji(e, t, n, r) {
|
|
|
8998
9007
|
let a = this.j2x(e, n + 1, r);
|
|
8999
9008
|
return r.pop(), e[this.options.textNodeName] !== void 0 && Object.keys(e).length === 1 ? this.buildTextValNode(e[this.options.textNodeName], t, a.attrStr, n, r) : this.buildObjectNode(a.val, t, a.attrStr, n);
|
|
9000
9009
|
}
|
|
9001
|
-
|
|
9010
|
+
ji.prototype.extractAttributes = function(e) {
|
|
9002
9011
|
if (!e || typeof e != "object") return null;
|
|
9003
9012
|
let t = {}, n = !1;
|
|
9004
9013
|
if (this.options.attributesGroupName && e[this.options.attributesGroupName]) {
|
|
@@ -9014,7 +9023,7 @@ Ai.prototype.extractAttributes = function(e) {
|
|
|
9014
9023
|
i && (t[i] = e[r], n = !0);
|
|
9015
9024
|
}
|
|
9016
9025
|
return n ? t : null;
|
|
9017
|
-
},
|
|
9026
|
+
}, ji.prototype.buildRawContent = function(e) {
|
|
9018
9027
|
if (typeof e == "string") return e;
|
|
9019
9028
|
if (typeof e != "object" || !e) return String(e);
|
|
9020
9029
|
if (e[this.options.textNodeName] !== void 0) return e[this.options.textNodeName];
|
|
@@ -9035,7 +9044,7 @@ Ai.prototype.extractAttributes = function(e) {
|
|
|
9035
9044
|
} else t += `<${n}>${r}</${n}>`;
|
|
9036
9045
|
}
|
|
9037
9046
|
return t;
|
|
9038
|
-
},
|
|
9047
|
+
}, ji.prototype.buildAttributesForStopNode = function(e) {
|
|
9039
9048
|
if (!e || typeof e != "object") return "";
|
|
9040
9049
|
let t = "";
|
|
9041
9050
|
if (this.options.attributesGroupName && e[this.options.attributesGroupName]) {
|
|
@@ -9054,20 +9063,20 @@ Ai.prototype.extractAttributes = function(e) {
|
|
|
9054
9063
|
}
|
|
9055
9064
|
}
|
|
9056
9065
|
return t;
|
|
9057
|
-
},
|
|
9066
|
+
}, ji.prototype.buildObjectNode = function(e, t, n, r) {
|
|
9058
9067
|
if (e === "") return t[0] === "?" ? this.indentate(r) + "<" + t + n + "?" + this.tagEndChar : this.indentate(r) + "<" + t + n + this.closeTag(t) + this.tagEndChar;
|
|
9059
9068
|
{
|
|
9060
9069
|
let i = "</" + t + this.tagEndChar, a = "";
|
|
9061
9070
|
return t[0] === "?" && (a = "?", i = ""), (n || n === "") && e.indexOf("<") === -1 ? this.indentate(r) + "<" + t + n + a + ">" + e + i : this.options.commentPropName !== !1 && t === this.options.commentPropName && a.length === 0 ? this.indentate(r) + `<!--${e}-->` + this.newLine : this.indentate(r) + "<" + t + n + a + this.tagEndChar + e + this.indentate(r) + i;
|
|
9062
9071
|
}
|
|
9063
|
-
},
|
|
9072
|
+
}, ji.prototype.closeTag = function(e) {
|
|
9064
9073
|
let t = "";
|
|
9065
9074
|
return this.options.unpairedTags.indexOf(e) === -1 ? t = this.options.suppressEmptyNode ? "/" : `></${e}` : this.options.suppressUnpairedNode || (t = "/"), t;
|
|
9066
|
-
},
|
|
9075
|
+
}, ji.prototype.checkStopNode = function(e) {
|
|
9067
9076
|
if (!this.stopNodeExpressions || this.stopNodeExpressions.length === 0) return !1;
|
|
9068
9077
|
for (let t = 0; t < this.stopNodeExpressions.length; t++) if (e.matches(this.stopNodeExpressions[t])) return !0;
|
|
9069
9078
|
return !1;
|
|
9070
|
-
},
|
|
9079
|
+
}, ji.prototype.buildTextValNode = function(e, t, n, r, i) {
|
|
9071
9080
|
if (this.options.cdataPropName !== !1 && t === this.options.cdataPropName) return this.indentate(r) + `<![CDATA[${e}]]>` + this.newLine;
|
|
9072
9081
|
if (this.options.commentPropName !== !1 && t === this.options.commentPropName) return this.indentate(r) + `<!--${e}-->` + this.newLine;
|
|
9073
9082
|
if (t[0] === "?") return this.indentate(r) + "<" + t + n + "?" + this.tagEndChar;
|
|
@@ -9075,28 +9084,28 @@ Ai.prototype.extractAttributes = function(e) {
|
|
|
9075
9084
|
let i = this.options.tagValueProcessor(t, e);
|
|
9076
9085
|
return i = this.replaceEntitiesValue(i), i === "" ? this.indentate(r) + "<" + t + n + this.closeTag(t) + this.tagEndChar : this.indentate(r) + "<" + t + n + ">" + i + "</" + t + this.tagEndChar;
|
|
9077
9086
|
}
|
|
9078
|
-
},
|
|
9087
|
+
}, ji.prototype.replaceEntitiesValue = function(e) {
|
|
9079
9088
|
if (e && e.length > 0 && this.options.processEntities) for (let t = 0; t < this.options.entities.length; t++) {
|
|
9080
9089
|
let n = this.options.entities[t];
|
|
9081
9090
|
e = e.replace(n.regex, n.val);
|
|
9082
9091
|
}
|
|
9083
9092
|
return e;
|
|
9084
9093
|
};
|
|
9085
|
-
function
|
|
9094
|
+
function Ni(e) {
|
|
9086
9095
|
return this.options.indentBy.repeat(e);
|
|
9087
9096
|
}
|
|
9088
|
-
function
|
|
9097
|
+
function Pi(e) {
|
|
9089
9098
|
return e.startsWith(this.options.attributeNamePrefix) && e !== this.options.textNodeName ? e.substr(this.attrPrefixLen) : !1;
|
|
9090
9099
|
}
|
|
9091
9100
|
//#endregion
|
|
9092
9101
|
//#region node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js
|
|
9093
|
-
var
|
|
9102
|
+
var Fi = ji, Ii = /* @__PURE__ */ a(({ fillMode: e = "preserve", svg: t, shouldStripClasses: n = !0, shouldStripIds: r = !0, shouldStripPositions: i = !0, shouldStripStyles: a = !0, ...o }, s) => {
|
|
9094
9103
|
let c = ["id"].map((e) => `@_${e}`), l = ["class"].map((e) => `@_${e}`), u = [
|
|
9095
9104
|
"fill",
|
|
9096
9105
|
"stroke",
|
|
9097
9106
|
"style"
|
|
9098
9107
|
].map((e) => `@_${e}`), d = ["x", "y"].map((e) => `@_${e}`), f = () => {
|
|
9099
|
-
let o = new
|
|
9108
|
+
let o = new vi({
|
|
9100
9109
|
attributeNamePrefix: "@_",
|
|
9101
9110
|
ignoreAttributes: !1,
|
|
9102
9111
|
ignoreDeclaration: !0,
|
|
@@ -9121,7 +9130,7 @@ var Pi = Ai, Fi = /* @__PURE__ */ a(({ fillMode: e = "preserve", svg: t, shouldS
|
|
|
9121
9130
|
}
|
|
9122
9131
|
return t;
|
|
9123
9132
|
}
|
|
9124
|
-
}), s = new
|
|
9133
|
+
}), s = new Fi({
|
|
9125
9134
|
attributeNamePrefix: "@_",
|
|
9126
9135
|
format: !1,
|
|
9127
9136
|
ignoreAttributes: !1
|
|
@@ -9134,20 +9143,20 @@ var Pi = Ai, Fi = /* @__PURE__ */ a(({ fillMode: e = "preserve", svg: t, shouldS
|
|
|
9134
9143
|
dangerouslySetInnerHTML: { __html: f() }
|
|
9135
9144
|
});
|
|
9136
9145
|
});
|
|
9137
|
-
process.env.NODE_ENV === "development" && (
|
|
9146
|
+
process.env.NODE_ENV === "development" && (Ii.displayName = "FlatSVG");
|
|
9138
9147
|
//#endregion
|
|
9139
9148
|
//#region src/primitives/Form.tsx
|
|
9140
|
-
var
|
|
9149
|
+
var Li = /* @__PURE__ */ a(({ onSubmit: e, ...t }, n) => /* @__PURE__ */ (0, D.jsx)("form", {
|
|
9141
9150
|
...t,
|
|
9142
9151
|
ref: n,
|
|
9143
9152
|
onSubmit: (t) => {
|
|
9144
9153
|
t.preventDefault(), e();
|
|
9145
9154
|
}
|
|
9146
9155
|
}));
|
|
9147
|
-
process.env.NODE_ENV !== "production" && (
|
|
9156
|
+
process.env.NODE_ENV !== "production" && (Li.displayName = "Form");
|
|
9148
9157
|
//#endregion
|
|
9149
9158
|
//#region src/primitives/MasonryGrid.tsx
|
|
9150
|
-
var
|
|
9159
|
+
var Ri = "base-", zi = /* @__PURE__ */ a(({ className: e, alignSections: t = !1, children: n, horizontalSpacing: r = 0, orientation: i = "vertical", sections: a = 3, verticalSpacing: o = 0, isReversed: l = !1, ...u }, p) => {
|
|
9151
9160
|
let m = d(null), [h, g] = f(NaN), [_, v] = f(NaN), [y, b] = f(NaN), [x, S] = f(NaN), w = () => K.from(m.current).width, T = () => K.from(m.current).height, E = () => {
|
|
9152
9161
|
let e = m.current;
|
|
9153
9162
|
if (!e) return;
|
|
@@ -9160,29 +9169,29 @@ var Li = "base-", Ri = /* @__PURE__ */ a(({ className: e, alignSections: t = !1,
|
|
|
9160
9169
|
let i = [...Array(s)].map(() => 0);
|
|
9161
9170
|
for (let e of Array.from(n)) {
|
|
9162
9171
|
if (!(e instanceof HTMLElement)) continue;
|
|
9163
|
-
let n =
|
|
9172
|
+
let n = Wi(e, a), [c, l] = Hi(i, n);
|
|
9164
9173
|
e.role = "gridcell", e.style.position = "absolute", e.style.width = `calc(${100 / s * n}% - ${r * (s - 1) / s * n}px + ${r * (n - 1)}px)`, e.style.height = "", e.style.left = `calc(${100 / s * c}% - ${r * (s - 1) / s * c}px + ${r * c}px)`, e.style.top = `${l + (l === 0 ? 0 : o)}px`;
|
|
9165
9174
|
for (let t = 0; t < n; t++) i[c + t] = l + (l === 0 ? 0 : o) + K.from(e).height;
|
|
9166
9175
|
if (t && c + n === s) {
|
|
9167
|
-
let e =
|
|
9176
|
+
let e = Ui(i);
|
|
9168
9177
|
for (let t = 0; t < s; t++) i[t] = e;
|
|
9169
9178
|
}
|
|
9170
9179
|
}
|
|
9171
|
-
let c = w(), u =
|
|
9180
|
+
let c = w(), u = Ui(i, s);
|
|
9172
9181
|
if (g(c), v(u), isNaN(u) || (e.style.height = `${u}px`), l) for (let e of Array.from(n)) e instanceof HTMLElement && (e.style.left = `calc(${c}px - ${e.style.left} - ${e.getBoundingClientRect().width}px)`);
|
|
9173
9182
|
} else {
|
|
9174
9183
|
let i = [...Array(s)].map(() => 0);
|
|
9175
9184
|
for (let e of Array.from(n)) {
|
|
9176
9185
|
if (!(e instanceof HTMLElement)) continue;
|
|
9177
|
-
let n =
|
|
9186
|
+
let n = Wi(e, a), [c, l] = Hi(i, n);
|
|
9178
9187
|
e.style.position = "absolute", e.style.width = "", e.style.height = `calc(${100 / s * n}% - ${o * (s - 1) / s * n}px + ${o * (n - 1)}px)`, e.style.top = `calc(${100 / s * c}% - ${o * (s - 1) / s * c}px + ${o * c}px)`, e.style.left = `${l + (l === 0 ? 0 : r)}px`;
|
|
9179
9188
|
for (let t = 0; t < n; t++) i[c + t] = l + (l === 0 ? 0 : r) + K.from(e).width;
|
|
9180
9189
|
if (t && c + n === s) {
|
|
9181
|
-
let e =
|
|
9190
|
+
let e = Ui(i);
|
|
9182
9191
|
for (let t = 0; t < s; t++) i[t] = e;
|
|
9183
9192
|
}
|
|
9184
9193
|
}
|
|
9185
|
-
let c = T(), u =
|
|
9194
|
+
let c = T(), u = Ui(i, s);
|
|
9186
9195
|
if (v(c), g(u), isNaN(u) || (e.style.width = `${u}px`), l) for (let e of Array.from(n)) e instanceof HTMLElement && (e.style.top = `calc(${c}px - ${e.style.top} - ${e.getBoundingClientRect().height}px)`);
|
|
9187
9196
|
}
|
|
9188
9197
|
};
|
|
@@ -9197,7 +9206,7 @@ var Li = "base-", Ri = /* @__PURE__ */ a(({ className: e, alignSections: t = !1,
|
|
|
9197
9206
|
o,
|
|
9198
9207
|
i
|
|
9199
9208
|
])), c(() => {
|
|
9200
|
-
let e =
|
|
9209
|
+
let e = Gi(m.current?.innerHTML);
|
|
9201
9210
|
if (e.length === 0) return E();
|
|
9202
9211
|
let t = e.length;
|
|
9203
9212
|
for (let n = 0; n < t; n++) {
|
|
@@ -9205,7 +9214,7 @@ var Li = "base-", Ri = /* @__PURE__ */ a(({ className: e, alignSections: t = !1,
|
|
|
9205
9214
|
r.src = t, r.onload = () => E();
|
|
9206
9215
|
}
|
|
9207
9216
|
}, [n]);
|
|
9208
|
-
let O =
|
|
9217
|
+
let O = Bi({ orientation: i }), k = Vi({
|
|
9209
9218
|
minHeight: _,
|
|
9210
9219
|
minWidth: h,
|
|
9211
9220
|
orientation: i
|
|
@@ -9222,10 +9231,10 @@ var Li = "base-", Ri = /* @__PURE__ */ a(({ className: e, alignSections: t = !1,
|
|
|
9222
9231
|
})
|
|
9223
9232
|
});
|
|
9224
9233
|
});
|
|
9225
|
-
function
|
|
9234
|
+
function Bi({ orientation: e = "horizontal" }) {
|
|
9226
9235
|
return k({ root: C(e) });
|
|
9227
9236
|
}
|
|
9228
|
-
function
|
|
9237
|
+
function Vi({ minHeight: e = NaN, minWidth: t = NaN, orientation: n = "horizontal" }) {
|
|
9229
9238
|
return j({ body: {
|
|
9230
9239
|
height: n === "horizontal" ? "100%" : "auto",
|
|
9231
9240
|
minHeight: n === "vertical" && !isNaN(e) ? `${e}px` : "",
|
|
@@ -9234,28 +9243,28 @@ function Bi({ minHeight: e = NaN, minWidth: t = NaN, orientation: n = "horizonta
|
|
|
9234
9243
|
width: n === "horizontal" ? "auto" : "100%"
|
|
9235
9244
|
} });
|
|
9236
9245
|
}
|
|
9237
|
-
function
|
|
9246
|
+
function Hi(e, t) {
|
|
9238
9247
|
let n = e.length, r = NaN, i = Infinity;
|
|
9239
9248
|
for (let a = 0; a < n; a++) {
|
|
9240
9249
|
let o = e[a], s = o < i, c = a + t <= n, l = !0;
|
|
9241
9250
|
for (let n = 1; n < t; n++) e[a + n] > o && (l = !1);
|
|
9242
9251
|
s && c && l && (r = a, i = o);
|
|
9243
9252
|
}
|
|
9244
|
-
return isNaN(r) ? [0,
|
|
9253
|
+
return isNaN(r) ? [0, Ui(e, t)] : [r, i];
|
|
9245
9254
|
}
|
|
9246
|
-
function
|
|
9255
|
+
function Ui(e, t) {
|
|
9247
9256
|
let n = e;
|
|
9248
9257
|
return t != null && !isNaN(t) && (n = n.slice(0, Math.max(1, Math.min(t, e.length)))), n.reduce((e, t, n) => t > e ? t : e, 0);
|
|
9249
9258
|
}
|
|
9250
|
-
function
|
|
9259
|
+
function Wi(e, t) {
|
|
9251
9260
|
let n = e.classList;
|
|
9252
|
-
for (let e of Array.from(n)) if (e.startsWith(
|
|
9253
|
-
let n = parseFloat(e.replace(
|
|
9261
|
+
for (let e of Array.from(n)) if (e.startsWith(Ri)) {
|
|
9262
|
+
let n = parseFloat(e.replace(Ri, ""));
|
|
9254
9263
|
if (!isNaN(n)) return Math.min(Math.max(n, 1), t);
|
|
9255
9264
|
}
|
|
9256
9265
|
return 1;
|
|
9257
9266
|
}
|
|
9258
|
-
function
|
|
9267
|
+
function Gi(e) {
|
|
9259
9268
|
if (!e) return [];
|
|
9260
9269
|
let t = /<img.*?src=(["'])(.*?)\1/g, n = /<img.*?src=(["'])(.*?)\1/, r = t.exec(e) ?? [], i = [];
|
|
9261
9270
|
for (let e of r) {
|
|
@@ -9264,19 +9273,19 @@ function Wi(e) {
|
|
|
9264
9273
|
}
|
|
9265
9274
|
return i;
|
|
9266
9275
|
}
|
|
9267
|
-
process.env.NODE_ENV === "development" && (
|
|
9276
|
+
process.env.NODE_ENV === "development" && (zi.displayName = "MasonryGrid");
|
|
9268
9277
|
//#endregion
|
|
9269
9278
|
//#region src/primitives/RangeSlider.tsx
|
|
9270
|
-
var
|
|
9271
|
-
let y = d(null), b = re(y), x = d(null), S = d(null), [w, T] = f(p ?? [l, o]), E =
|
|
9272
|
-
gutter:
|
|
9273
|
-
highlight:
|
|
9274
|
-
knob:
|
|
9275
|
-
knobContainer:
|
|
9276
|
-
label:
|
|
9279
|
+
var Ki = /* @__PURE__ */ a(({ className: e, children: t, decimalPlaces: n = 2, knobHeight: r = 28, knobPadding: i = 0, knobWidth: a = 40, max: o, min: l, orientation: u = "vertical", range: p, steps: m = -1, isClipped: h = !1, onChange: g, ..._ }, v) => {
|
|
9280
|
+
let y = d(null), b = re(y), x = d(null), S = d(null), [w, T] = f(p ?? [l, o]), E = ca(l, o, m), [O, k] = w.map((e) => oa(e, l, o, u, b, a, r, h)), j = k - O, M = A(t, {
|
|
9281
|
+
gutter: qi,
|
|
9282
|
+
highlight: Yi,
|
|
9283
|
+
knob: Xi,
|
|
9284
|
+
knobContainer: Zi,
|
|
9285
|
+
label: Ji
|
|
9277
9286
|
}), F = s((e, t, n) => {
|
|
9278
|
-
let i = u === "horizontal" ? t : n, s =
|
|
9279
|
-
return
|
|
9287
|
+
let i = u === "horizontal" ? t : n, s = oa(l, l, o, u, b, a, r, h), c = oa(w[1], l, o, u, b, a, r, h), d = oa(e, l, o, u, b, a, r, h) + i;
|
|
9288
|
+
return ia(Math.max(s, Math.min(c, d)), l, o, u, b, a, r, h);
|
|
9280
9289
|
}, [
|
|
9281
9290
|
a,
|
|
9282
9291
|
r,
|
|
@@ -9287,8 +9296,8 @@ var Gi = /* @__PURE__ */ a(({ className: e, children: t, decimalPlaces: n = 2, k
|
|
|
9287
9296
|
w[1],
|
|
9288
9297
|
K.toString(b)
|
|
9289
9298
|
]), I = s((e, t, n) => {
|
|
9290
|
-
let i = u === "horizontal" ? t : n, s =
|
|
9291
|
-
return
|
|
9299
|
+
let i = u === "horizontal" ? t : n, s = oa(w[0], l, o, u, b, a, r, h), c = oa(o, l, o, u, b, a, r, h), d = oa(e, l, o, u, b, a, r, h) + i;
|
|
9300
|
+
return ia(Math.max(s, Math.min(c, d)), l, o, u, b, a, r, h);
|
|
9292
9301
|
}, [
|
|
9293
9302
|
a,
|
|
9294
9303
|
r,
|
|
@@ -9304,12 +9313,12 @@ var Gi = /* @__PURE__ */ a(({ className: e, children: t, decimalPlaces: n = 2, k
|
|
|
9304
9313
|
}), { setValue: V, value: H, isDragging: U, isReleasing: W } = Ne(S, {
|
|
9305
9314
|
initialValue: p?.[1] ?? o,
|
|
9306
9315
|
transform: I
|
|
9307
|
-
}), G =
|
|
9316
|
+
}), G = $i({
|
|
9308
9317
|
isDraggingEndKnob: U,
|
|
9309
9318
|
isDraggingStartKnob: z,
|
|
9310
9319
|
isReleasingEndKnob: W,
|
|
9311
9320
|
isReleasingStartKnob: B
|
|
9312
|
-
}), q =
|
|
9321
|
+
}), q = ea({
|
|
9313
9322
|
highlightLength: j,
|
|
9314
9323
|
knobHeight: r,
|
|
9315
9324
|
knobPadding: i,
|
|
@@ -9330,9 +9339,9 @@ var Gi = /* @__PURE__ */ a(({ className: e, children: t, decimalPlaces: n = 2, k
|
|
|
9330
9339
|
U,
|
|
9331
9340
|
W
|
|
9332
9341
|
]), c(() => {
|
|
9333
|
-
E && L(
|
|
9342
|
+
E && L(sa(R, E));
|
|
9334
9343
|
}, [B, je(E)]), c(() => {
|
|
9335
|
-
!E || !W || V(
|
|
9344
|
+
!E || !W || V(sa(H, E));
|
|
9336
9345
|
}, [W, je(E)]), /* @__PURE__ */ (0, D.jsx)("div", {
|
|
9337
9346
|
..._,
|
|
9338
9347
|
className: C(e, u),
|
|
@@ -9346,11 +9355,11 @@ var Gi = /* @__PURE__ */ a(({ className: e, children: t, decimalPlaces: n = 2, k
|
|
|
9346
9355
|
children: [
|
|
9347
9356
|
/* @__PURE__ */ (0, D.jsx)(N, {
|
|
9348
9357
|
style: P(q.gutter),
|
|
9349
|
-
element: M.gutter ?? /* @__PURE__ */ (0, D.jsx)(
|
|
9358
|
+
element: M.gutter ?? /* @__PURE__ */ (0, D.jsx)(qi, {})
|
|
9350
9359
|
}),
|
|
9351
9360
|
/* @__PURE__ */ (0, D.jsx)(N, {
|
|
9352
9361
|
style: P(q.highlight),
|
|
9353
|
-
element: M.highlight ?? /* @__PURE__ */ (0, D.jsx)(
|
|
9362
|
+
element: M.highlight ?? /* @__PURE__ */ (0, D.jsx)(Yi, {})
|
|
9354
9363
|
}),
|
|
9355
9364
|
/* @__PURE__ */ (0, D.jsx)(N, {
|
|
9356
9365
|
className: G.startKnobContainer,
|
|
@@ -9363,15 +9372,15 @@ var Gi = /* @__PURE__ */ a(({ className: e, children: t, decimalPlaces: n = 2, k
|
|
|
9363
9372
|
top: `${O}px`
|
|
9364
9373
|
}),
|
|
9365
9374
|
disabled: (0, Ae.default)([R, H], [l, l]),
|
|
9366
|
-
element: M.knobContainer ?? /* @__PURE__ */ (0, D.jsx)(
|
|
9375
|
+
element: M.knobContainer ?? /* @__PURE__ */ (0, D.jsx)(Zi, {}),
|
|
9367
9376
|
children: /* @__PURE__ */ (0, D.jsxs)(N, {
|
|
9368
9377
|
className: G.startKnob,
|
|
9369
9378
|
style: P(q.knob),
|
|
9370
|
-
element: M.knob ?? /* @__PURE__ */ (0, D.jsx)(
|
|
9379
|
+
element: M.knob ?? /* @__PURE__ */ (0, D.jsx)(Xi, {}),
|
|
9371
9380
|
children: [/* @__PURE__ */ (0, D.jsx)("div", { style: q.knobHitBox }), M.label && /* @__PURE__ */ (0, D.jsx)(N, {
|
|
9372
9381
|
className: G.startLabel,
|
|
9373
9382
|
style: P(q.label),
|
|
9374
|
-
element: M.label ?? /* @__PURE__ */ (0, D.jsx)(
|
|
9383
|
+
element: M.label ?? /* @__PURE__ */ (0, D.jsx)(Ji, {}),
|
|
9375
9384
|
children: Number(R.toFixed(n)).toLocaleString()
|
|
9376
9385
|
})]
|
|
9377
9386
|
})
|
|
@@ -9387,15 +9396,15 @@ var Gi = /* @__PURE__ */ a(({ className: e, children: t, decimalPlaces: n = 2, k
|
|
|
9387
9396
|
top: `${k}px`
|
|
9388
9397
|
}),
|
|
9389
9398
|
disabled: (0, Ae.default)([R, H], [o, o]),
|
|
9390
|
-
element: M.knobContainer ?? /* @__PURE__ */ (0, D.jsx)(
|
|
9399
|
+
element: M.knobContainer ?? /* @__PURE__ */ (0, D.jsx)(Zi, {}),
|
|
9391
9400
|
children: /* @__PURE__ */ (0, D.jsxs)(N, {
|
|
9392
9401
|
className: G.endKnob,
|
|
9393
9402
|
style: P(q.knob),
|
|
9394
|
-
element: M.knob ?? /* @__PURE__ */ (0, D.jsx)(
|
|
9403
|
+
element: M.knob ?? /* @__PURE__ */ (0, D.jsx)(Xi, {}),
|
|
9395
9404
|
children: [/* @__PURE__ */ (0, D.jsx)("div", { style: q.knobHitBox }), M.label && /* @__PURE__ */ (0, D.jsx)(N, {
|
|
9396
9405
|
className: G.endLabel,
|
|
9397
9406
|
style: P(q.label),
|
|
9398
|
-
element: M.label ?? /* @__PURE__ */ (0, D.jsx)(
|
|
9407
|
+
element: M.label ?? /* @__PURE__ */ (0, D.jsx)(Ji, {}),
|
|
9399
9408
|
children: Number(H.toFixed(n)).toLocaleString()
|
|
9400
9409
|
})]
|
|
9401
9410
|
})
|
|
@@ -9403,14 +9412,14 @@ var Gi = /* @__PURE__ */ a(({ className: e, children: t, decimalPlaces: n = 2, k
|
|
|
9403
9412
|
]
|
|
9404
9413
|
})
|
|
9405
9414
|
});
|
|
9406
|
-
}),
|
|
9407
|
-
Gutter:
|
|
9408
|
-
Highlight:
|
|
9409
|
-
Knob:
|
|
9410
|
-
KnobContainer:
|
|
9411
|
-
Label:
|
|
9415
|
+
}), qi = ({ ...e }) => /* @__PURE__ */ (0, D.jsx)("div", { ...e }), Ji = ({ ...e }) => /* @__PURE__ */ (0, D.jsx)("div", { ...e }), Yi = ({ ...e }) => /* @__PURE__ */ (0, D.jsx)("div", { ...e }), Xi = ({ ...e }) => /* @__PURE__ */ (0, D.jsx)("div", { ...e }), Zi = ({ ...e }) => /* @__PURE__ */ (0, D.jsx)("button", { ...e }), Qi = /* @__PURE__ */ Object.assign(Ki, {
|
|
9416
|
+
Gutter: qi,
|
|
9417
|
+
Highlight: Yi,
|
|
9418
|
+
Knob: Xi,
|
|
9419
|
+
KnobContainer: Zi,
|
|
9420
|
+
Label: Ji
|
|
9412
9421
|
});
|
|
9413
|
-
function
|
|
9422
|
+
function $i({ isDraggingEndKnob: e = !1, isDraggingStartKnob: t = !1, isReleasingEndKnob: n = !1, isReleasingStartKnob: r = !1 }) {
|
|
9414
9423
|
return k({
|
|
9415
9424
|
endKnob: C({
|
|
9416
9425
|
dragging: e,
|
|
@@ -9438,7 +9447,7 @@ function Qi({ isDraggingEndKnob: e = !1, isDraggingStartKnob: t = !1, isReleasin
|
|
|
9438
9447
|
})
|
|
9439
9448
|
});
|
|
9440
9449
|
}
|
|
9441
|
-
function
|
|
9450
|
+
function ea({ highlightLength: e = 0, knobHeight: t = 0, knobPadding: n = 0, knobWidth: r = 0, orientation: i = "horizontal", start: a = 0 }) {
|
|
9442
9451
|
return j({
|
|
9443
9452
|
body: {
|
|
9444
9453
|
height: "100%",
|
|
@@ -9495,10 +9504,10 @@ function $i({ highlightLength: e = 0, knobHeight: t = 0, knobPadding: n = 0, kno
|
|
|
9495
9504
|
}
|
|
9496
9505
|
});
|
|
9497
9506
|
}
|
|
9498
|
-
function
|
|
9507
|
+
function ta(e, t, n) {
|
|
9499
9508
|
return (e - t) / (n - t);
|
|
9500
9509
|
}
|
|
9501
|
-
function
|
|
9510
|
+
function na(e, t, n, r, i, a) {
|
|
9502
9511
|
switch (t) {
|
|
9503
9512
|
case "horizontal": {
|
|
9504
9513
|
let t = a ? n.width - r : n.width;
|
|
@@ -9511,23 +9520,23 @@ function ta(e, t, n, r, i, a) {
|
|
|
9511
9520
|
default: return console.error(`[etudes::RangeSlider] Invalid orientation: ${t}`), NaN;
|
|
9512
9521
|
}
|
|
9513
9522
|
}
|
|
9514
|
-
function
|
|
9523
|
+
function ra(e, t, n) {
|
|
9515
9524
|
return e * (n - t) + t;
|
|
9516
9525
|
}
|
|
9517
|
-
function
|
|
9518
|
-
return na(
|
|
9526
|
+
function ia(e, t, n, r, i, a, o, s) {
|
|
9527
|
+
return ra(na(e, r, i, a, o, s), t, n);
|
|
9519
9528
|
}
|
|
9520
|
-
function
|
|
9529
|
+
function aa(e, t, n, r, i, a) {
|
|
9521
9530
|
switch (t) {
|
|
9522
9531
|
case "horizontal": return e * (a ? n.width - r : n.width) + (a ? r * .5 : 0);
|
|
9523
9532
|
case "vertical": return e * (a ? n.height - i : n.height) + (a ? i * .5 : 0);
|
|
9524
9533
|
default: return console.error(`[etudes::RangeSlider] Invalid orientation: ${t}`), NaN;
|
|
9525
9534
|
}
|
|
9526
9535
|
}
|
|
9527
|
-
function
|
|
9528
|
-
return
|
|
9536
|
+
function oa(e, t, n, r, i, a, o, s) {
|
|
9537
|
+
return aa(ta(e, t, n), r, i, a, o, s);
|
|
9529
9538
|
}
|
|
9530
|
-
function
|
|
9539
|
+
function sa(e, t) {
|
|
9531
9540
|
let n = t.length, r = 0, i = Infinity;
|
|
9532
9541
|
for (let a = 0; a < n; a++) {
|
|
9533
9542
|
let n = t[a], o = Math.abs(e - n);
|
|
@@ -9535,63 +9544,63 @@ function oa(e, t) {
|
|
|
9535
9544
|
}
|
|
9536
9545
|
return t[r];
|
|
9537
9546
|
}
|
|
9538
|
-
function
|
|
9547
|
+
function ca(e, t, n) {
|
|
9539
9548
|
if (!(n < 0)) return [
|
|
9540
9549
|
e,
|
|
9541
9550
|
...[...Array(n)].map((r, i) => e + (i + 1) * (t - e) / (1 + n)),
|
|
9542
9551
|
t
|
|
9543
9552
|
];
|
|
9544
9553
|
}
|
|
9545
|
-
process.env.NODE_ENV === "development" && (
|
|
9554
|
+
process.env.NODE_ENV === "development" && (Ki.displayName = "RangeSlider", qi.displayName = "RangeSlider.Gutter", Ji.displayName = "RangeSlider.Label", Yi.displayName = "RangeSlider.Highlight", Xi.displayName = "RangeSlider.Knob");
|
|
9546
9555
|
//#endregion
|
|
9547
9556
|
//#region src/primitives/Select.tsx
|
|
9548
|
-
var
|
|
9557
|
+
var la = /* @__PURE__ */ a(({ id: e, children: t, name: n, options: r, placeholder: i, value: a = "", isRequired: o = !1, onChange: s, ...c }, l) => {
|
|
9549
9558
|
let u = A(t, {
|
|
9550
|
-
expandIcon:
|
|
9551
|
-
option:
|
|
9552
|
-
toggle:
|
|
9559
|
+
expandIcon: ua,
|
|
9560
|
+
option: fa,
|
|
9561
|
+
toggle: da
|
|
9553
9562
|
});
|
|
9554
9563
|
return /* @__PURE__ */ (0, D.jsxs)("div", {
|
|
9555
9564
|
...c,
|
|
9556
9565
|
ref: l,
|
|
9557
|
-
style:
|
|
9566
|
+
style: ma.root,
|
|
9558
9567
|
children: [/* @__PURE__ */ (0, D.jsxs)(N, {
|
|
9559
|
-
style:
|
|
9568
|
+
style: ma.select,
|
|
9560
9569
|
"aria-required": o ? "true" : void 0,
|
|
9561
|
-
element: u.toggle ?? /* @__PURE__ */ (0, D.jsx)(
|
|
9570
|
+
element: u.toggle ?? /* @__PURE__ */ (0, D.jsx)(da, {}),
|
|
9562
9571
|
name: n,
|
|
9563
9572
|
required: o,
|
|
9564
9573
|
value: a,
|
|
9565
9574
|
onChange: (e) => s?.(e.target.value),
|
|
9566
9575
|
children: [i !== void 0 && /* @__PURE__ */ (0, D.jsx)(N, {
|
|
9567
9576
|
disabled: !0,
|
|
9568
|
-
element: u.option ?? /* @__PURE__ */ (0, D.jsx)(
|
|
9577
|
+
element: u.option ?? /* @__PURE__ */ (0, D.jsx)(fa, {}),
|
|
9569
9578
|
hidden: !0,
|
|
9570
9579
|
value: "",
|
|
9571
9580
|
children: i
|
|
9572
9581
|
}), r.map((e, t) => /* @__PURE__ */ (0, D.jsx)(N, {
|
|
9573
|
-
element: u.option ?? /* @__PURE__ */ (0, D.jsx)(
|
|
9582
|
+
element: u.option ?? /* @__PURE__ */ (0, D.jsx)(fa, {}),
|
|
9574
9583
|
value: e,
|
|
9575
9584
|
children: e
|
|
9576
9585
|
}, `${t}-${e}`))]
|
|
9577
9586
|
}), u.expandIcon && /* @__PURE__ */ (0, D.jsx)(N, {
|
|
9578
|
-
style:
|
|
9587
|
+
style: ma.expandIcon,
|
|
9579
9588
|
element: u.expandIcon
|
|
9580
9589
|
})]
|
|
9581
9590
|
});
|
|
9582
|
-
}),
|
|
9591
|
+
}), ua = ({ style: e, children: t, ...n }) => /* @__PURE__ */ (0, D.jsx)("figure", {
|
|
9583
9592
|
...n,
|
|
9584
9593
|
style: P(e, { pointerEvents: "none" }),
|
|
9585
9594
|
"aria-hidden": !0,
|
|
9586
9595
|
children: t
|
|
9587
|
-
}),
|
|
9596
|
+
}), da = ({ children: e, ...t }) => /* @__PURE__ */ (0, D.jsx)("select", {
|
|
9588
9597
|
...t,
|
|
9589
9598
|
children: e
|
|
9590
|
-
}),
|
|
9591
|
-
ExpandIcon:
|
|
9592
|
-
Option:
|
|
9593
|
-
Toggle:
|
|
9594
|
-
}),
|
|
9599
|
+
}), fa = ({ ...e }) => /* @__PURE__ */ (0, D.jsx)("option", { ...e }), pa = /* @__PURE__ */ Object.assign(la, {
|
|
9600
|
+
ExpandIcon: ua,
|
|
9601
|
+
Option: fa,
|
|
9602
|
+
Toggle: da
|
|
9603
|
+
}), ma = j({
|
|
9595
9604
|
expandIcon: {
|
|
9596
9605
|
pointerEvents: "none",
|
|
9597
9606
|
zIndex: 1
|
|
@@ -9613,10 +9622,10 @@ var ca = /* @__PURE__ */ a(({ id: e, children: t, name: n, options: r, placehold
|
|
|
9613
9622
|
width: "100%"
|
|
9614
9623
|
}
|
|
9615
9624
|
});
|
|
9616
|
-
process.env.NODE_ENV === "development" && (
|
|
9625
|
+
process.env.NODE_ENV === "development" && (la.displayName = "Select", ua.displayName = "Select.ExpandIcon", fa.displayName = "Select.Option", da.displayName = "Select.Toggle");
|
|
9617
9626
|
//#endregion
|
|
9618
9627
|
//#region src/primitives/Slider.tsx
|
|
9619
|
-
var
|
|
9628
|
+
var ha = /* @__PURE__ */ a(({ className: e, children: t, knobHeight: n = 30, knobPadding: r = 0, knobWidth: i = 30, labelProvider: a, orientation: o = "vertical", position: l = 0, trackPadding: u = 0, isClipped: f = !1, isInverted: p = !1, isTrackInteractive: m = !0, shouldOnlyDispatchOnDragEnd: h = !1, onChange: g, onDragEnd: _, onDragStart: v, ...y }, b) => {
|
|
9620
9629
|
let x = d(null), S = d(null), w = s((e, t, r) => {
|
|
9621
9630
|
let a = K.from(x.current), s = p ? 1 - e : e;
|
|
9622
9631
|
switch (o) {
|
|
@@ -9663,13 +9672,13 @@ var ma = /* @__PURE__ */ a(({ className: e, children: t, knobHeight: n = 30, kno
|
|
|
9663
9672
|
transform: w,
|
|
9664
9673
|
onDragEnd: _,
|
|
9665
9674
|
onDragStart: v
|
|
9666
|
-
}), M = p ? 1 - O : O, F =
|
|
9675
|
+
}), M = p ? 1 - O : O, F = xa({
|
|
9667
9676
|
orientation: o,
|
|
9668
9677
|
isAtEnd: p ? O === 0 : O === 1,
|
|
9669
9678
|
isAtStart: p ? O === 1 : O === 0,
|
|
9670
9679
|
isDragging: k,
|
|
9671
9680
|
isReleasing: j
|
|
9672
|
-
}), I =
|
|
9681
|
+
}), I = Sa({
|
|
9673
9682
|
knobHeight: n,
|
|
9674
9683
|
knobPadding: r,
|
|
9675
9684
|
knobWidth: i,
|
|
@@ -9686,10 +9695,10 @@ var ma = /* @__PURE__ */ a(({ className: e, children: t, knobHeight: n = 30, kno
|
|
|
9686
9695
|
k || !h || g?.(O, !0);
|
|
9687
9696
|
}, [k]);
|
|
9688
9697
|
let L = A(t, {
|
|
9689
|
-
knob:
|
|
9690
|
-
knobContainer:
|
|
9691
|
-
label:
|
|
9692
|
-
track:
|
|
9698
|
+
knob: _a,
|
|
9699
|
+
knobContainer: va,
|
|
9700
|
+
label: ya,
|
|
9701
|
+
track: ga
|
|
9693
9702
|
});
|
|
9694
9703
|
return /* @__PURE__ */ (0, D.jsx)("div", {
|
|
9695
9704
|
...y,
|
|
@@ -9711,7 +9720,7 @@ var ma = /* @__PURE__ */ a(({ className: e, children: t, knobHeight: n = 30, kno
|
|
|
9711
9720
|
left: "0",
|
|
9712
9721
|
width: `calc(${M * 100}% - ${u <= 0 ? 0 : i * .5}px - ${u}px)`
|
|
9713
9722
|
}),
|
|
9714
|
-
element: L.track ?? /* @__PURE__ */ (0, D.jsx)(
|
|
9723
|
+
element: L.track ?? /* @__PURE__ */ (0, D.jsx)(ga, {}),
|
|
9715
9724
|
onClick: T,
|
|
9716
9725
|
children: /* @__PURE__ */ (0, D.jsx)("div", { style: I.trackHitBox })
|
|
9717
9726
|
}),
|
|
@@ -9724,7 +9733,7 @@ var ma = /* @__PURE__ */ a(({ className: e, children: t, knobHeight: n = 30, kno
|
|
|
9724
9733
|
right: "0",
|
|
9725
9734
|
width: `calc(${(1 - M) * 100}% - ${u <= 0 ? 0 : i * .5}px - ${u}px)`
|
|
9726
9735
|
}),
|
|
9727
|
-
element: L.track ?? /* @__PURE__ */ (0, D.jsx)(
|
|
9736
|
+
element: L.track ?? /* @__PURE__ */ (0, D.jsx)(ga, {}),
|
|
9728
9737
|
onClick: T,
|
|
9729
9738
|
children: /* @__PURE__ */ (0, D.jsx)("div", { style: I.trackHitBox })
|
|
9730
9739
|
}),
|
|
@@ -9732,15 +9741,15 @@ var ma = /* @__PURE__ */ a(({ className: e, children: t, knobHeight: n = 30, kno
|
|
|
9732
9741
|
className: C(F.knobContainer),
|
|
9733
9742
|
ref: S,
|
|
9734
9743
|
style: I.knobContainer,
|
|
9735
|
-
element: L.knobContainer ?? /* @__PURE__ */ (0, D.jsx)(
|
|
9744
|
+
element: L.knobContainer ?? /* @__PURE__ */ (0, D.jsx)(va, {}),
|
|
9736
9745
|
children: /* @__PURE__ */ (0, D.jsxs)(N, {
|
|
9737
9746
|
className: C(F.knob),
|
|
9738
9747
|
style: P(I.knob),
|
|
9739
|
-
element: L.knob ?? /* @__PURE__ */ (0, D.jsx)(
|
|
9748
|
+
element: L.knob ?? /* @__PURE__ */ (0, D.jsx)(_a, {}),
|
|
9740
9749
|
children: [/* @__PURE__ */ (0, D.jsx)("div", { style: I.knobHitBox }), a && /* @__PURE__ */ (0, D.jsx)(N, {
|
|
9741
9750
|
className: C(F.label),
|
|
9742
9751
|
style: P(I.label),
|
|
9743
|
-
element: L.label ?? /* @__PURE__ */ (0, D.jsx)(
|
|
9752
|
+
element: L.label ?? /* @__PURE__ */ (0, D.jsx)(ya, {}),
|
|
9744
9753
|
children: a(O)
|
|
9745
9754
|
})]
|
|
9746
9755
|
})
|
|
@@ -9748,13 +9757,13 @@ var ma = /* @__PURE__ */ a(({ className: e, children: t, knobHeight: n = 30, kno
|
|
|
9748
9757
|
]
|
|
9749
9758
|
})
|
|
9750
9759
|
});
|
|
9751
|
-
}),
|
|
9752
|
-
Track:
|
|
9753
|
-
Knob:
|
|
9754
|
-
KnobContainer:
|
|
9755
|
-
Label:
|
|
9760
|
+
}), ga = ({ ...e }) => /* @__PURE__ */ (0, D.jsx)("div", { ...e }), _a = ({ ...e }) => /* @__PURE__ */ (0, D.jsx)("div", { ...e }), va = ({ ...e }) => /* @__PURE__ */ (0, D.jsx)("button", { ...e }), ya = ({ ...e }) => /* @__PURE__ */ (0, D.jsx)("div", { ...e }), ba = /* @__PURE__ */ Object.assign(ha, {
|
|
9761
|
+
Track: ga,
|
|
9762
|
+
Knob: _a,
|
|
9763
|
+
KnobContainer: va,
|
|
9764
|
+
Label: ya
|
|
9756
9765
|
});
|
|
9757
|
-
function
|
|
9766
|
+
function xa({ orientation: e = "vertical", isAtEnd: t = !1, isAtStart: n = !1, isDragging: r = !1, isReleasing: i = !1 }) {
|
|
9758
9767
|
return k({
|
|
9759
9768
|
knob: C(e, {
|
|
9760
9769
|
"at-end": t,
|
|
@@ -9788,7 +9797,7 @@ function ba({ orientation: e = "vertical", isAtEnd: t = !1, isAtStart: n = !1, i
|
|
|
9788
9797
|
})
|
|
9789
9798
|
});
|
|
9790
9799
|
}
|
|
9791
|
-
function
|
|
9800
|
+
function Sa({ knobHeight: e = 0, knobPadding: t = 0, knobWidth: n = 0, naturalPosition: r = 0, orientation: i = "vertical", isClipped: a = !1, isTrackInteractive: o = !0 }) {
|
|
9792
9801
|
return j({
|
|
9793
9802
|
body: {
|
|
9794
9803
|
height: "100%",
|
|
@@ -9853,20 +9862,20 @@ function xa({ knobHeight: e = 0, knobPadding: t = 0, knobWidth: n = 0, naturalPo
|
|
|
9853
9862
|
}
|
|
9854
9863
|
});
|
|
9855
9864
|
}
|
|
9856
|
-
process.env.NODE_ENV === "development" && (
|
|
9865
|
+
process.env.NODE_ENV === "development" && (ha.displayName = "Slider", ga.displayName = "Slider.Track", _a.displayName = "Slider.Knob", va.displayName = "Slider.KnobContainer", ya.displayName = "Slider.Label");
|
|
9857
9866
|
//#endregion
|
|
9858
9867
|
//#region src/primitives/StepSlider.tsx
|
|
9859
|
-
var
|
|
9868
|
+
var Ca = /* @__PURE__ */ a(({ className: e, children: t, index: n = 0, knobHeight: r = 30, knobPadding: i = 0, knobWidth: a = 30, labelProvider: o, orientation: l = "vertical", steps: u = Oa(10), trackPadding: p = 0, isClipped: m = !1, isInverted: h = !1, isTrackInteractive: g = !0, shouldOnlyDispatchOnDragEnd: _ = !1, onDragEnd: v, onDragStart: y, onIndexChange: b, onPositionChange: x, ...S }, w) => {
|
|
9860
9869
|
let T = d(null), E = d(null), O = re(T), [k, j] = f(n), M = s((e, t, n) => {
|
|
9861
|
-
let i = h ?
|
|
9870
|
+
let i = h ? Pa(e) : e;
|
|
9862
9871
|
switch (l) {
|
|
9863
9872
|
case "horizontal": {
|
|
9864
|
-
let e = m ? O.width - a : O.width, n =
|
|
9865
|
-
return h ?
|
|
9873
|
+
let e = m ? O.width - a : O.width, n = Fa((i * e + t) / e);
|
|
9874
|
+
return h ? Pa(n) : n;
|
|
9866
9875
|
}
|
|
9867
9876
|
case "vertical": {
|
|
9868
|
-
let e = m ? O.height - r : O.height, t =
|
|
9869
|
-
return h ?
|
|
9877
|
+
let e = m ? O.height - r : O.height, t = Fa((i * e + n) / e);
|
|
9878
|
+
return h ? Pa(t) : t;
|
|
9870
9879
|
}
|
|
9871
9880
|
default: return console.error(`[etudes::StepSlider] Invalid orientation: ${l}`), NaN;
|
|
9872
9881
|
}
|
|
@@ -9879,7 +9888,7 @@ var Sa = /* @__PURE__ */ a(({ className: e, children: t, index: n = 0, knobHeigh
|
|
|
9879
9888
|
r,
|
|
9880
9889
|
l
|
|
9881
9890
|
]), { setValue: F, value: I, isDragging: L, isReleasing: R } = Ne(E, {
|
|
9882
|
-
initialValue:
|
|
9891
|
+
initialValue: ja(n, u),
|
|
9883
9892
|
transform: M,
|
|
9884
9893
|
onDragEnd: v,
|
|
9885
9894
|
onDragStart: y
|
|
@@ -9888,16 +9897,16 @@ var Sa = /* @__PURE__ */ a(({ className: e, children: t, index: n = 0, knobHeigh
|
|
|
9888
9897
|
let t = K.fromViewport();
|
|
9889
9898
|
switch (l) {
|
|
9890
9899
|
case "horizontal": {
|
|
9891
|
-
let n = (e.clientX + t.left - O.left) / O.width, r = h ?
|
|
9892
|
-
j(i === k ?
|
|
9900
|
+
let n = (e.clientX + t.left - O.left) / O.width, r = h ? Pa(n) : n, i = Aa(r, u);
|
|
9901
|
+
j(i === k ? Fa(r > I ? i + 1 : i - 1, u.length - 1) : i);
|
|
9893
9902
|
break;
|
|
9894
9903
|
}
|
|
9895
9904
|
case "vertical": {
|
|
9896
|
-
let n = (e.clientY + t.top - O.top) / O.height, r = h ?
|
|
9905
|
+
let n = (e.clientY + t.top - O.top) / O.height, r = h ? Pa(n) : n, i = Aa(r, u);
|
|
9897
9906
|
if (i === k) {
|
|
9898
9907
|
let e = r > I ? i + 1 : i - 1;
|
|
9899
|
-
F(
|
|
9900
|
-
} else F(
|
|
9908
|
+
F(ja(e, u)), j(Fa(e, u.length - 1));
|
|
9909
|
+
} else F(ja(i, u)), j(i);
|
|
9901
9910
|
break;
|
|
9902
9911
|
}
|
|
9903
9912
|
default: console.error(`[etudes::StepSlider] Invalid orientation: ${l}`);
|
|
@@ -9913,13 +9922,13 @@ var Sa = /* @__PURE__ */ a(({ className: e, children: t, index: n = 0, knobHeigh
|
|
|
9913
9922
|
g,
|
|
9914
9923
|
l,
|
|
9915
9924
|
je(u)
|
|
9916
|
-
]), B = h ?
|
|
9925
|
+
]), B = h ? Pa(I) : I, V = Ma({
|
|
9917
9926
|
orientation: l,
|
|
9918
9927
|
isAtEnd: h ? I === 0 : I === 1,
|
|
9919
9928
|
isAtStart: h ? I === 1 : I === 0,
|
|
9920
9929
|
isDragging: L,
|
|
9921
9930
|
isReleasing: R
|
|
9922
|
-
}), H =
|
|
9931
|
+
}), H = Na({
|
|
9923
9932
|
knobHeight: r,
|
|
9924
9933
|
knobPadding: i,
|
|
9925
9934
|
knobWidth: a,
|
|
@@ -9928,13 +9937,13 @@ var Sa = /* @__PURE__ */ a(({ className: e, children: t, index: n = 0, knobHeigh
|
|
|
9928
9937
|
isClipped: m,
|
|
9929
9938
|
isTrackInteractive: g
|
|
9930
9939
|
}), U = A(t, {
|
|
9931
|
-
knob:
|
|
9932
|
-
knobContainer:
|
|
9933
|
-
label:
|
|
9934
|
-
track:
|
|
9940
|
+
knob: wa,
|
|
9941
|
+
knobContainer: Ta,
|
|
9942
|
+
label: Ea,
|
|
9943
|
+
track: Da
|
|
9935
9944
|
});
|
|
9936
9945
|
return c(() => {
|
|
9937
|
-
L || (F(
|
|
9946
|
+
L || (F(ja(n, u)), j(n));
|
|
9938
9947
|
}, [
|
|
9939
9948
|
n,
|
|
9940
9949
|
L,
|
|
@@ -9942,10 +9951,10 @@ var Sa = /* @__PURE__ */ a(({ className: e, children: t, index: n = 0, knobHeigh
|
|
|
9942
9951
|
]), c(() => {
|
|
9943
9952
|
if (L) {
|
|
9944
9953
|
if (_) return;
|
|
9945
|
-
j(
|
|
9954
|
+
j(Aa(I, u));
|
|
9946
9955
|
} else {
|
|
9947
|
-
let e =
|
|
9948
|
-
F(
|
|
9956
|
+
let e = Aa(I, u);
|
|
9957
|
+
F(ja(e, u)), j(e);
|
|
9949
9958
|
}
|
|
9950
9959
|
}, [
|
|
9951
9960
|
I,
|
|
@@ -9975,7 +9984,7 @@ var Sa = /* @__PURE__ */ a(({ className: e, children: t, index: n = 0, knobHeigh
|
|
|
9975
9984
|
left: "0",
|
|
9976
9985
|
width: `calc(${B * 100}% - ${p <= 0 ? 0 : a * .5}px - ${p}px)`
|
|
9977
9986
|
}),
|
|
9978
|
-
element: U.track ?? /* @__PURE__ */ (0, D.jsx)(
|
|
9987
|
+
element: U.track ?? /* @__PURE__ */ (0, D.jsx)(Da, {}),
|
|
9979
9988
|
onClick: z,
|
|
9980
9989
|
children: /* @__PURE__ */ (0, D.jsx)("div", { style: H.trackHitBox })
|
|
9981
9990
|
}),
|
|
@@ -9983,12 +9992,12 @@ var Sa = /* @__PURE__ */ a(({ className: e, children: t, index: n = 0, knobHeigh
|
|
|
9983
9992
|
className: C(h ? "start" : "end", V.track),
|
|
9984
9993
|
style: P(H.track, l === "vertical" ? {
|
|
9985
9994
|
bottom: "0",
|
|
9986
|
-
height: `calc(${
|
|
9995
|
+
height: `calc(${Pa(B) * 100}% - ${p <= 0 ? 0 : r * .5}px - ${p}px)`
|
|
9987
9996
|
} : {
|
|
9988
9997
|
right: "0",
|
|
9989
|
-
width: `calc(${
|
|
9998
|
+
width: `calc(${Pa(B) * 100}% - ${p <= 0 ? 0 : a * .5}px - ${p}px)`
|
|
9990
9999
|
}),
|
|
9991
|
-
element: U.track ?? /* @__PURE__ */ (0, D.jsx)(
|
|
10000
|
+
element: U.track ?? /* @__PURE__ */ (0, D.jsx)(Da, {}),
|
|
9992
10001
|
onClick: z,
|
|
9993
10002
|
children: /* @__PURE__ */ (0, D.jsx)("div", { style: H.trackHitBox })
|
|
9994
10003
|
}),
|
|
@@ -9996,50 +10005,50 @@ var Sa = /* @__PURE__ */ a(({ className: e, children: t, index: n = 0, knobHeigh
|
|
|
9996
10005
|
className: C(V.knobContainer),
|
|
9997
10006
|
ref: E,
|
|
9998
10007
|
style: P(H.knobContainer),
|
|
9999
|
-
element: U.knobContainer ?? /* @__PURE__ */ (0, D.jsx)(
|
|
10008
|
+
element: U.knobContainer ?? /* @__PURE__ */ (0, D.jsx)(Ta, {}),
|
|
10000
10009
|
children: /* @__PURE__ */ (0, D.jsxs)(N, {
|
|
10001
10010
|
className: C(V.knob),
|
|
10002
10011
|
style: P(H.knob),
|
|
10003
|
-
element: U.knob ?? /* @__PURE__ */ (0, D.jsx)(
|
|
10012
|
+
element: U.knob ?? /* @__PURE__ */ (0, D.jsx)(wa, {}),
|
|
10004
10013
|
children: [/* @__PURE__ */ (0, D.jsx)("div", { style: H.knobHitBox }), u && o && /* @__PURE__ */ (0, D.jsx)(N, {
|
|
10005
10014
|
className: C(V.label),
|
|
10006
10015
|
style: P(H.label),
|
|
10007
|
-
element: U.label ?? /* @__PURE__ */ (0, D.jsx)(
|
|
10008
|
-
children: o(I,
|
|
10016
|
+
element: U.label ?? /* @__PURE__ */ (0, D.jsx)(Ea, {}),
|
|
10017
|
+
children: o(I, Aa(I, u))
|
|
10009
10018
|
})]
|
|
10010
10019
|
})
|
|
10011
10020
|
})
|
|
10012
10021
|
]
|
|
10013
10022
|
})
|
|
10014
10023
|
});
|
|
10015
|
-
}),
|
|
10016
|
-
function
|
|
10024
|
+
}), wa = ({ ...e }) => /* @__PURE__ */ (0, D.jsx)("div", { ...e }), Ta = ({ ...e }) => /* @__PURE__ */ (0, D.jsx)("button", { ...e }), Ea = ({ ...e }) => /* @__PURE__ */ (0, D.jsx)("div", { ...e }), Da = ({ ...e }) => /* @__PURE__ */ (0, D.jsx)("div", { ...e });
|
|
10025
|
+
function Oa(e) {
|
|
10017
10026
|
if (e <= 1) return console.error("[etudes::StepSlider] `length` value must be greater than or equal to 2"), [];
|
|
10018
10027
|
if (Math.round(e) !== e) return console.error("[etudes::StepSlider] `length` value must be an integer"), [];
|
|
10019
10028
|
let t = 1 / (e - 1);
|
|
10020
10029
|
return Array(e).fill(null).map((e, n) => t * n);
|
|
10021
10030
|
}
|
|
10022
|
-
var
|
|
10023
|
-
Knob:
|
|
10024
|
-
KnobContainer:
|
|
10025
|
-
Label:
|
|
10026
|
-
Track:
|
|
10027
|
-
generateSteps:
|
|
10031
|
+
var ka = /* @__PURE__ */ Object.assign(Ca, {
|
|
10032
|
+
Knob: wa,
|
|
10033
|
+
KnobContainer: Ta,
|
|
10034
|
+
Label: Ea,
|
|
10035
|
+
Track: Da,
|
|
10036
|
+
generateSteps: Oa
|
|
10028
10037
|
});
|
|
10029
|
-
function
|
|
10038
|
+
function Aa(e, t) {
|
|
10030
10039
|
let n = -1, r = NaN;
|
|
10031
10040
|
for (let i = 0, a = t.length; i < a; i++) {
|
|
10032
|
-
let a =
|
|
10041
|
+
let a = ja(i, t);
|
|
10033
10042
|
if (isNaN(a)) continue;
|
|
10034
10043
|
let o = Math.abs(e - a);
|
|
10035
10044
|
(isNaN(r) || o < r) && (r = o, n = i);
|
|
10036
10045
|
}
|
|
10037
10046
|
return n;
|
|
10038
10047
|
}
|
|
10039
|
-
function
|
|
10048
|
+
function ja(e, t) {
|
|
10040
10049
|
return e >= t.length ? NaN : t[e];
|
|
10041
10050
|
}
|
|
10042
|
-
function
|
|
10051
|
+
function Ma({ orientation: e = "vertical", isAtEnd: t = !1, isAtStart: n = !1, isDragging: r = !1, isReleasing: i = !1 }) {
|
|
10043
10052
|
return k({
|
|
10044
10053
|
knob: C(e, {
|
|
10045
10054
|
"at-end": t,
|
|
@@ -10073,7 +10082,7 @@ function ja({ orientation: e = "vertical", isAtEnd: t = !1, isAtStart: n = !1, i
|
|
|
10073
10082
|
})
|
|
10074
10083
|
});
|
|
10075
10084
|
}
|
|
10076
|
-
function
|
|
10085
|
+
function Na({ knobHeight: e = 0, knobPadding: t = 0, knobWidth: n = 0, naturalPosition: r = 0, orientation: i = "vertical", isClipped: a = !1, isTrackInteractive: o = !1 }) {
|
|
10077
10086
|
return j({
|
|
10078
10087
|
body: {
|
|
10079
10088
|
height: "100%",
|
|
@@ -10138,16 +10147,16 @@ function Ma({ knobHeight: e = 0, knobPadding: t = 0, knobWidth: n = 0, naturalPo
|
|
|
10138
10147
|
}
|
|
10139
10148
|
});
|
|
10140
10149
|
}
|
|
10141
|
-
function
|
|
10150
|
+
function Pa(e) {
|
|
10142
10151
|
return 1 - e;
|
|
10143
10152
|
}
|
|
10144
|
-
function
|
|
10153
|
+
function Fa(e, t = 1, n = 0) {
|
|
10145
10154
|
return Math.max(n, Math.min(t, e));
|
|
10146
10155
|
}
|
|
10147
|
-
process.env.NODE_ENV === "development" && (
|
|
10156
|
+
process.env.NODE_ENV === "development" && (Ca.displayName = "StepSlider", Da.displayName = "StepSlider.Track", wa.displayName = "StepSlider.Knob", Ta.displayName = "StepSlider.KnobContainer", Ea.displayName = "StepSlider.Label");
|
|
10148
10157
|
//#endregion
|
|
10149
10158
|
//#region src/primitives/SwipeRegion.tsx
|
|
10150
|
-
var
|
|
10159
|
+
var Ia = /* @__PURE__ */ a(({ children: e, threshold: t = .5, isEnabled: n = !0, onSwipeDown: r, onSwipeLeft: i, onSwipeRight: a, onSwipeUp: o, ...s }, c) => {
|
|
10151
10160
|
let [l, u] = f(void 0), [d, p] = f(void 0), [m, h] = f(NaN), g = (e, t) => {
|
|
10152
10161
|
if (isNaN(e) || isNaN(t)) return y();
|
|
10153
10162
|
u(U.make(e, t));
|
|
@@ -10175,22 +10184,22 @@ var Fa = /* @__PURE__ */ a(({ children: e, threshold: t = .5, isEnabled: n = !0,
|
|
|
10175
10184
|
children: e
|
|
10176
10185
|
});
|
|
10177
10186
|
});
|
|
10178
|
-
process.env.NODE_ENV === "development" && (
|
|
10187
|
+
process.env.NODE_ENV === "development" && (Ia.displayName = "SwipeRegion");
|
|
10179
10188
|
//#endregion
|
|
10180
10189
|
//#region src/primitives/TextArea.tsx
|
|
10181
|
-
var
|
|
10190
|
+
var La = /* @__PURE__ */ a(({ onChange: e, ...t }, n) => /* @__PURE__ */ (0, D.jsx)("textarea", {
|
|
10182
10191
|
...t,
|
|
10183
10192
|
ref: n,
|
|
10184
10193
|
onChange: (t) => e(t.target.value)
|
|
10185
10194
|
}));
|
|
10186
|
-
process.env.NODE_ENV === "development" && (
|
|
10195
|
+
process.env.NODE_ENV === "development" && (La.displayName = "TextArea");
|
|
10187
10196
|
//#endregion
|
|
10188
10197
|
//#region src/primitives/Toggle.tsx
|
|
10189
|
-
var
|
|
10190
|
-
let l = d(null), u =
|
|
10191
|
-
knob:
|
|
10192
|
-
track:
|
|
10193
|
-
}), p =
|
|
10198
|
+
var Ra = /* @__PURE__ */ a(({ className: e, style: t, children: n, orientation: r = "horizontal", isInverted: i = !1, isOn: a = !1, onChange: o, ...s }, c) => {
|
|
10199
|
+
let l = d(null), u = Ht(l), f = A(n, {
|
|
10200
|
+
knob: Ba,
|
|
10201
|
+
track: za
|
|
10202
|
+
}), p = Ha({ isOn: a }), m = Ua({
|
|
10194
10203
|
knobSize: u,
|
|
10195
10204
|
orientation: r,
|
|
10196
10205
|
isInverted: i,
|
|
@@ -10209,7 +10218,7 @@ var La = /* @__PURE__ */ a(({ className: e, style: t, children: n, orientation:
|
|
|
10209
10218
|
}), /* @__PURE__ */ (0, D.jsx)(N, {
|
|
10210
10219
|
className: p.track,
|
|
10211
10220
|
style: m.track,
|
|
10212
|
-
element: f.track ?? /* @__PURE__ */ (0, D.jsx)(
|
|
10221
|
+
element: f.track ?? /* @__PURE__ */ (0, D.jsx)(za, {}),
|
|
10213
10222
|
children: /* @__PURE__ */ (0, D.jsx)("div", {
|
|
10214
10223
|
style: {
|
|
10215
10224
|
height: "100%",
|
|
@@ -10220,29 +10229,29 @@ var La = /* @__PURE__ */ a(({ className: e, style: t, children: n, orientation:
|
|
|
10220
10229
|
className: p.knob,
|
|
10221
10230
|
ref: l,
|
|
10222
10231
|
style: m.knob,
|
|
10223
|
-
element: f.knob ?? /* @__PURE__ */ (0, D.jsx)(
|
|
10232
|
+
element: f.knob ?? /* @__PURE__ */ (0, D.jsx)(Ba, {})
|
|
10224
10233
|
})
|
|
10225
10234
|
})
|
|
10226
10235
|
})]
|
|
10227
10236
|
});
|
|
10228
|
-
}),
|
|
10237
|
+
}), za = ({ children: e, ...t }) => /* @__PURE__ */ (0, D.jsx)("div", {
|
|
10229
10238
|
...t,
|
|
10230
10239
|
children: e
|
|
10231
|
-
}),
|
|
10240
|
+
}), Ba = ({ children: e, ...t }) => /* @__PURE__ */ (0, D.jsx)("div", {
|
|
10232
10241
|
...t,
|
|
10233
10242
|
children: e
|
|
10234
|
-
}),
|
|
10235
|
-
Knob:
|
|
10236
|
-
Track:
|
|
10243
|
+
}), Va = /* @__PURE__ */ Object.assign(Ra, {
|
|
10244
|
+
Knob: Ba,
|
|
10245
|
+
Track: za
|
|
10237
10246
|
});
|
|
10238
|
-
function
|
|
10247
|
+
function Ha({ isOn: e = !1 }) {
|
|
10239
10248
|
return k({
|
|
10240
10249
|
knob: C({ active: e }),
|
|
10241
10250
|
root: C({ active: e }),
|
|
10242
10251
|
track: C({ active: e })
|
|
10243
10252
|
});
|
|
10244
10253
|
}
|
|
10245
|
-
function
|
|
10254
|
+
function Ua({ knobSize: e = G.zero, orientation: t = "horizontal", isInverted: n = !1, isOn: r = !1 }) {
|
|
10246
10255
|
return j({
|
|
10247
10256
|
input: {
|
|
10248
10257
|
height: 0,
|
|
@@ -10272,26 +10281,26 @@ function Ha({ knobSize: e = G.zero, orientation: t = "horizontal", isInverted: n
|
|
|
10272
10281
|
track: { position: "relative" }
|
|
10273
10282
|
});
|
|
10274
10283
|
}
|
|
10275
|
-
process.env.NODE_ENV === "development" && (
|
|
10284
|
+
process.env.NODE_ENV === "development" && (Ra.displayName = "Toggle", Ba.displayName = "Toggle.Knob", za.displayName = "Toggle.Track");
|
|
10276
10285
|
//#endregion
|
|
10277
10286
|
//#region src/utils/createKeyDeep.ts
|
|
10278
|
-
function
|
|
10279
|
-
return e == null ? "" : Array.isArray(e) ? JSON.stringify(e.map(
|
|
10287
|
+
function Wa(e) {
|
|
10288
|
+
return e == null ? "" : Array.isArray(e) ? JSON.stringify(e.map(Wa)) : typeof e == "object" ? JSON.stringify(Object.entries(e).sort(([e], [t]) => e.localeCompare(t)).map(([e, t]) => [e, Wa(t)])) : je(e);
|
|
10280
10289
|
}
|
|
10281
10290
|
//#endregion
|
|
10282
10291
|
//#region src/utils/ExtractChildren.tsx
|
|
10283
|
-
function
|
|
10292
|
+
function Ga({ children: e, ...n }) {
|
|
10284
10293
|
return /* @__PURE__ */ (0, D.jsx)(D.Fragment, { children: t.map(e, (e) => o(e) ? M(e, { ...n }) : e) });
|
|
10285
10294
|
}
|
|
10286
|
-
process.env.NODE_ENV === "development" && (
|
|
10295
|
+
process.env.NODE_ENV === "development" && (Ga.displayName = "ExtractChildren");
|
|
10287
10296
|
//#endregion
|
|
10288
10297
|
//#region src/utils/getSystemColorScheme.ts
|
|
10289
|
-
function
|
|
10298
|
+
function Ka() {
|
|
10290
10299
|
return typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
10291
10300
|
}
|
|
10292
10301
|
//#endregion
|
|
10293
10302
|
//#region src/utils/NoSSR.tsx
|
|
10294
|
-
function
|
|
10303
|
+
function qa({ children: e, fallback: t = void 0 }) {
|
|
10295
10304
|
let [n, i] = f(!1);
|
|
10296
10305
|
if (c(() => {
|
|
10297
10306
|
i(typeof window < "u");
|
|
@@ -10301,4 +10310,4 @@ function Ka({ children: e, fallback: t = void 0 }) {
|
|
|
10301
10310
|
});
|
|
10302
10311
|
}
|
|
10303
10312
|
//#endregion
|
|
10304
|
-
export {
|
|
10313
|
+
export { cn as Accordion, L as Burger, V as BurgerButton, we as Button, mn as Carousel, xn as CodeInput, Xt as Collection, Y as Conditional, jn as Counter, pe as CoverImage, Se as CoverVideo, In as Dial, Kn as Dropdown, qe as Each, $e as ExtractChild, Ga as ExtractChildren, Ii as FlatSVG, Li as Form, ce as Image, ie as ImageSource, zi as MasonryGrid, qa as NoSSR, De as OptionButton, Fe as Panorama, We as PanoramaSlider, le as Picture, Qi as RangeSlider, O as Repeat, pa as Select, Ke as SelectableButton, ba as Slider, ka as StepSlider, N as Styled, Ia as SwipeRegion, Ze as Switch, La as TextArea, En as TextField, Va as Toggle, ve as Video, nt as WithTooltip, de as _Content, _a as _Knob, va as _KnobContainer, ya as _Label, ga as _Track, fe as _Viewport, k as asClassNameDict, A as asComponentDict, j as asStyleDict, M as cloneStyledElement, je as createKey, Wa as createKeyDeep, xt as createLocalCache, It as createSessionCache, Ut as getStyle, Ka as getSystemColorScheme, _t as isTouchDevice, et as measureIntrinsicSize, Wt as setStyle, tt as setStyles, P as styles, st as useClassName, ct as useClickOutside, lt as useCopyBlobToClipboard, ft as useDPR, ut as useDownloadBlob, pt as useDrag, mt as useDropzone, ae as useImageLoader, oe as useImageSize, Me as useInertiaDrag, Ne as useInertiaDragValue, ee as useIntersectionObserver, ht as useInterval, gt as useIsMounted, vt as useIsTouchDevice, yt as useKeyboardShortcut, J as useLatest, Et as useLocalCache, Dt as useMouseEnter, Ot as useMouseLeave, kt as useOS, At as usePrevious, re as useRect, jt as useScrollPosition, Vt as useSessionCache, Ht as useSize, te as useSizeObserver, Gt as useStyle, Kt as useSystemColorScheme, qt as useTimeout, he as useVideoMetadataLoader, ge as useVideoSize, ne as useViewportSize };
|