matsci-parse 0.15.0 → 0.16.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/dist/index.js +945 -927
- package/dist/index.js.map +1 -1
- package/dist/stats.html +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6865,88 +6865,106 @@ var fr = class {
|
|
|
6865
6865
|
//#endregion
|
|
6866
6866
|
//#region lib/core/io/cif/index.ts
|
|
6867
6867
|
function pr(e) {
|
|
6868
|
-
|
|
6868
|
+
if (e === void 0) return NaN;
|
|
6869
|
+
let t = e.replace(/^['"]+|['"]+$/g, "").trim();
|
|
6870
|
+
return Number(t.replace(/\(.+\)/, ""));
|
|
6869
6871
|
}
|
|
6870
6872
|
function mr(e) {
|
|
6871
6873
|
return e.match(/'[^']*'|"[^"]*"|\S+/g) ?? [];
|
|
6872
6874
|
}
|
|
6873
6875
|
function hr(e) {
|
|
6874
|
-
let t =
|
|
6875
|
-
|
|
6876
|
-
|
|
6877
|
-
|
|
6878
|
-
|
|
6879
|
-
|
|
6880
|
-
|
|
6881
|
-
|
|
6882
|
-
|
|
6883
|
-
|
|
6884
|
-
|
|
6885
|
-
|
|
6876
|
+
let t = e.toLowerCase();
|
|
6877
|
+
return t.includes("symmetry_equiv_pos") || t.includes("symop_operation_xyz");
|
|
6878
|
+
}
|
|
6879
|
+
function gr(e) {
|
|
6880
|
+
if (e === void 0) return "";
|
|
6881
|
+
let t = e.replace(/^['"]+|['"]+$/g, "").trim(), n = t.match(/^([A-Z][a-z]?)/);
|
|
6882
|
+
return n ? n[1] : t;
|
|
6883
|
+
}
|
|
6884
|
+
function _r(e) {
|
|
6885
|
+
let t = 0, n = 0, r = 0, i = 0, a = 0, o = 0, s = [], c = [], l = !1, u = [], d = !1, f = !1, p = !1, m = !1, h = [];
|
|
6886
|
+
function g() {
|
|
6887
|
+
l = !1, d = !1, f = !1, p = !1, m = !1, u = [];
|
|
6888
|
+
}
|
|
6889
|
+
let _ = new fr(e), v;
|
|
6890
|
+
for (; (v = _.next()) !== null;) {
|
|
6891
|
+
let e = v.trim();
|
|
6892
|
+
if (e && !e.startsWith("#")) {
|
|
6893
|
+
if (e.startsWith("data_") || e.startsWith("save_")) {
|
|
6894
|
+
g();
|
|
6886
6895
|
continue;
|
|
6887
6896
|
}
|
|
6888
|
-
if (
|
|
6889
|
-
|
|
6897
|
+
if (e === "loop_") {
|
|
6898
|
+
l = !0, u = [], d = !1, f = !1, p = !1, m = !1;
|
|
6890
6899
|
continue;
|
|
6891
6900
|
}
|
|
6892
|
-
if (
|
|
6893
|
-
|
|
6894
|
-
|
|
6895
|
-
|
|
6896
|
-
|
|
6901
|
+
if (e.startsWith("_cell_length_a") ? t = pr(mr(e)[1]) : e.startsWith("_cell_length_b") ? n = pr(mr(e)[1]) : e.startsWith("_cell_length_c") ? r = pr(mr(e)[1]) : e.startsWith("_cell_angle_alpha") ? i = pr(mr(e)[1]) : e.startsWith("_cell_angle_beta") ? a = pr(mr(e)[1]) : e.startsWith("_cell_angle_gamma") && (o = pr(mr(e)[1])), l && e.startsWith("_")) {
|
|
6902
|
+
if (c.length > 0 && d) {
|
|
6903
|
+
g();
|
|
6904
|
+
continue;
|
|
6905
|
+
}
|
|
6906
|
+
if (h.length > 0 && f) {
|
|
6907
|
+
g();
|
|
6908
|
+
continue;
|
|
6897
6909
|
}
|
|
6910
|
+
u.push(e), hr(e) ? (f = !0, d = !1, p = !1) : e.includes("_atom_site_aniso_") ? (m = !0, d = !1, p = !1) : e.includes("_atom_site_") && (m || (p = !0), f = !1);
|
|
6911
|
+
continue;
|
|
6912
|
+
}
|
|
6913
|
+
if (l && p && !d && (!(u.some((e) => e.includes("fract_x")) || u.some((e) => e.includes("fract_y")) || u.some((e) => e.includes("fract_z"))) || m ? p = !1 : (p = !1, d = !0, f = !1)), l && d && (s.length === 0 && (s = [...u]), c.push(mr(e))), l && f) {
|
|
6914
|
+
let t = e, n = t.match(/^\d+\s+(.*)$/);
|
|
6915
|
+
n && (t = n[1].trim()), t = t.replace(/^['"]+|['"]+$/g, "").trim(), t.includes(",") && h.push(t);
|
|
6898
6916
|
}
|
|
6899
6917
|
}
|
|
6900
6918
|
}
|
|
6901
|
-
let
|
|
6902
|
-
if (
|
|
6903
|
-
let
|
|
6904
|
-
if (e.length <=
|
|
6919
|
+
let y = M(t, n, r, i, a, o), b = s.findIndex((e) => e.includes("fract_x")), x = s.findIndex((e) => e.includes("fract_y")), S = s.findIndex((e) => e.includes("fract_z")), C = s.findIndex((e) => e.includes("type_symbol"));
|
|
6920
|
+
if (b < 0 || x < 0 || S < 0 || C < 0) throw Error("Missing required atom site columns");
|
|
6921
|
+
let w = Math.max(b, x, S, C), T = c.map((e) => {
|
|
6922
|
+
if (e.length <= w) throw Error("Incomplete atom site data row");
|
|
6905
6923
|
return {
|
|
6906
|
-
species: { symbol: e[
|
|
6924
|
+
species: { symbol: gr(e[C]) },
|
|
6907
6925
|
frac: new Float64Array([
|
|
6908
|
-
pr(e[
|
|
6909
|
-
pr(e[
|
|
6910
|
-
pr(e[
|
|
6926
|
+
pr(e[b]),
|
|
6927
|
+
pr(e[x]),
|
|
6928
|
+
pr(e[S])
|
|
6911
6929
|
])
|
|
6912
6930
|
};
|
|
6913
6931
|
});
|
|
6914
|
-
if (
|
|
6915
|
-
lattice:
|
|
6916
|
-
sites:
|
|
6932
|
+
if (h.length === 0) return {
|
|
6933
|
+
lattice: y,
|
|
6934
|
+
sites: T
|
|
6917
6935
|
};
|
|
6918
|
-
let
|
|
6919
|
-
function
|
|
6936
|
+
let E = ur(h);
|
|
6937
|
+
function D(e) {
|
|
6920
6938
|
return (e % 1 + 1) % 1;
|
|
6921
6939
|
}
|
|
6922
|
-
function
|
|
6940
|
+
function O(e) {
|
|
6923
6941
|
return Math.abs(e) < .001 ? 0 : e;
|
|
6924
6942
|
}
|
|
6925
|
-
function
|
|
6943
|
+
function k(e, t) {
|
|
6926
6944
|
let n = t.map((e) => {
|
|
6927
|
-
let t =
|
|
6945
|
+
let t = O(D(e));
|
|
6928
6946
|
return Math.round(t * 1e3) / 1e3;
|
|
6929
6947
|
});
|
|
6930
6948
|
return `${e}:${n[0]},${n[1]},${n[2]}`;
|
|
6931
6949
|
}
|
|
6932
|
-
let
|
|
6933
|
-
for (let e of
|
|
6950
|
+
let A = /* @__PURE__ */ new Set(), j = [];
|
|
6951
|
+
for (let e of T) for (let t of E) {
|
|
6934
6952
|
let n = dr(t, Array.from(e.frac)), r = [
|
|
6935
|
-
|
|
6936
|
-
|
|
6937
|
-
|
|
6938
|
-
], i =
|
|
6939
|
-
|
|
6953
|
+
O(D(n[0])),
|
|
6954
|
+
O(D(n[1])),
|
|
6955
|
+
O(D(n[2]))
|
|
6956
|
+
], i = k(e.species.symbol, r);
|
|
6957
|
+
A.has(i) || (A.add(i), j.push({
|
|
6940
6958
|
species: { symbol: e.species.symbol },
|
|
6941
6959
|
frac: new Float64Array(r)
|
|
6942
6960
|
}));
|
|
6943
6961
|
}
|
|
6944
6962
|
return {
|
|
6945
|
-
lattice:
|
|
6946
|
-
sites:
|
|
6963
|
+
lattice: y,
|
|
6964
|
+
sites: j
|
|
6947
6965
|
};
|
|
6948
6966
|
}
|
|
6949
|
-
function
|
|
6967
|
+
function vr(e, t = 6) {
|
|
6950
6968
|
let n = Oe(e.lattice), r = [];
|
|
6951
6969
|
r.push("data_matsci-parse"), r.push(""), r.push("_symmetry_space_group_name_H-M 'P 1'"), r.push("_symmetry_Int_Tables_number 1"), r.push(""), r.push(`_cell_length_a ${n[0].toFixed(t)}`), r.push(`_cell_length_b ${n[1].toFixed(t)}`), r.push(`_cell_length_c ${n[2].toFixed(t)}`), r.push(`_cell_angle_alpha ${n[3].toFixed(t)}`), r.push(`_cell_angle_beta ${n[4].toFixed(t)}`), r.push(`_cell_angle_gamma ${n[5].toFixed(t)}`), r.push(""), r.push("loop_"), r.push("_atom_site_label"), r.push("_atom_site_type_symbol"), r.push("_atom_site_fract_x"), r.push("_atom_site_fract_y"), r.push("_atom_site_fract_z");
|
|
6952
6970
|
for (let n = 0; n < e.sites.length; n++) {
|
|
@@ -6957,14 +6975,14 @@ function gr(e, t = 6) {
|
|
|
6957
6975
|
}
|
|
6958
6976
|
//#endregion
|
|
6959
6977
|
//#region lib/core/io/poscar.ts
|
|
6960
|
-
function
|
|
6978
|
+
function yr(e) {
|
|
6961
6979
|
return e.toLowerCase().startsWith("selective");
|
|
6962
6980
|
}
|
|
6963
|
-
function
|
|
6981
|
+
function br(e) {
|
|
6964
6982
|
let t = e.trim().toLowerCase();
|
|
6965
6983
|
return t.startsWith("c") || t.startsWith("k");
|
|
6966
6984
|
}
|
|
6967
|
-
function
|
|
6985
|
+
function xr(e) {
|
|
6968
6986
|
let t = new fr(e);
|
|
6969
6987
|
t.next();
|
|
6970
6988
|
let n = Number(t.nextTrimmed()), r = [];
|
|
@@ -6976,9 +6994,9 @@ function yr(e) {
|
|
|
6976
6994
|
let i = d(r), a = t.nextTrimmed().split(/\s+/), o = t.nextTrimmed().split(/\s+/).map(Number);
|
|
6977
6995
|
if (a.length !== o.length) throw Error("Species/count mismatch");
|
|
6978
6996
|
let s = !1, c = t.nextTrimmed();
|
|
6979
|
-
|
|
6997
|
+
yr(c) && (s = !0, c = t.nextTrimmed());
|
|
6980
6998
|
let l = !0;
|
|
6981
|
-
l = !
|
|
6999
|
+
l = !br(c);
|
|
6982
7000
|
let u = [], f = 0, p = o[0], m = o.reduce((e, t) => e + t, 0);
|
|
6983
7001
|
for (let e = 0; e < m; e++) {
|
|
6984
7002
|
let e = t.nextTrimmed().split(/\s+/), n = e.slice(0, 3).map(Number), r = l ? new Float64Array(n) : de(i, new Float64Array(n)), c = {};
|
|
@@ -6999,7 +7017,7 @@ function yr(e) {
|
|
|
6999
7017
|
_cursorEnd: t.count
|
|
7000
7018
|
};
|
|
7001
7019
|
}
|
|
7002
|
-
function
|
|
7020
|
+
function Sr(e, t) {
|
|
7003
7021
|
let n = t?.title ?? "Generated by matsci-parse", r = t?.scale ?? 1, i = t?.direct ?? !0, a = [];
|
|
7004
7022
|
a.push(n), a.push(String(r));
|
|
7005
7023
|
let o = e.lattice.basis.data;
|
|
@@ -7019,7 +7037,7 @@ function br(e, t) {
|
|
|
7019
7037
|
}
|
|
7020
7038
|
//#endregion
|
|
7021
7039
|
//#region lib/core/io/structuredata.ts
|
|
7022
|
-
function
|
|
7040
|
+
function Cr(e) {
|
|
7023
7041
|
let t = d([
|
|
7024
7042
|
...e.cell[0],
|
|
7025
7043
|
...e.cell[1],
|
|
@@ -7037,7 +7055,7 @@ function xr(e) {
|
|
|
7037
7055
|
})
|
|
7038
7056
|
};
|
|
7039
7057
|
}
|
|
7040
|
-
function
|
|
7058
|
+
function wr(e) {
|
|
7041
7059
|
let t = e.lattice.basis.data, n = [...new Set(e.sites.map((e) => e.species.symbol))].map((e) => ({
|
|
7042
7060
|
name: e,
|
|
7043
7061
|
symbols: [e]
|
|
@@ -7072,20 +7090,20 @@ function Sr(e) {
|
|
|
7072
7090
|
}
|
|
7073
7091
|
//#endregion
|
|
7074
7092
|
//#region lib/core/io/xsf.ts
|
|
7075
|
-
function
|
|
7093
|
+
function Tr(e, t) {
|
|
7076
7094
|
let n;
|
|
7077
7095
|
for (; (n = e.next()) !== null;) if (n.trim().toUpperCase() === t) return;
|
|
7078
7096
|
throw Error(`Missing ${t}`);
|
|
7079
7097
|
}
|
|
7080
|
-
function
|
|
7098
|
+
function Er(e) {
|
|
7081
7099
|
let t = new fr(e);
|
|
7082
|
-
|
|
7100
|
+
Tr(t, "PRIMVEC");
|
|
7083
7101
|
let n = d([
|
|
7084
7102
|
...t.nextTrimmed().split(/\s+/).map(Number),
|
|
7085
7103
|
...t.nextTrimmed().split(/\s+/).map(Number),
|
|
7086
7104
|
...t.nextTrimmed().split(/\s+/).map(Number)
|
|
7087
7105
|
]);
|
|
7088
|
-
|
|
7106
|
+
Tr(t, "PRIMCOORD");
|
|
7089
7107
|
let [r] = t.nextTrimmed().split(/\s+/).map(Number);
|
|
7090
7108
|
if (!Number.isInteger(r) || r < 0) throw Error("Invalid atom count in PRIMCOORD");
|
|
7091
7109
|
let i = oe(n).data, a = [];
|
|
@@ -7105,33 +7123,33 @@ function wr(e) {
|
|
|
7105
7123
|
sites: a
|
|
7106
7124
|
};
|
|
7107
7125
|
}
|
|
7108
|
-
function
|
|
7126
|
+
function Dr(e) {
|
|
7109
7127
|
return `${e[0]} ${e[1]} ${e[2]}`;
|
|
7110
7128
|
}
|
|
7111
|
-
function
|
|
7129
|
+
function Or(e) {
|
|
7112
7130
|
let t = e.basis.data;
|
|
7113
7131
|
return [
|
|
7114
|
-
|
|
7132
|
+
Dr([
|
|
7115
7133
|
t[0],
|
|
7116
7134
|
t[1],
|
|
7117
7135
|
t[2]
|
|
7118
7136
|
]),
|
|
7119
|
-
|
|
7137
|
+
Dr([
|
|
7120
7138
|
t[3],
|
|
7121
7139
|
t[4],
|
|
7122
7140
|
t[5]
|
|
7123
7141
|
]),
|
|
7124
|
-
|
|
7142
|
+
Dr([
|
|
7125
7143
|
t[6],
|
|
7126
7144
|
t[7],
|
|
7127
7145
|
t[8]
|
|
7128
7146
|
])
|
|
7129
7147
|
];
|
|
7130
7148
|
}
|
|
7131
|
-
function
|
|
7149
|
+
function kr(e) {
|
|
7132
7150
|
let t = [];
|
|
7133
7151
|
t.push("CRYSTAL"), t.push("PRIMVEC");
|
|
7134
|
-
let n =
|
|
7152
|
+
let n = Or(e.lattice);
|
|
7135
7153
|
t.push(...n), t.push("PRIMCOORD"), t.push(`${e.sites.length} 1`);
|
|
7136
7154
|
for (let n of e.sites) {
|
|
7137
7155
|
let r = ue(e.lattice, n);
|
|
@@ -7141,7 +7159,7 @@ function Dr(e) {
|
|
|
7141
7159
|
}
|
|
7142
7160
|
//#endregion
|
|
7143
7161
|
//#region lib/core/io/xyz.ts
|
|
7144
|
-
function
|
|
7162
|
+
function Ar(e) {
|
|
7145
7163
|
let t = {};
|
|
7146
7164
|
for (let n of e.matchAll(/(\w+)=(".*?"|\S+)/g)) {
|
|
7147
7165
|
let e = n[2];
|
|
@@ -7149,7 +7167,7 @@ function Or(e) {
|
|
|
7149
7167
|
}
|
|
7150
7168
|
return t;
|
|
7151
7169
|
}
|
|
7152
|
-
function
|
|
7170
|
+
function jr(e) {
|
|
7153
7171
|
if (!e.Lattice) throw Error("Extended XYZ must contain Lattice");
|
|
7154
7172
|
let t = e.Lattice.split(/\s+/).map(Number);
|
|
7155
7173
|
if (t.length !== 9) throw Error("Invalid Lattice");
|
|
@@ -7165,7 +7183,7 @@ function kr(e) {
|
|
|
7165
7183
|
t[8]
|
|
7166
7184
|
]);
|
|
7167
7185
|
}
|
|
7168
|
-
function
|
|
7186
|
+
function Mr(e) {
|
|
7169
7187
|
let t = e.split(":"), n = [], r = 0;
|
|
7170
7188
|
for (let e = 0; e < t.length; e += 3) {
|
|
7171
7189
|
let i = Number(t[e + 2]);
|
|
@@ -7178,7 +7196,7 @@ function Ar(e) {
|
|
|
7178
7196
|
}
|
|
7179
7197
|
return n;
|
|
7180
7198
|
}
|
|
7181
|
-
function
|
|
7199
|
+
function Nr(e) {
|
|
7182
7200
|
let t = new fr(e), n;
|
|
7183
7201
|
do
|
|
7184
7202
|
n = t.next();
|
|
@@ -7188,7 +7206,7 @@ function jr(e) {
|
|
|
7188
7206
|
if (!Number.isInteger(r) || r < 0) throw Error("Invalid atom count in XYZ file");
|
|
7189
7207
|
let i = t.next();
|
|
7190
7208
|
if (i === null) throw Error("XYZ file is too short");
|
|
7191
|
-
let a =
|
|
7209
|
+
let a = Ar(i), o = jr(a), s = a.Properties ? Mr(a.Properties) : [{
|
|
7192
7210
|
name: "species",
|
|
7193
7211
|
type: "S",
|
|
7194
7212
|
count: 1,
|
|
@@ -7225,14 +7243,14 @@ function jr(e) {
|
|
|
7225
7243
|
selectiveDynamics: l || void 0
|
|
7226
7244
|
};
|
|
7227
7245
|
}
|
|
7228
|
-
function
|
|
7246
|
+
function Pr(e) {
|
|
7229
7247
|
let t = e.basis.data;
|
|
7230
7248
|
return `${t[0]} ${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]} ${t[7]} ${t[8]}`;
|
|
7231
7249
|
}
|
|
7232
|
-
function
|
|
7250
|
+
function Fr(e) {
|
|
7233
7251
|
let t = [], n = e.sites;
|
|
7234
7252
|
t.push(String(n.length));
|
|
7235
|
-
let r =
|
|
7253
|
+
let r = Pr(e.lattice), i = [
|
|
7236
7254
|
"species",
|
|
7237
7255
|
"S",
|
|
7238
7256
|
"1",
|
|
@@ -7249,7 +7267,7 @@ function Nr(e) {
|
|
|
7249
7267
|
}
|
|
7250
7268
|
//#endregion
|
|
7251
7269
|
//#region lib/core/io/optimade.ts
|
|
7252
|
-
function
|
|
7270
|
+
function Ir(e) {
|
|
7253
7271
|
let t = d([
|
|
7254
7272
|
...e.attributes.lattice_vectors[0],
|
|
7255
7273
|
...e.attributes.lattice_vectors[1],
|
|
@@ -7263,7 +7281,7 @@ function Pr(e) {
|
|
|
7263
7281
|
}))
|
|
7264
7282
|
};
|
|
7265
7283
|
}
|
|
7266
|
-
function
|
|
7284
|
+
function Lr(e) {
|
|
7267
7285
|
let t = e.lattice.basis.data, n = e.sites.map((e) => e.species.symbol), r = [...new Set(n)].sort();
|
|
7268
7286
|
return { attributes: {
|
|
7269
7287
|
lattice_vectors: [
|
|
@@ -7297,16 +7315,16 @@ function Fr(e) {
|
|
|
7297
7315
|
}
|
|
7298
7316
|
//#endregion
|
|
7299
7317
|
//#region lib/core/units/converter.ts
|
|
7300
|
-
function
|
|
7318
|
+
function Rr(e, t, n, r, i) {
|
|
7301
7319
|
let a = (e) => i?.[e] ?? e, o = a(t), s = a(n);
|
|
7302
7320
|
return o === s ? e : e * r[o] / r[s];
|
|
7303
7321
|
}
|
|
7304
|
-
function
|
|
7305
|
-
return e.map((e) =>
|
|
7322
|
+
function zr(e, t, n, r, i) {
|
|
7323
|
+
return e.map((e) => Rr(e, t, n, r, i));
|
|
7306
7324
|
}
|
|
7307
7325
|
//#endregion
|
|
7308
7326
|
//#region lib/core/units/length.ts
|
|
7309
|
-
var
|
|
7327
|
+
var Br = {
|
|
7310
7328
|
angstrom: 1,
|
|
7311
7329
|
bohr: .529177,
|
|
7312
7330
|
nm: 10,
|
|
@@ -7315,28 +7333,28 @@ var Rr = {
|
|
|
7315
7333
|
cm: 1e8,
|
|
7316
7334
|
m: 1e10,
|
|
7317
7335
|
fm: 1e-5
|
|
7318
|
-
},
|
|
7336
|
+
}, Vr = {
|
|
7319
7337
|
Å: "angstrom",
|
|
7320
7338
|
μm: "um"
|
|
7321
|
-
},
|
|
7322
|
-
conversions:
|
|
7323
|
-
aliases:
|
|
7339
|
+
}, Hr = {
|
|
7340
|
+
conversions: Br,
|
|
7341
|
+
aliases: Vr,
|
|
7324
7342
|
convert(e, t, n) {
|
|
7325
|
-
return
|
|
7343
|
+
return Rr(e, t, n, Br, Vr);
|
|
7326
7344
|
},
|
|
7327
7345
|
convertArray(e, t, n) {
|
|
7328
|
-
return
|
|
7346
|
+
return zr(e, t, n, Br, Vr);
|
|
7329
7347
|
}
|
|
7330
7348
|
};
|
|
7331
7349
|
//#endregion
|
|
7332
7350
|
//#region lib/core/io/gro.ts
|
|
7333
|
-
function
|
|
7351
|
+
function Ur(e) {
|
|
7334
7352
|
return e.length > 5 ? e.slice(0, 5) : e.padStart(5);
|
|
7335
7353
|
}
|
|
7336
|
-
function
|
|
7354
|
+
function Wr(e) {
|
|
7337
7355
|
return e.toFixed(3).padStart(8);
|
|
7338
7356
|
}
|
|
7339
|
-
function
|
|
7357
|
+
function Gr(e) {
|
|
7340
7358
|
let t = e.split(/\r?\n/).filter((e) => e.length > 0), n = 0, r = t[n++].match(/t=\s*([-+]?[0-9]*\.?[0-9]+)/i), i = r ? Number(r[1]) : void 0, a = Number(t[n++]);
|
|
7341
7359
|
if (!Number.isFinite(a)) throw Error("Invalid GRO atom count");
|
|
7342
7360
|
let o = [];
|
|
@@ -7344,7 +7362,7 @@ function Ur(e) {
|
|
|
7344
7362
|
let e = t[n++], r = Number(e.slice(20, 28)), i = Number(e.slice(28, 36)), a = Number(e.slice(36, 44)), s = e.slice(10, 15).trim().replace(/[0-9]/g, "");
|
|
7345
7363
|
s = s.charAt(0).toUpperCase() + s.slice(1).toLowerCase(), o.push({
|
|
7346
7364
|
symbol: s,
|
|
7347
|
-
cart: new Float64Array(
|
|
7365
|
+
cart: new Float64Array(Hr.convertArray([
|
|
7348
7366
|
r,
|
|
7349
7367
|
i,
|
|
7350
7368
|
a
|
|
@@ -7353,7 +7371,7 @@ function Ur(e) {
|
|
|
7353
7371
|
}
|
|
7354
7372
|
let s = null, c = t[n];
|
|
7355
7373
|
if (c) {
|
|
7356
|
-
let e = c.trim().split(/\s+/).map(Number), t =
|
|
7374
|
+
let e = c.trim().split(/\s+/).map(Number), t = Hr.convertArray([
|
|
7357
7375
|
e[0] ?? 0,
|
|
7358
7376
|
e[3] ?? 0,
|
|
7359
7377
|
e[4] ?? 0,
|
|
@@ -7384,14 +7402,14 @@ function Ur(e) {
|
|
|
7384
7402
|
time: i
|
|
7385
7403
|
};
|
|
7386
7404
|
}
|
|
7387
|
-
function
|
|
7405
|
+
function Kr(e, t) {
|
|
7388
7406
|
let n = t?.title ?? (t?.time === void 0 ? "Generated by matsci-parse" : `Generated structure, t=${t.time}`), r = [];
|
|
7389
7407
|
r.push(n), r.push(String(e.sites.length));
|
|
7390
7408
|
for (let t = 0; t < e.sites.length; t++) {
|
|
7391
|
-
let n = e.sites[t], i = ue(e.lattice, n), [a, o, s] =
|
|
7392
|
-
r.push(
|
|
7409
|
+
let n = e.sites[t], i = ue(e.lattice, n), [a, o, s] = Hr.convertArray(Array.from(i), "angstrom", "nm");
|
|
7410
|
+
r.push(Ur("1") + Ur("RES") + Ur(n.species.symbol) + Ur(String(t + 1)) + Wr(a) + Wr(o) + Wr(s));
|
|
7393
7411
|
}
|
|
7394
|
-
let i = e.lattice.basis.data, [a, o, s] =
|
|
7412
|
+
let i = e.lattice.basis.data, [a, o, s] = Hr.convertArray([
|
|
7395
7413
|
i[0],
|
|
7396
7414
|
i[4],
|
|
7397
7415
|
i[8]
|
|
@@ -7404,8 +7422,8 @@ function Wr(e, t) {
|
|
|
7404
7422
|
}
|
|
7405
7423
|
//#endregion
|
|
7406
7424
|
//#region lib/core/io/pdb.ts
|
|
7407
|
-
var
|
|
7408
|
-
function
|
|
7425
|
+
var qr = 10;
|
|
7426
|
+
function Jr(e) {
|
|
7409
7427
|
return {
|
|
7410
7428
|
a: Number(e.slice(6, 15)),
|
|
7411
7429
|
b: Number(e.slice(15, 24)),
|
|
@@ -7415,16 +7433,16 @@ function Kr(e) {
|
|
|
7415
7433
|
gamma: Number(e.slice(47, 54))
|
|
7416
7434
|
};
|
|
7417
7435
|
}
|
|
7418
|
-
function
|
|
7436
|
+
function Yr(e, t, n, r, i, a) {
|
|
7419
7437
|
if (e <= .001 || t <= .001 || n <= .001) return !1;
|
|
7420
7438
|
let o = 1.2;
|
|
7421
7439
|
return !(e < r * o || t < i * o || n < a * o || e === 1 && t === 1 && n === 1);
|
|
7422
7440
|
}
|
|
7423
|
-
function
|
|
7441
|
+
function Xr(e) {
|
|
7424
7442
|
let t = e.split(/\r?\n/), n = null, r = [], i = Infinity, a = Infinity, o = Infinity, s = -Infinity, c = -Infinity, l = -Infinity;
|
|
7425
7443
|
for (let e of t) {
|
|
7426
7444
|
if (e.startsWith("CRYST1")) {
|
|
7427
|
-
n =
|
|
7445
|
+
n = Jr(e);
|
|
7428
7446
|
continue;
|
|
7429
7447
|
}
|
|
7430
7448
|
if (!e.startsWith("ATOM ") && !e.startsWith("HETATM")) continue;
|
|
@@ -7447,8 +7465,8 @@ function Jr(e) {
|
|
|
7447
7465
|
0,
|
|
7448
7466
|
0,
|
|
7449
7467
|
1
|
|
7450
|
-
]), h = i -
|
|
7451
|
-
n !== null &&
|
|
7468
|
+
]), h = i - qr, g = a - qr, _ = o - qr;
|
|
7469
|
+
n !== null && Yr(n.a, n.b, n.c, u, f, p) ? (m = M(n.a, n.b, n.c, n.alpha, n.beta, n.gamma), h = 0, g = 0, _ = 0) : m = d([
|
|
7452
7470
|
Math.max(u + 20, 1),
|
|
7453
7471
|
0,
|
|
7454
7472
|
0,
|
|
@@ -7472,7 +7490,7 @@ function Jr(e) {
|
|
|
7472
7490
|
sites: v
|
|
7473
7491
|
};
|
|
7474
7492
|
}
|
|
7475
|
-
function
|
|
7493
|
+
function Zr(e, t) {
|
|
7476
7494
|
let n = t?.title ?? "Generated by matsci-parse", r = [];
|
|
7477
7495
|
r.push(`HEADER ${n}`);
|
|
7478
7496
|
let i = 1;
|
|
@@ -7499,8 +7517,8 @@ function Yr(e, t) {
|
|
|
7499
7517
|
}
|
|
7500
7518
|
//#endregion
|
|
7501
7519
|
//#region lib/core/io/pw/ibrav.ts
|
|
7502
|
-
var
|
|
7503
|
-
function
|
|
7520
|
+
var Qr = Math.sqrt(3), $r = Math.sqrt(2);
|
|
7521
|
+
function ei(e, t, n) {
|
|
7504
7522
|
if (e === 0) throw Error("ibrav=0 requires explicit CELL_PARAMETERS");
|
|
7505
7523
|
let r, i, a, o, s, l;
|
|
7506
7524
|
if (n) {
|
|
@@ -7537,7 +7555,7 @@ function Qr(e, t, n) {
|
|
|
7537
7555
|
case -5: {
|
|
7538
7556
|
let e = n ? l : t[3] ?? 0;
|
|
7539
7557
|
Math.sqrt((1 - e) / 2);
|
|
7540
|
-
let i = Math.sqrt((1 - e) / 6), a = Math.sqrt((1 + 2 * e) / 3), o = a - 2 *
|
|
7558
|
+
let i = Math.sqrt((1 - e) / 6), a = Math.sqrt((1 + 2 * e) / 3), o = a - 2 * $r * i, s = a + $r * i, c = r / Qr;
|
|
7541
7559
|
u[0] = c * o, u[1] = c * s, u[2] = c * s, u[3] = c * s, u[4] = c * o, u[5] = c * s, u[6] = c * s, u[7] = c * s, u[8] = c * o;
|
|
7542
7560
|
break;
|
|
7543
7561
|
}
|
|
@@ -7608,15 +7626,15 @@ function Qr(e, t, n) {
|
|
|
7608
7626
|
}
|
|
7609
7627
|
//#endregion
|
|
7610
7628
|
//#region lib/core/io/pw/namelist.ts
|
|
7611
|
-
function
|
|
7629
|
+
function ti(e) {
|
|
7612
7630
|
let t = e.replace(/[dD]/g, "e");
|
|
7613
7631
|
return String(Number.parseFloat(t));
|
|
7614
7632
|
}
|
|
7615
|
-
function
|
|
7633
|
+
function ni(e) {
|
|
7616
7634
|
let t = e.trim();
|
|
7617
|
-
return t.startsWith("'") && t.endsWith("'") || t.startsWith("\"") && t.endsWith("\"") ? t.slice(1, -1) : /^\.(?:true|false)\.$/i.test(t) ? t.toLowerCase() === ".true." ? "true" : "false" : /[dD]/.test(t) ?
|
|
7635
|
+
return t.startsWith("'") && t.endsWith("'") || t.startsWith("\"") && t.endsWith("\"") ? t.slice(1, -1) : /^\.(?:true|false)\.$/i.test(t) ? t.toLowerCase() === ".true." ? "true" : "false" : /[dD]/.test(t) ? ti(t) : t;
|
|
7618
7636
|
}
|
|
7619
|
-
function
|
|
7637
|
+
function ri(e, t) {
|
|
7620
7638
|
let n = e[t].trim().match(/^&(\w+)/i);
|
|
7621
7639
|
if (!n) return null;
|
|
7622
7640
|
let r = n[1].toUpperCase(), i = /* @__PURE__ */ new Map();
|
|
@@ -7636,7 +7654,7 @@ function ti(e, t) {
|
|
|
7636
7654
|
let n = e.slice(0, t).trim().toLowerCase(), r = e.slice(t + 1);
|
|
7637
7655
|
if (!n) continue;
|
|
7638
7656
|
let a = n.match(/^(\w+)\((\d+)\)$/), o = a ? `${a[1]}(${a[2]})` : n;
|
|
7639
|
-
i.set(o,
|
|
7657
|
+
i.set(o, ni(r));
|
|
7640
7658
|
}
|
|
7641
7659
|
}
|
|
7642
7660
|
return {
|
|
@@ -7647,38 +7665,38 @@ function ti(e, t) {
|
|
|
7647
7665
|
end: e.length
|
|
7648
7666
|
};
|
|
7649
7667
|
}
|
|
7650
|
-
function
|
|
7668
|
+
function ii(e) {
|
|
7651
7669
|
let t = e.split("\n"), n = [];
|
|
7652
7670
|
for (let e = 0; e < t.length; e++) if (/^\s*&\w+/.test(t[e])) {
|
|
7653
|
-
let r =
|
|
7671
|
+
let r = ri(t, e);
|
|
7654
7672
|
r && (n.push(r.namelist), e = r.end);
|
|
7655
7673
|
}
|
|
7656
7674
|
return n;
|
|
7657
7675
|
}
|
|
7658
|
-
function
|
|
7676
|
+
function ai(e, t) {
|
|
7659
7677
|
let n = t.toUpperCase();
|
|
7660
7678
|
return e.find((e) => e.name === n);
|
|
7661
7679
|
}
|
|
7662
|
-
function
|
|
7663
|
-
return
|
|
7680
|
+
function oi(e, t, n) {
|
|
7681
|
+
return ai(e, t)?.values.get(n.toLowerCase());
|
|
7664
7682
|
}
|
|
7665
|
-
function
|
|
7666
|
-
let r =
|
|
7683
|
+
function si(e, t, n) {
|
|
7684
|
+
let r = oi(e, t, n);
|
|
7667
7685
|
if (r === void 0) return;
|
|
7668
7686
|
let i = Number.parseFloat(r);
|
|
7669
7687
|
return Number.isNaN(i) ? void 0 : i;
|
|
7670
7688
|
}
|
|
7671
|
-
function
|
|
7689
|
+
function ci(e, t, n, r) {
|
|
7672
7690
|
let i = n.toLowerCase(), a = [];
|
|
7673
7691
|
for (let n = 1; n <= r; n++) {
|
|
7674
|
-
let r =
|
|
7692
|
+
let r = oi(e, t, `${i}(${n})`);
|
|
7675
7693
|
r === void 0 ? a.push(0) : a.push(Number.parseFloat(r));
|
|
7676
7694
|
}
|
|
7677
7695
|
return a;
|
|
7678
7696
|
}
|
|
7679
7697
|
//#endregion
|
|
7680
7698
|
//#region lib/core/io/pw/index.ts
|
|
7681
|
-
var N = .529177,
|
|
7699
|
+
var N = .529177, li = {
|
|
7682
7700
|
control: {
|
|
7683
7701
|
title: "Generated by matsci-parse",
|
|
7684
7702
|
calculation: "scf",
|
|
@@ -7689,10 +7707,10 @@ var N = .529177, si = {
|
|
|
7689
7707
|
kpoints: { kspacing: .22 },
|
|
7690
7708
|
pseudo: { pseudos: {} }
|
|
7691
7709
|
};
|
|
7692
|
-
function
|
|
7693
|
-
let t =
|
|
7710
|
+
function ui(e) {
|
|
7711
|
+
let t = ii(e), n = e.split("\n"), r = si(t, "SYSTEM", "ibrav") ?? 0, i = si(t, "SYSTEM", "nat"), a = ci(t, "SYSTEM", "celldm", 6), o;
|
|
7694
7712
|
if (r !== 0) {
|
|
7695
|
-
let e =
|
|
7713
|
+
let e = ei(r, a).basis.data;
|
|
7696
7714
|
o = d([
|
|
7697
7715
|
e[0] * N,
|
|
7698
7716
|
e[1] * N,
|
|
@@ -7705,7 +7723,7 @@ function ci(e) {
|
|
|
7705
7723
|
e[8] * N
|
|
7706
7724
|
]);
|
|
7707
7725
|
} else {
|
|
7708
|
-
let { lattice: e, units: t } =
|
|
7726
|
+
let { lattice: e, units: t } = di(n);
|
|
7709
7727
|
if (t === "alat") {
|
|
7710
7728
|
if (a[0] === 0) throw Error("CELL_PARAMETERS alat requires celldm(1) in &SYSTEM");
|
|
7711
7729
|
let t = a[0] / N, n = e.basis.data;
|
|
@@ -7735,7 +7753,7 @@ function ci(e) {
|
|
|
7735
7753
|
]);
|
|
7736
7754
|
} else o = e;
|
|
7737
7755
|
}
|
|
7738
|
-
let { lines: s, units: c, selectiveDynamics: l } =
|
|
7756
|
+
let { lines: s, units: c, selectiveDynamics: l } = fi(n);
|
|
7739
7757
|
if (s.length === 0) throw Error("ATOMIC_POSITIONS block not found");
|
|
7740
7758
|
if (i !== void 0 && s.length !== i) throw Error(`Expected ${i} atoms (from &SYSTEM nat), got ${s.length}`);
|
|
7741
7759
|
let u = [];
|
|
@@ -7800,7 +7818,7 @@ function ci(e) {
|
|
|
7800
7818
|
...l ? { selectiveDynamics: !0 } : {}
|
|
7801
7819
|
};
|
|
7802
7820
|
}
|
|
7803
|
-
function
|
|
7821
|
+
function di(e) {
|
|
7804
7822
|
for (let t = 0; t < e.length; t++) {
|
|
7805
7823
|
let n = e[t].trim();
|
|
7806
7824
|
if (/^CELL_PARAMETERS/i.test(n)) {
|
|
@@ -7821,7 +7839,7 @@ function li(e) {
|
|
|
7821
7839
|
}
|
|
7822
7840
|
throw Error("CELL_PARAMETERS block not found");
|
|
7823
7841
|
}
|
|
7824
|
-
function
|
|
7842
|
+
function fi(e) {
|
|
7825
7843
|
for (let t = 0; t < e.length; t++) {
|
|
7826
7844
|
let n = e[t].trim();
|
|
7827
7845
|
if (/^ATOMIC_POSITIONS/i.test(n)) {
|
|
@@ -7846,29 +7864,29 @@ function ui(e) {
|
|
|
7846
7864
|
selectiveDynamics: !1
|
|
7847
7865
|
};
|
|
7848
7866
|
}
|
|
7849
|
-
var
|
|
7850
|
-
function
|
|
7867
|
+
var pi = { CONTROL: ["title"] };
|
|
7868
|
+
function mi(e, t) {
|
|
7851
7869
|
let n = {
|
|
7852
|
-
...
|
|
7870
|
+
...li.control,
|
|
7853
7871
|
...t?.control
|
|
7854
7872
|
}, { nat: r, ntyp: i, ibrav: a, ...o } = {
|
|
7855
|
-
...
|
|
7873
|
+
...li.system,
|
|
7856
7874
|
...t?.system
|
|
7857
7875
|
}, s = {
|
|
7858
|
-
...
|
|
7876
|
+
...li.electrons,
|
|
7859
7877
|
...t?.electrons
|
|
7860
|
-
}, c =
|
|
7861
|
-
return p.push(`title = '${n.title}'`), p.push(""),
|
|
7878
|
+
}, c = hi(e.sites), l = gi(c, t?.pseudo?.pseudos), u = _i(e), d = vi(e.lattice), f = yi(e, t?.kpoints), p = [];
|
|
7879
|
+
return p.push(`title = '${n.title}'`), p.push(""), wi(p, "CONTROL", {
|
|
7862
7880
|
...n,
|
|
7863
7881
|
title: void 0
|
|
7864
|
-
}), p.push(""),
|
|
7882
|
+
}), p.push(""), wi(p, "SYSTEM", {
|
|
7865
7883
|
...o,
|
|
7866
7884
|
nat: e.sites.length,
|
|
7867
7885
|
ntyp: c.length,
|
|
7868
7886
|
ibrav: 0
|
|
7869
|
-
}), p.push(""),
|
|
7887
|
+
}), p.push(""), wi(p, "ELECTRONS", s), p.push(""), p.push(...bi(l)), p.push(""), p.push(...xi(f)), p.push(""), p.push(...Si(d)), p.push(""), p.push(...Ci(u, e.selectiveDynamics)), p.join("\n");
|
|
7870
7888
|
}
|
|
7871
|
-
function
|
|
7889
|
+
function hi(e) {
|
|
7872
7890
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
7873
7891
|
for (let r of e) {
|
|
7874
7892
|
let e = r.species.symbol;
|
|
@@ -7876,20 +7894,20 @@ function pi(e) {
|
|
|
7876
7894
|
}
|
|
7877
7895
|
return n;
|
|
7878
7896
|
}
|
|
7879
|
-
function
|
|
7897
|
+
function gi(e, t) {
|
|
7880
7898
|
return e.map((e) => ({
|
|
7881
7899
|
symbol: e,
|
|
7882
7900
|
mass: zn(e)?.mass ?? 0,
|
|
7883
7901
|
pseudo: t?.[e] ?? `${e}.UPF`
|
|
7884
7902
|
}));
|
|
7885
7903
|
}
|
|
7886
|
-
function
|
|
7904
|
+
function _i(e) {
|
|
7887
7905
|
let t = /* @__PURE__ */ new Map();
|
|
7888
7906
|
for (let n of e.sites) {
|
|
7889
7907
|
let e = n.species.symbol, r = t.get(e);
|
|
7890
7908
|
r ? r.push(n) : t.set(e, [n]);
|
|
7891
7909
|
}
|
|
7892
|
-
let n =
|
|
7910
|
+
let n = hi(e.sites), r = [];
|
|
7893
7911
|
for (let e of n) {
|
|
7894
7912
|
let n = t.get(e) ?? [];
|
|
7895
7913
|
for (let t of n) {
|
|
@@ -7908,7 +7926,7 @@ function hi(e) {
|
|
|
7908
7926
|
}
|
|
7909
7927
|
return r;
|
|
7910
7928
|
}
|
|
7911
|
-
function
|
|
7929
|
+
function vi(e) {
|
|
7912
7930
|
let t = e.basis.data;
|
|
7913
7931
|
return [
|
|
7914
7932
|
[
|
|
@@ -7928,7 +7946,7 @@ function gi(e) {
|
|
|
7928
7946
|
]
|
|
7929
7947
|
];
|
|
7930
7948
|
}
|
|
7931
|
-
function
|
|
7949
|
+
function yi(e, t) {
|
|
7932
7950
|
return t ? "grid" in t ? {
|
|
7933
7951
|
mode: "automatic",
|
|
7934
7952
|
grid: t.grid,
|
|
@@ -7947,7 +7965,7 @@ function _i(e, t) {
|
|
|
7947
7965
|
]
|
|
7948
7966
|
} : {
|
|
7949
7967
|
mode: "automatic",
|
|
7950
|
-
grid: ke(e.lattice,
|
|
7968
|
+
grid: ke(e.lattice, li.kpoints.kspacing),
|
|
7951
7969
|
shift: [
|
|
7952
7970
|
0,
|
|
7953
7971
|
0,
|
|
@@ -7955,24 +7973,24 @@ function _i(e, t) {
|
|
|
7955
7973
|
]
|
|
7956
7974
|
};
|
|
7957
7975
|
}
|
|
7958
|
-
function
|
|
7976
|
+
function bi(e) {
|
|
7959
7977
|
let t = ["ATOMIC_SPECIES"];
|
|
7960
7978
|
for (let n of e) t.push(`${n.symbol} ${n.mass} ${n.pseudo}`);
|
|
7961
7979
|
return t;
|
|
7962
7980
|
}
|
|
7963
|
-
function
|
|
7981
|
+
function xi(e) {
|
|
7964
7982
|
switch (e.mode) {
|
|
7965
7983
|
case "gamma": return ["K_POINTS gamma"];
|
|
7966
7984
|
case "automatic": return ["K_POINTS automatic", `${e.grid[0]} ${e.grid[1]} ${e.grid[2]} ${e.shift[0]} ${e.shift[1]} ${e.shift[2]}`];
|
|
7967
7985
|
default: throw Error(`K_POINTS mode '${e.mode}' not yet supported in toPW`);
|
|
7968
7986
|
}
|
|
7969
7987
|
}
|
|
7970
|
-
function
|
|
7988
|
+
function Si(e, t = "angstrom") {
|
|
7971
7989
|
let n = [`CELL_PARAMETERS ${t}`];
|
|
7972
7990
|
for (let [t, r, i] of e) n.push(`${t} ${r} ${i}`);
|
|
7973
7991
|
return n;
|
|
7974
7992
|
}
|
|
7975
|
-
function
|
|
7993
|
+
function Ci(e, t, n = "crystal") {
|
|
7976
7994
|
let r = [`ATOMIC_POSITIONS ${n}`];
|
|
7977
7995
|
t && r.push("Selective dynamics");
|
|
7978
7996
|
for (let t of e) {
|
|
@@ -7981,8 +7999,8 @@ function xi(e, t, n = "crystal") {
|
|
|
7981
7999
|
}
|
|
7982
8000
|
return r;
|
|
7983
8001
|
}
|
|
7984
|
-
function
|
|
7985
|
-
let r = new Set(
|
|
8002
|
+
function wi(e, t, n) {
|
|
8003
|
+
let r = new Set(pi[t] ?? []), i = Object.entries(n).filter(([e, t]) => !r.has(e) && t !== void 0);
|
|
7986
8004
|
if (i.length === 0) {
|
|
7987
8005
|
e.push(`&${t}`), e.push("/");
|
|
7988
8006
|
return;
|
|
@@ -7996,16 +8014,16 @@ function Si(e, t, n) {
|
|
|
7996
8014
|
}
|
|
7997
8015
|
//#endregion
|
|
7998
8016
|
//#region lib/core/io/kpoints/qe.ts
|
|
7999
|
-
var
|
|
8000
|
-
function
|
|
8017
|
+
var Ti = /^K_POINTS(?:\s+\{?\(?(\w+)\)?\}?)?/i, Ei = /^(?:ATOMIC_SPECIES|ATOMIC_POSITIONS|CELL_PARAMETERS|K_POINTS|ADDITIONAL_K_POINTS|OCCUPATIONS|CONSTRAINTS|ATOMIC_VELOCITIES|ATOMIC_FORCES|HUBBARD|SOLVENTS)\b/i;
|
|
8018
|
+
function Di(e) {
|
|
8001
8019
|
let t = e.length, n = e.indexOf("!"), r = e.indexOf("#");
|
|
8002
8020
|
return n !== -1 && (t = Math.min(t, n)), r !== -1 && (t = Math.min(t, r)), e.slice(0, t);
|
|
8003
8021
|
}
|
|
8004
|
-
function
|
|
8005
|
-
return
|
|
8022
|
+
function Oi(e) {
|
|
8023
|
+
return Di(e).split(/\s+/).filter((e) => e !== "").map(Number);
|
|
8006
8024
|
}
|
|
8007
|
-
function
|
|
8008
|
-
let t =
|
|
8025
|
+
function ki(e) {
|
|
8026
|
+
let t = Oi(e);
|
|
8009
8027
|
if (t.length < 4) throw Error(`Invalid K_POINTS line: ${e}`);
|
|
8010
8028
|
return {
|
|
8011
8029
|
x: t[0],
|
|
@@ -8014,16 +8032,16 @@ function Di(e) {
|
|
|
8014
8032
|
w: t[3]
|
|
8015
8033
|
};
|
|
8016
8034
|
}
|
|
8017
|
-
function
|
|
8035
|
+
function Ai(e) {
|
|
8018
8036
|
let t = Number.parseInt(e[0] ?? "", 10);
|
|
8019
8037
|
if (Number.isNaN(t)) throw Error("K_POINTS list requires a point count");
|
|
8020
8038
|
let n = e.slice(1, 1 + t);
|
|
8021
8039
|
if (n.length !== t) throw Error(`Expected ${t} k-points, got ${n.length}`);
|
|
8022
|
-
return n.map(
|
|
8040
|
+
return n.map(ki);
|
|
8023
8041
|
}
|
|
8024
|
-
function
|
|
8042
|
+
function ji(e) {
|
|
8025
8043
|
let t = e.split("\n"), n = -1;
|
|
8026
|
-
for (let e = 0; e < t.length; e++) if (
|
|
8044
|
+
for (let e = 0; e < t.length; e++) if (Ti.test(t[e].trim())) {
|
|
8027
8045
|
n = e;
|
|
8028
8046
|
break;
|
|
8029
8047
|
}
|
|
@@ -8031,16 +8049,16 @@ function ki(e) {
|
|
|
8031
8049
|
let r = [t[n].trim()];
|
|
8032
8050
|
for (let e = n + 1; e < t.length; e++) {
|
|
8033
8051
|
let n = t[e].trim();
|
|
8034
|
-
if (n === "" ||
|
|
8052
|
+
if (n === "" || Ei.test(n)) break;
|
|
8035
8053
|
r.push(n);
|
|
8036
8054
|
}
|
|
8037
8055
|
return r;
|
|
8038
8056
|
}
|
|
8039
|
-
function
|
|
8040
|
-
let t =
|
|
8057
|
+
function Mi(e) {
|
|
8058
|
+
let t = ji(e), n = t[0].match(Ti)?.[1]?.toLowerCase() ?? "automatic", r = t.slice(1);
|
|
8041
8059
|
switch (n) {
|
|
8042
8060
|
case "automatic": {
|
|
8043
|
-
let e =
|
|
8061
|
+
let e = Oi(r[0] ?? "");
|
|
8044
8062
|
if (e.length < 6) throw Error("K_POINTS automatic requires 6 numbers");
|
|
8045
8063
|
return {
|
|
8046
8064
|
mode: n,
|
|
@@ -8060,7 +8078,7 @@ function Ai(e) {
|
|
|
8060
8078
|
case "crystal":
|
|
8061
8079
|
case "tpiba": return {
|
|
8062
8080
|
mode: n,
|
|
8063
|
-
points:
|
|
8081
|
+
points: Ai(r)
|
|
8064
8082
|
};
|
|
8065
8083
|
case "crystal_b":
|
|
8066
8084
|
case "tpiba_b": {
|
|
@@ -8071,45 +8089,45 @@ function Ai(e) {
|
|
|
8071
8089
|
return {
|
|
8072
8090
|
mode: n,
|
|
8073
8091
|
nks: e,
|
|
8074
|
-
points: t.map(
|
|
8092
|
+
points: t.map(ki)
|
|
8075
8093
|
};
|
|
8076
8094
|
}
|
|
8077
8095
|
case "crystal_c":
|
|
8078
8096
|
case "tpiba_c": return {
|
|
8079
8097
|
mode: n,
|
|
8080
|
-
points:
|
|
8098
|
+
points: Ai(r)
|
|
8081
8099
|
};
|
|
8082
8100
|
default: throw Error(`Unsupported K_POINTS mode '${n}'`);
|
|
8083
8101
|
}
|
|
8084
8102
|
}
|
|
8085
|
-
function
|
|
8103
|
+
function Ni(e) {
|
|
8086
8104
|
return `${e.x} ${e.y} ${e.z} ${e.w}`;
|
|
8087
8105
|
}
|
|
8088
|
-
function
|
|
8106
|
+
function Pi(e) {
|
|
8089
8107
|
return [
|
|
8090
8108
|
`K_POINTS ${e.mode}`,
|
|
8091
8109
|
String(e.points.length),
|
|
8092
|
-
...e.points.map(
|
|
8110
|
+
...e.points.map(Ni)
|
|
8093
8111
|
].join("\n");
|
|
8094
8112
|
}
|
|
8095
|
-
function
|
|
8113
|
+
function Fi(e) {
|
|
8096
8114
|
switch (e.mode) {
|
|
8097
8115
|
case "gamma": return "K_POINTS gamma";
|
|
8098
8116
|
case "automatic": return `K_POINTS automatic\n${e.grid.join(" ")} ${e.shift.join(" ")}`;
|
|
8099
8117
|
case "crystal":
|
|
8100
|
-
case "tpiba": return
|
|
8118
|
+
case "tpiba": return Pi(e);
|
|
8101
8119
|
case "crystal_b":
|
|
8102
8120
|
case "tpiba_b": return [
|
|
8103
8121
|
`K_POINTS ${e.mode}`,
|
|
8104
8122
|
String(e.nks),
|
|
8105
|
-
...e.points.map(
|
|
8123
|
+
...e.points.map(Ni)
|
|
8106
8124
|
].join("\n");
|
|
8107
8125
|
case "crystal_c":
|
|
8108
|
-
case "tpiba_c": return
|
|
8126
|
+
case "tpiba_c": return Pi(e);
|
|
8109
8127
|
}
|
|
8110
8128
|
}
|
|
8111
|
-
var
|
|
8112
|
-
function
|
|
8129
|
+
var Ii = 40;
|
|
8130
|
+
function Li(e, t) {
|
|
8113
8131
|
let n = e === "crystal" || e === "crystal_c" ? "reciprocal" : "cartesian";
|
|
8114
8132
|
return {
|
|
8115
8133
|
kind: "points",
|
|
@@ -8122,7 +8140,7 @@ function Fi(e, t) {
|
|
|
8122
8140
|
coordinateSystem: n
|
|
8123
8141
|
};
|
|
8124
8142
|
}
|
|
8125
|
-
function
|
|
8143
|
+
function Ri(e) {
|
|
8126
8144
|
if (e.length < 2) throw Error("K_POINTS band path requires at least two points");
|
|
8127
8145
|
let t = /* @__PURE__ */ new Map(), n = {}, r = (e) => {
|
|
8128
8146
|
let r = [
|
|
@@ -8145,8 +8163,8 @@ function Ii(e) {
|
|
|
8145
8163
|
density: a.length > 0 && a.every((e) => e === a[0]) ? a[0] : void 0
|
|
8146
8164
|
};
|
|
8147
8165
|
}
|
|
8148
|
-
function
|
|
8149
|
-
let t =
|
|
8166
|
+
function zi(e) {
|
|
8167
|
+
let t = Mi(e);
|
|
8150
8168
|
switch (t.mode) {
|
|
8151
8169
|
case "automatic": return {
|
|
8152
8170
|
kind: "grid",
|
|
@@ -8171,12 +8189,12 @@ function Li(e) {
|
|
|
8171
8189
|
case "crystal":
|
|
8172
8190
|
case "tpiba":
|
|
8173
8191
|
case "crystal_c":
|
|
8174
|
-
case "tpiba_c": return
|
|
8175
|
-
case "crystal_b": return
|
|
8192
|
+
case "tpiba_c": return Li(t.mode, t.points);
|
|
8193
|
+
case "crystal_b": return Ri(t.points);
|
|
8176
8194
|
case "tpiba_b": throw Error("tpiba_b band paths are expressed in 2*pi/alat units; converting them requires a lattice");
|
|
8177
8195
|
}
|
|
8178
8196
|
}
|
|
8179
|
-
function
|
|
8197
|
+
function Bi(e) {
|
|
8180
8198
|
return {
|
|
8181
8199
|
mode: e.coordinateSystem === "cartesian" ? "tpiba" : "crystal",
|
|
8182
8200
|
points: e.points.map((t, n) => ({
|
|
@@ -8187,18 +8205,18 @@ function Ri(e) {
|
|
|
8187
8205
|
}))
|
|
8188
8206
|
};
|
|
8189
8207
|
}
|
|
8190
|
-
function
|
|
8208
|
+
function Vi(e, t) {
|
|
8191
8209
|
switch (e.kind) {
|
|
8192
|
-
case "grid": return
|
|
8210
|
+
case "grid": return Fi({
|
|
8193
8211
|
mode: "automatic",
|
|
8194
8212
|
grid: [...e.mesh],
|
|
8195
8213
|
shift: [...e.origin]
|
|
8196
8214
|
});
|
|
8197
|
-
case "path": return
|
|
8198
|
-
case "points": return
|
|
8215
|
+
case "path": return Hi(e, t === void 0 ? e.density === void 0 ? Ii : Math.max(1, Math.round(e.density)) : Math.max(1, Math.round(t)));
|
|
8216
|
+
case "points": return Fi(Bi(e));
|
|
8199
8217
|
}
|
|
8200
8218
|
}
|
|
8201
|
-
function
|
|
8219
|
+
function Hi(e, t) {
|
|
8202
8220
|
let n = [], r = /* @__PURE__ */ new Set();
|
|
8203
8221
|
for (let i = 0; i < e.segments.length; i++) {
|
|
8204
8222
|
let [a, o] = e.segments[i], s = e.points[a];
|
|
@@ -8230,38 +8248,38 @@ function Bi(e, t) {
|
|
|
8230
8248
|
}
|
|
8231
8249
|
//#endregion
|
|
8232
8250
|
//#region lib/core/io/kpoints/vasp.ts
|
|
8233
|
-
var
|
|
8234
|
-
function
|
|
8251
|
+
var Ui = "Automatic mesh", Wi = "K-points list";
|
|
8252
|
+
function Gi(e) {
|
|
8235
8253
|
let t = new fr(e), n = t.next();
|
|
8236
8254
|
for (; n !== null && n.trim() === "";) n = t.next();
|
|
8237
8255
|
if (n === null) throw Error("KPOINTS file is too short");
|
|
8238
8256
|
let r = t.nextTrimmed(), i = Number(r);
|
|
8239
|
-
if (r === "0") return
|
|
8257
|
+
if (r === "0") return Ki(t);
|
|
8240
8258
|
if (Number.isInteger(i)) {
|
|
8241
8259
|
let e = t.nextTrimmed();
|
|
8242
|
-
return e.toLowerCase().startsWith("l") || i < 0 ?
|
|
8260
|
+
return e.toLowerCase().startsWith("l") || i < 0 ? Ji(t, e, i < 0, Math.abs(i)) : qi(t, e, i);
|
|
8243
8261
|
}
|
|
8244
8262
|
throw Error(`Unsupported KPOINTS mode '${r}'`);
|
|
8245
8263
|
}
|
|
8246
|
-
function
|
|
8264
|
+
function Ki(e) {
|
|
8247
8265
|
let t = e.nextTrimmed().toLowerCase();
|
|
8248
8266
|
if (t.startsWith("a")) throw Error("KPOINTS fully-automatic mode is not yet supported");
|
|
8249
|
-
let n = t.startsWith("m"), r =
|
|
8267
|
+
let n = t.startsWith("m"), r = ea(e.nextTrimmed(), "mesh"), i = e.next(), a = i === null || i.trim() === "" ? [
|
|
8250
8268
|
0,
|
|
8251
8269
|
0,
|
|
8252
8270
|
0
|
|
8253
|
-
] :
|
|
8271
|
+
] : ea(i.trim(), "shift");
|
|
8254
8272
|
return {
|
|
8255
8273
|
kind: "grid",
|
|
8256
8274
|
mesh: r,
|
|
8257
|
-
origin: n ?
|
|
8275
|
+
origin: n ? ta(r, a) : a,
|
|
8258
8276
|
scheme: n ? "monkhorst-pack" : "gamma-centered"
|
|
8259
8277
|
};
|
|
8260
8278
|
}
|
|
8261
|
-
function
|
|
8262
|
-
let r =
|
|
8279
|
+
function qi(e, t, n) {
|
|
8280
|
+
let r = Qi(t), i = [], a = [];
|
|
8263
8281
|
for (let t = 0; t < n; t++) {
|
|
8264
|
-
let { coordinate: t, weight: n } =
|
|
8282
|
+
let { coordinate: t, weight: n } = $i(e.nextTrimmed());
|
|
8265
8283
|
i.push({ coordinate: t }), a.push(n);
|
|
8266
8284
|
}
|
|
8267
8285
|
return {
|
|
@@ -8271,8 +8289,8 @@ function Gi(e, t, n) {
|
|
|
8271
8289
|
coordinateSystem: r
|
|
8272
8290
|
};
|
|
8273
8291
|
}
|
|
8274
|
-
function
|
|
8275
|
-
if (
|
|
8292
|
+
function Ji(e, t, n, r) {
|
|
8293
|
+
if (Qi(n ? t : e.nextTrimmed()) === "cartesian") throw Error("KPOINTS Cartesian line-mode is not yet supported");
|
|
8276
8294
|
let i = [], a = [], o;
|
|
8277
8295
|
for (; (o = e.next()) !== null;) {
|
|
8278
8296
|
let e = o.trim();
|
|
@@ -8283,7 +8301,7 @@ function Ki(e, t, n, r) {
|
|
|
8283
8301
|
for (let e of i) {
|
|
8284
8302
|
if (e.length % 2 != 0) throw Error("KPOINTS line-mode segments must come in pairs of lines");
|
|
8285
8303
|
for (let t = 0; t < e.length; t += 2) {
|
|
8286
|
-
let n =
|
|
8304
|
+
let n = Xi(s, Yi(e[t]), ++l), r = Xi(s, Yi(e[t + 1]), ++l);
|
|
8287
8305
|
c.push([n, r]);
|
|
8288
8306
|
}
|
|
8289
8307
|
}
|
|
@@ -8294,7 +8312,7 @@ function Ki(e, t, n, r) {
|
|
|
8294
8312
|
density: Number.isFinite(r) && r > 0 ? Math.round(r) : void 0
|
|
8295
8313
|
};
|
|
8296
8314
|
}
|
|
8297
|
-
function
|
|
8315
|
+
function Yi(e) {
|
|
8298
8316
|
let t = e.indexOf("!"), n = t === -1 ? e : e.slice(0, t), r = t === -1 ? "" : e.slice(t + 1).trim(), i = n.trim().split(/\s+/);
|
|
8299
8317
|
if (i.length < 3 || i.length > 4) throw Error(`Invalid KPOINTS point: '${e}'`);
|
|
8300
8318
|
let a = i.slice(0, 3).map(Number);
|
|
@@ -8308,21 +8326,21 @@ function qi(e) {
|
|
|
8308
8326
|
label: r || i[3]
|
|
8309
8327
|
};
|
|
8310
8328
|
}
|
|
8311
|
-
function
|
|
8329
|
+
function Xi(e, t, n) {
|
|
8312
8330
|
let r = t.label ?? `k${n}`, i = e[r];
|
|
8313
|
-
if (i !== void 0 && !
|
|
8331
|
+
if (i !== void 0 && !Zi(i, t.coordinate)) throw Error(`KPOINTS label '${r}' is used for two different k-points`);
|
|
8314
8332
|
return e[r] = t.coordinate, r;
|
|
8315
8333
|
}
|
|
8316
|
-
function
|
|
8334
|
+
function Zi(e, t) {
|
|
8317
8335
|
return e.every((e, n) => Math.abs(e - t[n]) < 1e-9);
|
|
8318
8336
|
}
|
|
8319
|
-
function
|
|
8337
|
+
function Qi(e) {
|
|
8320
8338
|
let t = e.toLowerCase();
|
|
8321
8339
|
if (t === "reciprocal" || t === "frac" || t === "r") return "reciprocal";
|
|
8322
8340
|
if (t === "cartesian" || t === "cart" || t === "c") return "cartesian";
|
|
8323
8341
|
throw Error(`Unknown KPOINTS coordinate system '${e}'`);
|
|
8324
8342
|
}
|
|
8325
|
-
function
|
|
8343
|
+
function $i(e) {
|
|
8326
8344
|
let t = e.split(/\s+/);
|
|
8327
8345
|
if (t.length < 3) throw Error(`Invalid KPOINTS point: '${e}'`);
|
|
8328
8346
|
let n = t.map(Number);
|
|
@@ -8336,7 +8354,7 @@ function Zi(e) {
|
|
|
8336
8354
|
weight: t.length >= 4 ? n[3] : 1
|
|
8337
8355
|
};
|
|
8338
8356
|
}
|
|
8339
|
-
function
|
|
8357
|
+
function ea(e, t) {
|
|
8340
8358
|
let n = e.split(/\s+/).map(Number);
|
|
8341
8359
|
if (n.length !== 3 || n.some((e) => Number.isNaN(e))) throw Error(`Invalid KPOINTS ${t}: '${e}'`);
|
|
8342
8360
|
return [
|
|
@@ -8345,7 +8363,7 @@ function Qi(e, t) {
|
|
|
8345
8363
|
n[2]
|
|
8346
8364
|
];
|
|
8347
8365
|
}
|
|
8348
|
-
function
|
|
8366
|
+
function ta(e, t) {
|
|
8349
8367
|
let n = (e, t) => (1 - e) / (2 * e) + t;
|
|
8350
8368
|
return [
|
|
8351
8369
|
n(e[0], t[0]),
|
|
@@ -8353,41 +8371,41 @@ function $i(e, t) {
|
|
|
8353
8371
|
n(e[2], t[2])
|
|
8354
8372
|
];
|
|
8355
8373
|
}
|
|
8356
|
-
function
|
|
8374
|
+
function na(e, t) {
|
|
8357
8375
|
switch (e.kind) {
|
|
8358
|
-
case "grid": return
|
|
8359
|
-
case "path": return
|
|
8360
|
-
case "points": return
|
|
8376
|
+
case "grid": return ra(e);
|
|
8377
|
+
case "path": return oa(e, t);
|
|
8378
|
+
case "points": return ia(e);
|
|
8361
8379
|
}
|
|
8362
8380
|
}
|
|
8363
|
-
function
|
|
8381
|
+
function ra({ mesh: e, origin: t, scheme: n }) {
|
|
8364
8382
|
let r = n === "monkhorst-pack" ? [
|
|
8365
8383
|
0,
|
|
8366
8384
|
0,
|
|
8367
8385
|
0
|
|
8368
8386
|
] : t;
|
|
8369
8387
|
return [
|
|
8370
|
-
|
|
8388
|
+
Ui,
|
|
8371
8389
|
"0",
|
|
8372
8390
|
n === "monkhorst-pack" ? "Monkhorst-Pack" : "Gamma",
|
|
8373
8391
|
e.join(" "),
|
|
8374
8392
|
r.join(" ")
|
|
8375
8393
|
].join("\n");
|
|
8376
8394
|
}
|
|
8377
|
-
function
|
|
8378
|
-
let t =
|
|
8379
|
-
if (t) return
|
|
8395
|
+
function ia(e) {
|
|
8396
|
+
let t = sa(e);
|
|
8397
|
+
if (t) return ra(t);
|
|
8380
8398
|
let n = e.coordinateSystem === "cartesian" ? "Cartesian" : "Reciprocal", r = e.points.map((t, n) => `${t.coordinate.join(" ")} ${e.weights?.[n] ?? 1}`);
|
|
8381
8399
|
return [
|
|
8382
|
-
|
|
8400
|
+
Wi,
|
|
8383
8401
|
String(e.points.length),
|
|
8384
8402
|
n,
|
|
8385
8403
|
...r
|
|
8386
8404
|
].join("\n");
|
|
8387
8405
|
}
|
|
8388
|
-
var
|
|
8389
|
-
function
|
|
8390
|
-
let i = r === void 0 ? n === void 0 ?
|
|
8406
|
+
var aa = 40;
|
|
8407
|
+
function oa({ points: e, segments: t, density: n }, r) {
|
|
8408
|
+
let i = r === void 0 ? n === void 0 ? aa : Math.max(1, Math.round(n)) : Math.max(1, Math.round(r)), a = [];
|
|
8391
8409
|
for (let [n, r] of t) a.push(`${e[n].join(" ")} ${n}`), a.push(`${e[r].join(" ")} ${r}`), a.push("");
|
|
8392
8410
|
return a.pop(), [
|
|
8393
8411
|
"Band path",
|
|
@@ -8397,7 +8415,7 @@ function ia({ points: e, segments: t, density: n }, r) {
|
|
|
8397
8415
|
...a
|
|
8398
8416
|
].join("\n");
|
|
8399
8417
|
}
|
|
8400
|
-
function
|
|
8418
|
+
function sa(e) {
|
|
8401
8419
|
if (e.coordinateSystem === "cartesian") return null;
|
|
8402
8420
|
let t = e.weights;
|
|
8403
8421
|
if (t && !t.every((e) => Math.abs(e - t[0]) < 1e-12)) return null;
|
|
@@ -8428,21 +8446,21 @@ function aa(e) {
|
|
|
8428
8446
|
}
|
|
8429
8447
|
//#endregion
|
|
8430
8448
|
//#region lib/core/io/kpoints/crystal.ts
|
|
8431
|
-
var
|
|
8432
|
-
function
|
|
8449
|
+
var ca = /^BAND\s*$/i, la = 40;
|
|
8450
|
+
function ua(e) {
|
|
8433
8451
|
let t = e.length, n = e.indexOf("!"), r = e.indexOf("#");
|
|
8434
8452
|
return n !== -1 && (t = Math.min(t, n)), r !== -1 && (t = Math.min(t, r)), e.slice(0, t).trim();
|
|
8435
8453
|
}
|
|
8436
|
-
function
|
|
8454
|
+
function da(e) {
|
|
8437
8455
|
let t = e.indexOf("!"), n = t === -1 ? e : e.slice(0, t), r = t === -1 ? "" : e.slice(t + 1).trim();
|
|
8438
8456
|
if (r !== "") return r;
|
|
8439
8457
|
let i = n.trim().split(/\s+/).filter((e) => e !== "");
|
|
8440
|
-
for (let e = 6; e < i.length; e++) if (!
|
|
8458
|
+
for (let e = 6; e < i.length; e++) if (!fa.test(i[e])) return i.slice(e).join(" ");
|
|
8441
8459
|
return "";
|
|
8442
8460
|
}
|
|
8443
|
-
var
|
|
8444
|
-
function
|
|
8445
|
-
let t =
|
|
8461
|
+
var fa = /^[-+]?\d*\.?\d+(?:[eE][-+]?\d+)?$/;
|
|
8462
|
+
function pa(e) {
|
|
8463
|
+
let t = ua(e).split(/\s+/).filter(Boolean);
|
|
8446
8464
|
if (t.length < 6) throw Error(`Invalid D3 BAND segment line: '${e}'`);
|
|
8447
8465
|
let n = t.slice(0, 6).map(Number);
|
|
8448
8466
|
if (n.some(Number.isNaN)) throw Error(`Invalid D3 BAND segment line: '${e}'`);
|
|
@@ -8456,19 +8474,19 @@ function da(e) {
|
|
|
8456
8474
|
n[5]
|
|
8457
8475
|
]];
|
|
8458
8476
|
}
|
|
8459
|
-
function
|
|
8477
|
+
function ma(e, t, n) {
|
|
8460
8478
|
let r = n ? ` ${n}` : "";
|
|
8461
8479
|
return `${e.join(" ")} ${t.join(" ")}${r}`;
|
|
8462
8480
|
}
|
|
8463
|
-
function
|
|
8481
|
+
function ha(e) {
|
|
8464
8482
|
let t = e.split("\n"), n = 0, r = t.length - 1;
|
|
8465
8483
|
for (; n < t.length && t[n].trim() === "";) n++;
|
|
8466
8484
|
for (; r > n && t[r].trim() === "";) r--;
|
|
8467
8485
|
let i = t.slice(n, r + 1);
|
|
8468
8486
|
if (i.length < 3) throw Error("D3 BAND file is too short");
|
|
8469
|
-
if (!
|
|
8487
|
+
if (!ca.test(i[0].trim())) throw Error("D3 BAND file must start with 'BAND'");
|
|
8470
8488
|
i[1].trim();
|
|
8471
|
-
let a =
|
|
8489
|
+
let a = ua(i[2]).split(/\s+/).filter(Boolean).map(Number);
|
|
8472
8490
|
if (a.length < 1 || a.some(Number.isNaN)) throw Error("Invalid D3 BAND header line");
|
|
8473
8491
|
let o = a[0];
|
|
8474
8492
|
if (i.length < 3 + o) throw Error(`D3 BAND header declares ${o} segments but only ${i.length - 3} lines remain`);
|
|
@@ -8477,14 +8495,14 @@ function pa(e) {
|
|
|
8477
8495
|
if (r !== void 0) return r;
|
|
8478
8496
|
if (t !== void 0) {
|
|
8479
8497
|
let r = s[t];
|
|
8480
|
-
if (r !== void 0 && !
|
|
8498
|
+
if (r !== void 0 && !ga(r, e)) throw Error(`D3 BAND: label '${t}' used for two different coordinates`);
|
|
8481
8499
|
return c.set(n, t), s[t] = e, t;
|
|
8482
8500
|
}
|
|
8483
8501
|
let i = `k${++u}`;
|
|
8484
8502
|
return c.set(n, i), s[i] = e, i;
|
|
8485
8503
|
};
|
|
8486
8504
|
for (let e = 3; e < 3 + o; e++) {
|
|
8487
|
-
let t = i[e], [n, r] =
|
|
8505
|
+
let t = i[e], [n, r] = pa(t), a = da(t), o, s;
|
|
8488
8506
|
if (a.includes("->")) {
|
|
8489
8507
|
let e = a.split("->").map((e) => e.trim());
|
|
8490
8508
|
o = e[0] || void 0, s = e[1] || void 0;
|
|
@@ -8497,31 +8515,31 @@ function pa(e) {
|
|
|
8497
8515
|
segments: l
|
|
8498
8516
|
};
|
|
8499
8517
|
}
|
|
8500
|
-
function
|
|
8518
|
+
function ga(e, t) {
|
|
8501
8519
|
return e.every((e, n) => Math.abs(e - t[n]) < 1e-6);
|
|
8502
8520
|
}
|
|
8503
|
-
function
|
|
8521
|
+
function _a(e, t = "", n) {
|
|
8504
8522
|
if (e.kind !== "path") throw Error("toCrystalD3 only supports KPath data");
|
|
8505
8523
|
let r = [];
|
|
8506
8524
|
for (let [t, n] of e.segments) {
|
|
8507
8525
|
let i = e.points[t], a = e.points[n];
|
|
8508
8526
|
if (!i || !a) throw Error(`KPath references unknown point '${t}' or '${n}'`);
|
|
8509
|
-
r.push(
|
|
8527
|
+
r.push(ma(i, a, `${t} -> ${n}`));
|
|
8510
8528
|
}
|
|
8511
8529
|
let i = e.segments.length;
|
|
8512
8530
|
return [
|
|
8513
8531
|
"BAND",
|
|
8514
8532
|
t,
|
|
8515
|
-
`${i} 1 ${i * (n === void 0 ? e.density === void 0 ?
|
|
8533
|
+
`${i} 1 ${i * (n === void 0 ? e.density === void 0 ? la : Math.max(1, Math.round(e.density)) : Math.max(1, Math.round(n)))} 1 0 1 0`,
|
|
8516
8534
|
...r
|
|
8517
8535
|
].join("\n");
|
|
8518
8536
|
}
|
|
8519
8537
|
//#endregion
|
|
8520
8538
|
//#region node_modules/.pnpm/fast-xml-parser@5.10.1/node_modules/fast-xml-parser/src/util.js
|
|
8521
|
-
var
|
|
8522
|
-
"" +
|
|
8523
|
-
var
|
|
8524
|
-
function
|
|
8539
|
+
var va = ":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", ya = va + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
|
|
8540
|
+
"" + va + ya;
|
|
8541
|
+
var ba = /* @__PURE__ */ RegExp("^[: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][: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]*$");
|
|
8542
|
+
function xa(e, t) {
|
|
8525
8543
|
let n = [], r = t.exec(e);
|
|
8526
8544
|
for (; r;) {
|
|
8527
8545
|
let i = [];
|
|
@@ -8532,13 +8550,13 @@ function ya(e, t) {
|
|
|
8532
8550
|
}
|
|
8533
8551
|
return n;
|
|
8534
8552
|
}
|
|
8535
|
-
var
|
|
8536
|
-
return
|
|
8553
|
+
var Sa = function(e) {
|
|
8554
|
+
return ba.exec(e) != null;
|
|
8537
8555
|
};
|
|
8538
|
-
function
|
|
8556
|
+
function Ca(e) {
|
|
8539
8557
|
return e !== void 0;
|
|
8540
8558
|
}
|
|
8541
|
-
var
|
|
8559
|
+
var wa = [
|
|
8542
8560
|
"hasOwnProperty",
|
|
8543
8561
|
"toString",
|
|
8544
8562
|
"valueOf",
|
|
@@ -8546,24 +8564,24 @@ var Sa = [
|
|
|
8546
8564
|
"__defineSetter__",
|
|
8547
8565
|
"__lookupGetter__",
|
|
8548
8566
|
"__lookupSetter__"
|
|
8549
|
-
],
|
|
8567
|
+
], Ta = [
|
|
8550
8568
|
"__proto__",
|
|
8551
8569
|
"constructor",
|
|
8552
8570
|
"prototype"
|
|
8553
|
-
],
|
|
8571
|
+
], Ea = {
|
|
8554
8572
|
allowBooleanAttributes: !1,
|
|
8555
8573
|
unpairedTags: []
|
|
8556
8574
|
};
|
|
8557
|
-
function
|
|
8558
|
-
t = Object.assign({},
|
|
8575
|
+
function Da(e, t) {
|
|
8576
|
+
t = Object.assign({}, Ea, t);
|
|
8559
8577
|
let n = [], r = !1, i = !1;
|
|
8560
8578
|
e[0] === "" && (e = e.substr(1));
|
|
8561
8579
|
for (let a = 0; a < e.length; a++) if (e[a] === "<" && e[a + 1] === "?") {
|
|
8562
|
-
if (a += 2, a =
|
|
8580
|
+
if (a += 2, a = ka(e, a), a.err) return a;
|
|
8563
8581
|
} else if (e[a] === "<") {
|
|
8564
8582
|
let o = a;
|
|
8565
8583
|
if (a++, e[a] === "!") {
|
|
8566
|
-
a =
|
|
8584
|
+
a = Aa(e, a);
|
|
8567
8585
|
continue;
|
|
8568
8586
|
}
|
|
8569
8587
|
{
|
|
@@ -8571,35 +8589,35 @@ function Ta(e, t) {
|
|
|
8571
8589
|
e[a] === "/" && (s = !0, a++);
|
|
8572
8590
|
let c = "";
|
|
8573
8591
|
for (; a < e.length && e[a] !== ">" && e[a] !== " " && e[a] !== " " && e[a] !== "\n" && e[a] !== "\r"; a++) c += e[a];
|
|
8574
|
-
if (c = c.trim(), c[c.length - 1] === "/" && (c = c.substring(0, c.length - 1), a--), !
|
|
8592
|
+
if (c = c.trim(), c[c.length - 1] === "/" && (c = c.substring(0, c.length - 1), a--), !za(c)) {
|
|
8575
8593
|
let t;
|
|
8576
|
-
return t = c.trim().length === 0 ? "Invalid space after '<'." : "Tag '" + c + "' is an invalid name.", P("InvalidTag", t,
|
|
8594
|
+
return t = c.trim().length === 0 ? "Invalid space after '<'." : "Tag '" + c + "' is an invalid name.", P("InvalidTag", t, Ba(e, a));
|
|
8577
8595
|
}
|
|
8578
|
-
let l =
|
|
8579
|
-
if (l === !1) return P("InvalidAttr", "Attributes for '" + c + "' have open quote.",
|
|
8596
|
+
let l = Na(e, a);
|
|
8597
|
+
if (l === !1) return P("InvalidAttr", "Attributes for '" + c + "' have open quote.", Ba(e, a));
|
|
8580
8598
|
let u = l.value;
|
|
8581
8599
|
if (a = l.index, u[u.length - 1] === "/") {
|
|
8582
8600
|
let n = a - u.length;
|
|
8583
8601
|
u = u.substring(0, u.length - 1);
|
|
8584
|
-
let i =
|
|
8602
|
+
let i = Fa(u, t);
|
|
8585
8603
|
if (i === !0) r = !0;
|
|
8586
|
-
else return P(i.err.code, i.err.msg,
|
|
8604
|
+
else return P(i.err.code, i.err.msg, Ba(e, n + i.err.line));
|
|
8587
8605
|
} else if (s) {
|
|
8588
|
-
if (!l.tagClosed) return P("InvalidTag", "Closing tag '" + c + "' doesn't have proper closing.",
|
|
8589
|
-
if (u.trim().length > 0) return P("InvalidTag", "Closing tag '" + c + "' can't have attributes or invalid starting.",
|
|
8590
|
-
if (n.length === 0) return P("InvalidTag", "Closing tag '" + c + "' has not been opened.",
|
|
8606
|
+
if (!l.tagClosed) return P("InvalidTag", "Closing tag '" + c + "' doesn't have proper closing.", Ba(e, a));
|
|
8607
|
+
if (u.trim().length > 0) return P("InvalidTag", "Closing tag '" + c + "' can't have attributes or invalid starting.", Ba(e, o));
|
|
8608
|
+
if (n.length === 0) return P("InvalidTag", "Closing tag '" + c + "' has not been opened.", Ba(e, o));
|
|
8591
8609
|
{
|
|
8592
8610
|
let t = n.pop();
|
|
8593
8611
|
if (c !== t.tagName) {
|
|
8594
|
-
let n =
|
|
8595
|
-
return P("InvalidTag", "Expected closing tag '" + t.tagName + "' (opened in line " + n.line + ", col " + n.col + ") instead of closing tag '" + c + "'.",
|
|
8612
|
+
let n = Ba(e, t.tagStartPos);
|
|
8613
|
+
return P("InvalidTag", "Expected closing tag '" + t.tagName + "' (opened in line " + n.line + ", col " + n.col + ") instead of closing tag '" + c + "'.", Ba(e, o));
|
|
8596
8614
|
}
|
|
8597
8615
|
n.length == 0 && (i = !0);
|
|
8598
8616
|
}
|
|
8599
8617
|
} else {
|
|
8600
|
-
let s =
|
|
8601
|
-
if (s !== !0) return P(s.err.code, s.err.msg,
|
|
8602
|
-
if (i === !0) return P("InvalidXml", "Multiple possible root nodes found.",
|
|
8618
|
+
let s = Fa(u, t);
|
|
8619
|
+
if (s !== !0) return P(s.err.code, s.err.msg, Ba(e, a - u.length + s.err.line));
|
|
8620
|
+
if (i === !0) return P("InvalidXml", "Multiple possible root nodes found.", Ba(e, a));
|
|
8603
8621
|
t.unpairedTags.indexOf(c) !== -1 || n.push({
|
|
8604
8622
|
tagName: c,
|
|
8605
8623
|
tagStartPos: o
|
|
@@ -8607,36 +8625,36 @@ function Ta(e, t) {
|
|
|
8607
8625
|
}
|
|
8608
8626
|
for (a++; a < e.length; a++) if (e[a] === "<") {
|
|
8609
8627
|
if (e[a + 1] === "!") {
|
|
8610
|
-
a++, a =
|
|
8628
|
+
a++, a = Aa(e, a);
|
|
8611
8629
|
continue;
|
|
8612
8630
|
}
|
|
8613
8631
|
if (e[a + 1] === "?") {
|
|
8614
|
-
if (a =
|
|
8632
|
+
if (a = ka(e, ++a), a.err) return a;
|
|
8615
8633
|
} else break;
|
|
8616
8634
|
} else if (e[a] === "&") {
|
|
8617
|
-
let t =
|
|
8618
|
-
if (t == -1) return P("InvalidChar", "char '&' is not expected.",
|
|
8635
|
+
let t = La(e, a);
|
|
8636
|
+
if (t == -1) return P("InvalidChar", "char '&' is not expected.", Ba(e, a));
|
|
8619
8637
|
a = t;
|
|
8620
|
-
} else if (i === !0 && !
|
|
8638
|
+
} else if (i === !0 && !Oa(e[a])) return P("InvalidXml", "Extra text at the end", Ba(e, a));
|
|
8621
8639
|
e[a] === "<" && a--;
|
|
8622
8640
|
}
|
|
8623
8641
|
} else {
|
|
8624
|
-
if (
|
|
8625
|
-
return P("InvalidChar", "char '" + e[a] + "' is not expected.",
|
|
8642
|
+
if (Oa(e[a])) continue;
|
|
8643
|
+
return P("InvalidChar", "char '" + e[a] + "' is not expected.", Ba(e, a));
|
|
8626
8644
|
}
|
|
8627
|
-
return r ? n.length == 1 ? P("InvalidTag", "Unclosed tag '" + n[0].tagName + "'.",
|
|
8645
|
+
return r ? n.length == 1 ? P("InvalidTag", "Unclosed tag '" + n[0].tagName + "'.", Ba(e, n[0].tagStartPos)) : n.length > 0 ? P("InvalidXml", "Invalid '" + JSON.stringify(n.map((e) => e.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", {
|
|
8628
8646
|
line: 1,
|
|
8629
8647
|
col: 1
|
|
8630
8648
|
}) : !0 : P("InvalidXml", "Start tag expected.", 1);
|
|
8631
8649
|
}
|
|
8632
|
-
function
|
|
8650
|
+
function Oa(e) {
|
|
8633
8651
|
return e === " " || e === " " || e === "\n" || e === "\r";
|
|
8634
8652
|
}
|
|
8635
|
-
function
|
|
8653
|
+
function ka(e, t) {
|
|
8636
8654
|
let n = t;
|
|
8637
8655
|
for (; t < e.length; t++) if (e[t] == "?" || e[t] == " ") {
|
|
8638
8656
|
let r = e.substr(n, t - n);
|
|
8639
|
-
if (t > 5 && r === "xml") return P("InvalidXml", "XML declaration allowed only at the start of the document.",
|
|
8657
|
+
if (t > 5 && r === "xml") return P("InvalidXml", "XML declaration allowed only at the start of the document.", Ba(e, t));
|
|
8640
8658
|
if (e[t] == "?" && e[t + 1] == ">") {
|
|
8641
8659
|
t++;
|
|
8642
8660
|
break;
|
|
@@ -8645,7 +8663,7 @@ function Da(e, t) {
|
|
|
8645
8663
|
}
|
|
8646
8664
|
return t;
|
|
8647
8665
|
}
|
|
8648
|
-
function
|
|
8666
|
+
function Aa(e, t) {
|
|
8649
8667
|
if (e.length > t + 5 && e[t + 1] === "-" && e[t + 2] === "-") {
|
|
8650
8668
|
for (t += 3; t < e.length; t++) if (e[t] === "-" && e[t + 1] === "-" && e[t + 2] === ">") {
|
|
8651
8669
|
t += 2;
|
|
@@ -8663,11 +8681,11 @@ function Oa(e, t) {
|
|
|
8663
8681
|
}
|
|
8664
8682
|
return t;
|
|
8665
8683
|
}
|
|
8666
|
-
var
|
|
8667
|
-
function
|
|
8684
|
+
var ja = "\"", Ma = "'";
|
|
8685
|
+
function Na(e, t) {
|
|
8668
8686
|
let n = "", r = "", i = !1;
|
|
8669
8687
|
for (; t < e.length; t++) {
|
|
8670
|
-
if (e[t] ===
|
|
8688
|
+
if (e[t] === ja || e[t] === Ma) r === "" ? r = e[t] : r !== e[t] || (r = "");
|
|
8671
8689
|
else if (e[t] === ">" && r === "") {
|
|
8672
8690
|
i = !0;
|
|
8673
8691
|
break;
|
|
@@ -8680,21 +8698,21 @@ function ja(e, t) {
|
|
|
8680
8698
|
tagClosed: i
|
|
8681
8699
|
};
|
|
8682
8700
|
}
|
|
8683
|
-
var
|
|
8684
|
-
function
|
|
8685
|
-
let n =
|
|
8701
|
+
var Pa = /* @__PURE__ */ RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?", "g");
|
|
8702
|
+
function Fa(e, t) {
|
|
8703
|
+
let n = xa(e, Pa), r = {};
|
|
8686
8704
|
for (let e = 0; e < n.length; e++) {
|
|
8687
|
-
if (n[e][1].length === 0) return P("InvalidAttr", "Attribute '" + n[e][2] + "' has no space in starting.",
|
|
8688
|
-
if (n[e][3] !== void 0 && n[e][4] === void 0) return P("InvalidAttr", "Attribute '" + n[e][2] + "' is without value.",
|
|
8689
|
-
if (n[e][3] === void 0 && !t.allowBooleanAttributes) return P("InvalidAttr", "boolean attribute '" + n[e][2] + "' is not allowed.",
|
|
8705
|
+
if (n[e][1].length === 0) return P("InvalidAttr", "Attribute '" + n[e][2] + "' has no space in starting.", Va(n[e]));
|
|
8706
|
+
if (n[e][3] !== void 0 && n[e][4] === void 0) return P("InvalidAttr", "Attribute '" + n[e][2] + "' is without value.", Va(n[e]));
|
|
8707
|
+
if (n[e][3] === void 0 && !t.allowBooleanAttributes) return P("InvalidAttr", "boolean attribute '" + n[e][2] + "' is not allowed.", Va(n[e]));
|
|
8690
8708
|
let i = n[e][2];
|
|
8691
|
-
if (!
|
|
8709
|
+
if (!Ra(i)) return P("InvalidAttr", "Attribute '" + i + "' is an invalid name.", Va(n[e]));
|
|
8692
8710
|
if (!Object.prototype.hasOwnProperty.call(r, i)) r[i] = 1;
|
|
8693
|
-
else return P("InvalidAttr", "Attribute '" + i + "' is repeated.",
|
|
8711
|
+
else return P("InvalidAttr", "Attribute '" + i + "' is repeated.", Va(n[e]));
|
|
8694
8712
|
}
|
|
8695
8713
|
return !0;
|
|
8696
8714
|
}
|
|
8697
|
-
function
|
|
8715
|
+
function Ia(e, t) {
|
|
8698
8716
|
let n = /\d/;
|
|
8699
8717
|
for (e[t] === "x" && (t++, n = /[\da-fA-F]/); t < e.length; t++) {
|
|
8700
8718
|
if (e[t] === ";") return t;
|
|
@@ -8702,9 +8720,9 @@ function Pa(e, t) {
|
|
|
8702
8720
|
}
|
|
8703
8721
|
return -1;
|
|
8704
8722
|
}
|
|
8705
|
-
function
|
|
8723
|
+
function La(e, t) {
|
|
8706
8724
|
if (t++, e[t] === ";") return -1;
|
|
8707
|
-
if (e[t] === "#") return t++,
|
|
8725
|
+
if (e[t] === "#") return t++, Ia(e, t);
|
|
8708
8726
|
let n = 0;
|
|
8709
8727
|
for (; t < e.length; t++, n++) if (!(e[t].match(/\w/) && n < 20)) {
|
|
8710
8728
|
if (e[t] === ";") break;
|
|
@@ -8720,25 +8738,25 @@ function P(e, t, n) {
|
|
|
8720
8738
|
col: n.col
|
|
8721
8739
|
} };
|
|
8722
8740
|
}
|
|
8723
|
-
function
|
|
8724
|
-
return
|
|
8741
|
+
function Ra(e) {
|
|
8742
|
+
return Sa(e);
|
|
8725
8743
|
}
|
|
8726
|
-
function
|
|
8727
|
-
return
|
|
8744
|
+
function za(e) {
|
|
8745
|
+
return Sa(e);
|
|
8728
8746
|
}
|
|
8729
|
-
function
|
|
8747
|
+
function Ba(e, t) {
|
|
8730
8748
|
let n = e.substring(0, t).split(/\r?\n/);
|
|
8731
8749
|
return {
|
|
8732
8750
|
line: n.length,
|
|
8733
8751
|
col: n[n.length - 1].length + 1
|
|
8734
8752
|
};
|
|
8735
8753
|
}
|
|
8736
|
-
function
|
|
8754
|
+
function Va(e) {
|
|
8737
8755
|
return e.startIndex + e[1].length;
|
|
8738
8756
|
}
|
|
8739
8757
|
//#endregion
|
|
8740
8758
|
//#region node_modules/.pnpm/@nodable+entities@3.0.0/node_modules/@nodable/entities/src/entities.js
|
|
8741
|
-
var
|
|
8759
|
+
var Ha = {
|
|
8742
8760
|
cent: "¢",
|
|
8743
8761
|
pound: "£",
|
|
8744
8762
|
curren: "¤",
|
|
@@ -8754,13 +8772,13 @@ var Ba = {
|
|
|
8754
8772
|
won: "₩",
|
|
8755
8773
|
yuan: "¥",
|
|
8756
8774
|
cedil: "¸"
|
|
8757
|
-
},
|
|
8775
|
+
}, Ua = {
|
|
8758
8776
|
amp: "&",
|
|
8759
8777
|
apos: "'",
|
|
8760
8778
|
gt: ">",
|
|
8761
8779
|
lt: "<",
|
|
8762
8780
|
quot: "\""
|
|
8763
|
-
},
|
|
8781
|
+
}, Wa = {
|
|
8764
8782
|
nbsp: "\xA0",
|
|
8765
8783
|
copy: "©",
|
|
8766
8784
|
reg: "®",
|
|
@@ -8781,17 +8799,17 @@ var Ba = {
|
|
|
8781
8799
|
frac12: "½",
|
|
8782
8800
|
frac14: "¼",
|
|
8783
8801
|
frac34: "¾"
|
|
8784
|
-
},
|
|
8802
|
+
}, Ga = Object.freeze({
|
|
8785
8803
|
ALLOW: "allow",
|
|
8786
8804
|
BLOCK: "block",
|
|
8787
8805
|
THROW: "throw"
|
|
8788
|
-
}),
|
|
8789
|
-
function
|
|
8806
|
+
}), Ka = /* @__PURE__ */ new Set("!?\\\\/[]$%{}^&*()<>|+");
|
|
8807
|
+
function qa(e) {
|
|
8790
8808
|
if (e[0] === "#") throw Error(`[EntityReplacer] Invalid character '#' in entity name: "${e}"`);
|
|
8791
|
-
for (let t of e) if (
|
|
8809
|
+
for (let t of e) if (Ka.has(t)) throw Error(`[EntityReplacer] Invalid character '${t}' in entity name: "${e}"`);
|
|
8792
8810
|
return e;
|
|
8793
8811
|
}
|
|
8794
|
-
function
|
|
8812
|
+
function Ja(...e) {
|
|
8795
8813
|
let t = Object.create(null);
|
|
8796
8814
|
for (let n of e) if (n) for (let e of Object.keys(n)) {
|
|
8797
8815
|
let r = n[e];
|
|
@@ -8803,65 +8821,65 @@ function Ka(...e) {
|
|
|
8803
8821
|
}
|
|
8804
8822
|
return t;
|
|
8805
8823
|
}
|
|
8806
|
-
var
|
|
8807
|
-
function
|
|
8808
|
-
return !e || e ===
|
|
8824
|
+
var Ya = "external", Xa = "base", Za = "all";
|
|
8825
|
+
function Qa(e) {
|
|
8826
|
+
return !e || e === Ya ? /* @__PURE__ */ new Set([Ya]) : e === Za ? /* @__PURE__ */ new Set([Za]) : e === Xa ? /* @__PURE__ */ new Set([Xa]) : Array.isArray(e) ? new Set(e) : /* @__PURE__ */ new Set([Ya]);
|
|
8809
8827
|
}
|
|
8810
|
-
var
|
|
8828
|
+
var $a = Object.freeze({
|
|
8811
8829
|
allow: 0,
|
|
8812
8830
|
leave: 1,
|
|
8813
8831
|
remove: 2,
|
|
8814
8832
|
throw: 3
|
|
8815
|
-
}),
|
|
8833
|
+
}), eo = /* @__PURE__ */ new Set([
|
|
8816
8834
|
9,
|
|
8817
8835
|
10,
|
|
8818
8836
|
13
|
|
8819
8837
|
]);
|
|
8820
|
-
function
|
|
8838
|
+
function to(e) {
|
|
8821
8839
|
if (!e) return {
|
|
8822
8840
|
xmlVersion: 1,
|
|
8823
|
-
onLevel:
|
|
8824
|
-
nullLevel:
|
|
8841
|
+
onLevel: $a.allow,
|
|
8842
|
+
nullLevel: $a.remove
|
|
8825
8843
|
};
|
|
8826
|
-
let t = e.xmlVersion === 1.1 ? 1.1 : 1, n =
|
|
8844
|
+
let t = e.xmlVersion === 1.1 ? 1.1 : 1, n = $a[e.onNCR] ?? $a.allow, r = $a[e.nullNCR] ?? $a.remove;
|
|
8827
8845
|
return {
|
|
8828
8846
|
xmlVersion: t,
|
|
8829
8847
|
onLevel: n,
|
|
8830
|
-
nullLevel: Math.max(r,
|
|
8848
|
+
nullLevel: Math.max(r, $a.remove)
|
|
8831
8849
|
};
|
|
8832
8850
|
}
|
|
8833
|
-
var
|
|
8851
|
+
var no = class {
|
|
8834
8852
|
constructor(e = {}) {
|
|
8835
|
-
this._limit = e.limit || {}, this._maxTotalExpansions = this._limit.maxTotalExpansions || 0, this._maxExpandedLength = this._limit.maxExpandedLength || 0, this._postCheck = typeof e.postCheck == "function" ? e.postCheck : (e) => e, this._limitTiers =
|
|
8836
|
-
let t =
|
|
8853
|
+
this._limit = e.limit || {}, this._maxTotalExpansions = this._limit.maxTotalExpansions || 0, this._maxExpandedLength = this._limit.maxExpandedLength || 0, this._postCheck = typeof e.postCheck == "function" ? e.postCheck : (e) => e, this._limitTiers = Qa(this._limit.applyLimitsTo ?? Ya), this._numericAllowed = e.numericAllowed ?? !0, this._baseMap = Ja(Ua, e.namedEntities || null), this._externalMap = Object.create(null), this._inputMap = Object.create(null), this._totalExpansions = 0, this._expandedLength = 0, this._removeSet = new Set(e.remove && Array.isArray(e.remove) ? e.remove : []), this._leaveSet = new Set(e.leave && Array.isArray(e.leave) ? e.leave : []);
|
|
8854
|
+
let t = to(e.ncr);
|
|
8837
8855
|
this._ncrXmlVersion = t.xmlVersion, this._ncrOnLevel = t.onLevel, this._ncrNullLevel = t.nullLevel, this._onExternalEntity = typeof e.onExternalEntity == "function" ? e.onExternalEntity : null, this._onInputEntity = typeof e.onInputEntity == "function" ? e.onInputEntity : null;
|
|
8838
8856
|
}
|
|
8839
8857
|
_applyRegistrationHook(e, t, n, r) {
|
|
8840
8858
|
if (!e) return !0;
|
|
8841
8859
|
let i = e(t, n);
|
|
8842
|
-
if (i ===
|
|
8843
|
-
if (i ===
|
|
8860
|
+
if (i === Ga.BLOCK) return !1;
|
|
8861
|
+
if (i === Ga.THROW) throw Error(`[EntityDecoder] Registration of ${r} entity "&${t};" was rejected by hook`);
|
|
8844
8862
|
return !0;
|
|
8845
8863
|
}
|
|
8846
8864
|
setExternalEntities(e) {
|
|
8847
|
-
if (e) for (let t of Object.keys(e))
|
|
8865
|
+
if (e) for (let t of Object.keys(e)) qa(t);
|
|
8848
8866
|
if (!this._onExternalEntity) {
|
|
8849
|
-
this._externalMap =
|
|
8867
|
+
this._externalMap = Ja(e);
|
|
8850
8868
|
return;
|
|
8851
8869
|
}
|
|
8852
|
-
let t =
|
|
8870
|
+
let t = Ja(e), n = Object.create(null);
|
|
8853
8871
|
for (let [e, r] of Object.entries(t)) this._applyRegistrationHook(this._onExternalEntity, e, r, "external") && (n[e] = r);
|
|
8854
8872
|
this._externalMap = n;
|
|
8855
8873
|
}
|
|
8856
8874
|
addExternalEntity(e, t) {
|
|
8857
|
-
|
|
8875
|
+
qa(e), typeof t == "string" && t.indexOf("&") === -1 && this._applyRegistrationHook(this._onExternalEntity, e, t, "external") && (this._externalMap[e] = t);
|
|
8858
8876
|
}
|
|
8859
8877
|
addInputEntities(e) {
|
|
8860
8878
|
if (this._totalExpansions = 0, this._expandedLength = 0, !this._onInputEntity) {
|
|
8861
|
-
this._inputMap =
|
|
8879
|
+
this._inputMap = Ja(e);
|
|
8862
8880
|
return;
|
|
8863
8881
|
}
|
|
8864
|
-
let t =
|
|
8882
|
+
let t = Ja(e), n = Object.create(null);
|
|
8865
8883
|
for (let [e, r] of Object.entries(t)) this._applyRegistrationHook(this._onInputEntity, e, r, "input") && (n[e] = r);
|
|
8866
8884
|
this._inputMap = n;
|
|
8867
8885
|
}
|
|
@@ -8891,7 +8909,7 @@ var eo = class {
|
|
|
8891
8909
|
continue;
|
|
8892
8910
|
}
|
|
8893
8911
|
let u, d;
|
|
8894
|
-
if (this._removeSet.has(l)) u = "", d === void 0 && (d =
|
|
8912
|
+
if (this._removeSet.has(l)) u = "", d === void 0 && (d = Ya);
|
|
8895
8913
|
else if (this._leaveSet.has(l)) {
|
|
8896
8914
|
a++;
|
|
8897
8915
|
continue;
|
|
@@ -8901,7 +8919,7 @@ var eo = class {
|
|
|
8901
8919
|
a++;
|
|
8902
8920
|
continue;
|
|
8903
8921
|
}
|
|
8904
|
-
u = e, d =
|
|
8922
|
+
u = e, d = Xa;
|
|
8905
8923
|
} else {
|
|
8906
8924
|
let e = this._resolveName(l);
|
|
8907
8925
|
u = e?.value, d = e?.tier;
|
|
@@ -8923,31 +8941,31 @@ var eo = class {
|
|
|
8923
8941
|
return this._postCheck(l, t);
|
|
8924
8942
|
}
|
|
8925
8943
|
_tierCounts(e) {
|
|
8926
|
-
return this._limitTiers.has(
|
|
8944
|
+
return this._limitTiers.has(Za) ? !0 : this._limitTiers.has(e);
|
|
8927
8945
|
}
|
|
8928
8946
|
_resolveName(e) {
|
|
8929
8947
|
if (e in this._inputMap) return {
|
|
8930
8948
|
value: this._inputMap[e],
|
|
8931
|
-
tier:
|
|
8949
|
+
tier: Ya
|
|
8932
8950
|
};
|
|
8933
8951
|
if (e in this._externalMap) return {
|
|
8934
8952
|
value: this._externalMap[e],
|
|
8935
|
-
tier:
|
|
8953
|
+
tier: Ya
|
|
8936
8954
|
};
|
|
8937
8955
|
if (e in this._baseMap) return {
|
|
8938
8956
|
value: this._baseMap[e],
|
|
8939
|
-
tier:
|
|
8957
|
+
tier: Xa
|
|
8940
8958
|
};
|
|
8941
8959
|
}
|
|
8942
8960
|
_classifyNCR(e) {
|
|
8943
|
-
return e === 0 ? this._ncrNullLevel : e >= 55296 && e <= 57343 || this._ncrXmlVersion === 1 && e >= 1 && e <= 31 && !
|
|
8961
|
+
return e === 0 ? this._ncrNullLevel : e >= 55296 && e <= 57343 || this._ncrXmlVersion === 1 && e >= 1 && e <= 31 && !eo.has(e) ? $a.remove : -1;
|
|
8944
8962
|
}
|
|
8945
8963
|
_applyNCRAction(e, t, n) {
|
|
8946
8964
|
switch (e) {
|
|
8947
|
-
case
|
|
8948
|
-
case
|
|
8949
|
-
case
|
|
8950
|
-
case
|
|
8965
|
+
case $a.allow: return String.fromCodePoint(n);
|
|
8966
|
+
case $a.remove: return "";
|
|
8967
|
+
case $a.leave: return;
|
|
8968
|
+
case $a.throw: throw Error(`[EntityDecoder] Prohibited numeric character reference &${t}; (U+${n.toString(16).toUpperCase().padStart(4, "0")})`);
|
|
8951
8969
|
default: return String.fromCodePoint(n);
|
|
8952
8970
|
}
|
|
8953
8971
|
}
|
|
@@ -8955,11 +8973,11 @@ var eo = class {
|
|
|
8955
8973
|
let t = e.charCodeAt(1), n;
|
|
8956
8974
|
if (n = t === 120 || t === 88 ? parseInt(e.slice(2), 16) : parseInt(e.slice(1), 10), Number.isNaN(n) || n < 0 || n > 1114111) return;
|
|
8957
8975
|
let r = this._classifyNCR(n);
|
|
8958
|
-
if (!this._numericAllowed && r <
|
|
8976
|
+
if (!this._numericAllowed && r < $a.remove) return;
|
|
8959
8977
|
let i = r === -1 ? this._ncrOnLevel : Math.max(this._ncrOnLevel, r);
|
|
8960
8978
|
return this._applyNCRAction(i, e, n);
|
|
8961
8979
|
}
|
|
8962
|
-
},
|
|
8980
|
+
}, ro = (e) => wa.includes(e) ? "__" + e : e, io = {
|
|
8963
8981
|
preserveOrder: !1,
|
|
8964
8982
|
attributeNamePrefix: "@_",
|
|
8965
8983
|
attributesGroupName: !1,
|
|
@@ -9002,14 +9020,14 @@ var eo = class {
|
|
|
9002
9020
|
maxNestedTags: 100,
|
|
9003
9021
|
strictReservedNames: !0,
|
|
9004
9022
|
jPath: !0,
|
|
9005
|
-
onDangerousProperty:
|
|
9023
|
+
onDangerousProperty: ro
|
|
9006
9024
|
};
|
|
9007
|
-
function
|
|
9025
|
+
function ao(e, t) {
|
|
9008
9026
|
if (typeof e != "string") return;
|
|
9009
9027
|
let n = e.toLowerCase();
|
|
9010
|
-
if (
|
|
9028
|
+
if (wa.some((e) => n === e.toLowerCase()) || Ta.some((e) => n === e.toLowerCase())) throw Error(`[SECURITY] Invalid ${t}: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`);
|
|
9011
9029
|
}
|
|
9012
|
-
function
|
|
9030
|
+
function oo(e, t) {
|
|
9013
9031
|
return typeof e == "boolean" ? {
|
|
9014
9032
|
enabled: e,
|
|
9015
9033
|
maxEntitySize: 1e4,
|
|
@@ -9030,10 +9048,10 @@ function io(e, t) {
|
|
|
9030
9048
|
allowedTags: e.allowedTags ?? null,
|
|
9031
9049
|
tagFilter: e.tagFilter ?? null,
|
|
9032
9050
|
appliesTo: e.appliesTo ?? "all"
|
|
9033
|
-
} :
|
|
9051
|
+
} : oo(!0);
|
|
9034
9052
|
}
|
|
9035
|
-
var
|
|
9036
|
-
let t = Object.assign({},
|
|
9053
|
+
var so = function(e) {
|
|
9054
|
+
let t = Object.assign({}, io, e), n = [
|
|
9037
9055
|
{
|
|
9038
9056
|
value: t.attributeNamePrefix,
|
|
9039
9057
|
name: "attributeNamePrefix"
|
|
@@ -9055,9 +9073,9 @@ var ao = function(e) {
|
|
|
9055
9073
|
name: "commentPropName"
|
|
9056
9074
|
}
|
|
9057
9075
|
];
|
|
9058
|
-
for (let { value: e, name: t } of n) e &&
|
|
9059
|
-
return t.onDangerousProperty === null && (t.onDangerousProperty =
|
|
9060
|
-
},
|
|
9076
|
+
for (let { value: e, name: t } of n) e && ao(e, t);
|
|
9077
|
+
return t.onDangerousProperty === null && (t.onDangerousProperty = ro), t.processEntities = oo(t.processEntities, t.htmlEntities), t.unpairedTagsSet = new Set(t.unpairedTags), t.stopNodes && Array.isArray(t.stopNodes) && (t.stopNodes = t.stopNodes.map((e) => typeof e == "string" && e.startsWith("*.") ? ".." + e.substring(2) : e)), t;
|
|
9078
|
+
}, co = typeof Symbol == "function" ? Symbol("XML Node Metadata") : "@@xmlMetadata", lo = class {
|
|
9061
9079
|
constructor(e) {
|
|
9062
9080
|
this.tagname = e, this.child = [], this[":@"] = Object.create(null);
|
|
9063
9081
|
}
|
|
@@ -9068,12 +9086,12 @@ var ao = function(e) {
|
|
|
9068
9086
|
e.tagname === "__proto__" && (e.tagname = "#__proto__"), e[":@"] && Object.keys(e[":@"]).length > 0 ? this.child.push({
|
|
9069
9087
|
[e.tagname]: e.child,
|
|
9070
9088
|
":@": e[":@"]
|
|
9071
|
-
}) : this.child.push({ [e.tagname]: e.child }), t !== void 0 && (this.child[this.child.length - 1][
|
|
9089
|
+
}) : this.child.push({ [e.tagname]: e.child }), t !== void 0 && (this.child[this.child.length - 1][co] = { startIndex: t });
|
|
9072
9090
|
}
|
|
9073
9091
|
static getMetaDataSymbol() {
|
|
9074
|
-
return
|
|
9092
|
+
return co;
|
|
9075
9093
|
}
|
|
9076
|
-
},
|
|
9094
|
+
}, uo = ":A-Za-z_À-ÖØ-öø-˿Ͱ-ͽͿ-҆҈--⁰-Ⰰ-、-豈-﷏ﷰ-�", fo = uo + "\\-\\.\\d·̀-ͯ‿-⁀", po = ":A-Za-z_À-˿Ͱ-ͽͿ-҆҈--⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-", mo = po + "\\-\\.\\d·̀-ͯ҇‿-⁀", ho = (e, t, n = "") => {
|
|
9077
9095
|
let r = `[${e.replace(":", "")}][${t.replace(":", "")}]*`;
|
|
9078
9096
|
return {
|
|
9079
9097
|
name: RegExp(`^[${e}][${t}]*$`, n),
|
|
@@ -9082,15 +9100,15 @@ var ao = function(e) {
|
|
|
9082
9100
|
nmToken: RegExp(`^[${t}]+$`, n),
|
|
9083
9101
|
nmTokens: RegExp(`^[${t}]+(?:\\s+[${t}]+)*$`, n)
|
|
9084
9102
|
};
|
|
9085
|
-
},
|
|
9103
|
+
}, go = ho(uo, fo), _o = ho(po, mo, "u"), vo = ho(":A-Za-z_", ":A-Za-z_\\-\\.\\d"), yo = (e = "1.0", t = !1) => t ? vo : e === "1.1" ? _o : go, bo = (e, { xmlVersion: t = "1.0", asciiOnly: n = !1 } = {}) => yo(t, n).qName.test(e), xo = [
|
|
9086
9104
|
"name",
|
|
9087
9105
|
"ncName",
|
|
9088
9106
|
"qName",
|
|
9089
9107
|
"nmToken",
|
|
9090
9108
|
"nmTokens"
|
|
9091
|
-
],
|
|
9092
|
-
if (!
|
|
9093
|
-
let i =
|
|
9109
|
+
], So = (e, { xmlVersion: t = "1.0", asciiOnly: n = !1, maxCacheSize: r = 2048 } = {}) => {
|
|
9110
|
+
if (!xo.includes(e)) throw TypeError(`Unknown production "${e}". Must be one of: ${xo.join(", ")}`);
|
|
9111
|
+
let i = yo(t, n)[e], a = /* @__PURE__ */ new Map(), o = (e) => {
|
|
9094
9112
|
let t = a.get(e);
|
|
9095
9113
|
if (t !== void 0) return t;
|
|
9096
9114
|
let n = i.test(e);
|
|
@@ -9099,7 +9117,7 @@ var ao = function(e) {
|
|
|
9099
9117
|
return o.reset = () => {
|
|
9100
9118
|
a = /* @__PURE__ */ new Map();
|
|
9101
9119
|
}, o;
|
|
9102
|
-
},
|
|
9120
|
+
}, Co = class {
|
|
9103
9121
|
constructor(e, t) {
|
|
9104
9122
|
this.suppressValidationErr = !e, this.options = e, this.xmlVersion = t || 1;
|
|
9105
9123
|
}
|
|
@@ -9112,23 +9130,23 @@ var ao = function(e) {
|
|
|
9112
9130
|
t += 9;
|
|
9113
9131
|
let i = 1, a = !1, o = !1, s = "";
|
|
9114
9132
|
for (; t < e.length; t++) if (e[t] === "<" && !o) {
|
|
9115
|
-
if (a &&
|
|
9133
|
+
if (a && To(e, "!ENTITY", t)) {
|
|
9116
9134
|
t += 7;
|
|
9117
9135
|
let i, a;
|
|
9118
9136
|
if ([i, a, t] = this.readEntityExp(e, t + 1, this.suppressValidationErr), a.indexOf("&") === -1) {
|
|
9119
9137
|
if (this.options.enabled !== !1 && this.options.maxEntityCount != null && r >= this.options.maxEntityCount) throw Error(`Entity count (${r + 1}) exceeds maximum allowed (${this.options.maxEntityCount})`);
|
|
9120
9138
|
n[i] = a, r++;
|
|
9121
9139
|
}
|
|
9122
|
-
} else if (a &&
|
|
9140
|
+
} else if (a && To(e, "!ELEMENT", t)) {
|
|
9123
9141
|
t += 8;
|
|
9124
9142
|
let { index: n } = this.readElementExp(e, t + 1);
|
|
9125
9143
|
t = n;
|
|
9126
|
-
} else if (a &&
|
|
9127
|
-
else if (a &&
|
|
9144
|
+
} else if (a && To(e, "!ATTLIST", t)) t += 8;
|
|
9145
|
+
else if (a && To(e, "!NOTATION", t)) {
|
|
9128
9146
|
t += 9;
|
|
9129
9147
|
let { index: n } = this.readNotationExp(e, t + 1, this.suppressValidationErr);
|
|
9130
9148
|
t = n;
|
|
9131
|
-
} else if (
|
|
9149
|
+
} else if (To(e, "!--", t)) o = !0;
|
|
9132
9150
|
else throw Error("Invalid DOCTYPE");
|
|
9133
9151
|
i++, s = "";
|
|
9134
9152
|
} else if (e[t] === ">") {
|
|
@@ -9142,11 +9160,11 @@ var ao = function(e) {
|
|
|
9142
9160
|
};
|
|
9143
9161
|
}
|
|
9144
9162
|
readEntityExp(e, t) {
|
|
9145
|
-
t =
|
|
9163
|
+
t = wo(e, t);
|
|
9146
9164
|
let n = t;
|
|
9147
9165
|
for (; t < e.length && !/\s/.test(e[t]) && e[t] !== "\"" && e[t] !== "'";) t++;
|
|
9148
9166
|
let r = e.substring(n, t);
|
|
9149
|
-
if (
|
|
9167
|
+
if (Eo(r, { xmlVersion: this.xmlVersion }), t = wo(e, t), !this.suppressValidationErr) {
|
|
9150
9168
|
if (e.substring(t, t + 6).toUpperCase() === "SYSTEM") throw Error("External entities are not supported");
|
|
9151
9169
|
if (e[t] === "%") throw Error("Parameter entities are not supported");
|
|
9152
9170
|
}
|
|
@@ -9159,16 +9177,16 @@ var ao = function(e) {
|
|
|
9159
9177
|
];
|
|
9160
9178
|
}
|
|
9161
9179
|
readNotationExp(e, t) {
|
|
9162
|
-
t =
|
|
9180
|
+
t = wo(e, t);
|
|
9163
9181
|
let n = t;
|
|
9164
9182
|
for (; t < e.length && !/\s/.test(e[t]);) t++;
|
|
9165
9183
|
let r = e.substring(n, t);
|
|
9166
|
-
!this.suppressValidationErr &&
|
|
9184
|
+
!this.suppressValidationErr && Eo(r, { xmlVersion: this.xmlVersion }), t = wo(e, t);
|
|
9167
9185
|
let i = e.substring(t, t + 6).toUpperCase();
|
|
9168
9186
|
if (!this.suppressValidationErr && i !== "SYSTEM" && i !== "PUBLIC") throw Error(`Expected SYSTEM or PUBLIC, found "${i}"`);
|
|
9169
|
-
t += i.length, t =
|
|
9187
|
+
t += i.length, t = wo(e, t);
|
|
9170
9188
|
let a = null, o = null;
|
|
9171
|
-
if (i === "PUBLIC") [t, a] = this.readIdentifierVal(e, t, "publicIdentifier"), t =
|
|
9189
|
+
if (i === "PUBLIC") [t, a] = this.readIdentifierVal(e, t, "publicIdentifier"), t = wo(e, t), (e[t] === "\"" || e[t] === "'") && ([t, o] = this.readIdentifierVal(e, t, "systemIdentifier"));
|
|
9172
9190
|
else if (i === "SYSTEM" && ([t, o] = this.readIdentifierVal(e, t, "systemIdentifier"), !this.suppressValidationErr && !o)) throw Error("Missing mandatory system identifier for SYSTEM notation");
|
|
9173
9191
|
return {
|
|
9174
9192
|
notationName: r,
|
|
@@ -9187,15 +9205,15 @@ var ao = function(e) {
|
|
|
9187
9205
|
return t++, [t, r];
|
|
9188
9206
|
}
|
|
9189
9207
|
readElementExp(e, t) {
|
|
9190
|
-
t =
|
|
9208
|
+
t = wo(e, t);
|
|
9191
9209
|
let n = t;
|
|
9192
9210
|
for (; t < e.length && !/\s/.test(e[t]);) t++;
|
|
9193
9211
|
let r = e.substring(n, t);
|
|
9194
|
-
if (!this.suppressValidationErr && !
|
|
9195
|
-
t =
|
|
9212
|
+
if (!this.suppressValidationErr && !bo(r, { xmlVersion: this.xmlVersion })) throw Error(`Invalid element name: "${r}"`);
|
|
9213
|
+
t = wo(e, t);
|
|
9196
9214
|
let i = "";
|
|
9197
|
-
if (e[t] === "E" &&
|
|
9198
|
-
else if (e[t] === "A" &&
|
|
9215
|
+
if (e[t] === "E" && To(e, "MPTY", t)) t += 4;
|
|
9216
|
+
else if (e[t] === "A" && To(e, "NY", t)) t += 2;
|
|
9199
9217
|
else if (e[t] === "(") {
|
|
9200
9218
|
t++;
|
|
9201
9219
|
let n = t;
|
|
@@ -9209,25 +9227,25 @@ var ao = function(e) {
|
|
|
9209
9227
|
};
|
|
9210
9228
|
}
|
|
9211
9229
|
readAttlistExp(e, t) {
|
|
9212
|
-
t =
|
|
9230
|
+
t = wo(e, t);
|
|
9213
9231
|
let n = t;
|
|
9214
9232
|
for (; t < e.length && !/\s/.test(e[t]);) t++;
|
|
9215
9233
|
let r = e.substring(n, t);
|
|
9216
|
-
for (
|
|
9234
|
+
for (Eo(r, { xmlVersion: this.xmlVersion }), t = wo(e, t), n = t; t < e.length && !/\s/.test(e[t]);) t++;
|
|
9217
9235
|
let i = e.substring(n, t);
|
|
9218
|
-
if (!
|
|
9219
|
-
t =
|
|
9236
|
+
if (!Eo(i, { xmlVersion: this.xmlVersion })) throw Error(`Invalid attribute name: "${i}"`);
|
|
9237
|
+
t = wo(e, t);
|
|
9220
9238
|
let a = "";
|
|
9221
9239
|
if (e.substring(t, t + 8).toUpperCase() === "NOTATION") {
|
|
9222
|
-
if (a = "NOTATION", t += 8, t =
|
|
9240
|
+
if (a = "NOTATION", t += 8, t = wo(e, t), e[t] !== "(") throw Error(`Expected '(', found "${e[t]}"`);
|
|
9223
9241
|
t++;
|
|
9224
9242
|
let n = [];
|
|
9225
9243
|
for (; t < e.length && e[t] !== ")";) {
|
|
9226
9244
|
let r = t;
|
|
9227
9245
|
for (; t < e.length && e[t] !== "|" && e[t] !== ")";) t++;
|
|
9228
9246
|
let i = e.substring(r, t);
|
|
9229
|
-
if (i = i.trim(), !
|
|
9230
|
-
n.push(i), e[t] === "|" && (t++, t =
|
|
9247
|
+
if (i = i.trim(), !Eo(i, { xmlVersion: this.xmlVersion })) throw Error(`Invalid notation name: "${i}"`);
|
|
9248
|
+
n.push(i), e[t] === "|" && (t++, t = wo(e, t));
|
|
9231
9249
|
}
|
|
9232
9250
|
if (e[t] !== ")") throw Error("Unterminated list of notations");
|
|
9233
9251
|
t++, a += " (" + n.join("|") + ")";
|
|
@@ -9245,7 +9263,7 @@ var ao = function(e) {
|
|
|
9245
9263
|
"NMTOKENS"
|
|
9246
9264
|
].includes(a.toUpperCase())) throw Error(`Invalid attribute type: "${a}"`);
|
|
9247
9265
|
}
|
|
9248
|
-
t =
|
|
9266
|
+
t = wo(e, t);
|
|
9249
9267
|
let o = "";
|
|
9250
9268
|
return e.substring(t, t + 8).toUpperCase() === "#REQUIRED" ? (o = "#REQUIRED", t += 8) : e.substring(t, t + 7).toUpperCase() === "#IMPLIED" ? (o = "#IMPLIED", t += 7) : [t, o] = this.readIdentifierVal(e, t, "ATTLIST"), {
|
|
9251
9269
|
elementName: r,
|
|
@@ -9255,21 +9273,21 @@ var ao = function(e) {
|
|
|
9255
9273
|
index: t
|
|
9256
9274
|
};
|
|
9257
9275
|
}
|
|
9258
|
-
},
|
|
9276
|
+
}, wo = (e, t) => {
|
|
9259
9277
|
for (; t < e.length && /\s/.test(e[t]);) t++;
|
|
9260
9278
|
return t;
|
|
9261
9279
|
};
|
|
9262
|
-
function
|
|
9280
|
+
function To(e, t, n) {
|
|
9263
9281
|
for (let r = 0; r < t.length; r++) if (t[r] !== e[n + r + 1]) return !1;
|
|
9264
9282
|
return !0;
|
|
9265
9283
|
}
|
|
9266
|
-
function
|
|
9267
|
-
if (
|
|
9284
|
+
function Eo(e, t) {
|
|
9285
|
+
if (bo(e, { xmlVersion: t })) return e;
|
|
9268
9286
|
throw Error(`Invalid entity name ${e}`);
|
|
9269
9287
|
}
|
|
9270
9288
|
//#endregion
|
|
9271
9289
|
//#region node_modules/.pnpm/anynum@1.0.1/node_modules/anynum/digitTable.js
|
|
9272
|
-
var
|
|
9290
|
+
var Do = [
|
|
9273
9291
|
48,
|
|
9274
9292
|
1632,
|
|
9275
9293
|
1776,
|
|
@@ -9331,28 +9349,28 @@ var To = [
|
|
|
9331
9349
|
124144,
|
|
9332
9350
|
125264,
|
|
9333
9351
|
130032
|
|
9334
|
-
],
|
|
9335
|
-
for (let e of
|
|
9352
|
+
], Oo = /* @__PURE__ */ new Map(), ko = 65535, Ao = 1632, jo = (/* @__PURE__ */ new Uint8Array(63904)).fill(255);
|
|
9353
|
+
for (let e of Do) for (let t = 0; t < 10; t++) {
|
|
9336
9354
|
let n = e + t;
|
|
9337
|
-
n <=
|
|
9355
|
+
n <= ko ? jo[n - Ao] = t : Oo.set(n, t);
|
|
9338
9356
|
}
|
|
9339
9357
|
//#endregion
|
|
9340
9358
|
//#region node_modules/.pnpm/anynum@1.0.1/node_modules/anynum/anynum.js
|
|
9341
|
-
var
|
|
9359
|
+
var Mo = 48, No = 57, Po = 45, Fo = /* @__PURE__ */ new Set([
|
|
9342
9360
|
8722,
|
|
9343
9361
|
65293,
|
|
9344
9362
|
65123
|
|
9345
9363
|
]);
|
|
9346
|
-
function
|
|
9364
|
+
function Io(e) {
|
|
9347
9365
|
if (typeof e != "string") return e;
|
|
9348
9366
|
let t = e.length;
|
|
9349
9367
|
if (t === 0) return e;
|
|
9350
9368
|
let n = -1;
|
|
9351
9369
|
for (let r = 0; r < t; r++) {
|
|
9352
9370
|
let i = e.charCodeAt(r);
|
|
9353
|
-
if (!(i >=
|
|
9371
|
+
if (!(i >= Mo && i <= No || i === Po)) {
|
|
9354
9372
|
if (i < 1632) {
|
|
9355
|
-
if (
|
|
9373
|
+
if (Fo.has(i)) {
|
|
9356
9374
|
n = r;
|
|
9357
9375
|
break;
|
|
9358
9376
|
}
|
|
@@ -9363,7 +9381,7 @@ function Po(e) {
|
|
|
9363
9381
|
let t = e.charCodeAt(r + 1);
|
|
9364
9382
|
if (t >= 56320 && t <= 57343) {
|
|
9365
9383
|
let e = 65536 + (i - 55296 << 10) + (t - 56320);
|
|
9366
|
-
if (
|
|
9384
|
+
if (Oo.has(e)) {
|
|
9367
9385
|
n = r;
|
|
9368
9386
|
break;
|
|
9369
9387
|
}
|
|
@@ -9371,7 +9389,7 @@ function Po(e) {
|
|
|
9371
9389
|
}
|
|
9372
9390
|
continue;
|
|
9373
9391
|
}
|
|
9374
|
-
if (
|
|
9392
|
+
if (jo[i - 1632] !== 255 || Fo.has(i)) {
|
|
9375
9393
|
n = r;
|
|
9376
9394
|
break;
|
|
9377
9395
|
}
|
|
@@ -9382,19 +9400,19 @@ function Po(e) {
|
|
|
9382
9400
|
n > 0 && r.push(e.slice(0, n));
|
|
9383
9401
|
for (let i = n; i < t; i++) {
|
|
9384
9402
|
let n = e.charCodeAt(i);
|
|
9385
|
-
if (n >=
|
|
9403
|
+
if (n >= Mo && n <= No || n === Po) {
|
|
9386
9404
|
r.push(e[i]);
|
|
9387
9405
|
continue;
|
|
9388
9406
|
}
|
|
9389
9407
|
if (n < 1632) {
|
|
9390
|
-
r.push(
|
|
9408
|
+
r.push(Fo.has(n) ? "-" : e[i]);
|
|
9391
9409
|
continue;
|
|
9392
9410
|
}
|
|
9393
9411
|
if (n >= 55296 && n <= 56319) {
|
|
9394
9412
|
if (i + 1 < t) {
|
|
9395
9413
|
let t = e.charCodeAt(i + 1);
|
|
9396
9414
|
if (t >= 56320 && t <= 57343) {
|
|
9397
|
-
let e = 65536 + (n - 55296 << 10) + (t - 56320), a =
|
|
9415
|
+
let e = 65536 + (n - 55296 << 10) + (t - 56320), a = Oo.get(e);
|
|
9398
9416
|
if (a !== void 0) {
|
|
9399
9417
|
r.push(String.fromCharCode(a + 48)), i++;
|
|
9400
9418
|
continue;
|
|
@@ -9404,18 +9422,18 @@ function Po(e) {
|
|
|
9404
9422
|
r.push(e[i]);
|
|
9405
9423
|
continue;
|
|
9406
9424
|
}
|
|
9407
|
-
if (
|
|
9425
|
+
if (Fo.has(n)) {
|
|
9408
9426
|
r.push("-");
|
|
9409
9427
|
continue;
|
|
9410
9428
|
}
|
|
9411
|
-
let a =
|
|
9429
|
+
let a = jo[n - Ao];
|
|
9412
9430
|
r.push(a === 255 ? e[i] : String.fromCharCode(a + 48));
|
|
9413
9431
|
}
|
|
9414
9432
|
return r.join("");
|
|
9415
9433
|
}
|
|
9416
9434
|
//#endregion
|
|
9417
9435
|
//#region node_modules/.pnpm/strnum@2.4.1/node_modules/strnum/strnum.js
|
|
9418
|
-
var
|
|
9436
|
+
var Lo = /^[-+]?0x[a-fA-F0-9]+$/, Ro = /^0b[01]+$/, zo = /^0o[0-7]+$/, Bo = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, Vo = {
|
|
9419
9437
|
hex: !0,
|
|
9420
9438
|
binary: !1,
|
|
9421
9439
|
octal: !1,
|
|
@@ -9425,20 +9443,20 @@ var Fo = /^[-+]?0x[a-fA-F0-9]+$/, Io = /^0b[01]+$/, Lo = /^0o[0-7]+$/, Ro = /^([
|
|
|
9425
9443
|
infinity: "original",
|
|
9426
9444
|
unicode: !1
|
|
9427
9445
|
};
|
|
9428
|
-
function
|
|
9429
|
-
if (t = Object.assign({},
|
|
9446
|
+
function Ho(e, t = {}) {
|
|
9447
|
+
if (t = Object.assign({}, Vo, t), !e || typeof e != "string") return e;
|
|
9430
9448
|
let n = e.trim();
|
|
9431
9449
|
if (n.length === 0 || t.skipLike !== void 0 && t.skipLike.test(n)) return e;
|
|
9432
|
-
if (n === "0" || t.unicode && (n =
|
|
9433
|
-
if (t.hex &&
|
|
9434
|
-
if (t.binary &&
|
|
9435
|
-
if (t.octal &&
|
|
9436
|
-
if (!isFinite(n)) return
|
|
9437
|
-
if (n.includes("e") || n.includes("E")) return
|
|
9438
|
-
{
|
|
9439
|
-
let r =
|
|
9450
|
+
if (n === "0" || t.unicode && (n = Io(n), n === "0")) return 0;
|
|
9451
|
+
if (t.hex && Lo.test(n)) return Ko(n, 16);
|
|
9452
|
+
if (t.binary && Ro.test(n)) return Ko(n, 2);
|
|
9453
|
+
if (t.octal && zo.test(n)) return Ko(n, 8);
|
|
9454
|
+
if (!isFinite(n)) return qo(e, Number(n), t);
|
|
9455
|
+
if (n.includes("e") || n.includes("E")) return Wo(e, n, t);
|
|
9456
|
+
{
|
|
9457
|
+
let r = Bo.exec(n);
|
|
9440
9458
|
if (r) {
|
|
9441
|
-
let i = r[1] || "", a = r[2], o =
|
|
9459
|
+
let i = r[1] || "", a = r[2], o = Go(r[3]), s = i ? e[a.length + 1] === "." : e[a.length] === ".";
|
|
9442
9460
|
if (!t.leadingZeros && (a.length > 1 || a.length === 1 && !s)) return e;
|
|
9443
9461
|
{
|
|
9444
9462
|
let r = Number(n), s = String(r);
|
|
@@ -9452,27 +9470,27 @@ function Bo(e, t = {}) {
|
|
|
9452
9470
|
return e;
|
|
9453
9471
|
}
|
|
9454
9472
|
}
|
|
9455
|
-
var
|
|
9456
|
-
function
|
|
9473
|
+
var Uo = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;
|
|
9474
|
+
function Wo(e, t, n) {
|
|
9457
9475
|
if (!n.eNotation) return e;
|
|
9458
|
-
let r = t.match(
|
|
9476
|
+
let r = t.match(Uo);
|
|
9459
9477
|
if (r) {
|
|
9460
9478
|
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;
|
|
9461
9479
|
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);
|
|
9462
9480
|
}
|
|
9463
9481
|
return e;
|
|
9464
9482
|
}
|
|
9465
|
-
function
|
|
9483
|
+
function Go(e) {
|
|
9466
9484
|
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;
|
|
9467
9485
|
}
|
|
9468
|
-
function
|
|
9486
|
+
function Ko(e, t) {
|
|
9469
9487
|
let n = e.trim();
|
|
9470
9488
|
if ((t === 2 || t === 8) && (e = n.substring(2)), parseInt) return parseInt(e, t);
|
|
9471
9489
|
if (Number.parseInt) return Number.parseInt(e, t);
|
|
9472
9490
|
if (window && window.parseInt) return window.parseInt(e, t);
|
|
9473
9491
|
throw Error("parseInt, Number.parseInt, window.parseInt are not supported");
|
|
9474
9492
|
}
|
|
9475
|
-
function
|
|
9493
|
+
function qo(e, t, n) {
|
|
9476
9494
|
let r = t === Infinity;
|
|
9477
9495
|
switch (n.infinity.toLowerCase()) {
|
|
9478
9496
|
case "null": return null;
|
|
@@ -9483,14 +9501,14 @@ function Go(e, t, n) {
|
|
|
9483
9501
|
}
|
|
9484
9502
|
//#endregion
|
|
9485
9503
|
//#region node_modules/.pnpm/fast-xml-parser@5.10.1/node_modules/fast-xml-parser/src/ignoreAttributes.js
|
|
9486
|
-
function
|
|
9504
|
+
function Jo(e) {
|
|
9487
9505
|
return typeof e == "function" ? e : Array.isArray(e) ? (t) => {
|
|
9488
9506
|
for (let n of e) if (typeof n == "string" && t === n || n instanceof RegExp && n.test(t)) return !0;
|
|
9489
9507
|
} : () => !1;
|
|
9490
9508
|
}
|
|
9491
9509
|
//#endregion
|
|
9492
9510
|
//#region node_modules/.pnpm/path-expression-matcher@1.6.2/node_modules/path-expression-matcher/src/Expression.js
|
|
9493
|
-
var
|
|
9511
|
+
var Yo = class {
|
|
9494
9512
|
constructor(e, t = {}, n) {
|
|
9495
9513
|
this.pattern = e, this.separator = t.separator || ".", this.segments = this._parse(e), this.data = n, 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);
|
|
9496
9514
|
}
|
|
@@ -9548,7 +9566,7 @@ var qo = class {
|
|
|
9548
9566
|
toString() {
|
|
9549
9567
|
return this.pattern;
|
|
9550
9568
|
}
|
|
9551
|
-
},
|
|
9569
|
+
}, Xo = class {
|
|
9552
9570
|
constructor() {
|
|
9553
9571
|
this._byDepthAndTag = /* @__PURE__ */ new Map(), this._wildcardByDepth = /* @__PURE__ */ new Map(), this._deepWildcards = [], this._deepByTerminalTag = /* @__PURE__ */ new Map(), this._patterns = /* @__PURE__ */ new Set(), this._sealed = !1;
|
|
9554
9572
|
}
|
|
@@ -9606,7 +9624,7 @@ var qo = class {
|
|
|
9606
9624
|
for (let t = 0; t < this._deepWildcards.length; t++) if (e.matches(this._deepWildcards[t])) return this._deepWildcards[t];
|
|
9607
9625
|
return null;
|
|
9608
9626
|
}
|
|
9609
|
-
},
|
|
9627
|
+
}, Zo = class {
|
|
9610
9628
|
constructor(e) {
|
|
9611
9629
|
this._matcher = e;
|
|
9612
9630
|
}
|
|
@@ -9663,9 +9681,9 @@ var qo = class {
|
|
|
9663
9681
|
matchesAny(e) {
|
|
9664
9682
|
return e.matchesAny(this._matcher);
|
|
9665
9683
|
}
|
|
9666
|
-
},
|
|
9684
|
+
}, Qo = class {
|
|
9667
9685
|
constructor(e = {}) {
|
|
9668
|
-
this.separator = e.separator || ".", this.path = [], this.siblingStacks = [], this._pathStringCache = null, this._view = new
|
|
9686
|
+
this.separator = e.separator || ".", this.path = [], this.siblingStacks = [], this._pathStringCache = null, this._view = new Zo(this), this._keptAttrs = [];
|
|
9669
9687
|
}
|
|
9670
9688
|
push(e, t = null, n = null, r = null) {
|
|
9671
9689
|
this._pathStringCache = null, this.path.length > 0 && (this.path[this.path.length - 1].values = void 0);
|
|
@@ -9816,7 +9834,7 @@ var qo = class {
|
|
|
9816
9834
|
readOnly() {
|
|
9817
9835
|
return this._view;
|
|
9818
9836
|
}
|
|
9819
|
-
},
|
|
9837
|
+
}, $o = [
|
|
9820
9838
|
{
|
|
9821
9839
|
id: "html-script-open",
|
|
9822
9840
|
description: "<script opening tag",
|
|
@@ -9902,7 +9920,7 @@ var qo = class {
|
|
|
9902
9920
|
description: "<form tag — can be used for phishing / credential harvesting injection",
|
|
9903
9921
|
pattern: /<form[\s>/]/i
|
|
9904
9922
|
}
|
|
9905
|
-
],
|
|
9923
|
+
], es = [
|
|
9906
9924
|
{
|
|
9907
9925
|
id: "xml-cdata-injection",
|
|
9908
9926
|
description: "CDATA section injection: <![CDATA[ breaks out of text node context",
|
|
@@ -9963,7 +9981,7 @@ var qo = class {
|
|
|
9963
9981
|
description: "?> closes an enclosing processing instruction",
|
|
9964
9982
|
pattern: /\?>/
|
|
9965
9983
|
}
|
|
9966
|
-
],
|
|
9984
|
+
], ts = [
|
|
9967
9985
|
{
|
|
9968
9986
|
id: "svg-script-element",
|
|
9969
9987
|
description: "<script element inside SVG executes JavaScript",
|
|
@@ -10029,7 +10047,7 @@ var qo = class {
|
|
|
10029
10047
|
description: "style= attribute containing javascript: (e.g. background:url(javascript:...))",
|
|
10030
10048
|
pattern: /style\s*=[\s\S]{0,60}javascript\s*:/i
|
|
10031
10049
|
}
|
|
10032
|
-
],
|
|
10050
|
+
], ns = [
|
|
10033
10051
|
{
|
|
10034
10052
|
id: "sql-block-comment-open",
|
|
10035
10053
|
description: "SQL block comment open: /* ... */ — unusual in legitimate user text",
|
|
@@ -10105,7 +10123,7 @@ var qo = class {
|
|
|
10105
10123
|
description: "INFORMATION_SCHEMA — reconnaissance query for table/column enumeration",
|
|
10106
10124
|
pattern: /\bINFORMATION_SCHEMA\b/i
|
|
10107
10125
|
}
|
|
10108
|
-
],
|
|
10126
|
+
], rs = [
|
|
10109
10127
|
{
|
|
10110
10128
|
id: "shell-path-traversal-unix",
|
|
10111
10129
|
description: "Unix path traversal: ../ — climbing the directory tree",
|
|
@@ -10196,7 +10214,7 @@ var qo = class {
|
|
|
10196
10214
|
description: "curl/wget with URL or flags — can exfiltrate data or download payloads",
|
|
10197
10215
|
pattern: /\b(?:curl|wget)\s+(?:https?:\/\/|ftp:\/\/|-)/i
|
|
10198
10216
|
}
|
|
10199
|
-
],
|
|
10217
|
+
], is = [
|
|
10200
10218
|
{
|
|
10201
10219
|
id: "redos-nested-quantifier-plus",
|
|
10202
10220
|
description: "Nested + quantifier inside a group with outer quantifier: (a+)+, (.+b)*, etc.",
|
|
@@ -10237,71 +10255,71 @@ var qo = class {
|
|
|
10237
10255
|
description: "Long alternation with many similar branches — polynomial backtracking risk",
|
|
10238
10256
|
pattern: /\([^)]{0,200}(?:\|[^|)]{0,50}){9,}\)/
|
|
10239
10257
|
}
|
|
10240
|
-
],
|
|
10258
|
+
], as = "[\"'\\s]*:", os = [
|
|
10241
10259
|
{
|
|
10242
10260
|
id: "nosql-where-operator",
|
|
10243
10261
|
description: "$where — executes arbitrary JavaScript server-side in MongoDB",
|
|
10244
|
-
pattern: RegExp(`\\$where${
|
|
10262
|
+
pattern: RegExp(`\\$where${as}`, "i")
|
|
10245
10263
|
},
|
|
10246
10264
|
{
|
|
10247
10265
|
id: "nosql-ne-operator",
|
|
10248
10266
|
description: "$ne — \"not equal\" operator used to bypass equality checks",
|
|
10249
|
-
pattern: RegExp(`\\$ne${
|
|
10267
|
+
pattern: RegExp(`\\$ne${as}`, "i")
|
|
10250
10268
|
},
|
|
10251
10269
|
{
|
|
10252
10270
|
id: "nosql-gt-operator",
|
|
10253
10271
|
description: "$gt — \"greater than\" used to bypass password/value checks",
|
|
10254
|
-
pattern: RegExp(`\\$gte?${
|
|
10272
|
+
pattern: RegExp(`\\$gte?${as}`, "i")
|
|
10255
10273
|
},
|
|
10256
10274
|
{
|
|
10257
10275
|
id: "nosql-lt-operator",
|
|
10258
10276
|
description: "$lt / $lte — \"less than\" bypass variants",
|
|
10259
|
-
pattern: RegExp(`\\$lte?${
|
|
10277
|
+
pattern: RegExp(`\\$lte?${as}`, "i")
|
|
10260
10278
|
},
|
|
10261
10279
|
{
|
|
10262
10280
|
id: "nosql-regex-operator",
|
|
10263
10281
|
description: "$regex — can be used to extract data character by character (blind injection)",
|
|
10264
|
-
pattern: RegExp(`\\$regex${
|
|
10282
|
+
pattern: RegExp(`\\$regex${as}`, "i")
|
|
10265
10283
|
},
|
|
10266
10284
|
{
|
|
10267
10285
|
id: "nosql-or-operator",
|
|
10268
10286
|
description: "$or — logical OR; used to create always-true conditions",
|
|
10269
|
-
pattern: RegExp(`\\$or${
|
|
10287
|
+
pattern: RegExp(`\\$or${as}\\s*\\[`, "i")
|
|
10270
10288
|
},
|
|
10271
10289
|
{
|
|
10272
10290
|
id: "nosql-and-operator",
|
|
10273
10291
|
description: "$and — logical AND operator injection",
|
|
10274
|
-
pattern: RegExp(`\\$and${
|
|
10292
|
+
pattern: RegExp(`\\$and${as}\\s*\\[`, "i")
|
|
10275
10293
|
},
|
|
10276
10294
|
{
|
|
10277
10295
|
id: "nosql-nor-operator",
|
|
10278
10296
|
description: "$nor — logical NOR operator injection",
|
|
10279
|
-
pattern: RegExp(`\\$nor${
|
|
10297
|
+
pattern: RegExp(`\\$nor${as}\\s*\\[`, "i")
|
|
10280
10298
|
},
|
|
10281
10299
|
{
|
|
10282
10300
|
id: "nosql-exists-operator",
|
|
10283
10301
|
description: "$exists — can enumerate fields to determine schema",
|
|
10284
|
-
pattern: RegExp(`\\$exists${
|
|
10302
|
+
pattern: RegExp(`\\$exists${as}`, "i")
|
|
10285
10303
|
},
|
|
10286
10304
|
{
|
|
10287
10305
|
id: "nosql-in-operator",
|
|
10288
10306
|
description: "$in — matches any value in a list; can enumerate values",
|
|
10289
|
-
pattern: RegExp(`\\$in${
|
|
10307
|
+
pattern: RegExp(`\\$in${as}\\s*\\[`, "i")
|
|
10290
10308
|
},
|
|
10291
10309
|
{
|
|
10292
10310
|
id: "nosql-expr-operator",
|
|
10293
10311
|
description: "$expr — allows aggregation expressions in queries (MongoDB 3.6+)",
|
|
10294
|
-
pattern: RegExp(`\\$expr${
|
|
10312
|
+
pattern: RegExp(`\\$expr${as}`, "i")
|
|
10295
10313
|
},
|
|
10296
10314
|
{
|
|
10297
10315
|
id: "nosql-function-operator",
|
|
10298
10316
|
description: "$function — executes arbitrary JavaScript in MongoDB 4.4+",
|
|
10299
|
-
pattern: RegExp(`\\$function${
|
|
10317
|
+
pattern: RegExp(`\\$function${as}`, "i")
|
|
10300
10318
|
},
|
|
10301
10319
|
{
|
|
10302
10320
|
id: "nosql-accumulator-operator",
|
|
10303
10321
|
description: "$accumulator — custom aggregation with arbitrary JS execution",
|
|
10304
|
-
pattern: RegExp(`\\$accumulator${
|
|
10322
|
+
pattern: RegExp(`\\$accumulator${as}`, "i")
|
|
10305
10323
|
},
|
|
10306
10324
|
{
|
|
10307
10325
|
id: "nosql-proto-pollution",
|
|
@@ -10318,7 +10336,7 @@ var qo = class {
|
|
|
10318
10336
|
description: "[\"__proto__\"] — bracket-notation prototype pollution",
|
|
10319
10337
|
pattern: /\[["']__proto__["']\]/
|
|
10320
10338
|
}
|
|
10321
|
-
],
|
|
10339
|
+
], ss = [
|
|
10322
10340
|
{
|
|
10323
10341
|
id: "log-crlf-injection",
|
|
10324
10342
|
description: "CRLF injection: literal \\r or \\n embeds fake log lines",
|
|
@@ -10379,7 +10397,7 @@ var qo = class {
|
|
|
10379
10397
|
description: "ANSI escape sequence: ESC[ — can manipulate terminal output when logs are tailed",
|
|
10380
10398
|
pattern: /\x1b\[/
|
|
10381
10399
|
}
|
|
10382
|
-
],
|
|
10400
|
+
], cs = [
|
|
10383
10401
|
{
|
|
10384
10402
|
id: "sql-line-comment",
|
|
10385
10403
|
description: "SQL line comment: -- followed by whitespace or end of string",
|
|
@@ -10395,22 +10413,22 @@ var qo = class {
|
|
|
10395
10413
|
description: "Hex-encoded string injection: 0x41414141 style (MySQL)",
|
|
10396
10414
|
pattern: /\b0x[0-9a-f]{4,}/i
|
|
10397
10415
|
}
|
|
10398
|
-
],
|
|
10399
|
-
|
|
10400
|
-
HTML:
|
|
10401
|
-
XML:
|
|
10402
|
-
SVG:
|
|
10403
|
-
SQL:
|
|
10404
|
-
"SQL-STRICT":
|
|
10405
|
-
SHELL:
|
|
10406
|
-
REDOS:
|
|
10407
|
-
NOSQL:
|
|
10408
|
-
LOG:
|
|
10416
|
+
], ls = [...ns, ...cs];
|
|
10417
|
+
$o.label = "HTML", es.label = "XML", ts.label = "SVG", ns.label = "SQL", ls.label = "SQL-STRICT", rs.label = "SHELL", is.label = "REDOS", os.label = "NOSQL", ss.label = "LOG", Object.freeze({
|
|
10418
|
+
HTML: $o,
|
|
10419
|
+
XML: es,
|
|
10420
|
+
SVG: ts,
|
|
10421
|
+
SQL: ns,
|
|
10422
|
+
"SQL-STRICT": ls,
|
|
10423
|
+
SHELL: rs,
|
|
10424
|
+
REDOS: is,
|
|
10425
|
+
NOSQL: os,
|
|
10426
|
+
LOG: ss
|
|
10409
10427
|
});
|
|
10410
|
-
function
|
|
10428
|
+
function us(e) {
|
|
10411
10429
|
if (typeof e != "string") throw TypeError(`is-unsafe: first argument must be a string, got ${typeof e}`);
|
|
10412
10430
|
}
|
|
10413
|
-
function
|
|
10431
|
+
function ds(e) {
|
|
10414
10432
|
if (!(e instanceof RegExp)) {
|
|
10415
10433
|
if (Array.isArray(e)) {
|
|
10416
10434
|
if (e.length === 0) throw TypeError("is-unsafe: context must not be an empty array");
|
|
@@ -10422,7 +10440,7 @@ function ls(e) {
|
|
|
10422
10440
|
throw TypeError(`is-unsafe: second argument must be a PatternList (e.g. HTML), an array of PatternLists (e.g. [HTML, XML]), or a RegExp. Got: ${typeof e}`);
|
|
10423
10441
|
}
|
|
10424
10442
|
}
|
|
10425
|
-
function
|
|
10443
|
+
function fs(e) {
|
|
10426
10444
|
return e instanceof RegExp ? {
|
|
10427
10445
|
lists: null,
|
|
10428
10446
|
regex: e
|
|
@@ -10434,7 +10452,7 @@ function us(e) {
|
|
|
10434
10452
|
regex: null
|
|
10435
10453
|
};
|
|
10436
10454
|
}
|
|
10437
|
-
function
|
|
10455
|
+
function ps(e, t) {
|
|
10438
10456
|
let n = t.label ?? "CUSTOM";
|
|
10439
10457
|
for (let r of t) if (r.pattern.test(e)) return {
|
|
10440
10458
|
context: n,
|
|
@@ -10444,16 +10462,16 @@ function ds(e, t) {
|
|
|
10444
10462
|
};
|
|
10445
10463
|
return null;
|
|
10446
10464
|
}
|
|
10447
|
-
function
|
|
10448
|
-
|
|
10449
|
-
let { lists: n, regex: r } =
|
|
10465
|
+
function ms(e, t) {
|
|
10466
|
+
us(e), ds(t);
|
|
10467
|
+
let { lists: n, regex: r } = fs(t);
|
|
10450
10468
|
if (r) return r.test(e);
|
|
10451
|
-
for (let t of n) if (
|
|
10469
|
+
for (let t of n) if (ps(e, t) !== null) return !0;
|
|
10452
10470
|
return !1;
|
|
10453
10471
|
}
|
|
10454
10472
|
//#endregion
|
|
10455
10473
|
//#region node_modules/.pnpm/fast-xml-parser@5.10.1/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js
|
|
10456
|
-
function
|
|
10474
|
+
function hs(e, t) {
|
|
10457
10475
|
if (!e) return {};
|
|
10458
10476
|
let n = t.attributesGroupName ? e[t.attributesGroupName] : e;
|
|
10459
10477
|
if (!n) return {};
|
|
@@ -10464,7 +10482,7 @@ function ps(e, t) {
|
|
|
10464
10482
|
} else r[e] = n[e];
|
|
10465
10483
|
return r;
|
|
10466
10484
|
}
|
|
10467
|
-
function
|
|
10485
|
+
function gs(e) {
|
|
10468
10486
|
if (!e || typeof e != "string") return;
|
|
10469
10487
|
let t = e.indexOf(":");
|
|
10470
10488
|
if (t !== -1 && t > 0) {
|
|
@@ -10472,14 +10490,14 @@ function ms(e) {
|
|
|
10472
10490
|
if (n !== "xmlns") return n;
|
|
10473
10491
|
}
|
|
10474
10492
|
}
|
|
10475
|
-
var
|
|
10493
|
+
var _s = class {
|
|
10476
10494
|
constructor(e, t) {
|
|
10477
|
-
this.options = e, this.currentNode = null, this.tagsNodeStack = [], this.parseXml =
|
|
10478
|
-
let n = { ...
|
|
10495
|
+
this.options = e, this.currentNode = null, this.tagsNodeStack = [], this.parseXml = Ss, this.parseTextData = vs, this.resolveNameSpace = ys, this.buildAttributesMap = xs, this.isItStopNode = Es, this.replaceEntitiesValue = ws, this.readStopNodeData = js, this.saveTextToParentTag = Ts, this.addChild = Cs, this.ignoreAttributesFn = Jo(this.options.ignoreAttributes), this.entityExpansionCount = 0, this.currentExpandedLength = 0, this.doctypefound = !1;
|
|
10496
|
+
let n = { ...Ua };
|
|
10479
10497
|
this.options.entityDecoder ? this.entityDecoder = this.options.entityDecoder : (typeof this.options.htmlEntities == "object" ? n = this.options.htmlEntities : this.options.htmlEntities === !0 && (n = {
|
|
10480
|
-
...
|
|
10481
|
-
...
|
|
10482
|
-
}), this.entityDecoder = new
|
|
10498
|
+
...Wa,
|
|
10499
|
+
...Ha
|
|
10500
|
+
}), this.entityDecoder = new no({
|
|
10483
10501
|
namedEntities: {
|
|
10484
10502
|
...n,
|
|
10485
10503
|
...t
|
|
@@ -10490,27 +10508,27 @@ var hs = class {
|
|
|
10490
10508
|
maxExpandedLength: this.options.processEntities.maxExpandedLength,
|
|
10491
10509
|
applyLimitsTo: this.options.processEntities.appliesTo
|
|
10492
10510
|
},
|
|
10493
|
-
onInputEntity: (e, t) =>
|
|
10494
|
-
})), this.matcher = new
|
|
10511
|
+
onInputEntity: (e, t) => ms(t, [$o, es]) ? Ga.BLOCK : Ga.ALLOW
|
|
10512
|
+
})), this.matcher = new Qo(), this.readonlyMatcher = this.matcher.readOnly(), this.isCurrentNodeStopNode = !1, this.stopNodeExpressionsSet = new Xo();
|
|
10495
10513
|
let r = this.options.stopNodes;
|
|
10496
10514
|
if (r && r.length > 0) {
|
|
10497
10515
|
for (let e = 0; e < r.length; e++) {
|
|
10498
10516
|
let t = r[e];
|
|
10499
|
-
typeof t == "string" ? this.stopNodeExpressionsSet.add(new
|
|
10517
|
+
typeof t == "string" ? this.stopNodeExpressionsSet.add(new Yo(t)) : t instanceof Yo && this.stopNodeExpressionsSet.add(t);
|
|
10500
10518
|
}
|
|
10501
10519
|
this.stopNodeExpressionsSet.seal();
|
|
10502
10520
|
}
|
|
10503
10521
|
}
|
|
10504
10522
|
};
|
|
10505
|
-
function
|
|
10523
|
+
function vs(e, t, n, r, i, a, o) {
|
|
10506
10524
|
let s = this.options;
|
|
10507
10525
|
if (e !== void 0 && (s.trimValues && !r && (e = e.trim()), e.length > 0)) {
|
|
10508
10526
|
o || (e = this.replaceEntitiesValue(e, t, n));
|
|
10509
10527
|
let r = s.jPath ? n.toString() : n, c = s.tagValueProcessor(t, e, r, i, a);
|
|
10510
|
-
return c == null ? e : typeof c != typeof e || c !== e ? c : s.trimValues || e.trim() === e ?
|
|
10528
|
+
return c == null ? e : typeof c != typeof e || c !== e ? c : s.trimValues || e.trim() === e ? Ms(e, s.parseTagValue, s.numberParseOptions) : e;
|
|
10511
10529
|
}
|
|
10512
10530
|
}
|
|
10513
|
-
function
|
|
10531
|
+
function ys(e) {
|
|
10514
10532
|
if (this.options.removeNSPrefix) {
|
|
10515
10533
|
let t = e.split(":"), n = e.charAt(0) === "/" ? "/" : "";
|
|
10516
10534
|
if (t[0] === "xmlns") return "";
|
|
@@ -10518,11 +10536,11 @@ function _s(e) {
|
|
|
10518
10536
|
}
|
|
10519
10537
|
return e;
|
|
10520
10538
|
}
|
|
10521
|
-
var
|
|
10522
|
-
function
|
|
10539
|
+
var bs = /* @__PURE__ */ RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?", "gm");
|
|
10540
|
+
function xs(e, t, n, r = !1) {
|
|
10523
10541
|
let i = this.options;
|
|
10524
10542
|
if (r === !0 || i.ignoreAttributes !== !0 && typeof e == "string") {
|
|
10525
|
-
let r =
|
|
10543
|
+
let r = xa(e, bs), a = r.length, o = {}, s = Array(a), c = !1, l = {};
|
|
10526
10544
|
for (let e = 0; e < a; e++) {
|
|
10527
10545
|
let t = this.resolveNameSpace(r[e][1]), a = r[e][4];
|
|
10528
10546
|
if (t.length && a !== void 0) {
|
|
@@ -10537,9 +10555,9 @@ function ys(e, t, n, r = !1) {
|
|
|
10537
10555
|
if (this.ignoreAttributesFn(t, u)) continue;
|
|
10538
10556
|
let n = i.attributeNamePrefix + t;
|
|
10539
10557
|
if (t.length) {
|
|
10540
|
-
if (i.transformAttributeName && (n = i.transformAttributeName(n)), n =
|
|
10558
|
+
if (i.transformAttributeName && (n = i.transformAttributeName(n)), n = Ps(n, i), r[e][4] !== void 0) {
|
|
10541
10559
|
let r = s[e], a = i.attributeValueProcessor(t, r, u);
|
|
10542
|
-
a == null ? o[n] = r : typeof a != typeof r || a !== r ? o[n] = a : o[n] =
|
|
10560
|
+
a == null ? o[n] = r : typeof a != typeof r || a !== r ? o[n] = a : o[n] = Ms(r, i.parseAttributeValue, i.numberParseOptions), d = !0;
|
|
10543
10561
|
} else i.allowBooleanAttributes && (o[n] = !0, d = !0);
|
|
10544
10562
|
}
|
|
10545
10563
|
}
|
|
@@ -10551,25 +10569,25 @@ function ys(e, t, n, r = !1) {
|
|
|
10551
10569
|
return o;
|
|
10552
10570
|
}
|
|
10553
10571
|
}
|
|
10554
|
-
var
|
|
10572
|
+
var Ss = function(e) {
|
|
10555
10573
|
e = e.replace(/\r\n?/g, "\n");
|
|
10556
|
-
let t = new
|
|
10574
|
+
let t = new lo("!xml"), n = t, r = "";
|
|
10557
10575
|
this.matcher.reset(), this.entityDecoder.reset(), this.entityExpansionCount = 0, this.currentExpandedLength = 0, this.doctypefound = !1;
|
|
10558
|
-
let i = this.options, a = new
|
|
10576
|
+
let i = this.options, a = new Co(i.processEntities), o = e.length;
|
|
10559
10577
|
for (let s = 0; s < o; s++) if (e[s] === "<") {
|
|
10560
10578
|
let c = e.charCodeAt(s + 1);
|
|
10561
10579
|
if (c === 47) {
|
|
10562
|
-
let t =
|
|
10580
|
+
let t = Os(e, ">", s, "Closing Tag is not closed."), a = e.substring(s + 2, t).trim();
|
|
10563
10581
|
if (i.removeNSPrefix) {
|
|
10564
10582
|
let e = a.indexOf(":");
|
|
10565
10583
|
e !== -1 && (a = a.substr(e + 1));
|
|
10566
10584
|
}
|
|
10567
|
-
a =
|
|
10585
|
+
a = Ns(i.transformTagName, a, "", i).tagName, n && (r = this.saveTextToParentTag(r, n, this.readonlyMatcher));
|
|
10568
10586
|
let o = this.matcher.getCurrentTag();
|
|
10569
10587
|
if (a && i.unpairedTagsSet.has(a)) throw Error(`Unpaired tag can not be used as closing tag: </${a}>`);
|
|
10570
10588
|
o && i.unpairedTagsSet.has(o) && (this.matcher.pop(), this.tagsNodeStack.pop()), this.matcher.pop(), this.isCurrentNodeStopNode = !1, n = this.tagsNodeStack.pop(), r = "", s = t;
|
|
10571
10589
|
} else if (c === 63) {
|
|
10572
|
-
let t =
|
|
10590
|
+
let t = As(e, s, !1, "?>");
|
|
10573
10591
|
if (!t) throw Error("Pi Tag is not closed.");
|
|
10574
10592
|
r = this.saveTextToParentTag(r, n, this.readonlyMatcher);
|
|
10575
10593
|
let o = this.buildAttributesMap(t.tagExp, this.matcher, t.tagName, !0);
|
|
@@ -10578,12 +10596,12 @@ var bs = function(e) {
|
|
|
10578
10596
|
this.entityDecoder.setXmlVersion(Number(e) || 1), a.setXmlVersion(Number(e) || 1);
|
|
10579
10597
|
}
|
|
10580
10598
|
if (!(i.ignoreDeclaration && t.tagName === "?xml" || i.ignorePiTags)) {
|
|
10581
|
-
let e = new
|
|
10599
|
+
let e = new lo(t.tagName);
|
|
10582
10600
|
e.add(i.textNodeName, ""), t.tagName !== t.tagExp && t.attrExpPresent && i.ignoreAttributes !== !0 && (e[":@"] = o), this.addChild(n, e, this.readonlyMatcher, s);
|
|
10583
10601
|
}
|
|
10584
10602
|
s = t.closeIndex + 1;
|
|
10585
10603
|
} else if (c === 33 && e.charCodeAt(s + 2) === 45 && e.charCodeAt(s + 3) === 45) {
|
|
10586
|
-
let t =
|
|
10604
|
+
let t = Os(e, "-->", s + 4, "Comment is not closed.");
|
|
10587
10605
|
if (i.commentPropName) {
|
|
10588
10606
|
let a = e.substring(s + 4, t - 2);
|
|
10589
10607
|
r = this.saveTextToParentTag(r, n, this.readonlyMatcher), n.add(i.commentPropName, [{ [i.textNodeName]: a }]);
|
|
@@ -10595,25 +10613,25 @@ var bs = function(e) {
|
|
|
10595
10613
|
let t = a.readDocType(e, s);
|
|
10596
10614
|
this.entityDecoder.addInputEntities(t.entities), s = t.i;
|
|
10597
10615
|
} else if (c === 33 && e.charCodeAt(s + 2) === 91) {
|
|
10598
|
-
let t =
|
|
10616
|
+
let t = Os(e, "]]>", s, "CDATA is not closed.") - 2, a = e.substring(s + 9, t);
|
|
10599
10617
|
r = this.saveTextToParentTag(r, n, this.readonlyMatcher);
|
|
10600
10618
|
let o = this.parseTextData(a, n.tagname, this.readonlyMatcher, !0, !1, !0, !0);
|
|
10601
10619
|
o ??= "", i.cdataPropName ? n.add(i.cdataPropName, [{ [i.textNodeName]: a }]) : n.add(i.textNodeName, o), s = t + 2;
|
|
10602
10620
|
} else {
|
|
10603
|
-
let a =
|
|
10621
|
+
let a = As(e, s, i.removeNSPrefix);
|
|
10604
10622
|
if (!a) {
|
|
10605
10623
|
let t = e.substring(Math.max(0, s - 50), Math.min(o, s + 50));
|
|
10606
10624
|
throw Error(`readTagExp returned undefined at position ${s}. Context: "${t}"`);
|
|
10607
10625
|
}
|
|
10608
10626
|
let c = a.tagName, l = a.rawTagName, u = a.tagExp, d = a.attrExpPresent, f = a.closeIndex;
|
|
10609
|
-
if ({tagName: c, tagExp: u} =
|
|
10627
|
+
if ({tagName: c, tagExp: u} = Ns(i.transformTagName, c, u, i), i.strictReservedNames && (c === i.commentPropName || c === i.cdataPropName || c === i.textNodeName || c === i.attributesGroupName)) throw Error(`Invalid tag name: ${c}`);
|
|
10610
10628
|
n && r && n.tagname !== "!xml" && (r = this.saveTextToParentTag(r, n, this.readonlyMatcher, !1));
|
|
10611
10629
|
let p = n;
|
|
10612
10630
|
p && i.unpairedTagsSet.has(p.tagname) && (n = this.tagsNodeStack.pop(), this.matcher.pop());
|
|
10613
10631
|
let m = !1;
|
|
10614
10632
|
u.length > 0 && u.lastIndexOf("/") === u.length - 1 && (m = !0, c[c.length - 1] === "/" ? (c = c.substr(0, c.length - 1), u = c) : u = u.substr(0, u.length - 1), d = c !== u);
|
|
10615
10633
|
let h = null, g;
|
|
10616
|
-
g =
|
|
10634
|
+
g = gs(l), c !== t.tagname && this.matcher.push(c, {}, g), c !== u && d && (h = this.buildAttributesMap(u, this.matcher, c), h && hs(h, i)), c !== t.tagname && (this.isCurrentNodeStopNode = this.isItStopNode());
|
|
10617
10635
|
let _ = s;
|
|
10618
10636
|
if (this.isCurrentNodeStopNode) {
|
|
10619
10637
|
let t = "";
|
|
@@ -10624,19 +10642,19 @@ var bs = function(e) {
|
|
|
10624
10642
|
if (!n) throw Error(`Unexpected end of ${l}`);
|
|
10625
10643
|
s = n.i, t = n.tagContent;
|
|
10626
10644
|
}
|
|
10627
|
-
let r = new
|
|
10645
|
+
let r = new lo(c);
|
|
10628
10646
|
h && (r[":@"] = h), r.add(i.textNodeName, t), this.matcher.pop(), this.isCurrentNodeStopNode = !1, this.addChild(n, r, this.readonlyMatcher, _);
|
|
10629
10647
|
} else {
|
|
10630
10648
|
if (m) {
|
|
10631
|
-
({tagName: c, tagExp: u} =
|
|
10632
|
-
let e = new
|
|
10649
|
+
({tagName: c, tagExp: u} = Ns(i.transformTagName, c, u, i));
|
|
10650
|
+
let e = new lo(c);
|
|
10633
10651
|
h && (e[":@"] = h), this.addChild(n, e, this.readonlyMatcher, _), this.matcher.pop(), this.isCurrentNodeStopNode = !1;
|
|
10634
10652
|
} else if (i.unpairedTagsSet.has(c)) {
|
|
10635
|
-
let e = new
|
|
10653
|
+
let e = new lo(c);
|
|
10636
10654
|
h && (e[":@"] = h), this.addChild(n, e, this.readonlyMatcher, _), this.matcher.pop(), this.isCurrentNodeStopNode = !1, s = a.closeIndex;
|
|
10637
10655
|
continue;
|
|
10638
10656
|
} else {
|
|
10639
|
-
let e = new
|
|
10657
|
+
let e = new lo(c);
|
|
10640
10658
|
if (this.tagsNodeStack.length > i.maxNestedTags) throw Error("Maximum nested tags exceeded");
|
|
10641
10659
|
this.tagsNodeStack.push(n), h && (e[":@"] = h), this.addChild(n, e, this.readonlyMatcher, _), n = e;
|
|
10642
10660
|
}
|
|
@@ -10646,12 +10664,12 @@ var bs = function(e) {
|
|
|
10646
10664
|
} else r += e[s];
|
|
10647
10665
|
return t.child;
|
|
10648
10666
|
};
|
|
10649
|
-
function
|
|
10667
|
+
function Cs(e, t, n, r) {
|
|
10650
10668
|
this.options.captureMetaData || (r = void 0);
|
|
10651
10669
|
let i = this.options.jPath ? n.toString() : n, a = this.options.updateTag(t.tagname, i, t[":@"]);
|
|
10652
10670
|
a === !1 || (typeof a == "string" && (t.tagname = a), e.addChild(t, r));
|
|
10653
10671
|
}
|
|
10654
|
-
function
|
|
10672
|
+
function ws(e, t, n) {
|
|
10655
10673
|
let r = this.options.processEntities;
|
|
10656
10674
|
if (!r || !r.enabled) return e;
|
|
10657
10675
|
if (r.allowedTags) {
|
|
@@ -10664,13 +10682,13 @@ function Ss(e, t, n) {
|
|
|
10664
10682
|
}
|
|
10665
10683
|
return this.entityDecoder.decode(e);
|
|
10666
10684
|
}
|
|
10667
|
-
function
|
|
10685
|
+
function Ts(e, t, n, r) {
|
|
10668
10686
|
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;
|
|
10669
10687
|
}
|
|
10670
|
-
function
|
|
10688
|
+
function Es() {
|
|
10671
10689
|
return this.stopNodeExpressionsSet.size !== 0 && this.matcher.matchesAny(this.stopNodeExpressionsSet);
|
|
10672
10690
|
}
|
|
10673
|
-
function
|
|
10691
|
+
function Ds(e, t, n = ">") {
|
|
10674
10692
|
let r = 0, i = e.length, a = n.charCodeAt(0), o = n.length > 1 ? n.charCodeAt(1) : -1, s = "", c = t;
|
|
10675
10693
|
for (let n = t; n < i; n++) {
|
|
10676
10694
|
let t = e.charCodeAt(n);
|
|
@@ -10689,18 +10707,18 @@ function Ts(e, t, n = ">") {
|
|
|
10689
10707
|
} else t === 9 && !r && (s += e.substring(c, n) + " ", c = n + 1);
|
|
10690
10708
|
}
|
|
10691
10709
|
}
|
|
10692
|
-
function
|
|
10710
|
+
function Os(e, t, n, r) {
|
|
10693
10711
|
let i = e.indexOf(t, n);
|
|
10694
10712
|
if (i === -1) throw Error(r);
|
|
10695
10713
|
return i + t.length - 1;
|
|
10696
10714
|
}
|
|
10697
|
-
function
|
|
10715
|
+
function ks(e, t, n, r) {
|
|
10698
10716
|
let i = e.indexOf(t, n);
|
|
10699
10717
|
if (i === -1) throw Error(r);
|
|
10700
10718
|
return i;
|
|
10701
10719
|
}
|
|
10702
|
-
function
|
|
10703
|
-
let i =
|
|
10720
|
+
function As(e, t, n, r = ">") {
|
|
10721
|
+
let i = Ds(e, t + 1, r);
|
|
10704
10722
|
if (!i) return;
|
|
10705
10723
|
let a = i.data, o = i.index, s = a.search(/\s/), c = a, l = !0;
|
|
10706
10724
|
s !== -1 && (c = a.substring(0, s), a = a.substring(s + 1).trimStart());
|
|
@@ -10717,51 +10735,51 @@ function Os(e, t, n, r = ">") {
|
|
|
10717
10735
|
rawTagName: u
|
|
10718
10736
|
};
|
|
10719
10737
|
}
|
|
10720
|
-
function
|
|
10738
|
+
function js(e, t, n) {
|
|
10721
10739
|
let r = n, i = 1, a = e.length;
|
|
10722
10740
|
for (; n < a; n++) if (e[n] === "<") {
|
|
10723
10741
|
let a = e.charCodeAt(n + 1);
|
|
10724
10742
|
if (a === 47) {
|
|
10725
|
-
let a =
|
|
10743
|
+
let a = ks(e, ">", n, `${t} is not closed`);
|
|
10726
10744
|
if (e.substring(n + 2, a).trim() === t && (i--, i === 0)) return {
|
|
10727
10745
|
tagContent: e.substring(r, n),
|
|
10728
10746
|
i: a
|
|
10729
10747
|
};
|
|
10730
10748
|
n = a;
|
|
10731
|
-
} else if (a === 63) n =
|
|
10732
|
-
else if (a === 33 && e.charCodeAt(n + 2) === 45 && e.charCodeAt(n + 3) === 45) n =
|
|
10733
|
-
else if (a === 33 && e.charCodeAt(n + 2) === 91) n =
|
|
10749
|
+
} else if (a === 63) n = Os(e, "?>", n + 1, "StopNode is not closed.");
|
|
10750
|
+
else if (a === 33 && e.charCodeAt(n + 2) === 45 && e.charCodeAt(n + 3) === 45) n = Os(e, "-->", n + 3, "StopNode is not closed.");
|
|
10751
|
+
else if (a === 33 && e.charCodeAt(n + 2) === 91) n = Os(e, "]]>", n, "StopNode is not closed.") - 2;
|
|
10734
10752
|
else {
|
|
10735
|
-
let r =
|
|
10753
|
+
let r = As(e, n, !1);
|
|
10736
10754
|
r && ((r && r.tagName) === t && r.tagExp[r.tagExp.length - 1] !== "/" && i++, n = r.closeIndex);
|
|
10737
10755
|
}
|
|
10738
10756
|
}
|
|
10739
10757
|
}
|
|
10740
|
-
function
|
|
10758
|
+
function Ms(e, t, n) {
|
|
10741
10759
|
if (t && typeof e == "string") {
|
|
10742
10760
|
let t = e.trim();
|
|
10743
|
-
return t === "true" || t !== "false" &&
|
|
10761
|
+
return t === "true" || t !== "false" && Ho(e, n);
|
|
10744
10762
|
}
|
|
10745
|
-
return
|
|
10763
|
+
return Ca(e) ? e : "";
|
|
10746
10764
|
}
|
|
10747
|
-
function
|
|
10765
|
+
function Ns(e, t, n, r) {
|
|
10748
10766
|
if (e) {
|
|
10749
10767
|
let r = e(t);
|
|
10750
10768
|
n === t && (n = r), t = r;
|
|
10751
10769
|
}
|
|
10752
|
-
return t =
|
|
10770
|
+
return t = Ps(t, r), {
|
|
10753
10771
|
tagName: t,
|
|
10754
10772
|
tagExp: n
|
|
10755
10773
|
};
|
|
10756
10774
|
}
|
|
10757
|
-
function
|
|
10758
|
-
if (
|
|
10759
|
-
return
|
|
10775
|
+
function Ps(e, t) {
|
|
10776
|
+
if (Ta.includes(e)) throw Error(`[SECURITY] Invalid name: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`);
|
|
10777
|
+
return wa.includes(e) ? t.onDangerousProperty(e) : e;
|
|
10760
10778
|
}
|
|
10761
10779
|
//#endregion
|
|
10762
10780
|
//#region node_modules/.pnpm/fast-xml-parser@5.10.1/node_modules/fast-xml-parser/src/xmlparser/node2json.js
|
|
10763
|
-
var
|
|
10764
|
-
function
|
|
10781
|
+
var Fs = lo.getMetaDataSymbol();
|
|
10782
|
+
function Is(e, t) {
|
|
10765
10783
|
if (!e || typeof e != "object") return {};
|
|
10766
10784
|
if (!t) return e;
|
|
10767
10785
|
let n = {};
|
|
@@ -10771,22 +10789,22 @@ function Ps(e, t) {
|
|
|
10771
10789
|
} else n[r] = e[r];
|
|
10772
10790
|
return n;
|
|
10773
10791
|
}
|
|
10774
|
-
function
|
|
10775
|
-
return
|
|
10792
|
+
function Ls(e, t, n, r) {
|
|
10793
|
+
return Rs(e, t, n, r);
|
|
10776
10794
|
}
|
|
10777
|
-
function
|
|
10795
|
+
function Rs(e, t, n, r) {
|
|
10778
10796
|
let i, a = {};
|
|
10779
10797
|
for (let o = 0; o < e.length; o++) {
|
|
10780
|
-
let s = e[o], c =
|
|
10798
|
+
let s = e[o], c = zs(s);
|
|
10781
10799
|
if (c !== void 0 && c !== t.textNodeName) {
|
|
10782
|
-
let e =
|
|
10800
|
+
let e = Is(s[":@"] || {}, t.attributeNamePrefix);
|
|
10783
10801
|
n.push(c, e);
|
|
10784
10802
|
}
|
|
10785
10803
|
if (c === t.textNodeName) i === void 0 ? i = s[c] : i += "" + s[c];
|
|
10786
10804
|
else if (c === void 0) continue;
|
|
10787
10805
|
else if (s[c]) {
|
|
10788
|
-
let e =
|
|
10789
|
-
if (Object.keys(e).length === 0 && t.alwaysCreateTextNode && (e[t.textNodeName] = ""), s[":@"] ?
|
|
10806
|
+
let e = Rs(s[c], t, n, r), i = Vs(e, t);
|
|
10807
|
+
if (Object.keys(e).length === 0 && t.alwaysCreateTextNode && (e[t.textNodeName] = ""), s[":@"] ? Bs(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[Fs] !== void 0 && typeof e == "object" && e && (e[Fs] = s[Fs]), a[c] !== void 0 && Object.prototype.hasOwnProperty.call(a, c)) Array.isArray(a[c]) || (a[c] = [a[c]]), a[c].push(e);
|
|
10790
10808
|
else {
|
|
10791
10809
|
let n = t.jPath ? r.toString() : r;
|
|
10792
10810
|
a[c] = t.isArray(c, n, i) ? [e] : e;
|
|
@@ -10796,14 +10814,14 @@ function Is(e, t, n, r) {
|
|
|
10796
10814
|
}
|
|
10797
10815
|
return typeof i == "string" ? i.length > 0 && (a[t.textNodeName] = i) : i !== void 0 && (a[t.textNodeName] = i), a;
|
|
10798
10816
|
}
|
|
10799
|
-
function
|
|
10817
|
+
function zs(e) {
|
|
10800
10818
|
let t = Object.keys(e);
|
|
10801
10819
|
for (let e = 0; e < t.length; e++) {
|
|
10802
10820
|
let n = t[e];
|
|
10803
10821
|
if (n !== ":@") return n;
|
|
10804
10822
|
}
|
|
10805
10823
|
}
|
|
10806
|
-
function
|
|
10824
|
+
function Bs(e, t, n, r) {
|
|
10807
10825
|
if (t) {
|
|
10808
10826
|
let i = Object.keys(t), a = i.length;
|
|
10809
10827
|
for (let o = 0; o < a; o++) {
|
|
@@ -10812,26 +10830,26 @@ function Rs(e, t, n, r) {
|
|
|
10812
10830
|
}
|
|
10813
10831
|
}
|
|
10814
10832
|
}
|
|
10815
|
-
function
|
|
10833
|
+
function Vs(e, t) {
|
|
10816
10834
|
let { textNodeName: n } = t, r = Object.keys(e).length;
|
|
10817
10835
|
return !!(r === 0 || r === 1 && (e[n] || typeof e[n] == "boolean" || e[n] === 0));
|
|
10818
10836
|
}
|
|
10819
10837
|
//#endregion
|
|
10820
10838
|
//#region node_modules/.pnpm/fast-xml-parser@5.10.1/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js
|
|
10821
|
-
var
|
|
10839
|
+
var Hs = class {
|
|
10822
10840
|
constructor(e) {
|
|
10823
|
-
this.externalEntities = {}, this.options =
|
|
10841
|
+
this.externalEntities = {}, this.options = so(e);
|
|
10824
10842
|
}
|
|
10825
10843
|
parse(e, t) {
|
|
10826
10844
|
if (typeof e != "string" && e.toString) e = e.toString();
|
|
10827
10845
|
else if (typeof e != "string") throw Error("XML data is accepted in String or Bytes[] form.");
|
|
10828
10846
|
if (t) {
|
|
10829
10847
|
t === !0 && (t = {});
|
|
10830
|
-
let n =
|
|
10848
|
+
let n = Da(e, t);
|
|
10831
10849
|
if (n !== !0) throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`);
|
|
10832
10850
|
}
|
|
10833
|
-
let n = new
|
|
10834
|
-
return this.options.preserveOrder || r === void 0 ? r :
|
|
10851
|
+
let n = new _s(this.options, this.externalEntities), r = n.parseXml(e);
|
|
10852
|
+
return this.options.preserveOrder || r === void 0 ? r : Ls(r, this.options, n.matcher, n.readonlyMatcher);
|
|
10835
10853
|
}
|
|
10836
10854
|
addEntity(e, t) {
|
|
10837
10855
|
if (t.indexOf("&") !== -1) throw Error("Entity value can't have '&'");
|
|
@@ -10840,27 +10858,27 @@ var Bs = class {
|
|
|
10840
10858
|
this.externalEntities[e] = t;
|
|
10841
10859
|
}
|
|
10842
10860
|
static getMetaDataSymbol() {
|
|
10843
|
-
return
|
|
10861
|
+
return lo.getMetaDataSymbol();
|
|
10844
10862
|
}
|
|
10845
10863
|
};
|
|
10846
10864
|
//#endregion
|
|
10847
10865
|
//#region node_modules/.pnpm/fast-xml-builder@1.3.0/node_modules/fast-xml-builder/src/util.js
|
|
10848
|
-
function
|
|
10866
|
+
function Us(e) {
|
|
10849
10867
|
return String(e).replace(/--/g, "- -").replace(/--/g, "- -").replace(/-$/, "- ");
|
|
10850
10868
|
}
|
|
10851
|
-
function
|
|
10869
|
+
function Ws(e) {
|
|
10852
10870
|
return String(e).replace(/\]\]>/g, "]]]]><![CDATA[>");
|
|
10853
10871
|
}
|
|
10854
|
-
function
|
|
10872
|
+
function Gs(e) {
|
|
10855
10873
|
return String(e).replace(/"/g, """).replace(/'/g, "'");
|
|
10856
10874
|
}
|
|
10857
10875
|
//#endregion
|
|
10858
10876
|
//#region node_modules/.pnpm/fast-xml-builder@1.3.0/node_modules/fast-xml-builder/src/orderedJs2Xml.js
|
|
10859
|
-
var
|
|
10860
|
-
function
|
|
10877
|
+
var Ks = "\n";
|
|
10878
|
+
function qs(e, t) {
|
|
10861
10879
|
if (!Array.isArray(e) || e.length === 0) return "1.0";
|
|
10862
10880
|
let n = e[0];
|
|
10863
|
-
if (
|
|
10881
|
+
if (ec(n) === "?xml") {
|
|
10864
10882
|
let e = n[":@"];
|
|
10865
10883
|
if (e) {
|
|
10866
10884
|
let n = t.attributeNamePrefix + "version";
|
|
@@ -10869,124 +10887,124 @@ function Gs(e, t) {
|
|
|
10869
10887
|
}
|
|
10870
10888
|
return "1.0";
|
|
10871
10889
|
}
|
|
10872
|
-
function
|
|
10890
|
+
function Js(e, t, n, r, i) {
|
|
10873
10891
|
return !n.sanitizeName || i(e) ? e : n.sanitizeName(e, {
|
|
10874
10892
|
isAttribute: t,
|
|
10875
10893
|
matcher: r.readOnly()
|
|
10876
10894
|
});
|
|
10877
10895
|
}
|
|
10878
|
-
function
|
|
10896
|
+
function Ys(e, t) {
|
|
10879
10897
|
let n = "";
|
|
10880
|
-
t.format && (n =
|
|
10898
|
+
t.format && (n = Ks);
|
|
10881
10899
|
let r = [];
|
|
10882
10900
|
if (t.stopNodes && Array.isArray(t.stopNodes)) for (let e = 0; e < t.stopNodes.length; e++) {
|
|
10883
10901
|
let n = t.stopNodes[e];
|
|
10884
|
-
typeof n == "string" ? r.push(new
|
|
10902
|
+
typeof n == "string" ? r.push(new Yo(n)) : n instanceof Yo && r.push(n);
|
|
10885
10903
|
}
|
|
10886
|
-
let i =
|
|
10887
|
-
return
|
|
10904
|
+
let i = So("qName", { xmlVersion: qs(e, t) }), a = new Qo();
|
|
10905
|
+
return Xs(e, t, n, a, r, i);
|
|
10888
10906
|
}
|
|
10889
|
-
function
|
|
10907
|
+
function Xs(e, t, n, r, i, a) {
|
|
10890
10908
|
let o = "", s = !1;
|
|
10891
10909
|
if (t.maxNestedTags && r.getDepth() > t.maxNestedTags) throw Error("Maximum nested tags exceeded");
|
|
10892
10910
|
if (!Array.isArray(e)) {
|
|
10893
10911
|
if (e != null) {
|
|
10894
10912
|
let n = e.toString();
|
|
10895
|
-
return n =
|
|
10913
|
+
return n = rc(n, t), n;
|
|
10896
10914
|
}
|
|
10897
10915
|
return "";
|
|
10898
10916
|
}
|
|
10899
10917
|
for (let c = 0; c < e.length; c++) {
|
|
10900
|
-
let l = e[c], u =
|
|
10918
|
+
let l = e[c], u = ec(l);
|
|
10901
10919
|
if (u === void 0) continue;
|
|
10902
|
-
let d = u === t.textNodeName || u === t.cdataPropName || u === t.commentPropName || u[0] === "?" ? u :
|
|
10920
|
+
let d = u === t.textNodeName || u === t.cdataPropName || u === t.commentPropName || u[0] === "?" ? u : Js(u, !1, t, r, a), f = Zs(l[":@"], t);
|
|
10903
10921
|
r.push(d, f);
|
|
10904
|
-
let p =
|
|
10922
|
+
let p = nc(r, i);
|
|
10905
10923
|
if (d === t.textNodeName) {
|
|
10906
10924
|
let e = l[u];
|
|
10907
|
-
p || (e = t.tagValueProcessor(d, e), e =
|
|
10925
|
+
p || (e = t.tagValueProcessor(d, e), e = rc(e, t)), s && (o += n), o += e, s = !1, r.pop();
|
|
10908
10926
|
continue;
|
|
10909
10927
|
}
|
|
10910
10928
|
if (d === t.cdataPropName) {
|
|
10911
10929
|
s && (o += n);
|
|
10912
|
-
let e = l[u][0][t.textNodeName], i =
|
|
10930
|
+
let e = l[u][0][t.textNodeName], i = Ws(e);
|
|
10913
10931
|
o += `<![CDATA[${i}]]>`, s = !1, r.pop();
|
|
10914
10932
|
continue;
|
|
10915
10933
|
}
|
|
10916
10934
|
if (d === t.commentPropName) {
|
|
10917
|
-
let e = l[u][0][t.textNodeName], i =
|
|
10935
|
+
let e = l[u][0][t.textNodeName], i = Us(e);
|
|
10918
10936
|
o += n + `<!--${i}-->`, s = !0, r.pop();
|
|
10919
10937
|
continue;
|
|
10920
10938
|
}
|
|
10921
10939
|
if (d[0] === "?") {
|
|
10922
|
-
let e =
|
|
10940
|
+
let e = tc(l[":@"], t, p, r, a);
|
|
10923
10941
|
o += (d === "?xml" ? "" : n) + `<${d}${e}?>`, s = !0, r.pop();
|
|
10924
10942
|
continue;
|
|
10925
10943
|
}
|
|
10926
10944
|
let m = n;
|
|
10927
10945
|
m !== "" && (m += t.indentBy);
|
|
10928
|
-
let h = n + `<${d}${
|
|
10929
|
-
g = p ?
|
|
10946
|
+
let h = n + `<${d}${tc(l[":@"], t, p, r, a)}`, g;
|
|
10947
|
+
g = p ? Qs(l[u], t) : Xs(l[u], t, m, r, i, a), t.unpairedTags.indexOf(d) === -1 ? (!g || g.length === 0) && t.suppressEmptyNode ? o += h + "/>" : g && g.endsWith(">") ? o += h + `>${g}${n}</${d}>` : (o += h + ">", g && n !== "" && (g.includes("/>") || g.includes("</")) ? o += n + t.indentBy + g + n : o += g, o += `</${d}>`) : t.suppressUnpairedNode ? o += h + ">" : o += h + "/>", s = !0, r.pop();
|
|
10930
10948
|
}
|
|
10931
10949
|
return o;
|
|
10932
10950
|
}
|
|
10933
|
-
function
|
|
10951
|
+
function Zs(e, t) {
|
|
10934
10952
|
if (!e || t.ignoreAttributes) return null;
|
|
10935
10953
|
let n = {}, r = !1;
|
|
10936
10954
|
for (let i in e) {
|
|
10937
10955
|
if (!Object.prototype.hasOwnProperty.call(e, i)) continue;
|
|
10938
10956
|
let a = i.startsWith(t.attributeNamePrefix) ? i.substr(t.attributeNamePrefix.length) : i;
|
|
10939
|
-
n[a] =
|
|
10957
|
+
n[a] = Gs(e[i]), r = !0;
|
|
10940
10958
|
}
|
|
10941
10959
|
return r ? n : null;
|
|
10942
10960
|
}
|
|
10943
|
-
function
|
|
10961
|
+
function Qs(e, t) {
|
|
10944
10962
|
if (!Array.isArray(e)) return e == null ? "" : e.toString();
|
|
10945
10963
|
let n = "";
|
|
10946
10964
|
for (let r = 0; r < e.length; r++) {
|
|
10947
|
-
let i = e[r], a =
|
|
10965
|
+
let i = e[r], a = ec(i);
|
|
10948
10966
|
if (a === t.textNodeName) n += i[a];
|
|
10949
10967
|
else if (a === t.cdataPropName) n += i[a][0][t.textNodeName];
|
|
10950
10968
|
else if (a === t.commentPropName) n += i[a][0][t.textNodeName];
|
|
10951
10969
|
else if (a && a[0] === "?") continue;
|
|
10952
10970
|
else if (a) {
|
|
10953
|
-
let e =
|
|
10971
|
+
let e = $s(i[":@"], t), r = Qs(i[a], t);
|
|
10954
10972
|
!r || r.length === 0 ? n += `<${a}${e}/>` : n += `<${a}${e}>${r}</${a}>`;
|
|
10955
10973
|
}
|
|
10956
10974
|
}
|
|
10957
10975
|
return n;
|
|
10958
10976
|
}
|
|
10959
|
-
function
|
|
10977
|
+
function $s(e, t) {
|
|
10960
10978
|
let n = "";
|
|
10961
10979
|
if (e && !t.ignoreAttributes) for (let r in e) {
|
|
10962
10980
|
if (!Object.prototype.hasOwnProperty.call(e, r)) continue;
|
|
10963
10981
|
let i = e[r];
|
|
10964
|
-
i === !0 && t.suppressBooleanAttributes ? n += ` ${r.substr(t.attributeNamePrefix.length)}` : n += ` ${r.substr(t.attributeNamePrefix.length)}="${
|
|
10982
|
+
i === !0 && t.suppressBooleanAttributes ? n += ` ${r.substr(t.attributeNamePrefix.length)}` : n += ` ${r.substr(t.attributeNamePrefix.length)}="${Gs(i)}"`;
|
|
10965
10983
|
}
|
|
10966
10984
|
return n;
|
|
10967
10985
|
}
|
|
10968
|
-
function
|
|
10986
|
+
function ec(e) {
|
|
10969
10987
|
let t = Object.keys(e);
|
|
10970
10988
|
for (let n = 0; n < t.length; n++) {
|
|
10971
10989
|
let r = t[n];
|
|
10972
10990
|
if (Object.prototype.hasOwnProperty.call(e, r) && r !== ":@") return r;
|
|
10973
10991
|
}
|
|
10974
10992
|
}
|
|
10975
|
-
function
|
|
10993
|
+
function tc(e, t, n, r, i) {
|
|
10976
10994
|
let a = "";
|
|
10977
10995
|
if (e && !t.ignoreAttributes) for (let o in e) {
|
|
10978
10996
|
if (!Object.prototype.hasOwnProperty.call(e, o)) continue;
|
|
10979
|
-
let s = o.substr(t.attributeNamePrefix.length), c = n ? s :
|
|
10980
|
-
n ? l = e[o] : (l = t.attributeValueProcessor(o, e[o]), l =
|
|
10997
|
+
let s = o.substr(t.attributeNamePrefix.length), c = n ? s : Js(s, !0, t, r, i), l;
|
|
10998
|
+
n ? l = e[o] : (l = t.attributeValueProcessor(o, e[o]), l = rc(l, t)), l === !0 && t.suppressBooleanAttributes ? a += ` ${c}` : a += ` ${c}="${Gs(l)}"`;
|
|
10981
10999
|
}
|
|
10982
11000
|
return a;
|
|
10983
11001
|
}
|
|
10984
|
-
function
|
|
11002
|
+
function nc(e, t) {
|
|
10985
11003
|
if (!t || t.length === 0) return !1;
|
|
10986
11004
|
for (let n = 0; n < t.length; n++) if (e.matches(t[n])) return !0;
|
|
10987
11005
|
return !1;
|
|
10988
11006
|
}
|
|
10989
|
-
function
|
|
11007
|
+
function rc(e, t) {
|
|
10990
11008
|
if (e && e.length > 0 && t.processEntities) for (let n = 0; n < t.entities.length; n++) {
|
|
10991
11009
|
let r = t.entities[n];
|
|
10992
11010
|
e = e.replace(r.regex, r.val);
|
|
@@ -10995,14 +11013,14 @@ function tc(e, t) {
|
|
|
10995
11013
|
}
|
|
10996
11014
|
//#endregion
|
|
10997
11015
|
//#region node_modules/.pnpm/fast-xml-builder@1.3.0/node_modules/fast-xml-builder/src/ignoreAttributes.js
|
|
10998
|
-
function
|
|
11016
|
+
function ic(e) {
|
|
10999
11017
|
return typeof e == "function" ? e : Array.isArray(e) ? (t) => {
|
|
11000
11018
|
for (let n of e) if (typeof n == "string" && t === n || n instanceof RegExp && n.test(t)) return !0;
|
|
11001
11019
|
} : () => !1;
|
|
11002
11020
|
}
|
|
11003
11021
|
//#endregion
|
|
11004
11022
|
//#region node_modules/.pnpm/fast-xml-builder@1.3.0/node_modules/fast-xml-builder/src/fxb.js
|
|
11005
|
-
var
|
|
11023
|
+
var ac = {
|
|
11006
11024
|
attributeNamePrefix: "@_",
|
|
11007
11025
|
attributesGroupName: !1,
|
|
11008
11026
|
textNodeName: "#text",
|
|
@@ -11051,18 +11069,18 @@ var rc = {
|
|
|
11051
11069
|
jPath: !0,
|
|
11052
11070
|
sanitizeName: !1
|
|
11053
11071
|
};
|
|
11054
|
-
function
|
|
11055
|
-
if (this.options = Object.assign({},
|
|
11072
|
+
function oc(e) {
|
|
11073
|
+
if (this.options = Object.assign({}, ac, 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++) {
|
|
11056
11074
|
let t = this.options.stopNodes[e];
|
|
11057
|
-
typeof t == "string" ? this.stopNodeExpressions.push(new
|
|
11075
|
+
typeof t == "string" ? this.stopNodeExpressions.push(new Yo(t)) : t instanceof Yo && this.stopNodeExpressions.push(t);
|
|
11058
11076
|
}
|
|
11059
11077
|
this.options.ignoreAttributes === !0 || this.options.attributesGroupName ? this.isAttribute = function() {
|
|
11060
11078
|
return !1;
|
|
11061
|
-
} : (this.ignoreAttributesFn =
|
|
11079
|
+
} : (this.ignoreAttributesFn = ic(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = dc), this.processTextOrObjNode = lc, this.options.format ? (this.indentate = uc, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() {
|
|
11062
11080
|
return "";
|
|
11063
11081
|
}, this.tagEndChar = ">", this.newLine = "");
|
|
11064
11082
|
}
|
|
11065
|
-
function
|
|
11083
|
+
function sc(e, t) {
|
|
11066
11084
|
let n = e["?xml"];
|
|
11067
11085
|
if (n && typeof n == "object") {
|
|
11068
11086
|
if (t.attributesGroupName && n[t.attributesGroupName]) {
|
|
@@ -11074,33 +11092,33 @@ function ac(e, t) {
|
|
|
11074
11092
|
}
|
|
11075
11093
|
return "1.0";
|
|
11076
11094
|
}
|
|
11077
|
-
function
|
|
11095
|
+
function cc(e, t, n, r, i) {
|
|
11078
11096
|
return !n.sanitizeName || i(e) ? e : n.sanitizeName(e, {
|
|
11079
11097
|
isAttribute: t,
|
|
11080
11098
|
matcher: r.readOnly()
|
|
11081
11099
|
});
|
|
11082
11100
|
}
|
|
11083
|
-
|
|
11084
|
-
if (this.options.preserveOrder) return
|
|
11101
|
+
oc.prototype.build = function(e) {
|
|
11102
|
+
if (this.options.preserveOrder) return Ys(e, this.options);
|
|
11085
11103
|
{
|
|
11086
11104
|
Array.isArray(e) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (e = { [this.options.arrayNodeName]: e });
|
|
11087
|
-
let t = new
|
|
11105
|
+
let t = new Qo(), n = So("qName", { xmlVersion: sc(e, this.options) });
|
|
11088
11106
|
return this.j2x(e, 0, t, n).val;
|
|
11089
11107
|
}
|
|
11090
|
-
},
|
|
11108
|
+
}, oc.prototype.j2x = function(e, t, n, r) {
|
|
11091
11109
|
let i = "", a = "";
|
|
11092
11110
|
if (this.options.maxNestedTags && n.getDepth() >= this.options.maxNestedTags) throw Error("Maximum nested tags exceeded");
|
|
11093
11111
|
let o = this.options.jPath ? n.toString() : n, s = this.checkStopNode(n);
|
|
11094
11112
|
for (let c in e) {
|
|
11095
11113
|
if (!Object.prototype.hasOwnProperty.call(e, c)) continue;
|
|
11096
|
-
let l = c === this.options.textNodeName || c === this.options.cdataPropName || c === this.options.commentPropName || this.options.attributesGroupName && c === this.options.attributesGroupName || this.isAttribute(c) || c[0] === "?" ? c :
|
|
11114
|
+
let l = c === this.options.textNodeName || c === this.options.cdataPropName || c === this.options.commentPropName || this.options.attributesGroupName && c === this.options.attributesGroupName || this.isAttribute(c) || c[0] === "?" ? c : cc(c, !1, this.options, n, r);
|
|
11097
11115
|
if (e[c] === void 0) this.isAttribute(c) && (a += "");
|
|
11098
11116
|
else if (e[c] === null) this.isAttribute(c) || l === this.options.cdataPropName || l === this.options.commentPropName ? a += "" : l[0] === "?" ? a += this.indentate(t) + "<" + l + "?" + this.tagEndChar : a += this.indentate(t) + "<" + l + "/" + this.tagEndChar;
|
|
11099
11117
|
else if (e[c] instanceof Date) a += this.buildTextValNode(e[c], l, "", t, n);
|
|
11100
11118
|
else if (typeof e[c] != "object") {
|
|
11101
11119
|
let u = this.isAttribute(c);
|
|
11102
11120
|
if (u && !this.ignoreAttributesFn(u, o)) {
|
|
11103
|
-
let t =
|
|
11121
|
+
let t = cc(u, !0, this.options, n, r);
|
|
11104
11122
|
i += this.buildAttrPairStr(t, "" + e[c], s);
|
|
11105
11123
|
} else if (!u) {
|
|
11106
11124
|
if (c === this.options.textNodeName) {
|
|
@@ -11144,7 +11162,7 @@ ic.prototype.build = function(e) {
|
|
|
11144
11162
|
} else if (this.options.attributesGroupName && c === this.options.attributesGroupName) {
|
|
11145
11163
|
let t = Object.keys(e[c]), a = t.length;
|
|
11146
11164
|
for (let o = 0; o < a; o++) {
|
|
11147
|
-
let a =
|
|
11165
|
+
let a = cc(t[o], !0, this.options, n, r);
|
|
11148
11166
|
i += this.buildAttrPairStr(a, "" + e[c][t[o]], s);
|
|
11149
11167
|
}
|
|
11150
11168
|
} else a += this.processTextOrObjNode(e[c], l, t, n, r);
|
|
@@ -11153,10 +11171,10 @@ ic.prototype.build = function(e) {
|
|
|
11153
11171
|
attrStr: i,
|
|
11154
11172
|
val: a
|
|
11155
11173
|
};
|
|
11156
|
-
},
|
|
11157
|
-
return n || (t = this.options.attributeValueProcessor(e, "" + t), t = this.replaceEntitiesValue(t)), this.options.suppressBooleanAttributes && t === "true" ? " " + e : " " + e + "=\"" +
|
|
11174
|
+
}, oc.prototype.buildAttrPairStr = function(e, t, n) {
|
|
11175
|
+
return n || (t = this.options.attributeValueProcessor(e, "" + t), t = this.replaceEntitiesValue(t)), this.options.suppressBooleanAttributes && t === "true" ? " " + e : " " + e + "=\"" + Gs(t) + "\"";
|
|
11158
11176
|
};
|
|
11159
|
-
function
|
|
11177
|
+
function lc(e, t, n, r, i) {
|
|
11160
11178
|
let a = this.extractAttributes(e);
|
|
11161
11179
|
if (r.push(t, a), this.checkStopNode(r)) {
|
|
11162
11180
|
let i = this.buildRawContent(e), a = this.buildAttributesForStopNode(e);
|
|
@@ -11165,7 +11183,7 @@ function sc(e, t, n, r, i) {
|
|
|
11165
11183
|
let o = this.j2x(e, n + 1, r, i);
|
|
11166
11184
|
return r.pop(), t[0] === "?" ? this.buildTextValNode("", t, o.attrStr, n, r) : e[this.options.textNodeName] !== void 0 && Object.keys(e).length === 1 ? this.buildTextValNode(e[this.options.textNodeName], t, o.attrStr, n, r) : this.buildObjectNode(o.val, t, o.attrStr, n);
|
|
11167
11185
|
}
|
|
11168
|
-
|
|
11186
|
+
oc.prototype.extractAttributes = function(e) {
|
|
11169
11187
|
if (!e || typeof e != "object") return null;
|
|
11170
11188
|
let t = {}, n = !1;
|
|
11171
11189
|
if (this.options.attributesGroupName && e[this.options.attributesGroupName]) {
|
|
@@ -11173,15 +11191,15 @@ ic.prototype.extractAttributes = function(e) {
|
|
|
11173
11191
|
for (let e in r) {
|
|
11174
11192
|
if (!Object.prototype.hasOwnProperty.call(r, e)) continue;
|
|
11175
11193
|
let i = e.startsWith(this.options.attributeNamePrefix) ? e.substring(this.options.attributeNamePrefix.length) : e;
|
|
11176
|
-
t[i] =
|
|
11194
|
+
t[i] = Gs(r[e]), n = !0;
|
|
11177
11195
|
}
|
|
11178
11196
|
} else for (let r in e) {
|
|
11179
11197
|
if (!Object.prototype.hasOwnProperty.call(e, r)) continue;
|
|
11180
11198
|
let i = this.isAttribute(r);
|
|
11181
|
-
i && (t[i] =
|
|
11199
|
+
i && (t[i] = Gs(e[r]), n = !0);
|
|
11182
11200
|
}
|
|
11183
11201
|
return n ? t : null;
|
|
11184
|
-
},
|
|
11202
|
+
}, oc.prototype.buildRawContent = function(e) {
|
|
11185
11203
|
if (typeof e == "string") return e;
|
|
11186
11204
|
if (typeof e != "object" || !e) return String(e);
|
|
11187
11205
|
if (e[this.options.textNodeName] !== void 0) return e[this.options.textNodeName];
|
|
@@ -11202,7 +11220,7 @@ ic.prototype.extractAttributes = function(e) {
|
|
|
11202
11220
|
} else t += `<${n}>${r}</${n}>`;
|
|
11203
11221
|
}
|
|
11204
11222
|
return t;
|
|
11205
|
-
},
|
|
11223
|
+
}, oc.prototype.buildAttributesForStopNode = function(e) {
|
|
11206
11224
|
if (!e || typeof e != "object") return "";
|
|
11207
11225
|
let t = "";
|
|
11208
11226
|
if (this.options.attributesGroupName && e[this.options.attributesGroupName]) {
|
|
@@ -11210,38 +11228,38 @@ ic.prototype.extractAttributes = function(e) {
|
|
|
11210
11228
|
for (let e in n) {
|
|
11211
11229
|
if (!Object.prototype.hasOwnProperty.call(n, e)) continue;
|
|
11212
11230
|
let r = e.startsWith(this.options.attributeNamePrefix) ? e.substring(this.options.attributeNamePrefix.length) : e, i = n[e];
|
|
11213
|
-
i === !0 && this.options.suppressBooleanAttributes ? t += " " + r : t += " " + r + "=\"" +
|
|
11231
|
+
i === !0 && this.options.suppressBooleanAttributes ? t += " " + r : t += " " + r + "=\"" + Gs(i) + "\"";
|
|
11214
11232
|
}
|
|
11215
11233
|
} else for (let n in e) {
|
|
11216
11234
|
if (!Object.prototype.hasOwnProperty.call(e, n)) continue;
|
|
11217
11235
|
let r = this.isAttribute(n);
|
|
11218
11236
|
if (r) {
|
|
11219
11237
|
let i = e[n];
|
|
11220
|
-
i === !0 && this.options.suppressBooleanAttributes ? t += " " + r : t += " " + r + "=\"" +
|
|
11238
|
+
i === !0 && this.options.suppressBooleanAttributes ? t += " " + r : t += " " + r + "=\"" + Gs(i) + "\"";
|
|
11221
11239
|
}
|
|
11222
11240
|
}
|
|
11223
11241
|
return t;
|
|
11224
|
-
},
|
|
11242
|
+
}, oc.prototype.buildObjectNode = function(e, t, n, r) {
|
|
11225
11243
|
if (e === "") return t[0] === "?" ? this.indentate(r) + "<" + t + n + "?" + this.tagEndChar : this.indentate(r) + "<" + t + n + this.closeTag(t) + this.tagEndChar;
|
|
11226
11244
|
if (t[0] === "?") return this.indentate(r) + "<" + t + n + "?" + this.tagEndChar;
|
|
11227
11245
|
{
|
|
11228
11246
|
let i = "</" + t + this.tagEndChar, a = "";
|
|
11229
|
-
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) + `<!--${
|
|
11247
|
+
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) + `<!--${Us(e)}-->` + this.newLine : this.indentate(r) + "<" + t + n + a + this.tagEndChar + e + this.indentate(r) + i;
|
|
11230
11248
|
}
|
|
11231
|
-
},
|
|
11249
|
+
}, oc.prototype.closeTag = function(e) {
|
|
11232
11250
|
let t = "";
|
|
11233
11251
|
return this.options.unpairedTags.indexOf(e) === -1 ? t = this.options.suppressEmptyNode ? "/" : `></${e}` : this.options.suppressUnpairedNode || (t = "/"), t;
|
|
11234
|
-
},
|
|
11252
|
+
}, oc.prototype.checkStopNode = function(e) {
|
|
11235
11253
|
if (!this.stopNodeExpressions || this.stopNodeExpressions.length === 0) return !1;
|
|
11236
11254
|
for (let t = 0; t < this.stopNodeExpressions.length; t++) if (e.matches(this.stopNodeExpressions[t])) return !0;
|
|
11237
11255
|
return !1;
|
|
11238
|
-
},
|
|
11256
|
+
}, oc.prototype.buildTextValNode = function(e, t, n, r, i) {
|
|
11239
11257
|
if (this.options.cdataPropName !== !1 && t === this.options.cdataPropName) {
|
|
11240
|
-
let t =
|
|
11258
|
+
let t = Ws(e);
|
|
11241
11259
|
return this.indentate(r) + `<![CDATA[${t}]]>` + this.newLine;
|
|
11242
11260
|
}
|
|
11243
11261
|
if (this.options.commentPropName !== !1 && t === this.options.commentPropName) {
|
|
11244
|
-
let t =
|
|
11262
|
+
let t = Us(e);
|
|
11245
11263
|
return this.indentate(r) + `<!--${t}-->` + this.newLine;
|
|
11246
11264
|
}
|
|
11247
11265
|
if (t[0] === "?") return this.indentate(r) + "<" + t + n + "?" + this.tagEndChar;
|
|
@@ -11249,32 +11267,32 @@ ic.prototype.extractAttributes = function(e) {
|
|
|
11249
11267
|
let i = this.options.tagValueProcessor(t, e);
|
|
11250
11268
|
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;
|
|
11251
11269
|
}
|
|
11252
|
-
},
|
|
11270
|
+
}, oc.prototype.replaceEntitiesValue = function(e) {
|
|
11253
11271
|
if (e && e.length > 0 && this.options.processEntities) for (let t = 0; t < this.options.entities.length; t++) {
|
|
11254
11272
|
let n = this.options.entities[t];
|
|
11255
11273
|
e = e.replace(n.regex, n.val);
|
|
11256
11274
|
}
|
|
11257
11275
|
return e;
|
|
11258
11276
|
};
|
|
11259
|
-
function
|
|
11277
|
+
function uc(e) {
|
|
11260
11278
|
return this.options.indentBy.repeat(e);
|
|
11261
11279
|
}
|
|
11262
|
-
function
|
|
11280
|
+
function dc(e) {
|
|
11263
11281
|
return e.startsWith(this.options.attributeNamePrefix) && e !== this.options.textNodeName ? e.substr(this.attrPrefixLen) : !1;
|
|
11264
11282
|
}
|
|
11265
11283
|
//#endregion
|
|
11266
11284
|
//#region node_modules/.pnpm/fast-xml-parser@5.10.1/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js
|
|
11267
|
-
var
|
|
11285
|
+
var fc = oc;
|
|
11268
11286
|
//#endregion
|
|
11269
11287
|
//#region lib/core/io/pseudo/fortran-helpers.ts
|
|
11270
11288
|
function F(e) {
|
|
11271
11289
|
return Number.parseFloat(e.replace(/[dD]/g, "e"));
|
|
11272
11290
|
}
|
|
11273
|
-
function
|
|
11291
|
+
function pc(e) {
|
|
11274
11292
|
let t = e.trim().toLowerCase();
|
|
11275
11293
|
return t === ".true." || t === "true" || t === "t";
|
|
11276
11294
|
}
|
|
11277
|
-
function
|
|
11295
|
+
function mc(e) {
|
|
11278
11296
|
let t = e.trim().split(/\s+/).filter(Boolean), n = new Float64Array(t.length);
|
|
11279
11297
|
for (let e = 0; e < t.length; e++) n[e] = F(t[e]);
|
|
11280
11298
|
return n;
|
|
@@ -11285,10 +11303,10 @@ function I(e) {
|
|
|
11285
11303
|
function L(e, t = 20) {
|
|
11286
11304
|
return e.toExponential(15).replace(/e/, "D").replace(/e\+/, "D+").replace(/e-/, "D-").padStart(t);
|
|
11287
11305
|
}
|
|
11288
|
-
function
|
|
11306
|
+
function hc(e) {
|
|
11289
11307
|
return e ? ".true." : ".false.";
|
|
11290
11308
|
}
|
|
11291
|
-
function
|
|
11309
|
+
function gc(e) {
|
|
11292
11310
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
11293
11311
|
}
|
|
11294
11312
|
function R(e, t = 4) {
|
|
@@ -11313,8 +11331,8 @@ function V(e, t, n = 0) {
|
|
|
11313
11331
|
let r = z(e, t);
|
|
11314
11332
|
return r ? I(r) : n;
|
|
11315
11333
|
}
|
|
11316
|
-
function
|
|
11317
|
-
return
|
|
11334
|
+
function _c(e, t) {
|
|
11335
|
+
return pc(z(e, t) || ".false.");
|
|
11318
11336
|
}
|
|
11319
11337
|
function H(e) {
|
|
11320
11338
|
return typeof e == "string" ? e : e && "#text" in e ? String(e["#text"]) : "";
|
|
@@ -11325,9 +11343,9 @@ function U(e) {
|
|
|
11325
11343
|
//#endregion
|
|
11326
11344
|
//#region lib/core/io/pseudo/upf.ts
|
|
11327
11345
|
function W(e) {
|
|
11328
|
-
return
|
|
11346
|
+
return mc(e);
|
|
11329
11347
|
}
|
|
11330
|
-
var
|
|
11348
|
+
var vc = {
|
|
11331
11349
|
ignoreAttributes: !1,
|
|
11332
11350
|
attributeNamePrefix: "@_",
|
|
11333
11351
|
allowBooleanAttributes: !0,
|
|
@@ -11336,7 +11354,7 @@ var gc = {
|
|
|
11336
11354
|
trimValues: !0,
|
|
11337
11355
|
isArray: (e, t, n, r) => !r && !!(e === "PP_BETA" || e.startsWith("PP_BETA.") || e === "PP_CHI" || e.startsWith("PP_CHI.") || e === "PP_VNL" || e === "PP_AEWFC" || e.startsWith("PP_AEWFC.") || e.startsWith("PP_GIPAW_CORE_ORBITAL.") || e.startsWith("PP_GIPAW_ORBITAL.") || e === "PP_RELWFC" || e === "PP_RELBETA")
|
|
11338
11356
|
};
|
|
11339
|
-
function
|
|
11357
|
+
function yc(e) {
|
|
11340
11358
|
return {
|
|
11341
11359
|
generated: z(e, "generated") || void 0,
|
|
11342
11360
|
author: z(e, "author") || void 0,
|
|
@@ -11345,14 +11363,14 @@ function _c(e) {
|
|
|
11345
11363
|
element: z(e, "element").trim(),
|
|
11346
11364
|
pseudoType: z(e, "pseudo_type") || "NC",
|
|
11347
11365
|
relativistic: z(e, "relativistic") || "scalar",
|
|
11348
|
-
isUltrasoft:
|
|
11349
|
-
isPaw:
|
|
11350
|
-
isCoulomb:
|
|
11351
|
-
hasSo:
|
|
11352
|
-
hasWfc:
|
|
11353
|
-
hasGipaw:
|
|
11354
|
-
pawAsGipaw:
|
|
11355
|
-
coreCorrection:
|
|
11366
|
+
isUltrasoft: _c(e, "is_ultrasoft"),
|
|
11367
|
+
isPaw: _c(e, "is_paw"),
|
|
11368
|
+
isCoulomb: _c(e, "is_coulomb"),
|
|
11369
|
+
hasSo: _c(e, "has_so"),
|
|
11370
|
+
hasWfc: _c(e, "has_wfc"),
|
|
11371
|
+
hasGipaw: _c(e, "has_gipaw"),
|
|
11372
|
+
pawAsGipaw: _c(e, "paw_as_gipaw"),
|
|
11373
|
+
coreCorrection: _c(e, "core_correction"),
|
|
11356
11374
|
functional: z(e, "functional"),
|
|
11357
11375
|
zValence: B(e, "z_valence"),
|
|
11358
11376
|
totalPsenergy: B(e, "total_psenergy"),
|
|
@@ -11366,7 +11384,7 @@ function _c(e) {
|
|
|
11366
11384
|
numberOfProj: V(e, "number_of_proj")
|
|
11367
11385
|
};
|
|
11368
11386
|
}
|
|
11369
|
-
function
|
|
11387
|
+
function bc(e) {
|
|
11370
11388
|
return {
|
|
11371
11389
|
dx: z(e, "dx") ? B(e, "dx") : void 0,
|
|
11372
11390
|
mesh: z(e, "mesh") ? V(e, "mesh") : void 0,
|
|
@@ -11377,10 +11395,10 @@ function vc(e) {
|
|
|
11377
11395
|
rab: W(H(e.PP_RAB))
|
|
11378
11396
|
};
|
|
11379
11397
|
}
|
|
11380
|
-
function
|
|
11398
|
+
function xc(e) {
|
|
11381
11399
|
return { vloc: W(H(e)) };
|
|
11382
11400
|
}
|
|
11383
|
-
function
|
|
11401
|
+
function Sc(e) {
|
|
11384
11402
|
return {
|
|
11385
11403
|
angularMomentum: V(e, "angular_momentum"),
|
|
11386
11404
|
cutoffRadiusIndex: z(e, "cutoff_radius_index") ? V(e, "cutoff_radius_index") : void 0,
|
|
@@ -11391,9 +11409,9 @@ function bc(e) {
|
|
|
11391
11409
|
beta: W(H(e))
|
|
11392
11410
|
};
|
|
11393
11411
|
}
|
|
11394
|
-
function
|
|
11412
|
+
function Cc(e) {
|
|
11395
11413
|
let t = [];
|
|
11396
|
-
for (let [n, r] of Object.entries(e)) (n === "PP_BETA" || n.startsWith("PP_BETA.")) && t.push(...U(r).map(
|
|
11414
|
+
for (let [n, r] of Object.entries(e)) (n === "PP_BETA" || n.startsWith("PP_BETA.")) && t.push(...U(r).map(Sc));
|
|
11397
11415
|
let n = H(e.PP_DIJ).trim().split(/\s+/).filter(Boolean).map(F), r = [];
|
|
11398
11416
|
if (n.length > 0) {
|
|
11399
11417
|
let e = t.length;
|
|
@@ -11408,7 +11426,7 @@ function xc(e) {
|
|
|
11408
11426
|
n[e + 2]
|
|
11409
11427
|
]);
|
|
11410
11428
|
}
|
|
11411
|
-
let i = e.PP_AUGMENTATION ?
|
|
11429
|
+
let i = e.PP_AUGMENTATION ? wc(e.PP_AUGMENTATION) : void 0;
|
|
11412
11430
|
return {
|
|
11413
11431
|
betas: t,
|
|
11414
11432
|
dij: r,
|
|
@@ -11416,9 +11434,9 @@ function xc(e) {
|
|
|
11416
11434
|
augmentation: i
|
|
11417
11435
|
};
|
|
11418
11436
|
}
|
|
11419
|
-
function
|
|
11437
|
+
function wc(e) {
|
|
11420
11438
|
return {
|
|
11421
|
-
qWithL: z(e, "q_with_l") ?
|
|
11439
|
+
qWithL: z(e, "q_with_l") ? _c(e, "q_with_l") : void 0,
|
|
11422
11440
|
nqf: z(e, "nqf") ? V(e, "nqf") : void 0,
|
|
11423
11441
|
shape: z(e, "shape") || void 0,
|
|
11424
11442
|
rMatchAugfun: z(e, "r_match_augfun") ? B(e, "r_match_augfun") : void 0,
|
|
@@ -11430,7 +11448,7 @@ function Sc(e) {
|
|
|
11430
11448
|
rinner: e.PP_RINNER ? W(H(e.PP_RINNER)) : void 0
|
|
11431
11449
|
};
|
|
11432
11450
|
}
|
|
11433
|
-
function
|
|
11451
|
+
function Tc(e) {
|
|
11434
11452
|
return {
|
|
11435
11453
|
l: V(e, "l"),
|
|
11436
11454
|
occupation: B(e, "occupation"),
|
|
@@ -11442,14 +11460,14 @@ function Cc(e) {
|
|
|
11442
11460
|
chi: W(H(e))
|
|
11443
11461
|
};
|
|
11444
11462
|
}
|
|
11445
|
-
function
|
|
11463
|
+
function Ec(e) {
|
|
11446
11464
|
return {
|
|
11447
11465
|
l: V(e, "l"),
|
|
11448
11466
|
label: z(e, "label"),
|
|
11449
11467
|
aewfc: W(H(e))
|
|
11450
11468
|
};
|
|
11451
11469
|
}
|
|
11452
|
-
function
|
|
11470
|
+
function Dc(e) {
|
|
11453
11471
|
return {
|
|
11454
11472
|
pawDataFormat: V(e, "paw_data_format"),
|
|
11455
11473
|
coreEnergy: B(e, "core_energy"),
|
|
@@ -11460,7 +11478,7 @@ function Tc(e) {
|
|
|
11460
11478
|
psWfcs: []
|
|
11461
11479
|
};
|
|
11462
11480
|
}
|
|
11463
|
-
function
|
|
11481
|
+
function Oc(e) {
|
|
11464
11482
|
let t = [], n = e.PP_GIPAW_CORE_ORBITALS;
|
|
11465
11483
|
if (n) {
|
|
11466
11484
|
for (let [e, r] of Object.entries(n)) if (e.startsWith("PP_GIPAW_CORE_ORBITAL.")) for (let e of U(r)) t.push({
|
|
@@ -11487,7 +11505,7 @@ function Ec(e) {
|
|
|
11487
11505
|
vlocPs: o
|
|
11488
11506
|
};
|
|
11489
11507
|
}
|
|
11490
|
-
function
|
|
11508
|
+
function kc(e) {
|
|
11491
11509
|
let t = [];
|
|
11492
11510
|
for (let n of U(e.PP_RELWFC)) t.push({
|
|
11493
11511
|
jchi: B(n, "jchi"),
|
|
@@ -11508,33 +11526,33 @@ function Dc(e) {
|
|
|
11508
11526
|
relBetas: n
|
|
11509
11527
|
};
|
|
11510
11528
|
}
|
|
11511
|
-
function
|
|
11512
|
-
let t = new
|
|
11529
|
+
function Ac(e) {
|
|
11530
|
+
let t = new Hs(vc).parse(e)?.UPF;
|
|
11513
11531
|
if (!t) throw Error("Not a UPF file: missing <UPF> root element");
|
|
11514
11532
|
let n = z(t, "version") || "2.0.1", r = t.PP_INFO && H(t.PP_INFO).trim() || void 0;
|
|
11515
11533
|
if (!t.PP_HEADER) throw Error("Missing PP_HEADER section");
|
|
11516
|
-
let i =
|
|
11534
|
+
let i = yc(t.PP_HEADER);
|
|
11517
11535
|
if (!t.PP_MESH) throw Error("Missing PP_MESH section");
|
|
11518
|
-
let a =
|
|
11536
|
+
let a = bc(t.PP_MESH), o = t.PP_NLCC ? W(H(t.PP_NLCC)) : void 0;
|
|
11519
11537
|
if (!t.PP_LOCAL) throw Error("Missing PP_LOCAL section");
|
|
11520
|
-
let s =
|
|
11538
|
+
let s = xc(t.PP_LOCAL), c;
|
|
11521
11539
|
if (t.PP_SEMILOCAL && (c = U(t.PP_SEMILOCAL.PP_VNL).map((e) => ({
|
|
11522
11540
|
l: V(e, "L"),
|
|
11523
11541
|
j: z(e, "J") ? B(e, "J") : void 0,
|
|
11524
11542
|
vnl: W(H(e))
|
|
11525
11543
|
}))), !t.PP_NONLOCAL) throw Error("Missing PP_NONLOCAL section");
|
|
11526
|
-
let l =
|
|
11544
|
+
let l = Cc(t.PP_NONLOCAL), u = t.PP_PSWFC, d = [];
|
|
11527
11545
|
if (u) {
|
|
11528
|
-
for (let [e, t] of Object.entries(u)) if (e === "PP_CHI" || e.startsWith("PP_CHI.")) for (let e of U(t)) d.push(
|
|
11546
|
+
for (let [e, t] of Object.entries(u)) if (e === "PP_CHI" || e.startsWith("PP_CHI.")) for (let e of U(t)) d.push(Tc(e));
|
|
11529
11547
|
}
|
|
11530
11548
|
let f;
|
|
11531
11549
|
if (t.PP_FULL_WFC) {
|
|
11532
11550
|
let e = [];
|
|
11533
|
-
for (let [n, r] of Object.entries(t.PP_FULL_WFC)) if (n.startsWith("PP_AEWFC")) for (let t of U(r)) e.push(
|
|
11551
|
+
for (let [n, r] of Object.entries(t.PP_FULL_WFC)) if (n.startsWith("PP_AEWFC")) for (let t of U(r)) e.push(Ec(t));
|
|
11534
11552
|
f = e.length > 0 ? e : void 0;
|
|
11535
11553
|
}
|
|
11536
11554
|
if (!t.PP_RHOATOM) throw Error("Missing PP_RHOATOM section");
|
|
11537
|
-
let p = W(H(t.PP_RHOATOM)), m = t.PP_PAW ?
|
|
11555
|
+
let p = W(H(t.PP_RHOATOM)), m = t.PP_PAW ? Dc(t.PP_PAW) : void 0, h = t.PP_GIPAW ? Oc(t.PP_GIPAW) : t.PP_GIPAW_RECONSTRUCTION ? Oc(t.PP_GIPAW_RECONSTRUCTION) : void 0, g = t.PP_SPIN_ORB ? kc(t.PP_SPIN_ORB) : void 0;
|
|
11538
11556
|
return m && f && f.length > 0 && (m.aeWfcs = f), m && d.length > 0 && (m.psWfcs = d.map((e) => ({
|
|
11539
11557
|
l: e.l,
|
|
11540
11558
|
label: e.label ?? "",
|
|
@@ -11556,9 +11574,9 @@ function Oc(e) {
|
|
|
11556
11574
|
spinOrbit: g
|
|
11557
11575
|
};
|
|
11558
11576
|
}
|
|
11559
|
-
function
|
|
11577
|
+
function jc(e) {
|
|
11560
11578
|
let t = [];
|
|
11561
|
-
t.push(`<UPF version="${e.version}">`), t.push(""), e.info && (t.push("<PP_INFO>"), t.push(e.info), t.push("</PP_INFO>"), t.push("")), t.push("<PP_HEADER"), t.push(` generated="${
|
|
11579
|
+
t.push(`<UPF version="${e.version}">`), t.push(""), e.info && (t.push("<PP_INFO>"), t.push(e.info), t.push("</PP_INFO>"), t.push("")), t.push("<PP_HEADER"), t.push(` generated="${gc(e.header.generated ?? "")}"`), t.push(` author="${gc(e.header.author ?? "")}"`), t.push(` date="${gc(e.header.date ?? "")}"`), t.push(` comment="${gc(e.header.comment ?? "")}"`), t.push(` element="${e.header.element}"`), t.push(` pseudo_type="${e.header.pseudoType}"`), t.push(` relativistic="${e.header.relativistic}"`), t.push(` is_ultrasoft="${hc(e.header.isUltrasoft)}"`), t.push(` is_paw="${hc(e.header.isPaw)}"`), t.push(` is_coulomb="${hc(e.header.isCoulomb)}"`), t.push(` has_so="${hc(e.header.hasSo)}"`), t.push(` has_wfc="${hc(e.header.hasWfc)}"`), t.push(` has_gipaw="${hc(e.header.hasGipaw)}"`), t.push(` paw_as_gipaw="${hc(e.header.pawAsGipaw)}"`), t.push(` core_correction="${hc(e.header.coreCorrection)}"`), t.push(` functional="${e.header.functional}"`), t.push(` z_valence="${L(e.header.zValence)}"`), t.push(` total_psenergy="${L(e.header.totalPsenergy)}"`), t.push(` wfc_cutoff="${L(e.header.wfcCutoff)}"`), t.push(` rho_cutoff="${L(e.header.rhoCutoff)}"`), t.push(` l_max="${e.header.lMax}"`), t.push(` l_max_rho="${e.header.lMaxRho}"`), t.push(` l_local="${e.header.lLocal}"`), t.push(` mesh_size="${e.header.meshSize}"`), t.push(` number_of_wfc="${e.header.numberOfWfc}"`), t.push(` number_of_proj="${e.header.numberOfProj}"/>`), t.push("");
|
|
11562
11580
|
let n = [];
|
|
11563
11581
|
if (e.mesh.dx != null && n.push(`dx="${e.mesh.dx}"`), e.mesh.mesh != null && n.push(`mesh="${e.mesh.mesh}"`), e.mesh.xmin != null && n.push(`xmin="${e.mesh.xmin}"`), n.push(`rmax="${e.mesh.rmax}"`), e.mesh.zmesh != null && n.push(`zmesh="${e.mesh.zmesh}"`), t.push(`<PP_MESH ${n.join(" ")}>`), t.push("<PP_R>"), t.push(R(e.mesh.r)), t.push("</PP_R>"), t.push("<PP_RAB>"), t.push(R(e.mesh.rab)), t.push("</PP_RAB>"), t.push("</PP_MESH>"), t.push(""), e.nlcc && (t.push("<PP_NLCC>"), t.push(R(e.nlcc)), t.push("</PP_NLCC>"), t.push("")), t.push("<PP_LOCAL>"), t.push(R(e.local.vloc)), t.push("</PP_LOCAL>"), t.push(""), e.semilocal) {
|
|
11564
11582
|
t.push("<PP_SEMILOCAL>");
|
|
@@ -11616,7 +11634,7 @@ function kc(e) {
|
|
|
11616
11634
|
t.push("<PP_GIPAW_ORBITALS>");
|
|
11617
11635
|
for (let n = 0; n < e.gipaw.orbitals.length; n++) {
|
|
11618
11636
|
let r = e.gipaw.orbitals[n];
|
|
11619
|
-
t.push(`<PP_GIPAW_ORBITAL.${n + 1} l="${r.l}" label="${
|
|
11637
|
+
t.push(`<PP_GIPAW_ORBITAL.${n + 1} l="${r.l}" label="${gc(r.label)}">`), t.push("<PP_GIPAW_ORBITAL_AE>"), t.push(R(r.aeOrbital)), t.push("</PP_GIPAW_ORBITAL_AE>"), t.push("<PP_GIPAW_ORBITAL_PS>"), t.push(R(r.psOrbital)), t.push("</PP_GIPAW_ORBITAL_PS>"), t.push(`</PP_GIPAW_ORBITAL.${n + 1}>`);
|
|
11620
11638
|
}
|
|
11621
11639
|
t.push("</PP_GIPAW_ORBITALS>");
|
|
11622
11640
|
}
|
|
@@ -11626,23 +11644,23 @@ function kc(e) {
|
|
|
11626
11644
|
}
|
|
11627
11645
|
//#endregion
|
|
11628
11646
|
//#region lib/core/io/pseudo/upf-v1.ts
|
|
11629
|
-
function
|
|
11647
|
+
function Mc(e, t) {
|
|
11630
11648
|
let n = `<${t}>`, r = `</${t}>`, i = e.indexOf(n);
|
|
11631
11649
|
if (i === -1) return null;
|
|
11632
11650
|
let a = e.indexOf(r, i);
|
|
11633
11651
|
return a === -1 ? null : e.substring(i + n.length, a);
|
|
11634
11652
|
}
|
|
11635
|
-
function
|
|
11636
|
-
return
|
|
11653
|
+
function Nc(e, t) {
|
|
11654
|
+
return Mc(e, t);
|
|
11637
11655
|
}
|
|
11638
|
-
function
|
|
11656
|
+
function Pc(e) {
|
|
11639
11657
|
return e.split("\n").filter((e) => e.trim().length > 0);
|
|
11640
11658
|
}
|
|
11641
|
-
function
|
|
11659
|
+
function Fc(e) {
|
|
11642
11660
|
if (!e.trim().split("\n")[0].trim().match(/^(\d+)/)) throw Error("Not a UPF v1 file: first line is not a version number");
|
|
11643
|
-
let t =
|
|
11661
|
+
let t = Mc(e, "PP_HEADER");
|
|
11644
11662
|
if (!t) throw Error("Missing PP_HEADER section");
|
|
11645
|
-
let n =
|
|
11663
|
+
let n = Pc(t), r = "X", i = "NC", a = "", o = 0, s = 0, c = 0, l = 0, u = 0, d = !1;
|
|
11646
11664
|
for (let e of n) {
|
|
11647
11665
|
let t = e.trim(), n = t.match(/^['"]?([A-Z][a-z]?)['"]?(?:\s|$)/);
|
|
11648
11666
|
n && (r = n[1]), (t.includes("'NC'") || t.includes("\"NC\"") || t.includes("NC")) && (i = "NC"), (t.includes("'US'") || t.includes("\"US\"") || t.includes("US")) && (i = "US"), (t.includes("'PAW'") || t.includes("\"PAW\"") || t.includes("PAW")) && (i = "PAW");
|
|
@@ -11657,10 +11675,10 @@ function Nc(e) {
|
|
|
11657
11675
|
let g = t.match(/(\d+)\s+(\d+)\s+(?:nwfc|nbeta)/i);
|
|
11658
11676
|
g && (l = parseInt(g[1]), u = parseInt(g[2])), (t.includes(".true.") || t.includes("T")) && (d = !0);
|
|
11659
11677
|
}
|
|
11660
|
-
let f =
|
|
11678
|
+
let f = Mc(e, "PP_MESH"), p = /* @__PURE__ */ new Float64Array(), m = /* @__PURE__ */ new Float64Array();
|
|
11661
11679
|
if (f) {
|
|
11662
|
-
let e =
|
|
11663
|
-
e && (p =
|
|
11680
|
+
let e = Nc(f, "PP_R"), t = Nc(f, "PP_RAB");
|
|
11681
|
+
e && (p = mc(e)), t && (m = mc(t));
|
|
11664
11682
|
}
|
|
11665
11683
|
if (p.length === 0) throw Error("Empty or missing PP_R section");
|
|
11666
11684
|
c = p.length;
|
|
@@ -11669,15 +11687,15 @@ function Nc(e) {
|
|
|
11669
11687
|
rmax: p[p.length - 1],
|
|
11670
11688
|
r: p,
|
|
11671
11689
|
rab: m
|
|
11672
|
-
}, g =
|
|
11690
|
+
}, g = Mc(e, "PP_LOCAL");
|
|
11673
11691
|
if (!g) throw Error("Missing PP_LOCAL section");
|
|
11674
|
-
let _ = { vloc:
|
|
11692
|
+
let _ = { vloc: mc(g) }, v = Mc(e, "PP_NONLOCAL"), y = [], b = [];
|
|
11675
11693
|
if (v) {
|
|
11676
11694
|
let e = v.match(/<PP_BETA[^>]*>([\s\S]*?)<\/PP_BETA>/g);
|
|
11677
11695
|
if (e) for (let t of e) {
|
|
11678
|
-
let e =
|
|
11696
|
+
let e = Pc(t.replace(/<\/?PP_BETA[^>]*>/g, ""));
|
|
11679
11697
|
if (e.length >= 2) {
|
|
11680
|
-
let t = e[0].trim().split(/\s+/), n = t.length >= 2 ? parseInt(t[1]) : 0, r = t.length >= 3 ? t[2].replace(/['"]/g, "") : `l=${n}`, i = e[1].trim().split(/\s+/), a = i.length >= 1 ? parseInt(i[0]) : 0, o =
|
|
11698
|
+
let t = e[0].trim().split(/\s+/), n = t.length >= 2 ? parseInt(t[1]) : 0, r = t.length >= 3 ? t[2].replace(/['"]/g, "") : `l=${n}`, i = e[1].trim().split(/\s+/), a = i.length >= 1 ? parseInt(i[0]) : 0, o = mc(e.slice(1).join("\n").replace(/^\s*\d+\s+/gm, ""));
|
|
11681
11699
|
y.push({
|
|
11682
11700
|
angularMomentum: n,
|
|
11683
11701
|
cutoffRadiusIndex: a,
|
|
@@ -11687,9 +11705,9 @@ function Nc(e) {
|
|
|
11687
11705
|
});
|
|
11688
11706
|
}
|
|
11689
11707
|
}
|
|
11690
|
-
let t =
|
|
11708
|
+
let t = Mc(v, "PP_DIJ");
|
|
11691
11709
|
if (t) {
|
|
11692
|
-
let e =
|
|
11710
|
+
let e = Pc(t);
|
|
11693
11711
|
for (let t of e) {
|
|
11694
11712
|
let e = t.trim().split(/\s+/).filter(Boolean);
|
|
11695
11713
|
if (e.length >= 3) {
|
|
@@ -11706,9 +11724,9 @@ function Nc(e) {
|
|
|
11706
11724
|
let x = {
|
|
11707
11725
|
betas: y,
|
|
11708
11726
|
dij: b
|
|
11709
|
-
}, S =
|
|
11727
|
+
}, S = Mc(e, "PP_PSWFC"), C = [];
|
|
11710
11728
|
if (S) {
|
|
11711
|
-
let e =
|
|
11729
|
+
let e = Pc(S), t = 0;
|
|
11712
11730
|
for (; t < e.length;) {
|
|
11713
11731
|
let n = e[t].trim().match(/['"]?(\w+)['"]?\s+(\d+)\s+([\d.]+)/);
|
|
11714
11732
|
if (n) {
|
|
@@ -11716,7 +11734,7 @@ function Nc(e) {
|
|
|
11716
11734
|
t++;
|
|
11717
11735
|
let o = [];
|
|
11718
11736
|
for (; t < e.length && !e[t].trim().match(/['"]?\w+['"]?\s+\d+\s+[\d.]+/);) o.push(e[t]), t++;
|
|
11719
|
-
let s =
|
|
11737
|
+
let s = mc(o.join("\n"));
|
|
11720
11738
|
C.push({
|
|
11721
11739
|
l: i,
|
|
11722
11740
|
occupation: a,
|
|
@@ -11726,7 +11744,7 @@ function Nc(e) {
|
|
|
11726
11744
|
} else t++;
|
|
11727
11745
|
}
|
|
11728
11746
|
}
|
|
11729
|
-
let w =
|
|
11747
|
+
let w = Mc(e, "PP_RHOATOM"), T = w ? mc(w) : new Float64Array(c);
|
|
11730
11748
|
return {
|
|
11731
11749
|
format: "UPF1",
|
|
11732
11750
|
version: "1.0.0",
|
|
@@ -11761,7 +11779,7 @@ function Nc(e) {
|
|
|
11761
11779
|
rhoatom: T
|
|
11762
11780
|
};
|
|
11763
11781
|
}
|
|
11764
|
-
function
|
|
11782
|
+
function Ic(e) {
|
|
11765
11783
|
let t = [];
|
|
11766
11784
|
t.push(" 0"), t.push("<PP_HEADER>"), t.push(` '${e.header.element}'`), t.push(` '${e.header.pseudoType}'`), t.push(` ${e.header.coreCorrection ? ".true." : ".false."} nlcc`), t.push(` '${e.header.functional}' dft`), t.push(` ${e.header.zValence.toFixed(8)} zp`), t.push(` ${e.header.totalPsenergy.toFixed(8)} etotps`), t.push(` ${e.header.wfcCutoff.toFixed(2)} ${e.header.rhoCutoff.toFixed(2)} ecutwfc,ecutrho`), t.push(` ${e.header.lMax} 'lmax'`), t.push(` ${e.mesh.r.length} 'mesh'`), t.push(` ${e.pswfc.length} ${e.nonlocal.betas.length} 'nwfc nbeta'`);
|
|
11767
11785
|
for (let n of e.pswfc) t.push(` '${n.label ?? "wfc"}' ${n.l} ${n.occupation.toFixed(4)}`);
|
|
@@ -11781,22 +11799,22 @@ function Pc(e) {
|
|
|
11781
11799
|
}
|
|
11782
11800
|
//#endregion
|
|
11783
11801
|
//#region lib/core/io/pseudo/elements.ts
|
|
11784
|
-
var
|
|
11785
|
-
for (let [e, t] of Object.entries(Ln))
|
|
11786
|
-
function
|
|
11802
|
+
var Lc = /* @__PURE__ */ new Map();
|
|
11803
|
+
for (let [e, t] of Object.entries(Ln)) Lc.set(t.symbol, Number(e));
|
|
11804
|
+
function Rc(e) {
|
|
11787
11805
|
return Ln[Math.round(e)]?.symbol ?? "X";
|
|
11788
11806
|
}
|
|
11789
|
-
function
|
|
11790
|
-
return
|
|
11807
|
+
function zc(e) {
|
|
11808
|
+
return Lc.get(e) ?? 0;
|
|
11791
11809
|
}
|
|
11792
11810
|
//#endregion
|
|
11793
11811
|
//#region lib/core/io/pseudo/fhi.ts
|
|
11794
|
-
function
|
|
11812
|
+
function Bc(e) {
|
|
11795
11813
|
let t = e.split("\n").find((e) => e.trim().length > 0);
|
|
11796
11814
|
if (!t) throw Error("FHI file too short to parse");
|
|
11797
|
-
return /^\s*\d/.test(t) ?
|
|
11815
|
+
return /^\s*\d/.test(t) ? Vc(e) : Hc(e);
|
|
11798
11816
|
}
|
|
11799
|
-
function
|
|
11817
|
+
function Vc(e) {
|
|
11800
11818
|
let t = e.split("\n").filter((e) => e.trim().length > 0);
|
|
11801
11819
|
if (t.length < 4) throw Error("FHI file too short to parse");
|
|
11802
11820
|
let n = t[0].trim().split(/\s+/), r = F(n[0]), i = I(n[1]), a = i - 1, o = 1;
|
|
@@ -11868,13 +11886,13 @@ function zc(e) {
|
|
|
11868
11886
|
nlcc: f ? new Float64Array(p) : void 0
|
|
11869
11887
|
};
|
|
11870
11888
|
}
|
|
11871
|
-
function
|
|
11872
|
-
let t = e.split("\n"), n =
|
|
11889
|
+
function Hc(e) {
|
|
11890
|
+
let t = e.split("\n"), n = Vc(t.slice(7).join("\n"));
|
|
11873
11891
|
if (t.length >= 3) {
|
|
11874
11892
|
let e = t[1].trim().split(/\s+/);
|
|
11875
11893
|
if (e.length >= 1) {
|
|
11876
11894
|
let t = parseFloat(e[0]);
|
|
11877
|
-
t > 0 && (n.header.element =
|
|
11895
|
+
t > 0 && (n.header.element = Rc(t));
|
|
11878
11896
|
}
|
|
11879
11897
|
e.length >= 2 && (n.header.zValence = parseFloat(e[1]));
|
|
11880
11898
|
let r = t[2].trim().split(/\s+/);
|
|
@@ -11885,7 +11903,7 @@ function Bc(e) {
|
|
|
11885
11903
|
}
|
|
11886
11904
|
return n;
|
|
11887
11905
|
}
|
|
11888
|
-
function
|
|
11906
|
+
function Uc(e) {
|
|
11889
11907
|
let t = [], n = e.header.lMax + 1, r = e.mesh.r;
|
|
11890
11908
|
t.push(`${L(e.header.zValence, 20)} ${n}`);
|
|
11891
11909
|
for (let e = 0; e < 9; e++) t.push(" 0.0000 0.0000 0.0000 0.0000");
|
|
@@ -11904,7 +11922,7 @@ function Vc(e) {
|
|
|
11904
11922
|
}
|
|
11905
11923
|
//#endregion
|
|
11906
11924
|
//#region lib/core/io/pseudo/psp8.ts
|
|
11907
|
-
function
|
|
11925
|
+
function Wc(e) {
|
|
11908
11926
|
let t = e.split("\n").filter((e) => e.trim().length > 0);
|
|
11909
11927
|
if (t.length < 6) throw Error("PSP8 file too short to parse");
|
|
11910
11928
|
let n = 0, r = t[n++].trim(), i = t[n++].trim().split(/\s+/), a = F(i[0]), o = F(i[1]), s = i.length > 2 ? i[2] : "", c = t[n++].trim().split(/\s+/), l = I(c[0]);
|
|
@@ -12011,7 +12029,7 @@ function Hc(e) {
|
|
|
12011
12029
|
}
|
|
12012
12030
|
A += t;
|
|
12013
12031
|
}
|
|
12014
|
-
let ee =
|
|
12032
|
+
let ee = Rc(a), te = Kc(u);
|
|
12015
12033
|
return {
|
|
12016
12034
|
format: "PSP8",
|
|
12017
12035
|
version: "2.0.1",
|
|
@@ -12054,10 +12072,10 @@ function Hc(e) {
|
|
|
12054
12072
|
nlcc: w
|
|
12055
12073
|
};
|
|
12056
12074
|
}
|
|
12057
|
-
function
|
|
12075
|
+
function Gc(e) {
|
|
12058
12076
|
let t = [], n = e.header.lMax, r = e.mesh.r.length, i = e.header.lLocal ?? 0, a = Array(n + 1).fill(0);
|
|
12059
12077
|
for (let t of e.nonlocal.betas) t.angularMomentum <= n && a[t.angularMomentum]++;
|
|
12060
|
-
let o =
|
|
12078
|
+
let o = zc(e.header.element);
|
|
12061
12079
|
t.push(e.header.generated ?? `${e.header.element} ${e.header.functional}`);
|
|
12062
12080
|
let s = e.header.date ?? "000000";
|
|
12063
12081
|
t.push(`${o.toFixed(4).padStart(12)} ${e.header.zValence.toFixed(4).padStart(12)} ${s.padStart(8)}`), t.push(` 8 ${e.header.xcCode ?? 0} ${n} ${i} ${r} 0`);
|
|
@@ -12084,7 +12102,7 @@ function Uc(e) {
|
|
|
12084
12102
|
if (e.header.extensionSwitch === 1 || e.header.extensionSwitch === 3) for (let n = 0; n < r; n++) t.push(`${(n + 1).toString().padStart(5)} ${L(e.mesh.r[n])} ${L(e.rhoatom[n])}`);
|
|
12085
12103
|
return t.join("\n");
|
|
12086
12104
|
}
|
|
12087
|
-
function
|
|
12105
|
+
function Kc(e) {
|
|
12088
12106
|
return {
|
|
12089
12107
|
1: "LDA (PW)",
|
|
12090
12108
|
2: "LDA (PW92)",
|
|
@@ -12096,27 +12114,27 @@ function Wc(e) {
|
|
|
12096
12114
|
}
|
|
12097
12115
|
//#endregion
|
|
12098
12116
|
//#region lib/core/io/pseudo/psml.ts
|
|
12099
|
-
var
|
|
12100
|
-
function
|
|
12117
|
+
var qc = "http://esl.cecam.org/PSML/ns/1.2";
|
|
12118
|
+
function Jc(e) {
|
|
12101
12119
|
let t = e.indexOf(":");
|
|
12102
12120
|
return t >= 0 ? e.substring(t + 1) : e;
|
|
12103
12121
|
}
|
|
12104
|
-
var
|
|
12122
|
+
var Yc = new Hs({
|
|
12105
12123
|
ignoreAttributes: !1,
|
|
12106
12124
|
attributeNamePrefix: "@_",
|
|
12107
12125
|
isArray: (e) => {
|
|
12108
|
-
let t =
|
|
12126
|
+
let t = Jc(e);
|
|
12109
12127
|
return t === "provenance" || t === "slps" || t === "proj" || t === "pswf" || t === "shell" || t === "functional";
|
|
12110
12128
|
}
|
|
12111
12129
|
});
|
|
12112
|
-
new
|
|
12130
|
+
new fc({
|
|
12113
12131
|
ignoreAttributes: !1,
|
|
12114
12132
|
attributeNamePrefix: "@_",
|
|
12115
12133
|
format: !0,
|
|
12116
12134
|
suppressBooleanAttributes: !1
|
|
12117
12135
|
});
|
|
12118
|
-
function
|
|
12119
|
-
let t =
|
|
12136
|
+
function Xc(e) {
|
|
12137
|
+
let t = Yc.parse(e), n = t.psml ?? t[`${qc}:psml`] ?? t, r = n.provenance, i;
|
|
12120
12138
|
if (r) {
|
|
12121
12139
|
let e = U(r);
|
|
12122
12140
|
if (e.length > 0) {
|
|
@@ -12127,12 +12145,12 @@ function Jc(e) {
|
|
|
12127
12145
|
};
|
|
12128
12146
|
}
|
|
12129
12147
|
}
|
|
12130
|
-
let a = n["pseudo-atom-spec"] ?? {}, o = z(a, "atomic-label") ||
|
|
12148
|
+
let a = n["pseudo-atom-spec"] ?? {}, o = z(a, "atomic-label") || Rc(V(a, "atomic-number")), s = B(a, "z-pseudo"), c = z(a, "relativity") || "scalar", l = z(a, "core-corrections") === "yes", u = a["exchange-correlation"]?.["libxc-info"], d = "";
|
|
12131
12149
|
u && (d = U(u.functional).map((e) => z(e, "name")).join("+"));
|
|
12132
12150
|
let f = n.grid, p = /* @__PURE__ */ new Float64Array();
|
|
12133
12151
|
if (f) {
|
|
12134
12152
|
let e = f["grid-data"];
|
|
12135
|
-
e && (p =
|
|
12153
|
+
e && (p = mc(H(e)));
|
|
12136
12154
|
}
|
|
12137
12155
|
if (p.length === 0) throw Error("Missing or empty grid in PSML file");
|
|
12138
12156
|
let m = new Float64Array(p.length);
|
|
@@ -12146,13 +12164,13 @@ function Jc(e) {
|
|
|
12146
12164
|
}, g = n["local-potential"], _ = new Float64Array(p.length);
|
|
12147
12165
|
if (g) {
|
|
12148
12166
|
let e = g.radfunc?.data;
|
|
12149
|
-
e && (_ =
|
|
12167
|
+
e && (_ = mc(H(e)));
|
|
12150
12168
|
}
|
|
12151
12169
|
let v = n["semilocal-potentials"], y = [], b = U(v);
|
|
12152
12170
|
if (b.length > 0) {
|
|
12153
12171
|
let e = U(b[0].slps);
|
|
12154
12172
|
for (let t of e) {
|
|
12155
|
-
let e =
|
|
12173
|
+
let e = Qc(z(t, "l")), n = t.radfunc?.data, r = n ? mc(H(n)) : new Float64Array(p.length);
|
|
12156
12174
|
y.push({
|
|
12157
12175
|
l: e,
|
|
12158
12176
|
vnl: r
|
|
@@ -12163,9 +12181,9 @@ function Jc(e) {
|
|
|
12163
12181
|
if (C.length > 0) {
|
|
12164
12182
|
let e = U(C[0].proj);
|
|
12165
12183
|
for (let t of e) {
|
|
12166
|
-
let e =
|
|
12184
|
+
let e = Qc(z(t, "l"));
|
|
12167
12185
|
B(t, "ekb");
|
|
12168
|
-
let n = t.radfunc?.data, r = n ?
|
|
12186
|
+
let n = t.radfunc?.data, r = n ? mc(H(n)) : new Float64Array(p.length);
|
|
12169
12187
|
S.push({
|
|
12170
12188
|
angularMomentum: e,
|
|
12171
12189
|
ultrasoftCutoffRadius: 0,
|
|
@@ -12190,7 +12208,7 @@ function Jc(e) {
|
|
|
12190
12208
|
if (E.length > 0) {
|
|
12191
12209
|
let e = U(E[0].pswf);
|
|
12192
12210
|
for (let t of e) {
|
|
12193
|
-
let e =
|
|
12211
|
+
let e = Qc(z(t, "l")), n = V(t, "n"), r = t.radfunc?.data, i = r ? mc(H(r)) : new Float64Array(p.length);
|
|
12194
12212
|
D.push({
|
|
12195
12213
|
l: e,
|
|
12196
12214
|
occupation: 0,
|
|
@@ -12203,12 +12221,12 @@ function Jc(e) {
|
|
|
12203
12221
|
let O = n["valence-charge"], k = new Float64Array(p.length);
|
|
12204
12222
|
if (O) {
|
|
12205
12223
|
let e = O.radfunc?.data;
|
|
12206
|
-
e && (k =
|
|
12224
|
+
e && (k = mc(H(e)));
|
|
12207
12225
|
}
|
|
12208
12226
|
let A = n["pseudocore-charge"], j;
|
|
12209
12227
|
if (A) {
|
|
12210
12228
|
let e = A.radfunc?.data;
|
|
12211
|
-
e && (j =
|
|
12229
|
+
e && (j = mc(H(e)));
|
|
12212
12230
|
}
|
|
12213
12231
|
return {
|
|
12214
12232
|
format: "PSML",
|
|
@@ -12250,15 +12268,15 @@ function Jc(e) {
|
|
|
12250
12268
|
nlcc: j
|
|
12251
12269
|
};
|
|
12252
12270
|
}
|
|
12253
|
-
function
|
|
12271
|
+
function Zc(e) {
|
|
12254
12272
|
let t = e.mesh.r, n = t.length, r = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
|
|
12255
12273
|
if (r += "<psml version=\"1.2\" energy_unit=\"hartree\" length_unit=\"bohr\" uuid=\"matsci-parse\">\n", e.provenance) {
|
|
12256
12274
|
let t = e.provenance.creator ?? "matsci-parse", n = e.provenance.date ?? (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
12257
12275
|
r += ` <provenance creator="${t}" date="${n}">\n`, r += " <annotation type=\"generated-by\" value=\"matsci-parse pseudopotential library\" />\n", r += " </provenance>\n";
|
|
12258
12276
|
}
|
|
12259
|
-
if (r += ` <pseudo-atom-spec atomic-label="${e.header.element}" atomic-number="${
|
|
12277
|
+
if (r += ` <pseudo-atom-spec atomic-label="${e.header.element}" atomic-number="${zc(e.header.element)}" z-pseudo="${e.header.zValence}" relativity="${e.header.relativistic}" core-corrections="${e.header.coreCorrection ? "yes" : "no"}">\n`, e.header.functional && (r += " <exchange-correlation>\n", r += " <libxc-info number-of-functionals=\"0\">\n", r += ` <functional name="${e.header.functional}" />\n`, r += " </libxc-info>\n", r += " </exchange-correlation>\n"), r += " </pseudo-atom-spec>\n", r += ` <grid npts="${n}">\n`, r += " <grid-data>\n", r += ` ${Array.from(t).map((e) => L(e).trim()).join(" ")}\n`, r += " </grid-data>\n", r += " </grid>\n", r += " <local-potential>\n", r += " <radfunc>\n", r += ` <data npts="${n}">\n`, r += ` ${R(e.local.vloc)}\n`, r += " </data>\n", r += " </radfunc>\n", r += " </local-potential>\n", e.semilocal && e.semilocal.length > 0) {
|
|
12260
12278
|
r += " <semilocal-potentials set=\"scalar_relativistic\">\n";
|
|
12261
|
-
for (let t of e.semilocal) r += ` <slps l="${
|
|
12279
|
+
for (let t of e.semilocal) r += ` <slps l="${$c(t.l)}" n="${t.l + 1}" rc="0">\n`, r += " <radfunc>\n", r += ` <data npts="${n}">${R(t.vnl)}</data>\n`, r += " </radfunc>\n", r += " </slps>\n";
|
|
12262
12280
|
r += " </semilocal-potentials>\n";
|
|
12263
12281
|
}
|
|
12264
12282
|
if (e.nonlocal.betas.length > 0) {
|
|
@@ -12266,18 +12284,18 @@ function Yc(e) {
|
|
|
12266
12284
|
let t = 1;
|
|
12267
12285
|
for (let i of e.nonlocal.betas) {
|
|
12268
12286
|
let a = e.nonlocal.dij.find(([e]) => e === t), o = a ? a[2] : 1;
|
|
12269
|
-
r += ` <proj l="${
|
|
12287
|
+
r += ` <proj l="${$c(i.angularMomentum)}" seq="${t}" ekb="${L(o).trim()}" type="kb">\n`, r += " <radfunc>\n", r += ` <data npts="${n}">${R(i.beta)}</data>\n`, r += " </radfunc>\n", r += " </proj>\n", t++;
|
|
12270
12288
|
}
|
|
12271
12289
|
r += " </nonlocal-projectors>\n";
|
|
12272
12290
|
}
|
|
12273
12291
|
if (e.pswfc.length > 0) {
|
|
12274
12292
|
r += " <pseudo-wave-functions set=\"pseudo\">\n";
|
|
12275
|
-
for (let t of e.pswfc) r += ` <pswf l="${
|
|
12293
|
+
for (let t of e.pswfc) r += ` <pswf l="${$c(t.l)}" n="${t.n ?? t.l + 1}">\n`, r += " <radfunc>\n", r += ` <data npts="${n}">${R(t.chi)}</data>\n`, r += " </radfunc>\n", r += " </pswf>\n";
|
|
12276
12294
|
r += " </pseudo-wave-functions>\n";
|
|
12277
12295
|
}
|
|
12278
12296
|
return e.rhoatom.length > 0 && (r += ` <valence-charge total-charge="${e.header.zValence}">\n`, r += " <radfunc>\n", r += ` <data npts="${n}">${R(e.rhoatom)}</data>\n`, r += " </radfunc>\n", r += " </valence-charge>\n"), e.nlcc && e.nlcc.length > 0 && (r += " <pseudocore-charge>\n", r += " <radfunc>\n", r += ` <data npts="${e.nlcc.length}">${R(e.nlcc)}</data>\n`, r += " </radfunc>\n", r += " </pseudocore-charge>\n"), r += "</psml>\n", r;
|
|
12279
12297
|
}
|
|
12280
|
-
function
|
|
12298
|
+
function Qc(e) {
|
|
12281
12299
|
return {
|
|
12282
12300
|
s: 0,
|
|
12283
12301
|
p: 1,
|
|
@@ -12286,12 +12304,12 @@ function Xc(e) {
|
|
|
12286
12304
|
g: 4
|
|
12287
12305
|
}[e.toLowerCase()] ?? 0;
|
|
12288
12306
|
}
|
|
12289
|
-
function
|
|
12307
|
+
function $c(e) {
|
|
12290
12308
|
return String.fromCharCode(115 + e);
|
|
12291
12309
|
}
|
|
12292
12310
|
//#endregion
|
|
12293
12311
|
//#region lib/core/io/pseudo/gth.ts
|
|
12294
|
-
function
|
|
12312
|
+
function el(e) {
|
|
12295
12313
|
let t = [], n = e.split("\n"), r = 0;
|
|
12296
12314
|
for (; r < n.length;) {
|
|
12297
12315
|
let e = n[r].trim();
|
|
@@ -12338,7 +12356,7 @@ function Qc(e) {
|
|
|
12338
12356
|
}
|
|
12339
12357
|
return t;
|
|
12340
12358
|
}
|
|
12341
|
-
function
|
|
12359
|
+
function tl(e, t, n, r) {
|
|
12342
12360
|
let i = new Float64Array(e.length), a = [
|
|
12343
12361
|
0,
|
|
12344
12362
|
0,
|
|
@@ -12352,33 +12370,33 @@ function $c(e, t, n, r) {
|
|
|
12352
12370
|
i[r] = -2 * t / (Math.sqrt(2 * Math.PI) * n) + a[0];
|
|
12353
12371
|
continue;
|
|
12354
12372
|
}
|
|
12355
|
-
let s = o / n, c = s * s, l =
|
|
12373
|
+
let s = o / n, c = s * s, l = ol(o / (Math.sqrt(2) * n)), u = Math.exp(-c / 2), d = -t / o * l, f = u * (a[0] + a[1] * c + a[2] * c * c + a[3] * c * c * c);
|
|
12356
12374
|
i[r] = d + f;
|
|
12357
12375
|
}
|
|
12358
12376
|
return i;
|
|
12359
12377
|
}
|
|
12360
|
-
function
|
|
12361
|
-
let i = new Float64Array(e.length), a = t + 2 * (n + 1) - 1, o = Math.sqrt(2) * (2 / (r * r)) ** (a + .5) / Math.sqrt(
|
|
12378
|
+
function nl(e, t, n, r) {
|
|
12379
|
+
let i = new Float64Array(e.length), a = t + 2 * (n + 1) - 1, o = Math.sqrt(2) * (2 / (r * r)) ** (a + .5) / Math.sqrt(sl(a + .5));
|
|
12362
12380
|
for (let t = 0; t < e.length; t++) {
|
|
12363
12381
|
let n = e[t];
|
|
12364
12382
|
n < 1e-15 ? i[t] = a === 0 ? o : 0 : i[t] = o * n ** +a * Math.exp(-n * n / (2 * r * r));
|
|
12365
12383
|
}
|
|
12366
12384
|
return i;
|
|
12367
12385
|
}
|
|
12368
|
-
function
|
|
12369
|
-
let t =
|
|
12386
|
+
function rl(e) {
|
|
12387
|
+
let t = el(e);
|
|
12370
12388
|
if (t.length === 0) throw Error("No GTH entries found in file");
|
|
12371
|
-
return
|
|
12389
|
+
return il(t[0]);
|
|
12372
12390
|
}
|
|
12373
|
-
function
|
|
12391
|
+
function il(e) {
|
|
12374
12392
|
let t = e.nElec.reduce((e, t) => e + t, 0), n = e.channels.length > 0 ? e.channels.length - 1 : 0, r = /* @__PURE__ */ new Float64Array(500), i = /* @__PURE__ */ new Float64Array(500), a = Math.log(20) / 499;
|
|
12375
12393
|
for (let e = 0; e < 500; e++) r[e] = Math.exp(a * e), i[e] = r[e] * a;
|
|
12376
12394
|
r[0] = r[1] * .01, i[0] = r[0] * a;
|
|
12377
|
-
let o =
|
|
12395
|
+
let o = tl(r, t, e.rLoc, e.cexpPpl), s = [], c = [], l = 1;
|
|
12378
12396
|
for (let t = 0; t < e.channels.length; t++) {
|
|
12379
12397
|
let n = e.channels[t];
|
|
12380
12398
|
for (let e = 0; e < n.nprjPpnl; e++) {
|
|
12381
|
-
let i =
|
|
12399
|
+
let i = nl(r, t, e, n.r);
|
|
12382
12400
|
s.push({
|
|
12383
12401
|
angularMomentum: t,
|
|
12384
12402
|
ultrasoftCutoffRadius: 0,
|
|
@@ -12444,7 +12462,7 @@ function nl(e) {
|
|
|
12444
12462
|
gth: u
|
|
12445
12463
|
};
|
|
12446
12464
|
}
|
|
12447
|
-
function
|
|
12465
|
+
function al(e) {
|
|
12448
12466
|
if (!e.gth) throw Error("Pseudopotential does not have GTH analytical parameters");
|
|
12449
12467
|
let t = [], n = e.gth;
|
|
12450
12468
|
t.push(`# ${e.header.element} ${e.header.functional}`), t.push("# Element symbol Name of the potential Alias names"), t.push("# n_elec(s) n_elec(p) n_elec(d) ..."), t.push("# r_loc nexp_ppl cexp_ppl(1) ... cexp_ppl(nexp_ppl)"), t.push("# nprj"), t.push(`${e.header.element} ${e.header.functional}`);
|
|
@@ -12466,12 +12484,12 @@ function rl(e) {
|
|
|
12466
12484
|
}
|
|
12467
12485
|
return t.join("\n");
|
|
12468
12486
|
}
|
|
12469
|
-
function
|
|
12487
|
+
function ol(e) {
|
|
12470
12488
|
let t = e >= 0 ? 1 : -1, n = Math.abs(e), r = 1 / (1 + .3275911 * n);
|
|
12471
12489
|
return t * (1 - ((((1.061405429 * r + -1.453152027) * r + 1.421413741) * r + -.284496736) * r + .254829592) * r * Math.exp(-n * n));
|
|
12472
12490
|
}
|
|
12473
|
-
function
|
|
12474
|
-
if (e < .5) return Math.PI / (Math.sin(Math.PI * e) *
|
|
12491
|
+
function sl(e) {
|
|
12492
|
+
if (e < .5) return Math.PI / (Math.sin(Math.PI * e) * sl(1 - e));
|
|
12475
12493
|
--e;
|
|
12476
12494
|
let t = [
|
|
12477
12495
|
.9999999999998099,
|
|
@@ -12490,7 +12508,7 @@ function al(e) {
|
|
|
12490
12508
|
}
|
|
12491
12509
|
//#endregion
|
|
12492
12510
|
//#region lib/core/io/json.ts
|
|
12493
|
-
function
|
|
12511
|
+
function cl(e) {
|
|
12494
12512
|
return {
|
|
12495
12513
|
lattice: Array.from(e.lattice.basis.data),
|
|
12496
12514
|
sites: e.sites.map((e) => ({
|
|
@@ -12499,7 +12517,7 @@ function ol(e) {
|
|
|
12499
12517
|
}))
|
|
12500
12518
|
};
|
|
12501
12519
|
}
|
|
12502
|
-
function
|
|
12520
|
+
function ll(e) {
|
|
12503
12521
|
return {
|
|
12504
12522
|
lattice: d(e.lattice),
|
|
12505
12523
|
sites: e.sites.map((e) => ({
|
|
@@ -12510,18 +12528,18 @@ function sl(e) {
|
|
|
12510
12528
|
}
|
|
12511
12529
|
//#endregion
|
|
12512
12530
|
//#region lib/core/io/ase.ts
|
|
12513
|
-
function
|
|
12531
|
+
function ul(e) {
|
|
12514
12532
|
return e.__ndarray__[2];
|
|
12515
12533
|
}
|
|
12516
|
-
function
|
|
12534
|
+
function dl(e, t, n) {
|
|
12517
12535
|
return { __ndarray__: [
|
|
12518
12536
|
e,
|
|
12519
12537
|
t,
|
|
12520
12538
|
n
|
|
12521
12539
|
] };
|
|
12522
12540
|
}
|
|
12523
|
-
function
|
|
12524
|
-
let t =
|
|
12541
|
+
function fl(e) {
|
|
12542
|
+
let t = ul(e.cell), n = d(new Float64Array(t)), r = ul(e.positions), i = ul(e.numbers), a = i.length, o = Array(a);
|
|
12525
12543
|
for (let e = 0; e < a; e++) {
|
|
12526
12544
|
let t = i[e], a = Vn.get(t);
|
|
12527
12545
|
if (a === void 0) throw Error(`Unknown atomic number ${t}`);
|
|
@@ -12538,14 +12556,14 @@ function ul(e) {
|
|
|
12538
12556
|
let s = {
|
|
12539
12557
|
lattice: n,
|
|
12540
12558
|
sites: o
|
|
12541
|
-
}, c =
|
|
12559
|
+
}, c = ul(e.pbc);
|
|
12542
12560
|
return c.some((e) => !e) && (s.pbc = [
|
|
12543
12561
|
c[0],
|
|
12544
12562
|
c[1],
|
|
12545
12563
|
c[2]
|
|
12546
12564
|
]), s;
|
|
12547
12565
|
}
|
|
12548
|
-
function
|
|
12566
|
+
function pl(e) {
|
|
12549
12567
|
let t = e.lattice.basis.data, n = e.sites.length, r = Array(n * 3), i = Array(n);
|
|
12550
12568
|
for (let t = 0; t < n; t++) {
|
|
12551
12569
|
let n = e.sites[t], a = ue(e.lattice, n);
|
|
@@ -12560,23 +12578,23 @@ function dl(e) {
|
|
|
12560
12578
|
!0
|
|
12561
12579
|
];
|
|
12562
12580
|
return {
|
|
12563
|
-
numbers:
|
|
12564
|
-
positions:
|
|
12565
|
-
cell:
|
|
12566
|
-
pbc:
|
|
12581
|
+
numbers: dl([n], "int64", i),
|
|
12582
|
+
positions: dl([n, 3], "float64", r),
|
|
12583
|
+
cell: dl([3, 3], "float64", Array.from(t)),
|
|
12584
|
+
pbc: dl([3], "bool", a),
|
|
12567
12585
|
__ase_objtype__: "atoms"
|
|
12568
12586
|
};
|
|
12569
12587
|
}
|
|
12570
12588
|
//#endregion
|
|
12571
12589
|
//#region lib/core/io/pymatgen.ts
|
|
12572
|
-
function
|
|
12590
|
+
function ml(e) {
|
|
12573
12591
|
let t = [];
|
|
12574
12592
|
for (let n of e) for (let e of n) t.push(e);
|
|
12575
12593
|
return t;
|
|
12576
12594
|
}
|
|
12577
|
-
function
|
|
12595
|
+
function hl(e) {
|
|
12578
12596
|
let t = {
|
|
12579
|
-
lattice: d(new Float64Array(
|
|
12597
|
+
lattice: d(new Float64Array(ml(e.lattice.matrix))),
|
|
12580
12598
|
sites: e.sites.map((e) => {
|
|
12581
12599
|
let t = e.species[0];
|
|
12582
12600
|
if (t === void 0) throw Error("Site has no species");
|
|
@@ -12595,7 +12613,7 @@ function pl(e) {
|
|
|
12595
12613
|
};
|
|
12596
12614
|
return e.charge !== void 0 && (t.charge = e.charge), e.properties !== void 0 && (t.properties = e.properties), t;
|
|
12597
12615
|
}
|
|
12598
|
-
function
|
|
12616
|
+
function gl(e) {
|
|
12599
12617
|
let t = e.lattice.basis.data, n = [
|
|
12600
12618
|
[
|
|
12601
12619
|
t[0],
|
|
@@ -12650,45 +12668,45 @@ function ml(e) {
|
|
|
12650
12668
|
}
|
|
12651
12669
|
//#endregion
|
|
12652
12670
|
//#region lib/core/units/energy.ts
|
|
12653
|
-
var
|
|
12671
|
+
var _l = {
|
|
12654
12672
|
eV: 1,
|
|
12655
12673
|
Hartree: 27.2114,
|
|
12656
12674
|
Rydberg: 13.6057,
|
|
12657
12675
|
"kJ/mol": .0103643,
|
|
12658
12676
|
"kcal/mol": .0433641
|
|
12659
|
-
},
|
|
12677
|
+
}, vl = {
|
|
12660
12678
|
Ha: "Hartree",
|
|
12661
12679
|
Ry: "Rydberg",
|
|
12662
12680
|
ev: "eV",
|
|
12663
12681
|
electronvolt: "eV"
|
|
12664
|
-
},
|
|
12665
|
-
conversions:
|
|
12666
|
-
aliases:
|
|
12682
|
+
}, yl = {
|
|
12683
|
+
conversions: _l,
|
|
12684
|
+
aliases: vl,
|
|
12667
12685
|
convert(e, t, n) {
|
|
12668
|
-
return
|
|
12686
|
+
return Rr(e, t, n, _l, vl);
|
|
12669
12687
|
},
|
|
12670
12688
|
convertArray(e, t, n) {
|
|
12671
|
-
return
|
|
12689
|
+
return zr(e, t, n, _l, vl);
|
|
12672
12690
|
}
|
|
12673
|
-
},
|
|
12691
|
+
}, bl = {
|
|
12674
12692
|
rad: 1,
|
|
12675
12693
|
deg: Math.PI / 180,
|
|
12676
12694
|
grad: Math.PI / 200
|
|
12677
|
-
},
|
|
12695
|
+
}, xl = {
|
|
12678
12696
|
"°": "deg",
|
|
12679
12697
|
deg: "deg",
|
|
12680
12698
|
rad: "rad",
|
|
12681
12699
|
gon: "grad"
|
|
12682
|
-
},
|
|
12683
|
-
conversions:
|
|
12684
|
-
aliases:
|
|
12700
|
+
}, Sl = {
|
|
12701
|
+
conversions: bl,
|
|
12702
|
+
aliases: xl,
|
|
12685
12703
|
convert(e, t, n) {
|
|
12686
|
-
return
|
|
12704
|
+
return Rr(e, t, n, bl, xl);
|
|
12687
12705
|
},
|
|
12688
12706
|
convertArray(e, t, n) {
|
|
12689
|
-
return
|
|
12707
|
+
return zr(e, t, n, bl, xl);
|
|
12690
12708
|
}
|
|
12691
|
-
},
|
|
12709
|
+
}, Cl = {
|
|
12692
12710
|
1: [1],
|
|
12693
12711
|
2: [2],
|
|
12694
12712
|
3: [
|
|
@@ -13309,8 +13327,8 @@ var hl = {
|
|
|
13309
13327
|
228: [527, 528],
|
|
13310
13328
|
229: [529],
|
|
13311
13329
|
230: [530]
|
|
13312
|
-
},
|
|
13313
|
-
function
|
|
13330
|
+
}, wl = 2 * 2 ** -52;
|
|
13331
|
+
function Tl() {
|
|
13314
13332
|
return [
|
|
13315
13333
|
[
|
|
13316
13334
|
1,
|
|
@@ -13329,7 +13347,7 @@ function Cl() {
|
|
|
13329
13347
|
]
|
|
13330
13348
|
];
|
|
13331
13349
|
}
|
|
13332
|
-
function
|
|
13350
|
+
function El() {
|
|
13333
13351
|
return [
|
|
13334
13352
|
[
|
|
13335
13353
|
-1,
|
|
@@ -13348,7 +13366,7 @@ function wl() {
|
|
|
13348
13366
|
]
|
|
13349
13367
|
];
|
|
13350
13368
|
}
|
|
13351
|
-
function
|
|
13369
|
+
function Dl(e, t) {
|
|
13352
13370
|
let [n, r, i] = e, a = Math.sqrt(n * n + r * r + i * i), o = t / 2, s = Math.sin(o) / a, c = Math.cos(o), l = s * n, u = s * r, d = s * i, f = [
|
|
13353
13371
|
[
|
|
13354
13372
|
1 - 2 * (u * u + d * d),
|
|
@@ -13366,11 +13384,11 @@ function Tl(e, t) {
|
|
|
13366
13384
|
1 - 2 * (l * l + u * u)
|
|
13367
13385
|
]
|
|
13368
13386
|
];
|
|
13369
|
-
for (let e = 0; e < 3; e++) for (let t = 0; t < 3; t++) Math.abs(f[e][t]) <
|
|
13387
|
+
for (let e = 0; e < 3; e++) for (let t = 0; t < 3; t++) Math.abs(f[e][t]) < wl && (f[e][t] = 0);
|
|
13370
13388
|
return f;
|
|
13371
13389
|
}
|
|
13372
|
-
function
|
|
13373
|
-
let n =
|
|
13390
|
+
function Ol(e, t) {
|
|
13391
|
+
let n = Dl(e, t + Math.PI);
|
|
13374
13392
|
return [
|
|
13375
13393
|
[
|
|
13376
13394
|
-n[0][0],
|
|
@@ -13389,18 +13407,18 @@ function El(e, t) {
|
|
|
13389
13407
|
]
|
|
13390
13408
|
];
|
|
13391
13409
|
}
|
|
13392
|
-
function
|
|
13410
|
+
function kl(e) {
|
|
13393
13411
|
switch (e.type) {
|
|
13394
|
-
case "I": return
|
|
13395
|
-
case "-I": return
|
|
13396
|
-
case "R": return
|
|
13397
|
-
case "S": return
|
|
13412
|
+
case "I": return Tl();
|
|
13413
|
+
case "-I": return El();
|
|
13414
|
+
case "R": return Dl(e.axis, e.angle);
|
|
13415
|
+
case "S": return Ol(e.axis, e.angle);
|
|
13398
13416
|
}
|
|
13399
13417
|
}
|
|
13400
|
-
function
|
|
13401
|
-
return e.map(
|
|
13418
|
+
function Al(e) {
|
|
13419
|
+
return e.map(kl);
|
|
13402
13420
|
}
|
|
13403
|
-
var G = { type: "I" },
|
|
13421
|
+
var G = { type: "I" }, jl = { type: "-I" }, K = (e) => ({
|
|
13404
13422
|
type: "R",
|
|
13405
13423
|
axis: [
|
|
13406
13424
|
0,
|
|
@@ -13408,7 +13426,7 @@ var G = { type: "I" }, kl = { type: "-I" }, K = (e) => ({
|
|
|
13408
13426
|
1
|
|
13409
13427
|
],
|
|
13410
13428
|
angle: e
|
|
13411
|
-
}),
|
|
13429
|
+
}), Ml = (e) => ({
|
|
13412
13430
|
type: "R",
|
|
13413
13431
|
axis: [
|
|
13414
13432
|
1,
|
|
@@ -13416,7 +13434,7 @@ var G = { type: "I" }, kl = { type: "-I" }, K = (e) => ({
|
|
|
13416
13434
|
0
|
|
13417
13435
|
],
|
|
13418
13436
|
angle: e
|
|
13419
|
-
}),
|
|
13437
|
+
}), Nl = (e) => ({
|
|
13420
13438
|
type: "R",
|
|
13421
13439
|
axis: [
|
|
13422
13440
|
0,
|
|
@@ -13428,7 +13446,7 @@ var G = { type: "I" }, kl = { type: "-I" }, K = (e) => ({
|
|
|
13428
13446
|
type: "R",
|
|
13429
13447
|
axis: e,
|
|
13430
13448
|
angle: t
|
|
13431
|
-
}),
|
|
13449
|
+
}), Pl = (e) => ({
|
|
13432
13450
|
type: "S",
|
|
13433
13451
|
axis: [
|
|
13434
13452
|
1,
|
|
@@ -13436,7 +13454,7 @@ var G = { type: "I" }, kl = { type: "-I" }, K = (e) => ({
|
|
|
13436
13454
|
0
|
|
13437
13455
|
],
|
|
13438
13456
|
angle: e
|
|
13439
|
-
}),
|
|
13457
|
+
}), Fl = (e) => ({
|
|
13440
13458
|
type: "S",
|
|
13441
13459
|
axis: [
|
|
13442
13460
|
0,
|
|
@@ -13456,33 +13474,33 @@ var G = { type: "I" }, kl = { type: "-I" }, K = (e) => ({
|
|
|
13456
13474
|
type: "S",
|
|
13457
13475
|
axis: e,
|
|
13458
13476
|
angle: t
|
|
13459
|
-
}),
|
|
13477
|
+
}), Il = Math.sqrt(3), Ll = [
|
|
13460
13478
|
-1,
|
|
13461
|
-
|
|
13479
|
+
Il,
|
|
13462
13480
|
0
|
|
13463
|
-
],
|
|
13481
|
+
], Rl = [
|
|
13464
13482
|
-1,
|
|
13465
|
-
-
|
|
13483
|
+
-Il,
|
|
13466
13484
|
0
|
|
13467
|
-
],
|
|
13468
|
-
|
|
13485
|
+
], zl = [
|
|
13486
|
+
Il,
|
|
13469
13487
|
1,
|
|
13470
13488
|
0
|
|
13471
|
-
],
|
|
13472
|
-
|
|
13489
|
+
], Bl = [
|
|
13490
|
+
Il,
|
|
13473
13491
|
-1,
|
|
13474
13492
|
0
|
|
13475
|
-
],
|
|
13493
|
+
], Vl = [
|
|
13476
13494
|
1,
|
|
13477
13495
|
1,
|
|
13478
13496
|
0
|
|
13479
|
-
],
|
|
13497
|
+
], Hl = [
|
|
13480
13498
|
1,
|
|
13481
13499
|
-1,
|
|
13482
13500
|
0
|
|
13483
|
-
], X = Math.PI, Z = X / 2,
|
|
13501
|
+
], X = Math.PI, Z = X / 2, Ul = X / 3;
|
|
13484
13502
|
X / 6;
|
|
13485
|
-
var
|
|
13503
|
+
var Wl = 2 * X / 3, Gl = -(2 * X) / 3, Kl = -X / 3, Q = [-.5, Il / 2], $ = [-.5, -Il / 2], ql = [0, 1], Jl = [0, -1], Yl = [
|
|
13486
13504
|
{
|
|
13487
13505
|
internationalNumber: 0,
|
|
13488
13506
|
hmSymbol: "",
|
|
@@ -13648,7 +13666,7 @@ var Hl = 2 * X / 3, Ul = -(2 * X) / 3, Wl = -X / 3, Q = [-.5, Pl / 2], $ = [-.5,
|
|
|
13648
13666
|
hmSymbol: "m-3m",
|
|
13649
13667
|
schoenflies: "Oh"
|
|
13650
13668
|
}
|
|
13651
|
-
],
|
|
13669
|
+
], Xl = {
|
|
13652
13670
|
C1: {
|
|
13653
13671
|
classes: { 0: [G] },
|
|
13654
13672
|
characterTable: { A: [1] },
|
|
@@ -13664,7 +13682,7 @@ var Hl = 2 * X / 3, Ul = -(2 * X) / 3, Wl = -X / 3, Q = [-.5, Pl / 2], $ = [-.5,
|
|
|
13664
13682
|
Ci: {
|
|
13665
13683
|
classes: {
|
|
13666
13684
|
0: [G],
|
|
13667
|
-
1: [
|
|
13685
|
+
1: [jl]
|
|
13668
13686
|
},
|
|
13669
13687
|
characterTable: {
|
|
13670
13688
|
Ag: [1, 1],
|
|
@@ -13719,7 +13737,7 @@ var Hl = 2 * X / 3, Ul = -(2 * X) / 3, Wl = -X / 3, Q = [-.5, Pl / 2], $ = [-.5,
|
|
|
13719
13737
|
classes: {
|
|
13720
13738
|
0: [G],
|
|
13721
13739
|
1: [K(X)],
|
|
13722
|
-
2: [
|
|
13740
|
+
2: [jl],
|
|
13723
13741
|
3: [J(0)]
|
|
13724
13742
|
},
|
|
13725
13743
|
characterTable: {
|
|
@@ -13761,8 +13779,8 @@ var Hl = 2 * X / 3, Ul = -(2 * X) / 3, Wl = -X / 3, Q = [-.5, Pl / 2], $ = [-.5,
|
|
|
13761
13779
|
classes: {
|
|
13762
13780
|
0: [G],
|
|
13763
13781
|
1: [K(X)],
|
|
13764
|
-
2: [
|
|
13765
|
-
3: [
|
|
13782
|
+
2: [Nl(X)],
|
|
13783
|
+
3: [Ml(X)]
|
|
13766
13784
|
},
|
|
13767
13785
|
characterTable: {
|
|
13768
13786
|
A: [
|
|
@@ -13812,8 +13830,8 @@ var Hl = 2 * X / 3, Ul = -(2 * X) / 3, Wl = -X / 3, Q = [-.5, Pl / 2], $ = [-.5,
|
|
|
13812
13830
|
classes: {
|
|
13813
13831
|
0: [G],
|
|
13814
13832
|
1: [K(X)],
|
|
13815
|
-
2: [
|
|
13816
|
-
3: [
|
|
13833
|
+
2: [Fl(0)],
|
|
13834
|
+
3: [Pl(0)]
|
|
13817
13835
|
},
|
|
13818
13836
|
characterTable: {
|
|
13819
13837
|
A1: [
|
|
@@ -13863,12 +13881,12 @@ var Hl = 2 * X / 3, Ul = -(2 * X) / 3, Wl = -X / 3, Q = [-.5, Pl / 2], $ = [-.5,
|
|
|
13863
13881
|
classes: {
|
|
13864
13882
|
0: [G],
|
|
13865
13883
|
1: [K(X)],
|
|
13866
|
-
2: [
|
|
13867
|
-
3: [
|
|
13868
|
-
4: [
|
|
13884
|
+
2: [Nl(X)],
|
|
13885
|
+
3: [Ml(X)],
|
|
13886
|
+
4: [jl],
|
|
13869
13887
|
5: [J(0)],
|
|
13870
|
-
6: [
|
|
13871
|
-
7: [
|
|
13888
|
+
6: [Fl(0)],
|
|
13889
|
+
7: [Pl(0)]
|
|
13872
13890
|
},
|
|
13873
13891
|
characterTable: {
|
|
13874
13892
|
Ag: [
|
|
@@ -13993,14 +14011,14 @@ var Hl = 2 * X / 3, Ul = -(2 * X) / 3, Wl = -X / 3, Q = [-.5, Pl / 2], $ = [-.5,
|
|
|
13993
14011
|
"1E": [
|
|
13994
14012
|
1,
|
|
13995
14013
|
-1,
|
|
13996
|
-
|
|
13997
|
-
|
|
14014
|
+
Jl,
|
|
14015
|
+
ql
|
|
13998
14016
|
],
|
|
13999
14017
|
"2E": [
|
|
14000
14018
|
1,
|
|
14001
14019
|
-1,
|
|
14002
|
-
|
|
14003
|
-
|
|
14020
|
+
ql,
|
|
14021
|
+
Jl
|
|
14004
14022
|
]
|
|
14005
14023
|
},
|
|
14006
14024
|
raman: [
|
|
@@ -14054,14 +14072,14 @@ var Hl = 2 * X / 3, Ul = -(2 * X) / 3, Wl = -X / 3, Q = [-.5, Pl / 2], $ = [-.5,
|
|
|
14054
14072
|
"1E": [
|
|
14055
14073
|
1,
|
|
14056
14074
|
-1,
|
|
14057
|
-
|
|
14058
|
-
|
|
14075
|
+
Jl,
|
|
14076
|
+
ql
|
|
14059
14077
|
],
|
|
14060
14078
|
"2E": [
|
|
14061
14079
|
1,
|
|
14062
14080
|
-1,
|
|
14063
|
-
|
|
14064
|
-
|
|
14081
|
+
ql,
|
|
14082
|
+
Jl
|
|
14065
14083
|
]
|
|
14066
14084
|
},
|
|
14067
14085
|
raman: [
|
|
@@ -14098,7 +14116,7 @@ var Hl = 2 * X / 3, Ul = -(2 * X) / 3, Wl = -X / 3, Q = [-.5, Pl / 2], $ = [-.5,
|
|
|
14098
14116
|
1: [K(X)],
|
|
14099
14117
|
2: [K(Z)],
|
|
14100
14118
|
3: [K(-Z)],
|
|
14101
|
-
4: [
|
|
14119
|
+
4: [jl],
|
|
14102
14120
|
5: [J(0)],
|
|
14103
14121
|
6: [J(-Z)],
|
|
14104
14122
|
7: [J(Z)]
|
|
@@ -14127,22 +14145,22 @@ var Hl = 2 * X / 3, Ul = -(2 * X) / 3, Wl = -X / 3, Q = [-.5, Pl / 2], $ = [-.5,
|
|
|
14127
14145
|
"1Eg": [
|
|
14128
14146
|
1,
|
|
14129
14147
|
-1,
|
|
14130
|
-
|
|
14131
|
-
|
|
14148
|
+
Jl,
|
|
14149
|
+
ql,
|
|
14132
14150
|
1,
|
|
14133
14151
|
-1,
|
|
14134
|
-
|
|
14135
|
-
|
|
14152
|
+
Jl,
|
|
14153
|
+
ql
|
|
14136
14154
|
],
|
|
14137
14155
|
"2Eg": [
|
|
14138
14156
|
1,
|
|
14139
14157
|
-1,
|
|
14140
|
-
|
|
14141
|
-
|
|
14158
|
+
ql,
|
|
14159
|
+
Jl,
|
|
14142
14160
|
1,
|
|
14143
14161
|
-1,
|
|
14144
|
-
|
|
14145
|
-
|
|
14162
|
+
ql,
|
|
14163
|
+
Jl
|
|
14146
14164
|
],
|
|
14147
14165
|
Au: [
|
|
14148
14166
|
1,
|
|
@@ -14167,22 +14185,22 @@ var Hl = 2 * X / 3, Ul = -(2 * X) / 3, Wl = -X / 3, Q = [-.5, Pl / 2], $ = [-.5,
|
|
|
14167
14185
|
"1Eu": [
|
|
14168
14186
|
1,
|
|
14169
14187
|
-1,
|
|
14170
|
-
|
|
14171
|
-
|
|
14188
|
+
Jl,
|
|
14189
|
+
ql,
|
|
14172
14190
|
-1,
|
|
14173
14191
|
1,
|
|
14174
|
-
|
|
14175
|
-
|
|
14192
|
+
ql,
|
|
14193
|
+
Jl
|
|
14176
14194
|
],
|
|
14177
14195
|
"2Eu": [
|
|
14178
14196
|
1,
|
|
14179
14197
|
-1,
|
|
14180
|
-
|
|
14181
|
-
|
|
14198
|
+
ql,
|
|
14199
|
+
Jl,
|
|
14182
14200
|
-1,
|
|
14183
14201
|
1,
|
|
14184
|
-
|
|
14185
|
-
|
|
14202
|
+
Jl,
|
|
14203
|
+
ql
|
|
14186
14204
|
]
|
|
14187
14205
|
},
|
|
14188
14206
|
raman: [
|
|
@@ -14218,8 +14236,8 @@ var Hl = 2 * X / 3, Ul = -(2 * X) / 3, Wl = -X / 3, Q = [-.5, Pl / 2], $ = [-.5,
|
|
|
14218
14236
|
0: [G],
|
|
14219
14237
|
1: [K(X)],
|
|
14220
14238
|
2: [K(Z), K(-Z)],
|
|
14221
|
-
3: [
|
|
14222
|
-
4: [q(
|
|
14239
|
+
3: [Ml(X), Nl(X)],
|
|
14240
|
+
4: [q(Vl, X), q(Hl, X)]
|
|
14223
14241
|
},
|
|
14224
14242
|
characterTable: {
|
|
14225
14243
|
A1: [
|
|
@@ -14289,8 +14307,8 @@ var Hl = 2 * X / 3, Ul = -(2 * X) / 3, Wl = -X / 3, Q = [-.5, Pl / 2], $ = [-.5,
|
|
|
14289
14307
|
0: [G],
|
|
14290
14308
|
1: [K(X)],
|
|
14291
14309
|
2: [K(Z), K(-Z)],
|
|
14292
|
-
3: [
|
|
14293
|
-
4: [Y(
|
|
14310
|
+
3: [Pl(0), Fl(0)],
|
|
14311
|
+
4: [Y(Vl, 0), Y(Hl, 0)]
|
|
14294
14312
|
},
|
|
14295
14313
|
characterTable: {
|
|
14296
14314
|
A1: [
|
|
@@ -14360,8 +14378,8 @@ var Hl = 2 * X / 3, Ul = -(2 * X) / 3, Wl = -X / 3, Q = [-.5, Pl / 2], $ = [-.5,
|
|
|
14360
14378
|
0: [G],
|
|
14361
14379
|
1: [K(X)],
|
|
14362
14380
|
2: [J(Z), J(-Z)],
|
|
14363
|
-
3: [
|
|
14364
|
-
4: [Y(
|
|
14381
|
+
3: [Ml(X), Nl(X)],
|
|
14382
|
+
4: [Y(Vl, 0), Y(Hl, 0)]
|
|
14365
14383
|
},
|
|
14366
14384
|
characterTable: {
|
|
14367
14385
|
A1: [
|
|
@@ -14431,13 +14449,13 @@ var Hl = 2 * X / 3, Ul = -(2 * X) / 3, Wl = -X / 3, Q = [-.5, Pl / 2], $ = [-.5,
|
|
|
14431
14449
|
0: [G],
|
|
14432
14450
|
1: [K(X)],
|
|
14433
14451
|
2: [K(Z), K(-Z)],
|
|
14434
|
-
3: [
|
|
14435
|
-
4: [q(
|
|
14436
|
-
5: [
|
|
14452
|
+
3: [Ml(X), Nl(X)],
|
|
14453
|
+
4: [q(Vl, X), q(Hl, X)],
|
|
14454
|
+
5: [jl],
|
|
14437
14455
|
6: [J(0)],
|
|
14438
14456
|
7: [J(Z), J(-Z)],
|
|
14439
|
-
8: [
|
|
14440
|
-
9: [Y(
|
|
14457
|
+
8: [Pl(0), Fl(0)],
|
|
14458
|
+
9: [Y(Vl, 0), Y(Hl, 0)]
|
|
14441
14459
|
},
|
|
14442
14460
|
characterTable: {
|
|
14443
14461
|
A1g: [
|
|
@@ -14590,8 +14608,8 @@ var Hl = 2 * X / 3, Ul = -(2 * X) / 3, Wl = -X / 3, Q = [-.5, Pl / 2], $ = [-.5,
|
|
|
14590
14608
|
C3: {
|
|
14591
14609
|
classes: {
|
|
14592
14610
|
0: [G],
|
|
14593
|
-
1: [K(
|
|
14594
|
-
2: [K(
|
|
14611
|
+
1: [K(Wl)],
|
|
14612
|
+
2: [K(Gl)]
|
|
14595
14613
|
},
|
|
14596
14614
|
characterTable: {
|
|
14597
14615
|
A: [
|
|
@@ -14642,11 +14660,11 @@ var Hl = 2 * X / 3, Ul = -(2 * X) / 3, Wl = -X / 3, Q = [-.5, Pl / 2], $ = [-.5,
|
|
|
14642
14660
|
C3i: {
|
|
14643
14661
|
classes: {
|
|
14644
14662
|
0: [G],
|
|
14645
|
-
1: [K(
|
|
14646
|
-
2: [K(
|
|
14647
|
-
3: [
|
|
14648
|
-
4: [J(
|
|
14649
|
-
5: [J(
|
|
14663
|
+
1: [K(Wl)],
|
|
14664
|
+
2: [K(Gl)],
|
|
14665
|
+
3: [jl],
|
|
14666
|
+
4: [J(Kl)],
|
|
14667
|
+
5: [J(Ul)]
|
|
14650
14668
|
},
|
|
14651
14669
|
characterTable: {
|
|
14652
14670
|
Ag: [
|
|
@@ -14730,11 +14748,11 @@ var Hl = 2 * X / 3, Ul = -(2 * X) / 3, Wl = -X / 3, Q = [-.5, Pl / 2], $ = [-.5,
|
|
|
14730
14748
|
D3: {
|
|
14731
14749
|
classes: {
|
|
14732
14750
|
0: [G],
|
|
14733
|
-
1: [K(
|
|
14751
|
+
1: [K(Wl), K(Gl)],
|
|
14734
14752
|
2: [
|
|
14735
|
-
|
|
14736
|
-
q(
|
|
14737
|
-
q(
|
|
14753
|
+
Ml(X),
|
|
14754
|
+
q(Ll, X),
|
|
14755
|
+
q(Rl, X)
|
|
14738
14756
|
]
|
|
14739
14757
|
},
|
|
14740
14758
|
characterTable: {
|
|
@@ -14766,11 +14784,11 @@ var Hl = 2 * X / 3, Ul = -(2 * X) / 3, Wl = -X / 3, Q = [-.5, Pl / 2], $ = [-.5,
|
|
|
14766
14784
|
C3v: {
|
|
14767
14785
|
classes: {
|
|
14768
14786
|
0: [G],
|
|
14769
|
-
1: [K(
|
|
14787
|
+
1: [K(Wl), K(Gl)],
|
|
14770
14788
|
2: [
|
|
14771
|
-
|
|
14772
|
-
Y(
|
|
14773
|
-
Y(
|
|
14789
|
+
Pl(0),
|
|
14790
|
+
Y(Ll, 0),
|
|
14791
|
+
Y(Rl, 0)
|
|
14774
14792
|
]
|
|
14775
14793
|
},
|
|
14776
14794
|
characterTable: {
|
|
@@ -14802,18 +14820,18 @@ var Hl = 2 * X / 3, Ul = -(2 * X) / 3, Wl = -X / 3, Q = [-.5, Pl / 2], $ = [-.5,
|
|
|
14802
14820
|
D3d: {
|
|
14803
14821
|
classes: {
|
|
14804
14822
|
0: [G],
|
|
14805
|
-
1: [K(
|
|
14823
|
+
1: [K(Wl), K(Gl)],
|
|
14806
14824
|
2: [
|
|
14807
|
-
|
|
14808
|
-
q(
|
|
14809
|
-
q(
|
|
14825
|
+
Ml(X),
|
|
14826
|
+
q(Ll, X),
|
|
14827
|
+
q(Rl, X)
|
|
14810
14828
|
],
|
|
14811
|
-
3: [
|
|
14812
|
-
4: [J(
|
|
14829
|
+
3: [jl],
|
|
14830
|
+
4: [J(Kl), J(Ul)],
|
|
14813
14831
|
5: [
|
|
14814
|
-
|
|
14815
|
-
Y(
|
|
14816
|
-
Y(
|
|
14832
|
+
Pl(0),
|
|
14833
|
+
Y(Ll, 0),
|
|
14834
|
+
Y(Rl, 0)
|
|
14817
14835
|
]
|
|
14818
14836
|
},
|
|
14819
14837
|
characterTable: {
|
|
@@ -14878,11 +14896,11 @@ var Hl = 2 * X / 3, Ul = -(2 * X) / 3, Wl = -X / 3, Q = [-.5, Pl / 2], $ = [-.5,
|
|
|
14878
14896
|
C6: {
|
|
14879
14897
|
classes: {
|
|
14880
14898
|
0: [G],
|
|
14881
|
-
1: [K(
|
|
14882
|
-
2: [K(
|
|
14899
|
+
1: [K(Ul)],
|
|
14900
|
+
2: [K(Wl)],
|
|
14883
14901
|
3: [K(X)],
|
|
14884
|
-
4: [K(
|
|
14885
|
-
5: [K(-
|
|
14902
|
+
4: [K(Gl)],
|
|
14903
|
+
5: [K(-Ul)]
|
|
14886
14904
|
},
|
|
14887
14905
|
characterTable: {
|
|
14888
14906
|
A: [
|
|
@@ -14972,11 +14990,11 @@ var Hl = 2 * X / 3, Ul = -(2 * X) / 3, Wl = -X / 3, Q = [-.5, Pl / 2], $ = [-.5,
|
|
|
14972
14990
|
C3h: {
|
|
14973
14991
|
classes: {
|
|
14974
14992
|
0: [G],
|
|
14975
|
-
1: [K(
|
|
14976
|
-
2: [K(
|
|
14993
|
+
1: [K(Wl)],
|
|
14994
|
+
2: [K(Gl)],
|
|
14977
14995
|
3: [J(0)],
|
|
14978
|
-
4: [J(
|
|
14979
|
-
5: [J(
|
|
14996
|
+
4: [J(Gl)],
|
|
14997
|
+
5: [J(Wl)]
|
|
14980
14998
|
},
|
|
14981
14999
|
characterTable: {
|
|
14982
15000
|
"A'": [
|
|
@@ -15066,17 +15084,17 @@ var Hl = 2 * X / 3, Ul = -(2 * X) / 3, Wl = -X / 3, Q = [-.5, Pl / 2], $ = [-.5,
|
|
|
15066
15084
|
C6h: {
|
|
15067
15085
|
classes: {
|
|
15068
15086
|
0: [G],
|
|
15069
|
-
1: [K(
|
|
15070
|
-
2: [K(
|
|
15087
|
+
1: [K(Ul)],
|
|
15088
|
+
2: [K(Wl)],
|
|
15071
15089
|
3: [K(X)],
|
|
15072
|
-
4: [K(
|
|
15073
|
-
5: [K(-
|
|
15074
|
-
6: [
|
|
15075
|
-
7: [J(
|
|
15076
|
-
8: [J(-
|
|
15090
|
+
4: [K(Gl)],
|
|
15091
|
+
5: [K(-Ul)],
|
|
15092
|
+
6: [jl],
|
|
15093
|
+
7: [J(Gl)],
|
|
15094
|
+
8: [J(-Ul)],
|
|
15077
15095
|
9: [J(0)],
|
|
15078
|
-
10: [J(
|
|
15079
|
-
11: [J(
|
|
15096
|
+
10: [J(Ul)],
|
|
15097
|
+
11: [J(Wl)]
|
|
15080
15098
|
},
|
|
15081
15099
|
characterTable: {
|
|
15082
15100
|
Ag: [
|
|
@@ -15287,17 +15305,17 @@ var Hl = 2 * X / 3, Ul = -(2 * X) / 3, Wl = -X / 3, Q = [-.5, Pl / 2], $ = [-.5,
|
|
|
15287
15305
|
classes: {
|
|
15288
15306
|
0: [G],
|
|
15289
15307
|
1: [K(X)],
|
|
15290
|
-
2: [K(
|
|
15291
|
-
3: [K(
|
|
15308
|
+
2: [K(Wl), K(Gl)],
|
|
15309
|
+
3: [K(Ul), K(-Ul)],
|
|
15292
15310
|
4: [
|
|
15293
|
-
|
|
15294
|
-
q(Fl, X),
|
|
15295
|
-
q(Il, X)
|
|
15296
|
-
],
|
|
15297
|
-
5: [
|
|
15298
|
-
jl(X),
|
|
15311
|
+
Ml(X),
|
|
15299
15312
|
q(Ll, X),
|
|
15300
15313
|
q(Rl, X)
|
|
15314
|
+
],
|
|
15315
|
+
5: [
|
|
15316
|
+
Nl(X),
|
|
15317
|
+
q(zl, X),
|
|
15318
|
+
q(Bl, X)
|
|
15301
15319
|
]
|
|
15302
15320
|
},
|
|
15303
15321
|
characterTable: {
|
|
@@ -15375,17 +15393,17 @@ var Hl = 2 * X / 3, Ul = -(2 * X) / 3, Wl = -X / 3, Q = [-.5, Pl / 2], $ = [-.5,
|
|
|
15375
15393
|
classes: {
|
|
15376
15394
|
0: [G],
|
|
15377
15395
|
1: [K(X)],
|
|
15378
|
-
2: [K(
|
|
15379
|
-
3: [K(
|
|
15396
|
+
2: [K(Wl), K(Gl)],
|
|
15397
|
+
3: [K(Ul), K(-Ul)],
|
|
15380
15398
|
4: [
|
|
15381
|
-
|
|
15382
|
-
Y(Fl, 0),
|
|
15383
|
-
Y(Il, 0)
|
|
15384
|
-
],
|
|
15385
|
-
5: [
|
|
15386
|
-
Nl(0),
|
|
15399
|
+
Pl(0),
|
|
15387
15400
|
Y(Ll, 0),
|
|
15388
15401
|
Y(Rl, 0)
|
|
15402
|
+
],
|
|
15403
|
+
5: [
|
|
15404
|
+
Fl(0),
|
|
15405
|
+
Y(zl, 0),
|
|
15406
|
+
Y(Bl, 0)
|
|
15389
15407
|
]
|
|
15390
15408
|
},
|
|
15391
15409
|
characterTable: {
|
|
@@ -15463,17 +15481,17 @@ var Hl = 2 * X / 3, Ul = -(2 * X) / 3, Wl = -X / 3, Q = [-.5, Pl / 2], $ = [-.5,
|
|
|
15463
15481
|
classes: {
|
|
15464
15482
|
0: [G],
|
|
15465
15483
|
1: [J(0)],
|
|
15466
|
-
2: [K(
|
|
15467
|
-
3: [J(
|
|
15484
|
+
2: [K(Wl), K(Gl)],
|
|
15485
|
+
3: [J(Wl), J(Gl)],
|
|
15468
15486
|
4: [
|
|
15469
|
-
|
|
15470
|
-
q(
|
|
15471
|
-
q(
|
|
15487
|
+
Ml(X),
|
|
15488
|
+
q(Ll, X),
|
|
15489
|
+
q(Rl, X)
|
|
15472
15490
|
],
|
|
15473
15491
|
5: [
|
|
15474
|
-
|
|
15475
|
-
Y(
|
|
15476
|
-
Y(
|
|
15492
|
+
Fl(0),
|
|
15493
|
+
Y(zl, 0),
|
|
15494
|
+
Y(Bl, 0)
|
|
15477
15495
|
]
|
|
15478
15496
|
},
|
|
15479
15497
|
characterTable: {
|
|
@@ -15550,32 +15568,32 @@ var Hl = 2 * X / 3, Ul = -(2 * X) / 3, Wl = -X / 3, Q = [-.5, Pl / 2], $ = [-.5,
|
|
|
15550
15568
|
D6h: {
|
|
15551
15569
|
classes: {
|
|
15552
15570
|
0: [G],
|
|
15553
|
-
1: [K(
|
|
15554
|
-
2: [K(
|
|
15571
|
+
1: [K(Ul), K(-Ul)],
|
|
15572
|
+
2: [K(Wl), K(Gl)],
|
|
15555
15573
|
3: [K(X)],
|
|
15556
15574
|
4: [
|
|
15557
|
-
|
|
15558
|
-
q(Fl, X),
|
|
15559
|
-
q(Il, X)
|
|
15560
|
-
],
|
|
15561
|
-
5: [
|
|
15562
|
-
jl(X),
|
|
15575
|
+
Ml(X),
|
|
15563
15576
|
q(Ll, X),
|
|
15564
15577
|
q(Rl, X)
|
|
15565
15578
|
],
|
|
15566
|
-
|
|
15567
|
-
|
|
15568
|
-
|
|
15579
|
+
5: [
|
|
15580
|
+
Nl(X),
|
|
15581
|
+
q(zl, X),
|
|
15582
|
+
q(Bl, X)
|
|
15583
|
+
],
|
|
15584
|
+
6: [jl],
|
|
15585
|
+
7: [J(Wl), J(Gl)],
|
|
15586
|
+
8: [J(Ul), J(-Ul)],
|
|
15569
15587
|
9: [J(0)],
|
|
15570
15588
|
10: [
|
|
15571
|
-
|
|
15572
|
-
Y(Fl, 0),
|
|
15573
|
-
Y(Il, 0)
|
|
15574
|
-
],
|
|
15575
|
-
11: [
|
|
15576
|
-
Nl(0),
|
|
15589
|
+
Pl(0),
|
|
15577
15590
|
Y(Ll, 0),
|
|
15578
15591
|
Y(Rl, 0)
|
|
15592
|
+
],
|
|
15593
|
+
11: [
|
|
15594
|
+
Fl(0),
|
|
15595
|
+
Y(zl, 0),
|
|
15596
|
+
Y(Bl, 0)
|
|
15579
15597
|
]
|
|
15580
15598
|
},
|
|
15581
15599
|
characterTable: {
|
|
@@ -15771,6 +15789,6 @@ var Hl = 2 * X / 3, Ul = -(2 * X) / 3, Wl = -X / 3, Q = [-.5, Pl / 2], $ = [-.5,
|
|
|
15771
15789
|
}
|
|
15772
15790
|
};
|
|
15773
15791
|
//#endregion
|
|
15774
|
-
export {
|
|
15792
|
+
export { Sl as AngleUnitSystem, Vn as AtomicNumberToSymbol, s as EPSILON, yl as EnergyUnitSystem, Hr as LengthUnitSystem, Ln as PeriodicTable, Bn as SymbolToAtomicNumber, ne as addVacuum, on as alphabeticalFormula, Be as analyzeStructure, we as angles, un as anonymousFormula, S as appendSite, C as appendSites, h as applyTransformationBasis, Dt as bandPathData, le as calculateScaleFactor, v as canonicalize, ue as cartesian, Un as cellMass, it as cellParams, c as clean, Vt as composition, Rr as convertMeasurement, zr as convertMeasurementArray, d as createLattice, Jn as createSite, Qn as createSpecies, er as createVolumetricData, je as cubic, Wn as density, Tt as determineAP, Et as determineExtBravais, Yn as distance, Bt as electronegativity, Rn as elementBySymbol, mt as evalExpr, ft as evalExprSimple, pt as extendKparam, nr as fill, Nn as findSites, Pn as findSitesBySpecies, de as fractional, fl as fromASE, _r as fromCIF, ha as fromCrystalD3, Bc as fromFHI, rr as fromFunction, Gr as fromGRO, rl as fromGTH, il as fromGthEntry, ll as fromJSON, Gi as fromKPOINTS, ir as fromMatrixSlices, Ir as fromOptimade, Xr as fromPDB, xr as fromPOSCAR, Xc as fromPSML, Wc as fromPSP8, ui as fromPW, Mi as fromPWKPoints, M as fromParameters, hl as fromPymatgen, Cr as fromStructureData, Ac as fromUPF, Fc as fromUPFv1, Er as fromXSF, Nr as fromXYZ, l as gcd, Je as generateBZVertices, Qe as getBZPolyhedron, zt as getBrillouinZoneData, An as getDistance, jn as getDistances, Mn as getDistancesMatrix, zn as getElement, Kn as getElements, Lt as getExplicitFromImplicit, Rt as getExplicitKPath, Mt as getPath, st as getPmatrix, ct as getPrimitive, ot as getRealCellFromReciprocalRows, at as getReciprocalCellRows, jt as getSeekPathHighSymPath, Gn as getSpecies, qn as getSpeciesCounts, Ve as getSymmetry, Cl as hallNumbersOfSpacegroup, x as hashStructure, Me as hexagonal, rn as hillFormula, Tl as identity, tr as index, Re as initMoyo, w as insertSite, T as insertSites, oe as inverse, El as inversion, cn as iupacFormula, $n as kpoints, zi as kpointsFromPW, Vi as kpointsToPW, ke as kspacingToGrid, u as lcm, Te as lengths, kn as matchStructures, rt as matrixFromRowMajor, Ee as metricTensor, Ne as monoclinic, hn as numAtoms, ar as ones, Pe as orthorhombic, Oe as parameters, mn as parseFormula, el as parseGTHFile, Xl as pointgroupDict, Yl as pointgroupMapping, be as reciprocalLattice, se as reciprocalLatticeCrystallographic, sn as reducedAlphabeticalFormula, dn as reducedAnonymousFormula, qt as reducedComposition, an as reducedFormula, ln as reducedIUPACFormula, pn as reducedSubscriptFormula, E as removeSite, D as removeSites, te as reorientToNormal, O as replaceSite, k as replaceSites, Al as resolveClass, kl as resolveOp, Fe as rhombohedral, Dl as rotationMatrix, Ol as rotoreflectionMatrix, he as slabFromMillerIndex, Se as slabFromSites, g as sortSites, fn as subscriptFormula, me as supercell, Ie as tetragonal, pl as toASE, vr as toCIF, _a as toCrystalD3, Uc as toFHI, Kr as toGRO, al as toGTH, cl as toJSON, na as toKPOINTS, ht as toMatrix, Lr as toOptimade, Zr as toPDB, Sr as toPOSCAR, Zc as toPSML, Gc as toPSP8, mi as toPW, Fi as toPWKPoints, gl as toPymatgen, wr as toStructureData, jc as toUPF, Ic as toUPFv1, kr as toXSF, Fr as toXYZ, Ct as transformAP, gt as vecMulMat, In as volume, Zn as wrap, or as zeros };
|
|
15775
15793
|
|
|
15776
15794
|
//# sourceMappingURL=index.js.map
|