@xtctwins/tctwins-bimx-engine 0.1.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.
Files changed (56) hide show
  1. package/README.md +1 -0
  2. package/dist/AnnotationTool-j9uTpTri.mjs +181 -0
  3. package/dist/BIMX_Viewer_Lib.es.js +8 -0
  4. package/dist/BIMX_Viewer_Lib.umd.js +90165 -0
  5. package/dist/CommentTool-BLrsulc_.mjs +186 -0
  6. package/dist/InspectorTool-BouA94us.mjs +166 -0
  7. package/dist/MeasureTool-CbYIFTPr.mjs +1468 -0
  8. package/dist/RoamTool-CXZPca_M.mjs +43 -0
  9. package/dist/ScreenShotTool-BiNcu9RZ.mjs +368 -0
  10. package/dist/SectionTool-DogiOv1d.mjs +466 -0
  11. package/dist/SettingTool-ClISeAhW.mjs +1261 -0
  12. package/dist/StructureTree-CmsIBbBk.mjs +1415 -0
  13. package/dist/closeButton.vue_vue_type_style_index_0_scope_true_lang-CBPVV86B.mjs +52 -0
  14. package/dist/const-DeAig7Pj.mjs +202 -0
  15. package/dist/debounce-B430Iy_D.mjs +80 -0
  16. package/dist/el-checkbox-id3wFY0e.mjs +479 -0
  17. package/dist/el-input-BW5rElpS.mjs +559 -0
  18. package/dist/el-scrollbar-La242VUu.mjs +34 -0
  19. package/dist/favicon.ico +0 -0
  20. package/dist/icon-DZm1Csdm.mjs +193 -0
  21. package/dist/index-3StVDuUH.mjs +115680 -0
  22. package/dist/index-BgjjA9sB.mjs +502 -0
  23. package/dist/index-L-tY1Gou.mjs +286 -0
  24. package/dist/index.html +17 -0
  25. package/dist/style.css +1 -0
  26. package/dist/use-form-item-DkYURTpK.mjs +105 -0
  27. package/package.json +67 -0
  28. package/types/BIMX_Viewer_Initial/viewerInitial.d.ts +16 -0
  29. package/types/components/BimViewerComponents/AnnotationTool.vue.d.ts +10 -0
  30. package/types/components/BimViewerComponents/CommentTool.vue.d.ts +14 -0
  31. package/types/components/BimViewerComponents/InspectorTool.vue.d.ts +14 -0
  32. package/types/components/BimViewerComponents/MeasureTool.vue.d.ts +12 -0
  33. package/types/components/BimViewerComponents/RoamTool.vue.d.ts +8 -0
  34. package/types/components/BimViewerComponents/ScreenShotTool.vue.d.ts +12 -0
  35. package/types/components/BimViewerComponents/SectionTool.vue.d.ts +6 -0
  36. package/types/components/BimViewerComponents/SettingTool.vue.d.ts +6 -0
  37. package/types/components/BimViewerComponents/StructureTree.vue.d.ts +6 -0
  38. package/types/components/BimViewerComponents/Toolbar.vue.d.ts +12 -0
  39. package/types/components/BimViewerComponents/emptyPage.vue.d.ts +8 -0
  40. package/types/components/BimX_Viewer.vue.d.ts +7 -0
  41. package/types/components/index.d.ts +4 -0
  42. package/types/components/types.d.ts +1 -0
  43. package/types/components/utilsComponents/closeButton.vue.d.ts +41 -0
  44. package/types/index.d.ts +9 -0
  45. package/types/main.d.ts +1 -0
  46. package/types/pages/mainView.vue.d.ts +7 -0
  47. package/types/router/index.d.ts +2 -0
  48. package/types/services/request/config.d.ts +13 -0
  49. package/types/store/components.d.ts +6 -0
  50. package/types/store/const.d.ts +200 -0
  51. package/types/store/ifcPropertyReflect.d.ts +1 -0
  52. package/types/store/toolbars.d.ts +96 -0
  53. package/types/utils/OSSHelper.d.ts +5 -0
  54. package/types/utils/eventBus.d.ts +2 -0
  55. package/types/utils/roles.d.ts +1 -0
  56. package/types/utils/splitType.d.ts +3 -0
