@realsee/five 6.8.3 → 6.8.4

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/vfx/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 2026/5/11
5
- * Version: 6.8.3
4
+ * Generated: 2026/5/13
5
+ * Version: 6.8.4
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -252,7 +252,7 @@
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
- */Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`three`);c=s(c);var l=`
255
+ */Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`three`);c=s(c,1);var l=`
256
256
  uniform vec3 uColor1;
257
257
  uniform vec3 uColor2;
258
258
  uniform float uOpacity;
@@ -536,7 +536,7 @@ void main() {
536
536
  gl_FragColor = vColor * rotatedTexture;
537
537
  #endif
538
538
  }
539
- `,M=class extends c.Points{constructor(e){var t,n,r,i,a,o,s,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,M,N,P,F,I,L,R,z,B,V;let H=new c.BufferGeometry;H.setAttribute(`position`,new c.BufferAttribute(new Float32Array,3)),H.setAttribute(`alive`,new c.BufferAttribute(new Float32Array,1)),H.setAttribute(`color`,new c.BufferAttribute(new Float32Array,3)),H.setAttribute(`opacity`,new c.BufferAttribute(new Float32Array,1)),H.setAttribute(`size`,new c.BufferAttribute(new Float32Array,1)),H.setAttribute(`angle`,new c.BufferAttribute(new Float32Array,1));let U=new c.ShaderMaterial({uniforms:{map:{value:(t=e.texture)==null?null:t}},defines:{USE_MAP:!!e.texture},vertexShader:A,fragmentShader:j,transparent:!0,blending:(n=e.blending)==null?c.NormalBlending:n,depthWrite:!1});super(H,U),this.instances=[],this.needsRender=!0,this.birthTime=Date.now()/1e3,this.disposed=!1,this.paused=!1,this.positionBase=(i=(r=e.positionBase)==null?void 0:r.clone())==null?new c.Vector3:i,this.positionStyle=(a=e.positionStyle)==null?`CUBE`:a,this.positionCubeSpread=(s=(o=e.positionCubeSpread)==null?void 0:o.clone())==null?new c.Vector3:s,this.positionSphereSpread=(l=e.positionSphereSpread)==null?0:l,this.velocityStyle=(u=e.velocityStyle)==null?`CUBE`:u,this.velocityCubeBase=(f=(d=e.velocityCubeBase)==null?void 0:d.clone())==null?new c.Vector3:f,this.velocityCubeSpread=(m=(p=e.velocityCubeSpread)==null?void 0:p.clone())==null?new c.Vector3:m,this.velocitySphereBase=(h=e.velocitySphereBase)==null?0:h,this.velocitySphereSpread=(g=e.velocitySphereSpread)==null?0:g,this.accelerationBase=(v=(_=e.accelerationBase)==null?void 0:_.clone())==null?new c.Vector3:v,this.accelerationSpread=(b=(y=e.accelerationSpread)==null?void 0:y.clone())==null?new c.Vector3:b,this.angleBase=(x=e.angleBase)==null?0:x,this.angleSpread=(S=e.angleSpread)==null?0:S,this.angleVelocityBase=(C=e.angleVelocityBase)==null?0:C,this.angleVelocitySpread=(w=e.angleVelocitySpread)==null?0:w,this.angleAccelerationBase=(T=e.angleAccelerationBase)==null?0:T,this.angleAccelerationSpread=(E=e.angleAccelerationSpread)==null?0:E,this.sizeBase=(D=e.sizeBase)==null?.1:D,this.sizeSpread=(O=e.sizeSpread)==null?0:O,this.sizeTween=(k=e.sizeTween)==null?null:k,this.colorBase=(N=(M=e.colorBase)==null?void 0:M.clone())==null?new c.Vector3:N,this.colorSpread=(F=(P=e.colorSpread)==null?void 0:P.clone())==null?new c.Vector3:F,this.colorTween=(I=e.colorTween)==null?null:I,this.opacityBase=((L=e.opacityBase)==null?e.opacityTween:L)?0:1,this.opacitySpread=(R=e.opacitySpread)==null?0:R,this.opacityTween=(z=e.opacityTween)==null?null:z,this.particlesPerSecond=(B=e.particlesPerSecond)==null?60:B,this.particleDeathAge=(V=e.particleDeathAge)==null?1:V}get texture(){return this.material.uniforms.map.value}set texture(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)}get blending(){return this.material.blending}set blending(e){this.material.blending=e}createInstance(e){let t=this.positionBase.clone();switch(this.positionStyle){case`CUBE`:t=T(this.positionBase,this.positionCubeSpread);break;case`SPHERE`:{let e=2*Math.random()-1,n=Math.PI*2*Math.random(),r=Math.sqrt(1-e*e),i=new c.Vector3(r*Math.cos(n),r*Math.sin(n),e);t=new c.Vector3().addVectors(this.positionBase,i.multiplyScalar(this.positionSphereSpread));break}default:break}let n=new c.Vector3;switch(this.velocityStyle){case`CUBE`:n=T(this.velocityCubeBase,this.velocityCubeSpread);break;case`SPHERE`:{let e=new c.Vector3().subVectors(t,this.positionBase),r=w(this.velocitySphereBase,this.velocitySphereSpread);n=e.normalize().multiplyScalar(r);break}default:break}return new k(e,this.particleDeathAge,t,n,T(this.accelerationBase,this.accelerationSpread),w(this.angleBase,this.angleSpread),w(this.angleVelocityBase,this.angleVelocitySpread),w(this.angleAccelerationBase,this.angleAccelerationSpread),T(this.colorBase,this.colorSpread),this.colorTween,w(this.sizeBase,this.sizeSpread),this.sizeTween,w(this.opacityBase,this.opacitySpread),this.opacityTween)}pause(){this.paused!==!0&&(this.paused=!0,this.birthTime=Date.now()/1e3)}play(){this.paused!==!1&&(this.paused=!1,this.birthTime=Date.now()/1e3)}setTime(e){if(this.disposed)return;e/=1e3;let t=e-this.birthTime,n=Math.ceil(this.particlesPerSecond*this.particleDeathAge);if(this.geometry.attributes.position.count<n){let e=new Float32Array(n*3);e.set(this.geometry.attributes.position.array,0);let t=new c.BufferAttribute(e,3);t.needsUpdate=!0,this.geometry.setAttribute(`position`,t)}if(this.geometry.attributes.alive.count<n){let e=new Float32Array(n);e.set(this.geometry.attributes.alive.array,0);let t=new c.BufferAttribute(e,1);t.needsUpdate=!0,this.geometry.setAttribute(`alive`,t)}if(this.geometry.attributes.color.count<n){let e=new Float32Array(n*3);e.set(this.geometry.attributes.color.array,0);let t=new c.BufferAttribute(e,3);t.needsUpdate=!0,this.geometry.setAttribute(`color`,t)}if(this.geometry.attributes.opacity.count<n){let e=new Float32Array(n);e.set(this.geometry.attributes.opacity.array,0);let t=new c.BufferAttribute(e,1);t.needsUpdate=!0,this.geometry.setAttribute(`opacity`,t)}if(this.geometry.attributes.size.count<n){let e=new Float32Array(n);e.set(this.geometry.attributes.size.array,0);let t=new c.BufferAttribute(e,1);t.needsUpdate=!0,this.geometry.setAttribute(`size`,t)}if(this.geometry.attributes.angle.count<n){let e=new Float32Array(n);e.set(this.geometry.attributes.angle.array,0);let t=new c.BufferAttribute(e,1);t.needsUpdate=!0,this.geometry.setAttribute(`angle`,t)}this.instances.length<n&&(this.instances.length=n);for(let r=0;r<this.instances.length;r++){let i=this.instances[r];if(r<n&&this.paused===!1&&(i===void 0||i.getAlive(e)===!1)){let a=this.particleDeathAge/n*r;if(t>a){let n=e-(t-a)%this.particleDeathAge;this.instances[r]=i=this.createInstance(n)}}if(i){let{position:t,alive:n,color:a,opacity:o,size:s,angle:c}=i.getState(e);this.geometry.attributes.position.setXYZ(r,t.x,t.y,t.z),this.geometry.attributes.position.needsUpdate=!0,this.geometry.attributes.alive.setX(r,n?1:0),this.geometry.attributes.alive.needsUpdate=!0,this.geometry.attributes.color.setXYZ(r,a.r,a.g,a.b),this.geometry.attributes.color.needsUpdate=!0,this.geometry.attributes.opacity.setX(r,o),this.geometry.attributes.opacity.needsUpdate=!0,this.geometry.attributes.size.setX(r,s),this.geometry.attributes.size.needsUpdate=!0,this.geometry.attributes.angle.setX(r,c),this.geometry.attributes.angle.needsUpdate=!0}}this.geometry.computeBoundingBox(),this.geometry.boundingSphere||(this.geometry.boundingSphere=new c.Sphere),this.geometry.boundingBox.getBoundingSphere(this.geometry.boundingSphere),this.needsRender=!0}dispose(){var e;this.disposed=!0,this.geometry.dispose(),(e=this.texture)==null||e.dispose(),this.material.dispose()}};function N(e,t){return e+t*(Math.random()-.5)}function P(e,t){let n=new c.Vector3(Math.random()-.5,Math.random()-.5,Math.random()-.5);return new c.Vector3().addVectors(e,new c.Vector3().multiplyVectors(t,n))}var F=`
539
+ `,M=class extends c.Points{constructor(e){var t,n,r,i,a,o,s,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,M,N,P,F,I,L,R,z,B,V;let H=new c.BufferGeometry;H.setAttribute(`position`,new c.BufferAttribute(new Float32Array,3)),H.setAttribute(`alive`,new c.BufferAttribute(new Float32Array,1)),H.setAttribute(`color`,new c.BufferAttribute(new Float32Array,3)),H.setAttribute(`opacity`,new c.BufferAttribute(new Float32Array,1)),H.setAttribute(`size`,new c.BufferAttribute(new Float32Array,1)),H.setAttribute(`angle`,new c.BufferAttribute(new Float32Array,1));let U=new c.ShaderMaterial({uniforms:{map:{value:(t=e.texture)==null?null:t}},defines:{USE_MAP:!!e.texture},vertexShader:A,fragmentShader:j,transparent:!0,blending:(n=e.blending)==null?c.NormalBlending:n,depthWrite:!1});super(H,U),this.instances=[],this.needsRender=!0,this.birthTime=Date.now()/1e3,this.disposed=!1,this.paused=!1,this.positionBase=(i=(r=e.positionBase)==null?void 0:r.clone())==null?new c.Vector3:i,this.positionStyle=(a=e.positionStyle)==null?`CUBE`:a,this.positionCubeSpread=(s=(o=e.positionCubeSpread)==null?void 0:o.clone())==null?new c.Vector3:s,this.positionSphereSpread=(l=e.positionSphereSpread)==null?0:l,this.velocityStyle=(u=e.velocityStyle)==null?`CUBE`:u,this.velocityCubeBase=(f=(d=e.velocityCubeBase)==null?void 0:d.clone())==null?new c.Vector3:f,this.velocityCubeSpread=(m=(p=e.velocityCubeSpread)==null?void 0:p.clone())==null?new c.Vector3:m,this.velocitySphereBase=(h=e.velocitySphereBase)==null?0:h,this.velocitySphereSpread=(g=e.velocitySphereSpread)==null?0:g,this.accelerationBase=(v=(_=e.accelerationBase)==null?void 0:_.clone())==null?new c.Vector3:v,this.accelerationSpread=(b=(y=e.accelerationSpread)==null?void 0:y.clone())==null?new c.Vector3:b,this.angleBase=(x=e.angleBase)==null?0:x,this.angleSpread=(S=e.angleSpread)==null?0:S,this.angleVelocityBase=(C=e.angleVelocityBase)==null?0:C,this.angleVelocitySpread=(w=e.angleVelocitySpread)==null?0:w,this.angleAccelerationBase=(T=e.angleAccelerationBase)==null?0:T,this.angleAccelerationSpread=(E=e.angleAccelerationSpread)==null?0:E,this.sizeBase=(D=e.sizeBase)==null?.1:D,this.sizeSpread=(O=e.sizeSpread)==null?0:O,this.sizeTween=(k=e.sizeTween)==null?null:k,this.colorBase=(N=(M=e.colorBase)==null?void 0:M.clone())==null?new c.Vector3:N,this.colorSpread=(F=(P=e.colorSpread)==null?void 0:P.clone())==null?new c.Vector3:F,this.colorTween=(I=e.colorTween)==null?null:I,this.opacityBase=((L=e.opacityBase)==null?e.opacityTween:L)?0:1,this.opacitySpread=(R=e.opacitySpread)==null?0:R,this.opacityTween=(z=e.opacityTween)==null?null:z,this.particlesPerSecond=(B=e.particlesPerSecond)==null?60:B,this.particleDeathAge=(V=e.particleDeathAge)==null?1:V}get texture(){return this.material.uniforms.map.value}set texture(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)}get blending(){return this.material.blending}set blending(e){this.material.blending=e}createInstance(e){let t=this.positionBase.clone();switch(this.positionStyle){case`CUBE`:t=T(this.positionBase,this.positionCubeSpread);break;case`SPHERE`:{let e=2*Math.random()-1,n=Math.PI*2*Math.random(),r=Math.sqrt(1-e*e),i=new c.Vector3(r*Math.cos(n),r*Math.sin(n),e);t=new c.Vector3().addVectors(this.positionBase,i.multiplyScalar(this.positionSphereSpread));break}default:break}let n=new c.Vector3;switch(this.velocityStyle){case`CUBE`:n=T(this.velocityCubeBase,this.velocityCubeSpread);break;case`SPHERE`:{let e=new c.Vector3().subVectors(t,this.positionBase),r=w(this.velocitySphereBase,this.velocitySphereSpread);n=e.normalize().multiplyScalar(r);break}default:break}return new k(e,this.particleDeathAge,t,n,T(this.accelerationBase,this.accelerationSpread),w(this.angleBase,this.angleSpread),w(this.angleVelocityBase,this.angleVelocitySpread),w(this.angleAccelerationBase,this.angleAccelerationSpread),T(this.colorBase,this.colorSpread),this.colorTween,w(this.sizeBase,this.sizeSpread),this.sizeTween,w(this.opacityBase,this.opacitySpread),this.opacityTween)}pause(){this.paused!==!0&&(this.paused=!0,this.birthTime=Date.now()/1e3)}play(){this.paused!==!1&&(this.paused=!1,this.birthTime=Date.now()/1e3)}setTime(e){if(this.disposed)return;e/=1e3;let t=e-this.birthTime,n=Math.ceil(this.particlesPerSecond*this.particleDeathAge);if(this.geometry.attributes.position.count<n){let e=new Float32Array(n*3);e.set(this.geometry.attributes.position.array,0);let t=new c.BufferAttribute(e,3);t.needsUpdate=!0,this.geometry.setAttribute(`position`,t)}if(this.geometry.attributes.alive.count<n){let e=new Float32Array(n);e.set(this.geometry.attributes.alive.array,0);let t=new c.BufferAttribute(e,1);t.needsUpdate=!0,this.geometry.setAttribute(`alive`,t)}if(this.geometry.attributes.color.count<n){let e=new Float32Array(n*3);e.set(this.geometry.attributes.color.array,0);let t=new c.BufferAttribute(e,3);t.needsUpdate=!0,this.geometry.setAttribute(`color`,t)}if(this.geometry.attributes.opacity.count<n){let e=new Float32Array(n);e.set(this.geometry.attributes.opacity.array,0);let t=new c.BufferAttribute(e,1);t.needsUpdate=!0,this.geometry.setAttribute(`opacity`,t)}if(this.geometry.attributes.size.count<n){let e=new Float32Array(n);e.set(this.geometry.attributes.size.array,0);let t=new c.BufferAttribute(e,1);t.needsUpdate=!0,this.geometry.setAttribute(`size`,t)}if(this.geometry.attributes.angle.count<n){let e=new Float32Array(n);e.set(this.geometry.attributes.angle.array,0);let t=new c.BufferAttribute(e,1);t.needsUpdate=!0,this.geometry.setAttribute(`angle`,t)}this.instances.length<n&&(this.instances.length=n);for(let r=0;r<this.instances.length;r++){let i=this.instances[r];if(r<n&&this.paused===!1&&(i===void 0||i.getAlive(e)===!1)){let a=this.particleDeathAge/n*r;if(t>a){let n=e-(t-a)%this.particleDeathAge;this.instances[r]=i=this.createInstance(n)}}if(i){let{position:t,alive:n,color:a,opacity:o,size:s,angle:c}=i.getState(e);this.geometry.attributes.position.setXYZ(r,t.x,t.y,t.z),this.geometry.attributes.position.needsUpdate=!0,this.geometry.attributes.alive.setX(r,+!!n),this.geometry.attributes.alive.needsUpdate=!0,this.geometry.attributes.color.setXYZ(r,a.r,a.g,a.b),this.geometry.attributes.color.needsUpdate=!0,this.geometry.attributes.opacity.setX(r,o),this.geometry.attributes.opacity.needsUpdate=!0,this.geometry.attributes.size.setX(r,s),this.geometry.attributes.size.needsUpdate=!0,this.geometry.attributes.angle.setX(r,c),this.geometry.attributes.angle.needsUpdate=!0}}this.geometry.computeBoundingBox(),this.geometry.boundingSphere||(this.geometry.boundingSphere=new c.Sphere),this.geometry.boundingBox.getBoundingSphere(this.geometry.boundingSphere),this.needsRender=!0}dispose(){var e;this.disposed=!0,this.geometry.dispose(),(e=this.texture)==null||e.dispose(),this.material.dispose()}};function N(e,t){return e+t*(Math.random()-.5)}function P(e,t){let n=new c.Vector3(Math.random()-.5,Math.random()-.5,Math.random()-.5);return new c.Vector3().addVectors(e,new c.Vector3().multiplyVectors(t,n))}var F=`
540
540
  // 粒子初始属性
