omnix-chat 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ChartBlockView-CFDCieqs.js +16359 -16729
- package/dist/SimulatorMask-BHVXyogh-D3fkDyID.js +622 -453
- package/dist/SimulatorMask-BHVXyogh-gk7lKSd9.js +622 -453
- package/dist/blockExport-D1glfDCL.js +14953 -15182
- package/dist/chunk-C-6Xjtra.js +42 -25
- package/dist/classPrivateFieldSet2-C_TowLYi.js +57 -70
- package/dist/classPrivateFieldSet2-DmVphaHw.js +14 -20
- package/dist/defineProperty-DDzGndnJ.js +25 -31
- package/dist/es-BAQ_ERKH.js +422 -439
- package/dist/page-agent-automation-Cplpsy_2.js +5125 -5107
- package/dist/page-agent-automation-kTRehHRs.js +5115 -5097
- package/dist/react.es.js +1 -1
- package/dist/react.legacy.es.js +2077 -2078
- package/dist/xlsx-DM9ZhRAn.js +12408 -12185
- package/package.json +1 -1
|
@@ -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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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(
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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(
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
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
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
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(
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
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
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
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
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
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
|
-
|
|
298
|
-
|
|
299
|
-
|
|
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
|
-
|
|
303
|
-
|
|
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
|
-
}
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
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
|
-
|
|
316
|
-
|
|
317
|
-
|
|
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
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
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
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
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
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
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
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
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
|
-
|
|
364
|
-
|
|
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
|
-
|
|
368
|
-
|
|
537
|
+
let e2 = k(window.getComputedStyle(document.body || document.documentElement).color);
|
|
538
|
+
return e2 !== null && e2 > 200;
|
|
369
539
|
}
|
|
370
540
|
function D() {
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
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(
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
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(
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
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(
|
|
398
|
-
|
|
399
|
-
|
|
567
|
+
function A(e2, t2 = 128) {
|
|
568
|
+
let n2 = k(e2);
|
|
569
|
+
return n2 !== null && n2 < t2;
|
|
400
570
|
}
|
|
401
571
|
var j = {
|
|
402
|
-
|
|
403
|
-
|
|
572
|
+
wrapper: "_wrapper_1ooyb_1",
|
|
573
|
+
visible: "_visible_1ooyb_11"
|
|
404
574
|
}, M = {
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
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
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
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
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
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
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
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
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
//# sourceMappingURL=SimulatorMask-BHVXyogh-gk7lKSd9.js.map
|
|
659
|
+
export {
|
|
660
|
+
N as SimulatorMask
|
|
661
|
+
};
|