@esotericsoftware/spine-core 4.0.15 → 4.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Animation.d.ts +363 -363
- package/dist/Animation.js +1969 -1950
- package/dist/AnimationState.d.ts +396 -396
- package/dist/AnimationState.js +1083 -959
- package/dist/AnimationStateData.d.ts +51 -51
- package/dist/AnimationStateData.js +72 -70
- package/dist/AssetManagerBase.d.ts +74 -72
- package/dist/AssetManagerBase.js +304 -303
- package/dist/AtlasAttachmentLoader.d.ts +51 -51
- package/dist/AtlasAttachmentLoader.js +75 -74
- package/dist/Bone.d.ts +138 -138
- package/dist/Bone.js +340 -334
- package/dist/BoneData.d.ts +72 -72
- package/dist/BoneData.js +82 -74
- package/dist/ConstraintData.d.ts +35 -35
- package/dist/ConstraintData.js +36 -36
- package/dist/Event.d.ts +44 -44
- package/dist/Event.js +49 -42
- package/dist/EventData.d.ts +41 -41
- package/dist/EventData.js +44 -37
- package/dist/IkConstraint.d.ts +64 -64
- package/dist/IkConstraint.js +291 -285
- package/dist/IkConstraintData.d.ts +54 -54
- package/dist/IkConstraintData.js +56 -54
- package/dist/PathConstraint.d.ts +71 -71
- package/dist/PathConstraint.js +475 -469
- package/dist/PathConstraintData.d.ts +80 -80
- package/dist/PathConstraintData.js +84 -70
- package/dist/Skeleton.d.ts +158 -158
- package/dist/Skeleton.js +589 -571
- package/dist/SkeletonBinary.d.ts +67 -67
- package/dist/SkeletonBinary.js +1095 -1094
- package/dist/SkeletonBounds.d.ts +77 -77
- package/dist/SkeletonBounds.js +218 -218
- package/dist/SkeletonClipping.d.ts +50 -50
- package/dist/SkeletonClipping.js +323 -323
- package/dist/SkeletonData.d.ts +114 -114
- package/dist/SkeletonData.js +190 -167
- package/dist/SkeletonJson.d.ts +51 -51
- package/dist/SkeletonJson.js +917 -916
- package/dist/Skin.d.ts +71 -71
- package/dist/Skin.js +203 -201
- package/dist/Slot.d.ts +72 -72
- package/dist/Slot.js +107 -94
- package/dist/SlotData.d.ts +57 -57
- package/dist/SlotData.js +68 -55
- package/dist/Texture.d.ts +69 -69
- package/dist/Texture.js +72 -72
- package/dist/TextureAtlas.d.ts +65 -65
- package/dist/TextureAtlas.js +267 -246
- package/dist/TransformConstraint.d.ts +60 -60
- package/dist/TransformConstraint.js +246 -240
- package/dist/TransformConstraintData.d.ts +60 -60
- package/dist/TransformConstraintData.js +62 -60
- package/dist/Triangulator.d.ts +43 -43
- package/dist/Triangulator.js +243 -243
- package/dist/Updatable.d.ts +37 -37
- package/dist/Updatable.js +29 -29
- package/dist/Utils.d.ts +168 -168
- package/dist/Utils.js +403 -403
- package/dist/VertexEffect.d.ts +35 -35
- package/dist/VertexEffect.js +29 -29
- package/dist/attachments/Attachment.d.ts +71 -71
- package/dist/attachments/Attachment.js +148 -140
- package/dist/attachments/AttachmentLoader.d.ts +53 -53
- package/dist/attachments/AttachmentLoader.js +29 -29
- package/dist/attachments/BoundingBoxAttachment.d.ts +40 -40
- package/dist/attachments/BoundingBoxAttachment.js +47 -47
- package/dist/attachments/ClippingAttachment.d.ts +42 -42
- package/dist/attachments/ClippingAttachment.js +51 -48
- package/dist/attachments/MeshAttachment.d.ts +74 -74
- package/dist/attachments/MeshAttachment.js +181 -160
- package/dist/attachments/PathAttachment.d.ts +47 -47
- package/dist/attachments/PathAttachment.js +59 -57
- package/dist/attachments/PointAttachment.d.ts +48 -48
- package/dist/attachments/PointAttachment.js +66 -63
- package/dist/attachments/RegionAttachment.d.ts +108 -108
- package/dist/attachments/RegionAttachment.js +201 -197
- package/dist/attachments/index.d.ts +8 -8
- package/dist/attachments/index.js +8 -8
- package/dist/iife/spine-core.js +170 -9
- package/dist/iife/spine-core.js.map +2 -2
- package/dist/iife/spine-core.min.js +2 -2
- package/dist/index.d.ts +42 -42
- package/dist/index.js +42 -42
- package/dist/polyfills.d.ts +29 -29
- package/dist/polyfills.js +38 -38
- package/dist/vertexeffects/JitterEffect.d.ts +39 -39
- package/dist/vertexeffects/JitterEffect.js +45 -45
- package/dist/vertexeffects/SwirlEffect.d.ts +44 -44
- package/dist/vertexeffects/SwirlEffect.js +60 -60
- package/package.json +32 -32
package/dist/Slot.d.ts
CHANGED
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
/******************************************************************************
|
|
2
|
-
* Spine Runtimes License Agreement
|
|
3
|
-
* Last updated January 1, 2020. Replaces all prior versions.
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) 2013-2020, Esoteric Software LLC
|
|
6
|
-
*
|
|
7
|
-
* Integration of the Spine Runtimes into software or otherwise creating
|
|
8
|
-
* derivative works of the Spine Runtimes is permitted under the terms and
|
|
9
|
-
* conditions of Section 2 of the Spine Editor License Agreement:
|
|
10
|
-
* http://esotericsoftware.com/spine-editor-license
|
|
11
|
-
*
|
|
12
|
-
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
|
13
|
-
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
|
14
|
-
* "Products"), provided that each user of the Products must obtain their own
|
|
15
|
-
* Spine Editor license and redistribution of the Products in any form must
|
|
16
|
-
* include this license and copyright notice.
|
|
17
|
-
*
|
|
18
|
-
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
|
19
|
-
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
20
|
-
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
21
|
-
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
|
22
|
-
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
23
|
-
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
|
24
|
-
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
|
25
|
-
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
26
|
-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
27
|
-
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
28
|
-
*****************************************************************************/
|
|
29
|
-
import { Attachment } from "./attachments/Attachment";
|
|
30
|
-
import { Bone } from "./Bone";
|
|
31
|
-
import { Skeleton } from "./Skeleton";
|
|
32
|
-
import { SlotData } from "./SlotData";
|
|
33
|
-
import { Color } from "./Utils";
|
|
34
|
-
/** Stores a slot's current pose. Slots organize attachments for {@link Skeleton#drawOrder} purposes and provide a place to store
|
|
35
|
-
* state for an attachment. State cannot be stored in an attachment itself because attachments are stateless and may be shared
|
|
36
|
-
* across multiple skeletons. */
|
|
37
|
-
export declare class Slot {
|
|
38
|
-
/** The slot's setup pose data. */
|
|
39
|
-
data: SlotData;
|
|
40
|
-
/** The bone this slot belongs to. */
|
|
41
|
-
bone: Bone;
|
|
42
|
-
/** The color used to tint the slot's attachment. If {@link #getDarkColor()} is set, this is used as the light color for two
|
|
43
|
-
* color tinting. */
|
|
44
|
-
color: Color;
|
|
45
|
-
/** The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark
|
|
46
|
-
* color's alpha is not used. */
|
|
47
|
-
darkColor: Color;
|
|
48
|
-
attachment: Attachment;
|
|
49
|
-
private attachmentTime;
|
|
50
|
-
attachmentState: number;
|
|
51
|
-
/** Values to deform the slot's attachment. For an unweighted mesh, the entries are local positions for each vertex. For a
|
|
52
|
-
* weighted mesh, the entries are an offset for each vertex which will be added to the mesh's local vertex positions.
|
|
53
|
-
*
|
|
54
|
-
* See {@link VertexAttachment#computeWorldVertices()} and {@link DeformTimeline}. */
|
|
55
|
-
deform: number[];
|
|
56
|
-
constructor(data: SlotData, bone: Bone);
|
|
57
|
-
/** The skeleton this slot belongs to. */
|
|
58
|
-
getSkeleton(): Skeleton;
|
|
59
|
-
/** The current attachment for the slot, or null if the slot has no attachment. */
|
|
60
|
-
getAttachment(): Attachment;
|
|
61
|
-
/** Sets the slot's attachment and, if the attachment changed, resets {@link #attachmentTime} and clears the {@link #deform}.
|
|
62
|
-
* The deform is not cleared if the old attachment has the same {@link VertexAttachment#getDeformAttachment()} as the specified
|
|
63
|
-
* attachment.
|
|
64
|
-
* @param attachment May be null. */
|
|
65
|
-
setAttachment(attachment: Attachment): void;
|
|
66
|
-
setAttachmentTime(time: number): void;
|
|
67
|
-
/** The time that has elapsed since the last time the attachment was set or cleared. Relies on Skeleton
|
|
68
|
-
* {@link Skeleton#time}. */
|
|
69
|
-
getAttachmentTime(): number;
|
|
70
|
-
/** Sets this slot to the setup pose. */
|
|
71
|
-
setToSetupPose(): void;
|
|
72
|
-
}
|
|
1
|
+
/******************************************************************************
|
|
2
|
+
* Spine Runtimes License Agreement
|
|
3
|
+
* Last updated January 1, 2020. Replaces all prior versions.
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) 2013-2020, Esoteric Software LLC
|
|
6
|
+
*
|
|
7
|
+
* Integration of the Spine Runtimes into software or otherwise creating
|
|
8
|
+
* derivative works of the Spine Runtimes is permitted under the terms and
|
|
9
|
+
* conditions of Section 2 of the Spine Editor License Agreement:
|
|
10
|
+
* http://esotericsoftware.com/spine-editor-license
|
|
11
|
+
*
|
|
12
|
+
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
|
13
|
+
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
|
14
|
+
* "Products"), provided that each user of the Products must obtain their own
|
|
15
|
+
* Spine Editor license and redistribution of the Products in any form must
|
|
16
|
+
* include this license and copyright notice.
|
|
17
|
+
*
|
|
18
|
+
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
|
19
|
+
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
20
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
21
|
+
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
|
22
|
+
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
23
|
+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
|
24
|
+
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
|
25
|
+
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
26
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
27
|
+
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
28
|
+
*****************************************************************************/
|
|
29
|
+
import { Attachment } from "./attachments/Attachment";
|
|
30
|
+
import { Bone } from "./Bone";
|
|
31
|
+
import { Skeleton } from "./Skeleton";
|
|
32
|
+
import { SlotData } from "./SlotData";
|
|
33
|
+
import { Color } from "./Utils";
|
|
34
|
+
/** Stores a slot's current pose. Slots organize attachments for {@link Skeleton#drawOrder} purposes and provide a place to store
|
|
35
|
+
* state for an attachment. State cannot be stored in an attachment itself because attachments are stateless and may be shared
|
|
36
|
+
* across multiple skeletons. */
|
|
37
|
+
export declare class Slot {
|
|
38
|
+
/** The slot's setup pose data. */
|
|
39
|
+
data: SlotData;
|
|
40
|
+
/** The bone this slot belongs to. */
|
|
41
|
+
bone: Bone;
|
|
42
|
+
/** The color used to tint the slot's attachment. If {@link #getDarkColor()} is set, this is used as the light color for two
|
|
43
|
+
* color tinting. */
|
|
44
|
+
color: Color;
|
|
45
|
+
/** The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark
|
|
46
|
+
* color's alpha is not used. */
|
|
47
|
+
darkColor: Color;
|
|
48
|
+
attachment: Attachment;
|
|
49
|
+
private attachmentTime;
|
|
50
|
+
attachmentState: number;
|
|
51
|
+
/** Values to deform the slot's attachment. For an unweighted mesh, the entries are local positions for each vertex. For a
|
|
52
|
+
* weighted mesh, the entries are an offset for each vertex which will be added to the mesh's local vertex positions.
|
|
53
|
+
*
|
|
54
|
+
* See {@link VertexAttachment#computeWorldVertices()} and {@link DeformTimeline}. */
|
|
55
|
+
deform: number[];
|
|
56
|
+
constructor(data: SlotData, bone: Bone);
|
|
57
|
+
/** The skeleton this slot belongs to. */
|
|
58
|
+
getSkeleton(): Skeleton;
|
|
59
|
+
/** The current attachment for the slot, or null if the slot has no attachment. */
|
|
60
|
+
getAttachment(): Attachment;
|
|
61
|
+
/** Sets the slot's attachment and, if the attachment changed, resets {@link #attachmentTime} and clears the {@link #deform}.
|
|
62
|
+
* The deform is not cleared if the old attachment has the same {@link VertexAttachment#getDeformAttachment()} as the specified
|
|
63
|
+
* attachment.
|
|
64
|
+
* @param attachment May be null. */
|
|
65
|
+
setAttachment(attachment: Attachment): void;
|
|
66
|
+
setAttachmentTime(time: number): void;
|
|
67
|
+
/** The time that has elapsed since the last time the attachment was set or cleared. Relies on Skeleton
|
|
68
|
+
* {@link Skeleton#time}. */
|
|
69
|
+
getAttachmentTime(): number;
|
|
70
|
+
/** Sets this slot to the setup pose. */
|
|
71
|
+
setToSetupPose(): void;
|
|
72
|
+
}
|
package/dist/Slot.js
CHANGED
|
@@ -1,94 +1,107 @@
|
|
|
1
|
-
/******************************************************************************
|
|
2
|
-
* Spine Runtimes License Agreement
|
|
3
|
-
* Last updated January 1, 2020. Replaces all prior versions.
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) 2013-2020, Esoteric Software LLC
|
|
6
|
-
*
|
|
7
|
-
* Integration of the Spine Runtimes into software or otherwise creating
|
|
8
|
-
* derivative works of the Spine Runtimes is permitted under the terms and
|
|
9
|
-
* conditions of Section 2 of the Spine Editor License Agreement:
|
|
10
|
-
* http://esotericsoftware.com/spine-editor-license
|
|
11
|
-
*
|
|
12
|
-
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
|
13
|
-
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
|
14
|
-
* "Products"), provided that each user of the Products must obtain their own
|
|
15
|
-
* Spine Editor license and redistribution of the Products in any form must
|
|
16
|
-
* include this license and copyright notice.
|
|
17
|
-
*
|
|
18
|
-
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
|
19
|
-
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
20
|
-
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
21
|
-
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
|
22
|
-
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
23
|
-
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
|
24
|
-
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
|
25
|
-
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
26
|
-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
27
|
-
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
28
|
-
*****************************************************************************/
|
|
29
|
-
import { VertexAttachment } from "./attachments/Attachment";
|
|
30
|
-
import { Color } from "./Utils";
|
|
31
|
-
/** Stores a slot's current pose. Slots organize attachments for {@link Skeleton#drawOrder} purposes and provide a place to store
|
|
32
|
-
* state for an attachment. State cannot be stored in an attachment itself because attachments are stateless and may be shared
|
|
33
|
-
* across multiple skeletons. */
|
|
34
|
-
export class Slot {
|
|
35
|
-
constructor(data, bone) {
|
|
36
|
-
/**
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
if
|
|
44
|
-
|
|
45
|
-
this.
|
|
46
|
-
this.
|
|
47
|
-
this.
|
|
48
|
-
this.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
this.attachment
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
this.
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
|
|
1
|
+
/******************************************************************************
|
|
2
|
+
* Spine Runtimes License Agreement
|
|
3
|
+
* Last updated January 1, 2020. Replaces all prior versions.
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) 2013-2020, Esoteric Software LLC
|
|
6
|
+
*
|
|
7
|
+
* Integration of the Spine Runtimes into software or otherwise creating
|
|
8
|
+
* derivative works of the Spine Runtimes is permitted under the terms and
|
|
9
|
+
* conditions of Section 2 of the Spine Editor License Agreement:
|
|
10
|
+
* http://esotericsoftware.com/spine-editor-license
|
|
11
|
+
*
|
|
12
|
+
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
|
13
|
+
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
|
14
|
+
* "Products"), provided that each user of the Products must obtain their own
|
|
15
|
+
* Spine Editor license and redistribution of the Products in any form must
|
|
16
|
+
* include this license and copyright notice.
|
|
17
|
+
*
|
|
18
|
+
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
|
19
|
+
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
20
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
21
|
+
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
|
22
|
+
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
23
|
+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
|
24
|
+
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
|
25
|
+
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
26
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
27
|
+
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
28
|
+
*****************************************************************************/
|
|
29
|
+
import { VertexAttachment } from "./attachments/Attachment";
|
|
30
|
+
import { Color } from "./Utils";
|
|
31
|
+
/** Stores a slot's current pose. Slots organize attachments for {@link Skeleton#drawOrder} purposes and provide a place to store
|
|
32
|
+
* state for an attachment. State cannot be stored in an attachment itself because attachments are stateless and may be shared
|
|
33
|
+
* across multiple skeletons. */
|
|
34
|
+
export class Slot {
|
|
35
|
+
constructor(data, bone) {
|
|
36
|
+
/** The slot's setup pose data. */
|
|
37
|
+
this.data = null;
|
|
38
|
+
/** The bone this slot belongs to. */
|
|
39
|
+
this.bone = null;
|
|
40
|
+
/** The color used to tint the slot's attachment. If {@link #getDarkColor()} is set, this is used as the light color for two
|
|
41
|
+
* color tinting. */
|
|
42
|
+
this.color = null;
|
|
43
|
+
/** The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark
|
|
44
|
+
* color's alpha is not used. */
|
|
45
|
+
this.darkColor = null;
|
|
46
|
+
this.attachment = null;
|
|
47
|
+
this.attachmentTime = 0;
|
|
48
|
+
this.attachmentState = 0;
|
|
49
|
+
/** Values to deform the slot's attachment. For an unweighted mesh, the entries are local positions for each vertex. For a
|
|
50
|
+
* weighted mesh, the entries are an offset for each vertex which will be added to the mesh's local vertex positions.
|
|
51
|
+
*
|
|
52
|
+
* See {@link VertexAttachment#computeWorldVertices()} and {@link DeformTimeline}. */
|
|
53
|
+
this.deform = new Array();
|
|
54
|
+
if (!data)
|
|
55
|
+
throw new Error("data cannot be null.");
|
|
56
|
+
if (!bone)
|
|
57
|
+
throw new Error("bone cannot be null.");
|
|
58
|
+
this.data = data;
|
|
59
|
+
this.bone = bone;
|
|
60
|
+
this.color = new Color();
|
|
61
|
+
this.darkColor = !data.darkColor ? null : new Color();
|
|
62
|
+
this.setToSetupPose();
|
|
63
|
+
}
|
|
64
|
+
/** The skeleton this slot belongs to. */
|
|
65
|
+
getSkeleton() {
|
|
66
|
+
return this.bone.skeleton;
|
|
67
|
+
}
|
|
68
|
+
/** The current attachment for the slot, or null if the slot has no attachment. */
|
|
69
|
+
getAttachment() {
|
|
70
|
+
return this.attachment;
|
|
71
|
+
}
|
|
72
|
+
/** Sets the slot's attachment and, if the attachment changed, resets {@link #attachmentTime} and clears the {@link #deform}.
|
|
73
|
+
* The deform is not cleared if the old attachment has the same {@link VertexAttachment#getDeformAttachment()} as the specified
|
|
74
|
+
* attachment.
|
|
75
|
+
* @param attachment May be null. */
|
|
76
|
+
setAttachment(attachment) {
|
|
77
|
+
if (this.attachment == attachment)
|
|
78
|
+
return;
|
|
79
|
+
if (!(attachment instanceof VertexAttachment) || !(this.attachment instanceof VertexAttachment)
|
|
80
|
+
|| attachment.deformAttachment != this.attachment.deformAttachment) {
|
|
81
|
+
this.deform.length = 0;
|
|
82
|
+
}
|
|
83
|
+
this.attachment = attachment;
|
|
84
|
+
this.attachmentTime = this.bone.skeleton.time;
|
|
85
|
+
}
|
|
86
|
+
setAttachmentTime(time) {
|
|
87
|
+
this.attachmentTime = this.bone.skeleton.time - time;
|
|
88
|
+
}
|
|
89
|
+
/** The time that has elapsed since the last time the attachment was set or cleared. Relies on Skeleton
|
|
90
|
+
* {@link Skeleton#time}. */
|
|
91
|
+
getAttachmentTime() {
|
|
92
|
+
return this.bone.skeleton.time - this.attachmentTime;
|
|
93
|
+
}
|
|
94
|
+
/** Sets this slot to the setup pose. */
|
|
95
|
+
setToSetupPose() {
|
|
96
|
+
this.color.setFromColor(this.data.color);
|
|
97
|
+
if (this.darkColor)
|
|
98
|
+
this.darkColor.setFromColor(this.data.darkColor);
|
|
99
|
+
if (!this.data.attachmentName)
|
|
100
|
+
this.attachment = null;
|
|
101
|
+
else {
|
|
102
|
+
this.attachment = null;
|
|
103
|
+
this.setAttachment(this.bone.skeleton.getAttachment(this.data.index, this.data.attachmentName));
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiU2xvdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9TbG90LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7K0VBMkIrRTtBQUUvRSxPQUFPLEVBQWMsZ0JBQWdCLEVBQUUsTUFBTSwwQkFBMEIsQ0F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lBQVksQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxDQUFDO1FBQ3pDLElBQUksSUFBSSxDQUFDLFNBQVM7WUFBRSxJQUFJLENBQUMsU0FBUyxDQUFDLFlBQVksQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxDQUFDO1FBQ3JFLElBQUksQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLGNBQWM7WUFDNUIsSUFBSSxDQUFDLFVBQVUsR0FBRyxJQUFJLENBQUM7YUFDbkI7WUFDSixJQUFJLENBQUMsVUFBVSxHQUFHLElBQUksQ0FBQztZQUN2QixJQUFJLENBQUMsYUFBYSxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsUUFBUSxDQUFDLGFBQWEsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLEtBQUssRUFBRSxJQUFJLENBQUMsSUFBSSxDQUFDLGNBQWMsQ0FBQyxDQUFDLENBQUM7U0FDaEc7SUFDRixDQUFDO0NBQ0QifQ==
|
package/dist/SlotData.d.ts
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
/******************************************************************************
|
|
2
|
-
* Spine Runtimes License Agreement
|
|
3
|
-
* Last updated January 1, 2020. Replaces all prior versions.
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) 2013-2020, Esoteric Software LLC
|
|
6
|
-
*
|
|
7
|
-
* Integration of the Spine Runtimes into software or otherwise creating
|
|
8
|
-
* derivative works of the Spine Runtimes is permitted under the terms and
|
|
9
|
-
* conditions of Section 2 of the Spine Editor License Agreement:
|
|
10
|
-
* http://esotericsoftware.com/spine-editor-license
|
|
11
|
-
*
|
|
12
|
-
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
|
13
|
-
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
|
14
|
-
* "Products"), provided that each user of the Products must obtain their own
|
|
15
|
-
* Spine Editor license and redistribution of the Products in any form must
|
|
16
|
-
* include this license and copyright notice.
|
|
17
|
-
*
|
|
18
|
-
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
|
19
|
-
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
20
|
-
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
21
|
-
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
|
22
|
-
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
23
|
-
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
|
24
|
-
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
|
25
|
-
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
26
|
-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
27
|
-
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
28
|
-
*****************************************************************************/
|
|
29
|
-
import { BoneData } from "./BoneData";
|
|
30
|
-
import { Color } from "./Utils";
|
|
31
|
-
/** Stores the setup pose for a {@link Slot}. */
|
|
32
|
-
export declare class SlotData {
|
|
33
|
-
/** The index of the slot in {@link Skeleton#getSlots()}. */
|
|
34
|
-
index: number;
|
|
35
|
-
/** The name of the slot, which is unique across all slots in the skeleton. */
|
|
36
|
-
name: string;
|
|
37
|
-
/** The bone this slot belongs to. */
|
|
38
|
-
boneData: BoneData;
|
|
39
|
-
/** The color used to tint the slot's attachment. If {@link #getDarkColor()} is set, this is used as the light color for two
|
|
40
|
-
* color tinting. */
|
|
41
|
-
color: Color;
|
|
42
|
-
/** The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark
|
|
43
|
-
* color's alpha is not used. */
|
|
44
|
-
darkColor: Color;
|
|
45
|
-
/** The name of the attachment that is visible for this slot in the setup pose, or null if no attachment is visible. */
|
|
46
|
-
attachmentName: string;
|
|
47
|
-
/** The blend mode for drawing the slot's attachment. */
|
|
48
|
-
blendMode: BlendMode;
|
|
49
|
-
constructor(index: number, name: string, boneData: BoneData);
|
|
50
|
-
}
|
|
51
|
-
/** Determines how images are blended with existing pixels when drawn. */
|
|
52
|
-
export declare enum BlendMode {
|
|
53
|
-
Normal = 0,
|
|
54
|
-
Additive = 1,
|
|
55
|
-
Multiply = 2,
|
|
56
|
-
Screen = 3
|
|
57
|
-
}
|
|
1
|
+
/******************************************************************************
|
|
2
|
+
* Spine Runtimes License Agreement
|
|
3
|
+
* Last updated January 1, 2020. Replaces all prior versions.
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) 2013-2020, Esoteric Software LLC
|
|
6
|
+
*
|
|
7
|
+
* Integration of the Spine Runtimes into software or otherwise creating
|
|
8
|
+
* derivative works of the Spine Runtimes is permitted under the terms and
|
|
9
|
+
* conditions of Section 2 of the Spine Editor License Agreement:
|
|
10
|
+
* http://esotericsoftware.com/spine-editor-license
|
|
11
|
+
*
|
|
12
|
+
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
|
13
|
+
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
|
14
|
+
* "Products"), provided that each user of the Products must obtain their own
|
|
15
|
+
* Spine Editor license and redistribution of the Products in any form must
|
|
16
|
+
* include this license and copyright notice.
|
|
17
|
+
*
|
|
18
|
+
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
|
19
|
+
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
20
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
21
|
+
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
|
22
|
+
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
23
|
+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
|
24
|
+
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
|
25
|
+
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
26
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
27
|
+
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
28
|
+
*****************************************************************************/
|
|
29
|
+
import { BoneData } from "./BoneData";
|
|
30
|
+
import { Color } from "./Utils";
|
|
31
|
+
/** Stores the setup pose for a {@link Slot}. */
|
|
32
|
+
export declare class SlotData {
|
|
33
|
+
/** The index of the slot in {@link Skeleton#getSlots()}. */
|
|
34
|
+
index: number;
|
|
35
|
+
/** The name of the slot, which is unique across all slots in the skeleton. */
|
|
36
|
+
name: string;
|
|
37
|
+
/** The bone this slot belongs to. */
|
|
38
|
+
boneData: BoneData;
|
|
39
|
+
/** The color used to tint the slot's attachment. If {@link #getDarkColor()} is set, this is used as the light color for two
|
|
40
|
+
* color tinting. */
|
|
41
|
+
color: Color;
|
|
42
|
+
/** The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark
|
|
43
|
+
* color's alpha is not used. */
|
|
44
|
+
darkColor: Color;
|
|
45
|
+
/** The name of the attachment that is visible for this slot in the setup pose, or null if no attachment is visible. */
|
|
46
|
+
attachmentName: string;
|
|
47
|
+
/** The blend mode for drawing the slot's attachment. */
|
|
48
|
+
blendMode: BlendMode;
|
|
49
|
+
constructor(index: number, name: string, boneData: BoneData);
|
|
50
|
+
}
|
|
51
|
+
/** Determines how images are blended with existing pixels when drawn. */
|
|
52
|
+
export declare enum BlendMode {
|
|
53
|
+
Normal = 0,
|
|
54
|
+
Additive = 1,
|
|
55
|
+
Multiply = 2,
|
|
56
|
+
Screen = 3
|
|
57
|
+
}
|
package/dist/SlotData.js
CHANGED
|
@@ -1,55 +1,68 @@
|
|
|
1
|
-
/******************************************************************************
|
|
2
|
-
* Spine Runtimes License Agreement
|
|
3
|
-
* Last updated January 1, 2020. Replaces all prior versions.
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) 2013-2020, Esoteric Software LLC
|
|
6
|
-
*
|
|
7
|
-
* Integration of the Spine Runtimes into software or otherwise creating
|
|
8
|
-
* derivative works of the Spine Runtimes is permitted under the terms and
|
|
9
|
-
* conditions of Section 2 of the Spine Editor License Agreement:
|
|
10
|
-
* http://esotericsoftware.com/spine-editor-license
|
|
11
|
-
*
|
|
12
|
-
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
|
13
|
-
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
|
14
|
-
* "Products"), provided that each user of the Products must obtain their own
|
|
15
|
-
* Spine Editor license and redistribution of the Products in any form must
|
|
16
|
-
* include this license and copyright notice.
|
|
17
|
-
*
|
|
18
|
-
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
|
19
|
-
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
20
|
-
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
21
|
-
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
|
22
|
-
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
23
|
-
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
|
24
|
-
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
|
25
|
-
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
26
|
-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
27
|
-
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
28
|
-
*****************************************************************************/
|
|
29
|
-
import { Color } from "./Utils";
|
|
30
|
-
/** Stores the setup pose for a {@link Slot}. */
|
|
31
|
-
export class SlotData {
|
|
32
|
-
constructor(index, name, boneData) {
|
|
33
|
-
/** The
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
this.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
|
|
49
|
-
(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
1
|
+
/******************************************************************************
|
|
2
|
+
* Spine Runtimes License Agreement
|
|
3
|
+
* Last updated January 1, 2020. Replaces all prior versions.
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) 2013-2020, Esoteric Software LLC
|
|
6
|
+
*
|
|
7
|
+
* Integration of the Spine Runtimes into software or otherwise creating
|
|
8
|
+
* derivative works of the Spine Runtimes is permitted under the terms and
|
|
9
|
+
* conditions of Section 2 of the Spine Editor License Agreement:
|
|
10
|
+
* http://esotericsoftware.com/spine-editor-license
|
|
11
|
+
*
|
|
12
|
+
* Otherwise, it is permitted to integrate the Spine Runtimes into software
|
|
13
|
+
* or otherwise create derivative works of the Spine Runtimes (collectively,
|
|
14
|
+
* "Products"), provided that each user of the Products must obtain their own
|
|
15
|
+
* Spine Editor license and redistribution of the Products in any form must
|
|
16
|
+
* include this license and copyright notice.
|
|
17
|
+
*
|
|
18
|
+
* THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
|
19
|
+
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
20
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
21
|
+
* DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
|
22
|
+
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
23
|
+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
|
24
|
+
* BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
|
25
|
+
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
26
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
27
|
+
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
28
|
+
*****************************************************************************/
|
|
29
|
+
import { Color } from "./Utils";
|
|
30
|
+
/** Stores the setup pose for a {@link Slot}. */
|
|
31
|
+
export class SlotData {
|
|
32
|
+
constructor(index, name, boneData) {
|
|
33
|
+
/** The index of the slot in {@link Skeleton#getSlots()}. */
|
|
34
|
+
this.index = 0;
|
|
35
|
+
/** The name of the slot, which is unique across all slots in the skeleton. */
|
|
36
|
+
this.name = null;
|
|
37
|
+
/** The bone this slot belongs to. */
|
|
38
|
+
this.boneData = null;
|
|
39
|
+
/** The color used to tint the slot's attachment. If {@link #getDarkColor()} is set, this is used as the light color for two
|
|
40
|
+
* color tinting. */
|
|
41
|
+
this.color = new Color(1, 1, 1, 1);
|
|
42
|
+
/** The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark
|
|
43
|
+
* color's alpha is not used. */
|
|
44
|
+
this.darkColor = null;
|
|
45
|
+
/** The name of the attachment that is visible for this slot in the setup pose, or null if no attachment is visible. */
|
|
46
|
+
this.attachmentName = null;
|
|
47
|
+
/** The blend mode for drawing the slot's attachment. */
|
|
48
|
+
this.blendMode = null;
|
|
49
|
+
if (index < 0)
|
|
50
|
+
throw new Error("index must be >= 0.");
|
|
51
|
+
if (!name)
|
|
52
|
+
throw new Error("name cannot be null.");
|
|
53
|
+
if (!boneData)
|
|
54
|
+
throw new Error("boneData cannot be null.");
|
|
55
|
+
this.index = index;
|
|
56
|
+
this.name = name;
|
|
57
|
+
this.boneData = boneData;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/** Determines how images are blended with existing pixels when drawn. */
|
|
61
|
+
export var BlendMode;
|
|
62
|
+
(function (BlendMode) {
|
|
63
|
+
BlendMode[BlendMode["Normal"] = 0] = "Normal";
|
|
64
|
+
BlendMode[BlendMode["Additive"] = 1] = "Additive";
|
|
65
|
+
BlendMode[BlendMode["Multiply"] = 2] = "Multiply";
|
|
66
|
+
BlendMode[BlendMode["Screen"] = 3] = "Screen";
|
|
67
|
+
})(BlendMode || (BlendMode = {}));
|
|
68
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiU2xvdERhdGEuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvU2xvdERhdGEudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OzsrRUEyQitFO0FBRy9FLE9BQU8sRUFBRSxLQUFLLEVBQUUsTUFBTSxTQUFTLENBQUM7QUFFaEMsZ0RBQWdEO0FBQ2hELE1BQU0sT0FBTyxRQUFRO0l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