adofai 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +111 -111
- package/dist/src/effectProcessor.js +37 -2
- package/dist/src/events/AddComponent.d.ts +7 -0
- package/dist/src/events/AddComponent.js +1 -0
- package/dist/src/events/AddDecoration.d.ts +25 -0
- package/dist/src/events/AddDecoration.js +1 -0
- package/dist/src/events/AddObject.d.ts +16 -0
- package/dist/src/events/AddObject.js +1 -0
- package/dist/src/events/AddParticle.d.ts +6 -0
- package/dist/src/events/AddParticle.js +1 -0
- package/dist/src/events/AddText.d.ts +22 -0
- package/dist/src/events/AddText.js +1 -0
- package/dist/src/events/AnimateTrack.d.ts +18 -0
- package/dist/src/events/AnimateTrack.js +1 -0
- package/dist/src/events/AutoPlayTiles.d.ts +7 -0
- package/dist/src/events/AutoPlayTiles.js +1 -0
- package/dist/src/events/Bloom.d.ts +15 -0
- package/dist/src/events/Bloom.js +1 -0
- package/dist/src/events/Bookmark.d.ts +8 -0
- package/dist/src/events/Bookmark.js +1 -0
- package/dist/src/events/CallMethod.d.ts +8 -0
- package/dist/src/events/CallMethod.js +1 -0
- package/dist/src/events/ChangeTrack.d.ts +12 -0
- package/dist/src/events/ChangeTrack.js +1 -0
- package/dist/src/events/Checkpoint.d.ts +4 -0
- package/dist/src/events/Checkpoint.js +1 -0
- package/dist/src/events/ColorTrack.d.ts +13 -0
- package/dist/src/events/ColorTrack.js +1 -0
- package/dist/src/events/CustomBackground.d.ts +24 -0
- package/dist/src/events/CustomBackground.js +1 -0
- package/dist/src/events/EditorComment.d.ts +6 -0
- package/dist/src/events/EditorComment.js +1 -0
- package/dist/src/events/EmitParticle.d.ts +7 -0
- package/dist/src/events/EmitParticle.js +1 -0
- package/dist/src/events/Flash.d.ts +14 -0
- package/dist/src/events/Flash.js +1 -0
- package/dist/src/events/FreeRoam.d.ts +11 -0
- package/dist/src/events/FreeRoam.js +1 -0
- package/dist/src/events/FreeRoamRemove.d.ts +7 -0
- package/dist/src/events/FreeRoamRemove.js +1 -0
- package/dist/src/events/FreeRoamTwirl.d.ts +7 -0
- package/dist/src/events/FreeRoamTwirl.js +1 -0
- package/dist/src/events/HallOfMirrors.d.ts +6 -0
- package/dist/src/events/HallOfMirrors.js +1 -0
- package/dist/src/events/Hide.d.ts +10 -0
- package/dist/src/events/Hide.js +1 -0
- package/dist/src/events/Hold.d.ts +6 -0
- package/dist/src/events/Hold.js +1 -0
- package/dist/src/events/KillPlayer.d.ts +5 -0
- package/dist/src/events/KillPlayer.js +1 -0
- package/dist/src/events/MoveCamera.d.ts +14 -0
- package/dist/src/events/MoveCamera.js +1 -0
- package/dist/src/events/MoveDecorations.d.ts +19 -0
- package/dist/src/events/MoveDecorations.js +1 -0
- package/dist/src/events/MoveTrack.d.ts +15 -0
- package/dist/src/events/MoveTrack.js +1 -0
- package/dist/src/events/MultiPlanet.d.ts +6 -0
- package/dist/src/events/MultiPlanet.js +1 -0
- package/dist/src/events/Multitap.d.ts +5 -0
- package/dist/src/events/Multitap.js +1 -0
- package/dist/src/events/Pause.d.ts +9 -0
- package/dist/src/events/Pause.js +1 -0
- package/dist/src/events/PlaySound.d.ts +11 -0
- package/dist/src/events/PlaySound.js +1 -0
- package/dist/src/events/PositionTrack.d.ts +11 -0
- package/dist/src/events/PositionTrack.js +1 -0
- package/dist/src/events/RecolorTrack.d.ts +14 -0
- package/dist/src/events/RecolorTrack.js +1 -0
- package/dist/src/events/RepeatEvents.d.ts +10 -0
- package/dist/src/events/RepeatEvents.js +1 -0
- package/dist/src/events/ScaleMargin.d.ts +8 -0
- package/dist/src/events/ScaleMargin.js +1 -0
- package/dist/src/events/ScalePlanets.d.ts +12 -0
- package/dist/src/events/ScalePlanets.js +1 -0
- package/dist/src/events/ScaleRadius.d.ts +8 -0
- package/dist/src/events/ScaleRadius.js +1 -0
- package/dist/src/events/ScreenScroll.d.ts +9 -0
- package/dist/src/events/ScreenScroll.js +1 -0
- package/dist/src/events/ScreenTile.d.ts +9 -0
- package/dist/src/events/ScreenTile.js +1 -0
- package/dist/src/events/SetConditionalEvents.d.ts +9 -0
- package/dist/src/events/SetConditionalEvents.js +1 -0
- package/dist/src/events/SetDefaultText.d.ts +7 -0
- package/dist/src/events/SetDefaultText.js +1 -0
- package/dist/src/events/SetFilter.d.ts +11 -0
- package/dist/src/events/SetFilter.js +1 -0
- package/dist/src/events/SetFilterAdvanced.d.ts +11 -0
- package/dist/src/events/SetFilterAdvanced.js +1 -0
- package/dist/src/events/SetFloorIcon.d.ts +8 -0
- package/dist/src/events/SetFloorIcon.js +1 -0
- package/dist/src/events/SetFrameRate.d.ts +8 -0
- package/dist/src/events/SetFrameRate.js +1 -0
- package/dist/src/events/SetHitsound.d.ts +10 -0
- package/dist/src/events/SetHitsound.js +1 -0
- package/dist/src/events/SetHoldSound.d.ts +14 -0
- package/dist/src/events/SetHoldSound.js +1 -0
- package/dist/src/events/SetInputEvent.d.ts +10 -0
- package/dist/src/events/SetInputEvent.js +1 -0
- package/dist/src/events/SetObject.d.ts +17 -0
- package/dist/src/events/SetObject.js +1 -0
- package/dist/src/events/SetParticle.d.ts +17 -0
- package/dist/src/events/SetParticle.js +1 -0
- package/dist/src/events/SetPlanetRotation.d.ts +9 -0
- package/dist/src/events/SetPlanetRotation.js +1 -0
- package/dist/src/events/SetSpeed.d.ts +5 -0
- package/dist/src/events/SetSpeed.js +1 -0
- package/dist/src/events/SetText.d.ts +19 -0
- package/dist/src/events/SetText.js +1 -0
- package/dist/src/events/ShakeScreen.d.ts +11 -0
- package/dist/src/events/ShakeScreen.js +1 -0
- package/dist/src/events/TileDimensions.d.ts +9 -0
- package/dist/src/events/TileDimensions.js +1 -0
- package/dist/src/events/Twirl.d.ts +4 -0
- package/dist/src/events/Twirl.js +1 -0
- package/dist/src/events/index.d.ts +56 -0
- package/dist/src/events/index.js +1 -0
- package/dist/src/format.js +3 -1
- package/dist/src/index.d.ts +3 -1
- package/dist/src/index.js +3 -1
- package/dist/src/pathdata.js +3 -1
- package/dist/src/presets.js +8 -5
- package/dist/src/structure/Level.d.ts +3 -3
- package/dist/src/structure/Level.js +20 -1
- package/dist/src/structure/interfaces.d.ts +7 -2
- package/dist/src/types.d.ts +96 -0
- package/dist/src/types.js +7 -0
- package/dist/umd/index.js +1 -1
- package/package.json +97 -92
- package/dist/src/parser/ArrayBufferParser copy.d.ts +0 -9
- package/dist/src/parser/ArrayBufferParser copy.js +0 -98
- package/dist/src/parser/BufferParser copy.d.ts +0 -9
- package/dist/src/parser/BufferParser copy.js +0 -92
- package/dist/src/parser/BufferParserX.d.ts +0 -23
- package/dist/src/parser/BufferParserX.js +0 -77
- package/dist/src/parser/FileParser.d.ts +0 -9
- package/dist/src/parser/FileParser.js +0 -30
- package/dist/src/structure/format copy.d.ts +0 -8
- package/dist/src/structure/format copy.js +0 -44
package/dist/src/presets.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.preset_inner_no_deco = exports.preset_noeffect_completely = exports.preset_nomovecamera = exports.preset_noholds = exports.preset_noeffect = void 0;
|
|
4
|
+
exports.preset_noeffect = {
|
|
2
5
|
type: 'exclude', events: [
|
|
3
6
|
'Flash',
|
|
4
7
|
'SetFilter',
|
|
@@ -11,17 +14,17 @@ export const preset_noeffect = {
|
|
|
11
14
|
'ShakeScreen'
|
|
12
15
|
]
|
|
13
16
|
};
|
|
14
|
-
|
|
17
|
+
exports.preset_noholds = {
|
|
15
18
|
type: 'exclude', events: [
|
|
16
19
|
'Hold',
|
|
17
20
|
]
|
|
18
21
|
};
|
|
19
|
-
|
|
22
|
+
exports.preset_nomovecamera = {
|
|
20
23
|
type: 'exclude', events: [
|
|
21
24
|
'MoveCamera',
|
|
22
25
|
]
|
|
23
26
|
};
|
|
24
|
-
|
|
27
|
+
exports.preset_noeffect_completely = {
|
|
25
28
|
type: 'exclude', events: [
|
|
26
29
|
"AddDecoration",
|
|
27
30
|
"AddText",
|
|
@@ -65,7 +68,7 @@ export const preset_noeffect_completely = {
|
|
|
65
68
|
"ScaleRadius"
|
|
66
69
|
]
|
|
67
70
|
};
|
|
68
|
-
|
|
71
|
+
exports.preset_inner_no_deco = {
|
|
69
72
|
type: "special", events: [
|
|
70
73
|
"MoveDecorations",
|
|
71
74
|
"SetText",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AdofaiEvent, LevelOptions, Tile, ParseProvider, ParseProgressEvent, PrecomputedProgressEvents, LightweightPrecomputedData } from './interfaces';
|
|
1
|
+
import { AdofaiEvent, ActionData, LevelOptions, Tile, ParseProvider, ParseProgressEvent, PrecomputedProgressEvents, LightweightPrecomputedData } from './interfaces';
|
|
2
2
|
import { EffectCleanerType } from '../filter/effectProcessor';
|
|
3
3
|
export declare class Level {
|
|
4
4
|
private _events;
|
|
@@ -103,11 +103,11 @@ export declare class Level {
|
|
|
103
103
|
private _parseAngle;
|
|
104
104
|
filterActionsByEventType(en: string): {
|
|
105
105
|
index: number;
|
|
106
|
-
action:
|
|
106
|
+
action: ActionData;
|
|
107
107
|
}[];
|
|
108
108
|
getActionsByIndex(en: string, index: number): {
|
|
109
109
|
count: number;
|
|
110
|
-
actions:
|
|
110
|
+
actions: ActionData[];
|
|
111
111
|
};
|
|
112
112
|
calculateTileCoordinates(): void;
|
|
113
113
|
/**
|
|
@@ -22,7 +22,26 @@ import pathData from '../pathdata';
|
|
|
22
22
|
import exportAsADOFAI from './format';
|
|
23
23
|
import effectProcessor from '../filter/effectProcessor';
|
|
24
24
|
import { EffectCleanerType } from '../filter/effectProcessor';
|
|
25
|
-
|
|
25
|
+
function uuid() {
|
|
26
|
+
var _a;
|
|
27
|
+
const r = new Uint8Array(16);
|
|
28
|
+
const crypto = (_a = globalThis.crypto) !== null && _a !== void 0 ? _a : globalThis === null || globalThis === void 0 ? void 0 : globalThis.msCrypto;
|
|
29
|
+
if (crypto === null || crypto === void 0 ? void 0 : crypto.getRandomValues) {
|
|
30
|
+
crypto.getRandomValues(r);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
for (let i = 0; i < 16; i++)
|
|
34
|
+
r[i] = Math.floor(Math.random() * 256);
|
|
35
|
+
}
|
|
36
|
+
r[6] = (r[6] & 0x0f) | 0x40;
|
|
37
|
+
r[8] = (r[8] & 0x3f) | 0x80;
|
|
38
|
+
const h = (b) => (b >>> 4).toString(16) + (b & 0x0f).toString(16);
|
|
39
|
+
return h(r[0]) + h(r[1]) + h(r[2]) + h(r[3]) + '-'
|
|
40
|
+
+ h(r[4]) + h(r[5]) + '-'
|
|
41
|
+
+ h(r[6]) + h(r[7]) + '-'
|
|
42
|
+
+ h(r[8]) + h(r[9]) + '-'
|
|
43
|
+
+ h(r[10]) + h(r[11]) + h(r[12]) + h(r[13]) + h(r[14]) + h(r[15]);
|
|
44
|
+
}
|
|
26
45
|
import * as presets from '../filter/presets';
|
|
27
46
|
export class Level {
|
|
28
47
|
constructor(opt, provider) {
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
export interface AdofaiEvent {
|
|
2
|
+
floor: number;
|
|
3
|
+
eventType: string;
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
}
|
|
6
|
+
export interface ActionData {
|
|
2
7
|
eventType: string;
|
|
3
8
|
[key: string]: any;
|
|
4
9
|
}
|
|
@@ -21,8 +26,8 @@ export interface GuidCallback {
|
|
|
21
26
|
export interface Tile {
|
|
22
27
|
direction?: number;
|
|
23
28
|
angle?: number;
|
|
24
|
-
actions:
|
|
25
|
-
addDecorations?:
|
|
29
|
+
actions: ActionData[];
|
|
30
|
+
addDecorations?: ActionData[];
|
|
26
31
|
_lastdir?: number;
|
|
27
32
|
twirl?: number;
|
|
28
33
|
position?: number[];
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
export type Vec2 = [number, number];
|
|
2
|
+
export type ABoolean = boolean | 'Enabled' | 'Disabled' | 'true' | 'false';
|
|
3
|
+
export declare const enum TextAnchor {
|
|
4
|
+
UpperLeft = "UpperLeft",
|
|
5
|
+
UpperCenter = "UpperCenter",
|
|
6
|
+
UpperRight = "UpperRight",
|
|
7
|
+
MiddleLeft = "MiddleLeft",
|
|
8
|
+
MiddleCenter = "MiddleCenter",
|
|
9
|
+
MiddleRight = "MiddleRight",
|
|
10
|
+
LowerLeft = "LowerLeft",
|
|
11
|
+
LowerCenter = "LowerCenter",
|
|
12
|
+
LowerRight = "LowerRight"
|
|
13
|
+
}
|
|
14
|
+
export declare const enum Hitbox {
|
|
15
|
+
None = "None",
|
|
16
|
+
Kill = "Kill",
|
|
17
|
+
PassThrough = "PassThrough",
|
|
18
|
+
NoEffect = "NoEffect"
|
|
19
|
+
}
|
|
20
|
+
export declare const enum FilterType {
|
|
21
|
+
Grayscale = "Grayscale",
|
|
22
|
+
Sepia = "Sepia",
|
|
23
|
+
Invert = "Invert",
|
|
24
|
+
Pixellate = "Pixellate",
|
|
25
|
+
Blur = "Blur",
|
|
26
|
+
Glitch = "Glitch",
|
|
27
|
+
Bloom = "Bloom",
|
|
28
|
+
VHS = "VHS",
|
|
29
|
+
Warp = "Warp",
|
|
30
|
+
RadialBlur = "RadialBlur",
|
|
31
|
+
Custom = "Custom"
|
|
32
|
+
}
|
|
33
|
+
export declare const enum FlashStyle {
|
|
34
|
+
Flash = "Flash",
|
|
35
|
+
Reverse = "Reverse",
|
|
36
|
+
StayBlack = "StayBlack",
|
|
37
|
+
Kill = "Kill",
|
|
38
|
+
FlashEx = "FlashEx"
|
|
39
|
+
}
|
|
40
|
+
export declare const enum RelativeTo {
|
|
41
|
+
Tile = "Tile",
|
|
42
|
+
LastPosition = "LastPosition",
|
|
43
|
+
Player = "Player"
|
|
44
|
+
}
|
|
45
|
+
export declare const enum TargetPlanet {
|
|
46
|
+
All = "All",
|
|
47
|
+
Current = "Current",
|
|
48
|
+
Specific = "Specific"
|
|
49
|
+
}
|
|
50
|
+
export declare const enum AngleCorrectionDir {
|
|
51
|
+
None = "None",
|
|
52
|
+
CW = "CW",
|
|
53
|
+
CCW = "CCW"
|
|
54
|
+
}
|
|
55
|
+
export declare const enum InputEventState {
|
|
56
|
+
Subscribe = "Subscribe",
|
|
57
|
+
Unsubscribe = "Unsubscribe"
|
|
58
|
+
}
|
|
59
|
+
export declare const enum InputEventTarget {
|
|
60
|
+
Pressed = "Pressed",
|
|
61
|
+
Released = "Released",
|
|
62
|
+
Held = "Held",
|
|
63
|
+
Neutral = "Neutral"
|
|
64
|
+
}
|
|
65
|
+
export declare const enum Condition {
|
|
66
|
+
IfPassed = "IfPassed",
|
|
67
|
+
IfFailed = "IfFailed"
|
|
68
|
+
}
|
|
69
|
+
export declare const enum BgDisplayMode {
|
|
70
|
+
FitToScreen = "FitToScreen",
|
|
71
|
+
Unscaled = "Unscaled",
|
|
72
|
+
Tiled = "Tiled"
|
|
73
|
+
}
|
|
74
|
+
export declare const enum BgShapeType {
|
|
75
|
+
Disabled = "Disabled",
|
|
76
|
+
Tile = "Tile",
|
|
77
|
+
Circle = "Circle",
|
|
78
|
+
Diamond = "Diamond",
|
|
79
|
+
Triangle = "Triangle",
|
|
80
|
+
Hexagon = "Hexagon",
|
|
81
|
+
Donut = "Donut",
|
|
82
|
+
Pentagon = "Pentagon",
|
|
83
|
+
Custom = "Custom"
|
|
84
|
+
}
|
|
85
|
+
export declare const enum HitsoundType {
|
|
86
|
+
Kick = "Kick",
|
|
87
|
+
Snare = "Snare",
|
|
88
|
+
Hat = "Hat",
|
|
89
|
+
Clap = "Clap",
|
|
90
|
+
Custom = "Custom"
|
|
91
|
+
}
|
|
92
|
+
export declare const enum HoldMidSoundTimingRelativeTo {
|
|
93
|
+
Start = "Start",
|
|
94
|
+
End = "End"
|
|
95
|
+
}
|
|
96
|
+
export declare function isEventEnabled(value: ABoolean | undefined, defaultValue: boolean): boolean;
|
package/dist/umd/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ADOFAI=e():t.ADOFAI=e()}(globalThis,(()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{Level:()=>St,Parsers:()=>r,Presets:()=>n,Structure:()=>i,pathData:()=>a});var r={};t.r(r),t.d(r,{ArrayBufferParser:()=>Q,BufferParser:()=>A,StringParser:()=>B,default:()=>$});var n={};t.r(n),t.d(n,{preset_inner_no_deco:()=>at,preset_noeffect:()=>rt,preset_noeffect_completely:()=>ot,preset_noholds:()=>nt,preset_nomovecamera:()=>it});var i={};t.r(i),t.d(i,{default:()=>St});var o={R:0,p:15,J:30,E:45,T:60,o:75,U:90,q:105,G:120,Q:135,H:150,W:165,L:180,x:195,N:210,Z:225,F:240,V:255,D:270,Y:285,B:300,C:315,M:330,A:345,5:555,6:666,7:777,8:888,"!":999};const a={pathDataTable:o,parseToangleData:function(t){return Array.from(t).map((function(t){return o[t]}))}};function s(t){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}function u(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,l(n.key),n)}}function l(t){var e=function(t){if("object"!=s(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=s(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==s(e)?e:e+""}const c=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return e=t,r=[{key:"parseError",value:function(t){return t}},{key:"parseAsObject",value:function(e,r){return(r||JSON).parse(t.parseAsText(e))}},{key:"parseAsText",value:function(t){return this.parseError(t)}}],null&&u(e.prototype,null),r&&u(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}function h(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,y(n.key),n)}}function p(t,e,r){return e&&h(t.prototype,e),r&&h(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function y(t){var e=function(t){if("object"!=f(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=f(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==f(e)?e:e+""}const v=p((function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}));function d(t){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},d(t)}function g(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function b(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,w(n.key),n)}}function m(t,e,r){return e&&b(t.prototype,e),r&&b(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function w(t){var e=function(t){if("object"!=d(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=d(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==d(e)?e:e+""}function O(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(O=function(){return!!t})()}function k(t){return k=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},k(t)}function S(t,e){return S=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},S(t,e)}var _=function(t){function e(){return g(this,e),t=this,n=arguments,r=k(r=e),function(t,e){if(e&&("object"==d(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,O()?Reflect.construct(r,n||[],k(t).constructor):r.apply(t,n));var t,r,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&S(t,e)}(e,t),m(e,[{key:"parse",value:function(t){var e,r;return e="string"==typeof t?(new TextEncoder).encode(t):(r=t).length>=3&&239===r[0]&&187===r[1]&&191===r[2]?r.subarray(3):r,new E(e).parseValue()}},{key:"stringify",value:function(t){return JSON.stringify(t)}}])}(v),E=function(){return m((function t(e){g(this,t),this.data=e,this.pos=0,this.decoder=new TextDecoder("utf-8"),this.length=e.length}),[{key:"parseValue",value:function(){this.eatWhitespace();var t=this.peek();if(-1===t)return null;switch(t){case 123:return this.parseObject();case 91:return this.parseArray();case 34:return this.parseString();case 116:return this.parseKeyword(!0);case 102:return this.parseKeyword(!1);case 110:return this.parseKeyword(null);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.parseNumber();default:return this.pos++,null}}},{key:"parseObject",value:function(){var t={};for(this.pos++;;){if(this.eatWhitespace(),125===this.peek()){this.pos++;break}var e=this.parseString();if(this.eatWhitespace(),58!==this.peek())break;this.pos++,t[e]=this.parseValue(),this.eatWhitespace(),44===this.peek()&&this.pos++}return t}},{key:"parseArray",value:function(){var t=[];for(this.pos++;;){if(this.eatWhitespace(),93===this.peek()){this.pos++;break}t.push(this.parseValue()),this.eatWhitespace(),44===this.peek()&&this.pos++}return t}},{key:"parseString",value:function(){this.pos++;for(var t=this.pos,e=!1;this.pos<this.length;){var r=this.data[this.pos];if(34===r)break;92===r?(e=!0,this.pos+=2):this.pos++}var n=this.pos;this.pos++;var i=this.data.subarray(t,n);return e?this.processEscapes(i):this.decoder.decode(i)}},{key:"processEscapes",value:function(t){for(var e=this.decoder.decode(t),r="",n=0;n<e.length;n++)if("\\"===e[n]&&n+1<e.length){var i=e[++n];switch(i){case'"':case"\\":case"/":r+=i;break;case"b":r+="\b";break;case"f":r+="\f";break;case"n":r+="\n";break;case"r":r+="\r";break;case"t":r+="\t";break;case"u":r+=String.fromCharCode(parseInt(e.substr(n+1,4),16)),n+=4}}else r+=e[n];return r}},{key:"parseNumber",value:function(){for(var t=this.pos;this.pos<this.length;){var e=this.data[this.pos];if(!(e>=48&&e<=57||46===e||101===e||69===e||43===e||45===e))break;this.pos++}var r=this.decoder.decode(this.data.subarray(t,this.pos));return parseFloat(r)}},{key:"parseKeyword",value:function(t){var e=this.data[this.pos];return 116===e?this.pos+=4:102===e?this.pos+=5:110===e&&(this.pos+=4),t}},{key:"eatWhitespace",value:function(){for(;this.pos<this.length;){var t=this.data[this.pos];if(32!==t&&10!==t&&13!==t&&9!==t)break;this.pos++}}},{key:"peek",value:function(){return this.pos<this.length?this.data[this.pos]:-1}}])}();const A=_;function j(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function T(t){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},T(t)}function P(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function D(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,N(n.key),n)}}function x(t,e,r){return e&&D(t.prototype,e),r&&D(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function N(t){var e=function(t){if("object"!=T(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=T(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==T(e)?e:e+""}function C(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(C=function(){return!!t})()}function M(t){return M=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},M(t)}function R(t,e){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},R(t,e)}var U=function(t){function e(){return P(this,e),t=this,n=arguments,r=M(r=e),function(t,e){if(e&&("object"==T(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,C()?Reflect.construct(r,n||[],M(t).constructor):r.apply(t,n));var t,r,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&R(t,e)}(e,t),x(e,[{key:"parse",value:function(t,r){if(null==t)return null;var n=new I(t).parseValue();return"function"==typeof r?e._applyReviver("",n,r):n}},{key:"stringify",value:function(t,e,r){return new K(e,r).serialize(t)}}],[{key:"_applyReviver",value:function(t,r,n){if(r&&"object"===T(r))if(Array.isArray(r))for(var i=0;i<r.length;i++)r[i]=e._applyReviver(i.toString(),r[i],n);else for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(r[o]=e._applyReviver(o,r[o],n));return n(t,r)}}])}(v),I=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;P(this,t),this.json=e,this.position=0,this.endSection=r,65279===this.peek()&&this.read()}return x(t,[{key:"parseValue",value:function(){return this.parseByToken(this.nextToken)}},{key:"parseObject",value:function(){var e={};for(this.read();;){var r=void 0;do{if((r=this.nextToken)===t.TOKEN.NONE)return null;if(r===t.TOKEN.CURLY_CLOSE)return e}while(r===t.TOKEN.COMMA);var n=this.parseString();if(null===n)return null;if(this.nextToken!==t.TOKEN.COLON)return null;if(null!=this.endSection&&n===this.endSection)return e;this.read(),e[n]=this.parseValue()}}},{key:"parseArray",value:function(){var e=[];this.read();for(var r=!0;r;){var n=this.nextToken;switch(n){case t.TOKEN.NONE:return null;case t.TOKEN.SQUARED_CLOSE:r=!1;break;case t.TOKEN.COMMA:break;default:var i=this.parseByToken(n);e.push(i)}}return e}},{key:"parseByToken",value:function(e){switch(e){case t.TOKEN.CURLY_OPEN:return this.parseObject();case t.TOKEN.SQUARED_OPEN:return this.parseArray();case t.TOKEN.STRING:return this.parseString();case t.TOKEN.NUMBER:return this.parseNumber();case t.TOKEN.TRUE:return!0;case t.TOKEN.FALSE:return!1;case t.TOKEN.NULL:default:return null}}},{key:"parseString",value:function(){var t="";this.read();for(var e=!0;e&&-1!==this.peek();){var r=this.nextChar;switch(r){case'"':e=!1;break;case"\\":if(-1===this.peek()){e=!1;break}var n=this.nextChar;switch(n){case'"':case"/":case"\\":t+=n;break;case"b":t+="\b";break;case"f":t+="\f";break;case"n":t+="\n";break;case"r":t+="\r";break;case"t":t+="\t";break;case"u":for(var i="",o=0;o<4;o++)i+=this.nextChar;t+=String.fromCharCode(Number.parseInt(i,16))}break;default:t+=r}}return t}},{key:"parseNumber",value:function(){var t=this.nextWord;return-1===t.indexOf(".")?Number.parseInt(t,10)||0:Number.parseFloat(t)||0}},{key:"eatWhitespace",value:function(){for(;-1!==t.WHITE_SPACE.indexOf(this.peekChar)&&(this.read(),-1!==this.peek()););}},{key:"peek",value:function(){return this.position>=this.json.length?-1:this.json.charCodeAt(this.position)}},{key:"read",value:function(){return this.position>=this.json.length?-1:this.json.charCodeAt(this.position++)}},{key:"peekChar",get:function(){var t=this.peek();return-1===t?"\0":String.fromCharCode(t)}},{key:"nextChar",get:function(){var t=this.read();return-1===t?"\0":String.fromCharCode(t)}},{key:"nextWord",get:function(){for(var e="";-1===t.WORD_BREAK.indexOf(this.peekChar)&&(e+=this.nextChar,-1!==this.peek()););return e}},{key:"nextToken",get:function(){if(this.eatWhitespace(),-1===this.peek())return t.TOKEN.NONE;switch(this.peekChar){case'"':return t.TOKEN.STRING;case",":return this.read(),t.TOKEN.COMMA;case"-":case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return t.TOKEN.NUMBER;case":":return t.TOKEN.COLON;case"[":return t.TOKEN.SQUARED_OPEN;case"]":return this.read(),t.TOKEN.SQUARED_CLOSE;case"{":return t.TOKEN.CURLY_OPEN;case"}":return this.read(),t.TOKEN.CURLY_CLOSE;default:switch(this.nextWord){case"false":return t.TOKEN.FALSE;case"true":return t.TOKEN.TRUE;case"null":return t.TOKEN.NULL;default:return t.TOKEN.NONE}}}}])}();I.WHITE_SPACE=" \t\n\r\ufeff",I.WORD_BREAK=' \t\n\r{}[],:"',I.TOKEN={NONE:0,CURLY_OPEN:1,CURLY_CLOSE:2,SQUARED_OPEN:3,SQUARED_CLOSE:4,COLON:5,COMMA:6,STRING:7,NUMBER:8,TRUE:9,FALSE:10,NULL:11};var K=function(){return x((function t(e,r){P(this,t),this.result="",this.indent=0,this.indentStr="",this.replacer=e||null,this.space=r||null,"number"==typeof r?this.indentStr=" ".repeat(Math.min(10,Math.max(0,r))):"string"==typeof r&&(this.indentStr=r.slice(0,10))}),[{key:"serialize",value:function(t){return this.result="",this.serializeValue(t,""),this.result}},{key:"serializeValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";"function"==typeof this.replacer&&(t=this.replacer(e,t)),null==t?this.result+="null":"string"==typeof t?this.serializeString(t):"boolean"==typeof t?this.result+=t.toString():Array.isArray(t)?this.serializeArray(t):"object"===T(t)?this.serializeObject(t):this.serializeOther(t)}},{key:"serializeObject",value:function(t){var e=!0;for(var r in this.result+="{",this.indentStr&&(this.result+="\n",this.indent++),t)if(Object.prototype.hasOwnProperty.call(t,r)){if(Array.isArray(this.replacer)&&!this.replacer.includes(r))continue;e||(this.result+=",",this.indentStr&&(this.result+="\n")),this.indentStr&&(this.result+=this.indentStr.repeat(this.indent)),this.serializeString(r.toString()),this.result+=":",this.indentStr&&(this.result+=" "),this.serializeValue(t[r],r),e=!1}this.indentStr&&(this.result+="\n",this.indent--,this.result+=this.indentStr.repeat(this.indent)),this.result+="}"}},{key:"serializeArray",value:function(t){this.result+="[",this.indentStr&&t.length>0&&(this.result+="\n",this.indent++);for(var e=!0,r=0;r<t.length;r++)e||(this.result+=",",this.indentStr&&(this.result+="\n")),this.indentStr&&(this.result+=this.indentStr.repeat(this.indent)),this.serializeValue(t[r],r.toString()),e=!1;this.indentStr&&t.length>0&&(this.result+="\n",this.indent--,this.result+=this.indentStr.repeat(this.indent)),this.result+="]"}},{key:"serializeString",value:function(t){this.result+='"';var e,r=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return j(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?j(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(t);try{for(r.s();!(e=r.n()).done;){var n=e.value;switch(n){case"\b":this.result+="\\b";break;case"\t":this.result+="\\t";break;case"\n":this.result+="\\n";break;case"\f":this.result+="\\f";break;case"\r":this.result+="\\r";break;case'"':this.result+='\\"';break;case"\\":this.result+="\\\\";break;default:var i=n.charCodeAt(0);this.result+=i>=32&&i<=126?n:"\\u"+i.toString(16).padStart(4,"0")}}}catch(t){r.e(t)}finally{r.f()}this.result+='"'}},{key:"serializeOther",value:function(t){"number"==typeof t?isFinite(t)?this.result+=t.toString():this.result+="null":this.serializeString(t.toString())}}])}();const B=U;function F(t){return F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},F(t)}function L(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,z(n.key),n)}}function z(t){var e=function(t){if("object"!=F(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=F(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==F(e)?e:e+""}function W(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(W=function(){return!!t})()}function V(t){return V=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},V(t)}function G(t,e){return G=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},G(t,e)}var H=new Uint8Array([239,187,191]),J=new Uint8Array([44]);function Y(t){var e=new Uint8Array(t);return e.length>=3&&e[0]===H[0]&&e[1]===H[1]&&e[2]===H[2]?t.slice(3):t}const Q=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=V(e),function(t,e){if(e&&("object"==F(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,W()?Reflect.construct(e,r||[],V(t).constructor):e.apply(t,r))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&G(t,e)}(e,t),r=e,(n=[{key:"parse",value:function(t){return"string"==typeof t?B.prototype.parse.call(B.prototype,t):B.prototype.parse.call(B.prototype,(e=function(t){for(var e=new Uint8Array(t),r=[],n="other",i=0,o=0;o<e.length;o++){var a=e[o];if("escape"==n)n="string";else switch(a){case 34:switch(n){case"string":n="other";break;case"comma":r.push(J);default:n="string"}break;case 92:"string"===n&&(n="escape");break;case 44:r.push(e.subarray(i,o)),i=o+1,"other"===n&&(n="comma");break;case 93:case 125:"comma"===n&&(n="other");break;case 9:case 10:case 11:case 12:case 13:case 32:break;default:"comma"===n&&(r.push(J),n="other")}}r.push(e.subarray(i));for(var s=0,u=0,l=r;u<l.length;u++)s+=l[u].length;for(var c=new Uint8Array(s),f=0,h=0,p=r;h<p.length;h++){var y=p[h];c.set(y,f),f+=y.length}return c.buffer}(Y(t)),r=Y(e),new TextDecoder("utf-8").decode(r)));var e,r}},{key:"stringify",value:function(t){return JSON.stringify(t)}}])&&L(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(v),$=c;function q(t){return q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},q(t)}function Z(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"\t",i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;if("object"!==q(t)||null===t)return JSON.stringify(t);if(Array.isArray(t)){if(t.every((function(t){return"object"!==q(t)||null===t})))return"["+t.map((function(t){return Z(t,0,!1,n,i)})).join(",")+"]";var o=n.repeat(e),a=n.repeat(e+i);return"[\n"+t.map((function(t){return a+X(t,n)})).join(",\n")+"\n"+o+"]"}var s=n.repeat(e),u=Object.keys(t);if(r){var l=n.repeat(i);return"{\n"+u.map((function(e){return l+JSON.stringify(e)+": "+Z(t[e],i,!1,n,i)})).join(",\n")+"\n}"}return"{\n"+u.map((function(r){return s+n.repeat(i)+JSON.stringify(r)+": "+Z(t[r],e+i,!1,n,i)})).join(",\n")+"\n"+s+"}"}function X(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"\t";return"object"!==q(t)||null===t?Z(t,0,!1,e):Array.isArray(t)?"["+t.map((function(t){return X(t,e)})).join(",")+"]":"{"+Object.keys(t).map((function(r){return JSON.stringify(r)+": "+X(t[r],e)})).join(", ")+"}"}const tt=Z;var et,rt={type:"exclude",events:["Flash","SetFilter","SetFilterAdvanced","HallOfMirrors","Bloom","ScalePlanets","ScreenTile","ScreenScroll","ShakeScreen"]},nt={type:"exclude",events:["Hold"]},it={type:"exclude",events:["MoveCamera"]},ot={type:"exclude",events:["AddDecoration","AddText","AddObject","Checkpoint","SetHitsound","PlaySound","SetPlanetRotation","ScalePlanets","ColorTrack","AnimateTrack","RecolorTrack","MoveTrack","PositionTrack","MoveDecorations","SetText","SetObject","SetDefaultText","CustomBackground","Flash","MoveCamera","SetFilter","HallOfMirrors","ShakeScreen","Bloom","ScreenTile","ScreenScroll","SetFrameRate","RepeatEvents","SetConditionalEvents","EditorComment","Bookmark","Hold","SetHoldSound","Hide","ScaleMargin","ScaleRadius"]},at={type:"special",events:["MoveDecorations","SetText","SetObject","SetDefaultText"]};!function(t){t.include="include",t.exclude="exclude",t.special="special"}(et||(et={}));const st=function(t){if(!Array.isArray(t))throw new Error("Arguments are not supported.");return t.map((function(t){var e=Object.assign({},t);return e.hasOwnProperty("addDecorations")&&(e.addDecorations=[]),Array.isArray(e.actions)&&(e.actions=e.actions.filter((function(t){return!at.events.includes(t.eventType)}))),e}))},ut=function(t,e){return e.map((function(e){var r=Object.assign({},e);return Array.isArray(e.actions)&&(r.actions=e.actions.filter((function(e){return!t.includes(e.eventType)}))),r}))},lt=function(t,e){return e.map((function(e){var r=Object.assign({},e);return Array.isArray(e.actions)&&(r.actions=e.actions.filter((function(e){return t.includes(e.eventType)}))),r}))},ct={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let ft;const ht=new Uint8Array(16),pt=[];for(let t=0;t<256;++t)pt.push((t+256).toString(16).slice(1));function yt(t,e,r){const n=(t=t||{}).random??t.rng?.()??function(){if(!ft){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");ft=crypto.getRandomValues.bind(crypto)}return ft(ht)}();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){if((r=r||0)<0||r+16>e.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let t=0;t<16;++t)e[r+t]=n[t];return e}return function(t,e=0){return(pt[t[e+0]]+pt[t[e+1]]+pt[t[e+2]]+pt[t[e+3]]+"-"+pt[t[e+4]]+pt[t[e+5]]+"-"+pt[t[e+6]]+pt[t[e+7]]+"-"+pt[t[e+8]]+pt[t[e+9]]+"-"+pt[t[e+10]]+pt[t[e+11]]+pt[t[e+12]]+pt[t[e+13]]+pt[t[e+14]]+pt[t[e+15]]).toLowerCase()}(n)}function vt(){vt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,r,n){return Object.defineProperty(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n})}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(e,r,n,i){var o=r&&r.prototype instanceof h?r:h,a=Object.create(o.prototype);return u(a,"_invoke",function(e,r,n){var i=1;return function(o,a){if(3===i)throw Error("Generator is already running");if(4===i){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=O(s,n);if(u){if(u===f)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(1===i)throw i=4,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=3;var l=c(e,r,n);if("normal"===l.type){if(i=n.done?4:2,l.arg===f)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=4,n.method="throw",n.arg=l.arg)}}}(e,n,new _(i||[])),!0),a}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var f={};function h(){}function p(){}function y(){}var v={};u(v,o,(function(){return this}));var d=Object.getPrototypeOf,g=d&&d(d(E([])));g&&g!==r&&n.call(g,o)&&(v=g);var b=y.prototype=h.prototype=Object.create(v);function m(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function r(i,o,a,s){var u=c(t[i],t,o);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==dt(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,s)}))}s(u.arg)}var i;u(this,"_invoke",(function(t,n){function o(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(o,o):o()}),!0)}function O(e,r){var n=r.method,i=e.i[n];if(i===t)return r.delegate=null,"throw"===n&&e.i.return&&(r.method="return",r.arg=t,O(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var o=c(i,e.i,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,f;var a=o.arg;return a?a.done?(r[e.r]=a.value,r.next=e.n,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,f):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,f)}function k(t){this.tryEntries.push(t)}function S(e){var r=e[4]||{};r.type="normal",r.arg=t,e[4]=r}function _(t){this.tryEntries=[[-1]],t.forEach(k,this),this.reset(!0)}function E(e){if(null!=e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(dt(e)+" is not iterable")}return p.prototype=y,u(b,"constructor",y),u(y,"constructor",p),p.displayName=u(y,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,s,"GeneratorFunction")),t.prototype=Object.create(b),t},e.awrap=function(t){return{__await:t}},m(w.prototype),u(w.prototype,a,(function(){return this})),e.AsyncIterator=w,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new w(l(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(b),u(b,s,"Generator"),u(b,o,(function(){return this})),u(b,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.unshift(n);return function t(){for(;r.length;)if((n=r.pop())in e)return t.value=n,t.done=!1,t;return t.done=!0,t}},e.values=E,_.prototype={constructor:_,reset:function(e){if(this.prev=this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(S),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0][4];if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(t){a.type="throw",a.arg=e,r.next=t}for(var i=r.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o[4],s=this.prev,u=o[1],l=o[2];if(-1===o[0])return n("end"),!1;if(!u&&!l)throw Error("try statement without catch or finally");if(null!=o[0]&&o[0]<=s){if(s<u)return this.method="next",this.arg=t,n(u),!0;if(s<l)return n(l),!1}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n[0]>-1&&n[0]<=this.prev&&this.prev<n[2]){var i=n;break}}i&&("break"===t||"continue"===t)&&i[0]<=e&&e<=i[2]&&(i=null);var o=i?i[4]:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i[2],f):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r[2]===t)return this.complete(r[4],r[3]),S(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r[0]===t){var n=r[4];if("throw"===n.type){var i=n.arg;S(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={i:E(e),r,n},"next"===this.method&&(this.arg=t),f}},e}function dt(t){return dt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dt(t)}function gt(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=bt(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function bt(t,e){if(t){if("string"==typeof t)return mt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?mt(t,e):void 0}}function mt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function wt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ot(n.key),n)}}function Ot(t){var e=function(t){if("object"!=dt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=dt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==dt(e)?e:e+""}var kt=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]])}return r},St=function(){return t=function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._precomputedEvents=null,this._precomputeMode=!1,this._lightweightData=null,this._events=new Map,this.guidCallbacks=new Map,this._options=e,this._provider=r},e=[{key:"generateGUID",value:function(){return"event_".concat(!ct.randomUUID||e||t?yt(t,e,r):ct.randomUUID());var t,e,r}},{key:"_emitProgress",value:function(t,e,r,n){var i={stage:t,current:e,total:r,percent:r>0?Math.round(e/r*100):0,data:n};this._precomputeMode&&this._precomputedEvents?this._precomputedEvents[t].push(i):(this.trigger("parse:progress",i),this.trigger("parse:".concat(t),i))}},{key:"enablePrecomputeMode",value:function(){this._precomputeMode=!0,this._precomputedEvents={start:[],pathData:[],angleData:[],relativeAngle:[],tilePosition:[],complete:[]}}},{key:"disablePrecomputeMode",value:function(){this._precomputeMode=!1}},{key:"getPrecomputedEvents",value:function(){return this._precomputedEvents}},{key:"clearPrecomputedEvents",value:function(){this._precomputedEvents=null}},{key:"getEventsAtPercent",value:function(t,e){if(!this._precomputedEvents)return[];for(var r=[],n=0,i=e?[e]:["start","pathData","angleData","relativeAngle","tilePosition","complete"];n<i.length;n++){var o,a=i[n],s=gt(this._precomputedEvents[a]);try{for(s.s();!(o=s.n()).done;){var u=o.value;if(u.percent<=t&&(0===r.length||r[r.length-1].percent<=u.percent)){var l=r[r.length-1];l&&l.stage===u.stage&&l.current===u.current||r.push(u)}}}catch(t){s.e(t)}finally{s.f()}}return r}},{key:"getPrecomputedEventCount",value:function(t){return this._precomputedEvents?t?this._precomputedEvents[t].length:Object.values(this._precomputedEvents).reduce((function(t,e){return t+e.length}),0):0}},{key:"getLightweightData",value:function(){return this._lightweightData}},{key:"precomputeLightweight",value:function(){for(var t,e,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this.tiles.length,i=new Array(n),o=r?[]:new Array(n),a=new Array(n),s=0;s<n;s++){var u=this.tiles[s];i[s]=null!==(t=u.angle)&&void 0!==t?t:0,a[s]=(null!==(e=u.twirl)&&void 0!==e?e:0)%2==1}if(!r){var l,c=[0,0],f=this.angleData,h=new Map,p=gt(this.actions);try{for(p.s();!(l=p.n()).done;){var y=l.value;"PositionTrack"===y.eventType&&y.positionOffset&&!0!==y.editorOnly&&"Enabled"!==y.editorOnly&&h.set(y.floor,y)}}catch(t){p.e(t)}finally{p.f()}for(var v=0;v<n;v++){var d=h.get(v);(null==d?void 0:d.positionOffset)&&(c[0]+=d.positionOffset[0],c[1]+=d.positionOffset[1]),o[v]=[c[0],c[1]];var g=void 0;if(999===f[v]){for(var b=1;v-b>=0&&999===f[v-b];)b++;g=(v-b>=0?f[v-b]:0)+180*(b-1)}else g=f[v];var m=g*Math.PI/180;c[0]+=Math.cos(m),c[1]+=Math.sin(m)}}return this._lightweightData={totalTiles:n,angles:i,positions:o,twirlFlags:a,computed:!0},this._lightweightData}},{key:"getLightweightDataRange",value:function(t,e){if(!this._lightweightData)return null;var r=Math.min(t+e,this._lightweightData.totalTiles);return{angles:this._lightweightData.angles.slice(t,r),positions:this._lightweightData.positions.slice(t,r),twirlFlags:this._lightweightData.twirlFlags.slice(t,r)}}},{key:"clearLightweightData",value:function(){this._lightweightData=null}},{key:"getTileRenderData",value:function(t){var e,r;if(t<0||t>=this.tiles.length)return null;var n=this.tiles[t];return{angle:null!==(e=n.angle)&&void 0!==e?e:0,position:n.position?[n.position[0],n.position[1]]:null,hasTwirl:(null!==(r=n.twirl)&&void 0!==r?r:0)%2==1}}},{key:"load",value:function(){var t=this;return new Promise((function(e,r){var n,i,o=t._options;t._emitProgress("start",0,0);var s=o instanceof ArrayBuffer,u=o instanceof Uint8Array,l="undefined"!=typeof Buffer&&Buffer.isBuffer(o);if("string"==typeof o||s||u||l)try{var c=s?new Uint8Array(o):o;i=null===(n=t._provider)||void 0===n?void 0:n.parse(c)}catch(t){return void r("解析失败: "+t)}else{if("object"!==dt(o)||null===o)return void r("Options must be String, Buffer, ArrayBuffer or Object");i=Object.assign({},o)}var f=i&&"object"===dt(i)&&null!==i&&void 0!==i.pathData,h=i&&"object"===dt(i)&&null!==i&&void 0!==i.angleData;if(f){var p=i.pathData;t._emitProgress("pathData",0,p.length,{source:p}),t.angleData=a.parseToangleData(p),t._emitProgress("pathData",p.length,p.length,{source:p,processed:t.angleData})}else{if(!h)return void r("There is not any angle datas.");t.angleData=i.angleData,t._emitProgress("angleData",t.angleData.length,t.angleData.length,{processed:t.angleData})}i&&"object"===dt(i)&&null!==i&&Array.isArray(i.actions)?t.actions=i.actions:t.actions=[],i&&"object"===dt(i)&&null!==i&&void 0!==i.settings?(t.settings=i.settings,i&&"object"===dt(i)&&null!==i&&Array.isArray(i.decorations)?t.__decorations=i.decorations:t.__decorations=[],t.tiles=[],t._angleDir=-180,t._twirlCount=0,t._createArray(t.angleData.length,{angleData:t.angleData,actions:t.actions,decorations:t.__decorations}).then((function(r){t.tiles=r,t._emitProgress("complete",t.angleData.length,t.angleData.length),t.trigger("load",t),e(!0)})).catch((function(t){r(t)}))):r("There is no ADOFAI settings.")}))}},{key:"on",value:function(t,e){this._events.has(t)||this._events.set(t,[]);var r=this.generateGUID();return this._events.get(t).push({guid:r,callback:e}),this.guidCallbacks.set(r,{eventName:t,callback:e}),r}},{key:"trigger",value:function(t,e){this._events.has(t)&&this._events.get(t).forEach((function(t){return(0,t.callback)(e)}))}},{key:"off",value:function(t){if(this.guidCallbacks.has(t)){var e=this.guidCallbacks.get(t).eventName;if(this.guidCallbacks.delete(t),this._events.has(e)){var r=this._events.get(e),n=r.findIndex((function(e){return e.guid===t}));-1!==n&&r.splice(n,1)}}}},{key:"_createArray",value:function(t,e){return r=this,n=void 0,i=void 0,o=vt().mark((function r(){var n,i,o,a,s,u,l,c,f,h,p,y,v,d,g,b,m,w;return vt().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(n=new Array(t),i=Math.max(100,Math.floor(t/100)),o=new Map,Array.isArray(e.actions)){a=gt(e.actions);try{for(a.s();!(s=a.n()).done;)u=s.value,o.has(u.floor)||o.set(u.floor,[]),o.get(u.floor).push(u)}catch(t){a.e(t)}finally{a.f()}}if(l=new Map,Array.isArray(e.decorations)){c=gt(e.decorations);try{for(c.s();!(f=c.n()).done;)h=f.value,l.has(h.floor)||l.set(h.floor,[]),l.get(h.floor).push(h)}catch(t){c.e(t)}finally{c.f()}}p=0;case 7:if(!(p<t)){r.next=24;break}y=o.get(p)||[],v=l.get(p)||[],d=gt(y);try{for(d.s();!(g=d.n()).done;)"Twirl"===g.value.eventType&&this._twirlCount++}catch(t){d.e(t)}finally{d.f()}if(b=this._parseAngle(e.angleData,p,this._twirlCount%2),m=y.map((function(t){return t.floor,kt(t,["floor"])})),w=v.map((function(t){return t.floor,kt(t,["floor"])})),n[p]={direction:e.angleData[p],_lastdir:e.angleData[p-1]||0,actions:m,angle:b,addDecorations:w,twirl:this._twirlCount,extraProps:{}},p%i!==0&&p!==t-1){r.next=21;break}if(this._emitProgress("relativeAngle",p+1,t,{tileIndex:p,angle:e.angleData[p],relativeAngle:b}),p%(10*i)!=0){r.next=21;break}return r.next=21,new Promise((function(t){return setTimeout(t,0)}));case 21:p++,r.next=7;break;case 24:return r.abrupt("return",n);case 25:case"end":return r.stop()}}),r,this)})),new(i||(i=Promise))((function(t,e){function a(t){try{u(o.next(t))}catch(t){e(t)}}function s(t){try{u(o.throw(t))}catch(t){e(t)}}function u(e){var r;e.done?t(e.value):(r=e.value,r instanceof i?r:new i((function(t){t(r)}))).then(a,s)}u((o=o.apply(r,n||[])).next())}));var r,n,i,o}},{key:"_changeAngle",value:function(){var t=this,e=0;return this.tiles.map((function(r){return e++,r.angle=t._parsechangedAngle(r.direction,e,r.twirl,r._lastdir),r}))}},{key:"_normalizeAngle",value:function(t){return(t%360+360)%360}},{key:"_parsechangedAngle",value:function(t,e,r,n){var i,o=0;if(0===e&&(this._angleDir=180),999===t){for(var a=1;e-a-1>=0&&999===(null===(i=this.tiles[e-a-1])||void 0===i?void 0:i.direction);)a++;var s=e-a-1>=0?this.tiles[e-a-1].direction:0;this._angleDir=this._normalizeAngle(s+180*(a-1)),isNaN(this._angleDir)&&(this._angleDir=0),o=0}else{var u=this._normalizeAngle(this._angleDir-t);0===(o=0===r?u:this._normalizeAngle(360-u))&&(o=360),this._angleDir=this._normalizeAngle(t+180)}return o}},{key:"_filterByFloor",value:function(t,e){if(!Array.isArray(t))return[];var r=t.filter((function(t){return t.floor===e}));return this._twirlCount+=r.filter((function(t){return"Twirl"===t.eventType})).length,r.map((function(t){return t.floor,kt(t,["floor"])}))}},{key:"_flattenAngleDatas",value:function(t){return t.map((function(t){return t.direction}))}},{key:"_flattenActionsWithFloor",value:function(t){return t.flatMap((function(t,e){return(Array.isArray(null==t?void 0:t.actions)?t.actions:[]).map((function(t){t.floor;var r=kt(t,["floor"]);return Object.assign({floor:e},r)}))}))}},{key:"_filterByFloorwithDeco",value:function(t,e){return Array.isArray(t)?t.filter((function(t){return t.floor===e})).map((function(t){return t.floor,kt(t,["floor"])})):[]}},{key:"_flattenDecorationsWithFloor",value:function(t){return t.flatMap((function(t,e){return(Array.isArray(null==t?void 0:t.addDecorations)?t.addDecorations:[]).map((function(t){t.floor;var r=kt(t,["floor"]);return Object.assign({floor:e},r)}))}))}},{key:"_parseAngle",value:function(t,e,r){var n=0;if(0===e&&(this._angleDir=180),999===t[e]){for(var i=1;e-i>=0&&999===t[e-i];)i++;var o=e-i>=0?t[e-i]:0;this._angleDir=this._normalizeAngle(o+180*(i-1)),isNaN(this._angleDir)&&(this._angleDir=0),n=0}else{var a=this._normalizeAngle(this._angleDir-t[e]);0===(n=0===r?a:this._normalizeAngle(360-a))&&(n=360),this._angleDir=this._normalizeAngle(t[e]+180)}return n}},{key:"filterActionsByEventType",value:function(t){return Object.entries(this.tiles).flatMap((function(t){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||bt(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t,2),r=e[0],n=e[1];return(Array.isArray(n.actions)?n.actions:[]).map((function(t){return{b:t,index:r}}))})).filter((function(e){return e.b.eventType===t})).map((function(t){var e=t.b,r=t.index;return{index:Number(r),action:e}}))}},{key:"getActionsByIndex",value:function(t,e){var r=this.filterActionsByEventType(t).filter((function(t){return t.index===e}));return{count:r.length,actions:r.map((function(t){return t.action}))}}},{key:"calculateTileCoordinates",value:function(){console.warn("calculateTileCoordinates is deprecated. Use calculateTilePosition instead.")}},{key:"calculateTilePosition",value:function(){var t,e=this.angleData,r=this.tiles.length,n=[],i=[0,0],o=new Map,a=gt(this.actions);try{for(a.s();!(t=a.n()).done;){var s=t.value;"PositionTrack"===s.eventType&&s.positionOffset&&!0!==s.editorOnly&&"Enabled"!==s.editorOnly&&o.set(s.floor,s)}}catch(t){a.e(t)}finally{a.f()}this._emitProgress("tilePosition",0,r);for(var u=new Array(r),l=0;l<r;l++)if(999===e[l]){for(var c=1;l-c>=0&&999===e[l-c];)c++;var f=l-c>=0?e[l-c]:0;u[l]=f+180*(c-1)}else u[l]=e[l];for(var h=Math.max(100,Math.floor(r/100)),p=0;p<=r;p++){var y=p===r,v=y?u[p-1]||0:u[p],d=0===p?0:u[p-1]||0,g=this.tiles[p],b=o.get(p);(null==b?void 0:b.positionOffset)&&(i[0]+=b.positionOffset[0],i[1]+=b.positionOffset[1]);var m=[i[0],i[1]];n.push(m),g&&(g.position=m,g.extraProps.angle1=v,g.extraProps.angle2=d-180,g.extraProps.cangle=y?u[p-1]+180:u[p]);var w=v*Math.PI/180;i[0]+=Math.cos(w),i[1]+=Math.sin(w),(p%h===0||y)&&this._emitProgress("tilePosition",p,r,{tileIndex:p,position:[m[0],m[1]],angle:v})}return this._emitProgress("tilePosition",r,r,{processed:n.flat()}),n}},{key:"floorOperation",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{type:"append",direction:0};switch(t.type){case"append":this.appendFloor(t);break;case"insert":"number"==typeof t.id&&this.tiles.splice(t.id,0,{direction:t.direction||0,angle:0,actions:[],addDecorations:[],_lastdir:this.tiles[t.id-1].direction,twirl:this.tiles[t.id-1].twirl});break;case"delete":"number"==typeof t.id&&this.tiles.splice(t.id,1)}this._changeAngle()}},{key:"appendFloor",value:function(t){this.tiles.push({direction:t.direction,angle:0,actions:[],addDecorations:[],_lastdir:this.tiles[this.tiles.length-1].direction,twirl:this.tiles[this.tiles.length-1].twirl,extraProps:{}}),this._changeAngle()}},{key:"clearDeco",value:function(){return this.tiles=st(this.tiles),!0}},{key:"clearEffect",value:function(t){this.clearEvent(n[t])}},{key:"clearEvent",value:function(t){t.type==et.include?this.tiles=lt(t.events,this.tiles):t.type==et.exclude&&(this.tiles=ut(t.events,this.tiles))}},{key:"export",value:function(t,e){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,o={angleData:this._flattenAngleDatas(this.tiles),settings:this.settings,actions:this._flattenActionsWithFloor(this.tiles),decorations:this._flattenDecorationsWithFloor(this.tiles)};return"object"===t?o:tt(o,e,r,n,i)}}],e&&wt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();return e})()));
|
|
2
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ADOFAI=e():t.ADOFAI=e()}(globalThis,()=>(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{Events:()=>o,Level:()=>St,Parsers:()=>r,Presets:()=>n,Structure:()=>i,Types:()=>a,pathData:()=>u});var r={};t.r(r),t.d(r,{ArrayBufferParser:()=>q,BufferParser:()=>j,StringParser:()=>I,default:()=>Z});var n={};t.r(n),t.d(n,{preset_inner_no_deco:()=>ut,preset_noeffect:()=>it,preset_noeffect_completely:()=>st,preset_noholds:()=>ot,preset_nomovecamera:()=>at});var i={};t.r(i),t.d(i,{default:()=>St});var o={};t.r(o);var a={};t.r(a),t.d(a,{isEventEnabled:()=>kt});var s={R:0,p:15,J:30,E:45,T:60,o:75,U:90,q:105,G:120,Q:135,H:150,W:165,L:180,x:195,N:210,Z:225,F:240,V:255,D:270,Y:285,B:300,C:315,M:330,A:345,5:555,6:666,7:777,8:888,"!":999};const u={pathDataTable:s,parseToangleData:function(t){return Array.from(t).map(function(t){return s[t]})}};function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function c(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,f(n.key),n)}}function f(t){var e=function(t){if("object"!=l(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=l(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==l(e)?e:e+""}const h=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return e=t,r=[{key:"parseError",value:function(t){return t}},{key:"parseAsObject",value:function(e,r){return(r||JSON).parse(t.parseAsText(e))}},{key:"parseAsText",value:function(t){return this.parseError(t)}}],null&&c(e.prototype,null),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();function p(t){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p(t)}function y(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,d(n.key),n)}}function v(t,e,r){return e&&y(t.prototype,e),r&&y(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function d(t){var e=function(t){if("object"!=p(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=p(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==p(e)?e:e+""}const b=v(function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)});function g(t){return g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},g(t)}function m(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function O(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,k(n.key),n)}}function S(t,e,r){return e&&O(t.prototype,e),r&&O(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function k(t){var e=function(t){if("object"!=g(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=g(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==g(e)?e:e+""}function w(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(w=function(){return!!t})()}function _(t){return _=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_(t)}function A(t,e){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},A(t,e)}var E=function(t){function e(){return m(this,e),t=this,n=arguments,r=_(r=e),function(t,e){if(e&&("object"==g(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,w()?Reflect.construct(r,n||[],_(t).constructor):r.apply(t,n));var t,r,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&A(t,e)}(e,t),S(e,[{key:"parse",value:function(t){var e,r;return e="string"==typeof t?(new TextEncoder).encode(t):(r=t).length>=3&&239===r[0]&&187===r[1]&&191===r[2]?r.subarray(3):r,new T(e).parseValue()}},{key:"stringify",value:function(t){return JSON.stringify(t)}}])}(b),T=function(){return S(function t(e){m(this,t),this.data=e,this.pos=0,this.decoder=new TextDecoder("utf-8"),this.length=e.length},[{key:"parseValue",value:function(){this.eatWhitespace();var t=this.peek();if(-1===t)return null;switch(t){case 123:return this.parseObject();case 91:return this.parseArray();case 34:return this.parseString();case 116:return this.parseKeyword(!0);case 102:return this.parseKeyword(!1);case 110:return this.parseKeyword(null);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.parseNumber();default:return this.pos++,null}}},{key:"parseObject",value:function(){var t={};for(this.pos++;;){if(this.eatWhitespace(),125===this.peek()){this.pos++;break}var e=this.parseString();if(this.eatWhitespace(),58!==this.peek())break;this.pos++,t[e]=this.parseValue(),this.eatWhitespace(),44===this.peek()&&this.pos++}return t}},{key:"parseArray",value:function(){var t=[];for(this.pos++;;){if(this.eatWhitespace(),93===this.peek()){this.pos++;break}t.push(this.parseValue()),this.eatWhitespace(),44===this.peek()&&this.pos++}return t}},{key:"parseString",value:function(){this.pos++;for(var t=this.pos,e=!1;this.pos<this.length;){var r=this.data[this.pos];if(34===r)break;92===r?(e=!0,this.pos+=2):this.pos++}var n=this.pos;this.pos++;var i=this.data.subarray(t,n);return e?this.processEscapes(i):this.decoder.decode(i)}},{key:"processEscapes",value:function(t){for(var e=this.decoder.decode(t),r="",n=0;n<e.length;n++)if("\\"===e[n]&&n+1<e.length){var i=e[++n];switch(i){case'"':case"\\":case"/":r+=i;break;case"b":r+="\b";break;case"f":r+="\f";break;case"n":r+="\n";break;case"r":r+="\r";break;case"t":r+="\t";break;case"u":r+=String.fromCharCode(parseInt(e.substr(n+1,4),16)),n+=4}}else r+=e[n];return r}},{key:"parseNumber",value:function(){for(var t=this.pos;this.pos<this.length;){var e=this.data[this.pos];if(!(e>=48&&e<=57||46===e||101===e||69===e||43===e||45===e))break;this.pos++}var r=this.decoder.decode(this.data.subarray(t,this.pos));return parseFloat(r)}},{key:"parseKeyword",value:function(t){var e=this.data[this.pos];return 116===e?this.pos+=4:102===e?this.pos+=5:110===e&&(this.pos+=4),t}},{key:"eatWhitespace",value:function(){for(;this.pos<this.length;){var t=this.data[this.pos];if(32!==t&&10!==t&&13!==t&&9!==t)break;this.pos++}}},{key:"peek",value:function(){return this.pos<this.length?this.data[this.pos]:-1}}])}();const j=E;function P(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function D(t){return D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},D(t)}function N(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function C(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,M(n.key),n)}}function x(t,e,r){return e&&C(t.prototype,e),r&&C(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function M(t){var e=function(t){if("object"!=D(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=D(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==D(e)?e:e+""}function R(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(R=function(){return!!t})()}function U(t){return U=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},U(t)}function K(t,e){return K=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},K(t,e)}var B=function(t){function e(){return N(this,e),t=this,n=arguments,r=U(r=e),function(t,e){if(e&&("object"==D(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,R()?Reflect.construct(r,n||[],U(t).constructor):r.apply(t,n));var t,r,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&K(t,e)}(e,t),x(e,[{key:"parse",value:function(t,r){if(null==t)return null;var n=new F(t).parseValue();return"function"==typeof r?e._applyReviver("",n,r):n}},{key:"stringify",value:function(t,e,r){return new L(e,r).serialize(t)}}],[{key:"_applyReviver",value:function(t,r,n){if(r&&"object"===D(r))if(Array.isArray(r))for(var i=0;i<r.length;i++)r[i]=e._applyReviver(i.toString(),r[i],n);else for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(r[o]=e._applyReviver(o,r[o],n));return n(t,r)}}])}(b),F=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;N(this,t),this.json=e,this.position=0,this.endSection=r,65279===this.peek()&&this.read()}return x(t,[{key:"parseValue",value:function(){return this.parseByToken(this.nextToken)}},{key:"parseObject",value:function(){var e={};for(this.read();;){var r=void 0;do{if((r=this.nextToken)===t.TOKEN.NONE)return null;if(r===t.TOKEN.CURLY_CLOSE)return e}while(r===t.TOKEN.COMMA);var n=this.parseString();if(null===n)return null;if(this.nextToken!==t.TOKEN.COLON)return null;if(null!=this.endSection&&n===this.endSection)return e;this.read(),e[n]=this.parseValue()}}},{key:"parseArray",value:function(){var e=[];this.read();for(var r=!0;r;){var n=this.nextToken;switch(n){case t.TOKEN.NONE:return null;case t.TOKEN.SQUARED_CLOSE:r=!1;break;case t.TOKEN.COMMA:break;default:var i=this.parseByToken(n);e.push(i)}}return e}},{key:"parseByToken",value:function(e){switch(e){case t.TOKEN.CURLY_OPEN:return this.parseObject();case t.TOKEN.SQUARED_OPEN:return this.parseArray();case t.TOKEN.STRING:return this.parseString();case t.TOKEN.NUMBER:return this.parseNumber();case t.TOKEN.TRUE:return!0;case t.TOKEN.FALSE:return!1;case t.TOKEN.NULL:default:return null}}},{key:"parseString",value:function(){var t="";this.read();for(var e=!0;e&&-1!==this.peek();){var r=this.nextChar;switch(r){case'"':e=!1;break;case"\\":if(-1===this.peek()){e=!1;break}var n=this.nextChar;switch(n){case'"':case"/":case"\\":t+=n;break;case"b":t+="\b";break;case"f":t+="\f";break;case"n":t+="\n";break;case"r":t+="\r";break;case"t":t+="\t";break;case"u":for(var i="",o=0;o<4;o++)i+=this.nextChar;t+=String.fromCharCode(Number.parseInt(i,16))}break;default:t+=r}}return t}},{key:"parseNumber",value:function(){var t=this.nextWord;return-1===t.indexOf(".")?Number.parseInt(t,10)||0:Number.parseFloat(t)||0}},{key:"eatWhitespace",value:function(){for(;-1!==t.WHITE_SPACE.indexOf(this.peekChar)&&(this.read(),-1!==this.peek()););}},{key:"peek",value:function(){return this.position>=this.json.length?-1:this.json.charCodeAt(this.position)}},{key:"read",value:function(){return this.position>=this.json.length?-1:this.json.charCodeAt(this.position++)}},{key:"peekChar",get:function(){var t=this.peek();return-1===t?"\0":String.fromCharCode(t)}},{key:"nextChar",get:function(){var t=this.read();return-1===t?"\0":String.fromCharCode(t)}},{key:"nextWord",get:function(){for(var e="";-1===t.WORD_BREAK.indexOf(this.peekChar)&&(e+=this.nextChar,-1!==this.peek()););return e}},{key:"nextToken",get:function(){if(this.eatWhitespace(),-1===this.peek())return t.TOKEN.NONE;switch(this.peekChar){case'"':return t.TOKEN.STRING;case",":return this.read(),t.TOKEN.COMMA;case"-":case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return t.TOKEN.NUMBER;case":":return t.TOKEN.COLON;case"[":return t.TOKEN.SQUARED_OPEN;case"]":return this.read(),t.TOKEN.SQUARED_CLOSE;case"{":return t.TOKEN.CURLY_OPEN;case"}":return this.read(),t.TOKEN.CURLY_CLOSE;default:switch(this.nextWord){case"false":return t.TOKEN.FALSE;case"true":return t.TOKEN.TRUE;case"null":return t.TOKEN.NULL;default:return t.TOKEN.NONE}}}}])}();F.WHITE_SPACE=" \t\n\r\ufeff",F.WORD_BREAK=' \t\n\r{}[],:"',F.TOKEN={NONE:0,CURLY_OPEN:1,CURLY_CLOSE:2,SQUARED_OPEN:3,SQUARED_CLOSE:4,COLON:5,COMMA:6,STRING:7,NUMBER:8,TRUE:9,FALSE:10,NULL:11};var L=function(){return x(function t(e,r){N(this,t),this.result="",this.indent=0,this.indentStr="",this.replacer=e||null,this.space=r||null,"number"==typeof r?this.indentStr=" ".repeat(Math.min(10,Math.max(0,r))):"string"==typeof r&&(this.indentStr=r.slice(0,10))},[{key:"serialize",value:function(t){return this.result="",this.serializeValue(t,""),this.result}},{key:"serializeValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";"function"==typeof this.replacer&&(t=this.replacer(e,t)),null==t?this.result+="null":"string"==typeof t?this.serializeString(t):"boolean"==typeof t?this.result+=t.toString():Array.isArray(t)?this.serializeArray(t):"object"===D(t)?this.serializeObject(t):this.serializeOther(t)}},{key:"serializeObject",value:function(t){var e=!0;for(var r in this.result+="{",this.indentStr&&(this.result+="\n",this.indent++),t)if(Object.prototype.hasOwnProperty.call(t,r)){if(Array.isArray(this.replacer)&&!this.replacer.includes(r))continue;e||(this.result+=",",this.indentStr&&(this.result+="\n")),this.indentStr&&(this.result+=this.indentStr.repeat(this.indent)),this.serializeString(r.toString()),this.result+=":",this.indentStr&&(this.result+=" "),this.serializeValue(t[r],r),e=!1}this.indentStr&&(this.result+="\n",this.indent--,this.result+=this.indentStr.repeat(this.indent)),this.result+="}"}},{key:"serializeArray",value:function(t){this.result+="[",this.indentStr&&t.length>0&&(this.result+="\n",this.indent++);for(var e=!0,r=0;r<t.length;r++)e||(this.result+=",",this.indentStr&&(this.result+="\n")),this.indentStr&&(this.result+=this.indentStr.repeat(this.indent)),this.serializeValue(t[r],r.toString()),e=!1;this.indentStr&&t.length>0&&(this.result+="\n",this.indent--,this.result+=this.indentStr.repeat(this.indent)),this.result+="]"}},{key:"serializeString",value:function(t){this.result+='"';var e,r=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return P(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?P(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(t);try{for(r.s();!(e=r.n()).done;){var n=e.value;switch(n){case"\b":this.result+="\\b";break;case"\t":this.result+="\\t";break;case"\n":this.result+="\\n";break;case"\f":this.result+="\\f";break;case"\r":this.result+="\\r";break;case'"':this.result+='\\"';break;case"\\":this.result+="\\\\";break;default:var i=n.charCodeAt(0);this.result+=i>=32&&i<=126?n:"\\u"+i.toString(16).padStart(4,"0")}}}catch(t){r.e(t)}finally{r.f()}this.result+='"'}},{key:"serializeOther",value:function(t){"number"==typeof t?isFinite(t)?this.result+=t.toString():this.result+="null":this.serializeString(t.toString())}}])}();const I=B;function z(t){return z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},z(t)}function W(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,V(n.key),n)}}function V(t){var e=function(t){if("object"!=z(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=z(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==z(e)?e:e+""}function G(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(G=function(){return!!t})()}function H(t){return H=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},H(t)}function J(t,e){return J=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},J(t,e)}var Q=new Uint8Array([239,187,191]),Y=new Uint8Array([44]);function $(t){var e=new Uint8Array(t);return e.length>=3&&e[0]===Q[0]&&e[1]===Q[1]&&e[2]===Q[2]?t.slice(3):t}const q=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=H(e),function(t,e){if(e&&("object"==z(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,G()?Reflect.construct(e,r||[],H(t).constructor):e.apply(t,r))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&J(t,e)}(e,t),r=e,(n=[{key:"parse",value:function(t){return"string"==typeof t?I.prototype.parse.call(I.prototype,t):I.prototype.parse.call(I.prototype,(e=function(t){for(var e=new Uint8Array(t),r=[],n="other",i=0,o=0;o<e.length;o++){var a=e[o];if("escape"==n)n="string";else switch(a){case 34:switch(n){case"string":n="other";break;case"comma":r.push(Y);default:n="string"}break;case 92:"string"===n&&(n="escape");break;case 44:r.push(e.subarray(i,o)),i=o+1,"other"===n&&(n="comma");break;case 93:case 125:"comma"===n&&(n="other");break;case 9:case 10:case 11:case 12:case 13:case 32:break;default:"comma"===n&&(r.push(Y),n="other")}}r.push(e.subarray(i));for(var s=0,u=0,l=r;u<l.length;u++)s+=l[u].length;for(var c=new Uint8Array(s),f=0,h=0,p=r;h<p.length;h++){var y=p[h];c.set(y,f),f+=y.length}return c.buffer}($(t)),r=$(e),new TextDecoder("utf-8").decode(r)));var e,r}},{key:"stringify",value:function(t){return JSON.stringify(t)}}])&&W(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(b),Z=h;function X(t){return X="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},X(t)}function tt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"\t",i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;if("object"!==X(t)||null===t)return JSON.stringify(t);if(Array.isArray(t)){if(t.every(function(t){return"object"!==X(t)||null===t}))return"["+t.map(function(t){return tt(t,0,!1,n,i)}).join(",")+"]";var o=n.repeat(e),a=n.repeat(e+i);return"[\n"+t.map(function(t){return a+et(t,n)}).join(",\n")+"\n"+o+"]"}var s=n.repeat(e),u=Object.keys(t);if(r){var l=n.repeat(i);return"{\n"+u.map(function(e){return l+JSON.stringify(e)+": "+tt(t[e],i,!1,n,i)}).join(",\n")+"\n}"}return"{\n"+u.map(function(r){return s+n.repeat(i)+JSON.stringify(r)+": "+tt(t[r],e+i,!1,n,i)}).join(",\n")+"\n"+s+"}"}function et(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"\t";return"object"!==X(t)||null===t?tt(t,0,!1,e):Array.isArray(t)?"["+t.map(function(t){return et(t,e)}).join(",")+"]":"{"+Object.keys(t).map(function(r){return JSON.stringify(r)+": "+et(t[r],e)}).join(", ")+"}"}const rt=tt;var nt,it={type:"exclude",events:["Flash","SetFilter","SetFilterAdvanced","HallOfMirrors","Bloom","ScalePlanets","ScreenTile","ScreenScroll","ShakeScreen"]},ot={type:"exclude",events:["Hold"]},at={type:"exclude",events:["MoveCamera"]},st={type:"exclude",events:["AddDecoration","AddText","AddObject","Checkpoint","SetHitsound","PlaySound","SetPlanetRotation","ScalePlanets","ColorTrack","AnimateTrack","RecolorTrack","MoveTrack","PositionTrack","MoveDecorations","SetText","SetObject","SetDefaultText","CustomBackground","Flash","MoveCamera","SetFilter","HallOfMirrors","ShakeScreen","Bloom","ScreenTile","ScreenScroll","SetFrameRate","RepeatEvents","SetConditionalEvents","EditorComment","Bookmark","Hold","SetHoldSound","Hide","ScaleMargin","ScaleRadius"]},ut={type:"special",events:["MoveDecorations","SetText","SetObject","SetDefaultText"]};!function(t){t.include="include",t.exclude="exclude",t.special="special"}(nt||(nt={}));const lt=function(t){if(!Array.isArray(t))throw new Error("Arguments are not supported.");return t.map(function(t){var e=Object.assign({},t);return e.hasOwnProperty("addDecorations")&&(e.addDecorations=[]),Array.isArray(e.actions)&&(e.actions=e.actions.filter(function(t){return!ut.events.includes(t.eventType)})),e})},ct=function(t,e){return e.map(function(e){var r=Object.assign({},e);return Array.isArray(e.actions)&&(r.actions=e.actions.filter(function(e){return!t.includes(e.eventType)})),r})},ft=function(t,e){return e.map(function(e){var r=Object.assign({},e);return Array.isArray(e.actions)&&(r.actions=e.actions.filter(function(e){return t.includes(e.eventType)})),r})};function ht(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function o(r,n,i,o){var u=n&&n.prototype instanceof s?n:s,l=Object.create(u.prototype);return pt(l,"_invoke",function(r,n,i){var o,s,u,l=0,c=i||[],f=!1,h={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,r){return o=e,s=0,u=t,h.n=r,a}};function p(r,n){for(s=r,u=n,e=0;!f&&l&&!i&&e<c.length;e++){var i,o=c[e],p=h.p,y=o[2];r>3?(i=y===n)&&(u=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=t):o[0]<=p&&((i=r<2&&p<o[1])?(s=0,h.v=n,h.n=o[1]):p<y&&(i=r<3||o[0]>n||n>y)&&(o[4]=r,o[5]=n,h.n=y,s=0))}if(i||r>1)return a;throw f=!0,n}return function(i,c,y){if(l>1)throw TypeError("Generator is already running");for(f&&1===c&&p(c,y),s=c,u=y;(e=s<2?t:u)||!f;){o||(s?s<3?(s>1&&(h.n=-1),p(s,u)):h.n=u:h.v=u);try{if(l=2,o){if(s||(i="next"),e=o[i]){if(!(e=e.call(o,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,s<2&&(s=0)}else 1===s&&(e=o.return)&&e.call(o),s<2&&(u=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=t}else if((e=(f=h.n<0)?u:r.call(n,h))!==a)break}catch(e){o=t,s=1,u=e}finally{l=1}}return{value:e,done:f}}}(r,i,o),!0),l}var a={};function s(){}function u(){}function l(){}e=Object.getPrototypeOf;var c=[][n]?e(e([][n]())):(pt(e={},n,function(){return this}),e),f=l.prototype=s.prototype=Object.create(c);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,pt(t,i,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=l,pt(f,"constructor",l),pt(l,"constructor",u),u.displayName="GeneratorFunction",pt(l,i,"GeneratorFunction"),pt(f),pt(f,i,"Generator"),pt(f,n,function(){return this}),pt(f,"toString",function(){return"[object Generator]"}),(ht=function(){return{w:o,m:h}})()}function pt(t,e,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(t){i=0}pt=function(t,e,r,n){function o(e,r){pt(t,e,function(t){return this._invoke(e,r,t)})}e?i?i(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(o("next",0),o("throw",1),o("return",2))},pt(t,e,r,n)}function yt(t){return yt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yt(t)}function vt(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=dt(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function dt(t,e){if(t){if("string"==typeof t)return bt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?bt(t,e):void 0}}function bt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function gt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,mt(n.key),n)}}function mt(t){var e=function(t){if("object"!=yt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=yt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==yt(e)?e:e+""}var Ot=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]])}return r},St=function(){return t=function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._precomputedEvents=null,this._precomputeMode=!1,this._lightweightData=null,this._events=new Map,this.guidCallbacks=new Map,this._options=e,this._provider=r},e=[{key:"generateGUID",value:function(){return"event_".concat(function(){var t,e=new Uint8Array(16),r=null!==(t=globalThis.crypto)&&void 0!==t?t:null===globalThis||void 0===globalThis?void 0:globalThis.msCrypto;if(null==r?void 0:r.getRandomValues)r.getRandomValues(e);else for(var n=0;n<16;n++)e[n]=Math.floor(256*Math.random());e[6]=15&e[6]|64,e[8]=63&e[8]|128;var i=function(t){return(t>>>4).toString(16)+(15&t).toString(16)};return i(e[0])+i(e[1])+i(e[2])+i(e[3])+"-"+i(e[4])+i(e[5])+"-"+i(e[6])+i(e[7])+"-"+i(e[8])+i(e[9])+"-"+i(e[10])+i(e[11])+i(e[12])+i(e[13])+i(e[14])+i(e[15])}())}},{key:"_emitProgress",value:function(t,e,r,n){var i={stage:t,current:e,total:r,percent:r>0?Math.round(e/r*100):0,data:n};this._precomputeMode&&this._precomputedEvents?this._precomputedEvents[t].push(i):(this.trigger("parse:progress",i),this.trigger("parse:".concat(t),i))}},{key:"enablePrecomputeMode",value:function(){this._precomputeMode=!0,this._precomputedEvents={start:[],pathData:[],angleData:[],relativeAngle:[],tilePosition:[],complete:[]}}},{key:"disablePrecomputeMode",value:function(){this._precomputeMode=!1}},{key:"getPrecomputedEvents",value:function(){return this._precomputedEvents}},{key:"clearPrecomputedEvents",value:function(){this._precomputedEvents=null}},{key:"getEventsAtPercent",value:function(t,e){if(!this._precomputedEvents)return[];for(var r=[],n=0,i=e?[e]:["start","pathData","angleData","relativeAngle","tilePosition","complete"];n<i.length;n++){var o,a=i[n],s=vt(this._precomputedEvents[a]);try{for(s.s();!(o=s.n()).done;){var u=o.value;if(u.percent<=t&&(0===r.length||r[r.length-1].percent<=u.percent)){var l=r[r.length-1];l&&l.stage===u.stage&&l.current===u.current||r.push(u)}}}catch(t){s.e(t)}finally{s.f()}}return r}},{key:"getPrecomputedEventCount",value:function(t){return this._precomputedEvents?t?this._precomputedEvents[t].length:Object.values(this._precomputedEvents).reduce(function(t,e){return t+e.length},0):0}},{key:"getLightweightData",value:function(){return this._lightweightData}},{key:"precomputeLightweight",value:function(){for(var t,e,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this.tiles.length,i=new Array(n),o=r?[]:new Array(n),a=new Array(n),s=0;s<n;s++){var u=this.tiles[s];i[s]=null!==(t=u.angle)&&void 0!==t?t:0,a[s]=(null!==(e=u.twirl)&&void 0!==e?e:0)%2==1}if(!r){var l,c=[0,0],f=this.angleData,h=new Map,p=vt(this.actions);try{for(p.s();!(l=p.n()).done;){var y=l.value;"PositionTrack"===y.eventType&&y.positionOffset&&!0!==y.editorOnly&&"Enabled"!==y.editorOnly&&h.set(y.floor,y)}}catch(t){p.e(t)}finally{p.f()}for(var v=0;v<n;v++){var d=h.get(v);(null==d?void 0:d.positionOffset)&&(c[0]+=d.positionOffset[0],c[1]+=d.positionOffset[1]),o[v]=[c[0],c[1]];var b=void 0;if(999===f[v]){for(var g=1;v-g>=0&&999===f[v-g];)g++;b=(v-g>=0?f[v-g]:0)+180*(g-1)}else b=f[v];var m=b*Math.PI/180;c[0]+=Math.cos(m),c[1]+=Math.sin(m)}}return this._lightweightData={totalTiles:n,angles:i,positions:o,twirlFlags:a,computed:!0},this._lightweightData}},{key:"getLightweightDataRange",value:function(t,e){if(!this._lightweightData)return null;var r=Math.min(t+e,this._lightweightData.totalTiles);return{angles:this._lightweightData.angles.slice(t,r),positions:this._lightweightData.positions.slice(t,r),twirlFlags:this._lightweightData.twirlFlags.slice(t,r)}}},{key:"clearLightweightData",value:function(){this._lightweightData=null}},{key:"getTileRenderData",value:function(t){var e,r;if(t<0||t>=this.tiles.length)return null;var n=this.tiles[t];return{angle:null!==(e=n.angle)&&void 0!==e?e:0,position:n.position?[n.position[0],n.position[1]]:null,hasTwirl:(null!==(r=n.twirl)&&void 0!==r?r:0)%2==1}}},{key:"load",value:function(){var t=this;return new Promise(function(e,r){var n,i,o=t._options;t._emitProgress("start",0,0);var a=o instanceof ArrayBuffer,s=o instanceof Uint8Array,l="undefined"!=typeof Buffer&&Buffer.isBuffer(o);if("string"==typeof o||a||s||l)try{var c=a?new Uint8Array(o):o;i=null===(n=t._provider)||void 0===n?void 0:n.parse(c)}catch(t){return void r("解析失败: "+t)}else{if("object"!==yt(o)||null===o)return void r("Options must be String, Buffer, ArrayBuffer or Object");i=Object.assign({},o)}var f=i&&"object"===yt(i)&&null!==i&&void 0!==i.pathData,h=i&&"object"===yt(i)&&null!==i&&void 0!==i.angleData;if(f){var p=i.pathData;t._emitProgress("pathData",0,p.length,{source:p}),t.angleData=u.parseToangleData(p),t._emitProgress("pathData",p.length,p.length,{source:p,processed:t.angleData})}else{if(!h)return void r("There is not any angle datas.");t.angleData=i.angleData,t._emitProgress("angleData",t.angleData.length,t.angleData.length,{processed:t.angleData})}i&&"object"===yt(i)&&null!==i&&Array.isArray(i.actions)?t.actions=i.actions:t.actions=[],i&&"object"===yt(i)&&null!==i&&void 0!==i.settings?(t.settings=i.settings,i&&"object"===yt(i)&&null!==i&&Array.isArray(i.decorations)?t.__decorations=i.decorations:t.__decorations=[],t.tiles=[],t._angleDir=-180,t._twirlCount=0,t._createArray(t.angleData.length,{angleData:t.angleData,actions:t.actions,decorations:t.__decorations}).then(function(r){t.tiles=r,t._emitProgress("complete",t.angleData.length,t.angleData.length),t.trigger("load",t),e(!0)}).catch(function(t){r(t)})):r("There is no ADOFAI settings.")})}},{key:"on",value:function(t,e){this._events.has(t)||this._events.set(t,[]);var r=this.generateGUID();return this._events.get(t).push({guid:r,callback:e}),this.guidCallbacks.set(r,{eventName:t,callback:e}),r}},{key:"trigger",value:function(t,e){this._events.has(t)&&this._events.get(t).forEach(function(t){return(0,t.callback)(e)})}},{key:"off",value:function(t){if(this.guidCallbacks.has(t)){var e=this.guidCallbacks.get(t).eventName;if(this.guidCallbacks.delete(t),this._events.has(e)){var r=this._events.get(e),n=r.findIndex(function(e){return e.guid===t});-1!==n&&r.splice(n,1)}}}},{key:"_createArray",value:function(t,e){return r=this,n=void 0,i=void 0,o=ht().m(function r(){var n,i,o,a,s,u,l,c,f,h,p,y,v,d,b,g,m,O;return ht().w(function(r){for(;;)switch(r.n){case 0:if(n=new Array(t),i=Math.max(100,Math.floor(t/100)),o=new Map,Array.isArray(e.actions)){a=vt(e.actions);try{for(a.s();!(s=a.n()).done;)u=s.value,o.has(u.floor)||o.set(u.floor,[]),o.get(u.floor).push(u)}catch(t){a.e(t)}finally{a.f()}}if(l=new Map,Array.isArray(e.decorations)){c=vt(e.decorations);try{for(c.s();!(f=c.n()).done;)h=f.value,l.has(h.floor)||l.set(h.floor,[]),l.get(h.floor).push(h)}catch(t){c.e(t)}finally{c.f()}}p=0;case 1:if(!(p<t)){r.n=3;break}y=o.get(p)||[],v=l.get(p)||[],d=vt(y);try{for(d.s();!(b=d.n()).done;)"Twirl"===b.value.eventType&&this._twirlCount++}catch(t){d.e(t)}finally{d.f()}if(g=this._parseAngle(e.angleData,p,this._twirlCount%2),m=y.map(function(t){return t.floor,Ot(t,["floor"])}),O=v.map(function(t){return t.floor,Ot(t,["floor"])}),n[p]={direction:e.angleData[p],_lastdir:e.angleData[p-1]||0,actions:m,angle:g,addDecorations:O,twirl:this._twirlCount,extraProps:{}},p%i!==0&&p!==t-1){r.n=2;break}if(this._emitProgress("relativeAngle",p+1,t,{tileIndex:p,angle:e.angleData[p],relativeAngle:g}),p%(10*i)!=0){r.n=2;break}return r.n=2,new Promise(function(t){return setTimeout(t,0)});case 2:p++,r.n=1;break;case 3:return r.a(2,n)}},r,this)}),new(i||(i=Promise))(function(t,e){function a(t){try{u(o.next(t))}catch(t){e(t)}}function s(t){try{u(o.throw(t))}catch(t){e(t)}}function u(e){var r;e.done?t(e.value):(r=e.value,r instanceof i?r:new i(function(t){t(r)})).then(a,s)}u((o=o.apply(r,n||[])).next())});var r,n,i,o}},{key:"_changeAngle",value:function(){var t=this,e=0;return this.tiles.map(function(r){return e++,r.angle=t._parsechangedAngle(r.direction,e,r.twirl,r._lastdir),r})}},{key:"_normalizeAngle",value:function(t){return(t%360+360)%360}},{key:"_parsechangedAngle",value:function(t,e,r,n){var i,o=0;if(0===e&&(this._angleDir=180),999===t){for(var a=1;e-a-1>=0&&999===(null===(i=this.tiles[e-a-1])||void 0===i?void 0:i.direction);)a++;var s=e-a-1>=0?this.tiles[e-a-1].direction:0;this._angleDir=this._normalizeAngle(s+180*(a-1)),isNaN(this._angleDir)&&(this._angleDir=0),o=0}else{var u=this._normalizeAngle(this._angleDir-t);0===(o=0===r?u:this._normalizeAngle(360-u))&&(o=360),this._angleDir=this._normalizeAngle(t+180)}return o}},{key:"_filterByFloor",value:function(t,e){if(!Array.isArray(t))return[];var r=t.filter(function(t){return t.floor===e});return this._twirlCount+=r.filter(function(t){return"Twirl"===t.eventType}).length,r.map(function(t){return t.floor,Ot(t,["floor"])})}},{key:"_flattenAngleDatas",value:function(t){return t.map(function(t){return t.direction})}},{key:"_flattenActionsWithFloor",value:function(t){return t.flatMap(function(t,e){return(Array.isArray(null==t?void 0:t.actions)?t.actions:[]).map(function(t){t.floor;var r=Ot(t,["floor"]);return Object.assign({floor:e},r)})})}},{key:"_filterByFloorwithDeco",value:function(t,e){return Array.isArray(t)?t.filter(function(t){return t.floor===e}).map(function(t){return t.floor,Ot(t,["floor"])}):[]}},{key:"_flattenDecorationsWithFloor",value:function(t){return t.flatMap(function(t,e){return(Array.isArray(null==t?void 0:t.addDecorations)?t.addDecorations:[]).map(function(t){t.floor;var r=Ot(t,["floor"]);return Object.assign({floor:e},r)})})}},{key:"_parseAngle",value:function(t,e,r){var n=0;if(0===e&&(this._angleDir=180),999===t[e]){for(var i=1;e-i>=0&&999===t[e-i];)i++;var o=e-i>=0?t[e-i]:0;this._angleDir=this._normalizeAngle(o+180*(i-1)),isNaN(this._angleDir)&&(this._angleDir=0),n=0}else{var a=this._normalizeAngle(this._angleDir-t[e]);0===(n=0===r?a:this._normalizeAngle(360-a))&&(n=360),this._angleDir=this._normalizeAngle(t[e]+180)}return n}},{key:"filterActionsByEventType",value:function(t){return Object.entries(this.tiles).flatMap(function(t){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||dt(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t,2),r=e[0],n=e[1];return(Array.isArray(n.actions)?n.actions:[]).map(function(t){return{b:t,index:r}})}).filter(function(e){return e.b.eventType===t}).map(function(t){var e=t.b,r=t.index;return{index:Number(r),action:e}})}},{key:"getActionsByIndex",value:function(t,e){var r=this.filterActionsByEventType(t).filter(function(t){return t.index===e});return{count:r.length,actions:r.map(function(t){return t.action})}}},{key:"calculateTileCoordinates",value:function(){console.warn("calculateTileCoordinates is deprecated. Use calculateTilePosition instead.")}},{key:"calculateTilePosition",value:function(){var t,e=this.angleData,r=this.tiles.length,n=[],i=[0,0],o=new Map,a=vt(this.actions);try{for(a.s();!(t=a.n()).done;){var s=t.value;"PositionTrack"===s.eventType&&s.positionOffset&&!0!==s.editorOnly&&"Enabled"!==s.editorOnly&&o.set(s.floor,s)}}catch(t){a.e(t)}finally{a.f()}this._emitProgress("tilePosition",0,r);for(var u=new Array(r),l=0;l<r;l++)if(999===e[l]){for(var c=1;l-c>=0&&999===e[l-c];)c++;var f=l-c>=0?e[l-c]:0;u[l]=f+180*(c-1)}else u[l]=e[l];for(var h=Math.max(100,Math.floor(r/100)),p=0;p<=r;p++){var y=p===r,v=y?u[p-1]||0:u[p],d=0===p?0:u[p-1]||0,b=this.tiles[p],g=o.get(p);(null==g?void 0:g.positionOffset)&&(i[0]+=g.positionOffset[0],i[1]+=g.positionOffset[1]);var m=[i[0],i[1]];n.push(m),b&&(b.position=m,b.extraProps.angle1=v,b.extraProps.angle2=d-180,b.extraProps.cangle=y?u[p-1]+180:u[p]);var O=v*Math.PI/180;i[0]+=Math.cos(O),i[1]+=Math.sin(O),(p%h===0||y)&&this._emitProgress("tilePosition",p,r,{tileIndex:p,position:[m[0],m[1]],angle:v})}return this._emitProgress("tilePosition",r,r,{processed:n.flat()}),n}},{key:"floorOperation",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{type:"append",direction:0};switch(t.type){case"append":this.appendFloor(t);break;case"insert":"number"==typeof t.id&&this.tiles.splice(t.id,0,{direction:t.direction||0,angle:0,actions:[],addDecorations:[],_lastdir:this.tiles[t.id-1].direction,twirl:this.tiles[t.id-1].twirl});break;case"delete":"number"==typeof t.id&&this.tiles.splice(t.id,1)}this._changeAngle()}},{key:"appendFloor",value:function(t){this.tiles.push({direction:t.direction,angle:0,actions:[],addDecorations:[],_lastdir:this.tiles[this.tiles.length-1].direction,twirl:this.tiles[this.tiles.length-1].twirl,extraProps:{}}),this._changeAngle()}},{key:"clearDeco",value:function(){return this.tiles=lt(this.tiles),!0}},{key:"clearEffect",value:function(t){this.clearEvent(n[t])}},{key:"clearEvent",value:function(t){t.type==nt.include?this.tiles=ft(t.events,this.tiles):t.type==nt.exclude&&(this.tiles=ct(t.events,this.tiles))}},{key:"export",value:function(t,e){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,o={angleData:this._flattenAngleDatas(this.tiles),settings:this.settings,actions:this._flattenActionsWithFloor(this.tiles),decorations:this._flattenDecorationsWithFloor(this.tiles)};return"object"===t?o:rt(o,e,r,n,i)}}],e&>(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function kt(t,e){return void 0===t?e:"boolean"==typeof t?t:"Enabled"===t||"true"===t}return e})());
|