@ifc-lite/viewer 1.19.0 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +59 -43
- package/.turbo/turbo-typecheck.log +1 -1
- package/CHANGELOG.md +496 -0
- package/dist/assets/basketViewActivator-Bzw51jhm.js +71 -0
- package/dist/assets/{bcf-DOG9_WPX.js → bcf-4K724hw0.js} +18 -18
- package/dist/assets/decode-worker-t2EGKAxO.js +1708 -0
- package/dist/assets/drawing-2d-Bjy8YPrg.js +257 -0
- package/dist/assets/exporters-u0sz2Upj.js +259119 -0
- package/dist/assets/geometry-controller.worker-NH8pZmrU.js +7 -0
- package/dist/assets/geometry.worker-Bp4rW_R1.js +1 -0
- package/dist/assets/ids-B7AXEv7h.js +4067 -0
- package/dist/assets/ifc-lite-DfZHk36-.js +7 -0
- package/dist/assets/ifc-lite_bg-DlKs5-yM.wasm +0 -0
- package/dist/assets/ifc-lite_bg-PqmRe3Ph.wasm +0 -0
- package/dist/assets/index-CSWgTe1s.css +1 -0
- package/dist/assets/{index-BOi3BuUI.js → index-DVNSvEMh.js} +49877 -28410
- package/dist/assets/laz-perf-Cvr_Lepg.js +1 -0
- package/dist/assets/laz-perf-DnSyzVYH.wasm +0 -0
- package/dist/assets/{native-bridge-CpBeOPQa.js → native-bridge-BiD01jI9.js} +2 -2
- package/dist/assets/parser.worker-Bnbrl6gy.js +182 -0
- package/dist/assets/{sandbox-Baez7n-t.js → sandbox-DPD1ROr0.js} +548 -530
- package/dist/assets/{server-client-BB6cMAXE.js → server-client-DP8fMPY9.js} +1 -1
- package/dist/assets/three-CDRZThFA.js +4057 -0
- package/dist/assets/{wasm-bridge-CAYCUHbE.js → wasm-bridge-CErti6zX.js} +1 -1
- package/dist/assets/workerHelpers-CBbWSJmd.js +36 -0
- package/dist/index.html +10 -9
- package/dist/samples/building-architecture.ifc +453 -0
- package/dist/samples/hello-wall.ifc +1054 -0
- package/dist/samples/infra-bridge.ifc +962 -0
- package/index.html +1 -1
- package/package.json +15 -10
- package/public/samples/building-architecture.ifc +453 -0
- package/public/samples/hello-wall.ifc +1054 -0
- package/public/samples/infra-bridge.ifc +962 -0
- package/src/App.tsx +37 -3
- package/src/components/mcp/HeroScene.tsx +876 -0
- package/src/components/mcp/McpLanding.tsx +1318 -0
- package/src/components/mcp/McpPlayground.tsx +524 -0
- package/src/components/mcp/PlaygroundChat.tsx +1097 -0
- package/src/components/mcp/PlaygroundViewer.tsx +815 -0
- package/src/components/mcp/README.md +171 -0
- package/src/components/mcp/data.ts +659 -0
- package/src/components/mcp/playground-dispatcher.ts +1649 -0
- package/src/components/mcp/playground-files.ts +107 -0
- package/src/components/mcp/playground-uploads.ts +122 -0
- package/src/components/mcp/types.ts +65 -0
- package/src/components/mcp/use-mcp-page.ts +109 -0
- package/src/components/viewer/BasketPresentationDock.tsx +3 -0
- package/src/components/viewer/CesiumOverlay.tsx +165 -120
- package/src/components/viewer/DeviationPanel.tsx +172 -0
- package/src/components/viewer/HierarchyPanel.tsx +29 -3
- package/src/components/viewer/HoverTooltip.tsx +5 -0
- package/src/components/viewer/IDSAuditSummary.tsx +389 -0
- package/src/components/viewer/IDSPanel.tsx +80 -26
- package/src/components/viewer/MainToolbar.tsx +79 -7
- package/src/components/viewer/MergeLayersBanner.tsx +108 -0
- package/src/components/viewer/MobileToolbar.tsx +326 -0
- package/src/components/viewer/PointCloudClasses.tsx +111 -0
- package/src/components/viewer/PointCloudLegend.tsx +119 -0
- package/src/components/viewer/PointCloudPanel.tsx +52 -1
- package/src/components/viewer/PropertiesPanel.tsx +37 -6
- package/src/components/viewer/RectSelectionOverlay.tsx +48 -0
- package/src/components/viewer/StatusBar.tsx +14 -0
- package/src/components/viewer/ViewerLayout.tsx +288 -95
- package/src/components/viewer/Viewport.tsx +86 -18
- package/src/components/viewer/ViewportContainer.tsx +60 -15
- package/src/components/viewer/ViewportOverlays.tsx +41 -26
- package/src/components/viewer/mouseHandlerTypes.ts +22 -0
- package/src/components/viewer/properties/GeoreferencingPanel.tsx +77 -8
- package/src/components/viewer/properties/MaterialCard.tsx +2 -2
- package/src/components/viewer/selectionHandlers.ts +41 -0
- package/src/components/viewer/tools/SectionPanel.tsx +181 -24
- package/src/components/viewer/tools/SectionVisualization.tsx +384 -3
- package/src/components/viewer/useAnimationLoop.ts +22 -0
- package/src/components/viewer/useMouseControls.ts +296 -3
- package/src/components/viewer/usePointCloudSync.ts +8 -1
- package/src/components/viewer/useRenderUpdates.ts +21 -1
- package/src/components/viewer/useTouchControls.ts +100 -41
- package/src/generated/mcp-catalog.json +82 -0
- package/src/hooks/federationLoadGate.test.ts +90 -0
- package/src/hooks/federationLoadGate.ts +127 -0
- package/src/hooks/ids/idsDataAccessor.ts +11 -259
- package/src/hooks/ingest/pointCloudIngest.ts +127 -16
- package/src/hooks/useDrawingGeneration.ts +81 -8
- package/src/hooks/useIDS.ts +90 -10
- package/src/hooks/useIfcFederation.ts +94 -16
- package/src/hooks/useIfcLoader.ts +289 -64
- package/src/hooks/useViewerSelectors.ts +10 -0
- package/src/lib/geo/cesium-bridge.ts +84 -67
- package/src/lib/geo/clamp-anchor.test.ts +80 -0
- package/src/lib/geo/clamp-anchor.ts +57 -0
- package/src/lib/geo/effective-georef.test.ts +79 -1
- package/src/lib/geo/effective-georef.ts +83 -0
- package/src/lib/geo/reproject.ts +26 -13
- package/src/lib/geo/terrain-elevation.ts +166 -0
- package/src/lib/lens/adapter.ts +1 -1
- package/src/lib/llm/context-builder.ts +1 -1
- package/src/lib/perf/memoryAccounting.test.ts +92 -0
- package/src/lib/perf/memoryAccounting.ts +235 -0
- package/src/sdk/adapters/mutation-view.ts +1 -1
- package/src/store/constants.ts +39 -2
- package/src/store/index.ts +6 -1
- package/src/store/slices/cesiumSlice.ts +1 -1
- package/src/store/slices/idsSlice.ts +24 -0
- package/src/store/slices/loadingSlice.ts +12 -0
- package/src/store/slices/pointCloudSlice.ts +72 -1
- package/src/store/slices/sectionSlice.test.ts +590 -1
- package/src/store/slices/sectionSlice.ts +344 -17
- package/src/store/slices/uiSlice.merge-layers.test.ts +217 -0
- package/src/store/slices/uiSlice.ts +60 -2
- package/src/store/types.ts +42 -0
- package/src/store.ts +13 -0
- package/src/utils/acquireFileBuffer.test.ts +231 -0
- package/src/utils/acquireFileBuffer.ts +128 -0
- package/src/utils/ifcConfig.ts +24 -0
- package/src/utils/nativeSpatialDataStore.ts +20 -2
- package/src/utils/spatialHierarchy.test.ts +116 -0
- package/src/utils/spatialHierarchy.ts +23 -0
- package/tailwind.config.js +5 -0
- package/tsconfig.json +1 -0
- package/vite.config.ts +12 -0
- package/dist/assets/basketViewActivator-RZy5c3Td.js +0 -1
- package/dist/assets/decode-worker-Collf_X_.js +0 -1320
- package/dist/assets/drawing-2d-DoxKMqbO.js +0 -257
- package/dist/assets/exporters-BraHBeoi.js +0 -81583
- package/dist/assets/geometry.worker-DQEZB2rB.js +0 -1
- package/dist/assets/ids-DQ5jY0E8.js +0 -1
- package/dist/assets/ifc-lite_bg-4yUkDRD8.wasm +0 -0
- package/dist/assets/index-0XpVr_S5.css +0 -1
|
@@ -0,0 +1,4067 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/exporters-u0sz2Upj.js","assets/bcf-4K724hw0.js","assets/zip-DBEtpeu6.js","assets/cesium-DUOzBlqv.js","assets/arrow-CZ5kQ26f.js","assets/cesium-ADbP7waU.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import { i as $, g as fe, f as J, a as ye, b as he, c as ve, d as Ee, R as Te, _ as Ie, e as be, E as ge, h as Se, j as Ae, k as A, l as N, m as xe, n as Ce, o as Re, p as Me, __tla as __tla_0 } from "./exporters-u0sz2Upj.js";
|
|
3
|
+
let g, ua, oa, ca, Ne, la;
|
|
4
|
+
let __tla = Promise.all([
|
|
5
|
+
(()=>{
|
|
6
|
+
try {
|
|
7
|
+
return __tla_0;
|
|
8
|
+
} catch {}
|
|
9
|
+
})()
|
|
10
|
+
]).then(async ()=>{
|
|
11
|
+
const O = "http://www.w3.org/2001/XMLSchema";
|
|
12
|
+
g = class extends Error {
|
|
13
|
+
constructor(t, a){
|
|
14
|
+
super(t), this.details = a, this.name = "IDSParseError";
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
let V = typeof globalThis < "u" && typeof globalThis.DOMParser == "function" ? globalThis.DOMParser : null;
|
|
18
|
+
V || (V = (await import("@xmldom/xmldom").then(async (m)=>{
|
|
19
|
+
await m.__tla;
|
|
20
|
+
return m;
|
|
21
|
+
})).DOMParser);
|
|
22
|
+
Ne = function(e) {
|
|
23
|
+
let t = typeof e == "string" ? e : new TextDecoder().decode(e);
|
|
24
|
+
if (t.charCodeAt(0) === 65279 && (t = t.slice(1)), !V) throw new g("No DOMParser implementation available", "Neither globalThis.DOMParser nor @xmldom/xmldom could be loaded.");
|
|
25
|
+
const a = new V;
|
|
26
|
+
let i;
|
|
27
|
+
try {
|
|
28
|
+
i = a.parseFromString(t, "text/xml");
|
|
29
|
+
} catch (s) {
|
|
30
|
+
throw new g("Failed to parse IDS XML", s instanceof Error ? s.message : String(s));
|
|
31
|
+
}
|
|
32
|
+
const n = typeof i.querySelector == "function" ? i.querySelector("parsererror") : null;
|
|
33
|
+
if (n) throw new g("Invalid XML format", n.textContent || void 0);
|
|
34
|
+
const r = i.documentElement;
|
|
35
|
+
if (!r) throw new g("Failed to parse IDS XML", "Parser returned a document with no root element.");
|
|
36
|
+
if (r.localName !== "ids") throw new g(`Invalid root element: expected "ids", got "${r.localName}"`);
|
|
37
|
+
return {
|
|
38
|
+
info: _e(r),
|
|
39
|
+
specifications: Pe(r),
|
|
40
|
+
schemaLocation: r.getAttribute("xsi:schemaLocation") || r.getAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "schemaLocation") || void 0
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
function _e(e) {
|
|
44
|
+
const t = h(e, "info");
|
|
45
|
+
return t ? {
|
|
46
|
+
title: C(t, "title") || "Untitled IDS",
|
|
47
|
+
copyright: C(t, "copyright"),
|
|
48
|
+
version: C(t, "version"),
|
|
49
|
+
author: C(t, "author"),
|
|
50
|
+
date: C(t, "date"),
|
|
51
|
+
purpose: C(t, "purpose"),
|
|
52
|
+
milestone: C(t, "milestone"),
|
|
53
|
+
description: C(t, "description")
|
|
54
|
+
} : {
|
|
55
|
+
title: "Untitled IDS"
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function Pe(e) {
|
|
59
|
+
const t = h(e, "specifications");
|
|
60
|
+
return t ? U(t, "specification").map((i, n)=>$e(i, n)) : [];
|
|
61
|
+
}
|
|
62
|
+
function $e(e, t) {
|
|
63
|
+
const a = e.getAttribute("name") || `Specification ${t + 1}`, n = (e.getAttribute("ifcVersion") || "IFC4").split(/\s+/).map((m)=>we(m)).filter((m)=>m !== null), r = h(e, "applicability"), s = {
|
|
64
|
+
facets: r ? Fe(r) : [],
|
|
65
|
+
cardinality: r?.getAttribute("cardinality") ?? void 0
|
|
66
|
+
}, l = (r ? r.getAttribute("minOccurs") : null) ?? e.getAttribute("minOccurs"), o = (r ? r.getAttribute("maxOccurs") : null) ?? e.getAttribute("maxOccurs");
|
|
67
|
+
let u;
|
|
68
|
+
if (l !== null) {
|
|
69
|
+
const m = parseInt(l, 10);
|
|
70
|
+
Number.isFinite(m) && (u = m);
|
|
71
|
+
}
|
|
72
|
+
let c;
|
|
73
|
+
if (o !== null) {
|
|
74
|
+
const m = parseInt(o, 10);
|
|
75
|
+
o === "unbounded" ? c = "unbounded" : Number.isFinite(m) && (c = m);
|
|
76
|
+
}
|
|
77
|
+
u === void 0 && (r || c !== void 0) && (u = 1);
|
|
78
|
+
const f = h(e, "requirements"), d = f ? qe(f) : [];
|
|
79
|
+
return {
|
|
80
|
+
id: e.getAttribute("identifier") || `spec-${t}`,
|
|
81
|
+
name: a,
|
|
82
|
+
description: e.getAttribute("description") || void 0,
|
|
83
|
+
instructions: e.getAttribute("instructions") || void 0,
|
|
84
|
+
identifier: e.getAttribute("identifier") || void 0,
|
|
85
|
+
ifcVersions: n.length > 0 ? n : [
|
|
86
|
+
"IFC4"
|
|
87
|
+
],
|
|
88
|
+
ifcVersionRaw: e.getAttribute("ifcVersion") || void 0,
|
|
89
|
+
applicability: s,
|
|
90
|
+
requirements: d,
|
|
91
|
+
minOccurs: u,
|
|
92
|
+
maxOccurs: c
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
function we(e) {
|
|
96
|
+
const t = e.toUpperCase().replace(/[^A-Z0-9]/g, "");
|
|
97
|
+
switch(t){
|
|
98
|
+
case "IFC2X3":
|
|
99
|
+
return "IFC2X3";
|
|
100
|
+
case "IFC4":
|
|
101
|
+
return "IFC4";
|
|
102
|
+
case "IFC4X3":
|
|
103
|
+
case "IFC4X3ADD2":
|
|
104
|
+
return "IFC4X3";
|
|
105
|
+
default:
|
|
106
|
+
return t.startsWith("IFC4X3") ? "IFC4X3" : t.startsWith("IFC4") ? "IFC4" : t.startsWith("IFC2X3") ? "IFC2X3" : null;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function Fe(e) {
|
|
110
|
+
const t = [];
|
|
111
|
+
for (const a of Array.from(e.children)){
|
|
112
|
+
const i = Z(a);
|
|
113
|
+
i && t.push(i);
|
|
114
|
+
}
|
|
115
|
+
return t;
|
|
116
|
+
}
|
|
117
|
+
function Z(e) {
|
|
118
|
+
switch(e.localName.toLowerCase()){
|
|
119
|
+
case "entity":
|
|
120
|
+
return ee(e);
|
|
121
|
+
case "attribute":
|
|
122
|
+
return Oe(e);
|
|
123
|
+
case "property":
|
|
124
|
+
return Le(e);
|
|
125
|
+
case "classification":
|
|
126
|
+
return Ve(e);
|
|
127
|
+
case "material":
|
|
128
|
+
return De(e);
|
|
129
|
+
case "partof":
|
|
130
|
+
return Ue(e);
|
|
131
|
+
default:
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
function ee(e) {
|
|
136
|
+
const t = h(e, "name"), a = h(e, "predefinedType");
|
|
137
|
+
if (!t) throw new g("Entity facet must have a name element");
|
|
138
|
+
return {
|
|
139
|
+
type: "entity",
|
|
140
|
+
name: T(t),
|
|
141
|
+
predefinedType: a ? T(a) : void 0
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
function Oe(e) {
|
|
145
|
+
const t = h(e, "name"), a = h(e, "value");
|
|
146
|
+
if (!t) throw new g("Attribute facet must have a name element");
|
|
147
|
+
return {
|
|
148
|
+
type: "attribute",
|
|
149
|
+
name: T(t),
|
|
150
|
+
value: a ? T(a) : void 0
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
function Le(e) {
|
|
154
|
+
const t = h(e, "propertySet"), a = h(e, "baseName"), i = e.getAttribute("dataType"), n = h(e, "dataType"), r = h(e, "value");
|
|
155
|
+
if (!t) throw new g("Property facet must have a propertySet element");
|
|
156
|
+
if (!a) throw new g("Property facet must have a baseName element");
|
|
157
|
+
let s;
|
|
158
|
+
return i ? s = {
|
|
159
|
+
type: "simpleValue",
|
|
160
|
+
value: i
|
|
161
|
+
} : n && (s = T(n)), {
|
|
162
|
+
type: "property",
|
|
163
|
+
propertySet: T(t),
|
|
164
|
+
baseName: T(a),
|
|
165
|
+
dataType: s,
|
|
166
|
+
value: r ? T(r) : void 0
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
function Ve(e) {
|
|
170
|
+
const t = h(e, "system"), a = h(e, "value");
|
|
171
|
+
return {
|
|
172
|
+
type: "classification",
|
|
173
|
+
system: t ? T(t) : void 0,
|
|
174
|
+
value: a ? T(a) : void 0
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
function De(e) {
|
|
178
|
+
const t = h(e, "value");
|
|
179
|
+
return {
|
|
180
|
+
type: "material",
|
|
181
|
+
value: t ? T(t) : void 0
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
function Ue(e) {
|
|
185
|
+
const t = e.getAttribute("relation"), a = t || "IfcRelContainedInSpatialStructure", i = h(e, "entity"), n = Be(a), r = ke(a), s = {
|
|
186
|
+
type: "partOf",
|
|
187
|
+
relation: n,
|
|
188
|
+
entity: i ? ee(i) : void 0
|
|
189
|
+
};
|
|
190
|
+
return !r && t && (s.rawRelation = t), s;
|
|
191
|
+
}
|
|
192
|
+
function ke(e) {
|
|
193
|
+
switch(e){
|
|
194
|
+
case "IfcRelAggregates":
|
|
195
|
+
case "IfcRelContainedInSpatialStructure":
|
|
196
|
+
case "IfcRelNests":
|
|
197
|
+
case "IfcRelVoidsElement":
|
|
198
|
+
case "IfcRelFillsElement":
|
|
199
|
+
case "IfcRelAssignsToGroup":
|
|
200
|
+
return !0;
|
|
201
|
+
default:
|
|
202
|
+
return !1;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
function Be(e) {
|
|
206
|
+
const t = e.toUpperCase();
|
|
207
|
+
return t.includes("ASSIGNSTOGROUP") || t.includes("GROUP") ? "IfcRelAssignsToGroup" : t.includes("AGGREGATE") ? "IfcRelAggregates" : t.includes("CONTAINED") || t.includes("SPATIAL") ? "IfcRelContainedInSpatialStructure" : t.includes("NEST") ? "IfcRelNests" : t.includes("VOID") ? "IfcRelVoidsElement" : t.includes("FILL") ? "IfcRelFillsElement" : "IfcRelContainedInSpatialStructure";
|
|
208
|
+
}
|
|
209
|
+
function qe(e) {
|
|
210
|
+
const t = [];
|
|
211
|
+
let a = 0;
|
|
212
|
+
for (const i of Array.from(e.children)){
|
|
213
|
+
const n = Z(i);
|
|
214
|
+
if (n) {
|
|
215
|
+
const r = i.getAttribute("cardinality"), s = i.getAttribute("minOccurs"), l = i.getAttribute("maxOccurs");
|
|
216
|
+
let o = "required", u;
|
|
217
|
+
if (r !== null) if (r === "required" || r === "optional" || r === "prohibited") o = r;
|
|
218
|
+
else {
|
|
219
|
+
const c = r.toLowerCase();
|
|
220
|
+
(c === "required" || c === "optional" || c === "prohibited") && (o = c), u = r;
|
|
221
|
+
}
|
|
222
|
+
else s === "0" && l === "0" ? o = "prohibited" : s === "0" && (o = "optional");
|
|
223
|
+
t.push({
|
|
224
|
+
id: `req-${a++}`,
|
|
225
|
+
facet: n,
|
|
226
|
+
optionality: o,
|
|
227
|
+
cardinalityRaw: u,
|
|
228
|
+
description: i.getAttribute("description") || void 0,
|
|
229
|
+
instructions: i.getAttribute("instructions") || void 0
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
return t;
|
|
234
|
+
}
|
|
235
|
+
function T(e) {
|
|
236
|
+
const t = h(e, "simpleValue");
|
|
237
|
+
if (t) return {
|
|
238
|
+
type: "simpleValue",
|
|
239
|
+
value: t.textContent?.trim() || ""
|
|
240
|
+
};
|
|
241
|
+
const a = te(e, "restriction", O) || h(e, "restriction");
|
|
242
|
+
if (a) return Ye(a);
|
|
243
|
+
const i = e.textContent?.trim();
|
|
244
|
+
return i ? {
|
|
245
|
+
type: "simpleValue",
|
|
246
|
+
value: i
|
|
247
|
+
} : {
|
|
248
|
+
type: "simpleValue",
|
|
249
|
+
value: ""
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
function Ye(e) {
|
|
253
|
+
const t = e.getAttribute("base") || void 0, a = (()=>{
|
|
254
|
+
const s = q(e, "pattern", O);
|
|
255
|
+
return s.length > 0 ? s : U(e, "pattern");
|
|
256
|
+
})();
|
|
257
|
+
if (a.length > 0) {
|
|
258
|
+
const s = a.map((o)=>o.getAttribute("value") || o.textContent || "").filter((o)=>o.length > 0);
|
|
259
|
+
return {
|
|
260
|
+
type: "pattern",
|
|
261
|
+
pattern: s.length === 1 ? s[0] : s.map((o)=>`(?:${o})`).join("|"),
|
|
262
|
+
base: t
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
const i = q(e, "enumeration", O);
|
|
266
|
+
if (i.length === 0) {
|
|
267
|
+
const s = U(e, "enumeration");
|
|
268
|
+
if (s.length > 0) return {
|
|
269
|
+
type: "enumeration",
|
|
270
|
+
values: s.map((l)=>l.getAttribute("value") || l.textContent || ""),
|
|
271
|
+
base: t
|
|
272
|
+
};
|
|
273
|
+
} else return {
|
|
274
|
+
type: "enumeration",
|
|
275
|
+
values: i.map((s)=>s.getAttribute("value") || s.textContent || ""),
|
|
276
|
+
base: t
|
|
277
|
+
};
|
|
278
|
+
const n = {};
|
|
279
|
+
for (const s of [
|
|
280
|
+
"minInclusive",
|
|
281
|
+
"maxInclusive",
|
|
282
|
+
"minExclusive",
|
|
283
|
+
"maxExclusive",
|
|
284
|
+
"length",
|
|
285
|
+
"minLength",
|
|
286
|
+
"maxLength"
|
|
287
|
+
])n[s] = te(e, s, O) || h(e, s);
|
|
288
|
+
if (Object.values(n).some((s)=>s !== null)) {
|
|
289
|
+
const s = {
|
|
290
|
+
type: "bounds",
|
|
291
|
+
base: t
|
|
292
|
+
}, l = (u)=>{
|
|
293
|
+
if (!u) return;
|
|
294
|
+
const c = parseFloat(u.getAttribute("value") || u.textContent || "");
|
|
295
|
+
return Number.isFinite(c) ? c : void 0;
|
|
296
|
+
}, o = (u)=>{
|
|
297
|
+
if (!u) return;
|
|
298
|
+
const c = parseInt(u.getAttribute("value") || u.textContent || "", 10);
|
|
299
|
+
return Number.isFinite(c) && c >= 0 ? c : void 0;
|
|
300
|
+
};
|
|
301
|
+
return s.minInclusive = l(n.minInclusive), s.maxInclusive = l(n.maxInclusive), s.minExclusive = l(n.minExclusive), s.maxExclusive = l(n.maxExclusive), s.length = o(n.length), s.minLength = o(n.minLength), s.maxLength = o(n.maxLength), s;
|
|
302
|
+
}
|
|
303
|
+
const r = e.textContent?.trim() || "";
|
|
304
|
+
return t && r === "" ? {
|
|
305
|
+
type: "enumeration",
|
|
306
|
+
values: [],
|
|
307
|
+
base: t
|
|
308
|
+
} : r ? {
|
|
309
|
+
type: "simpleValue",
|
|
310
|
+
value: r
|
|
311
|
+
} : {
|
|
312
|
+
type: "enumeration",
|
|
313
|
+
values: [],
|
|
314
|
+
base: t
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
function h(e, t) {
|
|
318
|
+
for (const a of Array.from(e.children))if (a.localName.toLowerCase() === t.toLowerCase()) return a;
|
|
319
|
+
return null;
|
|
320
|
+
}
|
|
321
|
+
function U(e, t) {
|
|
322
|
+
const a = [];
|
|
323
|
+
for (const i of Array.from(e.children))i.localName.toLowerCase() === t.toLowerCase() && a.push(i);
|
|
324
|
+
return a;
|
|
325
|
+
}
|
|
326
|
+
function te(e, t, a) {
|
|
327
|
+
for (const i of Array.from(e.children))if (i.localName.toLowerCase() === t.toLowerCase() && i.namespaceURI === a) return i;
|
|
328
|
+
return null;
|
|
329
|
+
}
|
|
330
|
+
function q(e, t, a) {
|
|
331
|
+
const i = [];
|
|
332
|
+
for (const n of Array.from(e.children))n.localName.toLowerCase() === t.toLowerCase() && n.namespaceURI === a && i.push(n);
|
|
333
|
+
return i;
|
|
334
|
+
}
|
|
335
|
+
function C(e, t) {
|
|
336
|
+
return h(e, t)?.textContent?.trim() || void 0;
|
|
337
|
+
}
|
|
338
|
+
const Y = /^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/, He = 1e-6;
|
|
339
|
+
function Xe(e, t) {
|
|
340
|
+
const a = He * (1 + Math.abs(e)), i = 16 * Number.EPSILON * Math.max(Math.abs(e), typeof t == "number" ? Math.abs(t) : 0);
|
|
341
|
+
return a + i;
|
|
342
|
+
}
|
|
343
|
+
function ie(e, t) {
|
|
344
|
+
const a = String(t), i = Y.test(e), n = typeof t == "number" || Y.test(a);
|
|
345
|
+
if (!i || !n) return;
|
|
346
|
+
const r = parseFloat(e), s = typeof t == "number" ? t : parseFloat(a);
|
|
347
|
+
if (!(Number.isNaN(r) || Number.isNaN(s))) return Math.abs(r - s) <= Xe(r, s);
|
|
348
|
+
}
|
|
349
|
+
function ae(e, t) {
|
|
350
|
+
if (!(e !== "true" && e !== "false")) return typeof t == "boolean" ? e === "true" ? t === !0 : t === !1 : t === "true" || t === "false" ? t === e : !1;
|
|
351
|
+
}
|
|
352
|
+
function ne(e, t, a) {
|
|
353
|
+
const i = String(t);
|
|
354
|
+
if (i === e || a && i.toUpperCase() === e.toUpperCase()) return !0;
|
|
355
|
+
}
|
|
356
|
+
function v(e, t, a) {
|
|
357
|
+
if (t == null) return !1;
|
|
358
|
+
const i = a?.caseInsensitive ?? !1;
|
|
359
|
+
switch(e.type){
|
|
360
|
+
case "simpleValue":
|
|
361
|
+
return Ge(e, t, i);
|
|
362
|
+
case "pattern":
|
|
363
|
+
return je(e, t, i);
|
|
364
|
+
case "enumeration":
|
|
365
|
+
return ze(e, t, i);
|
|
366
|
+
case "bounds":
|
|
367
|
+
return Ke(e, t);
|
|
368
|
+
default:
|
|
369
|
+
return !1;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
function Ge(e, t, a) {
|
|
373
|
+
const i = e.value, n = ne(i, t, a);
|
|
374
|
+
if (n !== void 0) return n;
|
|
375
|
+
const r = ie(i, t);
|
|
376
|
+
if (r !== void 0) return r;
|
|
377
|
+
const s = ae(i, t);
|
|
378
|
+
return s !== void 0 ? s : !1;
|
|
379
|
+
}
|
|
380
|
+
function je(e, t, a = !1) {
|
|
381
|
+
if (typeof t == "number" || typeof t == "boolean") return !1;
|
|
382
|
+
const i = String(t);
|
|
383
|
+
try {
|
|
384
|
+
const n = We(e.pattern), r = a ? "i" : "";
|
|
385
|
+
return new RegExp(`^${n}$`, r).test(i);
|
|
386
|
+
} catch {
|
|
387
|
+
return !1;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
function We(e) {
|
|
391
|
+
return e.replace(/\\i/g, "[A-Za-z_:]").replace(/\\c/g, "[A-Za-z0-9._:-]").replace(/\\p\{[^}]+\}/g, ".").replace(/\[([^\]]+)-\[[^\]]+\]\]/g, "[$1]");
|
|
392
|
+
}
|
|
393
|
+
function ze(e, t, a) {
|
|
394
|
+
return e.values.some((i)=>{
|
|
395
|
+
const n = ne(i, t, a);
|
|
396
|
+
if (n !== void 0) return n;
|
|
397
|
+
const r = ie(i, t);
|
|
398
|
+
if (r !== void 0) return r;
|
|
399
|
+
const s = ae(i, t);
|
|
400
|
+
return s !== void 0 ? s : !1;
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
function Ke(e, t) {
|
|
404
|
+
if (e.length !== void 0 || e.minLength !== void 0 || e.maxLength !== void 0) {
|
|
405
|
+
const i = String(t);
|
|
406
|
+
if (e.length !== void 0 && i.length !== e.length || e.minLength !== void 0 && i.length < e.minLength || e.maxLength !== void 0 && i.length > e.maxLength) return !1;
|
|
407
|
+
if (e.minInclusive === void 0 && e.maxInclusive === void 0 && e.minExclusive === void 0 && e.maxExclusive === void 0) return !0;
|
|
408
|
+
}
|
|
409
|
+
const a = typeof t == "number" ? t : parseFloat(String(t));
|
|
410
|
+
return !(isNaN(a) || e.minInclusive !== void 0 && a < e.minInclusive || e.maxInclusive !== void 0 && a > e.maxInclusive || e.minExclusive !== void 0 && a <= e.minExclusive || e.maxExclusive !== void 0 && a >= e.maxExclusive);
|
|
411
|
+
}
|
|
412
|
+
function p(e) {
|
|
413
|
+
switch(e.type){
|
|
414
|
+
case "simpleValue":
|
|
415
|
+
return `"${e.value}"`;
|
|
416
|
+
case "pattern":
|
|
417
|
+
return `pattern "${e.pattern}"`;
|
|
418
|
+
case "enumeration":
|
|
419
|
+
return e.values.length === 1 ? `"${e.values[0]}"` : `one of [${e.values.map((t)=>`"${t}"`).join(", ")}]`;
|
|
420
|
+
case "bounds":
|
|
421
|
+
return Qe(e);
|
|
422
|
+
default:
|
|
423
|
+
return "unknown";
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
function Qe(e) {
|
|
427
|
+
const t = [];
|
|
428
|
+
return e.minInclusive !== void 0 && e.maxInclusive !== void 0 ? `between ${e.minInclusive} and ${e.maxInclusive}` : (e.minInclusive !== void 0 && t.push(`>= ${e.minInclusive}`), e.maxInclusive !== void 0 && t.push(`<= ${e.maxInclusive}`), e.minExclusive !== void 0 && t.push(`> ${e.minExclusive}`), e.maxExclusive !== void 0 && t.push(`< ${e.maxExclusive}`), t.join(" and ") || "any value");
|
|
429
|
+
}
|
|
430
|
+
const Je = {
|
|
431
|
+
caseInsensitive: !0
|
|
432
|
+
};
|
|
433
|
+
function Ze(e, t, a) {
|
|
434
|
+
const i = a.getEntityType(t);
|
|
435
|
+
if (!i) return {
|
|
436
|
+
passed: !1,
|
|
437
|
+
actualValue: void 0,
|
|
438
|
+
expectedValue: p(e.name),
|
|
439
|
+
failure: {
|
|
440
|
+
type: "ENTITY_TYPE_MISMATCH",
|
|
441
|
+
field: "entityType",
|
|
442
|
+
actual: "unknown",
|
|
443
|
+
expected: p(e.name)
|
|
444
|
+
}
|
|
445
|
+
};
|
|
446
|
+
if (e.name.type === "simpleValue" && e.name.value !== e.name.value.toUpperCase()) return {
|
|
447
|
+
passed: !1,
|
|
448
|
+
actualValue: i,
|
|
449
|
+
expectedValue: p(e.name),
|
|
450
|
+
failure: {
|
|
451
|
+
type: "ENTITY_TYPE_MISMATCH",
|
|
452
|
+
field: "entityType",
|
|
453
|
+
actual: i,
|
|
454
|
+
expected: p(e.name)
|
|
455
|
+
}
|
|
456
|
+
};
|
|
457
|
+
if (!v(e.name, i, Je)) return {
|
|
458
|
+
passed: !1,
|
|
459
|
+
actualValue: i,
|
|
460
|
+
expectedValue: p(e.name),
|
|
461
|
+
failure: {
|
|
462
|
+
type: "ENTITY_TYPE_MISMATCH",
|
|
463
|
+
field: "entityType",
|
|
464
|
+
actual: i,
|
|
465
|
+
expected: p(e.name)
|
|
466
|
+
}
|
|
467
|
+
};
|
|
468
|
+
if (e.predefinedType) {
|
|
469
|
+
const n = a.getPredefinedTypeRaw?.(t), r = a.getObjectType(t);
|
|
470
|
+
if (!n && !r) return {
|
|
471
|
+
passed: !1,
|
|
472
|
+
actualValue: i,
|
|
473
|
+
expectedValue: `${p(e.name)} with predefinedType ${p(e.predefinedType)}`,
|
|
474
|
+
failure: {
|
|
475
|
+
type: "PREDEFINED_TYPE_MISSING",
|
|
476
|
+
field: "predefinedType",
|
|
477
|
+
expected: p(e.predefinedType)
|
|
478
|
+
}
|
|
479
|
+
};
|
|
480
|
+
let s = !1;
|
|
481
|
+
if ((n && v(e.predefinedType, n) || n === "USERDEFINED" && r && r !== n && v(e.predefinedType, r) || !n && r && v(e.predefinedType, r)) && (s = !0), !s) {
|
|
482
|
+
const l = r || n || "(none)";
|
|
483
|
+
return {
|
|
484
|
+
passed: !1,
|
|
485
|
+
actualValue: `${i}[${l}]`,
|
|
486
|
+
expectedValue: `${p(e.name)} with predefinedType ${p(e.predefinedType)}`,
|
|
487
|
+
failure: {
|
|
488
|
+
type: "PREDEFINED_TYPE_MISMATCH",
|
|
489
|
+
field: "predefinedType",
|
|
490
|
+
actual: l,
|
|
491
|
+
expected: p(e.predefinedType)
|
|
492
|
+
}
|
|
493
|
+
};
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
return {
|
|
497
|
+
passed: !0,
|
|
498
|
+
actualValue: e.predefinedType ? `${i}[${a.getObjectType(t) || ""}]` : i,
|
|
499
|
+
expectedValue: p(e.name)
|
|
500
|
+
};
|
|
501
|
+
}
|
|
502
|
+
function et(e, t) {
|
|
503
|
+
const a = e.name;
|
|
504
|
+
if (a.type === "simpleValue") return t.getEntitiesByType(a.value);
|
|
505
|
+
if (a.type === "enumeration") {
|
|
506
|
+
const i = [];
|
|
507
|
+
for (const n of a.values)i.push(...t.getEntitiesByType(n));
|
|
508
|
+
return i;
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
const tt = /^[+-]?\d+$/, it = /^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/, at = /^\d{4}-\d{2}-\d{2}(Z|[+-]\d{2}:\d{2})?$/, nt = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})?$/, rt = /^-?P(?:\d+Y)?(?:\d+M)?(?:\d+D)?(?:T(?:\d+H)?(?:\d+M)?(?:\d+(?:\.\d+)?S)?)?$/;
|
|
512
|
+
function re(e, t) {
|
|
513
|
+
return !t || t.length === 0 ? !0 : t.some((a)=>st(e, a));
|
|
514
|
+
}
|
|
515
|
+
function st(e, t) {
|
|
516
|
+
switch(t){
|
|
517
|
+
case "xs:integer":
|
|
518
|
+
return tt.test(e);
|
|
519
|
+
case "xs:double":
|
|
520
|
+
return it.test(e);
|
|
521
|
+
case "xs:boolean":
|
|
522
|
+
return e === "true" || e === "false";
|
|
523
|
+
case "xs:date":
|
|
524
|
+
return at.test(e);
|
|
525
|
+
case "xs:dateTime":
|
|
526
|
+
return nt.test(e);
|
|
527
|
+
case "xs:duration":
|
|
528
|
+
return rt.test(e);
|
|
529
|
+
case "xs:string":
|
|
530
|
+
return !0;
|
|
531
|
+
default:
|
|
532
|
+
return !0;
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
function lt(e) {
|
|
536
|
+
if (!e) return [];
|
|
537
|
+
const t = e.toUpperCase();
|
|
538
|
+
return t === "IFCINTEGER" || t === "IFCCOUNTMEASURE" ? [
|
|
539
|
+
"xs:integer"
|
|
540
|
+
] : t === "IFCBOOLEAN" ? [
|
|
541
|
+
"xs:boolean"
|
|
542
|
+
] : t === "IFCLOGICAL" ? [
|
|
543
|
+
"xs:boolean",
|
|
544
|
+
"xs:string"
|
|
545
|
+
] : t === "IFCDATE" ? [
|
|
546
|
+
"xs:date"
|
|
547
|
+
] : t === "IFCDATETIME" ? [
|
|
548
|
+
"xs:dateTime"
|
|
549
|
+
] : t === "IFCDURATION" || t === "IFCTIMESTAMP" ? [
|
|
550
|
+
"xs:duration"
|
|
551
|
+
] : t === "IFCREAL" || t.endsWith("MEASURE") || t.endsWith("RATIO") ? [
|
|
552
|
+
"xs:double"
|
|
553
|
+
] : t === "IFCLABEL" || t === "IFCTEXT" || t === "IFCIDENTIFIER" || t === "IFCSTRING" ? [
|
|
554
|
+
"xs:string"
|
|
555
|
+
] : [];
|
|
556
|
+
}
|
|
557
|
+
const ot = {
|
|
558
|
+
caseInsensitive: !0
|
|
559
|
+
}, ut = [
|
|
560
|
+
"Name",
|
|
561
|
+
"Description",
|
|
562
|
+
"ObjectType",
|
|
563
|
+
"Tag",
|
|
564
|
+
"GlobalId",
|
|
565
|
+
"LongName"
|
|
566
|
+
];
|
|
567
|
+
function ct(e, t, a) {
|
|
568
|
+
const i = e.name;
|
|
569
|
+
let n;
|
|
570
|
+
if (i.type === "simpleValue") n = [
|
|
571
|
+
i.value
|
|
572
|
+
];
|
|
573
|
+
else {
|
|
574
|
+
const s = a.getAttributeNames?.(t);
|
|
575
|
+
if (n = (s && s.length > 0 ? s : ut).filter((o)=>v(i, o, ot)), n.length === 0) return {
|
|
576
|
+
passed: !1,
|
|
577
|
+
expectedValue: e.value ? p(e.value) : `attribute matching ${p(i)} to exist`,
|
|
578
|
+
failure: {
|
|
579
|
+
type: "ATTRIBUTE_MISSING",
|
|
580
|
+
field: p(i),
|
|
581
|
+
expected: p(i)
|
|
582
|
+
}
|
|
583
|
+
};
|
|
584
|
+
}
|
|
585
|
+
let r;
|
|
586
|
+
for (const s of n){
|
|
587
|
+
const l = pt(e, s, t, a);
|
|
588
|
+
if (l.passed) return l;
|
|
589
|
+
(!r || l.failure?.type !== "ATTRIBUTE_MISSING" && r.failure?.type === "ATTRIBUTE_MISSING") && (r = l);
|
|
590
|
+
}
|
|
591
|
+
return r;
|
|
592
|
+
}
|
|
593
|
+
function pt(e, t, a, i) {
|
|
594
|
+
const n = dt(t, a, i);
|
|
595
|
+
if (n == null) return {
|
|
596
|
+
passed: !1,
|
|
597
|
+
actualValue: void 0,
|
|
598
|
+
expectedValue: e.value ? p(e.value) : `attribute "${t}" to exist`,
|
|
599
|
+
failure: {
|
|
600
|
+
type: "ATTRIBUTE_MISSING",
|
|
601
|
+
field: t,
|
|
602
|
+
expected: e.value ? p(e.value) : "any value"
|
|
603
|
+
}
|
|
604
|
+
};
|
|
605
|
+
if (n === "") return {
|
|
606
|
+
passed: !1,
|
|
607
|
+
actualValue: "(empty)",
|
|
608
|
+
expectedValue: e.value ? p(e.value) : `attribute "${t}" must have a non-empty value`,
|
|
609
|
+
failure: {
|
|
610
|
+
type: "ATTRIBUTE_VALUE_MISMATCH",
|
|
611
|
+
field: t,
|
|
612
|
+
actual: "(empty)",
|
|
613
|
+
expected: e.value ? p(e.value) : "a non-empty value"
|
|
614
|
+
}
|
|
615
|
+
};
|
|
616
|
+
if (!e.value) return {
|
|
617
|
+
passed: !0,
|
|
618
|
+
actualValue: String(n),
|
|
619
|
+
expectedValue: `attribute "${t}" to exist`
|
|
620
|
+
};
|
|
621
|
+
if (e.value.type === "simpleValue") {
|
|
622
|
+
const r = i.getAttributeXsdTypes?.(a, t);
|
|
623
|
+
if (r && !re(e.value.value, r)) return {
|
|
624
|
+
passed: !1,
|
|
625
|
+
actualValue: String(n),
|
|
626
|
+
expectedValue: p(e.value),
|
|
627
|
+
failure: {
|
|
628
|
+
type: "ATTRIBUTE_VALUE_MISMATCH",
|
|
629
|
+
field: t,
|
|
630
|
+
actual: String(n),
|
|
631
|
+
expected: p(e.value)
|
|
632
|
+
}
|
|
633
|
+
};
|
|
634
|
+
}
|
|
635
|
+
return v(e.value, n) ? {
|
|
636
|
+
passed: !0,
|
|
637
|
+
actualValue: String(n),
|
|
638
|
+
expectedValue: p(e.value)
|
|
639
|
+
} : {
|
|
640
|
+
passed: !1,
|
|
641
|
+
actualValue: String(n),
|
|
642
|
+
expectedValue: p(e.value),
|
|
643
|
+
failure: {
|
|
644
|
+
type: e.value.type === "pattern" ? "ATTRIBUTE_PATTERN_MISMATCH" : "ATTRIBUTE_VALUE_MISMATCH",
|
|
645
|
+
field: t,
|
|
646
|
+
actual: String(n),
|
|
647
|
+
expected: p(e.value)
|
|
648
|
+
}
|
|
649
|
+
};
|
|
650
|
+
}
|
|
651
|
+
function dt(e, t, a) {
|
|
652
|
+
switch(e.toLowerCase()){
|
|
653
|
+
case "name":
|
|
654
|
+
return a.getEntityName(t);
|
|
655
|
+
case "description":
|
|
656
|
+
return a.getDescription(t);
|
|
657
|
+
case "objecttype":
|
|
658
|
+
return a.getObjectType(t);
|
|
659
|
+
case "globalid":
|
|
660
|
+
return a.getGlobalId(t);
|
|
661
|
+
default:
|
|
662
|
+
return a.getAttribute(t, e);
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
const mt = {
|
|
666
|
+
caseInsensitive: !0
|
|
667
|
+
};
|
|
668
|
+
function ft(e, t, a) {
|
|
669
|
+
const i = a.getPropertySets(t);
|
|
670
|
+
if (i.length === 0) return {
|
|
671
|
+
passed: !1,
|
|
672
|
+
expectedValue: `property "${p(e.baseName)}" in "${p(e.propertySet)}"`,
|
|
673
|
+
failure: {
|
|
674
|
+
type: "PSET_MISSING",
|
|
675
|
+
field: p(e.propertySet),
|
|
676
|
+
expected: p(e.propertySet)
|
|
677
|
+
}
|
|
678
|
+
};
|
|
679
|
+
const n = i.filter((u)=>v(e.propertySet, u.name));
|
|
680
|
+
if (n.length === 0) {
|
|
681
|
+
const u = i.map((c)=>c.name).join(", ");
|
|
682
|
+
return {
|
|
683
|
+
passed: !1,
|
|
684
|
+
actualValue: u || "(none)",
|
|
685
|
+
expectedValue: p(e.propertySet),
|
|
686
|
+
failure: {
|
|
687
|
+
type: "PSET_MISSING",
|
|
688
|
+
field: "propertySet",
|
|
689
|
+
actual: u,
|
|
690
|
+
expected: p(e.propertySet),
|
|
691
|
+
context: {
|
|
692
|
+
availablePsets: u
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
};
|
|
696
|
+
}
|
|
697
|
+
let r, s;
|
|
698
|
+
for (const u of n){
|
|
699
|
+
const c = yt(e, u);
|
|
700
|
+
if (c.passed) {
|
|
701
|
+
r = c;
|
|
702
|
+
continue;
|
|
703
|
+
}
|
|
704
|
+
s ? s.failure?.type === "PROPERTY_MISSING" && c.failure?.type !== "PROPERTY_MISSING" && (s = c) : s = c;
|
|
705
|
+
}
|
|
706
|
+
if (s) {
|
|
707
|
+
if (s.failure?.type !== "PROPERTY_MISSING" || r) return s;
|
|
708
|
+
} else if (r) return r;
|
|
709
|
+
const l = n.map((u)=>u.name).join(", "), o = n.flatMap((u)=>u.properties.map((c)=>`${u.name}.${c.name}`)).join(", ");
|
|
710
|
+
return {
|
|
711
|
+
passed: !1,
|
|
712
|
+
actualValue: o || "(none)",
|
|
713
|
+
expectedValue: `${p(e.propertySet)}.${p(e.baseName)}`,
|
|
714
|
+
failure: {
|
|
715
|
+
type: "PROPERTY_MISSING",
|
|
716
|
+
field: p(e.baseName),
|
|
717
|
+
expected: p(e.baseName),
|
|
718
|
+
context: {
|
|
719
|
+
propertySet: l,
|
|
720
|
+
availableProperties: o
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
};
|
|
724
|
+
}
|
|
725
|
+
function yt(e, t) {
|
|
726
|
+
const a = t.properties.filter((r)=>v(e.baseName, r.name));
|
|
727
|
+
if (a.length === 0) return {
|
|
728
|
+
passed: !1,
|
|
729
|
+
failure: {
|
|
730
|
+
type: "PROPERTY_MISSING",
|
|
731
|
+
field: p(e.baseName),
|
|
732
|
+
expected: p(e.baseName),
|
|
733
|
+
context: {
|
|
734
|
+
propertySet: t.name,
|
|
735
|
+
availableProperties: t.properties.map((r)=>r.name).join(", ")
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
};
|
|
739
|
+
let i, n;
|
|
740
|
+
for (const r of a){
|
|
741
|
+
const s = ht(e, t, r);
|
|
742
|
+
if (s.passed) {
|
|
743
|
+
i = s;
|
|
744
|
+
continue;
|
|
745
|
+
}
|
|
746
|
+
n ? n.failure?.type === "PROPERTY_MISSING" && s.failure?.type !== "PROPERTY_MISSING" && (n = s) : n = s;
|
|
747
|
+
}
|
|
748
|
+
return n || i;
|
|
749
|
+
}
|
|
750
|
+
function ht(e, t, a) {
|
|
751
|
+
if (a.value === null || a.value === void 0 || a.value === "") return {
|
|
752
|
+
passed: !1,
|
|
753
|
+
actualValue: "(empty)",
|
|
754
|
+
expectedValue: e.value ? p(e.value) : `property "${t.name}.${a.name}" must have a value`,
|
|
755
|
+
failure: {
|
|
756
|
+
type: "PROPERTY_VALUE_MISMATCH",
|
|
757
|
+
field: `${t.name}.${a.name}`,
|
|
758
|
+
actual: "(empty)",
|
|
759
|
+
expected: e.value ? p(e.value) : "a non-empty value"
|
|
760
|
+
}
|
|
761
|
+
};
|
|
762
|
+
if (e.dataType && a.dataType && !v(e.dataType, a.dataType, mt)) return {
|
|
763
|
+
passed: !1,
|
|
764
|
+
actualValue: `${t.name}.${a.name} (${a.dataType})`,
|
|
765
|
+
expectedValue: `dataType ${p(e.dataType)}`,
|
|
766
|
+
failure: {
|
|
767
|
+
type: "PROPERTY_DATATYPE_MISMATCH",
|
|
768
|
+
field: `${t.name}.${a.name}`,
|
|
769
|
+
actual: a.dataType,
|
|
770
|
+
expected: p(e.dataType)
|
|
771
|
+
}
|
|
772
|
+
};
|
|
773
|
+
if (e.value) {
|
|
774
|
+
const i = a.value;
|
|
775
|
+
if (i == null || i === "") return {
|
|
776
|
+
passed: !1,
|
|
777
|
+
actualValue: "(empty)",
|
|
778
|
+
expectedValue: p(e.value),
|
|
779
|
+
failure: {
|
|
780
|
+
type: "PROPERTY_VALUE_MISMATCH",
|
|
781
|
+
field: `${t.name}.${a.name}`,
|
|
782
|
+
actual: "(empty)",
|
|
783
|
+
expected: p(e.value)
|
|
784
|
+
}
|
|
785
|
+
};
|
|
786
|
+
if (e.value.type === "simpleValue") {
|
|
787
|
+
const s = lt(a.dataType);
|
|
788
|
+
if (s.length > 0 && !re(e.value.value, s)) return {
|
|
789
|
+
passed: !1,
|
|
790
|
+
actualValue: String(i),
|
|
791
|
+
expectedValue: p(e.value),
|
|
792
|
+
failure: {
|
|
793
|
+
type: "PROPERTY_VALUE_MISMATCH",
|
|
794
|
+
field: `${t.name}.${a.name}`,
|
|
795
|
+
actual: String(i),
|
|
796
|
+
expected: p(e.value)
|
|
797
|
+
}
|
|
798
|
+
};
|
|
799
|
+
}
|
|
800
|
+
if (!(a.values && a.values.length > 0 ? a.values : [
|
|
801
|
+
i
|
|
802
|
+
]).some((s)=>v(e.value, s))) {
|
|
803
|
+
const s = e.value.type === "bounds" ? "PROPERTY_OUT_OF_BOUNDS" : "PROPERTY_VALUE_MISMATCH", l = a.values && a.values.length > 0 ? a.values.join(", ") : String(i);
|
|
804
|
+
return {
|
|
805
|
+
passed: !1,
|
|
806
|
+
actualValue: l,
|
|
807
|
+
expectedValue: p(e.value),
|
|
808
|
+
failure: {
|
|
809
|
+
type: s,
|
|
810
|
+
field: `${t.name}.${a.name}`,
|
|
811
|
+
actual: l,
|
|
812
|
+
expected: p(e.value)
|
|
813
|
+
}
|
|
814
|
+
};
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
return {
|
|
818
|
+
passed: !0,
|
|
819
|
+
actualValue: `${t.name}.${a.name} = ${a.value}`,
|
|
820
|
+
expectedValue: e.value ? p(e.value) : "property exists"
|
|
821
|
+
};
|
|
822
|
+
}
|
|
823
|
+
function vt(e, t, a) {
|
|
824
|
+
const i = a.getClassifications(t), n = i.length > 0;
|
|
825
|
+
if (!e.system && !e.value) return n ? {
|
|
826
|
+
passed: !0,
|
|
827
|
+
actualValue: i.map((s)=>`${s.system}:${s.value}`).join(", "),
|
|
828
|
+
expectedValue: "any classification"
|
|
829
|
+
} : {
|
|
830
|
+
passed: !1,
|
|
831
|
+
actualValue: "(none)",
|
|
832
|
+
expectedValue: "any classification",
|
|
833
|
+
failure: {
|
|
834
|
+
type: "CLASSIFICATION_MISSING",
|
|
835
|
+
expected: "any classification"
|
|
836
|
+
}
|
|
837
|
+
};
|
|
838
|
+
if (!n) {
|
|
839
|
+
const s = e.system && e.value ? `${p(e.system)}:${p(e.value)}` : e.system ? p(e.system) : p(e.value);
|
|
840
|
+
return {
|
|
841
|
+
passed: !1,
|
|
842
|
+
actualValue: "(none)",
|
|
843
|
+
expectedValue: s,
|
|
844
|
+
failure: {
|
|
845
|
+
type: "CLASSIFICATION_MISSING",
|
|
846
|
+
expected: s
|
|
847
|
+
}
|
|
848
|
+
};
|
|
849
|
+
}
|
|
850
|
+
let r = i;
|
|
851
|
+
if (e.system && (r = i.filter((s)=>v(e.system, s.system)), r.length === 0)) {
|
|
852
|
+
const s = [
|
|
853
|
+
...new Set(i.map((l)=>l.system))
|
|
854
|
+
].join(", ");
|
|
855
|
+
return {
|
|
856
|
+
passed: !1,
|
|
857
|
+
actualValue: s,
|
|
858
|
+
expectedValue: p(e.system),
|
|
859
|
+
failure: {
|
|
860
|
+
type: "CLASSIFICATION_SYSTEM_MISMATCH",
|
|
861
|
+
field: "system",
|
|
862
|
+
actual: s,
|
|
863
|
+
expected: p(e.system),
|
|
864
|
+
context: {
|
|
865
|
+
availableSystems: s
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
};
|
|
869
|
+
}
|
|
870
|
+
if (e.value) {
|
|
871
|
+
const s = r.filter((l)=>v(e.value, l.value));
|
|
872
|
+
if (s.length === 0) {
|
|
873
|
+
const l = r.map((o)=>o.value).join(", ");
|
|
874
|
+
return {
|
|
875
|
+
passed: !1,
|
|
876
|
+
actualValue: l || "(none)",
|
|
877
|
+
expectedValue: p(e.value),
|
|
878
|
+
failure: {
|
|
879
|
+
type: "CLASSIFICATION_VALUE_MISMATCH",
|
|
880
|
+
field: "value",
|
|
881
|
+
actual: l,
|
|
882
|
+
expected: p(e.value),
|
|
883
|
+
context: {
|
|
884
|
+
system: e.system ? p(e.system) : "any",
|
|
885
|
+
availableValues: l
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
};
|
|
889
|
+
}
|
|
890
|
+
return {
|
|
891
|
+
passed: !0,
|
|
892
|
+
actualValue: s.map((l)=>`${l.system}:${l.value}`).join(", "),
|
|
893
|
+
expectedValue: e.system ? `${p(e.system)}:${p(e.value)}` : p(e.value)
|
|
894
|
+
};
|
|
895
|
+
}
|
|
896
|
+
return {
|
|
897
|
+
passed: !0,
|
|
898
|
+
actualValue: r.map((s)=>`${s.system}:${s.value}`).join(", "),
|
|
899
|
+
expectedValue: p(e.system)
|
|
900
|
+
};
|
|
901
|
+
}
|
|
902
|
+
function Et(e, t, a) {
|
|
903
|
+
const i = a.getMaterials(t);
|
|
904
|
+
if (!e.value) return i.length === 0 ? {
|
|
905
|
+
passed: !1,
|
|
906
|
+
actualValue: "(none)",
|
|
907
|
+
expectedValue: "any material",
|
|
908
|
+
failure: {
|
|
909
|
+
type: "MATERIAL_MISSING",
|
|
910
|
+
expected: "any material"
|
|
911
|
+
}
|
|
912
|
+
} : {
|
|
913
|
+
passed: !0,
|
|
914
|
+
actualValue: i.map((r)=>r.name).join(", "),
|
|
915
|
+
expectedValue: "any material"
|
|
916
|
+
};
|
|
917
|
+
const n = i.filter((r)=>v(e.value, r.name) || r.category && v(e.value, r.category));
|
|
918
|
+
if (n.length === 0) {
|
|
919
|
+
if (i.length === 0) return {
|
|
920
|
+
passed: !1,
|
|
921
|
+
actualValue: "(none)",
|
|
922
|
+
expectedValue: p(e.value),
|
|
923
|
+
failure: {
|
|
924
|
+
type: "MATERIAL_MISSING",
|
|
925
|
+
expected: p(e.value)
|
|
926
|
+
}
|
|
927
|
+
};
|
|
928
|
+
const r = i.map((s)=>s.name).join(", ");
|
|
929
|
+
return {
|
|
930
|
+
passed: !1,
|
|
931
|
+
actualValue: r,
|
|
932
|
+
expectedValue: p(e.value),
|
|
933
|
+
failure: {
|
|
934
|
+
type: "MATERIAL_VALUE_MISMATCH",
|
|
935
|
+
field: "material",
|
|
936
|
+
actual: r,
|
|
937
|
+
expected: p(e.value),
|
|
938
|
+
context: {
|
|
939
|
+
availableMaterials: r
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
};
|
|
943
|
+
}
|
|
944
|
+
return {
|
|
945
|
+
passed: !0,
|
|
946
|
+
actualValue: n.map((r)=>r.name).join(", "),
|
|
947
|
+
expectedValue: p(e.value)
|
|
948
|
+
};
|
|
949
|
+
}
|
|
950
|
+
const H = {
|
|
951
|
+
caseInsensitive: !0
|
|
952
|
+
}, L = {
|
|
953
|
+
IfcRelAggregates: "aggregated in",
|
|
954
|
+
IfcRelAssignsToGroup: "grouped in",
|
|
955
|
+
IfcRelContainedInSpatialStructure: "contained in",
|
|
956
|
+
IfcRelNests: "nested in",
|
|
957
|
+
IfcRelVoidsElement: "voiding",
|
|
958
|
+
IfcRelFillsElement: "filling"
|
|
959
|
+
};
|
|
960
|
+
function Tt(e, t, a) {
|
|
961
|
+
const i = a.getAncestors ? a.getAncestors(t, e.relation) : [];
|
|
962
|
+
if (i.length === 0) {
|
|
963
|
+
const r = a.getParent(t, e.relation);
|
|
964
|
+
r && i.push(r);
|
|
965
|
+
}
|
|
966
|
+
if (i.length === 0) {
|
|
967
|
+
const r = L[e.relation] || e.relation, s = e.entity ? p(e.entity.name) : "any entity";
|
|
968
|
+
return {
|
|
969
|
+
passed: !1,
|
|
970
|
+
actualValue: "(no parent)",
|
|
971
|
+
expectedValue: `${r} ${s}`,
|
|
972
|
+
failure: {
|
|
973
|
+
type: "PARTOF_RELATION_MISSING",
|
|
974
|
+
field: e.relation,
|
|
975
|
+
expected: `${r} ${s}`,
|
|
976
|
+
context: {
|
|
977
|
+
relation: e.relation
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
};
|
|
981
|
+
}
|
|
982
|
+
let n;
|
|
983
|
+
for (const r of i){
|
|
984
|
+
const s = It(e, r);
|
|
985
|
+
if (s.passed) return s;
|
|
986
|
+
(!n || s.failure?.type !== "PARTOF_ENTITY_MISMATCH" && n.failure?.type === "PARTOF_ENTITY_MISMATCH") && (n = s);
|
|
987
|
+
}
|
|
988
|
+
return n;
|
|
989
|
+
}
|
|
990
|
+
function It(e, t) {
|
|
991
|
+
if (!e.entity) {
|
|
992
|
+
const n = L[e.relation] || e.relation;
|
|
993
|
+
return {
|
|
994
|
+
passed: !0,
|
|
995
|
+
actualValue: `${n} ${t.entityType}`,
|
|
996
|
+
expectedValue: `${n} any entity`
|
|
997
|
+
};
|
|
998
|
+
}
|
|
999
|
+
if (!v(e.entity.name, t.entityType, H)) {
|
|
1000
|
+
const n = L[e.relation] || e.relation;
|
|
1001
|
+
return {
|
|
1002
|
+
passed: !1,
|
|
1003
|
+
actualValue: `${n} ${t.entityType}`,
|
|
1004
|
+
expectedValue: `${n} ${p(e.entity.name)}`,
|
|
1005
|
+
failure: {
|
|
1006
|
+
type: "PARTOF_ENTITY_MISMATCH",
|
|
1007
|
+
field: "entity",
|
|
1008
|
+
actual: t.entityType,
|
|
1009
|
+
expected: p(e.entity.name),
|
|
1010
|
+
context: {
|
|
1011
|
+
relation: e.relation,
|
|
1012
|
+
parentId: String(t.expressId)
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
};
|
|
1016
|
+
}
|
|
1017
|
+
if (e.entity.predefinedType) {
|
|
1018
|
+
if (!t.predefinedType) return {
|
|
1019
|
+
passed: !1,
|
|
1020
|
+
actualValue: `${t.entityType} (no predefinedType)`,
|
|
1021
|
+
expectedValue: `${p(e.entity.name)} with predefinedType ${p(e.entity.predefinedType)}`,
|
|
1022
|
+
failure: {
|
|
1023
|
+
type: "PARTOF_PREDEFINED_TYPE_MISSING",
|
|
1024
|
+
field: "predefinedType",
|
|
1025
|
+
expected: p(e.entity.predefinedType),
|
|
1026
|
+
context: {
|
|
1027
|
+
relation: e.relation,
|
|
1028
|
+
parentType: t.entityType
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
};
|
|
1032
|
+
if (!v(e.entity.predefinedType, t.predefinedType, H)) return {
|
|
1033
|
+
passed: !1,
|
|
1034
|
+
actualValue: `${t.entityType}[${t.predefinedType}]`,
|
|
1035
|
+
expectedValue: `${p(e.entity.name)}[${p(e.entity.predefinedType)}]`,
|
|
1036
|
+
failure: {
|
|
1037
|
+
type: "PARTOF_PREDEFINED_TYPE_MISMATCH",
|
|
1038
|
+
field: "predefinedType",
|
|
1039
|
+
actual: t.predefinedType,
|
|
1040
|
+
expected: p(e.entity.predefinedType),
|
|
1041
|
+
context: {
|
|
1042
|
+
relation: e.relation,
|
|
1043
|
+
parentType: t.entityType
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
};
|
|
1047
|
+
}
|
|
1048
|
+
const a = L[e.relation] || e.relation, i = t.predefinedType ? `${t.entityType}[${t.predefinedType}]` : t.entityType;
|
|
1049
|
+
return {
|
|
1050
|
+
passed: !0,
|
|
1051
|
+
actualValue: `${a} ${i}`,
|
|
1052
|
+
expectedValue: `${a} ${p(e.entity.name)}`
|
|
1053
|
+
};
|
|
1054
|
+
}
|
|
1055
|
+
function se(e, t, a) {
|
|
1056
|
+
switch(e.type){
|
|
1057
|
+
case "entity":
|
|
1058
|
+
return Ze(e, t, a);
|
|
1059
|
+
case "attribute":
|
|
1060
|
+
return ct(e, t, a);
|
|
1061
|
+
case "property":
|
|
1062
|
+
return ft(e, t, a);
|
|
1063
|
+
case "classification":
|
|
1064
|
+
return vt(e, t, a);
|
|
1065
|
+
case "material":
|
|
1066
|
+
return Et(e, t, a);
|
|
1067
|
+
case "partOf":
|
|
1068
|
+
return Tt(e, t, a);
|
|
1069
|
+
default:
|
|
1070
|
+
return {
|
|
1071
|
+
passed: !1,
|
|
1072
|
+
failure: {
|
|
1073
|
+
type: "ENTITY_TYPE_MISMATCH",
|
|
1074
|
+
expected: "known facet type",
|
|
1075
|
+
actual: e.type
|
|
1076
|
+
}
|
|
1077
|
+
};
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
function bt(e, t) {
|
|
1081
|
+
switch(e.type){
|
|
1082
|
+
case "entity":
|
|
1083
|
+
return et(e, t);
|
|
1084
|
+
default:
|
|
1085
|
+
return;
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
la = async function(e, t, a, i = {}) {
|
|
1089
|
+
const { translator: n, onProgress: r, includePassingEntities: s = !0 } = i, l = [], o = e.specifications.length;
|
|
1090
|
+
for(let c = 0; c < o; c++){
|
|
1091
|
+
const f = e.specifications[c];
|
|
1092
|
+
r && r({
|
|
1093
|
+
phase: "filtering",
|
|
1094
|
+
specificationIndex: c,
|
|
1095
|
+
totalSpecifications: o,
|
|
1096
|
+
entitiesProcessed: 0,
|
|
1097
|
+
totalEntities: 0,
|
|
1098
|
+
percentage: Math.floor(c / o * 100)
|
|
1099
|
+
});
|
|
1100
|
+
const d = await gt(f, t, a, i, (m)=>{
|
|
1101
|
+
r && r({
|
|
1102
|
+
...m,
|
|
1103
|
+
specificationIndex: c,
|
|
1104
|
+
totalSpecifications: o,
|
|
1105
|
+
percentage: Math.floor((c + m.entitiesProcessed / Math.max(m.totalEntities, 1)) / o * 100)
|
|
1106
|
+
});
|
|
1107
|
+
});
|
|
1108
|
+
l.push(d);
|
|
1109
|
+
}
|
|
1110
|
+
r && r({
|
|
1111
|
+
phase: "complete",
|
|
1112
|
+
specificationIndex: o,
|
|
1113
|
+
totalSpecifications: o,
|
|
1114
|
+
entitiesProcessed: 0,
|
|
1115
|
+
totalEntities: 0,
|
|
1116
|
+
percentage: 100
|
|
1117
|
+
});
|
|
1118
|
+
const u = Rt(l);
|
|
1119
|
+
return {
|
|
1120
|
+
document: e,
|
|
1121
|
+
modelInfo: a,
|
|
1122
|
+
timestamp: new Date,
|
|
1123
|
+
summary: u,
|
|
1124
|
+
specificationResults: l
|
|
1125
|
+
};
|
|
1126
|
+
};
|
|
1127
|
+
async function gt(e, t, a, i, n) {
|
|
1128
|
+
const { translator: r, maxEntities: s, includePassingEntities: l = !0 } = i, o = a.modelId, u = St(e, t), c = s ? u.slice(0, s) : u, f = [], d = c.length;
|
|
1129
|
+
for(let I = 0; I < d; I++){
|
|
1130
|
+
const b = c[I];
|
|
1131
|
+
n && I % 100 === 0 && n({
|
|
1132
|
+
phase: "validating",
|
|
1133
|
+
entitiesProcessed: I,
|
|
1134
|
+
totalEntities: d
|
|
1135
|
+
});
|
|
1136
|
+
const P = At(e, b, o, t, r);
|
|
1137
|
+
(l || !P.passed) && f.push(P);
|
|
1138
|
+
}
|
|
1139
|
+
let m = 0, y = 0;
|
|
1140
|
+
for (const I of f)I.passed ? m++ : y++;
|
|
1141
|
+
l || (m = d - y);
|
|
1142
|
+
const M = Ct(e, u.length);
|
|
1143
|
+
let x = "pass";
|
|
1144
|
+
u.length === 0 ? M?.passed === !1 ? x = "fail" : M?.passed === !0 ? x = "pass" : x = "not_applicable" : (y > 0 || M?.passed === !1) && (x = "fail");
|
|
1145
|
+
const _ = d > 0 ? Math.floor(m / d * 100) : 100;
|
|
1146
|
+
return {
|
|
1147
|
+
specification: e,
|
|
1148
|
+
status: x,
|
|
1149
|
+
applicableCount: u.length,
|
|
1150
|
+
passedCount: m,
|
|
1151
|
+
failedCount: y,
|
|
1152
|
+
passRate: _,
|
|
1153
|
+
entityResults: f,
|
|
1154
|
+
cardinalityResult: M
|
|
1155
|
+
};
|
|
1156
|
+
}
|
|
1157
|
+
function St(e, t) {
|
|
1158
|
+
const a = e.applicability.facets;
|
|
1159
|
+
if (a.length === 0) return t.getAllEntityIds();
|
|
1160
|
+
let i;
|
|
1161
|
+
for (const r of a){
|
|
1162
|
+
const s = bt(r, t);
|
|
1163
|
+
if (s !== void 0) {
|
|
1164
|
+
i = s;
|
|
1165
|
+
break;
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
i === void 0 && (i = t.getAllEntityIds());
|
|
1169
|
+
const n = [];
|
|
1170
|
+
for (const r of i){
|
|
1171
|
+
let s = !0;
|
|
1172
|
+
for (const l of a)if (!se(l, r, t).passed) {
|
|
1173
|
+
s = !1;
|
|
1174
|
+
break;
|
|
1175
|
+
}
|
|
1176
|
+
s && n.push(r);
|
|
1177
|
+
}
|
|
1178
|
+
return n;
|
|
1179
|
+
}
|
|
1180
|
+
function At(e, t, a, i, n) {
|
|
1181
|
+
const r = [];
|
|
1182
|
+
let s = !0;
|
|
1183
|
+
for (const l of e.requirements){
|
|
1184
|
+
const o = xt(l, t, i, n);
|
|
1185
|
+
r.push(o), o.status === "fail" && (s = !1);
|
|
1186
|
+
}
|
|
1187
|
+
return {
|
|
1188
|
+
expressId: t,
|
|
1189
|
+
modelId: a,
|
|
1190
|
+
entityType: i.getEntityType(t) || "Unknown",
|
|
1191
|
+
entityName: i.getEntityName(t),
|
|
1192
|
+
globalId: i.getGlobalId(t),
|
|
1193
|
+
passed: s,
|
|
1194
|
+
requirementResults: r
|
|
1195
|
+
};
|
|
1196
|
+
}
|
|
1197
|
+
function xt(e, t, a, i) {
|
|
1198
|
+
const n = se(e.facet, t, a);
|
|
1199
|
+
let r, s;
|
|
1200
|
+
switch(e.optionality){
|
|
1201
|
+
case "required":
|
|
1202
|
+
r = n.passed ? "pass" : "fail", n.passed || (s = i ? i.describeFailure({
|
|
1203
|
+
requirement: e,
|
|
1204
|
+
status: "fail",
|
|
1205
|
+
facetType: e.facet.type,
|
|
1206
|
+
checkedDescription: "",
|
|
1207
|
+
actualValue: n.actualValue,
|
|
1208
|
+
expectedValue: n.expectedValue,
|
|
1209
|
+
failure: n.failure
|
|
1210
|
+
}) : X(n));
|
|
1211
|
+
break;
|
|
1212
|
+
case "optional":
|
|
1213
|
+
if (n.passed) r = "pass";
|
|
1214
|
+
else {
|
|
1215
|
+
const o = new Set([
|
|
1216
|
+
"ATTRIBUTE_MISSING",
|
|
1217
|
+
"PROPERTY_MISSING",
|
|
1218
|
+
"PSET_MISSING",
|
|
1219
|
+
"CLASSIFICATION_MISSING",
|
|
1220
|
+
"MATERIAL_MISSING",
|
|
1221
|
+
"PARTOF_RELATION_MISSING"
|
|
1222
|
+
]);
|
|
1223
|
+
n.failure?.type && o.has(n.failure.type) ? r = "pass" : (r = "fail", s = i ? i.describeFailure({
|
|
1224
|
+
requirement: e,
|
|
1225
|
+
status: "fail",
|
|
1226
|
+
facetType: e.facet.type,
|
|
1227
|
+
checkedDescription: "",
|
|
1228
|
+
actualValue: n.actualValue,
|
|
1229
|
+
expectedValue: n.expectedValue,
|
|
1230
|
+
failure: n.failure
|
|
1231
|
+
}) : X(n));
|
|
1232
|
+
}
|
|
1233
|
+
break;
|
|
1234
|
+
case "prohibited":
|
|
1235
|
+
r = n.passed ? "fail" : "pass", r === "fail" && (s = i ? i.t("failures.prohibited", {
|
|
1236
|
+
field: n.actualValue || "value"
|
|
1237
|
+
}) : `Prohibited: found ${n.actualValue}`);
|
|
1238
|
+
break;
|
|
1239
|
+
default:
|
|
1240
|
+
r = n.passed ? "pass" : "fail";
|
|
1241
|
+
}
|
|
1242
|
+
const l = i ? i.describeRequirement(e) : Mt(e);
|
|
1243
|
+
return {
|
|
1244
|
+
requirement: e,
|
|
1245
|
+
status: r,
|
|
1246
|
+
facetType: e.facet.type,
|
|
1247
|
+
checkedDescription: l,
|
|
1248
|
+
failureReason: s,
|
|
1249
|
+
actualValue: n.actualValue,
|
|
1250
|
+
expectedValue: n.expectedValue,
|
|
1251
|
+
failure: n.failure
|
|
1252
|
+
};
|
|
1253
|
+
}
|
|
1254
|
+
function Ct(e, t) {
|
|
1255
|
+
if (e.minOccurs === void 0 && e.maxOccurs === void 0) return;
|
|
1256
|
+
const a = e.minOccurs ?? 0, i = e.maxOccurs;
|
|
1257
|
+
let n = !0;
|
|
1258
|
+
const r = [];
|
|
1259
|
+
return t < a && (n = !1, r.push(`Expected at least ${a}, found ${t}`)), i !== "unbounded" && i !== void 0 && t > i && (n = !1, r.push(`Expected at most ${i}, found ${t}`)), {
|
|
1260
|
+
passed: n,
|
|
1261
|
+
actualCount: t,
|
|
1262
|
+
minExpected: e.minOccurs,
|
|
1263
|
+
maxExpected: e.maxOccurs,
|
|
1264
|
+
message: r.length > 0 ? r.join("; ") : "Cardinality satisfied"
|
|
1265
|
+
};
|
|
1266
|
+
}
|
|
1267
|
+
function Rt(e) {
|
|
1268
|
+
let t = e.length, a = 0, i = 0, n = 0, r = 0, s = 0;
|
|
1269
|
+
for (const o of e)o.status === "pass" ? a++ : o.status === "fail" && i++, n += o.applicableCount, r += o.passedCount, s += o.failedCount;
|
|
1270
|
+
const l = n > 0 ? Math.floor(r / n * 100) : 100;
|
|
1271
|
+
return {
|
|
1272
|
+
totalSpecifications: t,
|
|
1273
|
+
passedSpecifications: a,
|
|
1274
|
+
failedSpecifications: i,
|
|
1275
|
+
totalEntitiesChecked: n,
|
|
1276
|
+
totalEntitiesPassed: r,
|
|
1277
|
+
totalEntitiesFailed: s,
|
|
1278
|
+
overallPassRate: l
|
|
1279
|
+
};
|
|
1280
|
+
}
|
|
1281
|
+
function X(e) {
|
|
1282
|
+
if (!e.failure) return `Expected ${e.expectedValue}, got ${e.actualValue}`;
|
|
1283
|
+
const { type: t, field: a, actual: i, expected: n } = e.failure;
|
|
1284
|
+
switch(t){
|
|
1285
|
+
case "ENTITY_TYPE_MISMATCH":
|
|
1286
|
+
return `Entity type "${i}" does not match expected ${n}`;
|
|
1287
|
+
case "PREDEFINED_TYPE_MISMATCH":
|
|
1288
|
+
return `Predefined type "${i}" does not match expected ${n}`;
|
|
1289
|
+
case "PREDEFINED_TYPE_MISSING":
|
|
1290
|
+
return `Predefined type is missing, expected ${n}`;
|
|
1291
|
+
case "ATTRIBUTE_MISSING":
|
|
1292
|
+
return `Attribute "${a}" is missing`;
|
|
1293
|
+
case "ATTRIBUTE_VALUE_MISMATCH":
|
|
1294
|
+
return `Attribute "${a}" value "${i}" does not match expected ${n}`;
|
|
1295
|
+
case "ATTRIBUTE_PATTERN_MISMATCH":
|
|
1296
|
+
return `Attribute "${a}" value "${i}" does not match pattern ${n}`;
|
|
1297
|
+
case "PSET_MISSING":
|
|
1298
|
+
return `Property set "${a || n}" not found`;
|
|
1299
|
+
case "PROPERTY_MISSING":
|
|
1300
|
+
return `Property "${a}" not found`;
|
|
1301
|
+
case "PROPERTY_VALUE_MISMATCH":
|
|
1302
|
+
return `Property "${a}" value "${i}" does not match expected ${n}`;
|
|
1303
|
+
case "PROPERTY_DATATYPE_MISMATCH":
|
|
1304
|
+
return `Property "${a}" type "${i}" does not match expected ${n}`;
|
|
1305
|
+
case "PROPERTY_OUT_OF_BOUNDS":
|
|
1306
|
+
return `Property "${a}" value ${i} is out of bounds ${n}`;
|
|
1307
|
+
case "CLASSIFICATION_MISSING":
|
|
1308
|
+
return "No classification found";
|
|
1309
|
+
case "CLASSIFICATION_SYSTEM_MISMATCH":
|
|
1310
|
+
return `Classification system "${i}" does not match expected ${n}`;
|
|
1311
|
+
case "CLASSIFICATION_VALUE_MISMATCH":
|
|
1312
|
+
return `Classification value "${i}" does not match expected ${n}`;
|
|
1313
|
+
case "MATERIAL_MISSING":
|
|
1314
|
+
return "No material assigned";
|
|
1315
|
+
case "MATERIAL_VALUE_MISMATCH":
|
|
1316
|
+
return `Material "${i}" does not match expected ${n}`;
|
|
1317
|
+
case "PARTOF_RELATION_MISSING":
|
|
1318
|
+
return `Not ${a} any entity`;
|
|
1319
|
+
case "PARTOF_ENTITY_MISMATCH":
|
|
1320
|
+
return `Parent entity "${i}" does not match expected ${n}`;
|
|
1321
|
+
case "PARTOF_PREDEFINED_TYPE_MISSING":
|
|
1322
|
+
return `Parent entity predefined type is missing, expected ${n}`;
|
|
1323
|
+
case "PARTOF_PREDEFINED_TYPE_MISMATCH":
|
|
1324
|
+
return `Parent entity predefined type "${i}" does not match expected ${n}`;
|
|
1325
|
+
default:
|
|
1326
|
+
return `Validation failed: ${t}`;
|
|
1327
|
+
}
|
|
1328
|
+
}
|
|
1329
|
+
function Mt(e) {
|
|
1330
|
+
const t = e.facet, a = e.optionality;
|
|
1331
|
+
let i;
|
|
1332
|
+
switch(t.type){
|
|
1333
|
+
case "entity":
|
|
1334
|
+
i = `Must be ${p(t.name)}`, t.predefinedType && (i += ` with predefinedType ${p(t.predefinedType)}`);
|
|
1335
|
+
break;
|
|
1336
|
+
case "attribute":
|
|
1337
|
+
t.value ? i = `Attribute "${p(t.name)}" must equal ${p(t.value)}` : i = `Attribute "${p(t.name)}" must exist`;
|
|
1338
|
+
break;
|
|
1339
|
+
case "property":
|
|
1340
|
+
t.value ? i = `Property "${p(t.propertySet)}.${p(t.baseName)}" must equal ${p(t.value)}` : i = `Property "${p(t.propertySet)}.${p(t.baseName)}" must exist`;
|
|
1341
|
+
break;
|
|
1342
|
+
case "classification":
|
|
1343
|
+
t.system && t.value ? i = `Must have classification ${p(t.value)} in ${p(t.system)}` : t.system ? i = `Must be classified in ${p(t.system)}` : t.value ? i = `Must have classification ${p(t.value)}` : i = "Must have a classification";
|
|
1344
|
+
break;
|
|
1345
|
+
case "material":
|
|
1346
|
+
t.value ? i = `Must have material ${p(t.value)}` : i = "Must have a material assigned";
|
|
1347
|
+
break;
|
|
1348
|
+
case "partOf":
|
|
1349
|
+
{
|
|
1350
|
+
const n = t.relation.replace("IfcRel", "").toLowerCase();
|
|
1351
|
+
t.entity ? i = `Must be ${n} ${p(t.entity.name)}` : i = `Must be ${n} some entity`;
|
|
1352
|
+
break;
|
|
1353
|
+
}
|
|
1354
|
+
default:
|
|
1355
|
+
i = "Unknown requirement";
|
|
1356
|
+
}
|
|
1357
|
+
return a === "prohibited" ? i = i.replace("Must", "Must NOT").replace("must", "must NOT") : a === "optional" && (i = i.replace("Must", "Should").replace("must", "should")), i;
|
|
1358
|
+
}
|
|
1359
|
+
function Nt(e) {
|
|
1360
|
+
if (/\[[^\]]*-\[/.test(e)) return {
|
|
1361
|
+
pattern: e,
|
|
1362
|
+
supported: !1,
|
|
1363
|
+
reason: "XSD character-class subtraction is not supported in JS regex"
|
|
1364
|
+
};
|
|
1365
|
+
let t = "", a = 0;
|
|
1366
|
+
for(; a < e.length;){
|
|
1367
|
+
const i = e.charAt(a);
|
|
1368
|
+
if (i === "\\" && a + 1 < e.length) {
|
|
1369
|
+
const n = e.charAt(a + 1), r = _t(n);
|
|
1370
|
+
if (r) {
|
|
1371
|
+
t += r, a += 2;
|
|
1372
|
+
continue;
|
|
1373
|
+
}
|
|
1374
|
+
t += i + n, a += 2;
|
|
1375
|
+
continue;
|
|
1376
|
+
}
|
|
1377
|
+
t += i, a++;
|
|
1378
|
+
}
|
|
1379
|
+
return {
|
|
1380
|
+
pattern: t,
|
|
1381
|
+
supported: !0,
|
|
1382
|
+
reason: ""
|
|
1383
|
+
};
|
|
1384
|
+
}
|
|
1385
|
+
function _t(e) {
|
|
1386
|
+
switch(e){
|
|
1387
|
+
case "i":
|
|
1388
|
+
return "[\\p{L}_:]";
|
|
1389
|
+
case "I":
|
|
1390
|
+
return "[^\\p{L}_:]";
|
|
1391
|
+
case "c":
|
|
1392
|
+
return "[\\p{L}\\p{Nd}_:.\\-\\u00B7\\u0300-\\u036F\\u203F-\\u2040]";
|
|
1393
|
+
case "C":
|
|
1394
|
+
return "[^\\p{L}\\p{Nd}_:.\\-\\u00B7\\u0300-\\u036F\\u203F-\\u2040]";
|
|
1395
|
+
case "d":
|
|
1396
|
+
return "\\p{Nd}";
|
|
1397
|
+
case "D":
|
|
1398
|
+
return "\\P{Nd}";
|
|
1399
|
+
case "w":
|
|
1400
|
+
return "[\\p{L}\\p{Nd}]";
|
|
1401
|
+
case "W":
|
|
1402
|
+
return "[^\\p{L}\\p{Nd}]";
|
|
1403
|
+
default:
|
|
1404
|
+
return;
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
function Pt(e) {
|
|
1408
|
+
if (e === "") return {
|
|
1409
|
+
ok: !1,
|
|
1410
|
+
severity: "error",
|
|
1411
|
+
reason: "pattern is empty"
|
|
1412
|
+
};
|
|
1413
|
+
const t = Nt(e);
|
|
1414
|
+
if (!t.supported) return {
|
|
1415
|
+
ok: !1,
|
|
1416
|
+
severity: "warning",
|
|
1417
|
+
reason: t.reason
|
|
1418
|
+
};
|
|
1419
|
+
try {
|
|
1420
|
+
return new RegExp(t.pattern, "u"), {
|
|
1421
|
+
ok: !0,
|
|
1422
|
+
jsPattern: t.pattern
|
|
1423
|
+
};
|
|
1424
|
+
} catch (a) {
|
|
1425
|
+
return {
|
|
1426
|
+
ok: !1,
|
|
1427
|
+
severity: "error",
|
|
1428
|
+
reason: a instanceof Error ? a.message : String(a)
|
|
1429
|
+
};
|
|
1430
|
+
}
|
|
1431
|
+
}
|
|
1432
|
+
function $t(e) {
|
|
1433
|
+
const t = [];
|
|
1434
|
+
return e.specifications.forEach((a, i)=>{
|
|
1435
|
+
wt(a, `specifications[${i}]`, t);
|
|
1436
|
+
}), t;
|
|
1437
|
+
}
|
|
1438
|
+
function wt(e, t, a) {
|
|
1439
|
+
const i = e.minOccurs, n = e.maxOccurs;
|
|
1440
|
+
i !== void 0 && (!Number.isInteger(i) || i < 0) && a.push({
|
|
1441
|
+
severity: "error",
|
|
1442
|
+
code: "E_CARDINALITY_INVALID",
|
|
1443
|
+
message: `minOccurs must be a non-negative integer; got ${i}`,
|
|
1444
|
+
path: `${t}.minOccurs`,
|
|
1445
|
+
detail: {
|
|
1446
|
+
value: String(i)
|
|
1447
|
+
}
|
|
1448
|
+
}), n !== void 0 && n !== "unbounded" && (!Number.isInteger(n) || n < 0) && a.push({
|
|
1449
|
+
severity: "error",
|
|
1450
|
+
code: "E_CARDINALITY_INVALID",
|
|
1451
|
+
message: `maxOccurs must be a non-negative integer or "unbounded"; got ${n}`,
|
|
1452
|
+
path: `${t}.maxOccurs`,
|
|
1453
|
+
detail: {
|
|
1454
|
+
value: String(n)
|
|
1455
|
+
}
|
|
1456
|
+
}), typeof i == "number" && typeof n == "number" && i > n && a.push({
|
|
1457
|
+
severity: "error",
|
|
1458
|
+
code: "E_CARDINALITY_INVALID",
|
|
1459
|
+
message: `minOccurs (${i}) is greater than maxOccurs (${n})`,
|
|
1460
|
+
path: `${t}.minOccurs`,
|
|
1461
|
+
detail: {
|
|
1462
|
+
min: i,
|
|
1463
|
+
max: n
|
|
1464
|
+
}
|
|
1465
|
+
}), e.applicability.cardinality && a.push({
|
|
1466
|
+
severity: "warning",
|
|
1467
|
+
code: "W_CARDINALITY_PROHIBITED_APPLICABILITY",
|
|
1468
|
+
message: `cardinality="${e.applicability.cardinality}" has no effect on <applicability>`,
|
|
1469
|
+
path: `${t}.applicability.cardinality`
|
|
1470
|
+
}), e.applicability.facets.forEach((r, s)=>{
|
|
1471
|
+
k(r, `${t}.applicability.facets[${s}]`, a);
|
|
1472
|
+
}), e.requirements.forEach((r, s)=>{
|
|
1473
|
+
k(r.facet, `${t}.requirements[${s}]`, a), Ft(r, `${t}.requirements[${s}]`, a);
|
|
1474
|
+
});
|
|
1475
|
+
}
|
|
1476
|
+
function Ft(e, t, a) {
|
|
1477
|
+
switch(e.cardinalityRaw !== void 0 && a.push({
|
|
1478
|
+
severity: "error",
|
|
1479
|
+
code: "E_CARDINALITY_INVALID",
|
|
1480
|
+
message: `@cardinality="${e.cardinalityRaw}" is not a valid value; expected one of {required, optional, prohibited}`,
|
|
1481
|
+
path: `${t}.cardinality`,
|
|
1482
|
+
facetType: e.facet.type,
|
|
1483
|
+
detail: {
|
|
1484
|
+
value: e.cardinalityRaw
|
|
1485
|
+
}
|
|
1486
|
+
}), e.facet.type){
|
|
1487
|
+
case "property":
|
|
1488
|
+
{
|
|
1489
|
+
const i = e.facet.dataType !== void 0;
|
|
1490
|
+
e.optionality === "optional" && !i && a.push({
|
|
1491
|
+
severity: "error",
|
|
1492
|
+
code: "E_CARDINALITY_INVALID",
|
|
1493
|
+
message: "optional <property> requirement requires @dataType to be specified",
|
|
1494
|
+
path: `${t}.cardinality`,
|
|
1495
|
+
facetType: "property"
|
|
1496
|
+
}), e.optionality === "prohibited" && i && a.push({
|
|
1497
|
+
severity: "error",
|
|
1498
|
+
code: "E_CARDINALITY_INVALID",
|
|
1499
|
+
message: "prohibited <property> requirement is incompatible with @dataType",
|
|
1500
|
+
path: `${t}.cardinality`,
|
|
1501
|
+
facetType: "property"
|
|
1502
|
+
});
|
|
1503
|
+
break;
|
|
1504
|
+
}
|
|
1505
|
+
case "material":
|
|
1506
|
+
{
|
|
1507
|
+
e.optionality === "optional" && (e.facet.value !== void 0 && !D(e.facet.value) || a.push({
|
|
1508
|
+
severity: "error",
|
|
1509
|
+
code: "E_CARDINALITY_INVALID",
|
|
1510
|
+
message: "optional <material> requirement must specify a non-empty <value> constraint",
|
|
1511
|
+
path: `${t}.cardinality`,
|
|
1512
|
+
facetType: "material"
|
|
1513
|
+
}));
|
|
1514
|
+
break;
|
|
1515
|
+
}
|
|
1516
|
+
case "classification":
|
|
1517
|
+
{
|
|
1518
|
+
if (e.optionality === "optional") {
|
|
1519
|
+
const i = e.facet.system !== void 0 && !D(e.facet.system), n = e.facet.value !== void 0 && !D(e.facet.value);
|
|
1520
|
+
!i && !n && a.push({
|
|
1521
|
+
severity: "error",
|
|
1522
|
+
code: "E_CARDINALITY_INVALID",
|
|
1523
|
+
message: "optional <classification> requirement must specify <system> or <value>",
|
|
1524
|
+
path: `${t}.cardinality`,
|
|
1525
|
+
facetType: "classification"
|
|
1526
|
+
});
|
|
1527
|
+
}
|
|
1528
|
+
break;
|
|
1529
|
+
}
|
|
1530
|
+
}
|
|
1531
|
+
}
|
|
1532
|
+
function D(e) {
|
|
1533
|
+
switch(e.type){
|
|
1534
|
+
case "simpleValue":
|
|
1535
|
+
return e.value === "" || e.value == null;
|
|
1536
|
+
case "enumeration":
|
|
1537
|
+
return e.values.length === 0;
|
|
1538
|
+
case "pattern":
|
|
1539
|
+
return e.pattern === "";
|
|
1540
|
+
case "bounds":
|
|
1541
|
+
return e.minInclusive === void 0 && e.maxInclusive === void 0 && e.minExclusive === void 0 && e.maxExclusive === void 0 && e.length === void 0 && e.minLength === void 0 && e.maxLength === void 0;
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1544
|
+
function k(e, t, a) {
|
|
1545
|
+
switch(e.type){
|
|
1546
|
+
case "entity":
|
|
1547
|
+
E(e.name, `${t}.name`, a, e.type), e.predefinedType && E(e.predefinedType, `${t}.predefinedType`, a, e.type);
|
|
1548
|
+
break;
|
|
1549
|
+
case "attribute":
|
|
1550
|
+
E(e.name, `${t}.name`, a, e.type), e.value && E(e.value, `${t}.value`, a, e.type);
|
|
1551
|
+
break;
|
|
1552
|
+
case "property":
|
|
1553
|
+
E(e.propertySet, `${t}.propertySet`, a, e.type), E(e.baseName, `${t}.baseName`, a, e.type), e.dataType && E(e.dataType, `${t}.dataType`, a, e.type), e.value && E(e.value, `${t}.value`, a, e.type);
|
|
1554
|
+
break;
|
|
1555
|
+
case "classification":
|
|
1556
|
+
e.system && E(e.system, `${t}.system`, a, e.type), e.value && E(e.value, `${t}.value`, a, e.type);
|
|
1557
|
+
break;
|
|
1558
|
+
case "material":
|
|
1559
|
+
e.value && E(e.value, `${t}.value`, a, e.type);
|
|
1560
|
+
break;
|
|
1561
|
+
case "partOf":
|
|
1562
|
+
e.entity && k(e.entity, `${t}.entity`, a);
|
|
1563
|
+
break;
|
|
1564
|
+
}
|
|
1565
|
+
}
|
|
1566
|
+
function E(e, t, a, i) {
|
|
1567
|
+
switch(e.type){
|
|
1568
|
+
case "enumeration":
|
|
1569
|
+
if (e.values.length === 0 ? a.push({
|
|
1570
|
+
severity: "error",
|
|
1571
|
+
code: "E_RESTRICTION_EMPTY",
|
|
1572
|
+
message: "xs:enumeration must have at least one value",
|
|
1573
|
+
path: t,
|
|
1574
|
+
facetType: i
|
|
1575
|
+
}) : e.values.some((n)=>n === "" || n == null) && a.push({
|
|
1576
|
+
severity: "warning",
|
|
1577
|
+
code: "E_RESTRICTION_EMPTY",
|
|
1578
|
+
message: "xs:enumeration has an empty entry",
|
|
1579
|
+
path: t,
|
|
1580
|
+
facetType: i
|
|
1581
|
+
}), e.base) for (const n of e.values)n == null || n === "" || Dt(n, e.base) || a.push({
|
|
1582
|
+
severity: "error",
|
|
1583
|
+
code: "E_RESTRICTION_VALUE_MISMATCH",
|
|
1584
|
+
message: `xs:enumeration value "${n}" is not valid for xs:restriction @base="${e.base}"`,
|
|
1585
|
+
path: t,
|
|
1586
|
+
facetType: i,
|
|
1587
|
+
detail: {
|
|
1588
|
+
value: n,
|
|
1589
|
+
base: e.base
|
|
1590
|
+
}
|
|
1591
|
+
});
|
|
1592
|
+
break;
|
|
1593
|
+
case "bounds":
|
|
1594
|
+
Ot(e, t, a, i);
|
|
1595
|
+
break;
|
|
1596
|
+
case "pattern":
|
|
1597
|
+
Lt(e.pattern, t, a, i);
|
|
1598
|
+
break;
|
|
1599
|
+
}
|
|
1600
|
+
}
|
|
1601
|
+
function Ot(e, t, a, i) {
|
|
1602
|
+
const n = e.minInclusive ?? e.minExclusive, r = e.maxInclusive ?? e.maxExclusive;
|
|
1603
|
+
typeof n == "number" && typeof r == "number" && n > r && a.push({
|
|
1604
|
+
severity: "error",
|
|
1605
|
+
code: "E_RESTRICTION_RANGE",
|
|
1606
|
+
message: `xs:restriction bounds inverted: lower (${n}) > upper (${r})`,
|
|
1607
|
+
path: t,
|
|
1608
|
+
facetType: i,
|
|
1609
|
+
detail: {
|
|
1610
|
+
min: n,
|
|
1611
|
+
max: r
|
|
1612
|
+
}
|
|
1613
|
+
}), typeof e.minLength == "number" && typeof e.maxLength == "number" && e.minLength > e.maxLength && a.push({
|
|
1614
|
+
severity: "error",
|
|
1615
|
+
code: "E_RESTRICTION_RANGE",
|
|
1616
|
+
message: `xs:restriction lengths inverted: minLength (${e.minLength}) > maxLength (${e.maxLength})`,
|
|
1617
|
+
path: t,
|
|
1618
|
+
facetType: i,
|
|
1619
|
+
detail: {
|
|
1620
|
+
min: e.minLength,
|
|
1621
|
+
max: e.maxLength
|
|
1622
|
+
}
|
|
1623
|
+
}), typeof e.length == "number" && (typeof e.minLength == "number" || typeof e.maxLength == "number") && a.push({
|
|
1624
|
+
severity: "warning",
|
|
1625
|
+
code: "E_RESTRICTION_RANGE",
|
|
1626
|
+
message: "xs:length is mutually exclusive with xs:minLength/xs:maxLength",
|
|
1627
|
+
path: t,
|
|
1628
|
+
facetType: i
|
|
1629
|
+
}), e.minInclusive === void 0 && e.minExclusive === void 0 && e.maxInclusive === void 0 && e.maxExclusive === void 0 && e.length === void 0 && e.minLength === void 0 && e.maxLength === void 0 && a.push({
|
|
1630
|
+
severity: "error",
|
|
1631
|
+
code: "E_RESTRICTION_EMPTY",
|
|
1632
|
+
message: "xs:restriction has no min/max bounds or length facets",
|
|
1633
|
+
path: t,
|
|
1634
|
+
facetType: i
|
|
1635
|
+
});
|
|
1636
|
+
}
|
|
1637
|
+
function Lt(e, t, a, i) {
|
|
1638
|
+
const n = Pt(e);
|
|
1639
|
+
if (!n.ok) {
|
|
1640
|
+
if (n.severity === "error") {
|
|
1641
|
+
a.push({
|
|
1642
|
+
severity: "error",
|
|
1643
|
+
code: "E_RESTRICTION_EMPTY",
|
|
1644
|
+
message: e === "" ? "xs:pattern @value is empty" : `xs:pattern is not a valid regular expression: ${n.reason}`,
|
|
1645
|
+
path: t,
|
|
1646
|
+
facetType: i,
|
|
1647
|
+
detail: e === "" ? void 0 : {
|
|
1648
|
+
pattern: e
|
|
1649
|
+
}
|
|
1650
|
+
});
|
|
1651
|
+
return;
|
|
1652
|
+
}
|
|
1653
|
+
a.push({
|
|
1654
|
+
severity: "warning",
|
|
1655
|
+
code: "W_REGEX_UNVERIFIED",
|
|
1656
|
+
message: `xs:pattern uses XSD-specific syntax not verifiable in JS: ${n.reason}`,
|
|
1657
|
+
path: t,
|
|
1658
|
+
facetType: i,
|
|
1659
|
+
detail: {
|
|
1660
|
+
pattern: e
|
|
1661
|
+
}
|
|
1662
|
+
});
|
|
1663
|
+
}
|
|
1664
|
+
}
|
|
1665
|
+
const Vt = {
|
|
1666
|
+
"xs:integer": /^[+-]?(\d+)$/,
|
|
1667
|
+
"xs:double": /^([-+]?[0-9]*\.?[0-9]*([eE][-+]?[0-9]+)?|NaN|\+INF|-INF)$/,
|
|
1668
|
+
"xs:float": /^([-+]?[0-9]*\.?[0-9]*([eE][-+]?[0-9]+)?|NaN|\+INF|-INF)$/,
|
|
1669
|
+
"xs:decimal": /^([-+]?[0-9]*\.?[0-9]*([eE][-+]?[0-9]+)?|NaN|\+INF|-INF)$/,
|
|
1670
|
+
"xs:boolean": /^(true|false|0|1)$/,
|
|
1671
|
+
"xs:date": /^\d{4}-\d{2}-\d{2}(Z|([+-]\d{2}:\d{2}))?$/,
|
|
1672
|
+
"xs:dateTime": /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|([+-]\d{2}:\d{2}))?$/,
|
|
1673
|
+
"xs:time": /^\d{2}:\d{2}:\d{2}(\.\d+)?(Z|([+-]\d{2}:\d{2}))?$/,
|
|
1674
|
+
"xs:duration": /^[-+]?P(\d+Y)?(\d+M)?(\d+D)?(T(\d+H)?(\d+M)?(\d+S)?)?$/
|
|
1675
|
+
};
|
|
1676
|
+
function Dt(e, t) {
|
|
1677
|
+
const a = Vt[t];
|
|
1678
|
+
return a ? (t === "xs:double" || t === "xs:float" || t === "xs:decimal") && !/[0-9]/.test(e) ? !1 : a.test(e) : !0;
|
|
1679
|
+
}
|
|
1680
|
+
async function Ut(e, t) {
|
|
1681
|
+
const a = [];
|
|
1682
|
+
for(let i = 0; i < e.specifications.length; i++){
|
|
1683
|
+
const n = e.specifications[i], r = kt(n, t.ifcVersion);
|
|
1684
|
+
if (r.length === 0) continue;
|
|
1685
|
+
const s = new Set;
|
|
1686
|
+
for (const l of r){
|
|
1687
|
+
const o = [];
|
|
1688
|
+
await Bt(n, l, `specifications[${i}]`, o);
|
|
1689
|
+
for (const u of o){
|
|
1690
|
+
const c = `${u.code}|${u.path}|${u.message}`;
|
|
1691
|
+
s.has(c) || (s.add(c), a.push(u));
|
|
1692
|
+
}
|
|
1693
|
+
}
|
|
1694
|
+
}
|
|
1695
|
+
return a;
|
|
1696
|
+
}
|
|
1697
|
+
function kt(e, t) {
|
|
1698
|
+
if (t) {
|
|
1699
|
+
const n = G(t);
|
|
1700
|
+
return n ? [
|
|
1701
|
+
n
|
|
1702
|
+
] : [];
|
|
1703
|
+
}
|
|
1704
|
+
const a = [], i = new Set;
|
|
1705
|
+
for (const n of e.ifcVersions){
|
|
1706
|
+
const r = G(n);
|
|
1707
|
+
r && !i.has(r) && (i.add(r), a.push(r));
|
|
1708
|
+
}
|
|
1709
|
+
return a;
|
|
1710
|
+
}
|
|
1711
|
+
function G(e) {
|
|
1712
|
+
switch(e){
|
|
1713
|
+
case "IFC2X3":
|
|
1714
|
+
case "IFC4":
|
|
1715
|
+
case "IFC4X3":
|
|
1716
|
+
case "IFC4X3_ADD2":
|
|
1717
|
+
return e;
|
|
1718
|
+
default:
|
|
1719
|
+
return;
|
|
1720
|
+
}
|
|
1721
|
+
}
|
|
1722
|
+
async function Bt(e, t, a, i) {
|
|
1723
|
+
const n = e.applicability.facets.find((r)=>r.type === "entity");
|
|
1724
|
+
for(let r = 0; r < e.applicability.facets.length; r++){
|
|
1725
|
+
const s = e.applicability.facets[r];
|
|
1726
|
+
await j(s, t, `${a}.applicability.facets[${r}]`, n, i);
|
|
1727
|
+
}
|
|
1728
|
+
for(let r = 0; r < e.requirements.length; r++){
|
|
1729
|
+
const s = e.requirements[r];
|
|
1730
|
+
await j(s.facet, t, `${a}.requirements[${r}]`, n, i);
|
|
1731
|
+
}
|
|
1732
|
+
}
|
|
1733
|
+
async function j(e, t, a, i, n) {
|
|
1734
|
+
switch(e.type){
|
|
1735
|
+
case "entity":
|
|
1736
|
+
await Ht(e, t, a, n);
|
|
1737
|
+
break;
|
|
1738
|
+
case "property":
|
|
1739
|
+
await Gt(e, t, a, i, n);
|
|
1740
|
+
break;
|
|
1741
|
+
case "attribute":
|
|
1742
|
+
await Zt(e, t, a, i, n);
|
|
1743
|
+
break;
|
|
1744
|
+
case "partOf":
|
|
1745
|
+
await ti(e, t, a, i, n);
|
|
1746
|
+
break;
|
|
1747
|
+
case "classification":
|
|
1748
|
+
await qt(t, i, a, n);
|
|
1749
|
+
break;
|
|
1750
|
+
case "material":
|
|
1751
|
+
await Yt(t, i, a, n);
|
|
1752
|
+
break;
|
|
1753
|
+
}
|
|
1754
|
+
}
|
|
1755
|
+
async function qt(e, t, a, i) {
|
|
1756
|
+
if (!t || t.name.type !== "simpleValue") return;
|
|
1757
|
+
const n = t.name.value;
|
|
1758
|
+
if (!n) return;
|
|
1759
|
+
const r = e === "IFC2X3" ? "IfcRoot" : "IfcObjectDefinition";
|
|
1760
|
+
await $(e, n, r) || i.push({
|
|
1761
|
+
severity: "error",
|
|
1762
|
+
code: "E_IFC_PARTOF_ENTITY",
|
|
1763
|
+
message: `applicability entity "${n}" cannot be classified in ${e} (must be a subtype of ${r})`,
|
|
1764
|
+
path: a,
|
|
1765
|
+
facetType: "classification",
|
|
1766
|
+
detail: {
|
|
1767
|
+
value: n,
|
|
1768
|
+
required: r,
|
|
1769
|
+
version: e
|
|
1770
|
+
}
|
|
1771
|
+
});
|
|
1772
|
+
}
|
|
1773
|
+
async function Yt(e, t, a, i) {
|
|
1774
|
+
if (!t || t.name.type !== "simpleValue") return;
|
|
1775
|
+
const n = t.name.value;
|
|
1776
|
+
if (!n) return;
|
|
1777
|
+
const r = e === "IFC2X3" ? "IfcRoot" : "IfcObjectDefinition";
|
|
1778
|
+
await $(e, n, r) || i.push({
|
|
1779
|
+
severity: "error",
|
|
1780
|
+
code: "E_IFC_PARTOF_ENTITY",
|
|
1781
|
+
message: `applicability entity "${n}" cannot have a material in ${e} (must be a subtype of ${r})`,
|
|
1782
|
+
path: a,
|
|
1783
|
+
facetType: "material",
|
|
1784
|
+
detail: {
|
|
1785
|
+
value: n,
|
|
1786
|
+
required: r,
|
|
1787
|
+
version: e
|
|
1788
|
+
}
|
|
1789
|
+
});
|
|
1790
|
+
}
|
|
1791
|
+
async function Ht(e, t, a, i) {
|
|
1792
|
+
if (e.name.type !== "simpleValue") return;
|
|
1793
|
+
const n = e.name.value;
|
|
1794
|
+
if (!n) return;
|
|
1795
|
+
const r = await J(t, n);
|
|
1796
|
+
if (!r) {
|
|
1797
|
+
i.push({
|
|
1798
|
+
severity: "error",
|
|
1799
|
+
code: "E_IFC_ENTITY_UNKNOWN",
|
|
1800
|
+
message: `entity name "${n}" is not a known IFC entity for ${t}`,
|
|
1801
|
+
path: `${a}.name`,
|
|
1802
|
+
facetType: "entity",
|
|
1803
|
+
detail: {
|
|
1804
|
+
value: n,
|
|
1805
|
+
version: t
|
|
1806
|
+
}
|
|
1807
|
+
});
|
|
1808
|
+
return;
|
|
1809
|
+
}
|
|
1810
|
+
e.predefinedType && r.predefinedTypes.length > 0 && Xt(e.predefinedType, r, t, `${a}.predefinedType`, i);
|
|
1811
|
+
}
|
|
1812
|
+
function Xt(e, t, a, i, n) {
|
|
1813
|
+
const r = (s)=>t.predefinedTypes.includes(s.toUpperCase());
|
|
1814
|
+
switch(e.type){
|
|
1815
|
+
case "simpleValue":
|
|
1816
|
+
{
|
|
1817
|
+
const s = e.value;
|
|
1818
|
+
s && !r(s) && n.push({
|
|
1819
|
+
severity: "error",
|
|
1820
|
+
code: "E_IFC_PREDEF_TYPE_INVALID",
|
|
1821
|
+
message: `predefined type "${s}" is not valid for ${t.name} (${a})`,
|
|
1822
|
+
path: i,
|
|
1823
|
+
facetType: "entity",
|
|
1824
|
+
detail: {
|
|
1825
|
+
value: s,
|
|
1826
|
+
entity: t.name,
|
|
1827
|
+
version: a
|
|
1828
|
+
}
|
|
1829
|
+
});
|
|
1830
|
+
break;
|
|
1831
|
+
}
|
|
1832
|
+
case "enumeration":
|
|
1833
|
+
{
|
|
1834
|
+
for (const s of e.values)s && !r(s) && n.push({
|
|
1835
|
+
severity: "error",
|
|
1836
|
+
code: "E_IFC_PREDEF_TYPE_INVALID",
|
|
1837
|
+
message: `predefined type enumeration value "${s}" is not valid for ${t.name} (${a})`,
|
|
1838
|
+
path: i,
|
|
1839
|
+
facetType: "entity",
|
|
1840
|
+
detail: {
|
|
1841
|
+
value: s,
|
|
1842
|
+
entity: t.name,
|
|
1843
|
+
version: a
|
|
1844
|
+
}
|
|
1845
|
+
});
|
|
1846
|
+
break;
|
|
1847
|
+
}
|
|
1848
|
+
case "pattern":
|
|
1849
|
+
{
|
|
1850
|
+
try {
|
|
1851
|
+
const s = new RegExp(`^${e.pattern}$`);
|
|
1852
|
+
t.predefinedTypes.some((o)=>s.test(o)) || n.push({
|
|
1853
|
+
severity: "error",
|
|
1854
|
+
code: "E_IFC_PREDEF_TYPE_INVALID",
|
|
1855
|
+
message: `predefined type pattern "${e.pattern}" matches no value for ${t.name} (${a})`,
|
|
1856
|
+
path: i,
|
|
1857
|
+
facetType: "entity",
|
|
1858
|
+
detail: {
|
|
1859
|
+
pattern: e.pattern,
|
|
1860
|
+
entity: t.name,
|
|
1861
|
+
version: a
|
|
1862
|
+
}
|
|
1863
|
+
});
|
|
1864
|
+
} catch {}
|
|
1865
|
+
break;
|
|
1866
|
+
}
|
|
1867
|
+
}
|
|
1868
|
+
}
|
|
1869
|
+
async function Gt(e, t, a, i, n) {
|
|
1870
|
+
if (e.dataType && e.dataType.type === "simpleValue") {
|
|
1871
|
+
const o = e.dataType.value;
|
|
1872
|
+
if (o) {
|
|
1873
|
+
const u = await ve(t, o);
|
|
1874
|
+
u ? e.value && Wt(e.value, u.backingType, o, `${a}.value`, n) : n.push({
|
|
1875
|
+
severity: "error",
|
|
1876
|
+
code: "E_IFC_DATATYPE_UNKNOWN",
|
|
1877
|
+
message: `dataType "${o}" is not a known IFC measure/type for ${t}`,
|
|
1878
|
+
path: `${a}.dataType`,
|
|
1879
|
+
facetType: "property",
|
|
1880
|
+
detail: {
|
|
1881
|
+
value: o,
|
|
1882
|
+
version: t
|
|
1883
|
+
}
|
|
1884
|
+
});
|
|
1885
|
+
}
|
|
1886
|
+
}
|
|
1887
|
+
if (e.propertySet.type !== "simpleValue") return;
|
|
1888
|
+
const r = e.propertySet.value;
|
|
1889
|
+
if (!r) return;
|
|
1890
|
+
const s = await Ee(t, r), l = Te.some((o)=>r.startsWith(o));
|
|
1891
|
+
if (!s) {
|
|
1892
|
+
l && n.push({
|
|
1893
|
+
severity: "warning",
|
|
1894
|
+
code: "W_IFC_PSET_RESERVED_PREFIX",
|
|
1895
|
+
message: `property set "${r}" uses a reserved buildingSMART prefix but is not a known standard ${r.startsWith("Qto_") ? "quantity set" : "pset"} for ${t}`,
|
|
1896
|
+
path: `${a}.propertySet`,
|
|
1897
|
+
facetType: "property",
|
|
1898
|
+
detail: {
|
|
1899
|
+
value: r,
|
|
1900
|
+
version: t
|
|
1901
|
+
}
|
|
1902
|
+
});
|
|
1903
|
+
return;
|
|
1904
|
+
}
|
|
1905
|
+
if (i && s.applicableEntities.length > 0) {
|
|
1906
|
+
const o = await Jt(i, t);
|
|
1907
|
+
if (o.length > 0 && !(await Promise.all(o.map((c)=>Qt(t, c, s.applicableEntities)))).some(Boolean)) {
|
|
1908
|
+
const c = o.length === 1 ? o[0] : `{${o.join(", ")}}`;
|
|
1909
|
+
n.push({
|
|
1910
|
+
severity: "error",
|
|
1911
|
+
code: "E_IFC_PROP_NOT_IN_PSET",
|
|
1912
|
+
message: `${s.name} is not applicable to ${c} in ${t}`,
|
|
1913
|
+
path: `${a}.propertySet`,
|
|
1914
|
+
facetType: "property",
|
|
1915
|
+
detail: {
|
|
1916
|
+
pset: s.name,
|
|
1917
|
+
entity: c,
|
|
1918
|
+
version: t
|
|
1919
|
+
}
|
|
1920
|
+
});
|
|
1921
|
+
}
|
|
1922
|
+
}
|
|
1923
|
+
if (e.baseName.type === "simpleValue") {
|
|
1924
|
+
const o = e.baseName.value;
|
|
1925
|
+
if (o) {
|
|
1926
|
+
const u = s.properties.find((c)=>c.name === o);
|
|
1927
|
+
u ? e.dataType && e.dataType.type === "simpleValue" && e.dataType.value && jt(u, e.dataType.value, a, s.name, o, n) : n.push({
|
|
1928
|
+
severity: "error",
|
|
1929
|
+
code: "E_IFC_PROP_NOT_IN_PSET",
|
|
1930
|
+
message: `property "${o}" is not part of ${s.name} (${t})`,
|
|
1931
|
+
path: `${a}.baseName`,
|
|
1932
|
+
facetType: "property",
|
|
1933
|
+
detail: {
|
|
1934
|
+
property: o,
|
|
1935
|
+
pset: s.name,
|
|
1936
|
+
version: t
|
|
1937
|
+
}
|
|
1938
|
+
});
|
|
1939
|
+
}
|
|
1940
|
+
}
|
|
1941
|
+
}
|
|
1942
|
+
function jt(e, t, a, i, n, r) {
|
|
1943
|
+
const s = t.toUpperCase();
|
|
1944
|
+
if (e.dataType && e.dataType.toUpperCase() === s) return;
|
|
1945
|
+
const l = Kt(e.kind);
|
|
1946
|
+
l && s === l || r.push({
|
|
1947
|
+
severity: "error",
|
|
1948
|
+
code: "W_IFC_DATATYPE_MISMATCH",
|
|
1949
|
+
message: `${i}.${n} is typed ${e.dataType ?? e.kind} in the standard, not ${t}`,
|
|
1950
|
+
path: `${a}.dataType`,
|
|
1951
|
+
facetType: "property",
|
|
1952
|
+
detail: {
|
|
1953
|
+
expected: e.dataType ?? e.kind,
|
|
1954
|
+
actual: t,
|
|
1955
|
+
property: n
|
|
1956
|
+
}
|
|
1957
|
+
});
|
|
1958
|
+
}
|
|
1959
|
+
function Wt(e, t, a, i, n) {
|
|
1960
|
+
if (e.type === "simpleValue") return;
|
|
1961
|
+
const r = e.type === "pattern" || e.type === "enumeration" || e.type === "bounds" ? e.base : void 0;
|
|
1962
|
+
let s;
|
|
1963
|
+
if (r) s = r;
|
|
1964
|
+
else switch(e.type){
|
|
1965
|
+
case "pattern":
|
|
1966
|
+
case "enumeration":
|
|
1967
|
+
s = "xs:string";
|
|
1968
|
+
break;
|
|
1969
|
+
case "bounds":
|
|
1970
|
+
typeof e.length == "number" || typeof e.minLength == "number" || typeof e.maxLength == "number" ? s = "xs:string" : s = "xs:double";
|
|
1971
|
+
break;
|
|
1972
|
+
}
|
|
1973
|
+
s && (zt(s, t) || n.push({
|
|
1974
|
+
severity: "error",
|
|
1975
|
+
code: "E_RESTRICTION_BASE_MISMATCH",
|
|
1976
|
+
message: `xs:restriction base (${s}) is not compatible with dataType "${a}" (backing ${t})`,
|
|
1977
|
+
path: i,
|
|
1978
|
+
facetType: "property",
|
|
1979
|
+
detail: {
|
|
1980
|
+
inferred: s,
|
|
1981
|
+
expected: t,
|
|
1982
|
+
dataType: a
|
|
1983
|
+
}
|
|
1984
|
+
}));
|
|
1985
|
+
}
|
|
1986
|
+
function zt(e, t) {
|
|
1987
|
+
if (e === t) return !0;
|
|
1988
|
+
const a = new Set([
|
|
1989
|
+
"xs:double",
|
|
1990
|
+
"xs:decimal",
|
|
1991
|
+
"xs:float"
|
|
1992
|
+
]);
|
|
1993
|
+
return !!(a.has(e) && a.has(t));
|
|
1994
|
+
}
|
|
1995
|
+
function Kt(e) {
|
|
1996
|
+
switch(e){
|
|
1997
|
+
case "single":
|
|
1998
|
+
return "IFCPROPERTYSINGLEVALUE";
|
|
1999
|
+
case "enumeration":
|
|
2000
|
+
return "IFCPROPERTYENUMERATEDVALUE";
|
|
2001
|
+
case "list":
|
|
2002
|
+
return "IFCPROPERTYLISTVALUE";
|
|
2003
|
+
case "bounded":
|
|
2004
|
+
return "IFCPROPERTYBOUNDEDVALUE";
|
|
2005
|
+
case "reference":
|
|
2006
|
+
return "IFCPROPERTYREFERENCEVALUE";
|
|
2007
|
+
default:
|
|
2008
|
+
return;
|
|
2009
|
+
}
|
|
2010
|
+
}
|
|
2011
|
+
async function Qt(e, t, a) {
|
|
2012
|
+
for (const i of a)if (await $(e, t, i)) return !0;
|
|
2013
|
+
return !1;
|
|
2014
|
+
}
|
|
2015
|
+
async function Jt(e, t) {
|
|
2016
|
+
switch(e.name.type){
|
|
2017
|
+
case "simpleValue":
|
|
2018
|
+
return e.name.value ? [
|
|
2019
|
+
e.name.value
|
|
2020
|
+
] : [];
|
|
2021
|
+
case "enumeration":
|
|
2022
|
+
return e.name.values.filter((a)=>!!a);
|
|
2023
|
+
case "pattern":
|
|
2024
|
+
try {
|
|
2025
|
+
const a = new RegExp(`^${e.name.pattern}$`), { getEntities: i } = await Ie(async ()=>{
|
|
2026
|
+
const { getEntities: r } = await import("./exporters-u0sz2Upj.js").then(async (m)=>{
|
|
2027
|
+
await m.__tla;
|
|
2028
|
+
return m;
|
|
2029
|
+
}).then((s)=>s.ao);
|
|
2030
|
+
return {
|
|
2031
|
+
getEntities: r
|
|
2032
|
+
};
|
|
2033
|
+
}, __vite__mapDeps([0,1,2,3,4,5]));
|
|
2034
|
+
return (await i(t)).filter((r)=>a.test(r.name.toUpperCase()) || a.test(r.name)).map((r)=>r.name);
|
|
2035
|
+
} catch {
|
|
2036
|
+
return [];
|
|
2037
|
+
}
|
|
2038
|
+
default:
|
|
2039
|
+
return [];
|
|
2040
|
+
}
|
|
2041
|
+
}
|
|
2042
|
+
async function Zt(e, t, a, i, n) {
|
|
2043
|
+
if (!i || i.name.type !== "simpleValue" || e.name.type !== "simpleValue") return;
|
|
2044
|
+
const r = i.name.value, s = e.name.value;
|
|
2045
|
+
if (!r || !s) return;
|
|
2046
|
+
const l = await ye(t, r);
|
|
2047
|
+
if (l.length === 0) return;
|
|
2048
|
+
if (!ei(l, s)) {
|
|
2049
|
+
n.push({
|
|
2050
|
+
severity: "error",
|
|
2051
|
+
code: "E_IFC_ATTR_UNKNOWN_FOR_ENTITY",
|
|
2052
|
+
message: `attribute "${s}" is not defined on ${l[0].name} (${t})`,
|
|
2053
|
+
path: `${a}.name`,
|
|
2054
|
+
facetType: "attribute",
|
|
2055
|
+
detail: {
|
|
2056
|
+
attribute: s,
|
|
2057
|
+
entity: l[0].name,
|
|
2058
|
+
version: t
|
|
2059
|
+
}
|
|
2060
|
+
});
|
|
2061
|
+
return;
|
|
2062
|
+
}
|
|
2063
|
+
if (e.value === void 0) return;
|
|
2064
|
+
const o = await he(t, s);
|
|
2065
|
+
if (!o) return;
|
|
2066
|
+
const u = l[0].name.toUpperCase(), c = l.map((m)=>m.name.toUpperCase()), f = c.some((m)=>o.simpleValueEntities.includes(m)), d = c.some((m)=>o.complexEntities.includes(m));
|
|
2067
|
+
!f && d && n.push({
|
|
2068
|
+
severity: "error",
|
|
2069
|
+
code: "E_IFC_ATTR_UNKNOWN_FOR_ENTITY",
|
|
2070
|
+
message: `attribute "${s}" on ${u} is a complex/entity-typed attribute and cannot carry a simple <value> constraint (${t})`,
|
|
2071
|
+
path: `${a}.value`,
|
|
2072
|
+
facetType: "attribute",
|
|
2073
|
+
detail: {
|
|
2074
|
+
attribute: s,
|
|
2075
|
+
entity: u,
|
|
2076
|
+
version: t
|
|
2077
|
+
}
|
|
2078
|
+
});
|
|
2079
|
+
}
|
|
2080
|
+
function ei(e, t) {
|
|
2081
|
+
const a = t.toLowerCase();
|
|
2082
|
+
for (const i of e)for (const n of i.attributes)if (n.toLowerCase() === a) return !0;
|
|
2083
|
+
return !1;
|
|
2084
|
+
}
|
|
2085
|
+
async function ti(e, t, a, i, n) {
|
|
2086
|
+
const r = await fe(t), s = e.rawRelation ?? e.relation, l = s.toUpperCase(), o = r.find((u)=>u.relation === l);
|
|
2087
|
+
if (!o) {
|
|
2088
|
+
n.push({
|
|
2089
|
+
severity: "error",
|
|
2090
|
+
code: "E_IFC_PARTOF_RELATION",
|
|
2091
|
+
message: `partOf relation "${s}" is not valid for ${t}`,
|
|
2092
|
+
path: `${a}.relation`,
|
|
2093
|
+
facetType: "partOf",
|
|
2094
|
+
detail: {
|
|
2095
|
+
value: s,
|
|
2096
|
+
version: t
|
|
2097
|
+
}
|
|
2098
|
+
});
|
|
2099
|
+
return;
|
|
2100
|
+
}
|
|
2101
|
+
if (e.entity && e.entity.name.type === "simpleValue" && e.entity.name.value) {
|
|
2102
|
+
const u = e.entity.name.value, c = await J(t, u);
|
|
2103
|
+
if (!c) {
|
|
2104
|
+
n.push({
|
|
2105
|
+
severity: "error",
|
|
2106
|
+
code: "E_IFC_PARTOF_ENTITY",
|
|
2107
|
+
message: `partOf entity "${u}" is not a known IFC entity for ${t}`,
|
|
2108
|
+
path: `${a}.entity.name`,
|
|
2109
|
+
facetType: "partOf",
|
|
2110
|
+
detail: {
|
|
2111
|
+
value: u,
|
|
2112
|
+
version: t
|
|
2113
|
+
}
|
|
2114
|
+
});
|
|
2115
|
+
return;
|
|
2116
|
+
}
|
|
2117
|
+
const f = o.owner;
|
|
2118
|
+
await $(t, c.name, f) || n.push({
|
|
2119
|
+
severity: "error",
|
|
2120
|
+
code: "E_IFC_PARTOF_ENTITY",
|
|
2121
|
+
message: `partOf @entity "${c.name}" is not a subtype of "${f}" required by ${e.relation} (${t})`,
|
|
2122
|
+
path: `${a}.entity.name`,
|
|
2123
|
+
facetType: "partOf",
|
|
2124
|
+
detail: {
|
|
2125
|
+
value: c.name,
|
|
2126
|
+
required: f,
|
|
2127
|
+
relation: e.relation,
|
|
2128
|
+
version: t
|
|
2129
|
+
}
|
|
2130
|
+
});
|
|
2131
|
+
}
|
|
2132
|
+
if (i && i.name.type === "simpleValue" && i.name.value) {
|
|
2133
|
+
const u = i.name.value;
|
|
2134
|
+
await $(t, u, o.member) || n.push({
|
|
2135
|
+
severity: "error",
|
|
2136
|
+
code: "E_IFC_PARTOF_ENTITY",
|
|
2137
|
+
message: `applicability entity "${u}" cannot be the member of ${e.relation}; ${e.relation} requires the member to be a subtype of "${o.member}" (${t})`,
|
|
2138
|
+
path: `${a}.relation`,
|
|
2139
|
+
facetType: "partOf",
|
|
2140
|
+
detail: {
|
|
2141
|
+
applicability: u,
|
|
2142
|
+
required: o.member,
|
|
2143
|
+
relation: e.relation,
|
|
2144
|
+
version: t
|
|
2145
|
+
}
|
|
2146
|
+
});
|
|
2147
|
+
}
|
|
2148
|
+
}
|
|
2149
|
+
function ii(e) {
|
|
2150
|
+
try {
|
|
2151
|
+
return {
|
|
2152
|
+
document: Ne(e),
|
|
2153
|
+
issues: []
|
|
2154
|
+
};
|
|
2155
|
+
} catch (t) {
|
|
2156
|
+
return {
|
|
2157
|
+
issues: [
|
|
2158
|
+
ai(t)
|
|
2159
|
+
]
|
|
2160
|
+
};
|
|
2161
|
+
}
|
|
2162
|
+
}
|
|
2163
|
+
function ai(e) {
|
|
2164
|
+
if (e instanceof g) {
|
|
2165
|
+
const t = e.details ? `${e.message}: ${e.details}` : e.message;
|
|
2166
|
+
let a = "E_PARSE_UNKNOWN";
|
|
2167
|
+
return e.message.includes("Failed to parse IDS XML") || e.message.includes("Invalid XML format") || e.message.includes("No DOMParser") ? a = "E_PARSE_XML" : e.message.includes("Invalid root element") ? a = "E_PARSE_ROOT" : e.message.includes("facet") && (a = "E_PARSE_FACET"), {
|
|
2168
|
+
severity: "error",
|
|
2169
|
+
code: a,
|
|
2170
|
+
message: t,
|
|
2171
|
+
path: ""
|
|
2172
|
+
};
|
|
2173
|
+
}
|
|
2174
|
+
return {
|
|
2175
|
+
severity: "error",
|
|
2176
|
+
code: "E_PARSE_UNKNOWN",
|
|
2177
|
+
message: e instanceof Error ? e.message : String(e),
|
|
2178
|
+
path: ""
|
|
2179
|
+
};
|
|
2180
|
+
}
|
|
2181
|
+
const le = "http://www.w3.org/2001/XMLSchema", oe = new Set([
|
|
2182
|
+
"xmlns",
|
|
2183
|
+
"xsi",
|
|
2184
|
+
"xml"
|
|
2185
|
+
]), ni = {
|
|
2186
|
+
attrs: [],
|
|
2187
|
+
children: [
|
|
2188
|
+
"info",
|
|
2189
|
+
"specifications"
|
|
2190
|
+
]
|
|
2191
|
+
}, ri = {
|
|
2192
|
+
attrs: [],
|
|
2193
|
+
children: [
|
|
2194
|
+
"title",
|
|
2195
|
+
"copyright",
|
|
2196
|
+
"version",
|
|
2197
|
+
"description",
|
|
2198
|
+
"author",
|
|
2199
|
+
"date",
|
|
2200
|
+
"purpose",
|
|
2201
|
+
"milestone"
|
|
2202
|
+
]
|
|
2203
|
+
}, si = {
|
|
2204
|
+
attrs: [],
|
|
2205
|
+
children: [
|
|
2206
|
+
"specification"
|
|
2207
|
+
]
|
|
2208
|
+
}, li = {
|
|
2209
|
+
attrs: [
|
|
2210
|
+
"name",
|
|
2211
|
+
"ifcVersion",
|
|
2212
|
+
"identifier",
|
|
2213
|
+
"description",
|
|
2214
|
+
"instructions"
|
|
2215
|
+
],
|
|
2216
|
+
requiredAttrs: [
|
|
2217
|
+
"name",
|
|
2218
|
+
"ifcVersion"
|
|
2219
|
+
],
|
|
2220
|
+
children: [
|
|
2221
|
+
"applicability",
|
|
2222
|
+
"requirements"
|
|
2223
|
+
]
|
|
2224
|
+
}, oi = {
|
|
2225
|
+
attrs: [
|
|
2226
|
+
"minOccurs",
|
|
2227
|
+
"maxOccurs"
|
|
2228
|
+
],
|
|
2229
|
+
children: [
|
|
2230
|
+
"entity",
|
|
2231
|
+
"partOf",
|
|
2232
|
+
"classification",
|
|
2233
|
+
"attribute",
|
|
2234
|
+
"property",
|
|
2235
|
+
"material"
|
|
2236
|
+
]
|
|
2237
|
+
}, ui = {
|
|
2238
|
+
attrs: [
|
|
2239
|
+
"description"
|
|
2240
|
+
],
|
|
2241
|
+
children: [
|
|
2242
|
+
"entity",
|
|
2243
|
+
"partOf",
|
|
2244
|
+
"classification",
|
|
2245
|
+
"attribute",
|
|
2246
|
+
"property",
|
|
2247
|
+
"material"
|
|
2248
|
+
]
|
|
2249
|
+
}, ci = {
|
|
2250
|
+
attrs: [],
|
|
2251
|
+
children: [
|
|
2252
|
+
"name",
|
|
2253
|
+
"predefinedType"
|
|
2254
|
+
]
|
|
2255
|
+
}, pi = {
|
|
2256
|
+
attrs: [],
|
|
2257
|
+
children: [
|
|
2258
|
+
"name",
|
|
2259
|
+
"value"
|
|
2260
|
+
]
|
|
2261
|
+
}, di = {
|
|
2262
|
+
attrs: [],
|
|
2263
|
+
children: [
|
|
2264
|
+
"value",
|
|
2265
|
+
"system"
|
|
2266
|
+
]
|
|
2267
|
+
}, mi = {
|
|
2268
|
+
attrs: [
|
|
2269
|
+
"relation"
|
|
2270
|
+
],
|
|
2271
|
+
children: [
|
|
2272
|
+
"entity"
|
|
2273
|
+
]
|
|
2274
|
+
}, fi = {
|
|
2275
|
+
attrs: [
|
|
2276
|
+
"dataType"
|
|
2277
|
+
],
|
|
2278
|
+
children: [
|
|
2279
|
+
"propertySet",
|
|
2280
|
+
"baseName",
|
|
2281
|
+
"value"
|
|
2282
|
+
]
|
|
2283
|
+
}, yi = {
|
|
2284
|
+
attrs: [],
|
|
2285
|
+
children: [
|
|
2286
|
+
"value"
|
|
2287
|
+
]
|
|
2288
|
+
};
|
|
2289
|
+
function hi(e) {
|
|
2290
|
+
const t = ue(e);
|
|
2291
|
+
switch(e.toLowerCase()){
|
|
2292
|
+
case "entity":
|
|
2293
|
+
return {
|
|
2294
|
+
...t,
|
|
2295
|
+
attrs: [
|
|
2296
|
+
...t.attrs,
|
|
2297
|
+
"instructions"
|
|
2298
|
+
]
|
|
2299
|
+
};
|
|
2300
|
+
case "partof":
|
|
2301
|
+
return {
|
|
2302
|
+
...t,
|
|
2303
|
+
attrs: [
|
|
2304
|
+
...t.attrs,
|
|
2305
|
+
"cardinality",
|
|
2306
|
+
"instructions"
|
|
2307
|
+
]
|
|
2308
|
+
};
|
|
2309
|
+
case "attribute":
|
|
2310
|
+
return {
|
|
2311
|
+
...t,
|
|
2312
|
+
attrs: [
|
|
2313
|
+
...t.attrs,
|
|
2314
|
+
"cardinality",
|
|
2315
|
+
"instructions"
|
|
2316
|
+
]
|
|
2317
|
+
};
|
|
2318
|
+
case "classification":
|
|
2319
|
+
case "property":
|
|
2320
|
+
case "material":
|
|
2321
|
+
return {
|
|
2322
|
+
...t,
|
|
2323
|
+
attrs: [
|
|
2324
|
+
...t.attrs,
|
|
2325
|
+
"cardinality",
|
|
2326
|
+
"instructions",
|
|
2327
|
+
"uri"
|
|
2328
|
+
]
|
|
2329
|
+
};
|
|
2330
|
+
default:
|
|
2331
|
+
return t;
|
|
2332
|
+
}
|
|
2333
|
+
}
|
|
2334
|
+
function ue(e) {
|
|
2335
|
+
switch(e.toLowerCase()){
|
|
2336
|
+
case "entity":
|
|
2337
|
+
return ci;
|
|
2338
|
+
case "attribute":
|
|
2339
|
+
return pi;
|
|
2340
|
+
case "classification":
|
|
2341
|
+
return di;
|
|
2342
|
+
case "partof":
|
|
2343
|
+
return mi;
|
|
2344
|
+
case "property":
|
|
2345
|
+
return fi;
|
|
2346
|
+
case "material":
|
|
2347
|
+
return yi;
|
|
2348
|
+
default:
|
|
2349
|
+
return {
|
|
2350
|
+
attrs: [],
|
|
2351
|
+
children: []
|
|
2352
|
+
};
|
|
2353
|
+
}
|
|
2354
|
+
}
|
|
2355
|
+
const vi = {
|
|
2356
|
+
attrs: [],
|
|
2357
|
+
children: [
|
|
2358
|
+
"simpleValue"
|
|
2359
|
+
],
|
|
2360
|
+
xsChildren: [
|
|
2361
|
+
"restriction"
|
|
2362
|
+
]
|
|
2363
|
+
}, Ei = {
|
|
2364
|
+
attrs: [],
|
|
2365
|
+
children: [],
|
|
2366
|
+
textOnly: !0
|
|
2367
|
+
}, ce = [
|
|
2368
|
+
"enumeration",
|
|
2369
|
+
"pattern",
|
|
2370
|
+
"minInclusive",
|
|
2371
|
+
"maxInclusive",
|
|
2372
|
+
"minExclusive",
|
|
2373
|
+
"maxExclusive",
|
|
2374
|
+
"length",
|
|
2375
|
+
"minLength",
|
|
2376
|
+
"maxLength",
|
|
2377
|
+
"totalDigits",
|
|
2378
|
+
"fractionDigits",
|
|
2379
|
+
"whiteSpace"
|
|
2380
|
+
], Ti = {
|
|
2381
|
+
attrs: [
|
|
2382
|
+
"base"
|
|
2383
|
+
],
|
|
2384
|
+
children: [],
|
|
2385
|
+
xsChildren: ce
|
|
2386
|
+
}, Ii = {
|
|
2387
|
+
attrs: [
|
|
2388
|
+
"value"
|
|
2389
|
+
],
|
|
2390
|
+
children: [],
|
|
2391
|
+
textOnly: !0
|
|
2392
|
+
};
|
|
2393
|
+
async function bi(e) {
|
|
2394
|
+
const t = [], a = typeof e == "string" ? e : new TextDecoder().decode(e), i = a.charCodeAt(0) === 65279 ? a.slice(1) : a, n = await gi();
|
|
2395
|
+
let r;
|
|
2396
|
+
try {
|
|
2397
|
+
r = n.parseFromString(i, "text/xml");
|
|
2398
|
+
} catch {
|
|
2399
|
+
return t;
|
|
2400
|
+
}
|
|
2401
|
+
const s = r.documentElement;
|
|
2402
|
+
return !s || (s.localName ?? "").toLowerCase() !== "ids" || Si(s, t), t;
|
|
2403
|
+
}
|
|
2404
|
+
let w;
|
|
2405
|
+
function gi() {
|
|
2406
|
+
return w || (w = (async ()=>{
|
|
2407
|
+
const e = globalThis.DOMParser;
|
|
2408
|
+
if (typeof e == "function") return new e;
|
|
2409
|
+
const a = await import("@xmldom/xmldom").then(async (m)=>{
|
|
2410
|
+
await m.__tla;
|
|
2411
|
+
return m;
|
|
2412
|
+
});
|
|
2413
|
+
return new a.DOMParser;
|
|
2414
|
+
})(), w);
|
|
2415
|
+
}
|
|
2416
|
+
function Si(e, t) {
|
|
2417
|
+
S(e, ni, "ids", t);
|
|
2418
|
+
for (const a of R(e)){
|
|
2419
|
+
const i = (a.localName ?? "").toLowerCase();
|
|
2420
|
+
i === "info" ? Ai(a, "ids.info", t) : i === "specifications" && xi(a, "ids.specifications", t);
|
|
2421
|
+
}
|
|
2422
|
+
}
|
|
2423
|
+
function Ai(e, t, a) {
|
|
2424
|
+
S(e, ri, t, a);
|
|
2425
|
+
}
|
|
2426
|
+
function xi(e, t, a) {
|
|
2427
|
+
S(e, si, t, a);
|
|
2428
|
+
let i = 0;
|
|
2429
|
+
for (const n of R(e))(n.localName ?? "").toLowerCase() === "specification" && Ci(n, `${t}.specification[${i++}]`, a);
|
|
2430
|
+
}
|
|
2431
|
+
function Ci(e, t, a) {
|
|
2432
|
+
S(e, li, t, a);
|
|
2433
|
+
for (const i of R(e)){
|
|
2434
|
+
const n = (i.localName ?? "").toLowerCase();
|
|
2435
|
+
n === "applicability" ? W(i, `${t}.applicability`, !1, a) : n === "requirements" && W(i, `${t}.requirements`, !0, a);
|
|
2436
|
+
}
|
|
2437
|
+
}
|
|
2438
|
+
function W(e, t, a, i) {
|
|
2439
|
+
S(e, a ? ui : oi, t, i);
|
|
2440
|
+
let n = 0;
|
|
2441
|
+
for (const r of R(e)){
|
|
2442
|
+
const s = (r.localName ?? "").toLowerCase();
|
|
2443
|
+
pe(r, s, `${t}.facets[${n++}]`, a, i);
|
|
2444
|
+
}
|
|
2445
|
+
}
|
|
2446
|
+
function pe(e, t, a, i, n) {
|
|
2447
|
+
const r = i ? hi(t) : ue(t);
|
|
2448
|
+
S(e, r, a, n);
|
|
2449
|
+
for (const s of R(e)){
|
|
2450
|
+
const l = (s.localName ?? "").toLowerCase();
|
|
2451
|
+
Ri(s, l, `${a}.${l}`, i, n);
|
|
2452
|
+
}
|
|
2453
|
+
}
|
|
2454
|
+
function Ri(e, t, a, i, n) {
|
|
2455
|
+
switch(t){
|
|
2456
|
+
case "entity":
|
|
2457
|
+
pe(e, "entity", a, !1, n);
|
|
2458
|
+
return;
|
|
2459
|
+
case "name":
|
|
2460
|
+
case "value":
|
|
2461
|
+
case "baseName":
|
|
2462
|
+
case "propertySet":
|
|
2463
|
+
case "system":
|
|
2464
|
+
case "predefinedType":
|
|
2465
|
+
Mi(e, a, n);
|
|
2466
|
+
return;
|
|
2467
|
+
default:
|
|
2468
|
+
return;
|
|
2469
|
+
}
|
|
2470
|
+
}
|
|
2471
|
+
function Mi(e, t, a) {
|
|
2472
|
+
S(e, vi, t, a);
|
|
2473
|
+
for (const i of R(e)){
|
|
2474
|
+
const n = (i.localName ?? "").toLowerCase();
|
|
2475
|
+
n === "simpleValue" ? S(i, Ei, `${t}.simpleValue`, a) : n === "restriction" && (i.namespaceURI === le || i.namespaceURI === null) && Ni(i, `${t}.restriction`, a);
|
|
2476
|
+
}
|
|
2477
|
+
}
|
|
2478
|
+
function Ni(e, t, a) {
|
|
2479
|
+
S(e, Ti, t, a);
|
|
2480
|
+
for (const i of R(e)){
|
|
2481
|
+
const n = (i.localName ?? "").toLowerCase();
|
|
2482
|
+
ce.includes(n) && S(i, Ii, `${t}.${n}`, a);
|
|
2483
|
+
}
|
|
2484
|
+
}
|
|
2485
|
+
function S(e, t, a, i) {
|
|
2486
|
+
const n = new Set(t.attrs.map((l)=>l.toLowerCase()));
|
|
2487
|
+
for (const l of Array.from(e.attributes ?? [])){
|
|
2488
|
+
if (wi(l)) continue;
|
|
2489
|
+
const o = l.nodeName ?? "";
|
|
2490
|
+
if (Pi(o)) continue;
|
|
2491
|
+
const u = l.localName ?? l.nodeName ?? "", c = u.indexOf(":"), f = c === -1 ? u.toLowerCase() : u.slice(c + 1).toLowerCase(), d = c === -1 ? "" : u.slice(0, c).toLowerCase();
|
|
2492
|
+
!f || f === "xmlns" || d === "xmlns" || oe.has(d) || n.has(f) || i.push({
|
|
2493
|
+
severity: "error",
|
|
2494
|
+
code: "E_XSD_STRUCTURE",
|
|
2495
|
+
message: `unexpected attribute "${u}" on <${e.localName}>`,
|
|
2496
|
+
path: a,
|
|
2497
|
+
detail: {
|
|
2498
|
+
attribute: u,
|
|
2499
|
+
element: e.localName ?? ""
|
|
2500
|
+
}
|
|
2501
|
+
});
|
|
2502
|
+
}
|
|
2503
|
+
if (t.requiredAttrs) for (const l of t.requiredAttrs)_i(e, l) || i.push({
|
|
2504
|
+
severity: "error",
|
|
2505
|
+
code: "E_XSD_REQUIRED_ATTR",
|
|
2506
|
+
message: `<${e.localName}> is missing required @${l}`,
|
|
2507
|
+
path: a,
|
|
2508
|
+
detail: {
|
|
2509
|
+
attribute: l,
|
|
2510
|
+
element: e.localName ?? ""
|
|
2511
|
+
}
|
|
2512
|
+
});
|
|
2513
|
+
const r = new Set(t.children.map((l)=>l.toLowerCase())), s = new Set((t.xsChildren ?? []).map((l)=>l.toLowerCase()));
|
|
2514
|
+
for (const l of R(e)){
|
|
2515
|
+
const o = (l.localName ?? "").toLowerCase();
|
|
2516
|
+
if (l.namespaceURI === le) {
|
|
2517
|
+
s.has(o) || i.push({
|
|
2518
|
+
severity: "error",
|
|
2519
|
+
code: "E_XSD_STRUCTURE",
|
|
2520
|
+
message: `unexpected XSD child <xs:${o}> in <${e.localName}>`,
|
|
2521
|
+
path: a,
|
|
2522
|
+
detail: {
|
|
2523
|
+
child: `xs:${o}`,
|
|
2524
|
+
parent: e.localName ?? ""
|
|
2525
|
+
}
|
|
2526
|
+
});
|
|
2527
|
+
continue;
|
|
2528
|
+
}
|
|
2529
|
+
r.has(o) || i.push({
|
|
2530
|
+
severity: "error",
|
|
2531
|
+
code: "E_XSD_STRUCTURE",
|
|
2532
|
+
message: `unexpected child <${l.localName}> in <${e.localName}>`,
|
|
2533
|
+
path: a,
|
|
2534
|
+
detail: {
|
|
2535
|
+
child: l.localName ?? "",
|
|
2536
|
+
parent: e.localName ?? ""
|
|
2537
|
+
}
|
|
2538
|
+
});
|
|
2539
|
+
}
|
|
2540
|
+
t.textOnly;
|
|
2541
|
+
}
|
|
2542
|
+
function _i(e, t) {
|
|
2543
|
+
if (typeof e.hasAttribute == "function" && e.hasAttribute(t)) return !0;
|
|
2544
|
+
for (const a of Array.from(e.attributes ?? []))if ((a.localName ?? a.nodeName ?? "").toLowerCase() === t.toLowerCase()) return !0;
|
|
2545
|
+
return !1;
|
|
2546
|
+
}
|
|
2547
|
+
function Pi(e) {
|
|
2548
|
+
if (!e) return !1;
|
|
2549
|
+
if (e === "xmlns") return !0;
|
|
2550
|
+
const t = e.indexOf(":");
|
|
2551
|
+
return t === -1 ? !1 : oe.has(e.slice(0, t));
|
|
2552
|
+
}
|
|
2553
|
+
const $i = new Set([
|
|
2554
|
+
"http://www.w3.org/2000/xmlns/",
|
|
2555
|
+
"http://www.w3.org/XML/1998/namespace",
|
|
2556
|
+
"http://www.w3.org/2001/XMLSchema-instance"
|
|
2557
|
+
]);
|
|
2558
|
+
function wi(e) {
|
|
2559
|
+
return e.namespaceURI !== null && $i.has(e.namespaceURI);
|
|
2560
|
+
}
|
|
2561
|
+
function R(e) {
|
|
2562
|
+
if (e.children && e.children.length !== void 0) return Array.from(e.children);
|
|
2563
|
+
const t = [], a = e.childNodes ?? [];
|
|
2564
|
+
for(let i = 0; i < a.length; i++){
|
|
2565
|
+
const n = a[i];
|
|
2566
|
+
n && n.nodeType === 1 && t.push(n);
|
|
2567
|
+
}
|
|
2568
|
+
return t;
|
|
2569
|
+
}
|
|
2570
|
+
const Fi = [
|
|
2571
|
+
"IFC2X3",
|
|
2572
|
+
"IFC4",
|
|
2573
|
+
"IFC4X3_ADD2",
|
|
2574
|
+
"IFC4X3"
|
|
2575
|
+
], Oi = new Set([
|
|
2576
|
+
"IFC2X3",
|
|
2577
|
+
"IFC4",
|
|
2578
|
+
"IFC4X3",
|
|
2579
|
+
"IFC4X3_ADD2"
|
|
2580
|
+
]);
|
|
2581
|
+
function Li(e) {
|
|
2582
|
+
return Oi.has(e.toUpperCase().replace(/[^A-Z0-9_]/g, ""));
|
|
2583
|
+
}
|
|
2584
|
+
const Vi = new Set([
|
|
2585
|
+
"entity",
|
|
2586
|
+
"attribute",
|
|
2587
|
+
"classification",
|
|
2588
|
+
"material",
|
|
2589
|
+
"partOf",
|
|
2590
|
+
"property"
|
|
2591
|
+
]), Di = [
|
|
2592
|
+
"http://standards.buildingsmart.org/IDS/1.0/ids.xsd",
|
|
2593
|
+
"http://standards.buildingsmart.org/IDS/0.9.7/ids.xsd",
|
|
2594
|
+
"http://standards.buildingsmart.org/IDS/0.9.6/ids.xsd",
|
|
2595
|
+
"http://standards.buildingsmart.org/IDS/ids.xsd"
|
|
2596
|
+
];
|
|
2597
|
+
function Ui(e) {
|
|
2598
|
+
const t = [];
|
|
2599
|
+
if (e.schemaLocation) {
|
|
2600
|
+
const a = e.schemaLocation.split(/\s+/).filter((i)=>i.length > 0);
|
|
2601
|
+
for(let i = 0; i + 1 < a.length; i += 2){
|
|
2602
|
+
const n = a[i], r = a[i + 1];
|
|
2603
|
+
n === "http://standards.buildingsmart.org/IDS" && (Di.includes(r) || t.push({
|
|
2604
|
+
severity: "error",
|
|
2605
|
+
code: "E_XSD_SCHEMA_LOCATION",
|
|
2606
|
+
message: `xsi:schemaLocation references "${r}", not a recognised IDS XSD`,
|
|
2607
|
+
path: "schemaLocation",
|
|
2608
|
+
detail: {
|
|
2609
|
+
url: r
|
|
2610
|
+
}
|
|
2611
|
+
}));
|
|
2612
|
+
}
|
|
2613
|
+
}
|
|
2614
|
+
return (!e.info.title || e.info.title.trim() === "" || e.info.title === "Untitled IDS") && t.push({
|
|
2615
|
+
severity: "warning",
|
|
2616
|
+
code: "E_XSD_REQUIRED_ATTR",
|
|
2617
|
+
message: "IDS document is missing a non-empty <info><title> element",
|
|
2618
|
+
path: "info.title"
|
|
2619
|
+
}), e.specifications.forEach((a, i)=>ki(a, i, t)), t;
|
|
2620
|
+
}
|
|
2621
|
+
function ki(e, t, a) {
|
|
2622
|
+
const i = `specifications[${t}]`;
|
|
2623
|
+
if ((!e.name || e.name.trim() === "" || /^Specification \d+$/.test(e.name)) && a.push({
|
|
2624
|
+
severity: "error",
|
|
2625
|
+
code: "E_XSD_REQUIRED_ATTR",
|
|
2626
|
+
message: "specification is missing a non-empty @name attribute",
|
|
2627
|
+
path: `${i}.name`
|
|
2628
|
+
}), !e.ifcVersions || e.ifcVersions.length === 0) a.push({
|
|
2629
|
+
severity: "error",
|
|
2630
|
+
code: "E_XSD_REQUIRED_ATTR",
|
|
2631
|
+
message: "specification is missing the @ifcVersion attribute",
|
|
2632
|
+
path: `${i}.ifcVersion`
|
|
2633
|
+
});
|
|
2634
|
+
else for (const n of e.ifcVersions)Fi.includes(n) || a.push({
|
|
2635
|
+
severity: "error",
|
|
2636
|
+
code: "E_XSD_ENUM",
|
|
2637
|
+
message: `@ifcVersion "${n}" is not in {IFC2X3, IFC4, IFC4X3_ADD2}`,
|
|
2638
|
+
path: `${i}.ifcVersion`,
|
|
2639
|
+
detail: {
|
|
2640
|
+
value: n
|
|
2641
|
+
}
|
|
2642
|
+
});
|
|
2643
|
+
if (e.ifcVersionRaw) {
|
|
2644
|
+
const n = e.ifcVersionRaw.split(/\s+/).filter((r)=>r.length > 0);
|
|
2645
|
+
for (const r of n)Li(r) || a.push({
|
|
2646
|
+
severity: "error",
|
|
2647
|
+
code: "E_XSD_ENUM",
|
|
2648
|
+
message: `@ifcVersion token "${r}" is not in {IFC2X3, IFC4, IFC4X3_ADD2}`,
|
|
2649
|
+
path: `${i}.ifcVersion`,
|
|
2650
|
+
detail: {
|
|
2651
|
+
value: r
|
|
2652
|
+
}
|
|
2653
|
+
});
|
|
2654
|
+
}
|
|
2655
|
+
e.applicability.facets.length === 0 && a.push({
|
|
2656
|
+
severity: "error",
|
|
2657
|
+
code: "E_XSD_STRUCTURE",
|
|
2658
|
+
message: "specification has an empty <applicability> — at least one facet is required",
|
|
2659
|
+
path: `${i}.applicability`
|
|
2660
|
+
}), e.applicability.facets.forEach((n, r)=>{
|
|
2661
|
+
z(n, `${i}.applicability.facets[${r}]`, a);
|
|
2662
|
+
}), e.requirements.length === 0 && a.push({
|
|
2663
|
+
severity: "warning",
|
|
2664
|
+
code: "E_XSD_STRUCTURE",
|
|
2665
|
+
message: "specification has no <requirements>; matched entities will not be checked",
|
|
2666
|
+
path: `${i}.requirements`
|
|
2667
|
+
}), e.requirements.forEach((n, r)=>{
|
|
2668
|
+
z(n.facet, `${i}.requirements[${r}]`, a);
|
|
2669
|
+
});
|
|
2670
|
+
}
|
|
2671
|
+
function z(e, t, a) {
|
|
2672
|
+
if (!Vi.has(e.type)) {
|
|
2673
|
+
a.push({
|
|
2674
|
+
severity: "error",
|
|
2675
|
+
code: "E_XSD_STRUCTURE",
|
|
2676
|
+
message: `unknown facet type "${e.type}"`,
|
|
2677
|
+
path: t,
|
|
2678
|
+
facetType: e.type
|
|
2679
|
+
});
|
|
2680
|
+
return;
|
|
2681
|
+
}
|
|
2682
|
+
switch(e.type){
|
|
2683
|
+
case "entity":
|
|
2684
|
+
F(e.name, `${t}.name`, "entity.name", a, e.type);
|
|
2685
|
+
break;
|
|
2686
|
+
case "attribute":
|
|
2687
|
+
F(e.name, `${t}.name`, "attribute.name", a, e.type);
|
|
2688
|
+
break;
|
|
2689
|
+
case "property":
|
|
2690
|
+
F(e.propertySet, `${t}.propertySet`, "property.propertySet", a, e.type), F(e.baseName, `${t}.baseName`, "property.baseName", a, e.type);
|
|
2691
|
+
break;
|
|
2692
|
+
}
|
|
2693
|
+
}
|
|
2694
|
+
function F(e, t, a, i, n) {
|
|
2695
|
+
if (!e) {
|
|
2696
|
+
i.push({
|
|
2697
|
+
severity: "error",
|
|
2698
|
+
code: "E_XSD_REQUIRED_ATTR",
|
|
2699
|
+
message: `${a} is required`,
|
|
2700
|
+
path: t,
|
|
2701
|
+
facetType: n
|
|
2702
|
+
});
|
|
2703
|
+
return;
|
|
2704
|
+
}
|
|
2705
|
+
e.type === "simpleValue" && (!e.value || e.value.trim() === "") && i.push({
|
|
2706
|
+
severity: "error",
|
|
2707
|
+
code: "E_XSD_REQUIRED_ATTR",
|
|
2708
|
+
message: `${a} must have a non-empty value`,
|
|
2709
|
+
path: t,
|
|
2710
|
+
facetType: n
|
|
2711
|
+
});
|
|
2712
|
+
}
|
|
2713
|
+
oa = async function(e, t = {}) {
|
|
2714
|
+
const { document: a, issues: i } = ii(e);
|
|
2715
|
+
if (!a) return B(i);
|
|
2716
|
+
const n = t.xsdValidation === !1 ? [] : await bi(e), r = await Bi(a, t);
|
|
2717
|
+
return B([
|
|
2718
|
+
...i,
|
|
2719
|
+
...n,
|
|
2720
|
+
...r.issues
|
|
2721
|
+
], a);
|
|
2722
|
+
};
|
|
2723
|
+
async function Bi(e, t = {}) {
|
|
2724
|
+
const a = t.xsdValidation !== !1, i = t.ifcSchemaChecks !== !1, n = t.coherenceChecks !== !1, r = [];
|
|
2725
|
+
return a && r.push(...Ui(e)), n && r.push(...$t(e)), i && r.push(...await Ut(e, {
|
|
2726
|
+
ifcVersion: t.ifcVersion
|
|
2727
|
+
})), B(r, e);
|
|
2728
|
+
}
|
|
2729
|
+
function B(e, t) {
|
|
2730
|
+
let a = "valid";
|
|
2731
|
+
for (const i of e){
|
|
2732
|
+
if (i.severity === "error") {
|
|
2733
|
+
a = "error";
|
|
2734
|
+
break;
|
|
2735
|
+
}
|
|
2736
|
+
(i.severity === "warning" || i.severity === "info") && (a = "warning");
|
|
2737
|
+
}
|
|
2738
|
+
return {
|
|
2739
|
+
status: a,
|
|
2740
|
+
issues: e,
|
|
2741
|
+
parsedDocument: t
|
|
2742
|
+
};
|
|
2743
|
+
}
|
|
2744
|
+
const qi = {
|
|
2745
|
+
status: {
|
|
2746
|
+
pass: "PASS",
|
|
2747
|
+
fail: "FAIL",
|
|
2748
|
+
not_applicable: "NOT APPLICABLE"
|
|
2749
|
+
},
|
|
2750
|
+
optionality: {
|
|
2751
|
+
required: "Required",
|
|
2752
|
+
optional: "Optional",
|
|
2753
|
+
prohibited: "Prohibited"
|
|
2754
|
+
},
|
|
2755
|
+
cardinality: {
|
|
2756
|
+
satisfied: "Cardinality satisfied",
|
|
2757
|
+
atLeast: "Expected at least {min}, found {count}",
|
|
2758
|
+
atMost: "Expected at most {max}, found {count}",
|
|
2759
|
+
between: "Expected between {min} and {max}, found {count}",
|
|
2760
|
+
exactly: "Expected exactly {count}"
|
|
2761
|
+
},
|
|
2762
|
+
relations: {
|
|
2763
|
+
IfcRelAggregates: "part of",
|
|
2764
|
+
IfcRelAssignsToGroup: "grouped in",
|
|
2765
|
+
IfcRelContainedInSpatialStructure: "contained in",
|
|
2766
|
+
IfcRelNests: "nested in",
|
|
2767
|
+
IfcRelVoidsElement: "voiding",
|
|
2768
|
+
IfcRelFillsElement: "filling"
|
|
2769
|
+
},
|
|
2770
|
+
constraints: {
|
|
2771
|
+
simpleValue: '"{value}"',
|
|
2772
|
+
pattern: 'matching pattern "{pattern}"',
|
|
2773
|
+
enumeration: {
|
|
2774
|
+
single: '"{value}"',
|
|
2775
|
+
multiple: "one of [{values}]"
|
|
2776
|
+
},
|
|
2777
|
+
bounds: {
|
|
2778
|
+
between: "between {min} and {max}",
|
|
2779
|
+
atLeast: "at least {min}",
|
|
2780
|
+
atMost: "at most {max}",
|
|
2781
|
+
greaterThan: "greater than {min}",
|
|
2782
|
+
lessThan: "less than {max}"
|
|
2783
|
+
}
|
|
2784
|
+
},
|
|
2785
|
+
applicability: {
|
|
2786
|
+
entity: {
|
|
2787
|
+
simple: "Elements of type {entityType}",
|
|
2788
|
+
withPredefined: "{entityType} elements with predefined type {predefinedType}",
|
|
2789
|
+
pattern: "Elements with type matching {pattern}"
|
|
2790
|
+
},
|
|
2791
|
+
attribute: {
|
|
2792
|
+
exists: 'Elements where attribute "{name}" exists',
|
|
2793
|
+
equals: 'Elements where "{name}" equals {value}',
|
|
2794
|
+
pattern: 'Elements where "{name}" matches {pattern}'
|
|
2795
|
+
},
|
|
2796
|
+
property: {
|
|
2797
|
+
exists: 'Elements with property "{property}" in "{pset}"',
|
|
2798
|
+
equals: 'Elements where "{pset}.{property}" equals {value}',
|
|
2799
|
+
pattern: 'Elements where "{pset}.{property}" matches {pattern}',
|
|
2800
|
+
bounded: 'Elements where "{pset}.{property}" is {bounds}'
|
|
2801
|
+
},
|
|
2802
|
+
classification: {
|
|
2803
|
+
any: "Elements with any classification",
|
|
2804
|
+
system: 'Elements classified in "{system}"',
|
|
2805
|
+
value: 'Elements with classification "{value}"',
|
|
2806
|
+
systemAndValue: 'Elements classified as "{value}" in "{system}"'
|
|
2807
|
+
},
|
|
2808
|
+
material: {
|
|
2809
|
+
any: "Elements with any material assigned",
|
|
2810
|
+
value: 'Elements with material "{value}"',
|
|
2811
|
+
pattern: "Elements with material matching {pattern}"
|
|
2812
|
+
},
|
|
2813
|
+
partOf: {
|
|
2814
|
+
simple: "Elements that are {relation} another element",
|
|
2815
|
+
withEntity: "Elements that are {relation} a {entity}",
|
|
2816
|
+
withEntityAndType: "Elements that are {relation} a {entity} with type {predefinedType}"
|
|
2817
|
+
}
|
|
2818
|
+
},
|
|
2819
|
+
requirements: {
|
|
2820
|
+
entity: {
|
|
2821
|
+
mustBe: "Must be of type {entityType}",
|
|
2822
|
+
mustHavePredefined: "Must have predefined type {predefinedType}",
|
|
2823
|
+
mustBeWithPredefined: "Must be {entityType} with predefined type {predefinedType}"
|
|
2824
|
+
},
|
|
2825
|
+
attribute: {
|
|
2826
|
+
mustExist: 'Attribute "{name}" must exist',
|
|
2827
|
+
mustEqual: 'Attribute "{name}" must equal {value}',
|
|
2828
|
+
mustMatch: 'Attribute "{name}" must match {pattern}',
|
|
2829
|
+
mustNotExist: 'Attribute "{name}" must not exist',
|
|
2830
|
+
mustNotEqual: 'Attribute "{name}" must not equal {value}'
|
|
2831
|
+
},
|
|
2832
|
+
property: {
|
|
2833
|
+
mustExist: 'Property "{pset}.{property}" must exist',
|
|
2834
|
+
mustEqual: 'Property "{pset}.{property}" must equal {value}',
|
|
2835
|
+
mustMatch: 'Property "{pset}.{property}" must match {pattern}',
|
|
2836
|
+
mustBeBounded: 'Property "{pset}.{property}" must be {bounds}',
|
|
2837
|
+
mustHaveType: 'Property "{pset}.{property}" must be of type {dataType}',
|
|
2838
|
+
mustNotExist: 'Property "{pset}.{property}" must not exist'
|
|
2839
|
+
},
|
|
2840
|
+
classification: {
|
|
2841
|
+
mustHave: "Must have a classification",
|
|
2842
|
+
mustBeInSystem: 'Must be classified in "{system}"',
|
|
2843
|
+
mustHaveValue: 'Must have classification "{value}"',
|
|
2844
|
+
mustBeInSystemWithValue: 'Must be classified as "{value}" in "{system}"',
|
|
2845
|
+
mustNotHave: "Must not have any classification",
|
|
2846
|
+
mustNotBeInSystem: 'Must not be classified in "{system}"'
|
|
2847
|
+
},
|
|
2848
|
+
material: {
|
|
2849
|
+
mustHave: "Must have a material assigned",
|
|
2850
|
+
mustBe: 'Must have material "{value}"',
|
|
2851
|
+
mustMatch: "Must have material matching {pattern}",
|
|
2852
|
+
mustNotHave: "Must not have any material assigned"
|
|
2853
|
+
},
|
|
2854
|
+
partOf: {
|
|
2855
|
+
mustBe: "Must be {relation} a {entity}",
|
|
2856
|
+
mustBeSimple: "Must be {relation} another element",
|
|
2857
|
+
mustNotBe: "Must not be {relation} any element"
|
|
2858
|
+
}
|
|
2859
|
+
},
|
|
2860
|
+
failures: {
|
|
2861
|
+
entityTypeMismatch: 'Entity type is "{actual}", expected {expected}',
|
|
2862
|
+
predefinedTypeMismatch: 'Predefined type is "{actual}", expected {expected}',
|
|
2863
|
+
predefinedTypeMissing: "Predefined type is not set, expected {expected}",
|
|
2864
|
+
attributeMissing: 'Attribute "{name}" does not exist',
|
|
2865
|
+
attributeEmpty: 'Attribute "{name}" is empty',
|
|
2866
|
+
attributeValueMismatch: 'Attribute "{name}" is "{actual}", expected {expected}',
|
|
2867
|
+
attributePatternMismatch: 'Attribute "{name}" value "{actual}" does not match pattern {expected}',
|
|
2868
|
+
attributeProhibited: 'Prohibited attribute "{name}" exists with value "{actual}"',
|
|
2869
|
+
psetMissing: 'Property set "{pset}" not found',
|
|
2870
|
+
psetMissingAvailable: 'Property set "{pset}" not found. Available: {available}',
|
|
2871
|
+
propertyMissing: 'Property "{property}" not found in "{pset}"',
|
|
2872
|
+
propertyMissingAvailable: 'Property "{property}" not found in "{pset}". Available: {available}',
|
|
2873
|
+
propertyEmpty: 'Property "{pset}.{property}" has no value',
|
|
2874
|
+
propertyValueMismatch: 'Property "{pset}.{property}" is "{actual}", expected {expected}',
|
|
2875
|
+
propertyPatternMismatch: 'Property "{pset}.{property}" value "{actual}" does not match {expected}',
|
|
2876
|
+
propertyDatatypeMismatch: 'Property "{pset}.{property}" data type is "{actual}", expected {expected}',
|
|
2877
|
+
propertyOutOfBounds: 'Property "{pset}.{property}" value {actual} is out of range {expected}',
|
|
2878
|
+
propertyProhibited: 'Prohibited property "{pset}.{property}" exists with value "{actual}"',
|
|
2879
|
+
classificationMissing: "No classification assigned",
|
|
2880
|
+
classificationSystemMismatch: 'Classification system "{actual}" does not match expected "{expected}"',
|
|
2881
|
+
classificationSystemMissingAvailable: 'Classification system "{expected}" not found. Available: {available}',
|
|
2882
|
+
classificationValueMismatch: 'Classification code "{actual}" does not match expected {expected}',
|
|
2883
|
+
classificationValueMissingAvailable: "Classification code {expected} not found. Available: {available}",
|
|
2884
|
+
classificationProhibited: 'Prohibited classification "{actual}" exists in system "{system}"',
|
|
2885
|
+
materialMissing: "No material assigned",
|
|
2886
|
+
materialValueMismatch: 'Material "{actual}" does not match expected {expected}',
|
|
2887
|
+
materialValueMissingAvailable: "Material {expected} not found. Available: {available}",
|
|
2888
|
+
materialProhibited: 'Prohibited material "{actual}" is assigned',
|
|
2889
|
+
partOfMissing: "Element is not {relation} any {entity}",
|
|
2890
|
+
partOfMissingSimple: "Element is not {relation} any element",
|
|
2891
|
+
partOfEntityMismatch: "Parent element is {actual}, expected {expected}",
|
|
2892
|
+
partOfPredefinedMismatch: 'Parent predefined type is "{actual}", expected {expected}',
|
|
2893
|
+
partOfProhibited: "Element is {relation} {actual}, which is prohibited",
|
|
2894
|
+
prohibited: 'Prohibited {field} found: "{actual}"',
|
|
2895
|
+
unknown: "Validation failed: {reason}"
|
|
2896
|
+
},
|
|
2897
|
+
summary: {
|
|
2898
|
+
title: "IDS Validation Report",
|
|
2899
|
+
specifications: "{passed}/{total} specifications passed",
|
|
2900
|
+
entities: "{passed}/{total} entities compliant ({percent}%)",
|
|
2901
|
+
overallPass: "Model meets all requirements",
|
|
2902
|
+
overallFail: "Model has {count} failing specifications",
|
|
2903
|
+
noApplicable: "No applicable entities found"
|
|
2904
|
+
},
|
|
2905
|
+
ui: {
|
|
2906
|
+
specification: "Specification",
|
|
2907
|
+
specifications: "Specifications",
|
|
2908
|
+
requirement: "Requirement",
|
|
2909
|
+
requirements: "Requirements",
|
|
2910
|
+
applicability: "Applies to",
|
|
2911
|
+
entity: "Entity",
|
|
2912
|
+
entities: "Entities",
|
|
2913
|
+
passed: "Passed",
|
|
2914
|
+
failed: "Failed",
|
|
2915
|
+
passRate: "Pass rate",
|
|
2916
|
+
actualValue: "Actual",
|
|
2917
|
+
expectedValue: "Expected",
|
|
2918
|
+
failureReason: "Reason",
|
|
2919
|
+
showAll: "Show all",
|
|
2920
|
+
showFailed: "Show failed only",
|
|
2921
|
+
isolateFailed: "Isolate failed",
|
|
2922
|
+
isolatePassed: "Isolate passed",
|
|
2923
|
+
exportJson: "Export JSON",
|
|
2924
|
+
exportBcf: "Export BCF",
|
|
2925
|
+
loadIds: "Load IDS file",
|
|
2926
|
+
runValidation: "Run validation",
|
|
2927
|
+
clearResults: "Clear results"
|
|
2928
|
+
}
|
|
2929
|
+
}, Yi = {
|
|
2930
|
+
status: {
|
|
2931
|
+
pass: "BESTANDEN",
|
|
2932
|
+
fail: "FEHLGESCHLAGEN",
|
|
2933
|
+
not_applicable: "NICHT ANWENDBAR"
|
|
2934
|
+
},
|
|
2935
|
+
optionality: {
|
|
2936
|
+
required: "Erforderlich",
|
|
2937
|
+
optional: "Optional",
|
|
2938
|
+
prohibited: "Verboten"
|
|
2939
|
+
},
|
|
2940
|
+
cardinality: {
|
|
2941
|
+
satisfied: "Kardinalität erfüllt",
|
|
2942
|
+
atLeast: "Mindestens {min} erwartet, {count} gefunden",
|
|
2943
|
+
atMost: "Maximal {max} erwartet, {count} gefunden",
|
|
2944
|
+
between: "Zwischen {min} und {max} erwartet, {count} gefunden",
|
|
2945
|
+
exactly: "Genau {count} erwartet"
|
|
2946
|
+
},
|
|
2947
|
+
relations: {
|
|
2948
|
+
IfcRelAggregates: "Teil von",
|
|
2949
|
+
IfcRelAssignsToGroup: "gruppiert in",
|
|
2950
|
+
IfcRelContainedInSpatialStructure: "enthalten in",
|
|
2951
|
+
IfcRelNests: "verschachtelt in",
|
|
2952
|
+
IfcRelVoidsElement: "durchbrechend",
|
|
2953
|
+
IfcRelFillsElement: "ausfüllend"
|
|
2954
|
+
},
|
|
2955
|
+
constraints: {
|
|
2956
|
+
simpleValue: '"{value}"',
|
|
2957
|
+
pattern: 'entsprechend Muster "{pattern}"',
|
|
2958
|
+
enumeration: {
|
|
2959
|
+
single: '"{value}"',
|
|
2960
|
+
multiple: "eines von [{values}]"
|
|
2961
|
+
},
|
|
2962
|
+
bounds: {
|
|
2963
|
+
between: "zwischen {min} und {max}",
|
|
2964
|
+
atLeast: "mindestens {min}",
|
|
2965
|
+
atMost: "höchstens {max}",
|
|
2966
|
+
greaterThan: "größer als {min}",
|
|
2967
|
+
lessThan: "kleiner als {max}"
|
|
2968
|
+
}
|
|
2969
|
+
},
|
|
2970
|
+
applicability: {
|
|
2971
|
+
entity: {
|
|
2972
|
+
simple: "Elemente vom Typ {entityType}",
|
|
2973
|
+
withPredefined: "{entityType}-Elemente mit vordefiniertem Typ {predefinedType}",
|
|
2974
|
+
pattern: "Elemente mit Typ entsprechend {pattern}"
|
|
2975
|
+
},
|
|
2976
|
+
attribute: {
|
|
2977
|
+
exists: 'Elemente bei denen Attribut "{name}" existiert',
|
|
2978
|
+
equals: 'Elemente bei denen "{name}" gleich {value} ist',
|
|
2979
|
+
pattern: 'Elemente bei denen "{name}" dem Muster {pattern} entspricht'
|
|
2980
|
+
},
|
|
2981
|
+
property: {
|
|
2982
|
+
exists: 'Elemente mit Eigenschaft "{property}" in "{pset}"',
|
|
2983
|
+
equals: 'Elemente bei denen "{pset}.{property}" gleich {value} ist',
|
|
2984
|
+
pattern: 'Elemente bei denen "{pset}.{property}" dem Muster {pattern} entspricht',
|
|
2985
|
+
bounded: 'Elemente bei denen "{pset}.{property}" {bounds} ist'
|
|
2986
|
+
},
|
|
2987
|
+
classification: {
|
|
2988
|
+
any: "Elemente mit beliebiger Klassifizierung",
|
|
2989
|
+
system: 'Elemente klassifiziert in "{system}"',
|
|
2990
|
+
value: 'Elemente mit Klassifizierung "{value}"',
|
|
2991
|
+
systemAndValue: 'Elemente klassifiziert als "{value}" in "{system}"'
|
|
2992
|
+
},
|
|
2993
|
+
material: {
|
|
2994
|
+
any: "Elemente mit zugewiesenem Material",
|
|
2995
|
+
value: 'Elemente mit Material "{value}"',
|
|
2996
|
+
pattern: "Elemente mit Material entsprechend {pattern}"
|
|
2997
|
+
},
|
|
2998
|
+
partOf: {
|
|
2999
|
+
simple: "Elemente die {relation} einem anderen Element sind",
|
|
3000
|
+
withEntity: "Elemente die {relation} einem/einer {entity} sind",
|
|
3001
|
+
withEntityAndType: "Elemente die {relation} einem/einer {entity} mit Typ {predefinedType} sind"
|
|
3002
|
+
}
|
|
3003
|
+
},
|
|
3004
|
+
requirements: {
|
|
3005
|
+
entity: {
|
|
3006
|
+
mustBe: "Muss vom Typ {entityType} sein",
|
|
3007
|
+
mustHavePredefined: "Muss vordefinierten Typ {predefinedType} haben",
|
|
3008
|
+
mustBeWithPredefined: "Muss {entityType} mit vordefiniertem Typ {predefinedType} sein"
|
|
3009
|
+
},
|
|
3010
|
+
attribute: {
|
|
3011
|
+
mustExist: 'Attribut "{name}" muss existieren',
|
|
3012
|
+
mustEqual: 'Attribut "{name}" muss {value} entsprechen',
|
|
3013
|
+
mustMatch: 'Attribut "{name}" muss dem Muster {pattern} entsprechen',
|
|
3014
|
+
mustNotExist: 'Attribut "{name}" darf nicht existieren',
|
|
3015
|
+
mustNotEqual: 'Attribut "{name}" darf nicht {value} sein'
|
|
3016
|
+
},
|
|
3017
|
+
property: {
|
|
3018
|
+
mustExist: 'Eigenschaft "{pset}.{property}" muss existieren',
|
|
3019
|
+
mustEqual: 'Eigenschaft "{pset}.{property}" muss {value} sein',
|
|
3020
|
+
mustMatch: 'Eigenschaft "{pset}.{property}" muss dem Muster {pattern} entsprechen',
|
|
3021
|
+
mustBeBounded: 'Eigenschaft "{pset}.{property}" muss {bounds} sein',
|
|
3022
|
+
mustHaveType: 'Eigenschaft "{pset}.{property}" muss vom Datentyp {dataType} sein',
|
|
3023
|
+
mustNotExist: 'Eigenschaft "{pset}.{property}" darf nicht existieren'
|
|
3024
|
+
},
|
|
3025
|
+
classification: {
|
|
3026
|
+
mustHave: "Muss eine Klassifizierung haben",
|
|
3027
|
+
mustBeInSystem: 'Muss in "{system}" klassifiziert sein',
|
|
3028
|
+
mustHaveValue: 'Muss Klassifizierung "{value}" haben',
|
|
3029
|
+
mustBeInSystemWithValue: 'Muss als "{value}" in "{system}" klassifiziert sein',
|
|
3030
|
+
mustNotHave: "Darf keine Klassifizierung haben",
|
|
3031
|
+
mustNotBeInSystem: 'Darf nicht in "{system}" klassifiziert sein'
|
|
3032
|
+
},
|
|
3033
|
+
material: {
|
|
3034
|
+
mustHave: "Muss ein Material zugewiesen haben",
|
|
3035
|
+
mustBe: 'Muss Material "{value}" haben',
|
|
3036
|
+
mustMatch: "Muss Material entsprechend {pattern} haben",
|
|
3037
|
+
mustNotHave: "Darf kein Material zugewiesen haben"
|
|
3038
|
+
},
|
|
3039
|
+
partOf: {
|
|
3040
|
+
mustBe: "Muss {relation} einem/einer {entity} sein",
|
|
3041
|
+
mustBeSimple: "Muss {relation} einem anderen Element sein",
|
|
3042
|
+
mustNotBe: "Darf nicht {relation} einem Element sein"
|
|
3043
|
+
}
|
|
3044
|
+
},
|
|
3045
|
+
failures: {
|
|
3046
|
+
entityTypeMismatch: 'Elementtyp ist "{actual}", erwartet {expected}',
|
|
3047
|
+
predefinedTypeMismatch: 'Vordefinierter Typ ist "{actual}", erwartet {expected}',
|
|
3048
|
+
predefinedTypeMissing: "Vordefinierter Typ ist nicht gesetzt, erwartet {expected}",
|
|
3049
|
+
attributeMissing: 'Attribut "{name}" existiert nicht',
|
|
3050
|
+
attributeEmpty: 'Attribut "{name}" ist leer',
|
|
3051
|
+
attributeValueMismatch: 'Attribut "{name}" ist "{actual}", erwartet {expected}',
|
|
3052
|
+
attributePatternMismatch: 'Attribut "{name}" Wert "{actual}" entspricht nicht dem Muster {expected}',
|
|
3053
|
+
attributeProhibited: 'Verbotenes Attribut "{name}" existiert mit Wert "{actual}"',
|
|
3054
|
+
psetMissing: 'PropertySet "{pset}" nicht gefunden',
|
|
3055
|
+
psetMissingAvailable: 'PropertySet "{pset}" nicht gefunden. Verfügbar: {available}',
|
|
3056
|
+
propertyMissing: 'Eigenschaft "{property}" nicht in "{pset}" gefunden',
|
|
3057
|
+
propertyMissingAvailable: 'Eigenschaft "{property}" nicht in "{pset}" gefunden. Verfügbar: {available}',
|
|
3058
|
+
propertyEmpty: 'Eigenschaft "{pset}.{property}" hat keinen Wert',
|
|
3059
|
+
propertyValueMismatch: 'Eigenschaft "{pset}.{property}" ist "{actual}", erwartet {expected}',
|
|
3060
|
+
propertyPatternMismatch: 'Eigenschaft "{pset}.{property}" Wert "{actual}" entspricht nicht {expected}',
|
|
3061
|
+
propertyDatatypeMismatch: 'Eigenschaft "{pset}.{property}" Datentyp ist "{actual}", erwartet {expected}',
|
|
3062
|
+
propertyOutOfBounds: 'Eigenschaft "{pset}.{property}" Wert {actual} liegt außerhalb des Bereichs {expected}',
|
|
3063
|
+
propertyProhibited: 'Verbotene Eigenschaft "{pset}.{property}" existiert mit Wert "{actual}"',
|
|
3064
|
+
classificationMissing: "Keine Klassifizierung zugewiesen",
|
|
3065
|
+
classificationSystemMismatch: 'Klassifizierungssystem "{actual}" entspricht nicht dem erwarteten "{expected}"',
|
|
3066
|
+
classificationSystemMissingAvailable: 'Klassifizierungssystem "{expected}" nicht gefunden. Verfügbar: {available}',
|
|
3067
|
+
classificationValueMismatch: 'Klassifizierungscode "{actual}" entspricht nicht dem erwarteten {expected}',
|
|
3068
|
+
classificationValueMissingAvailable: "Klassifizierungscode {expected} nicht gefunden. Verfügbar: {available}",
|
|
3069
|
+
classificationProhibited: 'Verbotene Klassifizierung "{actual}" existiert im System "{system}"',
|
|
3070
|
+
materialMissing: "Kein Material zugewiesen",
|
|
3071
|
+
materialValueMismatch: 'Material "{actual}" entspricht nicht dem erwarteten {expected}',
|
|
3072
|
+
materialValueMissingAvailable: "Material {expected} nicht gefunden. Verfügbar: {available}",
|
|
3073
|
+
materialProhibited: 'Verbotenes Material "{actual}" ist zugewiesen',
|
|
3074
|
+
partOfMissing: "Element ist nicht {relation} einem/einer {entity}",
|
|
3075
|
+
partOfMissingSimple: "Element ist nicht {relation} einem anderen Element",
|
|
3076
|
+
partOfEntityMismatch: "Übergeordnetes Element ist {actual}, erwartet {expected}",
|
|
3077
|
+
partOfPredefinedMismatch: 'Vordefinierter Typ des übergeordneten Elements ist "{actual}", erwartet {expected}',
|
|
3078
|
+
partOfProhibited: "Element ist {relation} {actual}, was verboten ist",
|
|
3079
|
+
prohibited: 'Verbotenes {field} gefunden: "{actual}"',
|
|
3080
|
+
unknown: "Validierung fehlgeschlagen: {reason}"
|
|
3081
|
+
},
|
|
3082
|
+
summary: {
|
|
3083
|
+
title: "IDS-Validierungsbericht",
|
|
3084
|
+
specifications: "{passed}/{total} Spezifikationen bestanden",
|
|
3085
|
+
entities: "{passed}/{total} Elemente konform ({percent}%)",
|
|
3086
|
+
overallPass: "Modell erfüllt alle Anforderungen",
|
|
3087
|
+
overallFail: "Modell hat {count} fehlgeschlagene Spezifikationen",
|
|
3088
|
+
noApplicable: "Keine anwendbaren Elemente gefunden"
|
|
3089
|
+
},
|
|
3090
|
+
ui: {
|
|
3091
|
+
specification: "Spezifikation",
|
|
3092
|
+
specifications: "Spezifikationen",
|
|
3093
|
+
requirement: "Anforderung",
|
|
3094
|
+
requirements: "Anforderungen",
|
|
3095
|
+
applicability: "Gilt für",
|
|
3096
|
+
entity: "Element",
|
|
3097
|
+
entities: "Elemente",
|
|
3098
|
+
passed: "Bestanden",
|
|
3099
|
+
failed: "Fehlgeschlagen",
|
|
3100
|
+
passRate: "Erfolgsquote",
|
|
3101
|
+
actualValue: "Tatsächlich",
|
|
3102
|
+
expectedValue: "Erwartet",
|
|
3103
|
+
failureReason: "Grund",
|
|
3104
|
+
showAll: "Alle anzeigen",
|
|
3105
|
+
showFailed: "Nur fehlgeschlagene",
|
|
3106
|
+
isolateFailed: "Fehlgeschlagene isolieren",
|
|
3107
|
+
isolatePassed: "Bestandene isolieren",
|
|
3108
|
+
exportJson: "JSON exportieren",
|
|
3109
|
+
exportBcf: "BCF exportieren",
|
|
3110
|
+
loadIds: "IDS-Datei laden",
|
|
3111
|
+
runValidation: "Validierung starten",
|
|
3112
|
+
clearResults: "Ergebnisse löschen"
|
|
3113
|
+
}
|
|
3114
|
+
}, Hi = {
|
|
3115
|
+
status: {
|
|
3116
|
+
pass: "CONFORME",
|
|
3117
|
+
fail: "NON CONFORME",
|
|
3118
|
+
not_applicable: "NON APPLICABLE"
|
|
3119
|
+
},
|
|
3120
|
+
optionality: {
|
|
3121
|
+
required: "Obligatoire",
|
|
3122
|
+
optional: "Optionnel",
|
|
3123
|
+
prohibited: "Interdit"
|
|
3124
|
+
},
|
|
3125
|
+
cardinality: {
|
|
3126
|
+
satisfied: "Cardinalité respectée",
|
|
3127
|
+
atLeast: "Au moins {min} attendu(s), {count} trouvé(s)",
|
|
3128
|
+
atMost: "Au maximum {max} attendu(s), {count} trouvé(s)",
|
|
3129
|
+
between: "Entre {min} et {max} attendu(s), {count} trouvé(s)",
|
|
3130
|
+
exactly: "Exactement {count} attendu(s)"
|
|
3131
|
+
},
|
|
3132
|
+
relations: {
|
|
3133
|
+
IfcRelAggregates: "agrégé dans",
|
|
3134
|
+
IfcRelAssignsToGroup: "groupé dans",
|
|
3135
|
+
IfcRelContainedInSpatialStructure: "contenu dans",
|
|
3136
|
+
IfcRelNests: "imbriqué dans",
|
|
3137
|
+
IfcRelVoidsElement: "perçant",
|
|
3138
|
+
IfcRelFillsElement: "remplissant"
|
|
3139
|
+
},
|
|
3140
|
+
constraints: {
|
|
3141
|
+
simpleValue: '"{value}"',
|
|
3142
|
+
pattern: 'correspondant au motif "{pattern}"',
|
|
3143
|
+
enumeration: {
|
|
3144
|
+
single: '"{value}"',
|
|
3145
|
+
multiple: "l'un de [{values}]"
|
|
3146
|
+
},
|
|
3147
|
+
bounds: {
|
|
3148
|
+
between: "entre {min} et {max}",
|
|
3149
|
+
atLeast: "au moins {min}",
|
|
3150
|
+
atMost: "au plus {max}",
|
|
3151
|
+
greaterThan: "supérieur à {min}",
|
|
3152
|
+
lessThan: "inférieur à {max}"
|
|
3153
|
+
}
|
|
3154
|
+
},
|
|
3155
|
+
applicability: {
|
|
3156
|
+
entity: {
|
|
3157
|
+
simple: "Éléments de type {entityType}",
|
|
3158
|
+
withPredefined: "Éléments {entityType} avec type prédéfini {predefinedType}",
|
|
3159
|
+
pattern: "Éléments avec type correspondant à {pattern}"
|
|
3160
|
+
},
|
|
3161
|
+
attribute: {
|
|
3162
|
+
exists: `Éléments où l'attribut "{name}" existe`,
|
|
3163
|
+
equals: 'Éléments où "{name}" est égal à {value}',
|
|
3164
|
+
pattern: 'Éléments où "{name}" correspond au motif {pattern}'
|
|
3165
|
+
},
|
|
3166
|
+
property: {
|
|
3167
|
+
exists: 'Éléments avec propriété "{property}" dans "{pset}"',
|
|
3168
|
+
equals: 'Éléments où "{pset}.{property}" est égal à {value}',
|
|
3169
|
+
pattern: 'Éléments où "{pset}.{property}" correspond au motif {pattern}',
|
|
3170
|
+
bounded: 'Éléments où "{pset}.{property}" est {bounds}'
|
|
3171
|
+
},
|
|
3172
|
+
classification: {
|
|
3173
|
+
any: "Éléments avec une classification quelconque",
|
|
3174
|
+
system: 'Éléments classifiés dans "{system}"',
|
|
3175
|
+
value: 'Éléments avec classification "{value}"',
|
|
3176
|
+
systemAndValue: 'Éléments classifiés comme "{value}" dans "{system}"'
|
|
3177
|
+
},
|
|
3178
|
+
material: {
|
|
3179
|
+
any: "Éléments avec un matériau attribué",
|
|
3180
|
+
value: 'Éléments avec matériau "{value}"',
|
|
3181
|
+
pattern: "Éléments avec matériau correspondant à {pattern}"
|
|
3182
|
+
},
|
|
3183
|
+
partOf: {
|
|
3184
|
+
simple: "Éléments qui sont {relation} un autre élément",
|
|
3185
|
+
withEntity: "Éléments qui sont {relation} un(e) {entity}",
|
|
3186
|
+
withEntityAndType: "Éléments qui sont {relation} un(e) {entity} de type {predefinedType}"
|
|
3187
|
+
}
|
|
3188
|
+
},
|
|
3189
|
+
requirements: {
|
|
3190
|
+
entity: {
|
|
3191
|
+
mustBe: "Doit être de type {entityType}",
|
|
3192
|
+
mustHavePredefined: "Doit avoir le type prédéfini {predefinedType}",
|
|
3193
|
+
mustBeWithPredefined: "Doit être {entityType} avec type prédéfini {predefinedType}"
|
|
3194
|
+
},
|
|
3195
|
+
attribute: {
|
|
3196
|
+
mustExist: `L'attribut "{name}" doit exister`,
|
|
3197
|
+
mustEqual: `L'attribut "{name}" doit être égal à {value}`,
|
|
3198
|
+
mustMatch: `L'attribut "{name}" doit correspondre au motif {pattern}`,
|
|
3199
|
+
mustNotExist: `L'attribut "{name}" ne doit pas exister`,
|
|
3200
|
+
mustNotEqual: `L'attribut "{name}" ne doit pas être {value}`
|
|
3201
|
+
},
|
|
3202
|
+
property: {
|
|
3203
|
+
mustExist: 'La propriété "{pset}.{property}" doit exister',
|
|
3204
|
+
mustEqual: 'La propriété "{pset}.{property}" doit être égale à {value}',
|
|
3205
|
+
mustMatch: 'La propriété "{pset}.{property}" doit correspondre au motif {pattern}',
|
|
3206
|
+
mustBeBounded: 'La propriété "{pset}.{property}" doit être {bounds}',
|
|
3207
|
+
mustHaveType: 'La propriété "{pset}.{property}" doit être de type {dataType}',
|
|
3208
|
+
mustNotExist: 'La propriété "{pset}.{property}" ne doit pas exister'
|
|
3209
|
+
},
|
|
3210
|
+
classification: {
|
|
3211
|
+
mustHave: "Doit avoir une classification",
|
|
3212
|
+
mustBeInSystem: 'Doit être classifié dans "{system}"',
|
|
3213
|
+
mustHaveValue: 'Doit avoir la classification "{value}"',
|
|
3214
|
+
mustBeInSystemWithValue: 'Doit être classifié comme "{value}" dans "{system}"',
|
|
3215
|
+
mustNotHave: "Ne doit pas avoir de classification",
|
|
3216
|
+
mustNotBeInSystem: 'Ne doit pas être classifié dans "{system}"'
|
|
3217
|
+
},
|
|
3218
|
+
material: {
|
|
3219
|
+
mustHave: "Doit avoir un matériau attribué",
|
|
3220
|
+
mustBe: 'Doit avoir le matériau "{value}"',
|
|
3221
|
+
mustMatch: "Doit avoir un matériau correspondant à {pattern}",
|
|
3222
|
+
mustNotHave: "Ne doit pas avoir de matériau attribué"
|
|
3223
|
+
},
|
|
3224
|
+
partOf: {
|
|
3225
|
+
mustBe: "Doit être {relation} un(e) {entity}",
|
|
3226
|
+
mustBeSimple: "Doit être {relation} un autre élément",
|
|
3227
|
+
mustNotBe: "Ne doit pas être {relation} un élément"
|
|
3228
|
+
}
|
|
3229
|
+
},
|
|
3230
|
+
failures: {
|
|
3231
|
+
entityTypeMismatch: `Le type d'élément est "{actual}", attendu {expected}`,
|
|
3232
|
+
predefinedTypeMismatch: 'Le type prédéfini est "{actual}", attendu {expected}',
|
|
3233
|
+
predefinedTypeMissing: "Le type prédéfini n'est pas défini, attendu {expected}",
|
|
3234
|
+
attributeMissing: `L'attribut "{name}" n'existe pas`,
|
|
3235
|
+
attributeEmpty: `L'attribut "{name}" est vide`,
|
|
3236
|
+
attributeValueMismatch: `L'attribut "{name}" est "{actual}", attendu {expected}`,
|
|
3237
|
+
attributePatternMismatch: `La valeur de l'attribut "{name}" "{actual}" ne correspond pas au motif {expected}`,
|
|
3238
|
+
attributeProhibited: `L'attribut interdit "{name}" existe avec la valeur "{actual}"`,
|
|
3239
|
+
psetMissing: `L'ensemble de propriétés "{pset}" n'a pas été trouvé`,
|
|
3240
|
+
psetMissingAvailable: `L'ensemble de propriétés "{pset}" n'a pas été trouvé. Disponibles : {available}`,
|
|
3241
|
+
propertyMissing: `La propriété "{property}" n'a pas été trouvée dans "{pset}"`,
|
|
3242
|
+
propertyMissingAvailable: `La propriété "{property}" n'a pas été trouvée dans "{pset}". Disponibles : {available}`,
|
|
3243
|
+
propertyEmpty: `La propriété "{pset}.{property}" n'a pas de valeur`,
|
|
3244
|
+
propertyValueMismatch: 'La propriété "{pset}.{property}" est "{actual}", attendu {expected}',
|
|
3245
|
+
propertyPatternMismatch: 'La valeur de la propriété "{pset}.{property}" "{actual}" ne correspond pas à {expected}',
|
|
3246
|
+
propertyDatatypeMismatch: 'Le type de données de la propriété "{pset}.{property}" est "{actual}", attendu {expected}',
|
|
3247
|
+
propertyOutOfBounds: 'La valeur de la propriété "{pset}.{property}" {actual} est hors de la plage {expected}',
|
|
3248
|
+
propertyProhibited: 'La propriété interdite "{pset}.{property}" existe avec la valeur "{actual}"',
|
|
3249
|
+
classificationMissing: "Aucune classification attribuée",
|
|
3250
|
+
classificationSystemMismatch: 'Le système de classification "{actual}" ne correspond pas à "{expected}" attendu',
|
|
3251
|
+
classificationSystemMissingAvailable: `Le système de classification "{expected}" n'a pas été trouvé. Disponibles : {available}`,
|
|
3252
|
+
classificationValueMismatch: 'Le code de classification "{actual}" ne correspond pas à {expected} attendu',
|
|
3253
|
+
classificationValueMissingAvailable: "Le code de classification {expected} n'a pas été trouvé. Disponibles : {available}",
|
|
3254
|
+
classificationProhibited: 'La classification interdite "{actual}" existe dans le système "{system}"',
|
|
3255
|
+
materialMissing: "Aucun matériau attribué",
|
|
3256
|
+
materialValueMismatch: 'Le matériau "{actual}" ne correspond pas à {expected} attendu',
|
|
3257
|
+
materialValueMissingAvailable: "Le matériau {expected} n'a pas été trouvé. Disponibles : {available}",
|
|
3258
|
+
materialProhibited: 'Le matériau interdit "{actual}" est attribué',
|
|
3259
|
+
partOfMissing: "L'élément n'est pas {relation} un(e) {entity}",
|
|
3260
|
+
partOfMissingSimple: "L'élément n'est pas {relation} un autre élément",
|
|
3261
|
+
partOfEntityMismatch: "L'élément parent est {actual}, attendu {expected}",
|
|
3262
|
+
partOfPredefinedMismatch: `Le type prédéfini de l'élément parent est "{actual}", attendu {expected}`,
|
|
3263
|
+
partOfProhibited: "L'élément est {relation} {actual}, ce qui est interdit",
|
|
3264
|
+
prohibited: '{field} interdit trouvé : "{actual}"',
|
|
3265
|
+
unknown: "Validation échouée : {reason}"
|
|
3266
|
+
},
|
|
3267
|
+
summary: {
|
|
3268
|
+
title: "Rapport de validation IDS",
|
|
3269
|
+
specifications: "{passed}/{total} spécifications conformes",
|
|
3270
|
+
entities: "{passed}/{total} éléments conformes ({percent}%)",
|
|
3271
|
+
overallPass: "Le modèle respecte toutes les exigences",
|
|
3272
|
+
overallFail: "Le modèle a {count} spécifications non conformes",
|
|
3273
|
+
noApplicable: "Aucun élément applicable trouvé"
|
|
3274
|
+
},
|
|
3275
|
+
ui: {
|
|
3276
|
+
specification: "Spécification",
|
|
3277
|
+
specifications: "Spécifications",
|
|
3278
|
+
requirement: "Exigence",
|
|
3279
|
+
requirements: "Exigences",
|
|
3280
|
+
applicability: "S'applique à",
|
|
3281
|
+
entity: "Élément",
|
|
3282
|
+
entities: "Éléments",
|
|
3283
|
+
passed: "Conforme",
|
|
3284
|
+
failed: "Non conforme",
|
|
3285
|
+
passRate: "Taux de conformité",
|
|
3286
|
+
actualValue: "Réel",
|
|
3287
|
+
expectedValue: "Attendu",
|
|
3288
|
+
failureReason: "Raison",
|
|
3289
|
+
showAll: "Afficher tout",
|
|
3290
|
+
showFailed: "Afficher non conformes",
|
|
3291
|
+
isolateFailed: "Isoler non conformes",
|
|
3292
|
+
isolatePassed: "Isoler conformes",
|
|
3293
|
+
exportJson: "Exporter JSON",
|
|
3294
|
+
exportBcf: "Exporter BCF",
|
|
3295
|
+
loadIds: "Charger fichier IDS",
|
|
3296
|
+
runValidation: "Lancer la validation",
|
|
3297
|
+
clearResults: "Effacer les résultats"
|
|
3298
|
+
}
|
|
3299
|
+
}, K = {
|
|
3300
|
+
en: qi,
|
|
3301
|
+
de: Yi,
|
|
3302
|
+
fr: Hi
|
|
3303
|
+
};
|
|
3304
|
+
ua = function(e = "en") {
|
|
3305
|
+
return new Xi(e);
|
|
3306
|
+
};
|
|
3307
|
+
class Xi {
|
|
3308
|
+
locale;
|
|
3309
|
+
translations;
|
|
3310
|
+
constructor(t){
|
|
3311
|
+
this.locale = t, this.translations = K[t] || K.en;
|
|
3312
|
+
}
|
|
3313
|
+
t(t, a) {
|
|
3314
|
+
const i = t.split(".");
|
|
3315
|
+
let n = this.translations;
|
|
3316
|
+
for (const r of i)if (n && typeof n == "object" && r in n) n = n[r];
|
|
3317
|
+
else return t;
|
|
3318
|
+
return typeof n != "string" ? t : a ? this.interpolate(n, a) : n;
|
|
3319
|
+
}
|
|
3320
|
+
interpolate(t, a) {
|
|
3321
|
+
return t.replace(/\{(\w+)\}/g, (i, n)=>n in a ? String(a[n]) : i);
|
|
3322
|
+
}
|
|
3323
|
+
describeFacet(t, a) {
|
|
3324
|
+
switch(this.translations, t.type){
|
|
3325
|
+
case "entity":
|
|
3326
|
+
return this.describeEntityFacet(t, a);
|
|
3327
|
+
case "attribute":
|
|
3328
|
+
return this.describeAttributeFacet(t, a);
|
|
3329
|
+
case "property":
|
|
3330
|
+
return this.describePropertyFacet(t, a);
|
|
3331
|
+
case "classification":
|
|
3332
|
+
return this.describeClassificationFacet(t, a);
|
|
3333
|
+
case "material":
|
|
3334
|
+
return this.describeMaterialFacet(t, a);
|
|
3335
|
+
case "partOf":
|
|
3336
|
+
return this.describePartOfFacet(t, a);
|
|
3337
|
+
default:
|
|
3338
|
+
return "Unknown facet";
|
|
3339
|
+
}
|
|
3340
|
+
}
|
|
3341
|
+
describeEntityFacet(t, a) {
|
|
3342
|
+
const i = this.translations, n = this.describeConstraint(t.name);
|
|
3343
|
+
return a === "applicability" ? t.predefinedType ? this.interpolate(i.applicability.entity.withPredefined, {
|
|
3344
|
+
entityType: n,
|
|
3345
|
+
predefinedType: this.describeConstraint(t.predefinedType)
|
|
3346
|
+
}) : this.interpolate(i.applicability.entity.simple, {
|
|
3347
|
+
entityType: n
|
|
3348
|
+
}) : t.predefinedType ? this.interpolate(i.requirements.entity.mustBeWithPredefined, {
|
|
3349
|
+
entityType: n,
|
|
3350
|
+
predefinedType: this.describeConstraint(t.predefinedType)
|
|
3351
|
+
}) : this.interpolate(i.requirements.entity.mustBe, {
|
|
3352
|
+
entityType: n
|
|
3353
|
+
});
|
|
3354
|
+
}
|
|
3355
|
+
describeAttributeFacet(t, a) {
|
|
3356
|
+
const i = this.translations, n = this.describeConstraint(t.name);
|
|
3357
|
+
return a === "applicability" ? t.value ? t.value.type === "pattern" ? this.interpolate(i.applicability.attribute.pattern, {
|
|
3358
|
+
name: n,
|
|
3359
|
+
pattern: this.describeConstraint(t.value)
|
|
3360
|
+
}) : this.interpolate(i.applicability.attribute.equals, {
|
|
3361
|
+
name: n,
|
|
3362
|
+
value: this.describeConstraint(t.value)
|
|
3363
|
+
}) : this.interpolate(i.applicability.attribute.exists, {
|
|
3364
|
+
name: n
|
|
3365
|
+
}) : t.value ? t.value.type === "pattern" ? this.interpolate(i.requirements.attribute.mustMatch, {
|
|
3366
|
+
name: n,
|
|
3367
|
+
pattern: this.describeConstraint(t.value)
|
|
3368
|
+
}) : this.interpolate(i.requirements.attribute.mustEqual, {
|
|
3369
|
+
name: n,
|
|
3370
|
+
value: this.describeConstraint(t.value)
|
|
3371
|
+
}) : this.interpolate(i.requirements.attribute.mustExist, {
|
|
3372
|
+
name: n
|
|
3373
|
+
});
|
|
3374
|
+
}
|
|
3375
|
+
describePropertyFacet(t, a) {
|
|
3376
|
+
const i = this.translations, n = this.describeConstraint(t.propertySet), r = this.describeConstraint(t.baseName);
|
|
3377
|
+
return a === "applicability" ? t.value ? t.value.type === "pattern" ? this.interpolate(i.applicability.property.pattern, {
|
|
3378
|
+
pset: n,
|
|
3379
|
+
property: r,
|
|
3380
|
+
pattern: this.describeConstraint(t.value)
|
|
3381
|
+
}) : t.value.type === "bounds" ? this.interpolate(i.applicability.property.bounded, {
|
|
3382
|
+
pset: n,
|
|
3383
|
+
property: r,
|
|
3384
|
+
bounds: this.describeConstraint(t.value)
|
|
3385
|
+
}) : this.interpolate(i.applicability.property.equals, {
|
|
3386
|
+
pset: n,
|
|
3387
|
+
property: r,
|
|
3388
|
+
value: this.describeConstraint(t.value)
|
|
3389
|
+
}) : this.interpolate(i.applicability.property.exists, {
|
|
3390
|
+
pset: n,
|
|
3391
|
+
property: r
|
|
3392
|
+
}) : t.value ? t.value.type === "pattern" ? this.interpolate(i.requirements.property.mustMatch, {
|
|
3393
|
+
pset: n,
|
|
3394
|
+
property: r,
|
|
3395
|
+
pattern: this.describeConstraint(t.value)
|
|
3396
|
+
}) : t.value.type === "bounds" ? this.interpolate(i.requirements.property.mustBeBounded, {
|
|
3397
|
+
pset: n,
|
|
3398
|
+
property: r,
|
|
3399
|
+
bounds: this.describeConstraint(t.value)
|
|
3400
|
+
}) : this.interpolate(i.requirements.property.mustEqual, {
|
|
3401
|
+
pset: n,
|
|
3402
|
+
property: r,
|
|
3403
|
+
value: this.describeConstraint(t.value)
|
|
3404
|
+
}) : this.interpolate(i.requirements.property.mustExist, {
|
|
3405
|
+
pset: n,
|
|
3406
|
+
property: r
|
|
3407
|
+
});
|
|
3408
|
+
}
|
|
3409
|
+
describeClassificationFacet(t, a) {
|
|
3410
|
+
const i = this.translations;
|
|
3411
|
+
return a === "applicability" ? t.system && t.value ? this.interpolate(i.applicability.classification.systemAndValue, {
|
|
3412
|
+
system: this.describeConstraint(t.system),
|
|
3413
|
+
value: this.describeConstraint(t.value)
|
|
3414
|
+
}) : t.system ? this.interpolate(i.applicability.classification.system, {
|
|
3415
|
+
system: this.describeConstraint(t.system)
|
|
3416
|
+
}) : t.value ? this.interpolate(i.applicability.classification.value, {
|
|
3417
|
+
value: this.describeConstraint(t.value)
|
|
3418
|
+
}) : i.applicability.classification.any : t.system && t.value ? this.interpolate(i.requirements.classification.mustBeInSystemWithValue, {
|
|
3419
|
+
system: this.describeConstraint(t.system),
|
|
3420
|
+
value: this.describeConstraint(t.value)
|
|
3421
|
+
}) : t.system ? this.interpolate(i.requirements.classification.mustBeInSystem, {
|
|
3422
|
+
system: this.describeConstraint(t.system)
|
|
3423
|
+
}) : t.value ? this.interpolate(i.requirements.classification.mustHaveValue, {
|
|
3424
|
+
value: this.describeConstraint(t.value)
|
|
3425
|
+
}) : i.requirements.classification.mustHave;
|
|
3426
|
+
}
|
|
3427
|
+
describeMaterialFacet(t, a) {
|
|
3428
|
+
const i = this.translations;
|
|
3429
|
+
return a === "applicability" ? t.value ? t.value.type === "pattern" ? this.interpolate(i.applicability.material.pattern, {
|
|
3430
|
+
pattern: this.describeConstraint(t.value)
|
|
3431
|
+
}) : this.interpolate(i.applicability.material.value, {
|
|
3432
|
+
value: this.describeConstraint(t.value)
|
|
3433
|
+
}) : i.applicability.material.any : t.value ? t.value.type === "pattern" ? this.interpolate(i.requirements.material.mustMatch, {
|
|
3434
|
+
pattern: this.describeConstraint(t.value)
|
|
3435
|
+
}) : this.interpolate(i.requirements.material.mustBe, {
|
|
3436
|
+
value: this.describeConstraint(t.value)
|
|
3437
|
+
}) : i.requirements.material.mustHave;
|
|
3438
|
+
}
|
|
3439
|
+
describePartOfFacet(t, a) {
|
|
3440
|
+
const i = this.translations, n = this.getRelationDescription(t.relation);
|
|
3441
|
+
return a === "applicability" ? t.entity ? t.entity.predefinedType ? this.interpolate(i.applicability.partOf.withEntityAndType, {
|
|
3442
|
+
relation: n,
|
|
3443
|
+
entity: this.describeConstraint(t.entity.name),
|
|
3444
|
+
predefinedType: this.describeConstraint(t.entity.predefinedType)
|
|
3445
|
+
}) : this.interpolate(i.applicability.partOf.withEntity, {
|
|
3446
|
+
relation: n,
|
|
3447
|
+
entity: this.describeConstraint(t.entity.name)
|
|
3448
|
+
}) : this.interpolate(i.applicability.partOf.simple, {
|
|
3449
|
+
relation: n
|
|
3450
|
+
}) : t.entity ? this.interpolate(i.requirements.partOf.mustBe, {
|
|
3451
|
+
relation: n,
|
|
3452
|
+
entity: this.describeConstraint(t.entity.name)
|
|
3453
|
+
}) : this.interpolate(i.requirements.partOf.mustBeSimple, {
|
|
3454
|
+
relation: n
|
|
3455
|
+
});
|
|
3456
|
+
}
|
|
3457
|
+
describeConstraint(t) {
|
|
3458
|
+
const a = this.translations;
|
|
3459
|
+
switch(t.type){
|
|
3460
|
+
case "simpleValue":
|
|
3461
|
+
return this.interpolate(a.constraints.simpleValue, {
|
|
3462
|
+
value: t.value
|
|
3463
|
+
});
|
|
3464
|
+
case "pattern":
|
|
3465
|
+
return this.interpolate(a.constraints.pattern, {
|
|
3466
|
+
pattern: t.pattern
|
|
3467
|
+
});
|
|
3468
|
+
case "enumeration":
|
|
3469
|
+
return t.values.length === 1 ? this.interpolate(a.constraints.enumeration.single, {
|
|
3470
|
+
value: t.values[0]
|
|
3471
|
+
}) : this.interpolate(a.constraints.enumeration.multiple, {
|
|
3472
|
+
values: t.values.map((i)=>`"${i}"`).join(", ")
|
|
3473
|
+
});
|
|
3474
|
+
case "bounds":
|
|
3475
|
+
return this.describeBounds(t);
|
|
3476
|
+
default:
|
|
3477
|
+
return "unknown constraint";
|
|
3478
|
+
}
|
|
3479
|
+
}
|
|
3480
|
+
describeBounds(t) {
|
|
3481
|
+
const a = this.translations.constraints.bounds;
|
|
3482
|
+
return t.minInclusive !== void 0 && t.maxInclusive !== void 0 ? this.interpolate(a.between, {
|
|
3483
|
+
min: t.minInclusive,
|
|
3484
|
+
max: t.maxInclusive
|
|
3485
|
+
}) : t.minInclusive !== void 0 ? this.interpolate(a.atLeast, {
|
|
3486
|
+
min: t.minInclusive
|
|
3487
|
+
}) : t.maxInclusive !== void 0 ? this.interpolate(a.atMost, {
|
|
3488
|
+
max: t.maxInclusive
|
|
3489
|
+
}) : t.minExclusive !== void 0 ? this.interpolate(a.greaterThan, {
|
|
3490
|
+
min: t.minExclusive
|
|
3491
|
+
}) : t.maxExclusive !== void 0 ? this.interpolate(a.lessThan, {
|
|
3492
|
+
max: t.maxExclusive
|
|
3493
|
+
}) : "any value";
|
|
3494
|
+
}
|
|
3495
|
+
describeFailure(t) {
|
|
3496
|
+
const a = this.translations.failures;
|
|
3497
|
+
if (!t.failure) return t.actualValue && t.expectedValue ? `${t.actualValue} ≠ ${t.expectedValue}` : a.unknown.replace("{reason}", "no details");
|
|
3498
|
+
const { type: i, field: n, actual: r, expected: s, context: l } = t.failure;
|
|
3499
|
+
switch(i){
|
|
3500
|
+
case "ENTITY_TYPE_MISMATCH":
|
|
3501
|
+
return this.interpolate(a.entityTypeMismatch, {
|
|
3502
|
+
actual: r || "?",
|
|
3503
|
+
expected: s || "?"
|
|
3504
|
+
});
|
|
3505
|
+
case "PREDEFINED_TYPE_MISMATCH":
|
|
3506
|
+
return this.interpolate(a.predefinedTypeMismatch, {
|
|
3507
|
+
actual: r || "?",
|
|
3508
|
+
expected: s || "?"
|
|
3509
|
+
});
|
|
3510
|
+
case "PREDEFINED_TYPE_MISSING":
|
|
3511
|
+
return this.interpolate(a.predefinedTypeMissing, {
|
|
3512
|
+
expected: s || "?"
|
|
3513
|
+
});
|
|
3514
|
+
case "ATTRIBUTE_MISSING":
|
|
3515
|
+
return this.interpolate(a.attributeMissing, {
|
|
3516
|
+
name: n || "?"
|
|
3517
|
+
});
|
|
3518
|
+
case "ATTRIBUTE_VALUE_MISMATCH":
|
|
3519
|
+
return this.interpolate(a.attributeValueMismatch, {
|
|
3520
|
+
name: n || "?",
|
|
3521
|
+
actual: r || "?",
|
|
3522
|
+
expected: s || "?"
|
|
3523
|
+
});
|
|
3524
|
+
case "ATTRIBUTE_PATTERN_MISMATCH":
|
|
3525
|
+
return this.interpolate(a.attributePatternMismatch, {
|
|
3526
|
+
name: n || "?",
|
|
3527
|
+
actual: r || "?",
|
|
3528
|
+
expected: s || "?"
|
|
3529
|
+
});
|
|
3530
|
+
case "PSET_MISSING":
|
|
3531
|
+
return l?.availablePsets ? this.interpolate(a.psetMissingAvailable, {
|
|
3532
|
+
pset: n || s || "?",
|
|
3533
|
+
available: l.availablePsets
|
|
3534
|
+
}) : this.interpolate(a.psetMissing, {
|
|
3535
|
+
pset: n || s || "?"
|
|
3536
|
+
});
|
|
3537
|
+
case "PROPERTY_MISSING":
|
|
3538
|
+
return l?.availableProperties ? this.interpolate(a.propertyMissingAvailable, {
|
|
3539
|
+
property: n || "?",
|
|
3540
|
+
pset: l.propertySet || "?",
|
|
3541
|
+
available: l.availableProperties
|
|
3542
|
+
}) : this.interpolate(a.propertyMissing, {
|
|
3543
|
+
property: n || "?",
|
|
3544
|
+
pset: l?.propertySet || "?"
|
|
3545
|
+
});
|
|
3546
|
+
case "PROPERTY_VALUE_MISMATCH":
|
|
3547
|
+
return this.interpolate(a.propertyValueMismatch, {
|
|
3548
|
+
pset: this.extractPsetFromField(n),
|
|
3549
|
+
property: this.extractPropertyFromField(n),
|
|
3550
|
+
actual: r || "?",
|
|
3551
|
+
expected: s || "?"
|
|
3552
|
+
});
|
|
3553
|
+
case "PROPERTY_DATATYPE_MISMATCH":
|
|
3554
|
+
return this.interpolate(a.propertyDatatypeMismatch, {
|
|
3555
|
+
pset: this.extractPsetFromField(n),
|
|
3556
|
+
property: this.extractPropertyFromField(n),
|
|
3557
|
+
actual: r || "?",
|
|
3558
|
+
expected: s || "?"
|
|
3559
|
+
});
|
|
3560
|
+
case "PROPERTY_OUT_OF_BOUNDS":
|
|
3561
|
+
return this.interpolate(a.propertyOutOfBounds, {
|
|
3562
|
+
pset: this.extractPsetFromField(n),
|
|
3563
|
+
property: this.extractPropertyFromField(n),
|
|
3564
|
+
actual: r || "?",
|
|
3565
|
+
expected: s || "?"
|
|
3566
|
+
});
|
|
3567
|
+
case "CLASSIFICATION_MISSING":
|
|
3568
|
+
return a.classificationMissing;
|
|
3569
|
+
case "CLASSIFICATION_SYSTEM_MISMATCH":
|
|
3570
|
+
return l?.availableSystems ? this.interpolate(a.classificationSystemMissingAvailable, {
|
|
3571
|
+
expected: s || "?",
|
|
3572
|
+
available: l.availableSystems
|
|
3573
|
+
}) : this.interpolate(a.classificationSystemMismatch, {
|
|
3574
|
+
actual: r || "?",
|
|
3575
|
+
expected: s || "?"
|
|
3576
|
+
});
|
|
3577
|
+
case "CLASSIFICATION_VALUE_MISMATCH":
|
|
3578
|
+
return l?.availableValues ? this.interpolate(a.classificationValueMissingAvailable, {
|
|
3579
|
+
expected: s || "?",
|
|
3580
|
+
available: l.availableValues
|
|
3581
|
+
}) : this.interpolate(a.classificationValueMismatch, {
|
|
3582
|
+
actual: r || "?",
|
|
3583
|
+
expected: s || "?"
|
|
3584
|
+
});
|
|
3585
|
+
case "MATERIAL_MISSING":
|
|
3586
|
+
return a.materialMissing;
|
|
3587
|
+
case "MATERIAL_VALUE_MISMATCH":
|
|
3588
|
+
return l?.availableMaterials ? this.interpolate(a.materialValueMissingAvailable, {
|
|
3589
|
+
expected: s || "?",
|
|
3590
|
+
available: l.availableMaterials
|
|
3591
|
+
}) : this.interpolate(a.materialValueMismatch, {
|
|
3592
|
+
actual: r || "?",
|
|
3593
|
+
expected: s || "?"
|
|
3594
|
+
});
|
|
3595
|
+
case "PARTOF_RELATION_MISSING":
|
|
3596
|
+
return l?.entity ? this.interpolate(a.partOfMissing, {
|
|
3597
|
+
relation: this.getRelationDescription(n || "IfcRelContainedInSpatialStructure"),
|
|
3598
|
+
entity: l.entity
|
|
3599
|
+
}) : this.interpolate(a.partOfMissingSimple, {
|
|
3600
|
+
relation: this.getRelationDescription(n || "IfcRelContainedInSpatialStructure")
|
|
3601
|
+
});
|
|
3602
|
+
case "PARTOF_ENTITY_MISMATCH":
|
|
3603
|
+
return this.interpolate(a.partOfEntityMismatch, {
|
|
3604
|
+
actual: r || "?",
|
|
3605
|
+
expected: s || "?"
|
|
3606
|
+
});
|
|
3607
|
+
case "PROHIBITED_ATTRIBUTE_EXISTS":
|
|
3608
|
+
case "PROHIBITED_PROPERTY_EXISTS":
|
|
3609
|
+
case "PROHIBITED_CLASSIFICATION_EXISTS":
|
|
3610
|
+
case "PROHIBITED_MATERIAL_EXISTS":
|
|
3611
|
+
return this.interpolate(a.prohibited, {
|
|
3612
|
+
field: n || "value",
|
|
3613
|
+
actual: r || "?"
|
|
3614
|
+
});
|
|
3615
|
+
default:
|
|
3616
|
+
return this.interpolate(a.unknown, {
|
|
3617
|
+
reason: i
|
|
3618
|
+
});
|
|
3619
|
+
}
|
|
3620
|
+
}
|
|
3621
|
+
extractPsetFromField(t) {
|
|
3622
|
+
if (!t) return "?";
|
|
3623
|
+
const a = t.split(".");
|
|
3624
|
+
return a.length > 1 ? a[0] : "?";
|
|
3625
|
+
}
|
|
3626
|
+
extractPropertyFromField(t) {
|
|
3627
|
+
if (!t) return "?";
|
|
3628
|
+
const a = t.split(".");
|
|
3629
|
+
return a.length > 1 ? a.slice(1).join(".") : t;
|
|
3630
|
+
}
|
|
3631
|
+
describeRequirement(t) {
|
|
3632
|
+
let a = this.describeFacet(t.facet, "requirement");
|
|
3633
|
+
return t.optionality === "prohibited" ? a = this.applyProhibited(a) : t.optionality === "optional" && (a = this.applyOptional(a)), a;
|
|
3634
|
+
}
|
|
3635
|
+
applyProhibited(t) {
|
|
3636
|
+
return t.replace(/^Must be/i, "Must NOT be").replace(/^Must have/i, "Must NOT have").replace(/^Muss/i, "Darf nicht").replace(/^Doit être/i, "Ne doit pas être").replace(/^Doit avoir/i, "Ne doit pas avoir");
|
|
3637
|
+
}
|
|
3638
|
+
applyOptional(t) {
|
|
3639
|
+
return t.replace(/^Must/i, "Should").replace(/^Muss/i, "Sollte").replace(/^Doit/i, "Devrait");
|
|
3640
|
+
}
|
|
3641
|
+
getStatusText(t) {
|
|
3642
|
+
return this.translations.status[t];
|
|
3643
|
+
}
|
|
3644
|
+
getOptionalityText(t) {
|
|
3645
|
+
return this.translations.optionality[t];
|
|
3646
|
+
}
|
|
3647
|
+
getRelationDescription(t) {
|
|
3648
|
+
return this.translations.relations[t] || t.replace("IfcRel", "").toLowerCase();
|
|
3649
|
+
}
|
|
3650
|
+
}
|
|
3651
|
+
function Gi(e) {
|
|
3652
|
+
if (!e) return [];
|
|
3653
|
+
const t = [], a = (i, n)=>{
|
|
3654
|
+
i && t.push({
|
|
3655
|
+
name: i,
|
|
3656
|
+
category: n
|
|
3657
|
+
});
|
|
3658
|
+
};
|
|
3659
|
+
switch(e.type){
|
|
3660
|
+
case "Material":
|
|
3661
|
+
a(e.name, e.category), e.category && a(e.category, e.category);
|
|
3662
|
+
break;
|
|
3663
|
+
case "MaterialList":
|
|
3664
|
+
for (const i of e.materials || [])typeof i == "string" ? a(i) : i && typeof i == "object" && (a(i.name, i.category), i.category && a(i.category, i.category));
|
|
3665
|
+
break;
|
|
3666
|
+
case "MaterialLayerSet":
|
|
3667
|
+
a(e.name);
|
|
3668
|
+
for (const i of e.layers || [])a(i.materialName, i.category), a(i.name, i.category), i.materialCategory && a(i.materialCategory, i.materialCategory);
|
|
3669
|
+
break;
|
|
3670
|
+
case "MaterialConstituentSet":
|
|
3671
|
+
a(e.name);
|
|
3672
|
+
for (const i of e.constituents || [])a(i.materialName, i.category), a(i.name, i.category), i.materialCategory && a(i.materialCategory, i.materialCategory);
|
|
3673
|
+
break;
|
|
3674
|
+
case "MaterialProfileSet":
|
|
3675
|
+
a(e.name);
|
|
3676
|
+
for (const i of e.profiles || [])a(i.materialName, i.category), a(i.name, i.category), i.materialCategory && a(i.materialCategory, i.materialCategory);
|
|
3677
|
+
break;
|
|
3678
|
+
}
|
|
3679
|
+
return t;
|
|
3680
|
+
}
|
|
3681
|
+
function ji(e, t) {
|
|
3682
|
+
const a = [
|
|
3683
|
+
...be(e, t) || []
|
|
3684
|
+
];
|
|
3685
|
+
Wi(e, t, a);
|
|
3686
|
+
const i = [];
|
|
3687
|
+
for (const n of a){
|
|
3688
|
+
const r = n.system || "", s = n.identification || n.name || "";
|
|
3689
|
+
if (i.push({
|
|
3690
|
+
system: r,
|
|
3691
|
+
value: s,
|
|
3692
|
+
name: n.name
|
|
3693
|
+
}), Array.isArray(n.path)) for (const l of n.path)l && l !== s && i.push({
|
|
3694
|
+
system: r,
|
|
3695
|
+
value: l,
|
|
3696
|
+
name: n.name
|
|
3697
|
+
});
|
|
3698
|
+
}
|
|
3699
|
+
return i;
|
|
3700
|
+
}
|
|
3701
|
+
function Wi(e, t, a) {
|
|
3702
|
+
const i = e.entityIndex?.byType?.get?.("IFCEXTERNALREFERENCERELATIONSHIP") || [];
|
|
3703
|
+
if (i.length === 0 || !e.source?.length) return;
|
|
3704
|
+
const n = new ge(e.source);
|
|
3705
|
+
for (const r of i){
|
|
3706
|
+
const s = e.entityIndex.byId.get(r);
|
|
3707
|
+
if (!s) continue;
|
|
3708
|
+
const l = n.extractEntity(s);
|
|
3709
|
+
if (!l) continue;
|
|
3710
|
+
const o = l.attributes?.[2], u = l.attributes?.[3];
|
|
3711
|
+
if (typeof o != "number" || !Array.isArray(u) || !u.includes(t)) continue;
|
|
3712
|
+
const c = e.entityIndex.byId.get(o);
|
|
3713
|
+
if (!c) continue;
|
|
3714
|
+
const f = n.extractEntity(c);
|
|
3715
|
+
if (!f || f.type.toUpperCase() !== "IFCCLASSIFICATIONREFERENCE") continue;
|
|
3716
|
+
const d = f.attributes || [], m = {
|
|
3717
|
+
identification: typeof d[1] == "string" ? d[1] : void 0,
|
|
3718
|
+
name: typeof d[2] == "string" ? d[2] : void 0,
|
|
3719
|
+
path: []
|
|
3720
|
+
};
|
|
3721
|
+
let y = typeof d[3] == "number" ? d[3] : void 0;
|
|
3722
|
+
const M = new Set;
|
|
3723
|
+
for(; y !== void 0 && !M.has(y);){
|
|
3724
|
+
M.add(y);
|
|
3725
|
+
const x = e.entityIndex.byId.get(y);
|
|
3726
|
+
if (!x) break;
|
|
3727
|
+
const _ = n.extractEntity(x);
|
|
3728
|
+
if (!_) break;
|
|
3729
|
+
const I = _.type.toUpperCase(), b = _.attributes || [];
|
|
3730
|
+
if (I === "IFCCLASSIFICATION") {
|
|
3731
|
+
m.system = typeof b[3] == "string" ? b[3] : void 0;
|
|
3732
|
+
break;
|
|
3733
|
+
}
|
|
3734
|
+
if (I === "IFCCLASSIFICATIONREFERENCE") {
|
|
3735
|
+
const P = typeof b[1] == "string" ? b[1] : typeof b[2] == "string" ? b[2] : void 0;
|
|
3736
|
+
P && m.path.unshift(P), y = typeof b[3] == "number" ? b[3] : void 0;
|
|
3737
|
+
continue;
|
|
3738
|
+
}
|
|
3739
|
+
break;
|
|
3740
|
+
}
|
|
3741
|
+
a.push(m);
|
|
3742
|
+
}
|
|
3743
|
+
}
|
|
3744
|
+
function de(e) {
|
|
3745
|
+
if (typeof e == "string") return e.startsWith("IFC") || e.startsWith("Ifc") ? e.toUpperCase() : "IFCLABEL";
|
|
3746
|
+
switch(e){
|
|
3747
|
+
case 0:
|
|
3748
|
+
return "IFCLABEL";
|
|
3749
|
+
case 1:
|
|
3750
|
+
return "IFCREAL";
|
|
3751
|
+
case 2:
|
|
3752
|
+
return "IFCINTEGER";
|
|
3753
|
+
case 3:
|
|
3754
|
+
return "IFCBOOLEAN";
|
|
3755
|
+
case 4:
|
|
3756
|
+
return "IFCLOGICAL";
|
|
3757
|
+
case 5:
|
|
3758
|
+
return "IFCLABEL";
|
|
3759
|
+
case 6:
|
|
3760
|
+
return "IFCIDENTIFIER";
|
|
3761
|
+
case 7:
|
|
3762
|
+
return "IFCTEXT";
|
|
3763
|
+
case 8:
|
|
3764
|
+
return "IFCLABEL";
|
|
3765
|
+
case 9:
|
|
3766
|
+
return "IFCIDENTIFIER";
|
|
3767
|
+
case 10:
|
|
3768
|
+
return "IFCLABEL";
|
|
3769
|
+
default:
|
|
3770
|
+
return "IFCLABEL";
|
|
3771
|
+
}
|
|
3772
|
+
}
|
|
3773
|
+
function zi(e) {
|
|
3774
|
+
switch(e){
|
|
3775
|
+
case 0:
|
|
3776
|
+
return "IFCLENGTHMEASURE";
|
|
3777
|
+
case 1:
|
|
3778
|
+
return "IFCAREAMEASURE";
|
|
3779
|
+
case 2:
|
|
3780
|
+
return "IFCVOLUMEMEASURE";
|
|
3781
|
+
case 3:
|
|
3782
|
+
return "IFCCOUNTMEASURE";
|
|
3783
|
+
case 4:
|
|
3784
|
+
return "IFCMASSMEASURE";
|
|
3785
|
+
case 5:
|
|
3786
|
+
return "IFCTIMEMEASURE";
|
|
3787
|
+
default:
|
|
3788
|
+
return "IFCLABEL";
|
|
3789
|
+
}
|
|
3790
|
+
}
|
|
3791
|
+
function Ki(e, t, a, i) {
|
|
3792
|
+
if (!i || i === 1) return {
|
|
3793
|
+
value: e,
|
|
3794
|
+
values: t
|
|
3795
|
+
};
|
|
3796
|
+
const n = a ? a.toUpperCase() : "", r = n === "IFCLENGTHMEASURE" || n === "IFCPOSITIVELENGTHMEASURE", s = !a && Array.isArray(t) && t.length > 0;
|
|
3797
|
+
if (!r && !s) return {
|
|
3798
|
+
value: e,
|
|
3799
|
+
values: t
|
|
3800
|
+
};
|
|
3801
|
+
const l = (u)=>{
|
|
3802
|
+
const c = typeof u == "number" ? u : parseFloat(String(u));
|
|
3803
|
+
return Number.isFinite(c) ? c * i : null;
|
|
3804
|
+
};
|
|
3805
|
+
if (r) {
|
|
3806
|
+
const u = (()=>{
|
|
3807
|
+
const f = l(e);
|
|
3808
|
+
return f ?? e;
|
|
3809
|
+
})(), c = Array.isArray(t) ? t.map((f)=>{
|
|
3810
|
+
const d = l(f);
|
|
3811
|
+
return d == null ? String(f) : String(d);
|
|
3812
|
+
}) : t;
|
|
3813
|
+
return {
|
|
3814
|
+
value: u,
|
|
3815
|
+
values: c
|
|
3816
|
+
};
|
|
3817
|
+
}
|
|
3818
|
+
const o = [];
|
|
3819
|
+
for (const u of t){
|
|
3820
|
+
o.push(String(u));
|
|
3821
|
+
const c = l(u);
|
|
3822
|
+
c != null && String(c) !== String(u) && o.push(String(c));
|
|
3823
|
+
}
|
|
3824
|
+
return {
|
|
3825
|
+
value: e,
|
|
3826
|
+
values: o
|
|
3827
|
+
};
|
|
3828
|
+
}
|
|
3829
|
+
function Q(e, t) {
|
|
3830
|
+
const a = [], i = e.lengthUnitScale;
|
|
3831
|
+
return Qi(e, t, i, a), Ji(e, t, a), Zi(e, t, a), ea(e, t, i, a), a.length === 0 && ta(e, t, a), a;
|
|
3832
|
+
}
|
|
3833
|
+
function Qi(e, t, a, i) {
|
|
3834
|
+
let n = e.properties?.getForEntity?.(t);
|
|
3835
|
+
if ((!n || n.length === 0) && (n = Se(e, t)), !(!n || n.length === 0)) for (const r of n)i.push({
|
|
3836
|
+
name: r.name,
|
|
3837
|
+
properties: (r.properties || []).map((s)=>me(s, a))
|
|
3838
|
+
});
|
|
3839
|
+
}
|
|
3840
|
+
function Ji(e, t, a) {
|
|
3841
|
+
let i = e.quantities?.getForEntity?.(t);
|
|
3842
|
+
if ((!i || i.length === 0) && (i = Ae(e, t)), !(!i || i.length === 0)) for (const n of i)a.push({
|
|
3843
|
+
name: n.name,
|
|
3844
|
+
properties: (n.quantities || []).map((r)=>({
|
|
3845
|
+
name: r.name,
|
|
3846
|
+
value: r.value,
|
|
3847
|
+
dataType: zi(r.type)
|
|
3848
|
+
}))
|
|
3849
|
+
});
|
|
3850
|
+
}
|
|
3851
|
+
function Zi(e, t, a) {
|
|
3852
|
+
const i = e.relationships?.getRelated?.(t, A.DefinesByProperties, "inverse") || [];
|
|
3853
|
+
for (const n of i){
|
|
3854
|
+
const r = e.entityIndex?.byId?.get?.(n);
|
|
3855
|
+
if (!r) continue;
|
|
3856
|
+
const s = String(r.type).toUpperCase();
|
|
3857
|
+
if (s === "IFCPROPERTYSET" || s === "IFCELEMENTQUANTITY" || !s.endsWith("PROPERTIES")) continue;
|
|
3858
|
+
const l = N(e, n), o = l.find((c)=>c.name === "Name")?.value;
|
|
3859
|
+
if (typeof o != "string" || !o || a.some((c)=>c.name === o)) continue;
|
|
3860
|
+
const u = l.filter((c)=>c.name !== "GlobalId" && c.name !== "Name" && c.name !== "Description" && c.value !== void 0 && c.value !== "").map((c)=>({
|
|
3861
|
+
name: c.name,
|
|
3862
|
+
value: c.value,
|
|
3863
|
+
dataType: ""
|
|
3864
|
+
}));
|
|
3865
|
+
u.length > 0 && a.push({
|
|
3866
|
+
name: o,
|
|
3867
|
+
properties: u
|
|
3868
|
+
});
|
|
3869
|
+
}
|
|
3870
|
+
}
|
|
3871
|
+
function ea(e, t, a, i) {
|
|
3872
|
+
const n = xe(e, t);
|
|
3873
|
+
if (!n || !n.properties || n.properties.length === 0) return;
|
|
3874
|
+
const r = new Set(i.map((s)=>s.name));
|
|
3875
|
+
for (const s of n.properties)r.has(s.name) || i.push({
|
|
3876
|
+
name: s.name,
|
|
3877
|
+
properties: (s.properties || []).map((l)=>me(l, a))
|
|
3878
|
+
});
|
|
3879
|
+
}
|
|
3880
|
+
function ta(e, t, a) {
|
|
3881
|
+
const i = Ce(e, t);
|
|
3882
|
+
if (i.length !== 0) for (const n of i)a.push({
|
|
3883
|
+
name: n.name,
|
|
3884
|
+
properties: (n.properties || []).map((r)=>({
|
|
3885
|
+
name: r.name,
|
|
3886
|
+
value: Array.isArray(r.value) ? JSON.stringify(r.value) : r.value,
|
|
3887
|
+
dataType: de(r.type),
|
|
3888
|
+
...Array.isArray(r.values) && r.values.length > 0 ? {
|
|
3889
|
+
values: r.values
|
|
3890
|
+
} : {}
|
|
3891
|
+
}))
|
|
3892
|
+
});
|
|
3893
|
+
}
|
|
3894
|
+
function me(e, t) {
|
|
3895
|
+
const a = Array.isArray(e.values) && e.values.length > 0, i = e.dataType ?? (a ? void 0 : de(e.type)), n = Array.isArray(e.value) ? JSON.stringify(e.value) : e.value, r = a ? e.values : void 0, s = Ki(n, r, i, t);
|
|
3896
|
+
return {
|
|
3897
|
+
name: e.name,
|
|
3898
|
+
value: s.value,
|
|
3899
|
+
dataType: i ?? "",
|
|
3900
|
+
...s.values ? {
|
|
3901
|
+
values: s.values
|
|
3902
|
+
} : {}
|
|
3903
|
+
};
|
|
3904
|
+
}
|
|
3905
|
+
function ia(e, t) {
|
|
3906
|
+
const i = N(e, t).find((s)=>s.name === "PredefinedType"), n = typeof i?.value == "string" && i.value ? i.value : void 0;
|
|
3907
|
+
if (n && n !== "NOTDEFINED") return n;
|
|
3908
|
+
const r = e.relationships?.getRelated?.(t, A.DefinesByType, "inverse") || [];
|
|
3909
|
+
for (const s of r){
|
|
3910
|
+
const o = N(e, s).find((c)=>c.name === "PredefinedType"), u = typeof o?.value == "string" && o.value ? o.value : void 0;
|
|
3911
|
+
if (u && u !== "NOTDEFINED") return u;
|
|
3912
|
+
}
|
|
3913
|
+
return n;
|
|
3914
|
+
}
|
|
3915
|
+
function aa(e, t, a) {
|
|
3916
|
+
const i = N(e, t), r = i.find((u)=>u.name === "PredefinedType")?.value;
|
|
3917
|
+
if (typeof r == "string" && r && r !== "NOTDEFINED" && r !== "USERDEFINED") return r;
|
|
3918
|
+
const s = i.find((u)=>u.name === "ElementType") || i.find((u)=>u.name === "ObjectType") || i.find((u)=>u.name === "ProcessType") || i.find((u)=>u.name === "ResourceType");
|
|
3919
|
+
if (s && typeof s.value == "string" && s.value) return s.value;
|
|
3920
|
+
const l = e.relationships?.getRelated?.(t, A.DefinesByType, "inverse") || [];
|
|
3921
|
+
for (const u of l){
|
|
3922
|
+
const c = N(e, u), d = c.find((y)=>y.name === "PredefinedType")?.value;
|
|
3923
|
+
if (typeof d == "string" && d && d !== "NOTDEFINED" && d !== "USERDEFINED") return d;
|
|
3924
|
+
const m = c.find((y)=>y.name === "ElementType") || c.find((y)=>y.name === "ObjectType") || c.find((y)=>y.name === "ProcessType") || c.find((y)=>y.name === "ResourceType");
|
|
3925
|
+
if (m && typeof m.value == "string" && m.value) return m.value;
|
|
3926
|
+
}
|
|
3927
|
+
const o = a();
|
|
3928
|
+
return o || (typeof r == "string" && r ? r : void 0);
|
|
3929
|
+
}
|
|
3930
|
+
function na(e) {
|
|
3931
|
+
switch((e || "").toUpperCase()){
|
|
3932
|
+
case "IFC2X3":
|
|
3933
|
+
return "IFC2X3";
|
|
3934
|
+
case "IFC4":
|
|
3935
|
+
return "IFC4";
|
|
3936
|
+
case "IFC4X3":
|
|
3937
|
+
case "IFC4X3_ADD2":
|
|
3938
|
+
case "IFC5":
|
|
3939
|
+
return "IFC4X3";
|
|
3940
|
+
default:
|
|
3941
|
+
return "IFC4";
|
|
3942
|
+
}
|
|
3943
|
+
}
|
|
3944
|
+
const ra = {
|
|
3945
|
+
IfcRelAggregates: A.Aggregates,
|
|
3946
|
+
IfcRelAssignsToGroup: A.AssignsToGroup,
|
|
3947
|
+
IfcRelContainedInSpatialStructure: A.ContainsElements,
|
|
3948
|
+
IfcRelNests: A.Aggregates,
|
|
3949
|
+
IfcRelVoidsElement: A.VoidsElement,
|
|
3950
|
+
IfcRelFillsElement: A.FillsElement
|
|
3951
|
+
};
|
|
3952
|
+
ca = function(e) {
|
|
3953
|
+
function t(i, n) {
|
|
3954
|
+
const r = n.toLowerCase(), s = N(e, i);
|
|
3955
|
+
for (const l of s)if (l.name.toLowerCase() === r) return l.value;
|
|
3956
|
+
}
|
|
3957
|
+
const a = {
|
|
3958
|
+
getEntityType (i) {
|
|
3959
|
+
const n = e.entities?.getTypeName?.(i);
|
|
3960
|
+
if (n && n !== "Unknown") return n;
|
|
3961
|
+
const r = e.entityIndex?.byId;
|
|
3962
|
+
if (!r) return;
|
|
3963
|
+
const s = r.get(i);
|
|
3964
|
+
if (s) return typeof s == "object" && "type" in s ? String(s.type) : void 0;
|
|
3965
|
+
},
|
|
3966
|
+
getEntityName (i) {
|
|
3967
|
+
const n = t(i, "Name");
|
|
3968
|
+
return n !== void 0 && typeof n == "string" ? n : e.entities?.getName?.(i) || void 0;
|
|
3969
|
+
},
|
|
3970
|
+
getGlobalId (i) {
|
|
3971
|
+
const n = t(i, "GlobalId");
|
|
3972
|
+
return n !== void 0 && typeof n == "string" ? n : e.entities?.getGlobalId?.(i) || void 0;
|
|
3973
|
+
},
|
|
3974
|
+
getDescription (i) {
|
|
3975
|
+
const n = t(i, "Description");
|
|
3976
|
+
return n !== void 0 && typeof n == "string" ? n : e.entities?.getDescription?.(i) || void 0;
|
|
3977
|
+
},
|
|
3978
|
+
getAttributeNames (i) {
|
|
3979
|
+
return N(e, i).map((n)=>n.name);
|
|
3980
|
+
},
|
|
3981
|
+
getAttributeXsdTypes (i, n) {
|
|
3982
|
+
const r = a.getEntityType(i);
|
|
3983
|
+
if (r) return Me(na(e.schemaVersion), r, n);
|
|
3984
|
+
},
|
|
3985
|
+
getPredefinedTypeRaw (i) {
|
|
3986
|
+
return ia(e, i);
|
|
3987
|
+
},
|
|
3988
|
+
getObjectType (i) {
|
|
3989
|
+
return aa(e, i, ()=>e.entities?.getObjectType?.(i));
|
|
3990
|
+
},
|
|
3991
|
+
getEntitiesByType (i) {
|
|
3992
|
+
const n = e.entityIndex?.byType?.get(i.toUpperCase());
|
|
3993
|
+
return n ? Array.from(n) : [];
|
|
3994
|
+
},
|
|
3995
|
+
getAllEntityIds () {
|
|
3996
|
+
const i = e.entityIndex?.byId;
|
|
3997
|
+
return i ? Array.from(i.keys()) : [];
|
|
3998
|
+
},
|
|
3999
|
+
getPropertyValue (i, n, r) {
|
|
4000
|
+
const s = n.toLowerCase(), l = r.toLowerCase(), o = Q(e, i);
|
|
4001
|
+
for (const u of o)if (u.name.toLowerCase() === s) {
|
|
4002
|
+
for (const c of u.properties || [])if (c.name.toLowerCase() === l) return {
|
|
4003
|
+
value: c.value,
|
|
4004
|
+
dataType: c.dataType,
|
|
4005
|
+
propertySetName: u.name,
|
|
4006
|
+
propertyName: c.name
|
|
4007
|
+
};
|
|
4008
|
+
}
|
|
4009
|
+
},
|
|
4010
|
+
getPropertySets (i) {
|
|
4011
|
+
return Q(e, i);
|
|
4012
|
+
},
|
|
4013
|
+
getClassifications (i) {
|
|
4014
|
+
return ji(e, i);
|
|
4015
|
+
},
|
|
4016
|
+
getMaterials (i) {
|
|
4017
|
+
return Gi(Re(e, i));
|
|
4018
|
+
},
|
|
4019
|
+
getParent (i, n) {
|
|
4020
|
+
const r = a.getAncestors(i, n);
|
|
4021
|
+
return r.length > 0 ? r[0] : void 0;
|
|
4022
|
+
},
|
|
4023
|
+
getAncestors (i, n) {
|
|
4024
|
+
const r = e.relationships;
|
|
4025
|
+
if (!r?.getRelated) return [];
|
|
4026
|
+
const s = ra[n];
|
|
4027
|
+
if (s === void 0) return [];
|
|
4028
|
+
const l = [], o = new Set([
|
|
4029
|
+
i
|
|
4030
|
+
]), u = [
|
|
4031
|
+
i
|
|
4032
|
+
];
|
|
4033
|
+
for(; u.length > 0;){
|
|
4034
|
+
const c = u.shift(), f = r.getRelated(c, s, "inverse");
|
|
4035
|
+
for (const d of f || [])o.has(d) || (o.add(d), l.push({
|
|
4036
|
+
expressId: d,
|
|
4037
|
+
entityType: a.getEntityType(d) || "Unknown",
|
|
4038
|
+
predefinedType: a.getObjectType(d)
|
|
4039
|
+
}), u.push(d));
|
|
4040
|
+
}
|
|
4041
|
+
return l;
|
|
4042
|
+
},
|
|
4043
|
+
getAttribute (i, n) {
|
|
4044
|
+
switch(n.toLowerCase()){
|
|
4045
|
+
case "name":
|
|
4046
|
+
return a.getEntityName(i);
|
|
4047
|
+
case "description":
|
|
4048
|
+
return a.getDescription(i);
|
|
4049
|
+
case "globalid":
|
|
4050
|
+
return a.getGlobalId(i);
|
|
4051
|
+
case "objecttype":
|
|
4052
|
+
case "predefinedtype":
|
|
4053
|
+
return a.getObjectType(i);
|
|
4054
|
+
default:
|
|
4055
|
+
{
|
|
4056
|
+
const s = t(i, n);
|
|
4057
|
+
if (s !== void 0) return s;
|
|
4058
|
+
const l = e.entities;
|
|
4059
|
+
return l?.getAttribute ? l.getAttribute(i, n) : void 0;
|
|
4060
|
+
}
|
|
4061
|
+
}
|
|
4062
|
+
}
|
|
4063
|
+
};
|
|
4064
|
+
return a;
|
|
4065
|
+
};
|
|
4066
|
+
});
|
|
4067
|
+
export { g as I, ua as a, oa as b, ca as c, Ne as p, la as v, __tla };
|