@souldi/try-on 0.1.64 → 0.1.65

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.
@@ -1,40 +1,52 @@
1
+ //#region src/measurement-fields.mjs
2
+ var e = Object.freeze([
3
+ "chest",
4
+ "waist",
5
+ "hips",
6
+ "sleeve_length",
7
+ "inseam",
8
+ "shoulder_width",
9
+ "torso_length"
10
+ ]), t = Object.freeze(["height", ...e]), n = Object.freeze(new Set(["torso_length"]));
11
+ Object.freeze(Object.fromEntries(t.filter((e) => !n.has(e)).map((e) => [`declared_${e}_cm`, e])));
12
+ //#endregion
1
13
  //#region src/mannequin3d.js
2
- async function e(e, t, n = []) {
3
- let [r, { GLTFLoader: i }] = await Promise.all([import("./mannequin-chunks/three.module-BqUhHzuP.mjs"), import("./mannequin-chunks/GLTFLoader-S0hpQWQS.mjs")]), a = !1, o = new r.Scene(), s = e.clientWidth || 300, c = e.clientHeight || 260, l = new r.WebGLRenderer({
14
+ async function r(t, n, r = []) {
15
+ let [i, { GLTFLoader: a }] = await Promise.all([import("./mannequin-chunks/three.module-BqUhHzuP.mjs"), import("./mannequin-chunks/GLTFLoader-S0hpQWQS.mjs")]), o = !1, s = new i.Scene(), c = t.clientWidth || 300, l = t.clientHeight || 260, u = new i.WebGLRenderer({
4
16
  antialias: !0,
5
17
  alpha: !0
6
18
  });
7
- l.setPixelRatio(Math.min(2, window.devicePixelRatio || 1)), l.setSize(s, c), l.outputColorSpace = r.SRGBColorSpace, l.domElement.style.cssText = "position:absolute;inset:0;z-index:1;", e.appendChild(l.domElement), o.add(new r.HemisphereLight(16777215, 12170412, 1.5));
8
- let u = new r.DirectionalLight(16777215, 1.6);
9
- u.position.set(2, 4, 5), o.add(u);
10
- let d = new r.DirectionalLight(16777215, .7);
11
- d.position.set(-3, 2, -4), o.add(d);
12
- let f = new r.MeshStandardMaterial({
19
+ u.setPixelRatio(Math.min(2, window.devicePixelRatio || 1)), u.setSize(c, l), u.outputColorSpace = i.SRGBColorSpace, u.domElement.style.cssText = "position:absolute;inset:0;z-index:1;", t.appendChild(u.domElement), s.add(new i.HemisphereLight(16777215, 12170412, 1.5));
20
+ let d = new i.DirectionalLight(16777215, 1.6);
21
+ d.position.set(2, 4, 5), s.add(d);
22
+ let f = new i.DirectionalLight(16777215, .7);
23
+ f.position.set(-3, 2, -4), s.add(f);
24
+ let p = new i.MeshStandardMaterial({
13
25
  color: 16053489,
14
26
  roughness: .45,
15
27
  metalness: 0
16
- }), p = [f], m = [], h = await new Promise((e, n) => new i().load(t, e, void 0, n));
17
- if (a) return { destroy() {} };
18
- let g = h.scene;
19
- g.traverse((e) => {
20
- e.isMesh && (e.material = f, p.push(e.geometry));
21
- }), o.add(g);
22
- let _ = new r.Box3().setFromObject(g), v = 1.68 / (_.max.y - _.min.y || 1);
23
- g.scale.setScalar(v), g.updateMatrixWorld(!0);
24
- let y = new r.Box3().setFromObject(g);
25
- g.position.y -= y.min.y + .7, g.position.x -= (y.min.x + y.max.x) / 2, g.position.z -= (y.min.z + y.max.z) / 2, g.updateMatrixWorld(!0);
26
- let b = .01, x = [], S = new r.Vector3();
27
- g.traverse((e) => {
28
+ }), m = [p], h = [], g = await new Promise((e, t) => new a().load(n, e, void 0, t));
29
+ if (o) return { destroy() {} };
30
+ let _ = g.scene;
31
+ _.traverse((e) => {
32
+ e.isMesh && (e.material = p, m.push(e.geometry));
33
+ }), s.add(_);
34
+ let v = new i.Box3().setFromObject(_), y = 1.68 / (v.max.y - v.min.y || 1);
35
+ _.scale.setScalar(y), _.updateMatrixWorld(!0);
36
+ let b = new i.Box3().setFromObject(_);
37
+ _.position.y -= b.min.y + .7, _.position.x -= (b.min.x + b.max.x) / 2, _.position.z -= (b.min.z + b.max.z) / 2, _.updateMatrixWorld(!0);
38
+ let x = .01, S = [], C = new i.Vector3();
39
+ _.traverse((e) => {
28
40
  if (!e.isMesh) return;
29
41
  let t = e.geometry.getAttribute("position"), n = Math.max(1, Math.floor(t.count / 8e4));
30
- for (let r = 0; r < t.count; r += n) S.fromBufferAttribute(t, r), e.localToWorld(S), x.push(S.x, S.y, S.z);
42
+ for (let r = 0; r < t.count; r += n) C.fromBufferAttribute(t, r), e.localToWorld(C), S.push(C.x, C.y, C.z);
31
43
  });
32
- let C = .98, w = (e, t) => {
44
+ let w = .98, T = (e, t) => {
33
45
  let n = [];
34
- for (let r = 0; r < x.length; r += 3) Math.abs(x[r + 1] - e) <= t && n.push([x[r], x[r + 2]]);
46
+ for (let r = 0; r < S.length; r += 3) Math.abs(S[r + 1] - e) <= t && n.push([S[r], S[r + 2]]);
35
47
  return n;
36
- }, T = (e, t, n, r) => {
37
- let i = w(e, r || .011), a = Infinity, o = -Infinity, s = Infinity, c = -Infinity, l = 0;
48
+ }, E = (e, t, n, r) => {
49
+ let i = T(e, r || .011), a = Infinity, o = -Infinity, s = Infinity, c = -Infinity, l = 0;
38
50
  return i.forEach((e) => {
39
51
  e[0] <= t || e[0] >= n || (l++, e[0] < a && (a = e[0]), e[0] > o && (o = e[0]), e[1] < s && (s = e[1]), e[1] > c && (c = e[1]));
40
52
  }), l < 6 ? null : {
@@ -46,77 +58,77 @@ async function e(e, t, n = []) {
46
58
  cz: (s + c) / 2,
47
59
  w: o - a
48
60
  };
49
- }, E = (e) => {
50
- let t = T(e, -.5, .5, .008);
61
+ }, D = (e) => {
62
+ let t = E(e, -.5, .5, .008);
51
63
  return t ? t.w : 0;
52
- }, ee = Math.max(.08, E(C - .1)), D = C - .28;
53
- for (let e = C - .12; e > C - .45; e -= .01) if (E(e) > ee * 1.9) {
54
- D = e - .015;
64
+ }, ee = Math.max(.08, D(w - .1)), O = w - .28;
65
+ for (let e = w - .12; e > w - .45; e -= .01) if (D(e) > ee * 1.9) {
66
+ O = e - .015;
55
67
  break;
56
68
  }
57
- let O = D - .13, k = T(O, -.19, .19), A = {
58
- shY: D,
59
- shHalf: E(D) / 2,
60
- chestY: O,
61
- rx: k ? k.w / 2 : .14,
62
- zc: k ? k.cz : 0,
63
- zF: k ? k.z1 : .1
64
- }, j = null, M = null;
65
- for (let e = A.shY - .28; e > A.shY - .44; e -= .015) {
66
- let t = T(e, -.19, .19);
67
- t && (!j || t.w < j.t.w) && (j = {
69
+ let k = O - .13, A = E(k, -.19, .19), j = {
70
+ shY: O,
71
+ shHalf: D(O) / 2,
72
+ chestY: k,
73
+ rx: A ? A.w / 2 : .14,
74
+ zc: A ? A.cz : 0,
75
+ zF: A ? A.z1 : .1
76
+ }, M = null, N = null;
77
+ for (let e = j.shY - .28; e > j.shY - .44; e -= .015) {
78
+ let t = E(e, -.19, .19);
79
+ t && (!M || t.w < M.t.w) && (M = {
68
80
  y: e,
69
81
  t
70
82
  });
71
83
  }
72
- for (let e = A.shY - .42; e > A.shY - .54; e -= .02) {
73
- let t = T(e, -.165, .165);
74
- t && (!M || t.w > M.t.w) && (M = {
84
+ for (let e = j.shY - .42; e > j.shY - .54; e -= .02) {
85
+ let t = E(e, -.165, .165);
86
+ t && (!N || t.w > N.t.w) && (N = {
75
87
  y: e,
76
88
  t
77
89
  });
78
90
  }
79
- A.waistRow = j, A.hipsRow = M, A.crotchY = M ? M.y - .12 : A.shY - .6;
80
- let N = new r.PerspectiveCamera(30, s / c, .05, 100), P = D - .3;
81
- N.position.set(0, P, 2.35), N.lookAt(0, P, 0);
82
- let F = new r.Group();
83
- o.add(F);
84
- let I = "#5F7F63", L = (e, t, n) => new r.Vector3(e, t, n), R = {}, z = (e, t, n, i) => {
85
- let a = new r.CatmullRomCurve3(e, t, "catmullrom", .5), o = new r.TubeGeometry(a, t ? 90 : 40, n, 8, t), s = new r.TubeGeometry(a, t ? 90 : 40, n * 2.2, 8, t), c = new r.MeshBasicMaterial({ color: i || I }), l = new r.MeshBasicMaterial({
86
- color: i || I,
91
+ j.waistRow = M, j.hipsRow = N, j.crotchY = N ? N.y - .12 : j.shY - .6;
92
+ let P = new i.PerspectiveCamera(30, c / l, .05, 100), F = O - .3;
93
+ P.position.set(0, F, 2.35), P.lookAt(0, F, 0);
94
+ let I = new i.Group();
95
+ s.add(I);
96
+ let L = "#5F7F63", R = (e, t, n) => new i.Vector3(e, t, n), z = {}, B = (e, t, n, r) => {
97
+ let a = new i.CatmullRomCurve3(e, t, "catmullrom", .5), o = new i.TubeGeometry(a, t ? 90 : 40, n, 8, t), s = new i.TubeGeometry(a, t ? 90 : 40, n * 2.2, 8, t), c = new i.MeshBasicMaterial({ color: r || L }), l = new i.MeshBasicMaterial({
98
+ color: r || L,
87
99
  transparent: !0,
88
100
  opacity: .15,
89
101
  depthWrite: !1
90
102
  });
91
- m.push(o, s, c, l), F.add(new r.Mesh(o, c)), F.add(new r.Mesh(s, l));
92
- }, B = (e, t, n) => Math.max(.4, (e + n / (2 * Math.PI) * b) / (e + t)), te = (e, t, n) => Math.max(.4, (e + n / 2 * b) / (e + t)), ne = (e, t) => {
93
- let n = (A.rx + .012) * e, r = n * .72, i = A.zF - A.zc - r * .4, a = [];
103
+ h.push(o, s, c, l), I.add(new i.Mesh(o, c)), I.add(new i.Mesh(s, l));
104
+ }, V = (e, t, n) => Math.max(.4, (e + n / (2 * Math.PI) * x) / (e + t)), te = (e, t, n) => Math.max(.4, (e + n / 2 * x) / (e + t)), ne = (e, t) => {
105
+ let n = (j.rx + .012) * e, r = n * .72, i = j.zF - j.zc - r * .4, a = [];
94
106
  for (let e = 0; e < 36; e++) {
95
107
  let t = e / 36 * Math.PI * 2, o = Math.sin(t);
96
- a.push(L(n * Math.cos(t), A.chestY - .012 * Math.max(0, o), A.zc + r * o + Math.max(0, i) * Math.max(0, o) * Math.max(0, o)));
108
+ a.push(R(n * Math.cos(t), j.chestY - .012 * Math.max(0, o), j.zc + r * o + Math.max(0, i) * Math.max(0, o) * Math.max(0, o)));
97
109
  }
98
- z(a, !0, .7 * b, t), R.chest = L(-(n + b), A.chestY, A.zc);
110
+ B(a, !0, .7 * x, t), z.chest = R(-(n + x), j.chestY, j.zc);
99
111
  }, re = (e, t) => {
100
- let n = (A.shHalf - .015) * e, r = T(A.shY, -.25, .25), i = r ? r.cz : A.zc;
101
- z([
102
- L(-(n + b), A.shY - .5 * b, i + 2 * b),
103
- L(-n * .5, A.shY + 3.5 * b, i + 5 * b),
104
- L(0, A.shY + 4.5 * b, i + 6 * b),
105
- L(n * .5, A.shY + 3.5 * b, i + 5 * b),
106
- L(n + b, A.shY - .5 * b, i + 2 * b)
107
- ], !1, .65 * b, t), R.shoulder_width = L(-(n + 1.5 * b), A.shY - .5 * b, i + 2 * b);
108
- }, V = (e, t, n, r) => {
112
+ let n = (j.shHalf - .015) * e, r = E(j.shY, -.25, .25), i = r ? r.cz : j.zc;
113
+ B([
114
+ R(-(n + x), j.shY - .5 * x, i + 2 * x),
115
+ R(-n * .5, j.shY + 3.5 * x, i + 5 * x),
116
+ R(0, j.shY + 4.5 * x, i + 6 * x),
117
+ R(n * .5, j.shY + 3.5 * x, i + 5 * x),
118
+ R(n + x, j.shY - .5 * x, i + 2 * x)
119
+ ], !1, .65 * x, t), z.shoulder_width = R(-(n + 1.5 * x), j.shY - .5 * x, i + 2 * x);
120
+ }, H = (e, t, n, r) => {
109
121
  if (!e) return;
110
122
  let i = (e.t.w / 2 + .008) * t, a = Math.min((e.t.z1 - e.t.z0) / 2 + .008, i * .78) * t, o = [];
111
123
  for (let t = 0; t < 36; t++) {
112
124
  let n = t / 36 * Math.PI * 2;
113
- o.push(L(e.t.cx + i * Math.cos(n), e.y, e.t.cz + a * Math.sin(n)));
125
+ o.push(R(e.t.cx + i * Math.cos(n), e.y, e.t.cz + a * Math.sin(n)));
114
126
  }
115
- z(o, !0, .7 * b, r), R[n] = L(e.t.cx - i - b, e.y, e.t.cz);
127
+ B(o, !0, .7 * x, r), z[n] = R(e.t.cx - i - x, e.y, e.t.cz);
116
128
  }, ie = (e, t) => {
117
129
  let n = [];
118
- for (let e = A.shY - .05; e > A.shY - .25; e -= .015) {
119
- let t = w(e, .012);
130
+ for (let e = j.shY - .05; e > j.shY - .25; e -= .015) {
131
+ let t = T(e, .012);
120
132
  if (!t.length) continue;
121
133
  let r = t[0];
122
134
  t.forEach((e) => {
@@ -132,68 +144,81 @@ async function e(e, t, n = []) {
132
144
  n.forEach(([e, t, n]) => {
133
145
  r += t, i += t * t, a += e, o += e * t, s += n, c += n * t;
134
146
  });
135
- let u = l * i - r * r, d = (l * o - a * r) / u, f = (a - d * r) / l, p = (l * c - s * r) / u, m = (s - p * r) / l, h = A.shY - .02, g = L(f + d * h, h, m + p * h), _ = L(d, 1, p).normalize();
147
+ let u = l * i - r * r, d = (l * o - a * r) / u, f = (a - d * r) / l, p = (l * c - s * r) / u, m = (s - p * r) / l, h = j.shY - .02, g = R(f + d * h, h, m + p * h), _ = R(d, 1, p).normalize();
136
148
  _.y > 0 && _.multiplyScalar(-1);
137
- let v = g.clone().addScaledVector(_, Math.max(e, 4) * b * 1.1), y = [];
149
+ let v = g.clone().addScaledVector(_, Math.max(e, 4) * x * 1.1), y = [];
138
150
  for (let e = 0; e <= 6; e++) {
139
151
  let t = g.clone().lerp(v, e / 6);
140
- t.x += .8 * b, t.z += .5 * b, y.push(t);
152
+ t.x += .8 * x, t.z += .5 * x, y.push(t);
141
153
  }
142
- z(y, !1, .7 * b, t), R.sleeve_length = y[y.length - 1].clone();
154
+ B(y, !1, .7 * x, t), z.sleeve_length = y[y.length - 1].clone();
143
155
  }, ae = (e, t) => {
144
- if (!A.hipsRow) return;
145
- let n = A.hipsRow.y - .1, r = n - Math.max(e, 4) * b * .9, i = [];
156
+ if (!j.hipsRow) return;
157
+ let n = j.hipsRow.y - .1, r = n - Math.max(e, 4) * x * .9, i = [];
146
158
  for (let e = 0; e <= 10; e++) {
147
- let t = n + (r - n) * (e / 10), a = t > A.crotchY ? T(t, -.165, .165) : T(t, .006, .16, .016);
148
- i.push(L(a ? a.cx : 0, t, a ? a.z1 : A.zF));
159
+ let t = n + (r - n) * (e / 10), a = t > j.crotchY ? E(t, -.165, .165) : E(t, .006, .16, .016);
160
+ i.push(R(a ? a.cx : 0, t, a ? a.z1 : j.zF));
149
161
  }
150
- z(i, !1, .65 * b, t), R.inseam = i[i.length - 1].clone();
162
+ B(i, !1, .65 * x, t), z.inseam = i[i.length - 1].clone();
151
163
  }, oe = (e, t) => {
152
- let n = A.shY - .02, r = n - Math.max(e, 4) * b * .9, i = [];
164
+ let n = j.shY - .02, r = n - Math.max(e, 4) * x * .9, i = [];
153
165
  for (let e = 0; e <= 10; e++) {
154
- let t = n + (r - n) * (e / 10), a = T(t, -.19, .19);
155
- i.push(L(a ? a.cx : 0, t, a ? a.z1 : A.zF));
166
+ let t = n + (r - n) * (e / 10), a = E(t, -.19, .19);
167
+ i.push(R(a ? a.cx : 0, t, a ? a.z1 : j.zF));
156
168
  }
157
- z(i, !1, .65 * b, t), R.torso_length = i[i.length - 1].clone();
158
- }, H = (e) => {
159
- for (; F.children.length;) {
160
- let e = F.children.pop();
169
+ B(i, !1, .65 * x, t), z.torso_length = i[i.length - 1].clone();
170
+ }, U = (e) => {
171
+ for (; I.children.length;) {
172
+ let e = I.children.pop();
161
173
  e.geometry.dispose(), e.material.dispose();
162
174
  }
163
- m = [];
164
- for (let e in R) delete R[e];
175
+ h = [];
176
+ for (let e in z) delete z[e];
165
177
  for (let t of e) {
166
- let e = t.color || I;
167
- t.key === "chest" ? ne(B(A.rx, .012, t.easeCm), e) : t.key === "waist" && A.waistRow ? V(A.waistRow, B(A.waistRow.t.w / 2, .008, t.easeCm), "waist", e) : t.key === "hips" && A.hipsRow ? V(A.hipsRow, B(A.hipsRow.t.w / 2, .008, t.easeCm), "hips", e) : t.key === "shoulder_width" ? re(te(A.shHalf, .015, t.easeCm), e) : t.key === "sleeve_length" ? ie(20 + t.easeCm, e) : t.key === "inseam" ? ae(60 + t.easeCm, e) : t.key === "torso_length" && oe(65 + t.easeCm, e);
178
+ let e = t.color || L, n = W[t.key];
179
+ n && n(t.easeCm, e);
168
180
  }
181
+ }, W = {
182
+ chest: (e, t) => ne(V(j.rx, .012, e), t),
183
+ waist: (e, t) => {
184
+ j.waistRow && H(j.waistRow, V(j.waistRow.t.w / 2, .008, e), "waist", t);
185
+ },
186
+ hips: (e, t) => {
187
+ j.hipsRow && H(j.hipsRow, V(j.hipsRow.t.w / 2, .008, e), "hips", t);
188
+ },
189
+ shoulder_width: (e, t) => re(te(j.shHalf, .015, e), t),
190
+ sleeve_length: (e, t) => ie(20 + e, t),
191
+ inseam: (e, t) => ae(60 + e, t),
192
+ torso_length: (e, t) => oe(65 + e, t)
169
193
  };
170
- H(n);
171
- let U = document.createElement("div");
172
- U.style.cssText = "position:absolute;inset:0;z-index:2;pointer-events:none;font-family:Manrope,system-ui,sans-serif;";
173
- let W = "http://www.w3.org/2000/svg", G = document.createElementNS(W, "svg");
174
- G.setAttribute("width", String(s)), G.setAttribute("height", String(c)), G.style.cssText = "position:absolute;inset:0;", U.appendChild(G), e.appendChild(U);
175
- let K = n.filter((e) => R[e.key]), q = {}, J = {}, Y = {}, X = {};
176
- K.forEach((e) => {
194
+ for (let t of e) W[t] || console.warn(`[VirtualTryOn] mannequin has no band geometry for measurement "${t}"`);
195
+ U(r);
196
+ let G = document.createElement("div");
197
+ G.style.cssText = "position:absolute;inset:0;z-index:2;pointer-events:none;font-family:Manrope,system-ui,sans-serif;";
198
+ let K = "http://www.w3.org/2000/svg", q = document.createElementNS(K, "svg");
199
+ q.setAttribute("width", String(c)), q.setAttribute("height", String(l)), q.style.cssText = "position:absolute;inset:0;", G.appendChild(q), t.appendChild(G);
200
+ let J = r.filter((e) => z[e.key]), Y = {}, se = {}, X = {}, Z = {};
201
+ J.forEach((e) => {
177
202
  let t = document.createElement("div");
178
203
  t.style.cssText = "position:absolute;display:flex;align-items:center;gap:6px;background:rgba(255,255,255,0.94);border-radius:999px;padding:4px 10px 4px 5px;box-shadow:0 6px 20px rgba(28,28,22,0.12);white-space:nowrap;";
179
204
  let n = document.createElement("span");
180
205
  n.style.cssText = "width:16px;height:16px;border-radius:50%;background:#6F8F72;color:#FAF7ED;font-size:9.5px;font-weight:700;flex:none;display:inline-flex;align-items:center;justify-content:center;", n.textContent = e.letter;
181
206
  let r = document.createElement("span");
182
- r.style.cssText = `font-size:11px;font-weight:700;color:${e.color || "#5F7F63"};`, r.textContent = e.verdict || "", t.appendChild(n), t.appendChild(r), U.appendChild(t);
183
- let i = document.createElementNS(W, "line");
184
- i.setAttribute("stroke", "rgba(28,28,22,0.30)"), i.setAttribute("stroke-width", "1"), G.appendChild(i);
185
- let a = document.createElementNS(W, "circle");
186
- a.setAttribute("r", "2.2"), a.setAttribute("fill", "#1c1c16"), a.setAttribute("fill-opacity", "0.55"), G.appendChild(a), q[e.key] = t, J[e.key] = r, Y[e.key] = i, X[e.key] = a;
207
+ r.style.cssText = `font-size:11px;font-weight:700;color:${e.color || "#5F7F63"};`, r.textContent = e.verdict || "", t.appendChild(n), t.appendChild(r), G.appendChild(t);
208
+ let i = document.createElementNS(K, "line");
209
+ i.setAttribute("stroke", "rgba(28,28,22,0.30)"), i.setAttribute("stroke-width", "1"), q.appendChild(i);
210
+ let a = document.createElementNS(K, "circle");
211
+ a.setAttribute("r", "2.2"), a.setAttribute("fill", "#1c1c16"), a.setAttribute("fill-opacity", "0.55"), q.appendChild(a), Y[e.key] = t, se[e.key] = r, X[e.key] = i, Z[e.key] = a;
187
212
  });
188
- let se = () => {
189
- let t = e.clientWidth, n = e.clientHeight;
190
- if (!t || !n) return;
191
- G.setAttribute("width", String(t)), G.setAttribute("height", String(n));
213
+ let ce = () => {
214
+ let e = t.clientWidth, n = t.clientHeight;
215
+ if (!e || !n) return;
216
+ q.setAttribute("width", String(e)), q.setAttribute("height", String(n));
192
217
  let r = {};
193
- K.forEach((e) => {
194
- let i = R[e.key].clone().project(N);
195
- r[e.key] = {
196
- x: (i.x * .5 + .5) * t,
218
+ J.forEach((t) => {
219
+ let i = z[t.key].clone().project(P);
220
+ r[t.key] = {
221
+ x: (i.x * .5 + .5) * e,
197
222
  y: (-i.y * .5 + .5) * n
198
223
  };
199
224
  });
@@ -201,47 +226,47 @@ async function e(e, t, n = []) {
201
226
  left: [],
202
227
  right: []
203
228
  };
204
- K.forEach((e) => (r[e.key].x < t / 2 ? i.left : i.right).push(e)), Object.entries(i).forEach(([e, i]) => {
229
+ J.forEach((t) => (r[t.key].x < e / 2 ? i.left : i.right).push(t)), Object.entries(i).forEach(([t, i]) => {
205
230
  i.sort((e, t) => r[e.key].y - r[t.key].y);
206
231
  let a = 16;
207
232
  i.forEach((i) => {
208
233
  let o = r[i.key], s = Math.max(o.y, a);
209
234
  s = Math.min(s, n - 24), a = s + 34;
210
- let c = q[i.key];
211
- c.style.top = `${s - 13}px`, e === "left" ? (c.style.left = "10px", c.style.right = "auto") : (c.style.right = "10px", c.style.left = "auto");
212
- let l = c.offsetWidth, u = e === "left" ? 10 + l + 3 : t - 10 - l - 3;
213
- Y[i.key].setAttribute("x1", String(u)), Y[i.key].setAttribute("y1", String(s)), Y[i.key].setAttribute("x2", String(o.x)), Y[i.key].setAttribute("y2", String(o.y)), X[i.key].setAttribute("cx", String(o.x)), X[i.key].setAttribute("cy", String(o.y));
235
+ let c = Y[i.key];
236
+ c.style.top = `${s - 13}px`, t === "left" ? (c.style.left = "10px", c.style.right = "auto") : (c.style.right = "10px", c.style.left = "auto");
237
+ let l = c.offsetWidth, u = t === "left" ? 10 + l + 3 : e - 10 - l - 3;
238
+ X[i.key].setAttribute("x1", String(u)), X[i.key].setAttribute("y1", String(s)), X[i.key].setAttribute("x2", String(o.x)), X[i.key].setAttribute("y2", String(o.y)), Z[i.key].setAttribute("cx", String(o.x)), Z[i.key].setAttribute("cy", String(o.y));
214
239
  });
215
240
  });
216
- }, Z = () => {
217
- a || (l.render(o, N), se());
241
+ }, Q = () => {
242
+ o || (u.render(s, P), ce());
218
243
  };
219
- Z();
220
- let Q = new ResizeObserver(() => {
221
- let t = e.clientWidth, n = e.clientHeight;
222
- !t || !n || (l.setSize(t, n), N.aspect = t / n, N.updateProjectionMatrix(), Z());
244
+ Q();
245
+ let le = new ResizeObserver(() => {
246
+ let e = t.clientWidth, n = t.clientHeight;
247
+ !e || !n || (u.setSize(e, n), P.aspect = e / n, P.updateProjectionMatrix(), Q());
223
248
  });
224
- Q.observe(e);
225
- let $ = n.slice();
249
+ le.observe(t);
250
+ let $ = r.slice();
226
251
  return {
227
252
  destroy() {
228
- a || (a = !0, Q.disconnect(), p.forEach((e) => e.dispose()), m.forEach((e) => e.dispose()), l.dispose(), l.domElement.remove(), U.remove());
253
+ o || (o = !0, le.disconnect(), m.forEach((e) => e.dispose()), h.forEach((e) => e.dispose()), u.dispose(), u.domElement.remove(), G.remove());
229
254
  },
230
255
  updateMany(e) {
231
- if (!(a || !e.length)) {
256
+ if (!(o || !e.length)) {
232
257
  for (let t of e) {
233
258
  let e = $.findIndex((e) => e.key === t.key);
234
259
  e !== -1 && ($[e] = t);
235
260
  }
236
- H($);
261
+ U($);
237
262
  for (let t of e) {
238
- let e = J[t.key];
263
+ let e = se[t.key];
239
264
  e && (e.textContent = t.verdict || "", e.style.color = t.color || "#5F7F63");
240
265
  }
241
- Z();
266
+ Q();
242
267
  }
243
268
  }
244
269
  };
245
270
  }
246
271
  //#endregion
247
- export { e as mountMannequin3D };
272
+ export { r as mountMannequin3D };