@falcon-ui/falcon-ui 1.0.0 → 1.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 (51) hide show
  1. package/README.md +1 -0
  2. package/THIRD_PARTY_NOTICES.md +51 -0
  3. package/cjs/components/index.cjs +1131 -4
  4. package/cjs/components/index.cjs.map +1 -1
  5. package/cjs/components/loading/index.cjs +1186 -0
  6. package/cjs/components/loading/index.cjs.map +1 -0
  7. package/cjs/components/loading/src/loading.cjs +72 -0
  8. package/cjs/components/loading/src/loading.cjs.map +1 -0
  9. package/cjs/index.cjs +1132 -4
  10. package/cjs/index.cjs.map +1 -1
  11. package/esm/components/index.mjs +1130 -6
  12. package/esm/components/index.mjs.map +1 -1
  13. package/esm/components/loading/index.mjs +1179 -0
  14. package/esm/components/loading/index.mjs.map +1 -0
  15. package/esm/components/loading/src/loading.mjs +66 -0
  16. package/esm/components/loading/src/loading.mjs.map +1 -0
  17. package/esm/index.mjs +1131 -6
  18. package/esm/index.mjs.map +1 -1
  19. package/global.d.ts +2 -0
  20. package/package.json +7 -1
  21. package/theme/index.css +1 -1
  22. package/theme/index.scss +1 -0
  23. package/theme/src/loading.scss +52 -0
  24. package/types/components/barcode/index.d.ts +1 -1
  25. package/types/components/barcode/src/barcode.vue.d.ts +1 -1
  26. package/types/components/index.d.ts +2 -0
  27. package/types/components/input/index.d.ts +1 -1
  28. package/types/components/input/src/input.vue.d.ts +1 -1
  29. package/types/components/input-number/index.d.ts +3 -3
  30. package/types/components/input-number/src/input-number.vue.d.ts +1 -1
  31. package/types/components/loading/index.d.ts +183 -0
  32. package/types/components/loading/src/FlLoading.vue.d.ts +109 -0
  33. package/types/components/loading/src/animations/composing.d.ts +2 -0
  34. package/types/components/loading/src/animations/earth.d.ts +12 -0
  35. package/types/components/loading/src/animations/listening.d.ts +2 -0
  36. package/types/components/loading/src/animations/searching.d.ts +2 -0
  37. package/types/components/loading/src/animations/shaping.d.ts +2 -0
  38. package/types/components/loading/src/animations/solving.d.ts +2 -0
  39. package/types/components/loading/src/animations/working.d.ts +2 -0
  40. package/types/components/loading/src/earth-points.d.ts +22 -0
  41. package/types/components/loading/src/loading-frame.d.ts +4 -0
  42. package/types/components/loading/src/loading-geometry.d.ts +66 -0
  43. package/types/components/loading/src/loading-presets.d.ts +6 -0
  44. package/types/components/loading/src/loading-profiles.d.ts +7 -0
  45. package/types/components/loading/src/loading-renderer.d.ts +4 -0
  46. package/types/components/loading/src/loading.d.ts +65 -0
  47. package/types/components/loading/src/use-fl-loading.d.ts +15 -0
  48. package/types/components/loading/src/use-loading-animation.d.ts +13 -0
  49. package/types/components/loading/src/use-loading-color.d.ts +6 -0
  50. package/umd/falcon-ui.umd.js +1137 -7
  51. package/umd/falcon-ui.umd.js.map +1 -1
package/cjs/index.cjs CHANGED
@@ -7,6 +7,1131 @@ const require_dialog = require("./dialog-CJU00aEV.cjs");
7
7
  let vue = require("vue");
8
8
  let element_plus = require("element-plus");
9
9
  let __element_plus_icons_vue = require("@element-plus/icons-vue");
