sctj-components 1.0.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/PUBLISH_GUIDE.md +293 -0
- package/README.md +1112 -0
- package/lib/chunks/404-8b5347fb.js +4 -0
- package/lib/chunks/bug-29d5a8c8.js +4 -0
- package/lib/chunks/build-0e8711f7.js +4 -0
- package/lib/chunks/button-abec46ef.js +4 -0
- package/lib/chunks/cascader-328523ba.js +4 -0
- package/lib/chunks/chart-04ef8147.js +4 -0
- package/lib/chunks/checkbox-1238324c.js +4 -0
- package/lib/chunks/clipboard-625a991f.js +4 -0
- package/lib/chunks/code-2f6398b5.js +4 -0
- package/lib/chunks/color-13488c06.js +4 -0
- package/lib/chunks/component-495e49d4.js +4 -0
- package/lib/chunks/dashboard-3a81480c.js +4 -0
- package/lib/chunks/date-c2ef6759.js +4 -0
- package/lib/chunks/date-range-551e4fd6.js +4 -0
- package/lib/chunks/dict-5539087c.js +4 -0
- package/lib/chunks/documentation-8d81c185.js +4 -0
- package/lib/chunks/download-11fa6102.js +4 -0
- package/lib/chunks/drag-2fbf0e89.js +4 -0
- package/lib/chunks/druid-57209587.js +4 -0
- package/lib/chunks/edit-9e3738f0.js +4 -0
- package/lib/chunks/education-7fb0e453.js +4 -0
- package/lib/chunks/email-7477951a.js +4 -0
- package/lib/chunks/example-b8091a8b.js +4 -0
- package/lib/chunks/excel-9e8720a6.js +4 -0
- package/lib/chunks/exit-fullscreen-fe7ec08b.js +4 -0
- package/lib/chunks/eye-1a093b92.js +4 -0
- package/lib/chunks/eye-open-312c146f.js +4 -0
- package/lib/chunks/form-54837ed4.js +4 -0
- package/lib/chunks/fullscreen-552cc3b4.js +4 -0
- package/lib/chunks/github-0539cc3d.js +4 -0
- package/lib/chunks/guide-407e9748.js +4 -0
- package/lib/chunks/icon-83dfff61.js +4 -0
- package/lib/chunks/input-de62ab83.js +4 -0
- package/lib/chunks/international-7bb87f29.js +4 -0
- package/lib/chunks/job-e78e9a3d.js +4 -0
- package/lib/chunks/language-8b7629d9.js +4 -0
- package/lib/chunks/link-f264a825.js +4 -0
- package/lib/chunks/list-2e431778.js +4 -0
- package/lib/chunks/lock-5e8f10d7.js +4 -0
- package/lib/chunks/log-80bfb029.js +4 -0
- package/lib/chunks/logininfor-47a5f04e.js +4 -0
- package/lib/chunks/message-06f1d593.js +4 -0
- package/lib/chunks/money-14039a58.js +4 -0
- package/lib/chunks/monitor-b020306f.js +4 -0
- package/lib/chunks/nested-13647a6a.js +4 -0
- package/lib/chunks/number-290265fd.js +4 -0
- package/lib/chunks/online-64589b70.js +4 -0
- package/lib/chunks/password-1192ad67.js +4 -0
- package/lib/chunks/pdf-8176f032.js +4 -0
- package/lib/chunks/people-6e6b61b6.js +4 -0
- package/lib/chunks/peoples-35c96c5c.js +4 -0
- package/lib/chunks/phone-6bc01ca6.js +4 -0
- package/lib/chunks/post-0d01cf1a.js +4 -0
- package/lib/chunks/qq-df2843d2.js +4 -0
- package/lib/chunks/question-c1e9a4e7.js +4 -0
- package/lib/chunks/radio-5c66d676.js +4 -0
- package/lib/chunks/rate-eb858d5b.js +4 -0
- package/lib/chunks/redis-788c8d4f.js +4 -0
- package/lib/chunks/redis-list-6792700e.js +4 -0
- package/lib/chunks/row-d431ba9c.js +4 -0
- package/lib/chunks/search-990fe622.js +4 -0
- package/lib/chunks/select-1d794732.js +4 -0
- package/lib/chunks/server-b0c98c01.js +4 -0
- package/lib/chunks/shopping-2a187e37.js +4 -0
- package/lib/chunks/sip-0.13.6.min-53cd1379.js +5546 -0
- package/lib/chunks/size-e3f93f23.js +4 -0
- package/lib/chunks/skill-abe26c0c.js +4 -0
- package/lib/chunks/slider-cb3330ba.js +4 -0
- package/lib/chunks/star-5182766b.js +4 -0
- package/lib/chunks/swagger-266c9f25.js +4 -0
- package/lib/chunks/switch-74aa5d5b.js +4 -0
- package/lib/chunks/system-943da249.js +4 -0
- package/lib/chunks/tab-9202c247.js +4 -0
- package/lib/chunks/table-2d14e126.js +4 -0
- package/lib/chunks/textarea-4d9d0b2c.js +4 -0
- package/lib/chunks/theme-7bbe2d45.js +4 -0
- package/lib/chunks/time-f08907ac.js +4 -0
- package/lib/chunks/time-range-e7b40483.js +4 -0
- package/lib/chunks/tool-6f22c373.js +4 -0
- package/lib/chunks/tree-0118a113.js +4 -0
- package/lib/chunks/tree-table-54984188.js +4 -0
- package/lib/chunks/upload-e852b478.js +4 -0
- package/lib/chunks/user-82704b02.js +4 -0
- package/lib/chunks/validCode-ba29b5b3.js +4 -0
- package/lib/chunks/wechat-22f119d5.js +4 -0
- package/lib/chunks/zip-c3a63b61.js +4 -0
- package/lib/sctj-components.es.js +10491 -0
- package/lib/sctj-components.umd.js +1 -0
- package/lib/style.css +1 -0
- package/package.json +55 -0
- package/public/BimfaceSDKLoader@latest-release.js +643 -0
- package/public/hkPlayerPlugin/h5player.min.js +1 -0
- package/public/hkPlayerPlugin/playctrl1/DecodeWorker.js +705 -0
- package/public/hkPlayerPlugin/playctrl1/Decoder.js +171 -0
- package/public/hkPlayerPlugin/playctrl1simd/DecodeWorker.js +705 -0
- package/public/hkPlayerPlugin/playctrl1simd/Decoder.js +171 -0
- package/public/hkPlayerPlugin/playctrl2/Decoder.js +21 -0
- package/public/hkPlayerPlugin/playctrl2/Decoder.wasm +0 -0
- package/public/hkPlayerPlugin/playctrl2/Decoder.worker.js +1 -0
- package/public/hkPlayerPlugin/playctrl3/Decoder.js +21 -0
- package/public/hkPlayerPlugin/playctrl3/Decoder.wasm +0 -0
- package/public/hkPlayerPlugin/playctrl3/Decoder.worker.js +1 -0
- package/public/hkPlayerPlugin/talk/AudioInterCom.js +21 -0
- package/public/hkPlayerPlugin/talk/AudioInterCom.wasm +0 -0
- package/public/hkPlayerPlugin/talkW/AudioInterCom.js +21 -0
- package/public/hkPlayerPlugin/talkW/AudioInterCom.wasm +0 -0
- package/public/hkPlayerPlugin/talkW/AudioInterCom.worker.js +1 -0
- package/public/hkPlayerPlugin/transform/libSystemTransform.js +6589 -0
- package/public/hkPlayerPlugin/transform/libSystemTransform.wasm +0 -0
- package/public/hkPlayerPlugin/transform/systemTransform-worker.js +126 -0
|
@@ -0,0 +1,643 @@
|
|
|
1
|
+
!function () {
|
|
2
|
+
"use strict";
|
|
3
|
+
var e = window.hostConfig || {
|
|
4
|
+
APIHost: "https://api.bimface.com",
|
|
5
|
+
resourceHost: "https://m.bimface.com",
|
|
6
|
+
staticHost: "https://static.bimface.com",
|
|
7
|
+
dataEnvType: "BIMFACE",
|
|
8
|
+
securityApi: !0
|
|
9
|
+
};
|
|
10
|
+
void 0 === Object.assign && (Object.assign = function (e) {
|
|
11
|
+
if (null == e) throw new TypeError("Cannot convert undefined or null to object");
|
|
12
|
+
for (var t = Object(e), n = 1; n < arguments.length; n++) {
|
|
13
|
+
var o = arguments[n];
|
|
14
|
+
if (null != o) for (var r in o) Object.prototype.hasOwnProperty.call(o, r) && (t[r] = o[r])
|
|
15
|
+
}
|
|
16
|
+
return t
|
|
17
|
+
});
|
|
18
|
+
let t = Object.freeze({Release: "Release", Debug: "Debug"}),
|
|
19
|
+
n = Object.freeze({Normal: "Normal", DrawingView: "drawingView"}),
|
|
20
|
+
o = Object.freeze({BIMFACE: "BIMFACE", Local: "Local"}),
|
|
21
|
+
r = Object.freeze({zh_CN: "zh_CN", en_GB: "en_GB", sv_SE: "sv_SE", zh_TW: "zh_TW"}),
|
|
22
|
+
a = Object.freeze({Normal: "Normal", Bake: "Bake"});
|
|
23
|
+
window.BimfaceSDKLoaderConfig = function () {
|
|
24
|
+
if (window.hostConfig) {
|
|
25
|
+
for (let t in window.hostConfig) e[t] = window.hostConfig[t];
|
|
26
|
+
e.securityApi = window.hostConfig.securityApi
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
staticHost: `${e.staticHost}/api`,
|
|
30
|
+
APIHost: e.APIHost,
|
|
31
|
+
language: "zh_CN",
|
|
32
|
+
viewToken: null,
|
|
33
|
+
configuration: t.Release,
|
|
34
|
+
dataEnvType: e.dataEnvType || "BIMFACE",
|
|
35
|
+
viewType: n.Normal,
|
|
36
|
+
visualStyle: a.Bake,
|
|
37
|
+
version: "",
|
|
38
|
+
securityApi: e.securityApi
|
|
39
|
+
}
|
|
40
|
+
}, window.BimfaceEnvOption = o, window.BimfaceLanguageOption = r, window.BimfaceConfigrationOption = t, window.BimfaceViewTypeOption = n;
|
|
41
|
+
let i = function (e) {
|
|
42
|
+
let t = e.split("/");
|
|
43
|
+
return t.pop(), t.join("/") + "/"
|
|
44
|
+
};
|
|
45
|
+
var s = function (e, t) {
|
|
46
|
+
for (var n = 0; n < t.length; n++) t[n] = e + t[n]
|
|
47
|
+
}, c = function (e) {
|
|
48
|
+
var t = e.sdkVersion, o = e.options, r = o.configuration, a = [],
|
|
49
|
+
i = [`/${t}/${o.language}.js`, `/${t}/Application${r}.js`];
|
|
50
|
+
return a = function (e, t) {
|
|
51
|
+
return "drawingView" == e.renderType || t.viewType == n.DrawingView
|
|
52
|
+
}(e.metadata, e.options) ? [...a, ...i, `/${t}/Drawing.css`, `/${t}/bimface.bufferfly.js`, `/${t}/Drawing${r}.js`] : [...a, ...i, `/${t}/Bimface.css`, `/${t}/thirdparty.js`, `/${t}/lib/loaders/BimTilesLoader.js`, `/${t}/Bimface${r}.js`], a
|
|
53
|
+
};
|
|
54
|
+
window.postProcessing = function (e) {
|
|
55
|
+
var n = e.metadata, o = e.options, r = e.successCb, a = c(e);
|
|
56
|
+
s(o.staticHost, a), n.databagId = `${n.databagId}`, o.path ? (n.path = o.path, n.dataPath = "./") : o.resourcePath && (n.path = o.resourcePath.replace("viewToken", "")), n.sdkPath = o.sdkPath, 0 == a.length ? r(n) : d(a, (function () {
|
|
57
|
+
if (o.build === t.Debug && o.dataPath) {
|
|
58
|
+
let e = o.dataPath.split("/");
|
|
59
|
+
r({databagId: e.pop(), path: e.join("/")})
|
|
60
|
+
}
|
|
61
|
+
r(n)
|
|
62
|
+
}))
|
|
63
|
+
};
|
|
64
|
+
var d = function (e, n, o) {
|
|
65
|
+
var r = e.length, a = 0, i = function (l) {
|
|
66
|
+
if (l && "error" == l.message && l.element.indexOf("bimface.index") > -1) {
|
|
67
|
+
a = 0;
|
|
68
|
+
var f = o.options;
|
|
69
|
+
f.build, t.Release;
|
|
70
|
+
var h = c(o);
|
|
71
|
+
return s(f.staticHost, h), void d(h, n)
|
|
72
|
+
}
|
|
73
|
+
++a == r ? n() : u(e[a], i)
|
|
74
|
+
};
|
|
75
|
+
u(e[a], i)
|
|
76
|
+
}, l = [], u = function (e, t) {
|
|
77
|
+
if (!(l.indexOf(e.split("/").pop()) > -1)) {
|
|
78
|
+
var n, o = document.getElementsByTagName("head")[0];
|
|
79
|
+
return e.indexOf(".css") > -1 ? ((n = document.createElement("link")).setAttribute("href", e), n.setAttribute("rel", "stylesheet")) : (n = document.createElement("script")).setAttribute("src", e), n.url = e, o.appendChild(n), n.addEventListener("load", (function () {
|
|
80
|
+
l.push(this.url.split("/").pop()), t && t({message: "success"})
|
|
81
|
+
})), n.addEventListener("error", (function () {
|
|
82
|
+
t && t({element: e, message: "error"})
|
|
83
|
+
})), n
|
|
84
|
+
}
|
|
85
|
+
t()
|
|
86
|
+
};
|
|
87
|
+
window.loadResource = d;
|
|
88
|
+
|
|
89
|
+
class f extends class {
|
|
90
|
+
constructor(e) {
|
|
91
|
+
this.indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB || window.msIndexedDB, this.indexedDB || console.log("IndexedDB not supported"), this._db = null, this._opt = e
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
open(e, t) {
|
|
95
|
+
const n = e || this._opt.name, o = t || this._opt.version || 1, r = this.indexedDB.open(n, o);
|
|
96
|
+
return new Promise(((e, t) => {
|
|
97
|
+
r.onsuccess = t => {
|
|
98
|
+
this._db = r.result, e(this._db)
|
|
99
|
+
}, r.onupgradeneeded = e => {
|
|
100
|
+
let t = this._db = e.target.result;
|
|
101
|
+
(this._opt.storeList || []).forEach((e => !t.objectStoreNames.contains(e) && t.createObjectStore(e)))
|
|
102
|
+
}, r.onerror = e => {
|
|
103
|
+
t(e)
|
|
104
|
+
}
|
|
105
|
+
}))
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
getDB() {
|
|
109
|
+
return new Promise(((e, t) => {
|
|
110
|
+
this._db ? e(this._db) : this.open().then(e).catch(t)
|
|
111
|
+
}))
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
addObject(e, t, n) {
|
|
115
|
+
return new Promise(((o, r) => {
|
|
116
|
+
this.getDB().then((a => {
|
|
117
|
+
const i = a.transaction(e, "readwrite");
|
|
118
|
+
i.objectStore(e).put(t, n).onsuccess = e => {
|
|
119
|
+
o(e.target.result)
|
|
120
|
+
}, i.onerror = e => {
|
|
121
|
+
r(e)
|
|
122
|
+
}
|
|
123
|
+
})).catch(r)
|
|
124
|
+
}))
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
getObject(e, t) {
|
|
128
|
+
return new Promise(((n, o) => {
|
|
129
|
+
this.getDB().then((r => {
|
|
130
|
+
const a = r.transaction(e, "readonly");
|
|
131
|
+
a.objectStore(e).get(t).onsuccess = e => {
|
|
132
|
+
let t = e.target.result;
|
|
133
|
+
t ? n(t) : o(e)
|
|
134
|
+
}, a.onerror = e => {
|
|
135
|
+
o(e)
|
|
136
|
+
}
|
|
137
|
+
})).catch(o)
|
|
138
|
+
}))
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
deleteObject(e, t) {
|
|
142
|
+
return new Promise(((n, o) => {
|
|
143
|
+
this.getDB().then((r => {
|
|
144
|
+
const a = r.transaction(e, "readwrite");
|
|
145
|
+
a.objectStore(e).delete(t).onsuccess = e => {
|
|
146
|
+
n(e.target.result)
|
|
147
|
+
}, a.onerror = e => {
|
|
148
|
+
o(e)
|
|
149
|
+
}
|
|
150
|
+
})).catch(o)
|
|
151
|
+
}))
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
clearStore(e) {
|
|
155
|
+
return new Promise(((t, n) => {
|
|
156
|
+
this.getDB().then((o => {
|
|
157
|
+
const r = o.transaction(e, "readwrite");
|
|
158
|
+
r.objectStore(e).clear().onsuccess = e => {
|
|
159
|
+
t(e.target.result)
|
|
160
|
+
}, r.onerror = e => {
|
|
161
|
+
n(e)
|
|
162
|
+
}
|
|
163
|
+
})).catch(n)
|
|
164
|
+
}))
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
deleteDB(e) {
|
|
168
|
+
return new Promise((t => {
|
|
169
|
+
this.indexedDB.deleteDatabase(e), t()
|
|
170
|
+
}))
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
getAllKeys(e) {
|
|
174
|
+
return new Promise(((t, n) => {
|
|
175
|
+
this.getDB().then((o => {
|
|
176
|
+
const r = o.transaction(e, "readonly");
|
|
177
|
+
r.objectStore(e).getAllKeys().onsuccess = e => t(e.target.result), r.onerror = n
|
|
178
|
+
})).catch(n)
|
|
179
|
+
}))
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
getAll(e) {
|
|
183
|
+
return new Promise(((t, n) => {
|
|
184
|
+
this.getDB().then((o => {
|
|
185
|
+
const r = o.transaction(e, "readonly");
|
|
186
|
+
r.objectStore(e).getAll().onsuccess = e => t(e.target.result), r.onerror = n
|
|
187
|
+
})).catch(n)
|
|
188
|
+
}))
|
|
189
|
+
}
|
|
190
|
+
} {
|
|
191
|
+
constructor() {
|
|
192
|
+
super({name: "Bf_Loader", version: 1, storeList: ["d", "t"]})
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
getDatabagInfo(e, t) {
|
|
196
|
+
return new Promise(((n, o) => {
|
|
197
|
+
t ? this.getObject("d", e).then((e => this.addTemp(e, t).then((() => n(e))).catch(o))).catch(o) : this.getObject("d", e).then(n).catch(o)
|
|
198
|
+
}))
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
addDatabagInfo(e, t) {
|
|
202
|
+
return new Promise(((n, o) => {
|
|
203
|
+
const r = e.modelId,
|
|
204
|
+
a = () => Promise.all([this.addObject("d", e, r), this.addTemp(e, t)]).then(n).catch(o);
|
|
205
|
+
this.getDatabagInfo(r).then((t => {
|
|
206
|
+
t.databagId !== e.databagId && this.deleteDB(`Bf_${data.databagId}`), a()
|
|
207
|
+
})).catch((() => {
|
|
208
|
+
a()
|
|
209
|
+
}))
|
|
210
|
+
}))
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
deleteDatabagInfo(e) {
|
|
214
|
+
return new Promise(((t, n) => {
|
|
215
|
+
this.deleteObject("d", e).then(t).catch(n)
|
|
216
|
+
}))
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
addTemp(e, t) {
|
|
220
|
+
return new Promise(((n, o) => {
|
|
221
|
+
this.clearStore("t").then((() => {
|
|
222
|
+
this.addObject("t", e, t).then(n).catch(o)
|
|
223
|
+
})).catch(o)
|
|
224
|
+
}))
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
getTemp(e) {
|
|
228
|
+
return new Promise(((t, n) => {
|
|
229
|
+
this.getObject("t", e).then(t).catch(n)
|
|
230
|
+
}))
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
deleteStorageByModelId(e) {
|
|
234
|
+
return new Promise((t => {
|
|
235
|
+
this.getDatabagInfo(e).then((n => {
|
|
236
|
+
let o = "gisView" === n.renderType ? `Bg_${n.modelId}` : `Bf_${n.databagId}`;
|
|
237
|
+
Promise.allSettled([this.deleteDB(o), this.deleteDatabagInfo(e)]).then(t)
|
|
238
|
+
})).catch(t)
|
|
239
|
+
}))
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
getStoredModelIds() {
|
|
243
|
+
return this.getAllKeys("d")
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
getStoredModelInfo() {
|
|
247
|
+
return new Promise(((e, t) => {
|
|
248
|
+
this.getAll("d").then((t => {
|
|
249
|
+
let n = t.map((e => {
|
|
250
|
+
let {modelId: t, name: n, renderType: o} = e;
|
|
251
|
+
return {modelId: t, name: n, type: o}
|
|
252
|
+
}));
|
|
253
|
+
e(n)
|
|
254
|
+
})).catch(t)
|
|
255
|
+
}))
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
var h = function (e, t, n) {
|
|
260
|
+
if (e.metadata) return n(e.metadata);
|
|
261
|
+
const r = o => {
|
|
262
|
+
if (e.enableStorage && e.modelId) {
|
|
263
|
+
(new f).getDatabagInfo(e.modelId, e.viewToken).then((e => n && n(e))).catch((() => {
|
|
264
|
+
console.error("[BIMFACE ERROR]: failed get model info from storage"), t && t(o)
|
|
265
|
+
}))
|
|
266
|
+
} else t && t(o)
|
|
267
|
+
};
|
|
268
|
+
if (!e.viewToken && "Local" !== e.dataEnvType) return void r();
|
|
269
|
+
const a = e.dataEnvType !== o.Local, i = a && e.securityApi;
|
|
270
|
+
!function (e) {
|
|
271
|
+
var t, n = Object.assign({type: "get", data: null, success: null, failure: null}, e);
|
|
272
|
+
(t = window.XMLHttpRequest ? new XMLHttpRequest : new ActiveXObject("Microsoft.XMLHTTP")).onreadystatechange = function () {
|
|
273
|
+
if (4 == t.readyState) {
|
|
274
|
+
var e = t.status;
|
|
275
|
+
e >= 200 && e < 300 || 304 == e || 0 === e && "file:" === window.location.protocol ? n.success && n.success(t.responseText, t.responseXML) : n.failure && n.failure(e)
|
|
276
|
+
}
|
|
277
|
+
}, t.open(n.type, n.url, n.async), t.send(n.data)
|
|
278
|
+
}({
|
|
279
|
+
type: i ? "post" : "get",
|
|
280
|
+
url: a && !i ? `${e.url}?viewToken=${e.viewToken}` : e.url,
|
|
281
|
+
async: !0,
|
|
282
|
+
data: i ? e.data : void 0,
|
|
283
|
+
requestHeader: e.requestHeader,
|
|
284
|
+
success: function (t) {
|
|
285
|
+
var o = JSON.parse(t);
|
|
286
|
+
if ("Local" !== e.dataEnvType && "success" !== o.code) return o.message && console.error(`[BIMFACE ERROR]: ${o.message}`), void r(t);
|
|
287
|
+
if (o = o.data || o, e.enableStorage) {
|
|
288
|
+
(new f).addDatabagInfo(o, e.viewToken).then((() => n && n(o))).catch((() => n && n(o)))
|
|
289
|
+
} else n && n(o)
|
|
290
|
+
},
|
|
291
|
+
failure: r
|
|
292
|
+
})
|
|
293
|
+
}, p = function (e, t, o) {
|
|
294
|
+
h(e, o, (function (o) {
|
|
295
|
+
var r = function (e, t) {
|
|
296
|
+
let o, r = t.version;
|
|
297
|
+
if (e.renderVersion, /\d+?\.\d+?\.\d+/.test(r) && r.split(".")[0] >= 3) {
|
|
298
|
+
window.bimfaceSdkVersion = r;
|
|
299
|
+
const [e, t, n] = r.split(".");
|
|
300
|
+
"6" === t && Number(n) < 143 && (r = `Bimface@${r}`)
|
|
301
|
+
} else if ("Debug" == t.build) r = "Bimface", o = "Application"; else if (t.sdkPath) r = o = "bimface"; else if (t.viewType == n.DrawingView && "drawingView" != e.renderType) {
|
|
302
|
+
var a = e.subRenders;
|
|
303
|
+
if (a && 0 != a.length) for (var i = 0; i < a.length; i++) a[i].renderType == n.DrawingView && (r = a[i].jsSDKVersion, o = a[i].jsSDKVersion)
|
|
304
|
+
} else r = e.jsSDKVersion, o = e.jsSDKVersion;
|
|
305
|
+
return {ui: o, sdk: r}
|
|
306
|
+
}(o, e);
|
|
307
|
+
window.BimfaceLoaderConfig.fullStaticHost = "Local" == BimfaceLoaderConfig.dataEnvType ? e.staticHost + "/bimface" : e.staticHost + "/" + r.sdk;
|
|
308
|
+
var a = {metadata: o, options: e, successCb: t, sdkVersion: r.sdk, uiVersion: r.ui},
|
|
309
|
+
i = window.BimfaceLoaderConfig.fullStaticHost + "/bimface.index.js";
|
|
310
|
+
d([i], (function () {
|
|
311
|
+
postProcessing(a)
|
|
312
|
+
}), a)
|
|
313
|
+
}))
|
|
314
|
+
}, w = function (e, t) {
|
|
315
|
+
var n = "bimView" == e.renderType ? "3DView" : e.renderType, o = (e.subRenders, {
|
|
316
|
+
dataEnvType: t.dataEnvType,
|
|
317
|
+
viewToken: t.viewToken,
|
|
318
|
+
staticHost: t.staticHost,
|
|
319
|
+
APIHost: t.APIHost,
|
|
320
|
+
viewType: n
|
|
321
|
+
});
|
|
322
|
+
return Object.assign(o, e)
|
|
323
|
+
}, g = {
|
|
324
|
+
getStorage() {
|
|
325
|
+
return this.storage = this.storage || new f, this.storage
|
|
326
|
+
}, deleteStorageByModelId(e) {
|
|
327
|
+
return this.getStorage().deleteStorageByModelId(e)
|
|
328
|
+
}, getStoredModelIds() {
|
|
329
|
+
return this.getStorage().getStoredModelIds()
|
|
330
|
+
}, getStoredModelInfo() {
|
|
331
|
+
return this.getStorage().getStoredModelInfo()
|
|
332
|
+
}, store(e) {
|
|
333
|
+
let {
|
|
334
|
+
url: t,
|
|
335
|
+
viewToken: n,
|
|
336
|
+
storeMaterialOverride: o,
|
|
337
|
+
successCallback: r,
|
|
338
|
+
progressCallback: a,
|
|
339
|
+
errorCallback: i,
|
|
340
|
+
conditions: s,
|
|
341
|
+
storeByQueue: c
|
|
342
|
+
} = e;
|
|
343
|
+
const d = c && c.enable, l = d && (c.delay || 2e3);
|
|
344
|
+
if (!n) return;
|
|
345
|
+
t = t || [], r = r || function () {
|
|
346
|
+
}, a = a || function () {
|
|
347
|
+
}, i = i || function () {
|
|
348
|
+
};
|
|
349
|
+
const u = new BimfaceSDKLoaderConfig;
|
|
350
|
+
u.enableStorage = !0, u.viewToken = n, BimfaceSDKLoader.load(u).then((e => {
|
|
351
|
+
if ("3DView" == e.viewType) {
|
|
352
|
+
const c = document.createElement("div"), u = new Glodon.Bimface.Viewer.Viewer3DConfig;
|
|
353
|
+
u.domElement = c, u.enableStorage = !0;
|
|
354
|
+
const f = new Glodon.Bimface.Viewer.Viewer3D(u), h = new Promise((t => {
|
|
355
|
+
f.addModel(e), d || f.addEventListener(Glodon.Bimface.Viewer.Viewer3DEvent.ViewLoading, (e => a(e.progress)));
|
|
356
|
+
const r = () => {
|
|
357
|
+
requestAnimationFrame((() => {
|
|
358
|
+
f.destroy(), t()
|
|
359
|
+
}))
|
|
360
|
+
};
|
|
361
|
+
let i = !1;
|
|
362
|
+
f.addEventListener(Glodon.Bimface.Viewer.Viewer3DEvent.ViewAdded, (() => {
|
|
363
|
+
if (i) return;
|
|
364
|
+
const e = () => {
|
|
365
|
+
i = !0;
|
|
366
|
+
const e = f.getDefaultModel(),
|
|
367
|
+
t = e.getCloudViewer().getModelManager().getModel(e.modelId),
|
|
368
|
+
o = [...t._handler.layerProvider.getAllLayerIdxData().layerKeys],
|
|
369
|
+
s = [...t._handler.layerProvider.getLayerKeyAttributes()];
|
|
370
|
+
let c = 0;
|
|
371
|
+
const d = {}, u = () => {
|
|
372
|
+
if (a(Math.floor(100 * (c + 1) / o.length)), c === o.length) return void r();
|
|
373
|
+
o[c].split("-").forEach(((e, t) => d[s[t]] = e));
|
|
374
|
+
const e = f.getDefaultModel();
|
|
375
|
+
e && e.destroy();
|
|
376
|
+
const t = isNaN(l) ? 2e3 : Number(l);
|
|
377
|
+
setTimeout((() => {
|
|
378
|
+
f.addView(n)
|
|
379
|
+
}), t), c++
|
|
380
|
+
};
|
|
381
|
+
f.addEventListener(Glodon.Bimface.Viewer.Viewer3DEvent.ModelAdded, (() => {
|
|
382
|
+
f.showExclusiveComponentsByObjectData([d], null, u)
|
|
383
|
+
})), u()
|
|
384
|
+
};
|
|
385
|
+
o ? f.loadMaterialOverrideSet(f.getModel().modelId, n, (function () {
|
|
386
|
+
s ? f.showExclusiveComponentsByObjectData(s, null, r) : d ? e() : (f.showAllComponents(), f.addEventListener(Glodon.Bimface.Viewer.Viewer3DEvent.DemandLoaded, r))
|
|
387
|
+
})) : s ? f.showExclusiveComponentsByObjectData(s, null, r) : d ? e() : r()
|
|
388
|
+
}))
|
|
389
|
+
}));
|
|
390
|
+
Promise.all([h, f._storeData(t)]).then(r).catch(i)
|
|
391
|
+
}
|
|
392
|
+
})).catch()
|
|
393
|
+
}
|
|
394
|
+
}, m = function () {
|
|
395
|
+
return m = Object.assign || function (e) {
|
|
396
|
+
for (var t, n = 1, o = arguments.length; n < o; n++) for (var r in t = arguments[n]) Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]);
|
|
397
|
+
return e
|
|
398
|
+
}, m.apply(this, arguments)
|
|
399
|
+
};
|
|
400
|
+
|
|
401
|
+
function v(e, t, n, o) {
|
|
402
|
+
return new (n || (n = Promise))((function (r, a) {
|
|
403
|
+
function i(e) {
|
|
404
|
+
try {
|
|
405
|
+
c(o.next(e))
|
|
406
|
+
} catch (e) {
|
|
407
|
+
a(e)
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
function s(e) {
|
|
412
|
+
try {
|
|
413
|
+
c(o.throw(e))
|
|
414
|
+
} catch (e) {
|
|
415
|
+
a(e)
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
function c(e) {
|
|
420
|
+
var t;
|
|
421
|
+
e.done ? r(e.value) : (t = e.value, t instanceof n ? t : new n((function (e) {
|
|
422
|
+
e(t)
|
|
423
|
+
}))).then(i, s)
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
c((o = o.apply(e, t || [])).next())
|
|
427
|
+
}))
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
function b(e, t) {
|
|
431
|
+
var n, o, r, a, i = {
|
|
432
|
+
label: 0, sent: function () {
|
|
433
|
+
if (1 & r[0]) throw r[1];
|
|
434
|
+
return r[1]
|
|
435
|
+
}, trys: [], ops: []
|
|
436
|
+
};
|
|
437
|
+
return a = {
|
|
438
|
+
next: s(0),
|
|
439
|
+
throw: s(1),
|
|
440
|
+
return: s(2)
|
|
441
|
+
}, "function" == typeof Symbol && (a[Symbol.iterator] = function () {
|
|
442
|
+
return this
|
|
443
|
+
}), a;
|
|
444
|
+
|
|
445
|
+
function s(a) {
|
|
446
|
+
return function (s) {
|
|
447
|
+
return function (a) {
|
|
448
|
+
if (n) throw new TypeError("Generator is already executing.");
|
|
449
|
+
for (; i;) try {
|
|
450
|
+
if (n = 1, o && (r = 2 & a[0] ? o.return : a[0] ? o.throw || ((r = o.return) && r.call(o), 0) : o.next) && !(r = r.call(o, a[1])).done) return r;
|
|
451
|
+
switch (o = 0, r && (a = [2 & a[0], r.value]), a[0]) {
|
|
452
|
+
case 0:
|
|
453
|
+
case 1:
|
|
454
|
+
r = a;
|
|
455
|
+
break;
|
|
456
|
+
case 4:
|
|
457
|
+
return i.label++, {value: a[1], done: !1};
|
|
458
|
+
case 5:
|
|
459
|
+
i.label++, o = a[1], a = [0];
|
|
460
|
+
continue;
|
|
461
|
+
case 7:
|
|
462
|
+
a = i.ops.pop(), i.trys.pop();
|
|
463
|
+
continue;
|
|
464
|
+
default:
|
|
465
|
+
if (!(r = i.trys, (r = r.length > 0 && r[r.length - 1]) || 6 !== a[0] && 2 !== a[0])) {
|
|
466
|
+
i = 0;
|
|
467
|
+
continue
|
|
468
|
+
}
|
|
469
|
+
if (3 === a[0] && (!r || a[1] > r[0] && a[1] < r[3])) {
|
|
470
|
+
i.label = a[1];
|
|
471
|
+
break
|
|
472
|
+
}
|
|
473
|
+
if (6 === a[0] && i.label < r[1]) {
|
|
474
|
+
i.label = r[1], r = a;
|
|
475
|
+
break
|
|
476
|
+
}
|
|
477
|
+
if (r && i.label < r[2]) {
|
|
478
|
+
i.label = r[2], i.ops.push(a);
|
|
479
|
+
break
|
|
480
|
+
}
|
|
481
|
+
r[2] && i.ops.pop(), i.trys.pop();
|
|
482
|
+
continue
|
|
483
|
+
}
|
|
484
|
+
a = t.call(e, i)
|
|
485
|
+
} catch (e) {
|
|
486
|
+
a = [6, e], o = 0
|
|
487
|
+
} finally {
|
|
488
|
+
n = r = 0
|
|
489
|
+
}
|
|
490
|
+
if (5 & a[0]) throw a[1];
|
|
491
|
+
return {value: a[0] ? a[1] : void 0, done: !0}
|
|
492
|
+
}([a, s])
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
window.hostConfig = window.hostConfig || {
|
|
498
|
+
APIHost: "https://api.bimface.com",
|
|
499
|
+
resourceHost: "https://m.bimface.com",
|
|
500
|
+
staticHost: "https://static.bimface.com",
|
|
501
|
+
dataEnvType: "BIMFACE",
|
|
502
|
+
securityApi: !0
|
|
503
|
+
};
|
|
504
|
+
var y = function () {
|
|
505
|
+
window.hostConfig = window.hostConfig || {
|
|
506
|
+
APIHost: "https://api.bimface.com",
|
|
507
|
+
resourceHost: "https://m.bimface.com",
|
|
508
|
+
staticHost: "https://static.bimface.com",
|
|
509
|
+
dataEnvType: "BIMFACE",
|
|
510
|
+
securityApi: !0
|
|
511
|
+
};
|
|
512
|
+
var e = m({}, window.hostConfig);
|
|
513
|
+
return e.staticHost = window.hostConfig.staticHost + "/api", e
|
|
514
|
+
}, B = function () {
|
|
515
|
+
function e(e) {
|
|
516
|
+
this._config = e
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
return e.prototype.getModuleData = function (e) {
|
|
520
|
+
var t = this;
|
|
521
|
+
return new Promise((function (n, o) {
|
|
522
|
+
var r;
|
|
523
|
+
(r = {type: "post", data: e, url: t._config.APIHost + "/inside/databag"}, new Promise((function (e, t) {
|
|
524
|
+
var n = m(m({}, {type: "get", data: null}), r), o = new XMLHttpRequest;
|
|
525
|
+
o.onreadystatechange = function () {
|
|
526
|
+
if (4 == o.readyState) {
|
|
527
|
+
var n = o.status;
|
|
528
|
+
if (n >= 200 && n < 300 || 304 == n || 0 === n && "file:" === window.location.protocol) {
|
|
529
|
+
var r = void 0;
|
|
530
|
+
try {
|
|
531
|
+
r = JSON.parse(o.responseText)
|
|
532
|
+
} catch (e) {
|
|
533
|
+
throw e
|
|
534
|
+
}
|
|
535
|
+
e({json: r, responseText: o.responseText, responseXML: o.responseXML})
|
|
536
|
+
} else t(n)
|
|
537
|
+
}
|
|
538
|
+
}, o.open(n.type, n.url, n.async), o.send(n.data)
|
|
539
|
+
}))).then((function (e) {
|
|
540
|
+
e.json.data ? n(e.json.data) : o(e.json)
|
|
541
|
+
}))
|
|
542
|
+
}))
|
|
543
|
+
}, e.prototype.loadScript = function (e) {
|
|
544
|
+
return new Promise((function (t, n) {
|
|
545
|
+
var o = document.createElement("script");
|
|
546
|
+
o.setAttribute("src", e), o.onload = function () {
|
|
547
|
+
t(!0)
|
|
548
|
+
}, o.onerror = function (e) {
|
|
549
|
+
n(e), console.error(e)
|
|
550
|
+
}, document.getElementsByTagName("head")[0].append(o)
|
|
551
|
+
}))
|
|
552
|
+
}, e.prototype.loadCss = function (e) {
|
|
553
|
+
return new Promise((function (t, n) {
|
|
554
|
+
var o = document.createElement("link");
|
|
555
|
+
o.setAttribute("href", e), o.setAttribute("rel", "stylesheet"), o.onload = function () {
|
|
556
|
+
t(!0)
|
|
557
|
+
}, o.onerror = function (e) {
|
|
558
|
+
n(e), console.error(e)
|
|
559
|
+
}, document.getElementsByTagName("head")[0].append(o)
|
|
560
|
+
}))
|
|
561
|
+
}, e.prototype.getStaticMainSrc = function (e) {
|
|
562
|
+
return this._config.staticHost + "/Glodon/" + ("Debug" === this._config.build ? "Bimface" : e)
|
|
563
|
+
}, e.prototype.loadSDKLoader = function () {
|
|
564
|
+
var e = this;
|
|
565
|
+
return new Promise((function (t, n) {
|
|
566
|
+
if (window.BimfaceSDKLoader) t(!0); else {
|
|
567
|
+
var o = e._config.staticHost + "/BimfaceSDKLoader/BimfaceSDKLoader@latest-release.js";
|
|
568
|
+
e.loadScript(o).then((function () {
|
|
569
|
+
return t(!0)
|
|
570
|
+
})).catch((function () {
|
|
571
|
+
return n()
|
|
572
|
+
}))
|
|
573
|
+
}
|
|
574
|
+
}))
|
|
575
|
+
}, e.prototype.loadUIComponents = function (e) {
|
|
576
|
+
var t = this;
|
|
577
|
+
return new Promise((function (n, o) {
|
|
578
|
+
var r, a, i;
|
|
579
|
+
if (null === (i = null === (a = null === (r = window.Glodon) || void 0 === r ? void 0 : r.Bimface) || void 0 === a ? void 0 : a.Tiles) || void 0 === i ? void 0 : i.UI) return n(!0);
|
|
580
|
+
var s = t.getStaticMainSrc(e) + "/bimface.ui.css";
|
|
581
|
+
t.loadCss(s).then((function () {
|
|
582
|
+
return n(!0)
|
|
583
|
+
})).catch((function () {
|
|
584
|
+
return o()
|
|
585
|
+
}))
|
|
586
|
+
}))
|
|
587
|
+
}, e
|
|
588
|
+
}(), D = window.Glodon || {};
|
|
589
|
+
window.Glodon = D;
|
|
590
|
+
var T = D.Bimface = D.Bimface || {}, S = T.Module = T.Module || {}, P = function () {
|
|
591
|
+
function e(e) {
|
|
592
|
+
this._loadedModule = {}, this._config = e, this._helper = new B(e)
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
return e.prototype.loadModule = function (e) {
|
|
596
|
+
return v(this, void 0, void 0, (function () {
|
|
597
|
+
var t, n, o, r, a;
|
|
598
|
+
return b(this, (function (i) {
|
|
599
|
+
switch (i.label) {
|
|
600
|
+
case 0:
|
|
601
|
+
return t = new window.BimfaceSDKLoaderConfig, (t = m(m({}, t), this._config)).viewToken = e.viewToken, [4, window.BimfaceSDKLoader.load(t).catch((function (e) {
|
|
602
|
+
return console.log(e)
|
|
603
|
+
}))];
|
|
604
|
+
case 1:
|
|
605
|
+
return i.sent(), [4, this._helper.loadSDKLoader()];
|
|
606
|
+
case 2:
|
|
607
|
+
return i.sent(), [4, this._helper.getModuleData(e.viewToken)];
|
|
608
|
+
case 3:
|
|
609
|
+
return "moduleData" != (n = i.sent()).modelType ? [2, Promise.reject("[BIMFACE ERROR]: Invalid ViewToken, viewToken: [" + e.viewToken + "]")] : (n.viewToken = e.viewToken, o = n.jsSDKVersion, [4, this._helper.loadUIComponents(o)]);
|
|
610
|
+
case 4:
|
|
611
|
+
return i.sent(), this._loadedModule[e.moduleType] ? [3, 6] : (this._helper.loadCss(this._helper.getStaticMainSrc(o) + "/modules/" + e.moduleType + ".css"), [4, import(this._helper.getStaticMainSrc(o) + "/modules/" + e.moduleType + ".js")]);
|
|
612
|
+
case 5:
|
|
613
|
+
r = i.sent(), this._loadedModule[e.moduleType] = r.default, i.label = 6;
|
|
614
|
+
case 6:
|
|
615
|
+
for (a in this._loadedModule[e.moduleType]) this._loadedModule[e.moduleType][a].setCurrentModuleData && this._loadedModule[e.moduleType][a].setCurrentModuleData(n);
|
|
616
|
+
return [2, n]
|
|
617
|
+
}
|
|
618
|
+
}))
|
|
619
|
+
}))
|
|
620
|
+
}, e
|
|
621
|
+
}();
|
|
622
|
+
S.ModuleManager = P, S.ModuleManagerConfig = y;
|
|
623
|
+
var j = {
|
|
624
|
+
Version: "2023-3-16-11-23", load: function (e, n, r) {
|
|
625
|
+
window.BimfaceLoaderConfig = e, null == e.build && (e.build = t.Release);
|
|
626
|
+
var a = function (e) {
|
|
627
|
+
let n = Object.assign({}, e), r = "/Glodon";
|
|
628
|
+
return e.path ? (n.dataEnvType = o.Local, n.url = n.path, n.staticHost = n.sdkPath || i(n.path), n.resourcePath = i(n.path), n.path = i(n.path), r = n.sdkPath ? "" : "/jssdk") : e.resourcePath ? (n.dataEnvType = o.Local, n.url = n.resourcePath, n.resourcePath = i(n.resourcePath)) : (n.sdkPath && (r = "", n.staticHost = n.sdkPath), n.data = e.viewToken, n.url = `${e.APIHost}/inside/databag`), n.staticHost += r, e.build != t.Debug && n.configuration != t.Release || (n.configuration = ""), n.configuration = n.configuration ? `-${n.configuration.toLowerCase()}` : "", n
|
|
629
|
+
}(e);
|
|
630
|
+
if (!n && !r) return new Promise(((t, n) => {
|
|
631
|
+
p(a, (function (n) {
|
|
632
|
+
t(w(n, e))
|
|
633
|
+
}), n)
|
|
634
|
+
}));
|
|
635
|
+
p(a, (function (t) {
|
|
636
|
+
n && n(w(t, e))
|
|
637
|
+
}), (function (e) {
|
|
638
|
+
r && r()
|
|
639
|
+
}))
|
|
640
|
+
}, Storage: g
|
|
641
|
+
};
|
|
642
|
+
window.BimfaceSDKLoader = j
|
|
643
|
+
}();
|