omnix-chat 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,492 +1,661 @@
1
1
  import { a as e, i as t, n, o as r, r as i, t as a } from "./classPrivateFieldSet2-C_TowLYi.js";
2
- //#region node_modules/.pnpm/ai-motion@0.4.8/node_modules/ai-motion/build/Motion.js
3
- function o(e, t, n, r) {
4
- let i = Math.max(1, Math.min(e, t)), a = Math.min(Math.min(n, 20) + r, i), o = Math.min(a, Math.floor(e / 2)), s = Math.min(a, Math.floor(t / 2)), c = (t) => t / e * 2 - 1, l = (e) => e / t * 2 - 1, u = e, d = t, f = o, p = e - o, m = s, h = t - s, g = c(0), _ = c(u), v = l(0), y = l(d), b = c(f), x = c(p), S = l(m), C = l(h), w = o / e, T = 1 - o / e, E = s / t, D = 1 - s / t;
5
- return {
6
- positions: new Float32Array([
7
- g,
8
- v,
9
- _,
10
- v,
11
- g,
12
- S,
13
- g,
14
- S,
15
- _,
16
- v,
17
- _,
18
- S,
19
- g,
20
- C,
21
- _,
22
- C,
23
- g,
24
- y,
25
- g,
26
- y,
27
- _,
28
- C,
29
- _,
30
- y,
31
- g,
32
- S,
33
- b,
34
- S,
35
- g,
36
- C,
37
- g,
38
- C,
39
- b,
40
- S,
41
- b,
42
- C,
43
- x,
44
- S,
45
- _,
46
- S,
47
- x,
48
- C,
49
- x,
50
- C,
51
- _,
52
- S,
53
- _,
54
- C
55
- ]),
56
- uvs: new Float32Array([
57
- 0,
58
- 0,
59
- 1,
60
- 0,
61
- 0,
62
- E,
63
- 0,
64
- E,
65
- 1,
66
- 0,
67
- 1,
68
- E,
69
- 0,
70
- D,
71
- 1,
72
- D,
73
- 0,
74
- 1,
75
- 0,
76
- 1,
77
- 1,
78
- D,
79
- 1,
80
- 1,
81
- 0,
82
- E,
83
- w,
84
- E,
85
- 0,
86
- D,
87
- 0,
88
- D,
89
- w,
90
- E,
91
- w,
92
- D,
93
- T,
94
- E,
95
- 1,
96
- E,
97
- T,
98
- D,
99
- T,
100
- D,
101
- 1,
102
- E,
103
- 1,
104
- D
105
- ])
106
- };
2
+ function o(e2, t2, n2, r2) {
3
+ let i2 = Math.max(1, Math.min(e2, t2)), a2 = Math.min(Math.min(n2, 20) + r2, i2), o2 = Math.min(a2, Math.floor(e2 / 2)), s2 = Math.min(a2, Math.floor(t2 / 2)), c2 = (t3) => t3 / e2 * 2 - 1, l2 = (e3) => e3 / t2 * 2 - 1, u2 = e2, d2 = t2, f2 = o2, p2 = e2 - o2, m2 = s2, h2 = t2 - s2, g2 = c2(0), _2 = c2(u2), v2 = l2(0), y2 = l2(d2), b2 = c2(f2), x2 = c2(p2), S2 = l2(m2), C2 = l2(h2), w2 = o2 / e2, T2 = 1 - o2 / e2, E2 = s2 / t2, D2 = 1 - s2 / t2;
4
+ return {
5
+ positions: new Float32Array([
6
+ g2,
7
+ v2,
8
+ _2,
9
+ v2,
10
+ g2,
11
+ S2,
12
+ g2,
13
+ S2,
14
+ _2,
15
+ v2,
16
+ _2,
17
+ S2,
18
+ g2,
19
+ C2,
20
+ _2,
21
+ C2,
22
+ g2,
23
+ y2,
24
+ g2,
25
+ y2,
26
+ _2,
27
+ C2,
28
+ _2,
29
+ y2,
30
+ g2,
31
+ S2,
32
+ b2,
33
+ S2,
34
+ g2,
35
+ C2,
36
+ g2,
37
+ C2,
38
+ b2,
39
+ S2,
40
+ b2,
41
+ C2,
42
+ x2,
43
+ S2,
44
+ _2,
45
+ S2,
46
+ x2,
47
+ C2,
48
+ x2,
49
+ C2,
50
+ _2,
51
+ S2,
52
+ _2,
53
+ C2
54
+ ]),
55
+ uvs: new Float32Array([
56
+ 0,
57
+ 0,
58
+ 1,
59
+ 0,
60
+ 0,
61
+ E2,
62
+ 0,
63
+ E2,
64
+ 1,
65
+ 0,
66
+ 1,
67
+ E2,
68
+ 0,
69
+ D2,
70
+ 1,
71
+ D2,
72
+ 0,
73
+ 1,
74
+ 0,
75
+ 1,
76
+ 1,
77
+ D2,
78
+ 1,
79
+ 1,
80
+ 0,
81
+ E2,
82
+ w2,
83
+ E2,
84
+ 0,
85
+ D2,
86
+ 0,
87
+ D2,
88
+ w2,
89
+ E2,
90
+ w2,
91
+ D2,
92
+ T2,
93
+ E2,
94
+ 1,
95
+ E2,
96
+ T2,
97
+ D2,
98
+ T2,
99
+ D2,
100
+ 1,
101
+ E2,
102
+ 1,
103
+ D2
104
+ ])
105
+ };
107
106
  }
108
- function s(e, t, n) {
109
- let r = e.createShader(t);
110
- if (!r) throw Error("Failed to create shader");
111
- if (e.shaderSource(r, n), e.compileShader(r), !e.getShaderParameter(r, e.COMPILE_STATUS)) {
112
- let t = e.getShaderInfoLog(r) || "Unknown shader error";
113
- throw e.deleteShader(r), Error(t);
114
- }
115
- return r;
107
+ function s(e2, t2, n2) {
108
+ let r2 = e2.createShader(t2);
109
+ if (!r2) throw Error("Failed to create shader");
110
+ if (e2.shaderSource(r2, n2), e2.compileShader(r2), !e2.getShaderParameter(r2, e2.COMPILE_STATUS)) {
111
+ let t3 = e2.getShaderInfoLog(r2) || "Unknown shader error";
112
+ throw e2.deleteShader(r2), Error(t3);
113
+ }
114
+ return r2;
116
115
  }
117
- function c(e, t, n) {
118
- let r = s(e, e.VERTEX_SHADER, t), i = s(e, e.FRAGMENT_SHADER, n), a = e.createProgram();
119
- if (!a) throw Error("Failed to create program");
120
- if (e.attachShader(a, r), e.attachShader(a, i), e.linkProgram(a), !e.getProgramParameter(a, e.LINK_STATUS)) {
121
- let t = e.getProgramInfoLog(a) || "Unknown link error";
122
- throw e.deleteProgram(a), e.deleteShader(r), e.deleteShader(i), Error(t);
123
- }
124
- return e.deleteShader(r), e.deleteShader(i), a;
116
+ function c(e2, t2, n2) {
117
+ let r2 = s(e2, e2.VERTEX_SHADER, t2), i2 = s(e2, e2.FRAGMENT_SHADER, n2), a2 = e2.createProgram();
118
+ if (!a2) throw Error("Failed to create program");
119
+ if (e2.attachShader(a2, r2), e2.attachShader(a2, i2), e2.linkProgram(a2), !e2.getProgramParameter(a2, e2.LINK_STATUS)) {
120
+ let t3 = e2.getProgramInfoLog(a2) || "Unknown link error";
121
+ throw e2.deleteProgram(a2), e2.deleteShader(r2), e2.deleteShader(i2), Error(t3);
122
+ }
123
+ return e2.deleteShader(r2), e2.deleteShader(i2), a2;
125
124
  }
126
125
  var l = "#version 300 es\nprecision lowp float;\nin vec2 vUV;\nout vec4 outColor;\nuniform vec2 uResolution;\nuniform float uTime;\nuniform float uBorderWidth;\nuniform float uGlowWidth;\nuniform float uBorderRadius;\nuniform vec3 uColors[4];\nuniform float uGlowExponent;\nuniform float uGlowFactor;\nconst float PI = 3.14159265359;\nconst float TWO_PI = 2.0 * PI;\nconst float HALF_PI = 0.5 * PI;\nconst vec4 startPositions = vec4(0.0, PI, HALF_PI, 1.5 * PI);\nconst vec4 speeds = vec4(-1.9, -1.9, -1.5, 2.1);\nconst vec4 innerRadius = vec4(PI * 0.8, PI * 0.7, PI * 0.3, PI * 0.1);\nconst vec4 outerRadius = vec4(PI * 1.2, PI * 0.9, PI * 0.6, PI * 0.4);\nfloat random(vec2 st) {\nreturn fract(sin(dot(st.xy, vec2(12.9898, 78.233))) * 43758.5453123);\n}\nvec2 random2(vec2 st) {\nreturn vec2(random(st), random(st + 1.0));\n}\nfloat aaStep(float edge, float d) {\nfloat width = fwidth(d);\nreturn smoothstep(edge - width * 0.5, edge + width * 0.5, d);\n}\nfloat aaFract(float x) {\nfloat f = fract(x);\nfloat w = fwidth(x);\nfloat smooth_f = f * (1.0 - smoothstep(1.0 - w, 1.0, f));\nreturn smooth_f;\n}\nfloat sdRoundedBox(in vec2 p, in vec2 b, in float r) {\nvec2 q = abs(p) - b + r;\nreturn min(max(q.x, q.y), 0.0) + length(max(q, 0.0)) - r;\n}\nfloat getInnerGlow(vec2 p, vec2 b, float radius) {\nfloat dist_x = b.x - abs(p.x);\nfloat dist_y = b.y - abs(p.y);\nfloat glow_x = smoothstep(radius, 0.0, dist_x);\nfloat glow_y = smoothstep(radius, 0.0, dist_y);\nreturn 1.0 - (1.0 - glow_x) * (1.0 - glow_y);\n}\nfloat getVignette(vec2 uv) {\nvec2 vignetteUv = uv;\nvignetteUv = vignetteUv * (1.0 - vignetteUv);\nfloat vignette = vignetteUv.x * vignetteUv.y * 25.0;\nvignette = pow(vignette, 0.16);\nvignette = 1.0 - vignette;\nreturn vignette;\n}\nfloat uvToAngle(vec2 uv) {\nvec2 center = vec2(0.5);\nvec2 dir = uv - center;\nreturn atan(dir.y, dir.x) + PI;\n}\nvoid main() {\nvec2 uv = vUV;\nvec2 pos = uv * uResolution;\nvec2 centeredPos = pos - uResolution * 0.5;\nvec2 size = uResolution - uBorderWidth;\nvec2 halfSize = size * 0.5;\nfloat dBorderBox = sdRoundedBox(centeredPos, halfSize, uBorderRadius);\nfloat border = aaStep(0.0, dBorderBox);\nfloat glow = getInnerGlow(centeredPos, halfSize, uGlowWidth);\nfloat vignette = getVignette(uv);\nglow *= vignette;\nfloat posAngle = uvToAngle(uv);\nvec4 lightCenter = mod(startPositions + speeds * uTime, TWO_PI);\nvec4 angleDist = abs(posAngle - lightCenter);\nvec4 disToLight = min(angleDist, TWO_PI - angleDist) / TWO_PI;\nfloat intensityBorder[4];\nintensityBorder[0] = 1.0;\nintensityBorder[1] = smoothstep(0.4, 0.0, disToLight.y);\nintensityBorder[2] = smoothstep(0.4, 0.0, disToLight.z);\nintensityBorder[3] = smoothstep(0.2, 0.0, disToLight.w) * 0.5;\nvec3 borderColor = vec3(0.0);\nfor(int i = 0; i < 4; i++) {\nborderColor = mix(borderColor, uColors[i], intensityBorder[i]);\n}\nborderColor *= 1.1;\nborderColor = clamp(borderColor, 0.0, 1.0);\nfloat intensityGlow[4];\nintensityGlow[0] = smoothstep(0.9, 0.0, disToLight.x);\nintensityGlow[1] = smoothstep(0.7, 0.0, disToLight.y);\nintensityGlow[2] = smoothstep(0.4, 0.0, disToLight.z);\nintensityGlow[3] = smoothstep(0.1, 0.0, disToLight.w) * 0.7;\nvec4 breath = smoothstep(0.0, 1.0, sin(uTime * 1.0 + startPositions * PI) * 0.2 + 0.8);\nvec3 glowColor = vec3(0.0);\nglowColor += uColors[0] * intensityGlow[0] * breath.x;\nglowColor += uColors[1] * intensityGlow[1] * breath.y;\nglowColor += uColors[2] * intensityGlow[2] * breath.z;\nglowColor += uColors[3] * intensityGlow[3] * breath.w * glow;\nglow = pow(glow, uGlowExponent);\nglow *= random(pos + uTime) * 0.1 + 1.0;\nglowColor *= glow * uGlowFactor;\nglowColor = clamp(glowColor, 0.0, 1.0);\nvec3 color = mix(glowColor, borderColor + glowColor * 0.2, border);\nfloat alpha = mix(glow, 1.0, border);\noutColor = vec4(color, alpha);\n}", u = "#version 300 es\nin vec2 aPosition;\nin vec2 aUV;\nout vec2 vUV;\nvoid main() {\nvUV = aUV;\ngl_Position = vec4(aPosition, 0.0, 1.0);\n}", d = [
127
- "rgb(57, 182, 255)",
128
- "rgb(189, 69, 251)",
129
- "rgb(255, 87, 51)",
130
- "rgb(255, 214, 0)"
126
+ "rgb(57, 182, 255)",
127
+ "rgb(189, 69, 251)",
128
+ "rgb(255, 87, 51)",
129
+ "rgb(255, 214, 0)"
131
130
  ];
132
- function f(e) {
133
- let t = e.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
134
- if (!t) throw Error(`Invalid color format: ${e}`);
135
- let [, n, r, i] = t;
136
- return [
137
- parseInt(n) / 255,
138
- parseInt(r) / 255,
139
- parseInt(i) / 255
140
- ];
131
+ function f(e2) {
132
+ let t2 = e2.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
133
+ if (!t2) throw Error(`Invalid color format: ${e2}`);
134
+ let [, n2, r2, i2] = t2;
135
+ return [
136
+ parseInt(n2) / 255,
137
+ parseInt(r2) / 255,
138
+ parseInt(i2) / 255
139
+ ];
141
140
  }
142
141
  var p = class {
143
- constructor(e = {}) {
144
- r(this, "element", void 0), r(this, "canvas", void 0), r(this, "options", void 0), r(this, "running", !1), r(this, "disposed", !1), r(this, "startTime", 0), r(this, "lastTime", 0), r(this, "rafId", null), r(this, "glr", void 0), r(this, "observer", void 0), this.options = {
145
- width: e.width ?? 600,
146
- height: e.height ?? 600,
147
- ratio: e.ratio ?? window.devicePixelRatio ?? 1,
148
- borderWidth: e.borderWidth ?? 8,
149
- glowWidth: e.glowWidth ?? 200,
150
- borderRadius: e.borderRadius ?? 8,
151
- mode: e.mode ?? "light",
152
- ...e
153
- }, this.canvas = document.createElement("canvas"), this.options.classNames && (this.canvas.className = this.options.classNames), this.options.styles && Object.assign(this.canvas.style, this.options.styles), this.canvas.style.display = "block", this.canvas.style.transformOrigin = "center", this.canvas.style.pointerEvents = "none", this.element = this.canvas, this.setupGL(), this.options.skipGreeting || this.greet();
154
- }
155
- start() {
156
- if (this.disposed) throw Error("Motion instance has been disposed.");
157
- if (this.running) return;
158
- if (!this.glr) {
159
- console.error("WebGL resources are not initialized.");
160
- return;
161
- }
162
- this.running = !0, this.startTime = performance.now(), this.resize(this.options.width ?? 600, this.options.height ?? 600, this.options.ratio), this.glr.gl.viewport(0, 0, this.canvas.width, this.canvas.height), this.glr.gl.useProgram(this.glr.program), this.glr.gl.uniform2f(this.glr.uResolution, this.canvas.width, this.canvas.height), this.checkGLError(this.glr.gl, "start: after initial setup");
163
- let e = () => {
164
- if (!this.running || !this.glr) return;
165
- this.rafId = requestAnimationFrame(e);
166
- let t = performance.now();
167
- if (t - this.lastTime < 1e3 / 32) return;
168
- this.lastTime = t;
169
- let n = (t - this.startTime) * .001;
170
- this.render(n);
171
- };
172
- this.rafId = requestAnimationFrame(e);
173
- }
174
- pause() {
175
- if (this.disposed) throw Error("Motion instance has been disposed.");
176
- this.running = !1, this.rafId !== null && cancelAnimationFrame(this.rafId);
177
- }
178
- dispose() {
179
- if (this.disposed) return;
180
- this.disposed = !0, this.running = !1, this.rafId !== null && cancelAnimationFrame(this.rafId);
181
- let { gl: e, vao: t, positionBuffer: n, uvBuffer: r, program: i } = this.glr;
182
- t && e.deleteVertexArray(t), n && e.deleteBuffer(n), r && e.deleteBuffer(r), e.deleteProgram(i), this.observer && this.observer.disconnect(), this.canvas.remove();
183
- }
184
- resize(e, t, n) {
185
- if (this.disposed) throw Error("Motion instance has been disposed.");
186
- if (this.options.width = e, this.options.height = t, n && (this.options.ratio = n), !this.running) return;
187
- let { gl: r, program: i, vao: a, positionBuffer: s, uvBuffer: c, uResolution: l } = this.glr, u = n ?? this.options.ratio ?? window.devicePixelRatio ?? 1, d = Math.max(1, Math.floor(e * u)), f = Math.max(1, Math.floor(t * u));
188
- this.canvas.style.width = `${e}px`, this.canvas.style.height = `${t}px`, (this.canvas.width !== d || this.canvas.height !== f) && (this.canvas.width = d, this.canvas.height = f), r.viewport(0, 0, this.canvas.width, this.canvas.height), this.checkGLError(r, "resize: after viewport setup");
189
- let { positions: p, uvs: m } = o(this.canvas.width, this.canvas.height, this.options.borderWidth * u, this.options.glowWidth * u);
190
- r.bindVertexArray(a), r.bindBuffer(r.ARRAY_BUFFER, s), r.bufferData(r.ARRAY_BUFFER, p, r.STATIC_DRAW);
191
- let h = r.getAttribLocation(i, "aPosition");
192
- r.enableVertexAttribArray(h), r.vertexAttribPointer(h, 2, r.FLOAT, !1, 0, 0), this.checkGLError(r, "resize: after position buffer update"), r.bindBuffer(r.ARRAY_BUFFER, c), r.bufferData(r.ARRAY_BUFFER, m, r.STATIC_DRAW);
193
- let g = r.getAttribLocation(i, "aUV");
194
- r.enableVertexAttribArray(g), r.vertexAttribPointer(g, 2, r.FLOAT, !1, 0, 0), this.checkGLError(r, "resize: after UV buffer update"), r.useProgram(i), r.uniform2f(l, this.canvas.width, this.canvas.height), r.uniform1f(this.glr.uBorderWidth, this.options.borderWidth * u), r.uniform1f(this.glr.uGlowWidth, this.options.glowWidth * u), r.uniform1f(this.glr.uBorderRadius, this.options.borderRadius * u), this.checkGLError(r, "resize: after uniform updates");
195
- let _ = performance.now();
196
- this.lastTime = _;
197
- let v = (_ - this.startTime) * .001;
198
- this.render(v);
199
- }
200
- autoResize(e) {
201
- this.observer && this.observer.disconnect(), this.observer = new ResizeObserver(() => {
202
- let t = e.getBoundingClientRect();
203
- this.resize(t.width, t.height);
204
- }), this.observer.observe(e);
205
- }
206
- fadeIn() {
207
- if (this.disposed) throw Error("Motion instance has been disposed.");
208
- return new Promise((e, t) => {
209
- let n = this.canvas.animate([{
210
- opacity: 0,
211
- transform: "scale(1.2)"
212
- }, {
213
- opacity: 1,
214
- transform: "scale(1)"
215
- }], {
216
- duration: 300,
217
- easing: "ease-out",
218
- fill: "forwards"
219
- });
220
- n.onfinish = () => e(), n.oncancel = () => t("canceled");
221
- });
222
- }
223
- fadeOut() {
224
- if (this.disposed) throw Error("Motion instance has been disposed.");
225
- return new Promise((e, t) => {
226
- let n = this.canvas.animate([{
227
- opacity: 1,
228
- transform: "scale(1)"
229
- }, {
230
- opacity: 0,
231
- transform: "scale(1.2)"
232
- }], {
233
- duration: 300,
234
- easing: "ease-in",
235
- fill: "forwards"
236
- });
237
- n.onfinish = () => e(), n.oncancel = () => t("canceled");
238
- });
239
- }
240
- checkGLError(e, t) {
241
- let n = e.getError();
242
- if (n !== e.NO_ERROR) {
243
- for (console.group(`🔴 WebGL Error in ${t}`); n !== e.NO_ERROR;) {
244
- let t = this.getGLErrorName(e, n);
245
- console.error(`${t} (0x${n.toString(16)})`), n = e.getError();
246
- }
247
- console.groupEnd();
248
- }
249
- }
250
- getGLErrorName(e, t) {
251
- switch (t) {
252
- case e.INVALID_ENUM: return "INVALID_ENUM";
253
- case e.INVALID_VALUE: return "INVALID_VALUE";
254
- case e.INVALID_OPERATION: return "INVALID_OPERATION";
255
- case e.INVALID_FRAMEBUFFER_OPERATION: return "INVALID_FRAMEBUFFER_OPERATION";
256
- case e.OUT_OF_MEMORY: return "OUT_OF_MEMORY";
257
- case e.CONTEXT_LOST_WEBGL: return "CONTEXT_LOST_WEBGL";
258
- default: return "UNKNOWN_ERROR";
259
- }
142
+ constructor(e2 = {}) {
143
+ r(this, "element", void 0), r(this, "canvas", void 0), r(this, "options", void 0), r(this, "running", false), r(this, "disposed", false), r(this, "startTime", 0), r(this, "lastTime", 0), r(this, "rafId", null), r(this, "glr", void 0), r(this, "observer", void 0), this.options = {
144
+ width: e2.width ?? 600,
145
+ height: e2.height ?? 600,
146
+ ratio: e2.ratio ?? window.devicePixelRatio ?? 1,
147
+ borderWidth: e2.borderWidth ?? 8,
148
+ glowWidth: e2.glowWidth ?? 200,
149
+ borderRadius: e2.borderRadius ?? 8,
150
+ mode: e2.mode ?? "light",
151
+ ...e2
152
+ }, this.canvas = document.createElement("canvas"), this.options.classNames && (this.canvas.className = this.options.classNames), this.options.styles && Object.assign(this.canvas.style, this.options.styles), this.canvas.style.display = "block", this.canvas.style.transformOrigin = "center", this.canvas.style.pointerEvents = "none", this.element = this.canvas, this.setupGL(), this.options.skipGreeting || this.greet();
153
+ }
154
+ start() {
155
+ if (this.disposed) throw Error("Motion instance has been disposed.");
156
+ if (this.running) return;
157
+ if (!this.glr) {
158
+ console.error("WebGL resources are not initialized.");
159
+ return;
160
+ }
161
+ this.running = true, this.startTime = performance.now(), this.resize(this.options.width ?? 600, this.options.height ?? 600, this.options.ratio), this.glr.gl.viewport(0, 0, this.canvas.width, this.canvas.height), this.glr.gl.useProgram(this.glr.program), this.glr.gl.uniform2f(this.glr.uResolution, this.canvas.width, this.canvas.height), this.checkGLError(this.glr.gl, "start: after initial setup");
162
+ let e2 = () => {
163
+ if (!this.running || !this.glr) return;
164
+ this.rafId = requestAnimationFrame(e2);
165
+ let t2 = performance.now();
166
+ if (t2 - this.lastTime < 1e3 / 32) return;
167
+ this.lastTime = t2;
168
+ let n2 = (t2 - this.startTime) * 1e-3;
169
+ this.render(n2);
170
+ };
171
+ this.rafId = requestAnimationFrame(e2);
172
+ }
173
+ pause() {
174
+ if (this.disposed) throw Error("Motion instance has been disposed.");
175
+ this.running = false, this.rafId !== null && cancelAnimationFrame(this.rafId);
176
+ }
177
+ dispose() {
178
+ if (this.disposed) return;
179
+ this.disposed = true, this.running = false, this.rafId !== null && cancelAnimationFrame(this.rafId);
180
+ let { gl: e2, vao: t2, positionBuffer: n2, uvBuffer: r2, program: i2 } = this.glr;
181
+ t2 && e2.deleteVertexArray(t2), n2 && e2.deleteBuffer(n2), r2 && e2.deleteBuffer(r2), e2.deleteProgram(i2), this.observer && this.observer.disconnect(), this.canvas.remove();
182
+ }
183
+ resize(e2, t2, n2) {
184
+ if (this.disposed) throw Error("Motion instance has been disposed.");
185
+ if (this.options.width = e2, this.options.height = t2, n2 && (this.options.ratio = n2), !this.running) return;
186
+ let { gl: r2, program: i2, vao: a2, positionBuffer: s2, uvBuffer: c2, uResolution: l2 } = this.glr, u2 = n2 ?? this.options.ratio ?? window.devicePixelRatio ?? 1, d2 = Math.max(1, Math.floor(e2 * u2)), f2 = Math.max(1, Math.floor(t2 * u2));
187
+ this.canvas.style.width = `${e2}px`, this.canvas.style.height = `${t2}px`, (this.canvas.width !== d2 || this.canvas.height !== f2) && (this.canvas.width = d2, this.canvas.height = f2), r2.viewport(0, 0, this.canvas.width, this.canvas.height), this.checkGLError(r2, "resize: after viewport setup");
188
+ let { positions: p2, uvs: m2 } = o(this.canvas.width, this.canvas.height, this.options.borderWidth * u2, this.options.glowWidth * u2);
189
+ r2.bindVertexArray(a2), r2.bindBuffer(r2.ARRAY_BUFFER, s2), r2.bufferData(r2.ARRAY_BUFFER, p2, r2.STATIC_DRAW);
190
+ let h2 = r2.getAttribLocation(i2, "aPosition");
191
+ r2.enableVertexAttribArray(h2), r2.vertexAttribPointer(h2, 2, r2.FLOAT, false, 0, 0), this.checkGLError(r2, "resize: after position buffer update"), r2.bindBuffer(r2.ARRAY_BUFFER, c2), r2.bufferData(r2.ARRAY_BUFFER, m2, r2.STATIC_DRAW);
192
+ let g2 = r2.getAttribLocation(i2, "aUV");
193
+ r2.enableVertexAttribArray(g2), r2.vertexAttribPointer(g2, 2, r2.FLOAT, false, 0, 0), this.checkGLError(r2, "resize: after UV buffer update"), r2.useProgram(i2), r2.uniform2f(l2, this.canvas.width, this.canvas.height), r2.uniform1f(this.glr.uBorderWidth, this.options.borderWidth * u2), r2.uniform1f(this.glr.uGlowWidth, this.options.glowWidth * u2), r2.uniform1f(this.glr.uBorderRadius, this.options.borderRadius * u2), this.checkGLError(r2, "resize: after uniform updates");
194
+ let _2 = performance.now();
195
+ this.lastTime = _2;
196
+ let v2 = (_2 - this.startTime) * 1e-3;
197
+ this.render(v2);
198
+ }
199
+ autoResize(e2) {
200
+ this.observer && this.observer.disconnect(), this.observer = new ResizeObserver(() => {
201
+ let t2 = e2.getBoundingClientRect();
202
+ this.resize(t2.width, t2.height);
203
+ }), this.observer.observe(e2);
204
+ }
205
+ fadeIn() {
206
+ if (this.disposed) throw Error("Motion instance has been disposed.");
207
+ return new Promise((e2, t2) => {
208
+ let n2 = this.canvas.animate([{
209
+ opacity: 0,
210
+ transform: "scale(1.2)"
211
+ }, {
212
+ opacity: 1,
213
+ transform: "scale(1)"
214
+ }], {
215
+ duration: 300,
216
+ easing: "ease-out",
217
+ fill: "forwards"
218
+ });
219
+ n2.onfinish = () => e2(), n2.oncancel = () => t2("canceled");
220
+ });
221
+ }
222
+ fadeOut() {
223
+ if (this.disposed) throw Error("Motion instance has been disposed.");
224
+ return new Promise((e2, t2) => {
225
+ let n2 = this.canvas.animate([{
226
+ opacity: 1,
227
+ transform: "scale(1)"
228
+ }, {
229
+ opacity: 0,
230
+ transform: "scale(1.2)"
231
+ }], {
232
+ duration: 300,
233
+ easing: "ease-in",
234
+ fill: "forwards"
235
+ });
236
+ n2.onfinish = () => e2(), n2.oncancel = () => t2("canceled");
237
+ });
238
+ }
239
+ checkGLError(e2, t2) {
240
+ let n2 = e2.getError();
241
+ if (n2 !== e2.NO_ERROR) {
242
+ for (console.group(`\u{1F534} WebGL Error in ${t2}`); n2 !== e2.NO_ERROR; ) {
243
+ let t3 = this.getGLErrorName(e2, n2);
244
+ console.error(`${t3} (0x${n2.toString(16)})`), n2 = e2.getError();
245
+ }
246
+ console.groupEnd();
247
+ }
248
+ }
249
+ getGLErrorName(e2, t2) {
250
+ switch (t2) {
251
+ case e2.INVALID_ENUM:
252
+ return "INVALID_ENUM";
253
+ case e2.INVALID_VALUE:
254
+ return "INVALID_VALUE";
255
+ case e2.INVALID_OPERATION:
256
+ return "INVALID_OPERATION";
257
+ case e2.INVALID_FRAMEBUFFER_OPERATION:
258
+ return "INVALID_FRAMEBUFFER_OPERATION";
259
+ case e2.OUT_OF_MEMORY:
260
+ return "OUT_OF_MEMORY";
261
+ case e2.CONTEXT_LOST_WEBGL:
262
+ return "CONTEXT_LOST_WEBGL";
263
+ default:
264
+ return "UNKNOWN_ERROR";
265
+ }
266
+ }
267
+ setupGL() {
268
+ let e2 = this.canvas.getContext("webgl2", {
269
+ antialias: false,
270
+ alpha: true
271
+ });
272
+ if (!e2) throw Error("WebGL2 is required but not available.");
273
+ let t2 = c(e2, u, l);
274
+ this.checkGLError(e2, "setupGL: after createProgram");
275
+ let n2 = e2.createVertexArray();
276
+ e2.bindVertexArray(n2), this.checkGLError(e2, "setupGL: after VAO creation");
277
+ let { positions: r2, uvs: i2 } = o(this.canvas.width || 2, this.canvas.height || 2, this.options.borderWidth, this.options.glowWidth), a2 = e2.createBuffer();
278
+ e2.bindBuffer(e2.ARRAY_BUFFER, a2), e2.bufferData(e2.ARRAY_BUFFER, r2, e2.STATIC_DRAW);
279
+ let s2 = e2.getAttribLocation(t2, "aPosition");
280
+ e2.enableVertexAttribArray(s2), e2.vertexAttribPointer(s2, 2, e2.FLOAT, false, 0, 0), this.checkGLError(e2, "setupGL: after position buffer setup");
281
+ let p2 = e2.createBuffer();
282
+ e2.bindBuffer(e2.ARRAY_BUFFER, p2), e2.bufferData(e2.ARRAY_BUFFER, i2, e2.STATIC_DRAW);
283
+ let m2 = e2.getAttribLocation(t2, "aUV");
284
+ e2.enableVertexAttribArray(m2), e2.vertexAttribPointer(m2, 2, e2.FLOAT, false, 0, 0), this.checkGLError(e2, "setupGL: after UV buffer setup");
285
+ let h2 = e2.getUniformLocation(t2, "uResolution"), g2 = e2.getUniformLocation(t2, "uTime"), _2 = e2.getUniformLocation(t2, "uBorderWidth"), v2 = e2.getUniformLocation(t2, "uGlowWidth"), y2 = e2.getUniformLocation(t2, "uBorderRadius"), b2 = e2.getUniformLocation(t2, "uColors"), x2 = e2.getUniformLocation(t2, "uGlowExponent"), S2 = e2.getUniformLocation(t2, "uGlowFactor");
286
+ e2.useProgram(t2), e2.uniform1f(_2, this.options.borderWidth), e2.uniform1f(v2, this.options.glowWidth), e2.uniform1f(y2, this.options.borderRadius), this.options.mode === "dark" ? (e2.uniform1f(x2, 2), e2.uniform1f(S2, 1.8)) : (e2.uniform1f(x2, 1), e2.uniform1f(S2, 1));
287
+ let C2 = (this.options.colors || d).map(f);
288
+ for (let n3 = 0; n3 < C2.length; n3++) e2.uniform3f(e2.getUniformLocation(t2, `uColors[${n3}]`), ...C2[n3]);
289
+ this.checkGLError(e2, "setupGL: after uniform setup"), e2.bindVertexArray(null), e2.bindBuffer(e2.ARRAY_BUFFER, null), this.glr = {
290
+ gl: e2,
291
+ program: t2,
292
+ vao: n2,
293
+ positionBuffer: a2,
294
+ uvBuffer: p2,
295
+ uResolution: h2,
296
+ uTime: g2,
297
+ uBorderWidth: _2,
298
+ uGlowWidth: v2,
299
+ uBorderRadius: y2,
300
+ uColors: b2
301
+ };
302
+ }
303
+ render(e2) {
304
+ if (!this.glr) return;
305
+ let { gl: t2, program: n2, vao: r2, uTime: i2 } = this.glr;
306
+ t2.useProgram(n2), t2.bindVertexArray(r2), t2.uniform1f(i2, e2), t2.disable(t2.DEPTH_TEST), t2.disable(t2.CULL_FACE), t2.disable(t2.BLEND), t2.clearColor(0, 0, 0, 0), t2.clear(t2.COLOR_BUFFER_BIT), t2.drawArrays(t2.TRIANGLES, 0, 24), this.checkGLError(t2, "render: after draw call"), t2.bindVertexArray(null);
307
+ }
308
+ greet() {
309
+ console.log("%c\u{1F308} ai-motion 0.4.8 \u{1F308}", "background: linear-gradient(90deg, #39b6ff, #bd45fb, #ff5733, #ffd600); color: white; text-shadow: 0 0 2px rgba(0, 0, 0, 0.2); font-weight: bold; font-size: 1em; padding: 2px 12px; border-radius: 6px;");
310
+ }
311
+ }, m, h, g, _, v, y, b;
312
+ (function() {
313
+ try {
314
+ if (typeof document < "u") {
315
+ var e2 = document.createElement("style");
316
+ e2.appendChild(document.createTextNode(`._wrapper_1ooyb_1 {
317
+ position: fixed;
318
+ inset: 0;
319
+ z-index: 2147483641; /* \u786E\u4FDD\u5728\u6240\u6709\u5143\u7D20\u4E4B\u4E0A\uFF0C\u9664\u4E86 panel */
320
+ cursor: wait;
321
+ overflow: hidden;
322
+
323
+ display: none;
324
+ }
325
+
326
+ ._wrapper_1ooyb_1._visible_1ooyb_11 {
327
+ display: block;
328
+ }
329
+ /* AI \u5149\u6807\u6837\u5F0F */
330
+ ._cursor_1dgwb_2 {
331
+ position: absolute;
332
+ width: var(--cursor-size, 75px);
333
+ height: var(--cursor-size, 75px);
334
+ pointer-events: none;
335
+ z-index: 10000;
336
+ }
337
+
338
+ ._cursorBorder_1dgwb_10 {
339
+ position: absolute;
340
+ width: 100%;
341
+ height: 100%;
342
+ background: linear-gradient(45deg, rgb(57, 182, 255), rgb(189, 69, 251));
343
+ mask-image: url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20100%20100'%20fill='none'%3e%3cg%3e%3cpath%20d='M%2015%2042%20L%2015%2036.99%20Q%2015%2031.99%2023.7%2031.99%20L%2028.05%2031.99%20Q%2032.41%2031.99%2032.41%2021.99%20L%2032.41%2017%20Q%2032.41%2012%2041.09%2016.95%20L%2076.31%2037.05%20Q%2085%2042%2076.31%2046.95%20L%2041.09%2067.05%20Q%2032.41%2072%2032.41%2062.01%20L%2032.41%2057.01%20Q%2032.41%2052.01%2023.7%2052.01%20L%2019.35%2052.01%20Q%2015%2052.01%2015%2047.01%20Z'%20fill='none'%20stroke='%23000000'%20stroke-width='6'%20stroke-miterlimit='10'%20style='stroke:%20light-dark(rgb(0,%200,%200),%20rgb(255,%20255,%20255));'/%3e%3c/g%3e%3c/svg%3e");
344
+ mask-size: 100% 100%;
345
+ mask-repeat: no-repeat;
346
+
347
+ transform-origin: center;
348
+ transform: rotate(-135deg) scale(1.2);
349
+ margin-left: -10px;
350
+ margin-top: -18px;
351
+ }
352
+
353
+ ._cursorFilling_1dgwb_25 {
354
+ position: absolute;
355
+ width: 100%;
356
+ height: 100%;
357
+ background: url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20100%20100'%3e%3cdefs%3e%3c/defs%3e%3cg%20xmlns='http://www.w3.org/2000/svg'%20style='filter:%20drop-shadow(light-dark(rgba(0,%200,%200,%200.4),%20rgba(237,%20237,%20237,%200.4))%203px%204px%204px);'%3e%3cpath%20d='M%2015%2042%20L%2015%2036.99%20Q%2015%2031.99%2023.7%2031.99%20L%2028.05%2031.99%20Q%2032.41%2031.99%2032.41%2021.99%20L%2032.41%2017%20Q%2032.41%2012%2041.09%2016.95%20L%2076.31%2037.05%20Q%2085%2042%2076.31%2046.95%20L%2041.09%2067.05%20Q%2032.41%2072%2032.41%2062.01%20L%2032.41%2057.01%20Q%2032.41%2052.01%2023.7%2052.01%20L%2019.35%2052.01%20Q%2015%2052.01%2015%2047.01%20Z'%20fill='%23ffffff'%20stroke='none'%20style='fill:%20%23ffffff;'/%3e%3c/g%3e%3c/svg%3e");
358
+ background-size: 100% 100%;
359
+ background-repeat: no-repeat;
360
+
361
+ transform-origin: center;
362
+ transform: rotate(-135deg) scale(1.2);
363
+ margin-left: -10px;
364
+ margin-top: -18px;
365
+ }
366
+
367
+ ._cursorRipple_1dgwb_39 {
368
+ position: absolute;
369
+ width: 100%;
370
+ height: 100%;
371
+ pointer-events: none;
372
+ margin-left: -50%;
373
+ margin-top: -50%;
374
+
375
+ &::after {
376
+ content: '';
377
+ opacity: 0;
378
+ position: absolute;
379
+ inset: 0;
380
+ border: 4px solid rgba(57, 182, 255, 1);
381
+ border-radius: 50%;
260
382
  }
261
- setupGL() {
262
- let e = this.canvas.getContext("webgl2", {
263
- antialias: !1,
264
- alpha: !0
265
- });
266
- if (!e) throw Error("WebGL2 is required but not available.");
267
- let t = c(e, u, l);
268
- this.checkGLError(e, "setupGL: after createProgram");
269
- let n = e.createVertexArray();
270
- e.bindVertexArray(n), this.checkGLError(e, "setupGL: after VAO creation");
271
- let { positions: r, uvs: i } = o(this.canvas.width || 2, this.canvas.height || 2, this.options.borderWidth, this.options.glowWidth), a = e.createBuffer();
272
- e.bindBuffer(e.ARRAY_BUFFER, a), e.bufferData(e.ARRAY_BUFFER, r, e.STATIC_DRAW);
273
- let s = e.getAttribLocation(t, "aPosition");
274
- e.enableVertexAttribArray(s), e.vertexAttribPointer(s, 2, e.FLOAT, !1, 0, 0), this.checkGLError(e, "setupGL: after position buffer setup");
275
- let p = e.createBuffer();
276
- e.bindBuffer(e.ARRAY_BUFFER, p), e.bufferData(e.ARRAY_BUFFER, i, e.STATIC_DRAW);
277
- let m = e.getAttribLocation(t, "aUV");
278
- e.enableVertexAttribArray(m), e.vertexAttribPointer(m, 2, e.FLOAT, !1, 0, 0), this.checkGLError(e, "setupGL: after UV buffer setup");
279
- let h = e.getUniformLocation(t, "uResolution"), g = e.getUniformLocation(t, "uTime"), _ = e.getUniformLocation(t, "uBorderWidth"), v = e.getUniformLocation(t, "uGlowWidth"), y = e.getUniformLocation(t, "uBorderRadius"), b = e.getUniformLocation(t, "uColors"), x = e.getUniformLocation(t, "uGlowExponent"), S = e.getUniformLocation(t, "uGlowFactor");
280
- e.useProgram(t), e.uniform1f(_, this.options.borderWidth), e.uniform1f(v, this.options.glowWidth), e.uniform1f(y, this.options.borderRadius), this.options.mode === "dark" ? (e.uniform1f(x, 2), e.uniform1f(S, 1.8)) : (e.uniform1f(x, 1), e.uniform1f(S, 1));
281
- let C = (this.options.colors || d).map(f);
282
- for (let n = 0; n < C.length; n++) e.uniform3f(e.getUniformLocation(t, `uColors[${n}]`), ...C[n]);
283
- this.checkGLError(e, "setupGL: after uniform setup"), e.bindVertexArray(null), e.bindBuffer(e.ARRAY_BUFFER, null), this.glr = {
284
- gl: e,
285
- program: t,
286
- vao: n,
287
- positionBuffer: a,
288
- uvBuffer: p,
289
- uResolution: h,
290
- uTime: g,
291
- uBorderWidth: _,
292
- uGlowWidth: v,
293
- uBorderRadius: y,
294
- uColors: b
295
- };
383
+ }
384
+
385
+ ._cursor_1dgwb_2._clicking_1dgwb_57 ._cursorRipple_1dgwb_39::after {
386
+ animation: _cursor-ripple_1dgwb_1 300ms ease-out forwards;
387
+ }
388
+
389
+ @keyframes _cursor-ripple_1dgwb_1 {
390
+ 0% {
391
+ transform: scale(0);
392
+ opacity: 1;
296
393
  }
297
- render(e) {
298
- if (!this.glr) return;
299
- let { gl: t, program: n, vao: r, uTime: i } = this.glr;
300
- t.useProgram(n), t.bindVertexArray(r), t.uniform1f(i, e), t.disable(t.DEPTH_TEST), t.disable(t.CULL_FACE), t.disable(t.BLEND), t.clearColor(0, 0, 0, 0), t.clear(t.COLOR_BUFFER_BIT), t.drawArrays(t.TRIANGLES, 0, 24), this.checkGLError(t, "render: after draw call"), t.bindVertexArray(null);
394
+ 100% {
395
+ transform: scale(2);
396
+ opacity: 0;
301
397
  }
302
- greet() {
303
- console.log("%c🌈 ai-motion 0.4.8 🌈", "background: linear-gradient(90deg, #39b6ff, #bd45fb, #ff5733, #ffd600); color: white; text-shadow: 0 0 2px rgba(0, 0, 0, 0.2); font-weight: bold; font-size: 1em; padding: 2px 12px; border-radius: 6px;");
398
+ }`)), document.head.appendChild(e2);
399
+ }
400
+ } catch (e3) {
401
+ console.error("vite-plugin-css-injected-by-js", e3);
402
+ }
403
+ })(), function() {
404
+ try {
405
+ if (typeof document < "u") {
406
+ var e2 = document.createElement("style");
407
+ e2.appendChild(document.createTextNode(`._wrapper_1ooyb_1 {
408
+ position: fixed;
409
+ inset: 0;
410
+ z-index: 2147483641; /* \u786E\u4FDD\u5728\u6240\u6709\u5143\u7D20\u4E4B\u4E0A\uFF0C\u9664\u4E86 panel */
411
+ cursor: wait;
412
+ overflow: hidden;
413
+
414
+ display: none;
415
+ }
416
+
417
+ ._wrapper_1ooyb_1._visible_1ooyb_11 {
418
+ display: block;
419
+ }
420
+ /* AI \u5149\u6807\u6837\u5F0F */
421
+ ._cursor_1dgwb_2 {
422
+ position: absolute;
423
+ width: var(--cursor-size, 75px);
424
+ height: var(--cursor-size, 75px);
425
+ pointer-events: none;
426
+ z-index: 10000;
427
+ }
428
+
429
+ ._cursorBorder_1dgwb_10 {
430
+ position: absolute;
431
+ width: 100%;
432
+ height: 100%;
433
+ background: linear-gradient(45deg, rgb(57, 182, 255), rgb(189, 69, 251));
434
+ mask-image: url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20100%20100'%20fill='none'%3e%3cg%3e%3cpath%20d='M%2015%2042%20L%2015%2036.99%20Q%2015%2031.99%2023.7%2031.99%20L%2028.05%2031.99%20Q%2032.41%2031.99%2032.41%2021.99%20L%2032.41%2017%20Q%2032.41%2012%2041.09%2016.95%20L%2076.31%2037.05%20Q%2085%2042%2076.31%2046.95%20L%2041.09%2067.05%20Q%2032.41%2072%2032.41%2062.01%20L%2032.41%2057.01%20Q%2032.41%2052.01%2023.7%2052.01%20L%2019.35%2052.01%20Q%2015%2052.01%2015%2047.01%20Z'%20fill='none'%20stroke='%23000000'%20stroke-width='6'%20stroke-miterlimit='10'%20style='stroke:%20light-dark(rgb(0,%200,%200),%20rgb(255,%20255,%20255));'/%3e%3c/g%3e%3c/svg%3e");
435
+ mask-size: 100% 100%;
436
+ mask-repeat: no-repeat;
437
+
438
+ transform-origin: center;
439
+ transform: rotate(-135deg) scale(1.2);
440
+ margin-left: -10px;
441
+ margin-top: -18px;
442
+ }
443
+
444
+ ._cursorFilling_1dgwb_25 {
445
+ position: absolute;
446
+ width: 100%;
447
+ height: 100%;
448
+ background: url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20100%20100'%3e%3cdefs%3e%3c/defs%3e%3cg%20xmlns='http://www.w3.org/2000/svg'%20style='filter:%20drop-shadow(light-dark(rgba(0,%200,%200,%200.4),%20rgba(237,%20237,%20237,%200.4))%203px%204px%204px);'%3e%3cpath%20d='M%2015%2042%20L%2015%2036.99%20Q%2015%2031.99%2023.7%2031.99%20L%2028.05%2031.99%20Q%2032.41%2031.99%2032.41%2021.99%20L%2032.41%2017%20Q%2032.41%2012%2041.09%2016.95%20L%2076.31%2037.05%20Q%2085%2042%2076.31%2046.95%20L%2041.09%2067.05%20Q%2032.41%2072%2032.41%2062.01%20L%2032.41%2057.01%20Q%2032.41%2052.01%2023.7%2052.01%20L%2019.35%2052.01%20Q%2015%2052.01%2015%2047.01%20Z'%20fill='%23ffffff'%20stroke='none'%20style='fill:%20%23ffffff;'/%3e%3c/g%3e%3c/svg%3e");
449
+ background-size: 100% 100%;
450
+ background-repeat: no-repeat;
451
+
452
+ transform-origin: center;
453
+ transform: rotate(-135deg) scale(1.2);
454
+ margin-left: -10px;
455
+ margin-top: -18px;
456
+ }
457
+
458
+ ._cursorRipple_1dgwb_39 {
459
+ position: absolute;
460
+ width: 100%;
461
+ height: 100%;
462
+ pointer-events: none;
463
+ margin-left: -50%;
464
+ margin-top: -50%;
465
+
466
+ &::after {
467
+ content: '';
468
+ opacity: 0;
469
+ position: absolute;
470
+ inset: 0;
471
+ border: 4px solid rgba(57, 182, 255, 1);
472
+ border-radius: 50%;
304
473
  }
305
- }, m, h, g, _, v, y, b;
306
- (function() {
307
- try {
308
- if (typeof document < "u") {
309
- var e = document.createElement("style");
310
- e.appendChild(document.createTextNode("._wrapper_1ooyb_1 {\n position: fixed;\n inset: 0;\n z-index: 2147483641; /* 确保在所有元素之上,除了 panel */\n cursor: wait;\n overflow: hidden;\n\n display: none;\n}\n\n._wrapper_1ooyb_1._visible_1ooyb_11 {\n display: block;\n}\n/* AI 光标样式 */\n._cursor_1dgwb_2 {\n position: absolute;\n width: var(--cursor-size, 75px);\n height: var(--cursor-size, 75px);\n pointer-events: none;\n z-index: 10000;\n}\n\n._cursorBorder_1dgwb_10 {\n position: absolute;\n width: 100%;\n height: 100%;\n background: linear-gradient(45deg, rgb(57, 182, 255), rgb(189, 69, 251));\n mask-image: url(\"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20100%20100'%20fill='none'%3e%3cg%3e%3cpath%20d='M%2015%2042%20L%2015%2036.99%20Q%2015%2031.99%2023.7%2031.99%20L%2028.05%2031.99%20Q%2032.41%2031.99%2032.41%2021.99%20L%2032.41%2017%20Q%2032.41%2012%2041.09%2016.95%20L%2076.31%2037.05%20Q%2085%2042%2076.31%2046.95%20L%2041.09%2067.05%20Q%2032.41%2072%2032.41%2062.01%20L%2032.41%2057.01%20Q%2032.41%2052.01%2023.7%2052.01%20L%2019.35%2052.01%20Q%2015%2052.01%2015%2047.01%20Z'%20fill='none'%20stroke='%23000000'%20stroke-width='6'%20stroke-miterlimit='10'%20style='stroke:%20light-dark(rgb(0,%200,%200),%20rgb(255,%20255,%20255));'/%3e%3c/g%3e%3c/svg%3e\");\n mask-size: 100% 100%;\n mask-repeat: no-repeat;\n\n transform-origin: center;\n transform: rotate(-135deg) scale(1.2);\n margin-left: -10px;\n margin-top: -18px;\n}\n\n._cursorFilling_1dgwb_25 {\n position: absolute;\n width: 100%;\n height: 100%;\n background: url(\"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20100%20100'%3e%3cdefs%3e%3c/defs%3e%3cg%20xmlns='http://www.w3.org/2000/svg'%20style='filter:%20drop-shadow(light-dark(rgba(0,%200,%200,%200.4),%20rgba(237,%20237,%20237,%200.4))%203px%204px%204px);'%3e%3cpath%20d='M%2015%2042%20L%2015%2036.99%20Q%2015%2031.99%2023.7%2031.99%20L%2028.05%2031.99%20Q%2032.41%2031.99%2032.41%2021.99%20L%2032.41%2017%20Q%2032.41%2012%2041.09%2016.95%20L%2076.31%2037.05%20Q%2085%2042%2076.31%2046.95%20L%2041.09%2067.05%20Q%2032.41%2072%2032.41%2062.01%20L%2032.41%2057.01%20Q%2032.41%2052.01%2023.7%2052.01%20L%2019.35%2052.01%20Q%2015%2052.01%2015%2047.01%20Z'%20fill='%23ffffff'%20stroke='none'%20style='fill:%20%23ffffff;'/%3e%3c/g%3e%3c/svg%3e\");\n background-size: 100% 100%;\n background-repeat: no-repeat;\n\n transform-origin: center;\n transform: rotate(-135deg) scale(1.2);\n margin-left: -10px;\n margin-top: -18px;\n}\n\n._cursorRipple_1dgwb_39 {\n position: absolute;\n width: 100%;\n height: 100%;\n pointer-events: none;\n margin-left: -50%;\n margin-top: -50%;\n\n &::after {\n content: '';\n opacity: 0;\n position: absolute;\n inset: 0;\n border: 4px solid rgba(57, 182, 255, 1);\n border-radius: 50%;\n }\n}\n\n._cursor_1dgwb_2._clicking_1dgwb_57 ._cursorRipple_1dgwb_39::after {\n animation: _cursor-ripple_1dgwb_1 300ms ease-out forwards;\n}\n\n@keyframes _cursor-ripple_1dgwb_1 {\n 0% {\n transform: scale(0);\n opacity: 1;\n }\n 100% {\n transform: scale(2);\n opacity: 0;\n }\n}")), document.head.appendChild(e);
311
- }
312
- } catch (e) {
313
- console.error("vite-plugin-css-injected-by-js", e);
474
+ }
475
+
476
+ ._cursor_1dgwb_2._clicking_1dgwb_57 ._cursorRipple_1dgwb_39::after {
477
+ animation: _cursor-ripple_1dgwb_1 300ms ease-out forwards;
478
+ }
479
+
480
+ @keyframes _cursor-ripple_1dgwb_1 {
481
+ 0% {
482
+ transform: scale(0);
483
+ opacity: 1;
314
484
  }
315
- })(), (function() {
316
- try {
317
- if (typeof document < "u") {
318
- var e = document.createElement("style");
319
- e.appendChild(document.createTextNode("._wrapper_1ooyb_1 {\n position: fixed;\n inset: 0;\n z-index: 2147483641; /* 确保在所有元素之上,除了 panel */\n cursor: wait;\n overflow: hidden;\n\n display: none;\n}\n\n._wrapper_1ooyb_1._visible_1ooyb_11 {\n display: block;\n}\n/* AI 光标样式 */\n._cursor_1dgwb_2 {\n position: absolute;\n width: var(--cursor-size, 75px);\n height: var(--cursor-size, 75px);\n pointer-events: none;\n z-index: 10000;\n}\n\n._cursorBorder_1dgwb_10 {\n position: absolute;\n width: 100%;\n height: 100%;\n background: linear-gradient(45deg, rgb(57, 182, 255), rgb(189, 69, 251));\n mask-image: url(\"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20100%20100'%20fill='none'%3e%3cg%3e%3cpath%20d='M%2015%2042%20L%2015%2036.99%20Q%2015%2031.99%2023.7%2031.99%20L%2028.05%2031.99%20Q%2032.41%2031.99%2032.41%2021.99%20L%2032.41%2017%20Q%2032.41%2012%2041.09%2016.95%20L%2076.31%2037.05%20Q%2085%2042%2076.31%2046.95%20L%2041.09%2067.05%20Q%2032.41%2072%2032.41%2062.01%20L%2032.41%2057.01%20Q%2032.41%2052.01%2023.7%2052.01%20L%2019.35%2052.01%20Q%2015%2052.01%2015%2047.01%20Z'%20fill='none'%20stroke='%23000000'%20stroke-width='6'%20stroke-miterlimit='10'%20style='stroke:%20light-dark(rgb(0,%200,%200),%20rgb(255,%20255,%20255));'/%3e%3c/g%3e%3c/svg%3e\");\n mask-size: 100% 100%;\n mask-repeat: no-repeat;\n\n transform-origin: center;\n transform: rotate(-135deg) scale(1.2);\n margin-left: -10px;\n margin-top: -18px;\n}\n\n._cursorFilling_1dgwb_25 {\n position: absolute;\n width: 100%;\n height: 100%;\n background: url(\"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20100%20100'%3e%3cdefs%3e%3c/defs%3e%3cg%20xmlns='http://www.w3.org/2000/svg'%20style='filter:%20drop-shadow(light-dark(rgba(0,%200,%200,%200.4),%20rgba(237,%20237,%20237,%200.4))%203px%204px%204px);'%3e%3cpath%20d='M%2015%2042%20L%2015%2036.99%20Q%2015%2031.99%2023.7%2031.99%20L%2028.05%2031.99%20Q%2032.41%2031.99%2032.41%2021.99%20L%2032.41%2017%20Q%2032.41%2012%2041.09%2016.95%20L%2076.31%2037.05%20Q%2085%2042%2076.31%2046.95%20L%2041.09%2067.05%20Q%2032.41%2072%2032.41%2062.01%20L%2032.41%2057.01%20Q%2032.41%2052.01%2023.7%2052.01%20L%2019.35%2052.01%20Q%2015%2052.01%2015%2047.01%20Z'%20fill='%23ffffff'%20stroke='none'%20style='fill:%20%23ffffff;'/%3e%3c/g%3e%3c/svg%3e\");\n background-size: 100% 100%;\n background-repeat: no-repeat;\n\n transform-origin: center;\n transform: rotate(-135deg) scale(1.2);\n margin-left: -10px;\n margin-top: -18px;\n}\n\n._cursorRipple_1dgwb_39 {\n position: absolute;\n width: 100%;\n height: 100%;\n pointer-events: none;\n margin-left: -50%;\n margin-top: -50%;\n\n &::after {\n content: '';\n opacity: 0;\n position: absolute;\n inset: 0;\n border: 4px solid rgba(57, 182, 255, 1);\n border-radius: 50%;\n }\n}\n\n._cursor_1dgwb_2._clicking_1dgwb_57 ._cursorRipple_1dgwb_39::after {\n animation: _cursor-ripple_1dgwb_1 300ms ease-out forwards;\n}\n\n@keyframes _cursor-ripple_1dgwb_1 {\n 0% {\n transform: scale(0);\n opacity: 1;\n }\n 100% {\n transform: scale(2);\n opacity: 0;\n }\n}")), document.head.appendChild(e);
320
- }
321
- } catch (e) {
322
- console.error("vite-plugin-css-injected-by-js", e);
485
+ 100% {
486
+ transform: scale(2);
487
+ opacity: 0;
323
488
  }
324
- })();
489
+ }`)), document.head.appendChild(e2);
490
+ }
491
+ } catch (e3) {
492
+ console.error("vite-plugin-css-injected-by-js", e3);
493
+ }
494
+ }();
325
495
  function x() {
326
- try {
327
- return !!(S() || C() || w() || T() || D() || E());
328
- } catch (e) {
329
- return console.warn("Error determining if page is dark:", e), !1;
330
- }
496
+ try {
497
+ return !!(S() || C() || w() || T() || D() || E());
498
+ } catch (e2) {
499
+ return console.warn("Error determining if page is dark:", e2), false;
500
+ }
331
501
  }
332
502
  function S() {
333
- let e = [
334
- "dark",
335
- "dark-mode",
336
- "theme-dark",
337
- "night",
338
- "night-mode"
339
- ], t = document.documentElement, n = document.body || document.documentElement;
340
- for (let r of e) if (t.classList.contains(r) || n?.classList.contains(r)) return !0;
341
- return !1;
503
+ let e2 = [
504
+ "dark",
505
+ "dark-mode",
506
+ "theme-dark",
507
+ "night",
508
+ "night-mode"
509
+ ], t2 = document.documentElement, n2 = document.body || document.documentElement;
510
+ for (let r2 of e2) if (t2.classList.contains(r2) || n2?.classList.contains(r2)) return true;
511
+ return false;
342
512
  }
343
513
  function C() {
344
- let e = document.documentElement, t = document.body || document.documentElement;
345
- for (let n of [
346
- "data-theme",
347
- "data-color-mode",
348
- "data-bs-theme",
349
- "data-mui-color-scheme"
350
- ]) {
351
- let r = t?.getAttribute(n), i = e.getAttribute(n);
352
- if (r?.toLowerCase() === "dark" || i?.toLowerCase() === "dark") return !0;
353
- }
354
- return !1;
514
+ let e2 = document.documentElement, t2 = document.body || document.documentElement;
515
+ for (let n2 of [
516
+ "data-theme",
517
+ "data-color-mode",
518
+ "data-bs-theme",
519
+ "data-mui-color-scheme"
520
+ ]) {
521
+ let r2 = t2?.getAttribute(n2), i2 = e2.getAttribute(n2);
522
+ if (r2?.toLowerCase() === "dark" || i2?.toLowerCase() === "dark") return true;
523
+ }
524
+ return false;
355
525
  }
356
526
  function w() {
357
- let e = document.querySelector("meta[name=\"color-scheme\"]")?.content.toLowerCase();
358
- if (e === "dark" || e === "only dark") return !0;
359
- let t = window.getComputedStyle(document.documentElement).getPropertyValue("color-scheme").trim().toLowerCase();
360
- return t === "dark" || t === "only dark";
527
+ let e2 = document.querySelector('meta[name="color-scheme"]')?.content.toLowerCase();
528
+ if (e2 === "dark" || e2 === "only dark") return true;
529
+ let t2 = window.getComputedStyle(document.documentElement).getPropertyValue("color-scheme").trim().toLowerCase();
530
+ return t2 === "dark" || t2 === "only dark";
361
531
  }
362
532
  function T() {
363
- let e = window.getComputedStyle(document.documentElement), t = window.getComputedStyle(document.body || document.documentElement), n = e.backgroundColor, r = t.backgroundColor;
364
- return A(r) ? !0 : r === "transparent" || r.startsWith("rgba(0, 0, 0, 0)") ? A(n) : !1;
533
+ let e2 = window.getComputedStyle(document.documentElement), t2 = window.getComputedStyle(document.body || document.documentElement), n2 = e2.backgroundColor, r2 = t2.backgroundColor;
534
+ return A(r2) ? true : r2 === "transparent" || r2.startsWith("rgba(0, 0, 0, 0)") ? A(n2) : false;
365
535
  }
366
536
  function E() {
367
- let e = k(window.getComputedStyle(document.body || document.documentElement).color);
368
- return e !== null && e > 200;
537
+ let e2 = k(window.getComputedStyle(document.body || document.documentElement).color);
538
+ return e2 !== null && e2 > 200;
369
539
  }
370
540
  function D() {
371
- let { innerWidth: e, innerHeight: t } = window, n = e * t * .5;
372
- for (let e of [
373
- "#app",
374
- "#root",
375
- "#__next"
376
- ]) {
377
- let t = document.querySelector(e);
378
- if (!t) continue;
379
- let r = t.getBoundingClientRect();
380
- if (!(r.width * r.height < n) && A(window.getComputedStyle(t).backgroundColor)) return !0;
381
- }
382
- return !1;
541
+ let { innerWidth: e2, innerHeight: t2 } = window, n2 = e2 * t2 * 0.5;
542
+ for (let e3 of [
543
+ "#app",
544
+ "#root",
545
+ "#__next"
546
+ ]) {
547
+ let t3 = document.querySelector(e3);
548
+ if (!t3) continue;
549
+ let r2 = t3.getBoundingClientRect();
550
+ if (!(r2.width * r2.height < n2) && A(window.getComputedStyle(t3).backgroundColor)) return true;
551
+ }
552
+ return false;
383
553
  }
384
- function O(e) {
385
- let t = /rgba?\((\d+),\s*(\d+),\s*(\d+)/.exec(e);
386
- return t ? {
387
- r: parseInt(t[1]),
388
- g: parseInt(t[2]),
389
- b: parseInt(t[3])
390
- } : null;
554
+ function O(e2) {
555
+ let t2 = /rgba?\((\d+),\s*(\d+),\s*(\d+)/.exec(e2);
556
+ return t2 ? {
557
+ r: parseInt(t2[1]),
558
+ g: parseInt(t2[2]),
559
+ b: parseInt(t2[3])
560
+ } : null;
391
561
  }
392
- function k(e) {
393
- if (!e || e === "transparent" || e.startsWith("rgba(0, 0, 0, 0)")) return null;
394
- let t = O(e);
395
- return t ? .299 * t.r + .587 * t.g + .114 * t.b : null;
562
+ function k(e2) {
563
+ if (!e2 || e2 === "transparent" || e2.startsWith("rgba(0, 0, 0, 0)")) return null;
564
+ let t2 = O(e2);
565
+ return t2 ? 0.299 * t2.r + 0.587 * t2.g + 0.114 * t2.b : null;
396
566
  }
397
- function A(e, t = 128) {
398
- let n = k(e);
399
- return n !== null && n < t;
567
+ function A(e2, t2 = 128) {
568
+ let n2 = k(e2);
569
+ return n2 !== null && n2 < t2;
400
570
  }
401
571
  var j = {
402
- wrapper: "_wrapper_1ooyb_1",
403
- visible: "_visible_1ooyb_11"
572
+ wrapper: "_wrapper_1ooyb_1",
573
+ visible: "_visible_1ooyb_11"
404
574
  }, M = {
405
- cursor: "_cursor_1dgwb_2",
406
- cursorBorder: "_cursorBorder_1dgwb_10",
407
- cursorFilling: "_cursorFilling_1dgwb_25",
408
- cursorRipple: "_cursorRipple_1dgwb_39",
409
- clicking: "_clicking_1dgwb_57",
410
- "cursor-ripple": "_cursor-ripple_1dgwb_1"
575
+ cursor: "_cursor_1dgwb_2",
576
+ cursorBorder: "_cursorBorder_1dgwb_10",
577
+ cursorFilling: "_cursorFilling_1dgwb_25",
578
+ cursorRipple: "_cursorRipple_1dgwb_39",
579
+ clicking: "_clicking_1dgwb_57",
580
+ "cursor-ripple": "_cursor-ripple_1dgwb_1"
411
581
  }, N = (m = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap(), g = /* @__PURE__ */ new WeakMap(), _ = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new WeakMap(), b = /* @__PURE__ */ new WeakSet(), class extends EventTarget {
412
- constructor() {
413
- super(), e(this, b), r(this, "shown", !1), r(this, "wrapper", document.createElement("div")), r(this, "motion", null), t(this, m, !1), t(this, h, document.createElement("div")), t(this, g, 0), t(this, _, 0), t(this, v, 0), t(this, y, 0), this.wrapper.id = "page-agent-runtime_simulator-mask", this.wrapper.className = j.wrapper, this.wrapper.setAttribute("data-browser-use-ignore", "true"), this.wrapper.setAttribute("data-page-agent-ignore", "true");
414
- try {
415
- let e = new p({
416
- mode: x() ? "dark" : "light",
417
- styles: {
418
- position: "absolute",
419
- inset: "0"
420
- }
421
- });
422
- this.motion = e, this.wrapper.appendChild(e.element), e.autoResize(this.wrapper);
423
- } catch (e) {
424
- console.warn("[SimulatorMask] Motion overlay unavailable:", e);
425
- }
426
- this.wrapper.addEventListener("click", (e) => {
427
- e.stopPropagation(), e.preventDefault();
428
- }), this.wrapper.addEventListener("mousedown", (e) => {
429
- e.stopPropagation(), e.preventDefault();
430
- }), this.wrapper.addEventListener("mouseup", (e) => {
431
- e.stopPropagation(), e.preventDefault();
432
- }), this.wrapper.addEventListener("mousemove", (e) => {
433
- e.stopPropagation(), e.preventDefault();
434
- }), this.wrapper.addEventListener("wheel", (e) => {
435
- e.stopPropagation(), e.preventDefault();
436
- }), this.wrapper.addEventListener("keydown", (e) => {
437
- e.stopPropagation(), e.preventDefault();
438
- }), this.wrapper.addEventListener("keyup", (e) => {
439
- e.stopPropagation(), e.preventDefault();
440
- }), i(b, this, P).call(this), document.body.appendChild(this.wrapper), i(b, this, F).call(this);
441
- let n = (e) => {
442
- let { x: t, y: n } = e.detail;
443
- this.setCursorPosition(t, n);
444
- }, a = () => {
445
- this.triggerClickAnimation();
446
- }, o = () => {
447
- this.wrapper.style.pointerEvents = "none";
448
- }, s = () => {
449
- this.wrapper.style.pointerEvents = "auto";
450
- };
451
- window.addEventListener("PageAgent::MovePointerTo", n), window.addEventListener("PageAgent::ClickPointer", a), window.addEventListener("PageAgent::EnablePassThrough", o), window.addEventListener("PageAgent::DisablePassThrough", s), this.addEventListener("dispose", () => {
452
- window.removeEventListener("PageAgent::MovePointerTo", n), window.removeEventListener("PageAgent::ClickPointer", a), window.removeEventListener("PageAgent::EnablePassThrough", o), window.removeEventListener("PageAgent::DisablePassThrough", s);
453
- });
454
- }
455
- setCursorPosition(e, t) {
456
- n(m, this) || (a(v, this, e), a(y, this, t));
457
- }
458
- triggerClickAnimation() {
459
- n(m, this) || (n(h, this).classList.remove(M.clicking), n(h, this).offsetHeight, n(h, this).classList.add(M.clicking));
460
- }
461
- show() {
462
- this.shown || n(m, this) || (this.shown = !0, this.motion?.start(), this.motion?.fadeIn(), this.wrapper.classList.add(j.visible), a(g, this, window.innerWidth / 2), a(_, this, window.innerHeight / 2), a(v, this, n(g, this)), a(y, this, n(_, this)), n(h, this).style.left = `${n(g, this)}px`, n(h, this).style.top = `${n(_, this)}px`);
463
- }
464
- hide() {
465
- !this.shown || n(m, this) || (this.shown = !1, this.motion?.fadeOut(), this.motion?.pause(), n(h, this).classList.remove(M.clicking), setTimeout(() => {
466
- this.wrapper.classList.remove(j.visible);
467
- }, 800));
468
- }
469
- dispose() {
470
- a(m, this, !0), this.motion?.dispose(), this.wrapper.remove(), this.dispatchEvent(new Event("dispose"));
471
- }
582
+ constructor() {
583
+ super(), e(this, b), r(this, "shown", false), r(this, "wrapper", document.createElement("div")), r(this, "motion", null), t(this, m, false), t(this, h, document.createElement("div")), t(this, g, 0), t(this, _, 0), t(this, v, 0), t(this, y, 0), this.wrapper.id = "page-agent-runtime_simulator-mask", this.wrapper.className = j.wrapper, this.wrapper.setAttribute("data-browser-use-ignore", "true"), this.wrapper.setAttribute("data-page-agent-ignore", "true");
584
+ try {
585
+ let e2 = new p({
586
+ mode: x() ? "dark" : "light",
587
+ styles: {
588
+ position: "absolute",
589
+ inset: "0"
590
+ }
591
+ });
592
+ this.motion = e2, this.wrapper.appendChild(e2.element), e2.autoResize(this.wrapper);
593
+ } catch (e2) {
594
+ console.warn("[SimulatorMask] Motion overlay unavailable:", e2);
595
+ }
596
+ this.wrapper.addEventListener("click", (e2) => {
597
+ e2.stopPropagation(), e2.preventDefault();
598
+ }), this.wrapper.addEventListener("mousedown", (e2) => {
599
+ e2.stopPropagation(), e2.preventDefault();
600
+ }), this.wrapper.addEventListener("mouseup", (e2) => {
601
+ e2.stopPropagation(), e2.preventDefault();
602
+ }), this.wrapper.addEventListener("mousemove", (e2) => {
603
+ e2.stopPropagation(), e2.preventDefault();
604
+ }), this.wrapper.addEventListener("wheel", (e2) => {
605
+ e2.stopPropagation(), e2.preventDefault();
606
+ }), this.wrapper.addEventListener("keydown", (e2) => {
607
+ e2.stopPropagation(), e2.preventDefault();
608
+ }), this.wrapper.addEventListener("keyup", (e2) => {
609
+ e2.stopPropagation(), e2.preventDefault();
610
+ }), i(b, this, P).call(this), document.body.appendChild(this.wrapper), i(b, this, F).call(this);
611
+ let n2 = (e2) => {
612
+ let { x: t2, y: n3 } = e2.detail;
613
+ this.setCursorPosition(t2, n3);
614
+ }, a2 = () => {
615
+ this.triggerClickAnimation();
616
+ }, o2 = () => {
617
+ this.wrapper.style.pointerEvents = "none";
618
+ }, s2 = () => {
619
+ this.wrapper.style.pointerEvents = "auto";
620
+ };
621
+ window.addEventListener("PageAgent::MovePointerTo", n2), window.addEventListener("PageAgent::ClickPointer", a2), window.addEventListener("PageAgent::EnablePassThrough", o2), window.addEventListener("PageAgent::DisablePassThrough", s2), this.addEventListener("dispose", () => {
622
+ window.removeEventListener("PageAgent::MovePointerTo", n2), window.removeEventListener("PageAgent::ClickPointer", a2), window.removeEventListener("PageAgent::EnablePassThrough", o2), window.removeEventListener("PageAgent::DisablePassThrough", s2);
623
+ });
624
+ }
625
+ setCursorPosition(e2, t2) {
626
+ n(m, this) || (a(v, this, e2), a(y, this, t2));
627
+ }
628
+ triggerClickAnimation() {
629
+ n(m, this) || (n(h, this).classList.remove(M.clicking), n(h, this).offsetHeight, n(h, this).classList.add(M.clicking));
630
+ }
631
+ show() {
632
+ this.shown || n(m, this) || (this.shown = true, this.motion?.start(), this.motion?.fadeIn(), this.wrapper.classList.add(j.visible), a(g, this, window.innerWidth / 2), a(_, this, window.innerHeight / 2), a(v, this, n(g, this)), a(y, this, n(_, this)), n(h, this).style.left = `${n(g, this)}px`, n(h, this).style.top = `${n(_, this)}px`);
633
+ }
634
+ hide() {
635
+ !this.shown || n(m, this) || (this.shown = false, this.motion?.fadeOut(), this.motion?.pause(), n(h, this).classList.remove(M.clicking), setTimeout(() => {
636
+ this.wrapper.classList.remove(j.visible);
637
+ }, 800));
638
+ }
639
+ dispose() {
640
+ a(m, this, true), this.motion?.dispose(), this.wrapper.remove(), this.dispatchEvent(new Event("dispose"));
641
+ }
472
642
  });
473
643
  function P() {
474
- n(h, this).className = M.cursor;
475
- let e = document.createElement("div");
476
- e.className = M.cursorRipple, n(h, this).appendChild(e);
477
- let t = document.createElement("div");
478
- t.className = M.cursorFilling, n(h, this).appendChild(t);
479
- let r = document.createElement("div");
480
- r.className = M.cursorBorder, n(h, this).appendChild(r), this.wrapper.appendChild(n(h, this));
644
+ n(h, this).className = M.cursor;
645
+ let e2 = document.createElement("div");
646
+ e2.className = M.cursorRipple, n(h, this).appendChild(e2);
647
+ let t2 = document.createElement("div");
648
+ t2.className = M.cursorFilling, n(h, this).appendChild(t2);
649
+ let r2 = document.createElement("div");
650
+ r2.className = M.cursorBorder, n(h, this).appendChild(r2), this.wrapper.appendChild(n(h, this));
481
651
  }
482
652
  function F() {
483
- if (n(m, this)) return;
484
- let e = n(g, this) + (n(v, this) - n(g, this)) * .2, t = n(_, this) + (n(y, this) - n(_, this)) * .2, r = Math.abs(e - n(v, this));
485
- r > 0 && (r < 2 ? a(g, this, n(v, this)) : a(g, this, e), n(h, this).style.left = `${n(g, this)}px`);
486
- let o = Math.abs(t - n(y, this));
487
- o > 0 && (o < 2 ? a(_, this, n(y, this)) : a(_, this, t), n(h, this).style.top = `${n(_, this)}px`), requestAnimationFrame(() => i(b, this, F).call(this));
653
+ if (n(m, this)) return;
654
+ let e2 = n(g, this) + (n(v, this) - n(g, this)) * 0.2, t2 = n(_, this) + (n(y, this) - n(_, this)) * 0.2, r2 = Math.abs(e2 - n(v, this));
655
+ r2 > 0 && (r2 < 2 ? a(g, this, n(v, this)) : a(g, this, e2), n(h, this).style.left = `${n(g, this)}px`);
656
+ let o2 = Math.abs(t2 - n(y, this));
657
+ o2 > 0 && (o2 < 2 ? a(_, this, n(y, this)) : a(_, this, t2), n(h, this).style.top = `${n(_, this)}px`), requestAnimationFrame(() => i(b, this, F).call(this));
488
658
  }
489
- //#endregion
490
- export { N as SimulatorMask };
491
-
492
- //# sourceMappingURL=SimulatorMask-BHVXyogh-gk7lKSd9.js.map
659
+ export {
660
+ N as SimulatorMask
661
+ };