soonspacejs 2.9.13 → 2.9.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +1 -1
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import*as e from"three";import{Vector3 as t,Euler as n,Box3 as i,Scene as r,Quaternion as s,CubeTextureLoader as o,HalfFloatType as a,EquirectangularReflectionMapping as l,TextureLoader as c,Color as u,Texture as d,FileLoader as h,Vector2 as p,Matrix4 as f,BufferAttribute as m,BufferGeometry as g,Float32BufferAttribute as v,LineBasicMaterial as y,Line as w,Line3 as b,MathUtils as x,CurvePath as A,LineCurve as S,LineCurve3 as E,Bone as T,Uint16BufferAttribute as D,SkinnedMesh as C,Skeleton as M,AnimationClip as I,VectorKeyframeTrack as B,QuaternionKeyframeTrack as P,Object3D as O,InterpolateLinear as R,InterpolateDiscrete as L,EventDispatcher as k,LoopPingPong as N,KeyframeTrack as F,BooleanKeyframeTrack as z,NumberKeyframeTrack as U,ColorKeyframeTrack as j,StringKeyframeTrack as G,NormalAnimationBlendMode as H,REVISION as _,BasicDepthPacking as V,UnsignedByteType as Q,DepthTexture as Y,DepthStencilFormat as W,UnsignedInt248Type as X,UnsignedIntType as K,WebGLRenderTarget as Z,BackSide as q,DoubleSide as J,ShaderMaterial as $,FrontSide as ee,Uniform as te,RepeatWrapping as ne,LoadingManager as ie,NearestFilter as re,LinearFilter as se,LinearMipmapLinearFilter as oe,NoBlending as ae,RGBADepthPacking as le,PerspectiveCamera as ce,Mesh as ue,MeshDepthMaterial as de,LinearEncoding as he,sRGBEncoding as pe,Vector4 as fe,Camera as me,Material as ge,Fog as ve,LineSegments as ye,EdgesGeometry as we,MeshStandardMaterial as be,OrthographicCamera as xe,WebGLRenderer as Ae,PCFSoftShadowMap as Se,Sphere as Ee,DataTexture as Te,NoColorSpace as De,WebGLMultipleRenderTargets as Ce,RedFormat as Me,FloatType as Ie,RGBAFormat as Be,ShaderChunk as Pe,WebGLCubeRenderTarget as Oe,CubeCamera as Re,PMREMGenerator as Le,FramebufferTexture as ke,Matrix3 as Ne,TangentSpaceNormalMap as Fe,GLSL3 as ze,VideoTexture as Ue,GLBufferAttribute as je,InterleavedBufferAttribute as Ge,Frustum as He,MOUSE as _e,TOUCH as Ve,Spherical as Qe,Raycaster as Ye,Clock as We,AnimationMixer as Xe,SRGBColorSpace as Ke,LinearSRGBColorSpace as Ze,UVMapping as qe,ACESFilmicToneMapping as Je,CubeTexture as $e,Sprite as et,SphereGeometry as tt,CircleGeometry as nt,ShapeGeometry as it,Shape as rt,AmbientLight as st,DirectionalLight as ot,HemisphereLight as at,SpotLight as lt,PointLight as ct,RectAreaLight as ut,Loader as dt,LoaderUtils as ht,ClampToEdgeWrapping as pt,Group as ft,PropertyBinding as mt,LinearMipMapLinearFilter as gt,ImageLoader as vt,InstancedMesh as yt,SpriteMaterial as wt,GridHelper as bt,AxesHelper as xt,Box3Helper as At,PlaneGeometry as St,MeshBasicMaterial as Et,DirectionalLightHelper as Tt,HemisphereLightHelper as Dt,SpotLightHelper as Ct,PointLightHelper as Mt,Box2 as It,Plane as Bt,CanvasTexture as Pt,MeshPhongMaterial as Ot}from"three";export*from"three";import{RGBELoader as Rt}from"three/examples/jsm/loaders/RGBELoader.js";import{GLTFExporter as Lt}from"three/examples/jsm/exporters/GLTFExporter.js";import{RoomEnvironment as kt}from"three/examples/jsm/environments/RoomEnvironment.js";import Nt from"three/examples/jsm/libs/stats.module.js";import{Sky as Ft}from"three/examples/jsm/objects/Sky.js";import{mergeGeometries as zt,deinterleaveGeometry as Ut}from"three/examples/jsm/utils/BufferGeometryUtils.js";import"three/examples/jsm/postprocessing/Pass.js";import{WorkerPool as jt}from"three/examples/jsm/utils/WorkerPool.js";import{MeshBVH as Gt,computeBoundsTree as Ht,disposeBoundsTree as _t,acceleratedRaycast as Vt}from"three-mesh-bvh";import{RectAreaLightUniformsLib as Qt}from"three/examples/jsm/lights/RectAreaLightUniformsLib.js";import{TGALoader as Yt}from"three/examples/jsm/loaders/TGALoader.js";import{GLTFLoader as Wt}from"three/examples/jsm/loaders/GLTFLoader.js";import{DRACOLoader as Xt}from"three/examples/jsm/loaders/DRACOLoader.js";import*as Kt from"three/examples/jsm/utils/SkeletonUtils.js";import*as Zt from"three/examples/jsm/libs/fflate.module.js";import{NURBSCurve as qt}from"three/examples/jsm/curves/NURBSCurve.js";import{RectAreaLightHelper as Jt}from"three/examples/jsm/helpers/RectAreaLightHelper.js";var $t="soonspacejs",en="2.9.13",tn="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function nn(){throw new Error("setTimeout has not been defined")}function rn(){throw new Error("clearTimeout has not been defined")}var sn=nn,on=rn;function an(e){if(sn===setTimeout)return setTimeout(e,0);if((sn===nn||!sn)&&setTimeout)return sn=setTimeout,setTimeout(e,0);try{return sn(e,0)}catch(t){try{return sn.call(null,e,0)}catch(t){return sn.call(this,e,0)}}}"function"==typeof tn.setTimeout&&(sn=setTimeout),"function"==typeof tn.clearTimeout&&(on=clearTimeout);var ln,cn=[],un=!1,dn=-1;function hn(){un&&ln&&(un=!1,ln.length?cn=ln.concat(cn):dn=-1,cn.length&&pn())}function pn(){if(!un){var e=an(hn);un=!0;for(var t=cn.length;t;){for(ln=cn,cn=[];++dn<t;)ln&&ln[dn].run();dn=-1,t=cn.length}ln=null,un=!1,function(e){if(on===clearTimeout)return clearTimeout(e);if((on===rn||!on)&&clearTimeout)return on=clearTimeout,clearTimeout(e);try{return on(e)}catch(t){try{return on.call(null,e)}catch(t){return on.call(this,e)}}}(e)}}function fn(e,t){this.fun=e,this.array=t}fn.prototype.run=function(){this.fun.apply(null,this.array)};function mn(){}var gn=mn,vn=mn,yn=mn,wn=mn,bn=mn,xn=mn,An=mn;var Sn=tn.performance||{},En=Sn.now||Sn.mozNow||Sn.msNow||Sn.oNow||Sn.webkitNow||function(){return(new Date).getTime()};var Tn=new Date;var Dn,Cn={nextTick:function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];cn.push(new fn(e,t)),1!==cn.length||un||an(pn)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:gn,addListener:vn,once:yn,off:wn,removeListener:bn,removeAllListeners:xn,emit:An,binding:function(e){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*En.call(Sn),n=Math.floor(t),i=Math.floor(t%1*1e9);return e&&(n-=e[0],(i-=e[1])<0&&(n--,i+=1e9)),[n,i]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-Tn)/1e3}},Mn={Linear:{None:function(e){return e}},Quadratic:{In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}},Cubic:{In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}},Quartic:{In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}},Quintic:{In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}},Sinusoidal:{In:function(e){return 1-Math.cos(e*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return.5*(1-Math.cos(Math.PI*e))}},Exponential:{In:function(e){return 0===e?0:Math.pow(1024,e-1)},Out:function(e){return 1===e?1:1-Math.pow(2,-10*e)},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(2-Math.pow(2,-10*(e-1)))}},Circular:{In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}},Elastic:{In:function(e){return 0===e?0:1===e?1:-Math.pow(2,10*(e-1))*Math.sin(5*(e-1.1)*Math.PI)},Out:function(e){return 0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin(5*(e-.1)*Math.PI)+1},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?-.5*Math.pow(2,10*(e-1))*Math.sin(5*(e-1.1)*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin(5*(e-1.1)*Math.PI)+1}},Back:{In:function(e){var t=1.70158;return e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}},Bounce:{In:function(e){return 1-Mn.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?.5*Mn.Bounce.In(2*e):.5*Mn.Bounce.Out(2*e-1)+.5}}},In="undefined"==typeof self&&void 0!==Cn&&Cn.hrtime?function(){var e=Cn.hrtime();return 1e3*e[0]+e[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now?self.performance.now.bind(self.performance):void 0!==Date.now?Date.now:function(){return(new Date).getTime()},Bn=function(){function e(){this._tweens={},this._tweensAddedDuringUpdate={}}return e.prototype.getAll=function(){var e=this;return Object.keys(this._tweens).map((function(t){return e._tweens[t]}))},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(e){this._tweens[e.getId()]=e,this._tweensAddedDuringUpdate[e.getId()]=e},e.prototype.remove=function(e){delete this._tweens[e.getId()],delete this._tweensAddedDuringUpdate[e.getId()]},e.prototype.update=function(e,t){void 0===e&&(e=In()),void 0===t&&(t=!1);var n=Object.keys(this._tweens);if(0===n.length)return!1;for(;n.length>0;){this._tweensAddedDuringUpdate={};for(var i=0;i<n.length;i++){var r=this._tweens[n[i]],s=!t;r&&!1===r.update(e,s)&&!t&&delete this._tweens[n[i]]}n=Object.keys(this._tweensAddedDuringUpdate)}return!0},e}(),Pn={Linear:function(e,t){var n=e.length-1,i=n*t,r=Math.floor(i),s=Pn.Utils.Linear;return t<0?s(e[0],e[1],i):t>1?s(e[n],e[n-1],n-i):s(e[r],e[r+1>n?n:r+1],i-r)},Bezier:function(e,t){for(var n=0,i=e.length-1,r=Math.pow,s=Pn.Utils.Bernstein,o=0;o<=i;o++)n+=r(1-t,i-o)*r(t,o)*e[o]*s(i,o);return n},CatmullRom:function(e,t){var n=e.length-1,i=n*t,r=Math.floor(i),s=Pn.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(r=Math.floor(i=n*(1+t))),s(e[(r-1+n)%n],e[r],e[(r+1)%n],e[(r+2)%n],i-r)):t<0?e[0]-(s(e[0],e[0],e[1],e[1],-i)-e[0]):t>1?e[n]-(s(e[n],e[n],e[n-1],e[n-1],i-n)-e[n]):s(e[r?r-1:0],e[r],e[n<r+1?n:r+1],e[n<r+2?n:r+2],i-r)},Utils:{Linear:function(e,t,n){return(t-e)*n+e},Bernstein:function(e,t){var n=Pn.Utils.Factorial;return n(e)/n(t)/n(e-t)},Factorial:(Dn=[1],function(e){var t=1;if(Dn[e])return Dn[e];for(var n=e;n>1;n--)t*=n;return Dn[e]=t,t}),CatmullRom:function(e,t,n,i,r){var s=.5*(n-e),o=.5*(i-t),a=r*r;return(2*t-2*n+s+o)*(r*a)+(-3*t+3*n-2*s-o)*a+s*r+t}}},On=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),Rn=new Bn,Ln=function(){function e(e,t){void 0===t&&(t=Rn),this._object=e,this._group=t,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Mn.Linear.None,this._interpolationFunction=Pn.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._id=On.nextId(),this._isChainStopped=!1,this._goToEnd=!1}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.to=function(e,t){return this._valuesEnd=Object.create(e),void 0!==t&&(this._duration=t),this},e.prototype.duration=function(e){return this._duration=e,this},e.prototype.start=function(e){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed)for(var t in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(t),this._valuesStart[t]=this._valuesStartRepeat[t];return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=void 0!==e?"string"==typeof e?In()+parseFloat(e):e:In(),this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this},e.prototype._setupProperties=function(e,t,n,i){for(var r in n){var s=e[r],o=Array.isArray(s),a=o?"array":typeof s,l=!o&&Array.isArray(n[r]);if("undefined"!==a&&"function"!==a){if(l){var c=n[r];if(0===c.length)continue;c=c.map(this._handleRelativeValue.bind(this,s)),n[r]=[s].concat(c)}if("object"!==a&&!o||!s||l)void 0===t[r]&&(t[r]=s),o||(t[r]*=1),i[r]=l?n[r].slice().reverse():t[r]||0;else{for(var u in t[r]=o?[]:{},s)t[r][u]=s[u];i[r]=o?[]:{},this._setupProperties(s,t[r],n[r],i[r])}}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},e.prototype.pause=function(e){return void 0===e&&(e=In()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=e,this._group&&this._group.remove(this)),this},e.prototype.resume=function(e){return void 0===e&&(e=In()),this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=e-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this):this},e.prototype.stopChainedTweens=function(){for(var e=0,t=this._chainedTweens.length;e<t;e++)this._chainedTweens[e].stop();return this},e.prototype.group=function(e){return this._group=e,this},e.prototype.delay=function(e){return this._delayTime=e,this},e.prototype.repeat=function(e){return this._initialRepeat=e,this._repeat=e,this},e.prototype.repeatDelay=function(e){return this._repeatDelayTime=e,this},e.prototype.yoyo=function(e){return this._yoyo=e,this},e.prototype.easing=function(e){return this._easingFunction=e,this},e.prototype.interpolation=function(e){return this._interpolationFunction=e,this},e.prototype.chain=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this._chainedTweens=e,this},e.prototype.onStart=function(e){return this._onStartCallback=e,this},e.prototype.onUpdate=function(e){return this._onUpdateCallback=e,this},e.prototype.onRepeat=function(e){return this._onRepeatCallback=e,this},e.prototype.onComplete=function(e){return this._onCompleteCallback=e,this},e.prototype.onStop=function(e){return this._onStopCallback=e,this},e.prototype.update=function(e,t){if(void 0===e&&(e=In()),void 0===t&&(t=!0),this._isPaused)return!0;var n,i,r=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(e>r)return!1;t&&this.start(e)}if(this._goToEnd=!1,e<this._startTime)return!0;!1===this._onStartCallbackFired&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),i=(e-this._startTime)/this._duration,i=0===this._duration||i>1?1:i;var s=this._easingFunction(i);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,s),this._onUpdateCallback&&this._onUpdateCallback(this._object,i),1===i){if(this._repeat>0){for(n in isFinite(this._repeat)&&this._repeat--,this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[n]||(this._valuesStartRepeat[n]=this._valuesStartRepeat[n]+parseFloat(this._valuesEnd[n])),this._yoyo&&this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];return this._yoyo&&(this._reversed=!this._reversed),void 0!==this._repeatDelayTime?this._startTime=e+this._repeatDelayTime:this._startTime=e+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var o=0,a=this._chainedTweens.length;o<a;o++)this._chainedTweens[o].start(this._startTime+this._duration);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(e,t,n,i){for(var r in n)if(void 0!==t[r]){var s=t[r]||0,o=n[r],a=Array.isArray(e[r]),l=Array.isArray(o);!a&&l?e[r]=this._interpolationFunction(o,i):"object"==typeof o&&o?this._updateProperties(e[r],s,o,i):"number"==typeof(o=this._handleRelativeValue(s,o))&&(e[r]=s+(o-s)*i)}},e.prototype._handleRelativeValue=function(e,t){return"string"!=typeof t?t:"+"===t.charAt(0)||"-"===t.charAt(0)?e+parseFloat(t):parseFloat(t)},e.prototype._swapEndStartRepeatValues=function(e){var t=this._valuesStartRepeat[e],n=this._valuesEnd[e];this._valuesStartRepeat[e]="string"==typeof n?this._valuesStartRepeat[e]+parseFloat(n):this._valuesEnd[e],this._valuesEnd[e]=t},e}(),kn=On.nextId,Nn=Rn,Fn=Nn.getAll.bind(Nn),zn=Nn.removeAll.bind(Nn),Un=Nn.add.bind(Nn),jn=Nn.remove.bind(Nn),Gn=Nn.update.bind(Nn),Hn={Easing:Mn,Group:Bn,Interpolation:Pn,now:In,Sequence:On,nextId:kn,Tween:Ln,VERSION:"18.6.4",getAll:Fn,removeAll:zn,add:Un,remove:jn,update:Gn};const _n="[soonspacejs]: ";var Vn,Qn;!function(e){e.Group="Group",e.Light="Light",e.Model="Model",e.Poi="Poi",e.PoiNode="PoiNode",e.Canvas3D="Canvas3D",e.Topology="Topology",e.Helper="Helper",e.PluginObject="PluginObject"}(Vn||(Vn={})),function(e){e.sbm="SBM",e.sbmx="SBMX",e.dat="DAT",e.glb="GLB",e.gltf="GLTF",e.fbx="FBX"}(Qn||(Qn={}));const Yn="In soonspacejs: ",Wn=(e,t)=>{let n="";for(const e in t)n+=`${e}: ${t[e]};`;console.log(`%c${e}`,n)},Xn={},Kn=e=>{e in Xn||(Xn[e]=!0,console.warn(Yn+e))},Zn=e=>{e in Xn||(Xn[e]=!0,console.error(Yn+e))};function qn(e){return e instanceof t?e:new t(e.x,e.y,e.z)}function Jn(e){return e instanceof n?e:new n(e.x,e.y,e.z)}function $n(e){const t=new i;return e instanceof r?e.children.filter((e=>!("isTransformControls"in e))).reduce(((e,t)=>e.union((new i).setFromObject(t))),t):t.setFromObject(e),t.isEmpty()&&(e.getWorldPosition(t.min),t.max.copy(t.min)),t}function ei(e,t,n){const i=n.clone();return Math.abs(t[e]-n[e])>Math.PI&&(t[e]>n[e]?i[e]+=2*Math.PI:i[e]-=2*Math.PI),i}function ti(e,t){const i=ei("x",e,t),r=ei("y",e,t),s=ei("z",e,t);return new n(i.x,r.y,s.z,t.order)}function ni(e){return Math.PI/180*e}function ii(e,i=!0){return i?{position:e.getWorldPosition(new t),rotation:(new n).setFromQuaternion(e.getWorldQuaternion(new s)),scale:e.getWorldScale(new t)}:{position:e.position.clone(),rotation:e.rotation.clone(),scale:e.scale.clone()}}function ri(e,t,n=!0){const i=ii(t,n);e.position.copy(i.position),e.rotation.copy(i.rotation),e.scale.copy(i.scale)}function si(e){return!!e.visible&&(!e.parent||si(e.parent))}const oi=new t,ai=new t,li=new t,ci=(e,t,n,i=1)=>{const r=oi.set(e.x/n.width*2-1,-e.y/n.height*2+1,i);return r.unproject(t),r},ui=(e,t,n,i)=>{const r=((e,t,n)=>{const i=n.width/2,r=n.height/2;t.updateMatrixWorld();const s=e.project(t);return s.x=s.x*i+i,s.y=-s.y*r+r,s})(li.copy(e),n,i);let s=0;for(let o=0;o<2;++o){const a=ai.copy(r).setComponent(o,r.getComponent(o)+t),l=ci(a,n,i,a.z);s=Math.max(s,e.distanceTo(l))}return s};class di{constructor(){this.min=null,this.roots=[],this.nodes=new Map}shift(){const e=this.min;if(null===e||this.roots.length<1)return this.min=null,e;this.remove(e),this.roots.length>50&&this.consolidate();let t=1/0;const n=this.roots.length;for(let e=0;e<n;e++){const n=this.roots[e],i=this.getDistance(n);i<t&&(t=i,this.min=n)}return e}consolidate(){const e=[[],[],[],[],[],[],[]],t=e.length-1,n=this.roots.length;for(let i=0;i<n;i++){const n=this.roots[i],r=this.nodes.get(n);r&&r.depth<t&&e[r.depth].push(n)}for(let n=0;n<=t;n++)for(;e[n].length>1;){const i=e[n].shift(),r=e[n].shift(),s=n+1;let o=-1;if(void 0!==i&&void 0!==r){const n=this.nodes.get(i),a=this.nodes.get(r);n&&a&&(n.distance<a.distance?(n.depth=s,n.children.push(r),a.parent=i,s<=t&&e[s].push(i),o=this.roots.indexOf(r)):(a.depth=s,a.children.push(i),n.parent=r,s<=t&&e[s].push(r),o=this.roots.indexOf(i)))}o>-1&&this.roots.splice(o,1)}}add(e,t){if(this.nodes.set(e,{nodeIndex:e,distance:t,depth:0,parent:null,children:[]}),null===this.min)this.min=e;else{const n=this.nodes.get(this.min);n&&t<n.distance&&(this.min=e)}this.roots.push(e)}update(e,t){this.remove(e),this.add(e,t)}remove(e){var t,n;if(!this.nodes.has(e))return;const i=null===(t=this.nodes.get(e))||void 0===t?void 0:t.children;if(i&&i.length>0)for(let t=0;t<i.length;t++){const n=i[t],r=this.nodes.get(n),s=this.nodes.get(e);r&&s&&(r.parent=s.parent),r&&null===r.parent&&this.roots.push(n)}let r=null===(n=this.nodes.get(e))||void 0===n?void 0:n.parent;if(null===r){const t=this.roots.indexOf(e);t>-1&&this.roots.splice(t,1)}else for(;r;){const e=this.nodes.get(r);e&&(e.depth--,r=e.parent)}}getDistance(e){const t=this.nodes.get(e);return t?t.distance:1/0}}async function hi({path:e="",file:t}){if(Array.isArray(t))return(new o).setPath(e).loadAsync(t);{const n=Gi(t);if("hdr"===n||"pic"===n){const n=await(new Rt).setPath(e).setDataType(a).loadAsync(t);return n.mapping=l,n}{const n=await(new c).setPath(e).loadAsync(t);return n.mapping=l,n}}}function pi(e){if(!e)return null;const{colors:t,stops:n,size:i=1024}=e,r=document.createElement("canvas"),s=r.getContext("2d");if(!s)return null;r.width=16,r.height=i;const o=s.createLinearGradient(0,0,0,i),a=new u,l=t.map((e=>a.set(e).getStyle()));for(let e=0,t=l.length-1;e<=t;e++)o.addColorStop(n?n[e]:e/t,l[e]);s.fillStyle=o,s.fillRect(0,0,16,i);const c=new d(r);return c.needsUpdate=!0,c}const fi=e=>{const t=e.lastIndexOf("/");return-1===t?"./":e.slice(0,t+1)};function mi(e){return ki(e)?function(e){return e.map((e=>mi(e)))}(e):Ni(e)?function(e){if(Ni(e)){const t={};for(const n in e)t[n]=mi(e[n]);return t}return e}(e):e}const gi=(e,t)=>ki(e)?e.map(t):t(e),vi=e=>gi(e,(e=>e.clone())),yi=e=>gi(e,(e=>e.dispose())),wi=new h,bi=async(e,t)=>(wi.setResponseType(t),wi.loadAsync(e)),xi=new t,Ai=new t,Si=new t;function Ei(e,t){const n=xi.setFromMatrixPosition(e.matrixWorld),i=Ai.setFromMatrixPosition(t.matrixWorld),r=n.sub(i),s=Si.setFromMatrixColumn(t.matrixWorld,2).normalize().negate();return r.angleTo(s)>Math.PI/2}function Ti(e,t,n,i){const r=xi.setFromMatrixPosition(e.matrixWorld),s=r.clone();s.project(t),n.setFromCamera(new p(s.x,s.y),t);const o=n.intersectObjects(i,!0);if(o.length){const e=o[0].distance;return r.distanceTo(n.ray.origin)<e}return!0}function Di(e,t){const n=e.parent,{occludeThrottle:i}=n;let r=!0;if(Li(i)&&Li(e.userData.delta)&&(r=performance.now()-e.userData.delta>i),r&&n.occlude){const n=!Ei(e,t.camera)&&Ti(e,t.camera,t.raycaster,t.scener.intersectsList.getAll());e.visible=n,e.userData.delta=performance.now()}}const Ci=e=>{"function"==typeof requestIdleCallback?requestIdleCallback(e):setTimeout(e)};var Mi=function(){function e(){}return e.prototype.toJson=function(e,t){var n=this.xmlStringToXmlDom(e),i=this.xmlToJson(n);return t?(t.removeLineBreaks&&this.removeLineBreaks(i),t.removeComments&&this.removeCommentProperties(i),t.transformTextOnly&&this.transformTextOnly(i),i):i},e.prototype.xmlStringToXmlDom=function(e){return(new DOMParser).parseFromString(e,"text/xml")},e.prototype.removeLineBreaks=function(e){var t=this;Object.keys(e).forEach((function(n,i){"#text"===n&&Array.isArray(e[n])&&delete e[n],"object"==typeof e[n]&&t.removeLineBreaks(e[n])}))},e.prototype.removeCommentProperties=function(e){var t=this;Object.keys(e).forEach((function(n,i){"#comment"===n&&delete e[n],"object"==typeof e[n]&&t.removeCommentProperties(e[n])}))},e.prototype.transformTextOnly=function(e){var t=this;Object.keys(e).forEach((function(n,i){var r=Object.keys(e[n]).length>1,s=Object.keys(e[n])[0];r||"object"==typeof e[n][s]?t.transformTextOnly(e[n]):"object"==typeof e[n]&&e[n]["#text"]&&(e[n]=e[n]["#text"])}))},e.prototype.xmlToJson=function(e){var t={};if(1==e.nodeType){if(e.attributes.length>0){t._attributes={};for(var n=0;n<e.attributes.length;n++){var i=e.attributes.item(n);t._attributes[i.nodeName]=i.nodeValue}}}else 3==e.nodeType&&(t=e.nodeValue);if(e.hasChildNodes())for(var r=0;r<e.childNodes.length;r++){var s=e.childNodes.item(r),o=s.nodeName;if(void 0===t[o])t[o]=this.xmlToJson(s);else{if(void 0===t[o].push){var a=t[o];t[o]=[],t[o].push(a)}t[o].push(this.xmlToJson(s))}}return t},e}();function Ii(e){return bi(e,"text").then((e=>Promise.resolve(function(e){return(new Mi).toJson(e,{transformTextOnly:!0,removeComments:!0,removeLineBreaks:!0})}(e))))}class Bi{name="EXT_mesh_gpu_instancing";constructor(e){this.writer=e}writeNode(e,n){if(!0!==e.isInstancedMesh)return;const i=e.count,r=new f,o=new Float32Array(3*i),a=new Float32Array(4*i),l=new Float32Array(3*i),c=new t,u=new s,d=new t;for(let t=0;t<i;t++)e.getMatrixAt(t,r),r.decompose(c,u,d),o[3*t]=c.x,o[3*t+1]=c.y,o[3*t+2]=c.z,a[4*t]=u.x,a[4*t+1]=u.y,a[4*t+2]=u.z,a[4*t+3]=u.w,l[3*t]=d.x,l[3*t+1]=d.y,l[3*t+2]=d.z;const h=this.writer,p={};p.attributes={TRANSLATION:h.processAccessor(new m(o,3)),ROTATION:h.processAccessor(new m(a,4)),SCALE:h.processAccessor(new m(l,3))},n.extensions=n.extensions||{},n.extensions[this.name]=p,h.extensionsUsed[this.name]=!0}}const Pi=Object.prototype.hasOwnProperty,Oi=e=>"String"===zi(e),Ri=e=>"Boolean"===zi(e),Li=e=>"Number"===zi(e),ki=Array.isArray,Ni=e=>"Object"===zi(e),Fi=e=>"Function"===zi(e),zi=e=>Object.prototype.toString.call(e).slice(8,-1),Ui=(e,t,n)=>String.fromCodePoint(...new Uint8Array(e,t,n)),ji=()=>_n+Math.random().toString(36).substring(7).split("").join("_"),Gi=e=>{var t;const{href:n}=new URL(e,location.origin);if(n.includes(".")){const e=n.split(".").pop();if(!e)return;return e.includes("?")?null===(t=e.split("?").shift())||void 0===t?void 0:t.toLowerCase():e}};var Hi=Object.freeze({__proto__:null,IVector3ToEuler:Jn,IVector3ToVector3:qn,MinHeap:di,calculateScaleFactor:ui,cloneDeep:mi,cloneMaterials:vi,consoleSspTitle:Yn,deg2Euler:ni,disposeMaterials:yi,error:Zn,euler2Deg:function(e){return e/(Math.PI/180)},exportGltf:function(e,t={}){return new Promise(((n,i)=>{const r=new Lt;r.register((e=>new Bi(e))),r.parse(e,(e=>n(e)),(e=>i(e)),t)}))},fetchFile:bi,getAsciiString:Ui,getBoundingBox:$n,getExtension:Gi,getSpaceAttributeFromObject:ii,getTexture:hi,getValueType:zi,gradientTexture:pi,hasOwn:(e,t)=>Pi.call(e,t),idleTask:Ci,isArray:ki,isBoolean:Ri,isDate:e=>"Date"===zi(e),isFunction:Fi,isNull:e=>"Null"===zi(e),isNumber:Li,isObject:Ni,isObjectBehindCamera:Ei,isObjectOccludeVisible:Ti,isObjectVisible:si,isPromise:e=>"Promise"===zi(e),isString:Oi,isSymbol:e=>"Symbol"===zi(e),isUndefined:e=>"Undefined"===zi(e),log:Wn,materialHandle:gi,parseFilePath:fi,poiNodeOccludeHandler:Di,randomString:ji,rotationAFix:ti,rotationAxisFix:ei,sleep:e=>new Promise((t=>setTimeout((()=>t()),e))),syncSpaceAttributeToObject:ri,warn:Kn,xmlToJson:Ii});const _i={"Linear.None":Mn.Linear.None,"Quadratic.In":Mn.Quadratic.In,"Quadratic.Out":Mn.Quadratic.Out,"Quadratic.InOut":Mn.Quadratic.InOut,"Cubic.In":Mn.Cubic.In,"Cubic.Out":Mn.Cubic.Out,"Cubic.InOut":Mn.Cubic.InOut,"Quartic.In":Mn.Quartic.In,"Quartic.Out":Mn.Quartic.Out,"Quartic.InOut":Mn.Quartic.InOut,"Quintic.In":Mn.Quintic.In,"Quintic.Out":Mn.Quintic.Out,"Quintic.InOut":Mn.Quintic.InOut,"Sinusoidal.In":Mn.Sinusoidal.In,"Sinusoidal.Out":Mn.Sinusoidal.Out,"Sinusoidal.InOut":Mn.Sinusoidal.InOut,"Exponential.In":Mn.Exponential.In,"Exponential.Out":Mn.Exponential.Out,"Exponential.InOut":Mn.Exponential.InOut,"Circular.In":Mn.Circular.In,"Circular.Out":Mn.Circular.Out,"Circular.InOut":Mn.Circular.InOut,"Elastic.In":Mn.Elastic.In,"Elastic.Out":Mn.Elastic.Out,"Elastic.InOut":Mn.Elastic.InOut,"Back.In":Mn.Back.In,"Back.Out":Mn.Back.Out,"Back.InOut":Mn.Back.InOut,"Bounce.In":Mn.Bounce.In,"Bounce.Out":Mn.Bounce.Out,"Bounce.InOut":Mn.Bounce.InOut};function Vi(e,t,i={},r,s){return new Promise(((o,a)=>{const{duration:l=1e3,delay:c=0,repeat:u=!1,mode:d="Linear.None",yoyo:h=!1}=i,p=_i[d],f=new Ln(e).to(t,l).easing(p).delay(c).onUpdate((i=>{e instanceof n&&t instanceof n&&i instanceof n&&(i.order=t.order),null==r||r(i,f)})).onComplete((()=>{o()})).onStop((()=>{a("animation stop")})).onStart((()=>{null==s||s(f)}));Li(u)?f.repeat(u):Ri(u)&&u&&f.repeat(1/0),f.yoyo(h),f.start()}))}class Qi{constructor(e,t,n={}){this.target=e,this.points=t,this.speed=1,this.reverse=!1,this.needsRotate=!0,this.index=1,this._tween=null,Object.assign(this,n)}get isPlaying(){var e;return!!(null===(e=this._tween)||void 0===e?void 0:e.isPlaying())}async play(){if(this.isPlaying)return!1;this.index=1;let e=this.points.slice();return this.reverse&&(e=e.reverse()),this._play(e)}async _play(e){var t,n;const{target:i}=this,r=null!==(t=this.speed)&&void 0!==t?t:1,s=this.index;let o=e[s-1];if(!o)return!0;o.isVector3||(o=qn(o)),o=o.clone();let a=e[s];if(!a)return!0;a.isVector3||(a=qn(a).clone()),a=a.clone();const l=o.distanceTo(a)/r;this.needsRotate&&(1===s&&i.parent&&i.position.copy(i.parent.worldToLocal(o.clone())),i.lookAt(a)),await Vi(o,a,{duration:l},((e,t)=>{var n;if(i.parent){const t=i.parent.worldToLocal(e.clone());i.position.copy(t)}null===(n=this.onUpdate)||void 0===n||n.call(this,e,t)}),(e=>{var t,n;1===s&&(null===(t=this.onStart)||void 0===t||t.call(this,e)),null===(n=this.onEveryStart)||void 0===n||n.call(this,e),this._tween=e})),null===(n=this.onPoint)||void 0===n||n.call(this,s,a),this.index++,await this._play(e)}pause(){var e;null===(e=this._tween)||void 0===e||e.pause()}resume(){var e;null===(e=this._tween)||void 0===e||e.resume()}stop(){var e;null===(e=this._tween)||void 0===e||e.stop(),this._tween=null}}function Yi(e){var t=typeof e;return null==e||"object"!==t&&"function"!==t}var Wi,Xi=(e=>(e[e.x=0]="x",e[e.y=1]="y",e[e.z=2]="z",e))(Xi||{});(Wi=Xi||(Xi={})).toKey=function(e){return Wi[e]},Wi.toIndex=function(e){return Wi[e]},Wi.getCrossAxiss=function(e){return[(e+1)%3,(e+2)%3]};var Ki=(e=>(e[e.x=0]="x",e[e.y=1]="y",e[e.z=2]="z",e[e.w=3]="w",e))(Ki||{});(e=>{e.toKey=function(t){return e[t]},e.toIndex=function(t){return e[t]},e.getCrossAxiss=function(e){return[(e+1)%4,(e+2)%4]}})(Ki||(Ki={}));var Zi=Object.defineProperty,qi=(e,t,n)=>(((e,t,n)=>{t in e?Zi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);function Ji(e,t){if(t=t??e.arcLengthDivisions,e.cacheArcULengths&&e.cacheArcULengths.length===t+1&&!e.needsUpdate){const n=e.cacheArcULengths;return{lengths:n,length:n[t]}}e.needsUpdate=!1;const n=[0];let i=e.getPoint(0),r=0;for(let s=1;s<=t;s++){const o=e.getPointAt(s/t);r+=o.distanceTo(i),n.push(r),i=o}return e.cacheArcULengths=n,{lengths:n,length:r}}function $i(e,t,n){const i=n?t=>e.getPointAt(t):t=>e.getPoint(t);let r=i(0),s=0;const o=[],a=t.length;for(let e=0;e<a;e++){const n=i(t[e]);s+=n.distanceTo(r),o.push(s),r=n}return{lengths:o,length:o[a-1]}}function er(e,t){let n=e.sampleLength;if(!n){const t=e.sampleNum;if(t)return t;n=1}return Math.ceil(t/n)}function tr(e){const{curve:t}=e;let n=t.getLength();const i=er(e,n);return t.arcLengthDivisions<i&&(t.arcLengthDivisions=i,t.updateArcLengths(),n=t.getLength()),{length:n,division:i}}function nr(e,t){const n=er(t??{},e.getLength()),i=e.getPoints(n),r=e.getLengths(n);return ir(i,{...t,lengths:r})}function ir(e,t){const{startColor:n,endColor:i,color:r,lengths:s}=t??{},o=r?new u(r):null,a=n?new u(n):o??new u(0,1,0),l=i?new u(i):o??new u(0,0,1),c=[],d=[];e[0].toArray(c,0);const h=c.length,p=s??sr(e).lengths,f=p[p.length-1],m=new u;e.forEach(((e,t)=>{e.toArray(c,t*h);const n=p[t]/f;m.lerpColors(a,l,n),m.toArray(d,3*t)}));const y=new g;return y.setAttribute("position",new v(c,h)),y.setAttribute("color",new v(d,3)),y}function rr(e,t){t=t??{};let{material:n,linewidth:i}=t;i=i??1,n=n??new y({vertexColors:!0,linewidth:i});const r=Array.isArray(e)?ir(e,t):nr(e,t);return new w(r,n)}function sr(e){const t=or(e),n=[0],i=t.reduce(((e,t)=>(e+=t.distance(),n.push(e),e)),0);return{lines:t,lengths:n,length:i}}function or(e){const t=[];return e.reduce(((e,n)=>{const i=new b(e,n);return t.push(i),n})),t}function ar(e,t){const n=[];return{lines:t.filter(((t,i)=>{const r=t.closestPointToPointParameter(e),s=0<=r||r>=1;return s&&n.push(i),s})),indexs:n}}function lr(e,t){const{distSortIndexs:n,clampDists:i,clampPoints:r,ts:s,clampTs:o}=cr(e,t),a=n[0];return{line:t[a],index:a,clampDist:i[a],clampPoint:r[a],t:s[a],clampT:o[a]}}function cr(e,n){const i={clampDists:[],clampPoints:[],distSortIndexs:[],ts:[],clampTs:[]};return n.forEach(((n,r)=>{const s=n.closestPointToPointParameter(e),o=x.clamp(s,0,1),a=n.at(o,new t),l=e.distanceTo(a);i.clampDists.push(l),i.clampPoints.push(a),i.distSortIndexs.push(r),i.ts.push(s),i.clampTs.push(o)})),i.distSortIndexs.sort(((e,t)=>i.clampDists[e]-i.clampDists[t])),i}function ur(e){const t=new A,n=null==e[0].z?S:E;return e.reduce(((e,i)=>{const r=new n(e,i);return t.add(r),i})),t}var dr=(e=>(e.back="back",e.front="front",e))(dr||{});function hr(e){const{curve:t,distance:n,fromU:i=0,side:r,tolerance:s=.1*n}=e,o=e.length??t.getLength(),a=t.getPointAt(i);let l=n/o;const c="front"===r?-1:1;let u=!0,d=i,h=a,p=0,f=!0;do{d=c*l+i;let e=!1;d>1?(d=1,e=!0):d<0&&(d=0,e=!0),h=t.getPointAt(d),p=h.distanceTo(a),u=Math.abs(n-p)>s;const r=n/p;if(e&&u&&r>1){f=!1;break}l*=r}while(u);return{succeed:f,u:d,point:h,distance:p}}function pr(e){const{curve:t,distance:n,fromU:i=0,tolerance:r=.1*n,origin:s}=e,o=e.length??t.getLength(),a=t.getPointAt(i),l=a.distanceTo(s),c=n-l;let u=c/o,d=!0,h=i,p=a;do{h=u+i;let e=!1;h>1?(h=1,e=!0):h<0&&(h=0,e=!0),p=t.getPointAt(h);const o=p.distanceTo(s);d=Math.abs(n-o)>r;const a=c/(o-l);if(e&&d&&a>1)return null;u*=a}while(d);return{u:h,point:p}}const fr=new t,mr=new t(1,1,1);new s;const gr=new f;function vr(e){const{joints:t,axials:n}=e;if(t)var i=wr(t);else i=n?yr(e):br(e);return i}function yr(e){const{axials:t,start:n}=e,i=new T;n&&(i.position.copy(n),i.updateMatrix());const r=[i];return t.reduce(((e,t)=>{const n=new T;return n.position.copy(t),e.add(n),r.push(n),n.updateMatrix(),n}),i),i.updateWorldMatrix(!0,!0),r}function wr(e){const t=[];return e.reduce(((e,n)=>{const i=n.clone().sub(e);return t.push(i),n})),yr({axials:t,start:e[0]})}function br(e){const{start:t,axial:n}=e;let i=e.number;const r=new Array(i-1);return r.fill(n),yr({axials:r,start:t})}function xr(e){const{geometry:n,flexible:i=1,axial:r,number:o}=e,a=e.start??new t,l=r.clone().normalize(),c=r.length(),u=o-1,d=(new s).setFromUnitVectors(new t(1,0,0),l),h=(new f).compose(a,d,new t(1,1,1)).invert(),p=n.getAttribute("position").clone(),m=p.count;p.applyMatrix4(h);const g=[],y=[];for(let e=0;e<m;e++){const t=p.getX(e);if(t<0){g.push(0,0,0,0),y.push(1,0,0,0);continue}const n=Math.trunc(t/c);if(n<u){const e=t%c/c*i;g.push(n,n+1,0,0),y.push(1-e,e,0,0)}else g.push(u,0,0,0),y.push(1,0,0,0)}return n.setAttribute("skinIndex",new D(g,4)),n.setAttribute("skinWeight",new v(y,4)),n}function Ar(e){const{skeleton:n,geometryFrame:i}=e,r=n.boneInverses[0].clone().invert(),s=n.boneInverses[1].clone().invert();if(i){const e=i.clone().invert();r.premultiply(e),s.premultiply(e)}const o=(new t).setFromMatrixPosition(r),a=(new t).setFromMatrixPosition(s);return a.sub(o),xr({...e,start:o,axial:a,number:n.bones.length})}function Sr(e){const{skeleton:n,geometry:i,flexible:r=1,geometryFrame:s}=e,o=(null==s?void 0:s.clone().invert())??gr.clone(),a=or(n.boneInverses.map((e=>{const n=e.clone().invert().premultiply(o);return(new t).setFromMatrixPosition(n)}))),l=i.getAttribute("position"),c=l.count,u=[],d=[],h=new t;for(let e=0;e<c;e++){h.fromBufferAttribute(l,e);const{index:t,clampT:n}=lr(h,a),i=n*r;u.push(t,t+1,0,0),d.push(1-i,i,0,0)}return i.setAttribute("skinIndex",new D(u,4)),i.setAttribute("skinWeight",new v(d,4)),i}function Er(e){const{geometry:t}=e,n=e.material??void 0,i=new C(t,n),r=vr(e);i.add(r[0]);const s=new M(r);return i.bind(s),Sr({...e,skeleton:s}),i}function Tr(e){const{skeleton:t}=e,n=Dr(e);return n.updateMatrix(),n.updateMatrixWorld(),n.bind(t),n}function Dr(e){const{target:t,skeleton:n}=e,i=t.geometry,r=new C;return t.copy.call(r,t,!1),Sr({...e,geometry:i,skeleton:n,geometryFrame:t.matrixWorld}),r}function Cr(e){const{target:t}=e;let{skeleton:n}=e;if(n)var i=n.bones[0];else{const t=vr(e);n=new M(t),i=t[0]}t.add(i),t.updateWorldMatrix(!1,!0),n.calculateInverses(),i.removeFromParent();const r=Mr({...e,target:t,skeleton:n});return r.add(i),{model:r,skeleton:n,rootBone:i}}function Mr(e){const{target:t,skeleton:n,parent:i,posOnBone:r}=e,s=t.isMesh,o=s?Dr({...e,skeleton:n}):t.clone(!1);i&&i.add(o),o.updateMatrixWorld(!0),s&&(o.bind(n,t.matrixWorld),r&&(o.frustumCulled=!1));const a=t.children;for(const t of a)Mr({...e,target:t,parent:o});return o}function Ir(e){return e.filter((e=>{var t;return!(null!=(t=e.parent)&&t.isBone)}))}function Br(e){return e.find((e=>{var t;return!(null!=(t=e.parent)&&t.isBone)}))}function Pr(e){return Br(e)??e[0]}function Or(e){return e.curve?Rr(e):Ur(e)}function Rr(e){const{keyframeTracks:t,duration:n,...i}=Lr(e);return{...i,clip:new I(e.name,n,t)}}function Lr(e){const{curve:t,lookDistance:n}=e,i=e.targetPath??"",r=tr(e).division,s=kr(e,t.getLength()),o=R,a=[],l=Fr(r),c={...e,duration:s,division:r,ts:l,lookPoint:{distance:n}},u=zr(c),{points:d,rotates:h,...p}=Nr(c);if(d.length){const e=[];d.forEach(((t,n)=>{t.toArray(e,3*n)}));const t=new B(`${i}.position`,u,e,o);a.push(t)}if(h.length){const e=[];h.forEach(((t,n)=>{t.toArray(e,4*n)}));const t=new P(`${i}.quaternion`,u,e,o);a.push(t)}return{...p,keyframeTracks:a,duration:s}}function kr(e,t){let n=e.duration;if(!n){const i=e.speed;if(null==i)throw"缺少选项 duration 或者 speed";if(!t)throw"缺少参数 length";n=t/i}return n}function Nr(e){var n,i;const{curve:r,target:o,lookPoint:a,enableUp:l,fixUp:c}=e,u=e.position??!0,d=e.rotate??!0,h=[],p=[],m=[];if(!u&&!d)return{rotates:h,points:p,curveLength:void 0,lengths:void 0};const g=(e.anchor??fr).clone(),v=e.ts??e.us,y=!e.ts;if(!v)throw"缺少参数:至少传递 ts 和 us 任意之一";let w=gr.clone(),b=gr.clone(),x=mr.clone(),A=O.DEFAULT_UP;o&&(o.updateWorldMatrix(!0,!1),w=o.matrix,b=o.matrixWorld,x=o.scale,A=o.up);const S=w.clone().invert(),E=b.clone().multiply(S).clone().invert(),T=r.getTangent(0);T.transformDirection(E);const D=(null==(n=e.front)?void 0:n.clone().normalize())??T,C=(null==(i=e.up)?void 0:i.clone().normalize())??A.clone().transformDirection(E);let M=w.clone().setPosition(0,0,0),I=e=>r.getPoint(e),B=e=>r.getTangent(e);y&&(I=e=>r.getPointAt(e),B=e=>r.getTangentAt(e));const P=v.length,R=P-1;let{distance:L,curveLength:k,lengths:N}=a??{};L=L??0;let F=B;0!==L&&(N||(N=$i(r,v,y).lengths),null==k&&(k=N[R]),F=(e,t)=>{const n=I(e);let i=(N[t]+L)/k;return i>1&&(i=1),r.getPointAt(i).sub(n).normalize()});let z=e=>{const t=v[e],n=F(t,e);n.transformDirection(E),m.push(n);const i=e-1,r=i<0,o=r?D:m[i],a=(new s).setFromUnitVectors(o,n);if(!r){const e=h[i];a.multiply(e)}return a.normalize()};if(l){const e=new t(0,1,0);z=c?function(t){const n=v[t],i=F(n,t);i.transformDirection(E),m.push(i);const r=t-1;let o;if(r<0)o=(new s).setFromUnitVectors(D,i);else{const e=h[r],t=D.clone().applyQuaternion(e).normalize();o=(new s).setFromUnitVectors(t,i),o.multiply(e)}const a=C.clone().applyQuaternion(o).normalize(),l=(new s).setFromUnitVectors(a,e);return o.premultiply(l),o.normalize()}:function(t){const n=v[t],i=F(n,t);i.transformDirection(E),m.push(i);const r=t-1,o=r<0,a=o?D:m[r],l=(new s).setFromUnitVectors(a,i);if(o){const t=C.clone().applyQuaternion(l);t.projectOnPlane(i).normalize();const n=e.clone().projectOnPlane(i).normalize(),r=(new s).setFromUnitVectors(t,n);l.premultiply(r)}else{const e=h[r];l.multiply(e)}return l.normalize()}}for(let e=0;e<P;e++){const t=v[e];if(d){const t=z(e);h.push(t),M=(new f).compose(fr,t,x)}if(u){const e=I(t);e.applyMatrix4(E);const n=g.clone().applyMatrix4(M);e.sub(n),p.push(e)}}return{rotates:h,points:p,curveLength:k??void 0,lengths:N??void 0}}function Fr(e){const t=[];for(let n=0;n<=e;n++)t.push(n/e);return t}function zr(e){const{curve:t,division:n,duration:i}=e,r=t.getLengths(n),s=r[r.length-1];return r.map((e=>e/s*i))}function Ur(e){const{smooth:t,points:n}=e;if(!1===t)var{keyframeTracks:i,duration:r,...s}=jr(e);else{const t=ur(n);var{keyframeTracks:i,duration:r,...s}=Lr({...e,curve:t})}return{...s,clip:new I(e.name,r,i)}}function jr(e){const t=e.targetPath??"",n=e.points,{lines:i,length:r,lengths:s}=sr(n),o=kr(e,r),a=[],l=s.map((e=>e/r*o)),{points:c,pointTimes:u,rotates:d,rotateTimes:h}=Gr({...e,times:l},i);if(c.length){const e=[];c.forEach(((t,n)=>{t.toArray(e,3*n)}));const n=new B(`${t}.position`,u,e,R);a.push(n)}if(d.length){const e=[];d.forEach(((t,n)=>{t.toArray(e,4*n)}));const n=new P(`${t}.quaternion`,h,e,L);a.push(n)}return{keyframeTracks:a,duration:o,lengths:s,curveLength:r}}function Gr(e,n){var i,r;const{points:o,target:a,times:l,enableUp:c,fixUp:u}=e,d=e.position??!0,h=e.rotate??!0,p=o.length,m=p-1;n=n??or(o);const g=[],v=[],y=[],w=[],b={rotates:g,points:v,rotateTimes:l,pointTimes:y};if(!d&&!h)return b;const x=(e.anchor??fr).clone();let A=gr.clone(),S=gr.clone(),E=mr.clone(),T=O.DEFAULT_UP;a&&(a.updateWorldMatrix(!0,!1),A=a.matrix,S=a.matrixWorld,E=a.scale,T=a.up);const D=A.clone().invert(),C=S.clone().multiply(D).clone().invert(),M=n[0].delta(new t);M.transformDirection(C);const I=(null==(i=e.front)?void 0:i.clone().normalize())??M,B=(null==(r=e.up)?void 0:r.clone().normalize())??T.clone().transformDirection(C);let P=A.clone().setPosition(0,0,0),R=P,L=e=>{const i=n[e].delta(new t).normalize();i.transformDirection(C),w.push(i);const r=e-1,o=r<0,a=o?I:w[r],l=(new s).setFromUnitVectors(a,i);if(!o){const e=g[r];l.multiply(e)}return l.normalize()};if(c){const e=new t(0,1,0);L=u?function(i){const r=n[i].delta(new t).normalize();r.transformDirection(C),w.push(r);const o=i-1;let a;if(o<0)a=(new s).setFromUnitVectors(I,r);else{const e=g[o],t=I.clone().applyQuaternion(e).normalize();a=(new s).setFromUnitVectors(t,r),a.multiply(e)}const l=B.clone().applyQuaternion(a).normalize(),c=(new s).setFromUnitVectors(l,e);return a.premultiply(c),a.normalize()}:function(i){const r=n[i].delta(new t).normalize();r.transformDirection(C),w.push(r);const o=i-1,a=o<0,l=a?I:w[o],c=(new s).setFromUnitVectors(l,r);if(a){const t=B.clone().applyQuaternion(c);t.projectOnPlane(r).normalize();const n=e.clone().projectOnPlane(r).normalize(),i=(new s).setFromUnitVectors(t,n);c.premultiply(i)}else{const e=g[o];c.multiply(e)}return c.normalize()}}for(let e=0;e<p;e++){if(h)if(e<m){const t=L(e);g.push(t),P=(new f).compose(fr,t,E)}else g.push(g[e-1].clone());if(d){const t=l[e],n=o[e].clone();if(n.applyMatrix4(C),e>0){const e=x.clone().applyMatrix4(R),i=n.clone().sub(e);v.push(i),y.push(t)}const i=x.clone().applyMatrix4(P);n.sub(i),v.push(n),y.push(t)}R=P}return b}function Hr(e){const t=e.mixer,n=Cr(e),{model:i,skeleton:r}=n,s={...e,target:i,skeleton:r},{clip:o,...a}=e.posOnBone?_r(s):Yr(s);i.animations.push(o);const l=null==t?void 0:t.clipAction(o,i);return{...a,...n,clip:o,action:l}}function _r(e){const{boneTracks:t,duration:n,...i}=Vr(e),r=t.flat();return{...i,clip:new I(e.name,n,r)}}function Vr(e){const{skeleton:t,targetPath:n}=e,i=t.bones,{times:r,boneSampleDatas:s,duration:o,...a}=Qr(e),l=r.length,c=R,u=s.map(((e,t)=>{const{points:s,rotates:o}=e,a=i[t],u=n?`${n}.skeleton.bones[${t}]`:`${a.name||a.uuid}`,d=[],h=[];for(let e=0;e<l;e++)s&&s[e].toArray(d,3*e),o[e].toArray(h,4*e);const p=[];if(s){const e=new B(`${u}.position`,r,d,c);p.push(e)}const f=new P(`${u}.quaternion`,r,h,c);return p.push(f),p}));return{...a,boneTracks:u,duration:o}}function Qr(e){var n;const{curve:i,skeleton:r,stretch:o}=e,{bones:a,boneInverses:l}=r,c=a[0],u=e.target??c.parent;if(!u)throw"target 或 根骨骼的 parent 不存在";const d=e.tolerance??.1;c.updateWorldMatrix(!0,!0);const{division:h,length:p}=tr(e),{matrixWorld:m}=u,g=m.clone().invert(),v=[],y=[];l.reduce(((e,t)=>{const n=t.clone().invert();v.push(n);const i=e.clone().multiply(n);return y.push(i),t}),g);const w=y[0],b=new t,x=new s,A=new t;w.decompose(b,x,A);const S=kr(e,p),E=Fr(h),T=zr({curve:i,division:h,duration:S}),D=E.length,C=[],M=(new t).setFromMatrixPosition(y[1]).negate(),I=l[0],B=null==(n=e.up)?void 0:n.clone().applyMatrix4(m).transformDirection(I),{points:P,rotates:O,...R}=Nr({...e,curve:i,ts:E,target:c,rotate:!0,front:M,up:B,anchor:null});for(let e=0;e<D;e++)C.push(m.clone());const L=P.map(((e,t)=>{const n=O[t];n.premultiply(x).normalize();const i=(new f).compose(e,n,A);return i.premultiply(m),i})),k=i.getLengths(h).map((e=>e/p)),N=[{points:P,rotates:O,us:k,matrixs:L}],F=o?function(e,t,n){const r=N[e].us[t]-n/p;return{u:r,point:r<0?null:i.getPointAt(r)}}:function(e,t,n){const r=N[e].us[t],{u:s,point:o,succeed:a}=hr({curve:i,distance:n,fromU:r,length:p,side:dr.front,tolerance:d*n});return{u:s,point:a?o:null}},z=l.length,U=z-1;for(let e=1;e<z;e++){const n=[],r=[],o=[],a=[];N.push({points:n,rotates:r,us:o,matrixs:a});const l=y[e],c=v[e],u=e-1,d=N[u],h=y[u],p=v[u],{matrixs:m,points:g,rotates:w}=d,b=(new t).setFromMatrixScale(h),x=u-1,A=x<0?C:N[x].matrixs,S=new t,E=new s,T=new t;l.decompose(S,E,T);const M=(new t).setFromMatrixPosition(c).sub((new t).setFromMatrixPosition(p)).length(),I=S.length();for(let t=0;t<D;t++){const{point:c,u:d}=F(u,t,M);o.push(d),r.push(E.clone());const h=m[t];if(d<0||!c){n.push(S);const e=h.clone().multiply(l);a.push(e);continue}const p=A[t];let v=p.clone().invert();const y=c.clone().applyMatrix4(v),x=g[t];y.sub(x).normalize();const D=w[t],C=(new f).compose(x,D,b),B=S.clone().transformDirection(C),P=(new s).setFromUnitVectors(B,y);D.premultiply(P).normalize(),h.compose(x,D,b),h.premultiply(p);const O=h.clone().invert();c.applyMatrix4(O);const R=c.length();c.copy(S).multiplyScalar(R/I),n.push(c);const L=(new f).compose(c,E,T);if(e===U){const e=i.getTangentAt(d);e.negate().transformDirection(O);const n=(new s).setFromUnitVectors(c.clone().normalize(),e);n.premultiply(E).normalize(),r[t]=n,L.compose(c,n,T)}L.premultiply(h),a.push(L)}}return{...R,times:T,boneSampleDatas:N,duration:S}}function Yr(e){const{boneTracks:t,targetTracks:n,duration:i,...r}=Wr(e),s=n.concat(t.flat());return{...r,clip:new I(e.name,i,s)}}function Wr(e){const{skeleton:t,targetPath:n}=e,{times:i,boneSampleDatas:r,duration:s,targetSampleDatas:o,...a}=Xr(e),l=i.length,c=t.bones,u=R,d=[],h=[],{points:p,rotates:f}=o;for(let e=0;e<l;e++)p[e].toArray(d,3*e),f[e].toArray(h,4*e);const m=n??"",g=[new B(`${m}.position`,i,d,u),new P(`${m}.quaternion`,i,h,u)],v=r.map(((e,t)=>{const{points:r,rotates:s}=e,o=c[t],a=n?`${n}.skeleton.bones[${t}]`:`${o.name||o.uuid}`,d=[],h=[];for(let e=0;e<l;e++)r&&r[e].toArray(d,3*e),s[e].toArray(h,4*e);const p=[];if(r){const e=new B(`${a}.position`,i,d,u);p.push(e)}const f=new P(`${a}.quaternion`,i,h,u);return p.push(f),p}));return{...a,boneTracks:v,targetTracks:g,duration:s}}function Xr(e){const{curve:n,skeleton:i,stretch:r}=e,{bones:o,boneInverses:a}=i,l=o[0],c=e.target??l.parent;if(!c)throw"target 或 根骨骼的 parent 不存在";const u=e.tolerance??.1;l.updateWorldMatrix(!0,!0);const{division:d,length:h}=tr(e),{matrix:p,matrixWorld:m,scale:g}=c,v=m.clone().multiply(p.clone().invert()),y=m.clone().invert(),w=[],b=[];a.reduce(((e,t)=>{const n=t.clone().invert();w.push(n);const i=e.clone().multiply(n);return b.push(i),t}),y);const x=b[0],A=new t,S=new s,E=new t;x.decompose(A,S,E);const T=kr(e,h),D=Fr(d),C=w[0],M=(new t).setFromMatrixPosition(b[1]).negate().transformDirection(C).transformDirection(y),{rotates:I,points:B,...P}=Nr({...e,curve:n,target:c,position:!0,rotate:!0,anchor:A,front:M,ts:D}),O=zr({curve:n,division:d,duration:T}),R=B.map(((e,t)=>{const n=I[t],i=(new f).compose(e,n,g);return i.premultiply(v),i})),L={points:B,rotates:I,matrixs:R},k=[],N=R.map((e=>(k.push(S.clone()),e.clone().multiply(x)))),F=D.length,z=n.getLengths(d).map((e=>e/h)),U=[{rotates:k,us:z,matrixs:N}],j=r?function(e,t,i){const r=U[e].us[t]-i/h;return{u:r,point:r<0?null:n.getPointAt(r)}}:function(e,t,i){const r=U[e].us[t],{u:s,point:o,succeed:a}=hr({curve:n,distance:i,fromU:r,length:h,side:dr.front,tolerance:u*i});return{u:s,point:a?o:null}},G=a.length,H=G-1;for(let e=1;e<G;e++){const i=[],r=[],o=[],a=[];U.push({points:i,rotates:r,us:o,matrixs:a});const l=b[e],c=w[e],u=e-1,d=U[u],h=b[u],p=w[u],{matrixs:m,points:g,rotates:v}=d,y=new t,x=new s,A=new t;h.decompose(y,x,A);const S=u-1,E=S<0?R:U[S].matrixs,T=new t,D=new s,C=new t;l.decompose(T,D,C);const M=(new t).setFromMatrixPosition(c).sub((new t).setFromMatrixPosition(p)).length(),I=T.length();for(let t=0;t<F;t++){const{point:c,u:d}=j(u,t,M);o.push(d),r.push(D.clone());const h=m[t];if(d<0||!c){i.push(T);const e=h.clone().multiply(l);a.push(e);continue}const p=E[t];let w=p.clone().invert();const b=c.clone().applyMatrix4(w),S=(null==g?void 0:g[t])??y;b.sub(S).normalize();const B=v[t],P=(new f).compose(S,B,A),O=T.clone().transformDirection(P);B.setFromUnitVectors(O,b),B.premultiply(x).normalize(),h.compose(S,B,A),h.premultiply(p);const R=h.clone().invert();c.applyMatrix4(R);const L=c.length();c.copy(T).multiplyScalar(L/I),i.push(c);const k=(new f).compose(c,D,C);if(e===H){const e=n.getTangentAt(d);e.negate().transformDirection(R);const i=(new s).setFromUnitVectors(c.clone().normalize(),e);i.premultiply(D).normalize(),r[t]=i,k.compose(c,i,C)}k.premultiply(h),a.push(k)}}return{...P,times:O,boneSampleDatas:U,targetSampleDatas:L,duration:T}}class Kr{constructor(e){qi(this,"isAnimationClipKeyframe",!0),qi(this,"_tracksTimes",null),qi(this,"lastGetTime",0),qi(this,"lastGetKeyframeIndexs",[]),this.clip=e}get tracksTimes(){return this._tracksTimes??(this._tracksTimes=this.clip.tracks.map((e=>e.times)))}getTracksKeyframeIndexs(e){const{lastGetTime:t,tracksTimes:n}=this;e<t&&(this.lastGetKeyframeIndexs=[]),this.lastGetTime=e;const i=this.lastGetKeyframeIndexs;return this.lastGetKeyframeIndexs=n.map(((t,n)=>{const r=i[n]??0,s=t.length;for(let n=r;n<s;n++)if(e<t[n])return n-1;return s-1}))}getTracksKeyframes(e){const t=this.getTracksKeyframeIndexs(e),n=this.clip.tracks;return t.map(((e,t)=>{let i=null;if(-1!==e){const r=n[t],s=r.getValueSize(),o=e*s,a=o+s;i=Array.from(r.values.slice(o,a))}return{index:e,value:i}}))}}var Zr=(e=>(e.keyframe="keyframe",e.position=".position",e.quaternion=".quaternion",e.rotation=".rotation",e.scale=".scale",e.loop="loop",e.finished="finished",e.point="point",e))(Zr||{});const qr=["loop","finished"];class Jr extends Kr{constructor(e){super(e.getClip()),qi(this,"isAnimationActionKeyframe",!0),qi(this,"_trackNames"),qi(this,"_positionTrackName"),qi(this,"_quaternionTrackName"),qi(this,"_rotationTrackName"),qi(this,"_scaleTrackName"),qi(this,"event",new k),qi(this,"_frameEventNames",null),qi(this,"mixerListener",(e=>{(e.action.isAnimationActionKeyframe?e.action.action:e.action)===this.action&&this.event.dispatchEvent(e)})),qi(this,"_points",[]),qi(this,"_polyline"),qi(this,"_polylineLengths",[]),qi(this,"_pointsProgress",[]),qi(this,"lastGetProgress",0),qi(this,"lastGetPointIndex",0),qi(this,"_enablePointEvent",!0),qi(this,"_enableKeyframeEvent",!0),qi(this,"lastKeyframes",null),qi(this,"lastPolylineKeyframe",null),qi(this,"frameFun",(()=>{var e;if(this.enableKeyframeEvent){const{keyframes:e,lastKeyframes:t}=this;let n=!1;for(const[i,r]of Object.entries(e)){const e=null==t?void 0:t[i];r.index!==(null==e?void 0:e.index)&&(n=!0,this.event.dispatchEvent({type:i,preFrame:e,frame:r}))}n&&(this.event.dispatchEvent({type:"keyframe",preFrame:t,frame:e}),this.lastKeyframes=e)}if(this.pointEventEnabled){const{pointIndex:t,lastPolylineKeyframe:n}=this;if(t!==(null==n?void 0:n.index)){const i={index:t,value:this.points[t]??(null==(e=this.polyline)?void 0:e.getPoint(this.progress)),length:this.polylineLengths[t]};this.event.dispatchEvent({type:"point",preFrame:n,frame:i}),this.lastPolylineKeyframe=i}}})),qi(this,"_stopListenFun"),this.action=e}get time(){return this.action.time}get duration(){return this.clip.duration}get progressTime(){const{isReverseLoop:e,duration:t,time:n}=this;return e?t-n:n}set progressTime(e){const{action:t,isReverseLoop:n,duration:i}=this;n&&(e=i-e),t.time=e}get progress(){return this.progressTime/this.duration}set progress(e){this.progressTime=e*this.duration}get loopCount(){const e=this.action._loopCount;return-1===e?0:e}get isReverseLoop(){return this.action.loop===N&&this.loopCount%2==1}get loopDirFactor(){return this.isReverseLoop?-1:1}get isReverse(){const e=this.action.timeScale<0;return this.isReverseLoop?!e:e}get dirFactor(){return this.isReverse?-1:1}get trackNames(){return this._trackNames??(this._trackNames=this.clip.tracks.map((e=>e.name)))}get keyframeIndexs(){const e=this.getTracksKeyframeIndexs(this.progressTime);return this.trackNames.reduce(((t,n,i)=>(t[n]=e[i],t)),{})}get keyframes(){const e=this.getTracksKeyframes(this.progressTime);return this.trackNames.reduce(((t,n,i)=>(t[n]=e[i],t)),{})}get positionTrackName(){return void 0===this._positionTrackName&&(this._positionTrackName=this.trackNames.find((e=>e.endsWith(".position")))??null),this._positionTrackName}get positionkeyframeIndex(){const e=this.positionTrackName;return e?this.keyframeIndexs[e]:null}get positionKeyframe(){const e=this.positionTrackName;if(e){const{index:n,value:i}=this.keyframes[e];return{index:n,value:i?new t(...i):null}}return null}get quaternionTrackName(){return void 0===this._quaternionTrackName&&(this._quaternionTrackName=this.trackNames.find((e=>e.endsWith(".quaternion")))??null),this._quaternionTrackName}get quaternionKeyframeIndex(){const e=this.quaternionTrackName;return e?this.keyframeIndexs[e]:null}get quaternionKeyframe(){const e=this.quaternionTrackName;if(e){const{index:t,value:n}=this.keyframes[e];return{index:t,value:n?new s(...n):null}}return null}get rotationTrackName(){return void 0===this._rotationTrackName&&(this._rotationTrackName=this.trackNames.find((e=>e.endsWith(".rotation")))??null),this._rotationTrackName}get rotationkeyframeIndex(){const e=this.rotationTrackName;return e?this.keyframeIndexs[e]:null}get rotationKeyframe(){const e=this.rotationTrackName;if(e){const{index:t,value:i}=this.keyframes[e];return{index:t,value:i?new n(...i):null}}return null}get scaleTrackName(){return void 0===this._scaleTrackName&&(this._scaleTrackName=this.trackNames.find((e=>e.endsWith(".scale")))??null),this._scaleTrackName}get scaleKeyframeIndex(){const e=this.scaleTrackName;return e?this.keyframeIndexs[e]:null}get scaleKeyframe(){const e=this.scaleTrackName;if(e){const{index:n,value:i}=this.keyframes[e];return{index:n,value:i?new t(...i):null}}return null}get frameEventNames(){return this._frameEventNames??(this._frameEventNames=[...this.trackNames,"keyframe","point"])}get mixer(){return this.action._mixer}addEventListener(e,t){const n=this.mixerListener,i=qr.includes(e);i&&!this.mixer.hasEventListener(e,n)&&this.mixer.addEventListener(e,n);const r=this.frameEventNames.includes(e);return!(!i&&!r)&&(this.event.addEventListener(e,t),r&&!this._stopListenFun&&this.enableFrameEvent&&(this._stopListenFun=$r(this.frameFun)),!0)}removeEventListener(e,t){if(qr.includes(e)&&1===this.getListeners(e).length){const t=this.mixerListener;this.mixer.removeEventListener(e,t)}this.event.removeEventListener(e,t),this.stopListenFun&&!this.hasListeners&&(this.stopListenFun=null)}get points(){return this._points}set points(e){e.length>1?(this._points=e,this.polyline=ur(e)):(this._points=[],this.polyline=null)}get polyline(){return this._polyline}set polyline(e){this._polyline=e;const t=(null==e?void 0:e.getCurveLengths())??[];this.polylineLengths=[0,...t]}get polylineLengths(){return this._polylineLengths}set polylineLengths(e){this._polylineLengths=e;const t=1/e[e.length-1];this.pointsProgress=e.map((e=>e*t))}get polylineLength(){return this.polylineLengths[this.polylineLengths.length-1]}get polylineProgressLength(){return this.polylineLength*this.progress}get pointsProgress(){return this._pointsProgress}set pointsProgress(e){this._pointsProgress=e}get pointIndex(){return this.getPointIndex(this.progress)}getPointIndex(e){const{lastGetProgress:t,pointsProgress:n}=this;e<t&&(this.lastGetPointIndex=0),this.lastGetProgress=e;const i=Math.max(this.lastGetPointIndex,0),r=n.length;for(let t=i;t<r;t++)if(e<n[t])return this.lastGetPointIndex=t-1;return this.lastGetPointIndex=r-1}get enablePointEvent(){return this._enablePointEvent}set enablePointEvent(e){this._enablePointEvent=e,e&&this.autoStartListen()}get pointEventEnabled(){return this.enablePointEvent&&this.pointsProgress.length>0&&this.getListeners("point").length>0}get enableKeyframeEvent(){return this._enableKeyframeEvent}set enableKeyframeEvent(e){this._enableKeyframeEvent=e,e&&this.autoStartListen()}get enableFrameEvent(){return this.enableKeyframeEvent||this.enablePointEvent}get stopListenFun(){return this._stopListenFun}set stopListenFun(e){const t=this._stopListenFun;t&&t(),this._stopListenFun=e}startListen(){this.stopListenFun||(this.stopListenFun=$r(this.frameFun))}stopListen(){this.stopListenFun=null}autoStartListen(){!this.stopListenFun&&this.enableFrameEvent&&this.hasListeners&&(this.stopListenFun=$r(this.frameFun))}get listeners(){return this.event._listeners}get hasListeners(){const e=this.listeners;return!!e&&Object.values(e).some((e=>e&&e.length>0))}getListeners(e){var t;return(null==(t=this.listeners)?void 0:t[e])??[]}destroy(e){const{action:t,mixer:n,mixerListener:i}=this;this.stopListen(),n.removeEventListener("loop",i),n.removeEventListener("finished",i),this.event._listeners=null,!e&&(t.stop(),t.reset(),n._deactivateAction(t),n._removeInactiveAction(t))}}function $r(e){let t;const n=i=>{e(i),t=requestAnimationFrame(n)};return t=requestAnimationFrame(n),()=>{cancelAnimationFrame(t)}}class es extends Jr{constructor(){super(...arguments),qi(this,"isAnimationActionOperate",!0)}forward(e){const t=this.action;e=Math.abs(e??t.timeScale),t.timeScale=e}backward(e){const t=this.action;e=Math.abs(e??t.timeScale),t.timeScale=-e}}function ts(e){const t=new es(e);return new Proxy(t,{get:function(e,t,n){return t in e.action?e.action[t]:e[t]},set:function(e,t,n,i){return t in e.action?e.action[t]=n:e[t]=n,!0},deleteProperty:function(e,t){return t in e.action?Reflect.deleteProperty(e.action,t):Reflect.deleteProperty(e,t)},has:function(e,t){return t in e.action||t in e},ownKeys:function(e){return Reflect.ownKeys(e.action).concat(Reflect.ownKeys(e))}})}class ns{constructor(e){qi(this,"_action"),this.setAction(e)}get action(){return this._action}set action(e){this.setAction(e)}setAction(e){this._action=e&&ts(e)}get play(){const e=this.action;return!(!e||!e._mixer._isActiveAction(e)||e.paused)}set play(e){const t=this.action;t&&(t.paused=!e,e&&0===t.time&&t.play())}stop(){var e;null==(e=this.action)||e.stop()}}function is(e){var t;null==(t=e.reset)||t.call(e,!0)}class rs extends ns{constructor(e,t=[]){super(e),qi(this,"_updateGUI",null),this.guis=t}get updateGUI(){return this._updateGUI??this.constructor.updateGUI??is}set updateGUI(e){this._updateGUI=e}get action(){return this._action}set action(e){this.setAction(e),this.updateAllGUI()}updateAllGUI(){for(const e of this.guis)this.updateGUI(e)}}function ss(e){const t=new rs(e);return new Proxy(t,{get:function(e,t,n){var i;return t in e?e[t]:null==(i=e.action)?void 0:i[t]},set:function(e,t,n,i){if(t in e)e[t]=n;else{if(!e.action)return!1;e.action[t]=n}return!0},deleteProperty:function(e,t){return t in e?Reflect.deleteProperty(e,t):!!e.action&&Reflect.deleteProperty(e.action,t)},has:function(e,t){return t in e||!!e.action&&t in e.action},ownKeys:function(e){return e.action?Reflect.ownKeys(e).concat(Reflect.ownKeys(e.action)):Reflect.ownKeys(e)}})}qi(rs,"updateGUI",is);var os=(e=>(e.position=".position",e.quaternion=".quaternion",e.rotationX=".rotation[x]",e.rotationY=".rotation[y]",e.rotationZ=".rotation[z]",e.scale=".scale",e.color=".material.color",e.mapRotation=".material.map[rotation]",e.opacity=".material[opacity]",e.visible=".visible",e))(os||{}),as=(e=>(e.bool="bool",e.number="number",e.color="color",e.quaternion="quaternion",e.string="string",e.vector="vector",e))(as||{});const ls={bool:z,number:U,color:j,quaternion:P,string:G,vector:B},cs={blendMode:H,deduplication:!1,autoClear:!0,tracks:{".position":{valueTypeName:"vector"},".quaternion":{valueTypeName:"quaternion"},".scale":{valueTypeName:"vector"},".material.color":{valueTypeName:"color"},".material[opacity]":{valueTypeName:"number"},".material.map[rotation]":{valueTypeName:"number"},".visible":{valueTypeName:"bool"},".rotation[x]":{valueTypeName:"number"},".rotation[y]":{valueTypeName:"number"},".rotation[z]":{valueTypeName:"number"},".rotation[order]":{valueTypeName:"string"}}};class us{constructor(){qi(this,"_options",null),qi(this,"name"),qi(this,"duration"),qi(this,"tracksData",new Map),qi(this,"_tracks",null),qi(this,"_clip",null)}get globalOptions(){return this.constructor.options}get options(){return this._options??(this._options=structuredClone(this.globalOptions))}get blendMode(){return this.options.blendMode??(this.options.blendMode=this.globalOptions.blendMode)}set blendMode(e){this.blendMode!==e&&(this.options.blendMode=e,this.clipChanged())}get autoClear(){return this.options.autoClear??(this.options.autoClear=this.globalOptions.autoClear)}set autoClear(e){this.options.autoClear=e}get deduplication(){return this.options.deduplication??(this.options.deduplication=this.globalOptions.deduplication)}set deduplication(e){this.deduplication!==e&&(this.options.deduplication=e,this.tracksChanged())}get tracksConfig(){return this.options.tracks??(this.options.tracks=structuredClone(this.globalOptions.tracks))}set tracksConfig(e){const t=this.tracksConfig;this.options.tracks=e&&Object.assign(t,e)}clearKeyframes(){this.tracksData.clear(),this.tracksChanged()}tracksChanged(){this._tracks=null,this.clipChanged()}clipChanged(){this._clip=null}get tracks(){return this._tracks??(this._tracks=this.createTracks())}getTrackConfig(e){const t=this.tracksConfig;let n=t[e];if(n)return n;for(const n of Object.keys(t))if(e.endsWith(n))return t[n];return null}createTracks(){const{tracksData:e,deduplication:t,autoClear:n}=this,i=[];for(const[n,r]of e.entries()){r.sort(((e,t)=>e.time-t.time));const e=[],s=[];for(const{time:t,value:n}of r)e.push(t),s.push(...n);const{valueTypeName:o,...a}=this.getTrackConfig(n)??{};const l=new(ls[o]??F)(n,e,s);for(const[e,t]of Object.entries(a))null!=t&&(l[e]=t);t&&l.optimize(),i.push(l)}return n&&this.clearKeyframes(),i}get clip(){return this._clip??(this._clip=this.createClip())}createClip(e,t){e=e??this.name??void 0,t=t??this.duration??void 0;const{blendMode:n,tracks:i}=this,r=new I(e,t,i);return null!=n&&(r.blendMode=n),r}updateClip(e){return e||(e=this._clip)?(e.tracks=this.tracks,e.resetDuration(),e):this.clip}addKeyframe(e,t,n){const i=this.tracksData;i.has(e)||i.set(e,[]),i.get(e).push({time:t,value:n}),this.tracksChanged()}addKeyframes(e,t,n){for(const[i,r]of Object.entries(n)){const n=`${e}.${i}`;Array.isArray(r)?this.addKeyframe(n,t,r):Yi(r)?this.addKeyframe(n,t,[r]):this.addKeyframes(n,t,r)}}addPosition(e,t,n){const{x:i,y:r,z:s}=t;n=n??"",this.addKeyframe(`${n}.position`,e,[i,r,s])}addQuaternion(e,t,n){const{x:i,y:r,z:s,w:o}=t;n=n??"",this.addKeyframe(`${n}.quaternion`,e,[i,r,s,o])}addRotation(e,t,n){const{x:i,y:r,z:s,order:o}=t;n=n??"",this.addKeyframe(`${n}.rotation[x]`,e,[i]),this.addKeyframe(`${n}.rotation[y]`,e,[r]),this.addKeyframe(`${n}.rotation[z]`,e,[s]),o&&this.addKeyframe(`${n}.rotation[order]`,e,[o])}addRotationX(e,t,n){n=n??"",this.addKeyframe(`${n}.rotation[x]`,e,[t])}addRotationY(e,t,n){n=n??"",this.addKeyframe(`${n}.rotation[y]`,e,[t])}addRotationZ(e,t,n){n=n??"",this.addKeyframe(`${n}.rotation[z]`,e,[t])}addScale(e,t,n){const{x:i,y:r,z:s}=t;n=n??"",this.addKeyframe(`${n}.scale`,e,[i,r,s])}addColor(e,t,n){const{r:i,g:r,b:s}=t;n=n??"",this.addKeyframe(`${n}.material.color`,e,[i,r,s])}addOpacity(e,t,n){n=n??"",this.addKeyframe(`${n}.material[opacity]`,e,[t])}addMapRotation(e,t,n){n=n??"",this.addKeyframe(`${n}.material.map[rotation]`,e,[t])}addVisible(e,t,n){n=n??"",this.addKeyframe(`${n}.visible`,e,[t])}}qi(us,"options",cs);class ds extends us{constructor(e,t){super(),qi(this,"_mixer"),qi(this,"_root",null),qi(this,"_action",null),this.mixer=e,this.root=t}get mixer(){return this._mixer}set mixer(e){this._mixer!==e&&(this._mixer=e,this.actionChanged())}get root(){return this._root}set root(e){this._root!==e&&(this._root=e,this.actionChanged())}get loop(){return this.options.loop??(this.options.loop=this.globalOptions.loop)}set loop(e){this.loop!==e&&(this.options.loop=e,this.actionChanged())}get repetitions(){return this.options.repetitions??(this.options.repetitions=this.globalOptions.repetitions)}set repetitions(e){this.repetitions!==e&&(this.options.repetitions=e,this.actionChanged())}clipChanged(){super.clipChanged(),this.actionChanged()}actionChanged(){this._action=null}get action(){return this._action??(this._action=this.createAction())}createAction(e,t,n){t=t??void 0;const i=n??this.mixer,r=e??this.root??void 0,s=i.clipAction(this.clip,r,t),{loop:o,repetitions:a}=this;return null!=o&&(s.loop=o),null!=a&&(s.repetitions=a),s}}function hs(e,t=1){const n=e.slice().sort(((e,t)=>e-t)),i=[[]];return n.reduce((function(e,n){const r=e[e.length-1];return null==r||n-r<=t?e.push(n):(e=[n],i.push(e)),e}),i[0]),i}function ps(e,t){let{count:n=4,min:i=-1/0,max:r=1/0}=t??{};const s=e[0];i=Math.max(s-n+1,i),r=Math.min(s+n-1,r),n=Math.min(n,r-i+1);const o=[];for(const t of e)i<=t&&t<=r&&o.push(t);const a=hs(o);a.sort(((e,t)=>t.length-e.length));let l=a.find((e=>e.includes(s)));if(l.length>=n)return l.sort(((t,n)=>e.indexOf(t)-e.indexOf(n))),l=l.slice(0,n),l.sort(((e,t)=>e-t)),l;for(const e of o){i=l[0],r=l[l.length-1];let t=i-e,s=n-l.length;if(t>0&&t<=s)for(let t=e;t<i;t++)l.unshift(t);else if(t=e-r,t>0&&t<=s)for(let t=r+1;t<=e;t++)l.push(t);else;}return l}
|
|
1
|
+
import*as e from"three";import{Vector3 as t,Euler as n,Box3 as i,Scene as r,Quaternion as s,CubeTextureLoader as o,HalfFloatType as a,EquirectangularReflectionMapping as l,TextureLoader as c,Color as u,Texture as d,FileLoader as h,Vector2 as p,Matrix4 as f,BufferAttribute as m,BufferGeometry as g,Float32BufferAttribute as v,LineBasicMaterial as y,Line as w,Line3 as b,MathUtils as x,CurvePath as A,LineCurve as S,LineCurve3 as E,Bone as T,Uint16BufferAttribute as D,SkinnedMesh as C,Skeleton as M,AnimationClip as I,VectorKeyframeTrack as B,QuaternionKeyframeTrack as P,Object3D as O,InterpolateLinear as R,InterpolateDiscrete as L,EventDispatcher as k,LoopPingPong as N,KeyframeTrack as F,BooleanKeyframeTrack as z,NumberKeyframeTrack as U,ColorKeyframeTrack as j,StringKeyframeTrack as G,NormalAnimationBlendMode as H,REVISION as _,BasicDepthPacking as V,UnsignedByteType as Q,DepthTexture as Y,DepthStencilFormat as W,UnsignedInt248Type as X,UnsignedIntType as K,WebGLRenderTarget as Z,BackSide as q,DoubleSide as J,ShaderMaterial as $,FrontSide as ee,Uniform as te,RepeatWrapping as ne,LoadingManager as ie,NearestFilter as re,LinearFilter as se,LinearMipmapLinearFilter as oe,NoBlending as ae,RGBADepthPacking as le,PerspectiveCamera as ce,Mesh as ue,MeshDepthMaterial as de,LinearEncoding as he,sRGBEncoding as pe,Vector4 as fe,Camera as me,Material as ge,Fog as ve,LineSegments as ye,EdgesGeometry as we,MeshStandardMaterial as be,OrthographicCamera as xe,WebGLRenderer as Ae,PCFSoftShadowMap as Se,Sphere as Ee,DataTexture as Te,NoColorSpace as De,WebGLMultipleRenderTargets as Ce,RedFormat as Me,FloatType as Ie,RGBAFormat as Be,ShaderChunk as Pe,WebGLCubeRenderTarget as Oe,CubeCamera as Re,PMREMGenerator as Le,FramebufferTexture as ke,Matrix3 as Ne,TangentSpaceNormalMap as Fe,GLSL3 as ze,VideoTexture as Ue,GLBufferAttribute as je,InterleavedBufferAttribute as Ge,Frustum as He,MOUSE as _e,TOUCH as Ve,Spherical as Qe,Raycaster as Ye,Clock as We,AnimationMixer as Xe,SRGBColorSpace as Ke,LinearSRGBColorSpace as Ze,UVMapping as qe,ACESFilmicToneMapping as Je,CubeTexture as $e,Sprite as et,SphereGeometry as tt,CircleGeometry as nt,ShapeGeometry as it,Shape as rt,AmbientLight as st,DirectionalLight as ot,HemisphereLight as at,SpotLight as lt,PointLight as ct,RectAreaLight as ut,Loader as dt,LoaderUtils as ht,ClampToEdgeWrapping as pt,Group as ft,PropertyBinding as mt,LinearMipMapLinearFilter as gt,ImageLoader as vt,InstancedMesh as yt,SpriteMaterial as wt,GridHelper as bt,AxesHelper as xt,Box3Helper as At,PlaneGeometry as St,MeshBasicMaterial as Et,DirectionalLightHelper as Tt,HemisphereLightHelper as Dt,SpotLightHelper as Ct,PointLightHelper as Mt,Box2 as It,Plane as Bt,CanvasTexture as Pt,MeshPhongMaterial as Ot}from"three";export*from"three";import{RGBELoader as Rt}from"three/examples/jsm/loaders/RGBELoader.js";import{GLTFExporter as Lt}from"three/examples/jsm/exporters/GLTFExporter.js";import{RoomEnvironment as kt}from"three/examples/jsm/environments/RoomEnvironment.js";import Nt from"three/examples/jsm/libs/stats.module.js";import{Sky as Ft}from"three/examples/jsm/objects/Sky.js";import{mergeGeometries as zt,deinterleaveGeometry as Ut}from"three/examples/jsm/utils/BufferGeometryUtils.js";import"three/examples/jsm/postprocessing/Pass.js";import{WorkerPool as jt}from"three/examples/jsm/utils/WorkerPool.js";import{MeshBVH as Gt,computeBoundsTree as Ht,disposeBoundsTree as _t,acceleratedRaycast as Vt}from"three-mesh-bvh";import{RectAreaLightUniformsLib as Qt}from"three/examples/jsm/lights/RectAreaLightUniformsLib.js";import{TGALoader as Yt}from"three/examples/jsm/loaders/TGALoader.js";import{GLTFLoader as Wt}from"three/examples/jsm/loaders/GLTFLoader.js";import{DRACOLoader as Xt}from"three/examples/jsm/loaders/DRACOLoader.js";import*as Kt from"three/examples/jsm/utils/SkeletonUtils.js";import*as Zt from"three/examples/jsm/libs/fflate.module.js";import{NURBSCurve as qt}from"three/examples/jsm/curves/NURBSCurve.js";import{RectAreaLightHelper as Jt}from"three/examples/jsm/helpers/RectAreaLightHelper.js";var $t="soonspacejs",en="2.9.14",tn="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function nn(){throw new Error("setTimeout has not been defined")}function rn(){throw new Error("clearTimeout has not been defined")}var sn=nn,on=rn;function an(e){if(sn===setTimeout)return setTimeout(e,0);if((sn===nn||!sn)&&setTimeout)return sn=setTimeout,setTimeout(e,0);try{return sn(e,0)}catch(t){try{return sn.call(null,e,0)}catch(t){return sn.call(this,e,0)}}}"function"==typeof tn.setTimeout&&(sn=setTimeout),"function"==typeof tn.clearTimeout&&(on=clearTimeout);var ln,cn=[],un=!1,dn=-1;function hn(){un&&ln&&(un=!1,ln.length?cn=ln.concat(cn):dn=-1,cn.length&&pn())}function pn(){if(!un){var e=an(hn);un=!0;for(var t=cn.length;t;){for(ln=cn,cn=[];++dn<t;)ln&&ln[dn].run();dn=-1,t=cn.length}ln=null,un=!1,function(e){if(on===clearTimeout)return clearTimeout(e);if((on===rn||!on)&&clearTimeout)return on=clearTimeout,clearTimeout(e);try{return on(e)}catch(t){try{return on.call(null,e)}catch(t){return on.call(this,e)}}}(e)}}function fn(e,t){this.fun=e,this.array=t}fn.prototype.run=function(){this.fun.apply(null,this.array)};function mn(){}var gn=mn,vn=mn,yn=mn,wn=mn,bn=mn,xn=mn,An=mn;var Sn=tn.performance||{},En=Sn.now||Sn.mozNow||Sn.msNow||Sn.oNow||Sn.webkitNow||function(){return(new Date).getTime()};var Tn=new Date;var Dn,Cn={nextTick:function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];cn.push(new fn(e,t)),1!==cn.length||un||an(pn)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:gn,addListener:vn,once:yn,off:wn,removeListener:bn,removeAllListeners:xn,emit:An,binding:function(e){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*En.call(Sn),n=Math.floor(t),i=Math.floor(t%1*1e9);return e&&(n-=e[0],(i-=e[1])<0&&(n--,i+=1e9)),[n,i]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-Tn)/1e3}},Mn={Linear:{None:function(e){return e}},Quadratic:{In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}},Cubic:{In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}},Quartic:{In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}},Quintic:{In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}},Sinusoidal:{In:function(e){return 1-Math.cos(e*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return.5*(1-Math.cos(Math.PI*e))}},Exponential:{In:function(e){return 0===e?0:Math.pow(1024,e-1)},Out:function(e){return 1===e?1:1-Math.pow(2,-10*e)},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(2-Math.pow(2,-10*(e-1)))}},Circular:{In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}},Elastic:{In:function(e){return 0===e?0:1===e?1:-Math.pow(2,10*(e-1))*Math.sin(5*(e-1.1)*Math.PI)},Out:function(e){return 0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin(5*(e-.1)*Math.PI)+1},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?-.5*Math.pow(2,10*(e-1))*Math.sin(5*(e-1.1)*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin(5*(e-1.1)*Math.PI)+1}},Back:{In:function(e){var t=1.70158;return e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}},Bounce:{In:function(e){return 1-Mn.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?.5*Mn.Bounce.In(2*e):.5*Mn.Bounce.Out(2*e-1)+.5}}},In="undefined"==typeof self&&void 0!==Cn&&Cn.hrtime?function(){var e=Cn.hrtime();return 1e3*e[0]+e[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now?self.performance.now.bind(self.performance):void 0!==Date.now?Date.now:function(){return(new Date).getTime()},Bn=function(){function e(){this._tweens={},this._tweensAddedDuringUpdate={}}return e.prototype.getAll=function(){var e=this;return Object.keys(this._tweens).map((function(t){return e._tweens[t]}))},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(e){this._tweens[e.getId()]=e,this._tweensAddedDuringUpdate[e.getId()]=e},e.prototype.remove=function(e){delete this._tweens[e.getId()],delete this._tweensAddedDuringUpdate[e.getId()]},e.prototype.update=function(e,t){void 0===e&&(e=In()),void 0===t&&(t=!1);var n=Object.keys(this._tweens);if(0===n.length)return!1;for(;n.length>0;){this._tweensAddedDuringUpdate={};for(var i=0;i<n.length;i++){var r=this._tweens[n[i]],s=!t;r&&!1===r.update(e,s)&&!t&&delete this._tweens[n[i]]}n=Object.keys(this._tweensAddedDuringUpdate)}return!0},e}(),Pn={Linear:function(e,t){var n=e.length-1,i=n*t,r=Math.floor(i),s=Pn.Utils.Linear;return t<0?s(e[0],e[1],i):t>1?s(e[n],e[n-1],n-i):s(e[r],e[r+1>n?n:r+1],i-r)},Bezier:function(e,t){for(var n=0,i=e.length-1,r=Math.pow,s=Pn.Utils.Bernstein,o=0;o<=i;o++)n+=r(1-t,i-o)*r(t,o)*e[o]*s(i,o);return n},CatmullRom:function(e,t){var n=e.length-1,i=n*t,r=Math.floor(i),s=Pn.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(r=Math.floor(i=n*(1+t))),s(e[(r-1+n)%n],e[r],e[(r+1)%n],e[(r+2)%n],i-r)):t<0?e[0]-(s(e[0],e[0],e[1],e[1],-i)-e[0]):t>1?e[n]-(s(e[n],e[n],e[n-1],e[n-1],i-n)-e[n]):s(e[r?r-1:0],e[r],e[n<r+1?n:r+1],e[n<r+2?n:r+2],i-r)},Utils:{Linear:function(e,t,n){return(t-e)*n+e},Bernstein:function(e,t){var n=Pn.Utils.Factorial;return n(e)/n(t)/n(e-t)},Factorial:(Dn=[1],function(e){var t=1;if(Dn[e])return Dn[e];for(var n=e;n>1;n--)t*=n;return Dn[e]=t,t}),CatmullRom:function(e,t,n,i,r){var s=.5*(n-e),o=.5*(i-t),a=r*r;return(2*t-2*n+s+o)*(r*a)+(-3*t+3*n-2*s-o)*a+s*r+t}}},On=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),Rn=new Bn,Ln=function(){function e(e,t){void 0===t&&(t=Rn),this._object=e,this._group=t,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Mn.Linear.None,this._interpolationFunction=Pn.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._id=On.nextId(),this._isChainStopped=!1,this._goToEnd=!1}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.to=function(e,t){return this._valuesEnd=Object.create(e),void 0!==t&&(this._duration=t),this},e.prototype.duration=function(e){return this._duration=e,this},e.prototype.start=function(e){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed)for(var t in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(t),this._valuesStart[t]=this._valuesStartRepeat[t];return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=void 0!==e?"string"==typeof e?In()+parseFloat(e):e:In(),this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this},e.prototype._setupProperties=function(e,t,n,i){for(var r in n){var s=e[r],o=Array.isArray(s),a=o?"array":typeof s,l=!o&&Array.isArray(n[r]);if("undefined"!==a&&"function"!==a){if(l){var c=n[r];if(0===c.length)continue;c=c.map(this._handleRelativeValue.bind(this,s)),n[r]=[s].concat(c)}if("object"!==a&&!o||!s||l)void 0===t[r]&&(t[r]=s),o||(t[r]*=1),i[r]=l?n[r].slice().reverse():t[r]||0;else{for(var u in t[r]=o?[]:{},s)t[r][u]=s[u];i[r]=o?[]:{},this._setupProperties(s,t[r],n[r],i[r])}}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},e.prototype.pause=function(e){return void 0===e&&(e=In()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=e,this._group&&this._group.remove(this)),this},e.prototype.resume=function(e){return void 0===e&&(e=In()),this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=e-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this):this},e.prototype.stopChainedTweens=function(){for(var e=0,t=this._chainedTweens.length;e<t;e++)this._chainedTweens[e].stop();return this},e.prototype.group=function(e){return this._group=e,this},e.prototype.delay=function(e){return this._delayTime=e,this},e.prototype.repeat=function(e){return this._initialRepeat=e,this._repeat=e,this},e.prototype.repeatDelay=function(e){return this._repeatDelayTime=e,this},e.prototype.yoyo=function(e){return this._yoyo=e,this},e.prototype.easing=function(e){return this._easingFunction=e,this},e.prototype.interpolation=function(e){return this._interpolationFunction=e,this},e.prototype.chain=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this._chainedTweens=e,this},e.prototype.onStart=function(e){return this._onStartCallback=e,this},e.prototype.onUpdate=function(e){return this._onUpdateCallback=e,this},e.prototype.onRepeat=function(e){return this._onRepeatCallback=e,this},e.prototype.onComplete=function(e){return this._onCompleteCallback=e,this},e.prototype.onStop=function(e){return this._onStopCallback=e,this},e.prototype.update=function(e,t){if(void 0===e&&(e=In()),void 0===t&&(t=!0),this._isPaused)return!0;var n,i,r=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(e>r)return!1;t&&this.start(e)}if(this._goToEnd=!1,e<this._startTime)return!0;!1===this._onStartCallbackFired&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),i=(e-this._startTime)/this._duration,i=0===this._duration||i>1?1:i;var s=this._easingFunction(i);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,s),this._onUpdateCallback&&this._onUpdateCallback(this._object,i),1===i){if(this._repeat>0){for(n in isFinite(this._repeat)&&this._repeat--,this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[n]||(this._valuesStartRepeat[n]=this._valuesStartRepeat[n]+parseFloat(this._valuesEnd[n])),this._yoyo&&this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];return this._yoyo&&(this._reversed=!this._reversed),void 0!==this._repeatDelayTime?this._startTime=e+this._repeatDelayTime:this._startTime=e+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var o=0,a=this._chainedTweens.length;o<a;o++)this._chainedTweens[o].start(this._startTime+this._duration);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(e,t,n,i){for(var r in n)if(void 0!==t[r]){var s=t[r]||0,o=n[r],a=Array.isArray(e[r]),l=Array.isArray(o);!a&&l?e[r]=this._interpolationFunction(o,i):"object"==typeof o&&o?this._updateProperties(e[r],s,o,i):"number"==typeof(o=this._handleRelativeValue(s,o))&&(e[r]=s+(o-s)*i)}},e.prototype._handleRelativeValue=function(e,t){return"string"!=typeof t?t:"+"===t.charAt(0)||"-"===t.charAt(0)?e+parseFloat(t):parseFloat(t)},e.prototype._swapEndStartRepeatValues=function(e){var t=this._valuesStartRepeat[e],n=this._valuesEnd[e];this._valuesStartRepeat[e]="string"==typeof n?this._valuesStartRepeat[e]+parseFloat(n):this._valuesEnd[e],this._valuesEnd[e]=t},e}(),kn=On.nextId,Nn=Rn,Fn=Nn.getAll.bind(Nn),zn=Nn.removeAll.bind(Nn),Un=Nn.add.bind(Nn),jn=Nn.remove.bind(Nn),Gn=Nn.update.bind(Nn),Hn={Easing:Mn,Group:Bn,Interpolation:Pn,now:In,Sequence:On,nextId:kn,Tween:Ln,VERSION:"18.6.4",getAll:Fn,removeAll:zn,add:Un,remove:jn,update:Gn};const _n="[soonspacejs]: ";var Vn,Qn;!function(e){e.Group="Group",e.Light="Light",e.Model="Model",e.Poi="Poi",e.PoiNode="PoiNode",e.Canvas3D="Canvas3D",e.Topology="Topology",e.Helper="Helper",e.PluginObject="PluginObject"}(Vn||(Vn={})),function(e){e.sbm="SBM",e.sbmx="SBMX",e.dat="DAT",e.glb="GLB",e.gltf="GLTF",e.fbx="FBX"}(Qn||(Qn={}));const Yn="In soonspacejs: ",Wn=(e,t)=>{let n="";for(const e in t)n+=`${e}: ${t[e]};`;console.log(`%c${e}`,n)},Xn={},Kn=e=>{e in Xn||(Xn[e]=!0,console.warn(Yn+e))},Zn=e=>{e in Xn||(Xn[e]=!0,console.error(Yn+e))};function qn(e){return e instanceof t?e:new t(e.x,e.y,e.z)}function Jn(e){return e instanceof n?e:new n(e.x,e.y,e.z)}function $n(e){const t=new i;return e instanceof r?e.children.filter((e=>!("isTransformControls"in e))).reduce(((e,t)=>e.union((new i).setFromObject(t))),t):t.setFromObject(e),t.isEmpty()&&(e.getWorldPosition(t.min),t.max.copy(t.min)),t}function ei(e,t,n){const i=n.clone();return Math.abs(t[e]-n[e])>Math.PI&&(t[e]>n[e]?i[e]+=2*Math.PI:i[e]-=2*Math.PI),i}function ti(e,t){const i=ei("x",e,t),r=ei("y",e,t),s=ei("z",e,t);return new n(i.x,r.y,s.z,t.order)}function ni(e){return Math.PI/180*e}function ii(e,i=!0){return i?{position:e.getWorldPosition(new t),rotation:(new n).setFromQuaternion(e.getWorldQuaternion(new s)),scale:e.getWorldScale(new t)}:{position:e.position.clone(),rotation:e.rotation.clone(),scale:e.scale.clone()}}function ri(e,t,n=!0){const i=ii(t,n);e.position.copy(i.position),e.rotation.copy(i.rotation),e.scale.copy(i.scale)}function si(e){return!!e.visible&&(!e.parent||si(e.parent))}const oi=new t,ai=new t,li=new t,ci=(e,t,n,i=1)=>{const r=oi.set(e.x/n.width*2-1,-e.y/n.height*2+1,i);return r.unproject(t),r},ui=(e,t,n,i)=>{const r=((e,t,n)=>{const i=n.width/2,r=n.height/2;t.updateMatrixWorld();const s=e.project(t);return s.x=s.x*i+i,s.y=-s.y*r+r,s})(li.copy(e),n,i);let s=0;for(let o=0;o<2;++o){const a=ai.copy(r).setComponent(o,r.getComponent(o)+t),l=ci(a,n,i,a.z);s=Math.max(s,e.distanceTo(l))}return s};class di{constructor(){this.min=null,this.roots=[],this.nodes=new Map}shift(){const e=this.min;if(null===e||this.roots.length<1)return this.min=null,e;this.remove(e),this.roots.length>50&&this.consolidate();let t=1/0;const n=this.roots.length;for(let e=0;e<n;e++){const n=this.roots[e],i=this.getDistance(n);i<t&&(t=i,this.min=n)}return e}consolidate(){const e=[[],[],[],[],[],[],[]],t=e.length-1,n=this.roots.length;for(let i=0;i<n;i++){const n=this.roots[i],r=this.nodes.get(n);r&&r.depth<t&&e[r.depth].push(n)}for(let n=0;n<=t;n++)for(;e[n].length>1;){const i=e[n].shift(),r=e[n].shift(),s=n+1;let o=-1;if(void 0!==i&&void 0!==r){const n=this.nodes.get(i),a=this.nodes.get(r);n&&a&&(n.distance<a.distance?(n.depth=s,n.children.push(r),a.parent=i,s<=t&&e[s].push(i),o=this.roots.indexOf(r)):(a.depth=s,a.children.push(i),n.parent=r,s<=t&&e[s].push(r),o=this.roots.indexOf(i)))}o>-1&&this.roots.splice(o,1)}}add(e,t){if(this.nodes.set(e,{nodeIndex:e,distance:t,depth:0,parent:null,children:[]}),null===this.min)this.min=e;else{const n=this.nodes.get(this.min);n&&t<n.distance&&(this.min=e)}this.roots.push(e)}update(e,t){this.remove(e),this.add(e,t)}remove(e){var t,n;if(!this.nodes.has(e))return;const i=null===(t=this.nodes.get(e))||void 0===t?void 0:t.children;if(i&&i.length>0)for(let t=0;t<i.length;t++){const n=i[t],r=this.nodes.get(n),s=this.nodes.get(e);r&&s&&(r.parent=s.parent),r&&null===r.parent&&this.roots.push(n)}let r=null===(n=this.nodes.get(e))||void 0===n?void 0:n.parent;if(null===r){const t=this.roots.indexOf(e);t>-1&&this.roots.splice(t,1)}else for(;r;){const e=this.nodes.get(r);e&&(e.depth--,r=e.parent)}}getDistance(e){const t=this.nodes.get(e);return t?t.distance:1/0}}async function hi({path:e="",file:t}){if(Array.isArray(t))return(new o).setPath(e).loadAsync(t);{const n=Gi(t);if("hdr"===n||"pic"===n){const n=await(new Rt).setPath(e).setDataType(a).loadAsync(t);return n.mapping=l,n}{const n=await(new c).setPath(e).loadAsync(t);return n.mapping=l,n}}}function pi(e){if(!e)return null;const{colors:t,stops:n,size:i=1024}=e,r=document.createElement("canvas"),s=r.getContext("2d");if(!s)return null;r.width=16,r.height=i;const o=s.createLinearGradient(0,0,0,i),a=new u,l=t.map((e=>a.set(e).getStyle()));for(let e=0,t=l.length-1;e<=t;e++)o.addColorStop(n?n[e]:e/t,l[e]);s.fillStyle=o,s.fillRect(0,0,16,i);const c=new d(r);return c.needsUpdate=!0,c}const fi=e=>{const t=e.lastIndexOf("/");return-1===t?"./":e.slice(0,t+1)};function mi(e){return ki(e)?function(e){return e.map((e=>mi(e)))}(e):Ni(e)?function(e){if(Ni(e)){const t={};for(const n in e)t[n]=mi(e[n]);return t}return e}(e):e}const gi=(e,t)=>ki(e)?e.map(t):t(e),vi=e=>gi(e,(e=>e.clone())),yi=e=>gi(e,(e=>e.dispose())),wi=new h,bi=async(e,t)=>(wi.setResponseType(t),wi.loadAsync(e)),xi=new t,Ai=new t,Si=new t;function Ei(e,t){const n=xi.setFromMatrixPosition(e.matrixWorld),i=Ai.setFromMatrixPosition(t.matrixWorld),r=n.sub(i),s=Si.setFromMatrixColumn(t.matrixWorld,2).normalize().negate();return r.angleTo(s)>Math.PI/2}function Ti(e,t,n,i){const r=xi.setFromMatrixPosition(e.matrixWorld),s=r.clone();s.project(t),n.setFromCamera(new p(s.x,s.y),t);const o=n.intersectObjects(i,!0);if(o.length){const e=o[0].distance;return r.distanceTo(n.ray.origin)<e}return!0}function Di(e,t){const n=e.parent,{occludeThrottle:i}=n;let r=!0;if(Li(i)&&Li(e.userData.delta)&&(r=performance.now()-e.userData.delta>i),r&&n.occlude){const n=!Ei(e,t.camera)&&Ti(e,t.camera,t.raycaster,t.scener.intersectsList.getAll());e.visible=n,e.userData.delta=performance.now()}}const Ci=e=>{"function"==typeof requestIdleCallback?requestIdleCallback(e):setTimeout(e)};var Mi=function(){function e(){}return e.prototype.toJson=function(e,t){var n=this.xmlStringToXmlDom(e),i=this.xmlToJson(n);return t?(t.removeLineBreaks&&this.removeLineBreaks(i),t.removeComments&&this.removeCommentProperties(i),t.transformTextOnly&&this.transformTextOnly(i),i):i},e.prototype.xmlStringToXmlDom=function(e){return(new DOMParser).parseFromString(e,"text/xml")},e.prototype.removeLineBreaks=function(e){var t=this;Object.keys(e).forEach((function(n,i){"#text"===n&&Array.isArray(e[n])&&delete e[n],"object"==typeof e[n]&&t.removeLineBreaks(e[n])}))},e.prototype.removeCommentProperties=function(e){var t=this;Object.keys(e).forEach((function(n,i){"#comment"===n&&delete e[n],"object"==typeof e[n]&&t.removeCommentProperties(e[n])}))},e.prototype.transformTextOnly=function(e){var t=this;Object.keys(e).forEach((function(n,i){var r=Object.keys(e[n]).length>1,s=Object.keys(e[n])[0];r||"object"==typeof e[n][s]?t.transformTextOnly(e[n]):"object"==typeof e[n]&&e[n]["#text"]&&(e[n]=e[n]["#text"])}))},e.prototype.xmlToJson=function(e){var t={};if(1==e.nodeType){if(e.attributes.length>0){t._attributes={};for(var n=0;n<e.attributes.length;n++){var i=e.attributes.item(n);t._attributes[i.nodeName]=i.nodeValue}}}else 3==e.nodeType&&(t=e.nodeValue);if(e.hasChildNodes())for(var r=0;r<e.childNodes.length;r++){var s=e.childNodes.item(r),o=s.nodeName;if(void 0===t[o])t[o]=this.xmlToJson(s);else{if(void 0===t[o].push){var a=t[o];t[o]=[],t[o].push(a)}t[o].push(this.xmlToJson(s))}}return t},e}();function Ii(e){return bi(e,"text").then((e=>Promise.resolve(function(e){return(new Mi).toJson(e,{transformTextOnly:!0,removeComments:!0,removeLineBreaks:!0})}(e))))}class Bi{name="EXT_mesh_gpu_instancing";constructor(e){this.writer=e}writeNode(e,n){if(!0!==e.isInstancedMesh)return;const i=e.count,r=new f,o=new Float32Array(3*i),a=new Float32Array(4*i),l=new Float32Array(3*i),c=new t,u=new s,d=new t;for(let t=0;t<i;t++)e.getMatrixAt(t,r),r.decompose(c,u,d),o[3*t]=c.x,o[3*t+1]=c.y,o[3*t+2]=c.z,a[4*t]=u.x,a[4*t+1]=u.y,a[4*t+2]=u.z,a[4*t+3]=u.w,l[3*t]=d.x,l[3*t+1]=d.y,l[3*t+2]=d.z;const h=this.writer,p={};p.attributes={TRANSLATION:h.processAccessor(new m(o,3)),ROTATION:h.processAccessor(new m(a,4)),SCALE:h.processAccessor(new m(l,3))},n.extensions=n.extensions||{},n.extensions[this.name]=p,h.extensionsUsed[this.name]=!0}}const Pi=Object.prototype.hasOwnProperty,Oi=e=>"String"===zi(e),Ri=e=>"Boolean"===zi(e),Li=e=>"Number"===zi(e),ki=Array.isArray,Ni=e=>"Object"===zi(e),Fi=e=>"Function"===zi(e),zi=e=>Object.prototype.toString.call(e).slice(8,-1),Ui=(e,t,n)=>String.fromCodePoint(...new Uint8Array(e,t,n)),ji=()=>_n+Math.random().toString(36).substring(7).split("").join("_"),Gi=e=>{var t;const{href:n}=new URL(e,location.origin);if(n.includes(".")){const e=n.split(".").pop();if(!e)return;return e.includes("?")?null===(t=e.split("?").shift())||void 0===t?void 0:t.toLowerCase():e}};var Hi=Object.freeze({__proto__:null,IVector3ToEuler:Jn,IVector3ToVector3:qn,MinHeap:di,calculateScaleFactor:ui,cloneDeep:mi,cloneMaterials:vi,consoleSspTitle:Yn,deg2Euler:ni,disposeMaterials:yi,error:Zn,euler2Deg:function(e){return e/(Math.PI/180)},exportGltf:function(e,t={}){return new Promise(((n,i)=>{const r=new Lt;r.register((e=>new Bi(e))),r.parse(e,(e=>n(e)),(e=>i(e)),t)}))},fetchFile:bi,getAsciiString:Ui,getBoundingBox:$n,getExtension:Gi,getSpaceAttributeFromObject:ii,getTexture:hi,getValueType:zi,gradientTexture:pi,hasOwn:(e,t)=>Pi.call(e,t),idleTask:Ci,isArray:ki,isBoolean:Ri,isDate:e=>"Date"===zi(e),isFunction:Fi,isNull:e=>"Null"===zi(e),isNumber:Li,isObject:Ni,isObjectBehindCamera:Ei,isObjectOccludeVisible:Ti,isObjectVisible:si,isPromise:e=>"Promise"===zi(e),isString:Oi,isSymbol:e=>"Symbol"===zi(e),isUndefined:e=>"Undefined"===zi(e),log:Wn,materialHandle:gi,parseFilePath:fi,poiNodeOccludeHandler:Di,randomString:ji,rotationAFix:ti,rotationAxisFix:ei,sleep:e=>new Promise((t=>setTimeout((()=>t()),e))),syncSpaceAttributeToObject:ri,warn:Kn,xmlToJson:Ii});const _i={"Linear.None":Mn.Linear.None,"Quadratic.In":Mn.Quadratic.In,"Quadratic.Out":Mn.Quadratic.Out,"Quadratic.InOut":Mn.Quadratic.InOut,"Cubic.In":Mn.Cubic.In,"Cubic.Out":Mn.Cubic.Out,"Cubic.InOut":Mn.Cubic.InOut,"Quartic.In":Mn.Quartic.In,"Quartic.Out":Mn.Quartic.Out,"Quartic.InOut":Mn.Quartic.InOut,"Quintic.In":Mn.Quintic.In,"Quintic.Out":Mn.Quintic.Out,"Quintic.InOut":Mn.Quintic.InOut,"Sinusoidal.In":Mn.Sinusoidal.In,"Sinusoidal.Out":Mn.Sinusoidal.Out,"Sinusoidal.InOut":Mn.Sinusoidal.InOut,"Exponential.In":Mn.Exponential.In,"Exponential.Out":Mn.Exponential.Out,"Exponential.InOut":Mn.Exponential.InOut,"Circular.In":Mn.Circular.In,"Circular.Out":Mn.Circular.Out,"Circular.InOut":Mn.Circular.InOut,"Elastic.In":Mn.Elastic.In,"Elastic.Out":Mn.Elastic.Out,"Elastic.InOut":Mn.Elastic.InOut,"Back.In":Mn.Back.In,"Back.Out":Mn.Back.Out,"Back.InOut":Mn.Back.InOut,"Bounce.In":Mn.Bounce.In,"Bounce.Out":Mn.Bounce.Out,"Bounce.InOut":Mn.Bounce.InOut};function Vi(e,t,i={},r,s){return new Promise(((o,a)=>{const{duration:l=1e3,delay:c=0,repeat:u=!1,mode:d="Linear.None",yoyo:h=!1}=i,p=_i[d],f=new Ln(e).to(t,l).easing(p).delay(c).onUpdate((i=>{e instanceof n&&t instanceof n&&i instanceof n&&(i.order=t.order),null==r||r(i,f)})).onComplete((()=>{o()})).onStop((()=>{a("animation stop")})).onStart((()=>{null==s||s(f)}));Li(u)?f.repeat(u):Ri(u)&&u&&f.repeat(1/0),f.yoyo(h),f.start()}))}class Qi{constructor(e,t,n={}){this.target=e,this.points=t,this.speed=1,this.reverse=!1,this.needsRotate=!0,this.index=1,this._tween=null,Object.assign(this,n)}get isPlaying(){var e;return!!(null===(e=this._tween)||void 0===e?void 0:e.isPlaying())}async play(){if(this.isPlaying)return!1;this.index=1;let e=this.points.slice();return this.reverse&&(e=e.reverse()),this._play(e)}async _play(e){var t,n;const{target:i}=this,r=null!==(t=this.speed)&&void 0!==t?t:1,s=this.index;let o=e[s-1];if(!o)return!0;o.isVector3||(o=qn(o)),o=o.clone();let a=e[s];if(!a)return!0;a.isVector3||(a=qn(a).clone()),a=a.clone();const l=o.distanceTo(a)/r;this.needsRotate&&(1===s&&i.parent&&i.position.copy(i.parent.worldToLocal(o.clone())),i.lookAt(a)),await Vi(o,a,{duration:l},((e,t)=>{var n;if(i.parent){const t=i.parent.worldToLocal(e.clone());i.position.copy(t)}null===(n=this.onUpdate)||void 0===n||n.call(this,e,t)}),(e=>{var t,n;1===s&&(null===(t=this.onStart)||void 0===t||t.call(this,e)),null===(n=this.onEveryStart)||void 0===n||n.call(this,e),this._tween=e})),null===(n=this.onPoint)||void 0===n||n.call(this,s,a),this.index++,await this._play(e)}pause(){var e;null===(e=this._tween)||void 0===e||e.pause()}resume(){var e;null===(e=this._tween)||void 0===e||e.resume()}stop(){var e;null===(e=this._tween)||void 0===e||e.stop(),this._tween=null}}function Yi(e){var t=typeof e;return null==e||"object"!==t&&"function"!==t}var Wi,Xi=(e=>(e[e.x=0]="x",e[e.y=1]="y",e[e.z=2]="z",e))(Xi||{});(Wi=Xi||(Xi={})).toKey=function(e){return Wi[e]},Wi.toIndex=function(e){return Wi[e]},Wi.getCrossAxiss=function(e){return[(e+1)%3,(e+2)%3]};var Ki=(e=>(e[e.x=0]="x",e[e.y=1]="y",e[e.z=2]="z",e[e.w=3]="w",e))(Ki||{});(e=>{e.toKey=function(t){return e[t]},e.toIndex=function(t){return e[t]},e.getCrossAxiss=function(e){return[(e+1)%4,(e+2)%4]}})(Ki||(Ki={}));var Zi=Object.defineProperty,qi=(e,t,n)=>(((e,t,n)=>{t in e?Zi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);function Ji(e,t){if(t=t??e.arcLengthDivisions,e.cacheArcULengths&&e.cacheArcULengths.length===t+1&&!e.needsUpdate){const n=e.cacheArcULengths;return{lengths:n,length:n[t]}}e.needsUpdate=!1;const n=[0];let i=e.getPoint(0),r=0;for(let s=1;s<=t;s++){const o=e.getPointAt(s/t);r+=o.distanceTo(i),n.push(r),i=o}return e.cacheArcULengths=n,{lengths:n,length:r}}function $i(e,t,n){const i=n?t=>e.getPointAt(t):t=>e.getPoint(t);let r=i(0),s=0;const o=[],a=t.length;for(let e=0;e<a;e++){const n=i(t[e]);s+=n.distanceTo(r),o.push(s),r=n}return{lengths:o,length:o[a-1]}}function er(e,t){let n=e.sampleLength;if(!n){const t=e.sampleNum;if(t)return t;n=1}return Math.ceil(t/n)}function tr(e){const{curve:t}=e;let n=t.getLength();const i=er(e,n);return t.arcLengthDivisions<i&&(t.arcLengthDivisions=i,t.updateArcLengths(),n=t.getLength()),{length:n,division:i}}function nr(e,t){const n=er(t??{},e.getLength()),i=e.getPoints(n),r=e.getLengths(n);return ir(i,{...t,lengths:r})}function ir(e,t){const{startColor:n,endColor:i,color:r,lengths:s}=t??{},o=r?new u(r):null,a=n?new u(n):o??new u(0,1,0),l=i?new u(i):o??new u(0,0,1),c=[],d=[];e[0].toArray(c,0);const h=c.length,p=s??sr(e).lengths,f=p[p.length-1],m=new u;e.forEach(((e,t)=>{e.toArray(c,t*h);const n=p[t]/f;m.lerpColors(a,l,n),m.toArray(d,3*t)}));const y=new g;return y.setAttribute("position",new v(c,h)),y.setAttribute("color",new v(d,3)),y}function rr(e,t){t=t??{};let{material:n,linewidth:i}=t;i=i??1,n=n??new y({vertexColors:!0,linewidth:i});const r=Array.isArray(e)?ir(e,t):nr(e,t);return new w(r,n)}function sr(e){const t=or(e),n=[0],i=t.reduce(((e,t)=>(e+=t.distance(),n.push(e),e)),0);return{lines:t,lengths:n,length:i}}function or(e){const t=[];return e.reduce(((e,n)=>{const i=new b(e,n);return t.push(i),n})),t}function ar(e,t){const n=[];return{lines:t.filter(((t,i)=>{const r=t.closestPointToPointParameter(e),s=0<=r||r>=1;return s&&n.push(i),s})),indexs:n}}function lr(e,t){const{distSortIndexs:n,clampDists:i,clampPoints:r,ts:s,clampTs:o}=cr(e,t),a=n[0];return{line:t[a],index:a,clampDist:i[a],clampPoint:r[a],t:s[a],clampT:o[a]}}function cr(e,n){const i={clampDists:[],clampPoints:[],distSortIndexs:[],ts:[],clampTs:[]};return n.forEach(((n,r)=>{const s=n.closestPointToPointParameter(e),o=x.clamp(s,0,1),a=n.at(o,new t),l=e.distanceTo(a);i.clampDists.push(l),i.clampPoints.push(a),i.distSortIndexs.push(r),i.ts.push(s),i.clampTs.push(o)})),i.distSortIndexs.sort(((e,t)=>i.clampDists[e]-i.clampDists[t])),i}function ur(e){const t=new A,n=null==e[0].z?S:E;return e.reduce(((e,i)=>{const r=new n(e,i);return t.add(r),i})),t}var dr=(e=>(e.back="back",e.front="front",e))(dr||{});function hr(e){const{curve:t,distance:n,fromU:i=0,side:r,tolerance:s=.1*n}=e,o=e.length??t.getLength(),a=t.getPointAt(i);let l=n/o;const c="front"===r?-1:1;let u=!0,d=i,h=a,p=0,f=!0;do{d=c*l+i;let e=!1;d>1?(d=1,e=!0):d<0&&(d=0,e=!0),h=t.getPointAt(d),p=h.distanceTo(a),u=Math.abs(n-p)>s;const r=n/p;if(e&&u&&r>1){f=!1;break}l*=r}while(u);return{succeed:f,u:d,point:h,distance:p}}function pr(e){const{curve:t,distance:n,fromU:i=0,tolerance:r=.1*n,origin:s}=e,o=e.length??t.getLength(),a=t.getPointAt(i),l=a.distanceTo(s),c=n-l;let u=c/o,d=!0,h=i,p=a;do{h=u+i;let e=!1;h>1?(h=1,e=!0):h<0&&(h=0,e=!0),p=t.getPointAt(h);const o=p.distanceTo(s);d=Math.abs(n-o)>r;const a=c/(o-l);if(e&&d&&a>1)return null;u*=a}while(d);return{u:h,point:p}}const fr=new t,mr=new t(1,1,1);new s;const gr=new f;function vr(e){const{joints:t,axials:n}=e;if(t)var i=wr(t);else i=n?yr(e):br(e);return i}function yr(e){const{axials:t,start:n}=e,i=new T;n&&(i.position.copy(n),i.updateMatrix());const r=[i];return t.reduce(((e,t)=>{const n=new T;return n.position.copy(t),e.add(n),r.push(n),n.updateMatrix(),n}),i),i.updateWorldMatrix(!0,!0),r}function wr(e){const t=[];return e.reduce(((e,n)=>{const i=n.clone().sub(e);return t.push(i),n})),yr({axials:t,start:e[0]})}function br(e){const{start:t,axial:n}=e;let i=e.number;const r=new Array(i-1);return r.fill(n),yr({axials:r,start:t})}function xr(e){const{geometry:n,flexible:i=1,axial:r,number:o}=e,a=e.start??new t,l=r.clone().normalize(),c=r.length(),u=o-1,d=(new s).setFromUnitVectors(new t(1,0,0),l),h=(new f).compose(a,d,new t(1,1,1)).invert(),p=n.getAttribute("position").clone(),m=p.count;p.applyMatrix4(h);const g=[],y=[];for(let e=0;e<m;e++){const t=p.getX(e);if(t<0){g.push(0,0,0,0),y.push(1,0,0,0);continue}const n=Math.trunc(t/c);if(n<u){const e=t%c/c*i;g.push(n,n+1,0,0),y.push(1-e,e,0,0)}else g.push(u,0,0,0),y.push(1,0,0,0)}return n.setAttribute("skinIndex",new D(g,4)),n.setAttribute("skinWeight",new v(y,4)),n}function Ar(e){const{skeleton:n,geometryFrame:i}=e,r=n.boneInverses[0].clone().invert(),s=n.boneInverses[1].clone().invert();if(i){const e=i.clone().invert();r.premultiply(e),s.premultiply(e)}const o=(new t).setFromMatrixPosition(r),a=(new t).setFromMatrixPosition(s);return a.sub(o),xr({...e,start:o,axial:a,number:n.bones.length})}function Sr(e){const{skeleton:n,geometry:i,flexible:r=1,geometryFrame:s}=e,o=(null==s?void 0:s.clone().invert())??gr.clone(),a=or(n.boneInverses.map((e=>{const n=e.clone().invert().premultiply(o);return(new t).setFromMatrixPosition(n)}))),l=i.getAttribute("position"),c=l.count,u=[],d=[],h=new t;for(let e=0;e<c;e++){h.fromBufferAttribute(l,e);const{index:t,clampT:n}=lr(h,a),i=n*r;u.push(t,t+1,0,0),d.push(1-i,i,0,0)}return i.setAttribute("skinIndex",new D(u,4)),i.setAttribute("skinWeight",new v(d,4)),i}function Er(e){const{geometry:t}=e,n=e.material??void 0,i=new C(t,n),r=vr(e);i.add(r[0]);const s=new M(r);return i.bind(s),Sr({...e,skeleton:s}),i}function Tr(e){const{skeleton:t}=e,n=Dr(e);return n.updateMatrix(),n.updateMatrixWorld(),n.bind(t),n}function Dr(e){const{target:t,skeleton:n}=e,i=t.geometry,r=new C;return t.copy.call(r,t,!1),Sr({...e,geometry:i,skeleton:n,geometryFrame:t.matrixWorld}),r}function Cr(e){const{target:t}=e;let{skeleton:n}=e;if(n)var i=n.bones[0];else{const t=vr(e);n=new M(t),i=t[0]}t.add(i),t.updateWorldMatrix(!1,!0),n.calculateInverses(),i.removeFromParent();const r=Mr({...e,target:t,skeleton:n});return r.add(i),{model:r,skeleton:n,rootBone:i}}function Mr(e){const{target:t,skeleton:n,parent:i,posOnBone:r}=e,s=t.isMesh,o=s?Dr({...e,skeleton:n}):t.clone(!1);i&&i.add(o),o.updateMatrixWorld(!0),s&&(o.bind(n,t.matrixWorld),r&&(o.frustumCulled=!1));const a=t.children;for(const t of a)Mr({...e,target:t,parent:o});return o}function Ir(e){return e.filter((e=>{var t;return!(null!=(t=e.parent)&&t.isBone)}))}function Br(e){return e.find((e=>{var t;return!(null!=(t=e.parent)&&t.isBone)}))}function Pr(e){return Br(e)??e[0]}function Or(e){return e.curve?Rr(e):Ur(e)}function Rr(e){const{keyframeTracks:t,duration:n,...i}=Lr(e);return{...i,clip:new I(e.name,n,t)}}function Lr(e){const{curve:t,lookDistance:n}=e,i=e.targetPath??"",r=tr(e).division,s=kr(e,t.getLength()),o=R,a=[],l=Fr(r),c={...e,duration:s,division:r,ts:l,lookPoint:{distance:n}},u=zr(c),{points:d,rotates:h,...p}=Nr(c);if(d.length){const e=[];d.forEach(((t,n)=>{t.toArray(e,3*n)}));const t=new B(`${i}.position`,u,e,o);a.push(t)}if(h.length){const e=[];h.forEach(((t,n)=>{t.toArray(e,4*n)}));const t=new P(`${i}.quaternion`,u,e,o);a.push(t)}return{...p,keyframeTracks:a,duration:s}}function kr(e,t){let n=e.duration;if(!n){const i=e.speed;if(null==i)throw"缺少选项 duration 或者 speed";if(!t)throw"缺少参数 length";n=t/i}return n}function Nr(e){var n,i;const{curve:r,target:o,lookPoint:a,enableUp:l,fixUp:c}=e,u=e.position??!0,d=e.rotate??!0,h=[],p=[],m=[];if(!u&&!d)return{rotates:h,points:p,curveLength:void 0,lengths:void 0};const g=(e.anchor??fr).clone(),v=e.ts??e.us,y=!e.ts;if(!v)throw"缺少参数:至少传递 ts 和 us 任意之一";let w=gr.clone(),b=gr.clone(),x=mr.clone(),A=O.DEFAULT_UP;o&&(o.updateWorldMatrix(!0,!1),w=o.matrix,b=o.matrixWorld,x=o.scale,A=o.up);const S=w.clone().invert(),E=b.clone().multiply(S).clone().invert(),T=r.getTangent(0);T.transformDirection(E);const D=(null==(n=e.front)?void 0:n.clone().normalize())??T,C=(null==(i=e.up)?void 0:i.clone().normalize())??A.clone().transformDirection(E);let M=w.clone().setPosition(0,0,0),I=e=>r.getPoint(e),B=e=>r.getTangent(e);y&&(I=e=>r.getPointAt(e),B=e=>r.getTangentAt(e));const P=v.length,R=P-1;let{distance:L,curveLength:k,lengths:N}=a??{};L=L??0;let F=B;0!==L&&(N||(N=$i(r,v,y).lengths),null==k&&(k=N[R]),F=(e,t)=>{const n=I(e);let i=(N[t]+L)/k;return i>1&&(i=1),r.getPointAt(i).sub(n).normalize()});let z=e=>{const t=v[e],n=F(t,e);n.transformDirection(E),m.push(n);const i=e-1,r=i<0,o=r?D:m[i],a=(new s).setFromUnitVectors(o,n);if(!r){const e=h[i];a.multiply(e)}return a.normalize()};if(l){const e=new t(0,1,0);z=c?function(t){const n=v[t],i=F(n,t);i.transformDirection(E),m.push(i);const r=t-1;let o;if(r<0)o=(new s).setFromUnitVectors(D,i);else{const e=h[r],t=D.clone().applyQuaternion(e).normalize();o=(new s).setFromUnitVectors(t,i),o.multiply(e)}const a=C.clone().applyQuaternion(o).normalize(),l=(new s).setFromUnitVectors(a,e);return o.premultiply(l),o.normalize()}:function(t){const n=v[t],i=F(n,t);i.transformDirection(E),m.push(i);const r=t-1,o=r<0,a=o?D:m[r],l=(new s).setFromUnitVectors(a,i);if(o){const t=C.clone().applyQuaternion(l);t.projectOnPlane(i).normalize();const n=e.clone().projectOnPlane(i).normalize(),r=(new s).setFromUnitVectors(t,n);l.premultiply(r)}else{const e=h[r];l.multiply(e)}return l.normalize()}}for(let e=0;e<P;e++){const t=v[e];if(d){const t=z(e);h.push(t),M=(new f).compose(fr,t,x)}if(u){const e=I(t);e.applyMatrix4(E);const n=g.clone().applyMatrix4(M);e.sub(n),p.push(e)}}return{rotates:h,points:p,curveLength:k??void 0,lengths:N??void 0}}function Fr(e){const t=[];for(let n=0;n<=e;n++)t.push(n/e);return t}function zr(e){const{curve:t,division:n,duration:i}=e,r=t.getLengths(n),s=r[r.length-1];return r.map((e=>e/s*i))}function Ur(e){const{smooth:t,points:n}=e;if(!1===t)var{keyframeTracks:i,duration:r,...s}=jr(e);else{const t=ur(n);var{keyframeTracks:i,duration:r,...s}=Lr({...e,curve:t})}return{...s,clip:new I(e.name,r,i)}}function jr(e){const t=e.targetPath??"",n=e.points,{lines:i,length:r,lengths:s}=sr(n),o=kr(e,r),a=[],l=s.map((e=>e/r*o)),{points:c,pointTimes:u,rotates:d,rotateTimes:h}=Gr({...e,times:l},i);if(c.length){const e=[];c.forEach(((t,n)=>{t.toArray(e,3*n)}));const n=new B(`${t}.position`,u,e,R);a.push(n)}if(d.length){const e=[];d.forEach(((t,n)=>{t.toArray(e,4*n)}));const n=new P(`${t}.quaternion`,h,e,L);a.push(n)}return{keyframeTracks:a,duration:o,lengths:s,curveLength:r}}function Gr(e,n){var i,r;const{points:o,target:a,times:l,enableUp:c,fixUp:u}=e,d=e.position??!0,h=e.rotate??!0,p=o.length,m=p-1;n=n??or(o);const g=[],v=[],y=[],w=[],b={rotates:g,points:v,rotateTimes:l,pointTimes:y};if(!d&&!h)return b;const x=(e.anchor??fr).clone();let A=gr.clone(),S=gr.clone(),E=mr.clone(),T=O.DEFAULT_UP;a&&(a.updateWorldMatrix(!0,!1),A=a.matrix,S=a.matrixWorld,E=a.scale,T=a.up);const D=A.clone().invert(),C=S.clone().multiply(D).clone().invert(),M=n[0].delta(new t);M.transformDirection(C);const I=(null==(i=e.front)?void 0:i.clone().normalize())??M,B=(null==(r=e.up)?void 0:r.clone().normalize())??T.clone().transformDirection(C);let P=A.clone().setPosition(0,0,0),R=P,L=e=>{const i=n[e].delta(new t).normalize();i.transformDirection(C),w.push(i);const r=e-1,o=r<0,a=o?I:w[r],l=(new s).setFromUnitVectors(a,i);if(!o){const e=g[r];l.multiply(e)}return l.normalize()};if(c){const e=new t(0,1,0);L=u?function(i){const r=n[i].delta(new t).normalize();r.transformDirection(C),w.push(r);const o=i-1;let a;if(o<0)a=(new s).setFromUnitVectors(I,r);else{const e=g[o],t=I.clone().applyQuaternion(e).normalize();a=(new s).setFromUnitVectors(t,r),a.multiply(e)}const l=B.clone().applyQuaternion(a).normalize(),c=(new s).setFromUnitVectors(l,e);return a.premultiply(c),a.normalize()}:function(i){const r=n[i].delta(new t).normalize();r.transformDirection(C),w.push(r);const o=i-1,a=o<0,l=a?I:w[o],c=(new s).setFromUnitVectors(l,r);if(a){const t=B.clone().applyQuaternion(c);t.projectOnPlane(r).normalize();const n=e.clone().projectOnPlane(r).normalize(),i=(new s).setFromUnitVectors(t,n);c.premultiply(i)}else{const e=g[o];c.multiply(e)}return c.normalize()}}for(let e=0;e<p;e++){if(h)if(e<m){const t=L(e);g.push(t),P=(new f).compose(fr,t,E)}else g.push(g[e-1].clone());if(d){const t=l[e],n=o[e].clone();if(n.applyMatrix4(C),e>0){const e=x.clone().applyMatrix4(R),i=n.clone().sub(e);v.push(i),y.push(t)}const i=x.clone().applyMatrix4(P);n.sub(i),v.push(n),y.push(t)}R=P}return b}function Hr(e){const t=e.mixer,n=Cr(e),{model:i,skeleton:r}=n,s={...e,target:i,skeleton:r},{clip:o,...a}=e.posOnBone?_r(s):Yr(s);i.animations.push(o);const l=null==t?void 0:t.clipAction(o,i);return{...a,...n,clip:o,action:l}}function _r(e){const{boneTracks:t,duration:n,...i}=Vr(e),r=t.flat();return{...i,clip:new I(e.name,n,r)}}function Vr(e){const{skeleton:t,targetPath:n}=e,i=t.bones,{times:r,boneSampleDatas:s,duration:o,...a}=Qr(e),l=r.length,c=R,u=s.map(((e,t)=>{const{points:s,rotates:o}=e,a=i[t],u=n?`${n}.skeleton.bones[${t}]`:`${a.name||a.uuid}`,d=[],h=[];for(let e=0;e<l;e++)s&&s[e].toArray(d,3*e),o[e].toArray(h,4*e);const p=[];if(s){const e=new B(`${u}.position`,r,d,c);p.push(e)}const f=new P(`${u}.quaternion`,r,h,c);return p.push(f),p}));return{...a,boneTracks:u,duration:o}}function Qr(e){var n;const{curve:i,skeleton:r,stretch:o}=e,{bones:a,boneInverses:l}=r,c=a[0],u=e.target??c.parent;if(!u)throw"target 或 根骨骼的 parent 不存在";const d=e.tolerance??.1;c.updateWorldMatrix(!0,!0);const{division:h,length:p}=tr(e),{matrixWorld:m}=u,g=m.clone().invert(),v=[],y=[];l.reduce(((e,t)=>{const n=t.clone().invert();v.push(n);const i=e.clone().multiply(n);return y.push(i),t}),g);const w=y[0],b=new t,x=new s,A=new t;w.decompose(b,x,A);const S=kr(e,p),E=Fr(h),T=zr({curve:i,division:h,duration:S}),D=E.length,C=[],M=(new t).setFromMatrixPosition(y[1]).negate(),I=l[0],B=null==(n=e.up)?void 0:n.clone().applyMatrix4(m).transformDirection(I),{points:P,rotates:O,...R}=Nr({...e,curve:i,ts:E,target:c,rotate:!0,front:M,up:B,anchor:null});for(let e=0;e<D;e++)C.push(m.clone());const L=P.map(((e,t)=>{const n=O[t];n.premultiply(x).normalize();const i=(new f).compose(e,n,A);return i.premultiply(m),i})),k=i.getLengths(h).map((e=>e/p)),N=[{points:P,rotates:O,us:k,matrixs:L}],F=o?function(e,t,n){const r=N[e].us[t]-n/p;return{u:r,point:r<0?null:i.getPointAt(r)}}:function(e,t,n){const r=N[e].us[t],{u:s,point:o,succeed:a}=hr({curve:i,distance:n,fromU:r,length:p,side:dr.front,tolerance:d*n});return{u:s,point:a?o:null}},z=l.length,U=z-1;for(let e=1;e<z;e++){const n=[],r=[],o=[],a=[];N.push({points:n,rotates:r,us:o,matrixs:a});const l=y[e],c=v[e],u=e-1,d=N[u],h=y[u],p=v[u],{matrixs:m,points:g,rotates:w}=d,b=(new t).setFromMatrixScale(h),x=u-1,A=x<0?C:N[x].matrixs,S=new t,E=new s,T=new t;l.decompose(S,E,T);const M=(new t).setFromMatrixPosition(c).sub((new t).setFromMatrixPosition(p)).length(),I=S.length();for(let t=0;t<D;t++){const{point:c,u:d}=F(u,t,M);o.push(d),r.push(E.clone());const h=m[t];if(d<0||!c){n.push(S);const e=h.clone().multiply(l);a.push(e);continue}const p=A[t];let v=p.clone().invert();const y=c.clone().applyMatrix4(v),x=g[t];y.sub(x).normalize();const D=w[t],C=(new f).compose(x,D,b),B=S.clone().transformDirection(C),P=(new s).setFromUnitVectors(B,y);D.premultiply(P).normalize(),h.compose(x,D,b),h.premultiply(p);const O=h.clone().invert();c.applyMatrix4(O);const R=c.length();c.copy(S).multiplyScalar(R/I),n.push(c);const L=(new f).compose(c,E,T);if(e===U){const e=i.getTangentAt(d);e.negate().transformDirection(O);const n=(new s).setFromUnitVectors(c.clone().normalize(),e);n.premultiply(E).normalize(),r[t]=n,L.compose(c,n,T)}L.premultiply(h),a.push(L)}}return{...R,times:T,boneSampleDatas:N,duration:S}}function Yr(e){const{boneTracks:t,targetTracks:n,duration:i,...r}=Wr(e),s=n.concat(t.flat());return{...r,clip:new I(e.name,i,s)}}function Wr(e){const{skeleton:t,targetPath:n}=e,{times:i,boneSampleDatas:r,duration:s,targetSampleDatas:o,...a}=Xr(e),l=i.length,c=t.bones,u=R,d=[],h=[],{points:p,rotates:f}=o;for(let e=0;e<l;e++)p[e].toArray(d,3*e),f[e].toArray(h,4*e);const m=n??"",g=[new B(`${m}.position`,i,d,u),new P(`${m}.quaternion`,i,h,u)],v=r.map(((e,t)=>{const{points:r,rotates:s}=e,o=c[t],a=n?`${n}.skeleton.bones[${t}]`:`${o.name||o.uuid}`,d=[],h=[];for(let e=0;e<l;e++)r&&r[e].toArray(d,3*e),s[e].toArray(h,4*e);const p=[];if(r){const e=new B(`${a}.position`,i,d,u);p.push(e)}const f=new P(`${a}.quaternion`,i,h,u);return p.push(f),p}));return{...a,boneTracks:v,targetTracks:g,duration:s}}function Xr(e){const{curve:n,skeleton:i,stretch:r}=e,{bones:o,boneInverses:a}=i,l=o[0],c=e.target??l.parent;if(!c)throw"target 或 根骨骼的 parent 不存在";const u=e.tolerance??.1;l.updateWorldMatrix(!0,!0);const{division:d,length:h}=tr(e),{matrix:p,matrixWorld:m,scale:g}=c,v=m.clone().multiply(p.clone().invert()),y=m.clone().invert(),w=[],b=[];a.reduce(((e,t)=>{const n=t.clone().invert();w.push(n);const i=e.clone().multiply(n);return b.push(i),t}),y);const x=b[0],A=new t,S=new s,E=new t;x.decompose(A,S,E);const T=kr(e,h),D=Fr(d),C=w[0],M=(new t).setFromMatrixPosition(b[1]).negate().transformDirection(C).transformDirection(y),{rotates:I,points:B,...P}=Nr({...e,curve:n,target:c,position:!0,rotate:!0,anchor:A,front:M,ts:D}),O=zr({curve:n,division:d,duration:T}),R=B.map(((e,t)=>{const n=I[t],i=(new f).compose(e,n,g);return i.premultiply(v),i})),L={points:B,rotates:I,matrixs:R},k=[],N=R.map((e=>(k.push(S.clone()),e.clone().multiply(x)))),F=D.length,z=n.getLengths(d).map((e=>e/h)),U=[{rotates:k,us:z,matrixs:N}],j=r?function(e,t,i){const r=U[e].us[t]-i/h;return{u:r,point:r<0?null:n.getPointAt(r)}}:function(e,t,i){const r=U[e].us[t],{u:s,point:o,succeed:a}=hr({curve:n,distance:i,fromU:r,length:h,side:dr.front,tolerance:u*i});return{u:s,point:a?o:null}},G=a.length,H=G-1;for(let e=1;e<G;e++){const i=[],r=[],o=[],a=[];U.push({points:i,rotates:r,us:o,matrixs:a});const l=b[e],c=w[e],u=e-1,d=U[u],h=b[u],p=w[u],{matrixs:m,points:g,rotates:v}=d,y=new t,x=new s,A=new t;h.decompose(y,x,A);const S=u-1,E=S<0?R:U[S].matrixs,T=new t,D=new s,C=new t;l.decompose(T,D,C);const M=(new t).setFromMatrixPosition(c).sub((new t).setFromMatrixPosition(p)).length(),I=T.length();for(let t=0;t<F;t++){const{point:c,u:d}=j(u,t,M);o.push(d),r.push(D.clone());const h=m[t];if(d<0||!c){i.push(T);const e=h.clone().multiply(l);a.push(e);continue}const p=E[t];let w=p.clone().invert();const b=c.clone().applyMatrix4(w),S=(null==g?void 0:g[t])??y;b.sub(S).normalize();const B=v[t],P=(new f).compose(S,B,A),O=T.clone().transformDirection(P);B.setFromUnitVectors(O,b),B.premultiply(x).normalize(),h.compose(S,B,A),h.premultiply(p);const R=h.clone().invert();c.applyMatrix4(R);const L=c.length();c.copy(T).multiplyScalar(L/I),i.push(c);const k=(new f).compose(c,D,C);if(e===H){const e=n.getTangentAt(d);e.negate().transformDirection(R);const i=(new s).setFromUnitVectors(c.clone().normalize(),e);i.premultiply(D).normalize(),r[t]=i,k.compose(c,i,C)}k.premultiply(h),a.push(k)}}return{...P,times:O,boneSampleDatas:U,targetSampleDatas:L,duration:T}}class Kr{constructor(e){qi(this,"isAnimationClipKeyframe",!0),qi(this,"_tracksTimes",null),qi(this,"lastGetTime",0),qi(this,"lastGetKeyframeIndexs",[]),this.clip=e}get tracksTimes(){return this._tracksTimes??(this._tracksTimes=this.clip.tracks.map((e=>e.times)))}getTracksKeyframeIndexs(e){const{lastGetTime:t,tracksTimes:n}=this;e<t&&(this.lastGetKeyframeIndexs=[]),this.lastGetTime=e;const i=this.lastGetKeyframeIndexs;return this.lastGetKeyframeIndexs=n.map(((t,n)=>{const r=i[n]??0,s=t.length;for(let n=r;n<s;n++)if(e<t[n])return n-1;return s-1}))}getTracksKeyframes(e){const t=this.getTracksKeyframeIndexs(e),n=this.clip.tracks;return t.map(((e,t)=>{let i=null;if(-1!==e){const r=n[t],s=r.getValueSize(),o=e*s,a=o+s;i=Array.from(r.values.slice(o,a))}return{index:e,value:i}}))}}var Zr=(e=>(e.keyframe="keyframe",e.position=".position",e.quaternion=".quaternion",e.rotation=".rotation",e.scale=".scale",e.loop="loop",e.finished="finished",e.point="point",e))(Zr||{});const qr=["loop","finished"];class Jr extends Kr{constructor(e){super(e.getClip()),qi(this,"isAnimationActionKeyframe",!0),qi(this,"_trackNames"),qi(this,"_positionTrackName"),qi(this,"_quaternionTrackName"),qi(this,"_rotationTrackName"),qi(this,"_scaleTrackName"),qi(this,"event",new k),qi(this,"_frameEventNames",null),qi(this,"mixerListener",(e=>{(e.action.isAnimationActionKeyframe?e.action.action:e.action)===this.action&&this.event.dispatchEvent(e)})),qi(this,"_points",[]),qi(this,"_polyline"),qi(this,"_polylineLengths",[]),qi(this,"_pointsProgress",[]),qi(this,"lastGetProgress",0),qi(this,"lastGetPointIndex",0),qi(this,"_enablePointEvent",!0),qi(this,"_enableKeyframeEvent",!0),qi(this,"lastKeyframes",null),qi(this,"lastPolylineKeyframe",null),qi(this,"frameFun",(()=>{var e;if(this.enableKeyframeEvent){const{keyframes:e,lastKeyframes:t}=this;let n=!1;for(const[i,r]of Object.entries(e)){const e=null==t?void 0:t[i];r.index!==(null==e?void 0:e.index)&&(n=!0,this.event.dispatchEvent({type:i,preFrame:e,frame:r}))}n&&(this.event.dispatchEvent({type:"keyframe",preFrame:t,frame:e}),this.lastKeyframes=e)}if(this.pointEventEnabled){const{pointIndex:t,lastPolylineKeyframe:n}=this;if(t!==(null==n?void 0:n.index)){const i={index:t,value:this.points[t]??(null==(e=this.polyline)?void 0:e.getPoint(this.progress)),length:this.polylineLengths[t]};this.event.dispatchEvent({type:"point",preFrame:n,frame:i}),this.lastPolylineKeyframe=i}}})),qi(this,"_stopListenFun"),this.action=e}get time(){return this.action.time}get duration(){return this.clip.duration}get progressTime(){const{isReverseLoop:e,duration:t,time:n}=this;return e?t-n:n}set progressTime(e){const{action:t,isReverseLoop:n,duration:i}=this;n&&(e=i-e),t.time=e}get progress(){return this.progressTime/this.duration}set progress(e){this.progressTime=e*this.duration}get loopCount(){const e=this.action._loopCount;return-1===e?0:e}get isReverseLoop(){return this.action.loop===N&&this.loopCount%2==1}get loopDirFactor(){return this.isReverseLoop?-1:1}get isReverse(){const e=this.action.timeScale<0;return this.isReverseLoop?!e:e}get dirFactor(){return this.isReverse?-1:1}get trackNames(){return this._trackNames??(this._trackNames=this.clip.tracks.map((e=>e.name)))}get keyframeIndexs(){const e=this.getTracksKeyframeIndexs(this.progressTime);return this.trackNames.reduce(((t,n,i)=>(t[n]=e[i],t)),{})}get keyframes(){const e=this.getTracksKeyframes(this.progressTime);return this.trackNames.reduce(((t,n,i)=>(t[n]=e[i],t)),{})}get positionTrackName(){return void 0===this._positionTrackName&&(this._positionTrackName=this.trackNames.find((e=>e.endsWith(".position")))??null),this._positionTrackName}get positionkeyframeIndex(){const e=this.positionTrackName;return e?this.keyframeIndexs[e]:null}get positionKeyframe(){const e=this.positionTrackName;if(e){const{index:n,value:i}=this.keyframes[e];return{index:n,value:i?new t(...i):null}}return null}get quaternionTrackName(){return void 0===this._quaternionTrackName&&(this._quaternionTrackName=this.trackNames.find((e=>e.endsWith(".quaternion")))??null),this._quaternionTrackName}get quaternionKeyframeIndex(){const e=this.quaternionTrackName;return e?this.keyframeIndexs[e]:null}get quaternionKeyframe(){const e=this.quaternionTrackName;if(e){const{index:t,value:n}=this.keyframes[e];return{index:t,value:n?new s(...n):null}}return null}get rotationTrackName(){return void 0===this._rotationTrackName&&(this._rotationTrackName=this.trackNames.find((e=>e.endsWith(".rotation")))??null),this._rotationTrackName}get rotationkeyframeIndex(){const e=this.rotationTrackName;return e?this.keyframeIndexs[e]:null}get rotationKeyframe(){const e=this.rotationTrackName;if(e){const{index:t,value:i}=this.keyframes[e];return{index:t,value:i?new n(...i):null}}return null}get scaleTrackName(){return void 0===this._scaleTrackName&&(this._scaleTrackName=this.trackNames.find((e=>e.endsWith(".scale")))??null),this._scaleTrackName}get scaleKeyframeIndex(){const e=this.scaleTrackName;return e?this.keyframeIndexs[e]:null}get scaleKeyframe(){const e=this.scaleTrackName;if(e){const{index:n,value:i}=this.keyframes[e];return{index:n,value:i?new t(...i):null}}return null}get frameEventNames(){return this._frameEventNames??(this._frameEventNames=[...this.trackNames,"keyframe","point"])}get mixer(){return this.action._mixer}addEventListener(e,t){const n=this.mixerListener,i=qr.includes(e);i&&!this.mixer.hasEventListener(e,n)&&this.mixer.addEventListener(e,n);const r=this.frameEventNames.includes(e);return!(!i&&!r)&&(this.event.addEventListener(e,t),r&&!this._stopListenFun&&this.enableFrameEvent&&(this._stopListenFun=$r(this.frameFun)),!0)}removeEventListener(e,t){if(qr.includes(e)&&1===this.getListeners(e).length){const t=this.mixerListener;this.mixer.removeEventListener(e,t)}this.event.removeEventListener(e,t),this.stopListenFun&&!this.hasListeners&&(this.stopListenFun=null)}get points(){return this._points}set points(e){e.length>1?(this._points=e,this.polyline=ur(e)):(this._points=[],this.polyline=null)}get polyline(){return this._polyline}set polyline(e){this._polyline=e;const t=(null==e?void 0:e.getCurveLengths())??[];this.polylineLengths=[0,...t]}get polylineLengths(){return this._polylineLengths}set polylineLengths(e){this._polylineLengths=e;const t=1/e[e.length-1];this.pointsProgress=e.map((e=>e*t))}get polylineLength(){return this.polylineLengths[this.polylineLengths.length-1]}get polylineProgressLength(){return this.polylineLength*this.progress}get pointsProgress(){return this._pointsProgress}set pointsProgress(e){this._pointsProgress=e}get pointIndex(){return this.getPointIndex(this.progress)}getPointIndex(e){const{lastGetProgress:t,pointsProgress:n}=this;e<t&&(this.lastGetPointIndex=0),this.lastGetProgress=e;const i=Math.max(this.lastGetPointIndex,0),r=n.length;for(let t=i;t<r;t++)if(e<n[t])return this.lastGetPointIndex=t-1;return this.lastGetPointIndex=r-1}get enablePointEvent(){return this._enablePointEvent}set enablePointEvent(e){this._enablePointEvent=e,e&&this.autoStartListen()}get pointEventEnabled(){return this.enablePointEvent&&this.pointsProgress.length>0&&this.getListeners("point").length>0}get enableKeyframeEvent(){return this._enableKeyframeEvent}set enableKeyframeEvent(e){this._enableKeyframeEvent=e,e&&this.autoStartListen()}get enableFrameEvent(){return this.enableKeyframeEvent||this.enablePointEvent}get stopListenFun(){return this._stopListenFun}set stopListenFun(e){const t=this._stopListenFun;t&&t(),this._stopListenFun=e}startListen(){this.stopListenFun||(this.stopListenFun=$r(this.frameFun))}stopListen(){this.stopListenFun=null}autoStartListen(){!this.stopListenFun&&this.enableFrameEvent&&this.hasListeners&&(this.stopListenFun=$r(this.frameFun))}get listeners(){return this.event._listeners}get hasListeners(){const e=this.listeners;return!!e&&Object.values(e).some((e=>e&&e.length>0))}getListeners(e){var t;return(null==(t=this.listeners)?void 0:t[e])??[]}destroy(e){const{action:t,mixer:n,mixerListener:i}=this;this.stopListen(),n.removeEventListener("loop",i),n.removeEventListener("finished",i),this.event._listeners=null,!e&&(t.stop(),t.reset(),n._deactivateAction(t),n._removeInactiveAction(t))}}function $r(e){let t;const n=i=>{e(i),t=requestAnimationFrame(n)};return t=requestAnimationFrame(n),()=>{cancelAnimationFrame(t)}}class es extends Jr{constructor(){super(...arguments),qi(this,"isAnimationActionOperate",!0)}forward(e){const t=this.action;e=Math.abs(e??t.timeScale),t.timeScale=e}backward(e){const t=this.action;e=Math.abs(e??t.timeScale),t.timeScale=-e}}function ts(e){const t=new es(e);return new Proxy(t,{get:function(e,t,n){return t in e.action?e.action[t]:e[t]},set:function(e,t,n,i){return t in e.action?e.action[t]=n:e[t]=n,!0},deleteProperty:function(e,t){return t in e.action?Reflect.deleteProperty(e.action,t):Reflect.deleteProperty(e,t)},has:function(e,t){return t in e.action||t in e},ownKeys:function(e){return Reflect.ownKeys(e.action).concat(Reflect.ownKeys(e))}})}class ns{constructor(e){qi(this,"_action"),this.setAction(e)}get action(){return this._action}set action(e){this.setAction(e)}setAction(e){this._action=e&&ts(e)}get play(){const e=this.action;return!(!e||!e._mixer._isActiveAction(e)||e.paused)}set play(e){const t=this.action;t&&(t.paused=!e,e&&0===t.time&&t.play())}stop(){var e;null==(e=this.action)||e.stop()}}function is(e){var t;null==(t=e.reset)||t.call(e,!0)}class rs extends ns{constructor(e,t=[]){super(e),qi(this,"_updateGUI",null),this.guis=t}get updateGUI(){return this._updateGUI??this.constructor.updateGUI??is}set updateGUI(e){this._updateGUI=e}get action(){return this._action}set action(e){this.setAction(e),this.updateAllGUI()}updateAllGUI(){for(const e of this.guis)this.updateGUI(e)}}function ss(e){const t=new rs(e);return new Proxy(t,{get:function(e,t,n){var i;return t in e?e[t]:null==(i=e.action)?void 0:i[t]},set:function(e,t,n,i){if(t in e)e[t]=n;else{if(!e.action)return!1;e.action[t]=n}return!0},deleteProperty:function(e,t){return t in e?Reflect.deleteProperty(e,t):!!e.action&&Reflect.deleteProperty(e.action,t)},has:function(e,t){return t in e||!!e.action&&t in e.action},ownKeys:function(e){return e.action?Reflect.ownKeys(e).concat(Reflect.ownKeys(e.action)):Reflect.ownKeys(e)}})}qi(rs,"updateGUI",is);var os=(e=>(e.position=".position",e.quaternion=".quaternion",e.rotationX=".rotation[x]",e.rotationY=".rotation[y]",e.rotationZ=".rotation[z]",e.scale=".scale",e.color=".material.color",e.mapRotation=".material.map[rotation]",e.opacity=".material[opacity]",e.visible=".visible",e))(os||{}),as=(e=>(e.bool="bool",e.number="number",e.color="color",e.quaternion="quaternion",e.string="string",e.vector="vector",e))(as||{});const ls={bool:z,number:U,color:j,quaternion:P,string:G,vector:B},cs={blendMode:H,deduplication:!1,autoClear:!0,tracks:{".position":{valueTypeName:"vector"},".quaternion":{valueTypeName:"quaternion"},".scale":{valueTypeName:"vector"},".material.color":{valueTypeName:"color"},".material[opacity]":{valueTypeName:"number"},".material.map[rotation]":{valueTypeName:"number"},".visible":{valueTypeName:"bool"},".rotation[x]":{valueTypeName:"number"},".rotation[y]":{valueTypeName:"number"},".rotation[z]":{valueTypeName:"number"},".rotation[order]":{valueTypeName:"string"}}};class us{constructor(){qi(this,"_options",null),qi(this,"name"),qi(this,"duration"),qi(this,"tracksData",new Map),qi(this,"_tracks",null),qi(this,"_clip",null)}get globalOptions(){return this.constructor.options}get options(){return this._options??(this._options=structuredClone(this.globalOptions))}get blendMode(){return this.options.blendMode??(this.options.blendMode=this.globalOptions.blendMode)}set blendMode(e){this.blendMode!==e&&(this.options.blendMode=e,this.clipChanged())}get autoClear(){return this.options.autoClear??(this.options.autoClear=this.globalOptions.autoClear)}set autoClear(e){this.options.autoClear=e}get deduplication(){return this.options.deduplication??(this.options.deduplication=this.globalOptions.deduplication)}set deduplication(e){this.deduplication!==e&&(this.options.deduplication=e,this.tracksChanged())}get tracksConfig(){return this.options.tracks??(this.options.tracks=structuredClone(this.globalOptions.tracks))}set tracksConfig(e){const t=this.tracksConfig;this.options.tracks=e&&Object.assign(t,e)}clearKeyframes(){this.tracksData.clear(),this.tracksChanged()}tracksChanged(){this._tracks=null,this.clipChanged()}clipChanged(){this._clip=null}get tracks(){return this._tracks??(this._tracks=this.createTracks())}getTrackConfig(e){const t=this.tracksConfig;let n=t[e];if(n)return n;for(const n of Object.keys(t))if(e.endsWith(n))return t[n];return null}createTracks(){const{tracksData:e,deduplication:t,autoClear:n}=this,i=[];for(const[n,r]of e.entries()){r.sort(((e,t)=>e.time-t.time));const e=[],s=[];for(const{time:t,value:n}of r)e.push(t),s.push(...n);const{valueTypeName:o,...a}=this.getTrackConfig(n)??{};const l=new(ls[o]??F)(n,e,s);for(const[e,t]of Object.entries(a))null!=t&&(l[e]=t);t&&l.optimize(),i.push(l)}return n&&this.clearKeyframes(),i}get clip(){return this._clip??(this._clip=this.createClip())}createClip(e,t){e=e??this.name??void 0,t=t??this.duration??void 0;const{blendMode:n,tracks:i}=this,r=new I(e,t,i);return null!=n&&(r.blendMode=n),r}updateClip(e){return e||(e=this._clip)?(e.tracks=this.tracks,e.resetDuration(),e):this.clip}addKeyframe(e,t,n){const i=this.tracksData;i.has(e)||i.set(e,[]),i.get(e).push({time:t,value:n}),this.tracksChanged()}addKeyframes(e,t,n){for(const[i,r]of Object.entries(n)){const n=`${e}.${i}`;Array.isArray(r)?this.addKeyframe(n,t,r):Yi(r)?this.addKeyframe(n,t,[r]):this.addKeyframes(n,t,r)}}addPosition(e,t,n){const{x:i,y:r,z:s}=t;n=n??"",this.addKeyframe(`${n}.position`,e,[i,r,s])}addQuaternion(e,t,n){const{x:i,y:r,z:s,w:o}=t;n=n??"",this.addKeyframe(`${n}.quaternion`,e,[i,r,s,o])}addRotation(e,t,n){const{x:i,y:r,z:s,order:o}=t;n=n??"",this.addKeyframe(`${n}.rotation[x]`,e,[i]),this.addKeyframe(`${n}.rotation[y]`,e,[r]),this.addKeyframe(`${n}.rotation[z]`,e,[s]),o&&this.addKeyframe(`${n}.rotation[order]`,e,[o])}addRotationX(e,t,n){n=n??"",this.addKeyframe(`${n}.rotation[x]`,e,[t])}addRotationY(e,t,n){n=n??"",this.addKeyframe(`${n}.rotation[y]`,e,[t])}addRotationZ(e,t,n){n=n??"",this.addKeyframe(`${n}.rotation[z]`,e,[t])}addScale(e,t,n){const{x:i,y:r,z:s}=t;n=n??"",this.addKeyframe(`${n}.scale`,e,[i,r,s])}addColor(e,t,n){const{r:i,g:r,b:s}=t;n=n??"",this.addKeyframe(`${n}.material.color`,e,[i,r,s])}addOpacity(e,t,n){n=n??"",this.addKeyframe(`${n}.material[opacity]`,e,[t])}addMapRotation(e,t,n){n=n??"",this.addKeyframe(`${n}.material.map[rotation]`,e,[t])}addVisible(e,t,n){n=n??"",this.addKeyframe(`${n}.visible`,e,[t])}}qi(us,"options",cs);class ds extends us{constructor(e,t){super(),qi(this,"_mixer"),qi(this,"_root",null),qi(this,"_action",null),this.mixer=e,this.root=t}get mixer(){return this._mixer}set mixer(e){this._mixer!==e&&(this._mixer=e,this.actionChanged())}get root(){return this._root}set root(e){this._root!==e&&(this._root=e,this.actionChanged())}get loop(){return this.options.loop??(this.options.loop=this.globalOptions.loop)}set loop(e){this.loop!==e&&(this.options.loop=e,this.actionChanged())}get repetitions(){return this.options.repetitions??(this.options.repetitions=this.globalOptions.repetitions)}set repetitions(e){this.repetitions!==e&&(this.options.repetitions=e,this.actionChanged())}clipChanged(){super.clipChanged(),this.actionChanged()}actionChanged(){this._action=null}get action(){return this._action??(this._action=this.createAction())}createAction(e,t,n){t=t??void 0;const i=n??this.mixer,r=e??this.root??void 0,s=i.clipAction(this.clip,r,t),{loop:o,repetitions:a}=this;return null!=o&&(s.loop=o),null!=a&&(s.repetitions=a),s}}function hs(e,t=1){const n=e.slice().sort(((e,t)=>e-t)),i=[[]];return n.reduce((function(e,n){const r=e[e.length-1];return null==r||n-r<=t?e.push(n):(e=[n],i.push(e)),e}),i[0]),i}function ps(e,t){let{count:n=4,min:i=-1/0,max:r=1/0}=t??{};const s=e[0];i=Math.max(s-n+1,i),r=Math.min(s+n-1,r),n=Math.min(n,r-i+1);const o=[];for(const t of e)i<=t&&t<=r&&o.push(t);const a=hs(o);a.sort(((e,t)=>t.length-e.length));let l=a.find((e=>e.includes(s)));if(l.length>=n)return l.sort(((t,n)=>e.indexOf(t)-e.indexOf(n))),l=l.slice(0,n),l.sort(((e,t)=>e-t)),l;for(const e of o){i=l[0],r=l[l.length-1];let t=i-e,s=n-l.length;if(t>0&&t<=s)for(let t=e;t<i;t++)l.unshift(t);else if(t=e-r,t>0&&t<=s)for(let t=r+1;t<=e;t++)l.push(t);else;}return l}
|
|
2
2
|
/**
|
|
3
3
|
* postprocessing v6.33.0 build Fri Aug 11 2023
|
|
4
4
|
* https://github.com/pmndrs/postprocessing
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "soonspacejs",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.14",
|
|
4
4
|
"homepage": "http://www.xwbuilders.com:8800/",
|
|
5
5
|
"description": "soonspacejs 2.x",
|
|
6
6
|
"module": "./dist/index.esm.js",
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"three": ">=0.155.0"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "31f01639493c1723b0448161a9afdb2d128d8c8a"
|
|
32
32
|
}
|