@vunk/plus 1.12.2 → 1.13.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.
- package/components/_plugin-vue_export-helper-BHFhmbuH.js +1 -0
- package/components/_plugin-vue_export-helper-CHgC5LLL.mjs +9 -0
- package/components/agent-chat-provider/index.cjs +1 -0
- package/components/agent-chat-provider/index.mjs +113 -187
- package/components/agent-chat-provider/src/index.vue.d.ts +3 -2
- package/components/avatar/index.cjs +1 -0
- package/components/avatar/index.mjs +25 -31
- package/components/avatar/src/index.vue.d.ts +40 -39
- package/components/broadcasting-markdown/__tests__/const.test.d.ts +1 -0
- package/components/broadcasting-markdown/__tests__/utils.test.d.ts +1 -0
- package/components/broadcasting-markdown/index.cjs +5 -0
- package/components/broadcasting-markdown/index.mjs +346 -4376
- package/components/broadcasting-markdown/src/howler-speech.vue.d.ts +18 -24
- package/components/broadcasting-markdown/src/index.vue.d.ts +101 -51
- package/components/broadcasting-markdown/src/paragraph.vue.d.ts +17 -29
- package/components/broadcasting-markdown/src/speech-error.vue.d.ts +2 -59
- package/components/bubble-list/index.cjs +1 -0
- package/components/bubble-list/index.mjs +220 -302
- package/components/bubble-list/src/core/index.vue.d.ts +40 -885
- package/components/bubble-list/src/core/loading.vue.d.ts +3 -0
- package/components/bubble-list/src/index.vue.d.ts +29 -1321
- package/components/bubble-templates/index.cjs +1 -0
- package/components/bubble-templates/index.mjs +34 -49
- package/components/bubble-templates/src/index.vue.d.ts +3 -224
- package/components/chat-independent/index.cjs +1 -0
- package/components/chat-independent/index.mjs +105 -212
- package/components/chat-independent/src/index.vue.d.ts +20 -2712
- package/components/components.css +1 -0
- package/components/drawer/index.cjs +1 -0
- package/components/drawer/index.mjs +53 -94
- package/components/drawer/src/ctx.d.ts +22 -22
- package/components/drawer/src/index.vue.d.ts +84 -557
- package/components/index.cjs +1 -0
- package/components/index.d.ts +1 -0
- package/components/lottie-animation/index.cjs +1 -0
- package/components/lottie-animation/index.mjs +36 -55
- package/components/lottie-animation/src/index.vue.d.ts +3 -2
- package/components/metahuman-broadcasting/index.cjs +1 -0
- package/components/metahuman-broadcasting/index.mjs +89 -140
- package/components/metahuman-broadcasting/src/index.vue.d.ts +16 -718
- package/components/monaco-editor/index.cjs +1 -0
- package/components/monaco-editor/index.mjs +68 -95
- package/components/monaco-editor/src/index.vue.d.ts +3 -2
- package/components/monaco-environment/index.cjs +1 -0
- package/components/monaco-environment/index.mjs +23 -38
- package/components/monaco-environment/src/index.vue.d.ts +2 -1
- package/components/pixi-frame/index.cjs +1 -0
- package/components/pixi-frame/index.mjs +941 -1969
- package/components/pixi-frame/src/apng.vue.d.ts +17 -73
- package/components/pixi-frame/src/bitmap-generator.vue.d.ts +24 -66
- package/components/pixi-frame/src/bitmap.vue.d.ts +28 -80
- package/components/pixi-frame/src/buffer-image.vue.d.ts +29 -97
- package/components/pixi-frame/src/core.vue.d.ts +20 -75
- package/components/pixi-frame/src/index.vue.d.ts +302 -237
- package/components/pixi-frame/src/provider.vue.d.ts +12 -1
- package/components/pixi-frame/src/video.vue.d.ts +17 -71
- package/components/pixi-frame/src/view.vue.d.ts +4 -16
- package/components/recorder-button/index.cjs +1 -0
- package/components/recorder-button/index.mjs +140 -269
- package/components/recorder-button/src/index.vue.d.ts +67 -66
- package/components/routes-menu-content/index.cjs +1 -0
- package/components/routes-menu-content/index.mjs +150 -229
- package/components/routes-menu-content/src/index.vue.d.ts +27 -26
- package/components/routes-menu-content/src/item/core/index.vue.d.ts +27 -26
- package/components/routes-menu-content/src/item/index.vue.d.ts +27 -26
- package/components/scrollbar/index.cjs +1 -0
- package/components/scrollbar/index.mjs +288 -567
- package/components/scrollbar/src/bar.vue.d.ts +6 -133
- package/components/scrollbar/src/index.vue.d.ts +66 -337
- package/components/scrollbar/src/thumb.vue.d.ts +3 -80
- package/components/sender/index.cjs +1 -0
- package/components/sender/index.mjs +156 -285
- package/components/sender/src/SenderHeader.vue.d.ts +14 -221
- package/components/sender/src/index.vue.d.ts +16 -505
- package/components/speech-button/index.cjs +1 -0
- package/components/speech-button/index.mjs +98 -144
- package/components/speech-button/src/LoadingIcon.vue.d.ts +2 -1
- package/components/speech-button/src/RecordingIcon.vue.d.ts +2 -1
- package/components/speech-button/src/index.vue.d.ts +6 -5
- package/components/table-columns/index.cjs +1 -0
- package/components/table-columns/index.mjs +48 -78
- package/components/table-columns/src/ctx.d.ts +10 -10
- package/components/table-columns/src/el-ctx.d.ts +1 -1
- package/components/table-columns/src/index.vue.d.ts +24 -23
- package/components/tables-v1/index.cjs +1 -0
- package/components/tables-v1/index.mjs +99 -160
- package/components/tables-v1/src/ctx.d.ts +28 -28
- package/components/tables-v1/src/el-ctx.d.ts +2 -2
- package/components/tables-v1/src/index.vue.d.ts +88 -2243
- package/components/tables-v1-checkbox/index.cjs +98 -0
- package/components/tables-v1-checkbox/index.mjs +1594 -3735
- package/components/tables-v1-checkbox/src/ctx.d.ts +26 -26
- package/components/tables-v1-checkbox/src/index.vue.d.ts +176 -2330
- package/components/text/index.cjs +1 -0
- package/components/text/index.mjs +70 -108
- package/components/text/src/ctx.d.ts +31 -31
- package/components/text/src/index.vue.d.ts +92 -1819
- package/components/thinking/index.cjs +1 -0
- package/components/thinking/index.mjs +127 -227
- package/components/thinking/src/index.vue.d.ts +22 -2044
- package/components/typing-markdown/index.cjs +1 -0
- package/components/typing-markdown/index.mjs +61 -201
- package/components/typing-markdown/src/index.vue.d.ts +3 -2
- package/components/vditor/index.cjs +1 -0
- package/components/vditor/index.mjs +121 -195
- package/components/vditor/src/ctx.d.ts +2 -2
- package/components/vditor/src/handle-fullscreen.vue.d.ts +3 -2
- package/components/vditor/src/handle-value.vue.d.ts +3 -2
- package/components/vditor/src/index.vue.d.ts +5 -4
- package/components/xgplayer/index.cjs +1 -0
- package/components/xgplayer/index.mjs +49 -90
- package/components/xgplayer/src/core.vue.d.ts +13 -18
- package/components/xgplayer/src/index.vue.d.ts +13 -67
- package/composables/el-breakpoints/index.cjs +1 -0
- package/composables/el-breakpoints/index.d.ts +10 -10
- package/composables/el-breakpoints/index.mjs +10 -12
- package/composables/index.cjs +1 -0
- package/composables/index.d.ts +1 -0
- package/composables/recorder/index.cjs +1 -0
- package/composables/recorder/index.mjs +9172 -14803
- package/element/_plugin-vue_export-helper-BHFhmbuH.js +1 -0
- package/element/bubble/index.cjs +3 -0
- package/element/bubble/index.d.ts +1 -1
- package/element/bubble/index.mjs +1 -1
- package/element/bubble/src/index.vue.d.ts +22 -22
- package/element/index.css +1 -1
- package/element/thinking/index.cjs +1 -0
- package/element/thinking/index.d.ts +1 -1
- package/element/thinking/index.mjs +1 -1
- package/element/thinking/src/index.vue.d.ts +26 -26
- package/element/thinking/src/types.d.ts +10 -0
- package/icons/_plugin-vue_export-helper-BHFhmbuH.js +1 -0
- package/icons/_plugin-vue_export-helper-CHgC5LLL.mjs +9 -0
- package/icons/end/index.cjs +1 -0
- package/icons/end/index.mjs +21 -26
- package/icons/end/src/index.vue.d.ts +3 -0
- package/icons/keyboard/index.cjs +1 -0
- package/icons/keyboard/index.mjs +21 -26
- package/icons/keyboard/src/index.vue.d.ts +3 -0
- package/icons/start/index.cjs +1 -0
- package/icons/start/index.mjs +21 -26
- package/icons/start/src/index.vue.d.ts +3 -0
- package/icons/voice/index.cjs +1 -0
- package/icons/voice/index.mjs +26 -44
- package/icons/voice/src/index.vue.d.ts +2 -3
- package/index.css +2 -558
- package/index.d.ts +1 -0
- package/package.json +78 -87
- package/shared/data/index.cjs +1 -0
- package/shared/data/index.mjs +16 -22
- package/shared/types/index.cjs +1 -0
- package/shared/types/index.d.ts +1 -0
- package/components/LinkOutlined.mjs +0 -1321
- package/components/_commonjsHelpers.mjs +0 -7
- package/components/_plugin-vue_export-helper.mjs +0 -9
- package/components/bubble-list/index.css +0 -70
- package/components/bubble-templates/index.css +0 -4
- package/components/chat-independent/index.css +0 -47
- package/components/drawer/index.css +0 -124
- package/components/index2.mjs +0 -78
- package/components/lottie-animation/index.css +0 -4
- package/components/monaco-editor/index.css +0 -4
- package/components/pixi-frame/index.css +0 -4
- package/components/recorder-button/index.css +0 -69
- package/components/sender/index.css +0 -22
- package/components/speech-button/index.css +0 -10
- package/components/tables-v1/index.css +0 -7
- package/components/tables-v1-checkbox/index.css +0 -8
- package/components/thinking/index.css +0 -125
- package/components/typing-markdown/index.css +0 -31
- package/components/vditor/index.css +0 -12
- package/components/xgplayer/index.css +0 -1
- package/icons/_plugin-vue_export-helper.mjs +0 -9
|
@@ -1,1003 +1,465 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { TickerStatus } from
|
|
3
|
-
|
|
4
|
-
import { Deferred, sleep } from
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
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
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
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
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
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
|
-
_this2.imageElement.src = url;
|
|
461
|
-
});
|
|
462
|
-
}
|
|
463
|
-
}]);
|
|
464
|
-
|
|
465
|
-
return Frame;
|
|
466
|
-
}();
|
|
467
|
-
|
|
468
|
-
/***/ }),
|
|
469
|
-
/* 3 */
|
|
470
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
471
|
-
|
|
472
|
-
Object.defineProperty(exports, "__esModule", {
|
|
473
|
-
value: true
|
|
474
|
-
});
|
|
475
|
-
|
|
476
|
-
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
477
|
-
|
|
478
|
-
var _events = __webpack_require__(4);
|
|
479
|
-
|
|
480
|
-
var _events2 = _interopRequireDefault(_events);
|
|
481
|
-
|
|
482
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
483
|
-
|
|
484
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
485
|
-
|
|
486
|
-
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
487
|
-
|
|
488
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
489
|
-
|
|
490
|
-
var _class = function (_EventEmitter) {
|
|
491
|
-
_inherits(_class, _EventEmitter);
|
|
492
|
-
|
|
493
|
-
/**
|
|
494
|
-
* @param {APNG} apng
|
|
495
|
-
* @param {CanvasRenderingContext2D} context
|
|
496
|
-
* @param {boolean} autoPlay
|
|
497
|
-
*/
|
|
498
|
-
|
|
499
|
-
/** @type {number} */
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
/** @type {boolean} */
|
|
503
|
-
|
|
504
|
-
/** @type {ImageData} */
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
/** @type {APNG} */
|
|
508
|
-
|
|
509
|
-
/** @type {CanvasRenderingContext2D} */
|
|
510
|
-
function _class(apng, context, autoPlay) {
|
|
511
|
-
_classCallCheck(this, _class);
|
|
512
|
-
|
|
513
|
-
var _this = _possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).call(this));
|
|
514
|
-
|
|
515
|
-
_this.playbackRate = 1.0;
|
|
516
|
-
_this._currentFrameNumber = 0;
|
|
517
|
-
_this._ended = false;
|
|
518
|
-
_this._paused = true;
|
|
519
|
-
_this._numPlays = 0;
|
|
520
|
-
_this._rafId = null;
|
|
521
|
-
|
|
522
|
-
_this._apng = apng;
|
|
523
|
-
_this.context = context;
|
|
524
|
-
_this.stop();
|
|
525
|
-
if (autoPlay) {
|
|
526
|
-
_this.play();
|
|
527
|
-
}
|
|
528
|
-
return _this;
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
/**
|
|
532
|
-
*
|
|
533
|
-
* @return {number}
|
|
534
|
-
*/
|
|
535
|
-
|
|
536
|
-
/** @type {number|null} */
|
|
537
|
-
|
|
538
|
-
/** @type {boolean} */
|
|
539
|
-
|
|
540
|
-
/** @type {number} */
|
|
541
|
-
|
|
542
|
-
/** @type {Frame} */
|
|
543
|
-
|
|
544
|
-
/** @type {number} */
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
_createClass(_class, [{
|
|
548
|
-
key: 'renderNextFrame',
|
|
549
|
-
value: function renderNextFrame() {
|
|
550
|
-
this._currentFrameNumber = (this._currentFrameNumber + 1) % this._apng.frames.length;
|
|
551
|
-
if (this._currentFrameNumber === this._apng.frames.length - 1) {
|
|
552
|
-
this._numPlays++;
|
|
553
|
-
if (this._apng.numPlays !== 0 && this._numPlays >= this._apng.numPlays) {
|
|
554
|
-
this._ended = true;
|
|
555
|
-
this._paused = true;
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
if (this._prevFrame && this._prevFrame.disposeOp == 1) {
|
|
560
|
-
this.context.clearRect(this._prevFrame.left, this._prevFrame.top, this._prevFrame.width, this._prevFrame.height);
|
|
561
|
-
} else if (this._prevFrame && this._prevFrame.disposeOp == 2) {
|
|
562
|
-
this.context.putImageData(this._prevFrameData, this._prevFrame.left, this._prevFrame.top);
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
var frame = this.currentFrame;
|
|
566
|
-
this._prevFrame = frame;
|
|
567
|
-
this._prevFrameData = null;
|
|
568
|
-
if (frame.disposeOp == 2) {
|
|
569
|
-
this._prevFrameData = this.context.getImageData(frame.left, frame.top, frame.width, frame.height);
|
|
570
|
-
}
|
|
571
|
-
if (frame.blendOp == 0) {
|
|
572
|
-
this.context.clearRect(frame.left, frame.top, frame.width, frame.height);
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
this.context.drawImage(frame.imageElement, frame.left, frame.top);
|
|
576
|
-
|
|
577
|
-
this.emit('frame', this._currentFrameNumber);
|
|
578
|
-
if (this._ended) {
|
|
579
|
-
this.emit('end');
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
// playback
|
|
584
|
-
|
|
585
|
-
}, {
|
|
586
|
-
key: 'play',
|
|
587
|
-
value: function play() {
|
|
588
|
-
var _this2 = this;
|
|
589
|
-
|
|
590
|
-
if (this._rafId) {
|
|
591
|
-
cancelAnimationFrame(this._rafId);
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
this.emit('play');
|
|
595
|
-
|
|
596
|
-
if (this._ended) {
|
|
597
|
-
this.stop();
|
|
598
|
-
}
|
|
599
|
-
this._paused = false;
|
|
600
|
-
|
|
601
|
-
var nextRenderTime = performance.now() + this.currentFrame.delay / this.playbackRate;
|
|
602
|
-
var tick = function tick(now) {
|
|
603
|
-
if (_this2._ended || _this2._paused) {
|
|
604
|
-
return;
|
|
605
|
-
}
|
|
606
|
-
if (now >= nextRenderTime) {
|
|
607
|
-
while (now - nextRenderTime >= _this2._apng.playTime / _this2.playbackRate) {
|
|
608
|
-
nextRenderTime += _this2._apng.playTime / _this2.playbackRate;
|
|
609
|
-
_this2._numPlays++;
|
|
610
|
-
}
|
|
611
|
-
do {
|
|
612
|
-
_this2.renderNextFrame();
|
|
613
|
-
nextRenderTime += _this2.currentFrame.delay / _this2.playbackRate;
|
|
614
|
-
} while (!_this2._ended && !_this2._paused && now > nextRenderTime);
|
|
615
|
-
}
|
|
616
|
-
_this2._rafId = requestAnimationFrame(tick);
|
|
617
|
-
};
|
|
618
|
-
this._rafId = requestAnimationFrame(tick);
|
|
619
|
-
}
|
|
620
|
-
}, {
|
|
621
|
-
key: 'pause',
|
|
622
|
-
value: function pause() {
|
|
623
|
-
if (!this._paused) {
|
|
624
|
-
if (this._rafId) {
|
|
625
|
-
cancelAnimationFrame(this._rafId);
|
|
626
|
-
this._rafId = null;
|
|
627
|
-
}
|
|
628
|
-
this.emit('pause');
|
|
629
|
-
this._paused = true;
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
}, {
|
|
633
|
-
key: 'stop',
|
|
634
|
-
value: function stop() {
|
|
635
|
-
if (this._rafId) {
|
|
636
|
-
cancelAnimationFrame(this._rafId);
|
|
637
|
-
this._rafId = null;
|
|
638
|
-
}
|
|
639
|
-
this.emit('stop');
|
|
640
|
-
this._numPlays = 0;
|
|
641
|
-
this._ended = false;
|
|
642
|
-
this._paused = true;
|
|
643
|
-
// render first frame
|
|
644
|
-
this._currentFrameNumber = -1;
|
|
645
|
-
this.context.clearRect(0, 0, this._apng.width, this._apng.height);
|
|
646
|
-
this.renderNextFrame();
|
|
647
|
-
}
|
|
648
|
-
}, {
|
|
649
|
-
key: 'currentFrameNumber',
|
|
650
|
-
get: function get() {
|
|
651
|
-
return this._currentFrameNumber;
|
|
652
|
-
}
|
|
653
|
-
|
|
654
|
-
/**
|
|
655
|
-
*
|
|
656
|
-
* @return {Frame}
|
|
657
|
-
*/
|
|
658
|
-
|
|
659
|
-
}, {
|
|
660
|
-
key: 'currentFrame',
|
|
661
|
-
get: function get() {
|
|
662
|
-
return this._apng.frames[this._currentFrameNumber];
|
|
663
|
-
}
|
|
664
|
-
}, {
|
|
665
|
-
key: 'paused',
|
|
666
|
-
get: function get() {
|
|
667
|
-
return this._paused;
|
|
668
|
-
}
|
|
669
|
-
}, {
|
|
670
|
-
key: 'ended',
|
|
671
|
-
get: function get() {
|
|
672
|
-
return this._ended;
|
|
673
|
-
}
|
|
674
|
-
}]);
|
|
675
|
-
|
|
676
|
-
return _class;
|
|
677
|
-
}(_events2.default);
|
|
678
|
-
|
|
679
|
-
exports.default = _class;
|
|
680
|
-
|
|
681
|
-
/***/ }),
|
|
682
|
-
/* 4 */
|
|
683
|
-
/***/ (function(module, exports) {
|
|
684
|
-
|
|
685
|
-
// Copyright Joyent, Inc. and other Node contributors.
|
|
686
|
-
//
|
|
687
|
-
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
688
|
-
// copy of this software and associated documentation files (the
|
|
689
|
-
// "Software"), to deal in the Software without restriction, including
|
|
690
|
-
// without limitation the rights to use, copy, modify, merge, publish,
|
|
691
|
-
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
692
|
-
// persons to whom the Software is furnished to do so, subject to the
|
|
693
|
-
// following conditions:
|
|
694
|
-
//
|
|
695
|
-
// The above copyright notice and this permission notice shall be included
|
|
696
|
-
// in all copies or substantial portions of the Software.
|
|
697
|
-
//
|
|
698
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
699
|
-
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
700
|
-
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|
701
|
-
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
702
|
-
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
703
|
-
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
704
|
-
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
705
|
-
|
|
706
|
-
function EventEmitter() {
|
|
707
|
-
this._events = this._events || {};
|
|
708
|
-
this._maxListeners = this._maxListeners || undefined;
|
|
709
|
-
}
|
|
710
|
-
module.exports = EventEmitter;
|
|
711
|
-
|
|
712
|
-
// Backwards-compat with node 0.10.x
|
|
713
|
-
EventEmitter.EventEmitter = EventEmitter;
|
|
714
|
-
|
|
715
|
-
EventEmitter.prototype._events = undefined;
|
|
716
|
-
EventEmitter.prototype._maxListeners = undefined;
|
|
717
|
-
|
|
718
|
-
// By default EventEmitters will print a warning if more than 10 listeners are
|
|
719
|
-
// added to it. This is a useful default which helps finding memory leaks.
|
|
720
|
-
EventEmitter.defaultMaxListeners = 10;
|
|
721
|
-
|
|
722
|
-
// Obviously not all Emitters should be limited to 10. This function allows
|
|
723
|
-
// that to be increased. Set to zero for unlimited.
|
|
724
|
-
EventEmitter.prototype.setMaxListeners = function(n) {
|
|
725
|
-
if (!isNumber(n) || n < 0 || isNaN(n))
|
|
726
|
-
throw TypeError('n must be a positive number');
|
|
727
|
-
this._maxListeners = n;
|
|
728
|
-
return this;
|
|
729
|
-
};
|
|
730
|
-
|
|
731
|
-
EventEmitter.prototype.emit = function(type) {
|
|
732
|
-
var er, handler, len, args, i, listeners;
|
|
733
|
-
|
|
734
|
-
if (!this._events)
|
|
735
|
-
this._events = {};
|
|
736
|
-
|
|
737
|
-
// If there is no 'error' event listener then throw.
|
|
738
|
-
if (type === 'error') {
|
|
739
|
-
if (!this._events.error ||
|
|
740
|
-
(isObject(this._events.error) && !this._events.error.length)) {
|
|
741
|
-
er = arguments[1];
|
|
742
|
-
if (er instanceof Error) {
|
|
743
|
-
throw er; // Unhandled 'error' event
|
|
744
|
-
} else {
|
|
745
|
-
// At least give some kind of context to the user
|
|
746
|
-
var err = new Error('Uncaught, unspecified "error" event. (' + er + ')');
|
|
747
|
-
err.context = er;
|
|
748
|
-
throw err;
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
}
|
|
752
|
-
|
|
753
|
-
handler = this._events[type];
|
|
754
|
-
|
|
755
|
-
if (isUndefined(handler))
|
|
756
|
-
return false;
|
|
757
|
-
|
|
758
|
-
if (isFunction(handler)) {
|
|
759
|
-
switch (arguments.length) {
|
|
760
|
-
// fast cases
|
|
761
|
-
case 1:
|
|
762
|
-
handler.call(this);
|
|
763
|
-
break;
|
|
764
|
-
case 2:
|
|
765
|
-
handler.call(this, arguments[1]);
|
|
766
|
-
break;
|
|
767
|
-
case 3:
|
|
768
|
-
handler.call(this, arguments[1], arguments[2]);
|
|
769
|
-
break;
|
|
770
|
-
// slower
|
|
771
|
-
default:
|
|
772
|
-
args = Array.prototype.slice.call(arguments, 1);
|
|
773
|
-
handler.apply(this, args);
|
|
774
|
-
}
|
|
775
|
-
} else if (isObject(handler)) {
|
|
776
|
-
args = Array.prototype.slice.call(arguments, 1);
|
|
777
|
-
listeners = handler.slice();
|
|
778
|
-
len = listeners.length;
|
|
779
|
-
for (i = 0; i < len; i++)
|
|
780
|
-
listeners[i].apply(this, args);
|
|
781
|
-
}
|
|
782
|
-
|
|
783
|
-
return true;
|
|
784
|
-
};
|
|
785
|
-
|
|
786
|
-
EventEmitter.prototype.addListener = function(type, listener) {
|
|
787
|
-
var m;
|
|
788
|
-
|
|
789
|
-
if (!isFunction(listener))
|
|
790
|
-
throw TypeError('listener must be a function');
|
|
791
|
-
|
|
792
|
-
if (!this._events)
|
|
793
|
-
this._events = {};
|
|
794
|
-
|
|
795
|
-
// To avoid recursion in the case that type === "newListener"! Before
|
|
796
|
-
// adding it to the listeners, first emit "newListener".
|
|
797
|
-
if (this._events.newListener)
|
|
798
|
-
this.emit('newListener', type,
|
|
799
|
-
isFunction(listener.listener) ?
|
|
800
|
-
listener.listener : listener);
|
|
801
|
-
|
|
802
|
-
if (!this._events[type])
|
|
803
|
-
// Optimize the case of one listener. Don't need the extra array object.
|
|
804
|
-
this._events[type] = listener;
|
|
805
|
-
else if (isObject(this._events[type]))
|
|
806
|
-
// If we've already got an array, just append.
|
|
807
|
-
this._events[type].push(listener);
|
|
808
|
-
else
|
|
809
|
-
// Adding the second element, need to change to array.
|
|
810
|
-
this._events[type] = [this._events[type], listener];
|
|
811
|
-
|
|
812
|
-
// Check for listener leak
|
|
813
|
-
if (isObject(this._events[type]) && !this._events[type].warned) {
|
|
814
|
-
if (!isUndefined(this._maxListeners)) {
|
|
815
|
-
m = this._maxListeners;
|
|
816
|
-
} else {
|
|
817
|
-
m = EventEmitter.defaultMaxListeners;
|
|
818
|
-
}
|
|
819
|
-
|
|
820
|
-
if (m && m > 0 && this._events[type].length > m) {
|
|
821
|
-
this._events[type].warned = true;
|
|
822
|
-
console.error('(node) warning: possible EventEmitter memory ' +
|
|
823
|
-
'leak detected. %d listeners added. ' +
|
|
824
|
-
'Use emitter.setMaxListeners() to increase limit.',
|
|
825
|
-
this._events[type].length);
|
|
826
|
-
if (typeof console.trace === 'function') {
|
|
827
|
-
// not supported in IE 10
|
|
828
|
-
console.trace();
|
|
829
|
-
}
|
|
830
|
-
}
|
|
831
|
-
}
|
|
832
|
-
|
|
833
|
-
return this;
|
|
834
|
-
};
|
|
835
|
-
|
|
836
|
-
EventEmitter.prototype.on = EventEmitter.prototype.addListener;
|
|
837
|
-
|
|
838
|
-
EventEmitter.prototype.once = function(type, listener) {
|
|
839
|
-
if (!isFunction(listener))
|
|
840
|
-
throw TypeError('listener must be a function');
|
|
841
|
-
|
|
842
|
-
var fired = false;
|
|
843
|
-
|
|
844
|
-
function g() {
|
|
845
|
-
this.removeListener(type, g);
|
|
846
|
-
|
|
847
|
-
if (!fired) {
|
|
848
|
-
fired = true;
|
|
849
|
-
listener.apply(this, arguments);
|
|
850
|
-
}
|
|
851
|
-
}
|
|
852
|
-
|
|
853
|
-
g.listener = listener;
|
|
854
|
-
this.on(type, g);
|
|
855
|
-
|
|
856
|
-
return this;
|
|
857
|
-
};
|
|
858
|
-
|
|
859
|
-
// emits a 'removeListener' event iff the listener was removed
|
|
860
|
-
EventEmitter.prototype.removeListener = function(type, listener) {
|
|
861
|
-
var list, position, length, i;
|
|
862
|
-
|
|
863
|
-
if (!isFunction(listener))
|
|
864
|
-
throw TypeError('listener must be a function');
|
|
865
|
-
|
|
866
|
-
if (!this._events || !this._events[type])
|
|
867
|
-
return this;
|
|
868
|
-
|
|
869
|
-
list = this._events[type];
|
|
870
|
-
length = list.length;
|
|
871
|
-
position = -1;
|
|
872
|
-
|
|
873
|
-
if (list === listener ||
|
|
874
|
-
(isFunction(list.listener) && list.listener === listener)) {
|
|
875
|
-
delete this._events[type];
|
|
876
|
-
if (this._events.removeListener)
|
|
877
|
-
this.emit('removeListener', type, listener);
|
|
878
|
-
|
|
879
|
-
} else if (isObject(list)) {
|
|
880
|
-
for (i = length; i-- > 0;) {
|
|
881
|
-
if (list[i] === listener ||
|
|
882
|
-
(list[i].listener && list[i].listener === listener)) {
|
|
883
|
-
position = i;
|
|
884
|
-
break;
|
|
885
|
-
}
|
|
886
|
-
}
|
|
887
|
-
|
|
888
|
-
if (position < 0)
|
|
889
|
-
return this;
|
|
890
|
-
|
|
891
|
-
if (list.length === 1) {
|
|
892
|
-
list.length = 0;
|
|
893
|
-
delete this._events[type];
|
|
894
|
-
} else {
|
|
895
|
-
list.splice(position, 1);
|
|
896
|
-
}
|
|
897
|
-
|
|
898
|
-
if (this._events.removeListener)
|
|
899
|
-
this.emit('removeListener', type, listener);
|
|
900
|
-
}
|
|
901
|
-
|
|
902
|
-
return this;
|
|
903
|
-
};
|
|
904
|
-
|
|
905
|
-
EventEmitter.prototype.removeAllListeners = function(type) {
|
|
906
|
-
var key, listeners;
|
|
907
|
-
|
|
908
|
-
if (!this._events)
|
|
909
|
-
return this;
|
|
910
|
-
|
|
911
|
-
// not listening for removeListener, no need to emit
|
|
912
|
-
if (!this._events.removeListener) {
|
|
913
|
-
if (arguments.length === 0)
|
|
914
|
-
this._events = {};
|
|
915
|
-
else if (this._events[type])
|
|
916
|
-
delete this._events[type];
|
|
917
|
-
return this;
|
|
918
|
-
}
|
|
919
|
-
|
|
920
|
-
// emit removeListener for all listeners on all events
|
|
921
|
-
if (arguments.length === 0) {
|
|
922
|
-
for (key in this._events) {
|
|
923
|
-
if (key === 'removeListener') continue;
|
|
924
|
-
this.removeAllListeners(key);
|
|
925
|
-
}
|
|
926
|
-
this.removeAllListeners('removeListener');
|
|
927
|
-
this._events = {};
|
|
928
|
-
return this;
|
|
929
|
-
}
|
|
930
|
-
|
|
931
|
-
listeners = this._events[type];
|
|
932
|
-
|
|
933
|
-
if (isFunction(listeners)) {
|
|
934
|
-
this.removeListener(type, listeners);
|
|
935
|
-
} else if (listeners) {
|
|
936
|
-
// LIFO order
|
|
937
|
-
while (listeners.length)
|
|
938
|
-
this.removeListener(type, listeners[listeners.length - 1]);
|
|
939
|
-
}
|
|
940
|
-
delete this._events[type];
|
|
941
|
-
|
|
942
|
-
return this;
|
|
943
|
-
};
|
|
944
|
-
|
|
945
|
-
EventEmitter.prototype.listeners = function(type) {
|
|
946
|
-
var ret;
|
|
947
|
-
if (!this._events || !this._events[type])
|
|
948
|
-
ret = [];
|
|
949
|
-
else if (isFunction(this._events[type]))
|
|
950
|
-
ret = [this._events[type]];
|
|
951
|
-
else
|
|
952
|
-
ret = this._events[type].slice();
|
|
953
|
-
return ret;
|
|
954
|
-
};
|
|
955
|
-
|
|
956
|
-
EventEmitter.prototype.listenerCount = function(type) {
|
|
957
|
-
if (this._events) {
|
|
958
|
-
var evlistener = this._events[type];
|
|
959
|
-
|
|
960
|
-
if (isFunction(evlistener))
|
|
961
|
-
return 1;
|
|
962
|
-
else if (evlistener)
|
|
963
|
-
return evlistener.length;
|
|
964
|
-
}
|
|
965
|
-
return 0;
|
|
966
|
-
};
|
|
967
|
-
|
|
968
|
-
EventEmitter.listenerCount = function(emitter, type) {
|
|
969
|
-
return emitter.listenerCount(type);
|
|
970
|
-
};
|
|
971
|
-
|
|
972
|
-
function isFunction(arg) {
|
|
973
|
-
return typeof arg === 'function';
|
|
974
|
-
}
|
|
975
|
-
|
|
976
|
-
function isNumber(arg) {
|
|
977
|
-
return typeof arg === 'number';
|
|
978
|
-
}
|
|
979
|
-
|
|
980
|
-
function isObject(arg) {
|
|
981
|
-
return typeof arg === 'object' && arg !== null;
|
|
982
|
-
}
|
|
983
|
-
|
|
984
|
-
function isUndefined(arg) {
|
|
985
|
-
return arg === void 0;
|
|
986
|
-
}
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
/***/ })
|
|
990
|
-
/******/ ])
|
|
991
|
-
});
|
|
992
|
-
} (lib));
|
|
993
|
-
|
|
994
|
-
var libExports = lib.exports;
|
|
995
|
-
var parseAPNG = /*@__PURE__*/getDefaultExportFromCjs(libExports);
|
|
996
|
-
|
|
997
|
-
const props = {
|
|
1
|
+
import { inject as fe, provide as de, watchEffect as B, onBeforeUnmount as S, defineComponent as C, useId as ne, ref as U, onMounted as ae, renderSlot as V, watch as Q, computed as J, createElementBlock as me, openBlock as H, resolveComponent as K, createBlock as Y, withCtx as he, createVNode as ve } from "vue";
|
|
2
|
+
import { TickerStatus as m } from "@vunk/shared/enum";
|
|
3
|
+
import { TickerStatus as Ye } from "@vunk/shared/enum";
|
|
4
|
+
import { Deferred as ge, sleep as Z } from "@vunk/shared/promise";
|
|
5
|
+
import { Application as _e, Sprite as ye, Assets as R, Texture as ee, ImageSource as oe, BufferImageSource as we } from "pixi.js";
|
|
6
|
+
import { pickObject as se } from "@vunk/shared/object";
|
|
7
|
+
import { useModelComputed as ie, useDeferred as be } from "@vunk/core/composables";
|
|
8
|
+
import { _ as xe } from "../_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
9
|
+
function Fe(o) {
|
|
10
|
+
return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
|
|
11
|
+
}
|
|
12
|
+
var X = { exports: {} }, ke = X.exports, ue;
|
|
13
|
+
function Pe() {
|
|
14
|
+
return ue || (ue = 1, (function(o, P) {
|
|
15
|
+
(function(r, p) {
|
|
16
|
+
o.exports = p();
|
|
17
|
+
})(ke, function() {
|
|
18
|
+
return (
|
|
19
|
+
/******/
|
|
20
|
+
(function(t) {
|
|
21
|
+
var r = {};
|
|
22
|
+
function p(l) {
|
|
23
|
+
if (r[l])
|
|
24
|
+
return r[l].exports;
|
|
25
|
+
var v = r[l] = {
|
|
26
|
+
/******/
|
|
27
|
+
exports: {},
|
|
28
|
+
/******/
|
|
29
|
+
id: l,
|
|
30
|
+
/******/
|
|
31
|
+
loaded: !1
|
|
32
|
+
/******/
|
|
33
|
+
};
|
|
34
|
+
return t[l].call(v.exports, v, v.exports, p), v.loaded = !0, v.exports;
|
|
35
|
+
}
|
|
36
|
+
return p.m = t, p.c = r, p.p = "", p(0);
|
|
37
|
+
})([
|
|
38
|
+
/* 0 */
|
|
39
|
+
/***/
|
|
40
|
+
(function(t, r, p) {
|
|
41
|
+
Object.defineProperty(r, "__esModule", {
|
|
42
|
+
value: !0
|
|
43
|
+
}), r.isNotPNG = a, r.isNotAPNG = u, r.default = s;
|
|
44
|
+
var l = p(1), v = w(l), _ = p(2);
|
|
45
|
+
function w(f) {
|
|
46
|
+
return f && f.__esModule ? f : { default: f };
|
|
47
|
+
}
|
|
48
|
+
var e = new Error("Not a PNG"), n = new Error("Not an animated PNG");
|
|
49
|
+
function a(f) {
|
|
50
|
+
return f === e;
|
|
51
|
+
}
|
|
52
|
+
function u(f) {
|
|
53
|
+
return f === n;
|
|
54
|
+
}
|
|
55
|
+
var i = new Uint8Array([137, 80, 78, 71, 13, 10, 26, 10]);
|
|
56
|
+
function s(f) {
|
|
57
|
+
var g = new Uint8Array(f);
|
|
58
|
+
if (Array.prototype.some.call(i, function(T, D) {
|
|
59
|
+
return T !== g[D];
|
|
60
|
+
}))
|
|
61
|
+
return e;
|
|
62
|
+
var c = !1;
|
|
63
|
+
if (b(g, function(T) {
|
|
64
|
+
return !(c = T === "acTL");
|
|
65
|
+
}), !c)
|
|
66
|
+
return n;
|
|
67
|
+
var x = [], I = [], N = null, k = null, M = 0, O = new _.APNG();
|
|
68
|
+
if (b(g, function(T, D, E, $) {
|
|
69
|
+
var L = new DataView(D.buffer);
|
|
70
|
+
switch (T) {
|
|
71
|
+
case "IHDR":
|
|
72
|
+
N = D.subarray(E + 8, E + 8 + $), O.width = L.getUint32(E + 8), O.height = L.getUint32(E + 12);
|
|
73
|
+
break;
|
|
74
|
+
case "acTL":
|
|
75
|
+
O.numPlays = L.getUint32(E + 8 + 4);
|
|
76
|
+
break;
|
|
77
|
+
case "fcTL":
|
|
78
|
+
k && (O.frames.push(k), M++), k = new _.Frame(), k.width = L.getUint32(E + 8 + 4), k.height = L.getUint32(E + 8 + 8), k.left = L.getUint32(E + 8 + 12), k.top = L.getUint32(E + 8 + 16);
|
|
79
|
+
var pe = L.getUint16(E + 8 + 20), te = L.getUint16(E + 8 + 22);
|
|
80
|
+
te === 0 && (te = 100), k.delay = 1e3 * pe / te, k.delay <= 10 && (k.delay = 100), O.playTime += k.delay, k.disposeOp = L.getUint8(E + 8 + 24), k.blendOp = L.getUint8(E + 8 + 25), k.dataParts = [], M === 0 && k.disposeOp === 2 && (k.disposeOp = 1);
|
|
81
|
+
break;
|
|
82
|
+
case "fdAT":
|
|
83
|
+
k && k.dataParts.push(D.subarray(E + 8 + 4, E + 8 + $));
|
|
84
|
+
break;
|
|
85
|
+
case "IDAT":
|
|
86
|
+
k && k.dataParts.push(D.subarray(E + 8, E + 8 + $));
|
|
87
|
+
break;
|
|
88
|
+
case "IEND":
|
|
89
|
+
I.push(y(D, E, 12 + $));
|
|
90
|
+
break;
|
|
91
|
+
default:
|
|
92
|
+
x.push(y(D, E, 12 + $));
|
|
93
|
+
}
|
|
94
|
+
}), k && O.frames.push(k), O.frames.length == 0)
|
|
95
|
+
return n;
|
|
96
|
+
var G = new Blob(x), W = new Blob(I);
|
|
97
|
+
return O.frames.forEach(function(T) {
|
|
98
|
+
var D = [];
|
|
99
|
+
D.push(i), N.set(d(T.width), 0), N.set(d(T.height), 4), D.push(F("IHDR", N)), D.push(G), T.dataParts.forEach(function(E) {
|
|
100
|
+
return D.push(F("IDAT", E));
|
|
101
|
+
}), D.push(W), T.imageData = new Blob(D, { type: "image/png" }), delete T.dataParts, D = null;
|
|
102
|
+
}), O;
|
|
103
|
+
}
|
|
104
|
+
function b(f, g) {
|
|
105
|
+
var c = new DataView(f.buffer), x = 8, I = void 0, N = void 0, k = void 0;
|
|
106
|
+
do
|
|
107
|
+
N = c.getUint32(x), I = h(f, x + 4, 4), k = g(I, f, x, N), x += 12 + N;
|
|
108
|
+
while (k !== !1 && I != "IEND" && x < f.length);
|
|
109
|
+
}
|
|
110
|
+
function h(f, g, c) {
|
|
111
|
+
var x = Array.prototype.slice.call(f.subarray(g, g + c));
|
|
112
|
+
return String.fromCharCode.apply(String, x);
|
|
113
|
+
}
|
|
114
|
+
function A(f) {
|
|
115
|
+
for (var g = new Uint8Array(f.length), c = 0; c < f.length; c++)
|
|
116
|
+
g[c] = f.charCodeAt(c);
|
|
117
|
+
return g;
|
|
118
|
+
}
|
|
119
|
+
function y(f, g, c) {
|
|
120
|
+
var x = new Uint8Array(c);
|
|
121
|
+
return x.set(f.subarray(g, g + c)), x;
|
|
122
|
+
}
|
|
123
|
+
var F = function(g, c) {
|
|
124
|
+
var x = g.length + c.length, I = new Uint8Array(x + 8), N = new DataView(I.buffer);
|
|
125
|
+
N.setUint32(0, c.length), I.set(A(g), 4), I.set(c, 8);
|
|
126
|
+
var k = (0, v.default)(I, 4, x);
|
|
127
|
+
return N.setUint32(x + 4, k), I;
|
|
128
|
+
}, d = function(g) {
|
|
129
|
+
return new Uint8Array([g >>> 24 & 255, g >>> 16 & 255, g >>> 8 & 255, g & 255]);
|
|
130
|
+
};
|
|
131
|
+
}),
|
|
132
|
+
/* 1 */
|
|
133
|
+
/***/
|
|
134
|
+
(function(t, r) {
|
|
135
|
+
Object.defineProperty(r, "__esModule", {
|
|
136
|
+
value: !0
|
|
137
|
+
}), r.default = function(w) {
|
|
138
|
+
for (var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : w.length - e, a = -1, u = e, i = e + n; u < i; u++)
|
|
139
|
+
a = a >>> 8 ^ p[(a ^ w[u]) & 255];
|
|
140
|
+
return a ^ -1;
|
|
141
|
+
};
|
|
142
|
+
for (var p = new Uint32Array(256), l = 0; l < 256; l++) {
|
|
143
|
+
for (var v = l, _ = 0; _ < 8; _++)
|
|
144
|
+
v = (v & 1) !== 0 ? 3988292384 ^ v >>> 1 : v >>> 1;
|
|
145
|
+
p[l] = v;
|
|
146
|
+
}
|
|
147
|
+
}),
|
|
148
|
+
/* 2 */
|
|
149
|
+
/***/
|
|
150
|
+
(function(t, r, p) {
|
|
151
|
+
Object.defineProperty(r, "__esModule", {
|
|
152
|
+
value: !0
|
|
153
|
+
}), r.Frame = r.APNG = void 0;
|
|
154
|
+
var l = /* @__PURE__ */ (function() {
|
|
155
|
+
function n(a, u) {
|
|
156
|
+
for (var i = 0; i < u.length; i++) {
|
|
157
|
+
var s = u[i];
|
|
158
|
+
s.enumerable = s.enumerable || !1, s.configurable = !0, "value" in s && (s.writable = !0), Object.defineProperty(a, s.key, s);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
return function(a, u, i) {
|
|
162
|
+
return u && n(a.prototype, u), i && n(a, i), a;
|
|
163
|
+
};
|
|
164
|
+
})(), v = p(3), _ = w(v);
|
|
165
|
+
function w(n) {
|
|
166
|
+
return n && n.__esModule ? n : { default: n };
|
|
167
|
+
}
|
|
168
|
+
function e(n, a) {
|
|
169
|
+
if (!(n instanceof a))
|
|
170
|
+
throw new TypeError("Cannot call a class as a function");
|
|
171
|
+
}
|
|
172
|
+
r.APNG = (function() {
|
|
173
|
+
function n() {
|
|
174
|
+
e(this, n), this.width = 0, this.height = 0, this.numPlays = 0, this.playTime = 0, this.frames = [];
|
|
175
|
+
}
|
|
176
|
+
return l(n, [{
|
|
177
|
+
key: "createImages",
|
|
178
|
+
/**
|
|
179
|
+
*
|
|
180
|
+
* @return {Promise.<*>}
|
|
181
|
+
*/
|
|
182
|
+
value: function() {
|
|
183
|
+
return Promise.all(this.frames.map(function(u) {
|
|
184
|
+
return u.createImage();
|
|
185
|
+
}));
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
*
|
|
189
|
+
* @param {CanvasRenderingContext2D} context
|
|
190
|
+
* @param {boolean} autoPlay
|
|
191
|
+
* @return {Promise.<Player>}
|
|
192
|
+
*/
|
|
193
|
+
}, {
|
|
194
|
+
key: "getPlayer",
|
|
195
|
+
value: function(u) {
|
|
196
|
+
var i = this, s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
|
|
197
|
+
return this.createImages().then(function() {
|
|
198
|
+
return new _.default(i, u, s);
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
}]), n;
|
|
202
|
+
})(), r.Frame = (function() {
|
|
203
|
+
function n() {
|
|
204
|
+
e(this, n), this.left = 0, this.top = 0, this.width = 0, this.height = 0, this.delay = 0, this.disposeOp = 0, this.blendOp = 0, this.imageData = null, this.imageElement = null;
|
|
205
|
+
}
|
|
206
|
+
return l(n, [{
|
|
207
|
+
key: "createImage",
|
|
208
|
+
value: function() {
|
|
209
|
+
var u = this;
|
|
210
|
+
return this.imageElement ? Promise.resolve() : new Promise(function(i, s) {
|
|
211
|
+
var b = URL.createObjectURL(u.imageData);
|
|
212
|
+
u.imageElement = document.createElement("img"), u.imageElement.onload = function() {
|
|
213
|
+
URL.revokeObjectURL(b), i();
|
|
214
|
+
}, u.imageElement.onerror = function() {
|
|
215
|
+
URL.revokeObjectURL(b), u.imageElement = null, s(new Error("Image creation error"));
|
|
216
|
+
}, u.imageElement.src = b;
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
}]), n;
|
|
220
|
+
})();
|
|
221
|
+
}),
|
|
222
|
+
/* 3 */
|
|
223
|
+
/***/
|
|
224
|
+
(function(t, r, p) {
|
|
225
|
+
Object.defineProperty(r, "__esModule", {
|
|
226
|
+
value: !0
|
|
227
|
+
});
|
|
228
|
+
var l = /* @__PURE__ */ (function() {
|
|
229
|
+
function i(s, b) {
|
|
230
|
+
for (var h = 0; h < b.length; h++) {
|
|
231
|
+
var A = b[h];
|
|
232
|
+
A.enumerable = A.enumerable || !1, A.configurable = !0, "value" in A && (A.writable = !0), Object.defineProperty(s, A.key, A);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
return function(s, b, h) {
|
|
236
|
+
return b && i(s.prototype, b), h && i(s, h), s;
|
|
237
|
+
};
|
|
238
|
+
})(), v = p(4), _ = w(v);
|
|
239
|
+
function w(i) {
|
|
240
|
+
return i && i.__esModule ? i : { default: i };
|
|
241
|
+
}
|
|
242
|
+
function e(i, s) {
|
|
243
|
+
if (!(i instanceof s))
|
|
244
|
+
throw new TypeError("Cannot call a class as a function");
|
|
245
|
+
}
|
|
246
|
+
function n(i, s) {
|
|
247
|
+
if (!i)
|
|
248
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
249
|
+
return s && (typeof s == "object" || typeof s == "function") ? s : i;
|
|
250
|
+
}
|
|
251
|
+
function a(i, s) {
|
|
252
|
+
if (typeof s != "function" && s !== null)
|
|
253
|
+
throw new TypeError("Super expression must either be null or a function, not " + typeof s);
|
|
254
|
+
i.prototype = Object.create(s && s.prototype, { constructor: { value: i, enumerable: !1, writable: !0, configurable: !0 } }), s && (Object.setPrototypeOf ? Object.setPrototypeOf(i, s) : i.__proto__ = s);
|
|
255
|
+
}
|
|
256
|
+
var u = (function(i) {
|
|
257
|
+
a(s, i);
|
|
258
|
+
function s(b, h, A) {
|
|
259
|
+
e(this, s);
|
|
260
|
+
var y = n(this, (s.__proto__ || Object.getPrototypeOf(s)).call(this));
|
|
261
|
+
return y.playbackRate = 1, y._currentFrameNumber = 0, y._ended = !1, y._paused = !0, y._numPlays = 0, y._rafId = null, y._apng = b, y.context = h, y.stop(), A && y.play(), y;
|
|
262
|
+
}
|
|
263
|
+
return l(s, [{
|
|
264
|
+
key: "renderNextFrame",
|
|
265
|
+
value: function() {
|
|
266
|
+
this._currentFrameNumber = (this._currentFrameNumber + 1) % this._apng.frames.length, this._currentFrameNumber === this._apng.frames.length - 1 && (this._numPlays++, this._apng.numPlays !== 0 && this._numPlays >= this._apng.numPlays && (this._ended = !0, this._paused = !0)), this._prevFrame && this._prevFrame.disposeOp == 1 ? this.context.clearRect(this._prevFrame.left, this._prevFrame.top, this._prevFrame.width, this._prevFrame.height) : this._prevFrame && this._prevFrame.disposeOp == 2 && this.context.putImageData(this._prevFrameData, this._prevFrame.left, this._prevFrame.top);
|
|
267
|
+
var h = this.currentFrame;
|
|
268
|
+
this._prevFrame = h, this._prevFrameData = null, h.disposeOp == 2 && (this._prevFrameData = this.context.getImageData(h.left, h.top, h.width, h.height)), h.blendOp == 0 && this.context.clearRect(h.left, h.top, h.width, h.height), this.context.drawImage(h.imageElement, h.left, h.top), this.emit("frame", this._currentFrameNumber), this._ended && this.emit("end");
|
|
269
|
+
}
|
|
270
|
+
// playback
|
|
271
|
+
}, {
|
|
272
|
+
key: "play",
|
|
273
|
+
value: function() {
|
|
274
|
+
var h = this;
|
|
275
|
+
this._rafId && cancelAnimationFrame(this._rafId), this.emit("play"), this._ended && this.stop(), this._paused = !1;
|
|
276
|
+
var A = performance.now() + this.currentFrame.delay / this.playbackRate, y = function F(d) {
|
|
277
|
+
if (!(h._ended || h._paused)) {
|
|
278
|
+
if (d >= A) {
|
|
279
|
+
for (; d - A >= h._apng.playTime / h.playbackRate; )
|
|
280
|
+
A += h._apng.playTime / h.playbackRate, h._numPlays++;
|
|
281
|
+
do
|
|
282
|
+
h.renderNextFrame(), A += h.currentFrame.delay / h.playbackRate;
|
|
283
|
+
while (!h._ended && !h._paused && d > A);
|
|
284
|
+
}
|
|
285
|
+
h._rafId = requestAnimationFrame(F);
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
this._rafId = requestAnimationFrame(y);
|
|
289
|
+
}
|
|
290
|
+
}, {
|
|
291
|
+
key: "pause",
|
|
292
|
+
value: function() {
|
|
293
|
+
this._paused || (this._rafId && (cancelAnimationFrame(this._rafId), this._rafId = null), this.emit("pause"), this._paused = !0);
|
|
294
|
+
}
|
|
295
|
+
}, {
|
|
296
|
+
key: "stop",
|
|
297
|
+
value: function() {
|
|
298
|
+
this._rafId && (cancelAnimationFrame(this._rafId), this._rafId = null), this.emit("stop"), this._numPlays = 0, this._ended = !1, this._paused = !0, this._currentFrameNumber = -1, this.context.clearRect(0, 0, this._apng.width, this._apng.height), this.renderNextFrame();
|
|
299
|
+
}
|
|
300
|
+
}, {
|
|
301
|
+
key: "currentFrameNumber",
|
|
302
|
+
get: function() {
|
|
303
|
+
return this._currentFrameNumber;
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
*
|
|
307
|
+
* @return {Frame}
|
|
308
|
+
*/
|
|
309
|
+
}, {
|
|
310
|
+
key: "currentFrame",
|
|
311
|
+
get: function() {
|
|
312
|
+
return this._apng.frames[this._currentFrameNumber];
|
|
313
|
+
}
|
|
314
|
+
}, {
|
|
315
|
+
key: "paused",
|
|
316
|
+
get: function() {
|
|
317
|
+
return this._paused;
|
|
318
|
+
}
|
|
319
|
+
}, {
|
|
320
|
+
key: "ended",
|
|
321
|
+
get: function() {
|
|
322
|
+
return this._ended;
|
|
323
|
+
}
|
|
324
|
+
}]), s;
|
|
325
|
+
})(_.default);
|
|
326
|
+
r.default = u;
|
|
327
|
+
}),
|
|
328
|
+
/* 4 */
|
|
329
|
+
/***/
|
|
330
|
+
(function(t, r) {
|
|
331
|
+
function p() {
|
|
332
|
+
this._events = this._events || {}, this._maxListeners = this._maxListeners || void 0;
|
|
333
|
+
}
|
|
334
|
+
t.exports = p, p.EventEmitter = p, p.prototype._events = void 0, p.prototype._maxListeners = void 0, p.defaultMaxListeners = 10, p.prototype.setMaxListeners = function(e) {
|
|
335
|
+
if (!v(e) || e < 0 || isNaN(e))
|
|
336
|
+
throw TypeError("n must be a positive number");
|
|
337
|
+
return this._maxListeners = e, this;
|
|
338
|
+
}, p.prototype.emit = function(e) {
|
|
339
|
+
var n, a, u, i, s, b;
|
|
340
|
+
if (this._events || (this._events = {}), e === "error" && (!this._events.error || _(this._events.error) && !this._events.error.length)) {
|
|
341
|
+
if (n = arguments[1], n instanceof Error)
|
|
342
|
+
throw n;
|
|
343
|
+
var h = new Error('Uncaught, unspecified "error" event. (' + n + ")");
|
|
344
|
+
throw h.context = n, h;
|
|
345
|
+
}
|
|
346
|
+
if (a = this._events[e], w(a))
|
|
347
|
+
return !1;
|
|
348
|
+
if (l(a))
|
|
349
|
+
switch (arguments.length) {
|
|
350
|
+
// fast cases
|
|
351
|
+
case 1:
|
|
352
|
+
a.call(this);
|
|
353
|
+
break;
|
|
354
|
+
case 2:
|
|
355
|
+
a.call(this, arguments[1]);
|
|
356
|
+
break;
|
|
357
|
+
case 3:
|
|
358
|
+
a.call(this, arguments[1], arguments[2]);
|
|
359
|
+
break;
|
|
360
|
+
// slower
|
|
361
|
+
default:
|
|
362
|
+
i = Array.prototype.slice.call(arguments, 1), a.apply(this, i);
|
|
363
|
+
}
|
|
364
|
+
else if (_(a))
|
|
365
|
+
for (i = Array.prototype.slice.call(arguments, 1), b = a.slice(), u = b.length, s = 0; s < u; s++)
|
|
366
|
+
b[s].apply(this, i);
|
|
367
|
+
return !0;
|
|
368
|
+
}, p.prototype.addListener = function(e, n) {
|
|
369
|
+
var a;
|
|
370
|
+
if (!l(n))
|
|
371
|
+
throw TypeError("listener must be a function");
|
|
372
|
+
return this._events || (this._events = {}), this._events.newListener && this.emit(
|
|
373
|
+
"newListener",
|
|
374
|
+
e,
|
|
375
|
+
l(n.listener) ? n.listener : n
|
|
376
|
+
), this._events[e] ? _(this._events[e]) ? this._events[e].push(n) : this._events[e] = [this._events[e], n] : this._events[e] = n, _(this._events[e]) && !this._events[e].warned && (w(this._maxListeners) ? a = p.defaultMaxListeners : a = this._maxListeners, a && a > 0 && this._events[e].length > a && (this._events[e].warned = !0, console.error(
|
|
377
|
+
"(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",
|
|
378
|
+
this._events[e].length
|
|
379
|
+
), typeof console.trace == "function" && console.trace())), this;
|
|
380
|
+
}, p.prototype.on = p.prototype.addListener, p.prototype.once = function(e, n) {
|
|
381
|
+
if (!l(n))
|
|
382
|
+
throw TypeError("listener must be a function");
|
|
383
|
+
var a = !1;
|
|
384
|
+
function u() {
|
|
385
|
+
this.removeListener(e, u), a || (a = !0, n.apply(this, arguments));
|
|
386
|
+
}
|
|
387
|
+
return u.listener = n, this.on(e, u), this;
|
|
388
|
+
}, p.prototype.removeListener = function(e, n) {
|
|
389
|
+
var a, u, i, s;
|
|
390
|
+
if (!l(n))
|
|
391
|
+
throw TypeError("listener must be a function");
|
|
392
|
+
if (!this._events || !this._events[e])
|
|
393
|
+
return this;
|
|
394
|
+
if (a = this._events[e], i = a.length, u = -1, a === n || l(a.listener) && a.listener === n)
|
|
395
|
+
delete this._events[e], this._events.removeListener && this.emit("removeListener", e, n);
|
|
396
|
+
else if (_(a)) {
|
|
397
|
+
for (s = i; s-- > 0; )
|
|
398
|
+
if (a[s] === n || a[s].listener && a[s].listener === n) {
|
|
399
|
+
u = s;
|
|
400
|
+
break;
|
|
401
|
+
}
|
|
402
|
+
if (u < 0)
|
|
403
|
+
return this;
|
|
404
|
+
a.length === 1 ? (a.length = 0, delete this._events[e]) : a.splice(u, 1), this._events.removeListener && this.emit("removeListener", e, n);
|
|
405
|
+
}
|
|
406
|
+
return this;
|
|
407
|
+
}, p.prototype.removeAllListeners = function(e) {
|
|
408
|
+
var n, a;
|
|
409
|
+
if (!this._events)
|
|
410
|
+
return this;
|
|
411
|
+
if (!this._events.removeListener)
|
|
412
|
+
return arguments.length === 0 ? this._events = {} : this._events[e] && delete this._events[e], this;
|
|
413
|
+
if (arguments.length === 0) {
|
|
414
|
+
for (n in this._events)
|
|
415
|
+
n !== "removeListener" && this.removeAllListeners(n);
|
|
416
|
+
return this.removeAllListeners("removeListener"), this._events = {}, this;
|
|
417
|
+
}
|
|
418
|
+
if (a = this._events[e], l(a))
|
|
419
|
+
this.removeListener(e, a);
|
|
420
|
+
else if (a)
|
|
421
|
+
for (; a.length; )
|
|
422
|
+
this.removeListener(e, a[a.length - 1]);
|
|
423
|
+
return delete this._events[e], this;
|
|
424
|
+
}, p.prototype.listeners = function(e) {
|
|
425
|
+
var n;
|
|
426
|
+
return !this._events || !this._events[e] ? n = [] : l(this._events[e]) ? n = [this._events[e]] : n = this._events[e].slice(), n;
|
|
427
|
+
}, p.prototype.listenerCount = function(e) {
|
|
428
|
+
if (this._events) {
|
|
429
|
+
var n = this._events[e];
|
|
430
|
+
if (l(n))
|
|
431
|
+
return 1;
|
|
432
|
+
if (n)
|
|
433
|
+
return n.length;
|
|
434
|
+
}
|
|
435
|
+
return 0;
|
|
436
|
+
}, p.listenerCount = function(e, n) {
|
|
437
|
+
return e.listenerCount(n);
|
|
438
|
+
};
|
|
439
|
+
function l(e) {
|
|
440
|
+
return typeof e == "function";
|
|
441
|
+
}
|
|
442
|
+
function v(e) {
|
|
443
|
+
return typeof e == "number";
|
|
444
|
+
}
|
|
445
|
+
function _(e) {
|
|
446
|
+
return typeof e == "object" && e !== null;
|
|
447
|
+
}
|
|
448
|
+
function w(e) {
|
|
449
|
+
return e === void 0;
|
|
450
|
+
}
|
|
451
|
+
})
|
|
452
|
+
/******/
|
|
453
|
+
])
|
|
454
|
+
);
|
|
455
|
+
});
|
|
456
|
+
})(X)), X.exports;
|
|
457
|
+
}
|
|
458
|
+
var Ae = Pe();
|
|
459
|
+
const Ee = /* @__PURE__ */ Fe(Ae), q = {
|
|
998
460
|
url: {
|
|
999
461
|
type: String,
|
|
1000
|
-
requierd:
|
|
462
|
+
requierd: !1
|
|
1001
463
|
},
|
|
1002
464
|
data: {
|
|
1003
465
|
type: Array,
|
|
@@ -1008,14 +470,14 @@ const props = {
|
|
|
1008
470
|
*/
|
|
1009
471
|
loop: {
|
|
1010
472
|
type: Boolean,
|
|
1011
|
-
default:
|
|
473
|
+
default: !1
|
|
1012
474
|
},
|
|
1013
475
|
/**
|
|
1014
476
|
* @description v-model:status 控制动画状态
|
|
1015
477
|
*/
|
|
1016
478
|
status: {
|
|
1017
479
|
type: String,
|
|
1018
|
-
default:
|
|
480
|
+
default: m.pending
|
|
1019
481
|
},
|
|
1020
482
|
frameRate: {
|
|
1021
483
|
type: Number,
|
|
@@ -1034,551 +496,318 @@ const props = {
|
|
|
1034
496
|
*/
|
|
1035
497
|
prerender: {
|
|
1036
498
|
type: Boolean,
|
|
1037
|
-
default:
|
|
499
|
+
default: !1
|
|
1038
500
|
},
|
|
1039
501
|
visible: {
|
|
1040
502
|
type: Boolean,
|
|
1041
|
-
default:
|
|
503
|
+
default: !0
|
|
1042
504
|
}
|
|
1043
|
-
}
|
|
1044
|
-
const emits = {
|
|
505
|
+
}, j = {
|
|
1045
506
|
"update:status": null,
|
|
1046
507
|
"update:data": null,
|
|
1047
|
-
|
|
1048
|
-
};
|
|
1049
|
-
|
|
1050
|
-
const
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
const whenDef = new Deferred();
|
|
1054
|
-
const context = {
|
|
1055
|
-
whenDef,
|
|
1056
|
-
when: () => whenDef.promise
|
|
508
|
+
setData: null
|
|
509
|
+
}, le = /* @__PURE__ */ Symbol("appInjectKey");
|
|
510
|
+
function Ie() {
|
|
511
|
+
const o = new _e(), P = new ge(), t = {
|
|
512
|
+
whenDef: P,
|
|
513
|
+
when: () => P.promise
|
|
1057
514
|
};
|
|
1058
|
-
|
|
1059
|
-
application,
|
|
1060
|
-
context
|
|
1061
|
-
});
|
|
1062
|
-
return { application, context };
|
|
515
|
+
return de(le, {
|
|
516
|
+
application: o,
|
|
517
|
+
context: t
|
|
518
|
+
}), { application: o, context: t };
|
|
1063
519
|
}
|
|
1064
|
-
function
|
|
1065
|
-
const
|
|
1066
|
-
if (!
|
|
520
|
+
function ce() {
|
|
521
|
+
const o = fe(le);
|
|
522
|
+
if (!o)
|
|
1067
523
|
throw new Error("Pixi app not provided");
|
|
1068
|
-
|
|
1069
|
-
return core;
|
|
524
|
+
return o;
|
|
1070
525
|
}
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
sprite.visible = props.visible ?? true;
|
|
1080
|
-
});
|
|
1081
|
-
watchEffect(() => {
|
|
1082
|
-
props.label && (sprite.label = props.label);
|
|
1083
|
-
});
|
|
1084
|
-
autoResize && context.when().then((app2) => {
|
|
1085
|
-
if (sprite.texture) {
|
|
1086
|
-
resizeSprite();
|
|
1087
|
-
app2.renderer.on("resize", resizeSprite);
|
|
1088
|
-
}
|
|
526
|
+
function z(o) {
|
|
527
|
+
const P = o.autoResize ?? !0, t = o.resize ?? _, { application: r, context: p } = ce(), l = new ye();
|
|
528
|
+
r.stage.addChild(l), B(() => {
|
|
529
|
+
l.visible = o.visible ?? !0;
|
|
530
|
+
}), B(() => {
|
|
531
|
+
o.label && (l.label = o.label);
|
|
532
|
+
}), P && p.when().then((w) => {
|
|
533
|
+
l.texture && (v(), w.renderer.on("resize", v));
|
|
1089
534
|
});
|
|
1090
|
-
function
|
|
1091
|
-
if (!
|
|
535
|
+
function v() {
|
|
536
|
+
if (!r.renderer?.screen)
|
|
1092
537
|
return;
|
|
1093
|
-
const
|
|
1094
|
-
|
|
1095
|
-
application:
|
|
1096
|
-
sprite,
|
|
1097
|
-
meta
|
|
538
|
+
const w = l.texture._meta;
|
|
539
|
+
t({
|
|
540
|
+
application: r,
|
|
541
|
+
sprite: l,
|
|
542
|
+
meta: w
|
|
1098
543
|
});
|
|
1099
544
|
}
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
app.stage.removeChild(sprite);
|
|
545
|
+
S(() => {
|
|
546
|
+
r.renderer.off("resize", v), r.stage.removeChild(l);
|
|
1103
547
|
});
|
|
1104
|
-
function
|
|
1105
|
-
const
|
|
1106
|
-
|
|
1107
|
-
const scale = Math.min(scaleX, scaleY);
|
|
1108
|
-
sprite.scale.set(scale);
|
|
1109
|
-
sprite.x = (app.screen.width - sprite.width) / 2;
|
|
1110
|
-
sprite.y = (app.screen.height - sprite.height) / 2;
|
|
548
|
+
function _() {
|
|
549
|
+
const w = r.screen.width / l.texture.width, e = r.screen.height / l.texture.height, n = Math.min(w, e);
|
|
550
|
+
l.scale.set(n), l.x = (r.screen.width - l.width) / 2, l.y = (r.screen.height - l.height) / 2;
|
|
1111
551
|
}
|
|
1112
552
|
return {
|
|
1113
|
-
sprite,
|
|
1114
|
-
resizeSprite,
|
|
1115
|
-
application:
|
|
553
|
+
sprite: l,
|
|
554
|
+
resizeSprite: v,
|
|
555
|
+
application: r
|
|
1116
556
|
};
|
|
1117
557
|
}
|
|
1118
|
-
|
|
1119
|
-
var _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
558
|
+
const Ne = /* @__PURE__ */ C({
|
|
1120
559
|
__name: "apng",
|
|
1121
560
|
props: {
|
|
1122
|
-
...
|
|
561
|
+
...q,
|
|
1123
562
|
url: {
|
|
1124
563
|
type: String,
|
|
1125
|
-
required:
|
|
564
|
+
required: !0
|
|
1126
565
|
}
|
|
1127
566
|
},
|
|
1128
|
-
emits,
|
|
1129
|
-
setup(
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
const index = ref(0);
|
|
1138
|
-
const isLoaded = ref(false);
|
|
1139
|
-
const error = ref("");
|
|
1140
|
-
const textureMap = /* @__PURE__ */ new Map();
|
|
1141
|
-
let timer = null;
|
|
1142
|
-
let reusableCanvas = null;
|
|
1143
|
-
let reusableCtx = null;
|
|
1144
|
-
onMounted(() => loadAPNG(props.url));
|
|
1145
|
-
function getReusableCanvas(width, height) {
|
|
1146
|
-
if (!reusableCanvas) {
|
|
1147
|
-
reusableCanvas = document.createElement("canvas");
|
|
1148
|
-
reusableCtx = reusableCanvas.getContext("2d", {
|
|
1149
|
-
willReadFrequently: true
|
|
1150
|
-
});
|
|
1151
|
-
}
|
|
1152
|
-
if (reusableCanvas.width !== width || reusableCanvas.height !== height) {
|
|
1153
|
-
reusableCanvas.width = width;
|
|
1154
|
-
reusableCanvas.height = height;
|
|
1155
|
-
}
|
|
1156
|
-
return { canvas: reusableCanvas, ctx: reusableCtx };
|
|
567
|
+
emits: j,
|
|
568
|
+
setup(o, { emit: P }) {
|
|
569
|
+
const t = o, r = P, p = ne(), l = (c) => `${p}-apng-frame-${c}`, { sprite: v, resizeSprite: _ } = z(t), w = U([]), e = U(0), n = U(!1), a = U(""), u = /* @__PURE__ */ new Map();
|
|
570
|
+
let i = null, s = null, b = null;
|
|
571
|
+
ae(() => A(t.url));
|
|
572
|
+
function h(c, x) {
|
|
573
|
+
return s || (s = document.createElement("canvas"), b = s.getContext("2d", {
|
|
574
|
+
willReadFrequently: !0
|
|
575
|
+
})), (s.width !== c || s.height !== x) && (s.width = c, s.height = x), { canvas: s, ctx: b };
|
|
1157
576
|
}
|
|
1158
|
-
async function
|
|
577
|
+
async function A(c) {
|
|
1159
578
|
try {
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
const
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
await
|
|
1176
|
-
|
|
1177
|
-
ctx.drawImage(img, frame.left, frame.top);
|
|
1178
|
-
const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
|
|
1179
|
-
const alias = getAlias(frameIndex);
|
|
1180
|
-
textureMap.set(alias, void 0);
|
|
1181
|
-
ctx.putImageData(imageData, 0, 0);
|
|
1182
|
-
const dataUrl = canvas.toDataURL();
|
|
1183
|
-
Assets.add({ alias, src: dataUrl });
|
|
1184
|
-
const texture = await Assets.load(alias);
|
|
1185
|
-
textureMap.set(alias, texture);
|
|
1186
|
-
if (frameIndex === 0) {
|
|
1187
|
-
sprite.texture = texture;
|
|
1188
|
-
resizeSprite();
|
|
1189
|
-
}
|
|
1190
|
-
return alias;
|
|
579
|
+
a.value = "", n.value = !1, await g();
|
|
580
|
+
const x = await fetch(c);
|
|
581
|
+
if (!x.ok)
|
|
582
|
+
throw new Error(`加载APNG失败: ${x.status}`);
|
|
583
|
+
const I = await x.arrayBuffer(), N = Ee(I);
|
|
584
|
+
if (N instanceof Error)
|
|
585
|
+
throw new TypeError(`APNG解析失败: ${N.message}`);
|
|
586
|
+
const { canvas: k, ctx: M } = h(N.width, N.height), O = N.frames.map(async (G, W) => {
|
|
587
|
+
M.clearRect(0, 0, k.width, k.height), await G.createImage();
|
|
588
|
+
const T = G.imageElement;
|
|
589
|
+
M.drawImage(T, G.left, G.top);
|
|
590
|
+
const D = M.getImageData(0, 0, k.width, k.height), E = l(W);
|
|
591
|
+
u.set(E, void 0), M.putImageData(D, 0, 0);
|
|
592
|
+
const $ = k.toDataURL();
|
|
593
|
+
R.add({ alias: E, src: $ });
|
|
594
|
+
const L = await R.load(E);
|
|
595
|
+
return u.set(E, L), W === 0 && (v.texture = L, _()), E;
|
|
1191
596
|
});
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
console.error("\u52A0\u8F7DAPNG\u5931\u8D25:", err);
|
|
1196
|
-
error.value = err instanceof Error ? err.message : "\u52A0\u8F7DAPNG\u5931\u8D25";
|
|
1197
|
-
emit("update:status", TickerStatus.stopped);
|
|
597
|
+
w.value = await Promise.all(O), n.value = !0;
|
|
598
|
+
} catch (x) {
|
|
599
|
+
console.error("加载APNG失败:", x), a.value = x instanceof Error ? x.message : "加载APNG失败", r("update:status", m.stopped);
|
|
1198
600
|
}
|
|
1199
601
|
}
|
|
1200
|
-
function
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
timer = window.setInterval(() => {
|
|
1204
|
-
if (frames.value.length === 0 || props.status !== TickerStatus.playing) {
|
|
602
|
+
function y() {
|
|
603
|
+
i === null && (i = window.setInterval(() => {
|
|
604
|
+
if (w.value.length === 0 || t.status !== m.playing)
|
|
1205
605
|
return;
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
getAlias(index.value)
|
|
606
|
+
const c = u.get(
|
|
607
|
+
l(e.value)
|
|
1209
608
|
);
|
|
1210
|
-
if (
|
|
1211
|
-
const
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
sprite.texture = currentTexture;
|
|
1219
|
-
resizeSprite();
|
|
1220
|
-
index.value = props.loop ? (index.value + 1) % frames.value.length : index.value + 1;
|
|
1221
|
-
} else {
|
|
1222
|
-
if (!props.loop)
|
|
1223
|
-
emit("update:status", TickerStatus.paused);
|
|
1224
|
-
}
|
|
1225
|
-
}, 1e3 / props.frameRate);
|
|
609
|
+
if (c) {
|
|
610
|
+
const x = e.value - 1;
|
|
611
|
+
x >= 0 && !t.loop && Promise.resolve().then(() => Z(500)).then(() => {
|
|
612
|
+
R.unload(l(x)), u.delete(l(x));
|
|
613
|
+
}), v.texture = c, _(), e.value = t.loop ? (e.value + 1) % w.value.length : e.value + 1;
|
|
614
|
+
} else
|
|
615
|
+
t.loop || r("update:status", m.paused);
|
|
616
|
+
}, 1e3 / t.frameRate));
|
|
1226
617
|
}
|
|
1227
|
-
function
|
|
1228
|
-
|
|
1229
|
-
return;
|
|
1230
|
-
}
|
|
1231
|
-
emit("update:status", TickerStatus.playing);
|
|
1232
|
-
startFrameLoop();
|
|
618
|
+
function F() {
|
|
619
|
+
!n.value || w.value.length <= 1 || (r("update:status", m.playing), y());
|
|
1233
620
|
}
|
|
1234
|
-
function
|
|
1235
|
-
|
|
1236
|
-
clearInterval(timer);
|
|
1237
|
-
timer = null;
|
|
1238
|
-
}
|
|
1239
|
-
emit("update:status", TickerStatus.paused);
|
|
621
|
+
function d() {
|
|
622
|
+
i !== null && (clearInterval(i), i = null), r("update:status", m.paused);
|
|
1240
623
|
}
|
|
1241
|
-
function
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
}
|
|
1246
|
-
index.value = 0;
|
|
1247
|
-
const firstTexture = textureMap.get(getAlias(0));
|
|
1248
|
-
if (firstTexture) {
|
|
1249
|
-
sprite.texture = firstTexture;
|
|
1250
|
-
resizeSprite();
|
|
1251
|
-
}
|
|
1252
|
-
emit("update:status", TickerStatus.stopped);
|
|
624
|
+
function f() {
|
|
625
|
+
i !== null && (clearInterval(i), i = null), e.value = 0;
|
|
626
|
+
const c = u.get(l(0));
|
|
627
|
+
c && (v.texture = c, _()), r("update:status", m.stopped);
|
|
1253
628
|
}
|
|
1254
|
-
async function
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
for (const [alias, texture] of textureMap) {
|
|
1261
|
-
if (texture && texture !== Texture.EMPTY) {
|
|
1262
|
-
unloadPromises.push(Assets.unload(alias));
|
|
1263
|
-
}
|
|
1264
|
-
}
|
|
1265
|
-
await Promise.all(unloadPromises);
|
|
1266
|
-
textureMap.clear();
|
|
1267
|
-
frames.value = [];
|
|
1268
|
-
index.value = 0;
|
|
1269
|
-
isLoaded.value = false;
|
|
1270
|
-
error.value = "";
|
|
1271
|
-
if (reusableCanvas) {
|
|
1272
|
-
reusableCanvas.width = 0;
|
|
1273
|
-
reusableCanvas.height = 0;
|
|
1274
|
-
}
|
|
629
|
+
async function g() {
|
|
630
|
+
i !== null && (clearInterval(i), i = null);
|
|
631
|
+
const c = [];
|
|
632
|
+
for (const [x, I] of u)
|
|
633
|
+
I && I !== ee.EMPTY && c.push(R.unload(x));
|
|
634
|
+
await Promise.all(c), u.clear(), w.value = [], e.value = 0, n.value = !1, a.value = "", s && (s.width = 0, s.height = 0);
|
|
1275
635
|
}
|
|
1276
|
-
|
|
1277
|
-
switch (
|
|
1278
|
-
case
|
|
1279
|
-
|
|
636
|
+
return B(() => {
|
|
637
|
+
switch (t.status) {
|
|
638
|
+
case m.play:
|
|
639
|
+
F();
|
|
1280
640
|
break;
|
|
1281
|
-
case
|
|
1282
|
-
|
|
641
|
+
case m.pause:
|
|
642
|
+
d();
|
|
1283
643
|
break;
|
|
1284
|
-
case
|
|
1285
|
-
|
|
644
|
+
case m.stop:
|
|
645
|
+
f();
|
|
1286
646
|
break;
|
|
1287
647
|
}
|
|
1288
|
-
})
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
reusableCanvas = null;
|
|
1292
|
-
reusableCtx = null;
|
|
1293
|
-
});
|
|
1294
|
-
const __returned__ = { props, emit, compId, getAlias, sprite, resizeSprite, frames, index, isLoaded, error, textureMap, get timer() {
|
|
1295
|
-
return timer;
|
|
1296
|
-
}, set timer(v) {
|
|
1297
|
-
timer = v;
|
|
1298
|
-
}, get reusableCanvas() {
|
|
1299
|
-
return reusableCanvas;
|
|
1300
|
-
}, set reusableCanvas(v) {
|
|
1301
|
-
reusableCanvas = v;
|
|
1302
|
-
}, get reusableCtx() {
|
|
1303
|
-
return reusableCtx;
|
|
1304
|
-
}, set reusableCtx(v) {
|
|
1305
|
-
reusableCtx = v;
|
|
1306
|
-
}, getReusableCanvas, loadAPNG, startFrameLoop, play, pause, stop, cleanup };
|
|
1307
|
-
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
1308
|
-
return __returned__;
|
|
648
|
+
}), S(async () => {
|
|
649
|
+
await g(), s = null, b = null;
|
|
650
|
+
}), (c, x) => V(c.$slots, "default");
|
|
1309
651
|
}
|
|
1310
|
-
})
|
|
1311
|
-
|
|
1312
|
-
function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1313
|
-
return renderSlot(_ctx.$slots, "default");
|
|
1314
|
-
}
|
|
1315
|
-
var ApngComp = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$8], ["__file", "/home/runner/work/vunk-plus/vunk-plus/packages/components/pixi-frame/src/apng.vue"]]);
|
|
1316
|
-
|
|
1317
|
-
var _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
652
|
+
}), Ge = /* @__PURE__ */ C({
|
|
1318
653
|
__name: "bitmap-generator",
|
|
1319
654
|
props: {
|
|
1320
|
-
...
|
|
655
|
+
...se(q, {
|
|
1321
656
|
excludes: ["loop"]
|
|
1322
657
|
}),
|
|
1323
658
|
generator: {
|
|
1324
659
|
type: Object,
|
|
1325
|
-
required:
|
|
660
|
+
required: !0
|
|
1326
661
|
}
|
|
1327
662
|
},
|
|
1328
663
|
emits: {
|
|
1329
664
|
"update:status": null,
|
|
1330
|
-
|
|
665
|
+
load: (o) => o
|
|
1331
666
|
},
|
|
1332
|
-
setup(
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
const emit = __emit;
|
|
1336
|
-
const { sprite, resizeSprite, application } = useSprite(props);
|
|
1337
|
-
const texture = new Texture({
|
|
1338
|
-
dynamic: true
|
|
667
|
+
setup(o, { emit: P }) {
|
|
668
|
+
const t = o, r = P, { sprite: p, resizeSprite: l, application: v } = z(t), _ = new ee({
|
|
669
|
+
dynamic: !0
|
|
1339
670
|
});
|
|
1340
|
-
|
|
1341
|
-
function
|
|
1342
|
-
|
|
1343
|
-
const
|
|
1344
|
-
resource:
|
|
671
|
+
p.texture = _;
|
|
672
|
+
function w(i) {
|
|
673
|
+
_.source.destroy();
|
|
674
|
+
const s = new oe({
|
|
675
|
+
resource: i
|
|
1345
676
|
});
|
|
1346
|
-
|
|
1347
|
-
texture.update();
|
|
1348
|
-
resizeSprite();
|
|
677
|
+
_.source = s, _.update(), l();
|
|
1349
678
|
}
|
|
1350
|
-
|
|
1351
|
-
application,
|
|
1352
|
-
sprite
|
|
1353
|
-
})
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
return;
|
|
1362
|
-
}
|
|
1363
|
-
props.generator.next().then(({ value, done }) => {
|
|
1364
|
-
if (done) {
|
|
1365
|
-
return emit("update:status", TickerStatus.stopped);
|
|
1366
|
-
}
|
|
1367
|
-
updateTextureFromBitmap(value);
|
|
679
|
+
r("load", {
|
|
680
|
+
application: v,
|
|
681
|
+
sprite: p
|
|
682
|
+
}), Q(() => t.status, (i) => {
|
|
683
|
+
i === m.play && n(), i === m.pause && a(), i === m.stop && u();
|
|
684
|
+
}, { immediate: !0 });
|
|
685
|
+
function e() {
|
|
686
|
+
t.status === m.playing && t.generator.next().then(({ value: i, done: s }) => {
|
|
687
|
+
if (s)
|
|
688
|
+
return r("update:status", m.stopped);
|
|
689
|
+
w(i);
|
|
1368
690
|
});
|
|
1369
691
|
}
|
|
1370
|
-
function
|
|
1371
|
-
|
|
1372
|
-
application.ticker.maxFPS = props.frameRate;
|
|
1373
|
-
emit("update:status", TickerStatus.playing);
|
|
1374
|
-
application.ticker.add(drawFrame);
|
|
692
|
+
function n() {
|
|
693
|
+
v.ticker.minFPS = t.frameRate, v.ticker.maxFPS = t.frameRate, r("update:status", m.playing), v.ticker.add(e);
|
|
1375
694
|
}
|
|
1376
|
-
function
|
|
1377
|
-
|
|
1378
|
-
emit("update:status", TickerStatus.paused);
|
|
695
|
+
function a() {
|
|
696
|
+
v.ticker.remove(e), r("update:status", m.paused);
|
|
1379
697
|
}
|
|
1380
|
-
function
|
|
1381
|
-
|
|
1382
|
-
emit("update:status", TickerStatus.stopped);
|
|
698
|
+
function u() {
|
|
699
|
+
v.ticker.remove(e), r("update:status", m.stopped);
|
|
1383
700
|
}
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
});
|
|
1388
|
-
const __returned__ = { props, emit, sprite, resizeSprite, application, texture, updateTextureFromBitmap, drawFrame, play, pause, stop };
|
|
1389
|
-
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
1390
|
-
return __returned__;
|
|
701
|
+
return S(() => {
|
|
702
|
+
u(), _.destroy();
|
|
703
|
+
}), (i, s) => V(i.$slots, "default");
|
|
1391
704
|
}
|
|
1392
|
-
})
|
|
1393
|
-
|
|
1394
|
-
function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1395
|
-
return renderSlot(_ctx.$slots, "default");
|
|
1396
|
-
}
|
|
1397
|
-
var bitmapGenerator = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$7], ["__file", "/home/runner/work/vunk-plus/vunk-plus/packages/components/pixi-frame/src/bitmap-generator.vue"]]);
|
|
1398
|
-
|
|
1399
|
-
var _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
705
|
+
}), De = /* @__PURE__ */ C({
|
|
1400
706
|
__name: "bitmap",
|
|
1401
707
|
props: {
|
|
1402
|
-
...
|
|
708
|
+
...se(q, {
|
|
1403
709
|
excludes: ["loop"]
|
|
1404
710
|
}),
|
|
1405
711
|
data: {
|
|
1406
712
|
type: void 0,
|
|
1407
|
-
required:
|
|
713
|
+
required: !0
|
|
1408
714
|
},
|
|
1409
715
|
frameIndex: {
|
|
1410
716
|
type: Number
|
|
1411
717
|
}
|
|
1412
718
|
},
|
|
1413
719
|
emits: {
|
|
1414
|
-
...
|
|
1415
|
-
|
|
720
|
+
...j,
|
|
721
|
+
load: (o) => o,
|
|
1416
722
|
"update:frameIndex": null,
|
|
1417
|
-
|
|
723
|
+
notFound: (o) => !0
|
|
1418
724
|
},
|
|
1419
|
-
setup(
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
const emit = __emit;
|
|
1423
|
-
const { sprite, resizeSprite, application } = useSprite(props);
|
|
1424
|
-
const texture = new Texture({
|
|
1425
|
-
dynamic: true
|
|
725
|
+
setup(o, { emit: P }) {
|
|
726
|
+
const t = o, r = P, { sprite: p, resizeSprite: l, application: v } = z(t), _ = new ee({
|
|
727
|
+
dynamic: !0
|
|
1426
728
|
});
|
|
1427
|
-
|
|
1428
|
-
function
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
resource: bitmap
|
|
729
|
+
p.texture = _;
|
|
730
|
+
function w(d) {
|
|
731
|
+
_.source?.resource?.close(), _.source?.destroy();
|
|
732
|
+
const f = new oe({
|
|
733
|
+
resource: d
|
|
1433
734
|
});
|
|
1434
|
-
|
|
1435
|
-
texture.update();
|
|
1436
|
-
resizeSprite();
|
|
735
|
+
_.source = f, _.update(), l();
|
|
1437
736
|
}
|
|
1438
|
-
|
|
1439
|
-
application,
|
|
1440
|
-
sprite
|
|
737
|
+
r("load", {
|
|
738
|
+
application: v,
|
|
739
|
+
sprite: p
|
|
1441
740
|
});
|
|
1442
|
-
const
|
|
741
|
+
const e = ie({
|
|
1443
742
|
default: 0,
|
|
1444
743
|
key: "frameIndex"
|
|
1445
|
-
},
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
lastScheduledClearIndex.value = frameIndex;
|
|
1451
|
-
sleep(0).then(() => {
|
|
1452
|
-
emit("setData", {
|
|
1453
|
-
k: frameIndex,
|
|
744
|
+
}, t, r), n = U(-1);
|
|
745
|
+
function a(d) {
|
|
746
|
+
d <= n.value || (n.value = d, Z(0).then(() => {
|
|
747
|
+
r("setData", {
|
|
748
|
+
k: d,
|
|
1454
749
|
v: null
|
|
1455
750
|
});
|
|
1456
|
-
});
|
|
751
|
+
}));
|
|
1457
752
|
}
|
|
1458
|
-
let
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
let lastFpsUpdateTime = 0;
|
|
1462
|
-
function startFrameLoop() {
|
|
1463
|
-
if (animationId !== null)
|
|
753
|
+
let u = null, i = 0, s = 0, b = 0;
|
|
754
|
+
function h() {
|
|
755
|
+
if (u !== null)
|
|
1464
756
|
return;
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
drawFrame();
|
|
1475
|
-
frameCount++;
|
|
1476
|
-
const elapsed = now - lastFpsUpdateTime;
|
|
1477
|
-
if (elapsed >= 1e3) {
|
|
1478
|
-
const currentFps = Math.round(frameCount * 1e3 / elapsed);
|
|
1479
|
-
console.log(`[Bitmap] FPS: ${currentFps}`);
|
|
1480
|
-
frameCount = 0;
|
|
1481
|
-
lastFpsUpdateTime = now;
|
|
757
|
+
i = performance.now(), b = i, s = 0;
|
|
758
|
+
function d() {
|
|
759
|
+
const g = performance.now(), c = 1e3 / t.frameRate, x = g - i;
|
|
760
|
+
if (x >= c) {
|
|
761
|
+
i = g - x % c, f(), s++;
|
|
762
|
+
const I = g - b;
|
|
763
|
+
if (I >= 1e3) {
|
|
764
|
+
const N = Math.round(s * 1e3 / I);
|
|
765
|
+
console.log(`[Bitmap] FPS: ${N}`), s = 0, b = g;
|
|
1482
766
|
}
|
|
1483
767
|
}
|
|
1484
|
-
|
|
1485
|
-
animationId = requestAnimationFrame(renderFrame);
|
|
1486
|
-
} else {
|
|
1487
|
-
animationId = null;
|
|
1488
|
-
}
|
|
768
|
+
t.status === m.playing ? u = requestAnimationFrame(d) : u = null;
|
|
1489
769
|
}
|
|
1490
|
-
function
|
|
1491
|
-
if (
|
|
770
|
+
function f() {
|
|
771
|
+
if (t.data.length === 0 || t.status !== m.playing)
|
|
1492
772
|
return;
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
scheduleClearFrame(originIndex);
|
|
1499
|
-
}
|
|
1500
|
-
updateTextureFromBitmap(bitmap);
|
|
1501
|
-
index.value = index.value + 1;
|
|
1502
|
-
} else {
|
|
773
|
+
const g = t.data[e.value];
|
|
774
|
+
if (g) {
|
|
775
|
+
const c = e.value - 1;
|
|
776
|
+
c >= 0 && a(c), w(g), e.value = e.value + 1;
|
|
777
|
+
} else
|
|
1503
778
|
console.warn(
|
|
1504
|
-
`Bitmap for index ${
|
|
1505
|
-
);
|
|
1506
|
-
emit("notFound", index.value);
|
|
1507
|
-
}
|
|
779
|
+
`Bitmap for index ${e.value} not found. Ensure the data is loaded.`
|
|
780
|
+
), r("notFound", e.value);
|
|
1508
781
|
}
|
|
1509
|
-
|
|
782
|
+
u = requestAnimationFrame(d);
|
|
1510
783
|
}
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
});
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
newStatus === TickerStatus.pause && pause();
|
|
1519
|
-
newStatus === TickerStatus.stop && stop();
|
|
1520
|
-
}, { immediate: true });
|
|
1521
|
-
function play() {
|
|
1522
|
-
if (props.data.length > 0) {
|
|
1523
|
-
emit("update:status", TickerStatus.playing);
|
|
1524
|
-
startFrameLoop();
|
|
1525
|
-
} else {
|
|
1526
|
-
emit("update:status", TickerStatus.stopped);
|
|
1527
|
-
}
|
|
784
|
+
B(() => {
|
|
785
|
+
t.prerender && e.value === 0 && t.data.length > 0 && t.data[0] && w(t.data[0]);
|
|
786
|
+
}), Q(() => t.status, (d) => {
|
|
787
|
+
d === m.play && A(), d === m.pause && y(), d === m.stop && F();
|
|
788
|
+
}, { immediate: !0 });
|
|
789
|
+
function A() {
|
|
790
|
+
t.data.length > 0 ? (r("update:status", m.playing), h()) : r("update:status", m.stopped);
|
|
1528
791
|
}
|
|
1529
|
-
function
|
|
1530
|
-
|
|
792
|
+
function y() {
|
|
793
|
+
r("update:status", m.paused);
|
|
1531
794
|
}
|
|
1532
|
-
function
|
|
1533
|
-
|
|
1534
|
-
if (animationId !== null) {
|
|
1535
|
-
cancelAnimationFrame(animationId);
|
|
1536
|
-
animationId = null;
|
|
1537
|
-
}
|
|
1538
|
-
emit("update:data", []);
|
|
1539
|
-
index.value = 0;
|
|
1540
|
-
lastScheduledClearIndex.value = -1;
|
|
795
|
+
function F() {
|
|
796
|
+
r("update:status", m.stopped), u !== null && (cancelAnimationFrame(u), u = null), r("update:data", []), e.value = 0, n.value = -1;
|
|
1541
797
|
}
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
});
|
|
1546
|
-
const __returned__ = { props, emit, sprite, resizeSprite, application, texture, updateTextureFromBitmap, index, lastScheduledClearIndex, scheduleClearFrame, get animationId() {
|
|
1547
|
-
return animationId;
|
|
1548
|
-
}, set animationId(v) {
|
|
1549
|
-
animationId = v;
|
|
1550
|
-
}, get lastFrameTime() {
|
|
1551
|
-
return lastFrameTime;
|
|
1552
|
-
}, set lastFrameTime(v) {
|
|
1553
|
-
lastFrameTime = v;
|
|
1554
|
-
}, get frameCount() {
|
|
1555
|
-
return frameCount;
|
|
1556
|
-
}, set frameCount(v) {
|
|
1557
|
-
frameCount = v;
|
|
1558
|
-
}, get lastFpsUpdateTime() {
|
|
1559
|
-
return lastFpsUpdateTime;
|
|
1560
|
-
}, set lastFpsUpdateTime(v) {
|
|
1561
|
-
lastFpsUpdateTime = v;
|
|
1562
|
-
}, startFrameLoop, play, pause, stop };
|
|
1563
|
-
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
1564
|
-
return __returned__;
|
|
798
|
+
return S(() => {
|
|
799
|
+
F(), _.destroy();
|
|
800
|
+
}), (d, f) => V(d.$slots, "default");
|
|
1565
801
|
}
|
|
1566
|
-
})
|
|
1567
|
-
|
|
1568
|
-
function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1569
|
-
return renderSlot(_ctx.$slots, "default");
|
|
1570
|
-
}
|
|
1571
|
-
var Bitmap = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6], ["__file", "/home/runner/work/vunk-plus/vunk-plus/packages/components/pixi-frame/src/bitmap.vue"]]);
|
|
1572
|
-
|
|
1573
|
-
var _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
802
|
+
}), je = /* @__PURE__ */ C({
|
|
1574
803
|
__name: "buffer-image",
|
|
1575
804
|
props: {
|
|
1576
|
-
...
|
|
805
|
+
...se(q, {
|
|
1577
806
|
excludes: ["loop"]
|
|
1578
807
|
}),
|
|
1579
808
|
data: {
|
|
1580
809
|
type: Array,
|
|
1581
|
-
required:
|
|
810
|
+
required: !0
|
|
1582
811
|
},
|
|
1583
812
|
/**
|
|
1584
813
|
* Pixel format for BufferImageSource.
|
|
@@ -1593,525 +822,285 @@ var _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
1593
822
|
},
|
|
1594
823
|
height: {
|
|
1595
824
|
type: Number,
|
|
1596
|
-
required:
|
|
825
|
+
required: !0
|
|
1597
826
|
},
|
|
1598
827
|
width: {
|
|
1599
828
|
type: Number,
|
|
1600
|
-
required:
|
|
829
|
+
required: !0
|
|
1601
830
|
}
|
|
1602
831
|
},
|
|
1603
832
|
emits: {
|
|
1604
|
-
...
|
|
1605
|
-
|
|
833
|
+
...j,
|
|
834
|
+
load: (o) => o,
|
|
1606
835
|
"update:frameIndex": null,
|
|
1607
|
-
|
|
836
|
+
notFound: (o) => !0
|
|
1608
837
|
},
|
|
1609
|
-
setup(
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
const emit = __emit;
|
|
1613
|
-
const { sprite, resizeSprite, application } = useSprite(props);
|
|
1614
|
-
const texture = new Texture({
|
|
1615
|
-
dynamic: true
|
|
838
|
+
setup(o, { emit: P }) {
|
|
839
|
+
const t = o, r = P, { sprite: p, resizeSprite: l, application: v } = z(t), _ = new ee({
|
|
840
|
+
dynamic: !0
|
|
1616
841
|
});
|
|
1617
|
-
|
|
1618
|
-
function
|
|
1619
|
-
|
|
1620
|
-
const
|
|
1621
|
-
resource,
|
|
1622
|
-
height:
|
|
1623
|
-
width:
|
|
1624
|
-
format:
|
|
842
|
+
p.texture = _;
|
|
843
|
+
function w(d) {
|
|
844
|
+
_.source?.destroy();
|
|
845
|
+
const f = new we({
|
|
846
|
+
resource: d,
|
|
847
|
+
height: t.height,
|
|
848
|
+
width: t.width,
|
|
849
|
+
format: t.format
|
|
1625
850
|
});
|
|
1626
|
-
|
|
1627
|
-
texture.update();
|
|
1628
|
-
resizeSprite();
|
|
851
|
+
_.source = f, _.update(), l();
|
|
1629
852
|
}
|
|
1630
|
-
|
|
1631
|
-
application,
|
|
1632
|
-
sprite
|
|
853
|
+
r("load", {
|
|
854
|
+
application: v,
|
|
855
|
+
sprite: p
|
|
1633
856
|
});
|
|
1634
|
-
const
|
|
857
|
+
const e = ie({
|
|
1635
858
|
default: 0,
|
|
1636
859
|
key: "frameIndex"
|
|
1637
|
-
},
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
lastScheduledClearIndex.value = frameIndex;
|
|
1643
|
-
sleep(0).then(() => {
|
|
1644
|
-
emit("setData", {
|
|
1645
|
-
k: frameIndex,
|
|
860
|
+
}, t, r), n = U(-1);
|
|
861
|
+
function a(d) {
|
|
862
|
+
d <= n.value || (n.value = d, Z(0).then(() => {
|
|
863
|
+
r("setData", {
|
|
864
|
+
k: d,
|
|
1646
865
|
v: null
|
|
1647
866
|
});
|
|
1648
|
-
});
|
|
867
|
+
}));
|
|
1649
868
|
}
|
|
1650
|
-
let
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
let lastFpsUpdateTime = 0;
|
|
1654
|
-
function startFrameLoop() {
|
|
1655
|
-
if (animationId !== null)
|
|
869
|
+
let u = null, i = 0, s = 0, b = 0;
|
|
870
|
+
function h() {
|
|
871
|
+
if (u !== null)
|
|
1656
872
|
return;
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
drawFrame();
|
|
1667
|
-
frameCount++;
|
|
1668
|
-
const elapsed = now - lastFpsUpdateTime;
|
|
1669
|
-
if (elapsed >= 1e3) {
|
|
1670
|
-
const currentFps = Math.round(frameCount * 1e3 / elapsed);
|
|
1671
|
-
console.log(`[Bitmap] FPS: ${currentFps}`);
|
|
1672
|
-
frameCount = 0;
|
|
1673
|
-
lastFpsUpdateTime = now;
|
|
873
|
+
i = performance.now(), b = i, s = 0;
|
|
874
|
+
function d() {
|
|
875
|
+
const g = performance.now(), c = 1e3 / t.frameRate, x = g - i;
|
|
876
|
+
if (x >= c) {
|
|
877
|
+
i = g - x % c, f(), s++;
|
|
878
|
+
const I = g - b;
|
|
879
|
+
if (I >= 1e3) {
|
|
880
|
+
const N = Math.round(s * 1e3 / I);
|
|
881
|
+
console.log(`[Bitmap] FPS: ${N}`), s = 0, b = g;
|
|
1674
882
|
}
|
|
1675
883
|
}
|
|
1676
|
-
|
|
1677
|
-
animationId = requestAnimationFrame(renderFrame);
|
|
1678
|
-
} else {
|
|
1679
|
-
animationId = null;
|
|
1680
|
-
}
|
|
884
|
+
t.status === m.playing ? u = requestAnimationFrame(d) : u = null;
|
|
1681
885
|
}
|
|
1682
|
-
function
|
|
1683
|
-
if (
|
|
886
|
+
function f() {
|
|
887
|
+
if (t.data.length === 0 || t.status !== m.playing)
|
|
1684
888
|
return;
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
scheduleClearFrame(originIndex);
|
|
1691
|
-
}
|
|
1692
|
-
updateTexture(bitmap);
|
|
1693
|
-
index.value = index.value + 1;
|
|
1694
|
-
} else {
|
|
889
|
+
const g = t.data[e.value];
|
|
890
|
+
if (g) {
|
|
891
|
+
const c = e.value - 1;
|
|
892
|
+
c >= 0 && a(c), w(g), e.value = e.value + 1;
|
|
893
|
+
} else
|
|
1695
894
|
console.warn(
|
|
1696
|
-
`Bitmap for index ${
|
|
1697
|
-
);
|
|
1698
|
-
emit("notFound", index.value);
|
|
1699
|
-
}
|
|
895
|
+
`Bitmap for index ${e.value} not found. Ensure the data is loaded.`
|
|
896
|
+
), r("notFound", e.value);
|
|
1700
897
|
}
|
|
1701
|
-
|
|
898
|
+
u = requestAnimationFrame(d);
|
|
1702
899
|
}
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
});
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
newStatus === TickerStatus.pause && pause();
|
|
1711
|
-
newStatus === TickerStatus.stop && stop();
|
|
1712
|
-
}, { immediate: true });
|
|
1713
|
-
function play() {
|
|
1714
|
-
if (props.data.length > 0) {
|
|
1715
|
-
emit("update:status", TickerStatus.playing);
|
|
1716
|
-
startFrameLoop();
|
|
1717
|
-
} else {
|
|
1718
|
-
emit("update:status", TickerStatus.stopped);
|
|
1719
|
-
}
|
|
900
|
+
B(() => {
|
|
901
|
+
t.prerender && e.value === 0 && t.data.length > 0 && t.data[0] && w(t.data[0]);
|
|
902
|
+
}), Q(() => t.status, (d) => {
|
|
903
|
+
d === m.play && A(), d === m.pause && y(), d === m.stop && F();
|
|
904
|
+
}, { immediate: !0 });
|
|
905
|
+
function A() {
|
|
906
|
+
t.data.length > 0 ? (r("update:status", m.playing), h()) : r("update:status", m.stopped);
|
|
1720
907
|
}
|
|
1721
|
-
function
|
|
1722
|
-
|
|
908
|
+
function y() {
|
|
909
|
+
r("update:status", m.paused);
|
|
1723
910
|
}
|
|
1724
|
-
function
|
|
1725
|
-
|
|
1726
|
-
if (animationId !== null) {
|
|
1727
|
-
cancelAnimationFrame(animationId);
|
|
1728
|
-
animationId = null;
|
|
1729
|
-
}
|
|
1730
|
-
emit("update:data", []);
|
|
1731
|
-
index.value = 0;
|
|
1732
|
-
lastScheduledClearIndex.value = -1;
|
|
911
|
+
function F() {
|
|
912
|
+
r("update:status", m.stopped), u !== null && (cancelAnimationFrame(u), u = null), r("update:data", []), e.value = 0, n.value = -1;
|
|
1733
913
|
}
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
});
|
|
1738
|
-
const __returned__ = { props, emit, sprite, resizeSprite, application, texture, updateTexture, index, lastScheduledClearIndex, scheduleClearFrame, get animationId() {
|
|
1739
|
-
return animationId;
|
|
1740
|
-
}, set animationId(v) {
|
|
1741
|
-
animationId = v;
|
|
1742
|
-
}, get lastFrameTime() {
|
|
1743
|
-
return lastFrameTime;
|
|
1744
|
-
}, set lastFrameTime(v) {
|
|
1745
|
-
lastFrameTime = v;
|
|
1746
|
-
}, get frameCount() {
|
|
1747
|
-
return frameCount;
|
|
1748
|
-
}, set frameCount(v) {
|
|
1749
|
-
frameCount = v;
|
|
1750
|
-
}, get lastFpsUpdateTime() {
|
|
1751
|
-
return lastFpsUpdateTime;
|
|
1752
|
-
}, set lastFpsUpdateTime(v) {
|
|
1753
|
-
lastFpsUpdateTime = v;
|
|
1754
|
-
}, startFrameLoop, play, pause, stop };
|
|
1755
|
-
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
1756
|
-
return __returned__;
|
|
914
|
+
return S(() => {
|
|
915
|
+
F(), _.destroy();
|
|
916
|
+
}), (d, f) => V(d.$slots, "default");
|
|
1757
917
|
}
|
|
1758
|
-
})
|
|
1759
|
-
|
|
1760
|
-
function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1761
|
-
return renderSlot(_ctx.$slots, "default");
|
|
1762
|
-
}
|
|
1763
|
-
var bufferImage = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5], ["__file", "/home/runner/work/vunk-plus/vunk-plus/packages/components/pixi-frame/src/buffer-image.vue"]]);
|
|
1764
|
-
|
|
1765
|
-
var _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
918
|
+
}), ze = /* @__PURE__ */ C({
|
|
1766
919
|
__name: "core",
|
|
1767
920
|
props: {
|
|
1768
|
-
...
|
|
921
|
+
...q,
|
|
1769
922
|
data: {
|
|
1770
923
|
type: void 0,
|
|
1771
|
-
required:
|
|
924
|
+
required: !0
|
|
1772
925
|
},
|
|
1773
926
|
frameIndex: {
|
|
1774
927
|
type: Number
|
|
1775
928
|
}
|
|
1776
929
|
},
|
|
1777
930
|
emits: {
|
|
1778
|
-
...
|
|
1779
|
-
|
|
931
|
+
...j,
|
|
932
|
+
load: (o) => o,
|
|
1780
933
|
"update:frameIndex": null,
|
|
1781
|
-
|
|
934
|
+
notFound: (o) => !0
|
|
1782
935
|
},
|
|
1783
|
-
setup(
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
const completedIndex = ref(0);
|
|
1792
|
-
const enabledData = computed(() => {
|
|
1793
|
-
return props.data.slice(completedIndex.value);
|
|
1794
|
-
});
|
|
1795
|
-
watchEffect(() => {
|
|
1796
|
-
for (const key in enabledData.value) {
|
|
1797
|
-
const theKey = +key + completedIndex.value;
|
|
1798
|
-
const alias = `${compId}-${theKey}`;
|
|
1799
|
-
const src = typeof enabledData.value[key] === "string" ? enabledData.value[key] : enabledData.value[key]?.src;
|
|
1800
|
-
if (!src) {
|
|
1801
|
-
continue;
|
|
1802
|
-
}
|
|
1803
|
-
if (textureMap.has(alias)) {
|
|
1804
|
-
continue;
|
|
1805
|
-
}
|
|
1806
|
-
Assets.add({
|
|
1807
|
-
alias,
|
|
1808
|
-
src,
|
|
936
|
+
setup(o, { emit: P }) {
|
|
937
|
+
const t = o, r = P, p = ne(), l = (F) => `${p}-${F}`, { sprite: v, resizeSprite: _, application: w } = z(t), e = /* @__PURE__ */ new Map(), n = U(0), a = J(() => t.data.slice(n.value));
|
|
938
|
+
B(() => {
|
|
939
|
+
for (const F in a.value) {
|
|
940
|
+
const d = +F + n.value, f = `${p}-${d}`, g = typeof a.value[F] == "string" ? a.value[F] : a.value[F]?.src;
|
|
941
|
+
g && (e.has(f) || (R.add({
|
|
942
|
+
alias: f,
|
|
943
|
+
src: g,
|
|
1809
944
|
loadParser: "loadTextures"
|
|
1810
|
-
})
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
res._meta = enabledData.value[key];
|
|
1814
|
-
textureMap.set(alias, res);
|
|
1815
|
-
if (props.prerender && theKey === 0) {
|
|
1816
|
-
sprite.texture = res;
|
|
1817
|
-
resizeSprite();
|
|
1818
|
-
}
|
|
1819
|
-
});
|
|
945
|
+
}), e.set(f, void 0), R.load(f).then((c) => {
|
|
946
|
+
c._meta = a.value[F], e.set(f, c), t.prerender && d === 0 && (v.texture = c, _());
|
|
947
|
+
})));
|
|
1820
948
|
}
|
|
949
|
+
}), r("load", {
|
|
950
|
+
application: w,
|
|
951
|
+
sprite: v
|
|
1821
952
|
});
|
|
1822
|
-
|
|
1823
|
-
application,
|
|
1824
|
-
sprite
|
|
1825
|
-
});
|
|
1826
|
-
const index = useModelComputed({
|
|
953
|
+
const u = ie({
|
|
1827
954
|
default: 0,
|
|
1828
955
|
key: "frameIndex"
|
|
1829
|
-
},
|
|
1830
|
-
let
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
if (animationId !== null)
|
|
956
|
+
}, t, r);
|
|
957
|
+
let i = null, s = 0;
|
|
958
|
+
function b() {
|
|
959
|
+
if (i !== null)
|
|
1834
960
|
return;
|
|
1835
|
-
|
|
1836
|
-
function
|
|
1837
|
-
const
|
|
1838
|
-
|
|
1839
|
-
const delta = now - lastFrameTime;
|
|
1840
|
-
if (delta >= frameDuration) {
|
|
1841
|
-
lastFrameTime = now - delta % frameDuration;
|
|
1842
|
-
drawFrame();
|
|
1843
|
-
}
|
|
1844
|
-
if (props.status === TickerStatus.playing) {
|
|
1845
|
-
animationId = requestAnimationFrame(renderFrame);
|
|
1846
|
-
} else {
|
|
1847
|
-
animationId = null;
|
|
1848
|
-
}
|
|
961
|
+
s = performance.now();
|
|
962
|
+
function F() {
|
|
963
|
+
const f = performance.now(), g = 1e3 / t.frameRate, c = f - s;
|
|
964
|
+
c >= g && (s = f - c % g, d()), t.status === m.playing ? i = requestAnimationFrame(F) : i = null;
|
|
1849
965
|
}
|
|
1850
|
-
function
|
|
1851
|
-
if (
|
|
966
|
+
function d() {
|
|
967
|
+
if (t.data.length === 0 || t.status !== m.playing)
|
|
1852
968
|
return;
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
getAlias(index.value)
|
|
969
|
+
const f = e.get(
|
|
970
|
+
l(u.value)
|
|
1856
971
|
);
|
|
1857
|
-
if (
|
|
1858
|
-
const
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
});
|
|
1872
|
-
completedIndex.value = originIndex;
|
|
1873
|
-
});
|
|
1874
|
-
}
|
|
1875
|
-
sprite.texture = currentTexture;
|
|
1876
|
-
resizeSprite();
|
|
1877
|
-
index.value = props.loop ? (index.value + 1) % props.data.length : index.value + 1;
|
|
1878
|
-
} else {
|
|
972
|
+
if (f) {
|
|
973
|
+
const g = v.texture, c = u.value - 1;
|
|
974
|
+
g && c >= 0 && !t.loop && Promise.resolve(Z(500)).then(() => R.unload(
|
|
975
|
+
l(c)
|
|
976
|
+
)).then(() => {
|
|
977
|
+
e.set(
|
|
978
|
+
l(c),
|
|
979
|
+
void 0
|
|
980
|
+
), r("setData", {
|
|
981
|
+
k: c,
|
|
982
|
+
v: ""
|
|
983
|
+
}), n.value = c;
|
|
984
|
+
}), v.texture = f, _(), u.value = t.loop ? (u.value + 1) % t.data.length : u.value + 1;
|
|
985
|
+
} else
|
|
1879
986
|
console.warn(
|
|
1880
|
-
`Texture for index ${
|
|
1881
|
-
);
|
|
1882
|
-
emit("notFound", index.value);
|
|
1883
|
-
if (!props.loop)
|
|
1884
|
-
emit("update:status", TickerStatus.paused);
|
|
1885
|
-
}
|
|
987
|
+
`Texture for index ${u.value} not found. Ensure the texture is loaded.`
|
|
988
|
+
), r("notFound", u.value), t.loop || r("update:status", m.paused);
|
|
1886
989
|
}
|
|
1887
|
-
|
|
990
|
+
i = requestAnimationFrame(F);
|
|
1888
991
|
}
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
function play() {
|
|
1895
|
-
if (props.data.length > 0) {
|
|
1896
|
-
emit("update:status", TickerStatus.playing);
|
|
1897
|
-
startFrameLoop();
|
|
1898
|
-
} else {
|
|
1899
|
-
emit("update:status", TickerStatus.stopped);
|
|
1900
|
-
}
|
|
992
|
+
Q(() => t.status, (F) => {
|
|
993
|
+
F === m.play && h(), F === m.pause && A(), F === m.stop && y();
|
|
994
|
+
}, { immediate: !0 });
|
|
995
|
+
function h() {
|
|
996
|
+
t.data.length > 0 ? (r("update:status", m.playing), b()) : r("update:status", m.stopped);
|
|
1901
997
|
}
|
|
1902
|
-
function
|
|
1903
|
-
|
|
998
|
+
function A() {
|
|
999
|
+
r("update:status", m.paused);
|
|
1904
1000
|
}
|
|
1905
|
-
function
|
|
1906
|
-
|
|
1907
|
-
if (animationId !== null) {
|
|
1908
|
-
cancelAnimationFrame(animationId);
|
|
1909
|
-
animationId = null;
|
|
1910
|
-
}
|
|
1911
|
-
emit("update:data", []);
|
|
1912
|
-
textureMap.clear();
|
|
1913
|
-
index.value = 0;
|
|
1001
|
+
function y() {
|
|
1002
|
+
r("update:status", m.stopped), i !== null && (cancelAnimationFrame(i), i = null), r("update:data", []), e.clear(), u.value = 0;
|
|
1914
1003
|
}
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
}
|
|
1921
|
-
});
|
|
1922
|
-
stop();
|
|
1923
|
-
});
|
|
1924
|
-
const __returned__ = { props, emit, compId, getAlias, sprite, resizeSprite, application, textureMap, completedIndex, enabledData, index, get animationId() {
|
|
1925
|
-
return animationId;
|
|
1926
|
-
}, set animationId(v) {
|
|
1927
|
-
animationId = v;
|
|
1928
|
-
}, get lastFrameTime() {
|
|
1929
|
-
return lastFrameTime;
|
|
1930
|
-
}, set lastFrameTime(v) {
|
|
1931
|
-
lastFrameTime = v;
|
|
1932
|
-
}, startFrameLoop, play, pause, stop };
|
|
1933
|
-
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
1934
|
-
return __returned__;
|
|
1004
|
+
return S(() => {
|
|
1005
|
+
Array.from(e.entries()).forEach(([d, f]) => {
|
|
1006
|
+
f && R.unload(d);
|
|
1007
|
+
}), y();
|
|
1008
|
+
}), (F, d) => V(F.$slots, "default");
|
|
1935
1009
|
}
|
|
1936
|
-
})
|
|
1937
|
-
|
|
1938
|
-
function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1939
|
-
return renderSlot(_ctx.$slots, "default");
|
|
1940
|
-
}
|
|
1941
|
-
var core = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4], ["__file", "/home/runner/work/vunk-plus/vunk-plus/packages/components/pixi-frame/src/core.vue"]]);
|
|
1942
|
-
|
|
1943
|
-
var _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
1010
|
+
}), Le = /* @__PURE__ */ C({
|
|
1944
1011
|
__name: "provider",
|
|
1945
|
-
setup(
|
|
1946
|
-
|
|
1947
|
-
initPixiApp();
|
|
1948
|
-
const __returned__ = {};
|
|
1949
|
-
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
1950
|
-
return __returned__;
|
|
1012
|
+
setup(o) {
|
|
1013
|
+
return Ie(), (P, t) => V(P.$slots, "default");
|
|
1951
1014
|
}
|
|
1952
|
-
})
|
|
1953
|
-
|
|
1954
|
-
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1955
|
-
return renderSlot(_ctx.$slots, "default");
|
|
1956
|
-
}
|
|
1957
|
-
var ProviderComp = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__file", "/home/runner/work/vunk-plus/vunk-plus/packages/components/pixi-frame/src/provider.vue"]]);
|
|
1958
|
-
|
|
1959
|
-
var _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
1015
|
+
}), Re = /* @__PURE__ */ C({
|
|
1960
1016
|
__name: "video",
|
|
1961
1017
|
props: {
|
|
1962
|
-
...
|
|
1018
|
+
...q,
|
|
1963
1019
|
url: {
|
|
1964
1020
|
type: String,
|
|
1965
|
-
required:
|
|
1021
|
+
required: !0
|
|
1966
1022
|
}
|
|
1967
1023
|
},
|
|
1968
|
-
emits,
|
|
1969
|
-
setup(
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
const { sprite, resizeSprite } = useSprite(props);
|
|
1976
|
-
const texture = ref();
|
|
1977
|
-
const video = computed(() => {
|
|
1978
|
-
if (texture.value?.source && texture.value.source.resource) {
|
|
1979
|
-
const resource = texture.value.source.resource;
|
|
1980
|
-
if (resource instanceof HTMLVideoElement) {
|
|
1981
|
-
return resource;
|
|
1982
|
-
}
|
|
1024
|
+
emits: j,
|
|
1025
|
+
setup(o, { emit: P }) {
|
|
1026
|
+
const t = o, r = P, p = ne(), l = () => `${p}-video`, { sprite: v, resizeSprite: _ } = z(t), w = U(), e = J(() => {
|
|
1027
|
+
if (w.value?.source && w.value.source.resource) {
|
|
1028
|
+
const y = w.value.source.resource;
|
|
1029
|
+
if (y instanceof HTMLVideoElement)
|
|
1030
|
+
return y;
|
|
1983
1031
|
}
|
|
1984
1032
|
return null;
|
|
1985
|
-
});
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
});
|
|
1993
|
-
watchEffect(() => {
|
|
1994
|
-
video.value && (video.value.loop = props.loop);
|
|
1995
|
-
});
|
|
1996
|
-
onMounted(() => loadVideoTexture(props.url));
|
|
1997
|
-
async function loadVideoTexture(url) {
|
|
1033
|
+
}), n = be(), a = U("");
|
|
1034
|
+
n.promise.then(() => {
|
|
1035
|
+
t.status === m.play && b();
|
|
1036
|
+
}), B(() => {
|
|
1037
|
+
e.value && (e.value.loop = t.loop);
|
|
1038
|
+
}), ae(() => u(t.url));
|
|
1039
|
+
async function u(y) {
|
|
1998
1040
|
try {
|
|
1999
|
-
|
|
2000
|
-
const
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
texture.value = videoTexture;
|
|
2007
|
-
sprite.texture = videoTexture;
|
|
2008
|
-
if (video.value) {
|
|
2009
|
-
video.value.loop = props.loop;
|
|
2010
|
-
video.value.muted = true;
|
|
2011
|
-
video.value.crossOrigin = "anonymous";
|
|
2012
|
-
setupVideoEvents(video.value);
|
|
2013
|
-
readyDef.resolve();
|
|
2014
|
-
}
|
|
2015
|
-
resizeSprite();
|
|
2016
|
-
return videoTexture;
|
|
2017
|
-
} catch (error) {
|
|
2018
|
-
console.error("\u52A0\u8F7D\u89C6\u9891\u7EB9\u7406\u5931\u8D25:", error);
|
|
2019
|
-
videoError.value = "\u89C6\u9891\u52A0\u8F7D\u5931\u8D25";
|
|
2020
|
-
return null;
|
|
1041
|
+
a.value = "";
|
|
1042
|
+
const F = l();
|
|
1043
|
+
R.cache.has(F) && await R.unload(F), R.add({ alias: F, src: y });
|
|
1044
|
+
const d = await R.load(F);
|
|
1045
|
+
return w.value = d, v.texture = d, e.value && (e.value.loop = t.loop, e.value.muted = !0, e.value.crossOrigin = "anonymous", i(e.value), n.resolve()), _(), d;
|
|
1046
|
+
} catch (F) {
|
|
1047
|
+
return console.error("加载视频纹理失败:", F), a.value = "视频加载失败", null;
|
|
2021
1048
|
}
|
|
2022
1049
|
}
|
|
2023
|
-
function
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
})
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
video2.play();
|
|
2038
|
-
} else {
|
|
2039
|
-
emit("update:status", TickerStatus.stopped);
|
|
2040
|
-
}
|
|
2041
|
-
});
|
|
2042
|
-
video2.addEventListener("error", (e) => {
|
|
2043
|
-
const error = video2.error;
|
|
2044
|
-
let errorMessage = "\u89C6\u9891\u64AD\u653E\u5931\u8D25";
|
|
2045
|
-
if (error) {
|
|
2046
|
-
switch (error.code) {
|
|
2047
|
-
case error.MEDIA_ERR_ABORTED:
|
|
2048
|
-
errorMessage = "\u89C6\u9891\u64AD\u653E\u88AB\u4E2D\u6B62";
|
|
1050
|
+
function i(y) {
|
|
1051
|
+
y.addEventListener("play", () => {
|
|
1052
|
+
t.status !== m.playing && r("update:status", m.playing);
|
|
1053
|
+
}), y.addEventListener("pause", () => {
|
|
1054
|
+
t.status !== m.paused && r("update:status", m.paused);
|
|
1055
|
+
}), y.addEventListener("ended", () => {
|
|
1056
|
+
t.loop ? (y.currentTime = 0, y.play()) : r("update:status", m.stopped);
|
|
1057
|
+
}), y.addEventListener("error", (F) => {
|
|
1058
|
+
const d = y.error;
|
|
1059
|
+
let f = "视频播放失败";
|
|
1060
|
+
if (d)
|
|
1061
|
+
switch (d.code) {
|
|
1062
|
+
case d.MEDIA_ERR_ABORTED:
|
|
1063
|
+
f = "视频播放被中止";
|
|
2049
1064
|
break;
|
|
2050
|
-
case
|
|
2051
|
-
|
|
1065
|
+
case d.MEDIA_ERR_NETWORK:
|
|
1066
|
+
f = "网络错误导致视频播放失败";
|
|
2052
1067
|
break;
|
|
2053
|
-
case
|
|
2054
|
-
|
|
1068
|
+
case d.MEDIA_ERR_DECODE:
|
|
1069
|
+
f = "视频解码失败";
|
|
2055
1070
|
break;
|
|
2056
|
-
case
|
|
2057
|
-
|
|
1071
|
+
case d.MEDIA_ERR_SRC_NOT_SUPPORTED:
|
|
1072
|
+
f = "不支持的视频格式";
|
|
2058
1073
|
break;
|
|
2059
1074
|
}
|
|
2060
|
-
|
|
2061
|
-
console.error("\u89C6\u9891\u64AD\u653E\u9519\u8BEF:", errorMessage, e);
|
|
2062
|
-
videoError.value = errorMessage;
|
|
2063
|
-
emit("update:status", TickerStatus.stopped);
|
|
1075
|
+
console.error("视频播放错误:", f, F), a.value = f, r("update:status", m.stopped);
|
|
2064
1076
|
});
|
|
2065
1077
|
}
|
|
2066
|
-
async function
|
|
2067
|
-
if (
|
|
2068
|
-
const
|
|
2069
|
-
|
|
2070
|
-
texture.value = void 0;
|
|
2071
|
-
if (Assets.cache.has(alias)) {
|
|
2072
|
-
await Assets.unload(alias);
|
|
2073
|
-
}
|
|
1078
|
+
async function s() {
|
|
1079
|
+
if (w.value) {
|
|
1080
|
+
const y = l();
|
|
1081
|
+
w.value.destroy(!0), w.value = void 0, R.cache.has(y) && await R.unload(y);
|
|
2074
1082
|
}
|
|
2075
|
-
|
|
1083
|
+
a.value = "";
|
|
2076
1084
|
}
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
1085
|
+
B(() => {
|
|
1086
|
+
t.status === m.play && b(), t.status === m.pause && h(), t.status === m.stop && A();
|
|
1087
|
+
}), S(() => {
|
|
1088
|
+
s();
|
|
2081
1089
|
});
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
if (video.value) {
|
|
2087
|
-
video.value.play().catch((error) => {
|
|
2088
|
-
console.error("\u89C6\u9891\u64AD\u653E\u5931\u8D25:", error);
|
|
2089
|
-
videoError.value = "\u89C6\u9891\u64AD\u653E\u5931\u8D25";
|
|
2090
|
-
});
|
|
2091
|
-
}
|
|
1090
|
+
function b() {
|
|
1091
|
+
e.value && e.value.play().catch((y) => {
|
|
1092
|
+
console.error("视频播放失败:", y), a.value = "视频播放失败";
|
|
1093
|
+
});
|
|
2092
1094
|
}
|
|
2093
|
-
function
|
|
2094
|
-
|
|
1095
|
+
function h() {
|
|
1096
|
+
e.value?.pause();
|
|
2095
1097
|
}
|
|
2096
|
-
function
|
|
2097
|
-
|
|
2098
|
-
video.value.pause();
|
|
2099
|
-
video.value.currentTime = 0;
|
|
2100
|
-
}
|
|
2101
|
-
emit("update:status", TickerStatus.stopped);
|
|
1098
|
+
function A() {
|
|
1099
|
+
e.value && (e.value.pause(), e.value.currentTime = 0), r("update:status", m.stopped);
|
|
2102
1100
|
}
|
|
2103
|
-
|
|
2104
|
-
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
2105
|
-
return __returned__;
|
|
1101
|
+
return (y, F) => V(y.$slots, "default");
|
|
2106
1102
|
}
|
|
2107
|
-
})
|
|
2108
|
-
|
|
2109
|
-
function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2110
|
-
return renderSlot(_ctx.$slots, "default");
|
|
2111
|
-
}
|
|
2112
|
-
var VideoComp = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__file", "/home/runner/work/vunk-plus/vunk-plus/packages/components/pixi-frame/src/video.vue"]]);
|
|
2113
|
-
|
|
2114
|
-
var _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
1103
|
+
}), Te = /* @__PURE__ */ C({
|
|
2115
1104
|
__name: "view",
|
|
2116
1105
|
props: {
|
|
2117
1106
|
defaultOptions: {
|
|
@@ -2119,114 +1108,97 @@ var _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
2119
1108
|
default: () => ({})
|
|
2120
1109
|
}
|
|
2121
1110
|
},
|
|
2122
|
-
setup(
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
});
|
|
2135
|
-
const __returned__ = { props, app, context, appRef };
|
|
2136
|
-
Object.defineProperty(__returned__, "__isScriptSetup", { enumerable: false, value: true });
|
|
2137
|
-
return __returned__;
|
|
1111
|
+
setup(o) {
|
|
1112
|
+
const P = o, { application: t, context: r } = ce(), p = U();
|
|
1113
|
+
return ae(async () => {
|
|
1114
|
+
await t.init({
|
|
1115
|
+
resizeTo: p.value,
|
|
1116
|
+
...P.defaultOptions
|
|
1117
|
+
}), r.whenDef.resolve(t), p.value.appendChild(t.canvas);
|
|
1118
|
+
}), (l, v) => (H(), me("div", {
|
|
1119
|
+
ref_key: "appRef",
|
|
1120
|
+
ref: p,
|
|
1121
|
+
class: "vk-pixi-frame"
|
|
1122
|
+
}, null, 512));
|
|
2138
1123
|
}
|
|
2139
|
-
})
|
|
2140
|
-
|
|
2141
|
-
const _hoisted_1 = {
|
|
2142
|
-
ref: "appRef",
|
|
2143
|
-
class: "vk-pixi-frame"
|
|
2144
|
-
};
|
|
2145
|
-
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2146
|
-
return openBlock(), createElementBlock(
|
|
2147
|
-
"div",
|
|
2148
|
-
_hoisted_1,
|
|
2149
|
-
null,
|
|
2150
|
-
512
|
|
2151
|
-
/* NEED_PATCH */
|
|
2152
|
-
);
|
|
2153
|
-
}
|
|
2154
|
-
var ViewComp = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__file", "/home/runner/work/vunk-plus/vunk-plus/packages/components/pixi-frame/src/view.vue"]]);
|
|
2155
|
-
|
|
2156
|
-
var _sfc_main = defineComponent({
|
|
1124
|
+
}), Oe = C({
|
|
2157
1125
|
name: "VkPixiFrame",
|
|
2158
1126
|
components: {
|
|
2159
|
-
ApngComp,
|
|
1127
|
+
ApngComp: Ne,
|
|
2160
1128
|
// CoreComp,
|
|
2161
|
-
ProviderComp,
|
|
2162
|
-
ViewComp,
|
|
2163
|
-
VideoComp,
|
|
2164
|
-
Bitmap
|
|
1129
|
+
ProviderComp: Le,
|
|
1130
|
+
ViewComp: Te,
|
|
1131
|
+
VideoComp: Re,
|
|
1132
|
+
Bitmap: De
|
|
2165
1133
|
},
|
|
2166
|
-
props,
|
|
2167
|
-
emits,
|
|
2168
|
-
setup(
|
|
2169
|
-
const
|
|
2170
|
-
if (!
|
|
2171
|
-
return
|
|
2172
|
-
const
|
|
2173
|
-
return
|
|
2174
|
-
})
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
return url.includes(".mp4") || url.includes(".webm") || url.includes(".mov");
|
|
1134
|
+
props: q,
|
|
1135
|
+
emits: j,
|
|
1136
|
+
setup(o) {
|
|
1137
|
+
const P = J(() => {
|
|
1138
|
+
if (!o.url)
|
|
1139
|
+
return !1;
|
|
1140
|
+
const r = o.url.toLowerCase();
|
|
1141
|
+
return r.includes(".png") && !r.includes(".mp4") && !r.includes(".webm");
|
|
1142
|
+
}), t = J(() => {
|
|
1143
|
+
if (!o.url)
|
|
1144
|
+
return !1;
|
|
1145
|
+
const r = o.url.toLowerCase();
|
|
1146
|
+
return r.includes(".mp4") || r.includes(".webm") || r.includes(".mov");
|
|
2180
1147
|
});
|
|
2181
1148
|
return {
|
|
2182
|
-
isApng,
|
|
2183
|
-
isVideo
|
|
1149
|
+
isApng: P,
|
|
1150
|
+
isVideo: t
|
|
2184
1151
|
};
|
|
2185
1152
|
}
|
|
2186
1153
|
});
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
const _component_ProviderComp = resolveComponent("ProviderComp");
|
|
2194
|
-
return openBlock(), createBlock(_component_ProviderComp, null, {
|
|
2195
|
-
default: withCtx(() => [
|
|
2196
|
-
createVNode(_component_ViewComp),
|
|
2197
|
-
_ctx.isApng && _ctx.url ? (openBlock(), createBlock(_component_ApngComp, {
|
|
1154
|
+
function Ue(o, P, t, r, p, l) {
|
|
1155
|
+
const v = K("ViewComp"), _ = K("ApngComp"), w = K("VideoComp"), e = K("Bitmap"), n = K("ProviderComp");
|
|
1156
|
+
return H(), Y(n, null, {
|
|
1157
|
+
default: he(() => [
|
|
1158
|
+
ve(v),
|
|
1159
|
+
o.isApng && o.url ? (H(), Y(_, {
|
|
2198
1160
|
key: 0,
|
|
2199
|
-
url:
|
|
2200
|
-
loop:
|
|
2201
|
-
status:
|
|
2202
|
-
"onUpdate:status":
|
|
2203
|
-
}, null, 8, ["url", "loop", "status"])) :
|
|
1161
|
+
url: o.url,
|
|
1162
|
+
loop: o.loop,
|
|
1163
|
+
status: o.status,
|
|
1164
|
+
"onUpdate:status": P[0] || (P[0] = (a) => o.$emit("update:status", a))
|
|
1165
|
+
}, null, 8, ["url", "loop", "status"])) : o.isVideo && o.url ? (H(), Y(w, {
|
|
2204
1166
|
key: 1,
|
|
2205
|
-
url:
|
|
2206
|
-
loop:
|
|
2207
|
-
status:
|
|
2208
|
-
"onUpdate:status":
|
|
2209
|
-
}, null, 8, ["url", "loop", "status"])) : (
|
|
1167
|
+
url: o.url,
|
|
1168
|
+
loop: o.loop,
|
|
1169
|
+
status: o.status,
|
|
1170
|
+
"onUpdate:status": P[1] || (P[1] = (a) => o.$emit("update:status", a))
|
|
1171
|
+
}, null, 8, ["url", "loop", "status"])) : (H(), Y(e, {
|
|
2210
1172
|
key: 2,
|
|
2211
|
-
data:
|
|
2212
|
-
loop:
|
|
2213
|
-
status:
|
|
2214
|
-
onSetData:
|
|
2215
|
-
"onUpdate:status":
|
|
1173
|
+
data: o.data,
|
|
1174
|
+
loop: o.loop,
|
|
1175
|
+
status: o.status,
|
|
1176
|
+
onSetData: P[2] || (P[2] = (a) => o.$emit("setData", a)),
|
|
1177
|
+
"onUpdate:status": P[3] || (P[3] = (a) => o.$emit("update:status", a))
|
|
2216
1178
|
}, null, 8, ["data", "loop", "status"]))
|
|
2217
1179
|
]),
|
|
2218
1180
|
_: 1
|
|
2219
|
-
/* STABLE */
|
|
2220
1181
|
});
|
|
2221
1182
|
}
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
1183
|
+
const re = /* @__PURE__ */ xe(Oe, [["render", Ue]]), Ke = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1184
|
+
__proto__: null
|
|
1185
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1186
|
+
re.install = (o) => {
|
|
1187
|
+
o.component(re.name || "VkPixiFrame", re);
|
|
1188
|
+
};
|
|
1189
|
+
export {
|
|
1190
|
+
Ye as TickerStatus,
|
|
1191
|
+
re as VkPixiFrame,
|
|
1192
|
+
Ne as VkPixiFrameApng,
|
|
1193
|
+
De as VkPixiFrameBitmap,
|
|
1194
|
+
Ge as VkPixiFrameBitmapGenerator,
|
|
1195
|
+
je as VkPixiFrameBufferImage,
|
|
1196
|
+
ze as VkPixiFrameCore,
|
|
1197
|
+
Le as VkPixiFrameProvider,
|
|
1198
|
+
Re as VkPixiFrameVideo,
|
|
1199
|
+
Te as VkPixiFrameView,
|
|
1200
|
+
Ke as __VkPixiFrame,
|
|
1201
|
+
re as default,
|
|
1202
|
+
ce as usePixiApp,
|
|
1203
|
+
z as useSprite
|
|
2230
1204
|
};
|
|
2231
|
-
|
|
2232
|
-
export { VkPixiFrame, ApngComp as VkPixiFrameApng, Bitmap as VkPixiFrameBitmap, bitmapGenerator as VkPixiFrameBitmapGenerator, bufferImage as VkPixiFrameBufferImage, core as VkPixiFrameCore, ProviderComp as VkPixiFrameProvider, VideoComp as VkPixiFrameVideo, ViewComp as VkPixiFrameView, types as __VkPixiFrame, VkPixiFrame as default, usePixiApp, useSprite };
|