10
+ const flLoadingAnimations = [
11
+ "working",
12
+ "searching",
13
+ "solving",
14
+ "listening",
15
+ "composing",
16
+ "shaping",
17
+ "earth"
18
+ ];
19
+ const flLoadingSizes = [
20
+ 20,
21
+ 32,
22
+ 48,
23
+ 64,
24
+ 96
25
+ ];
26
+ const flLoadingProps = {
27
+ active: {
28
+ type: Boolean,
29
+ default: true
30
+ },
31
+ animation: {
32
+ type: String,
33
+ default: "searching",
34
+ validator: (v) => flLoadingAnimations.includes(v)
35
+ },
36
+ size: {
37
+ type: Number,
38
+ default: 64,
39
+ validator: (v) => flLoadingSizes.includes(v)
40
+ },
41
+ color: {
42
+ type: String,
43
+ default: ""
44
+ },
45
+ theme: {
46
+ type: String,
47
+ default: "auto"
48
+ },
49
+ speed: {
50
+ type: Number,
51
+ default: 1
52
+ },
53
+ paused: {
54
+ type: Boolean,
55
+ default: false
56
+ },
57
+ text: {
58
+ type: String,
59
+ default: ""
60
+ },
61
+ layout: {
62
+ type: String,
63
+ default: "inline"
64
+ },
65
+ ariaLabel: {
66
+ type: String,
67
+ default: "加载中"
68
+ }
69
+ };
70
+ const normalizeAnimation = (v) => flLoadingAnimations.includes(v) ? v : "searching";
71
+ const normalizeSize = (v) => flLoadingSizes.includes(v) ? v : 64;
72
+ const normalizeSpeed = (v) => Number.isFinite(v) ? Math.max(.25, Math.min(3, v)) : 1;
73
+ function useLoadingColor(host, options) {
74
+ const color = (0, vue.ref)("#20252b");
75
+ let mounted = false;
76
+ let observer;
77
+ let media;
78
+ let probe;
79
+ let observedHost;
80
+ const resolve = () => {
81
+ if (!mounted) return;
82
+ const target = host() || document.documentElement;
83
+ if (target !== observedHost) {
84
+ observer?.disconnect();
85
+ probe?.remove();
86
+ probe = document.createElement("span");
87
+ probe.setAttribute("aria-hidden", "true");
88
+ probe.style.cssText = "position:absolute;visibility:hidden;pointer-events:none;width:0;height:0;overflow:hidden";
89
+ target.appendChild(probe);
90
+ for (let el = target; el; el = el.parentElement) observer?.observe(el, {
91
+ attributes: true,
92
+ attributeFilter: [
93
+ "class",
94
+ "style",
95
+ "data-theme"
96
+ ]
97
+ });
98
+ observedHost = target;
99
+ }
100
+ const { color: explicit, theme = "auto" } = options();
101
+ let dark = theme === "dark";
102
+ if (theme === "auto") {
103
+ dark = media?.matches ?? false;
104
+ for (let el = target; el; el = el.parentElement) {
105
+ const marker = el.dataset.theme;
106
+ if (marker === "dark" || marker === "light") {
107
+ dark = marker === "dark";
108
+ break;
109
+ }
110
+ if (el.classList.contains("dark") || el.classList.contains("light")) {
111
+ dark = el.classList.contains("dark");
112
+ break;
113
+ }
114
+ }
115
+ }
116
+ const variable = getComputedStyle(target).getPropertyValue("--fl-loading-color").trim();
117
+ const fallback = dark ? "#f0f3f7" : "#20252b";
118
+ if (probe) {
119
+ probe.style.color = fallback;
120
+ if (explicit || variable) probe.style.color = explicit || variable;
121
+ color.value = getComputedStyle(probe).color || fallback;
122
+ }
123
+ };
124
+ (0, vue.watch)([
125
+ host,
126
+ () => options().color,
127
+ () => options().theme
128
+ ], resolve, { flush: "post" });
129
+ (0, vue.onMounted)(() => {
130
+ mounted = true;
131
+ media = window.matchMedia?.("(prefers-color-scheme: dark)");
132
+ observer = typeof MutationObserver === "undefined" ? void 0 : new MutationObserver(resolve);
133
+ media?.addEventListener("change", resolve);
134
+ resolve();
135
+ });
136
+ (0, vue.onScopeDispose)(() => {
137
+ mounted = false;
138
+ observer?.disconnect();
139
+ media?.removeEventListener("change", resolve);
140
+ probe?.remove();
141
+ });
142
+ return color;
143
+ }
144
+ var COUNT_PAIRS = [
145
+ ["latRings", "lonDensity"],
146
+ ["rings", "lonDensity"],
147
+ ["lanes", "segs"]
148
+ ];
149
+ var COUNT_KEYS = [
150
+ "orbitN",
151
+ "ghostN",
152
+ "nodeN",
153
+ "strandN",
154
+ "signals"
155
+ ];
156
+ var ICON_DENSITY_KEYS = ["iconD"];
157
+ var RADIUS_KEYS = [
158
+ "rBase",
159
+ "rDepth",
160
+ "rActive",
161
+ "rDot",
162
+ "ghostR",
163
+ "partR",
164
+ "partRDepth",
165
+ "nodeR",
166
+ "nodeRDepth"
167
+ ];
168
+ function scaleCounts(opts, scale) {
169
+ const out = { ...opts };
170
+ const done = /* @__PURE__ */ new Set();
171
+ const rt = Math.sqrt(scale);
172
+ for (const [a, b] of COUNT_PAIRS) {
173
+ const va = out[a];
174
+ const vb = out[b];
175
+ if (va != null && vb != null && !done.has(a) && !done.has(b)) {
176
+ out[a] = Math.max(2, Math.round(va * rt));
177
+ out[b] = Math.max(2, Math.round(vb * rt));
178
+ done.add(a);
179
+ done.add(b);
180
+ }
181
+ }
182
+ for (const k of COUNT_KEYS) {
183
+ const v = out[k];
184
+ if (v != null && v !== 0 && !done.has(k)) out[k] = Math.max(1, Math.round(v * scale));
185
+ }
186
+ for (const k of ICON_DENSITY_KEYS) {
187
+ const v = out[k];
188
+ if (v != null) out[k] = Math.max(.02, v * scale);
189
+ }
190
+ return out;
191
+ }
192
+ function scaleRadii(opts, scale) {
193
+ const out = { ...opts };
194
+ for (const k of RADIUS_KEYS) {
195
+ const v = out[k];
196
+ if (v != null) out[k] = v * scale;
197
+ }
198
+ out.rSizeMul = (out.rSizeMul ?? 1) * scale;
199
+ return out;
200
+ }
201
+ const BASE_PROFILES = {
202
+ globe: {
203
+ latRings: 17,
204
+ lonDensity: 44,
205
+ rBase: .6,
206
+ rDepth: 1.7,
207
+ rBoost: 1,
208
+ inkFar: .62,
209
+ inkSpan: .54,
210
+ rsPow: .6,
211
+ rMin: .3
212
+ },
213
+ orbits: {
214
+ orbitN: 12,
215
+ ghostN: 40,
216
+ ghostR: .9,
217
+ ghostA: .5,
218
+ particles: 3,
219
+ partR: 1.2,
220
+ partRDepth: 1.6,
221
+ rsPow: .6,
222
+ rMin: .3
223
+ },
224
+ rubik: {
225
+ latRings: 15,
226
+ lonDensity: 40,
227
+ moveCount: 14,
228
+ rBase: .6,
229
+ rDepth: 1.7,
230
+ rActive: .3,
231
+ inkFar: .62,
232
+ inkSpan: .54,
233
+ rsPow: .6,
234
+ rMin: .3
235
+ },
236
+ wave: {
237
+ rings: 15,
238
+ lonDensity: 40,
239
+ rBase: .6,
240
+ rDepth: 1.7,
241
+ rsPow: .6,
242
+ rMin: .3
243
+ },
244
+ web: {
245
+ nodeN: 30,
246
+ thr: .72,
247
+ signals: 5,
248
+ nodeR: 1.4,
249
+ nodeRDepth: 1.8,
250
+ lineW: .8,
251
+ rsPow: .6,
252
+ rMin: .3
253
+ },
254
+ braid: {
255
+ strandN: 52,
256
+ turns: 3,
257
+ ghostN: 150,
258
+ rBase: 1.2,
259
+ rDepth: 1.8,
260
+ rsPow: .6,
261
+ rMin: .3
262
+ },
263
+ ribbon: {
264
+ lanes: 5,
265
+ segs: 88,
266
+ ghostN: 150,
267
+ rBase: 1.1,
268
+ rDepth: 1.7,
269
+ rsPow: .6,
270
+ rMin: .3
271
+ },
272
+ ring: {
273
+ lanes: 5,
274
+ segs: 88,
275
+ ghostN: 0,
276
+ faceOn: 1,
277
+ rBase: 1.1,
278
+ rDepth: 1.7,
279
+ rsPow: .6,
280
+ rMin: .3
281
+ },
282
+ morph: {
283
+ rDot: .021,
284
+ iconD: 1,
285
+ rMin: .25
286
+ }
287
+ };
288
+ var presets = {
289
+ working: [
290
+ "orbits",
291
+ 1.885,
292
+ 1,
293
+ 1,
294
+ 3.9,
295
+ .238,
296
+ 2.4
297
+ ],
298
+ searching: [
299
+ "globe",
300
+ 2.015,
301
+ .42,
302
+ 1.15,
303
+ 2.665,
304
+ .105,
305
+ 1.75
306
+ ],
307
+ solving: [
308
+ "rubik",
309
+ 1.82,
310
+ .35,
311
+ 1.05,
312
+ 1.95,
313
+ .088,
314
+ 1.9
315
+ ],
316
+ listening: [
317
+ "wave",
318
+ 4.388,
319
+ .341,
320
+ 1,
321
+ 3.998,
322
+ .105,
323
+ 1.6
324
+ ],
325
+ composing: [
326
+ "ribbon",
327
+ 2.34,
328
+ .25,
329
+ .85,
330
+ 3.12,
331
+ .051,
332
+ 1.073
333
+ ],
334
+ shaping: [
335
+ "morph",
336
+ 2.405,
337
+ .702,
338
+ .395,
339
+ 2.08,
340
+ .53,
341
+ 1.011
342
+ ]
343
+ };
344
+ var cache$1 = /* @__PURE__ */ new Map();
345
+ function resolvePreset(animation, size) {
346
+ const key = `${animation}-${size}`;
347
+ const hit = cache$1.get(key);
348
+ if (hit) return hit;
349
+ if (animation === "earth") return {
350
+ speed: 1,
351
+ opts: {}
352
+ };
353
+ const [mode, bigSpeed, bigCount, bigRadius, smallSpeed, smallCount, smallRadius] = presets[animation];
354
+ const blend = Math.max(0, Math.min(1, (size - 20) / 44));
355
+ const count = smallCount + (bigCount - smallCount) * blend;
356
+ const radius = smallRadius + (bigRadius - smallRadius) * blend;
357
+ let opts = scaleRadii(scaleCounts(BASE_PROFILES[mode], count), radius);
358
+ if (animation === "searching") opts = {
359
+ ...opts,
360
+ scanMul: 4.08,
361
+ dimBase: .45
362
+ };
363
+ if (animation === "composing") opts = {
364
+ ...opts,
365
+ spin: 0,
366
+ bandMul: 3.9,
367
+ wobMul: 1
368
+ };
369
+ if (animation === "shaping") opts = {
370
+ ...opts,
371
+ spread: 1.45
372
+ };
373
+ const resolved = {
374
+ speed: smallSpeed + (bigSpeed - smallSpeed) * blend,
375
+ opts
376
+ };
377
+ cache$1.set(key, resolved);
378
+ return resolved;
379
+ }
380
+ function hashD(a, b) {
381
+ const h$6 = Math.sin(a * 12.9898 + b * 78.233) * 43758.5453;
382
+ return h$6 - Math.floor(h$6);
383
+ }
384
+ function fibDir(i, n) {
385
+ const golden = Math.PI * (3 - Math.sqrt(5));
386
+ const y = 1 - 2 * (i + .5) / n;
387
+ const rad = Math.sqrt(1 - y * y);
388
+ const a = i * golden;
389
+ return [
390
+ rad * Math.cos(a),
391
+ y,
392
+ rad * Math.sin(a)
393
+ ];
394
+ }
395
+ function angleDelta(a, b) {
396
+ return Math.atan2(Math.sin(a - b), Math.cos(a - b));
397
+ }
398
+ function makeProj(yaw, tilt, cx, cy, scale) {
399
+ const st = Math.sin(tilt);
400
+ const ct = Math.cos(tilt);
401
+ const sy = Math.sin(yaw);
402
+ const cyw = Math.cos(yaw);
403
+ return (x, y, z) => {
404
+ const x1 = x * cyw + z * sy;
405
+ const z1 = -x * sy + z * cyw;
406
+ const y1 = y * ct - z1 * st;
407
+ const z2 = y * st + z1 * ct;
408
+ return [
409
+ cx + x1 * scale,
410
+ cy - y1 * scale,
411
+ z2
412
+ ];
413
+ };
414
+ }
415
+ function finalizeFrame(dots, lines, rMin = .3) {
416
+ const visible = [];
417
+ for (const d of dots) {
418
+ if ((d.a ?? 1) < .02) continue;
419
+ d.r = Math.max(rMin, d.r);
420
+ visible.push(d);
421
+ }
422
+ visible.sort((a, b) => a.z - b.z);
423
+ return {
424
+ dots: visible,
425
+ lines: lines.filter((l) => (l.a ?? 1) >= .02)
426
+ };
427
+ }
428
+ function radiusScale(size, pow) {
429
+ return (size / 300) ** pow;
430
+ }
431
+ const frameGlobe = (size, t, o) => {
432
+ const spin = .5;
433
+ const cx = size / 2;
434
+ const cy = size / 2;
435
+ const radius = size / 2 * .82;
436
+ const tilt = .4 + .06 * Math.sin(t * .35);
437
+ const pt = makeProj(t * spin, tilt, cx, cy, radius);
438
+ const scan = t * (spin + (1.7 - spin) * (o.scanMul ?? 1));
439
+ const rs = radiusScale(size, o.rsPow ?? .6);
440
+ const dimBase = o.dimBase ?? 1;
441
+ const dots = [];
442
+ const latRings = o.latRings ?? 17;
443
+ const lonDensity = o.lonDensity ?? 44;
444
+ for (let li = 0; li <= latRings; li++) {
445
+ const lat = -Math.PI / 2 + li / latRings * Math.PI;
446
+ const cosLat = Math.cos(lat);
447
+ const sinLat = Math.sin(lat);
448
+ const lonCount = Math.max(1, Math.round(Math.abs(cosLat) * lonDensity));
449
+ for (let lj = 0; lj < lonCount; lj++) {
450
+ const lon = lj / lonCount * 2 * Math.PI;
451
+ const [px, py, z] = pt(cosLat * Math.cos(lon), sinLat, cosLat * Math.sin(lon));
452
+ const depth = (z + 1) / 2;
453
+ const d = angleDelta(lon + t * spin, scan);
454
+ const boost = Math.exp(-(d * d) / .18) * Math.max(0, z);
455
+ dots.push({
456
+ x: px,
457
+ y: py,
458
+ z,
459
+ r: ((o.rBase ?? .6) + (o.rDepth ?? 1.7) * depth + (o.rBoost ?? 1) * boost) * rs,
460
+ white: (o.inkFar ?? .62) - (o.inkSpan ?? .54) * depth,
461
+ a: dimBase + (1 - dimBase) * Math.min(1, boost)
462
+ });
463
+ }
464
+ }
465
+ return finalizeFrame(dots, [], o.rMin);
466
+ };
467
+ function solveCycle(time, count, slotDur, rest) {
468
+ const tc = time % (2 * count * slotDur + rest);
469
+ const amount = new Array(count).fill(0);
470
+ let active = -1;
471
+ if (tc < 2 * count * slotDur) {
472
+ const slot = Math.floor(tc / slotDur);
473
+ const p = (tc - slot * slotDur) / slotDur;
474
+ const ep = 1 - (1 - Math.min(1, p / .7)) ** 3;
475
+ if (slot < count) {
476
+ for (let i = 0; i < slot; i++) amount[i] = 1;
477
+ amount[slot] = ep;
478
+ active = slot;
479
+ } else {
480
+ const u = 2 * count - 1 - slot;
481
+ for (let i = 0; i < u; i++) amount[i] = 1;
482
+ amount[u] = 1 - ep;
483
+ active = u;
484
+ }
485
+ }
486
+ return {
487
+ amount,
488
+ active
489
+ };
490
+ }
491
+ function applyMoves(pt3, moves, sc) {
492
+ let [x, y, z] = pt3;
493
+ let inActive = false;
494
+ for (let i = 0; i < moves.length; i++) {
495
+ if (sc.amount[i] <= 0) continue;
496
+ const mv = moves[i];
497
+ const coord = mv.axis === 0 ? x : mv.axis === 1 ? y : z;
498
+ if (coord < mv.lo || coord >= mv.hi) continue;
499
+ if (i === sc.active) inActive = true;
500
+ const a = mv.ang * sc.amount[i];
501
+ const ca = Math.cos(a);
502
+ const sa = Math.sin(a);
503
+ if (mv.axis === 0) {
504
+ const y2 = y * ca - z * sa;
505
+ z = y * sa + z * ca;
506
+ y = y2;
507
+ } else if (mv.axis === 1) {
508
+ const x2 = x * ca + z * sa;
509
+ z = -x * sa + z * ca;
510
+ x = x2;
511
+ } else {
512
+ const x2 = x * ca - y * sa;
513
+ y = x * sa + y * ca;
514
+ x = x2;
515
+ }
516
+ }
517
+ return [
518
+ x,
519
+ y,
520
+ z,
521
+ inActive
522
+ ];
523
+ }
524
+ function makeMoves(count) {
525
+ const moves = [];
526
+ for (let i = 0; i < count; i++) {
527
+ const axis = Math.min(2, Math.floor(hashD(i, 2.3) * 3));
528
+ const lo = -1 + .5 * Math.min(3, Math.floor(hashD(i, 5.9) * 4));
529
+ const dir = hashD(i, 7.7) < .5 ? 1 : -1;
530
+ moves.push({
531
+ axis,
532
+ lo,
533
+ hi: lo + .5,
534
+ ang: dir * Math.PI / 2
535
+ });
536
+ }
537
+ return moves;
538
+ }
539
+ const frameRubik = (size, t, o) => {
540
+ const cx = size / 2;
541
+ const cy = size / 2;
542
+ const R = size / 2 * .82;
543
+ const pt = makeProj(t * .55, .35 + .1 * Math.sin(t * .9), cx, cy, R);
544
+ const rs = radiusScale(size, o.rsPow ?? .6);
545
+ const moveCount = o.moveCount ?? 14;
546
+ const moves = makeMoves(moveCount);
547
+ const sc = solveCycle(t, moveCount, .42, 1.2);
548
+ const dots = [];
549
+ const latRings = o.latRings ?? 15;
550
+ const lonDensity = o.lonDensity ?? 40;
551
+ for (let li = 0; li <= latRings; li++) {
552
+ const lat = -Math.PI / 2 + li / latRings * Math.PI;
553
+ const cosLat = Math.cos(lat);
554
+ const sinLat = Math.sin(lat);
555
+ const lonCount = Math.max(1, Math.round(Math.abs(cosLat) * lonDensity));
556
+ for (let lj = 0; lj < lonCount; lj++) {
557
+ const lon = lj / lonCount * 2 * Math.PI;
558
+ const [x, y, z, inActive] = applyMoves([
559
+ cosLat * Math.cos(lon),
560
+ sinLat,
561
+ cosLat * Math.sin(lon)
562
+ ], moves, sc);
563
+ const [px, py, zr] = pt(x, y, z);
564
+ const depth = (zr + 1) / 2;
565
+ dots.push({
566
+ x: px,
567
+ y: py,
568
+ z: zr,
569
+ r: ((o.rBase ?? .6) + (o.rDepth ?? 1.7) * depth + (inActive ? o.rActive ?? .3 : 0)) * rs,
570
+ white: (o.inkFar ?? .62) - (o.inkSpan ?? .54) * depth - (inActive ? .14 : 0)
571
+ });
572
+ }
573
+ }
574
+ return finalizeFrame(dots, [], o.rMin);
575
+ };
576
+ const frameWave = (size, t, o) => {
577
+ const cx = size / 2;
578
+ const cy = size / 2;
579
+ const R = size / 2 * .874;
580
+ const pt = makeProj(t * .18, .38, cx, cy, 1);
581
+ const rs = radiusScale(size, o.rsPow ?? .6);
582
+ const dots = [];
583
+ const rings = o.rings ?? 15;
584
+ const lonDensity = o.lonDensity ?? 40;
585
+ for (let ri = 0; ri <= rings; ri++) {
586
+ const lat = -Math.PI / 2 + ri / rings * Math.PI;
587
+ const cosLat = Math.cos(lat);
588
+ const sinLat = Math.sin(lat);
589
+ const w = .62 * Math.sin(t * 2.1 - ri * .52) + .38 * Math.sin(t * 1.27 + ri * .83);
590
+ const rr = R * (.88 + .105 * w);
591
+ const lonCount = Math.max(1, Math.round(Math.abs(cosLat) * lonDensity));
592
+ for (let lj = 0; lj < lonCount; lj++) {
593
+ const lon = lj / lonCount * 2 * Math.PI;
594
+ const [px, py, z] = pt(cosLat * Math.cos(lon) * rr, sinLat * rr, cosLat * Math.sin(lon) * rr);
595
+ const depth = (z / R + 1) / 2;
596
+ const crest = Math.max(0, w);
597
+ dots.push({
598
+ x: px,
599
+ y: py,
600
+ z,
601
+ r: ((o.rBase ?? .6) + (o.rDepth ?? 1.7) * depth) * (1 + .4 * crest) * rs,
602
+ white: .66 - .56 * depth - .1 * crest
603
+ });
604
+ }
605
+ }
606
+ return finalizeFrame(dots, [], o.rMin);
607
+ };
608
+ const frameOrbits = (size, t, o) => {
609
+ const cx = size / 2;
610
+ const cy = size / 2;
611
+ const R = size / 2 * .82;
612
+ const pt = makeProj(t * .12, .3, cx, cy, 1);
613
+ const rs = radiusScale(size, o.rsPow ?? .6);
614
+ const dots = [];
615
+ const orbitN = o.orbitN ?? 12;
616
+ const ghostN = o.ghostN ?? 40;
617
+ const particles = o.particles ?? 3;
618
+ for (let orb = 0; orb < orbitN; orb++) {
619
+ const h1 = hashD(orb, 1.7);
620
+ const h2 = hashD(orb, 5.2);
621
+ const h3 = hashD(orb, 8.9);
622
+ const ro = R * (.45 + .52 * h1);
623
+ const th = h1 * 2 * Math.PI;
624
+ const phi = Math.acos(2 * h2 - 1);
625
+ const nx = Math.sin(phi) * Math.cos(th);
626
+ const ny = Math.cos(phi);
627
+ const nz = Math.sin(phi) * Math.sin(th);
628
+ let ux = -ny;
629
+ let uy = nx;
630
+ const uz = 0;
631
+ const ul = Math.max(1e-6, Math.sqrt(ux * ux + uy * uy));
632
+ ux /= ul;
633
+ uy /= ul;
634
+ const vx = ny * uz - nz * uy;
635
+ const vy = nz * ux - nx * uz;
636
+ const vz = nx * uy - ny * ux;
637
+ const speed = (.25 + .55 * h3) * (h3 > .5 ? 1 : -1);
638
+ for (let k = 0; k < ghostN; k++) {
639
+ const a = k / ghostN * 2 * Math.PI;
640
+ const [px, py, z] = pt((ux * Math.cos(a) + vx * Math.sin(a)) * ro, (uy * Math.cos(a) + vy * Math.sin(a)) * ro, (uz * Math.cos(a) + vz * Math.sin(a)) * ro);
641
+ const depth = (z / ro + 1) / 2;
642
+ dots.push({
643
+ x: px,
644
+ y: py,
645
+ z,
646
+ r: (o.ghostR ?? .9) * rs,
647
+ white: .72,
648
+ a: (o.ghostA ?? .5) * (.4 + .6 * depth)
649
+ });
650
+ }
651
+ for (let m = 0; m < particles; m++) {
652
+ const a = t * speed + m / particles * 2 * Math.PI + h2 * 6;
653
+ const [px, py, z] = pt((ux * Math.cos(a) + vx * Math.sin(a)) * ro, (uy * Math.cos(a) + vy * Math.sin(a)) * ro, (uz * Math.cos(a) + vz * Math.sin(a)) * ro);
654
+ const depth = (z / ro + 1) / 2;
655
+ dots.push({
656
+ x: px,
657
+ y: py,
658
+ z,
659
+ r: ((o.partR ?? 1.2) + (o.partRDepth ?? 1.6) * depth) * rs,
660
+ white: .3 - .22 * depth
661
+ });
662
+ }
663
+ }
664
+ return finalizeFrame(dots, [], o.rMin);
665
+ };
666
+ const frameRibbon = (size, t, o) => {
667
+ const cx = size / 2;
668
+ const cy = size / 2;
669
+ const R = size / 2 * .78;
670
+ const spin = o.spin ?? 1;
671
+ const camTilt = .3;
672
+ const pt = makeProj(t * .1 * spin, camTilt, cx, cy, 1);
673
+ const rs = radiusScale(size, o.rsPow ?? .6);
674
+ const dots = [];
675
+ const ghostN = o.ghostN ?? 150;
676
+ for (let i = 0; i < ghostN; i++) {
677
+ const d = fibDir(i, ghostN);
678
+ const [px, py, z] = pt(d[0] * R, d[1] * R, d[2] * R);
679
+ const depth = (z / R + 1) / 2;
680
+ dots.push({
681
+ x: px,
682
+ y: py,
683
+ z,
684
+ r: .8 * rs,
685
+ white: .78,
686
+ a: .1 + .22 * depth
687
+ });
688
+ }
689
+ const ya = t * .24 * spin;
690
+ const ta = o.faceOn ? -camTilt : .55 + .3 * Math.sin(t * .18) * spin;
691
+ const ux = Math.cos(ya);
692
+ const uy = 0;
693
+ const uz = Math.sin(ya);
694
+ const vx = -uz * Math.sin(ta);
695
+ const vy = Math.cos(ta);
696
+ const vz = ux * Math.sin(ta);
697
+ const nx = uy * vz - uz * vy;
698
+ const ny = uz * vx - ux * vz;
699
+ const nz = ux * vy - uy * vx;
700
+ const wobAmp = .23 * (o.wobMul ?? 1);
701
+ const baseR = o.faceOn ? R / (1 + .85 * wobAmp) : R;
702
+ const baseLanes = o.lanes ?? 5;
703
+ const segs = o.segs ?? 88;
704
+ const lanes = Math.max(1, Math.round(baseLanes * (o.bandMul ?? 1)));
705
+ for (let w = 0; w < lanes; w++) {
706
+ const laneOff = (w - (lanes - 1) / 2) * .075;
707
+ const edge = Math.abs(w - (lanes - 1) / 2) / Math.max(1, (lanes - 1) / 2);
708
+ for (let k = 0; k < segs; k++) {
709
+ const a = k / segs * 2 * Math.PI;
710
+ const wob = (.16 * Math.sin(a * 3 - t * 1.7 + w * .22) + .07 * Math.sin(a * 5 + t * 1.1)) * (o.wobMul ?? 1);
711
+ const radial = o.faceOn ? 1 + wob : 1;
712
+ const off$1 = o.faceOn ? laneOff : laneOff + wob;
713
+ const x = ux * Math.cos(a) + vx * Math.sin(a) + nx * off$1;
714
+ const y = uy * Math.cos(a) + vy * Math.sin(a) + ny * off$1;
715
+ const z = uz * Math.cos(a) + vz * Math.sin(a) + nz * off$1;
716
+ const l = Math.sqrt(x * x + y * y + z * z);
717
+ const rr = baseR * radial;
718
+ const [px, py, zr] = pt(x / l * rr, y / l * rr, z / l * rr);
719
+ const depth = (zr / R + 1) / 2;
720
+ dots.push({
721
+ x: px,
722
+ y: py,
723
+ z: zr,
724
+ r: ((o.rBase ?? 1.1) + (o.rDepth ?? 1.7) * depth) * (1 - .25 * edge) * rs,
725
+ white: .52 - .44 * depth + .18 * edge,
726
+ a: .4 + .6 * depth
727
+ });
728
+ }
729
+ }
730
+ return finalizeFrame(dots, [], o.rMin);
731
+ };
732
+ function smoothE(x) {
733
+ return x * x * (3 - 2 * x);
734
+ }
735
+ function polyPath(verts) {
736
+ const V = verts.length;
737
+ const L = [];
738
+ let total = 0;
739
+ for (let i = 0; i < V; i++) {
740
+ const a = verts[i];
741
+ const b = verts[(i + 1) % V];
742
+ const l = Math.hypot(b[0] - a[0], b[1] - a[1]);
743
+ L.push(l);
744
+ total += l;
745
+ }
746
+ return (f) => {
747
+ let target = f * total;
748
+ let i = 0;
749
+ while (target > L[i] && i < V - 1) {
750
+ target -= L[i];
751
+ i++;
752
+ }
753
+ const a = verts[i];
754
+ const b = verts[(i + 1) % V];
755
+ const ff = L[i] ? Math.min(1, target / L[i]) : 0;
756
+ return [a[0] + (b[0] - a[0]) * ff, a[1] + (b[1] - a[1]) * ff];
757
+ };
758
+ }
759
+ var CIRCLE = (f) => {
760
+ const a = -Math.PI / 2 + f * 2 * Math.PI;
761
+ return [Math.cos(a) * .24, Math.sin(a) * .24];
762
+ };
763
+ var CYCLE = [
764
+ CIRCLE,
765
+ polyPath([
766
+ [0, -.26],
767
+ [.24, .16],
768
+ [-.24, .16]
769
+ ]),
770
+ polyPath([
771
+ [0, -.2],
772
+ [.2, -.2],
773
+ [.2, .2],
774
+ [-.2, .2],
775
+ [-.2, -.2]
776
+ ])
777
+ ];
778
+ function morphN(d) {
779
+ return Math.max(6, Math.round(34 * d));
780
+ }
781
+ var HOLD = 1.4;
782
+ var MORPH = .9;
783
+ var SEG = HOLD + MORPH;
784
+ const frameMorph = (size, t, o) => {
785
+ const K = CYCLE.length;
786
+ const tc = t % (SEG * K);
787
+ const k = Math.floor(tc / SEG);
788
+ const local = tc - k * SEG;
789
+ const m = local > HOLD ? smoothE((local - HOLD) / MORPH) : 0;
790
+ const sprd = o.spread ?? 1;
791
+ const pA = CYCLE[k];
792
+ const pB = CYCLE[(k + 1) % K];
793
+ const M = 160;
794
+ const pts = [];
795
+ for (let i = 0; i < M; i++) {
796
+ const f = i / M;
797
+ const a = pA(f);
798
+ const b = pB(f);
799
+ pts.push([(a[0] + (b[0] - a[0]) * m) * sprd, (a[1] + (b[1] - a[1]) * m) * sprd]);
800
+ }
801
+ const L = [];
802
+ let total = 0;
803
+ for (let i = 0; i < M; i++) {
804
+ const a = pts[i];
805
+ const b = pts[(i + 1) % M];
806
+ const l = Math.hypot(b[0] - a[0], b[1] - a[1]);
807
+ L.push(l);
808
+ total += l;
809
+ }
810
+ const n = morphN(o.iconD ?? 1);
811
+ const re = (o.rDot ?? .021) * 1.35 * sprd;
812
+ const pulse = 1 + .02 * Math.sin(local * 3.1);
813
+ const dots = [];
814
+ const c2 = size / 2;
815
+ let seg = 0;
816
+ let acc = 0;
817
+ for (let k2 = 0; k2 < n; k2++) {
818
+ const target = k2 / n * total;
819
+ while (acc + L[seg] < target && seg < M - 1) {
820
+ acc += L[seg];
821
+ seg++;
822
+ }
823
+ const a = pts[seg];
824
+ const b = pts[(seg + 1) % M];
825
+ const f = L[seg] ? Math.min(1, (target - acc) / L[seg]) : 0;
826
+ const x = (a[0] + (b[0] - a[0]) * f) * pulse;
827
+ const y = (a[1] + (b[1] - a[1]) * f) * pulse;
828
+ dots.push({
829
+ x: c2 + x * size,
830
+ y: c2 + y * size,
831
+ z: 0,
832
+ r: Math.max(.35, re * size),
833
+ white: .1
834
+ });
835
+ }
836
+ return finalizeFrame(dots, [], o.rMin);
837
+ };
838
+ const earthPointData = {
839
+ "20": {
840
+ rings: 9,
841
+ flags: "01100000000000000000000000000000100010000100000011000110011000000000011111100000011001001100011000111010"
842
+ },
843
+ "32": {
844
+ rings: 17,
845
+ flags: "011001001111000000000000000000000100000000000000000000010000000000000000000000000110000010000000101000000000000111000001110000001110000000000001111000011100000000000000000000001110000011110000001000000000000000100000111111000000000000000000100000001111111010100000000000011000000110011111111000000011110000101001111100000011110001111111100011100001111111000000010000"
846
+ },
847
+ "48": {
848
+ rings: 29,
849
+ flags: "111011111111001011001111111100000000000000101111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000001000000000000001100000000000000000000000001100000000000000000001100000000001100000000000011111000000000000000000001110000000001110100000000001111100000000000000000000011111000000001111010000000000011100000000000000000000001111110000000011110000000000000001100000000000000000000011111111000000011111000000000000000010100000000000000000000111100000000001111100000000000100000000000000000000000000011100000000111111111000001000000000000000000000000000000100000000001111111111000001000100000000000000000000000101001000000001111111111100110110000000000000000000001110010000000001111111111001111111100000000000000000111110000000000111110111111111111000000000000000011111100000000100001111111111110010000000000011111100000000101101111111111100000000000111111010000011111111111111100000000011110100000100111111111110100011111010100010111111111111111010010001011111110001001100001000000110000000"
850
+ },
851
+ "64": {
852
+ rings: 37,
853
+ flags: "111011111111011110011111111100000001000111111111110000000000000000001101111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000011100000000000010000000000000001000111000000000000000000000000111100000000000011100000000000000011111110000000000000000000000000111100000000000011110100000000000011111110000000000000000000000000001111110000000000111100100000000000000111110000000000000000000000000001111111100000000001111110100000000000000011000000000000000000000000000001111111110000000000111110000000000000000000000001000000000000000000000000111111111000000000011111100000000000000000000100000000000000000000000000001111110000000000001111111000000000000101100000000000000000000000000000000001111100000000000011111111000000000011001000000000000000000000000000000000001100000000011111111111110000010000010000000000000000000000000000000011000000000000011111111111110000011000110000000000000000000000000000011000010000000000111111111111111000110011000000000000000000000000000011000100000000000111111111111110011111111110000000000000000000000011100000000000000011111111111111111111111100000000000000000000011111110000000000001110000111111111111110000000000000000000011111110000000000010000011101111111111000000000000000000011111111000000000010110010111111111111000000000000001111111101000000111111111111111111110000000000001111101110000011111111111111111110000000001111100100000010101111111111110010011111111010100000111111111111111101111010011000011111111111100001110110000001110000001011101000000000000000000"
854
+ },
855
+ "96": {
856
+ rings: 53,
857
+ flags: "111111111111001111011111111100111110011111111111110000110111000111111111111110000000000001000000111111111111111100000000000000000000000000110111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000001100000000000000000000000000000000000000000000000001000000000000000000000000011100000000000000000000000000000000000000000000000000001000000000000000000000000011110000000000000000000000000000000000000000000000110000001000000000000000000000000000111100000000000000000011000000000000000000000010000111000000000000000000000000000000000001111100000000000000000111100000000000000000000011111111110000000000000000000000000000000000011111100000000000000001111100000000000000000000011111111110000000000000000000000000000000000000111111100000000000000001111110010000000000000000001111111111000000000000000000000000000000000000001111111100000000000000011111100100000000000000000000111111110000000000000000000000000000000000000001111111110000000000000011111111011000000000000000000001111101000000000000000000000000000000000000000111111111110000000000000001111111100000000000000000000000001101000000000000000000000000000000000000000011111111111100000000000000111111110000000000000000000000000000000100000000000000000000000000000000000000111111111111100000000000000111111100000000000000000000110000000111000000000000000000000000000000000000000111111111111000000000000000111111110000000000000000000101101000111000000000000000000000000000000000000000011111111100000000000000000111111111100000000000000000100110000000000000000000000000000000000000000000000000111111100000000000000000011111111111000000000000000110001000000000000000000000000000000000000000000000000111111000000000000001111111111111111100000000010000010000001000000000000000000000000000000000000000000000011100000000000000111111111111111111100000000000000000000000000000000000000000000000000000000000000011000000000000000000011111111111111111110000000110000011100000000000000000000000000000000000000000001110000000000000000000011111111111111110111000000110001111000000000000000000000000000000000000000001100100010000000000000001111111111111110111110000111101111000000000000000000000000000000000000000011100000000000000000000001111111111111111111100111111111111111000000000000000000000000000000000011100001000000000000000001111111111110111011111111111111111100000000000000000000000000000000111111110000000000000000000111111111111111111111111111111111000000000000000000000000000000111111111000000000000000000111100000011111111111111111111100100000000000000000000000001111111111100000000000000011000000011111011111111111111100100000000000000000000000011111111111000000000000000110100111111001111111111111101000000000000000000000001111111111110000000000000011101110010111111111111111111010000000000000000000111111111101010000000000111111111111111111111111111100000000000000000011111111111111000000000111111111111111111111111111100000000000000011111111011110000000000001111111111111111111110001000000000001111110001100000000000010111111111111111111000100000111111111100100010000000101111111111111111111010001111111111111001000100010111111111111111111110111111001010011000001111111111111111111000001111101110000000101111111100000000010011100000000110000000000011110010000000000000101100000000000000000000"
858
+ }
859
+ };
860
+ var cache = /* @__PURE__ */ new Map();
861
+ function getEarthPoints(size) {
862
+ const hit = cache.get(size);
863
+ if (hit) return hit;
864
+ const { rings, flags } = earthPointData[size];
865
+ const points = [];
866
+ let index$1 = 0;
867
+ for (let row = 0; row < rings; row++) {
868
+ const lat = -Math.PI / 2 + (row + .5) / rings * Math.PI;
869
+ const count = Math.max(1, Math.round(2 * rings * Math.cos(lat)));
870
+ for (let col = 0; col < count; col++, index$1++) {
871
+ const lon = -Math.PI + col / count * 2 * Math.PI;
872
+ const land = flags[index$1] === "1";
873
+ if (!land && index$1 % 3 !== 0) continue;
874
+ points.push({
875
+ x: Math.cos(lat) * Math.cos(lon),
876
+ y: Math.sin(lat),
877
+ z: Math.cos(lat) * Math.sin(lon),
878
+ lon,
879
+ land
880
+ });
881
+ }
882
+ }
883
+ cache.set(size, points);
884
+ return points;
885
+ }
886
+ function frameEarth(size, time) {
887
+ const project = makeProj(35 * Math.PI / 180 - Math.PI / 2 + time * .22, .18, size / 2, size / 2, size * .43);
888
+ const dots = [];
889
+ for (const p of getEarthPoints(size)) {
890
+ const [x, y, z] = project(p.x, p.y, p.z);
891
+ if (z <= 0) continue;
892
+ const scan = Math.exp(-Math.pow(angleDelta(p.lon, time * .9), 2) / .08);
893
+ const edge = Math.min(1, z / .14);
894
+ dots.push({
895
+ x,
896
+ y,
897
+ z,
898
+ r: (size <= 32 ? .48 : .52) * (size / 64) ** .25 * (1 + .2 * z + (p.land ? .22 * scan : 0)),
899
+ white: p.land ? .08 + .2 * (1 - z) : .65,
900
+ a: edge * (p.land ? .82 + scan * .18 : .2)
901
+ });
902
+ }
903
+ return finalizeFrame(dots, [], .3);
904
+ }
905
+ var frames = {
906
+ searching: frameGlobe,
907
+ solving: frameRubik,
908
+ listening: frameWave,
909
+ working: frameOrbits,
910
+ composing: frameRibbon,
911
+ shaping: frameMorph
912
+ };
913
+ function createLoadingFrame(animation, size, time) {
914
+ if (animation === "earth") return frameEarth(size, time);
915
+ const { speed, opts } = resolvePreset(animation, size);
916
+ const frame = frames[animation](size, time * speed, opts);
917
+ if (size === 20 && frame.dots.length > 120) {
918
+ const count = frame.dots.length;
919
+ frame.dots = Array.from({ length: 120 }, (_, i) => frame.dots[Math.floor(i * count / 120)]);
920
+ }
921
+ return frame;
922
+ }
923
+ function paintLoadingFrame(ctx, frame, color) {
924
+ ctx.fillStyle = color;
925
+ for (const dot of frame.dots) {
926
+ ctx.globalAlpha = Math.max(0, Math.min(1, (dot.a ?? 1) * (1 - dot.white)));
927
+ ctx.beginPath();
928
+ ctx.arc(dot.x, dot.y, dot.r, 0, Math.PI * 2);
929
+ ctx.fill();
930
+ }
931
+ ctx.globalAlpha = 1;
932
+ }
933
+ function useLoadingAnimation(canvas, options, color) {
934
+ const available = (0, vue.ref)(true);
935
+ let ctx = null;
936
+ let raf;
937
+ let previous;
938
+ let elapsed = 0;
939
+ let enabled = true;
940
+ let inView = true;
941
+ let reduced = false;
942
+ let mounted = false;
943
+ let dpr = 1;
944
+ let observer;
945
+ let motion;
946
+ const stop = () => {
947
+ if (raf !== void 0) cancelAnimationFrame(raf);
948
+ raf = void 0;
949
+ previous = void 0;
950
+ };
951
+ const running = () => mounted && ctx && enabled && inView && options().active && !options().paused && !reduced && document.visibilityState !== "hidden";
952
+ const paint = () => {
953
+ if (!ctx || !canvas.value) return;
954
+ const size = normalizeSize(options().size);
955
+ const ratio = Math.min(2, Math.max(1, window.devicePixelRatio || 1));
956
+ if (canvas.value.width !== Math.round(size * ratio) || ratio !== dpr) {
957
+ canvas.value.width = Math.round(size * ratio);
958
+ canvas.value.height = Math.round(size * ratio);
959
+ }
960
+ dpr = ratio;
961
+ ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
962
+ ctx.clearRect(0, 0, size, size);
963
+ try {
964
+ paintLoadingFrame(ctx, createLoadingFrame(normalizeAnimation(options().animation), size, reduced ? .6 : elapsed), color.value);
965
+ } catch {
966
+ available.value = false;
967
+ ctx = null;
968
+ stop();
969
+ }
970
+ };
971
+ const tick = (now) => {
972
+ raf = void 0;
973
+ if (!running()) {
974
+ previous = void 0;
975
+ return;
976
+ }
977
+ if (previous !== void 0) elapsed += Math.min(100, now - previous) / 1e3 * normalizeSpeed(options().speed);
978
+ previous = now;
979
+ paint();
980
+ if (running()) raf = requestAnimationFrame(tick);
981
+ };
982
+ const sync = () => {
983
+ if (!mounted) return;
984
+ if (!running()) stop();
985
+ if (options().active && inView && enabled && document.visibilityState !== "hidden") paint();
986
+ if (running() && raf === void 0) raf = requestAnimationFrame(tick);
987
+ };
988
+ const motionChange = () => {
989
+ reduced = motion?.matches ?? false;
990
+ sync();
991
+ };
992
+ (0, vue.watch)(() => [
993
+ options().active,
994
+ options().paused,
995
+ options().animation,
996
+ options().size,
997
+ options().speed,
998
+ color.value
999
+ ], sync, { flush: "post" });
1000
+ (0, vue.onMounted)(() => {
1001
+ mounted = true;
1002
+ try {
1003
+ ctx = canvas.value?.getContext("2d") ?? null;
1004
+ } catch {
1005
+ ctx = null;
1006
+ }
1007
+ available.value = !!ctx;
1008
+ motion = window.matchMedia?.("(prefers-reduced-motion: reduce)");
1009
+ reduced = motion?.matches ?? false;
1010
+ motion?.addEventListener("change", motionChange);
1011
+ if (typeof IntersectionObserver !== "undefined" && canvas.value) {
1012
+ observer = new IntersectionObserver(([entry]) => {
1013
+ inView = entry.isIntersecting;
1014
+ sync();
1015
+ });
1016
+ observer.observe(canvas.value);
1017
+ }
1018
+ document.addEventListener("visibilitychange", sync);
1019
+ window.addEventListener("resize", sync);
1020
+ sync();
1021
+ });
1022
+ (0, vue.onActivated)(() => {
1023
+ enabled = true;
1024
+ sync();
1025
+ });
1026
+ (0, vue.onDeactivated)(() => {
1027
+ enabled = false;
1028
+ stop();
1029
+ });
1030
+ (0, vue.onScopeDispose)(() => {
1031
+ mounted = false;
1032
+ stop();
1033
+ observer?.disconnect();
1034
+ motion?.removeEventListener("change", motionChange);
1035
+ if (typeof document !== "undefined") document.removeEventListener("visibilitychange", sync);
1036
+ if (typeof window !== "undefined") window.removeEventListener("resize", sync);
1037
+ ctx = null;
1038
+ });
1039
+ return { available };
1040
+ }
1041
+ var _hoisted_1$7 = [
1042
+ "role",
1043
+ "aria-live",
1044
+ "aria-hidden",
1045
+ "aria-label"
1046
+ ];
1047
+ var FlLoading_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
1048
+ name: "FlLoading",
1049
+ __name: "FlLoading",
1050
+ props: flLoadingProps,
1051
+ setup(__props) {
1052
+ const props = __props;
1053
+ const ns = require_dialog.useNamespace("loading");
1054
+ const root = (0, vue.ref)();
1055
+ const canvas = (0, vue.ref)();
1056
+ const resolvedSize = (0, vue.computed)(() => normalizeSize(props.size));
1057
+ const resolvedColor = useLoadingColor(() => root.value, () => props);
1058
+ const { available } = useLoadingAnimation(canvas, () => props, resolvedColor);
1059
+ return (_ctx, _cache) => {
1060
+ return (0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
1061
+ ref_key: "root",
1062
+ ref: root,
1063
+ class: (0, vue.normalizeClass)([
1064
+ (0, vue.unref)(ns).b(),
1065
+ (0, vue.unref)(ns).m(_ctx.layout),
1066
+ (0, vue.unref)(ns).is("inactive", !_ctx.active)
1067
+ ]),
1068
+ style: (0, vue.normalizeStyle)({ "--fl-loading-size": `${resolvedSize.value}px` }),
1069
+ role: _ctx.active ? "status" : void 0,
1070
+ "aria-live": _ctx.active ? "polite" : "off",
1071
+ "aria-hidden": !_ctx.active || void 0,
1072
+ "aria-label": !_ctx.text && !_ctx.$slots.text ? _ctx.ariaLabel : void 0
1073
+ }, [(0, vue.createElementVNode)("span", {
1074
+ class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("visual")),
1075
+ "aria-hidden": "true"
1076
+ }, [(0, vue.withDirectives)((0, vue.createElementVNode)("canvas", {
1077
+ ref_key: "canvas",
1078
+ ref: canvas,
1079
+ class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("canvas")),
1080
+ style: (0, vue.normalizeStyle)({
1081
+ width: `${resolvedSize.value}px`,
1082
+ height: `${resolvedSize.value}px`
1083
+ })
1084
+ }, null, 6), [[vue.vShow, (0, vue.unref)(available)]]), !(0, vue.unref)(available) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
1085
+ key: 0,
1086
+ class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("fallback")),
1087
+ style: (0, vue.normalizeStyle)({ color: (0, vue.unref)(resolvedColor) })
1088
+ }, "●", 6)) : (0, vue.createCommentVNode)("v-if", true)], 2), _ctx.text || _ctx.$slots.text ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
1089
+ key: 0,
1090
+ class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("text"))
1091
+ }, [(0, vue.renderSlot)(_ctx.$slots, "text", {}, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)(_ctx.text), 1)])], 2)) : (0, vue.createCommentVNode)("v-if", true)], 14, _hoisted_1$7);
1092
+ };
1093
+ }
1094
+ });
1095
+ var FlLoading_default = FlLoading_vue_vue_type_script_setup_true_lang_default;
1096
+ function useFlLoading(active, options = {}) {
1097
+ const ns = require_dialog.useNamespace("loading");
1098
+ const alive = (0, vue.ref)(true);
1099
+ const generation = (0, vue.ref)(0);
1100
+ const resolved = (0, vue.computed)(() => (0, vue.toValue)(options));
1101
+ const color = useLoadingColor(() => (0, vue.toValue)(resolved.value.themeTarget), () => resolved.value);
1102
+ (0, vue.watch)(() => (0, vue.toValue)(active), () => generation.value++, { flush: "sync" });
1103
+ (0, vue.onScopeDispose)(() => {
1104
+ alive.value = false;
1105
+ });
1106
+ const Content = (0, vue.defineComponent)({
1107
+ name: "FlLoadingContent",
1108
+ props: { generation: {
1109
+ type: Number,
1110
+ required: true
1111
+ } },
1112
+ setup(props) {
1113
+ const ownGeneration = props.generation;
1114
+ return () => {
1115
+ const { background: _background, customClass: _customClass, themeTarget: _target, ...visual } = resolved.value;
1116
+ return (0, vue.h)(FlLoading_default, {
1117
+ layout: "vertical",
1118
+ ...visual,
1119
+ color: color.value,
1120
+ active: alive.value && (0, vue.toValue)(active) && ownGeneration === generation.value
1121
+ });
1122
+ };
1123
+ }
1124
+ });
1125
+ return (0, vue.computed)(() => {
1126
+ if (!alive.value || !(0, vue.toValue)(active)) return false;
1127
+ return {
1128
+ text: (0, vue.h)(Content, { generation: generation.value }),
1129
+ customClass: [ns.b("adapter"), resolved.value.customClass].filter(Boolean).join(" "),
1130
+ background: resolved.value.background
1131
+ };
1132
+ });
1133
+ }
1134
+ const FlLoading = require_dialog.withInstall(FlLoading_default);
10
1135
  const FlDialog = require_dialog.withInstall(require_dialog.dialog_default);
