@p100-web/core-three 100.0.65 → 100.0.66
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/package.json +2 -2
- package/dist/src/App.d.ts +0 -40
- package/dist/src/App.d.ts.map +0 -1
- package/dist/src/App.js +0 -171
- package/dist/src/App.js.map +0 -1
- package/dist/src/ComponentFactory.d.ts +0 -5
- package/dist/src/ComponentFactory.d.ts.map +0 -1
- package/dist/src/ComponentFactory.js +0 -17
- package/dist/src/ComponentFactory.js.map +0 -1
- package/dist/src/PCanvas.d.ts +0 -171
- package/dist/src/PCanvas.d.ts.map +0 -1
- package/dist/src/PCanvas.js +0 -992
- package/dist/src/PCanvas.js.map +0 -1
- package/dist/src/ThreeEngine.d.ts +0 -25
- package/dist/src/ThreeEngine.d.ts.map +0 -1
- package/dist/src/ThreeEngine.js +0 -102
- package/dist/src/ThreeEngine.js.map +0 -1
- package/dist/src/ThreeNodeRenderer.d.ts +0 -32
- package/dist/src/ThreeNodeRenderer.d.ts.map +0 -1
- package/dist/src/ThreeNodeRenderer.js +0 -87
- package/dist/src/ThreeNodeRenderer.js.map +0 -1
- package/dist/src/media/AudioLoader.d.ts +0 -32
- package/dist/src/media/AudioLoader.d.ts.map +0 -1
- package/dist/src/media/AudioLoader.js +0 -110
- package/dist/src/media/AudioLoader.js.map +0 -1
- package/dist/src/media/EnvironmentLoader.d.ts +0 -40
- package/dist/src/media/EnvironmentLoader.d.ts.map +0 -1
- package/dist/src/media/EnvironmentLoader.js +0 -120
- package/dist/src/media/EnvironmentLoader.js.map +0 -1
- package/dist/src/media/ImageLoader.d.ts +0 -36
- package/dist/src/media/ImageLoader.d.ts.map +0 -1
- package/dist/src/media/ImageLoader.js +0 -160
- package/dist/src/media/ImageLoader.js.map +0 -1
- package/dist/src/media/MediaLoader.d.ts +0 -14
- package/dist/src/media/MediaLoader.d.ts.map +0 -1
- package/dist/src/media/MediaLoader.js +0 -70
- package/dist/src/media/MediaLoader.js.map +0 -1
- package/dist/src/media/ModelLoader.d.ts +0 -49
- package/dist/src/media/ModelLoader.d.ts.map +0 -1
- package/dist/src/media/ModelLoader.js +0 -223
- package/dist/src/media/ModelLoader.js.map +0 -1
- package/dist/src/media/VideoLoader.d.ts +0 -35
- package/dist/src/media/VideoLoader.d.ts.map +0 -1
- package/dist/src/media/VideoLoader.js +0 -105
- package/dist/src/media/VideoLoader.js.map +0 -1
- package/dist/src/pcomponents/PAnimator.d.ts +0 -24
- package/dist/src/pcomponents/PAnimator.d.ts.map +0 -1
- package/dist/src/pcomponents/PAnimator.js +0 -129
- package/dist/src/pcomponents/PAnimator.js.map +0 -1
- package/dist/src/pcomponents/PBasicMaterial.d.ts +0 -17
- package/dist/src/pcomponents/PBasicMaterial.d.ts.map +0 -1
- package/dist/src/pcomponents/PBasicMaterial.js +0 -142
- package/dist/src/pcomponents/PBasicMaterial.js.map +0 -1
- package/dist/src/pcomponents/PCollider.d.ts +0 -11
- package/dist/src/pcomponents/PCollider.d.ts.map +0 -1
- package/dist/src/pcomponents/PCollider.js +0 -61
- package/dist/src/pcomponents/PCollider.js.map +0 -1
- package/dist/src/pcomponents/PCubeGeometry.d.ts +0 -8
- package/dist/src/pcomponents/PCubeGeometry.d.ts.map +0 -1
- package/dist/src/pcomponents/PCubeGeometry.js +0 -23
- package/dist/src/pcomponents/PCubeGeometry.js.map +0 -1
- package/dist/src/pcomponents/PEnvironment.d.ts +0 -14
- package/dist/src/pcomponents/PEnvironment.d.ts.map +0 -1
- package/dist/src/pcomponents/PEnvironment.js +0 -86
- package/dist/src/pcomponents/PEnvironment.js.map +0 -1
- package/dist/src/pcomponents/PImageBackground.d.ts +0 -14
- package/dist/src/pcomponents/PImageBackground.d.ts.map +0 -1
- package/dist/src/pcomponents/PImageBackground.js +0 -85
- package/dist/src/pcomponents/PImageBackground.js.map +0 -1
- package/dist/src/pcomponents/PLight.d.ts +0 -8
- package/dist/src/pcomponents/PLight.d.ts.map +0 -1
- package/dist/src/pcomponents/PLight.js +0 -22
- package/dist/src/pcomponents/PLight.js.map +0 -1
- package/dist/src/pcomponents/PLightDirectional.d.ts +0 -8
- package/dist/src/pcomponents/PLightDirectional.d.ts.map +0 -1
- package/dist/src/pcomponents/PLightDirectional.js +0 -36
- package/dist/src/pcomponents/PLightDirectional.js.map +0 -1
- package/dist/src/pcomponents/PMaskedMaterial.d.ts +0 -17
- package/dist/src/pcomponents/PMaskedMaterial.d.ts.map +0 -1
- package/dist/src/pcomponents/PMaskedMaterial.js +0 -214
- package/dist/src/pcomponents/PMaskedMaterial.js.map +0 -1
- package/dist/src/pcomponents/PModelGLTF.d.ts +0 -18
- package/dist/src/pcomponents/PModelGLTF.d.ts.map +0 -1
- package/dist/src/pcomponents/PModelGLTF.js +0 -98
- package/dist/src/pcomponents/PModelGLTF.js.map +0 -1
- package/dist/src/pcomponents/PPhysicalMaterial.d.ts +0 -13
- package/dist/src/pcomponents/PPhysicalMaterial.d.ts.map +0 -1
- package/dist/src/pcomponents/PPhysicalMaterial.js +0 -106
- package/dist/src/pcomponents/PPhysicalMaterial.js.map +0 -1
- package/dist/src/pcomponents/PPlaneGeometry.d.ts +0 -8
- package/dist/src/pcomponents/PPlaneGeometry.d.ts.map +0 -1
- package/dist/src/pcomponents/PPlaneGeometry.js +0 -23
- package/dist/src/pcomponents/PPlaneGeometry.js.map +0 -1
- package/dist/src/pcomponents/PProjectRoot.d.ts +0 -8
- package/dist/src/pcomponents/PProjectRoot.d.ts.map +0 -1
- package/dist/src/pcomponents/PProjectRoot.js +0 -24
- package/dist/src/pcomponents/PProjectRoot.js.map +0 -1
- package/dist/src/pcomponents/PSlider.d.ts +0 -16
- package/dist/src/pcomponents/PSlider.d.ts.map +0 -1
- package/dist/src/pcomponents/PSlider.js +0 -69
- package/dist/src/pcomponents/PSlider.js.map +0 -1
- package/dist/src/pcomponents/PSound.d.ts +0 -17
- package/dist/src/pcomponents/PSound.d.ts.map +0 -1
- package/dist/src/pcomponents/PSound.js +0 -110
- package/dist/src/pcomponents/PSound.js.map +0 -1
- package/dist/src/pcomponents/PSphereGeometry.d.ts +0 -9
- package/dist/src/pcomponents/PSphereGeometry.d.ts.map +0 -1
- package/dist/src/pcomponents/PSphereGeometry.js +0 -24
- package/dist/src/pcomponents/PSphereGeometry.js.map +0 -1
- package/dist/src/pcomponents/PSprite.d.ts +0 -14
- package/dist/src/pcomponents/PSprite.d.ts.map +0 -1
- package/dist/src/pcomponents/PSprite.js +0 -79
- package/dist/src/pcomponents/PSprite.js.map +0 -1
- package/dist/src/pcomponents/PSpriteAnimation.d.ts +0 -15
- package/dist/src/pcomponents/PSpriteAnimation.d.ts.map +0 -1
- package/dist/src/pcomponents/PSpriteAnimation.js +0 -80
- package/dist/src/pcomponents/PSpriteAnimation.js.map +0 -1
- package/dist/src/pcomponents/PText.d.ts +0 -10
- package/dist/src/pcomponents/PText.d.ts.map +0 -1
- package/dist/src/pcomponents/PText.js +0 -44
- package/dist/src/pcomponents/PText.js.map +0 -1
- package/dist/src/pcomponents/PVideoBackground.d.ts +0 -13
- package/dist/src/pcomponents/PVideoBackground.d.ts.map +0 -1
- package/dist/src/pcomponents/PVideoBackground.js +0 -85
- package/dist/src/pcomponents/PVideoBackground.js.map +0 -1
- package/dist/src/pcomponents/PVideoPlayer.d.ts +0 -5
- package/dist/src/pcomponents/PVideoPlayer.d.ts.map +0 -1
- package/dist/src/pcomponents/PVideoPlayer.js +0 -12
- package/dist/src/pcomponents/PVideoPlayer.js.map +0 -1
- package/dist/src/postprocessing/PSSRPass.d.ts +0 -19
- package/dist/src/postprocessing/PSSRPass.d.ts.map +0 -1
- package/dist/src/postprocessing/PSSRPass.js +0 -69
- package/dist/src/postprocessing/PSSRPass.js.map +0 -1
- package/dist/src/postprocessing/ThreeJsPostProcessor.d.ts +0 -32
- package/dist/src/postprocessing/ThreeJsPostProcessor.d.ts.map +0 -1
- package/dist/src/postprocessing/ThreeJsPostProcessor.js +0 -264
- package/dist/src/postprocessing/ThreeJsPostProcessor.js.map +0 -1
- package/dist/src/three/ColliderObject3D.d.ts +0 -19
- package/dist/src/three/ColliderObject3D.d.ts.map +0 -1
- package/dist/src/three/ColliderObject3D.js +0 -146
- package/dist/src/three/ColliderObject3D.js.map +0 -1
- package/dist/src/three/FreeCameraControls.d.ts +0 -30
- package/dist/src/three/FreeCameraControls.d.ts.map +0 -1
- package/dist/src/three/FreeCameraControls.js +0 -158
- package/dist/src/three/FreeCameraControls.js.map +0 -1
- package/dist/src/three/OrbitCameraControls.d.ts +0 -24
- package/dist/src/three/OrbitCameraControls.d.ts.map +0 -1
- package/dist/src/three/OrbitCameraControls.js +0 -81
- package/dist/src/three/OrbitCameraControls.js.map +0 -1
- package/dist/src/three/VrCameraControls.d.ts +0 -28
- package/dist/src/three/VrCameraControls.d.ts.map +0 -1
- package/dist/src/three/VrCameraControls.js +0 -124
- package/dist/src/three/VrCameraControls.js.map +0 -1
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
import { BackSide, FrontSide, Texture, SRGBColorSpace, VideoTexture, ShaderMaterial, Color, } from "three";
|
|
2
|
-
import { PMaskedMaterial as PMaskedMaterialBase } from "@p100-web/core";
|
|
3
|
-
import { FileType, FileSubType, } from "@p100-web/core";
|
|
4
|
-
export default class PMaskedMaterial extends PMaskedMaterialBase {
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this._material = null;
|
|
8
|
-
this._cacheKey = 0;
|
|
9
|
-
}
|
|
10
|
-
getTexture() {
|
|
11
|
-
return this._material?.uniforms.map.value || null;
|
|
12
|
-
}
|
|
13
|
-
getMaterial() {
|
|
14
|
-
return this._material;
|
|
15
|
-
}
|
|
16
|
-
//
|
|
17
|
-
// PComponent
|
|
18
|
-
//
|
|
19
|
-
dispose() {
|
|
20
|
-
// Release files
|
|
21
|
-
if (this.file_texture)
|
|
22
|
-
this.context.releaseFile(this.file_texture);
|
|
23
|
-
}
|
|
24
|
-
_dispose(unrender) {
|
|
25
|
-
if (this.file_texture) {
|
|
26
|
-
if (this.file_texture.type === FileType.Image) {
|
|
27
|
-
this.context
|
|
28
|
-
.imageLoader()
|
|
29
|
-
.disposeImage(this, this.file_texture, this._cacheKey);
|
|
30
|
-
}
|
|
31
|
-
else if (this.file_texture.type === FileType.Video) {
|
|
32
|
-
// Notify any video player
|
|
33
|
-
const videoPlayer = this.node.findComponent("PVideoPlayer");
|
|
34
|
-
videoPlayer?.onDisposeMaterial();
|
|
35
|
-
this.context
|
|
36
|
-
.videoLoader()
|
|
37
|
-
.disposeVideo(this, this.file_texture);
|
|
38
|
-
}
|
|
39
|
-
this._cacheKey = 0;
|
|
40
|
-
}
|
|
41
|
-
// Check if we should dispose Material
|
|
42
|
-
if (this._material) {
|
|
43
|
-
// Do we have a texture as well?
|
|
44
|
-
if (this._material.uniforms.map.value) {
|
|
45
|
-
this._material.uniforms.map.value.dispose();
|
|
46
|
-
this._material.uniforms.map.value.source.data = null;
|
|
47
|
-
this._material.uniforms.map.value = null;
|
|
48
|
-
}
|
|
49
|
-
this._material.needsUpdate = true;
|
|
50
|
-
// Dispose material
|
|
51
|
-
if (unrender) {
|
|
52
|
-
this._material.dispose();
|
|
53
|
-
this._material = null;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
unrender() {
|
|
58
|
-
this._dispose(true);
|
|
59
|
-
// Unregister as material for PNode
|
|
60
|
-
this.node.material = null;
|
|
61
|
-
}
|
|
62
|
-
render() {
|
|
63
|
-
// Register as material for PNode
|
|
64
|
-
this.node.material = this;
|
|
65
|
-
if (!this.node.hasEl()) {
|
|
66
|
-
this.context.error("Material is missing Mesh");
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
const mesh = this.node.getEl();
|
|
70
|
-
const material = createChromaKeyMaterial({
|
|
71
|
-
side: this.inverted ? BackSide : FrontSide,
|
|
72
|
-
opacity: this.opacity,
|
|
73
|
-
transparent: this.transparent,
|
|
74
|
-
fog: false,
|
|
75
|
-
wireframe: false,
|
|
76
|
-
alphaTest: this.alphaTest,
|
|
77
|
-
depthWrite: this.depthWrite,
|
|
78
|
-
});
|
|
79
|
-
// Set mask threshold
|
|
80
|
-
material.uniforms.keyThreshold.value = this.maskThreshold;
|
|
81
|
-
// Set mask softness
|
|
82
|
-
material.uniforms.keySoftness.value = this.maskSoftness;
|
|
83
|
-
// Set green screen color
|
|
84
|
-
material.uniforms.keyColor.value.set(this.maskColor);
|
|
85
|
-
this._material = material;
|
|
86
|
-
mesh.material = material;
|
|
87
|
-
mesh.renderOrder = this.renderOrder;
|
|
88
|
-
if (this.file_texture !== null) {
|
|
89
|
-
// Check which loader to use
|
|
90
|
-
if (this.file_texture.type === FileType.Image)
|
|
91
|
-
this.context
|
|
92
|
-
.imageLoader()
|
|
93
|
-
.load(this, this.file_texture);
|
|
94
|
-
else if (this.file_texture.type === FileType.Video)
|
|
95
|
-
this.context
|
|
96
|
-
.videoLoader()
|
|
97
|
-
.load(this, this.file_texture);
|
|
98
|
-
else
|
|
99
|
-
this.context.error("Unsuppotred material texture");
|
|
100
|
-
}
|
|
101
|
-
material.needsUpdate = true;
|
|
102
|
-
}
|
|
103
|
-
setTextureRepeat(file, texture) {
|
|
104
|
-
if (this._material) {
|
|
105
|
-
if (file.subType === FileSubType.Stereo) {
|
|
106
|
-
this._material.uniforms.stereoMultiplier.value = 0.5;
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
this._material.uniforms.stereoMultiplier.value = 1;
|
|
110
|
-
}
|
|
111
|
-
texture.needsUpdate = true;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
//
|
|
115
|
-
// IVideoLoader
|
|
116
|
-
//
|
|
117
|
-
onVideoLoaded(file, value) {
|
|
118
|
-
if (this._material === null) {
|
|
119
|
-
this.context.error("onVideoLoaded and material was null");
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
const texture = new VideoTexture(value);
|
|
123
|
-
texture.colorSpace = SRGBColorSpace;
|
|
124
|
-
this.setTextureRepeat(file, texture);
|
|
125
|
-
this._material.uniforms.map.value = texture;
|
|
126
|
-
this._material.needsUpdate = true;
|
|
127
|
-
}
|
|
128
|
-
//
|
|
129
|
-
// IImageLoader
|
|
130
|
-
//
|
|
131
|
-
onImageLoaded(file, data, cacheKey) {
|
|
132
|
-
this._cacheKey = cacheKey;
|
|
133
|
-
if (this._material === null) {
|
|
134
|
-
this.context.error("onImageLoaded and material was null");
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
const texture = new Texture();
|
|
138
|
-
texture.userData.id = file._id;
|
|
139
|
-
texture.colorSpace = SRGBColorSpace;
|
|
140
|
-
texture.image = data;
|
|
141
|
-
this.setTextureRepeat(file, texture);
|
|
142
|
-
this._material.uniforms.map.value = texture;
|
|
143
|
-
this._material.needsUpdate = true;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
function createChromaKeyMaterial(args) {
|
|
147
|
-
return new ShaderMaterial({
|
|
148
|
-
...args,
|
|
149
|
-
uniforms: {
|
|
150
|
-
map: { value: null }, // set later
|
|
151
|
-
keyColor: { value: new Color(0, 1, 0) }, // green screen
|
|
152
|
-
keyThreshold: { value: 0.0025 }, // squared threshold
|
|
153
|
-
keySoftness: { value: 0.001 }, // squared threshold
|
|
154
|
-
stereoMultiplier: { value: 1 }, // squared threshold
|
|
155
|
-
},
|
|
156
|
-
vertexShader: `
|
|
157
|
-
varying vec2 vUv;
|
|
158
|
-
void main() {
|
|
159
|
-
vUv = uv;
|
|
160
|
-
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
161
|
-
}
|
|
162
|
-
`,
|
|
163
|
-
fragmentShader: args.transparent
|
|
164
|
-
? `
|
|
165
|
-
uniform sampler2D map;
|
|
166
|
-
uniform vec3 keyColor;
|
|
167
|
-
uniform float keyThreshold;
|
|
168
|
-
uniform float keySoftness;
|
|
169
|
-
uniform float stereoMultiplier;
|
|
170
|
-
varying vec2 vUv;
|
|
171
|
-
|
|
172
|
-
void main() {
|
|
173
|
-
vec2 uv = vUv;
|
|
174
|
-
uv.y *= stereoMultiplier;
|
|
175
|
-
vec4 col = texture2D(map, uv);
|
|
176
|
-
|
|
177
|
-
// squared distance to key color
|
|
178
|
-
vec3 diff = col.rgb - keyColor;
|
|
179
|
-
float distSq = dot(diff, diff);
|
|
180
|
-
|
|
181
|
-
// Smooth alpha:
|
|
182
|
-
// distSq <= keyThreshold → fully transparent
|
|
183
|
-
// distSq >= keyThreshold+softness → fully opaque
|
|
184
|
-
float alpha = smoothstep(keyThreshold, keyThreshold + keySoftness, distSq);
|
|
185
|
-
|
|
186
|
-
// multiply original texture alpha as well
|
|
187
|
-
gl_FragColor = vec4(col.rgb, col.a * alpha);
|
|
188
|
-
}
|
|
189
|
-
`
|
|
190
|
-
: `
|
|
191
|
-
uniform sampler2D map;
|
|
192
|
-
uniform vec3 keyColor;
|
|
193
|
-
uniform float keyThreshold;
|
|
194
|
-
uniform float stereoMultiplier;
|
|
195
|
-
varying vec2 vUv;
|
|
196
|
-
|
|
197
|
-
void main() {
|
|
198
|
-
vec2 uv = vUv;
|
|
199
|
-
uv.y *= stereoMultiplier;
|
|
200
|
-
vec4 col = texture2D(map, uv);
|
|
201
|
-
|
|
202
|
-
// squared distance to key color
|
|
203
|
-
vec3 diff = col.rgb - keyColor;
|
|
204
|
-
float distSq = dot(diff, diff);
|
|
205
|
-
|
|
206
|
-
// branch-free alpha mask
|
|
207
|
-
if (distSq < keyThreshold) discard;
|
|
208
|
-
gl_FragColor = vec4(col.rgb, 1);
|
|
209
|
-
}
|
|
210
|
-
`,
|
|
211
|
-
//
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
//# sourceMappingURL=PMaskedMaterial.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PMaskedMaterial.js","sourceRoot":"","sources":["../../../src/pcomponents/PMaskedMaterial.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,SAAS,EAET,OA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"three";
|
|
2
|
-
import { IAnimationAction, PModelGLTF as PModelGLTFBase } from "@p100-web/core";
|
|
3
|
-
import { IModelLoader, PFile } from "@p100-web/core";
|
|
4
|
-
import { IModel } from "../media/ModelLoader";
|
|
5
|
-
export default class PModelGLTF extends PModelGLTFBase implements IModelLoader {
|
|
6
|
-
el: Group | null;
|
|
7
|
-
mixer: AnimationMixer | null;
|
|
8
|
-
actions: AnimationAction[] | null;
|
|
9
|
-
protected _reflectors: Mesh[] | null;
|
|
10
|
-
unrender(): void;
|
|
11
|
-
render(): void;
|
|
12
|
-
getAnimationAction(clip: string): IAnimationAction | null;
|
|
13
|
-
/**
|
|
14
|
-
* Called when the object has finished loading
|
|
15
|
-
*/
|
|
16
|
-
onModelLoaded: (_file: PFile, model: IModel) => Promise<void>;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=PModelGLTF.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PModelGLTF.d.ts","sourceRoot":"","sources":["../../../src/pcomponents/PModelGLTF.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,KAAK,EAAE,IAAI,EAAY,MAAM,OAAO,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EAAE,YAAY,EAAkB,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAErE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAG9C,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,cAAe,YAAW,YAAY;IAC5E,EAAE,EAAE,KAAK,GAAG,IAAI,CAAQ;IAExB,KAAK,EAAE,cAAc,GAAG,IAAI,CAAQ;IACpC,OAAO,EAAE,eAAe,EAAE,GAAG,IAAI,CAAQ;IAEzC,SAAS,CAAC,WAAW,EAAE,IAAI,EAAE,GAAG,IAAI,CAAQ;IAE5C,QAAQ;IAkBR,MAAM;IAaN,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI;IAYzD;;OAEG;IACH,aAAa,GAAU,OAAO,KAAK,EAAE,OAAO,MAAM,mBAuDhD;CACH"}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { Group } from "three";
|
|
2
|
-
import { PModelGLTF as PModelGLTFBase } from "@p100-web/core";
|
|
3
|
-
export default class PModelGLTF extends PModelGLTFBase {
|
|
4
|
-
constructor() {
|
|
5
|
-
super(...arguments);
|
|
6
|
-
this.el = null;
|
|
7
|
-
this.mixer = null;
|
|
8
|
-
this.actions = null;
|
|
9
|
-
this._reflectors = null;
|
|
10
|
-
//
|
|
11
|
-
// IModelLoader
|
|
12
|
-
//
|
|
13
|
-
/**
|
|
14
|
-
* Called when the object has finished loading
|
|
15
|
-
*/
|
|
16
|
-
this.onModelLoaded = async (_file, model) => {
|
|
17
|
-
// await this.parseGLTF(model);
|
|
18
|
-
if (!this.node.hasEl())
|
|
19
|
-
throw new Error("Missing el");
|
|
20
|
-
if (model.actions && model.actions.length) {
|
|
21
|
-
this.mixer = model.mixer;
|
|
22
|
-
this.actions = model.actions;
|
|
23
|
-
}
|
|
24
|
-
this.el = model.modelScene;
|
|
25
|
-
this.node.getEl().add(model.modelScene);
|
|
26
|
-
// Process model
|
|
27
|
-
if (this.forceDepthWrite || this.reflector) {
|
|
28
|
-
let composer = null;
|
|
29
|
-
// Setup custom reflectors
|
|
30
|
-
if (this.reflector) {
|
|
31
|
-
composer = this.context.getPCanvas().getComposer();
|
|
32
|
-
this._reflectors = [];
|
|
33
|
-
}
|
|
34
|
-
model.modelScene.traverse((node) => {
|
|
35
|
-
if (node.material) {
|
|
36
|
-
const material = node.material;
|
|
37
|
-
if (this.reflector) {
|
|
38
|
-
if (node.userData.REFL) {
|
|
39
|
-
this._reflectors?.push(node);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
if (this.forceDepthWrite &&
|
|
43
|
-
material.transparent &&
|
|
44
|
-
!material.depthWrite) {
|
|
45
|
-
material.depthWrite = true;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
if (this._reflectors?.length === 0)
|
|
50
|
-
this._reflectors = null;
|
|
51
|
-
if (composer && this._reflectors) {
|
|
52
|
-
composer.addSSRSelectors(this._reflectors);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
if (this.node.collider !== null) {
|
|
56
|
-
this.node.collider.computeBounds();
|
|
57
|
-
}
|
|
58
|
-
if (!this.context.editor) {
|
|
59
|
-
this.outevent_onLoaded?.emit(null, this);
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
unrender() {
|
|
64
|
-
this.mixer = null;
|
|
65
|
-
this.actions = null;
|
|
66
|
-
if (this._reflectors) {
|
|
67
|
-
const composer = this.context.getPCanvas().getComposer();
|
|
68
|
-
composer?.removeSSRSelectors(this._reflectors);
|
|
69
|
-
this._reflectors = null;
|
|
70
|
-
}
|
|
71
|
-
if (this.el !== null) {
|
|
72
|
-
this.context.modelLoader().disposeModel(this, this.el);
|
|
73
|
-
this.el = null;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
// getAction(name: string): AnimationAction | null {}
|
|
77
|
-
render() {
|
|
78
|
-
if (this.file_model !== null) {
|
|
79
|
-
this.node.set_el(new Group(), false);
|
|
80
|
-
if (!this.context.modelLoader().load(this, this.file_model)) {
|
|
81
|
-
this.context.error("File type not supported");
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
//
|
|
86
|
-
// ANIMATIONS
|
|
87
|
-
//
|
|
88
|
-
getAnimationAction(clip) {
|
|
89
|
-
if (this.actions === null)
|
|
90
|
-
return null;
|
|
91
|
-
for (const action of this.actions) {
|
|
92
|
-
if (action.getClip().name === clip)
|
|
93
|
-
return action;
|
|
94
|
-
}
|
|
95
|
-
return null;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
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;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CAiEF"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { MeshStandardMaterial } from "three";
|
|
2
|
-
import { PPhysicalMaterial as PPhysicalMaterialBase } from "@p100-web/core";
|
|
3
|
-
import { IImageLoader, PFile } from "@p100-web/core";
|
|
4
|
-
export default class PPhysicalMaterial extends PPhysicalMaterialBase implements IImageLoader {
|
|
5
|
-
protected _material: MeshStandardMaterial | null;
|
|
6
|
-
_cacheKey: number;
|
|
7
|
-
setTextureRepeat(): void;
|
|
8
|
-
_dispose(unrender: boolean): void;
|
|
9
|
-
render(): void;
|
|
10
|
-
callback_setOpacity: (payloadValue: string | null) => void;
|
|
11
|
-
onImageLoaded(file: PFile, data: any, cacheKey: number): void;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=PPhysicalMaterial.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PPhysicalMaterial.d.ts","sourceRoot":"","sources":["../../../src/pcomponents/PPhysicalMaterial.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,oBAAoB,EAKrB,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,iBAAiB,IAAI,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAe,YAAY,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAElE,MAAM,CAAC,OAAO,OAAO,iBACnB,SAAQ,qBACR,YAAW,YAAY;IAEvB,SAAS,CAAC,SAAS,EAAE,oBAAoB,GAAG,IAAI,CAAQ;IACxD,SAAS,SAAK;IAEd,gBAAgB;IAgBhB,QAAQ,CAAC,QAAQ,EAAE,OAAO;IA0B1B,MAAM;IAwCN,mBAAmB,GAAI,cAAc,MAAM,GAAG,IAAI,UAKhD;IAMF,aAAa,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;CAmB9D"}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { BackSide, ClampToEdgeWrapping, DoubleSide, FrontSide, MeshStandardMaterial, RepeatWrapping, Texture, Vector2, SRGBColorSpace, } from "three";
|
|
2
|
-
import { PPhysicalMaterial as PPhysicalMaterialBase } from "@p100-web/core";
|
|
3
|
-
import { FileSubType } from "@p100-web/core";
|
|
4
|
-
export default class PPhysicalMaterial extends PPhysicalMaterialBase {
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this._material = null;
|
|
8
|
-
this._cacheKey = 0;
|
|
9
|
-
//
|
|
10
|
-
// Event Callbacks
|
|
11
|
-
//
|
|
12
|
-
this.callback_setOpacity = (payloadValue) => {
|
|
13
|
-
if (this._material && payloadValue) {
|
|
14
|
-
const opacity = parseFloat(payloadValue);
|
|
15
|
-
this._material.opacity = opacity;
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
setTextureRepeat() {
|
|
20
|
-
const texture = this._material?.map || null;
|
|
21
|
-
if (texture !== null) {
|
|
22
|
-
texture.wrapS = this.repeat.x > 1 ? RepeatWrapping : ClampToEdgeWrapping;
|
|
23
|
-
texture.wrapT = this.repeat.y > 1 ? RepeatWrapping : ClampToEdgeWrapping;
|
|
24
|
-
texture.repeat = new Vector2(this.repeat.x || 1, this.repeat.y || 1);
|
|
25
|
-
texture.offset = new Vector2(this.offset.x, this.offset.y);
|
|
26
|
-
if (this._material)
|
|
27
|
-
this._material.needsUpdate = true;
|
|
28
|
-
texture.needsUpdate = true;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
//
|
|
32
|
-
// PComponent
|
|
33
|
-
//
|
|
34
|
-
_dispose(unrender) {
|
|
35
|
-
if (this.file_texture) {
|
|
36
|
-
this.context
|
|
37
|
-
.imageLoader()
|
|
38
|
-
.disposeImage(this, this.file_texture, this._cacheKey);
|
|
39
|
-
this._cacheKey = 0;
|
|
40
|
-
}
|
|
41
|
-
// Check if we should dispose Material
|
|
42
|
-
if (this._material) {
|
|
43
|
-
// Do we have a texture as well?
|
|
44
|
-
if (this._material.map) {
|
|
45
|
-
this._material.map.dispose();
|
|
46
|
-
this._material.map = null;
|
|
47
|
-
}
|
|
48
|
-
this._material.needsUpdate = true;
|
|
49
|
-
// Dispose material
|
|
50
|
-
if (unrender) {
|
|
51
|
-
this._material.dispose();
|
|
52
|
-
this._material = null;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
render() {
|
|
57
|
-
if (!this.node.hasEl()) {
|
|
58
|
-
this.context.error("Material is missing Mesh");
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
const material = new MeshStandardMaterial({
|
|
62
|
-
color: this.color,
|
|
63
|
-
map: null,
|
|
64
|
-
side: this.inverted ? BackSide : FrontSide,
|
|
65
|
-
opacity: this.opacity,
|
|
66
|
-
transparent: this.transparent,
|
|
67
|
-
fog: false,
|
|
68
|
-
shadowSide: DoubleSide,
|
|
69
|
-
wireframe: false,
|
|
70
|
-
alphaTest: this.alphaTest,
|
|
71
|
-
metalness: this.metalness,
|
|
72
|
-
roughness: this.roughness,
|
|
73
|
-
});
|
|
74
|
-
this._material = material;
|
|
75
|
-
const mesh = this.node.getEl();
|
|
76
|
-
mesh.material = material;
|
|
77
|
-
if (this.inverted) {
|
|
78
|
-
mesh.scale.x = mesh.scale.x * -1;
|
|
79
|
-
}
|
|
80
|
-
mesh.renderOrder = this.renderOrder;
|
|
81
|
-
if (this.file_texture !== null) {
|
|
82
|
-
this.context.imageLoader().load(this, this.file_texture);
|
|
83
|
-
}
|
|
84
|
-
material.needsUpdate = true;
|
|
85
|
-
}
|
|
86
|
-
//
|
|
87
|
-
// IImageLoader
|
|
88
|
-
//
|
|
89
|
-
onImageLoaded(file, data, cacheKey) {
|
|
90
|
-
this._cacheKey = cacheKey;
|
|
91
|
-
if (this._material === null) {
|
|
92
|
-
this.context.error("onImageLoaded and material was null");
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
const texture = new Texture();
|
|
96
|
-
texture.userData.id = file._id;
|
|
97
|
-
texture.colorSpace = SRGBColorSpace;
|
|
98
|
-
texture.image = data;
|
|
99
|
-
if (file.subType === FileSubType.Stereo)
|
|
100
|
-
texture.repeat = new Vector2(1, 0.5);
|
|
101
|
-
this._material.map = texture;
|
|
102
|
-
this.setTextureRepeat();
|
|
103
|
-
this._material.needsUpdate = true;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
//# sourceMappingURL=PPhysicalMaterial.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PPhysicalMaterial.js","sourceRoot":"","sources":["../../../src/pcomponents/PPhysicalMaterial.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,mBAAmB,EACnB,UAAU,EACV,SAAS,EAET,oBAAoB,EACpB,cAAc,EACd,OAAO,EACP,OAAO,EACP,cAAc,GACf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,iBAAiB,IAAI,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAuB,MAAM,gBAAgB,CAAC;AAElE,MAAM,CAAC,OAAO,OAAO,iBACnB,SAAQ,qBAAqB;IAD/B;;QAIY,cAAS,GAAgC,IAAI,CAAC;QACxD,cAAS,GAAG,CAAC,CAAC;QAgFd,EAAE;QACF,mBAAmB;QACnB,EAAE;QAEF,wBAAmB,GAAG,CAAC,YAA2B,EAAE,EAAE;YACpD,IAAI,IAAI,CAAC,SAAS,IAAI,YAAY,EAAE,CAAC;gBACnC,MAAM,OAAO,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;gBACzC,IAAI,CAAC,SAAS,CAAC,OAAO,GAAG,OAAO,CAAC;YACnC,CAAC;QACH,CAAC,CAAC;IAyBJ,CAAC;IAhHC,gBAAgB;QACd,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,EAAE,GAAG,IAAI,IAAI,CAAC;QAC5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AW,CAAC;QAEpC,IAAI,IAAI,CAAC,YAAY,KAAK,IAAI,EAAE,CAAC;YAC/B,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAC3D,CAAC;QAED,QAAQ,CAAC,WAAW,GAAG,IAAI,CAAC;IAC9B,CAAC;IAaD,EAAE;IACF,gBAAgB;IAChB,EAAE;IAEF,aAAa,CAAC,IAAW,EAAE,IAAS,EAAE,QAAgB;QACpD,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAE1B,IAAI,IAAI,CAAC,SAAS,KAAK,IAAI,EAAE,CAAC;YAC5B,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAC;YAC1D,OAAO;QACT,CAAC;QAED,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;QAC9B,OAAO,CAAC,QAAQ,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC;QAC/B,OAAO,CAAC,UAAU,GAAG,cAAc,CAAC;QACpC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;QACrB,IAAI,IAAI,CAAC,OAAO,KAAK,WAAW,CAAC,MAAM;YACrC,OAAO,CAAC,MAAM,GAAG,IAAI,OAAO,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QAEvC,IAAI,CAAC,SAAS,CAAC,GAAG,GAAG,OAAO,CAAC;QAC7B,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxB,IAAI,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC;IACpC,CAAC;CACF"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { PlaneGeometry } from "three";
|
|
2
|
-
import { PPlaneGeometry as PPlaneGeometryBase } from "@p100-web/core";
|
|
3
|
-
export default class PPlaneGeometry extends PPlaneGeometryBase {
|
|
4
|
-
el: PlaneGeometry | null;
|
|
5
|
-
unrender(): void;
|
|
6
|
-
render(): void;
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=PPlaneGeometry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PPlaneGeometry.d.ts","sourceRoot":"","sources":["../../../src/pcomponents/PPlaneGeometry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,aAAa,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,cAAc,IAAI,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEtE,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,kBAAkB;IAC5D,EAAE,EAAE,aAAa,GAAG,IAAI,CAAQ;IAEhC,QAAQ;IAOR,MAAM;CAaP"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Mesh, PlaneGeometry } from "three";
|
|
2
|
-
import { PPlaneGeometry as PPlaneGeometryBase } from "@p100-web/core";
|
|
3
|
-
export default class PPlaneGeometry extends PPlaneGeometryBase {
|
|
4
|
-
constructor() {
|
|
5
|
-
super(...arguments);
|
|
6
|
-
this.el = null;
|
|
7
|
-
}
|
|
8
|
-
unrender() {
|
|
9
|
-
if (this.el) {
|
|
10
|
-
this.el.dispose();
|
|
11
|
-
this.el = null;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
render() {
|
|
15
|
-
const geometry = new PlaneGeometry(this.size.x, this.size.y, this.segments.x, this.segments.y);
|
|
16
|
-
const mesh = new Mesh(geometry);
|
|
17
|
-
mesh.castShadow = this.castShadow;
|
|
18
|
-
mesh.receiveShadow = this.receiveShadow;
|
|
19
|
-
this.node.set_el(mesh, false);
|
|
20
|
-
this.el = geometry;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=PPlaneGeometry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PPlaneGeometry.js","sourceRoot":"","sources":["../../../src/pcomponents/PPlaneGeometry.ts"],"names":[],"mappings":"AAAA,OAAO,EAA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0 @@
|
|
|
1
|
-
import { PProjectRoot as PProjectRootBase } from "@p100-web/core";
|
|
2
|
-
export default class PProjectRoot extends PProjectRootBase {
|
|
3
|
-
render() {
|
|
4
|
-
if (!this.node.hasEl()) {
|
|
5
|
-
const rootNode = this.context.getPCanvas().getThreeRootNode();
|
|
6
|
-
this.node.set_el(rootNode, true);
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
unrender() { }
|
|
10
|
-
play() {
|
|
11
|
-
const camera = this.context.getPCanvas().getThreeCamera();
|
|
12
|
-
// Audio
|
|
13
|
-
const audioListener = this.context.getAudioListener();
|
|
14
|
-
camera.add(audioListener);
|
|
15
|
-
if (this.enabled) {
|
|
16
|
-
this.context.enableInput();
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
stop() {
|
|
20
|
-
const audioListener = this.context.getAudioListener();
|
|
21
|
-
audioListener.removeFromParent();
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=PProjectRoot.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PProjectRoot.js","sourceRoot":"","sources":["../../../src/pcomponents/PProjectRoot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAIlE,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,gBAAgB;IACxD,MAAM;QACJ,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC;YACvB,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAW,CAAC,gBAAgB,EAAE,CAAC;YACvE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;IAED,QAAQ,KAAU,CAAC;IAEnB,IAAI;QACF,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAW,CAAC,cAAc,EAAE,CAAC;QAEnE,QAAQ;QACR,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAmB,CAAC;QACvE,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QAE1B,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;QAC7B,CAAC;IACH,CAAC;IAED,IAAI;QACF,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAmB,CAAC;QACvE,aAAa,CAAC,gBAAgB,EAAE,CAAC;IACnC,CAAC;CACF"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Mesh, Vector3 } from "three";
|
|
2
|
-
import { PSlider as PSliderBase, type IColliderComponent, type IColliderObject } from "@p100-web/core";
|
|
3
|
-
export default class PSlider extends PSliderBase implements IColliderComponent {
|
|
4
|
-
el: Mesh | null;
|
|
5
|
-
_width: number;
|
|
6
|
-
render(): void;
|
|
7
|
-
addColliderNode(): void;
|
|
8
|
-
getColliderObject(): IColliderObject | null;
|
|
9
|
-
unrender(): void;
|
|
10
|
-
computeBounds(): void;
|
|
11
|
-
private getPercent;
|
|
12
|
-
native_onHoverEnter: (point: Vector3) => void;
|
|
13
|
-
native_onHoverExit: () => void;
|
|
14
|
-
native_onClick: () => void;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=PSlider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PSlider.d.ts","sourceRoot":"","sources":["../../../src/pcomponents/PSlider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAY,OAAO,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EACL,OAAO,IAAI,WAAW,EACtB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACrB,MAAM,gBAAgB,CAAC;AAGxB,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,WAAY,YAAW,kBAAkB;IAC5E,EAAE,EAAE,IAAI,GAAG,IAAI,CAAQ;IACvB,MAAM,SAAO;IAEb,MAAM;IAWN,eAAe;IAcf,iBAAiB,IAAI,eAAe,GAAG,IAAI;IAI3C,QAAQ;IAUR,aAAa;IAcb,OAAO,CAAC,UAAU;IAKlB,mBAAmB,GAAI,OAAO,OAAO,UAInC;IAEF,kBAAkB,aAGhB;IAEF,cAAc,aAGZ;CACH"}
|