@liquidcars/atlas 0.1.41 → 0.1.43
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/README.md +11 -5
- package/dist/liquidcars-atlas.js +280 -235
- package/dist/liquidcars-atlas.js.map +1 -1
- package/package.json +1 -1
- package/src/liquidcars-atlas.js +137 -37
package/dist/liquidcars-atlas.js
CHANGED
|
@@ -11890,7 +11890,7 @@ var Qc = class {
|
|
|
11890
11890
|
}
|
|
11891
11891
|
}, $c = {
|
|
11892
11892
|
name: "@liquidcars/atlas",
|
|
11893
|
-
version: "0.1.
|
|
11893
|
+
version: "0.1.43",
|
|
11894
11894
|
description: "Reusable 3D conceptual atlas Web Component for LiquidCars-style models",
|
|
11895
11895
|
type: "module",
|
|
11896
11896
|
scripts: {
|
|
@@ -11927,34 +11927,40 @@ var Qc = class {
|
|
|
11927
11927
|
}.version, el = {
|
|
11928
11928
|
component: "#8ae4d0",
|
|
11929
11929
|
connection: "#f4edba"
|
|
11930
|
-
}, tl =
|
|
11931
|
-
|
|
11932
|
-
|
|
11930
|
+
}, tl = "cone", nl = Object.freeze([
|
|
11931
|
+
"all",
|
|
11932
|
+
"selected",
|
|
11933
|
+
"callers",
|
|
11934
|
+
"called",
|
|
11935
|
+
"none"
|
|
11936
|
+
]), rl = .05, il = 15, al = /* @__PURE__ */ new Map(), ol = /* @__PURE__ */ new Map(), sl = /* @__PURE__ */ new Map();
|
|
11937
|
+
function cl(e) {
|
|
11938
|
+
return Array.isArray(e) ? e.map(cl) : !e || typeof e != "object" ? e : Object.fromEntries(Object.entries(e).filter(([, e]) => typeof e != "function" && e !== void 0).map(([e, t]) => [e, cl(t)]));
|
|
11933
11939
|
}
|
|
11934
|
-
function
|
|
11935
|
-
return (e == null ? [] : Array.isArray(e) ? e : [e]).map((e) => typeof e == "string" ? { name: e } :
|
|
11940
|
+
function ll(e) {
|
|
11941
|
+
return (e == null ? [] : Array.isArray(e) ? e : [e]).map((e) => typeof e == "string" ? { name: e } : cl(e)).filter((e) => e && String(e.name || "").trim()).map((e) => ({
|
|
11936
11942
|
...e,
|
|
11937
11943
|
name: String(e.name).trim()
|
|
11938
11944
|
}));
|
|
11939
11945
|
}
|
|
11940
|
-
function
|
|
11946
|
+
function ul(e) {
|
|
11941
11947
|
return [...new Set((e == null ? [] : Array.isArray(e) ? e : [e]).map((e) => String(e || "").trim()).filter(Boolean))];
|
|
11942
11948
|
}
|
|
11943
|
-
function
|
|
11944
|
-
return e ? typeof e == "string" ? { spdx: e } :
|
|
11949
|
+
function dl(e) {
|
|
11950
|
+
return e ? typeof e == "string" ? { spdx: e } : cl(e) : null;
|
|
11945
11951
|
}
|
|
11946
|
-
function
|
|
11947
|
-
let n =
|
|
11952
|
+
function fl(e, t) {
|
|
11953
|
+
let n = cl(e || {}), r = String(n.id || `source-${t + 1}`).trim();
|
|
11948
11954
|
if (!r) throw TypeError("Geometry pack sources require an id.");
|
|
11949
11955
|
return {
|
|
11950
11956
|
...n,
|
|
11951
11957
|
id: r,
|
|
11952
|
-
authors:
|
|
11953
|
-
license:
|
|
11958
|
+
authors: ll(n.authors ?? n.author),
|
|
11959
|
+
license: dl(n.license)
|
|
11954
11960
|
};
|
|
11955
11961
|
}
|
|
11956
|
-
function
|
|
11957
|
-
let r =
|
|
11962
|
+
function pl(e, t, n) {
|
|
11963
|
+
let r = cl(e || {}), i = String(r.id || "").trim();
|
|
11958
11964
|
if (!i) throw TypeError(`Geometry pack resource at index ${t} requires an id.`);
|
|
11959
11965
|
let a = r.source == null ? null : String(r.source).trim();
|
|
11960
11966
|
if (a && !n.has(a)) throw TypeError(`Geometry pack resource '${i}' references unknown source '${a}'.`);
|
|
@@ -11963,13 +11969,13 @@ function dl(e, t, n) {
|
|
|
11963
11969
|
id: i,
|
|
11964
11970
|
kind: String(r.kind || r.type || "asset"),
|
|
11965
11971
|
source: a,
|
|
11966
|
-
authors:
|
|
11967
|
-
license:
|
|
11972
|
+
authors: ll(r.authors ?? r.author),
|
|
11973
|
+
license: dl(r.license)
|
|
11968
11974
|
};
|
|
11969
11975
|
}
|
|
11970
|
-
function
|
|
11976
|
+
function ml(e, t) {
|
|
11971
11977
|
if (!e.showcase || typeof e.showcase != "object") return null;
|
|
11972
|
-
let n =
|
|
11978
|
+
let n = cl(e.showcase), r = Array.isArray(n.groups) ? n.groups : [], i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), o = r.map((e, n) => {
|
|
11973
11979
|
let r = e && typeof e == "object" ? e : {}, o = String(r.id || `group-${n + 1}`).trim();
|
|
11974
11980
|
if (!o || i.has(o)) throw TypeError(`Geometry pack '${t}' showcase contains a duplicate or empty group id.`);
|
|
11975
11981
|
i.add(o);
|
|
@@ -11987,8 +11993,8 @@ function fl(e, t) {
|
|
|
11987
11993
|
...r,
|
|
11988
11994
|
id: s,
|
|
11989
11995
|
geometry: i.includes(".") ? i : `${t}.${i}`,
|
|
11990
|
-
geometryOptions:
|
|
11991
|
-
geometryPalette:
|
|
11996
|
+
geometryOptions: cl(r.geometryOptions || r.options || r.parameters || {}),
|
|
11997
|
+
geometryPalette: cl(r.geometryPalette || r.palette || {})
|
|
11992
11998
|
};
|
|
11993
11999
|
})
|
|
11994
12000
|
};
|
|
@@ -11998,11 +12004,11 @@ function fl(e, t) {
|
|
|
11998
12004
|
title: String(n.title || e.name || t),
|
|
11999
12005
|
description: String(n.description || ""),
|
|
12000
12006
|
groups: o,
|
|
12001
|
-
relations:
|
|
12007
|
+
relations: cl(Array.isArray(n.relations) ? n.relations : [])
|
|
12002
12008
|
};
|
|
12003
12009
|
}
|
|
12004
|
-
function
|
|
12005
|
-
let n = (Array.isArray(e.sources) ? e.sources : []).map(
|
|
12010
|
+
function hl(e, t) {
|
|
12011
|
+
let n = (Array.isArray(e.sources) ? e.sources : []).map(fl), r = new Set(n.map((e) => e.id)), i = (Array.isArray(e.resources) ? e.resources : []).map((e, t) => pl(e, t, r));
|
|
12006
12012
|
if (new Set(i.map((e) => e.id)).size !== i.length) throw TypeError(`Geometry pack '${t}' contains duplicate resource ids.`);
|
|
12007
12013
|
return {
|
|
12008
12014
|
namespace: t,
|
|
@@ -12011,36 +12017,36 @@ function pl(e, t) {
|
|
|
12011
12017
|
description: String(e.description || ""),
|
|
12012
12018
|
category: String(e.category || e.name || t),
|
|
12013
12019
|
homepage: e.homepage ? String(e.homepage) : "",
|
|
12014
|
-
repository:
|
|
12015
|
-
authors:
|
|
12016
|
-
license:
|
|
12020
|
+
repository: cl(e.repository || null),
|
|
12021
|
+
authors: ll(e.authors ?? e.author),
|
|
12022
|
+
license: dl(e.license),
|
|
12017
12023
|
attribution: String(e.attribution || ""),
|
|
12018
|
-
collections:
|
|
12019
|
-
showcase:
|
|
12024
|
+
collections: cl(Array.isArray(e.collections) ? e.collections : []),
|
|
12025
|
+
showcase: ml(e, t),
|
|
12020
12026
|
sources: n,
|
|
12021
12027
|
resources: i,
|
|
12022
12028
|
geometries: []
|
|
12023
12029
|
};
|
|
12024
12030
|
}
|
|
12025
|
-
function
|
|
12031
|
+
function gl(e) {
|
|
12026
12032
|
let { create: t, resourceMap: n, ...r } = e;
|
|
12027
12033
|
return {
|
|
12028
|
-
...
|
|
12034
|
+
...cl(r),
|
|
12029
12035
|
canonicalSize: [...e.canonicalSize],
|
|
12030
|
-
parameters:
|
|
12031
|
-
palette:
|
|
12032
|
-
anchors:
|
|
12036
|
+
parameters: cl(e.parameters),
|
|
12037
|
+
palette: cl(e.palette),
|
|
12038
|
+
anchors: cl(e.anchors)
|
|
12033
12039
|
};
|
|
12034
12040
|
}
|
|
12035
|
-
function
|
|
12036
|
-
return
|
|
12041
|
+
function _l(e) {
|
|
12042
|
+
return cl(e);
|
|
12037
12043
|
}
|
|
12038
|
-
function
|
|
12044
|
+
function vl(e) {
|
|
12039
12045
|
if (!e || typeof e != "object") throw TypeError("A geometry pack must be an object.");
|
|
12040
12046
|
let t = String(e.namespace || "").trim();
|
|
12041
12047
|
if (!/^[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)*$/i.test(t)) throw TypeError("A geometry pack requires a valid dot-separated namespace.");
|
|
12042
12048
|
if (!Array.isArray(e.geometries) || !e.geometries.length) throw TypeError("A geometry pack requires at least one geometry.");
|
|
12043
|
-
let n =
|
|
12049
|
+
let n = hl(e, t), r = Object.freeze(Object.fromEntries(n.resources.map((e) => [e.id, Object.freeze(cl(e))]))), i = [];
|
|
12044
12050
|
for (let a of e.geometries) {
|
|
12045
12051
|
if (!a || typeof a != "object" || !a.id) throw TypeError(`Geometry pack '${t}' contains an invalid geometry.`);
|
|
12046
12052
|
let o = String(a.id).includes(".") ? String(a.id).split(".").pop() : String(a.id), s = String(a.id).includes(".") ? String(a.id) : `${t}.${o}`;
|
|
@@ -12053,8 +12059,8 @@ function gl(e) {
|
|
|
12053
12059
|
packVersion: n.version,
|
|
12054
12060
|
category: a.category || n.category,
|
|
12055
12061
|
collection: a.collection == null ? "" : String(a.collection).trim(),
|
|
12056
|
-
tags:
|
|
12057
|
-
keywords:
|
|
12062
|
+
tags: ul(a.tags),
|
|
12063
|
+
keywords: ul(a.keywords),
|
|
12058
12064
|
canonicalSize: Array.isArray(a.canonicalSize) && a.canonicalSize.length === 3 ? a.canonicalSize.map(Number) : [
|
|
12059
12065
|
2.5,
|
|
12060
12066
|
1.5,
|
|
@@ -12072,41 +12078,41 @@ function gl(e) {
|
|
|
12072
12078
|
resourceMap: r
|
|
12073
12079
|
});
|
|
12074
12080
|
}
|
|
12075
|
-
|
|
12081
|
+
yl(t);
|
|
12076
12082
|
let a = [];
|
|
12077
12083
|
for (let e of i) {
|
|
12078
|
-
|
|
12079
|
-
for (let t of e.aliases || [])
|
|
12084
|
+
al.set(e.id, e), ol.set(e.id, e.id);
|
|
12085
|
+
for (let t of e.aliases || []) ol.set(String(t), e.id);
|
|
12080
12086
|
a.push(e.id);
|
|
12081
12087
|
}
|
|
12082
|
-
n.geometries = [...a],
|
|
12083
|
-
let o =
|
|
12088
|
+
n.geometries = [...a], sl.set(t, n);
|
|
12089
|
+
let o = _l(n);
|
|
12084
12090
|
return typeof globalThis.dispatchEvent == "function" && typeof CustomEvent == "function" && globalThis.dispatchEvent(new CustomEvent("lc-geometry-registry-change", { detail: {
|
|
12085
12091
|
namespace: t,
|
|
12086
12092
|
geometries: a,
|
|
12087
12093
|
pack: o
|
|
12088
12094
|
} })), o;
|
|
12089
12095
|
}
|
|
12090
|
-
function
|
|
12096
|
+
function yl(e) {
|
|
12091
12097
|
let t = [];
|
|
12092
|
-
for (let [n, r] of
|
|
12093
|
-
for (let [e, n] of
|
|
12094
|
-
return
|
|
12098
|
+
for (let [n, r] of al) r.namespace === e && (al.delete(n), t.push(n));
|
|
12099
|
+
for (let [e, n] of ol) t.includes(n) && ol.delete(e);
|
|
12100
|
+
return sl.delete(e), t;
|
|
12095
12101
|
}
|
|
12096
|
-
function
|
|
12097
|
-
return [...
|
|
12102
|
+
function bl() {
|
|
12103
|
+
return [...al.values()].map(gl);
|
|
12098
12104
|
}
|
|
12099
|
-
function
|
|
12100
|
-
return [...
|
|
12105
|
+
function xl() {
|
|
12106
|
+
return [...sl.values()].map(_l);
|
|
12101
12107
|
}
|
|
12102
|
-
function
|
|
12103
|
-
let t =
|
|
12104
|
-
return
|
|
12108
|
+
function Sl(e) {
|
|
12109
|
+
let t = ol.get(e) || e;
|
|
12110
|
+
return al.get(t) || null;
|
|
12105
12111
|
}
|
|
12106
|
-
function
|
|
12112
|
+
function Cl(e) {
|
|
12107
12113
|
return e === "container" || e === "shell";
|
|
12108
12114
|
}
|
|
12109
|
-
function
|
|
12115
|
+
function wl(e = {}) {
|
|
12110
12116
|
let t = e && typeof e == "object" ? e : {}, n = Number(t.opacity);
|
|
12111
12117
|
return {
|
|
12112
12118
|
mode: t.mode === "connected" ? "connected" : "all",
|
|
@@ -12115,20 +12121,26 @@ function Sl(e = {}) {
|
|
|
12115
12121
|
opacity: Number.isFinite(n) ? Math.max(.02, Math.min(.8, n)) : .12
|
|
12116
12122
|
};
|
|
12117
12123
|
}
|
|
12118
|
-
function
|
|
12124
|
+
function Tl(e) {
|
|
12119
12125
|
return [
|
|
12120
12126
|
"preserve",
|
|
12121
12127
|
"center",
|
|
12122
12128
|
"fit"
|
|
12123
12129
|
].includes(e) ? e : "preserve";
|
|
12124
12130
|
}
|
|
12125
|
-
function
|
|
12131
|
+
function El(e) {
|
|
12126
12132
|
return e === "model" ? "model" : "camera";
|
|
12127
12133
|
}
|
|
12128
|
-
function
|
|
12134
|
+
function Dl(e) {
|
|
12135
|
+
return e === "ring" ? "ring" : tl;
|
|
12136
|
+
}
|
|
12137
|
+
function Ol(e) {
|
|
12138
|
+
return nl.includes(e) ? e : "selected";
|
|
12139
|
+
}
|
|
12140
|
+
function kl(e, t) {
|
|
12129
12141
|
e && e.transparent !== t && (e.transparent = t, e.needsUpdate = !0);
|
|
12130
12142
|
}
|
|
12131
|
-
|
|
12143
|
+
vl({
|
|
12132
12144
|
namespace: "geo",
|
|
12133
12145
|
name: "Geometric primitives",
|
|
12134
12146
|
version: "1",
|
|
@@ -12185,7 +12197,7 @@ gl({
|
|
|
12185
12197
|
} } : {}
|
|
12186
12198
|
}))
|
|
12187
12199
|
});
|
|
12188
|
-
var
|
|
12200
|
+
var Al = {
|
|
12189
12201
|
background: {
|
|
12190
12202
|
color: "#0a111a",
|
|
12191
12203
|
glow: "#1c2b39",
|
|
@@ -12230,17 +12242,17 @@ var El = {
|
|
|
12230
12242
|
hint: !0
|
|
12231
12243
|
}
|
|
12232
12244
|
};
|
|
12233
|
-
function
|
|
12245
|
+
function jl(e, t) {
|
|
12234
12246
|
let n = { ...e };
|
|
12235
12247
|
if (!t || typeof t != "object") return n;
|
|
12236
|
-
for (let [r, i] of Object.entries(t)) n[r] = i && typeof i == "object" && !Array.isArray(i) ?
|
|
12248
|
+
for (let [r, i] of Object.entries(t)) n[r] = i && typeof i == "object" && !Array.isArray(i) ? jl(e?.[r] || {}, i) : i;
|
|
12237
12249
|
return n;
|
|
12238
12250
|
}
|
|
12239
|
-
function
|
|
12251
|
+
function Ml(e) {
|
|
12240
12252
|
let t = e && typeof e == "object" ? { ...e } : {};
|
|
12241
|
-
return typeof e == "string" ? t.background = { color: e } : typeof t.background == "string" && (t.background = { color: t.background }),
|
|
12253
|
+
return typeof e == "string" ? t.background = { color: e } : typeof t.background == "string" && (t.background = { color: t.background }), jl(Al, t);
|
|
12242
12254
|
}
|
|
12243
|
-
function
|
|
12255
|
+
function Nl(e) {
|
|
12244
12256
|
if (!e || typeof e != "object") return "directed";
|
|
12245
12257
|
let t = String(e.mode || e.visual || e.render || e.type || e.direction || "").trim().toLowerCase().replace(/[_\s]+/g, "-");
|
|
12246
12258
|
return e.bidirectional === !0 || [
|
|
@@ -12255,7 +12267,7 @@ function kl(e) {
|
|
|
12255
12267
|
"failed"
|
|
12256
12268
|
].includes(t) ? "broken" : "directed";
|
|
12257
12269
|
}
|
|
12258
|
-
var
|
|
12270
|
+
var Pl = [":host{display:block;position:relative;height:var(--lc-height,680px);min-height:420px;color:var(--lc-panel-title,#e9f0f5);font:14px Inter,system-ui,-apple-system,sans-serif;background:var(--lc-bg,#0a111a);border:1px solid #294252;border-radius:12px;overflow:hidden;contain:content}", "*{box-sizing:border-box}.atlas{display:grid;grid-template-columns:minmax(0,1fr) 300px;height:100%}.atlas[data-panel=hidden]{grid-template-columns:1fr}.viewport{position:relative;min-width:0;overflow:hidden;background:radial-gradient(ellipse at 50% 45%,var(--lc-bg-glow,#1c2b39),var(--lc-bg-fade,#0a111a) 82%)}canvas{display:block;width:100%;height:100%;cursor:grab;touch-action:none}.toolbar{position:absolute;z-index:10;bottom:28px;left:50%;transform:translateX(-50%);display:flex;gap:3px;padding:6px;background:var(--lc-toolbar-bg,#15232fe8);border:1px solid var(--lc-toolbar-border,#3a5062);border-radius:8px;white-space:nowrap}.toolbar[data-hidden=true],.toolbar[hidden],.panel[data-hidden=true],.panel[hidden],.crumbs[data-hidden=true],.crumbs[hidden],.hint[data-hidden=true],.hint[hidden]{display:none!important}.toolbar button{height:30px;padding:0 9px;border:0;border-radius:5px;background:none;color:var(--lc-toolbar-text,#dbe7ec);cursor:pointer}.toolbar button:hover,.toolbar button.active{background:var(--lc-toolbar-active,#1f3d4b);color:var(--lc-toolbar-active-text,#c5f2e9)}.toolbar i{display:block;width:1px;margin:2px 3px;background:#38515f}.hint{position:absolute;z-index:9;top:8px;bottom:auto;left:0;right:0;text-align:center;padding:2px 8px;font-size:11px;line-height:16px;color:var(--lc-hint,#8da6b8);pointer-events:none}.panel{overflow:auto;padding:24px 20px;background:var(--lc-panel-bg,linear-gradient(140deg,#182633,#0e1925 65%));border-left:1px solid var(--lc-panel-border,#2a3a48)}.panel h2{font-size:26px;line-height:1.12;font-weight:470;margin:12px 0;color:var(--lc-panel-title,#e9f0f5)}.panel h3{font-size:11px;letter-spacing:1.4px;color:#91aabd;margin:24px 0 10px}.panel p{font-size:14px;line-height:1.55;color:var(--lc-panel-text,#b5c6d2)}.panel .eyebrow{font-size:11px;letter-spacing:1.7px;color:#6ad7c0}.panel .sub{font-size:13px;color:#8fa8bd;margin-bottom:16px}.panel .external-link{display:inline-flex;align-items:center;gap:6px;margin:2px 0 12px;color:#6ad7c0;font-size:13px;font-weight:600;text-decoration:none}.panel .external-link:hover{text-decoration:underline}.panel button{display:block;width:100%;padding:10px 0;text-align:left;background:none;border:0;border-bottom:1px solid var(--lc-panel-border,#2a3a48);color:#d9e7eb;cursor:pointer}.panel button:hover{color:#6ad7c0}.panel .relation{padding:10px 0;border-bottom:1px solid var(--lc-panel-border,#2a3a48)}.panel .relation strong{display:block;font-weight:550}.panel .relation small{display:block;color:#86a6b9;font-size:12px;margin-top:4px}.panel .back{color:#9db7c8;font-size:13px}.panel .crumbs{display:flex;flex-wrap:wrap;gap:5px;align-items:center;margin:0 0 12px}.panel .crumbs button{display:inline;width:auto;padding:3px 7px;border:0;border-radius:4px;background:var(--lc-crumb-bg,#142733);color:var(--lc-crumb-text,#91b6c7);font-size:12px}.panel .crumbs button.current{background:var(--lc-crumb-active,#1c4a4d);color:var(--lc-crumb-active-text,#c5f2e9)}.panel .note{border-top:1px solid var(--lc-panel-border,#2a3a48);padding-top:16px;margin-top:22px;font-size:12px;color:#7692a6}.error{position:absolute;inset:20%;padding:18px;background:#172b3b;border:1px solid #7896a9;line-height:1.5;z-index:4}@media(max-width:900px){.toolbar{gap:0}.toolbar button{padding:0 6px;font-size:12px}}@media(max-width:760px){:host{height:680px}.atlas{grid-template-columns:1fr;grid-template-rows:minmax(420px,1fr) auto}.panel{max-height:250px;border-left:0;border-top:1px solid var(--lc-panel-border,#2a3a48);padding:18px}.toolbar{bottom:24px}.hint{top:8px;bottom:auto;display:block}}"].join(""), Fl = ".toolbar{max-width:calc(100% - 16px);overflow:visible}.toolbar-group{display:flex;align-items:center;gap:2px}.toolbar-group+.toolbar-group{padding-left:6px;border-left:1px solid #38515f}.toolbar .toolbar-icon{display:grid;width:30px;padding:0;place-items:center}.toolbar-icon svg,.toolbar-menu>summary svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.toolbar-menu{position:relative}.toolbar-menu>summary{display:flex;align-items:center;height:30px;padding:0 8px;gap:6px;border-radius:5px;color:var(--lc-toolbar-text,#dbe7ec);cursor:pointer;list-style:none;user-select:none}.toolbar-menu>summary::-webkit-details-marker{display:none}.toolbar-menu>summary:hover,.toolbar-menu[open]>summary{background:var(--lc-toolbar-active,#1f3d4b);color:var(--lc-toolbar-active-text,#c5f2e9)}.toolbar-menu-status{max-width:92px;overflow:hidden;font-size:11px;text-overflow:ellipsis;white-space:nowrap}.toolbar-menu-chevron{width:10px;height:10px!important;transition:transform .16s ease}.toolbar-menu[open] .toolbar-menu-chevron{transform:rotate(180deg)}.toolbar-popover{position:absolute;right:0;bottom:calc(100% + 8px);display:grid;min-width:218px;padding:6px;border:1px solid var(--lc-toolbar-border,#3a5062);border-radius:9px;background:var(--lc-toolbar-bg,#15232ff7);box-shadow:0 14px 36px #0009}.toolbar-popover-title{padding:7px 9px 5px;color:var(--lc-hint,#8da6b8);font-size:9px;font-weight:700;letter-spacing:.1em;text-transform:uppercase}.toolbar .toolbar-option{display:grid;grid-template-columns:minmax(0,1fr) 18px;align-items:center;width:100%;height:auto;min-height:34px;padding:7px 9px;text-align:left}.toolbar-option span:first-child{overflow:hidden;text-overflow:ellipsis}.toolbar-option-check{color:var(--lc-toolbar-active-text,#c5f2e9);font-weight:700;text-align:center;visibility:hidden}.toolbar-option.active .toolbar-option-check{visibility:visible}.toolbar-option-separator{height:1px;margin:5px 7px;background:#38515f}.toolbar button[disabled]{opacity:.42;cursor:not-allowed}@media(max-width:620px){.toolbar-menu-status{display:none}.toolbar-menu>summary{width:30px;padding:0;justify-content:center}.toolbar-menu-chevron{display:none}.toolbar-group+.toolbar-group{padding-left:3px}.toolbar-popover{right:-4px}}", Il = [
|
|
12259
12271
|
".viewport>.atlas-print-snapshot{display:none!important}",
|
|
12260
12272
|
"@media print{",
|
|
12261
12273
|
":host{-webkit-print-color-adjust:exact;print-color-adjust:exact;break-inside:avoid;page-break-inside:avoid}",
|
|
@@ -12264,17 +12276,17 @@ var Al = [":host{display:block;position:relative;height:var(--lc-height,680px);m
|
|
|
12264
12276
|
":host([data-lc-print-ready]) .viewport>canvas:not(.atlas-print-snapshot){display:none!important}",
|
|
12265
12277
|
":host([data-lc-print-ready]) .viewport>.atlas-print-snapshot{display:block!important;width:100%;height:100%}",
|
|
12266
12278
|
"}"
|
|
12267
|
-
].join(""),
|
|
12268
|
-
minus:
|
|
12269
|
-
plus:
|
|
12270
|
-
fit:
|
|
12271
|
-
front:
|
|
12272
|
-
view:
|
|
12273
|
-
relations:
|
|
12274
|
-
focus:
|
|
12275
|
-
chevron:
|
|
12276
|
-
},
|
|
12277
|
-
function
|
|
12279
|
+
].join(""), Ll = (e, t = "0 0 24 24") => `<svg viewBox="${t}" aria-hidden="true">${e}</svg>`, Rl = {
|
|
12280
|
+
minus: Ll("<path d=\"M6 12h12\"/>"),
|
|
12281
|
+
plus: Ll("<path d=\"M12 6v12M6 12h12\"/>"),
|
|
12282
|
+
fit: Ll("<path d=\"M9 4H4v5M15 4h5v5M20 15v5h-5M4 15v5h5\"/><circle cx=\"12\" cy=\"12\" r=\"2.5\"/>"),
|
|
12283
|
+
front: Ll("<rect x=\"4\" y=\"5\" width=\"16\" height=\"14\" rx=\"1.5\"/><path d=\"M8 16h8\"/>"),
|
|
12284
|
+
view: Ll("<path d=\"M2.5 12s3.5-5 9.5-5 9.5 5 9.5 5-3.5 5-9.5 5-9.5-5-9.5-5Z\"/><circle cx=\"12\" cy=\"12\" r=\"2.5\"/>"),
|
|
12285
|
+
relations: Ll("<circle cx=\"5\" cy=\"6\" r=\"2\"/><circle cx=\"19\" cy=\"7\" r=\"2\"/><circle cx=\"12\" cy=\"18\" r=\"2\"/><path d=\"m6.8 6.3 10.2.5M6.2 7.7l4.6 8.6m6.8-7.5-4.4 7.5\"/>"),
|
|
12286
|
+
focus: Ll("<circle cx=\"12\" cy=\"12\" r=\"7\"/><circle cx=\"12\" cy=\"12\" r=\"2.5\"/><path d=\"M12 2v3M12 19v3M2 12h3M19 12h3\"/>"),
|
|
12287
|
+
chevron: Ll("<path d=\"m8 10 4 4 4-4\"/>")
|
|
12288
|
+
}, zl = (e, t, n = !1) => `<button class="toolbar-option${n ? " active" : ""}" data-action="${e}" aria-pressed="${n}"><span>${t}</span><span class="toolbar-option-check" aria-hidden="true">✓</span></button>`, Bl = (e, t, n, r, i) => `<details class="toolbar-menu" data-toolbar-menu="${e}"><summary aria-label="${n}" title="${n}">${t}<span class="toolbar-menu-status" data-toolbar-status="${e}">${r}</span>${Rl.chevron}</summary><div class="toolbar-popover" role="menu"><div class="toolbar-popover-title">${n}</div>${i}</div></details>`, Vl = `<div class="atlas"><section class="viewport"><canvas tabindex="0" aria-label="Modelo 3D interactivo"></canvas><div class="toolbar" role="toolbar" aria-label="Controles de la vista"><div class="toolbar-group" data-toolbar-group="camera"><button class="toolbar-icon" data-action="minus" aria-label="Alejar" title="Alejar">${Rl.minus}</button><button class="toolbar-icon" data-action="plus" aria-label="Acercar" title="Acercar">${Rl.plus}</button><button class="toolbar-icon" data-action="fit" aria-label="Encuadrar todo el modelo" title="Encuadrar todo el modelo">${Rl.fit}</button><button class="toolbar-icon" data-action="front" aria-label="Vista frontal" title="Vista frontal">${Rl.front}</button></div><div class="toolbar-group" data-toolbar-group="view">${Bl("view", Rl.view, "Vista", "Vista", zl("labels", "Etiquetas", !0) + zl("panel", "Información", !0) + zl("item-facing", "Caras a cámara", !0) + "<div class=\"toolbar-option-separator\"></div>" + zl("open-all", "Abrir todos") + zl("close-all", "Cerrar todos"))}</div><div class="toolbar-group" data-toolbar-group="relations">${Bl("relations", Rl.relations, "Relaciones", "Selección", zl("relations-all", "Todas") + zl("relations-selected", "Selección", !0) + zl("relations-callers", "All callers") + zl("relations-called", "All called") + zl("relations-none", "Ocultar"))}</div><div class="toolbar-group" data-toolbar-group="focus">${Bl("focus", Rl.focus, "Foco", "Todo", zl("focus-all", "Todo", !0) + zl("focus-dim", "Conectados") + zl("focus-hide", "Aislar") + "<div class=\"toolbar-option-separator\"></div>" + zl("focus-selection", "Enfocar selección") + zl("focus-layout", "Reorganizar visibles"))}</div></div><div class="hint">Gira: arrastra · Pan: botón derecho / ⇧+arrastra / 2 dedos · Zoom: rueda o pellizco · Selecciona: clic · Enfoca: doble clic</div></section><aside class="panel" aria-live="polite"></aside></div>`;
|
|
12289
|
+
function Hl(e) {
|
|
12278
12290
|
return String(e ?? "").replace(/[&<>"']/g, (e) => ({
|
|
12279
12291
|
"&": "&",
|
|
12280
12292
|
"<": "<",
|
|
@@ -12283,18 +12295,18 @@ function Rl(e) {
|
|
|
12283
12295
|
"'": "'"
|
|
12284
12296
|
})[e]);
|
|
12285
12297
|
}
|
|
12286
|
-
function
|
|
12298
|
+
function Ul(e) {
|
|
12287
12299
|
let t = String(e ?? "").trim();
|
|
12288
12300
|
if (!t) return "";
|
|
12289
12301
|
try {
|
|
12290
12302
|
let e = new URL(t, globalThis.location?.href);
|
|
12291
|
-
return ["http:", "https:"].includes(e.protocol) ? "<a class=\"external-link\" href=\"" +
|
|
12303
|
+
return ["http:", "https:"].includes(e.protocol) ? "<a class=\"external-link\" href=\"" + Hl(e.href) + "\" target=\"_blank\" rel=\"noopener noreferrer\">Open documentation ↗</a>" : "";
|
|
12292
12304
|
} catch {
|
|
12293
12305
|
return "";
|
|
12294
12306
|
}
|
|
12295
12307
|
}
|
|
12296
|
-
function
|
|
12297
|
-
let t = e && typeof e == "object" ? e : {}, n = Array.isArray(t.entities) ? t.entities.map((e) => ({
|
|
12308
|
+
function Wl(e) {
|
|
12309
|
+
let t = e && typeof e == "object" ? e : {}, n = t.render && typeof t.render == "object" ? t.render : {}, r = Array.isArray(t.entities) ? t.entities.map((e) => ({
|
|
12298
12310
|
...e,
|
|
12299
12311
|
p: Array.isArray(e.p) ? e.p : [
|
|
12300
12312
|
0,
|
|
@@ -12306,18 +12318,18 @@ function Bl(e) {
|
|
|
12306
12318
|
1,
|
|
12307
12319
|
1
|
|
12308
12320
|
]
|
|
12309
|
-
})) : [],
|
|
12321
|
+
})) : [], i = Array.isArray(t.relations) ? t.relations.map((e, t) => Array.isArray(e) ? {
|
|
12310
12322
|
from: e[0],
|
|
12311
12323
|
to: e[1],
|
|
12312
12324
|
label: e[2] || "",
|
|
12313
|
-
mode:
|
|
12325
|
+
mode: Nl({ mode: e[3] }),
|
|
12314
12326
|
index: t
|
|
12315
12327
|
} : {
|
|
12316
12328
|
...e,
|
|
12317
12329
|
from: e.from,
|
|
12318
12330
|
to: e.to,
|
|
12319
12331
|
label: e.label || "",
|
|
12320
|
-
mode:
|
|
12332
|
+
mode: Nl(e),
|
|
12321
12333
|
index: t
|
|
12322
12334
|
}) : [];
|
|
12323
12335
|
return {
|
|
@@ -12326,12 +12338,16 @@ function Bl(e) {
|
|
|
12326
12338
|
...el,
|
|
12327
12339
|
...t.palette || {}
|
|
12328
12340
|
},
|
|
12329
|
-
theme:
|
|
12330
|
-
|
|
12331
|
-
|
|
12341
|
+
theme: Ml(t.theme || t.styles),
|
|
12342
|
+
render: {
|
|
12343
|
+
...n,
|
|
12344
|
+
relationMarker: Dl(n.relationMarker)
|
|
12345
|
+
},
|
|
12346
|
+
entities: r,
|
|
12347
|
+
relations: i
|
|
12332
12348
|
};
|
|
12333
12349
|
}
|
|
12334
|
-
function
|
|
12350
|
+
function Gl(e, t, n = [
|
|
12335
12351
|
1,
|
|
12336
12352
|
1,
|
|
12337
12353
|
1
|
|
@@ -12350,7 +12366,7 @@ function Vl(e, t, n = [
|
|
|
12350
12366
|
});
|
|
12351
12367
|
return s.center(), s;
|
|
12352
12368
|
}
|
|
12353
|
-
function
|
|
12369
|
+
function Kl(e, t, n) {
|
|
12354
12370
|
let r = new ui();
|
|
12355
12371
|
for (let t = 0; t < e; t++) {
|
|
12356
12372
|
let n = Math.PI / 2 + t * Math.PI * 2 / e, i = new V(Math.cos(n) * .5, Math.sin(n) * .5);
|
|
@@ -12367,7 +12383,7 @@ function Hl(e, t, n) {
|
|
|
12367
12383
|
});
|
|
12368
12384
|
return i.rotateX(Math.PI / 2), i.center(), i;
|
|
12369
12385
|
}
|
|
12370
|
-
function
|
|
12386
|
+
function ql(e, t, n, r) {
|
|
12371
12387
|
let i = Math.min(.22, Math.max(0, Number(n) || 0));
|
|
12372
12388
|
if (!i) return new Er(t, e, 1, 32);
|
|
12373
12389
|
let a = [new V(0, -.5)];
|
|
@@ -12384,7 +12400,7 @@ function Ul(e, t, n, r) {
|
|
|
12384
12400
|
}
|
|
12385
12401
|
return a.push(new V(0, .5)), new Qi(a, 32);
|
|
12386
12402
|
}
|
|
12387
|
-
function
|
|
12403
|
+
function Jl(e, t) {
|
|
12388
12404
|
if (!t) return e;
|
|
12389
12405
|
let n = Math.min(.72, Math.max(0, Number(t) * 3)), r = e.attributes.position;
|
|
12390
12406
|
for (let e = 0; e < r.count; e++) {
|
|
@@ -12393,36 +12409,36 @@ function Wl(e, t) {
|
|
|
12393
12409
|
}
|
|
12394
12410
|
return r.needsUpdate = !0, e.computeVertexNormals(), e;
|
|
12395
12411
|
}
|
|
12396
|
-
function
|
|
12412
|
+
function Yl(e, t = 0, n = 4, r = [
|
|
12397
12413
|
1,
|
|
12398
12414
|
1,
|
|
12399
12415
|
1
|
|
12400
12416
|
]) {
|
|
12401
12417
|
let i = Number(t) || 0, a = Math.max(2, Math.round(Number(n) || 4));
|
|
12402
12418
|
switch (e) {
|
|
12403
|
-
case "cylinder": return i ?
|
|
12404
|
-
case "cone": return i ?
|
|
12419
|
+
case "cylinder": return i ? ql(.5, .5, i, a) : new Er(.5, .5, 1, 32);
|
|
12420
|
+
case "cone": return i ? ql(0, .5, i, a) : new Dr(.5, 1, 32);
|
|
12405
12421
|
case "frustum-cone":
|
|
12406
|
-
case "truncated-cone": return i ?
|
|
12422
|
+
case "truncated-cone": return i ? ql(.28, .5, i, a) : new Er(.28, .5, 1, 32);
|
|
12407
12423
|
case "frustum-pyramid":
|
|
12408
12424
|
case "truncated-pyramid": return new Er(.28, .5, 1, 4);
|
|
12409
12425
|
case "frustum-triangle": return new Er(.28, .5, 1, 3);
|
|
12410
|
-
case "prism": return i ?
|
|
12411
|
-
case "pyramid-square": return i ?
|
|
12412
|
-
case "pyramid-triangle": return i ?
|
|
12426
|
+
case "prism": return i ? Kl(6, i, a) : new Er(.5, .5, 1, 6);
|
|
12427
|
+
case "pyramid-square": return i ? Jl(new Dr(.5, 1, 4), i) : new Dr(.5, 1, 4);
|
|
12428
|
+
case "pyramid-triangle": return i ? Jl(new Dr(.5, 1, 3), i) : new Dr(.5, 1, 3);
|
|
12413
12429
|
case "sphere": return new ta(.5, 24, 16);
|
|
12414
|
-
case "octahedron": return
|
|
12415
|
-
case "dodecahedron": return
|
|
12416
|
-
case "icosahedron": return
|
|
12417
|
-
default: return i ?
|
|
12430
|
+
case "octahedron": return Jl(new $i(.5), i);
|
|
12431
|
+
case "dodecahedron": return Jl(new kr(.5), i);
|
|
12432
|
+
case "icosahedron": return Jl(new Zi(.5), i);
|
|
12433
|
+
default: return i ? Gl(i, a, r) : new Nn(1, 1, 1);
|
|
12418
12434
|
}
|
|
12419
12435
|
}
|
|
12420
|
-
function
|
|
12436
|
+
function Xl(e) {
|
|
12421
12437
|
e.computeBoundingBox();
|
|
12422
12438
|
let t = e.boundingBox?.getSize(new U());
|
|
12423
12439
|
return !t || !t.x || !t.y || !t.z ? e : (e.scale(1 / t.x, 1 / t.y, 1 / t.z), e.computeBoundingBox(), e);
|
|
12424
12440
|
}
|
|
12425
|
-
function
|
|
12441
|
+
function Zl(e, t) {
|
|
12426
12442
|
let n = e.geometryOptions || e.geometry_options || e.parameters || {}, r = {};
|
|
12427
12443
|
for (let [e, n] of Object.entries(t?.parameters || {})) n && Object.hasOwn(n, "default") && (r[e] = n.default);
|
|
12428
12444
|
return {
|
|
@@ -12430,10 +12446,10 @@ function ql(e, t) {
|
|
|
12430
12446
|
...n && typeof n == "object" ? n : {}
|
|
12431
12447
|
};
|
|
12432
12448
|
}
|
|
12433
|
-
function
|
|
12449
|
+
function Ql(e, t, n) {
|
|
12434
12450
|
return typeof e != "string" || !e ? n : t[e] || e;
|
|
12435
12451
|
}
|
|
12436
|
-
function
|
|
12452
|
+
function $l(e, t = "#ffffff", n = "transparent") {
|
|
12437
12453
|
let r = document.createElement("canvas");
|
|
12438
12454
|
r.width = 256, r.height = 256;
|
|
12439
12455
|
let i = r.getContext("2d");
|
|
@@ -12441,8 +12457,8 @@ function Yl(e, t = "#ffffff", n = "transparent") {
|
|
|
12441
12457
|
let a = new Cr(r);
|
|
12442
12458
|
return a.colorSpace = y, a;
|
|
12443
12459
|
}
|
|
12444
|
-
var
|
|
12445
|
-
function
|
|
12460
|
+
var eu = /^[AaCcHhLlMmQqSsTtVvZz]$/, tu = /[-+]?(?:\d*\.\d+|\d+\.?)(?:[eE][-+]?\d+)?|[AaCcHhLlMmQqSsTtVvZz]/g;
|
|
12461
|
+
function nu(e, t, n, r, i, a, o, s, c) {
|
|
12446
12462
|
let l = Math.abs(Number(n)), u = Math.abs(Number(r));
|
|
12447
12463
|
if (!l || !u || e === s && t === c) return [[s, c]];
|
|
12448
12464
|
let d = Number(i || 0) * Math.PI / 180, f = Math.cos(d), p = Math.sin(d), m = (e - s) / 2, h = (t - c) / 2, g = f * m + p * h, _ = -p * m + f * h, v = Math.sqrt(Math.max(1, g * g / (l * l) + _ * _ / (u * u)));
|
|
@@ -12458,12 +12474,12 @@ function Ql(e, t, n, r, i, a, o, s, c) {
|
|
|
12458
12474
|
return [w + f * l * r - p * u * i, T + p * l * r + f * u * i];
|
|
12459
12475
|
});
|
|
12460
12476
|
}
|
|
12461
|
-
function
|
|
12462
|
-
let t = String(e || "").match(
|
|
12477
|
+
function ru(e) {
|
|
12478
|
+
let t = String(e || "").match(tu) || [], n = new qa(), r = 0, i = "", a = "", o = 0, s = 0, c = 0, l = 0, u = 0, d = 0, f = 0, p = 0, m = () => r < t.length && !eu.test(t[r]), h = () => Number(t[r++]), g = () => {
|
|
12463
12479
|
let e = t[r];
|
|
12464
12480
|
return /^[01].+/.test(e) ? (t[r] = e.slice(1), e[0] === "1") : h() !== 0;
|
|
12465
12481
|
}, _ = (e, t, n) => [n ? o + e : e, n ? s + t : t];
|
|
12466
|
-
for (; r < t.length && (
|
|
12482
|
+
for (; r < t.length && (eu.test(t[r]) && (i = t[r++]), i);) {
|
|
12467
12483
|
let e = i.toLowerCase(), t = i === e;
|
|
12468
12484
|
if (e === "z") {
|
|
12469
12485
|
n.currentPath?.closePath(), o = c, s = l, a = i, i = "";
|
|
@@ -12503,7 +12519,7 @@ function $l(e) {
|
|
|
12503
12519
|
}
|
|
12504
12520
|
else if (e === "a") for (; m();) {
|
|
12505
12521
|
let e = h(), r = h(), c = h(), l = g(), u = g(), [d, f] = _(h(), h(), t);
|
|
12506
|
-
for (let [t, i] of
|
|
12522
|
+
for (let [t, i] of nu(o, s, e, r, c, l, u, d, f)) n.lineTo(t, -i);
|
|
12507
12523
|
o = d, s = f, a = i;
|
|
12508
12524
|
}
|
|
12509
12525
|
else break;
|
|
@@ -12511,12 +12527,12 @@ function $l(e) {
|
|
|
12511
12527
|
}
|
|
12512
12528
|
return n;
|
|
12513
12529
|
}
|
|
12514
|
-
function
|
|
12530
|
+
function iu(e, t = {}) {
|
|
12515
12531
|
let n = String(e || "").match(/<path\b[^>]*>/gi) || [], r = [];
|
|
12516
12532
|
for (let e of n) {
|
|
12517
12533
|
let t = e.match(/\bd\s*=\s*(["'])([\s\S]*?)\1/i);
|
|
12518
12534
|
if (!t) continue;
|
|
12519
|
-
let n =
|
|
12535
|
+
let n = ru(t[2]);
|
|
12520
12536
|
r.push(...n.toShapes(!0, !1));
|
|
12521
12537
|
}
|
|
12522
12538
|
if (!r.length) return new Nn(1, 1, .12);
|
|
@@ -12531,11 +12547,11 @@ function eu(e, t = {}) {
|
|
|
12531
12547
|
});
|
|
12532
12548
|
return a.center(), a;
|
|
12533
12549
|
}
|
|
12534
|
-
function
|
|
12535
|
-
return e.shape === "plane" ? new ea(1, 1) : e.shape === "svg-extrude" ?
|
|
12550
|
+
function au(e) {
|
|
12551
|
+
return e.shape === "plane" ? new ea(1, 1) : e.shape === "svg-extrude" ? iu(e.svg, e) : Yl(e.shape || e.geometry || "box", e.radius, e.segments, e.size);
|
|
12536
12552
|
}
|
|
12537
|
-
function
|
|
12538
|
-
let a =
|
|
12553
|
+
function ou(e, t, n, r, i) {
|
|
12554
|
+
let a = Zl(t, e), o = {
|
|
12539
12555
|
...n,
|
|
12540
12556
|
...e.palette || {},
|
|
12541
12557
|
...t.geometryPalette || t.geometry_palette || {}
|
|
@@ -12550,11 +12566,11 @@ function nu(e, t, n, r, i) {
|
|
|
12550
12566
|
if (!c.length) throw Error(`Geometry '${e.id}' did not produce any parts.`);
|
|
12551
12567
|
let l = new Qn(), u = [], d = [];
|
|
12552
12568
|
for (let a of c) {
|
|
12553
|
-
let s =
|
|
12554
|
-
|
|
12555
|
-
let c = a.color || "component", f =
|
|
12569
|
+
let s = au(a);
|
|
12570
|
+
Xl(s);
|
|
12571
|
+
let c = a.color || "component", f = Ql(c, o, n.component || el.component), p = a.emissive || "#000000", m = new ia({
|
|
12556
12572
|
color: f,
|
|
12557
|
-
emissive:
|
|
12573
|
+
emissive: Ql(p, o, "#000000"),
|
|
12558
12574
|
emissiveIntensity: Number.isFinite(Number(a.emissiveIntensity)) ? Math.max(0, Number(a.emissiveIntensity)) : 0,
|
|
12559
12575
|
roughness: Number.isFinite(Number(a.roughness)) ? Number(a.roughness) : .72,
|
|
12560
12576
|
metalness: Number.isFinite(Number(a.metalness)) ? Number(a.metalness) : .06,
|
|
@@ -12625,7 +12641,7 @@ function nu(e, t, n, r, i) {
|
|
|
12625
12641
|
n.src = _;
|
|
12626
12642
|
}
|
|
12627
12643
|
})(), m.map.colorSpace = y, m.needsUpdate = !0;
|
|
12628
|
-
} else g != null && g !== "" && (m.map =
|
|
12644
|
+
} else g != null && g !== "" && (m.map = $l(g, Ql(a.iconColor || "#ffffff", o, "#ffffff"), Ql(a.iconBackground || "transparent", o, "transparent")), m.transparent = !0, m.needsUpdate = !0);
|
|
12629
12645
|
if (h = new An(s, m), h.position.fromArray(Array.isArray(a.position) ? a.position : [
|
|
12630
12646
|
0,
|
|
12631
12647
|
0,
|
|
@@ -12662,19 +12678,23 @@ function nu(e, t, n, r, i) {
|
|
|
12662
12678
|
descriptor: s
|
|
12663
12679
|
};
|
|
12664
12680
|
}
|
|
12665
|
-
var
|
|
12681
|
+
var su = Object.freeze([
|
|
12666
12682
|
"auto",
|
|
12667
12683
|
"top",
|
|
12668
12684
|
"bottom",
|
|
12669
12685
|
"left",
|
|
12670
12686
|
"right"
|
|
12671
12687
|
]);
|
|
12672
|
-
function
|
|
12688
|
+
function cu(e) {
|
|
12673
12689
|
let t = String(e || "auto").trim().toLowerCase();
|
|
12674
|
-
return
|
|
12690
|
+
return su.includes(t) ? t : "auto";
|
|
12675
12691
|
}
|
|
12676
|
-
function
|
|
12677
|
-
let
|
|
12692
|
+
function lu(e = {}, t = {}) {
|
|
12693
|
+
let n = e.style?.label?.anchor ?? e.labelAnchor ?? e.label_anchor, r = Cl(e.type) ? "auto" : t?.label?.anchor ?? "bottom";
|
|
12694
|
+
return cu(n ?? r);
|
|
12695
|
+
}
|
|
12696
|
+
function uu(e, t, n, r, i = .025) {
|
|
12697
|
+
let a = cu(e);
|
|
12678
12698
|
if (a === "auto") return null;
|
|
12679
12699
|
let o = Math.max(0, Number(t?.x) || 0), s = Math.max(0, Number(t?.y) || 0);
|
|
12680
12700
|
Math.max(0, Number(n) || 0);
|
|
@@ -12701,7 +12721,7 @@ function au(e, t, n, r, i = .025) {
|
|
|
12701
12721
|
backRotation: Math.PI / 2
|
|
12702
12722
|
};
|
|
12703
12723
|
}
|
|
12704
|
-
function
|
|
12724
|
+
function du(e, t, n, r = "", i = !0) {
|
|
12705
12725
|
let a = document.createElement("canvas"), o = a.getContext("2d"), s = n.x * .88, c = Math.min(.82, n.y * .64);
|
|
12706
12726
|
a.width = Math.ceil(s * 320), a.height = Math.ceil(c * 320), o.imageSmoothingEnabled = !0, o.imageSmoothingQuality = "high", o.clearRect(0, 0, a.width, a.height);
|
|
12707
12727
|
let l = a.height * .62;
|
|
@@ -12738,7 +12758,7 @@ function ou(e, t, n, r = "", i = !0) {
|
|
|
12738
12758
|
let C = new An(b, v);
|
|
12739
12759
|
C.rotation.y = Math.PI, C.position.set(0, n.y / 2 - .09 - c / 2, -n.z / 2 - .012);
|
|
12740
12760
|
let w = new An(b, v.clone());
|
|
12741
|
-
w.rotation.x = -Math.PI / 2, w.position.set(0, n.y / 2 + .012, 0), w.visible =
|
|
12761
|
+
w.rotation.x = -Math.PI / 2, w.position.set(0, n.y / 2 + .012, 0), w.visible = Cl(r), x.add(S, C, w);
|
|
12742
12762
|
for (let e of [
|
|
12743
12763
|
S,
|
|
12744
12764
|
C,
|
|
@@ -12746,7 +12766,7 @@ function ou(e, t, n, r = "", i = !0) {
|
|
|
12746
12766
|
]) e.renderOrder = 20, e.frustumCulled = !1, e.material.depthTest = !0, e.material.depthWrite = !1, e.material.transparent = !0;
|
|
12747
12767
|
return x.renderOrder = 20, x.frustumCulled = !1, x.userData.front = S, x.userData.back = C, x.userData.top = w, x.userData.height = c, x.userData.width = s, x.userData.textOffsetX = h, x.userData.textOffsetY = g, x.userData.nodeLabel = !0, x;
|
|
12748
12768
|
}
|
|
12749
|
-
function
|
|
12769
|
+
function fu(e, t, n, r = globalThis.document) {
|
|
12750
12770
|
if (!e || !t || !n || !r?.createElement) return null;
|
|
12751
12771
|
try {
|
|
12752
12772
|
e.render(t, n);
|
|
@@ -12768,12 +12788,13 @@ function su(e, t, n, r = globalThis.document) {
|
|
|
12768
12788
|
return null;
|
|
12769
12789
|
}
|
|
12770
12790
|
}
|
|
12771
|
-
var
|
|
12791
|
+
var pu = class extends HTMLElement {
|
|
12772
12792
|
static version = $c;
|
|
12773
12793
|
static get observedAttributes() {
|
|
12774
12794
|
return [
|
|
12775
12795
|
"height",
|
|
12776
12796
|
"relation-mode",
|
|
12797
|
+
"relation-marker",
|
|
12777
12798
|
"selection-mode",
|
|
12778
12799
|
"selection-navigation",
|
|
12779
12800
|
"item-facing",
|
|
@@ -12786,23 +12807,23 @@ var cu = class extends HTMLElement {
|
|
|
12786
12807
|
];
|
|
12787
12808
|
}
|
|
12788
12809
|
static registerGeometryPack(e) {
|
|
12789
|
-
return
|
|
12810
|
+
return vl(e);
|
|
12790
12811
|
}
|
|
12791
12812
|
static unregisterGeometryPack(e) {
|
|
12792
|
-
return
|
|
12813
|
+
return yl(e);
|
|
12793
12814
|
}
|
|
12794
12815
|
static getGeometryCatalog() {
|
|
12795
|
-
return
|
|
12816
|
+
return bl();
|
|
12796
12817
|
}
|
|
12797
12818
|
static getGeometryPackCatalog() {
|
|
12798
|
-
return
|
|
12819
|
+
return xl();
|
|
12799
12820
|
}
|
|
12800
12821
|
constructor() {
|
|
12801
|
-
super(), this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = "<style>" +
|
|
12822
|
+
super(), this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = "<style>" + Pl + Fl + Il + "</style>" + Vl, this.canvas = this.shadowRoot.querySelector("canvas"), this.panel = this.shadowRoot.querySelector(".panel"), this.scene = new tr(), this.camera = new Kn(30, 1, .1, 2e3), this.cameraPosition = new U(), this.cameraTarget = new U(), this.raycaster = new Wa(), this.pointer = new V(), this.nodes = /* @__PURE__ */ new Map(), this.open = /* @__PURE__ */ new Set(), this._initialOpenContainers = /* @__PURE__ */ new Set(), this.selected = null, this.selectedRelationIndex = null, this.modelData = null, this._loading = !1, this._pendingSelection = null, this._theme = Ml(), this.relationMode = Ol(this.getAttribute("relation-mode")), this.relationMarker = Dl(this.getAttribute("relation-marker")), this.focusFilter = wl({
|
|
12802
12823
|
mode: this.getAttribute("focus-mode"),
|
|
12803
12824
|
effect: this.getAttribute("focus-effect"),
|
|
12804
12825
|
layout: this.getAttribute("focus-layout")
|
|
12805
|
-
}), this.selectionMode = ["internal", "event"].includes(this.getAttribute("selection-mode")) ? this.getAttribute("selection-mode") : "internal", this.selectionNavigation =
|
|
12826
|
+
}), this.selectionMode = ["internal", "event"].includes(this.getAttribute("selection-mode")) ? this.getAttribute("selection-mode") : "internal", this.selectionNavigation = Tl(this.getAttribute("selection-navigation")), this.itemFacing = El(this.getAttribute("item-facing")), this.showShellLabels = this.getAttribute("shell-labels") !== "false", this.yaw = .37, this.pitch = .22, this.zoom = 1, this.targetZoom = 1, this.focus = new U(), this.targetFocus = new U(), this.drag = null, this.pointers = /* @__PURE__ */ new Map(), this.relationGroup = new Qn(), this.scene.add(this.relationGroup), this.relations = [], this.animationFrame = 0, this.ready = !1, this._toolbarVisible = this.getAttribute("toolbar") !== "off", this._panelVisible = this.getAttribute("panel") !== "off", this.toolbar = this.shadowRoot.querySelector(".toolbar"), this._printState = null, this._beforePrintListener = () => this.prepareForPrint(), this._afterPrintListener = () => this.restoreAfterPrint(), this._printMedia = globalThis.matchMedia?.("print") || null, this._printMediaListener = (e) => e.matches ? this.prepareForPrint() : this.restoreAfterPrint(), this._geometryRegistryListener = () => {
|
|
12806
12827
|
this.ready && this.modelData && this._build();
|
|
12807
12828
|
}, this._bindControls(), this._syncFocusToolbar(), this._syncRelationToolbar(), this._syncLabelsToolbar(), this._syncPanelToolbar(), this._syncItemFacingToolbar(), this.resizeObserver = new ResizeObserver(() => this.resize()), this.resizeObserver.observe(this.canvas);
|
|
12808
12829
|
}
|
|
@@ -12814,7 +12835,7 @@ var cu = class extends HTMLElement {
|
|
|
12814
12835
|
}
|
|
12815
12836
|
attributeChangedCallback(e, t, n) {
|
|
12816
12837
|
if (t !== n) {
|
|
12817
|
-
if (e === "height" && this.style.setProperty("--lc-height", n || "680px"), e === "relation-mode" && this.ready && this.setRelationMode(n || "selected"), e === "selection-mode" && this.setSelectionMode(n || "internal"), e === "selection-navigation" && this.setSelectionNavigation(n), e === "item-facing" &&
|
|
12838
|
+
if (e === "height" && this.style.setProperty("--lc-height", n || "680px"), e === "relation-mode" && this.ready && this.setRelationMode(n || "selected"), e === "relation-marker" && Dl(n) !== this.relationMarker && this.setRelationMarker(n, { source: "attribute" }), e === "selection-mode" && this.setSelectionMode(n || "internal"), e === "selection-navigation" && this.setSelectionNavigation(n), e === "item-facing" && El(n) !== this.itemFacing && this.setItemFacing(n, { source: "attribute" }), e === "focus-mode" && n !== this.focusFilter.mode && this.setFocusFilter({ mode: n }), e === "focus-effect" && n !== this.focusFilter.effect && this.setFocusFilter({ effect: n }), e === "focus-layout" && n !== this.focusFilter.layout && this.setFocusFilter({ layout: n }), e === "shell-labels" && this.ready) {
|
|
12818
12839
|
let e = n !== "false";
|
|
12819
12840
|
e !== this.showShellLabels && (this.showShellLabels = e, this._build({
|
|
12820
12841
|
preserveSelection: this.selected?.id,
|
|
@@ -12857,7 +12878,7 @@ var cu = class extends HTMLElement {
|
|
|
12857
12878
|
this.setPalette(e);
|
|
12858
12879
|
}
|
|
12859
12880
|
captureFrame() {
|
|
12860
|
-
return
|
|
12881
|
+
return fu(this.renderer, this.scene, this.camera, this.ownerDocument);
|
|
12861
12882
|
}
|
|
12862
12883
|
prepareForPrint() {
|
|
12863
12884
|
if (this._printState) return this;
|
|
@@ -12962,13 +12983,13 @@ var cu = class extends HTMLElement {
|
|
|
12962
12983
|
if (!e.size) return null;
|
|
12963
12984
|
for (let t of [...e]) {
|
|
12964
12985
|
let n = this.nodes.get(t);
|
|
12965
|
-
n &&
|
|
12986
|
+
n && Cl(n.type) && this._descendantIds(t, e);
|
|
12966
12987
|
}
|
|
12967
12988
|
let t = new Set(e);
|
|
12968
12989
|
for (let n of this.relations) (t.has(n.from) || t.has(n.to)) && (e.add(n.from), e.add(n.to));
|
|
12969
12990
|
for (let t of [...e]) {
|
|
12970
12991
|
let n = this.nodes.get(t);
|
|
12971
|
-
n &&
|
|
12992
|
+
n && Cl(n.type) && this._descendantIds(t, e);
|
|
12972
12993
|
}
|
|
12973
12994
|
for (let t of [...e]) {
|
|
12974
12995
|
let n = this.nodes.get(t)?.parent ? this.nodes.get(this.nodes.get(t).parent) : null;
|
|
@@ -13010,18 +13031,25 @@ var cu = class extends HTMLElement {
|
|
|
13010
13031
|
r && (r.textContent = e === "all" ? "Todo" : e === "dim" ? "Conectados" : "Aislar");
|
|
13011
13032
|
}
|
|
13012
13033
|
_syncRelationToolbar() {
|
|
13013
|
-
|
|
13014
|
-
|
|
13015
|
-
"selected",
|
|
13016
|
-
"none"
|
|
13017
|
-
]) {
|
|
13034
|
+
if (!this.shadowRoot) return;
|
|
13035
|
+
for (let e of nl) {
|
|
13018
13036
|
let t = this.shadowRoot.querySelector(`[data-action="relations-${e}"]`);
|
|
13019
13037
|
if (!t) continue;
|
|
13020
13038
|
let n = e === this.relationMode;
|
|
13021
|
-
t.classList.toggle("active", n), t.setAttribute("aria-pressed", String(n))
|
|
13039
|
+
t.classList.toggle("active", n), t.setAttribute("aria-pressed", String(n)), [
|
|
13040
|
+
"selected",
|
|
13041
|
+
"callers",
|
|
13042
|
+
"called"
|
|
13043
|
+
].includes(e) && (t.disabled = !this.selected && this.selectedRelationIndex === null);
|
|
13022
13044
|
}
|
|
13023
13045
|
let e = this.shadowRoot.querySelector("[data-toolbar-status=\"relations\"]");
|
|
13024
|
-
e && (e.textContent =
|
|
13046
|
+
e && (e.textContent = {
|
|
13047
|
+
all: "Todas",
|
|
13048
|
+
selected: "Selección",
|
|
13049
|
+
callers: "All callers",
|
|
13050
|
+
called: "All called",
|
|
13051
|
+
none: "Ocultar"
|
|
13052
|
+
}[this.relationMode]);
|
|
13025
13053
|
}
|
|
13026
13054
|
_syncPanelToolbar() {
|
|
13027
13055
|
let e = this.shadowRoot?.querySelector("[data-action=\"panel\"]");
|
|
@@ -13045,7 +13073,7 @@ var cu = class extends HTMLElement {
|
|
|
13045
13073
|
});
|
|
13046
13074
|
}
|
|
13047
13075
|
setFocusFilter(e = {}, t = {}) {
|
|
13048
|
-
let n =
|
|
13076
|
+
let n = wl({
|
|
13049
13077
|
...this.focusFilter,
|
|
13050
13078
|
...e || {}
|
|
13051
13079
|
}), r = JSON.stringify(n) !== JSON.stringify(this.focusFilter);
|
|
@@ -13057,13 +13085,12 @@ var cu = class extends HTMLElement {
|
|
|
13057
13085
|
_applyModelRenderOptions() {
|
|
13058
13086
|
let e = this.modelData?.render;
|
|
13059
13087
|
if (!e || typeof e != "object") return this;
|
|
13060
|
-
|
|
13061
|
-
|
|
13062
|
-
"
|
|
13063
|
-
|
|
13064
|
-
].includes(e.relationMode) && e.relationMode !== this.relationMode && this.setRelationMode(e.relationMode), Object.hasOwn(e, "selectionMode") && e.selectionMode !== this.selectionMode && this.setSelectionMode(e.selectionMode);
|
|
13088
|
+
nl.includes(e.relationMode) && e.relationMode !== this.relationMode && this.setRelationMode(e.relationMode), Dl(e.relationMarker) !== this.relationMarker && this.setRelationMarker(e.relationMarker, {
|
|
13089
|
+
emit: !1,
|
|
13090
|
+
source: "model"
|
|
13091
|
+
}), Object.hasOwn(e, "selectionMode") && e.selectionMode !== this.selectionMode && this.setSelectionMode(e.selectionMode);
|
|
13065
13092
|
let t = e.navigation?.onSelect ?? e.selectionNavigation;
|
|
13066
|
-
return t != null && t !== this.selectionNavigation && this.setSelectionNavigation(t), Object.hasOwn(e, "toolbar") && e.toolbar !== !1 !== this.toolbarVisible && this.setToolbarVisible(e.toolbar !== !1), Object.hasOwn(e, "shellLabels") && e.shellLabels !== !1 !== this.showShellLabels && this.setShellLabels(e.shellLabels !== !1), Object.hasOwn(e, "itemFacing") &&
|
|
13093
|
+
return t != null && t !== this.selectionNavigation && this.setSelectionNavigation(t), Object.hasOwn(e, "toolbar") && e.toolbar !== !1 !== this.toolbarVisible && this.setToolbarVisible(e.toolbar !== !1), Object.hasOwn(e, "shellLabels") && e.shellLabels !== !1 !== this.showShellLabels && this.setShellLabels(e.shellLabels !== !1), Object.hasOwn(e, "itemFacing") && El(e.itemFacing) !== this.itemFacing && this.setItemFacing(e.itemFacing, {
|
|
13067
13094
|
emit: !1,
|
|
13068
13095
|
source: "model"
|
|
13069
13096
|
}), e.focus && this.setFocusFilter(e.focus, { emit: !1 }), this;
|
|
@@ -13076,10 +13103,10 @@ var cu = class extends HTMLElement {
|
|
|
13076
13103
|
}));
|
|
13077
13104
|
}
|
|
13078
13105
|
_containerEntityIds() {
|
|
13079
|
-
return (this.modelData?.entities || []).filter((e) =>
|
|
13106
|
+
return (this.modelData?.entities || []).filter((e) => Cl(e.type)).map((e) => e.id);
|
|
13080
13107
|
}
|
|
13081
13108
|
_declaredOpenContainerIds() {
|
|
13082
|
-
return (this.modelData?.entities || []).filter((e) =>
|
|
13109
|
+
return (this.modelData?.entities || []).filter((e) => Cl(e.type) && e.open === !0).map((e) => e.id);
|
|
13083
13110
|
}
|
|
13084
13111
|
_emitContainerStateChange(e, t = {}) {
|
|
13085
13112
|
if (!e?.changed || t.emit === !1) return;
|
|
@@ -13137,7 +13164,7 @@ var cu = class extends HTMLElement {
|
|
|
13137
13164
|
}
|
|
13138
13165
|
_commitModelChange(e, t = {}, n = {}) {
|
|
13139
13166
|
let r = n.preserveSelection === !1 ? null : this.selected?.id, i = n.preserveSelection === !1 ? null : this._publicRelation(this.selectedRelationIndex), a = i?.id ?? i?.index ?? null;
|
|
13140
|
-
this.modelData =
|
|
13167
|
+
this.modelData = Wl(this.modelData);
|
|
13141
13168
|
let o = this._syncInitialContainerState({
|
|
13142
13169
|
refresh: !1,
|
|
13143
13170
|
emit: !1,
|
|
@@ -13154,7 +13181,7 @@ var cu = class extends HTMLElement {
|
|
|
13154
13181
|
}
|
|
13155
13182
|
updateModel(e = {}, t = {}) {
|
|
13156
13183
|
if (!e || typeof e != "object" || Array.isArray(e)) throw TypeError("El parche del modelo debe ser un objeto.");
|
|
13157
|
-
let n = this.modelData ||
|
|
13184
|
+
let n = this.modelData || Wl({}), r = JSON.stringify(n.render?.camera || null), i = {
|
|
13158
13185
|
...n,
|
|
13159
13186
|
...e,
|
|
13160
13187
|
palette: e.palette ? {
|
|
@@ -13165,11 +13192,11 @@ var cu = class extends HTMLElement {
|
|
|
13165
13192
|
entities: Array.isArray(e.entities) ? e.entities : n.entities,
|
|
13166
13193
|
relations: Array.isArray(e.relations) ? e.relations : n.relations
|
|
13167
13194
|
};
|
|
13168
|
-
return this.modelData =
|
|
13195
|
+
return this.modelData = Wl(i), this.theme = this.modelData.theme, this._commitModelChange("model-update", { patch: e }, t), this._applyModelRenderOptions(), JSON.stringify(this.modelData.render?.camera || null) !== r && this.modelData.render?.camera && this.setCameraView(this.modelData.render.camera, { animate: t.animateCamera !== !1 }), this;
|
|
13169
13196
|
}
|
|
13170
13197
|
addEntity(e, t = {}) {
|
|
13171
13198
|
if (!e || typeof e != "object" || !e.id) throw TypeError("La entidad debe incluir un id.");
|
|
13172
|
-
if (this.modelData ||=
|
|
13199
|
+
if (this.modelData ||= Wl({}), this.modelData.entities.some((t) => t.id === e.id)) throw Error(`Ya existe una entidad con id "${e.id}".`);
|
|
13173
13200
|
if (e.parent && !this.modelData.entities.some((t) => t.id === e.parent)) throw Error(`No existe el contenedor padre "${e.parent}".`);
|
|
13174
13201
|
return this.modelData.entities = [...this.modelData.entities, { ...e }], this._commitModelChange("entity-add", { entity: this._publicEntity(e.id) }, t);
|
|
13175
13202
|
}
|
|
@@ -13246,10 +13273,10 @@ var cu = class extends HTMLElement {
|
|
|
13246
13273
|
return this.targetZoom = Math.min(2.8, this.targetZoom * 1.18), this.invalidate(), this;
|
|
13247
13274
|
}
|
|
13248
13275
|
zoomOut() {
|
|
13249
|
-
return this.targetZoom = Math.max(
|
|
13276
|
+
return this.targetZoom = Math.max(rl, this.targetZoom / 1.18), this.invalidate(), this;
|
|
13250
13277
|
}
|
|
13251
13278
|
setSelectionNavigation(e) {
|
|
13252
|
-
let t =
|
|
13279
|
+
let t = Tl(e);
|
|
13253
13280
|
return this.selectionNavigation = t, this.getAttribute("selection-navigation") !== t && this.setAttribute("selection-navigation", t), this;
|
|
13254
13281
|
}
|
|
13255
13282
|
focusSelection(e = {}) {
|
|
@@ -13262,7 +13289,7 @@ var cu = class extends HTMLElement {
|
|
|
13262
13289
|
return t ? (this.targetFocus.copy(t), this.targetZoom = n, e.animate === !1 && (this.focus.copy(this.targetFocus), this.zoom = this.targetZoom), this.invalidate(), this) : this;
|
|
13263
13290
|
}
|
|
13264
13291
|
_applySelectionNavigation(e = this.selectionNavigation) {
|
|
13265
|
-
let t =
|
|
13292
|
+
let t = Tl(e);
|
|
13266
13293
|
if (t === "preserve") return this;
|
|
13267
13294
|
let n = this.targetZoom;
|
|
13268
13295
|
return this.focusSelection(), t === "center" && (this.targetZoom = n), this;
|
|
@@ -13287,7 +13314,7 @@ var cu = class extends HTMLElement {
|
|
|
13287
13314
|
return Math.max(29, 39.5 / Math.max(this.camera.aspect, .5));
|
|
13288
13315
|
}
|
|
13289
13316
|
getCameraView() {
|
|
13290
|
-
let e = this.focus.clone(), t = this._baseCameraDistance() / Math.max(
|
|
13317
|
+
let e = this.focus.clone(), t = this._baseCameraDistance() / Math.max(rl, this.zoom), n = new U(Math.sin(this.yaw) * Math.cos(this.pitch), Math.sin(this.pitch), Math.cos(this.yaw) * Math.cos(this.pitch)).multiplyScalar(t).add(e), r = (e) => e.map((e) => Number(e.toFixed(3)));
|
|
13291
13318
|
return {
|
|
13292
13319
|
position: r(n.toArray()),
|
|
13293
13320
|
target: r(e.toArray()),
|
|
@@ -13301,7 +13328,7 @@ var cu = class extends HTMLElement {
|
|
|
13301
13328
|
if (!(a > 1e-6)) return this;
|
|
13302
13329
|
this.yaw = Math.atan2(i.x, i.z), this.pitch = Math.asin(Math.max(-1, Math.min(1, i.y / a)));
|
|
13303
13330
|
let o = Number(e.zoom), s = Number.isFinite(o) && o > 0 ? o : this._baseCameraDistance() / a;
|
|
13304
|
-
return this.targetFocus.copy(r), this.targetZoom = Math.max(
|
|
13331
|
+
return this.targetFocus.copy(r), this.targetZoom = Math.max(rl, Math.min(2.8, s)), t.animate === !1 && (this.focus.copy(this.targetFocus), this.zoom = this.targetZoom), this.invalidate(), this;
|
|
13305
13332
|
}
|
|
13306
13333
|
restoreInitialCamera(e = {}) {
|
|
13307
13334
|
let t = this.modelData?.render?.camera;
|
|
@@ -13318,7 +13345,7 @@ var cu = class extends HTMLElement {
|
|
|
13318
13345
|
t.expandByPoint(n.clone().sub(r)), t.expandByPoint(n.clone().add(r));
|
|
13319
13346
|
}
|
|
13320
13347
|
let n = t.isEmpty() ? new U() : t.getCenter(new U()), r = t.isEmpty() ? new U(1, 1, 1) : t.getSize(new U()), i = Math.max(1, r.length() / 2), a = de.degToRad(this.camera.fov), o = i / Math.sin(a / 2) * 1.12, s = this._baseCameraDistance();
|
|
13321
|
-
return this.targetZoom = Math.max(
|
|
13348
|
+
return this.targetZoom = Math.max(rl, Math.min(2.8, s / o)), this.targetFocus.copy(n), e.animate === !1 && (this.zoom = this.targetZoom, this.focus.copy(this.targetFocus)), this.invalidate(), this;
|
|
13322
13349
|
}
|
|
13323
13350
|
frontView() {
|
|
13324
13351
|
return this.yaw = 0, this.pitch = 0, this.invalidate(), this;
|
|
@@ -13334,7 +13361,7 @@ var cu = class extends HTMLElement {
|
|
|
13334
13361
|
return this.setShellLabels(!this.showShellLabels);
|
|
13335
13362
|
}
|
|
13336
13363
|
setItemFacing(e = "camera", t = {}) {
|
|
13337
|
-
let n =
|
|
13364
|
+
let n = El(e), r = n !== this.itemFacing;
|
|
13338
13365
|
return this.itemFacing = n, this.getAttribute("item-facing") !== n && this.setAttribute("item-facing", n), this._syncItemFacingToolbar(), this._applyItemFacing(), this.invalidate(), r && t.emit !== !1 && this._emit("lc-item-facing-change", {
|
|
13339
13366
|
mode: n,
|
|
13340
13367
|
source: t.source || "api"
|
|
@@ -13344,7 +13371,7 @@ var cu = class extends HTMLElement {
|
|
|
13344
13371
|
return this.setItemFacing(this.itemFacing === "camera" ? "model" : "camera", e);
|
|
13345
13372
|
}
|
|
13346
13373
|
_applyItemFacing() {
|
|
13347
|
-
if (this.camera) for (let e of this.nodes.values()) e.group && !
|
|
13374
|
+
if (this.camera) for (let e of this.nodes.values()) e.group && !Cl(e.type) && (this.itemFacing === "camera" ? e.group.quaternion.copy(this.camera.quaternion) : e.group.quaternion.identity());
|
|
13348
13375
|
}
|
|
13349
13376
|
isContainerOpen(e) {
|
|
13350
13377
|
return this._containerEntityIds().includes(e) && this.open.has(e);
|
|
@@ -13359,14 +13386,14 @@ var cu = class extends HTMLElement {
|
|
|
13359
13386
|
setContainerOpen(e, t = !0, n = {}) {
|
|
13360
13387
|
let r = this.modelData?.entities?.find((t) => t.id === e);
|
|
13361
13388
|
if (!r) throw Error(`No existe una entidad con id "${e}".`);
|
|
13362
|
-
if (!
|
|
13389
|
+
if (!Cl(r.type)) throw TypeError(`La entidad "${e}" no es un contenedor.`);
|
|
13363
13390
|
let i = new Set(this.open);
|
|
13364
13391
|
if (t) i.add(e);
|
|
13365
13392
|
else if (i.delete(e), n.closeDescendants !== !1) for (let t of this.modelData.entities) {
|
|
13366
13393
|
let n = t.parent, r = /* @__PURE__ */ new Set();
|
|
13367
13394
|
for (; n && !r.has(n);) {
|
|
13368
13395
|
if (r.add(n), n === e) {
|
|
13369
|
-
|
|
13396
|
+
Cl(t.type) && i.delete(t.id);
|
|
13370
13397
|
break;
|
|
13371
13398
|
}
|
|
13372
13399
|
n = this.modelData.entities.find((e) => e.id === n)?.parent || null;
|
|
@@ -13403,13 +13430,13 @@ var cu = class extends HTMLElement {
|
|
|
13403
13430
|
this.setTheme(e);
|
|
13404
13431
|
}
|
|
13405
13432
|
get theme() {
|
|
13406
|
-
return this._theme ||
|
|
13433
|
+
return this._theme || Ml();
|
|
13407
13434
|
}
|
|
13408
13435
|
set theme(e) {
|
|
13409
|
-
this._theme =
|
|
13436
|
+
this._theme = Ml(e), this.shadowRoot && this._applyTheme();
|
|
13410
13437
|
}
|
|
13411
13438
|
setTheme(e = {}) {
|
|
13412
|
-
return this.theme =
|
|
13439
|
+
return this.theme = jl(this.theme, e), this.modelData && (this.modelData.theme = this.theme), this._applyLighting(), this.invalidate(), this;
|
|
13413
13440
|
}
|
|
13414
13441
|
_applyTheme() {
|
|
13415
13442
|
let e = this.theme, t = this.style;
|
|
@@ -13440,7 +13467,7 @@ var cu = class extends HTMLElement {
|
|
|
13440
13467
|
this._loading = !0, this._pendingSelection = null;
|
|
13441
13468
|
try {
|
|
13442
13469
|
let t = typeof e == "string" ? await fetch(e).then((e) => e.json()) : e;
|
|
13443
|
-
this.modelData =
|
|
13470
|
+
this.modelData = Wl(t), this.selected = null, this.selectedRelationIndex = null, this.open.clear(), this._initialOpenContainers.clear(), this._pendingPalette &&= (this.modelData.palette = {
|
|
13444
13471
|
...this.modelData.palette,
|
|
13445
13472
|
...this._pendingPalette
|
|
13446
13473
|
}, null), this.theme = this.modelData.theme, this._applyTheme(), this._syncInitialContainerState({
|
|
@@ -13471,9 +13498,9 @@ var cu = class extends HTMLElement {
|
|
|
13471
13498
|
}
|
|
13472
13499
|
_applyLighting() {
|
|
13473
13500
|
if (!this.ambientLight || !this.directionalLight) return;
|
|
13474
|
-
let e = this.theme?.lighting ||
|
|
13501
|
+
let e = this.theme?.lighting || Al.lighting;
|
|
13475
13502
|
this.ambientLight.color.set(e.ambientSky), this.ambientLight.groundColor.set(e.ambientGround), this.ambientLight.intensity = Number(e.ambient) || 0, this.directionalLight.color.set(e.directionalColor), this.directionalLight.intensity = Number(e.directional) || 0;
|
|
13476
|
-
let t = Array.isArray(e.directionalPosition) ? e.directionalPosition :
|
|
13503
|
+
let t = Array.isArray(e.directionalPosition) ? e.directionalPosition : Al.lighting.directionalPosition;
|
|
13477
13504
|
this.directionalLight.position.fromArray(t);
|
|
13478
13505
|
}
|
|
13479
13506
|
_worldPosition(e, t = /* @__PURE__ */ new Set()) {
|
|
@@ -13510,7 +13537,7 @@ var cu = class extends HTMLElement {
|
|
|
13510
13537
|
...e.geometryPalette || {},
|
|
13511
13538
|
...e.geometryPaletteOverrides || {}
|
|
13512
13539
|
};
|
|
13513
|
-
n.material.color.set(
|
|
13540
|
+
n.material.color.set(Ql(n.value, r, t)), n.material.emissive && n.emissiveValue && n.material.emissive.set(Ql(n.emissiveValue, r, "#000000"));
|
|
13514
13541
|
}
|
|
13515
13542
|
}
|
|
13516
13543
|
}
|
|
@@ -13523,19 +13550,19 @@ var cu = class extends HTMLElement {
|
|
|
13523
13550
|
for (let e of this.modelData.entities) {
|
|
13524
13551
|
let t = this.nodes.get(e.id);
|
|
13525
13552
|
t.group = new Qn(), t.group.position.copy(this._worldPosition(t));
|
|
13526
|
-
let n = e.geometry || "box", r =
|
|
13553
|
+
let n = e.geometry || "box", r = Sl(n), i = !r && n.includes("."), a = i ? "#ed8f98" : this.modelData.palette[e.c] || e.c || this.modelData.palette.component;
|
|
13527
13554
|
i && this.dispatchEvent(new CustomEvent("lc-warning", { detail: {
|
|
13528
13555
|
code: "GEOMETRY_NOT_REGISTERED",
|
|
13529
13556
|
geometry: n,
|
|
13530
13557
|
entityId: e.id
|
|
13531
13558
|
} }));
|
|
13532
|
-
let o = r?.primitive || n, s = r && !r.primitive && !
|
|
13559
|
+
let o = r?.primitive || n, s = r && !r.primitive && !Cl(e.type);
|
|
13533
13560
|
if (t.geometryDefinition = r || null, t.geometryMissing = i, t.geometryPalette = r?.palette || {}, t.geometryPaletteOverrides = e.geometryPalette || e.geometry_palette || {}, t.ports = {
|
|
13534
13561
|
...r?.anchors || {},
|
|
13535
13562
|
...e.ports || {}
|
|
13536
13563
|
}, s) {
|
|
13537
13564
|
try {
|
|
13538
|
-
let n =
|
|
13565
|
+
let n = ou(r, e, this.modelData.palette, () => this.invalidate(), (e) => this.dispatchEvent(new CustomEvent("lc-warning", { detail: e })));
|
|
13539
13566
|
n.root.scale.multiply(new U().fromArray(e.s)), t.appearanceMaterials = [], n.root.traverse((e) => {
|
|
13540
13567
|
if (!(e.isMesh || e.isLine || e.isLineSegments || e.isSprite)) return;
|
|
13541
13568
|
e.userData.node = t;
|
|
@@ -13556,7 +13583,7 @@ var cu = class extends HTMLElement {
|
|
|
13556
13583
|
entityId: e.id,
|
|
13557
13584
|
error: r
|
|
13558
13585
|
} }));
|
|
13559
|
-
let i =
|
|
13586
|
+
let i = Xl(Yl("box"));
|
|
13560
13587
|
t.material = new ia({
|
|
13561
13588
|
color: "#ed8f98",
|
|
13562
13589
|
roughness: .72,
|
|
@@ -13565,13 +13592,13 @@ var cu = class extends HTMLElement {
|
|
|
13565
13592
|
}
|
|
13566
13593
|
t.labelSize = new U().fromArray(e.s);
|
|
13567
13594
|
} else {
|
|
13568
|
-
let n = o === "box" && Number(e.radius) > 0, r =
|
|
13569
|
-
n ||
|
|
13595
|
+
let n = o === "box" && Number(e.radius) > 0, r = Yl(o, e.radius, e.segments, e.s);
|
|
13596
|
+
n || Xl(r), t.material = new ia({
|
|
13570
13597
|
color: a,
|
|
13571
13598
|
roughness: .72,
|
|
13572
13599
|
metalness: .06,
|
|
13573
13600
|
transparent: !0,
|
|
13574
|
-
opacity:
|
|
13601
|
+
opacity: Cl(e.type) ? .96 : 1
|
|
13575
13602
|
}), t.mesh = new An(r, t.material), t.mesh.scale.fromArray(n ? [
|
|
13576
13603
|
1,
|
|
13577
13604
|
1,
|
|
@@ -13586,7 +13613,7 @@ var cu = class extends HTMLElement {
|
|
|
13586
13613
|
1
|
|
13587
13614
|
] : e.s), t.group.add(t.edge);
|
|
13588
13615
|
}
|
|
13589
|
-
t.label =
|
|
13616
|
+
t.label = du(e.name, a, t.labelSize, e.type, this.showShellLabels), t.labelAnchor = lu(e, this.modelData.style), t.label.userData.node = t, t.label.traverse((e) => {
|
|
13590
13617
|
e.userData.node = t;
|
|
13591
13618
|
}), t.group.add(t.label), this.scene.add(t.group);
|
|
13592
13619
|
}
|
|
@@ -13621,7 +13648,32 @@ var cu = class extends HTMLElement {
|
|
|
13621
13648
|
return i.add(s.multiplyScalar(u));
|
|
13622
13649
|
}
|
|
13623
13650
|
_activeRelationIndexes() {
|
|
13624
|
-
|
|
13651
|
+
if (this.relationMode === "all") return this.relations.map((e, t) => t);
|
|
13652
|
+
if (this.selectedRelationIndex !== null && this.relationMode === "selected") return [this.selectedRelationIndex];
|
|
13653
|
+
if (this.relationMode === "selected") return this.selected ? this.relations.map((e, t) => e.from === this.selected.id || e.to === this.selected.id ? t : -1).filter((e) => e >= 0) : [];
|
|
13654
|
+
if (!["callers", "called"].includes(this.relationMode)) return [];
|
|
13655
|
+
let e = this.selectedRelationIndex === null ? null : this.relations[this.selectedRelationIndex], t = this.selected?.id || (this.relationMode === "callers" ? e?.to : e?.from);
|
|
13656
|
+
return t ? this._recursiveRelationIndexes(t, this.relationMode) : [];
|
|
13657
|
+
}
|
|
13658
|
+
_recursiveRelationIndexes(e, t) {
|
|
13659
|
+
let n = [e], r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
|
|
13660
|
+
for (; n.length;) {
|
|
13661
|
+
let e = n.shift();
|
|
13662
|
+
e && !r.has(e) && (r.add(e), this.relations.forEach((a, o) => {
|
|
13663
|
+
let s = Nl(a) === "bidirectional", c = null;
|
|
13664
|
+
t === "callers" ? a.to === e ? c = a.from : s && a.from === e && (c = a.to) : a.from === e ? c = a.to : s && a.to === e && (c = a.from), c && (i.add(o), r.has(c) || n.push(c));
|
|
13665
|
+
}));
|
|
13666
|
+
}
|
|
13667
|
+
return [...i].sort((e, t) => e - t);
|
|
13668
|
+
}
|
|
13669
|
+
_createRelationMarker(e, t, n, r = this.relationMarker) {
|
|
13670
|
+
let i = Dl(r), a = new An(i === "ring" ? new na(.068, .018, 8, 20) : new Dr(.09, .22, 12), new rn({
|
|
13671
|
+
color: e,
|
|
13672
|
+
transparent: !0,
|
|
13673
|
+
opacity: t,
|
|
13674
|
+
depthWrite: !1
|
|
13675
|
+
})), o = i === "ring" ? new U(0, 0, 1) : new U(0, 1, 0);
|
|
13676
|
+
return a.quaternion.setFromUnitVectors(o, n), a.userData.relationMarker = i, a;
|
|
13625
13677
|
}
|
|
13626
13678
|
_rebuildRelations() {
|
|
13627
13679
|
this._clearRelationGroup();
|
|
@@ -13633,7 +13685,7 @@ var cu = class extends HTMLElement {
|
|
|
13633
13685
|
if (!o && this.focusFilter.effect === "hide") continue;
|
|
13634
13686
|
let s = o ? 1 : this.focusFilter.opacity, c = this._endpoint(i, a, !0, e), l = this._endpoint(a, i, !1, e), u = l.clone().sub(c);
|
|
13635
13687
|
if (u.lengthSq() < .01) continue;
|
|
13636
|
-
let d =
|
|
13688
|
+
let d = Nl(e), f = r === this.selectedRelationIndex, p = (e, t = .055, n = .88) => {
|
|
13637
13689
|
let r = new rn({
|
|
13638
13690
|
color: e,
|
|
13639
13691
|
transparent: !0,
|
|
@@ -13643,7 +13695,7 @@ var cu = class extends HTMLElement {
|
|
|
13643
13695
|
});
|
|
13644
13696
|
f && (r.color.lerp(new X(16777215), .28), r.opacity = 1);
|
|
13645
13697
|
let i = new An(new ra(new ri(c, l), 10, f ? t * 1.45 : t, 6, !1), r);
|
|
13646
|
-
return i.renderOrder =
|
|
13698
|
+
return i.renderOrder = il, this.relationGroup.add(i), i;
|
|
13647
13699
|
}, m = new An(new ra(new ri(c, l), 10, .16, 6, !1), new rn({
|
|
13648
13700
|
transparent: !0,
|
|
13649
13701
|
opacity: 0,
|
|
@@ -13656,26 +13708,16 @@ var cu = class extends HTMLElement {
|
|
|
13656
13708
|
p(14965603);
|
|
13657
13709
|
let e = u.clone().normalize(), t = Math.min(.18, Math.max(.07, u.length() * .018));
|
|
13658
13710
|
for (let n = 0; n < 3; n++) {
|
|
13659
|
-
let i = c.clone().lerp(l, (n + 1) / 4), a =
|
|
13660
|
-
|
|
13661
|
-
transparent: !0,
|
|
13662
|
-
opacity: (f ? 1 : .9) * s,
|
|
13663
|
-
depthWrite: !1
|
|
13664
|
-
}));
|
|
13665
|
-
a.userData.relationIndex = r, a.userData.phase = n / 3, a.userData.oscillate = !0, a.userData.start = i.clone().sub(e.clone().multiplyScalar(t)), a.userData.end = i.clone().add(e.clone().multiplyScalar(t)), a.quaternion.setFromUnitVectors(new U(0, 0, 1), e), a.renderOrder = nl, this.relationGroup.add(a);
|
|
13711
|
+
let i = c.clone().lerp(l, (n + 1) / 4), a = this._createRelationMarker(14965603, (f ? 1 : .9) * s, e);
|
|
13712
|
+
a.userData.relationIndex = r, a.userData.phase = n / 3, a.userData.oscillate = !0, a.userData.start = i.clone().sub(e.clone().multiplyScalar(t)), a.userData.end = i.clone().add(e.clone().multiplyScalar(t)), a.renderOrder = il, this.relationGroup.add(a);
|
|
13666
13713
|
}
|
|
13667
13714
|
continue;
|
|
13668
13715
|
}
|
|
13669
13716
|
p(n);
|
|
13670
13717
|
let h = u.clone().normalize();
|
|
13671
13718
|
for (let e = 0; e < 4; e++) {
|
|
13672
|
-
let t =
|
|
13673
|
-
|
|
13674
|
-
transparent: !0,
|
|
13675
|
-
opacity: (f ? 1 : .9) * s,
|
|
13676
|
-
depthWrite: !1
|
|
13677
|
-
}));
|
|
13678
|
-
t.userData.relationIndex = r, t.userData.phase = e / 4, t.userData.direction = d === "bidirectional" && e % 2 ? -1 : 1, t.userData.start = c.clone(), t.userData.end = l.clone(), t.quaternion.setFromUnitVectors(new U(0, 0, 1), h), t.renderOrder = nl, this.relationGroup.add(t);
|
|
13719
|
+
let t = d === "bidirectional" && e % 2 ? -1 : 1, i = this._createRelationMarker(n, (f ? 1 : .9) * s, h.clone().multiplyScalar(t));
|
|
13720
|
+
i.userData.relationIndex = r, i.userData.phase = e / 4, i.userData.direction = t, i.userData.start = c.clone(), i.userData.end = l.clone(), i.renderOrder = il, this.relationGroup.add(i);
|
|
13679
13721
|
}
|
|
13680
13722
|
}
|
|
13681
13723
|
}
|
|
@@ -13683,8 +13725,8 @@ var cu = class extends HTMLElement {
|
|
|
13683
13725
|
if (!this.modelData) return;
|
|
13684
13726
|
let e = this.selectedRelationIndex === null ? null : this.relations[this.selectedRelationIndex];
|
|
13685
13727
|
if (e) {
|
|
13686
|
-
let t =
|
|
13687
|
-
this.panel.innerHTML = "<button class=\"back\" data-action=\"overview\">← Vista de conjunto</button><button data-action=\"focus-selection\">◎ Enfocar selección</button><div class=\"eyebrow\">RELACIÓN</div><h2>" +
|
|
13728
|
+
let t = Nl(e), n = e.text ? "<p>" + Hl(e.text) + "</p>" : "", r = Ul(e.url);
|
|
13729
|
+
this.panel.innerHTML = "<button class=\"back\" data-action=\"overview\">← Vista de conjunto</button><button data-action=\"focus-selection\">◎ Enfocar selección</button><div class=\"eyebrow\">RELACIÓN</div><h2>" + Hl(e.label || `${e.from} → ${e.to}`) + "</h2><div class=\"sub\">" + Hl(e.from) + " → " + Hl(e.to) + "</div>" + n + r + "<h3>MODO</h3><p>" + Hl(t) + "</p>", this.panel.querySelector("[data-action=\"overview\"]")?.addEventListener("click", () => this.reset()), this.panel.querySelector("[data-action=\"focus-selection\"]")?.addEventListener("click", () => this.focusSelection()), this._applyTheme();
|
|
13688
13730
|
return;
|
|
13689
13731
|
}
|
|
13690
13732
|
let t = this.selected;
|
|
@@ -13694,11 +13736,11 @@ var cu = class extends HTMLElement {
|
|
|
13694
13736
|
}
|
|
13695
13737
|
let n = this.relations.filter((e) => e.from === t.id || e.to === t.id), r = this.modelData.entities.filter((e) => e.parent === t.id), i = [], a = /* @__PURE__ */ new Set(), o = t;
|
|
13696
13738
|
for (; o && !a.has(o.id);) a.add(o.id), i.unshift(o), o = o.parent ? this.nodes.get(o.parent) : null;
|
|
13697
|
-
let s = "<nav class=\"crumbs\" aria-label=\"Ruta del modelo\"><button data-action=\"overview\">Modelo</button>" + i.map((e, t) => "<span>/</span><button data-action=\"path\" data-id=\"" +
|
|
13698
|
-
let n = this.relations.indexOf(e), r = e.text ? "<small>" +
|
|
13699
|
-
return "<button class=\"relation\" data-action=\"relation\" data-relation-index=\"" + n + "\"><strong>" +
|
|
13739
|
+
let s = "<nav class=\"crumbs\" aria-label=\"Ruta del modelo\"><button data-action=\"overview\">Modelo</button>" + i.map((e, t) => "<span>/</span><button data-action=\"path\" data-id=\"" + Hl(e.id) + "\" class=\"" + (t === i.length - 1 ? "current" : "") + "\">" + Hl(e.name) + "</button>").join("") + "</nav>", c = n.map((e) => {
|
|
13740
|
+
let n = this.relations.indexOf(e), r = e.text ? "<small>" + Hl(e.text) + "</small>" : "";
|
|
13741
|
+
return "<button class=\"relation\" data-action=\"relation\" data-relation-index=\"" + n + "\"><strong>" + Hl(e.label || (e.from === t.id ? e.to : e.from)) + "</strong><small>" + Hl(e.from) + " → " + Hl(e.to) + "</small>" + r + "</button>";
|
|
13700
13742
|
}).join("");
|
|
13701
|
-
this.panel.innerHTML = "<button class=\"back\" data-action=\"overview\">← Vista de conjunto</button>" + s + "<button data-action=\"focus-selection\">◎ Enfocar selección</button><div class=\"eyebrow\">" +
|
|
13743
|
+
this.panel.innerHTML = "<button class=\"back\" data-action=\"overview\">← Vista de conjunto</button>" + s + "<button data-action=\"focus-selection\">◎ Enfocar selección</button><div class=\"eyebrow\">" + Hl(Cl(t.type) ? "CONTENEDOR" : t.type === "actor" ? "ACTOR EXTERNO" : "COMPONENTE") + "</div><h2>" + Hl(t.name) + "</h2><div class=\"sub\">" + Hl(t.sub || "") + "</div><p>" + Hl(t.text || "") + "</p>" + Ul(t.url) + (Cl(t.type) ? "<button data-action=\"toggle-shell\">" + (this.open.has(t.id) ? "Cerrar bloque" : "Abrir bloque") + "</button>" : "") + (r.length ? "<h3>CONTIENE</h3><p>" + r.length + " pieza(s) interna(s).</p>" : "") + "<h3>RELACIONES</h3>" + (c || "<p>No hay relaciones directas.</p>"), this.panel.querySelectorAll("[data-action=\"overview\"]").forEach((e) => e.addEventListener("click", () => this.reset())), this.panel.querySelectorAll("[data-action=\"path\"]").forEach((e) => e.addEventListener("click", () => this.select(e.dataset.id))), this.panel.querySelectorAll("[data-action=\"relation\"]").forEach((e) => e.addEventListener("click", () => this.selectRelation(Number(e.dataset.relationIndex), { source: "panel" }))), this.panel.querySelector("[data-action=\"focus-selection\"]")?.addEventListener("click", () => this.focusSelection()), this.panel.querySelector("[data-action=\"toggle-shell\"]")?.addEventListener("click", () => {
|
|
13702
13744
|
this.toggleContainer(t.id, { source: "panel" });
|
|
13703
13745
|
}), this._applyTheme();
|
|
13704
13746
|
}
|
|
@@ -13707,10 +13749,10 @@ var cu = class extends HTMLElement {
|
|
|
13707
13749
|
if (!n) return this;
|
|
13708
13750
|
let r = new Set(this.open), i = n.parent ? this.nodes.get(n.parent) : null;
|
|
13709
13751
|
for (; i;) r.add(i.id), i = i.parent ? this.nodes.get(i.parent) : null;
|
|
13710
|
-
return this.selected = n, this.selectedRelationIndex = null,
|
|
13752
|
+
return this.selected = n, this.selectedRelationIndex = null, Cl(n.type) && r.add(n.id), this._replaceOpenContainers(r, {
|
|
13711
13753
|
refresh: !1,
|
|
13712
13754
|
source: t.source || "api"
|
|
13713
|
-
}), this._applySelectionNavigation(t.navigation), this._renderPanel(), this._rebuildRelations(), this._syncFocusToolbar(), this.invalidate(), t.focusEvent !== !1 && this._emitFocusChange(t.source || "api"), t.emit !== !1 && this._emit("lc-select", {
|
|
13755
|
+
}), this._applySelectionNavigation(t.navigation), this._renderPanel(), this._rebuildRelations(), this._syncRelationToolbar(), this._syncFocusToolbar(), this.invalidate(), t.focusEvent !== !1 && this._emitFocusChange(t.source || "api"), t.emit !== !1 && this._emit("lc-select", {
|
|
13714
13756
|
kind: "entity",
|
|
13715
13757
|
id: e,
|
|
13716
13758
|
index: null,
|
|
@@ -13731,7 +13773,7 @@ var cu = class extends HTMLElement {
|
|
|
13731
13773
|
return this._replaceOpenContainers(i, {
|
|
13732
13774
|
refresh: !1,
|
|
13733
13775
|
source: t.source || "api"
|
|
13734
|
-
}), this._applySelectionNavigation(t.navigation), this._renderPanel(), this._rebuildRelations(), this._syncFocusToolbar(), this.invalidate(), t.focusEvent !== !1 && this._emitFocusChange(t.source || "api"), t.emit !== !1 && this._emit("lc-select", {
|
|
13776
|
+
}), this._applySelectionNavigation(t.navigation), this._renderPanel(), this._rebuildRelations(), this._syncRelationToolbar(), this._syncFocusToolbar(), this.invalidate(), t.focusEvent !== !1 && this._emitFocusChange(t.source || "api"), t.emit !== !1 && this._emit("lc-select", {
|
|
13735
13777
|
kind: "relation",
|
|
13736
13778
|
id: r.id || null,
|
|
13737
13779
|
index: n,
|
|
@@ -13741,11 +13783,14 @@ var cu = class extends HTMLElement {
|
|
|
13741
13783
|
}), this;
|
|
13742
13784
|
}
|
|
13743
13785
|
setRelationMode(e) {
|
|
13744
|
-
this.relationMode =
|
|
13745
|
-
|
|
13746
|
-
|
|
13747
|
-
|
|
13748
|
-
|
|
13786
|
+
this.relationMode = Ol(e), this.setAttribute("relation-mode", this.relationMode), this._syncRelationToolbar(), this._syncFocusToolbar(), this._rebuildRelations(), this.invalidate(), this.dispatchEvent(new CustomEvent("lc-relation-mode", { detail: { mode: this.relationMode } }));
|
|
13787
|
+
}
|
|
13788
|
+
setRelationMarker(e, t = {}) {
|
|
13789
|
+
let n = Dl(e), r = n !== this.relationMarker;
|
|
13790
|
+
return this.relationMarker = n, this.getAttribute?.("relation-marker") !== n && this.setAttribute?.("relation-marker", n), r && this.ready && (this._rebuildRelations(), this.invalidate()), r && t.emit !== !1 && this._emit("lc-relation-marker-change", {
|
|
13791
|
+
marker: n,
|
|
13792
|
+
source: t.source || "api"
|
|
13793
|
+
}), this;
|
|
13749
13794
|
}
|
|
13750
13795
|
reset() {
|
|
13751
13796
|
this.selected = null, this.selectedRelationIndex = null, this.restoreInitialContainerState({
|
|
@@ -13771,20 +13816,20 @@ var cu = class extends HTMLElement {
|
|
|
13771
13816
|
for (let e of this.nodes.values()) {
|
|
13772
13817
|
let t = this._focusAlpha(e, i), n = this._isVisible(e) && t > 0;
|
|
13773
13818
|
e.group.visible = n;
|
|
13774
|
-
let r =
|
|
13775
|
-
if (e.mesh.renderOrder = r ? 10 - !!e.parent : 0, e.material)
|
|
13819
|
+
let r = Cl(e.type) && this.open.has(e.id), a = (r ? .12 : 1) * t;
|
|
13820
|
+
if (e.mesh.renderOrder = r ? 10 - !!e.parent : 0, e.material) kl(e.material, !0), e.material.opacity = a, e.material.depthWrite = !r, e.material.emissive?.set(e === this.selected ? e.material.color : 0), e.material.emissiveIntensity = e === this.selected ? .15 : 0;
|
|
13776
13821
|
else {
|
|
13777
|
-
for (let n of e.appearanceMaterials || []) Object.hasOwn(n.userData, "atlasBaseOpacity") || (n.userData.atlasBaseOpacity = n.opacity ?? 1), Object.hasOwn(n.userData, "atlasBaseTransparent") || (n.userData.atlasBaseTransparent = n.transparent), Object.hasOwn(n.userData, "atlasBaseDepthWrite") || (n.userData.atlasBaseDepthWrite = n.depthWrite),
|
|
13822
|
+
for (let n of e.appearanceMaterials || []) Object.hasOwn(n.userData, "atlasBaseOpacity") || (n.userData.atlasBaseOpacity = n.opacity ?? 1), Object.hasOwn(n.userData, "atlasBaseTransparent") || (n.userData.atlasBaseTransparent = n.transparent), Object.hasOwn(n.userData, "atlasBaseDepthWrite") || (n.userData.atlasBaseDepthWrite = n.depthWrite), kl(n, n.userData.atlasBaseTransparent || t < 1), n.depthWrite = n.userData.atlasBaseDepthWrite, n.opacity = n.userData.atlasBaseOpacity * t, n.emissive?.set(e === this.selected ? n.color : 0), n.emissiveIntensity = e === this.selected ? .15 : 0;
|
|
13778
13823
|
e._appearanceSelected = e === this.selected;
|
|
13779
13824
|
}
|
|
13780
13825
|
e.edge?.material && (e.edge.material.opacity = (e === this.selected ? 1 : .65) * t);
|
|
13781
|
-
let o =
|
|
13826
|
+
let o = Cl(e.type) && r, s = o, c = e.label.userData.front, l = e.label.userData.back, u = e.label.userData.top, d = e.label.userData.height, f = e.label.userData.width, p = e.label.userData.textOffsetX || 0;
|
|
13782
13827
|
e.label.userData.textOffsetY;
|
|
13783
|
-
let m = e.labelSize || new U().fromArray(e.s), h =
|
|
13828
|
+
let m = e.labelSize || new U().fromArray(e.s), h = uu(e.labelAnchor, m, f, d);
|
|
13784
13829
|
e.label.visible = n;
|
|
13785
|
-
let g = this._worldPosition(e), _ = this.itemFacing === "camera" && !
|
|
13830
|
+
let g = this._worldPosition(e), _ = this.itemFacing === "camera" && !Cl(e.type) || this.camera.position.z >= g.z, v = this.camera.position.y > g.y + .25;
|
|
13786
13831
|
if (h) c.visible = _, l.visible = !_, u.visible = !1, c.scale.setScalar(1), l.scale.setScalar(1), c.position.set(h.x, h.y, m.z / 2 + .025), l.position.set(h.x, h.y, -m.z / 2 - .025), c.rotation.z = h.frontRotation, l.rotation.z = h.backRotation, c.material.color.set(15923964), l.material.color.set(15923964), c.material.opacity = t, l.material.opacity = t;
|
|
13787
|
-
else if (
|
|
13832
|
+
else if (Cl(e.type)) {
|
|
13788
13833
|
c.rotation.z = 0, l.rotation.z = 0, c.visible = _ && (!o || s), l.visible = !_ && (!o || s), u.visible = s && v;
|
|
13789
13834
|
let e = s ? .52 : 1;
|
|
13790
13835
|
c.scale.setScalar(e), c.position.x = s ? -m.x / 2 + .18 + f * e / 2 - p * e : 0;
|
|
@@ -13803,7 +13848,7 @@ var cu = class extends HTMLElement {
|
|
|
13803
13848
|
let t = this.canvas.getBoundingClientRect();
|
|
13804
13849
|
this.pointer.set((e.clientX - t.left) / t.width * 2 - 1, -(e.clientY - t.top) / t.height * 2 + 1), this.raycaster.setFromCamera(this.pointer, this.camera);
|
|
13805
13850
|
let n = [];
|
|
13806
|
-
for (let e of this.nodes.values()) e.group.visible && (
|
|
13851
|
+
for (let e of this.nodes.values()) e.group.visible && (Cl(e.type) && this.open.has(e.id) || n.push(e.pickMesh || e.mesh), e.label?.visible && n.push(...e.label.children.filter((e) => e.visible)));
|
|
13807
13852
|
let r = this.raycaster.intersectObjects(n, !0)[0] || null, i = this.relationMode === "none" ? [] : this.relationGroup.children.filter((e) => e.userData?.relationPick), a = this.raycaster.intersectObjects(i, !1)[0] || null;
|
|
13808
13853
|
if (r && (!a || r.distance <= a.distance + .12)) {
|
|
13809
13854
|
let e = r.object;
|
|
@@ -13832,7 +13877,7 @@ var cu = class extends HTMLElement {
|
|
|
13832
13877
|
e.key === "Escape" && (this._closeToolbarMenus(), this.canvas.focus({ preventScroll: !0 }));
|
|
13833
13878
|
}), this.shadowRoot.addEventListener("click", (e) => {
|
|
13834
13879
|
let t = e.target.closest?.("[data-action]"), n = t?.dataset.action;
|
|
13835
|
-
e.target.closest?.(".toolbar-menu") || this._closeToolbarMenus(), n === "minus" && this.zoomOut(), n === "plus" && this.zoomIn(), n === "fit" && this.fit(), n === "front" && this.frontView(), n === "labels" && this.toggleShellLabels(), n === "panel" && this.setPanelVisible(!this.panelVisible), n === "item-facing" && this.toggleItemFacing({ source: "toolbar" }), n === "open-all" && this.openAllContainers({ source: "toolbar" }), n === "close-all" && this.closeAllContainers({ source: "toolbar" }), n === "relations-all" && this.setRelationMode("all"), n === "relations-selected" && this.setRelationMode("selected"), n === "relations-none" && this.setRelationMode("none"), n === "focus-all" && this.setFocusFilter({ mode: "all" }, { source: "toolbar" }), n === "focus-dim" && this.setFocusFilter({
|
|
13880
|
+
e.target.closest?.(".toolbar-menu") || this._closeToolbarMenus(), n === "minus" && this.zoomOut(), n === "plus" && this.zoomIn(), n === "fit" && this.fit(), n === "front" && this.frontView(), n === "labels" && this.toggleShellLabels(), n === "panel" && this.setPanelVisible(!this.panelVisible), n === "item-facing" && this.toggleItemFacing({ source: "toolbar" }), n === "open-all" && this.openAllContainers({ source: "toolbar" }), n === "close-all" && this.closeAllContainers({ source: "toolbar" }), n === "relations-all" && this.setRelationMode("all"), n === "relations-selected" && this.setRelationMode("selected"), n === "relations-callers" && this.setRelationMode("callers"), n === "relations-called" && this.setRelationMode("called"), n === "relations-none" && this.setRelationMode("none"), n === "focus-all" && this.setFocusFilter({ mode: "all" }, { source: "toolbar" }), n === "focus-dim" && this.setFocusFilter({
|
|
13836
13881
|
mode: "connected",
|
|
13837
13882
|
effect: "dim"
|
|
13838
13883
|
}, { source: "toolbar" }), n === "focus-hide" && this.setFocusFilter({
|
|
@@ -13876,7 +13921,7 @@ var cu = class extends HTMLElement {
|
|
|
13876
13921
|
y: e.clientY
|
|
13877
13922
|
}), e.pointerType === "touch" && this.pointers.size >= 2) {
|
|
13878
13923
|
let [e, t] = [...this.pointers.values()], n = (e.x + t.x) / 2, r = (e.y + t.y) / 2, i = Math.max(1, Math.hypot(e.x - t.x, e.y - t.y));
|
|
13879
|
-
this.drag.mode === "touch-pan" ? (this._panByPixels(n - this.drag.x, r - this.drag.y), this.targetZoom = Math.min(2.8, Math.max(
|
|
13924
|
+
this.drag.mode === "touch-pan" ? (this._panByPixels(n - this.drag.x, r - this.drag.y), this.targetZoom = Math.min(2.8, Math.max(rl, this.targetZoom * i / Math.max(1, this.drag.distance))), Object.assign(this.drag, {
|
|
13880
13925
|
x: n,
|
|
13881
13926
|
y: r,
|
|
13882
13927
|
distance: i,
|
|
@@ -13947,16 +13992,16 @@ var cu = class extends HTMLElement {
|
|
|
13947
13992
|
navigation: "fit"
|
|
13948
13993
|
});
|
|
13949
13994
|
}), this.canvas.addEventListener("wheel", (e) => {
|
|
13950
|
-
e.preventDefault(), this.targetZoom = Math.min(2.8, Math.max(
|
|
13995
|
+
e.preventDefault(), this.targetZoom = Math.min(2.8, Math.max(rl, this.targetZoom * Math.exp(-e.deltaY * .001))), this.invalidate();
|
|
13951
13996
|
}, { passive: !1 });
|
|
13952
13997
|
}
|
|
13953
13998
|
_showError(e) {
|
|
13954
13999
|
let t = this.shadowRoot.querySelector(".viewport"), n = t.querySelector(".error");
|
|
13955
|
-
n ? n.textContent = e : t.insertAdjacentHTML("beforeend", "<div class=\"error\" role=\"alert\">" +
|
|
14000
|
+
n ? n.textContent = e : t.insertAdjacentHTML("beforeend", "<div class=\"error\" role=\"alert\">" + Hl(e) + "</div>");
|
|
13956
14001
|
}
|
|
13957
14002
|
};
|
|
13958
|
-
customElements.get("liquidcars-atlas") || customElements.define("liquidcars-atlas",
|
|
14003
|
+
customElements.get("liquidcars-atlas") || customElements.define("liquidcars-atlas", pu);
|
|
13959
14004
|
//#endregion
|
|
13960
|
-
export { $c as ATLAS_VERSION,
|
|
14005
|
+
export { $c as ATLAS_VERSION, tl as DEFAULT_RELATION_MARKER, pu as LiquidCarsAtlas, nl as RELATION_DISPLAY_MODES, fu as captureRendererFrame, iu as createSvgExtrudeGeometry, bl as getGeometryCatalog, xl as getGeometryPackCatalog, uu as labelPlacementForAnchor, cu as normalizeLabelAnchor, Wl as normalizeModel, vl as registerGeometryPack, lu as resolveEntityLabelAnchor, yl as unregisterGeometryPack };
|
|
13961
14006
|
|
|
13962
14007
|
//# sourceMappingURL=liquidcars-atlas.js.map
|