@@ -0,0 +1,1261 @@
1
+ import { f as We, a as ke, c as G, I as xe, R as ye, u as Ne, D as Ee, x as ue, _ as Te, t as Fe, e as fe, w as ze, d as me, H as Qe, B as lt, S as nt, F as at, J as ot, N as Ce, T as je, k as Pe } from "./index-3StVDuUH.mjs";
2
+ import "./el-scrollbar-La242VUu.mjs";
3
+ import { E as it, a as st } from "./el-checkbox-id3wFY0e.mjs";
4
+ import { E as rt } from "./el-input-BW5rElpS.mjs";
5
+ import { a as ut, _ as dt } from "./closeButton.vue_vue_type_style_index_0_scope_true_lang-CBPVV86B.mjs";
6
+ import { defineComponent as ae, ref as z, reactive as Ke, computed as y, watch as de, onMounted as Ue, onUpdated as ct, openBlock as f, createElementBlock as P, normalizeClass as A, unref as t, withModifiers as Be, withDirectives as Ge, withKeys as pe, renderSlot as _e, createVNode as j, withCtx as Z, createBlock as X, createCommentVNode as W, nextTick as Se, shallowRef as mt, inject as vt, toRefs as Me, normalizeStyle as ie, createElementVNode as _, toDisplayString as Ve, h as ft, provide as bt, Fragment as ve, renderList as we, resolveDynamicComponent as he, createTextVNode as oe } from "vue";
7
+ import { b as gt } from "./const-DeAig7Pj.mjs";
8
+ import { c as ht, d as Ae, C as ce, I as ne, U as Q, a as Re, u as Oe, e as Ze, f as Ye, E as re, b as De } from "./use-form-item-DkYURTpK.mjs";
9
+ import { d as pt, m as yt, e as Vt, p as wt, i as Ie, l as St } from "./icon-DZm1Csdm.mjs";
10
+ import { u as et } from "./index-BgjjA9sB.mjs";
11
+ import { d as He } from "./debounce-B430Iy_D.mjs";
12
+ import { E as kt } from "./index-L-tY1Gou.mjs";
13
+ const Nt = (e) => ["", ...ht].includes(e), Et = 100, It = 600, Je = {
14
+ beforeMount(e, n) {
15
+ const s = n.value, { interval: l = Et, delay: m = It } = We(s) ? {} : s;
16
+ let d, r;
17
+ const u = () => We(s) ? s() : s.handler(), p = () => {
18
+ r && (clearTimeout(r), r = void 0), d && (clearInterval(d), d = void 0);
19
+ };
20
+ e.addEventListener("mousedown", (b) => {
21
+ b.button === 0 && (p(), u(), document.addEventListener("mouseup", () => p(), {
22
+ once: !0
23
+ }), r = setTimeout(() => {
24
+ d = setInterval(() => {
25
+ u();
26
+ }, l);
27
+ }, m));
28
+ });
29
+ }
30
+ }, Ct = ke({
31
+ id: {
32
+ type: String,
33
+ default: void 0
34
+ },
35
+ step: {
36
+ type: Number,
37
+ default: 1
38
+ },
39
+ stepStrictly: Boolean,
40
+ max: {
41
+ type: Number,
42
+ default: Number.POSITIVE_INFINITY
43
+ },
44
+ min: {
45
+ type: Number,
46
+ default: Number.NEGATIVE_INFINITY
47
+ },
48
+ modelValue: Number,
49
+ readonly: Boolean,
50
+ disabled: Boolean,
51
+ size: Ae,
52
+ controls: {
53
+ type: Boolean,
54
+ default: !0
55
+ },
56
+ controlsPosition: {
57
+ type: String,
58
+ default: "",
59
+ values: ["", "right"]
60
+ },
61
+ valueOnClear: {
62
+ type: [String, Number, null],
63
+ validator: (e) => e === null || G(e) || ["min", "max"].includes(e),
64
+ default: null
65
+ },
66
+ name: String,
67
+ label: String,
68
+ placeholder: String,
69
+ precision: {
70
+ type: Number,
71
+ validator: (e) => e >= 0 && e === Number.parseInt(`${e}`, 10)
72
+ },
73
+ validateEvent: {
74
+ type: Boolean,
75
+ default: !0
76
+ },
77
+ ...xe(["ariaLabel"])
78
+ }), Bt = {
79
+ [ce]: (e, n) => n !== e,
80
+ blur: (e) => e instanceof FocusEvent,
81
+ focus: (e) => e instanceof FocusEvent,
82
+ [ne]: (e) => G(e) || ye(e),
83
+ [Q]: (e) => G(e) || ye(e)
84
+ }, _t = ["aria-label", "onKeydown"], Tt = ["aria-label", "onKeydown"], Pt = ae({
85
+ name: "ElInputNumber"
86
+ }), Lt = /* @__PURE__ */ ae({
87
+ ...Pt,
88
+ props: Ct,
89
+ emits: Bt,
90
+ setup(e, { expose: n, emit: s }) {
91
+ const l = e, { t: m } = et(), d = Ne("input-number"), r = z(), u = Ke({
92
+ currentValue: l.modelValue,
93
+ userInput: null
94
+ }), { formItem: p } = Re(), b = y(() => G(l.modelValue) && l.modelValue <= l.min), w = y(() => G(l.modelValue) && l.modelValue >= l.max), c = y(() => {
95
+ const a = N(l.step);
96
+ return Ee(l.precision) ? Math.max(N(l.modelValue), a) : (a > l.precision && ue("InputNumber", "precision should not be less than the decimal places of step"), l.precision);
97
+ }), L = y(() => l.controls && l.controlsPosition === "right"), K = Oe(), F = Ze(), Y = y(() => {
98
+ if (u.userInput !== null)
99
+ return u.userInput;
100
+ let a = u.currentValue;
101
+ if (ye(a))
102
+ return "";
103
+ if (G(a)) {
104
+ if (Number.isNaN(a))
105
+ return "";
106
+ Ee(l.precision) || (a = a.toFixed(l.precision));
107
+ }
108
+ return a;
109
+ }), U = (a, i) => {
110
+ if (Ee(i) && (i = c.value), i === 0)
111
+ return Math.round(a);
112
+ let h = String(a);
113
+ const C = h.indexOf(".");
114
+ if (C === -1 || !h.replace(".", "").split("")[C + i])
115
+ return a;
116
+ const q = h.length;
117
+ return h.charAt(q - 1) === "5" && (h = `${h.slice(0, Math.max(0, q - 1))}6`), Number.parseFloat(Number(h).toFixed(i));
118
+ }, N = (a) => {
119
+ if (ye(a))
120
+ return 0;
121
+ const i = a.toString(), h = i.indexOf(".");
122
+ let C = 0;
123
+ return h !== -1 && (C = i.length - h - 1), C;
124
+ }, T = (a, i = 1) => G(a) ? U(a + l.step * i) : u.currentValue, R = () => {
125
+ if (l.readonly || F.value || w.value)
126
+ return;
127
+ const a = Number(Y.value) || 0, i = T(a);
128
+ g(i), s(ne, u.currentValue), O();
129
+ }, $ = () => {
130
+ if (l.readonly || F.value || b.value)
131
+ return;
132
+ const a = Number(Y.value) || 0, i = T(a, -1);
133
+ g(i), s(ne, u.currentValue), O();
134
+ }, o = (a, i) => {
135
+ const { max: h, min: C, step: E, precision: x, stepStrictly: q, valueOnClear: v } = l;
136
+ h < C && Fe("InputNumber", "min should not be greater than max.");
137
+ let S = Number(a);
138
+ if (ye(a) || Number.isNaN(S))
139
+ return null;
140
+ if (a === "") {
141
+ if (v === null)
142
+ return null;
143
+ S = fe(v) ? { min: C, max: h }[v] : v;
144
+ }
145
+ return q && (S = U(Math.round(S / E) * E, x)), Ee(x) || (S = U(S, x)), (S > h || S < C) && (S = S > h ? h : C, i && s(Q, S)), S;
146
+ }, g = (a, i = !0) => {
147
+ var h;
148
+ const C = u.currentValue, E = o(a);
149
+ if (!i) {
150
+ s(Q, E);
151
+ return;
152
+ }
153
+ C === E && a || (u.userInput = null, s(Q, E), C !== E && s(ce, E, C), l.validateEvent && ((h = p == null ? void 0 : p.validate) == null || h.call(p, "change").catch((x) => ue(x))), u.currentValue = E);
154
+ }, J = (a) => {
155
+ u.userInput = a;
156
+ const i = a === "" ? null : Number(a);
157
+ s(ne, i), g(i, !1);
158
+ }, B = (a) => {
159
+ const i = a !== "" ? Number(a) : "";
160
+ (G(i) && !Number.isNaN(i) || a === "") && g(i), O(), u.userInput = null;
161
+ }, I = () => {
162
+ var a, i;
163
+ (i = (a = r.value) == null ? void 0 : a.focus) == null || i.call(a);
164
+ }, D = () => {
165
+ var a, i;
166
+ (i = (a = r.value) == null ? void 0 : a.blur) == null || i.call(a);
167
+ }, V = (a) => {
168
+ s("focus", a);
169
+ }, M = (a) => {
170
+ var i;
171
+ u.userInput = null, s("blur", a), l.validateEvent && ((i = p == null ? void 0 : p.validate) == null || i.call(p, "blur").catch((h) => ue(h)));
172
+ }, O = () => {
173
+ u.currentValue !== l.modelValue && (u.currentValue = l.modelValue);
174
+ }, ee = (a) => {
175
+ document.activeElement === a.target && a.preventDefault();
176
+ };
177
+ return de(() => l.modelValue, (a, i) => {
178
+ const h = o(a, !0);
179
+ u.userInput === null && h !== i && (u.currentValue = h);
180
+ }, { immediate: !0 }), Ue(() => {
181
+ var a;
182
+ const { min: i, max: h, modelValue: C } = l, E = (a = r.value) == null ? void 0 : a.input;
183
+ if (E.setAttribute("role", "spinbutton"), Number.isFinite(h) ? E.setAttribute("aria-valuemax", String(h)) : E.removeAttribute("aria-valuemax"), Number.isFinite(i) ? E.setAttribute("aria-valuemin", String(i)) : E.removeAttribute("aria-valuemin"), E.setAttribute("aria-valuenow", u.currentValue || u.currentValue === 0 ? String(u.currentValue) : ""), E.setAttribute("aria-disabled", String(F.value)), !G(C) && C != null) {
184
+ let x = Number(C);
185
+ Number.isNaN(x) && (x = null), s(Q, x);
186
+ }
187
+ E.addEventListener("wheel", ee, { passive: !1 });
188
+ }), ct(() => {
189
+ var a, i;
190
+ const h = (a = r.value) == null ? void 0 : a.input;
191
+ h == null || h.setAttribute("aria-valuenow", `${(i = u.currentValue) != null ? i : ""}`);
192
+ }), Ye({
193
+ from: "label",
194
+ replacement: "aria-label",
195
+ version: "2.8.0",
196
+ scope: "el-input-number",
197
+ ref: "https://element-plus.org/en-US/component/input-number.html"
198
+ }, y(() => !!l.label)), n({
199
+ focus: I,
200
+ blur: D
201
+ }), (a, i) => (f(), P("div", {
202
+ class: A([
203
+ t(d).b(),
204
+ t(d).m(t(K)),
205
+ t(d).is("disabled", t(F)),
206
+ t(d).is("without-controls", !a.controls),
207
+ t(d).is("controls-right", t(L))
208
+ ]),
209
+ onDragstart: i[0] || (i[0] = Be(() => {
210
+ }, ["prevent"]))
211
+ }, [
212
+ a.controls ? Ge((f(), P("span", {
213
+ key: 0,
214
+ role: "button",
215
+ "aria-label": t(m)("el.inputNumber.decrease"),
216
+ class: A([t(d).e("decrease"), t(d).is("disabled", t(b))]),
217
+ onKeydown: pe($, ["enter"])
218
+ }, [
219
+ _e(a.$slots, "decrease-icon", {}, () => [
220
+ j(t(re), null, {
221
+ default: Z(() => [
222
+ t(L) ? (f(), X(t(pt), { key: 0 })) : (f(), X(t(yt), { key: 1 }))
223
+ ]),
224
+ _: 1
225
+ })
226
+ ])
227
+ ], 42, _t)), [
228
+ [t(Je), $]
229
+ ]) : W("v-if", !0),
230
+ a.controls ? Ge((f(), P("span", {
231
+ key: 1,
232
+ role: "button",
233
+ "aria-label": t(m)("el.inputNumber.increase"),
234
+ class: A([t(d).e("increase"), t(d).is("disabled", t(w))]),
235
+ onKeydown: pe(R, ["enter"])
236
+ }, [
237
+ _e(a.$slots, "increase-icon", {}, () => [
238
+ j(t(re), null, {
239
+ default: Z(() => [
240
+ t(L) ? (f(), X(t(Vt), { key: 0 })) : (f(), X(t(wt), { key: 1 }))
241
+ ]),
242
+ _: 1
243
+ })
244
+ ])
245
+ ], 42, Tt)), [
246
+ [t(Je), R]
247
+ ]) : W("v-if", !0),
248
+ j(t(rt), {
249
+ id: a.id,
250
+ ref_key: "input",
251
+ ref: r,
252
+ type: "number",
253
+ step: a.step,
254
+ "model-value": t(Y),
255
+ placeholder: a.placeholder,
256
+ readonly: a.readonly,
257
+ disabled: t(F),
258
+ size: t(K),
259
+ max: a.max,
260
+ min: a.min,
261
+ name: a.name,
262
+ "aria-label": a.label || a.ariaLabel,
263
+ "validate-event": !1,
264
+ onKeydown: [
265
+ pe(Be(R, ["prevent"]), ["up"]),
266
+ pe(Be($, ["prevent"]), ["down"])
267
+ ],
268
+ onBlur: M,
269
+ onFocus: V,
270
+ onInput: J,
271
+ onChange: B
272
+ }, null, 8, ["id", "step", "model-value", "placeholder", "readonly", "disabled", "size", "max", "min", "name", "aria-label", "onKeydown"])
273
+ ], 34));
274
+ }
275
+ });
276
+ var Mt = /* @__PURE__ */ Te(Lt, [["__file", "input-number.vue"]]);
277
+ const At = ze(Mt), tt = Symbol("sliderContextKey"), $t = ke({
278
+ modelValue: {
279
+ type: me([Number, Array]),
280
+ default: 0
281
+ },
282
+ id: {
283
+ type: String,
284
+ default: void 0
285
+ },
286
+ min: {
287
+ type: Number,
288
+ default: 0
289
+ },
290
+ max: {
291
+ type: Number,
292
+ default: 100
293
+ },
294
+ step: {
295
+ type: Number,
296
+ default: 1
297
+ },
298
+ showInput: Boolean,
299
+ showInputControls: {
300
+ type: Boolean,
301
+ default: !0
302
+ },
303
+ size: Ae,
304
+ inputSize: Ae,
305
+ showStops: Boolean,
306
+ showTooltip: {
307
+ type: Boolean,
308
+ default: !0
309
+ },
310
+ formatTooltip: {
311
+ type: me(Function),
312
+ default: void 0
313
+ },
314
+ disabled: Boolean,
315
+ range: Boolean,
316
+ vertical: Boolean,
317
+ height: String,
318
+ debounce: {
319
+ type: Number,
320
+ default: 300
321
+ },
322
+ label: {
323
+ type: String,
324
+ default: void 0
325
+ },
326
+ rangeStartLabel: {
327
+ type: String,
328
+ default: void 0
329
+ },
330
+ rangeEndLabel: {
331
+ type: String,
332
+ default: void 0
333
+ },
334
+ formatValueText: {
335
+ type: me(Function),
336
+ default: void 0
337
+ },
338
+ tooltipClass: {
339
+ type: String,
340
+ default: void 0
341
+ },
342
+ placement: {
343
+ type: String,
344
+ values: Qe,
345
+ default: "top"
346
+ },
347
+ marks: {
348
+ type: me(Object)
349
+ },
350
+ validateEvent: {
351
+ type: Boolean,
352
+ default: !0
353
+ },
354
+ ...xe(["ariaLabel"])
355
+ }), Le = (e) => G(e) || lt(e) && e.every(G), xt = {
356
+ [Q]: Le,
357
+ [ne]: Le,
358
+ [ce]: Le
359
+ }, Ft = (e, n, s) => {
360
+ const l = z();
361
+ return Ue(async () => {
362
+ e.range ? (Array.isArray(e.modelValue) ? (n.firstValue = Math.max(e.min, e.modelValue[0]), n.secondValue = Math.min(e.max, e.modelValue[1])) : (n.firstValue = e.min, n.secondValue = e.max), n.oldValue = [n.firstValue, n.secondValue]) : (typeof e.modelValue != "number" || Number.isNaN(e.modelValue) ? n.firstValue = e.min : n.firstValue = Math.min(e.max, Math.max(e.min, e.modelValue)), n.oldValue = n.firstValue), nt(window, "resize", s), await Se(), s();
363
+ }), {
364
+ sliderWrapper: l
365
+ };
366
+ }, zt = (e) => y(() => e.marks ? Object.keys(e.marks).map(Number.parseFloat).sort((s, l) => s - l).filter((s) => s <= e.max && s >= e.min).map((s) => ({
367
+ point: s,
368
+ position: (s - e.min) * 100 / (e.max - e.min),
369
+ mark: e.marks[s]
370
+ })) : []), Kt = (e, n, s) => {
371
+ const { form: l, formItem: m } = Re(), d = mt(), r = z(), u = z(), p = {
372
+ firstButton: r,
373
+ secondButton: u
374
+ }, b = y(() => e.disabled || (l == null ? void 0 : l.disabled) || !1), w = y(() => Math.min(n.firstValue, n.secondValue)), c = y(() => Math.max(n.firstValue, n.secondValue)), L = y(() => e.range ? `${100 * (c.value - w.value) / (e.max - e.min)}%` : `${100 * (n.firstValue - e.min) / (e.max - e.min)}%`), K = y(() => e.range ? `${100 * (w.value - e.min) / (e.max - e.min)}%` : "0%"), F = y(() => e.vertical ? { height: e.height } : {}), Y = y(() => e.vertical ? {
375
+ height: L.value,
376
+ bottom: K.value
377
+ } : {
378
+ width: L.value,
379
+ left: K.value
380
+ }), U = () => {
381
+ d.value && (n.sliderSize = d.value[`client${e.vertical ? "Height" : "Width"}`]);
382
+ }, N = (V) => {
383
+ const M = e.min + V * (e.max - e.min) / 100;
384
+ if (!e.range)
385
+ return r;
386
+ let O;
387
+ return Math.abs(w.value - M) < Math.abs(c.value - M) ? O = n.firstValue < n.secondValue ? "firstButton" : "secondButton" : O = n.firstValue > n.secondValue ? "firstButton" : "secondButton", p[O];
388
+ }, T = (V) => {
389
+ const M = N(V);
390
+ return M.value.setPosition(V), M;
391
+ }, R = (V) => {
392
+ n.firstValue = V, o(e.range ? [w.value, c.value] : V);
393
+ }, $ = (V) => {
394
+ n.secondValue = V, e.range && o([w.value, c.value]);
395
+ }, o = (V) => {
396
+ s(Q, V), s(ne, V);
397
+ }, g = async () => {
398
+ await Se(), s(ce, e.range ? [w.value, c.value] : e.modelValue);
399
+ }, J = (V) => {
400
+ var M, O, ee, a, i, h;
401
+ if (b.value || n.dragging)
402
+ return;
403
+ U();
404
+ let C = 0;
405
+ if (e.vertical) {
406
+ const E = (ee = (O = (M = V.touches) == null ? void 0 : M.item(0)) == null ? void 0 : O.clientY) != null ? ee : V.clientY;
407
+ C = (d.value.getBoundingClientRect().bottom - E) / n.sliderSize * 100;
408
+ } else {
409
+ const E = (h = (i = (a = V.touches) == null ? void 0 : a.item(0)) == null ? void 0 : i.clientX) != null ? h : V.clientX, x = d.value.getBoundingClientRect().left;
410
+ C = (E - x) / n.sliderSize * 100;
411
+ }
412
+ if (!(C < 0 || C > 100))
413
+ return T(C);
414
+ };
415
+ return {
416
+ elFormItem: m,
417
+ slider: d,
418
+ firstButton: r,
419
+ secondButton: u,
420
+ sliderDisabled: b,
421
+ minValue: w,
422
+ maxValue: c,
423
+ runwayStyle: F,
424
+ barStyle: Y,
425
+ resetSize: U,
426
+ setPosition: T,
427
+ emitChange: g,
428
+ onSliderWrapperPrevent: (V) => {
429
+ var M, O;
430
+ ((M = p.firstButton.value) != null && M.dragging || (O = p.secondButton.value) != null && O.dragging) && V.preventDefault();
431
+ },
432
+ onSliderClick: (V) => {
433
+ J(V) && g();
434
+ },
435
+ onSliderDown: async (V) => {
436
+ const M = J(V);
437
+ M && (await Se(), M.value.onButtonDown(V));
438
+ },
439
+ setFirstValue: R,
440
+ setSecondValue: $
441
+ };
442
+ }, { left: Ut, down: Rt, right: Ot, up: Yt, home: Xt, end: Wt, pageUp: jt, pageDown: Gt } = at, Ht = (e, n, s) => {
443
+ const l = z(), m = z(!1), d = y(() => n.value instanceof Function), r = y(() => d.value && n.value(e.modelValue) || e.modelValue), u = He(() => {
444
+ s.value && (m.value = !0);
445
+ }, 50), p = He(() => {
446
+ s.value && (m.value = !1);
447
+ }, 50);
448
+ return {
449
+ tooltip: l,
450
+ tooltipVisible: m,
451
+ formatValue: r,
452
+ displayTooltip: u,
453
+ hideTooltip: p
454
+ };
455
+ }, Jt = (e, n, s) => {
456
+ const {
457
+ disabled: l,
458
+ min: m,
459
+ max: d,
460
+ step: r,
461
+ showTooltip: u,
462
+ precision: p,
463
+ sliderSize: b,
464
+ formatTooltip: w,
465
+ emitChange: c,
466
+ resetSize: L,
467
+ updateDragging: K
468
+ } = vt(tt), { tooltip: F, tooltipVisible: Y, formatValue: U, displayTooltip: N, hideTooltip: T } = Ht(e, w, u), R = z(), $ = y(() => `${(e.modelValue - m.value) / (d.value - m.value) * 100}%`), o = y(() => e.vertical ? { bottom: $.value } : { left: $.value }), g = () => {
469
+ n.hovering = !0, N();
470
+ }, J = () => {
471
+ n.hovering = !1, n.dragging || T();
472
+ }, B = (v) => {
473
+ l.value || (v.preventDefault(), C(v), window.addEventListener("mousemove", E), window.addEventListener("touchmove", E), window.addEventListener("mouseup", x), window.addEventListener("touchend", x), window.addEventListener("contextmenu", x), R.value.focus());
474
+ }, I = (v) => {
475
+ l.value || (n.newPosition = Number.parseFloat($.value) + v / (d.value - m.value) * 100, q(n.newPosition), c());
476
+ }, D = () => {
477
+ I(-r.value);
478
+ }, V = () => {
479
+ I(r.value);
480
+ }, M = () => {
481
+ I(-r.value * 4);
482
+ }, O = () => {
483
+ I(r.value * 4);
484
+ }, ee = () => {
485
+ l.value || (q(0), c());
486
+ }, a = () => {
487
+ l.value || (q(100), c());
488
+ }, i = (v) => {
489
+ let S = !0;
490
+ [Ut, Rt].includes(v.key) ? D() : [Ot, Yt].includes(v.key) ? V() : v.key === Xt ? ee() : v.key === Wt ? a() : v.key === Gt ? M() : v.key === jt ? O() : S = !1, S && v.preventDefault();
491
+ }, h = (v) => {
492
+ let S, te;
493
+ return v.type.startsWith("touch") ? (te = v.touches[0].clientY, S = v.touches[0].clientX) : (te = v.clientY, S = v.clientX), {
494
+ clientX: S,
495
+ clientY: te
496
+ };
497
+ }, C = (v) => {
498
+ n.dragging = !0, n.isClick = !0;
499
+ const { clientX: S, clientY: te } = h(v);
500
+ e.vertical ? n.startY = te : n.startX = S, n.startPosition = Number.parseFloat($.value), n.newPosition = n.startPosition;
501
+ }, E = (v) => {
502
+ if (n.dragging) {
503
+ n.isClick = !1, N(), L();
504
+ let S;
505
+ const { clientX: te, clientY: se } = h(v);
506
+ e.vertical ? (n.currentY = se, S = (n.startY - n.currentY) / b.value * 100) : (n.currentX = te, S = (n.currentX - n.startX) / b.value * 100), n.newPosition = n.startPosition + S, q(n.newPosition);
507
+ }
508
+ }, x = () => {
509
+ n.dragging && (setTimeout(() => {
510
+ n.dragging = !1, n.hovering || T(), n.isClick || q(n.newPosition), c();
511
+ }, 0), window.removeEventListener("mousemove", E), window.removeEventListener("touchmove", E), window.removeEventListener("mouseup", x), window.removeEventListener("touchend", x), window.removeEventListener("contextmenu", x));
512
+ }, q = async (v) => {
513
+ if (v === null || Number.isNaN(+v))
514
+ return;
515
+ v < 0 ? v = 0 : v > 100 && (v = 100);
516
+ const S = 100 / ((d.value - m.value) / r.value);
517
+ let se = Math.round(v / S) * S * (d.value - m.value) * 0.01 + m.value;
518
+ se = Number.parseFloat(se.toFixed(p.value)), se !== e.modelValue && s(Q, se), !n.dragging && e.modelValue !== n.oldValue && (n.oldValue = e.modelValue), await Se(), n.dragging && N(), F.value.updatePopper();
519
+ };
520
+ return de(() => n.dragging, (v) => {
521
+ K(v);
522
+ }), {
523
+ disabled: l,
524
+ button: R,
525
+ tooltip: F,
526
+ tooltipVisible: Y,
527
+ showTooltip: u,
528
+ wrapperStyle: o,
529
+ formatValue: U,
530
+ handleMouseEnter: g,
531
+ handleMouseLeave: J,
532
+ onButtonDown: B,
533
+ onKeyDown: i,
534
+ setPosition: q
535
+ };
536
+ }, qt = (e, n, s, l) => ({
537
+ stops: y(() => {
538
+ if (!e.showStops || e.min > e.max)
539
+ return [];
540
+ if (e.step === 0)
541
+ return ue("ElSlider", "step should not be 0."), [];
542
+ const r = (e.max - e.min) / e.step, u = 100 * e.step / (e.max - e.min), p = Array.from({ length: r - 1 }).map((b, w) => (w + 1) * u);
543
+ return e.range ? p.filter((b) => b < 100 * (s.value - e.min) / (e.max - e.min) || b > 100 * (l.value - e.min) / (e.max - e.min)) : p.filter((b) => b > 100 * (n.firstValue - e.min) / (e.max - e.min));
544
+ }),
545
+ getStopStyle: (r) => e.vertical ? { bottom: `${r}%` } : { left: `${r}%` }
546
+ }), Qt = (e, n, s, l, m, d) => {
547
+ const r = (b) => {
548
+ m(Q, b), m(ne, b);
549
+ }, u = () => e.range ? ![s.value, l.value].every((b, w) => b === n.oldValue[w]) : e.modelValue !== n.oldValue, p = () => {
550
+ var b, w;
551
+ e.min > e.max && Fe("Slider", "min should not be greater than max.");
552
+ const c = e.modelValue;
553
+ e.range && Array.isArray(c) ? c[1] < e.min ? r([e.min, e.min]) : c[0] > e.max ? r([e.max, e.max]) : c[0] < e.min ? r([e.min, c[1]]) : c[1] > e.max ? r([c[0], e.max]) : (n.firstValue = c[0], n.secondValue = c[1], u() && (e.validateEvent && ((b = d == null ? void 0 : d.validate) == null || b.call(d, "change").catch((L) => ue(L))), n.oldValue = c.slice())) : !e.range && typeof c == "number" && !Number.isNaN(c) && (c < e.min ? r(e.min) : c > e.max ? r(e.max) : (n.firstValue = c, u() && (e.validateEvent && ((w = d == null ? void 0 : d.validate) == null || w.call(d, "change").catch((L) => ue(L))), n.oldValue = c)));
554
+ };
555
+ p(), de(() => n.dragging, (b) => {
556
+ b || p();
557
+ }), de(() => e.modelValue, (b, w) => {
558
+ n.dragging || Array.isArray(b) && Array.isArray(w) && b.every((c, L) => c === w[L]) && n.firstValue === b[0] && n.secondValue === b[1] || p();
559
+ }, {
560
+ deep: !0
561
+ }), de(() => [e.min, e.max], () => {
562
+ p();
563
+ });
564
+ }, Zt = ke({
565
+ modelValue: {
566
+ type: Number,
567
+ default: 0
568
+ },
569
+ vertical: Boolean,
570
+ tooltipClass: String,
571
+ placement: {
572
+ type: String,
573
+ values: Qe,
574
+ default: "top"
575
+ }
576
+ }), Dt = {
577
+ [Q]: (e) => G(e)
578
+ }, el = ["tabindex"], tl = ae({
579
+ name: "ElSliderButton"
580
+ }), ll = /* @__PURE__ */ ae({
581
+ ...tl,
582
+ props: Zt,
583
+ emits: Dt,
584
+ setup(e, { expose: n, emit: s }) {
585
+ const l = e, m = Ne("slider"), d = Ke({
586
+ hovering: !1,
587
+ dragging: !1,
588
+ isClick: !1,
589
+ startX: 0,
590
+ currentX: 0,
591
+ startY: 0,
592
+ currentY: 0,
593
+ startPosition: 0,
594
+ newPosition: 0,
595
+ oldValue: l.modelValue
596
+ }), {
597
+ disabled: r,
598
+ button: u,
599
+ tooltip: p,
600
+ showTooltip: b,
601
+ tooltipVisible: w,
602
+ wrapperStyle: c,
603
+ formatValue: L,
604
+ handleMouseEnter: K,
605
+ handleMouseLeave: F,
606
+ onButtonDown: Y,
607
+ onKeyDown: U,
608
+ setPosition: N
609
+ } = Jt(l, d, s), { hovering: T, dragging: R } = Me(d);
610
+ return n({
611
+ onButtonDown: Y,
612
+ onKeyDown: U,
613
+ setPosition: N,
614
+ hovering: T,
615
+ dragging: R
616
+ }), ($, o) => (f(), P("div", {
617
+ ref_key: "button",
618
+ ref: u,
619
+ class: A([t(m).e("button-wrapper"), { hover: t(T), dragging: t(R) }]),
620
+ style: ie(t(c)),
621
+ tabindex: t(r) ? -1 : 0,
622
+ onMouseenter: o[0] || (o[0] = (...g) => t(K) && t(K)(...g)),
623
+ onMouseleave: o[1] || (o[1] = (...g) => t(F) && t(F)(...g)),
624
+ onMousedown: o[2] || (o[2] = (...g) => t(Y) && t(Y)(...g)),
625
+ onTouchstart: o[3] || (o[3] = (...g) => t(Y) && t(Y)(...g)),
626
+ onFocus: o[4] || (o[4] = (...g) => t(K) && t(K)(...g)),
627
+ onBlur: o[5] || (o[5] = (...g) => t(F) && t(F)(...g)),
628
+ onKeydown: o[6] || (o[6] = (...g) => t(U) && t(U)(...g))
629
+ }, [
630
+ j(t(ot), {
631
+ ref_key: "tooltip",
632
+ ref: p,
633
+ visible: t(w),
634
+ placement: $.placement,
635
+ "fallback-placements": ["top", "bottom", "right", "left"],
636
+ "stop-popper-mouse-event": !1,
637
+ "popper-class": $.tooltipClass,
638
+ disabled: !t(b),
639
+ persistent: ""
640
+ }, {
641
+ content: Z(() => [
642
+ _("span", null, Ve(t(L)), 1)
643
+ ]),
644
+ default: Z(() => [
645
+ _("div", {
646
+ class: A([t(m).e("button"), { hover: t(T), dragging: t(R) }])
647
+ }, null, 2)
648
+ ]),
649
+ _: 1
650
+ }, 8, ["visible", "placement", "popper-class", "disabled"])
651
+ ], 46, el));
652
+ }
653
+ });
654
+ var qe = /* @__PURE__ */ Te(ll, [["__file", "button.vue"]]);
655
+ const nl = ke({
656
+ mark: {
657
+ type: me([String, Object]),
658
+ default: void 0
659
+ }
660
+ });
661
+ var al = ae({
662
+ name: "ElSliderMarker",
663
+ props: nl,
664
+ setup(e) {
665
+ const n = Ne("slider"), s = y(() => fe(e.mark) ? e.mark : e.mark.label), l = y(() => fe(e.mark) ? void 0 : e.mark.style);
666
+ return () => ft("div", {
667
+ class: n.e("marks-text"),
668
+ style: l.value
669
+ }, s.value);
670
+ }
671
+ });
672
+ const ol = ["id", "role", "aria-label", "aria-labelledby"], il = { key: 1 }, sl = ae({
673
+ name: "ElSlider"
674
+ }), rl = /* @__PURE__ */ ae({
675
+ ...sl,
676
+ props: $t,
677
+ emits: xt,
678
+ setup(e, { expose: n, emit: s }) {
679
+ const l = e, m = Ne("slider"), { t: d } = et(), r = Ke({
680
+ firstValue: 0,
681
+ secondValue: 0,
682
+ oldValue: 0,
683
+ dragging: !1,
684
+ sliderSize: 1
685
+ }), {
686
+ elFormItem: u,
687
+ slider: p,
688
+ firstButton: b,
689
+ secondButton: w,
690
+ sliderDisabled: c,
691
+ minValue: L,
692
+ maxValue: K,
693
+ runwayStyle: F,
694
+ barStyle: Y,
695
+ resetSize: U,
696
+ emitChange: N,
697
+ onSliderWrapperPrevent: T,
698
+ onSliderClick: R,
699
+ onSliderDown: $,
700
+ setFirstValue: o,
701
+ setSecondValue: g
702
+ } = Kt(l, r, s), { stops: J, getStopStyle: B } = qt(l, r, L, K), { inputId: I, isLabeledByFormItem: D } = De(l, {
703
+ formItemContext: u
704
+ }), V = Oe(), M = y(() => l.inputSize || V.value), O = y(() => l.label || l.ariaLabel || d("el.slider.defaultLabel", {
705
+ min: l.min,
706
+ max: l.max
707
+ })), ee = y(() => l.range ? l.rangeStartLabel || d("el.slider.defaultRangeStartLabel") : O.value), a = y(() => l.formatValueText ? l.formatValueText(v.value) : `${v.value}`), i = y(() => l.rangeEndLabel || d("el.slider.defaultRangeEndLabel")), h = y(() => l.formatValueText ? l.formatValueText(S.value) : `${S.value}`), C = y(() => [
708
+ m.b(),
709
+ m.m(V.value),
710
+ m.is("vertical", l.vertical),
711
+ { [m.m("with-input")]: l.showInput }
712
+ ]), E = zt(l);
713
+ Qt(l, r, L, K, s, u);
714
+ const x = y(() => {
715
+ const k = [l.min, l.max, l.step].map((le) => {
716
+ const be = `${le}`.split(".")[1];
717
+ return be ? be.length : 0;
718
+ });
719
+ return Math.max.apply(null, k);
720
+ }), { sliderWrapper: q } = Ft(l, r, U), { firstValue: v, secondValue: S, sliderSize: te } = Me(r), se = (k) => {
721
+ r.dragging = k;
722
+ };
723
+ return bt(tt, {
724
+ ...Me(l),
725
+ sliderSize: te,
726
+ disabled: c,
727
+ precision: x,
728
+ emitChange: N,
729
+ resetSize: U,
730
+ updateDragging: se
731
+ }), Ye({
732
+ from: "label",
733
+ replacement: "aria-label",
734
+ version: "2.8.0",
735
+ scope: "el-slider",
736
+ ref: "https://element-plus.org/en-US/component/slider.html"
737
+ }, y(() => !!l.label)), n({
738
+ onSliderClick: R
739
+ }), (k, le) => {
740
+ var be, Xe;
741
+ return f(), P("div", {
742
+ id: k.range ? t(I) : void 0,
743
+ ref_key: "sliderWrapper",
744
+ ref: q,
745
+ class: A(t(C)),
746
+ role: k.range ? "group" : void 0,
747
+ "aria-label": k.range && !t(D) ? t(O) : void 0,
748
+ "aria-labelledby": k.range && t(D) ? (be = t(u)) == null ? void 0 : be.labelId : void 0,
749
+ onTouchstart: le[2] || (le[2] = (...H) => t(T) && t(T)(...H)),
750
+ onTouchmove: le[3] || (le[3] = (...H) => t(T) && t(T)(...H))
751
+ }, [
752
+ _("div", {
753
+ ref_key: "slider",
754
+ ref: p,
755
+ class: A([
756
+ t(m).e("runway"),
757
+ { "show-input": k.showInput && !k.range },
758
+ t(m).is("disabled", t(c))
759
+ ]),
760
+ style: ie(t(F)),
761
+ onMousedown: le[0] || (le[0] = (...H) => t($) && t($)(...H)),
762
+ onTouchstart: le[1] || (le[1] = (...H) => t($) && t($)(...H))
763
+ }, [
764
+ _("div", {
765
+ class: A(t(m).e("bar")),
766
+ style: ie(t(Y))
767
+ }, null, 6),
768
+ j(qe, {
769
+ id: k.range ? void 0 : t(I),
770
+ ref_key: "firstButton",
771
+ ref: b,
772
+ "model-value": t(v),
773
+ vertical: k.vertical,
774
+ "tooltip-class": k.tooltipClass,
775
+ placement: k.placement,
776
+ role: "slider",
777
+ "aria-label": k.range || !t(D) ? t(ee) : void 0,
778
+ "aria-labelledby": !k.range && t(D) ? (Xe = t(u)) == null ? void 0 : Xe.labelId : void 0,
779
+ "aria-valuemin": k.min,
780
+ "aria-valuemax": k.range ? t(S) : k.max,
781
+ "aria-valuenow": t(v),
782
+ "aria-valuetext": t(a),
783
+ "aria-orientation": k.vertical ? "vertical" : "horizontal",
784
+ "aria-disabled": t(c),
785
+ "onUpdate:modelValue": t(o)
786
+ }, null, 8, ["id", "model-value", "vertical", "tooltip-class", "placement", "aria-label", "aria-labelledby", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-orientation", "aria-disabled", "onUpdate:modelValue"]),
787
+ k.range ? (f(), X(qe, {
788
+ key: 0,
789
+ ref_key: "secondButton",
790
+ ref: w,
791
+ "model-value": t(S),
792
+ vertical: k.vertical,
793
+ "tooltip-class": k.tooltipClass,
794
+ placement: k.placement,
795
+ role: "slider",
796
+ "aria-label": t(i),
797
+ "aria-valuemin": t(v),
798
+ "aria-valuemax": k.max,
799
+ "aria-valuenow": t(S),
800
+ "aria-valuetext": t(h),
801
+ "aria-orientation": k.vertical ? "vertical" : "horizontal",
802
+ "aria-disabled": t(c),
803
+ "onUpdate:modelValue": t(g)
804
+ }, null, 8, ["model-value", "vertical", "tooltip-class", "placement", "aria-label", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-orientation", "aria-disabled", "onUpdate:modelValue"])) : W("v-if", !0),
805
+ k.showStops ? (f(), P("div", il, [
806
+ (f(!0), P(ve, null, we(t(J), (H, ge) => (f(), P("div", {
807
+ key: ge,
808
+ class: A(t(m).e("stop")),
809
+ style: ie(t(B)(H))
810
+ }, null, 6))), 128))
811
+ ])) : W("v-if", !0),
812
+ t(E).length > 0 ? (f(), P(ve, { key: 2 }, [
813
+ _("div", null, [
814
+ (f(!0), P(ve, null, we(t(E), (H, ge) => (f(), P("div", {
815
+ key: ge,
816
+ style: ie(t(B)(H.position)),
817
+ class: A([t(m).e("stop"), t(m).e("marks-stop")])
818
+ }, null, 6))), 128))
819
+ ]),
820
+ _("div", {
821
+ class: A(t(m).e("marks"))
822
+ }, [
823
+ (f(!0), P(ve, null, we(t(E), (H, ge) => (f(), X(t(al), {
824
+ key: ge,
825
+ mark: H.mark,
826
+ style: ie(t(B)(H.position))
827
+ }, null, 8, ["mark", "style"]))), 128))
828
+ ], 2)
829
+ ], 64)) : W("v-if", !0)
830
+ ], 38),
831
+ k.showInput && !k.range ? (f(), X(t(At), {
832
+ key: 0,
833
+ ref: "input",
834
+ "model-value": t(v),
835
+ class: A(t(m).e("input")),
836
+ step: k.step,
837
+ disabled: t(c),
838
+ controls: k.showInputControls,
839
+ min: k.min,
840
+ max: k.max,
841
+ debounce: k.debounce,
842
+ size: t(M),
843
+ "onUpdate:modelValue": t(o),
844
+ onChange: t(N)
845
+ }, null, 8, ["model-value", "class", "step", "disabled", "controls", "min", "max", "debounce", "size", "onUpdate:modelValue", "onChange"])) : W("v-if", !0)
846
+ ], 42, ol);
847
+ };
848
+ }
849
+ });
850
+ var ul = /* @__PURE__ */ Te(rl, [["__file", "slider.vue"]]);
851
+ const dl = ze(ul), cl = ke({
852
+ modelValue: {
853
+ type: [Boolean, String, Number],
854
+ default: !1
855
+ },
856
+ disabled: {
857
+ type: Boolean,
858
+ default: !1
859
+ },
860
+ loading: {
861
+ type: Boolean,
862
+ default: !1
863
+ },
864
+ size: {
865
+ type: String,
866
+ validator: Nt
867
+ },
868
+ width: {
869
+ type: [String, Number],
870
+ default: ""
871
+ },
872
+ inlinePrompt: {
873
+ type: Boolean,
874
+ default: !1
875
+ },
876
+ inactiveActionIcon: {
877
+ type: Ie
878
+ },
879
+ activeActionIcon: {
880
+ type: Ie
881
+ },
882
+ activeIcon: {
883
+ type: Ie
884
+ },
885
+ inactiveIcon: {
886
+ type: Ie
887
+ },
888
+ activeText: {
889
+ type: String,
890
+ default: ""
891
+ },
892
+ inactiveText: {
893
+ type: String,
894
+ default: ""
895
+ },
896
+ activeValue: {
897
+ type: [Boolean, String, Number],
898
+ default: !0
899
+ },
900
+ inactiveValue: {
901
+ type: [Boolean, String, Number],
902
+ default: !1
903
+ },
904
+ name: {
905
+ type: String,
906
+ default: ""
907
+ },
908
+ validateEvent: {
909
+ type: Boolean,
910
+ default: !0
911
+ },
912
+ beforeChange: {
913
+ type: me(Function)
914
+ },
915
+ id: String,
916
+ tabindex: {
917
+ type: [String, Number]
918
+ },
919
+ label: {
920
+ type: String,
921
+ default: void 0
922
+ },
923
+ ...xe(["ariaLabel"])
924
+ }), ml = {
925
+ [Q]: (e) => Ce(e) || fe(e) || G(e),
926
+ [ce]: (e) => Ce(e) || fe(e) || G(e),
927
+ [ne]: (e) => Ce(e) || fe(e) || G(e)
928
+ }, vl = ["onClick"], fl = ["id", "aria-checked", "aria-disabled", "aria-label", "name", "true-value", "false-value", "disabled", "tabindex", "onKeydown"], bl = ["aria-hidden"], gl = ["aria-hidden"], hl = ["aria-hidden"], $e = "ElSwitch", pl = ae({
929
+ name: $e
930
+ }), yl = /* @__PURE__ */ ae({
931
+ ...pl,
932
+ props: cl,
933
+ emits: ml,
934
+ setup(e, { expose: n, emit: s }) {
935
+ const l = e, { formItem: m } = Re(), d = Oe(), r = Ne("switch"), { inputId: u } = De(l, {
936
+ formItemContext: m
937
+ }), p = Ze(y(() => l.loading)), b = z(l.modelValue !== !1), w = z(), c = z(), L = y(() => [
938
+ r.b(),
939
+ r.m(d.value),
940
+ r.is("disabled", p.value),
941
+ r.is("checked", N.value)
942
+ ]), K = y(() => [
943
+ r.e("label"),
944
+ r.em("label", "left"),
945
+ r.is("active", !N.value)
946
+ ]), F = y(() => [
947
+ r.e("label"),
948
+ r.em("label", "right"),
949
+ r.is("active", N.value)
950
+ ]), Y = y(() => ({
951
+ width: ut(l.width)
952
+ }));
953
+ de(() => l.modelValue, () => {
954
+ b.value = !0;
955
+ });
956
+ const U = y(() => b.value ? l.modelValue : !1), N = y(() => U.value === l.activeValue);
957
+ [l.activeValue, l.inactiveValue].includes(U.value) || (s(Q, l.inactiveValue), s(ce, l.inactiveValue), s(ne, l.inactiveValue)), de(N, (o) => {
958
+ var g;
959
+ w.value.checked = o, l.validateEvent && ((g = m == null ? void 0 : m.validate) == null || g.call(m, "change").catch((J) => ue(J)));
960
+ });
961
+ const T = () => {
962
+ const o = N.value ? l.inactiveValue : l.activeValue;
963
+ s(Q, o), s(ce, o), s(ne, o), Se(() => {
964
+ w.value.checked = N.value;
965
+ });
966
+ }, R = () => {
967
+ if (p.value)
968
+ return;
969
+ const { beforeChange: o } = l;
970
+ if (!o) {
971
+ T();
972
+ return;
973
+ }
974
+ const g = o();
975
+ [
976
+ je(g),
977
+ Ce(g)
978
+ ].includes(!0) || Fe($e, "beforeChange must return type `Promise<boolean>` or `boolean`"), je(g) ? g.then((B) => {
979
+ B && T();
980
+ }).catch((B) => {
981
+ ue($e, `some error occurred: ${B}`);
982
+ }) : g && T();
983
+ }, $ = () => {
984
+ var o, g;
985
+ (g = (o = w.value) == null ? void 0 : o.focus) == null || g.call(o);
986
+ };
987
+ return Ue(() => {
988
+ w.value.checked = N.value;
989
+ }), Ye({
990
+ from: "label",
991
+ replacement: "aria-label",
992
+ version: "2.8.0",
993
+ scope: "el-switch",
994
+ ref: "https://element-plus.org/en-US/component/switch.html"
995
+ }, y(() => !!l.label)), n({
996
+ focus: $,
997
+ checked: N
998
+ }), (o, g) => (f(), P("div", {
999
+ class: A(t(L)),
1000
+ onClick: Be(R, ["prevent"])
1001
+ }, [
1002
+ _("input", {
1003
+ id: t(u),
1004
+ ref_key: "input",
1005
+ ref: w,
1006
+ class: A(t(r).e("input")),
1007
+ type: "checkbox",
1008
+ role: "switch",
1009
+ "aria-checked": t(N),
1010
+ "aria-disabled": t(p),
1011
+ "aria-label": o.label || o.ariaLabel,
1012
+ name: o.name,
1013
+ "true-value": o.activeValue,
1014
+ "false-value": o.inactiveValue,
1015
+ disabled: t(p),
1016
+ tabindex: o.tabindex,
1017
+ onChange: T,
1018
+ onKeydown: pe(R, ["enter"])
1019
+ }, null, 42, fl),
1020
+ !o.inlinePrompt && (o.inactiveIcon || o.inactiveText) ? (f(), P("span", {
1021
+ key: 0,
1022
+ class: A(t(K))
1023
+ }, [
1024
+ o.inactiveIcon ? (f(), X(t(re), { key: 0 }, {
1025
+ default: Z(() => [
1026
+ (f(), X(he(o.inactiveIcon)))
1027
+ ]),
1028
+ _: 1
1029
+ })) : W("v-if", !0),
1030
+ !o.inactiveIcon && o.inactiveText ? (f(), P("span", {
1031
+ key: 1,
1032
+ "aria-hidden": t(N)
1033
+ }, Ve(o.inactiveText), 9, bl)) : W("v-if", !0)
1034
+ ], 2)) : W("v-if", !0),
1035
+ _("span", {
1036
+ ref_key: "core",
1037
+ ref: c,
1038
+ class: A(t(r).e("core")),
1039
+ style: ie(t(Y))
1040
+ }, [
1041
+ o.inlinePrompt ? (f(), P("div", {
1042
+ key: 0,
1043
+ class: A(t(r).e("inner"))
1044
+ }, [
1045
+ o.activeIcon || o.inactiveIcon ? (f(), X(t(re), {
1046
+ key: 0,
1047
+ class: A(t(r).is("icon"))
1048
+ }, {
1049
+ default: Z(() => [
1050
+ (f(), X(he(t(N) ? o.activeIcon : o.inactiveIcon)))
1051
+ ]),
1052
+ _: 1
1053
+ }, 8, ["class"])) : o.activeText || o.inactiveText ? (f(), P("span", {
1054
+ key: 1,
1055
+ class: A(t(r).is("text")),
1056
+ "aria-hidden": !t(N)
1057
+ }, Ve(t(N) ? o.activeText : o.inactiveText), 11, gl)) : W("v-if", !0)
1058
+ ], 2)) : W("v-if", !0),
1059
+ _("div", {
1060
+ class: A(t(r).e("action"))
1061
+ }, [
1062
+ o.loading ? (f(), X(t(re), {
1063
+ key: 0,
1064
+ class: A(t(r).is("loading"))
1065
+ }, {
1066
+ default: Z(() => [
1067
+ j(t(St))
1068
+ ]),
1069
+ _: 1
1070
+ }, 8, ["class"])) : t(N) ? _e(o.$slots, "active-action", { key: 1 }, () => [
1071
+ o.activeActionIcon ? (f(), X(t(re), { key: 0 }, {
1072
+ default: Z(() => [
1073
+ (f(), X(he(o.activeActionIcon)))
1074
+ ]),
1075
+ _: 1
1076
+ })) : W("v-if", !0)
1077
+ ]) : t(N) ? W("v-if", !0) : _e(o.$slots, "inactive-action", { key: 2 }, () => [
1078
+ o.inactiveActionIcon ? (f(), X(t(re), { key: 0 }, {
1079
+ default: Z(() => [
1080
+ (f(), X(he(o.inactiveActionIcon)))
1081
+ ]),
1082
+ _: 1
1083
+ })) : W("v-if", !0)
1084
+ ])
1085
+ ], 2)
1086
+ ], 6),
1087
+ !o.inlinePrompt && (o.activeIcon || o.activeText) ? (f(), P("span", {
1088
+ key: 1,
1089
+ class: A(t(F))
1090
+ }, [
1091
+ o.activeIcon ? (f(), X(t(re), { key: 0 }, {
1092
+ default: Z(() => [
1093
+ (f(), X(he(o.activeIcon)))
1094
+ ]),
1095
+ _: 1
1096
+ })) : W("v-if", !0),
1097
+ !o.activeIcon && o.activeText ? (f(), P("span", {
1098
+ key: 1,
1099
+ "aria-hidden": !t(N)
1100
+ }, Ve(o.activeText), 9, hl)) : W("v-if", !0)
1101
+ ], 2)) : W("v-if", !0)
1102
+ ], 10, vl));
1103
+ }
1104
+ });
1105
+ var Vl = /* @__PURE__ */ Te(yl, [["__file", "switch.vue"]]);
1106
+ const wl = ze(Vl), Sl = { class: "setting_contaier" }, kl = { class: "setting-top" }, Nl = /* @__PURE__ */ _("span", null, "设置", -1), El = /* @__PURE__ */ _("div", { class: "setting-title" }, "效果", -1), Il = {
1107
+ key: 0,
1108
+ class: "color-list"
1109
+ }, Cl = ["onClick"], Bl = { class: "setting-effect" }, _l = { class: "setting-effect" }, Tl = { class: "light-slider" }, Pl = /* @__PURE__ */ _("div", { class: "setting-title" }, "外观模式", -1), Ll = { class: "setting-effect" }, Ml = /* @__PURE__ */ _("div", { class: "setting-title" }, "模型视角切换", -1), Al = { class: "setting-effect" }, $l = { class: "setting-effect" }, xl = { class: "setting-effect" }, Fl = { class: "setting-effect" }, ql = /* @__PURE__ */ ae({
1110
+ __name: "SettingTool",
1111
+ emits: ["closePanel"],
1112
+ setup(e, { emit: n }) {
1113
+ let s = window.BimViewer;
1114
+ const l = z(!1), m = z(!0), d = z(!1), r = z(!0), u = z(!1), p = z(!1), b = z(), w = z(50), c = z(["亮"]), L = z(["亮", "暗"]), K = z("#linear-gradient(180deg, #fffefb 0%, #daebff 100%)"), F = n;
1115
+ Pe.on("BimViewer", () => {
1116
+ s = window.BimViewer, R(!1);
1117
+ });
1118
+ const Y = () => {
1119
+ F("closePanel"), Pe.emit("unhighlight");
1120
+ }, U = () => {
1121
+ p.value = !p.value;
1122
+ }, N = (B) => {
1123
+ b.value = B.id, console.log("data.rgb", B.rgb), K.value = B.color, Pe.emit("changeBackgroundColor", B.color);
1124
+ }, T = (B) => {
1125
+ s.setLightIntensity(B);
1126
+ }, R = (B) => {
1127
+ s.setEdgesEnabled(B);
1128
+ }, $ = () => {
1129
+ s.SetThreeDModeActive(void 0, () => {
1130
+ console.log(s.threeDMode);
1131
+ });
1132
+ }, o = () => {
1133
+ s.SetOrthoModeActive(void 0, () => {
1134
+ console.log(s.orthoMode);
1135
+ });
1136
+ }, g = () => {
1137
+ s.SetShowSpaceModeActive();
1138
+ }, J = (B) => {
1139
+ B == "亮" ? window.BimViewer.setSpaceMaterialColor(1) : window.BimViewer.setSpaceMaterialColor(2), c.value = c.value.includes(B) ? [B] : [];
1140
+ };
1141
+ return (B, I) => {
1142
+ const D = dt, V = wl, M = dl, O = it, ee = st, a = kt;
1143
+ return f(), P("div", Sl, [
1144
+ _("div", kl, [
1145
+ Nl,
1146
+ j(D, {
1147
+ class: "close",
1148
+ width: 18,
1149
+ "click-handle": Y,
1150
+ light: ""
1151
+ })
1152
+ ]),
1153
+ j(a, { height: "360px" }, {
1154
+ default: Z(() => [
1155
+ El,
1156
+ _("div", {
1157
+ class: "setting-effect",
1158
+ onClick: U
1159
+ }, [
1160
+ oe(" 背景颜色 "),
1161
+ _("div", {
1162
+ class: "choose-color",
1163
+ style: ie({ background: K.value })
1164
+ }, null, 4)
1165
+ ]),
1166
+ p.value ? (f(), P("div", Il, [
1167
+ (f(!0), P(ve, null, we(t(gt), (i) => (f(), P("div", {
1168
+ class: A(["color-item", { "color-item-active": b.value === i.id }]),
1169
+ key: i.id,
1170
+ onClick: (h) => N(i)
1171
+ }, [
1172
+ _("div", {
1173
+ class: "bg",
1174
+ style: ie({ background: i.color, border: i.id === 4 ? "1px solid #F1F1F1" : "none" })
1175
+ }, null, 4),
1176
+ oe(" " + Ve(i.name), 1)
1177
+ ], 10, Cl))), 128))
1178
+ ])) : W("", !0),
1179
+ _("div", Bl, [
1180
+ oe(" 显示边缘 "),
1181
+ j(V, {
1182
+ modelValue: l.value,
1183
+ "onUpdate:modelValue": I[0] || (I[0] = (i) => l.value = i),
1184
+ style: { "--el-switch-on-color": "#0065fc" },
1185
+ onChange: I[1] || (I[1] = (i) => R())
1186
+ }, null, 8, ["modelValue"])
1187
+ ]),
1188
+ _("div", _l, [
1189
+ oe(" 光源强度 "),
1190
+ _("div", Tl, [
1191
+ j(M, {
1192
+ modelValue: w.value,
1193
+ "onUpdate:modelValue": I[2] || (I[2] = (i) => w.value = i),
1194
+ onInput: I[3] || (I[3] = (i) => T(w.value))
1195
+ }, null, 8, ["modelValue"])
1196
+ ])
1197
+ ]),
1198
+ Pl,
1199
+ _("div", Ll, [
1200
+ oe(" 日间/夜间模式 "),
1201
+ j(V, {
1202
+ modelValue: m.value,
1203
+ "onUpdate:modelValue": I[4] || (I[4] = (i) => m.value = i),
1204
+ style: { "--el-switch-on-color": "#0065fc" }
1205
+ }, null, 8, ["modelValue"])
1206
+ ]),
1207
+ Ml,
1208
+ _("div", Al, [
1209
+ oe(" 透视/正交 "),
1210
+ j(V, {
1211
+ modelValue: d.value,
1212
+ "onUpdate:modelValue": I[5] || (I[5] = (i) => d.value = i),
1213
+ style: { "--el-switch-on-color": "#0065fc" },
1214
+ onChange: o
1215
+ }, null, 8, ["modelValue"])
1216
+ ]),
1217
+ _("div", $l, [
1218
+ oe(" 2D/3D "),
1219
+ j(V, {
1220
+ modelValue: r.value,
1221
+ "onUpdate:modelValue": I[6] || (I[6] = (i) => r.value = i),
1222
+ style: { "--el-switch-on-color": "#0065fc" },
1223
+ onChange: $
1224
+ }, null, 8, ["modelValue"])
1225
+ ]),
1226
+ _("div", xl, [
1227
+ oe(" 显示模型空间 "),
1228
+ j(V, {
1229
+ modelValue: u.value,
1230
+ "onUpdate:modelValue": I[7] || (I[7] = (i) => u.value = i),
1231
+ style: { "--el-switch-on-color": "#0065fc" },
1232
+ onChange: g
1233
+ }, null, 8, ["modelValue"])
1234
+ ]),
1235
+ _("div", Fl, [
1236
+ oe(" 空间效果 "),
1237
+ j(ee, {
1238
+ modelValue: c.value,
1239
+ "onUpdate:modelValue": I[8] || (I[8] = (i) => c.value = i),
1240
+ size: "small"
1241
+ }, {
1242
+ default: Z(() => [
1243
+ (f(!0), P(ve, null, we(L.value, (i) => (f(), X(O, {
1244
+ label: i,
1245
+ key: i,
1246
+ onChange: (h) => J(i)
1247
+ }, null, 8, ["label", "onChange"]))), 128))
1248
+ ]),
1249
+ _: 1
1250
+ }, 8, ["modelValue"])
1251
+ ])
1252
+ ]),
1253
+ _: 1
1254
+ })
1255
+ ]);
1256
+ };
1257
+ }
1258
+ });
1259
+ export {
1260
+ ql as default
1261
+ };