leiting-bim 2.1.126 → 2.1.128

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.
@@ -0,0 +1,404 @@
1
+ import { onMounted as L, nextTick as U, isRef as _, toRefs as N, customRef as q, toValue as h, getCurrentScope as J, onScopeDispose as K, getCurrentInstance as V, watch as H, shallowRef as b, shallowReadonly as Q, computed as C, ref as I, unref as Z } from "vue";
2
+ function P(e) {
3
+ return J() ? (K(e), !0) : !1;
4
+ }
5
+ const k = typeof window < "u" && typeof document < "u";
6
+ typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
7
+ const j = (e) => e != null, ee = Object.prototype.toString, te = (e) => ee.call(e) === "[object Object]";
8
+ function z(e) {
9
+ return Array.isArray(e) ? e : [e];
10
+ }
11
+ function ne(e) {
12
+ return V();
13
+ }
14
+ function oe(e, n = {}) {
15
+ if (!_(e))
16
+ return N(e);
17
+ const i = Array.isArray(e.value) ? Array.from({ length: e.value.length }) : {};
18
+ for (const p in e.value)
19
+ i[p] = q(() => ({
20
+ get() {
21
+ return e.value[p];
22
+ },
23
+ set(v) {
24
+ var s;
25
+ if ((s = h(n.replaceRef)) != null ? s : !0)
26
+ if (Array.isArray(e.value)) {
27
+ const o = [...e.value];
28
+ o[p] = v, e.value = o;
29
+ } else {
30
+ const o = { ...e.value, [p]: v };
31
+ Object.setPrototypeOf(o, Object.getPrototypeOf(e.value)), e.value = o;
32
+ }
33
+ else
34
+ e.value[p] = v;
35
+ }
36
+ }));
37
+ return i;
38
+ }
39
+ function $(e, n = !0, i) {
40
+ ne() ? L(e, i) : n ? e() : U(e);
41
+ }
42
+ function ae(e, n = 1e3, i = {}) {
43
+ const {
44
+ immediate: p = !0,
45
+ immediateCallback: v = !1
46
+ } = i;
47
+ let s = null;
48
+ const r = b(!1);
49
+ function o() {
50
+ s && (clearInterval(s), s = null);
51
+ }
52
+ function u() {
53
+ r.value = !1, o();
54
+ }
55
+ function c() {
56
+ const f = h(n);
57
+ f <= 0 || (r.value = !0, v && e(), o(), r.value && (s = setInterval(e, f)));
58
+ }
59
+ if (p && k && c(), _(n) || typeof n == "function") {
60
+ const f = H(n, () => {
61
+ r.value && k && c();
62
+ });
63
+ P(f);
64
+ }
65
+ return P(u), {
66
+ isActive: Q(r),
67
+ pause: u,
68
+ resume: c
69
+ };
70
+ }
71
+ function se(e, n, i) {
72
+ return H(
73
+ e,
74
+ n,
75
+ {
76
+ ...i,
77
+ immediate: !0
78
+ }
79
+ );
80
+ }
81
+ const B = k ? window : void 0;
82
+ function Y(e) {
83
+ var n;
84
+ const i = h(e);
85
+ return (n = i?.$el) != null ? n : i;
86
+ }
87
+ function X(...e) {
88
+ const n = [], i = () => {
89
+ n.forEach((o) => o()), n.length = 0;
90
+ }, p = (o, u, c, f) => (o.addEventListener(u, c, f), () => o.removeEventListener(u, c, f)), v = C(() => {
91
+ const o = z(h(e[0])).filter((u) => u != null);
92
+ return o.every((u) => typeof u != "string") ? o : void 0;
93
+ }), s = se(
94
+ () => {
95
+ var o, u;
96
+ return [
97
+ (u = (o = v.value) == null ? void 0 : o.map((c) => Y(c))) != null ? u : [B].filter((c) => c != null),
98
+ z(h(v.value ? e[1] : e[0])),
99
+ z(Z(v.value ? e[2] : e[1])),
100
+ // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
101
+ h(v.value ? e[3] : e[2])
102
+ ];
103
+ },
104
+ ([o, u, c, f]) => {
105
+ if (i(), !o?.length || !u?.length || !c?.length)
106
+ return;
107
+ const l = te(f) ? { ...f } : f;
108
+ n.push(
109
+ ...o.flatMap(
110
+ (a) => u.flatMap(
111
+ (d) => c.map((g) => p(a, d, g, l))
112
+ )
113
+ )
114
+ );
115
+ },
116
+ { flush: "post" }
117
+ ), r = () => {
118
+ s(), i();
119
+ };
120
+ return P(i), r;
121
+ }
122
+ // @__NO_SIDE_EFFECTS__
123
+ function le() {
124
+ const e = b(!1), n = V();
125
+ return n && L(() => {
126
+ e.value = !0;
127
+ }, n), e;
128
+ }
129
+ // @__NO_SIDE_EFFECTS__
130
+ function F(e) {
131
+ const n = /* @__PURE__ */ le();
132
+ return C(() => (n.value, !!e()));
133
+ }
134
+ function ue(e, n, i = {}) {
135
+ const { window: p = B, ...v } = i;
136
+ let s;
137
+ const r = /* @__PURE__ */ F(() => p && "MutationObserver" in p), o = () => {
138
+ s && (s.disconnect(), s = void 0);
139
+ }, u = C(() => {
140
+ const a = h(e), d = z(a).map(Y).filter(j);
141
+ return new Set(d);
142
+ }), c = H(
143
+ u,
144
+ (a) => {
145
+ o(), r.value && a.size && (s = new MutationObserver(n), a.forEach((d) => s.observe(d, v)));
146
+ },
147
+ { immediate: !0, flush: "post" }
148
+ ), f = () => s?.takeRecords(), l = () => {
149
+ c(), o();
150
+ };
151
+ return P(l), {
152
+ isSupported: r,
153
+ stop: l,
154
+ takeRecords: f
155
+ };
156
+ }
157
+ function fe(e, n = {}) {
158
+ var i;
159
+ const {
160
+ pointerTypes: p,
161
+ preventDefault: v,
162
+ stopPropagation: s,
163
+ exact: r,
164
+ onMove: o,
165
+ onEnd: u,
166
+ onStart: c,
167
+ initialValue: f,
168
+ axis: l = "both",
169
+ draggingElement: a = B,
170
+ containerElement: d,
171
+ handle: g = e,
172
+ buttons: E = [0]
173
+ } = n, x = I(
174
+ (i = h(f)) != null ? i : { x: 0, y: 0 }
175
+ ), y = I(), O = (t) => p ? p.includes(t.pointerType) : !0, R = (t) => {
176
+ h(v) && t.preventDefault(), h(s) && t.stopPropagation();
177
+ }, T = (t) => {
178
+ var m;
179
+ if (!h(E).includes(t.button) || h(n.disabled) || !O(t) || h(r) && t.target !== h(e))
180
+ return;
181
+ const w = h(d), W = (m = w?.getBoundingClientRect) == null ? void 0 : m.call(w), M = h(e).getBoundingClientRect(), D = {
182
+ x: t.clientX - (w ? M.left - W.left + w.scrollLeft : M.left),
183
+ y: t.clientY - (w ? M.top - W.top + w.scrollTop : M.top)
184
+ };
185
+ c?.(D, t) !== !1 && (y.value = D, R(t));
186
+ }, S = (t) => {
187
+ if (h(n.disabled) || !O(t) || !y.value)
188
+ return;
189
+ const m = h(d), w = h(e).getBoundingClientRect();
190
+ let { x: W, y: M } = x.value;
191
+ (l === "x" || l === "both") && (W = t.clientX - y.value.x, m && (W = Math.min(Math.max(0, W), m.scrollWidth - w.width))), (l === "y" || l === "both") && (M = t.clientY - y.value.y, m && (M = Math.min(Math.max(0, M), m.scrollHeight - w.height))), x.value = {
192
+ x: W,
193
+ y: M
194
+ }, o?.(x.value, t), R(t);
195
+ }, A = (t) => {
196
+ h(n.disabled) || !O(t) || y.value && (y.value = void 0, u?.(x.value, t), R(t));
197
+ };
198
+ if (k) {
199
+ const t = () => {
200
+ var m;
201
+ return {
202
+ capture: (m = n.capture) != null ? m : !0,
203
+ passive: !h(v)
204
+ };
205
+ };
206
+ X(g, "pointerdown", T, t), X(a, "pointermove", S, t), X(a, "pointerup", A, t);
207
+ }
208
+ return {
209
+ ...oe(x),
210
+ position: x,
211
+ isDragging: C(() => !!y.value),
212
+ style: C(
213
+ () => `left:${x.value.x}px;top:${x.value.y}px;`
214
+ )
215
+ };
216
+ }
217
+ function G(e, n, i = {}) {
218
+ const { window: p = B, ...v } = i;
219
+ let s;
220
+ const r = /* @__PURE__ */ F(() => p && "ResizeObserver" in p), o = () => {
221
+ s && (s.disconnect(), s = void 0);
222
+ }, u = C(() => {
223
+ const l = h(e);
224
+ return Array.isArray(l) ? l.map((a) => Y(a)) : [Y(l)];
225
+ }), c = H(
226
+ u,
227
+ (l) => {
228
+ if (o(), r.value && p) {
229
+ s = new ResizeObserver(n);
230
+ for (const a of l)
231
+ a && s.observe(a, v);
232
+ }
233
+ },
234
+ { immediate: !0, flush: "post" }
235
+ ), f = () => {
236
+ o(), c();
237
+ };
238
+ return P(f), {
239
+ isSupported: r,
240
+ stop: f
241
+ };
242
+ }
243
+ function ve(e, n = { width: 0, height: 0 }, i = {}) {
244
+ const { window: p = B, box: v = "content-box" } = i, s = C(() => {
245
+ var l, a;
246
+ return (a = (l = Y(e)) == null ? void 0 : l.namespaceURI) == null ? void 0 : a.includes("svg");
247
+ }), r = b(n.width), o = b(n.height), { stop: u } = G(
248
+ e,
249
+ ([l]) => {
250
+ const a = v === "border-box" ? l.borderBoxSize : v === "content-box" ? l.contentBoxSize : l.devicePixelContentBoxSize;
251
+ if (p && s.value) {
252
+ const d = Y(e);
253
+ if (d) {
254
+ const g = d.getBoundingClientRect();
255
+ r.value = g.width, o.value = g.height;
256
+ }
257
+ } else if (a) {
258
+ const d = z(a);
259
+ r.value = d.reduce((g, { inlineSize: E }) => g + E, 0), o.value = d.reduce((g, { blockSize: E }) => g + E, 0);
260
+ } else
261
+ r.value = l.contentRect.width, o.value = l.contentRect.height;
262
+ },
263
+ i
264
+ );
265
+ $(() => {
266
+ const l = Y(e);
267
+ l && (r.value = "offsetWidth" in l ? l.offsetWidth : n.width, o.value = "offsetHeight" in l ? l.offsetHeight : n.height);
268
+ });
269
+ const c = H(
270
+ () => Y(e),
271
+ (l) => {
272
+ r.value = l ? n.width : 0, o.value = l ? n.height : 0;
273
+ }
274
+ );
275
+ function f() {
276
+ u(), c();
277
+ }
278
+ return {
279
+ width: r,
280
+ height: o,
281
+ stop: f
282
+ };
283
+ }
284
+ const re = {
285
+ page: (e) => [e.pageX, e.pageY],
286
+ client: (e) => [e.clientX, e.clientY],
287
+ screen: (e) => [e.screenX, e.screenY],
288
+ movement: (e) => e instanceof MouseEvent ? [e.movementX, e.movementY] : null
289
+ };
290
+ function ie(e = {}) {
291
+ const {
292
+ type: n = "page",
293
+ touch: i = !0,
294
+ resetOnTouchEnds: p = !1,
295
+ initialValue: v = { x: 0, y: 0 },
296
+ window: s = B,
297
+ target: r = s,
298
+ scroll: o = !0,
299
+ eventFilter: u
300
+ } = e;
301
+ let c = null, f = 0, l = 0;
302
+ const a = b(v.x), d = b(v.y), g = b(null), E = typeof n == "function" ? n : re[n], x = (t) => {
303
+ const m = E(t);
304
+ c = t, m && ([a.value, d.value] = m, g.value = "mouse"), s && (f = s.scrollX, l = s.scrollY);
305
+ }, y = (t) => {
306
+ if (t.touches.length > 0) {
307
+ const m = E(t.touches[0]);
308
+ m && ([a.value, d.value] = m, g.value = "touch");
309
+ }
310
+ }, O = () => {
311
+ if (!c || !s)
312
+ return;
313
+ const t = E(c);
314
+ c instanceof MouseEvent && t && (a.value = t[0] + s.scrollX - f, d.value = t[1] + s.scrollY - l);
315
+ }, R = () => {
316
+ a.value = v.x, d.value = v.y;
317
+ }, T = u ? (t) => u(() => x(t), {}) : (t) => x(t), S = u ? (t) => u(() => y(t), {}) : (t) => y(t), A = u ? () => u(() => O(), {}) : () => O();
318
+ if (r) {
319
+ const t = { passive: !0 };
320
+ X(r, ["mousemove", "dragover"], T, t), i && n !== "movement" && (X(r, ["touchstart", "touchmove"], S, t), p && X(r, "touchend", R, t)), o && n === "page" && X(s, "scroll", A, t);
321
+ }
322
+ return {
323
+ x: a,
324
+ y: d,
325
+ sourceType: g
326
+ };
327
+ }
328
+ function pe(e, n = {}) {
329
+ const {
330
+ windowResize: i = !0,
331
+ windowScroll: p = !0,
332
+ handleOutside: v = !0,
333
+ window: s = B
334
+ } = n, r = n.type || "page", { x: o, y: u, sourceType: c } = ie(n), f = b(e ?? s?.document.body), l = b(0), a = b(0), d = b(0), g = b(0), E = b(0), x = b(0), y = b(!0);
335
+ function O() {
336
+ if (!s)
337
+ return;
338
+ const S = Y(f);
339
+ if (!S || !(S instanceof Element))
340
+ return;
341
+ const {
342
+ left: A,
343
+ top: t,
344
+ width: m,
345
+ height: w
346
+ } = S.getBoundingClientRect();
347
+ d.value = A + (r === "page" ? s.pageXOffset : 0), g.value = t + (r === "page" ? s.pageYOffset : 0), E.value = w, x.value = m;
348
+ const W = o.value - d.value, M = u.value - g.value;
349
+ y.value = m === 0 || w === 0 || W < 0 || M < 0 || W > m || M > w, (v || !y.value) && (l.value = W, a.value = M);
350
+ }
351
+ const R = [];
352
+ function T() {
353
+ R.forEach((S) => S()), R.length = 0;
354
+ }
355
+ if ($(() => {
356
+ O();
357
+ }), s) {
358
+ const {
359
+ stop: S
360
+ } = G(f, O), {
361
+ stop: A
362
+ } = ue(f, O, {
363
+ attributeFilter: ["style", "class"]
364
+ }), t = H(
365
+ [f, o, u],
366
+ O
367
+ );
368
+ R.push(
369
+ S,
370
+ A,
371
+ t
372
+ ), X(
373
+ document,
374
+ "mouseleave",
375
+ () => y.value = !0,
376
+ { passive: !0 }
377
+ ), p && R.push(
378
+ X("scroll", O, { capture: !0, passive: !0 })
379
+ ), i && R.push(
380
+ X("resize", O, { passive: !0 })
381
+ );
382
+ }
383
+ return {
384
+ x: o,
385
+ y: u,
386
+ sourceType: c,
387
+ elementX: l,
388
+ elementY: a,
389
+ elementPositionX: d,
390
+ elementPositionY: g,
391
+ elementHeight: E,
392
+ elementWidth: x,
393
+ isOutside: y,
394
+ stop: T
395
+ };
396
+ }
397
+ export {
398
+ ae as a,
399
+ ve as b,
400
+ pe as c,
401
+ fe as d,
402
+ G as u
403
+ };
404
+ //# sourceMappingURL=index-Kqi_S6KA.js.map