11
1136
  const flInputProps = {
12
1137
  isTable: {
@@ -7642,17 +8767,17 @@ var resolveColumnKey = (path) => {
7642
8767
  return first || path;
7643
8768
  };
7644
8769
  const createTableProxyDataBuilder = () => {
7645
- const cache = /* @__PURE__ */ new WeakMap();
8770
+ const cache$2 = /* @__PURE__ */ new WeakMap();
7646
8771
  const runtime = {
7647
8772
  onCellChange: () => void 0,
7648
8773
  resolveRowIndex: () => -1,
7649
8774
  rowKeyField: "id",
7650
8775
  maxDepth: 4
7651
8776
  };
7652
- const getCachedProxy = (target, path) => cache.get(target)?.get(path);
8777
+ const getCachedProxy = (target, path) => cache$2.get(target)?.get(path);
7653
8778
  const setCachedProxy = (target, path, proxy) => {
7654
- if (!cache.has(target)) cache.set(target, /* @__PURE__ */ new Map());
7655
- cache.get(target)?.set(path, proxy);
8779
+ if (!cache$2.has(target)) cache$2.set(target, /* @__PURE__ */ new Map());
8780
+ cache$2.get(target)?.set(path, proxy);
7656
8781
  };
7657
8782
  const toNullableRow = (value) => {
7658
8783
  if (!isObjectLike(value)) return null;
@@ -9086,6 +10211,7 @@ var table_editor_default = table_editor_vue_vue_type_script_setup_true_lang_defa
9086
10211
  const FlTable = require_dialog.withInstall(table_default);
9087
10212
  const FlTableEditor = require_dialog.withInstall(table_editor_default);
9088
10213
  var components = [
10214
+ FlLoading,
9089
10215
  FlBarcode,
9090
10216
  require_dialog.FlButton,
9091
10217
  FlDialog,
@@ -9114,6 +10240,7 @@ exports.FlDialog = FlDialog;
9114
10240
  exports.FlInput = FlInput;
9115
10241
  exports.FlInputNumber = FlInputNumber;
9116
10242
  exports.FlInputSearch = FlInputSearch;
10243
+ exports.FlLoading = FlLoading;
9117
10244
  exports.FlQrCode = FlQrCode;
9118
10245
  exports.FlRadialMenu = FlRadialMenu;
9119
10246
  exports.FlRadialMenuItem = FlRadialMenuItem;
@@ -9133,6 +10260,7 @@ exports.mergeComponentExpose = require_dialog.mergeComponentExpose;
9133
10260
  exports.open = require_dialog.open;
9134
10261
  exports.useClearableState = require_dialog.useClearableState;
9135
10262
  exports.useDialog = require_dialog.useDialog;
10263
+ exports.useFlLoading = useFlLoading;
9136
10264
  exports.useMergedAttrs = require_dialog.useMergedAttrs;
9137
10265
  exports.useMergedExpose = require_dialog.useMergedExpose;
9138
10266
  exports.useNamespace = require_dialog.useNamespace;