541
541
  attribute vec3 initialVelocity;
542
542
  attribute vec3 acceleration;
package/vfx/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 2026/5/11
5
- * Version: 6.8.3
4
+ * Generated: 2026/5/13
5
+ * Version: 6.8.4
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -678,7 +678,7 @@ var x = class {
678
678
  }
679
679
  if (i) {
680
680
  let { position: n, alive: r, color: a, opacity: o, size: s, angle: c } = i.getState(t);
681
- this.geometry.attributes.position.setXYZ(e, n.x, n.y, n.z), this.geometry.attributes.position.needsUpdate = !0, this.geometry.attributes.alive.setX(e, r ? 1 : 0), this.geometry.attributes.alive.needsUpdate = !0, this.geometry.attributes.color.setXYZ(e, a.r, a.g, a.b), this.geometry.attributes.color.needsUpdate = !0, this.geometry.attributes.opacity.setX(e, o), this.geometry.attributes.opacity.needsUpdate = !0, this.geometry.attributes.size.setX(e, s), this.geometry.attributes.size.needsUpdate = !0, this.geometry.attributes.angle.setX(e, c), this.geometry.attributes.angle.needsUpdate = !0;
681
+ this.geometry.attributes.position.setXYZ(e, n.x, n.y, n.z), this.geometry.attributes.position.needsUpdate = !0, this.geometry.attributes.alive.setX(e, +!!r), this.geometry.attributes.alive.needsUpdate = !0, this.geometry.attributes.color.setXYZ(e, a.r, a.g, a.b), this.geometry.attributes.color.needsUpdate = !0, this.geometry.attributes.opacity.setX(e, o), this.geometry.attributes.opacity.needsUpdate = !0, this.geometry.attributes.size.setX(e, s), this.geometry.attributes.size.needsUpdate = !0, this.geometry.attributes.angle.setX(e, c), this.geometry.attributes.angle.needsUpdate = !0;
682
682
  }
