@realsee/five 6.0.0-alpha.70 → 6.0.0-alpha.71

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/umd/five-vfx.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * @license
3
3
  * @realsee/five
4
4
  * Generated: 12/20/2023
5
- * Version: 6.0.0-alpha.70
5
+ * Version: 6.0.0-alpha.71
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -252,288 +252,4 @@
252
252
  * No amendment to or modification of this Agreement will be binding unless in
253
253
  * writing and signed by Realsee. You and Realsee hereto confirm that this
254
254
  * Agreement and all related documents shall be drafted in English.
255
- */(function(h,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("three")):typeof define=="function"&&define.amd?define(["exports","three"],x):(h=typeof globalThis<"u"?globalThis:h||self,x(h.FiveSDK_VFX={},h.THREE))})(this,function(h,x){"use strict";function se(r){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const t=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(n,e,t.get?t:{enumerable:!0,get:()=>r[e]})}}return n.default=r,Object.freeze(n)}const i=se(x);var T=function(r,n){return T=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])},T(r,n)};function w(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");T(r,n);function e(){this.constructor=r}r.prototype=n===null?Object.create(n):(e.prototype=n.prototype,new e)}typeof SuppressedError=="function"&&SuppressedError;for(var ne=`
256
- uniform vec3 uColor1;
257
- uniform vec3 uColor2;
258
- uniform float uOpacity;
259
-
260
- varying vec3 vPosition;
261
- varying float vNoise;
262
-
263
- void main() {
264
- float alpha = 1.0;
265
- float gradient = mix(0.0, 1.0, -vPosition.y + 1.75);
266
- if(vNoise > 0.3 * gradient) {
267
- alpha = 0.0;
268
- }
269
- float mask = mix(0.3, 1.0, -vPosition.y + 0.5);
270
- alpha = clamp(alpha * (mask * 10.0), 0.0, 1.0);
271
- vec3 color = mix(uColor1, uColor2, -vPosition.y + 0.5);
272
- color.g = color.g * (1.0 + gradient * vNoise);
273
- gl_FragColor = vec4(color, alpha * uOpacity);
274
- }
275
- `,M=`
276
- // Simplex 4D Noise
277
- // by Ian McEwan, Ashima Arts
278
- //
279
- vec4 permute(vec4 x) {
280
- return mod((x * 34.0 + 1.0) * x, 289.0);
281
- }
282
- float permute(float x) {
283
- return floor( mod((x * 34.0 + 1.0) * x, 289.0) );
284
- }
285
- vec4 taylorInvSqrt(vec4 r) {
286
- return 1.79284291400159 - 0.85373472095314 * r;
287
- }
288
- float taylorInvSqrt(float r) {
289
- return 1.79284291400159 - 0.85373472095314 * r;
290
- }
291
-
292
- vec4 grad4(float j, vec4 ip) {
293
- const vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);
294
- vec4 p,s;
295
-
296
- p.xyz = floor( fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;
297
- p.w = 1.5 - dot(abs(p.xyz), ones.xyz);
298
- s = vec4(lessThan(p, vec4(0.0)));
299
- p.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;
300
-
301
- return p;
302
- }
303
-
304
- float simplexNoise(vec4 v) {
305
- const vec2 C = vec2( 0.138196601125010504, // (5 - sqrt(5))/20 G4
306
- 0.309016994374947451); // (sqrt(5) - 1)/4 F4
307
- // First corner
308
- vec4 i = floor(v + dot(v, C.yyyy) );
309
- vec4 x0 = v - i + dot(i, C.xxxx);
310
-
311
- // Other corners
312
-
313
- // Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI)
314
- vec4 i0;
315
-
316
- vec3 isX = step( x0.yzw, x0.xxx );
317
- vec3 isYZ = step( x0.zww, x0.yyz );
318
-
319
- // i0.x = dot( isX, vec3( 1.0 ) );
320
- i0.x = isX.x + isX.y + isX.z;
321
- i0.yzw = 1.0 - isX;
322
-
323
- // i0.y += dot( isYZ.xy, vec2( 1.0 ) );
324
- i0.y += isYZ.x + isYZ.y;
325
- i0.zw += 1.0 - isYZ.xy;
326
-
327
- i0.z += isYZ.z;
328
- i0.w += 1.0 - isYZ.z;
329
-
330
- // i0 now contains the unique values 0,1,2,3 in each channel
331
- vec4 i3 = clamp( i0, 0.0, 1.0 );
332
- vec4 i2 = clamp( i0-1.0, 0.0, 1.0 );
333
- vec4 i1 = clamp( i0-2.0, 0.0, 1.0 );
334
-
335
- // x0 = x0 - 0.0 + 0.0 * C
336
- vec4 x1 = x0 - i1 + 1.0 * C.xxxx;
337
- vec4 x2 = x0 - i2 + 2.0 * C.xxxx;
338
- vec4 x3 = x0 - i3 + 3.0 * C.xxxx;
339
- vec4 x4 = x0 - 1.0 + 4.0 * C.xxxx;
340
-
341
- // Permutations
342
- i = mod(i, 289.0);
343
- float j0 = permute( permute( permute( permute(i.w) + i.z) + i.y) + i.x);
344
- vec4 j1 = permute( permute( permute( permute (
345
- i.w + vec4(i1.w, i2.w, i3.w, 1.0 ))
346
- + i.z + vec4(i1.z, i2.z, i3.z, 1.0 ))
347
- + i.y + vec4(i1.y, i2.y, i3.y, 1.0 ))
348
- + i.x + vec4(i1.x, i2.x, i3.x, 1.0 ));
349
-
350
- // Gradients
351
- // ( 7*7*6 points uniformly over a cube, mapped onto a 4-octahedron.)
352
- // 7*7*6 = 294, which is close to the ring size 17*17 = 289.
353
-
354
- vec4 ip = vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ;
355
-
356
- vec4 p0 = grad4(j0, ip);
357
- vec4 p1 = grad4(j1.x, ip);
358
- vec4 p2 = grad4(j1.y, ip);
359
- vec4 p3 = grad4(j1.z, ip);
360
- vec4 p4 = grad4(j1.w, ip);
361
-
362
- // Normalise gradients
363
- vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));
364
- p0 *= norm.x;
365
- p1 *= norm.y;
366
- p2 *= norm.z;
367
- p3 *= norm.w;
368
- p4 *= taylorInvSqrt(dot(p4,p4));
369
-
370
- // Mix contributions from the five corners
371
- vec3 m0 = max(0.6 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.0);
372
- vec2 m1 = max(0.6 - vec2(dot(x3,x3), dot(x4,x4) ), 0.0);
373
- m0 = m0 * m0;
374
- m1 = m1 * m1;
375
- return 49.0 * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 )))
376
- + dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ;
377
-
378
- }
379
- `,E=`
380
- float scale(float value, float fromMin, float fromMax, float toMin, float toMax) {
381
- return toMin + (value - fromMin) * (toMax - toMin) / (fromMax - fromMin);
382
- }
383
- `,ie=`
384
- uniform float uTime;
385
- uniform float uNoise;
386
- uniform float uSpeed;
387
-
388
- varying vec3 vPosition;
389
- varying float vNoise;
390
-
391
- `.concat(M,`
392
- `).concat(E,`
393
-
394
- float fbm(vec4 x) {
395
- float v = 0.0;
396
- float a = 0.5;
397
- vec4 shift = vec4(100.0);
398
- #pragma unroll_loop_start
399
- for ( int i = 0; i < FRAGMENTATION_DEGREE; i ++ ) {
400
- v += a * simplexNoise(x);
401
- x = x * 2.0 + shift;
402
- a *= 0.5;
403
- }
404
- #pragma unroll_loop_end
405
- return v;
406
- }
407
-
408
- void main() {
409
- vPosition = position;
410
- vNoise = fbm(vec4((position / uNoise) - vec3(0.0, uTime * uSpeed, 0.0), 0.0));
411
- vNoise = scale(vNoise, -1.0, 1.0, 0.0, 1.0);
412
-
413
- gl_Position = projectionMatrix * modelViewMatrix * vec4(vPosition, 1.0);
414
- }
415
- `),le=new i.SphereBufferGeometry(1,300,300),re=[],A=0;A<2;A++)re.push(new i.Vector2(Math.sin(A)/2+1,A*2-.8));var ue=new i.LatheBufferGeometry(re,300),ce=function(r){w(n,r);function n(e){var t=r.call(this)||this;t.needsRender=!0;var o;if(e instanceof i.BufferGeometry)o=e;else switch(e){case"ring":o=ue;break;case"circle":default:o=le;break}t.uniforms={uTime:{value:0},uColor1:{value:new i.Color("rgb(255, 177, 20)")},uColor2:{value:new i.Color("rgb(255, 0, 0)")},uNoise:{value:1.2},uSpeed:{value:1},uOpacity:{value:1}},t.defines={FRAGMENTATION_DEGREE:2};var s=new i.Mesh(o,new i.ShaderMaterial({uniforms:t.uniforms,defines:t.defines,vertexShader:ie,fragmentShader:ne,transparent:!0,depthWrite:!1,side:i.BackSide})),a=new i.Mesh(o,new i.ShaderMaterial({uniforms:t.uniforms,defines:t.defines,vertexShader:ie,fragmentShader:ne,transparent:!0,depthWrite:!1,side:i.FrontSide}));return s.scale.setScalar(.1),a.scale.setScalar(.1),t.add(s),t.add(a),t}return n.prototype.setTime=function(e){this.startTime===void 0&&(this.startTime=e),this.uniforms.uTime.value=(e-this.startTime)/1e3,this.needsRender=!0},Object.defineProperty(n.prototype,"color1",{get:function(){return this.uniforms.uColor1.value},set:function(e){this.uniforms.uColor1.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"color2",{get:function(){return this.uniforms.uColor2.value},set:function(e){this.uniforms.uColor2.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"speed",{get:function(){return this.uniforms.uSpeed.value},set:function(e){this.uniforms.uSpeed.value=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"noise",{get:function(){return this.uniforms.uSpeed.value},set:function(e){this.uniforms.uSpeed.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"opacity",{get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.uOpacity.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"fragmentationDegree",{get:function(){return this.defines.FRAGMENTATION_DEGREE},set:function(e){this.defines.FRAGMENTATION_DEGREE=e,this.traverse(function(t){t instanceof i.Mesh&&t.material instanceof i.ShaderMaterial&&(t.material.needsUpdate=!0)}),this.needsRender=!0},enumerable:!1,configurable:!0}),n}(i.Group),de=`
416
- uniform vec3 uLightColor;
417
- uniform vec3 uSpotPosition;
418
- uniform float uAttenuation;
419
- uniform float uAnglePower;
420
-
421
- varying vec3 vNormal;
422
- varying vec3 vWorldPosition;
423
- varying float vNoise;
424
-
425
- void main() {
426
- float intensity;
427
- intensity = distance(vWorldPosition, uSpotPosition) / uAttenuation;
428
- intensity = 1.0 - clamp(intensity, 0.1, 1.0);
429
-
430
- vec3 normal = vec3(vNormal.x, vNormal.y, abs(vNormal.z));
431
- float angleIntensity = pow( dot(normal, vec3(0.0, 0.0, 1.0)), uAnglePower * vNoise );
432
- intensity = intensity * angleIntensity * vNoise;
433
- gl_FragColor = vec4( uLightColor, intensity );
434
- }
435
- `,ve=`
436
-
437
- uniform float uTime;
438
-
439
- varying vec3 vNormal;
440
- varying vec3 vWorldPosition;
441
- varying float vNoise;
442
-
443
- `.concat(M,`
444
- `).concat(E,`
445
-
446
- void main(){
447
-
448
- vNormal = normalize( normalMatrix * normal );
449
- vec4 worldPosition = modelMatrix * vec4( position, 1.0 );
450
- vWorldPosition = worldPosition.xyz;
451
- vNoise = simplexNoise(vec4(position - vec3(0.0, uTime * 0.4, 0.0), 0));
452
- vNoise = scale(vNoise, -1.0, 1.0, 0.5, 1.0);
453
-
454
- gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
455
- }
456
- `),pe=function(r){w(n,r);function n(e,t,o){e===void 0&&(e=1),t===void 0&&(t=.1),o===void 0&&(o=.2);var s=r.call(this)||this;s.needsRender=!0,s.uniforms={uTime:{value:0},uAttenuation:{value:e*.9},uAnglePower:{value:2},uSpotPosition:{value:s.position},uLightColor:{value:new i.Color(16777215)}};var a=new i.CylinderBufferGeometry(t,o,e,64,20,!0);a.applyMatrix4(new i.Matrix4().makeTranslation(0,-e/2,0)),a.applyMatrix4(new i.Matrix4().makeRotationX(-Math.PI/2));var l=new i.Mesh(a,new i.ShaderMaterial({uniforms:s.uniforms,vertexShader:ve,fragmentShader:de,transparent:!0,side:i.FrontSide,depthWrite:!1}));return s.add(l),s}return n.prototype.setTime=function(e){this.startTime===void 0&&(this.startTime=e),this.uniforms.uTime.value=(e-this.startTime)/1e3,this.needsRender=!0},Object.defineProperty(n.prototype,"attenuation",{get:function(){return this.uniforms.uAttenuation.value},set:function(e){this.uniforms.uAttenuation.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"anglePower",{get:function(){return this.uniforms.uAnglePower.value},set:function(e){this.uniforms.uAnglePower.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"color",{get:function(){return this.uniforms.uLightColor.value},set:function(e){this.uniforms.uLightColor.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),n}(i.Group),oe=`
457
- uniform vec3 uColor;
458
- uniform float uOpacity;
459
- varying vec3 vPosition;
460
- varying float vNoise;
461
-
462
- void main() {
463
- float gradient = mix(0.0, 1.0, 1.0 + vPosition.y);
464
- gl_FragColor = vec4(uColor, vNoise * gradient * uOpacity);
465
- }
466
- `,ae=`
467
-
468
- uniform float uTime;
469
- uniform float uSpeed;
470
- uniform float uScale;
471
- uniform float uExpand;
472
- varying float vNoise;
473
- varying vec3 vPosition;
474
-
475
- `.concat(M,`
476
- `).concat(E,`
477
-
478
- void main(){
479
-
480
- vPosition = position;
481
- vNoise = simplexNoise(vec4(position.x * uScale, position.y + uTime * uSpeed, 0.0, 0.0));
482
- vNoise = scale(vNoise, 0.0, 1.0, 0.5, 1.0);
483
-
484
- vec4 transformed = vec4( position, 1.0 );
485
- transformed.x = transformed.x * scale(abs(transformed.y), 0.0, 1.0, 1.0, uExpand);
486
-
487
- gl_Position = projectionMatrix * modelViewMatrix * transformed;
488
- }
489
- `),C=new i.PlaneBufferGeometry(1,1,200,200);C.translate(0,-.5,0);var fe=function(r){w(n,r);function n(){var e=r.call(this)||this;e.needsRender=!0;var t=e.outer=new i.Mesh(C,new i.ShaderMaterial({uniforms:{uTime:{value:0},uSpeed:{value:.75},uScale:{value:2},uExpand:{value:1.2},uColor:{value:new i.Color(.5,.5,.9)},uOpacity:{value:1}},vertexShader:ae,fragmentShader:oe,transparent:!0,side:i.DoubleSide,depthWrite:!1})),o=e.inner=new i.Mesh(C,new i.ShaderMaterial({uniforms:{uTime:{value:0},uSpeed:{value:2},uScale:{value:20},uExpand:{value:1.2},uColor:{value:new i.Color(1,1,1)},uOpacity:{value:.1}},vertexShader:ae,fragmentShader:oe,transparent:!0,side:i.DoubleSide,depthWrite:!1}));return t.rotateX(-Math.PI/2),o.rotateX(-Math.PI/2),e.add(t),e.add(o),e}return n.prototype.setTime=function(e){this.startTime===void 0&&(this.startTime=e);var t=(e-this.startTime)/1e3;this.inner.material.uniforms.uTime.value=t,this.outer.material.uniforms.uTime.value=t,this.needsRender=!0},Object.defineProperty(n.prototype,"expand",{get:function(){return this.outer.material.uniforms.uExpand.value},set:function(e){this.outer.material.uniforms.uExpand.value=e,this.inner.material.uniforms.uExpand.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"speed",{get:function(){return this.inner.material.uniforms.speed.value},set:function(e){this.inner.material.uniforms.speed.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"color",{get:function(){return this.outer.material.uniforms.color.value},set:function(e){this.outer.material.uniforms.color.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"flowColor",{get:function(){return this.inner.material.uniforms.color.value},set:function(e){this.inner.material.uniforms.color.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),n}(i.Group);function b(r,n){return r+n*(Math.random()-.5)}function _(r,n){var e=new i.Vector3(Math.random()-.5,Math.random()-.5,Math.random()-.5);return new i.Vector3().addVectors(r,new i.Vector3().multiplyVectors(n,e))}function P(r,n,e){return r*e+n*e*e/2}function he(r,n,e){return new i.Vector3(P(r.x,n.x,e),P(r.y,n.y,e),P(r.z,n.z,e))}function z(r,n){for(var e=r.times.length,t=0;t<e&&n>r.times[t];)t++;if(t==0)return r.values[0];if(t==e)return r.values[e-1];var o=(n-r.times[t-1])/(r.times[t]-r.times[t-1]),s=r.values[t-1],a=r.values[t];return typeof r.values[0]=="number"?s+o*(a-s):s.clone().lerp(a,o)}var me=function(){function r(n,e,t,o,s,a,l,u,d,v,p,c,f,y){this.birthTime=n,this.deathAge=e,this.position=t.clone(),this.velocity=o.clone(),this.acceleration=s.clone(),this.angle=a,this.angleVelocity=l,this.angleAcceleration=u,this.color=d,this.colorTween=v,this.size=p,this.sizeTween=c,this.opacity=f,this.opacityTween=y}return r.prototype.getAlive=function(n){return this.deathAge>n-this.birthTime},r.prototype.getState=function(n){var e=this.getAlive(n),t=Math.min(this.deathAge,n-this.birthTime),o=he(this.velocity,this.acceleration,t).add(this.position),s=P(this.angleVelocity,this.angleAcceleration,t)+this.angle,a=(this.sizeTween?z(this.sizeTween,t):0)+this.size,l=(this.colorTween?z(this.colorTween,t):new i.Vector3).add(this.color),u=new i.Color().setHSL(l.x,l.y,l.z),d=(this.opacityTween?z(this.opacityTween,t):0)+this.opacity;return{alive:e,age:t,position:o,angle:s,size:a,color:u,opacity:d}},r}(),ye=`
490
- attribute vec3 color;
491
- attribute float opacity;
492
- attribute float size;
493
- attribute float alive; // float used as boolean (0 = false, 1 = true)
494
-
495
- varying vec4 vColor;
496
-
497
- #if defined(USE_MAP)
498
- attribute float angle;
499
- varying float vAngle;
500
- #endif
501
-
502
- void main() {
503
- if (alive > 0.5) {
504
- vColor = vec4(color, opacity);
505
- } else {
506
- vColor = vec4(0.0, 0.0, 0.0, 0.0);
507
- }
508
- #if defined(USE_MAP)
509
- vAngle = angle;
510
- #endif
511
- vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
512
- gl_PointSize = size * ( 300.0 / length( mvPosition.xyz ) );
513
- gl_Position = projectionMatrix * mvPosition;
514
- }
515
- `,ge=`
516
- varying vec4 vColor;
517
-
518
- #if defined(USE_MAP)
519
- uniform sampler2D map;
520
- varying float vAngle;
521
- #endif
522
-
523
- void main() {
524
- gl_FragColor = vColor;
525
-
526
- #if defined(USE_MAP)
527
- float c = cos(vAngle);
528
- float s = sin(vAngle);
529
-
530
- // rotate UV coordinates to rotate texture
531
- vec2 rotatedUV = vec2(
532
- c * (gl_PointCoord.x - 0.5) + s * (gl_PointCoord.y - 0.5) + 0.5,
533
- c * (gl_PointCoord.y - 0.5) - s * (gl_PointCoord.x - 0.5) + 0.5
534
- );
535
- vec4 rotatedTexture = texture2D(map, rotatedUV);
536
- gl_FragColor = vColor * rotatedTexture;
537
- #endif
538
- }
539
- `,be=function(r){w(n,r);function n(e){var t=this,o,s,a,l,u,d,v,p,c,f,y,S,m,B,R,N,V,O,j,F,D,U,G,I,X,H,k,L,q,W,Y,Z,$,J,Q,K,ee,te,g=new i.BufferGeometry;g.setAttribute("position",new i.BufferAttribute(new Float32Array,3)),g.setAttribute("alive",new i.BufferAttribute(new Float32Array,1)),g.setAttribute("color",new i.BufferAttribute(new Float32Array,3)),g.setAttribute("opacity",new i.BufferAttribute(new Float32Array,1)),g.setAttribute("size",new i.BufferAttribute(new Float32Array,1)),g.setAttribute("angle",new i.BufferAttribute(new Float32Array,1));var xe=new i.ShaderMaterial({uniforms:{map:{value:(o=e.texture)!==null&&o!==void 0?o:null}},defines:{USE_MAP:!!e.texture},vertexShader:ye,fragmentShader:ge,transparent:!0,blending:(s=e.blending)!==null&&s!==void 0?s:i.NormalBlending,depthWrite:!1});return t=r.call(this,g,xe)||this,t.instances=[],t.needsRender=!0,t.birthTime=Date.now()/1e3,t.disposed=!1,t.paused=!1,t.positionBase=(l=(a=e.positionBase)===null||a===void 0?void 0:a.clone())!==null&&l!==void 0?l:new i.Vector3,t.positionStyle=(u=e.positionStyle)!==null&&u!==void 0?u:"CUBE",t.positionCubeSpread=(v=(d=e.positionCubeSpread)===null||d===void 0?void 0:d.clone())!==null&&v!==void 0?v:new i.Vector3,t.positionSphereSpread=(p=e.positionSphereSpread)!==null&&p!==void 0?p:0,t.velocityStyle=(c=e.velocityStyle)!==null&&c!==void 0?c:"CUBE",t.velocityCubeBase=(y=(f=e.velocityCubeBase)===null||f===void 0?void 0:f.clone())!==null&&y!==void 0?y:new i.Vector3,t.velocityCubeSpread=(m=(S=e.velocityCubeSpread)===null||S===void 0?void 0:S.clone())!==null&&m!==void 0?m:new i.Vector3,t.velocitySphereBase=(B=e.velocitySphereBase)!==null&&B!==void 0?B:0,t.velocitySphereSpread=(R=e.velocitySphereSpread)!==null&&R!==void 0?R:0,t.accelerationBase=(V=(N=e.accelerationBase)===null||N===void 0?void 0:N.clone())!==null&&V!==void 0?V:new i.Vector3,t.accelerationSpread=(j=(O=e.accelerationSpread)===null||O===void 0?void 0:O.clone())!==null&&j!==void 0?j:new i.Vector3,t.angleBase=(F=e.angleBase)!==null&&F!==void 0?F:0,t.angleSpread=(D=e.angleSpread)!==null&&D!==void 0?D:0,t.angleVelocityBase=(U=e.angleVelocityBase)!==null&&U!==void 0?U:0,t.angleVelocitySpread=(G=e.angleVelocitySpread)!==null&&G!==void 0?G:0,t.angleAccelerationBase=(I=e.angleAccelerationBase)!==null&&I!==void 0?I:0,t.angleAccelerationSpread=(X=e.angleAccelerationSpread)!==null&&X!==void 0?X:0,t.sizeBase=(H=e.sizeBase)!==null&&H!==void 0?H:.1,t.sizeSpread=(k=e.sizeSpread)!==null&&k!==void 0?k:0,t.sizeTween=(L=e.sizeTween)!==null&&L!==void 0?L:null,t.colorBase=(W=(q=e.colorBase)===null||q===void 0?void 0:q.clone())!==null&&W!==void 0?W:new i.Vector3,t.colorSpread=(Z=(Y=e.colorSpread)===null||Y===void 0?void 0:Y.clone())!==null&&Z!==void 0?Z:new i.Vector3,t.colorTween=($=e.colorTween)!==null&&$!==void 0?$:null,t.opacityBase=((J=e.opacityBase)!==null&&J!==void 0?J:e.opacityTween)?0:1,t.opacitySpread=(Q=e.opacitySpread)!==null&&Q!==void 0?Q:0,t.opacityTween=(K=e.opacityTween)!==null&&K!==void 0?K:null,t.particlesPerSecond=(ee=e.particlesPerSecond)!==null&&ee!==void 0?ee:60,t.particleDeathAge=(te=e.particleDeathAge)!==null&&te!==void 0?te:1,t}return Object.defineProperty(n.prototype,"texture",{get:function(){return this.material.uniforms.map.value},set:function(e){this.material.uniforms.map.value=e,e===null?this.material.defines.USE_MAP!==!1&&(this.material.defines.USE_MAP=!1,this.material.needsUpdate=!0):this.material.defines.USE_MAP!==!0&&(this.material.defines.USE_MAP=!0,this.material.needsUpdate=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"blending",{get:function(){return this.material.blending},set:function(e){this.material.blending=e},enumerable:!1,configurable:!0}),n.prototype.createInstance=function(e){var t=this.positionBase.clone();switch(this.positionStyle){case"CUBE":{t=_(this.positionBase,this.positionCubeSpread);break}case"SPHERE":{var o=2*Math.random()-1,s=Math.PI*2*Math.random(),a=Math.sqrt(1-o*o),l=new i.Vector3(a*Math.cos(s),a*Math.sin(s),o);t=new i.Vector3().addVectors(this.positionBase,l.multiplyScalar(this.positionSphereSpread));break}}var u=new i.Vector3;switch(this.velocityStyle){case"CUBE":{u=_(this.velocityCubeBase,this.velocityCubeSpread);break}case"SPHERE":{var d=new i.Vector3().subVectors(t,this.positionBase),v=b(this.velocitySphereBase,this.velocitySphereSpread);u=d.normalize().multiplyScalar(v);break}}var p=new me(e,this.particleDeathAge,t,u,_(this.accelerationBase,this.accelerationSpread),b(this.angleBase,this.angleSpread),b(this.angleVelocityBase,this.angleVelocitySpread),b(this.angleAccelerationBase,this.angleAccelerationSpread),_(this.colorBase,this.colorSpread),this.colorTween,b(this.sizeBase,this.sizeSpread),this.sizeTween,b(this.opacityBase,this.opacitySpread),this.opacityTween);return p},n.prototype.pause=function(){this.paused!==!0&&(this.paused=!0,this.birthTime=Date.now()/1e3)},n.prototype.play=function(){this.paused!==!1&&(this.paused=!1,this.birthTime=Date.now()/1e3)},n.prototype.setTime=function(e){if(!this.disposed){e/=1e3;var t=e-this.birthTime,o=Math.ceil(this.particlesPerSecond*this.particleDeathAge);if(this.geometry.attributes.position.count<o){var s=new Float32Array(o*3);s.set(this.geometry.attributes.position.array,0);var a=new i.BufferAttribute(s,3);a.needsUpdate=!0,this.geometry.setAttribute("position",a)}if(this.geometry.attributes.alive.count<o){var l=new Float32Array(o);l.set(this.geometry.attributes.alive.array,0);var a=new i.BufferAttribute(l,1);a.needsUpdate=!0,this.geometry.setAttribute("alive",a)}if(this.geometry.attributes.color.count<o){var u=new Float32Array(o*3);u.set(this.geometry.attributes.color.array,0);var a=new i.BufferAttribute(u,3);a.needsUpdate=!0,this.geometry.setAttribute("color",a)}if(this.geometry.attributes.opacity.count<o){var d=new Float32Array(o);d.set(this.geometry.attributes.opacity.array,0);var a=new i.BufferAttribute(d,1);a.needsUpdate=!0,this.geometry.setAttribute("opacity",a)}if(this.geometry.attributes.size.count<o){var v=new Float32Array(o);v.set(this.geometry.attributes.size.array,0);var a=new i.BufferAttribute(v,1);a.needsUpdate=!0,this.geometry.setAttribute("size",a)}if(this.geometry.attributes.angle.count<o){var p=new Float32Array(o);p.set(this.geometry.attributes.angle.array,0);var a=new i.BufferAttribute(p,1);a.needsUpdate=!0,this.geometry.setAttribute("angle",a)}this.instances.length<o&&(this.instances.length=o);for(var c=0;c<this.instances.length;c++){var f=this.instances[c];if(c<o&&this.paused===!1&&(f===void 0||f.getAlive(e)===!1)){var y=this.particleDeathAge/o*c;if(t>y){var S=e-(t-y)%this.particleDeathAge;this.instances[c]=f=this.createInstance(S)}}if(f){var m=f.getState(e),s=m.position,l=m.alive,u=m.color,d=m.opacity,v=m.size,p=m.angle;this.geometry.attributes.position.setXYZ(c,s.x,s.y,s.z),this.geometry.attributes.position.needsUpdate=!0,this.geometry.attributes.alive.setX(c,l?1:0),this.geometry.attributes.alive.needsUpdate=!0,this.geometry.attributes.color.setXYZ(c,u.r,u.g,u.b),this.geometry.attributes.color.needsUpdate=!0,this.geometry.attributes.opacity.setX(c,d),this.geometry.attributes.opacity.needsUpdate=!0,this.geometry.attributes.size.setX(c,v),this.geometry.attributes.size.needsUpdate=!0,this.geometry.attributes.angle.setX(c,p),this.geometry.attributes.angle.needsUpdate=!0}}this.geometry.computeBoundingBox(),this.geometry.boundingSphere||(this.geometry.boundingSphere=new i.Sphere),this.geometry.boundingBox.getBoundingSphere(this.geometry.boundingSphere),this.needsRender=!0}},n.prototype.dispose=function(){var e;this.disposed=!0,this.geometry.dispose(),(e=this.texture)===null||e===void 0||e.dispose(),this.material.dispose()},n}(i.Points);h.Airflow=fe,h.Flame=ce,h.Particle=be,h.SpotLight=pe,Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})});
255
+ */!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("three")):"function"==typeof define&&define.amd?define(["exports","three"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).FiveSDK_VFX={},e.THREE)}(this,(function(e,t){"use strict";function n(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const n in e)if("default"!==n){const i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:()=>e[n]})}return t.default=e,Object.freeze(t)}const i=n(t);var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}"function"==typeof SuppressedError&&SuppressedError;for(var a="\nuniform vec3 uColor1;\nuniform vec3 uColor2;\nuniform float uOpacity;\n\nvarying vec3 vPosition;\nvarying float vNoise;\n\nvoid main() {\n float alpha = 1.0;\n float gradient = mix(0.0, 1.0, -vPosition.y + 1.75);\n if(vNoise > 0.3 * gradient) {\n alpha = 0.0;\n }\n float mask = mix(0.3, 1.0, -vPosition.y + 0.5);\n alpha = clamp(alpha * (mask * 10.0), 0.0, 1.0);\n vec3 color = mix(uColor1, uColor2, -vPosition.y + 0.5);\n color.g = color.g * (1.0 + gradient * vNoise);\n gl_FragColor = vec4(color, alpha * uOpacity);\n}\n",s="\n// Simplex 4D Noise\n// by Ian McEwan, Ashima Arts\n//\nvec4 permute(vec4 x) {\n return mod((x * 34.0 + 1.0) * x, 289.0);\n}\nfloat permute(float x) {\n return floor( mod((x * 34.0 + 1.0) * x, 289.0) );\n}\nvec4 taylorInvSqrt(vec4 r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\nfloat taylorInvSqrt(float r) {\n return 1.79284291400159 - 0.85373472095314 * r;\n}\n\nvec4 grad4(float j, vec4 ip) {\n const vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);\n vec4 p,s;\n\n p.xyz = floor( fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;\n p.w = 1.5 - dot(abs(p.xyz), ones.xyz);\n s = vec4(lessThan(p, vec4(0.0)));\n p.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;\n\n return p;\n}\n\nfloat simplexNoise(vec4 v) {\n const vec2 C = vec2( 0.138196601125010504, // (5 - sqrt(5))/20 G4\n 0.309016994374947451); // (sqrt(5) - 1)/4 F4\n // First corner\n vec4 i = floor(v + dot(v, C.yyyy) );\n vec4 x0 = v - i + dot(i, C.xxxx);\n\n // Other corners\n\n // Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI)\n vec4 i0;\n\n vec3 isX = step( x0.yzw, x0.xxx );\n vec3 isYZ = step( x0.zww, x0.yyz );\n\n // i0.x = dot( isX, vec3( 1.0 ) );\n i0.x = isX.x + isX.y + isX.z;\n i0.yzw = 1.0 - isX;\n\n // i0.y += dot( isYZ.xy, vec2( 1.0 ) );\n i0.y += isYZ.x + isYZ.y;\n i0.zw += 1.0 - isYZ.xy;\n\n i0.z += isYZ.z;\n i0.w += 1.0 - isYZ.z;\n\n // i0 now contains the unique values 0,1,2,3 in each channel\n vec4 i3 = clamp( i0, 0.0, 1.0 );\n vec4 i2 = clamp( i0-1.0, 0.0, 1.0 );\n vec4 i1 = clamp( i0-2.0, 0.0, 1.0 );\n\n // x0 = x0 - 0.0 + 0.0 * C\n vec4 x1 = x0 - i1 + 1.0 * C.xxxx;\n vec4 x2 = x0 - i2 + 2.0 * C.xxxx;\n vec4 x3 = x0 - i3 + 3.0 * C.xxxx;\n vec4 x4 = x0 - 1.0 + 4.0 * C.xxxx;\n\n // Permutations\n i = mod(i, 289.0);\n float j0 = permute( permute( permute( permute(i.w) + i.z) + i.y) + i.x);\n vec4 j1 = permute( permute( permute( permute (\n i.w + vec4(i1.w, i2.w, i3.w, 1.0 ))\n + i.z + vec4(i1.z, i2.z, i3.z, 1.0 ))\n + i.y + vec4(i1.y, i2.y, i3.y, 1.0 ))\n + i.x + vec4(i1.x, i2.x, i3.x, 1.0 ));\n\n // Gradients\n // ( 7*7*6 points uniformly over a cube, mapped onto a 4-octahedron.)\n // 7*7*6 = 294, which is close to the ring size 17*17 = 289.\n\n vec4 ip = vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ;\n\n vec4 p0 = grad4(j0, ip);\n vec4 p1 = grad4(j1.x, ip);\n vec4 p2 = grad4(j1.y, ip);\n vec4 p3 = grad4(j1.z, ip);\n vec4 p4 = grad4(j1.w, ip);\n\n // Normalise gradients\n vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n p4 *= taylorInvSqrt(dot(p4,p4));\n\n // Mix contributions from the five corners\n vec3 m0 = max(0.6 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.0);\n vec2 m1 = max(0.6 - vec2(dot(x3,x3), dot(x4,x4) ), 0.0);\n m0 = m0 * m0;\n m1 = m1 * m1;\n return 49.0 * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 )))\n + dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ;\n\n}\n",l="\nfloat scale(float value, float fromMin, float fromMax, float toMin, float toMax) {\n return toMin + (value - fromMin) * (toMax - toMin) / (fromMax - fromMin);\n}\n",u="\nuniform float uTime;\nuniform float uNoise;\nuniform float uSpeed;\n\nvarying vec3 vPosition;\nvarying float vNoise;\n\n".concat(s,"\n").concat(l,"\n\nfloat fbm(vec4 x) {\n float v = 0.0;\n float a = 0.5;\n vec4 shift = vec4(100.0);\n #pragma unroll_loop_start\n for ( int i = 0; i < FRAGMENTATION_DEGREE; i ++ ) {\n v += a * simplexNoise(x);\n x = x * 2.0 + shift;\n a *= 0.5;\n }\n #pragma unroll_loop_end\n return v;\n}\n\nvoid main() {\n vPosition = position;\n vNoise = fbm(vec4((position / uNoise) - vec3(0.0, uTime * uSpeed, 0.0), 0.0));\n vNoise = scale(vNoise, -1.0, 1.0, 0.0, 1.0);\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4(vPosition, 1.0);\n}\n"),c=new i.SphereBufferGeometry(1,300,300),d=[],p=0;p<2;p++)d.push(new i.Vector2(Math.sin(p)/2+1,2*p-.8));var v=new i.LatheBufferGeometry(d,300),f=function(e){function t(t){var n,o=e.call(this)||this;if(o.needsRender=!0,t instanceof i.BufferGeometry)n=t;else if("ring"===t)n=v;else n=c;o.uniforms={uTime:{value:0},uColor1:{value:new i.Color("rgb(255, 177, 20)")},uColor2:{value:new i.Color("rgb(255, 0, 0)")},uNoise:{value:1.2},uSpeed:{value:1},uOpacity:{value:1}},o.defines={FRAGMENTATION_DEGREE:2};var r=new i.Mesh(n,new i.ShaderMaterial({uniforms:o.uniforms,defines:o.defines,vertexShader:u,fragmentShader:a,transparent:!0,depthWrite:!1,side:i.BackSide})),s=new i.Mesh(n,new i.ShaderMaterial({uniforms:o.uniforms,defines:o.defines,vertexShader:u,fragmentShader:a,transparent:!0,depthWrite:!1,side:i.FrontSide}));return r.scale.setScalar(.1),s.scale.setScalar(.1),o.add(r),o.add(s),o}return r(t,e),t.prototype.setTime=function(e){void 0===this.startTime&&(this.startTime=e),this.uniforms.uTime.value=(e-this.startTime)/1e3,this.needsRender=!0},Object.defineProperty(t.prototype,"color1",{get:function(){return this.uniforms.uColor1.value},set:function(e){this.uniforms.uColor1.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color2",{get:function(){return this.uniforms.uColor2.value},set:function(e){this.uniforms.uColor2.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"speed",{get:function(){return this.uniforms.uSpeed.value},set:function(e){this.uniforms.uSpeed.value=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"noise",{get:function(){return this.uniforms.uSpeed.value},set:function(e){this.uniforms.uSpeed.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"opacity",{get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.uOpacity.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fragmentationDegree",{get:function(){return this.defines.FRAGMENTATION_DEGREE},set:function(e){this.defines.FRAGMENTATION_DEGREE=e,this.traverse((function(e){e instanceof i.Mesh&&e.material instanceof i.ShaderMaterial&&(e.material.needsUpdate=!0)})),this.needsRender=!0},enumerable:!1,configurable:!0}),t}(i.Group),h="\n\nuniform float uTime;\n\nvarying vec3 vNormal;\nvarying vec3 vWorldPosition;\nvarying float vNoise;\n\n".concat(s,"\n").concat(l,"\n\nvoid main(){\n\n vNormal = normalize( normalMatrix * normal );\n vec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n vWorldPosition = worldPosition.xyz;\n vNoise = simplexNoise(vec4(position - vec3(0.0, uTime * 0.4, 0.0), 0));\n vNoise = scale(vNoise, -1.0, 1.0, 0.5, 1.0);\n\n gl_Position\t= projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n"),m=function(e){function t(t,n,o){void 0===t&&(t=1),void 0===n&&(n=.1),void 0===o&&(o=.2);var r=e.call(this)||this;r.needsRender=!0,r.uniforms={uTime:{value:0},uAttenuation:{value:.9*t},uAnglePower:{value:2},uSpotPosition:{value:r.position},uLightColor:{value:new i.Color(16777215)}};var a=new i.CylinderBufferGeometry(n,o,t,64,20,!0);a.applyMatrix4((new i.Matrix4).makeTranslation(0,-t/2,0)),a.applyMatrix4((new i.Matrix4).makeRotationX(-Math.PI/2));var s=new i.Mesh(a,new i.ShaderMaterial({uniforms:r.uniforms,vertexShader:h,fragmentShader:"\nuniform vec3 uLightColor;\nuniform vec3 uSpotPosition;\nuniform float uAttenuation;\nuniform float uAnglePower;\n\nvarying vec3 vNormal;\nvarying vec3 vWorldPosition;\nvarying float vNoise;\n\nvoid main() {\n float intensity;\n intensity\t= distance(vWorldPosition, uSpotPosition) / uAttenuation;\n intensity\t= 1.0 - clamp(intensity, 0.1, 1.0);\n\n vec3 normal = vec3(vNormal.x, vNormal.y, abs(vNormal.z));\n float angleIntensity = pow( dot(normal, vec3(0.0, 0.0, 1.0)), uAnglePower * vNoise );\n intensity\t= intensity * angleIntensity * vNoise;\n gl_FragColor = vec4( uLightColor, intensity );\n}\n",transparent:!0,side:i.FrontSide,depthWrite:!1}));return r.add(s),r}return r(t,e),t.prototype.setTime=function(e){void 0===this.startTime&&(this.startTime=e),this.uniforms.uTime.value=(e-this.startTime)/1e3,this.needsRender=!0},Object.defineProperty(t.prototype,"attenuation",{get:function(){return this.uniforms.uAttenuation.value},set:function(e){this.uniforms.uAttenuation.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"anglePower",{get:function(){return this.uniforms.uAnglePower.value},set:function(e){this.uniforms.uAnglePower.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.uniforms.uLightColor.value},set:function(e){this.uniforms.uLightColor.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),t}(i.Group),y="\nuniform vec3 uColor;\nuniform float uOpacity;\nvarying vec3 vPosition;\nvarying float vNoise;\n\nvoid main() {\n float gradient = mix(0.0, 1.0, 1.0 + vPosition.y);\n gl_FragColor = vec4(uColor, vNoise * gradient * uOpacity);\n}\n",g="\n\nuniform float uTime;\nuniform float uSpeed;\nuniform float uScale;\nuniform float uExpand;\nvarying float vNoise;\nvarying vec3 vPosition;\n\n".concat(s,"\n").concat(l,"\n\nvoid main(){\n\n vPosition = position;\n vNoise = simplexNoise(vec4(position.x * uScale, position.y + uTime * uSpeed, 0.0, 0.0));\n vNoise = scale(vNoise, 0.0, 1.0, 0.5, 1.0);\n\n vec4 transformed = vec4( position, 1.0 );\n transformed.x = transformed.x * scale(abs(transformed.y), 0.0, 1.0, 1.0, uExpand);\n\n gl_Position\t= projectionMatrix * modelViewMatrix * transformed;\n}\n"),b=new i.PlaneBufferGeometry(1,1,200,200);b.translate(0,-.5,0);var x=function(e){function t(){var t=e.call(this)||this;t.needsRender=!0;var n=t.outer=new i.Mesh(b,new i.ShaderMaterial({uniforms:{uTime:{value:0},uSpeed:{value:.75},uScale:{value:2},uExpand:{value:1.2},uColor:{value:new i.Color(.5,.5,.9)},uOpacity:{value:1}},vertexShader:g,fragmentShader:y,transparent:!0,side:i.DoubleSide,depthWrite:!1})),o=t.inner=new i.Mesh(b,new i.ShaderMaterial({uniforms:{uTime:{value:0},uSpeed:{value:2},uScale:{value:20},uExpand:{value:1.2},uColor:{value:new i.Color(1,1,1)},uOpacity:{value:.1}},vertexShader:g,fragmentShader:y,transparent:!0,side:i.DoubleSide,depthWrite:!1}));return n.rotateX(-Math.PI/2),o.rotateX(-Math.PI/2),t.add(n),t.add(o),t}return r(t,e),t.prototype.setTime=function(e){void 0===this.startTime&&(this.startTime=e);var t=(e-this.startTime)/1e3;this.inner.material.uniforms.uTime.value=t,this.outer.material.uniforms.uTime.value=t,this.needsRender=!0},Object.defineProperty(t.prototype,"expand",{get:function(){return this.outer.material.uniforms.uExpand.value},set:function(e){this.outer.material.uniforms.uExpand.value=e,this.inner.material.uniforms.uExpand.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"speed",{get:function(){return this.inner.material.uniforms.speed.value},set:function(e){this.inner.material.uniforms.speed.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.outer.material.uniforms.color.value},set:function(e){this.outer.material.uniforms.color.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"flowColor",{get:function(){return this.inner.material.uniforms.color.value},set:function(e){this.inner.material.uniforms.color.value=e,this.needsRender=!0},enumerable:!1,configurable:!0}),t}(i.Group);function w(e,t){return e+t*(Math.random()-.5)}function S(e,t){var n=new i.Vector3(Math.random()-.5,Math.random()-.5,Math.random()-.5);return(new i.Vector3).addVectors(e,(new i.Vector3).multiplyVectors(t,n))}function A(e,t,n){return e*n+t*n*n/2}function P(e,t){for(var n=e.times.length,i=0;i<n&&t>e.times[i];)i++;if(0==i)return e.values[0];if(i==n)return e.values[n-1];var o=(t-e.times[i-1])/(e.times[i]-e.times[i-1]),r=e.values[i-1],a=e.values[i];return"number"==typeof e.values[0]?r+o*(a-r):r.clone().lerp(a,o)}var T=function(){function e(e,t,n,i,o,r,a,s,l,u,c,d,p,v){this.birthTime=e,this.deathAge=t,this.position=n.clone(),this.velocity=i.clone(),this.acceleration=o.clone(),this.angle=r,this.angleVelocity=a,this.angleAcceleration=s,this.color=l,this.colorTween=u,this.size=c,this.sizeTween=d,this.opacity=p,this.opacityTween=v}return e.prototype.getAlive=function(e){return this.deathAge>e-this.birthTime},e.prototype.getState=function(e){var t=this.getAlive(e),n=Math.min(this.deathAge,e-this.birthTime),o=function(e,t,n){return new i.Vector3(A(e.x,t.x,n),A(e.y,t.y,n),A(e.z,t.z,n))}(this.velocity,this.acceleration,n).add(this.position),r=A(this.angleVelocity,this.angleAcceleration,n)+this.angle,a=(this.sizeTween?P(this.sizeTween,n):0)+this.size,s=(this.colorTween?P(this.colorTween,n):new i.Vector3).add(this.color);return{alive:t,age:n,position:o,angle:r,size:a,color:(new i.Color).setHSL(s.x,s.y,s.z),opacity:(this.opacityTween?P(this.opacityTween,n):0)+this.opacity}},e}(),M=function(e){function t(t){var n,o,r,a,s,l,u,c,d,p,v,f,h,m,y,g,b,x,w,S,A,P,T,M,C,B,z,E,N,_,O,V,j,R,U,F,D,G,I=this,X=new i.BufferGeometry;X.setAttribute("position",new i.BufferAttribute(new Float32Array,3)),X.setAttribute("alive",new i.BufferAttribute(new Float32Array,1)),X.setAttribute("color",new i.BufferAttribute(new Float32Array,3)),X.setAttribute("opacity",new i.BufferAttribute(new Float32Array,1)),X.setAttribute("size",new i.BufferAttribute(new Float32Array,1)),X.setAttribute("angle",new i.BufferAttribute(new Float32Array,1));var W=new i.ShaderMaterial({uniforms:{map:{value:null!==(n=t.texture)&&void 0!==n?n:null}},defines:{USE_MAP:!!t.texture},vertexShader:"\nattribute vec3 color;\nattribute float opacity;\nattribute float size;\nattribute float alive; // float used as boolean (0 = false, 1 = true)\n\nvarying vec4 vColor;\n\n#if defined(USE_MAP)\n attribute float angle;\n varying float vAngle;\n#endif\n\nvoid main() {\n if (alive > 0.5) {\n vColor = vec4(color, opacity);\n } else {\n vColor = vec4(0.0, 0.0, 0.0, 0.0);\n }\n #if defined(USE_MAP)\n vAngle = angle;\n #endif\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n gl_PointSize = size * ( 300.0 / length( mvPosition.xyz ) );\n gl_Position = projectionMatrix * mvPosition;\n}\n",fragmentShader:"\nvarying vec4 vColor;\n\n#if defined(USE_MAP)\n uniform sampler2D map;\n varying float vAngle;\n#endif\n\nvoid main() {\n gl_FragColor = vColor;\n\n #if defined(USE_MAP)\n float c = cos(vAngle);\n float s = sin(vAngle);\n\n // rotate UV coordinates to rotate texture\n vec2 rotatedUV = vec2(\n c * (gl_PointCoord.x - 0.5) + s * (gl_PointCoord.y - 0.5) + 0.5,\n c * (gl_PointCoord.y - 0.5) - s * (gl_PointCoord.x - 0.5) + 0.5\n );\n vec4 rotatedTexture = texture2D(map, rotatedUV);\n gl_FragColor = vColor * rotatedTexture;\n #endif\n}\n",transparent:!0,blending:null!==(o=t.blending)&&void 0!==o?o:i.NormalBlending,depthWrite:!1});return(I=e.call(this,X,W)||this).instances=[],I.needsRender=!0,I.birthTime=Date.now()/1e3,I.disposed=!1,I.paused=!1,I.positionBase=null!==(a=null===(r=t.positionBase)||void 0===r?void 0:r.clone())&&void 0!==a?a:new i.Vector3,I.positionStyle=null!==(s=t.positionStyle)&&void 0!==s?s:"CUBE",I.positionCubeSpread=null!==(u=null===(l=t.positionCubeSpread)||void 0===l?void 0:l.clone())&&void 0!==u?u:new i.Vector3,I.positionSphereSpread=null!==(c=t.positionSphereSpread)&&void 0!==c?c:0,I.velocityStyle=null!==(d=t.velocityStyle)&&void 0!==d?d:"CUBE",I.velocityCubeBase=null!==(v=null===(p=t.velocityCubeBase)||void 0===p?void 0:p.clone())&&void 0!==v?v:new i.Vector3,I.velocityCubeSpread=null!==(h=null===(f=t.velocityCubeSpread)||void 0===f?void 0:f.clone())&&void 0!==h?h:new i.Vector3,I.velocitySphereBase=null!==(m=t.velocitySphereBase)&&void 0!==m?m:0,I.velocitySphereSpread=null!==(y=t.velocitySphereSpread)&&void 0!==y?y:0,I.accelerationBase=null!==(b=null===(g=t.accelerationBase)||void 0===g?void 0:g.clone())&&void 0!==b?b:new i.Vector3,I.accelerationSpread=null!==(w=null===(x=t.accelerationSpread)||void 0===x?void 0:x.clone())&&void 0!==w?w:new i.Vector3,I.angleBase=null!==(S=t.angleBase)&&void 0!==S?S:0,I.angleSpread=null!==(A=t.angleSpread)&&void 0!==A?A:0,I.angleVelocityBase=null!==(P=t.angleVelocityBase)&&void 0!==P?P:0,I.angleVelocitySpread=null!==(T=t.angleVelocitySpread)&&void 0!==T?T:0,I.angleAccelerationBase=null!==(M=t.angleAccelerationBase)&&void 0!==M?M:0,I.angleAccelerationSpread=null!==(C=t.angleAccelerationSpread)&&void 0!==C?C:0,I.sizeBase=null!==(B=t.sizeBase)&&void 0!==B?B:.1,I.sizeSpread=null!==(z=t.sizeSpread)&&void 0!==z?z:0,I.sizeTween=null!==(E=t.sizeTween)&&void 0!==E?E:null,I.colorBase=null!==(_=null===(N=t.colorBase)||void 0===N?void 0:N.clone())&&void 0!==_?_:new i.Vector3,I.colorSpread=null!==(V=null===(O=t.colorSpread)||void 0===O?void 0:O.clone())&&void 0!==V?V:new i.Vector3,I.colorTween=null!==(j=t.colorTween)&&void 0!==j?j:null,I.opacityBase=(null!==(R=t.opacityBase)&&void 0!==R?R:t.opacityTween)?0:1,I.opacitySpread=null!==(U=t.opacitySpread)&&void 0!==U?U:0,I.opacityTween=null!==(F=t.opacityTween)&&void 0!==F?F:null,I.particlesPerSecond=null!==(D=t.particlesPerSecond)&&void 0!==D?D:60,I.particleDeathAge=null!==(G=t.particleDeathAge)&&void 0!==G?G:1,I}return r(t,e),Object.defineProperty(t.prototype,"texture",{get:function(){return this.material.uniforms.map.value},set:function(e){this.material.uniforms.map.value=e,null===e?!1!==this.material.defines.USE_MAP&&(this.material.defines.USE_MAP=!1,this.material.needsUpdate=!0):!0!==this.material.defines.USE_MAP&&(this.material.defines.USE_MAP=!0,this.material.needsUpdate=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"blending",{get:function(){return this.material.blending},set:function(e){this.material.blending=e},enumerable:!1,configurable:!0}),t.prototype.createInstance=function(e){var t=this.positionBase.clone();switch(this.positionStyle){case"CUBE":t=S(this.positionBase,this.positionCubeSpread);break;case"SPHERE":var n=2*Math.random()-1,o=2*Math.PI*Math.random(),r=Math.sqrt(1-n*n),a=new i.Vector3(r*Math.cos(o),r*Math.sin(o),n);t=(new i.Vector3).addVectors(this.positionBase,a.multiplyScalar(this.positionSphereSpread))}var s=new i.Vector3;switch(this.velocityStyle){case"CUBE":s=S(this.velocityCubeBase,this.velocityCubeSpread);break;case"SPHERE":var l=(new i.Vector3).subVectors(t,this.positionBase),u=w(this.velocitySphereBase,this.velocitySphereSpread);s=l.normalize().multiplyScalar(u)}return new T(e,this.particleDeathAge,t,s,S(this.accelerationBase,this.accelerationSpread),w(this.angleBase,this.angleSpread),w(this.angleVelocityBase,this.angleVelocitySpread),w(this.angleAccelerationBase,this.angleAccelerationSpread),S(this.colorBase,this.colorSpread),this.colorTween,w(this.sizeBase,this.sizeSpread),this.sizeTween,w(this.opacityBase,this.opacitySpread),this.opacityTween)},t.prototype.pause=function(){!0!==this.paused&&(this.paused=!0,this.birthTime=Date.now()/1e3)},t.prototype.play=function(){!1!==this.paused&&(this.paused=!1,this.birthTime=Date.now()/1e3)},t.prototype.setTime=function(e){if(!this.disposed){var t,n=(e/=1e3)-this.birthTime,o=Math.ceil(this.particlesPerSecond*this.particleDeathAge);if(this.geometry.attributes.position.count<o)(c=new Float32Array(3*o)).set(this.geometry.attributes.position.array,0),(t=new i.BufferAttribute(c,3)).needsUpdate=!0,this.geometry.setAttribute("position",t);if(this.geometry.attributes.alive.count<o)(d=new Float32Array(o)).set(this.geometry.attributes.alive.array,0),(t=new i.BufferAttribute(d,1)).needsUpdate=!0,this.geometry.setAttribute("alive",t);if(this.geometry.attributes.color.count<o)(p=new Float32Array(3*o)).set(this.geometry.attributes.color.array,0),(t=new i.BufferAttribute(p,3)).needsUpdate=!0,this.geometry.setAttribute("color",t);if(this.geometry.attributes.opacity.count<o)(v=new Float32Array(o)).set(this.geometry.attributes.opacity.array,0),(t=new i.BufferAttribute(v,1)).needsUpdate=!0,this.geometry.setAttribute("opacity",t);if(this.geometry.attributes.size.count<o)(f=new Float32Array(o)).set(this.geometry.attributes.size.array,0),(t=new i.BufferAttribute(f,1)).needsUpdate=!0,this.geometry.setAttribute("size",t);if(this.geometry.attributes.angle.count<o)(h=new Float32Array(o)).set(this.geometry.attributes.angle.array,0),(t=new i.BufferAttribute(h,1)).needsUpdate=!0,this.geometry.setAttribute("angle",t);this.instances.length<o&&(this.instances.length=o);for(var r=0;r<this.instances.length;r++){var a=this.instances[r];if(r<o&&!1===this.paused&&(void 0===a||!1===a.getAlive(e))){var s=this.particleDeathAge/o*r;if(n>s){var l=e-(n-s)%this.particleDeathAge;this.instances[r]=a=this.createInstance(l)}}if(a){var u=a.getState(e),c=u.position,d=u.alive,p=u.color,v=u.opacity,f=u.size,h=u.angle;this.geometry.attributes.position.setXYZ(r,c.x,c.y,c.z),this.geometry.attributes.position.needsUpdate=!0,this.geometry.attributes.alive.setX(r,d?1:0),this.geometry.attributes.alive.needsUpdate=!0,this.geometry.attributes.color.setXYZ(r,p.r,p.g,p.b),this.geometry.attributes.color.needsUpdate=!0,this.geometry.attributes.opacity.setX(r,v),this.geometry.attributes.opacity.needsUpdate=!0,this.geometry.attributes.size.setX(r,f),this.geometry.attributes.size.needsUpdate=!0,this.geometry.attributes.angle.setX(r,h),this.geometry.attributes.angle.needsUpdate=!0}}this.geometry.computeBoundingBox(),this.geometry.boundingSphere||(this.geometry.boundingSphere=new i.Sphere),this.geometry.boundingBox.getBoundingSphere(this.geometry.boundingSphere),this.needsRender=!0}},t.prototype.dispose=function(){var e;this.disposed=!0,this.geometry.dispose(),null===(e=this.texture)||void 0===e||e.dispose(),this.material.dispose()},t}(i.Points);e.Airflow=x,e.Flame=f,e.Particle=M,e.SpotLight=m,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
package/umd/five-vue.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * @license
3
3
  * @realsee/five
4
4
  * Generated: 12/20/2023
5
- * Version: 6.0.0-alpha.70
5
+ * Version: 6.0.0-alpha.71
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -252,4 +252,4 @@
252
252
  * No amendment to or modification of this Agreement will be binding unless in
253
253
  * writing and signed by Realsee. You and Realsee hereto confirm that this
254
254
  * Agreement and all related documents shall be drafted in English.
255
- */(function(f,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("@realsee/five"),require("three")):typeof define=="function"&&define.amd?define(["exports","vue","@realsee/five","three"],t):(f=typeof globalThis<"u"?globalThis:f||self,t(f.FiveSDK_Vue={},f.Vue,f.FiveSDK,f.THREE))})(this,function(f,t,m,b){"use strict";function R(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return n.default=e,Object.freeze(n)}const h=R(b);var d=function(){return d=Object.assign||function(n){for(var r,o=1,a=arguments.length;o<a;o++){r=arguments[o];for(var l in r)Object.prototype.hasOwnProperty.call(r,l)&&(n[l]=r[l])}return n},d.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;var w=!1;function k(e){w=e}var F=Symbol();function s(){var e=t.inject(F);if(!e)throw new Error("Inject five error!");return e}var j={display:"inline-block",overflow:"hidden"},E=t.defineComponent({props:{width:{type:Number,required:!0},height:{type:Number,required:!0}},setup:function(e){var n=t.toRef(e,"width"),r=t.toRef(e,"height"),o=s(),a=t.ref(null);return t.watch([n,r,a],function(){if(o.renderer&&a.value){if(o.renderer.domElement.parentNode!==null&&o.renderer.domElement.parentNode!==a.value)throw new Error("There are more than 2 fiveCanvas in this context.");o.renderer.domElement.parentNode!==a.value&&a.value.appendChild(o.renderer.domElement),o.camera.aspect=n.value/r.value,o.camera.updateProjectionMatrix(),o.renderer.setSize(n.value,r.value),o.needsRender=!0}}),function(){return t.h("div",{id:"five",style:d({width:"".concat(n.value,"px"),height:"".concat(r.value,"px")},j),ref:a})}}}),g=[];function O(e){var n=e===void 0?{}:e,r=n.backgroundColor,o=r===void 0?1579548:r,a=n.backgroundAlpha,l=a===void 0?1:a,u=n.pixelRatio,c=u===void 0?1:u;if(!(typeof window>"u")){var i=g.shift();return i||(i=new h.WebGLRenderer({antialias:!1,alpha:!0}),i.outputEncoding=h.sRGBEncoding),i.setPixelRatio(c),i.setClearColor(o,l),i.autoClear=!0,i}}function P(e){e&&g.indexOf(e)===-1&&g.push(e)}function B(e,n){var r=Array.isArray(e)?e:[e],o=Array.isArray(n)?n:[n];if(r.length!==o.length)return!1;for(var a=0;a<r.length;a++)if(r[a]!==o[a])return!1;return!0}var U=t.defineComponent({props:{works:Object,initialWorks:Object,initialState:Object,initialUserAction:Boolean,onWorksChange:Function,onStateChange:Function,onCurrentStateChange:Function,onError:Function,fiveInitArgs:{type:Object,default:function(){return{}}},style:Object},setup:function(e){var n,r=t.toRefs(e).works,o=m.getViewportScale(),a=o===1?window.devicePixelRatio:1,l=O({pixelRatio:a}),u=new m.Five(d({renderer:l},e.fiveInitArgs)),c=e.works||e.initialWorks;return c&&u.load(c,e.initialState,void 0,(n=e.initialUserAction)!==null&&n!==void 0?n:!0),k(!!e.works),r&&t.watch(r,function(i,v){i&&!B(i,u.works)&&u.load(i,e.initialState)}),t.onBeforeUnmount(function(){u&&(u.dispose(),P(u.renderer))}),u.on("load",function(){e.onWorksChange&&u.works&&e.onWorksChange(u==null?void 0:u.works)}),u.on("stateChange",function(i,v){e.onStateChange&&e.onStateChange(i,v)}),u.on("currentStateChange",function(i,v){e.onCurrentStateChange&&e.onCurrentStateChange(i,v)}),u.on("error",function(i){e.onError?e.onError(i):console.warn(i.message)}),t.provide(F,u),{five:t.shallowReadonly(u)}},render:function(){return t.h("div",{style:this.$props.style},this.$slots)}});function W(){var e=s(),n=t.ref(e.works),r=t.readonly(n),o=function(l,u,c,i){if(w)throw new Error("props 'work' is set in fiveProvider, if you need modify work internal, use 'initialWork' instead.");return e.load(l,u,c,i)},a=e.on("load",function(){n.value=e.works});return t.onBeforeUnmount(function(){a()}),[r,o]}function _(){var e=s(),n=t.ref(d({},e.state)),r=e.on("stateChange",function(a){Object.assign(n.value,d({},a))});t.onBeforeUnmount(function(){r()});var o=function(a,l,u){l===void 0&&(l=!1),u===void 0&&(u=!0);var c=typeof a=="function"?a(e.getCurrentState()):a;e.setState(c,l,u)};return[n,o]}function A(){var e=s(),n=t.ref(e.getCurrentState()),r=e.on("currentStateChange",function(){Object.assign(n.value,e.getCurrentState())});t.onBeforeUnmount(function(){r()});var o=function(a,l,u){var c=typeof a=="function"?a(e.getCurrentState()):a;e.setState(c,l,u)};return[n,o]}function I(){var e=s(),n=t.reactive(e.getCurrentState()),r=t.ref(e.works.getResolvedObserver(e.pano)),o=e.on("currentStateChange",function(){Object.assign(n,e.getCurrentState()),r.value=e.works.getResolvedObserver({workCode:n.workCode,panoIndex:n.panoIndex})});return t.onBeforeUnmount(function(){o()}),r}function V(e,n){var r=s(),o=r.on(e,n);t.onBeforeUnmount(function(){o()})}function D(){var e=s(),n=function(c,i){return e.updateCamera(c,i)},r=function(c,i,v,X,Y){return e.getPixels(c,i,v,X,Y)},o=function(c){return e.render(c)},a=function(){return e.needsRender=!0},l=function(c,i){return e.preloadPano(c,i)},u=function(c,i){return i===void 0&&(i=!1),e.project2d(c,i)};return{updateCamera:n,getPixels:r,render:o,needsRender:a,preloadPano:l,project2d:u}}function L(e,n){n===void 0&&(n=!1);var r=s(),o=t.ref(Symbol()),a=t.shallowRef(e?r.project2d(t.isRef(e)?e.value:e,n):null),l=r.on("cameraUpdate",function(){o.value=Symbol()});return t.onBeforeUnmount(function(){l()}),t.watch([o,e],function(){a.value=r.project2d(t.isRef(e)?e.value:e,n)}),a}function H(){return L}function p(e){var n=e.camera.getWorldDirection(new h.Vector3),r=new h.Raycaster(e.camera.position,n);return r}function M(){var e=s(),n=t.shallowRef(p(e)),r=e.on("cameraUpdate",function(){n.value=p(e)});return t.onBeforeUnmount(function(){r()}),n}function C(e){return e.camera.getWorldDirection(new h.Vector3)}function T(){var e=s(),n=t.shallowRef(C(e)),r=e.on("cameraUpdate",function(){n.value=C(e)});return t.onBeforeUnmount(function(){r()}),n}function q(e){var n=s(),r=t.shallowRef([]);return t.watch(e,function(){r.value=n.model.intersectRaycaster(t.isRef(e)?e.value:e)}),r}function N(){return q}function y(e){return e.model.empty?"Empty":"Loaded"}function K(){var e=s(),n=t.ref(y(e)),r=e.on("modelLoaded",function(){n.value=y(e)});return t.onBeforeUnmount(function(){r()}),n}function $(){var e=s(),n=t.ref(e.model.shownFloor),r=t.ref(e.model.floorLength),o=function(l){typeof l=="number"?e.model.show(l):e.model.show()},a=[];return a.push(e.on("modelShownFloorChange",function(){n.value=e.model.shownFloor})),a.push(e.on("modelLoaded",function(){r.value=e.model.floorLength})),t.onBeforeUnmount(function(){for(var l;l=a.shift();)l()}),[n,r,o]}function x(){var e=s(),n=t.ref(e.helperVisible),r=function(a){e.helperVisible=a},o=e.on("helpersVisibleChange",function(a){n.value=a});return t.onBeforeUnmount(function(){o()}),[n,r]}function z(){return s()}function S(e){return e.model.bounding.clone()}function G(){var e=s(),n=t.shallowRef(S(e)),r=e.on("modelLoaded",function(){n.value=S(e)});return t.onBeforeUnmount(function(){r()}),n}function J(){var e=s();return e.scene}function Q(){var e=s(),n=t.shallowRef(e.model),r=e.on("modelLoaded",function(){n.value=e.model});return t.onBeforeUnmount(function(){r()}),n}f.FiveCanvas=E,f.FiveProvider=U,f.unsafe__useFiveInject=z,f.useFiveAction=D,f.useFiveCameraDirection=T,f.useFiveCameraRaycaster=M,f.useFiveCurrentObserver=I,f.useFiveCurrentState=A,f.useFiveEventCallback=V,f.useFiveFloor=$,f.useFiveHelper=x,f.useFiveModel=Q,f.useFiveModelBounding=G,f.useFiveModelIntersectRaycaster=N,f.useFiveModelReadyState=K,f.useFiveProject2d=H,f.useFiveScene=J,f.useFiveState=_,f.useFiveWorks=W,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
255
+ */!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("vue"),require("@realsee/five"),require("three")):"function"==typeof define&&define.amd?define(["exports","vue","@realsee/five","three"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).FiveSDK_Vue={},e.Vue,e.FiveSDK,e.THREE)}(this,(function(e,n,t,r){"use strict";function o(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const t in e)if("default"!==t){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}return n.default=e,Object.freeze(n)}const i=o(r);var u=function(){return u=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},u.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;var a=!1;var f=Symbol();function c(){var e=n.inject(f);if(!e)throw new Error("Inject five error!");return e}var l={display:"inline-block",overflow:"hidden"},s=n.defineComponent({props:{width:{type:Number,required:!0},height:{type:Number,required:!0}},setup:function(e){var t=n.toRef(e,"width"),r=n.toRef(e,"height"),o=c(),i=n.ref(null);return n.watch([t,r,i],(function(){if(o.renderer&&i.value){if(null!==o.renderer.domElement.parentNode&&o.renderer.domElement.parentNode!==i.value)throw new Error("There are more than 2 fiveCanvas in this context.");o.renderer.domElement.parentNode!==i.value&&i.value.appendChild(o.renderer.domElement),o.camera.aspect=t.value/r.value,o.camera.updateProjectionMatrix(),o.renderer.setSize(t.value,r.value),o.needsRender=!0}})),function(){return n.h("div",{id:"five",style:u({width:"".concat(t.value,"px"),height:"".concat(r.value,"px")},l),ref:i})}}}),d=[];var v=n.defineComponent({props:{works:Object,initialWorks:Object,initialState:Object,initialUserAction:Boolean,onWorksChange:Function,onStateChange:Function,onCurrentStateChange:Function,onError:Function,fiveInitArgs:{type:Object,default:function(){return{}}},style:Object},setup:function(e){var r,o,c=n.toRefs(e).works,l=function(e){var n=void 0===e?{}:e,t=n.backgroundColor,r=void 0===t?1579548:t,o=n.backgroundAlpha,u=void 0===o?1:o,a=n.pixelRatio,f=void 0===a?1:a;if("undefined"!=typeof window){var c=d.shift();return c||((c=new i.WebGLRenderer({antialias:!1,alpha:!0})).outputEncoding=i.sRGBEncoding),c.setPixelRatio(f),c.setClearColor(r,u),c.autoClear=!0,c}}({pixelRatio:1===t.getViewportScale()?window.devicePixelRatio:1}),s=new t.Five(u({renderer:l},e.fiveInitArgs)),v=e.works||e.initialWorks;return v&&s.load(v,e.initialState,void 0,null===(r=e.initialUserAction)||void 0===r||r),o=!!e.works,a=o,c&&n.watch(c,(function(n,t){n&&!function(e,n){var t=Array.isArray(e)?e:[e],r=Array.isArray(n)?n:[n];if(t.length!==r.length)return!1;for(var o=0;o<t.length;o++)if(t[o]!==r[o])return!1;return!0}(n,s.works)&&s.load(n,e.initialState)})),n.onBeforeUnmount((function(){s&&(s.dispose(),function(e){e&&-1===d.indexOf(e)&&d.push(e)}(s.renderer))})),s.on("load",(function(){e.onWorksChange&&s.works&&e.onWorksChange(null==s?void 0:s.works)})),s.on("stateChange",(function(n,t){e.onStateChange&&e.onStateChange(n,t)})),s.on("currentStateChange",(function(n,t){e.onCurrentStateChange&&e.onCurrentStateChange(n,t)})),s.on("error",(function(n){e.onError?e.onError(n):console.warn(n.message)})),n.provide(f,s),{five:n.shallowReadonly(s)}},render:function(){return n.h("div",{style:this.$props.style},this.$slots)}});function p(e,t){void 0===t&&(t=!1);var r=c(),o=n.ref(Symbol()),i=n.shallowRef(e?r.project2d(n.isRef(e)?e.value:e,t):null),u=r.on("cameraUpdate",(function(){o.value=Symbol()}));return n.onBeforeUnmount((function(){u()})),n.watch([o,e],(function(){i.value=r.project2d(n.isRef(e)?e.value:e,t)})),i}function h(e){var n=e.camera.getWorldDirection(new i.Vector3);return new i.Raycaster(e.camera.position,n)}function m(e){return e.camera.getWorldDirection(new i.Vector3)}function g(e){var t=c(),r=n.shallowRef([]);return n.watch(e,(function(){r.value=t.model.intersectRaycaster(n.isRef(e)?e.value:e)})),r}function w(e){return e.model.empty?"Empty":"Loaded"}function y(e){return e.model.bounding.clone()}e.FiveCanvas=s,e.FiveProvider=v,e.unsafe__useFiveInject=function(){return c()},e.useFiveAction=function(){var e=c();return{updateCamera:function(n,t){return e.updateCamera(n,t)},getPixels:function(n,t,r,o,i){return e.getPixels(n,t,r,o,i)},render:function(n){return e.render(n)},needsRender:function(){return e.needsRender=!0},preloadPano:function(n,t){return e.preloadPano(n,t)},project2d:function(n,t){return void 0===t&&(t=!1),e.project2d(n,t)}}},e.useFiveCameraDirection=function(){var e=c(),t=n.shallowRef(m(e)),r=e.on("cameraUpdate",(function(){t.value=m(e)}));return n.onBeforeUnmount((function(){r()})),t},e.useFiveCameraRaycaster=function(){var e=c(),t=n.shallowRef(h(e)),r=e.on("cameraUpdate",(function(){t.value=h(e)}));return n.onBeforeUnmount((function(){r()})),t},e.useFiveCurrentObserver=function(){var e=c(),t=n.reactive(e.getCurrentState()),r=n.ref(e.works.getResolvedObserver(e.pano)),o=e.on("currentStateChange",(function(){Object.assign(t,e.getCurrentState()),r.value=e.works.getResolvedObserver({workCode:t.workCode,panoIndex:t.panoIndex})}));return n.onBeforeUnmount((function(){o()})),r},e.useFiveCurrentState=function(){var e=c(),t=n.ref(e.getCurrentState()),r=e.on("currentStateChange",(function(){Object.assign(t.value,e.getCurrentState())}));return n.onBeforeUnmount((function(){r()})),[t,function(n,t,r){var o="function"==typeof n?n(e.getCurrentState()):n;e.setState(o,t,r)}]},e.useFiveEventCallback=function(e,t){var r=c().on(e,t);n.onBeforeUnmount((function(){r()}))},e.useFiveFloor=function(){var e=c(),t=n.ref(e.model.shownFloor),r=n.ref(e.model.floorLength),o=[];return o.push(e.on("modelShownFloorChange",(function(){t.value=e.model.shownFloor}))),o.push(e.on("modelLoaded",(function(){r.value=e.model.floorLength}))),n.onBeforeUnmount((function(){for(var e;e=o.shift();)e()})),[t,r,function(n){"number"==typeof n?e.model.show(n):e.model.show()}]},e.useFiveHelper=function(){var e=c(),t=n.ref(e.helperVisible),r=e.on("helpersVisibleChange",(function(e){t.value=e}));return n.onBeforeUnmount((function(){r()})),[t,function(n){e.helperVisible=n}]},e.useFiveModel=function(){var e=c(),t=n.shallowRef(e.model),r=e.on("modelLoaded",(function(){t.value=e.model}));return n.onBeforeUnmount((function(){r()})),t},e.useFiveModelBounding=function(){var e=c(),t=n.shallowRef(y(e)),r=e.on("modelLoaded",(function(){t.value=y(e)}));return n.onBeforeUnmount((function(){r()})),t},e.useFiveModelIntersectRaycaster=function(){return g},e.useFiveModelReadyState=function(){var e=c(),t=n.ref(w(e)),r=e.on("modelLoaded",(function(){t.value=w(e)}));return n.onBeforeUnmount((function(){r()})),t},e.useFiveProject2d=function(){return p},e.useFiveScene=function(){return c().scene},e.useFiveState=function(){var e=c(),t=n.ref(u({},e.state)),r=e.on("stateChange",(function(e){Object.assign(t.value,u({},e))}));return n.onBeforeUnmount((function(){r()})),[t,function(n,t,r){void 0===t&&(t=!1),void 0===r&&(r=!0);var o="function"==typeof n?n(e.getCurrentState()):n;e.setState(o,t,r)}]},e.useFiveWorks=function(){var e=c(),t=n.ref(e.works),r=n.readonly(t),o=e.on("load",(function(){t.value=e.works}));return n.onBeforeUnmount((function(){o()})),[r,function(n,t,r,o){if(a)throw new Error("props 'work' is set in fiveProvider, if you need modify work internal, use 'initialWork' instead.");return e.load(n,t,r,o)}]},Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));