@roomle/web-sdk 2.113.0-debug.12 → 3.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/lib/{BufferGeometry-DxMNUz5W.mjs → BufferGeometry-B5LFGvE2.mjs} +2 -2
- package/lib/{BufferGeometry-DxMNUz5W.mjs.map → BufferGeometry-B5LFGvE2.mjs.map} +1 -1
- package/lib/ConfiguratorKernel.wasm +0 -0
- package/lib/{GLTFExporter-D6nmo8bl.mjs → GLTFExporter-C1gRWpQj.mjs} +16 -16
- package/lib/{GLTFExporter-D6nmo8bl.mjs.map → GLTFExporter-C1gRWpQj.mjs.map} +1 -1
- package/lib/{PointLightHelper-BfkYMbMn.mjs → PointLightHelper-BDeJgAoy.mjs} +12 -12
- package/lib/{PointLightHelper-BfkYMbMn.mjs.map → PointLightHelper-BDeJgAoy.mjs.map} +1 -1
- package/lib/RoomleCore.wasm +0 -0
- package/lib/RoomleToolsCore.wasm +0 -0
- package/lib/{SpotLightHelper-DgUtIhfr.mjs → SpotLightHelper-ZYLkUTeq.mjs} +3 -3
- package/lib/{SpotLightHelper-DgUtIhfr.mjs.map → SpotLightHelper-ZYLkUTeq.mjs.map} +1 -1
- package/lib/{USDZExporter-DolKgErZ.mjs → USDZExporter-PH7aPEeu.mjs} +2 -2
- package/lib/{USDZExporter-DolKgErZ.mjs.map → USDZExporter-PH7aPEeu.mjs.map} +1 -1
- package/lib/{banana-for-scale-DRVLP1E5.mjs → banana-for-scale-Bs-c973M.mjs} +2 -2
- package/lib/{banana-for-scale-DRVLP1E5.mjs.map → banana-for-scale-Bs-c973M.mjs.map} +1 -1
- package/lib/{component-dimensioning-DR-QAVWc.mjs → component-dimensioning-Ci8YTggz.mjs} +2 -2
- package/lib/{component-dimensioning-DR-QAVWc.mjs.map → component-dimensioning-Ci8YTggz.mjs.map} +1 -1
- package/lib/{continuous-drawing-helper-CYEmULFe.mjs → continuous-drawing-helper-Dtw7ggwm.mjs} +2 -2
- package/lib/{continuous-drawing-helper-CYEmULFe.mjs.map → continuous-drawing-helper-Dtw7ggwm.mjs.map} +1 -1
- package/lib/{homag-intelligence-Bq-oBRsz.mjs → homag-intelligence-BM21wVTA.mjs} +390 -314
- package/lib/homag-intelligence-BM21wVTA.mjs.map +1 -0
- package/lib/{imos-ix-poc-export-helper-qHVFmcvf.mjs → imos-ix-poc-export-helper-BU1sN6Ne.mjs} +2 -2
- package/lib/{imos-ix-poc-export-helper-qHVFmcvf.mjs.map → imos-ix-poc-export-helper-BU1sN6Ne.mjs.map} +1 -1
- package/lib/{index-JPCZ4gUe.mjs → index-D42y5zd8.mjs} +2560 -2532
- package/lib/index-D42y5zd8.mjs.map +1 -0
- package/lib/{material-viewer-BEGEyF_X.mjs → material-viewer-By12ABiJ.mjs} +2 -2
- package/lib/material-viewer-By12ABiJ.mjs.map +1 -0
- package/lib/roomle-sdk.d.ts +70 -259
- package/lib/roomle-sdk.js +11 -11
- package/lib/static/roomle-core-hsc/ConfiguratorKernel.wasm +0 -0
- package/lib/static/roomle-core-hsc/RoomleCore.wasm +0 -0
- package/lib/static/roomle-core-hsc/RoomleServiceCore.wasm +0 -0
- package/lib/static/roomle-core-hsc/RoomleToolsCore.wasm +0 -0
- package/lib/static/roomle-core-hsc/configuratorCoreInterface.d.ts +1 -0
- package/lib/static/roomle-core-hsc/embind/configuratorCoreInterface.d.ts +1 -0
- package/lib/static/roomle-core-hsc/embind/plannerCoreInterface.d.ts +1 -0
- package/lib/static/roomle-core-hsc/package.json +1 -1
- package/lib/static/roomle-core-hsc/plannerCoreInterface.d.ts +1 -0
- package/lib/static/roomle-core-hsc/src/embind/configuratorCoreInterface.d.ts +1 -0
- package/lib/static/roomle-core-hsc/src/embind/plannerCoreInterface.d.ts +1 -0
- package/lib/static/roomle-core-hsc/wasm_modern/ConfiguratorKernel.wasm +0 -0
- package/lib/static/roomle-core-hsc/wasm_modern/RoomleCore.wasm +0 -0
- package/lib/static/roomle-core-hsc/wasm_modern/RoomleServiceCore.wasm +0 -0
- package/lib/static/roomle-core-hsc/wasm_modern/RoomleToolsCore.wasm +0 -0
- package/lib/{stats-helper-DmMNmZ05.mjs → stats-helper-D-83CCNk.mjs} +2 -2
- package/lib/{stats-helper-DmMNmZ05.mjs.map → stats-helper-D-83CCNk.mjs.map} +1 -1
- package/lib/{three.webgpu-BHLDP7Yy.mjs → three.webgpu-BnovKq12.mjs} +3 -3
- package/lib/{three.webgpu-BHLDP7Yy.mjs.map → three.webgpu-BnovKq12.mjs.map} +1 -1
- package/lib/{tools-core-BjEVsNG6.mjs → tools-core-CUzb2OCL.mjs} +2 -2
- package/lib/{tools-core-BjEVsNG6.mjs.map → tools-core-CUzb2OCL.mjs.map} +1 -1
- package/package.json +1 -1
- package/lib/homag-intelligence-Bq-oBRsz.mjs.map +0 -1
- package/lib/index-JPCZ4gUe.mjs.map +0 -1
- package/lib/material-viewer-BEGEyF_X.mjs.map +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { A as _, J as g, K as
|
|
1
|
+
import { A as _, J as g, K as I, N as L, O as M, Q as R } from "./index-D42y5zd8.mjs";
|
|
2
2
|
class O {
|
|
3
3
|
}
|
|
4
4
|
const f = {
|
|
5
5
|
HIDE: "hide",
|
|
6
6
|
SHOW_ATTRIBUTES: "attributes",
|
|
7
7
|
SHOW_ARTICLES: "articles"
|
|
8
|
-
},
|
|
8
|
+
}, b = {
|
|
9
9
|
NONE: "none",
|
|
10
10
|
GROUP: "group",
|
|
11
11
|
ROOT_MODULE: "rootModule",
|
|
12
12
|
SUB_MODULE: "subModule"
|
|
13
|
-
},
|
|
13
|
+
}, m = {
|
|
14
14
|
MULTI_SELECT: "multiselect",
|
|
15
15
|
TC_CONFIG: "tc-config",
|
|
16
16
|
RML_OBJECT: "rml-object"
|
|
@@ -18,7 +18,7 @@ const f = {
|
|
|
18
18
|
class w {
|
|
19
19
|
constructor(t) {
|
|
20
20
|
this._callbacks = null, this._contextType = _.PLANNER, this._selectionMode = null, this._hiSelection = {
|
|
21
|
-
type:
|
|
21
|
+
type: b.NONE,
|
|
22
22
|
groupId: null,
|
|
23
23
|
rootModuleId: null,
|
|
24
24
|
subModuleId: null
|
|
@@ -42,7 +42,7 @@ class w {
|
|
|
42
42
|
this._contextType = t, t === _.PLANNER && this._resetSelection(), this._handleViewTypeChange();
|
|
43
43
|
}
|
|
44
44
|
groupOrModuleSelected(t, e, o) {
|
|
45
|
-
this._selectionMode =
|
|
45
|
+
this._selectionMode = m.TC_CONFIG, this._hiSelection.groupId = t, this._hiSelection.rootModuleId = e ?? null, this._hiSelection.subModuleId = o ?? null, this._hiSelection.rootModuleId && this._hiSelection.subModuleId ? this._hiSelection.type = b.SUB_MODULE : this._hiSelection.rootModuleId ? this._hiSelection.type = b.ROOT_MODULE : this._hiSelection.type = b.GROUP, this._handleViewTypeChange();
|
|
46
46
|
}
|
|
47
47
|
componentSelectionCancel(t) {
|
|
48
48
|
this._contextType === _.CONFIGURATOR && (t === "click_outside" || t === "isolation_mode_cancelled" || t === "select_other" || (this._resetSelection(), this._handleViewTypeChange()));
|
|
@@ -50,7 +50,7 @@ class w {
|
|
|
50
50
|
selectionCancel(t) {
|
|
51
51
|
t !== "select_other" && (this._resetSelection(), this._handleViewTypeChange());
|
|
52
52
|
}
|
|
53
|
-
selectionChanged(t, e, o,
|
|
53
|
+
selectionChanged(t, e, o, i, r) {
|
|
54
54
|
this._selectionHandler(
|
|
55
55
|
_.PLANNER,
|
|
56
56
|
t,
|
|
@@ -61,18 +61,18 @@ class w {
|
|
|
61
61
|
_resetSelection() {
|
|
62
62
|
this._selectionMode = null;
|
|
63
63
|
}
|
|
64
|
-
_selectionHandler(t, e, o,
|
|
64
|
+
_selectionHandler(t, e, o, i) {
|
|
65
65
|
if (t !== _.CONFIGURATOR) {
|
|
66
|
-
if (e ===
|
|
66
|
+
if (e === m.MULTI_SELECT) {
|
|
67
67
|
this._selectionMode = e, this._handleViewTypeChange();
|
|
68
68
|
return;
|
|
69
69
|
}
|
|
70
|
-
o === "external-configuration" &&
|
|
70
|
+
o === "external-configuration" && i.externalConfigurationType === m.TC_CONFIG ? this._selectionMode = m.TC_CONFIG : this._selectionMode = m.RML_OBJECT, this._handleViewTypeChange();
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
_handleViewTypeChange() {
|
|
74
74
|
let t = f.SHOW_ARTICLES;
|
|
75
|
-
this._selectionMode ===
|
|
75
|
+
this._selectionMode === m.TC_CONFIG && (this._contextType === _.CONFIGURATOR || this._hiSelection.type !== b.GROUP) && (t = f.SHOW_ATTRIBUTES), this._emitSelectionChange(t);
|
|
76
76
|
}
|
|
77
77
|
_emitSelectionChange(t) {
|
|
78
78
|
if (this._emittedSelection.panel !== t) {
|
|
@@ -91,7 +91,7 @@ class w {
|
|
|
91
91
|
));
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
|
-
class
|
|
94
|
+
class A {
|
|
95
95
|
constructor(t, e = null) {
|
|
96
96
|
this._libraryData = /* @__PURE__ */ new Map(), this._posDataForLoading = null, this._posArticleMap = /* @__PURE__ */ new Map(), this._posSubArticleMap = /* @__PURE__ */ new Map(), this._groupMap = /* @__PURE__ */ new Map(), this._nextPosDataId = 1, this._hiCallbacks = null, this._pendingGroupsToBeLoaded = [], this._planCompletelyLoaded = !1, this._validSubArticles = [], this._designerRequests = t, this._hiCallbacks = e, this._hiObjectSelection = new w(e);
|
|
97
97
|
}
|
|
@@ -118,8 +118,8 @@ class D {
|
|
|
118
118
|
}
|
|
119
119
|
loadPosData(t, e) {
|
|
120
120
|
t?.articles && (t = t.articles), t.forEach((o) => {
|
|
121
|
-
const
|
|
122
|
-
r.libraryId = e, r.isConfigDummy ? this._posSubArticleMap.set(
|
|
121
|
+
const i = o.id || o.articleId, r = g(o);
|
|
122
|
+
r.libraryId = e, r.isConfigDummy ? this._posSubArticleMap.set(i, r) : this._posArticleMap.set(i, r);
|
|
123
123
|
});
|
|
124
124
|
}
|
|
125
125
|
setPosDataForLoading(t) {
|
|
@@ -135,18 +135,18 @@ class D {
|
|
|
135
135
|
return this._posDataForLoading?.groups ?? null;
|
|
136
136
|
}
|
|
137
137
|
async newPosDataFromId(t) {
|
|
138
|
-
|
|
138
|
+
I(t) && (t = L(t));
|
|
139
139
|
let e = !1, o;
|
|
140
140
|
if (this._posArticleMap.has(t) ? o = g(this._posArticleMap.get(t)) : this._posSubArticleMap.has(t) && (e = !0, o = g(this._posSubArticleMap.get(t))), !o)
|
|
141
141
|
return;
|
|
142
|
-
const
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
)?.posGroupVersion,
|
|
146
|
-
|
|
142
|
+
const i = o;
|
|
143
|
+
i.ver = this.getLibraryData(
|
|
144
|
+
i.libraryId
|
|
145
|
+
)?.posGroupVersion, i.logMessages = [], i.roots.forEach((s) => {
|
|
146
|
+
s.libraryId = o.libraryId, s.catalog = o.catalog, s.logMessages = [], s.isGenerated || (s.articleName = o.articleName, s.articleId = o.articleId, s.desc = o.desc, s.imageUrl = o.imageUrl, s.category = o.category);
|
|
147
147
|
});
|
|
148
148
|
let r;
|
|
149
|
-
return e ? r = this._calculateNewGroup(
|
|
149
|
+
return e ? r = this._calculateNewGroup(i, !1) : (r = this._addNewGroup(i, !1).posDataJson, this._groupsModified(r, [], [])), r;
|
|
150
150
|
}
|
|
151
151
|
async newPosDataFromGroup(t) {
|
|
152
152
|
const e = this._addNewGroup(t, !1);
|
|
@@ -176,8 +176,8 @@ class D {
|
|
|
176
176
|
async selectSubModule(t, e, o) {
|
|
177
177
|
try {
|
|
178
178
|
await this._designerRequests.selectModule(e, o);
|
|
179
|
-
} catch (
|
|
180
|
-
console.error(
|
|
179
|
+
} catch (i) {
|
|
180
|
+
console.error(i);
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
async openCloseGroup(t) {
|
|
@@ -193,25 +193,25 @@ class D {
|
|
|
193
193
|
}
|
|
194
194
|
deleteRootModule(t, e, o) {
|
|
195
195
|
try {
|
|
196
|
-
const
|
|
197
|
-
if (
|
|
198
|
-
this._setGroupPosition(
|
|
199
|
-
const r =
|
|
196
|
+
const i = this._getGroup(t.groupId);
|
|
197
|
+
if (i) {
|
|
198
|
+
this._setGroupPosition(i, t), this._setGroupContour(i, t), this._setRootModulesPosition(i, t);
|
|
199
|
+
const r = i.posDataJson;
|
|
200
200
|
r.roots = r.roots.filter(
|
|
201
201
|
(a) => a.id !== e
|
|
202
202
|
);
|
|
203
|
-
const
|
|
204
|
-
|
|
203
|
+
const s = this._splitOffGroupsFromGroups(
|
|
204
|
+
i,
|
|
205
205
|
o
|
|
206
206
|
);
|
|
207
|
-
this._calculateAndUpdateGroupMap(
|
|
208
|
-
|
|
209
|
-
|
|
207
|
+
this._calculateAndUpdateGroupMap(i), this._loadPosData(i, s), this._groupsModified(
|
|
208
|
+
s.map((a) => a.posDataJson),
|
|
209
|
+
i.posDataJson,
|
|
210
210
|
[]
|
|
211
211
|
);
|
|
212
212
|
}
|
|
213
|
-
} catch (
|
|
214
|
-
console.error(
|
|
213
|
+
} catch (i) {
|
|
214
|
+
console.error(i);
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
217
|
duplicateGroup(t) {
|
|
@@ -221,13 +221,13 @@ class D {
|
|
|
221
221
|
const o = g(e.posDataJson);
|
|
222
222
|
o.roots = o.roots.filter(
|
|
223
223
|
(r) => t.rootModules.find(
|
|
224
|
-
(
|
|
224
|
+
(s) => s.moduleId === r.id
|
|
225
225
|
) !== void 0
|
|
226
226
|
);
|
|
227
|
-
const
|
|
228
|
-
this._setGroupPosition(
|
|
227
|
+
const i = this._addNewGroup(o, !1);
|
|
228
|
+
this._setGroupPosition(i, t), this._designerRequests.loadPosGroups(i.posDataJson, {
|
|
229
229
|
findFreeSpaceInPlan: !0
|
|
230
|
-
}), this._groupsModified(
|
|
230
|
+
}), this._groupsModified(i.posDataJson, [], []);
|
|
231
231
|
}
|
|
232
232
|
} catch (e) {
|
|
233
233
|
console.error(e);
|
|
@@ -235,14 +235,14 @@ class D {
|
|
|
235
235
|
}
|
|
236
236
|
mergeGroups(t, e, o) {
|
|
237
237
|
try {
|
|
238
|
-
const
|
|
239
|
-
if (this._groupMap.has(t.groupId) &&
|
|
238
|
+
const i = Array.isArray(e) ? e : [e];
|
|
239
|
+
if (this._groupMap.has(t.groupId) && i.length > 0) {
|
|
240
240
|
const r = [];
|
|
241
|
-
for (const n of
|
|
241
|
+
for (const n of i) {
|
|
242
242
|
const l = this._getGroup(n);
|
|
243
243
|
l && r.push(...l.posDataJson.roots);
|
|
244
244
|
}
|
|
245
|
-
const
|
|
245
|
+
const s = r.filter(
|
|
246
246
|
(n) => !n.isGenerated
|
|
247
247
|
), a = this._getGroup(t.groupId);
|
|
248
248
|
if (a) {
|
|
@@ -252,43 +252,43 @@ class D {
|
|
|
252
252
|
n && this._applyImplicitRelevantAttributes(
|
|
253
253
|
this._getLibraryIdForPosData(a.posDataJson),
|
|
254
254
|
n,
|
|
255
|
-
|
|
256
|
-
), a.posDataJson.roots.push(...
|
|
257
|
-
mergedGroups:
|
|
255
|
+
s
|
|
256
|
+
), a.posDataJson.roots.push(...s), this._setGroupPosition(a, t), this._setGroupContour(a, t), this._setRootModulesPosition(a, t), this._calculateAndUpdateGroupMap(a), this._designerRequests.loadPosGroups(a.posDataJson, {
|
|
257
|
+
mergedGroups: i
|
|
258
258
|
});
|
|
259
259
|
const l = [];
|
|
260
|
-
for (const d of
|
|
260
|
+
for (const d of i)
|
|
261
261
|
this._groupMap.has(d) && (this._groupMap.delete(d), l.push(d));
|
|
262
262
|
this._groupsModified([], a.posDataJson, l);
|
|
263
263
|
}
|
|
264
264
|
}
|
|
265
|
-
} catch (
|
|
266
|
-
console.error(
|
|
265
|
+
} catch (i) {
|
|
266
|
+
console.error(i);
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
269
|
_applyImplicitRelevantAttributes(t, e, o) {
|
|
270
|
-
const
|
|
271
|
-
if (!
|
|
270
|
+
const i = this.getLibraryData(t)?.masterData;
|
|
271
|
+
if (!i || !e || o.length === 0)
|
|
272
272
|
return;
|
|
273
|
-
const
|
|
273
|
+
const s = i.modules.find(
|
|
274
274
|
(a) => a.id === e.name
|
|
275
275
|
)?.assignedAttributes.filter(
|
|
276
|
-
(a) =>
|
|
276
|
+
(a) => i.attributes.find((n) => n.id === a)?.implicitRelevant === !0
|
|
277
277
|
) ?? [];
|
|
278
278
|
for (const a of o) {
|
|
279
|
-
const n =
|
|
279
|
+
const n = i.modules.find(
|
|
280
280
|
(l) => l.id === a.name
|
|
281
281
|
);
|
|
282
|
-
for (const l of
|
|
282
|
+
for (const l of s) {
|
|
283
283
|
const d = e.attributes?.find(
|
|
284
|
-
(
|
|
284
|
+
(y) => y.id === l
|
|
285
285
|
);
|
|
286
286
|
if (!n?.assignedAttributes.find(
|
|
287
|
-
(
|
|
287
|
+
(y) => y === l
|
|
288
288
|
))
|
|
289
289
|
continue;
|
|
290
290
|
const p = a.attributes?.find(
|
|
291
|
-
(
|
|
291
|
+
(y) => y.id === l
|
|
292
292
|
);
|
|
293
293
|
p ? (p.isInput = d?.isInput ?? !1, p.isInput === !0 && (p.value = d?.value)) : (d?.isInput ?? !1) && a.attributes?.push({
|
|
294
294
|
id: l,
|
|
@@ -303,12 +303,12 @@ class D {
|
|
|
303
303
|
const o = this._getGroup(t.groupId);
|
|
304
304
|
if (o) {
|
|
305
305
|
this._setGroupPosition(o, t), this._setGroupContour(o, t), this._setRootModulesPosition(o, t);
|
|
306
|
-
const
|
|
306
|
+
const i = Array.isArray(e) ? e : [e], r = this._splitOffGroupsFromGroups(
|
|
307
307
|
o,
|
|
308
|
-
|
|
308
|
+
i
|
|
309
309
|
);
|
|
310
310
|
this._calculateAndUpdateGroupMap(o), this._loadPosData(o, r), this._groupsModified(
|
|
311
|
-
r.map((
|
|
311
|
+
r.map((s) => s.posDataJson),
|
|
312
312
|
o.posDataJson,
|
|
313
313
|
[]
|
|
314
314
|
);
|
|
@@ -321,11 +321,11 @@ class D {
|
|
|
321
321
|
try {
|
|
322
322
|
const e = this._getGroup(t.groupId);
|
|
323
323
|
if (e) {
|
|
324
|
-
for (const
|
|
324
|
+
for (const i of e.posDataJson.roots)
|
|
325
325
|
t.rootModules.filter(
|
|
326
|
-
(r) => r.moduleId ===
|
|
326
|
+
(r) => r.moduleId === i.id
|
|
327
327
|
).forEach((r) => {
|
|
328
|
-
|
|
328
|
+
i.articlePos = r.pos, i.rotationY = r.rotationY;
|
|
329
329
|
});
|
|
330
330
|
const o = this._calculateAndUpdateGroupMap(e);
|
|
331
331
|
this._designerRequests.loadPosGroups(o, {}), this._groupsModified([], o, []);
|
|
@@ -343,8 +343,8 @@ class D {
|
|
|
343
343
|
}
|
|
344
344
|
changedGroupFromHistory(t, e) {
|
|
345
345
|
try {
|
|
346
|
-
const o = this._calculate(t),
|
|
347
|
-
r ? r.posDataJson = o : this._addGroupToMap(
|
|
346
|
+
const o = this._calculate(t), i = o.id, r = this._getGroup(i);
|
|
347
|
+
r ? r.posDataJson = o : this._addGroupToMap(i, o), e && this._designerRequests.loadPosGroups(t, {}), this._groupsModified(
|
|
348
348
|
r ? [] : [o],
|
|
349
349
|
r ? [o] : [],
|
|
350
350
|
[]
|
|
@@ -387,7 +387,7 @@ class D {
|
|
|
387
387
|
return;
|
|
388
388
|
}
|
|
389
389
|
const e = this._posDataForLoading.groups.find(
|
|
390
|
-
(
|
|
390
|
+
(i) => i.id === t.id
|
|
391
391
|
);
|
|
392
392
|
if (!e) {
|
|
393
393
|
this.removedGroup(t.id), this._designerRequests.deleteGroup(t.id);
|
|
@@ -400,9 +400,9 @@ class D {
|
|
|
400
400
|
try {
|
|
401
401
|
const e = t.id, o = !this._groupMap.has(e);
|
|
402
402
|
o && this._addGroupToMap(e, t);
|
|
403
|
-
const
|
|
404
|
-
if (
|
|
405
|
-
const r = this._calculateAndUpdateGroupMap(
|
|
403
|
+
const i = this._getGroup(e);
|
|
404
|
+
if (i) {
|
|
405
|
+
const r = this._calculateAndUpdateGroupMap(i);
|
|
406
406
|
this._designerRequests.loadPosGroups(r, {
|
|
407
407
|
respondWithPositionInPlan: !0
|
|
408
408
|
}), this._groupsModified(
|
|
@@ -424,22 +424,20 @@ class D {
|
|
|
424
424
|
async getGroupDataForOrder(t) {
|
|
425
425
|
try {
|
|
426
426
|
const e = Array.from(this._groupMap.values()).map(
|
|
427
|
-
(
|
|
427
|
+
(s) => s.posDataJson
|
|
428
428
|
);
|
|
429
429
|
let o = 1;
|
|
430
|
-
e.forEach((
|
|
431
|
-
|
|
430
|
+
e.forEach((s) => {
|
|
431
|
+
s.roots.forEach((a) => {
|
|
432
432
|
a.additionalText = "Additional Text " + o++;
|
|
433
433
|
});
|
|
434
434
|
});
|
|
435
|
-
const
|
|
435
|
+
const i = await this._designerRequests.getRoomInformation(), r = this.getLibraryData(t)?.getOrderData(
|
|
436
436
|
e,
|
|
437
|
-
t
|
|
437
|
+
t,
|
|
438
|
+
i?.rooms ?? []
|
|
438
439
|
);
|
|
439
|
-
|
|
440
|
-
return null;
|
|
441
|
-
const r = await this._designerRequests.getRoomInformation();
|
|
442
|
-
return s.rooms = r?.rooms ?? [], s;
|
|
440
|
+
return r || null;
|
|
443
441
|
} catch (e) {
|
|
444
442
|
return console.error(e), null;
|
|
445
443
|
}
|
|
@@ -454,35 +452,35 @@ class D {
|
|
|
454
452
|
_setRootModulesPosition(t, e) {
|
|
455
453
|
for (const o of t.posDataJson.roots)
|
|
456
454
|
e.rootModules.filter(
|
|
457
|
-
(
|
|
458
|
-
).forEach((
|
|
459
|
-
o.articlePos =
|
|
455
|
+
(i) => i.moduleId === o.id
|
|
456
|
+
).forEach((i) => {
|
|
457
|
+
o.articlePos = i.pos, o.rotationY = i.rotationY;
|
|
460
458
|
});
|
|
461
459
|
}
|
|
462
460
|
_loadPosData(t, e) {
|
|
463
|
-
const o = g(t.posDataJson),
|
|
461
|
+
const o = g(t.posDataJson), i = Array.isArray(o) ? o : [o];
|
|
464
462
|
for (const r of e ?? [])
|
|
465
|
-
|
|
466
|
-
this._designerRequests.loadPosGroups(
|
|
463
|
+
i.push(g(r.posDataJson));
|
|
464
|
+
this._designerRequests.loadPosGroups(i, {});
|
|
467
465
|
}
|
|
468
466
|
_splitOffGroupsFromGroups(t, e) {
|
|
469
467
|
const o = [];
|
|
470
|
-
for (const
|
|
468
|
+
for (const i of e ?? []) {
|
|
471
469
|
const r = this._splitOffRootModulesFromGroup(
|
|
472
470
|
t,
|
|
473
|
-
|
|
474
|
-
),
|
|
475
|
-
o.push(
|
|
471
|
+
i
|
|
472
|
+
), s = this._addNewGroup(r, !0);
|
|
473
|
+
o.push(s);
|
|
476
474
|
}
|
|
477
475
|
return o;
|
|
478
476
|
}
|
|
479
477
|
_splitOffRootModulesFromGroup(t, e) {
|
|
480
478
|
const o = e.rootModules.map(
|
|
481
479
|
(a) => a.moduleId
|
|
482
|
-
),
|
|
480
|
+
), i = t.posDataJson, r = i.roots.filter(
|
|
483
481
|
(a) => o.includes(a.id)
|
|
484
482
|
);
|
|
485
|
-
|
|
483
|
+
i.roots = i.roots.filter(
|
|
486
484
|
(a) => !o.includes(a.id)
|
|
487
485
|
);
|
|
488
486
|
for (const a of r)
|
|
@@ -491,15 +489,15 @@ class D {
|
|
|
491
489
|
).forEach((n) => {
|
|
492
490
|
a.articlePos = n.pos, a.rotationY = n.rotationY;
|
|
493
491
|
});
|
|
494
|
-
for (const a of
|
|
492
|
+
for (const a of i.roots)
|
|
495
493
|
a.isGenerated && r.push(g(a));
|
|
496
494
|
return {
|
|
497
495
|
id: void 0,
|
|
498
|
-
libraryId:
|
|
496
|
+
libraryId: i.libraryId,
|
|
499
497
|
pos: e.pos,
|
|
500
498
|
rotationY: e.rotationY,
|
|
501
499
|
roots: r,
|
|
502
|
-
ver:
|
|
500
|
+
ver: i.ver,
|
|
503
501
|
logMessages: []
|
|
504
502
|
};
|
|
505
503
|
}
|
|
@@ -511,10 +509,10 @@ class D {
|
|
|
511
509
|
}
|
|
512
510
|
_setSubmoduleImages(t, e) {
|
|
513
511
|
e && t.modules?.length && t.modules.forEach((o) => {
|
|
514
|
-
const
|
|
512
|
+
const i = e.modules.find(
|
|
515
513
|
(r) => r.id === o.name
|
|
516
514
|
);
|
|
517
|
-
|
|
515
|
+
i && (o.imageUrl = i.imageUrl), this._setSubmoduleImages(o, e);
|
|
518
516
|
});
|
|
519
517
|
}
|
|
520
518
|
_calculateAndUpdateGroupMap(t) {
|
|
@@ -535,7 +533,7 @@ class D {
|
|
|
535
533
|
};
|
|
536
534
|
return this._groupMap.set(t, o), o;
|
|
537
535
|
}
|
|
538
|
-
updateAttribute(t, e, o,
|
|
536
|
+
updateAttribute(t, e, o, i) {
|
|
539
537
|
if (!t)
|
|
540
538
|
return;
|
|
541
539
|
const r = Array.from(this._groupMap.entries()).find(
|
|
@@ -543,29 +541,29 @@ class D {
|
|
|
543
541
|
);
|
|
544
542
|
if (!r)
|
|
545
543
|
throw new Error("PosGroup not found inside the calculated articles list");
|
|
546
|
-
const [,
|
|
547
|
-
if (
|
|
544
|
+
const [, s] = r;
|
|
545
|
+
if (s) {
|
|
548
546
|
const a = this._modifyAttributeOfModules(
|
|
549
|
-
|
|
547
|
+
s,
|
|
550
548
|
e ?? t,
|
|
551
549
|
o,
|
|
552
|
-
|
|
550
|
+
i
|
|
553
551
|
);
|
|
554
552
|
this._designerRequests.loadPosGroups(a, {
|
|
555
553
|
correctArrangement: !0
|
|
556
554
|
}), this._groupsModified([], a, []);
|
|
557
555
|
}
|
|
558
556
|
}
|
|
559
|
-
modifyAttribute(t, e, o,
|
|
557
|
+
modifyAttribute(t, e, o, i) {
|
|
560
558
|
const r = this._getGroup(t);
|
|
561
559
|
if (r) {
|
|
562
|
-
const
|
|
560
|
+
const s = e.map(
|
|
563
561
|
(n) => n.subModuleId ?? n.rootModuleId
|
|
564
562
|
), a = this._modifyAttributeOfModules(
|
|
565
563
|
r,
|
|
566
|
-
|
|
564
|
+
s,
|
|
567
565
|
o,
|
|
568
|
-
|
|
566
|
+
i
|
|
569
567
|
);
|
|
570
568
|
this._designerRequests.loadPosGroups(a, {
|
|
571
569
|
correctArrangement: !0
|
|
@@ -580,19 +578,19 @@ class D {
|
|
|
580
578
|
}
|
|
581
579
|
if (!o.module.checkAttributes)
|
|
582
580
|
return;
|
|
583
|
-
let
|
|
581
|
+
let i;
|
|
584
582
|
try {
|
|
585
|
-
|
|
583
|
+
i = await this.getLibraryData(
|
|
586
584
|
o.group
|
|
587
585
|
)?.getAttributesDropDownValues(o.module, e);
|
|
588
|
-
} catch (
|
|
589
|
-
console.error(
|
|
586
|
+
} catch (s) {
|
|
587
|
+
console.error(s);
|
|
590
588
|
}
|
|
591
|
-
if (!
|
|
589
|
+
if (!i)
|
|
592
590
|
return;
|
|
593
591
|
const r = {};
|
|
594
|
-
for (const [
|
|
595
|
-
a && a.length > 0 && (r[
|
|
592
|
+
for (const [s, a] of Object.entries(i))
|
|
593
|
+
a && a.length > 0 && (r[s] = {
|
|
596
594
|
calcResult: a.map((n) => ({
|
|
597
595
|
value: n.value,
|
|
598
596
|
kind: n.kind
|
|
@@ -600,6 +598,116 @@ class D {
|
|
|
600
598
|
});
|
|
601
599
|
return r;
|
|
602
600
|
}
|
|
601
|
+
async getVerifiedGroupAttributeOptions(t, e) {
|
|
602
|
+
const o = this._getGroup(t);
|
|
603
|
+
if (!o) {
|
|
604
|
+
console.error("Group not found");
|
|
605
|
+
return;
|
|
606
|
+
}
|
|
607
|
+
const i = this.getLibraryData(o.posDataJson);
|
|
608
|
+
if (!i || !i.masterData)
|
|
609
|
+
return;
|
|
610
|
+
const r = e ? Array.isArray(e) ? e : [e] : [], s = this._groupAttributesByModule(
|
|
611
|
+
o,
|
|
612
|
+
i,
|
|
613
|
+
r
|
|
614
|
+
);
|
|
615
|
+
if (s.size === 0)
|
|
616
|
+
return;
|
|
617
|
+
const a = await this._collectAllOptionsPerAttribute(
|
|
618
|
+
s,
|
|
619
|
+
i
|
|
620
|
+
);
|
|
621
|
+
return this._calculateCombinedResults(a);
|
|
622
|
+
}
|
|
623
|
+
_groupAttributesByModule(t, e, o) {
|
|
624
|
+
const i = /* @__PURE__ */ new Map();
|
|
625
|
+
for (const r of o) {
|
|
626
|
+
const s = [];
|
|
627
|
+
for (const a of t.posDataJson.roots)
|
|
628
|
+
this._collectModulesWithAttribute(
|
|
629
|
+
a,
|
|
630
|
+
r,
|
|
631
|
+
e.masterData,
|
|
632
|
+
s
|
|
633
|
+
);
|
|
634
|
+
for (const a of s) {
|
|
635
|
+
const n = i.get(a.id);
|
|
636
|
+
n ? n.attributeIds.push(r) : i.set(a.id, {
|
|
637
|
+
module: a,
|
|
638
|
+
attributeIds: [r]
|
|
639
|
+
});
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
return i;
|
|
643
|
+
}
|
|
644
|
+
async _collectAllOptionsPerAttribute(t, e) {
|
|
645
|
+
const o = /* @__PURE__ */ new Map();
|
|
646
|
+
for (const { module: i, attributeIds: r } of t.values())
|
|
647
|
+
if (i.checkAttributes)
|
|
648
|
+
try {
|
|
649
|
+
const s = await e.getAttributesDropDownValues(
|
|
650
|
+
i,
|
|
651
|
+
r
|
|
652
|
+
);
|
|
653
|
+
if (!s)
|
|
654
|
+
continue;
|
|
655
|
+
for (const a of r) {
|
|
656
|
+
const n = s[a];
|
|
657
|
+
if (n && n.length > 0) {
|
|
658
|
+
let l = o.get(a);
|
|
659
|
+
l || (l = /* @__PURE__ */ new Map(), o.set(a, l));
|
|
660
|
+
for (const d of n) {
|
|
661
|
+
const h = l.get(d.value);
|
|
662
|
+
h ? l.set(
|
|
663
|
+
d.value,
|
|
664
|
+
this._getMoreRestrictedKind(h, d.kind)
|
|
665
|
+
) : l.set(d.value, d.kind);
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
} catch (s) {
|
|
670
|
+
console.error(s);
|
|
671
|
+
}
|
|
672
|
+
return o;
|
|
673
|
+
}
|
|
674
|
+
_calculateCombinedResults(t) {
|
|
675
|
+
const e = {};
|
|
676
|
+
for (const [o, i] of t.entries()) {
|
|
677
|
+
const r = [];
|
|
678
|
+
for (const [s, a] of i.entries())
|
|
679
|
+
r.push({ value: s, kind: a });
|
|
680
|
+
r.sort(
|
|
681
|
+
(s, a) => this._getKindRank(s.kind) - this._getKindRank(a.kind)
|
|
682
|
+
), r.length > 0 && (e[o] = { calcResult: r });
|
|
683
|
+
}
|
|
684
|
+
return Object.keys(e).length > 0 ? e : void 0;
|
|
685
|
+
}
|
|
686
|
+
_getKindRank(t) {
|
|
687
|
+
switch (t) {
|
|
688
|
+
case M.Normal:
|
|
689
|
+
return 0;
|
|
690
|
+
case M.Conflicting:
|
|
691
|
+
return 1;
|
|
692
|
+
case M.Invalid:
|
|
693
|
+
return 2;
|
|
694
|
+
default:
|
|
695
|
+
return 3;
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
_getMoreRestrictedKind(t, e) {
|
|
699
|
+
return this._getKindRank(t) > this._getKindRank(e) ? t : e;
|
|
700
|
+
}
|
|
701
|
+
_collectModulesWithAttribute(t, e, o, i) {
|
|
702
|
+
if (o.modules.find((s) => s.id === t.name)?.assignedAttributes.includes(e) && i.push(t), t.modules)
|
|
703
|
+
for (const s of t.modules)
|
|
704
|
+
this._collectModulesWithAttribute(
|
|
705
|
+
s,
|
|
706
|
+
e,
|
|
707
|
+
o,
|
|
708
|
+
i
|
|
709
|
+
);
|
|
710
|
+
}
|
|
603
711
|
updateAdditionalInfo(t, e) {
|
|
604
712
|
const o = this._findRootModuleInAllGroups(t);
|
|
605
713
|
if (!o) {
|
|
@@ -611,13 +719,13 @@ class D {
|
|
|
611
719
|
o.rootModule.additionalText = e, this._designerRequests.loadPosGroups(o.group, {}), this._groupsModified([], o.group, []);
|
|
612
720
|
}
|
|
613
721
|
async swapRootModule(t, e, o) {
|
|
614
|
-
const
|
|
615
|
-
if (!
|
|
722
|
+
const i = this._getGroup(t);
|
|
723
|
+
if (!i)
|
|
616
724
|
return;
|
|
617
|
-
const r =
|
|
725
|
+
const r = i.posDataJson, s = r.roots.find(
|
|
618
726
|
(p) => p.id === e
|
|
619
727
|
);
|
|
620
|
-
if (!
|
|
728
|
+
if (!s)
|
|
621
729
|
return;
|
|
622
730
|
const a = await this.newPosDataFromId(o), n = a.roots.filter(
|
|
623
731
|
(p) => !p.isGenerated
|
|
@@ -625,14 +733,14 @@ class D {
|
|
|
625
733
|
if (!a || n.length !== 1)
|
|
626
734
|
return;
|
|
627
735
|
const l = n[0];
|
|
628
|
-
|
|
736
|
+
s && this._applyImplicitRelevantAttributes(
|
|
629
737
|
this._getLibraryIdForPosData(r),
|
|
630
|
-
|
|
738
|
+
s,
|
|
631
739
|
[l]
|
|
632
|
-
), l.articlePos =
|
|
740
|
+
), l.articlePos = s.articlePos, l.rotationY = s.rotationY, r.roots = r.roots.filter(
|
|
633
741
|
(p) => p.id !== e
|
|
634
742
|
), r.roots.push(l);
|
|
635
|
-
const d = this._calculateAndUpdateGroupMap(
|
|
743
|
+
const d = this._calculateAndUpdateGroupMap(i), h = {
|
|
636
744
|
originalModuleId: e,
|
|
637
745
|
newModuleId: l.id
|
|
638
746
|
};
|
|
@@ -642,20 +750,20 @@ class D {
|
|
|
642
750
|
moduleIdMap: [h]
|
|
643
751
|
}), this._groupsModified([], d, []);
|
|
644
752
|
}
|
|
645
|
-
_modifyAttributeOfModules(t, e, o,
|
|
646
|
-
const r = Array.isArray(e) ? e : [e],
|
|
753
|
+
_modifyAttributeOfModules(t, e, o, i) {
|
|
754
|
+
const r = Array.isArray(e) ? e : [e], s = this.getLibraryData(t.posDataJson);
|
|
647
755
|
for (const n of r) {
|
|
648
756
|
const l = this._findModule(
|
|
649
757
|
t.posDataJson.roots,
|
|
650
758
|
n
|
|
651
759
|
);
|
|
652
|
-
if (l &&
|
|
653
|
-
const d =
|
|
760
|
+
if (l && s) {
|
|
761
|
+
const d = s.solveModuleAttributeConflict(
|
|
654
762
|
l,
|
|
655
763
|
o,
|
|
656
|
-
|
|
764
|
+
i
|
|
657
765
|
);
|
|
658
|
-
this._setAttribute(l, o,
|
|
766
|
+
this._setAttribute(l, o, i), d && d.length > 0 && d.forEach((h) => {
|
|
659
767
|
h.value !== void 0 && this._setAttribute(
|
|
660
768
|
l,
|
|
661
769
|
h.id,
|
|
@@ -668,32 +776,32 @@ class D {
|
|
|
668
776
|
}
|
|
669
777
|
_setAttribute(t, e, o) {
|
|
670
778
|
if (t.attributes && t.attributes.length > 0) {
|
|
671
|
-
const r = t.attributes.find((
|
|
779
|
+
const r = t.attributes.find((s) => s.id === e);
|
|
672
780
|
if (r) {
|
|
673
781
|
r.value = o, r.isInput = !0;
|
|
674
782
|
return;
|
|
675
783
|
}
|
|
676
784
|
}
|
|
677
|
-
const
|
|
785
|
+
const i = {
|
|
678
786
|
id: e,
|
|
679
787
|
value: o,
|
|
680
788
|
isInput: !0
|
|
681
789
|
};
|
|
682
|
-
t.attributes ? t.attributes.push(
|
|
790
|
+
t.attributes ? t.attributes.push(i) : t.attributes = [i];
|
|
683
791
|
}
|
|
684
792
|
findValidSubArticles(t) {
|
|
685
793
|
this._validSubArticles = [];
|
|
686
794
|
const e = Array.isArray(t) ? t : [t];
|
|
687
795
|
for (const o of e) {
|
|
688
|
-
const
|
|
689
|
-
if (!
|
|
796
|
+
const i = this._getGroup(o);
|
|
797
|
+
if (!i)
|
|
690
798
|
continue;
|
|
691
|
-
const r =
|
|
799
|
+
const r = i.posDataJson, { libraryId: s, libraryData: a } = this._getLibrary(r);
|
|
692
800
|
if (!a)
|
|
693
801
|
continue;
|
|
694
802
|
const n = Array.from(
|
|
695
803
|
this._posSubArticleMap.values()
|
|
696
|
-
).filter((l) => l.libraryId ===
|
|
804
|
+
).filter((l) => l.libraryId === s);
|
|
697
805
|
try {
|
|
698
806
|
const l = a.getValidSubArticles(
|
|
699
807
|
r,
|
|
@@ -716,9 +824,9 @@ class D {
|
|
|
716
824
|
const o = this._getValidSubArticle(e);
|
|
717
825
|
if (!o)
|
|
718
826
|
return [];
|
|
719
|
-
const
|
|
720
|
-
for (const
|
|
721
|
-
const a = this._getGroup(
|
|
827
|
+
const i = Array.isArray(t) ? t : [t], r = [];
|
|
828
|
+
for (const s of i) {
|
|
829
|
+
const a = this._getGroup(s);
|
|
722
830
|
if (!a)
|
|
723
831
|
continue;
|
|
724
832
|
const n = a.posDataJson, { libraryData: l } = this._getLibrary(n);
|
|
@@ -737,44 +845,34 @@ class D {
|
|
|
737
845
|
return r;
|
|
738
846
|
}
|
|
739
847
|
addSubArticle(t, e, o) {
|
|
740
|
-
const
|
|
741
|
-
if (!
|
|
848
|
+
const i = this._getValidSubArticle(t);
|
|
849
|
+
if (!i)
|
|
742
850
|
return;
|
|
743
851
|
const { group: r } = this._findRootModuleInAllGroups(e);
|
|
744
852
|
if (!r)
|
|
745
853
|
return;
|
|
746
|
-
const
|
|
854
|
+
const s = this._addSubArticle(
|
|
747
855
|
r,
|
|
748
|
-
|
|
856
|
+
i,
|
|
749
857
|
e,
|
|
750
858
|
o
|
|
751
859
|
);
|
|
752
|
-
this._designerRequests.loadPosGroups(
|
|
753
|
-
}
|
|
754
|
-
async savePlanSnapshot() {
|
|
755
|
-
const t = await this._designerRequests.saveExternalObjectSnapshot();
|
|
756
|
-
return t ? {
|
|
757
|
-
id: t.planSnapshotId,
|
|
758
|
-
perspectiveImageLink: t.perspectiveImageLink,
|
|
759
|
-
topImageLink: t.topImageLink,
|
|
760
|
-
room3dLink: t.objectGlbLink,
|
|
761
|
-
room3dFullLink: t.fullPlanGlbLink
|
|
762
|
-
} : (console.error("Failed to save plan snapshot"), null);
|
|
860
|
+
this._designerRequests.loadPosGroups(s, {}), this._groupsModified([], s, []);
|
|
763
861
|
}
|
|
764
862
|
_findRootModuleInAllGroups(t) {
|
|
765
863
|
for (const e of this._groupMap.values()) {
|
|
766
|
-
const o = e.posDataJson,
|
|
864
|
+
const o = e.posDataJson, i = o.roots.find(
|
|
767
865
|
(r) => r.id === t
|
|
768
866
|
);
|
|
769
|
-
if (
|
|
770
|
-
return { group: o, rootModule:
|
|
867
|
+
if (i !== void 0)
|
|
868
|
+
return { group: o, rootModule: i };
|
|
771
869
|
}
|
|
772
870
|
}
|
|
773
871
|
_findModuleInAllGroups(t) {
|
|
774
872
|
for (const e of this._groupMap.values()) {
|
|
775
|
-
const o = e.posDataJson,
|
|
776
|
-
if (
|
|
777
|
-
return { group: o, module:
|
|
873
|
+
const o = e.posDataJson, i = this._findModule(o.roots, t);
|
|
874
|
+
if (i !== void 0)
|
|
875
|
+
return { group: o, module: i };
|
|
778
876
|
}
|
|
779
877
|
}
|
|
780
878
|
_findModule(t, e) {
|
|
@@ -782,9 +880,9 @@ class D {
|
|
|
782
880
|
if (o.id === e)
|
|
783
881
|
return o;
|
|
784
882
|
if (o.modules && o.modules.length > 0) {
|
|
785
|
-
const
|
|
786
|
-
if (
|
|
787
|
-
return
|
|
883
|
+
const i = this._findModule(o.modules, e);
|
|
884
|
+
if (i !== void 0)
|
|
885
|
+
return i;
|
|
788
886
|
}
|
|
789
887
|
}
|
|
790
888
|
}
|
|
@@ -805,12 +903,12 @@ class D {
|
|
|
805
903
|
return t.length < 4 && (t = "0".repeat(4 - t.length) + t), "id" + t;
|
|
806
904
|
}
|
|
807
905
|
async _groupsModified(t, e, o) {
|
|
808
|
-
const
|
|
809
|
-
|
|
906
|
+
const i = Array.isArray(t) ? t : [t];
|
|
907
|
+
i.length > 0 && await this._hiCallbacks?.onPosGroupAdded(i);
|
|
810
908
|
const r = Array.isArray(e) ? e : [e];
|
|
811
909
|
r.length > 0 && await this._hiCallbacks?.onPosGroupChanged(r);
|
|
812
|
-
const
|
|
813
|
-
|
|
910
|
+
const s = Array.isArray(o) ? o : [o];
|
|
911
|
+
s.length > 0 && await this._hiCallbacks?.onPosGroupDeleted(s), this._calculatePrice();
|
|
814
912
|
}
|
|
815
913
|
_calculatePrice() {
|
|
816
914
|
const t = Array.from(this._groupMap.values()).map(
|
|
@@ -822,13 +920,13 @@ class D {
|
|
|
822
920
|
const { libraryId: e, libraryData: o } = this._getLibrary(t);
|
|
823
921
|
if (!o)
|
|
824
922
|
return null;
|
|
825
|
-
const
|
|
826
|
-
|
|
827
|
-
let r =
|
|
923
|
+
const i = g(t);
|
|
924
|
+
i.libraryId = e, i.logMessages && (i.logMessages = []);
|
|
925
|
+
let r = i;
|
|
828
926
|
try {
|
|
829
|
-
r = o.calculateGroup(
|
|
830
|
-
} catch (
|
|
831
|
-
console.error("Error calculating group:",
|
|
927
|
+
r = o.calculateGroup(i);
|
|
928
|
+
} catch (s) {
|
|
929
|
+
console.error("Error calculating group:", s);
|
|
832
930
|
}
|
|
833
931
|
return this._takeOverPropertiesFromOriginalGroup(
|
|
834
932
|
e,
|
|
@@ -837,26 +935,26 @@ class D {
|
|
|
837
935
|
r
|
|
838
936
|
), r;
|
|
839
937
|
}
|
|
840
|
-
_addSubArticle(t, e, o,
|
|
841
|
-
const { libraryId: r, libraryData:
|
|
842
|
-
if (!
|
|
938
|
+
_addSubArticle(t, e, o, i) {
|
|
939
|
+
const { libraryId: r, libraryData: s } = this._getLibrary(t);
|
|
940
|
+
if (!s)
|
|
843
941
|
return null;
|
|
844
942
|
const a = g(t);
|
|
845
943
|
a.libraryId = r, a.logMessages && (a.logMessages = []);
|
|
846
944
|
let n = a;
|
|
847
945
|
try {
|
|
848
|
-
n =
|
|
946
|
+
n = s.addSubArticle(
|
|
849
947
|
a,
|
|
850
948
|
e,
|
|
851
949
|
o,
|
|
852
|
-
|
|
853
|
-
), n =
|
|
950
|
+
i
|
|
951
|
+
), n = s.calculateGroup(n);
|
|
854
952
|
} catch (l) {
|
|
855
953
|
console.error("Error adding sub article to group:", l);
|
|
856
954
|
}
|
|
857
955
|
return this._takeOverPropertiesFromOriginalGroup(
|
|
858
956
|
r,
|
|
859
|
-
|
|
957
|
+
s,
|
|
860
958
|
t,
|
|
861
959
|
n
|
|
862
960
|
), this._addGroupToMap(n.id, n), n;
|
|
@@ -865,121 +963,82 @@ class D {
|
|
|
865
963
|
const e = this._getLibraryIdForPosData(t), o = this.getLibraryData(e);
|
|
866
964
|
return { libraryId: e, libraryData: o };
|
|
867
965
|
}
|
|
868
|
-
_takeOverPropertiesFromOriginalGroup(t, e, o,
|
|
869
|
-
o.pos !== void 0 && (
|
|
966
|
+
_takeOverPropertiesFromOriginalGroup(t, e, o, i) {
|
|
967
|
+
o.pos !== void 0 && (i.pos = o.pos), o.rotationY !== void 0 && (i.rotationY = o.rotationY);
|
|
870
968
|
const r = e.masterData;
|
|
871
|
-
|
|
969
|
+
i.roots.forEach((s) => {
|
|
872
970
|
const a = o.roots.find(
|
|
873
|
-
(l) => l.id ===
|
|
874
|
-
), n = r?.modules.find((l) => l.id ===
|
|
875
|
-
|
|
971
|
+
(l) => l.id === s.id
|
|
972
|
+
), n = r?.modules.find((l) => l.id === s.name);
|
|
973
|
+
s.libraryId = a?.libraryId ?? t, s.articleName = a?.articleName ?? a?.articleId ?? n?.name ?? n?.id, s.articleId = a?.articleId ?? a?.articleName ?? n?.id ?? n?.name, s.imageUrl = a?.imageUrl ?? n?.imageUrl, s.desc = a?.desc ?? n?.desc, s.category = a?.category, s.additionalText = a?.additionalText, s.canBeDeleted === void 0 && (s.canBeDeleted = !s.isGenerated), this._setSubmoduleImages(s, r);
|
|
876
974
|
});
|
|
877
975
|
}
|
|
878
976
|
}
|
|
879
977
|
const c = [];
|
|
880
978
|
for (let u = 0; u < 256; ++u)
|
|
881
979
|
c.push((u + 256).toString(16).slice(1));
|
|
882
|
-
function
|
|
980
|
+
function P(u, t = 0) {
|
|
883
981
|
return (c[u[t + 0]] + c[u[t + 1]] + c[u[t + 2]] + c[u[t + 3]] + "-" + c[u[t + 4]] + c[u[t + 5]] + "-" + c[u[t + 6]] + c[u[t + 7]] + "-" + c[u[t + 8]] + c[u[t + 9]] + "-" + c[u[t + 10]] + c[u[t + 11]] + c[u[t + 12]] + c[u[t + 13]] + c[u[t + 14]] + c[u[t + 15]]).toLowerCase();
|
|
884
982
|
}
|
|
885
983
|
let S;
|
|
886
|
-
const
|
|
984
|
+
const C = new Uint8Array(16);
|
|
887
985
|
function v() {
|
|
888
986
|
if (!S) {
|
|
889
987
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
890
988
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
891
989
|
S = crypto.getRandomValues.bind(crypto);
|
|
892
990
|
}
|
|
893
|
-
return S(
|
|
991
|
+
return S(C);
|
|
894
992
|
}
|
|
895
|
-
const
|
|
896
|
-
function
|
|
897
|
-
if (
|
|
898
|
-
return
|
|
993
|
+
const T = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), G = { randomUUID: T };
|
|
994
|
+
function E(u, t, e) {
|
|
995
|
+
if (G.randomUUID && !t && !u)
|
|
996
|
+
return G.randomUUID();
|
|
899
997
|
u = u || {};
|
|
900
998
|
const o = u.random || (u.rng || v)();
|
|
901
999
|
if (o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, t) {
|
|
902
1000
|
e = e || 0;
|
|
903
|
-
for (let
|
|
904
|
-
t[e +
|
|
1001
|
+
for (let i = 0; i < 16; ++i)
|
|
1002
|
+
t[e + i] = o[i];
|
|
905
1003
|
return t;
|
|
906
1004
|
}
|
|
907
|
-
return
|
|
1005
|
+
return P(o);
|
|
908
1006
|
}
|
|
909
1007
|
const F = (u, t) => {
|
|
910
|
-
u.callbacks.
|
|
911
|
-
t.mergeGroups(e, o, s);
|
|
912
|
-
}, u.callbacks.onSplitExternalObjectGroup = (e, o) => {
|
|
913
|
-
t.splitRootModuleFromGroup(e, o);
|
|
914
|
-
}, u.callbacks.onExternalObjectGroupArrangementChanged = (e) => {
|
|
915
|
-
t.arrangeRootModulesOfGroup(e);
|
|
916
|
-
}, u.callbacks.onDeleteExternalObjectGroup = (e) => {
|
|
917
|
-
t.removedGroup(e);
|
|
918
|
-
}, u.callbacks.onDeleteExternalObjectRootModule = (e, o, s) => {
|
|
919
|
-
t.deleteRootModule(
|
|
920
|
-
e,
|
|
921
|
-
o,
|
|
922
|
-
s ?? []
|
|
923
|
-
);
|
|
924
|
-
}, u.callbacks.onDeleteExternalObjectSubModule = (e, o) => {
|
|
925
|
-
}, u.callbacks.onDuplicateExternalObjectGroup = (e, o) => {
|
|
926
|
-
t.duplicateGroup(o);
|
|
927
|
-
}, u.callbacks.onChangedExternalObjectGroupPlan = (e) => {
|
|
928
|
-
t.changedGroupPlanningSituation(e);
|
|
929
|
-
}, u.callbacks.onExternalObjectEnvironmentChanged = (e) => {
|
|
930
|
-
}, u.callbacks.onExternalObjectGroupChanged = (e) => {
|
|
931
|
-
const o = JSON.parse(e);
|
|
932
|
-
t.changedGroupFromHistory(o, !1);
|
|
933
|
-
}, u.callbacks.onExternalObjectGroupLoaded = (e) => {
|
|
934
|
-
const o = JSON.parse(e);
|
|
935
|
-
t.loadedGroup(o);
|
|
936
|
-
}, u.callbacks.onExternalObjectAttributeChanged = (e, o, s, r) => {
|
|
937
|
-
Array.isArray(o) ? t.modifyAttribute(e, o, s, r) : t.modifyAttribute(
|
|
938
|
-
e,
|
|
939
|
-
[
|
|
940
|
-
{
|
|
941
|
-
groupId: e,
|
|
942
|
-
rootModuleId: o,
|
|
943
|
-
subModuleId: null
|
|
944
|
-
}
|
|
945
|
-
],
|
|
946
|
-
s,
|
|
947
|
-
r
|
|
948
|
-
);
|
|
1008
|
+
u.callbacks.onDeleteExternalObjectSubModule = (e, o) => {
|
|
949
1009
|
}, u.callbacks.onCompletelyLoaded = () => {
|
|
950
1010
|
t.groupsCompletelyLoaded();
|
|
951
|
-
}, u.callbacks.
|
|
952
|
-
}, u.callbacks.onExternalObjectModuleSelected = (e, o, s) => {
|
|
1011
|
+
}, u.callbacks.onExternalObjectModuleSelected = (e, o, i) => {
|
|
953
1012
|
t.hiObjectSelection.groupOrModuleSelected(
|
|
954
1013
|
e,
|
|
955
1014
|
o,
|
|
956
|
-
|
|
1015
|
+
i
|
|
957
1016
|
);
|
|
958
1017
|
}, u.callbacks.onContextChanged = (e) => {
|
|
959
1018
|
t.hiObjectSelection.contextChanged(e);
|
|
960
|
-
}, u.callbacks.onSelectionChange = (e, o,
|
|
1019
|
+
}, u.callbacks.onSelectionChange = (e, o, i, r, s) => {
|
|
961
1020
|
t.hiObjectSelection.selectionChanged(
|
|
962
1021
|
e,
|
|
963
1022
|
o,
|
|
964
|
-
|
|
1023
|
+
i,
|
|
965
1024
|
r,
|
|
966
|
-
|
|
1025
|
+
s
|
|
967
1026
|
);
|
|
968
1027
|
}, u.callbacks.onSelectionCancel = (e) => {
|
|
969
1028
|
t.hiObjectSelection.selectionCancel(e);
|
|
970
1029
|
};
|
|
971
|
-
},
|
|
1030
|
+
}, D = (u = /* @__PURE__ */ new Date()) => {
|
|
972
1031
|
let t = u.toISOString();
|
|
973
1032
|
t = t.slice(0, -1);
|
|
974
1033
|
const e = t.lastIndexOf(".");
|
|
975
1034
|
let o = t;
|
|
976
1035
|
e !== -1 && (o = t.substring(0, e + 4) + "0000");
|
|
977
|
-
const
|
|
1036
|
+
const i = u.getTimezoneOffset(), r = Math.abs(Math.floor(i / 60)), s = Math.abs(i % 60), n = `${i <= 0 ? "+" : "-"}${String(r).padStart(
|
|
978
1037
|
2,
|
|
979
1038
|
"0"
|
|
980
|
-
)}:${String(
|
|
1039
|
+
)}:${String(s).padStart(2, "0")}`;
|
|
981
1040
|
return o + n;
|
|
982
|
-
},
|
|
1041
|
+
}, q = () => ({
|
|
983
1042
|
id: window.uuidv4 ? window.uuidv4() : "00000000-0000-0000-0000-000000000000",
|
|
984
1043
|
state: "New",
|
|
985
1044
|
orderNumber: "736362",
|
|
@@ -987,8 +1046,8 @@ const F = (u, t) => {
|
|
|
987
1046
|
orderDescription: "Lorem ipsum dolor sit amet...",
|
|
988
1047
|
project: "Single family house Müller John",
|
|
989
1048
|
personInCharge: "Joe",
|
|
990
|
-
orderDate:
|
|
991
|
-
deliveryDatePlanned:
|
|
1049
|
+
orderDate: D(),
|
|
1050
|
+
deliveryDatePlanned: D(
|
|
992
1051
|
new Date(Date.now() + 336 * 60 * 60 * 1e3)
|
|
993
1052
|
),
|
|
994
1053
|
addresses: [
|
|
@@ -1003,16 +1062,16 @@ const F = (u, t) => {
|
|
|
1003
1062
|
],
|
|
1004
1063
|
customerName: "Müller & Co.",
|
|
1005
1064
|
customerNumber: "462642",
|
|
1006
|
-
createdAt:
|
|
1007
|
-
changedAt:
|
|
1065
|
+
createdAt: D(),
|
|
1066
|
+
changedAt: D(),
|
|
1008
1067
|
changedBy: "Selfish",
|
|
1009
1068
|
items: []
|
|
1010
|
-
}),
|
|
1011
|
-
const e = await u.getPlanOverview(), o = {},
|
|
1012
|
-
if (Array.isArray(
|
|
1069
|
+
}), N = async (u, t) => {
|
|
1070
|
+
const e = await u.getPlanOverview(), o = {}, i = e.objects.reduce((a, n) => (n.catalogItemId && (o[n.catalogItemId] || (o[n.catalogItemId] = 0, a.push(n.catalogItemId)), o[n.catalogItemId]++), a), []), s = (Array.isArray(i) && i.length > 0 ? await u.getRapiAccess().getItems(i) : []).filter((a) => a.manufacturerSKU !== void 0 ? (a.count = o[a.id], !0) : !1);
|
|
1071
|
+
if (Array.isArray(s) && s.length > 0) {
|
|
1013
1072
|
t.items || (t.items = []);
|
|
1014
1073
|
let a = t.items.reduce((n, l) => l.items?.length ? n + l.items.length : n, 0);
|
|
1015
|
-
|
|
1074
|
+
s.forEach((n) => {
|
|
1016
1075
|
const l = {};
|
|
1017
1076
|
l.type = "Position", l.name = (++a).toString(), l.articleNumber = n.manufacturerSKU, l.articleName = n.label, l.catalog = n.catalog, l.quantity = n.count, l.height = n.displayedHeight, l.width = n.displayedWidth, l.depth = n.displayedDepth, l.color = n.basecolor, l.procurementType = "PTO", l.additionalData = [], n.perspectiveImage && l.additionalData.push({
|
|
1018
1077
|
category: "ArticleImage",
|
|
@@ -1022,37 +1081,47 @@ const F = (u, t) => {
|
|
|
1022
1081
|
});
|
|
1023
1082
|
}
|
|
1024
1083
|
};
|
|
1025
|
-
class
|
|
1084
|
+
class U {
|
|
1026
1085
|
constructor(t, e) {
|
|
1027
1086
|
this._roomlePlanner = t, this._glueLogic = e;
|
|
1028
1087
|
}
|
|
1029
|
-
async
|
|
1030
|
-
|
|
1031
|
-
|
|
1088
|
+
async fetchPrice(t, e) {
|
|
1089
|
+
let o = await this._glueLogic.getGroupDataForOrder(t);
|
|
1090
|
+
return await this._fetchOrderDataWithPrice(o, e);
|
|
1091
|
+
}
|
|
1092
|
+
async placeOrder(t = !0, e) {
|
|
1093
|
+
const o = await this._roomlePlanner.saveExternalObjectSnapshot();
|
|
1094
|
+
if (!o) {
|
|
1032
1095
|
console.error("Could not save plan snapshot before placing order");
|
|
1033
1096
|
return;
|
|
1034
1097
|
}
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1098
|
+
let i = t ? await this._fetchOrderDataWithPrice(o.orderData, e) : null, r;
|
|
1099
|
+
i ? r = i.orderData : (r = this._createOrder(e), r.items.push(o.orderData), await N(this._roomlePlanner, o.orderData)), this._addAdditionalDataToOrder(r.items[0], o), await this._glueLogic.hiCallbacks?.onPlaceOrder(r);
|
|
1100
|
+
}
|
|
1101
|
+
_addAdditionalDataToOrder(t, e) {
|
|
1102
|
+
Array.isArray(t.additionalData) || (t.additionalData = []), e.perspectiveImageLink && t.additionalData.push({
|
|
1040
1103
|
type: "Image",
|
|
1041
1104
|
category: "OverviewImage",
|
|
1042
1105
|
downloadUri: e.perspectiveImageLink
|
|
1043
|
-
}), e.topImageLink &&
|
|
1106
|
+
}), e.topImageLink && t.additionalData.push({
|
|
1044
1107
|
type: "Image",
|
|
1045
1108
|
category: "AboveImage",
|
|
1046
1109
|
downloadUri: e.topImageLink
|
|
1047
|
-
}), e.
|
|
1110
|
+
}), e.objectGlbLink && t.additionalData.push({
|
|
1048
1111
|
type: "ThreeD",
|
|
1049
1112
|
category: "ThreeDModel",
|
|
1050
|
-
downloadUri: e.
|
|
1051
|
-
})
|
|
1113
|
+
downloadUri: e.objectGlbLink
|
|
1114
|
+
});
|
|
1115
|
+
}
|
|
1116
|
+
async _fetchOrderDataWithPrice(t, e) {
|
|
1117
|
+
let o = this._createOrder(e);
|
|
1118
|
+
return o.items.push(t), this._glueLogic.hiCallbacks?.onFetchPrice(o);
|
|
1052
1119
|
}
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1120
|
+
_createOrder(t) {
|
|
1121
|
+
return t ? {
|
|
1122
|
+
...t,
|
|
1123
|
+
items: []
|
|
1124
|
+
} : q();
|
|
1056
1125
|
}
|
|
1057
1126
|
}
|
|
1058
1127
|
class k {
|
|
@@ -1067,8 +1136,8 @@ class k {
|
|
|
1067
1136
|
}
|
|
1068
1137
|
_logRequest(t, ...e) {
|
|
1069
1138
|
let o = t;
|
|
1070
|
-
e && e.forEach((
|
|
1071
|
-
o += " " +
|
|
1139
|
+
e && e.forEach((i) => {
|
|
1140
|
+
o += " " + i;
|
|
1072
1141
|
}), this._hiCallbacks.onLogMessage?.("HI REQUEST", o);
|
|
1073
1142
|
}
|
|
1074
1143
|
isLibraryLoaded(t) {
|
|
@@ -1120,32 +1189,32 @@ class k {
|
|
|
1120
1189
|
duplicateGroup(t) {
|
|
1121
1190
|
this._logRequest("duplicateGroup", t.groupId), this._glueLogic.duplicateGroup(t);
|
|
1122
1191
|
}
|
|
1123
|
-
modifyAttribute(t, e, o,
|
|
1192
|
+
modifyAttribute(t, e, o, i) {
|
|
1124
1193
|
this._logRequest(
|
|
1125
1194
|
"modifyAttribute",
|
|
1126
1195
|
t,
|
|
1127
1196
|
JSON.stringify(e),
|
|
1128
1197
|
o,
|
|
1129
|
-
|
|
1198
|
+
i
|
|
1130
1199
|
), this._glueLogic.modifyAttribute(
|
|
1131
1200
|
t,
|
|
1132
1201
|
e,
|
|
1133
1202
|
o,
|
|
1134
|
-
|
|
1203
|
+
i
|
|
1135
1204
|
);
|
|
1136
1205
|
}
|
|
1137
|
-
updateAttribute(t, e, o,
|
|
1206
|
+
updateAttribute(t, e, o, i) {
|
|
1138
1207
|
this._logRequest(
|
|
1139
1208
|
"updateAttribute",
|
|
1140
1209
|
t,
|
|
1141
1210
|
e,
|
|
1142
1211
|
o,
|
|
1143
|
-
|
|
1212
|
+
i.toString()
|
|
1144
1213
|
), this._glueLogic.updateAttribute(
|
|
1145
1214
|
t,
|
|
1146
1215
|
e,
|
|
1147
1216
|
o,
|
|
1148
|
-
|
|
1217
|
+
i
|
|
1149
1218
|
);
|
|
1150
1219
|
}
|
|
1151
1220
|
getVerifiedAttributeOptions(t, e) {
|
|
@@ -1155,6 +1224,16 @@ class k {
|
|
|
1155
1224
|
e ? JSON.stringify(e) : "[]"
|
|
1156
1225
|
), this._glueLogic.getVerifiedAttributeOptions(t, e);
|
|
1157
1226
|
}
|
|
1227
|
+
getVerifiedGroupAttributeOptions(t, e) {
|
|
1228
|
+
return this._logRequest(
|
|
1229
|
+
"getVerifiedGroupAttributeOptions",
|
|
1230
|
+
t,
|
|
1231
|
+
e ? JSON.stringify(e) : "[]"
|
|
1232
|
+
), this._glueLogic.getVerifiedGroupAttributeOptions(
|
|
1233
|
+
t,
|
|
1234
|
+
e
|
|
1235
|
+
);
|
|
1236
|
+
}
|
|
1158
1237
|
updateAdditionalInfo(t, e) {
|
|
1159
1238
|
this._logRequest("updateAdditionalInfo", t, e), this._glueLogic.updateAdditionalInfo(t, e);
|
|
1160
1239
|
}
|
|
@@ -1217,25 +1296,22 @@ class k {
|
|
|
1217
1296
|
getGroupDataForOrder(t) {
|
|
1218
1297
|
return this._logRequest("getGroupDataForOrder", t), this._glueLogic.getGroupDataForOrder(t);
|
|
1219
1298
|
}
|
|
1220
|
-
savePlanSnapshot() {
|
|
1221
|
-
return this._logRequest("savePlanSnapshot"), this._glueLogic.savePlanSnapshot();
|
|
1222
|
-
}
|
|
1223
1299
|
}
|
|
1224
|
-
class
|
|
1300
|
+
class V {
|
|
1225
1301
|
constructor(t, e) {
|
|
1226
1302
|
this._roomDesignerRequests = t, this._hiCallbacks = e;
|
|
1227
1303
|
}
|
|
1228
1304
|
_logResponse(t, ...e) {
|
|
1229
1305
|
let o = t;
|
|
1230
|
-
e && e.forEach((
|
|
1231
|
-
o += " " +
|
|
1306
|
+
e && e.forEach((i) => {
|
|
1307
|
+
o += " " + i;
|
|
1232
1308
|
}), this._hiCallbacks.onLogMessage?.("HI RESPONSE", o);
|
|
1233
1309
|
}
|
|
1234
1310
|
loadMasterData(t) {
|
|
1235
1311
|
this._logResponse("loadMasterData"), this._roomDesignerRequests.loadMasterData(t);
|
|
1236
1312
|
}
|
|
1237
1313
|
async loadPosGroups(t, e) {
|
|
1238
|
-
const o = Array.isArray(t) ? t.map((
|
|
1314
|
+
const o = Array.isArray(t) ? t.map((i) => i.id).join(",") : t.id;
|
|
1239
1315
|
return this._logResponse(
|
|
1240
1316
|
"loadPosGroups",
|
|
1241
1317
|
o,
|
|
@@ -1256,18 +1332,18 @@ class U {
|
|
|
1256
1332
|
async selectModule(t, e) {
|
|
1257
1333
|
return this._logResponse("selectModule", t, e), this._roomDesignerRequests.selectModule(t, e);
|
|
1258
1334
|
}
|
|
1259
|
-
openCloseGroup(t, e, o,
|
|
1335
|
+
openCloseGroup(t, e, o, i) {
|
|
1260
1336
|
return this._logResponse(
|
|
1261
1337
|
"openCloseGroup",
|
|
1262
1338
|
t,
|
|
1263
1339
|
e,
|
|
1264
1340
|
o.toString(),
|
|
1265
|
-
|
|
1341
|
+
i.toString()
|
|
1266
1342
|
), this._roomDesignerRequests.openCloseGroup(
|
|
1267
1343
|
t,
|
|
1268
1344
|
e,
|
|
1269
1345
|
o,
|
|
1270
|
-
|
|
1346
|
+
i
|
|
1271
1347
|
), Promise.resolve();
|
|
1272
1348
|
}
|
|
1273
1349
|
deleteGroup(t) {
|
|
@@ -1289,20 +1365,20 @@ class U {
|
|
|
1289
1365
|
console.warn("Homag Intelligence plugin is loaded.");
|
|
1290
1366
|
class J extends O {
|
|
1291
1367
|
constructor() {
|
|
1292
|
-
super(), this._roomlePlanner = null, this._api = null, this._glueLogic = null, this._orders = null, window.uuidv4 || (window.uuidv4 =
|
|
1368
|
+
super(), this._roomlePlanner = null, this._api = null, this._glueLogic = null, this._orders = null, window.uuidv4 || (window.uuidv4 = E);
|
|
1293
1369
|
}
|
|
1294
1370
|
async init(t, e, o) {
|
|
1295
1371
|
if (this._roomlePlanner = t, this._roomlePlanner.setHomagIntelligence(this), this._api = new R(this._roomlePlanner), e?.debugLogging) {
|
|
1296
|
-
const r = new
|
|
1372
|
+
const r = new V(this._api, o), s = new A(r, o);
|
|
1297
1373
|
this._glueLogic = new k(
|
|
1298
|
-
|
|
1374
|
+
s,
|
|
1299
1375
|
o
|
|
1300
1376
|
);
|
|
1301
1377
|
} else
|
|
1302
|
-
this._glueLogic = new
|
|
1378
|
+
this._glueLogic = new A(this._api, o);
|
|
1303
1379
|
F(this._roomlePlanner, this._glueLogic);
|
|
1304
|
-
const
|
|
1305
|
-
return this._glueLogic.setPosDataForLoading(
|
|
1380
|
+
const i = await o.onGetSavedPosGroupData() ?? null;
|
|
1381
|
+
return this._glueLogic.setPosDataForLoading(i), this._orders = new U(t, this._glueLogic), this;
|
|
1306
1382
|
}
|
|
1307
1383
|
async loadLibrary(t) {
|
|
1308
1384
|
if (!this._glueLogic)
|
|
@@ -1318,7 +1394,7 @@ class J extends O {
|
|
|
1318
1394
|
async _loadLibraryData(t) {
|
|
1319
1395
|
if (this._glueLogic.isLibraryLoaded(t))
|
|
1320
1396
|
return this._glueLogic.getLibraryData(t);
|
|
1321
|
-
const e = this._glueLogic.hiCallbacks, { masterData: o, libraryExports:
|
|
1397
|
+
const e = this._glueLogic.hiCallbacks, { masterData: o, libraryExports: i } = await this._requestHiLibrary(
|
|
1322
1398
|
t,
|
|
1323
1399
|
e
|
|
1324
1400
|
);
|
|
@@ -1326,14 +1402,14 @@ class J extends O {
|
|
|
1326
1402
|
libraryId: t,
|
|
1327
1403
|
masterData: o,
|
|
1328
1404
|
posGroupVersion: 1,
|
|
1329
|
-
calculateGroup: (
|
|
1330
|
-
getOrderData: (
|
|
1331
|
-
getAttributesDropDownValues: async (
|
|
1332
|
-
const n = a ? Array.isArray(a) ? a : [a] :
|
|
1405
|
+
calculateGroup: (s) => i.calc(s),
|
|
1406
|
+
getOrderData: (s, a, n) => i.getOrderData(s, a, n),
|
|
1407
|
+
getAttributesDropDownValues: async (s, a) => {
|
|
1408
|
+
const n = a ? Array.isArray(a) ? a : [a] : s.attributes.map((d) => d.id), l = {};
|
|
1333
1409
|
for (const d of n)
|
|
1334
1410
|
try {
|
|
1335
|
-
const h =
|
|
1336
|
-
|
|
1411
|
+
const h = i.getAttributesDropDownValues(
|
|
1412
|
+
s,
|
|
1337
1413
|
d
|
|
1338
1414
|
);
|
|
1339
1415
|
l[d] = h;
|
|
@@ -1342,42 +1418,42 @@ class J extends O {
|
|
|
1342
1418
|
}
|
|
1343
1419
|
return l;
|
|
1344
1420
|
},
|
|
1345
|
-
solveModuleAttributeConflict: (
|
|
1346
|
-
|
|
1421
|
+
solveModuleAttributeConflict: (s, a, n) => i.solveModuleAttributeConflict ? i.solveModuleAttributeConflict(
|
|
1422
|
+
s,
|
|
1347
1423
|
a,
|
|
1348
1424
|
n
|
|
1349
1425
|
) : void 0,
|
|
1350
|
-
getValidSubArticles(
|
|
1351
|
-
return
|
|
1352
|
-
|
|
1426
|
+
getValidSubArticles(s, a, n) {
|
|
1427
|
+
return i.getValidSubArticles ? i.getValidSubArticles(
|
|
1428
|
+
s,
|
|
1353
1429
|
a,
|
|
1354
1430
|
n
|
|
1355
1431
|
) : [];
|
|
1356
1432
|
},
|
|
1357
|
-
getValidContainerModulesForSubArticle(
|
|
1358
|
-
return
|
|
1359
|
-
|
|
1433
|
+
getValidContainerModulesForSubArticle(s, a, n) {
|
|
1434
|
+
return i.getValidContainerModulesForSubArticle ? i.getValidContainerModulesForSubArticle(
|
|
1435
|
+
s,
|
|
1360
1436
|
a,
|
|
1361
1437
|
n
|
|
1362
1438
|
) : [];
|
|
1363
1439
|
},
|
|
1364
|
-
addSubArticle(
|
|
1365
|
-
return
|
|
1366
|
-
|
|
1440
|
+
addSubArticle(s, a, n, l) {
|
|
1441
|
+
return i.addSubArticle ? i.addSubArticle(
|
|
1442
|
+
s,
|
|
1367
1443
|
a,
|
|
1368
1444
|
n,
|
|
1369
1445
|
l
|
|
1370
|
-
) :
|
|
1446
|
+
) : s;
|
|
1371
1447
|
}
|
|
1372
1448
|
};
|
|
1373
1449
|
}
|
|
1374
1450
|
async _requestHiLibrary(t, e) {
|
|
1375
1451
|
if (!this._glueLogic)
|
|
1376
1452
|
throw new Error("GlueLogic not initialized");
|
|
1377
|
-
const [o,
|
|
1453
|
+
const [o, i] = await Promise.all([
|
|
1378
1454
|
e.onLoadMasterData(t),
|
|
1379
1455
|
e.onLoadJavascript(t)
|
|
1380
|
-
]), r = await this._initCalcScript(
|
|
1456
|
+
]), r = await this._initCalcScript(i);
|
|
1381
1457
|
return {
|
|
1382
1458
|
masterData: o,
|
|
1383
1459
|
libraryExports: r
|
|
@@ -1400,14 +1476,14 @@ class J extends O {
|
|
|
1400
1476
|
getGlueLogic() {
|
|
1401
1477
|
return this._glueLogic;
|
|
1402
1478
|
}
|
|
1403
|
-
async placeOrder(t = !0) {
|
|
1404
|
-
await this._orders.placeOrder(t);
|
|
1479
|
+
async placeOrder(t = !0, e) {
|
|
1480
|
+
await this._orders.placeOrder(t, e);
|
|
1405
1481
|
}
|
|
1406
|
-
async fetchPrice(t) {
|
|
1407
|
-
return this._orders.fetchPrice(t);
|
|
1482
|
+
async fetchPrice(t, e) {
|
|
1483
|
+
return this._orders.fetchPrice(t, e);
|
|
1408
1484
|
}
|
|
1409
1485
|
}
|
|
1410
1486
|
export {
|
|
1411
1487
|
J as HomagIntelligence
|
|
1412
1488
|
};
|
|
1413
|
-
//# sourceMappingURL=homag-intelligence-
|
|
1489
|
+
//# sourceMappingURL=homag-intelligence-BM21wVTA.mjs.map
|