683
683
  }
684
684
  this.geometry.computeBoundingBox(), this.geometry.boundingSphere || (this.geometry.boundingSphere = new e.Sphere()), this.geometry.boundingBox.getBoundingSphere(this.geometry.boundingSphere), this.needsRender = !0;
package/vue/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 2026/5/11
5
- * Version: 6.8.3
4
+ * Generated: 2026/5/13
5
+ * Version: 6.8.4
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
- */Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`vue`),l=require(`@realsee/five`),u=require(`three`);u=s(u);var d=!1;function f(e){d=e}var p=Symbol();function m(){let e=(0,c.inject)(p);if(!e)throw Error(`Inject five error!`);return e}var h={display:`inline-block`,overflow:`hidden`},g=(0,c.defineComponent)({props:{width:{type:Number,required:!0},height:{type:Number,required:!0}},setup(e){let t=(0,c.toRef)(e,`width`),n=(0,c.toRef)(e,`height`),r=m(),i=(0,c.ref)(null);return(0,c.watch)([t,n,i],()=>{if(r.renderer&&i.value){if(r.renderer.domElement.parentNode!==null&&r.renderer.domElement.parentNode!==i.value)throw Error(`There are more than 2 fiveCanvas in this context.`);r.renderer.domElement.parentNode!==i.value&&i.value.appendChild(r.renderer.domElement),r.camera.aspect=t.value/n.value,r.camera.updateProjectionMatrix(),r.renderer.setSize(t.value,n.value),r.refresh({width:t.value,height:n.value}),r.needsRender=!0}}),()=>(0,c.h)(`div`,{id:`five`,style:Object.assign({width:`${t.value}px`,height:`${n.value}px`},h),ref:i})}}),_=[],v=[];function y({backgroundColor:e=1579548,backgroundAlpha:t=1,preserveDrawingBuffer:n=!0,pixelRatio:r=1,webgl2:i=!1}={}){if(typeof window>`u`)return;let a=null;if(a=i?_.shift():v.shift(),!a){if(i){let e=document.createElement(`canvas`),t=e.getContext(`webgl2`);t?a=new u.WebGLRenderer({preserveDrawingBuffer:n,antialias:!0,alpha:!0,stencil:!0,canvas:e,context:t}):(console.error(`error occurred when getting webgl2 canvas context, mybe webgl2 not support, fallback to webgl.`),a=new u.WebGLRenderer({preserveDrawingBuffer:n,antialias:!1,alpha:!0,stencil:!0}))}else a=new u.WebGLRenderer({preserveDrawingBuffer:n,antialias:!1,alpha:!0,stencil:!0});a.outputEncoding=u.sRGBEncoding}return a.setPixelRatio(r),a.setClearColor(e,t),a.autoClear=!0,a}function b(e){e&&(e.capabilities.isWebGL2?v.indexOf(e)===-1&&v.push(e):_.indexOf(e)===-1&&_.push(e))}function x(e,t){let n=Array.isArray(e)?e:[e],r=Array.isArray(t)?t:[t];if(n.length!==r.length)return!1;for(let e=0;e<n.length;e++)if(n[e]!==r[e])return!1;return!0}var S=(0,c.defineComponent)({props:{works:Object,initialWorks:Object,initialState:Object,initialUserAction:Boolean,onWorksChange:Function,onStateChange:Function,onCurrentStateChange:Function,onError:Function,fiveInitArgs:{type:Object,default:()=>({})},style:Object},setup(e){var t;let{works:n}=(0,c.toRefs)(e),r=y({pixelRatio:(0,l.getViewportScale)()===1?window.devicePixelRatio:1}),i=new l.Five(Object.assign({renderer:r},e.fiveInitArgs)),a=e.works||e.initialWorks;return a&&i.load(a,e.initialState,void 0,(t=e.initialUserAction)==null?!0:t),f(!!e.works),n&&(0,c.watch)(n,(t,n)=>{t&&!x(t,i.works)&&i.load(t,e.initialState)}),(0,c.onBeforeUnmount)(()=>{i&&(i.dispose(),b(i.renderer))}),i.on(`load`,()=>{e.onWorksChange&&i.works&&e.onWorksChange(i==null?void 0:i.works)}),i.on(`stateChange`,(t,n)=>{e.onStateChange&&e.onStateChange(t,n)}),i.on(`currentStateChange`,(t,n)=>{e.onCurrentStateChange&&e.onCurrentStateChange(t,n)}),i.on(`error`,t=>{e.onError?e.onError(t):console.warn(t.message)}),(0,c.provide)(p,i),{five:(0,c.shallowReadonly)(i)}},render(){return(0,c.h)(`div`,{style:this.$props.style},this.$slots)}});function C(){let e=m(),t=(0,c.ref)(e.works),n=(0,c.readonly)(t),r=(t,n,r,i)=>{if(d)throw Error(`props 'work' is set in fiveProvider, if you need modify work internal, use 'initialWork' instead.`);return e.load(t,n,r,i)},i=e.on(`load`,()=>{t.value=e.works});return(0,c.onBeforeUnmount)(()=>{i()}),[n,r]}function w(){let e=m(),t=(0,c.ref)(Object.assign({},e.state)),n=e.on(`stateChange`,e=>{Object.assign(t.value,Object.assign({},e))});return(0,c.onBeforeUnmount)(()=>{n()}),[t,(t,n=!1,r=!0)=>{let i=typeof t==`function`?t(e.getCurrentState()):t;e.setState(i,n,r)}]}function T(){let e=m(),t=(0,c.ref)(e.getCurrentState()),n=e.on(`currentStateChange`,()=>{Object.assign(t.value,e.getCurrentState())});return(0,c.onBeforeUnmount)(()=>{n()}),[t,(t,n,r)=>{let i=typeof t==`function`?t(e.getCurrentState()):t;e.setState(i,n,r)}]}function E(){let e=m(),t=(0,c.reactive)(e.getCurrentState()),n=(0,c.ref)(e.works.getObserver(e.pano)),r=e.on(`currentStateChange`,()=>{Object.assign(t,e.getCurrentState()),n.value=e.works.getObserver({workCode:t.workCode,panoIndex:t.panoIndex})});return(0,c.onBeforeUnmount)(()=>{r()}),n}function D(e,t){let n=m().on(e,t);(0,c.onBeforeUnmount)(()=>{n()})}function O(){let e=m();return{updateCamera:(t,n)=>e.updateCamera(t,n),getPixels:e.getPixels.bind(e),render:t=>e.render(t),needsRender:()=>e.needsRender=!0,preloadPano:(t,n)=>e.preloadPano(t,n),project2d:(t,n=!1)=>e.project2d(t,n)}}function k(e,t=!1){let n=m(),r=(0,c.ref)(Symbol()),i=(0,c.shallowRef)(e?n.project2d((0,c.isRef)(e)?e.value:e,t):null),a=n.on(`cameraUpdate`,()=>{r.value=Symbol()});return(0,c.onBeforeUnmount)(()=>{a()}),(0,c.watch)([r,e],()=>{i.value=n.project2d((0,c.isRef)(e)?e.value:e,t)}),i}function A(){return k}function j(e){let t=e.camera.getWorldDirection(new u.Vector3);return new u.Raycaster(e.camera.position,t)}function M(){let e=m(),t=(0,c.shallowRef)(j(e)),n=e.on(`cameraUpdate`,()=>{t.value=j(e)});return(0,c.onBeforeUnmount)(()=>{n()}),t}function N(e){return e.camera.getWorldDirection(new u.Vector3)}function P(){let e=m(),t=(0,c.shallowRef)(N(e)),n=e.on(`cameraUpdate`,()=>{t.value=N(e)});return(0,c.onBeforeUnmount)(()=>{n()}),t}function F(e){let t=m(),n=(0,c.shallowRef)([]);return(0,c.watch)(e,()=>{n.value=t.model.intersectRaycaster((0,c.isRef)(e)?e.value:e)}),n}function I(){return F}function L(e){return e.model.empty?`Empty`:`Loaded`}function R(){let e=m(),t=(0,c.ref)(L(e)),n=e.on(`modelLoaded`,()=>{t.value=L(e)});return(0,c.onBeforeUnmount)(()=>{n()}),t}function z(){let e=m(),t=(0,c.ref)(e.model.shownFloor),n=(0,c.ref)(e.model.floorLength),r=t=>{typeof t==`number`?e.model.show(t):e.model.show()},i=[];return i.push(e.on(`modelShownFloorChange`,()=>{t.value=e.model.shownFloor})),i.push(e.on(`modelLoaded`,()=>{n.value=e.model.floorLength})),(0,c.onBeforeUnmount)(()=>{let e;for(;e=i.shift();)e()}),[t,n,r]}function B(){let e=m(),t=(0,c.ref)(e.helperVisible),n=t=>{e.helperVisible=t},r=e.on(`helpersVisibleChange`,e=>{t.value=e});return(0,c.onBeforeUnmount)(()=>{r()}),[t,n]}function V(){return m()}function H(e){return e.model.bounding.clone()}function U(){let e=m(),t=(0,c.shallowRef)(H(e)),n=e.on(`modelLoaded`,()=>{t.value=H(e)});return(0,c.onBeforeUnmount)(()=>{n()}),t}function W(){return m().scene}function G(){let e=m(),t=(0,c.shallowRef)(e.model),n=e.on(`modelLoaded`,()=>{t.value=e.model});return(0,c.onBeforeUnmount)(()=>{n()}),t}exports.FiveCanvas=g,exports.FiveProvider=S,exports.unsafe__useFiveInject=V,exports.useFiveAction=O,exports.useFiveCameraDirection=P,exports.useFiveCameraRaycaster=M,exports.useFiveCurrentObserver=E,exports.useFiveCurrentState=T,exports.useFiveEventCallback=D,exports.useFiveFloor=z,exports.useFiveHelper=B,exports.useFiveModel=G,exports.useFiveModelBounding=U,exports.useFiveModelIntersectRaycaster=I,exports.useFiveModelReadyState=R,exports.useFiveProject2d=A,exports.useFiveScene=W,exports.useFiveState=w,exports.useFiveWorks=C;
255
+ */Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`vue`),l=require(`@realsee/five`),u=require(`three`);u=s(u,1);var d=!1;function f(e){d=e}var p=Symbol();function m(){let e=(0,c.inject)(p);if(!e)throw Error(`Inject five error!`);return e}var h={display:`inline-block`,overflow:`hidden`},g=(0,c.defineComponent)({props:{width:{type:Number,required:!0},height:{type:Number,required:!0}},setup(e){let t=(0,c.toRef)(e,`width`),n=(0,c.toRef)(e,`height`),r=m(),i=(0,c.ref)(null);return(0,c.watch)([t,n,i],()=>{if(r.renderer&&i.value){if(r.renderer.domElement.parentNode!==null&&r.renderer.domElement.parentNode!==i.value)throw Error(`There are more than 2 fiveCanvas in this context.`);r.renderer.domElement.parentNode!==i.value&&i.value.appendChild(r.renderer.domElement),r.camera.aspect=t.value/n.value,r.camera.updateProjectionMatrix(),r.renderer.setSize(t.value,n.value),r.refresh({width:t.value,height:n.value}),r.needsRender=!0}}),()=>(0,c.h)(`div`,{id:`five`,style:Object.assign({width:`${t.value}px`,height:`${n.value}px`},h),ref:i})}}),_=[],v=[];function y({backgroundColor:e=1579548,backgroundAlpha:t=1,preserveDrawingBuffer:n=!0,pixelRatio:r=1,webgl2:i=!1}={}){if(typeof window>`u`)return;let a=null;if(a=i?_.shift():v.shift(),!a){if(i){let e=document.createElement(`canvas`),t=e.getContext(`webgl2`);t?a=new u.WebGLRenderer({preserveDrawingBuffer:n,antialias:!0,alpha:!0,stencil:!0,canvas:e,context:t}):(console.error(`error occurred when getting webgl2 canvas context, mybe webgl2 not support, fallback to webgl.`),a=new u.WebGLRenderer({preserveDrawingBuffer:n,antialias:!1,alpha:!0,stencil:!0}))}else a=new u.WebGLRenderer({preserveDrawingBuffer:n,antialias:!1,alpha:!0,stencil:!0});a.outputEncoding=u.sRGBEncoding}return a.setPixelRatio(r),a.setClearColor(e,t),a.autoClear=!0,a}function b(e){e&&(e.capabilities.isWebGL2?v.indexOf(e)===-1&&v.push(e):_.indexOf(e)===-1&&_.push(e))}function x(e,t){let n=Array.isArray(e)?e:[e],r=Array.isArray(t)?t:[t];if(n.length!==r.length)return!1;for(let e=0;e<n.length;e++)if(n[e]!==r[e])return!1;return!0}var S=(0,c.defineComponent)({props:{works:Object,initialWorks:Object,initialState:Object,initialUserAction:Boolean,onWorksChange:Function,onStateChange:Function,onCurrentStateChange:Function,onError:Function,fiveInitArgs:{type:Object,default:()=>({})},style:Object},setup(e){var t;let{works:n}=(0,c.toRefs)(e),r=y({pixelRatio:(0,l.getViewportScale)()===1?window.devicePixelRatio:1}),i=new l.Five(Object.assign({renderer:r},e.fiveInitArgs)),a=e.works||e.initialWorks;return a&&i.load(a,e.initialState,void 0,(t=e.initialUserAction)==null?!0:t),f(!!e.works),n&&(0,c.watch)(n,(t,n)=>{t&&!x(t,i.works)&&i.load(t,e.initialState)}),(0,c.onBeforeUnmount)(()=>{i&&(i.dispose(),b(i.renderer))}),i.on(`load`,()=>{e.onWorksChange&&i.works&&e.onWorksChange(i==null?void 0:i.works)}),i.on(`stateChange`,(t,n)=>{e.onStateChange&&e.onStateChange(t,n)}),i.on(`currentStateChange`,(t,n)=>{e.onCurrentStateChange&&e.onCurrentStateChange(t,n)}),i.on(`error`,t=>{e.onError?e.onError(t):console.warn(t.message)}),(0,c.provide)(p,i),{five:(0,c.shallowReadonly)(i)}},render(){return(0,c.h)(`div`,{style:this.$props.style},this.$slots)}});function C(){let e=m(),t=(0,c.ref)(e.works),n=(0,c.readonly)(t),r=(t,n,r,i)=>{if(d)throw Error(`props 'work' is set in fiveProvider, if you need modify work internal, use 'initialWork' instead.`);return e.load(t,n,r,i)},i=e.on(`load`,()=>{t.value=e.works});return(0,c.onBeforeUnmount)(()=>{i()}),[n,r]}function w(){let e=m(),t=(0,c.ref)(Object.assign({},e.state)),n=e.on(`stateChange`,e=>{Object.assign(t.value,Object.assign({},e))});return(0,c.onBeforeUnmount)(()=>{n()}),[t,(t,n=!1,r=!0)=>{let i=typeof t==`function`?t(e.getCurrentState()):t;e.setState(i,n,r)}]}function T(){let e=m(),t=(0,c.ref)(e.getCurrentState()),n=e.on(`currentStateChange`,()=>{Object.assign(t.value,e.getCurrentState())});return(0,c.onBeforeUnmount)(()=>{n()}),[t,(t,n,r)=>{let i=typeof t==`function`?t(e.getCurrentState()):t;e.setState(i,n,r)}]}function E(){let e=m(),t=(0,c.reactive)(e.getCurrentState()),n=(0,c.ref)(e.works.getObserver(e.pano)),r=e.on(`currentStateChange`,()=>{Object.assign(t,e.getCurrentState()),n.value=e.works.getObserver({workCode:t.workCode,panoIndex:t.panoIndex})});return(0,c.onBeforeUnmount)(()=>{r()}),n}function D(e,t){let n=m().on(e,t);(0,c.onBeforeUnmount)(()=>{n()})}function O(){let e=m();return{updateCamera:(t,n)=>e.updateCamera(t,n),getPixels:e.getPixels.bind(e),render:t=>e.render(t),needsRender:()=>e.needsRender=!0,preloadPano:(t,n)=>e.preloadPano(t,n),project2d:(t,n=!1)=>e.project2d(t,n)}}function k(e,t=!1){let n=m(),r=(0,c.ref)(Symbol()),i=(0,c.shallowRef)(e?n.project2d((0,c.isRef)(e)?e.value:e,t):null),a=n.on(`cameraUpdate`,()=>{r.value=Symbol()});return(0,c.onBeforeUnmount)(()=>{a()}),(0,c.watch)([r,e],()=>{i.value=n.project2d((0,c.isRef)(e)?e.value:e,t)}),i}function A(){return k}function j(e){let t=e.camera.getWorldDirection(new u.Vector3);return new u.Raycaster(e.camera.position,t)}function M(){let e=m(),t=(0,c.shallowRef)(j(e)),n=e.on(`cameraUpdate`,()=>{t.value=j(e)});return(0,c.onBeforeUnmount)(()=>{n()}),t}function N(e){return e.camera.getWorldDirection(new u.Vector3)}function P(){let e=m(),t=(0,c.shallowRef)(N(e)),n=e.on(`cameraUpdate`,()=>{t.value=N(e)});return(0,c.onBeforeUnmount)(()=>{n()}),t}function F(e){let t=m(),n=(0,c.shallowRef)([]);return(0,c.watch)(e,()=>{n.value=t.model.intersectRaycaster((0,c.isRef)(e)?e.value:e)}),n}function I(){return F}function L(e){return e.model.empty?`Empty`:`Loaded`}function R(){let e=m(),t=(0,c.ref)(L(e)),n=e.on(`modelLoaded`,()=>{t.value=L(e)});return(0,c.onBeforeUnmount)(()=>{n()}),t}function z(){let e=m(),t=(0,c.ref)(e.model.shownFloor),n=(0,c.ref)(e.model.floorLength),r=t=>{typeof t==`number`?e.model.show(t):e.model.show()},i=[];return i.push(e.on(`modelShownFloorChange`,()=>{t.value=e.model.shownFloor})),i.push(e.on(`modelLoaded`,()=>{n.value=e.model.floorLength})),(0,c.onBeforeUnmount)(()=>{let e;for(;e=i.shift();)e()}),[t,n,r]}function B(){let e=m(),t=(0,c.ref)(e.helperVisible),n=t=>{e.helperVisible=t},r=e.on(`helpersVisibleChange`,e=>{t.value=e});return(0,c.onBeforeUnmount)(()=>{r()}),[t,n]}function V(){return m()}function H(e){return e.model.bounding.clone()}function U(){let e=m(),t=(0,c.shallowRef)(H(e)),n=e.on(`modelLoaded`,()=>{t.value=H(e)});return(0,c.onBeforeUnmount)(()=>{n()}),t}function W(){return m().scene}function G(){let e=m(),t=(0,c.shallowRef)(e.model),n=e.on(`modelLoaded`,()=>{t.value=e.model});return(0,c.onBeforeUnmount)(()=>{n()}),t}exports.FiveCanvas=g,exports.FiveProvider=S,exports.unsafe__useFiveInject=V,exports.useFiveAction=O,exports.useFiveCameraDirection=P,exports.useFiveCameraRaycaster=M,exports.useFiveCurrentObserver=E,exports.useFiveCurrentState=T,exports.useFiveEventCallback=D,exports.useFiveFloor=z,exports.useFiveHelper=B,exports.useFiveModel=G,exports.useFiveModelBounding=U,exports.useFiveModelIntersectRaycaster=I,exports.useFiveModelReadyState=R,exports.useFiveProject2d=A,exports.useFiveScene=W,exports.useFiveState=w,exports.useFiveWorks=C;
package/vue/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 2026/5/11
5
- * Version: 6.8.3
4
+ * Generated: 2026/5/13
5
+ * Version: 6.8.4
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 2026/5/11
5
- * Version: 6.8.3
4
+ * Generated: 2026/5/13
5
+ * Version: 6.8.4
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
- */Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`node:fs`),l=require(`node:fs/promises`),u=require(`node:path`),d=require(`node:stream`),f=require(`sharp`);f=s(f);function p(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function m(e,t){if(t&&t[t.length-1]!==`/`&&(t+=`/`),e.length>t.length&&e.startsWith(t))return e.slice(t.length);throw Error(`${e} is not starting with ${t}`)}function h(...e){let t=[];e=e.map(e=>(e==null?``:e).trim()).filter(e=>e.length>0&&!/^\/+$/.test(e));for(let n=0;n<e.length;n++){let r=n===0,i=n===e.length-1,a=e[n];r||(a=a.replace(/^\.\//,``).replace(/^\/+/,``)),i||(a=a.replace(/\/+$/,``)),t.push(a)}return t.join(`/`)}var g=1024*1024*5;function _(e,t,n){return p(this,void 0,void 0,function*(){var r;if((0,c.existsSync)(t))return t;let i=yield n(e);if(i.ok&&i.body){if(yield(0,l.mkdir)((0,u.dirname)(t),{recursive:!0}),Number((r=i.headers.get(`content-length`))==null?`Infinity`:r)>g)return new Promise((e,n)=>{let r=d.Readable.fromWeb(i.body),a=(0,c.createWriteStream)(t);r.pipe(a),r.on(`error`,n),a.on(`finish`,()=>e(t))});{let e=yield i.arrayBuffer();return yield(0,l.writeFile)(t,Buffer.from(e)),t}}throw Error(`url: ${e}(${i.statusText})`)})}var v=[`jpg`,`png`],y=95;function b(e,t){let n=(0,u.extname)(e).slice(1)||`jpg`,{cut:r,size:i,format:a=n}=t,o=``;if(t.toFilename)o=t.toFilename(e,{cut:t.cut,size:t.size,format:t.format});else{let t=``,s=``,c=a;r&&(t=r.join(`x`)),i&&(s=`${i}x`),c===n&&!s&&!t&&(c=``),o=[e,t,s,c].filter(e=>e.length>0).join(`.`)}return o}function x(e,t){return p(this,void 0,void 0,function*(){let n=(0,u.extname)(e).slice(1)||`jpg`,{cut:r,size:i,format:a=n}=t,o=e;if((r||i)&&a!==n&&v.includes(a)){let n=b(e,{format:a,toFilename:t.toFilename});n!==o&&(0,c.existsSync)(n)&&(o=n)}let s=(0,f.default)(o);r&&(s=s.extract({left:r[0],top:r[1],width:r[2],height:r[3]})),i&&(s=s.resize(i)),s=s.toFormat(a,{quality:y});let l=b(e,t);return l!==e&&!(0,c.existsSync)(l)?s.toFile(l).then(()=>l):l})}function S(e){let t=[];if(e.content&&(e.content.uri?t.push(e.content.uri):e.content.url&&t.push(e.content.url)),e.children)for(let n of e.children){let e=S(n);if(e.length>0)for(let n=0;n<e.length;n++)t.push(e[n])}return t}function C(e,t,n){return p(this,void 0,void 0,function*(){let r=new URL(e,t).href,i=_(r,(0,u.join)(n.distPath,m(r,n.baseURL)),n.fetch);n.log(e=>`download: ${r} -> ${e}`,i),yield i,/\.json$/.test(e)&&(yield w(r,n))})}function w(e,t){return p(this,void 0,void 0,function*(){let n=new URL(`tileset_checksum.json`,e).href,r=(0,u.join)(t.distPath,m(n,t.baseURL)),i=null;try{let e=_(n,r,t.fetch);t.log(e=>`download: ${n} -> ${e}`,e),yield e;let{file_md5:a}=JSON.parse(yield(0,l.readFile)(r,`utf8`));if(typeof a==`object`){let e=Object.keys(a);e.length>0&&(i=e)}}catch(e){}if(i&&i.length>0){let e=[];for(let r of i){let i=new URL(r,n).href,a=_(i,(0,u.join)(t.distPath,m(i,t.baseURL)),t.fetch);if(t.log(e=>`download: ${i} -> ${e}`,a),e.push(a),e.length>=10){let t=e;e=[],yield Promise.all(t)}}yield Promise.all(e);return}let a=(0,u.join)(t.distPath,m(e,t.baseURL)),o=_(e,a,t.fetch);t.log(t=>`download: ${e} -> ${t}`,o),yield o;let s=JSON.parse(yield(0,l.readFile)(a,`utf8`));if(s.asset.overview){let n=new URL(s.asset.overview.imageFile,e).href,r=_(n,(0,u.join)(t.distPath,m(n,t.baseURL)),t.fetch);t.log(e=>`download: ${n} -> ${e}`,r),yield r}if(s.asset.trajectories)for(let n of s.asset.trajectories.list){let r=new URL(n.file,e).href,i=_(r,(0,u.join)(t.distPath,m(r,t.baseURL)),t.fetch);t.log(e=>`download: ${r} -> ${e}`,i),yield i}let c=S(s.root);for(let n=0;n<c.length;n+=6){let r=[];for(let i=0;i<6;i++){let a=c[n+i];if(a){let n=C(a,e,t);r.push(n)}}yield Promise.all(r)}})}function T(e,t){return p(this,void 0,void 0,function*(){if(t.log(`process model`),e.model){let{textures:n,layers:r,file:i,textureBase:a}=e.model;if(i){t.log(`process model file`);let r=e.getURL(i),o=_(r,(0,u.join)(t.distPath,m(r,t.baseURL)),t.fetch);if(t.log(e=>`download: ${i} -> ${e}`,o),yield o,n)for(let r of n){let n=h(e.getURL(a==null?``:a),r),i=(0,u.join)(t.distPath,m(n,t.baseURL)),o=_(n,i,t.fetch);t.log(e=>`download: ${n} -> ${e}`,o),yield o;let s=t.imageOptions.format;s.length===0&&s.push(void 0);let c=t.imageOptions.size;c.length===0&&c.push(void 0);let l=[];for(let e of s)for(let n of c){let r=x(i,{format:e,size:n,toFilename:t.imageProcessingFilename});t.log(e=>`imageProcessing: ${i} -> ${e}`,r),l.push(r)}yield Promise.all(l)}}if(r)for(let n of r){let{tileset:r}=n;t.log(`process model layer`),yield w(e.getURL(r),t)}}})}function E(e,t,n){return p(this,void 0,void 0,function*(){let r=(0,u.join)(n.distPath,m(e,n.baseURL)),i=_(e,r,n.fetch);n.log(t=>`download: ${e} -> ${t}`,i),yield i;let a=Math.pow(2,t.level),o=n.imageOptions.format;o.length===0&&o.push(void 0);let s=[];if(a>1)for(let e=0;e<a;e++)for(let i=0;i<a;i++)for(let c of o){let o=[t.size/a*i,t.size/a*e,t.size/a,t.size/a],l=x(r,{format:c,size:t.scale>=1?void 0:t.scale*t.size/a,cut:o,toFilename:n.imageProcessingFilename});if(n.log(e=>`imageProcessing: ${r} -> ${e}`,l),s.push(l),t.level===1&&t.scale>=.5&&(c===`jpg`||/\.jpg$/.test(r))){let e=x(r,{format:c,size:void 0,cut:o,toFilename:n.imageProcessingFilename});n.log(e=>`imageProcessing: ${r} -> ${e}`,e),s.push(e)}}yield Promise.all(s)})}function D(e,t){return p(this,void 0,void 0,function*(){yield Promise.all([E(e.work.getURL(e.front),e,t),E(e.work.getURL(e.back),e,t),E(e.work.getURL(e.left),e,t),E(e.work.getURL(e.right),e,t),E(e.work.getURL(e.up),e,t),E(e.work.getURL(e.down),e,t)])})}function O(e,t,n){return p(this,void 0,void 0,function*(){let r=(0,u.join)(n.distPath,m(e,n.baseURL)),i=_(e,r,n.fetch);n.log(t=>`download: ${e} -> ${t}`,i),yield i;let a=n.imageOptions.format;a.length===0&&a.push(void 0);let o=n.imageOptions.size;o.length===0&&o.push(void 0);for(let r of t){let t=e.replace(/cube\_\d+/,`cube_${r}`),i=(0,u.join)(n.distPath,m(t,n.baseURL)),o=_(t,i,n.fetch);n.log(e=>`download ${t} -> ${i}`,o),yield o;for(let e of a){let t=x(i,{format:e,toFilename:n.imageProcessingFilename});n.log(e=>`imageProcessing: ${i} -> ${e}`,t),yield t}}let s=[];for(let e of a)for(let t of o){let i=x(r,{format:e,size:t,toFilename:n.imageProcessingFilename});n.log(e=>`imageProcessing: ${r} -> ${e}`,i),s.push(i)}yield Promise.all(s)})}function k(e,t){return p(this,void 0,void 0,function*(){let{images:n}=e;yield Promise.all([O(n.work.getURL(n.front),n.sizeList,t),O(n.work.getURL(n.back),n.sizeList,t),O(n.work.getURL(n.left),n.sizeList,t),O(n.work.getURL(n.right),n.sizeList,t),O(n.work.getURL(n.up),n.sizeList,t),O(n.work.getURL(n.down),n.sizeList,t)]),n.tiles&&(yield Promise.all(n.tiles.map(e=>D(e,t))))})}function A(e,t){return p(this,void 0,void 0,function*(){let{observers:n}=e;for(let e of n){let n=k(e,t);t.log(`process observer #${e.index} derived: ${e.derivedIdStr}`,n),yield n}})}function j(e,t){if(t){let n=Date.now();t.then(t=>{let r=Date.now()-n,i=typeof e==`function`?e(t):e;console.log(i+`(${r}ms)`)}).catch(()=>{})}else{let t=typeof e==`function`?e(null):e;console.log(t)}}function M(e){return p(this,arguments,void 0,function*(e,t={}){var n,r,i,a,o,s,d,f,p,m;let h=e.baseURL,g=``;if(t.distPath)g=(0,u.resolve)(process.cwd(),t.distPath);else for(g=(0,u.resolve)(process.cwd(),(n=e.workCode)==null?`work-${Date.now()}`:n);(0,c.existsSync)(g);)/.-(\d+)$/.test(g)?g=g.replace(/.-(\d+)$/,(e,t)=>`-`+(Number(t)+1)):g+=`-1`;let _={baseURL:h,distPath:g,fetch:(r=t.fetch)==null?fetch:r,imageOptions:{size:(a=(i=t.imageOptions)==null?void 0:i.size)==null?[]:a,format:(s=(o=t.imageOptions)==null?void 0:o.format)==null?[]:s},textureOptions:{size:(f=(d=t.textureOptions)==null?void 0:d.size)==null?[]:f,format:(m=(p=t.textureOptions)==null?void 0:p.format)==null?[]:m},log:t.log?j:(()=>Promise.resolve()),imageProcessingFilename:t.imageProcessingFilename};_.log(JSON.stringify(_,null,` `)),yield(0,l.mkdir)(g,{recursive:!0}),yield(0,l.writeFile)((0,u.resolve)(g,`work.json`),JSON.stringify(e.toJSON(),null,` `)),yield A(e,_),yield T(e,_)})}exports.download=M;
255
+ */Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`node:fs`),l=require(`node:fs/promises`),u=require(`node:path`),d=require(`node:stream`),f=require(`sharp`);f=s(f,1);function p(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||(n=Promise))(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function m(e,t){if(t&&t[t.length-1]!==`/`&&(t+=`/`),e.length>t.length&&e.startsWith(t))return e.slice(t.length);throw Error(`${e} is not starting with ${t}`)}function h(...e){let t=[];e=e.map(e=>(e==null?``:e).trim()).filter(e=>e.length>0&&!/^\/+$/.test(e));for(let n=0;n<e.length;n++){let r=n===0,i=n===e.length-1,a=e[n];r||(a=a.replace(/^\.\//,``).replace(/^\/+/,``)),i||(a=a.replace(/\/+$/,``)),t.push(a)}return t.join(`/`)}var g=1024*1024*5;function _(e,t,n){return p(this,void 0,void 0,function*(){var r;if((0,c.existsSync)(t))return t;let i=yield n(e);if(i.ok&&i.body){if(yield(0,l.mkdir)((0,u.dirname)(t),{recursive:!0}),Number((r=i.headers.get(`content-length`))==null?`Infinity`:r)>g)return new Promise((e,n)=>{let r=d.Readable.fromWeb(i.body),a=(0,c.createWriteStream)(t);r.pipe(a),r.on(`error`,n),a.on(`finish`,()=>e(t))});{let e=yield i.arrayBuffer();return yield(0,l.writeFile)(t,Buffer.from(e)),t}}throw Error(`url: ${e}(${i.statusText})`)})}var v=[`jpg`,`png`],y=95;function b(e,t){let n=(0,u.extname)(e).slice(1)||`jpg`,{cut:r,size:i,format:a=n}=t,o=``;if(t.toFilename)o=t.toFilename(e,{cut:t.cut,size:t.size,format:t.format});else{let t=``,s=``,c=a;r&&(t=r.join(`x`)),i&&(s=`${i}x`),c===n&&!s&&!t&&(c=``),o=[e,t,s,c].filter(e=>e.length>0).join(`.`)}return o}function x(e,t){return p(this,void 0,void 0,function*(){let n=(0,u.extname)(e).slice(1)||`jpg`,{cut:r,size:i,format:a=n}=t,o=e;if((r||i)&&a!==n&&v.includes(a)){let n=b(e,{format:a,toFilename:t.toFilename});n!==o&&(0,c.existsSync)(n)&&(o=n)}let s=(0,f.default)(o);r&&(s=s.extract({left:r[0],top:r[1],width:r[2],height:r[3]})),i&&(s=s.resize(i)),s=s.toFormat(a,{quality:y});let l=b(e,t);return l!==e&&!(0,c.existsSync)(l)?s.toFile(l).then(()=>l):l})}function S(e){let t=[];if(e.content&&(e.content.uri?t.push(e.content.uri):e.content.url&&t.push(e.content.url)),e.children)for(let n of e.children){let e=S(n);if(e.length>0)for(let n=0;n<e.length;n++)t.push(e[n])}return t}function C(e,t,n){return p(this,void 0,void 0,function*(){let r=new URL(e,t).href,i=_(r,(0,u.join)(n.distPath,m(r,n.baseURL)),n.fetch);n.log(e=>`download: ${r} -> ${e}`,i),yield i,/\.json$/.test(e)&&(yield w(r,n))})}function w(e,t){return p(this,void 0,void 0,function*(){let n=new URL(`tileset_checksum.json`,e).href,r=(0,u.join)(t.distPath,m(n,t.baseURL)),i=null;try{let e=_(n,r,t.fetch);t.log(e=>`download: ${n} -> ${e}`,e),yield e;let{file_md5:a}=JSON.parse(yield(0,l.readFile)(r,`utf8`));if(typeof a==`object`){let e=Object.keys(a);e.length>0&&(i=e)}}catch(e){}if(i&&i.length>0){let e=[];for(let r of i){let i=new URL(r,n).href,a=_(i,(0,u.join)(t.distPath,m(i,t.baseURL)),t.fetch);if(t.log(e=>`download: ${i} -> ${e}`,a),e.push(a),e.length>=10){let t=e;e=[],yield Promise.all(t)}}yield Promise.all(e);return}let a=(0,u.join)(t.distPath,m(e,t.baseURL)),o=_(e,a,t.fetch);t.log(t=>`download: ${e} -> ${t}`,o),yield o;let s=JSON.parse(yield(0,l.readFile)(a,`utf8`));if(s.asset.overview){let n=new URL(s.asset.overview.imageFile,e).href,r=_(n,(0,u.join)(t.distPath,m(n,t.baseURL)),t.fetch);t.log(e=>`download: ${n} -> ${e}`,r),yield r}if(s.asset.trajectories)for(let n of s.asset.trajectories.list){let r=new URL(n.file,e).href,i=_(r,(0,u.join)(t.distPath,m(r,t.baseURL)),t.fetch);t.log(e=>`download: ${r} -> ${e}`,i),yield i}let c=S(s.root);for(let n=0;n<c.length;n+=6){let r=[];for(let i=0;i<6;i++){let a=c[n+i];if(a){let n=C(a,e,t);r.push(n)}}yield Promise.all(r)}})}function T(e,t){return p(this,void 0,void 0,function*(){if(t.log(`process model`),e.model){let{textures:n,layers:r,file:i,textureBase:a}=e.model;if(i){t.log(`process model file`);let r=e.getURL(i),o=_(r,(0,u.join)(t.distPath,m(r,t.baseURL)),t.fetch);if(t.log(e=>`download: ${i} -> ${e}`,o),yield o,n)for(let r of n){let n=h(e.getURL(a==null?``:a),r),i=(0,u.join)(t.distPath,m(n,t.baseURL)),o=_(n,i,t.fetch);t.log(e=>`download: ${n} -> ${e}`,o),yield o;let s=t.imageOptions.format;s.length===0&&s.push(void 0);let c=t.imageOptions.size;c.length===0&&c.push(void 0);let l=[];for(let e of s)for(let n of c){let r=x(i,{format:e,size:n,toFilename:t.imageProcessingFilename});t.log(e=>`imageProcessing: ${i} -> ${e}`,r),l.push(r)}yield Promise.all(l)}}if(r)for(let n of r){let{tileset:r}=n;t.log(`process model layer`),yield w(e.getURL(r),t)}}})}function E(e,t,n){return p(this,void 0,void 0,function*(){let r=(0,u.join)(n.distPath,m(e,n.baseURL)),i=_(e,r,n.fetch);n.log(t=>`download: ${e} -> ${t}`,i),yield i;let a=Math.pow(2,t.level),o=n.imageOptions.format;o.length===0&&o.push(void 0);let s=[];if(a>1)for(let e=0;e<a;e++)for(let i=0;i<a;i++)for(let c of o){let o=[t.size/a*i,t.size/a*e,t.size/a,t.size/a],l=x(r,{format:c,size:t.scale>=1?void 0:t.scale*t.size/a,cut:o,toFilename:n.imageProcessingFilename});if(n.log(e=>`imageProcessing: ${r} -> ${e}`,l),s.push(l),t.level===1&&t.scale>=.5&&(c===`jpg`||/\.jpg$/.test(r))){let e=x(r,{format:c,size:void 0,cut:o,toFilename:n.imageProcessingFilename});n.log(e=>`imageProcessing: ${r} -> ${e}`,e),s.push(e)}}yield Promise.all(s)})}function D(e,t){return p(this,void 0,void 0,function*(){yield Promise.all([E(e.work.getURL(e.front),e,t),E(e.work.getURL(e.back),e,t),E(e.work.getURL(e.left),e,t),E(e.work.getURL(e.right),e,t),E(e.work.getURL(e.up),e,t),E(e.work.getURL(e.down),e,t)])})}function O(e,t,n){return p(this,void 0,void 0,function*(){let r=(0,u.join)(n.distPath,m(e,n.baseURL)),i=_(e,r,n.fetch);n.log(t=>`download: ${e} -> ${t}`,i),yield i;let a=n.imageOptions.format;a.length===0&&a.push(void 0);let o=n.imageOptions.size;o.length===0&&o.push(void 0);for(let r of t){let t=e.replace(/cube\_\d+/,`cube_${r}`),i=(0,u.join)(n.distPath,m(t,n.baseURL)),o=_(t,i,n.fetch);n.log(e=>`download ${t} -> ${i}`,o),yield o;for(let e of a){let t=x(i,{format:e,toFilename:n.imageProcessingFilename});n.log(e=>`imageProcessing: ${i} -> ${e}`,t),yield t}}let s=[];for(let e of a)for(let t of o){let i=x(r,{format:e,size:t,toFilename:n.imageProcessingFilename});n.log(e=>`imageProcessing: ${r} -> ${e}`,i),s.push(i)}yield Promise.all(s)})}function k(e,t){return p(this,void 0,void 0,function*(){let{images:n}=e;yield Promise.all([O(n.work.getURL(n.front),n.sizeList,t),O(n.work.getURL(n.back),n.sizeList,t),O(n.work.getURL(n.left),n.sizeList,t),O(n.work.getURL(n.right),n.sizeList,t),O(n.work.getURL(n.up),n.sizeList,t),O(n.work.getURL(n.down),n.sizeList,t)]),n.tiles&&(yield Promise.all(n.tiles.map(e=>D(e,t))))})}function A(e,t){return p(this,void 0,void 0,function*(){let{observers:n}=e;for(let e of n){let n=k(e,t);t.log(`process observer #${e.index} derived: ${e.derivedIdStr}`,n),yield n}})}function j(e,t){if(t){let n=Date.now();t.then(t=>{let r=Date.now()-n,i=typeof e==`function`?e(t):e;console.log(i+`(${r}ms)`)}).catch(()=>{})}else{let t=typeof e==`function`?e(null):e;console.log(t)}}function M(e){return p(this,arguments,void 0,function*(e,t={}){var n,r,i,a,o,s,d,f,p,m;let h=e.baseURL,g=``;if(t.distPath)g=(0,u.resolve)(process.cwd(),t.distPath);else for(g=(0,u.resolve)(process.cwd(),(n=e.workCode)==null?`work-${Date.now()}`:n);(0,c.existsSync)(g);)/.-(\d+)$/.test(g)?g=g.replace(/.-(\d+)$/,(e,t)=>`-`+(Number(t)+1)):g+=`-1`;let _={baseURL:h,distPath:g,fetch:(r=t.fetch)==null?fetch:r,imageOptions:{size:(a=(i=t.imageOptions)==null?void 0:i.size)==null?[]:a,format:(s=(o=t.imageOptions)==null?void 0:o.format)==null?[]:s},textureOptions:{size:(f=(d=t.textureOptions)==null?void 0:d.size)==null?[]:f,format:(m=(p=t.textureOptions)==null?void 0:p.format)==null?[]:m},log:t.log?j:(()=>Promise.resolve()),imageProcessingFilename:t.imageProcessingFilename};_.log(JSON.stringify(_,null,` `)),yield(0,l.mkdir)(g,{recursive:!0}),yield(0,l.writeFile)((0,u.resolve)(g,`work.json`),JSON.stringify(e.toJSON(),null,` `)),yield A(e,_),yield T(e,_)})}exports.download=M;
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 2026/5/11
5
- * Version: 6.8.3
4
+ * Generated: 2026/5/13
5
+ * Version: 6.8.4
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021