diff --git a/Sketchbook-master/Sketchbook-master/.gitattributes b/Sketchbook-master/Sketchbook-master/.gitattributes new file mode 100644 index 00000000..642db914 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/.gitattributes @@ -0,0 +1 @@ +*.js linguist-detectable=false diff --git a/Sketchbook-master/Sketchbook-master/.gitignore b/Sketchbook-master/Sketchbook-master/.gitignore new file mode 100644 index 00000000..7f32e4b8 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/.gitignore @@ -0,0 +1,2 @@ +.vscode +node_modules \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/.travis.yml b/Sketchbook-master/Sketchbook-master/.travis.yml new file mode 100644 index 00000000..7b3cd16f --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - node +script: + - npm run build \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/LICENSE b/Sketchbook-master/Sketchbook-master/LICENSE new file mode 100644 index 00000000..c7cd6c2d --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 swift502 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/README.md b/Sketchbook-master/Sketchbook-master/README.md new file mode 100644 index 00000000..9b0954aa --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/README.md @@ -0,0 +1,103 @@ +

+ +
+ Live demo +
+

+ +[![badge](https://img.shields.io/npm/v/sketchbook?style=flat-square)](https://www.npmjs.com/package/sketchbook) +[![badge](https://img.shields.io/travis/swift502/sketchbook?style=flat-square)](https://travis-ci.org/swift502/Sketchbook) +[![badge](https://img.shields.io/discord/730763393325334628?label=discord&style=flat-square)](https://discord.gg/fGuEqCe) + +# Final update (20. Feb 2023) + +As I have no more interest in developing this project, it comes to a conclusion. In order to remain honest about the true state of the project, I am archiving this repository. + +- If you wish to modify Sketchbook feel free to fork it. +- To see if someone is currently maintaining a fork, check out the [Network Graph](https://github.com/swift502/Sketchbook/network). +- The [NPM package](https://www.npmjs.com/package/sketchbook) name is available, and I'll give it away to anyone who asks for it. The package has never worked properly. + +# 📒 Sketchbook + +Simple web based game engine built on [three.js](https://github.com/mrdoob/three.js) and [cannon.js](https://github.com/schteppe/cannon.js) focused on third-person character controls and related gameplay mechanics. + +Mostly a playground for exploring how conventional third person gameplay mechanics found in modern games work and recreating them in a general way. + +## Features + +* World + * Three.js scene + * Cannon.js physics + * Variable timescale + * Frame skipping + * FXAA anti-aliasing +* Characters + * Third-person camera + * Raycast character controller with capsule collisions + * General state system + * Character AI +* Vehicles + * Cars + * Airplanes + * Helicopters + +All planned features can be found in the [GitHub Projects](https://github.com/swift502/Sketchbook/projects). + +## Usage + +You can define your own scenes in Blender, and then read them with Sketchbook. Sketchbook needs to run on a local server such as [http-server](https://www.npmjs.com/package/http-server) or [webpack-dev-server](https://github.com/webpack/webpack-dev-server) to be able to load external assets. + + + +1. Import: + +```html + +``` + +2. Load a glb scene defined in Blender: + +```javascript +const world = new Sketchbook.World('scene.glb'); +``` + + + +## Contributing + +1. Get the LTS version of [Node.js](https://nodejs.org/en/) 16 +2. [Fork this repository](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) +3. Run `npm install` +4. Run `npm run dev` +5. Make changes and test them out at http://localhost:8080 +6. Commit and [make a pull request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork)! + +## Credits + +Big thank you to each of the following github users for contributing to Sketchbook: + +- [aleqsunder](https://github.com/aleqsunder) +- [barhatsor](https://github.com/barhatsor) +- [danshuri](https://github.com/danshuri) diff --git a/Sketchbook-master/Sketchbook-master/build/assets/airplane.glb b/Sketchbook-master/Sketchbook-master/build/assets/airplane.glb new file mode 100644 index 00000000..0a078e49 Binary files /dev/null and b/Sketchbook-master/Sketchbook-master/build/assets/airplane.glb differ diff --git a/Sketchbook-master/Sketchbook-master/build/assets/boxman.glb b/Sketchbook-master/Sketchbook-master/build/assets/boxman.glb new file mode 100644 index 00000000..9d3f418c Binary files /dev/null and b/Sketchbook-master/Sketchbook-master/build/assets/boxman.glb differ diff --git a/Sketchbook-master/Sketchbook-master/build/assets/car.glb b/Sketchbook-master/Sketchbook-master/build/assets/car.glb new file mode 100644 index 00000000..877c2534 Binary files /dev/null and b/Sketchbook-master/Sketchbook-master/build/assets/car.glb differ diff --git a/Sketchbook-master/Sketchbook-master/build/assets/heli.glb b/Sketchbook-master/Sketchbook-master/build/assets/heli.glb new file mode 100644 index 00000000..429b25ba Binary files /dev/null and b/Sketchbook-master/Sketchbook-master/build/assets/heli.glb differ diff --git a/Sketchbook-master/Sketchbook-master/build/assets/world.glb b/Sketchbook-master/Sketchbook-master/build/assets/world.glb new file mode 100644 index 00000000..a457f3cf Binary files /dev/null and b/Sketchbook-master/Sketchbook-master/build/assets/world.glb differ diff --git a/Sketchbook-master/Sketchbook-master/build/sketchbook.min.js b/Sketchbook-master/Sketchbook-master/build/sketchbook.min.js new file mode 100644 index 00000000..e904176e --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/build/sketchbook.min.js @@ -0,0 +1,41 @@ +/*! + * Sketchbook 0.4 (https://github.com/swift502/Sketchbook) + * Built on three.js (https://github.com/mrdoob/three.js) and cannon.js (https://github.com/schteppe/cannon.js) + */ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Sketchbook=e():t.Sketchbook=e()}(window,(function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=31)}([function(t,e,n){"use strict";n.r(e),n.d(e,"ACESFilmicToneMapping",(function(){return ct})),n.d(e,"AddEquation",(function(){return C})),n.d(e,"AddOperation",(function(){return nt})),n.d(e,"AdditiveBlending",(function(){return E})),n.d(e,"AlphaFormat",(function(){return jt})),n.d(e,"AlwaysDepth",(function(){return X})),n.d(e,"AlwaysStencilFunc",(function(){return hn})),n.d(e,"AmbientLight",(function(){return Ku})),n.d(e,"AmbientLightProbe",(function(){return xh})),n.d(e,"AnimationClip",(function(){return iu})),n.d(e,"AnimationLoader",(function(){return hu})),n.d(e,"AnimationMixer",(function(){return Qh})),n.d(e,"AnimationObjectGroup",(function(){return Xh})),n.d(e,"AnimationUtils",(function(){return Gl})),n.d(e,"ArcCurve",(function(){return xu})),n.d(e,"ArrayCamera",(function(){return fs})),n.d(e,"ArrowHelper",(function(){return Dd})),n.d(e,"Audio",(function(){return Lh})),n.d(e,"AudioAnalyser",(function(){return Nh})),n.d(e,"AudioContext",(function(){return fh})),n.d(e,"AudioListener",(function(){return Ph})),n.d(e,"AudioLoader",(function(){return mh})),n.d(e,"AxesHelper",(function(){return kd})),n.d(e,"AxisHelper",(function(){return Gp})),n.d(e,"BackSide",(function(){return g})),n.d(e,"BasicDepthPacking",(function(){return We})),n.d(e,"BasicShadowMap",(function(){return d})),n.d(e,"BinaryTextureLoader",(function(){return Qp})),n.d(e,"Bone",(function(){return qs})),n.d(e,"BooleanKeyframeTrack",(function(){return Kl})),n.d(e,"BoundingBoxHelper",(function(){return Wp})),n.d(e,"Box2",(function(){return rd})),n.d(e,"Box3",(function(){return Mi})),n.d(e,"Box3Helper",(function(){return Od})),n.d(e,"BoxBufferGeometry",(function(){return eo})),n.d(e,"BoxGeometry",(function(){return to})),n.d(e,"BoxHelper",(function(){return Rd})),n.d(e,"BufferAttribute",(function(){return lr})),n.d(e,"BufferGeometry",(function(){return Pr})),n.d(e,"BufferGeometryLoader",(function(){return nh})),n.d(e,"ByteType",(function(){return Rt})),n.d(e,"Cache",(function(){return ou})),n.d(e,"Camera",(function(){return ao})),n.d(e,"CameraHelper",(function(){return Pd})),n.d(e,"CanvasRenderer",(function(){return Jp})),n.d(e,"CanvasTexture",(function(){return yc})),n.d(e,"CatmullRomCurve3",(function(){return Au})),n.d(e,"CineonToneMapping",(function(){return st})),n.d(e,"CircleBufferGeometry",(function(){return Rl})),n.d(e,"CircleGeometry",(function(){return Cl})),n.d(e,"ClampToEdgeWrapping",(function(){return yt})),n.d(e,"Clock",(function(){return Sh})),n.d(e,"ClosedSplineCurve3",(function(){return Up})),n.d(e,"Color",(function(){return tr})),n.d(e,"ColorKeyframeTrack",(function(){return Zl})),n.d(e,"CompressedTexture",(function(){return gc})),n.d(e,"CompressedTextureLoader",(function(){return du})),n.d(e,"ConeBufferGeometry",(function(){return Ll})),n.d(e,"ConeGeometry",(function(){return Pl})),n.d(e,"CubeCamera",(function(){return co})),n.d(e,"CubeGeometry",(function(){return to})),n.d(e,"CubeReflectionMapping",(function(){return ut})),n.d(e,"CubeRefractionMapping",(function(){return ht})),n.d(e,"CubeTexture",(function(){return Fo})),n.d(e,"CubeTextureLoader",(function(){return mu})),n.d(e,"CubeUVReflectionMapping",(function(){return mt})),n.d(e,"CubeUVRefractionMapping",(function(){return vt})),n.d(e,"CubicBezierCurve",(function(){return Lu})),n.d(e,"CubicBezierCurve3",(function(){return Cu})),n.d(e,"CubicInterpolant",(function(){return ql})),n.d(e,"CullFaceBack",(function(){return s})),n.d(e,"CullFaceFront",(function(){return c})),n.d(e,"CullFaceFrontBack",(function(){return l})),n.d(e,"CullFaceNone",(function(){return a})),n.d(e,"Curve",(function(){return gu})),n.d(e,"CurvePath",(function(){return Du})),n.d(e,"CustomBlending",(function(){return L})),n.d(e,"CylinderBufferGeometry",(function(){return Tl})),n.d(e,"CylinderGeometry",(function(){return El})),n.d(e,"Cylindrical",(function(){return nd})),n.d(e,"DataTexture",(function(){return uo})),n.d(e,"DataTexture2DArray",(function(){return Io})),n.d(e,"DataTexture3D",(function(){return No})),n.d(e,"DataTextureLoader",(function(){return pu})),n.d(e,"DecrementStencilOp",(function(){return $e})),n.d(e,"DecrementWrapStencilOp",(function(){return en})),n.d(e,"DefaultLoadingManager",(function(){return su})),n.d(e,"DepthFormat",(function(){return Yt})),n.d(e,"DepthStencilFormat",(function(){return Qt})),n.d(e,"DepthTexture",(function(){return xc})),n.d(e,"DirectionalLight",(function(){return Qu})),n.d(e,"DirectionalLightHelper",(function(){return Ad})),n.d(e,"DirectionalLightShadow",(function(){return Yu})),n.d(e,"DiscreteInterpolant",(function(){return Yl})),n.d(e,"DodecahedronBufferGeometry",(function(){return Oc})),n.d(e,"DodecahedronGeometry",(function(){return Rc})),n.d(e,"DoubleSide",(function(){return y})),n.d(e,"DstAlphaFactor",(function(){return U})),n.d(e,"DstColorFactor",(function(){return H})),n.d(e,"DynamicBufferAttribute",(function(){return Rp})),n.d(e,"DynamicCopyUsage",(function(){return xn})),n.d(e,"DynamicDrawUsage",(function(){return pn})),n.d(e,"DynamicReadUsage",(function(){return vn})),n.d(e,"EdgesGeometry",(function(){return Al})),n.d(e,"EdgesHelper",(function(){return qp})),n.d(e,"EllipseCurve",(function(){return yu})),n.d(e,"EqualDepth",(function(){return K})),n.d(e,"EqualStencilFunc",(function(){return an})),n.d(e,"EquirectangularReflectionMapping",(function(){return dt})),n.d(e,"EquirectangularRefractionMapping",(function(){return pt})),n.d(e,"Euler",(function(){return Yn})),n.d(e,"EventDispatcher",(function(){return bn})),n.d(e,"ExtrudeBufferGeometry",(function(){return hl})),n.d(e,"ExtrudeGeometry",(function(){return ul})),n.d(e,"Face3",(function(){return rr})),n.d(e,"Face4",(function(){return xp})),n.d(e,"FaceColors",(function(){return _})),n.d(e,"FileLoader",(function(){return uu})),n.d(e,"FlatShading",(function(){return x})),n.d(e,"Float32Attribute",(function(){return zp})),n.d(e,"Float32BufferAttribute",(function(){return gr})),n.d(e,"Float64Attribute",(function(){return Vp})),n.d(e,"Float64BufferAttribute",(function(){return yr})),n.d(e,"FloatType",(function(){return Bt})),n.d(e,"Fog",(function(){return xs})),n.d(e,"FogExp2",(function(){return ys})),n.d(e,"Font",(function(){return hh})),n.d(e,"FontLoader",(function(){return ph})),n.d(e,"FrontFaceDirectionCCW",(function(){return h})),n.d(e,"FrontFaceDirectionCW",(function(){return u})),n.d(e,"FrontSide",(function(){return v})),n.d(e,"Frustum",(function(){return fo})),n.d(e,"GammaEncoding",(function(){return ze})),n.d(e,"Geometry",(function(){return $r})),n.d(e,"GeometryUtils",(function(){return Zp})),n.d(e,"GreaterDepth",(function(){return J})),n.d(e,"GreaterEqualDepth",(function(){return Z})),n.d(e,"GreaterEqualStencilFunc",(function(){return un})),n.d(e,"GreaterStencilFunc",(function(){return cn})),n.d(e,"GridHelper",(function(){return wd})),n.d(e,"Group",(function(){return ms})),n.d(e,"HalfFloatType",(function(){return Dt})),n.d(e,"HemisphereLight",(function(){return Uu})),n.d(e,"HemisphereLightHelper",(function(){return xd})),n.d(e,"HemisphereLightProbe",(function(){return yh})),n.d(e,"IcosahedronBufferGeometry",(function(){return Cc})),n.d(e,"IcosahedronGeometry",(function(){return Lc})),n.d(e,"ImageBitmapLoader",(function(){return lh})),n.d(e,"ImageLoader",(function(){return fu})),n.d(e,"ImageUtils",(function(){return Pn})),n.d(e,"ImmediateRenderObject",(function(){return cd})),n.d(e,"IncrementStencilOp",(function(){return Je})),n.d(e,"IncrementWrapStencilOp",(function(){return tn})),n.d(e,"InstancedBufferAttribute",(function(){return eh})),n.d(e,"InstancedBufferGeometry",(function(){return th})),n.d(e,"InstancedInterleavedBuffer",(function(){return Zh})),n.d(e,"InstancedMesh",(function(){return Zs})),n.d(e,"Int16Attribute",(function(){return Np})),n.d(e,"Int16BufferAttribute",(function(){return pr})),n.d(e,"Int32Attribute",(function(){return Dp})),n.d(e,"Int32BufferAttribute",(function(){return mr})),n.d(e,"Int8Attribute",(function(){return Op})),n.d(e,"Int8BufferAttribute",(function(){return ur})),n.d(e,"IntType",(function(){return It})),n.d(e,"InterleavedBuffer",(function(){return ws})),n.d(e,"InterleavedBufferAttribute",(function(){return Ss})),n.d(e,"Interpolant",(function(){return Wl})),n.d(e,"InterpolateDiscrete",(function(){return Pe})),n.d(e,"InterpolateLinear",(function(){return Le})),n.d(e,"InterpolateSmooth",(function(){return Ce})),n.d(e,"InvertStencilOp",(function(){return nn})),n.d(e,"JSONLoader",(function(){return $p})),n.d(e,"KeepStencilOp",(function(){return Ke})),n.d(e,"KeyframeTrack",(function(){return Ql})),n.d(e,"LOD",(function(){return Us})),n.d(e,"LatheBufferGeometry",(function(){return bl})),n.d(e,"LatheGeometry",(function(){return wl})),n.d(e,"Layers",(function(){return Qn})),n.d(e,"LensFlare",(function(){return ef})),n.d(e,"LessDepth",(function(){return Y})),n.d(e,"LessEqualDepth",(function(){return Q})),n.d(e,"LessEqualStencilFunc",(function(){return sn})),n.d(e,"LessStencilFunc",(function(){return on})),n.d(e,"Light",(function(){return Vu})),n.d(e,"LightProbe",(function(){return gh})),n.d(e,"LightShadow",(function(){return ju})),n.d(e,"Line",(function(){return rc})),n.d(e,"Line3",(function(){return sd})),n.d(e,"LineBasicMaterial",(function(){return Js})),n.d(e,"LineCurve",(function(){return Ru})),n.d(e,"LineCurve3",(function(){return Ou})),n.d(e,"LineDashedMaterial",(function(){return jl})),n.d(e,"LineLoop",(function(){return cc})),n.d(e,"LinePieces",(function(){return bp})),n.d(e,"LineSegments",(function(){return sc})),n.d(e,"LineStrip",(function(){return wp})),n.d(e,"LinearEncoding",(function(){return De})),n.d(e,"LinearFilter",(function(){return At})),n.d(e,"LinearInterpolant",(function(){return Xl})),n.d(e,"LinearMipMapLinearFilter",(function(){return Lt})),n.d(e,"LinearMipMapNearestFilter",(function(){return Tt})),n.d(e,"LinearMipmapLinearFilter",(function(){return Pt})),n.d(e,"LinearMipmapNearestFilter",(function(){return Et})),n.d(e,"LinearToneMapping",(function(){return rt})),n.d(e,"Loader",(function(){return cu})),n.d(e,"LoaderUtils",(function(){return $u})),n.d(e,"LoadingManager",(function(){return au})),n.d(e,"LogLuvEncoding",(function(){return Ue})),n.d(e,"LoopOnce",(function(){return Ae})),n.d(e,"LoopPingPong",(function(){return Te})),n.d(e,"LoopRepeat",(function(){return Ee})),n.d(e,"LuminanceAlphaFormat",(function(){return qt})),n.d(e,"LuminanceFormat",(function(){return Wt})),n.d(e,"MOUSE",(function(){return r})),n.d(e,"Material",(function(){return ar})),n.d(e,"MaterialLoader",(function(){return Ju})),n.d(e,"Math",(function(){return An})),n.d(e,"MathUtils",(function(){return An})),n.d(e,"Matrix3",(function(){return Tn})),n.d(e,"Matrix4",(function(){return Wn})),n.d(e,"MaxEquation",(function(){return I})),n.d(e,"Mesh",(function(){return qr})),n.d(e,"MeshBasicMaterial",(function(){return sr})),n.d(e,"MeshDepthMaterial",(function(){return as})),n.d(e,"MeshDistanceMaterial",(function(){return ss})),n.d(e,"MeshFaceMaterial",(function(){return _p})),n.d(e,"MeshLambertMaterial",(function(){return Vl})),n.d(e,"MeshMatcapMaterial",(function(){return Ul})),n.d(e,"MeshNormalMaterial",(function(){return zl})),n.d(e,"MeshPhongMaterial",(function(){return Dl})),n.d(e,"MeshPhysicalMaterial",(function(){return Bl})),n.d(e,"MeshStandardMaterial",(function(){return Nl})),n.d(e,"MeshToonMaterial",(function(){return kl})),n.d(e,"MinEquation",(function(){return F})),n.d(e,"MirroredRepeatWrapping",(function(){return xt})),n.d(e,"MixOperation",(function(){return et})),n.d(e,"MultiMaterial",(function(){return Sp})),n.d(e,"MultiplyBlending",(function(){return P})),n.d(e,"MultiplyOperation",(function(){return tt})),n.d(e,"NearestFilter",(function(){return wt})),n.d(e,"NearestMipMapLinearFilter",(function(){return Mt})),n.d(e,"NearestMipMapNearestFilter",(function(){return _t})),n.d(e,"NearestMipmapLinearFilter",(function(){return St})),n.d(e,"NearestMipmapNearestFilter",(function(){return bt})),n.d(e,"NeverDepth",(function(){return q})),n.d(e,"NeverStencilFunc",(function(){return rn})),n.d(e,"NoBlending",(function(){return M})),n.d(e,"NoColors",(function(){return b})),n.d(e,"NoToneMapping",(function(){return it})),n.d(e,"NormalBlending",(function(){return A})),n.d(e,"NotEqualDepth",(function(){return $})),n.d(e,"NotEqualStencilFunc",(function(){return ln})),n.d(e,"NumberKeyframeTrack",(function(){return Jl})),n.d(e,"Object3D",(function(){return li})),n.d(e,"ObjectLoader",(function(){return rh})),n.d(e,"ObjectSpaceNormalMap",(function(){return Ye})),n.d(e,"OctahedronBufferGeometry",(function(){return Pc})),n.d(e,"OctahedronGeometry",(function(){return Tc})),n.d(e,"OneFactor",(function(){return B})),n.d(e,"OneMinusDstAlphaFactor",(function(){return j})),n.d(e,"OneMinusDstColorFactor",(function(){return G})),n.d(e,"OneMinusSrcAlphaFactor",(function(){return V})),n.d(e,"OneMinusSrcColorFactor",(function(){return k})),n.d(e,"OrthographicCamera",(function(){return Xu})),n.d(e,"PCFShadowMap",(function(){return p})),n.d(e,"PCFSoftShadowMap",(function(){return f})),n.d(e,"PMREMGenerator",(function(){return ap})),n.d(e,"ParametricBufferGeometry",(function(){return _c})),n.d(e,"ParametricGeometry",(function(){return bc})),n.d(e,"Particle",(function(){return Ap})),n.d(e,"ParticleBasicMaterial",(function(){return Pp})),n.d(e,"ParticleSystem",(function(){return Ep})),n.d(e,"ParticleSystemMaterial",(function(){return Lp})),n.d(e,"Path",(function(){return ku})),n.d(e,"PerspectiveCamera",(function(){return so})),n.d(e,"Plane",(function(){return zi})),n.d(e,"PlaneBufferGeometry",(function(){return xo})),n.d(e,"PlaneGeometry",(function(){return yo})),n.d(e,"PlaneHelper",(function(){return Fd})),n.d(e,"PointCloud",(function(){return Mp})),n.d(e,"PointCloudMaterial",(function(){return Tp})),n.d(e,"PointLight",(function(){return qu})),n.d(e,"PointLightHelper",(function(){return md})),n.d(e,"Points",(function(){return fc})),n.d(e,"PointsMaterial",(function(){return lc})),n.d(e,"PolarGridHelper",(function(){return bd})),n.d(e,"PolyhedronBufferGeometry",(function(){return Mc})),n.d(e,"PolyhedronGeometry",(function(){return Sc})),n.d(e,"PositionalAudio",(function(){return Ih})),n.d(e,"PropertyBinding",(function(){return qh})),n.d(e,"PropertyMixer",(function(){return Bh})),n.d(e,"QuadraticBezierCurve",(function(){return Fu})),n.d(e,"QuadraticBezierCurve3",(function(){return Iu})),n.d(e,"Quaternion",(function(){return In})),n.d(e,"QuaternionKeyframeTrack",(function(){return tu})),n.d(e,"QuaternionLinearInterpolant",(function(){return $l})),n.d(e,"REVISION",(function(){return i})),n.d(e,"RGBADepthPacking",(function(){return qe})),n.d(e,"RGBAFormat",(function(){return Gt})),n.d(e,"RGBAIntegerFormat",(function(){return ee})),n.d(e,"RGBA_ASTC_10x10_Format",(function(){return _e})),n.d(e,"RGBA_ASTC_10x5_Format",(function(){return xe})),n.d(e,"RGBA_ASTC_10x6_Format",(function(){return we})),n.d(e,"RGBA_ASTC_10x8_Format",(function(){return be})),n.d(e,"RGBA_ASTC_12x10_Format",(function(){return Se})),n.d(e,"RGBA_ASTC_12x12_Format",(function(){return Me})),n.d(e,"RGBA_ASTC_4x4_Format",(function(){return he})),n.d(e,"RGBA_ASTC_5x4_Format",(function(){return de})),n.d(e,"RGBA_ASTC_5x5_Format",(function(){return pe})),n.d(e,"RGBA_ASTC_6x5_Format",(function(){return fe})),n.d(e,"RGBA_ASTC_6x6_Format",(function(){return me})),n.d(e,"RGBA_ASTC_8x5_Format",(function(){return ve})),n.d(e,"RGBA_ASTC_8x6_Format",(function(){return ge})),n.d(e,"RGBA_ASTC_8x8_Format",(function(){return ye})),n.d(e,"RGBA_PVRTC_2BPPV1_Format",(function(){return le})),n.d(e,"RGBA_PVRTC_4BPPV1_Format",(function(){return ce})),n.d(e,"RGBA_S3TC_DXT1_Format",(function(){return ie})),n.d(e,"RGBA_S3TC_DXT3_Format",(function(){return re})),n.d(e,"RGBA_S3TC_DXT5_Format",(function(){return oe})),n.d(e,"RGBDEncoding",(function(){return Ge})),n.d(e,"RGBEEncoding",(function(){return Ve})),n.d(e,"RGBEFormat",(function(){return Xt})),n.d(e,"RGBFormat",(function(){return Ht})),n.d(e,"RGBIntegerFormat",(function(){return te})),n.d(e,"RGBM16Encoding",(function(){return He})),n.d(e,"RGBM7Encoding",(function(){return je})),n.d(e,"RGB_ETC1_Format",(function(){return ue})),n.d(e,"RGB_PVRTC_2BPPV1_Format",(function(){return se})),n.d(e,"RGB_PVRTC_4BPPV1_Format",(function(){return ae})),n.d(e,"RGB_S3TC_DXT1_Format",(function(){return ne})),n.d(e,"RGFormat",(function(){return Jt})),n.d(e,"RGIntegerFormat",(function(){return $t})),n.d(e,"RawShaderMaterial",(function(){return Il})),n.d(e,"Ray",(function(){return Ni})),n.d(e,"Raycaster",(function(){return Jh})),n.d(e,"RectAreaLight",(function(){return Zu})),n.d(e,"RedFormat",(function(){return Kt})),n.d(e,"RedIntegerFormat",(function(){return Zt})),n.d(e,"ReinhardToneMapping",(function(){return ot})),n.d(e,"RepeatWrapping",(function(){return gt})),n.d(e,"ReplaceStencilOp",(function(){return Ze})),n.d(e,"ReverseSubtractEquation",(function(){return O})),n.d(e,"RingBufferGeometry",(function(){return xl})),n.d(e,"RingGeometry",(function(){return yl})),n.d(e,"Scene",(function(){return ui})),n.d(e,"SceneUtils",(function(){return tf})),n.d(e,"ShaderChunk",(function(){return wo})),n.d(e,"ShaderLib",(function(){return bo})),n.d(e,"ShaderMaterial",(function(){return oo})),n.d(e,"ShadowMaterial",(function(){return Fl})),n.d(e,"Shape",(function(){return zu})),n.d(e,"ShapeBufferGeometry",(function(){return Sl})),n.d(e,"ShapeGeometry",(function(){return _l})),n.d(e,"ShapePath",(function(){return uh})),n.d(e,"ShapeUtils",(function(){return sl})),n.d(e,"ShortType",(function(){return Ot})),n.d(e,"Skeleton",(function(){return Ws})),n.d(e,"SkeletonHelper",(function(){return fd})),n.d(e,"SkinnedMesh",(function(){return js})),n.d(e,"SmoothShading",(function(){return w})),n.d(e,"Sphere",(function(){return Ti})),n.d(e,"SphereBufferGeometry",(function(){return gl})),n.d(e,"SphereGeometry",(function(){return vl})),n.d(e,"Spherical",(function(){return ed})),n.d(e,"SphericalHarmonics3",(function(){return vh})),n.d(e,"SphericalReflectionMapping",(function(){return ft})),n.d(e,"Spline",(function(){return Hp})),n.d(e,"SplineCurve",(function(){return Nu})),n.d(e,"SplineCurve3",(function(){return jp})),n.d(e,"SpotLight",(function(){return Gu})),n.d(e,"SpotLightHelper",(function(){return ud})),n.d(e,"SpotLightShadow",(function(){return Hu})),n.d(e,"Sprite",(function(){return Ds})),n.d(e,"SpriteMaterial",(function(){return Ms})),n.d(e,"SrcAlphaFactor",(function(){return z})),n.d(e,"SrcAlphaSaturateFactor",(function(){return W})),n.d(e,"SrcColorFactor",(function(){return D})),n.d(e,"StaticCopyUsage",(function(){return yn})),n.d(e,"StaticDrawUsage",(function(){return dn})),n.d(e,"StaticReadUsage",(function(){return mn})),n.d(e,"StereoCamera",(function(){return _h})),n.d(e,"StreamCopyUsage",(function(){return wn})),n.d(e,"StreamDrawUsage",(function(){return fn})),n.d(e,"StreamReadUsage",(function(){return gn})),n.d(e,"StringKeyframeTrack",(function(){return eu})),n.d(e,"SubtractEquation",(function(){return R})),n.d(e,"SubtractiveBlending",(function(){return T})),n.d(e,"TOUCH",(function(){return o})),n.d(e,"TangentSpaceNormalMap",(function(){return Xe})),n.d(e,"TetrahedronBufferGeometry",(function(){return Ec})),n.d(e,"TetrahedronGeometry",(function(){return Ac})),n.d(e,"TextBufferGeometry",(function(){return ml})),n.d(e,"TextGeometry",(function(){return fl})),n.d(e,"Texture",(function(){return Cn})),n.d(e,"TextureLoader",(function(){return vu})),n.d(e,"TorusBufferGeometry",(function(){return kc})),n.d(e,"TorusGeometry",(function(){return Dc})),n.d(e,"TorusKnotBufferGeometry",(function(){return Bc})),n.d(e,"TorusKnotGeometry",(function(){return Nc})),n.d(e,"Triangle",(function(){return Ki})),n.d(e,"TriangleFanDrawMode",(function(){return Be})),n.d(e,"TriangleStripDrawMode",(function(){return Ne})),n.d(e,"TrianglesDrawMode",(function(){return Ie})),n.d(e,"TubeBufferGeometry",(function(){return Ic})),n.d(e,"TubeGeometry",(function(){return Fc})),n.d(e,"UVMapping",(function(){return lt})),n.d(e,"Uint16Attribute",(function(){return Bp})),n.d(e,"Uint16BufferAttribute",(function(){return fr})),n.d(e,"Uint32Attribute",(function(){return kp})),n.d(e,"Uint32BufferAttribute",(function(){return vr})),n.d(e,"Uint8Attribute",(function(){return Fp})),n.d(e,"Uint8BufferAttribute",(function(){return hr})),n.d(e,"Uint8ClampedAttribute",(function(){return Ip})),n.d(e,"Uint8ClampedBufferAttribute",(function(){return dr})),n.d(e,"Uncharted2ToneMapping",(function(){return at})),n.d(e,"Uniform",(function(){return Kh})),n.d(e,"UniformsLib",(function(){return mo})),n.d(e,"UniformsUtils",(function(){return ro})),n.d(e,"UnsignedByteType",(function(){return Ct})),n.d(e,"UnsignedInt248Type",(function(){return Ut})),n.d(e,"UnsignedIntType",(function(){return Nt})),n.d(e,"UnsignedShort4444Type",(function(){return kt})),n.d(e,"UnsignedShort5551Type",(function(){return zt})),n.d(e,"UnsignedShort565Type",(function(){return Vt})),n.d(e,"UnsignedShortType",(function(){return Ft})),n.d(e,"VSMShadowMap",(function(){return m})),n.d(e,"Vector2",(function(){return En})),n.d(e,"Vector3",(function(){return Dn})),n.d(e,"Vector4",(function(){return Rn})),n.d(e,"VectorKeyframeTrack",(function(){return nu})),n.d(e,"Vertex",(function(){return Cp})),n.d(e,"VertexColors",(function(){return S})),n.d(e,"VideoTexture",(function(){return vc})),n.d(e,"WebGLCubeRenderTarget",(function(){return lo})),n.d(e,"WebGLMultisampleRenderTarget",(function(){return Fn})),n.d(e,"WebGLRenderTarget",(function(){return On})),n.d(e,"WebGLRenderTargetCube",(function(){return Kp})),n.d(e,"WebGLRenderer",(function(){return gs})),n.d(e,"WebGLUtils",(function(){return hs})),n.d(e,"WireframeGeometry",(function(){return wc})),n.d(e,"WireframeHelper",(function(){return Xp})),n.d(e,"WrapAroundEnding",(function(){return Fe})),n.d(e,"XHRLoader",(function(){return Yp})),n.d(e,"ZeroCurvatureEnding",(function(){return Re})),n.d(e,"ZeroFactor",(function(){return N})),n.d(e,"ZeroSlopeEnding",(function(){return Oe})),n.d(e,"ZeroStencilOp",(function(){return Qe})),n.d(e,"sRGBEncoding",(function(){return ke})),void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),void 0===Math.sign&&(Math.sign=function(t){return t<0?-1:t>0?1:+t}),"name"in Function.prototype==!1&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n>8&255]+_n[t>>16&255]+_n[t>>24&255]+"-"+_n[255&e]+_n[e>>8&255]+"-"+_n[e>>16&15|64]+_n[e>>24&255]+"-"+_n[63&n|128]+_n[n>>8&255]+"-"+_n[n>>16&255]+_n[n>>24&255]+_n[255&i]+_n[i>>8&255]+_n[i>>16&255]+_n[i>>24&255]).toUpperCase()},clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,n,i,r){return i+(t-e)*(r-i)/(n-e)},lerp:function(t,e,n){return(1-n)*t+n*e},smoothstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(t){return t*An.DEG2RAD},radToDeg:function(t){return t*An.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},setQuaternionFromProperEuler:function(t,e,n,i,r){var o=Math.cos,a=Math.sin,s=o(n/2),c=a(n/2),l=o((e+i)/2),u=a((e+i)/2),h=o((e-i)/2),d=a((e-i)/2),p=o((i-e)/2),f=a((i-e)/2);"XYX"===r?t.set(s*u,c*h,c*d,s*l):"YZY"===r?t.set(c*d,s*u,c*h,s*l):"ZXZ"===r?t.set(c*h,c*d,s*u,s*l):"XZX"===r?t.set(s*u,c*f,c*p,s*l):"YXY"===r?t.set(c*p,s*u,c*f,s*l):"ZYZ"===r?t.set(c*f,c*p,s*u,s*l):console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order.")}};function En(t,e){this.x=t||0,this.y=e||0}function Tn(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}Object.defineProperties(En.prototype,{width:{get:function(){return this.x},set:function(t){this.x=t}},height:{get:function(){return this.y},set:function(t){this.y=t}}}),Object.assign(En.prototype,{isVector2:!0,set:function(t,e){return this.x=t,this.y=e,this},setScalar:function(t){return this.x=t,this.y=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(t){return this.x=t.x,this.y=t.y,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(t){return this.x+=t,this.y+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(t){return this.x-=t,this.y-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},divideScalar:function(t){return this.multiplyScalar(1/t)},applyMatrix3:function(t){var e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this},clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,n=this.y-t.y;return e*e+n*n},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this},rotateAround:function(t,e){var n=Math.cos(e),i=Math.sin(e),r=this.x-t.x,o=this.y-t.y;return this.x=r*n-o*i+t.x,this.y=r*i+o*n+t.y,this}}),Object.assign(Tn.prototype,{isMatrix3:!0,set:function(t,e,n,i,r,o,a,s,c){var l=this.elements;return l[0]=t,l[1]=i,l[2]=a,l[3]=e,l[4]=r,l[5]=s,l[6]=n,l[7]=o,l[8]=c,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(t){var e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this},setFromMatrix4:function(t){var e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},multiply:function(t){return this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var n=t.elements,i=e.elements,r=this.elements,o=n[0],a=n[3],s=n[6],c=n[1],l=n[4],u=n[7],h=n[2],d=n[5],p=n[8],f=i[0],m=i[3],v=i[6],g=i[1],y=i[4],x=i[7],w=i[2],b=i[5],_=i[8];return r[0]=o*f+a*g+s*w,r[3]=o*m+a*y+s*b,r[6]=o*v+a*x+s*_,r[1]=c*f+l*g+u*w,r[4]=c*m+l*y+u*b,r[7]=c*v+l*x+u*_,r[2]=h*f+d*g+p*w,r[5]=h*m+d*y+p*b,r[8]=h*v+d*x+p*_,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this},determinant:function(){var t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],o=t[4],a=t[5],s=t[6],c=t[7],l=t[8];return e*o*l-e*a*c-n*r*l+n*a*s+i*r*c-i*o*s},getInverse:function(t,e){t&&t.isMatrix4&&console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");var n=t.elements,i=this.elements,r=n[0],o=n[1],a=n[2],s=n[3],c=n[4],l=n[5],u=n[6],h=n[7],d=n[8],p=d*c-l*h,f=l*u-d*s,m=h*s-c*u,v=r*p+o*f+a*m;if(0===v){var g="THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0";if(!0===e)throw new Error(g);return console.warn(g),this.identity()}var y=1/v;return i[0]=p*y,i[1]=(a*h-d*o)*y,i[2]=(l*o-a*c)*y,i[3]=f*y,i[4]=(d*r-a*u)*y,i[5]=(a*s-l*r)*y,i[6]=m*y,i[7]=(o*u-h*r)*y,i[8]=(c*r-o*s)*y,this},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},getNormalMatrix:function(t){return this.setFromMatrix4(t).getInverse(this).transpose()},transposeIntoArray:function(t){var e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this},setUvTransform:function(t,e,n,i,r,o,a){var s=Math.cos(r),c=Math.sin(r);this.set(n*s,n*c,-n*(s*o+c*a)+o+t,-i*c,i*s,-i*(-c*o+s*a)+a+e,0,0,1)},scale:function(t,e){var n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=e,n[4]*=e,n[7]*=e,this},rotate:function(t){var e=Math.cos(t),n=Math.sin(t),i=this.elements,r=i[0],o=i[3],a=i[6],s=i[1],c=i[4],l=i[7];return i[0]=e*r+n*s,i[3]=e*o+n*c,i[6]=e*a+n*l,i[1]=-n*r+e*s,i[4]=-n*o+e*c,i[7]=-n*a+e*l,this},translate:function(t,e){var n=this.elements;return n[0]+=t*n[2],n[3]+=t*n[5],n[6]+=t*n[8],n[1]+=e*n[2],n[4]+=e*n[5],n[7]+=e*n[8],this},equals:function(t){for(var e=this.elements,n=t.elements,i=0;i<9;i++)if(e[i]!==n[i])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var n=0;n<9;n++)this.elements[n]=t[n+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}});var Pn={getDataURL:function(t){var e;if("undefined"==typeof HTMLCanvasElement)return t.src;if(t instanceof HTMLCanvasElement)e=t;else{void 0===Mn&&(Mn=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Mn.width=t.width,Mn.height=t.height;var n=Mn.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=Mn}return e.width>2048||e.height>2048?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}},Ln=0;function Cn(t,e,n,i,r,o,a,s,c,l){Object.defineProperty(this,"id",{value:Ln++}),this.uuid=An.generateUUID(),this.name="",this.image=void 0!==t?t:Cn.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:Cn.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:yt,this.wrapT=void 0!==i?i:yt,this.magFilter=void 0!==r?r:At,this.minFilter=void 0!==o?o:Pt,this.anisotropy=void 0!==c?c:1,this.format=void 0!==a?a:Gt,this.internalFormat=null,this.type=void 0!==s?s:Ct,this.offset=new En(0,0),this.repeat=new En(1,1),this.center=new En(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Tn,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==l?l:De,this.version=0,this.onUpdate=null}function Rn(t,e,n,i){this.x=t||0,this.y=e||0,this.z=n||0,this.w=void 0!==i?i:1}function On(t,e,n){this.width=t,this.height=e,this.scissor=new Rn(0,0,t,e),this.scissorTest=!1,this.viewport=new Rn(0,0,t,e),n=n||{},this.texture=new Cn(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={},this.texture.image.width=t,this.texture.image.height=e,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:At,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0===n.stencilBuffer||n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}function Fn(t,e,n){On.call(this,t,e,n),this.samples=4}function In(t,e,n,i){this._x=t||0,this._y=e||0,this._z=n||0,this._w=void 0!==i?i:1}Cn.DEFAULT_IMAGE=void 0,Cn.DEFAULT_MAPPING=lt,Cn.prototype=Object.assign(Object.create(bn.prototype),{constructor:Cn,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},toJSON:function(t){var e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];var n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var i=this.image;if(void 0===i.uuid&&(i.uuid=An.generateUUID()),!e&&void 0===t.images[i.uuid]){var r;if(Array.isArray(i)){r=[];for(var o=0,a=i.length;o1)switch(this.wrapS){case gt:t.x=t.x-Math.floor(t.x);break;case yt:t.x=t.x<0?0:1;break;case xt:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case gt:t.y=t.y-Math.floor(t.y);break;case yt:t.y=t.y<0?0:1;break;case xt:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}}),Object.defineProperty(Cn.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.defineProperties(Rn.prototype,{width:{get:function(){return this.z},set:function(t){this.z=t}},height:{get:function(){return this.w},set:function(t){this.w=t}}}),Object.assign(Rn.prototype,{isVector4:!0,set:function(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setW:function(t){return this.w=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},applyMatrix4:function(t){var e=this.x,n=this.y,i=this.z,r=this.w,o=t.elements;return this.x=o[0]*e+o[4]*n+o[8]*i+o[12]*r,this.y=o[1]*e+o[5]*n+o[9]*i+o[13]*r,this.z=o[2]*e+o[6]*n+o[10]*i+o[14]*r,this.w=o[3]*e+o[7]*n+o[11]*i+o[15]*r,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);var e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this},setAxisAngleFromRotationMatrix:function(t){var e,n,i,r,o=t.elements,a=o[0],s=o[4],c=o[8],l=o[1],u=o[5],h=o[9],d=o[2],p=o[6],f=o[10];if(Math.abs(s-l)<.01&&Math.abs(c-d)<.01&&Math.abs(h-p)<.01){if(Math.abs(s+l)<.1&&Math.abs(c+d)<.1&&Math.abs(h+p)<.1&&Math.abs(a+u+f-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;var m=(a+1)/2,v=(u+1)/2,g=(f+1)/2,y=(s+l)/4,x=(c+d)/4,w=(h+p)/4;return m>v&&m>g?m<.01?(n=0,i=.707106781,r=.707106781):(i=y/(n=Math.sqrt(m)),r=x/n):v>g?v<.01?(n=.707106781,i=0,r=.707106781):(n=y/(i=Math.sqrt(v)),r=w/i):g<.01?(n=.707106781,i=.707106781,r=0):(n=x/(r=Math.sqrt(g)),i=w/r),this.set(n,i,r,e),this}var b=Math.sqrt((p-h)*(p-h)+(c-d)*(c-d)+(l-s)*(l-s));return Math.abs(b)<.001&&(b=1),this.x=(p-h)/b,this.y=(c-d)/b,this.z=(l-s)/b,this.w=Math.acos((a+u+f-1)/2),this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this},clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}}),On.prototype=Object.assign(Object.create(bn.prototype),{constructor:On,isWebGLRenderTarget:!0,setSize:function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.texture.image.width=t,this.texture.image.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.width=t.width,this.height=t.height,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Fn.prototype=Object.assign(Object.create(On.prototype),{constructor:Fn,isWebGLMultisampleRenderTarget:!0,copy:function(t){return On.prototype.copy.call(this,t),this.samples=t.samples,this}}),Object.assign(In,{slerp:function(t,e,n,i){return n.copy(t).slerp(e,i)},slerpFlat:function(t,e,n,i,r,o,a){var s=n[i+0],c=n[i+1],l=n[i+2],u=n[i+3],h=r[o+0],d=r[o+1],p=r[o+2],f=r[o+3];if(u!==f||s!==h||c!==d||l!==p){var m=1-a,v=s*h+c*d+l*p+u*f,g=v>=0?1:-1,y=1-v*v;if(y>Number.EPSILON){var x=Math.sqrt(y),w=Math.atan2(x,v*g);m=Math.sin(m*w)/x,a=Math.sin(a*w)/x}var b=a*g;if(s=s*m+h*b,c=c*m+d*b,l=l*m+p*b,u=u*m+f*b,m===1-a){var _=1/Math.sqrt(s*s+c*c+l*l+u*u);s*=_,c*=_,l*=_,u*=_}}t[e]=s,t[e+1]=c,t[e+2]=l,t[e+3]=u}}),Object.defineProperties(In.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},w:{get:function(){return this._w},set:function(t){this._w=t,this._onChangeCallback()}}}),Object.assign(In.prototype,{isQuaternion:!0,set:function(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this},setFromEuler:function(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=t._x,i=t._y,r=t._z,o=t.order,a=Math.cos,s=Math.sin,c=a(n/2),l=a(i/2),u=a(r/2),h=s(n/2),d=s(i/2),p=s(r/2);return"XYZ"===o?(this._x=h*l*u+c*d*p,this._y=c*d*u-h*l*p,this._z=c*l*p+h*d*u,this._w=c*l*u-h*d*p):"YXZ"===o?(this._x=h*l*u+c*d*p,this._y=c*d*u-h*l*p,this._z=c*l*p-h*d*u,this._w=c*l*u+h*d*p):"ZXY"===o?(this._x=h*l*u-c*d*p,this._y=c*d*u+h*l*p,this._z=c*l*p+h*d*u,this._w=c*l*u-h*d*p):"ZYX"===o?(this._x=h*l*u-c*d*p,this._y=c*d*u+h*l*p,this._z=c*l*p-h*d*u,this._w=c*l*u+h*d*p):"YZX"===o?(this._x=h*l*u+c*d*p,this._y=c*d*u+h*l*p,this._z=c*l*p-h*d*u,this._w=c*l*u-h*d*p):"XZY"===o&&(this._x=h*l*u-c*d*p,this._y=c*d*u-h*l*p,this._z=c*l*p+h*d*u,this._w=c*l*u+h*d*p),!1!==e&&this._onChangeCallback(),this},setFromAxisAngle:function(t,e){var n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this},setFromRotationMatrix:function(t){var e,n=t.elements,i=n[0],r=n[4],o=n[8],a=n[1],s=n[5],c=n[9],l=n[2],u=n[6],h=n[10],d=i+s+h;return d>0?(e=.5/Math.sqrt(d+1),this._w=.25/e,this._x=(u-c)*e,this._y=(o-l)*e,this._z=(a-r)*e):i>s&&i>h?(e=2*Math.sqrt(1+i-s-h),this._w=(u-c)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(o+l)/e):s>h?(e=2*Math.sqrt(1+s-i-h),this._w=(o-l)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(c+u)/e):(e=2*Math.sqrt(1+h-i-s),this._w=(a-r)/e,this._x=(o+l)/e,this._y=(c+u)/e,this._z=.25*e),this._onChangeCallback(),this},setFromUnitVectors:function(t,e){var n=t.dot(e)+1;return n<1e-6?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()},angleTo:function(t){return 2*Math.acos(Math.abs(An.clamp(this.dot(t),-1,1)))},rotateTowards:function(t,e){var n=this.angleTo(t);if(0===n)return this;var i=Math.min(1,e/n);return this.slerp(t,i),this},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},dot:function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)},premultiply:function(t){return this.multiplyQuaternions(t,this)},multiplyQuaternions:function(t,e){var n=t._x,i=t._y,r=t._z,o=t._w,a=e._x,s=e._y,c=e._z,l=e._w;return this._x=n*l+o*a+i*c-r*s,this._y=i*l+o*s+r*a-n*c,this._z=r*l+o*c+n*s-i*a,this._w=o*l-n*a-i*s-r*c,this._onChangeCallback(),this},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var n=this._x,i=this._y,r=this._z,o=this._w,a=o*t._w+n*t._x+i*t._y+r*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=o,this._x=n,this._y=i,this._z=r,this;var s=1-a*a;if(s<=Number.EPSILON){var c=1-e;return this._w=c*o+e*this._w,this._x=c*n+e*this._x,this._y=c*i+e*this._y,this._z=c*r+e*this._z,this.normalize(),this._onChangeCallback(),this}var l=Math.sqrt(s),u=Math.atan2(l,a),h=Math.sin((1-e)*u)/l,d=Math.sin(e*u)/l;return this._w=o*h+this._w*d,this._x=n*h+this._x*d,this._y=i*h+this._y*d,this._z=r*h+this._z*d,this._onChangeCallback(),this},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},fromArray:function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},_onChange:function(t){return this._onChangeCallback=t,this},_onChangeCallback:function(){}});var Nn=new Dn,Bn=new In;function Dn(t,e,n){this.x=t||0,this.y=e||0,this.z=n||0}Object.assign(Dn.prototype,{isVector3:!0,set:function(t,e,n){return this.x=t,this.y=e,this.z=n,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this},multiplyVectors:function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},applyEuler:function(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(Bn.setFromEuler(t))},applyAxisAngle:function(t,e){return this.applyQuaternion(Bn.setFromAxisAngle(t,e))},applyMatrix3:function(t){var e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6]*i,this.y=r[1]*e+r[4]*n+r[7]*i,this.z=r[2]*e+r[5]*n+r[8]*i,this},applyNormalMatrix:function(t){return this.applyMatrix3(t).normalize()},applyMatrix4:function(t){var e=this.x,n=this.y,i=this.z,r=t.elements,o=1/(r[3]*e+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*i+r[12])*o,this.y=(r[1]*e+r[5]*n+r[9]*i+r[13])*o,this.z=(r[2]*e+r[6]*n+r[10]*i+r[14])*o,this},applyQuaternion:function(t){var e=this.x,n=this.y,i=this.z,r=t.x,o=t.y,a=t.z,s=t.w,c=s*e+o*i-a*n,l=s*n+a*e-r*i,u=s*i+r*n-o*e,h=-r*e-o*n-a*i;return this.x=c*s+h*-r+l*-a-u*-o,this.y=l*s+h*-o+u*-r-c*-a,this.z=u*s+h*-a+c*-o-l*-r,this},project:function(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)},unproject:function(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)},transformDirection:function(t){var e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[4]*n+r[8]*i,this.y=r[1]*e+r[5]*n+r[9]*i,this.z=r[2]*e+r[6]*n+r[10]*i,this.normalize()},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this},clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},cross:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)},crossVectors:function(t,e){var n=t.x,i=t.y,r=t.z,o=e.x,a=e.y,s=e.z;return this.x=i*s-r*a,this.y=r*o-n*s,this.z=n*a-i*o,this},projectOnVector:function(t){var e=t.lengthSq();if(0===e)return this.set(0,0,0);var n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)},projectOnPlane:function(t){return Nn.copy(this).projectOnVector(t),this.sub(Nn)},reflect:function(t){return this.sub(Nn.copy(t).multiplyScalar(2*this.dot(t)))},angleTo:function(t){var e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;var n=this.dot(t)/e;return Math.acos(An.clamp(n,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)},setFromSpherical:function(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)},setFromSphericalCoords:function(t,e,n){var i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*Math.cos(n),this},setFromCylindrical:function(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)},setFromCylindricalCoords:function(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this},setFromMatrixPosition:function(t){var e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this},setFromMatrixScale:function(t){var e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this},setFromMatrixColumn:function(t,e){return this.fromArray(t.elements,4*e)},setFromMatrix3Column:function(t,e){return this.fromArray(t.elements,3*e)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}});var kn=new Dn,zn=new Wn,Vn=new Dn(0,0,0),Un=new Dn(1,1,1),jn=new Dn,Hn=new Dn,Gn=new Dn;function Wn(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}Object.assign(Wn.prototype,{isMatrix4:!0,set:function(t,e,n,i,r,o,a,s,c,l,u,h,d,p,f,m){var v=this.elements;return v[0]=t,v[4]=e,v[8]=n,v[12]=i,v[1]=r,v[5]=o,v[9]=a,v[13]=s,v[2]=c,v[6]=l,v[10]=u,v[14]=h,v[3]=d,v[7]=p,v[11]=f,v[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new Wn).fromArray(this.elements)},copy:function(t){var e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this},copyPosition:function(t){var e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this},extractBasis:function(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis:function(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this},extractRotation:function(t){var e=this.elements,n=t.elements,i=1/kn.setFromMatrixColumn(t,0).length(),r=1/kn.setFromMatrixColumn(t,1).length(),o=1/kn.setFromMatrixColumn(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*r,e[5]=n[5]*r,e[6]=n[6]*r,e[7]=0,e[8]=n[8]*o,e[9]=n[9]*o,e[10]=n[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromEuler:function(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var e=this.elements,n=t.x,i=t.y,r=t.z,o=Math.cos(n),a=Math.sin(n),s=Math.cos(i),c=Math.sin(i),l=Math.cos(r),u=Math.sin(r);if("XYZ"===t.order){var h=o*l,d=o*u,p=a*l,f=a*u;e[0]=s*l,e[4]=-s*u,e[8]=c,e[1]=d+p*c,e[5]=h-f*c,e[9]=-a*s,e[2]=f-h*c,e[6]=p+d*c,e[10]=o*s}else if("YXZ"===t.order){var m=s*l,v=s*u,g=c*l,y=c*u;e[0]=m+y*a,e[4]=g*a-v,e[8]=o*c,e[1]=o*u,e[5]=o*l,e[9]=-a,e[2]=v*a-g,e[6]=y+m*a,e[10]=o*s}else if("ZXY"===t.order){m=s*l,v=s*u,g=c*l,y=c*u;e[0]=m-y*a,e[4]=-o*u,e[8]=g+v*a,e[1]=v+g*a,e[5]=o*l,e[9]=y-m*a,e[2]=-o*c,e[6]=a,e[10]=o*s}else if("ZYX"===t.order){h=o*l,d=o*u,p=a*l,f=a*u;e[0]=s*l,e[4]=p*c-d,e[8]=h*c+f,e[1]=s*u,e[5]=f*c+h,e[9]=d*c-p,e[2]=-c,e[6]=a*s,e[10]=o*s}else if("YZX"===t.order){var x=o*s,w=o*c,b=a*s,_=a*c;e[0]=s*l,e[4]=_-x*u,e[8]=b*u+w,e[1]=u,e[5]=o*l,e[9]=-a*l,e[2]=-c*l,e[6]=w*u+b,e[10]=x-_*u}else if("XZY"===t.order){x=o*s,w=o*c,b=a*s,_=a*c;e[0]=s*l,e[4]=-u,e[8]=c*l,e[1]=x*u+_,e[5]=o*l,e[9]=w*u-b,e[2]=b*u-w,e[6]=a*l,e[10]=_*u+x}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromQuaternion:function(t){return this.compose(Vn,t,Un)},lookAt:function(t,e,n){var i=this.elements;return Gn.subVectors(t,e),0===Gn.lengthSq()&&(Gn.z=1),Gn.normalize(),jn.crossVectors(n,Gn),0===jn.lengthSq()&&(1===Math.abs(n.z)?Gn.x+=1e-4:Gn.z+=1e-4,Gn.normalize(),jn.crossVectors(n,Gn)),jn.normalize(),Hn.crossVectors(Gn,jn),i[0]=jn.x,i[4]=Hn.x,i[8]=Gn.x,i[1]=jn.y,i[5]=Hn.y,i[9]=Gn.y,i[2]=jn.z,i[6]=Hn.z,i[10]=Gn.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var n=t.elements,i=e.elements,r=this.elements,o=n[0],a=n[4],s=n[8],c=n[12],l=n[1],u=n[5],h=n[9],d=n[13],p=n[2],f=n[6],m=n[10],v=n[14],g=n[3],y=n[7],x=n[11],w=n[15],b=i[0],_=i[4],S=i[8],M=i[12],A=i[1],E=i[5],T=i[9],P=i[13],L=i[2],C=i[6],R=i[10],O=i[14],F=i[3],I=i[7],N=i[11],B=i[15];return r[0]=o*b+a*A+s*L+c*F,r[4]=o*_+a*E+s*C+c*I,r[8]=o*S+a*T+s*R+c*N,r[12]=o*M+a*P+s*O+c*B,r[1]=l*b+u*A+h*L+d*F,r[5]=l*_+u*E+h*C+d*I,r[9]=l*S+u*T+h*R+d*N,r[13]=l*M+u*P+h*O+d*B,r[2]=p*b+f*A+m*L+v*F,r[6]=p*_+f*E+m*C+v*I,r[10]=p*S+f*T+m*R+v*N,r[14]=p*M+f*P+m*O+v*B,r[3]=g*b+y*A+x*L+w*F,r[7]=g*_+y*E+x*C+w*I,r[11]=g*S+y*T+x*R+w*N,r[15]=g*M+y*P+x*O+w*B,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},determinant:function(){var t=this.elements,e=t[0],n=t[4],i=t[8],r=t[12],o=t[1],a=t[5],s=t[9],c=t[13],l=t[2],u=t[6],h=t[10],d=t[14];return t[3]*(+r*s*u-i*c*u-r*a*h+n*c*h+i*a*d-n*s*d)+t[7]*(+e*s*d-e*c*h+r*o*h-i*o*d+i*c*l-r*s*l)+t[11]*(+e*c*u-e*a*d-r*o*u+n*o*d+r*a*l-n*c*l)+t[15]*(-i*a*l-e*s*u+e*a*h+i*o*u-n*o*h+n*s*l)},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},setPosition:function(t,e,n){var i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=n),this},getInverse:function(t,e){var n=this.elements,i=t.elements,r=i[0],o=i[1],a=i[2],s=i[3],c=i[4],l=i[5],u=i[6],h=i[7],d=i[8],p=i[9],f=i[10],m=i[11],v=i[12],g=i[13],y=i[14],x=i[15],w=p*y*h-g*f*h+g*u*m-l*y*m-p*u*x+l*f*x,b=v*f*h-d*y*h-v*u*m+c*y*m+d*u*x-c*f*x,_=d*g*h-v*p*h+v*l*m-c*g*m-d*l*x+c*p*x,S=v*p*u-d*g*u-v*l*f+c*g*f+d*l*y-c*p*y,M=r*w+o*b+a*_+s*S;if(0===M){var A="THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";if(!0===e)throw new Error(A);return console.warn(A),this.identity()}var E=1/M;return n[0]=w*E,n[1]=(g*f*s-p*y*s-g*a*m+o*y*m+p*a*x-o*f*x)*E,n[2]=(l*y*s-g*u*s+g*a*h-o*y*h-l*a*x+o*u*x)*E,n[3]=(p*u*s-l*f*s-p*a*h+o*f*h+l*a*m-o*u*m)*E,n[4]=b*E,n[5]=(d*y*s-v*f*s+v*a*m-r*y*m-d*a*x+r*f*x)*E,n[6]=(v*u*s-c*y*s-v*a*h+r*y*h+c*a*x-r*u*x)*E,n[7]=(c*f*s-d*u*s+d*a*h-r*f*h-c*a*m+r*u*m)*E,n[8]=_*E,n[9]=(v*p*s-d*g*s-v*o*m+r*g*m+d*o*x-r*p*x)*E,n[10]=(c*g*s-v*l*s+v*o*h-r*g*h-c*o*x+r*l*x)*E,n[11]=(d*l*s-c*p*s-d*o*h+r*p*h+c*o*m-r*l*m)*E,n[12]=S*E,n[13]=(d*g*a-v*p*a+v*o*f-r*g*f-d*o*y+r*p*y)*E,n[14]=(v*l*a-c*g*a-v*o*u+r*g*u+c*o*y-r*l*y)*E,n[15]=(c*p*a-d*l*a+d*o*u-r*p*u-c*o*f+r*l*f)*E,this},scale:function(t){var e=this.elements,n=t.x,i=t.y,r=t.z;return e[0]*=n,e[4]*=i,e[8]*=r,e[1]*=n,e[5]*=i,e[9]*=r,e[2]*=n,e[6]*=i,e[10]*=r,e[3]*=n,e[7]*=i,e[11]*=r,this},getMaxScaleOnAxis:function(){var t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))},makeTranslation:function(t,e,n){return this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this},makeRotationX:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this},makeRotationY:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this},makeRotationZ:function(t){var e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(t,e){var n=Math.cos(e),i=Math.sin(e),r=1-n,o=t.x,a=t.y,s=t.z,c=r*o,l=r*a;return this.set(c*o+n,c*a-i*s,c*s+i*a,0,c*a+i*s,l*a+n,l*s-i*o,0,c*s-i*a,l*s+i*o,r*s*s+n,0,0,0,0,1),this},makeScale:function(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this},makeShear:function(t,e,n){return this.set(1,e,n,0,t,1,n,0,t,e,1,0,0,0,0,1),this},compose:function(t,e,n){var i=this.elements,r=e._x,o=e._y,a=e._z,s=e._w,c=r+r,l=o+o,u=a+a,h=r*c,d=r*l,p=r*u,f=o*l,m=o*u,v=a*u,g=s*c,y=s*l,x=s*u,w=n.x,b=n.y,_=n.z;return i[0]=(1-(f+v))*w,i[1]=(d+x)*w,i[2]=(p-y)*w,i[3]=0,i[4]=(d-x)*b,i[5]=(1-(h+v))*b,i[6]=(m+g)*b,i[7]=0,i[8]=(p+y)*_,i[9]=(m-g)*_,i[10]=(1-(h+f))*_,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this},decompose:function(t,e,n){var i=this.elements,r=kn.set(i[0],i[1],i[2]).length(),o=kn.set(i[4],i[5],i[6]).length(),a=kn.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),t.x=i[12],t.y=i[13],t.z=i[14],zn.copy(this);var s=1/r,c=1/o,l=1/a;return zn.elements[0]*=s,zn.elements[1]*=s,zn.elements[2]*=s,zn.elements[4]*=c,zn.elements[5]*=c,zn.elements[6]*=c,zn.elements[8]*=l,zn.elements[9]*=l,zn.elements[10]*=l,e.setFromRotationMatrix(zn),n.x=r,n.y=o,n.z=a,this},makePerspective:function(t,e,n,i,r,o){void 0===o&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var a=this.elements,s=2*r/(e-t),c=2*r/(n-i),l=(e+t)/(e-t),u=(n+i)/(n-i),h=-(o+r)/(o-r),d=-2*o*r/(o-r);return a[0]=s,a[4]=0,a[8]=l,a[12]=0,a[1]=0,a[5]=c,a[9]=u,a[13]=0,a[2]=0,a[6]=0,a[10]=h,a[14]=d,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this},makeOrthographic:function(t,e,n,i,r,o){var a=this.elements,s=1/(e-t),c=1/(n-i),l=1/(o-r),u=(e+t)*s,h=(n+i)*c,d=(o+r)*l;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-u,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-h,a[2]=0,a[6]=0,a[10]=-2*l,a[14]=-d,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this},equals:function(t){for(var e=this.elements,n=t.elements,i=0;i<16;i++)if(e[i]!==n[i])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var n=0;n<16;n++)this.elements[n]=t[n+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}});var qn=new Wn,Xn=new In;function Yn(t,e,n,i){this._x=t||0,this._y=e||0,this._z=n||0,this._order=i||Yn.DefaultOrder}function Qn(){this.mask=1}Yn.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],Yn.DefaultOrder="XYZ",Object.defineProperties(Yn.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},order:{get:function(){return this._order},set:function(t){this._order=t,this._onChangeCallback()}}}),Object.assign(Yn.prototype,{isEuler:!0,set:function(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._order=i||this._order,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this},setFromRotationMatrix:function(t,e,n){var i=An.clamp,r=t.elements,o=r[0],a=r[4],s=r[8],c=r[1],l=r[5],u=r[9],h=r[2],d=r[6],p=r[10];return"XYZ"===(e=e||this._order)?(this._y=Math.asin(i(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-u,p),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(d,l),this._z=0)):"YXZ"===e?(this._x=Math.asin(-i(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(s,p),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-h,o),this._z=0)):"ZXY"===e?(this._x=Math.asin(i(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,p),this._z=Math.atan2(-a,l)):(this._y=0,this._z=Math.atan2(c,o))):"ZYX"===e?(this._y=Math.asin(-i(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,p),this._z=Math.atan2(c,o)):(this._x=0,this._z=Math.atan2(-a,l))):"YZX"===e?(this._z=Math.asin(i(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-u,l),this._y=Math.atan2(-h,o)):(this._x=0,this._y=Math.atan2(s,p))):"XZY"===e?(this._z=Math.asin(-i(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,l),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-u,p),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+e),this._order=e,!1!==n&&this._onChangeCallback(),this},setFromQuaternion:function(t,e,n){return qn.makeRotationFromQuaternion(t),this.setFromRotationMatrix(qn,e,n)},setFromVector3:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},reorder:function(t){return Xn.setFromEuler(this),this.setFromQuaternion(Xn,t)},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order},fromArray:function(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t},toVector3:function(t){return t?t.set(this._x,this._y,this._z):new Dn(this._x,this._y,this._z)},_onChange:function(t){return this._onChangeCallback=t,this},_onChangeCallback:function(){}}),Object.assign(Qn.prototype,{set:function(t){this.mask=1<1){for(var e=0;e1){for(var e=0;e0){i.children=[];for(s=0;s0&&(n.geometries=h),d.length>0&&(n.materials=d),p.length>0&&(n.textures=p),f.length>0&&(n.images=f),a.length>0&&(n.shapes=a)}return n.object=i,n;function m(t){var e=[];for(var n in t){var i=t[n];delete i.metadata,e.push(i)}return e}},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,e){if(void 0===e&&(e=!0),this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(var n=0;ns)return!1}return!0}Object.assign(Mi.prototype,{isBox3:!0,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromArray:function(t){for(var e=1/0,n=1/0,i=1/0,r=-1/0,o=-1/0,a=-1/0,s=0,c=t.length;sr&&(r=l),u>o&&(o=u),h>a&&(a=h)}return this.min.set(e,n,i),this.max.set(r,o,a),this},setFromBufferAttribute:function(t){for(var e=1/0,n=1/0,i=1/0,r=-1/0,o=-1/0,a=-1/0,s=0,c=t.count;sr&&(r=l),u>o&&(o=u),h>a&&(a=h)}return this.min.set(e,n,i),this.max.set(r,o,a),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,n=t.length;ethis.max.x||t.ythis.max.y||t.zthis.max.z)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},getParameter:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .getParameter() target is now required"),e=new Dn),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(t){return!(t.max.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)},intersectsSphere:function(t){return this.clampPoint(t.center,di),di.distanceToSquared(t.center)<=t.radius*t.radius},intersectsPlane:function(t){var e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant},intersectsTriangle:function(t){if(this.isEmpty())return!1;this.getCenter(wi),bi.subVectors(this.max,wi),fi.subVectors(t.a,wi),mi.subVectors(t.b,wi),vi.subVectors(t.c,wi),gi.subVectors(mi,fi),yi.subVectors(vi,mi),xi.subVectors(fi,vi);var e=[0,-gi.z,gi.y,0,-yi.z,yi.y,0,-xi.z,xi.y,gi.z,0,-gi.x,yi.z,0,-yi.x,xi.z,0,-xi.x,-gi.y,gi.x,0,-yi.y,yi.x,0,-xi.y,xi.x,0];return!!Ai(e,fi,mi,vi,bi)&&(!!Ai(e=[1,0,0,0,1,0,0,0,1],fi,mi,vi,bi)&&(_i.crossVectors(gi,yi),Ai(e=[_i.x,_i.y,_i.z],fi,mi,vi,bi)))},clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .clampPoint() target is now required"),e=new Dn),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){return di.copy(t).clamp(this.min,this.max).sub(t).length()},getBoundingSphere:function(t){return void 0===t&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(t.center),t.radius=.5*this.getSize(di).length(),t},intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:function(t){return this.isEmpty()||(hi[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),hi[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),hi[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),hi[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),hi[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),hi[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),hi[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),hi[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(hi)),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}});var Ei=new Mi;function Ti(t,e){this.center=void 0!==t?t:new Dn,this.radius=void 0!==e?e:0}Object.assign(Ti.prototype,{set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:function(t,e){var n=this.center;void 0!==e?n.copy(e):Ei.setFromPoints(t).getCenter(n);for(var i=0,r=0,o=t.length;rthis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e},getBoundingBox:function(t){return void 0===t&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),t=new Mi),t.set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},translate:function(t){return this.center.add(t),this},equals:function(t){return t.center.equals(this.center)&&t.radius===this.radius}});var Pi=new Dn,Li=new Dn,Ci=new Dn,Ri=new Dn,Oi=new Dn,Fi=new Dn,Ii=new Dn;function Ni(t,e){this.origin=void 0!==t?t:new Dn,this.direction=void 0!==e?e:new Dn(0,0,-1)}Object.assign(Ni.prototype,{set:function(t,e){return this.origin.copy(t),this.direction.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this},at:function(t,e){return void 0===e&&(console.warn("THREE.Ray: .at() target is now required"),e=new Dn),e.copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},recast:function(t){return this.origin.copy(this.at(t,Pi)),this},closestPointToPoint:function(t,e){void 0===e&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),e=new Dn),e.subVectors(t,this.origin);var n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(n).add(this.origin)},distanceToPoint:function(t){return Math.sqrt(this.distanceSqToPoint(t))},distanceSqToPoint:function(t){var e=Pi.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Pi.copy(this.direction).multiplyScalar(e).add(this.origin),Pi.distanceToSquared(t))},distanceSqToSegment:function(t,e,n,i){Li.copy(t).add(e).multiplyScalar(.5),Ci.copy(e).sub(t).normalize(),Ri.copy(this.origin).sub(Li);var r,o,a,s,c=.5*t.distanceTo(e),l=-this.direction.dot(Ci),u=Ri.dot(this.direction),h=-Ri.dot(Ci),d=Ri.lengthSq(),p=Math.abs(1-l*l);if(p>0)if(o=l*u-h,s=c*p,(r=l*h-u)>=0)if(o>=-s)if(o<=s){var f=1/p;a=(r*=f)*(r+l*(o*=f)+2*u)+o*(l*r+o+2*h)+d}else o=c,a=-(r=Math.max(0,-(l*o+u)))*r+o*(o+2*h)+d;else o=-c,a=-(r=Math.max(0,-(l*o+u)))*r+o*(o+2*h)+d;else o<=-s?a=-(r=Math.max(0,-(-l*c+u)))*r+(o=r>0?-c:Math.min(Math.max(-c,-h),c))*(o+2*h)+d:o<=s?(r=0,a=(o=Math.min(Math.max(-c,-h),c))*(o+2*h)+d):a=-(r=Math.max(0,-(l*c+u)))*r+(o=r>0?c:Math.min(Math.max(-c,-h),c))*(o+2*h)+d;else o=l>0?-c:c,a=-(r=Math.max(0,-(l*o+u)))*r+o*(o+2*h)+d;return n&&n.copy(this.direction).multiplyScalar(r).add(this.origin),i&&i.copy(Ci).multiplyScalar(o).add(Li),a},intersectSphere:function(t,e){Pi.subVectors(t.center,this.origin);var n=Pi.dot(this.direction),i=Pi.dot(Pi)-n*n,r=t.radius*t.radius;if(i>r)return null;var o=Math.sqrt(r-i),a=n-o,s=n+o;return a<0&&s<0?null:a<0?this.at(s,e):this.at(a,e)},intersectsSphere:function(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius},distanceToPlane:function(t){var e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null},intersectPlane:function(t,e){var n=this.distanceToPlane(t);return null===n?null:this.at(n,e)},intersectsPlane:function(t){var e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0},intersectBox:function(t,e){var n,i,r,o,a,s,c=1/this.direction.x,l=1/this.direction.y,u=1/this.direction.z,h=this.origin;return c>=0?(n=(t.min.x-h.x)*c,i=(t.max.x-h.x)*c):(n=(t.max.x-h.x)*c,i=(t.min.x-h.x)*c),l>=0?(r=(t.min.y-h.y)*l,o=(t.max.y-h.y)*l):(r=(t.max.y-h.y)*l,o=(t.min.y-h.y)*l),n>o||r>i?null:((r>n||n!=n)&&(n=r),(o=0?(a=(t.min.z-h.z)*u,s=(t.max.z-h.z)*u):(a=(t.max.z-h.z)*u,s=(t.min.z-h.z)*u),n>s||a>i?null:((a>n||n!=n)&&(n=a),(s=0?n:i,e)))},intersectsBox:function(t){return null!==this.intersectBox(t,Pi)},intersectTriangle:function(t,e,n,i,r){Oi.subVectors(e,t),Fi.subVectors(n,t),Ii.crossVectors(Oi,Fi);var o,a=this.direction.dot(Ii);if(a>0){if(i)return null;o=1}else{if(!(a<0))return null;o=-1,a=-a}Ri.subVectors(this.origin,t);var s=o*this.direction.dot(Fi.crossVectors(Ri,Fi));if(s<0)return null;var c=o*this.direction.dot(Oi.cross(Ri));if(c<0)return null;if(s+c>a)return null;var l=-o*Ri.dot(Ii);return l<0?null:this.at(l/a,r)},applyMatrix4:function(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this},equals:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}});var Bi=new Dn,Di=new Dn,ki=new Tn;function zi(t,e){this.normal=void 0!==t?t:new Dn(1,0,0),this.constant=void 0!==e?e:0}Object.assign(zi.prototype,{isPlane:!0,set:function(t,e){return this.normal.copy(t),this.constant=e,this},setComponents:function(t,e,n,i){return this.normal.set(t,e,n),this.constant=i,this},setFromNormalAndCoplanarPoint:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this},setFromCoplanarPoints:function(t,e,n){var i=Bi.subVectors(n,e).cross(Di.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(i,t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this},normalize:function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(t){return this.normal.dot(t)+this.constant},distanceToSphere:function(t){return this.distanceToPoint(t.center)-t.radius},projectPoint:function(t,e){return void 0===e&&(console.warn("THREE.Plane: .projectPoint() target is now required"),e=new Dn),e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)},intersectLine:function(t,e){void 0===e&&(console.warn("THREE.Plane: .intersectLine() target is now required"),e=new Dn);var n=t.delta(Bi),i=this.normal.dot(n);if(0===i)return 0===this.distanceToPoint(t.start)?e.copy(t.start):void 0;var r=-(t.start.dot(this.normal)+this.constant)/i;return r<0||r>1?void 0:e.copy(n).multiplyScalar(r).add(t.start)},intersectsLine:function(t){var e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){return void 0===t&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),t=new Dn),t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(t,e){var n=e||ki.getNormalMatrix(t),i=this.coplanarPoint(Bi).applyMatrix4(t),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this},translate:function(t){return this.constant-=t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}});var Vi=new Dn,Ui=new Dn,ji=new Dn,Hi=new Dn,Gi=new Dn,Wi=new Dn,qi=new Dn,Xi=new Dn,Yi=new Dn,Qi=new Dn;function Ki(t,e,n){this.a=void 0!==t?t:new Dn,this.b=void 0!==e?e:new Dn,this.c=void 0!==n?n:new Dn}Object.assign(Ki,{getNormal:function(t,e,n,i){void 0===i&&(console.warn("THREE.Triangle: .getNormal() target is now required"),i=new Dn),i.subVectors(n,e),Vi.subVectors(t,e),i.cross(Vi);var r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)},getBarycoord:function(t,e,n,i,r){Vi.subVectors(i,e),Ui.subVectors(n,e),ji.subVectors(t,e);var o=Vi.dot(Vi),a=Vi.dot(Ui),s=Vi.dot(ji),c=Ui.dot(Ui),l=Ui.dot(ji),u=o*c-a*a;if(void 0===r&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),r=new Dn),0===u)return r.set(-2,-1,-1);var h=1/u,d=(c*s-a*l)*h,p=(o*l-a*s)*h;return r.set(1-d-p,p,d)},containsPoint:function(t,e,n,i){return Ki.getBarycoord(t,e,n,i,Hi),Hi.x>=0&&Hi.y>=0&&Hi.x+Hi.y<=1},getUV:function(t,e,n,i,r,o,a,s){return this.getBarycoord(t,e,n,i,Hi),s.set(0,0),s.addScaledVector(r,Hi.x),s.addScaledVector(o,Hi.y),s.addScaledVector(a,Hi.z),s},isFrontFacing:function(t,e,n,i){return Vi.subVectors(n,e),Ui.subVectors(t,e),Vi.cross(Ui).dot(i)<0}}),Object.assign(Ki.prototype,{set:function(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this},setFromPointsAndIndices:function(t,e,n,i){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[i]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this},getArea:function(){return Vi.subVectors(this.c,this.b),Ui.subVectors(this.a,this.b),.5*Vi.cross(Ui).length()},getMidpoint:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),t=new Dn),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(t){return Ki.getNormal(this.a,this.b,this.c,t)},getPlane:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getPlane() target is now required"),t=new zi),t.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(t,e){return Ki.getBarycoord(t,this.a,this.b,this.c,e)},getUV:function(t,e,n,i,r){return Ki.getUV(t,this.a,this.b,this.c,e,n,i,r)},containsPoint:function(t){return Ki.containsPoint(t,this.a,this.b,this.c)},isFrontFacing:function(t){return Ki.isFrontFacing(this.a,this.b,this.c,t)},intersectsBox:function(t){return t.intersectsTriangle(this)},closestPointToPoint:function(t,e){void 0===e&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),e=new Dn);var n,i,r=this.a,o=this.b,a=this.c;Gi.subVectors(o,r),Wi.subVectors(a,r),Xi.subVectors(t,r);var s=Gi.dot(Xi),c=Wi.dot(Xi);if(s<=0&&c<=0)return e.copy(r);Yi.subVectors(t,o);var l=Gi.dot(Yi),u=Wi.dot(Yi);if(l>=0&&u<=l)return e.copy(o);var h=s*u-l*c;if(h<=0&&s>=0&&l<=0)return n=s/(s-l),e.copy(r).addScaledVector(Gi,n);Qi.subVectors(t,a);var d=Gi.dot(Qi),p=Wi.dot(Qi);if(p>=0&&d<=p)return e.copy(a);var f=d*c-s*p;if(f<=0&&c>=0&&p<=0)return i=c/(c-p),e.copy(r).addScaledVector(Wi,i);var m=l*p-d*u;if(m<=0&&u-l>=0&&d-p>=0)return qi.subVectors(a,o),i=(u-l)/(u-l+(d-p)),e.copy(o).addScaledVector(qi,i);var v=1/(m+f+h);return n=f*v,i=h*v,e.copy(r).addScaledVector(Gi,n).addScaledVector(Wi,i)},equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}});var Zi={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ji={h:0,s:0,l:0},$i={h:0,s:0,l:0};function tr(t,e,n){return void 0===e&&void 0===n?this.set(t):this.setRGB(t,e,n)}function er(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}function nr(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function ir(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}function rr(t,e,n,i,r,o){this.a=t,this.b=e,this.c=n,this.normal=i&&i.isVector3?i:new Dn,this.vertexNormals=Array.isArray(i)?i:[],this.color=r&&r.isColor?r:new tr,this.vertexColors=Array.isArray(r)?r:[],this.materialIndex=void 0!==o?o:0}Object.assign(tr.prototype,{isColor:!0,r:1,g:1,b:1,set:function(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this},setScalar:function(t){return this.r=t,this.g=t,this.b=t,this},setHex:function(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,e,n){return this.r=t,this.g=e,this.b=n,this},setHSL:function(t,e,n){if(t=An.euclideanModulo(t,1),e=An.clamp(e,0,1),n=An.clamp(n,0,1),0===e)this.r=this.g=this.b=n;else{var i=n<=.5?n*(1+e):n+e-n*e,r=2*n-i;this.r=er(r,i,t+1/3),this.g=er(r,i,t),this.b=er(r,i,t-1/3)}return this},setStyle:function(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)){var i,r=n[1],o=n[2];switch(r){case"rgb":case"rgba":if(i=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,e(i[5]),this;if(i=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,e(i[5]),this;break;case"hsl":case"hsla":if(i=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)){var a=parseFloat(i[1])/360,s=parseInt(i[2],10)/100,c=parseInt(i[3],10)/100;return e(i[5]),this.setHSL(a,s,c)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(t)){var l=n[1],u=l.length;if(3===u)return this.r=parseInt(l.charAt(0)+l.charAt(0),16)/255,this.g=parseInt(l.charAt(1)+l.charAt(1),16)/255,this.b=parseInt(l.charAt(2)+l.charAt(2),16)/255,this;if(6===u)return this.r=parseInt(l.charAt(0)+l.charAt(1),16)/255,this.g=parseInt(l.charAt(2)+l.charAt(3),16)/255,this.b=parseInt(l.charAt(4)+l.charAt(5),16)/255,this}return t&&t.length>0?this.setColorName(t):this},setColorName:function(t){var e=Zi[t];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},copyGammaToLinear:function(t,e){return void 0===e&&(e=2),this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this},copyLinearToGamma:function(t,e){void 0===e&&(e=2);var n=e>0?1/e:1;return this.r=Math.pow(t.r,n),this.g=Math.pow(t.g,n),this.b=Math.pow(t.b,n),this},convertGammaToLinear:function(t){return this.copyGammaToLinear(this,t),this},convertLinearToGamma:function(t){return this.copyLinearToGamma(this,t),this},copySRGBToLinear:function(t){return this.r=nr(t.r),this.g=nr(t.g),this.b=nr(t.b),this},copyLinearToSRGB:function(t){return this.r=ir(t.r),this.g=ir(t.g),this.b=ir(t.b),this},convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(t){void 0===t&&(console.warn("THREE.Color: .getHSL() target is now required"),t={h:0,s:0,l:0});var e,n,i=this.r,r=this.g,o=this.b,a=Math.max(i,r,o),s=Math.min(i,r,o),c=(s+a)/2;if(s===a)e=0,n=0;else{var l=a-s;switch(n=c<=.5?l/(a+s):l/(2-a-s),a){case i:e=(r-o)/l+(r0&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.morphNormals&&(n.morphNormals=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),e){var r=i(t.textures),o=i(t.images);r.length>0&&(n.textures=r),o.length>0&&(n.images=o)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.blending=t.blending,this.side=t.side,this.flatShading=t.flatShading,this.vertexTangents=t.vertexTangents,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;var e=t.clippingPlanes,n=null;if(null!==e){var i=e.length;n=new Array(i);for(var r=0;r!==i;++r)n[r]=e[r].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(ar.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),sr.prototype=Object.create(ar.prototype),sr.prototype.constructor=sr,sr.prototype.isMeshBasicMaterial=!0,sr.prototype.copy=function(t){return ar.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this};var cr=new Dn;function lr(t,e,n){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===n,this.usage=dn,this.updateRange={offset:0,count:-1},this.version=0}function ur(t,e,n){lr.call(this,new Int8Array(t),e,n)}function hr(t,e,n){lr.call(this,new Uint8Array(t),e,n)}function dr(t,e,n){lr.call(this,new Uint8ClampedArray(t),e,n)}function pr(t,e,n){lr.call(this,new Int16Array(t),e,n)}function fr(t,e,n){lr.call(this,new Uint16Array(t),e,n)}function mr(t,e,n){lr.call(this,new Int32Array(t),e,n)}function vr(t,e,n){lr.call(this,new Uint32Array(t),e,n)}function gr(t,e,n){lr.call(this,new Float32Array(t),e,n)}function yr(t,e,n){lr.call(this,new Float64Array(t),e,n)}function xr(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function wr(t){if(0===t.length)return-1/0;for(var e=t[0],n=1,i=t.length;ne&&(e=t[n]);return e}Object.defineProperty(lr.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(lr.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this},copyAt:function(t,e,n){t*=this.itemSize,n*=e.itemSize;for(var i=0,r=this.itemSize;i0,a=r[1]&&r[1].length>0,s=t.morphTargets,c=s.length;if(c>0){e=[];for(var l=0;l0){u=[];for(l=0;l0&&0===n.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(l=0;l65535?vr:fr)(t,1):this.index=t},getAttribute:function(t){return this.attributes[t]},setAttribute:function(t,e){return this.attributes[t]=e,this},deleteAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,e,n){this.groups.push({start:t,count:e,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix4:function(t){var e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);var n=this.attributes.normal;if(void 0!==n){var i=(new Tn).getNormalMatrix(t);n.applyNormalMatrix(i),n.needsUpdate=!0}var r=this.attributes.tangent;return void 0!==r&&(r.transformDirection(t),r.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(t){return _r.makeRotationX(t),this.applyMatrix4(_r),this},rotateY:function(t){return _r.makeRotationY(t),this.applyMatrix4(_r),this},rotateZ:function(t){return _r.makeRotationZ(t),this.applyMatrix4(_r),this},translate:function(t,e,n){return _r.makeTranslation(t,e,n),this.applyMatrix4(_r),this},scale:function(t,e,n){return _r.makeScale(t,e,n),this.applyMatrix4(_r),this},lookAt:function(t){return Sr.lookAt(t),Sr.updateMatrix(),this.applyMatrix4(Sr.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Mr).negate(),this.translate(Mr.x,Mr.y,Mr.z),this},setFromObject:function(t){var e=t.geometry;if(t.isPoints||t.isLine){var n=new gr(3*e.vertices.length,3),i=new gr(3*e.colors.length,3);if(this.setAttribute("position",n.copyVector3sArray(e.vertices)),this.setAttribute("color",i.copyColorsArray(e.colors)),e.lineDistances&&e.lineDistances.length===e.vertices.length){var r=new gr(e.lineDistances.length,1);this.setAttribute("lineDistance",r.copyArray(e.lineDistances))}null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone())}else t.isMesh&&e&&e.isGeometry&&this.fromGeometry(e);return this},setFromPoints:function(t){for(var e=[],n=0,i=t.length;n0){var n=new Float32Array(3*t.normals.length);this.setAttribute("normal",new lr(n,3).copyVector3sArray(t.normals))}if(t.colors.length>0){var i=new Float32Array(3*t.colors.length);this.setAttribute("color",new lr(i,3).copyColorsArray(t.colors))}if(t.uvs.length>0){var r=new Float32Array(2*t.uvs.length);this.setAttribute("uv",new lr(r,2).copyVector2sArray(t.uvs))}if(t.uvs2.length>0){var o=new Float32Array(2*t.uvs2.length);this.setAttribute("uv2",new lr(o,2).copyVector2sArray(t.uvs2))}for(var a in this.groups=t.groups,t.morphTargets){for(var s=[],c=t.morphTargets[a],l=0,u=c.length;l0){var p=new gr(4*t.skinIndices.length,4);this.setAttribute("skinIndex",p.copyVector4sArray(t.skinIndices))}if(t.skinWeights.length>0){var f=new gr(4*t.skinWeights.length,4);this.setAttribute("skinWeight",f.copyVector4sArray(t.skinWeights))}return null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Mi);var t=this.attributes.position,e=this.morphAttributes.position;if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(var n=0,i=e.length;n0&&(t.userData=this.userData),void 0!==this.parameters){var e=this.parameters;for(var n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};var i=this.index;null!==i&&(t.data.index={type:i.array.constructor.name,array:Array.prototype.slice.call(i.array)});var r=this.attributes;for(var n in r){var o=(d=r[n]).toJSON();""!==d.name&&(o.name=d.name),t.data.attributes[n]=o}var a={},s=!1;for(var n in this.morphAttributes){for(var c=this.morphAttributes[n],l=[],u=0,h=c.length;u0&&(a[n]=l,s=!0)}s&&(t.data.morphAttributes=a,t.data.morphTargetsRelative=this.morphTargetsRelative);var p=this.groups;p.length>0&&(t.data.groups=JSON.parse(JSON.stringify(p)));var f=this.boundingSphere;return null!==f&&(t.data.boundingSphere={center:f.center.toArray(),radius:f.radius}),t},clone:function(){return(new Pr).copy(this)},copy:function(t){var e,n,i;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var r=t.index;null!==r&&this.setIndex(r.clone());var o=t.attributes;for(e in o){var a=o[e];this.setAttribute(e,a.clone())}var s=t.morphAttributes;for(e in s){var c=[],l=s[e];for(n=0,i=l.length;nn.far?null:{distance:c,point:Wr.clone(),object:t}}function Yr(t,e,n,i,r,o,a,s,c,l,u,h){Or.fromBufferAttribute(r,l),Fr.fromBufferAttribute(r,u),Ir.fromBufferAttribute(r,h);var d=t.morphTargetInfluences;if(e.morphTargets&&o&&d){kr.set(0,0,0),zr.set(0,0,0),Vr.set(0,0,0);for(var p=0,f=o.length;p0){var a=r[o[0]];if(void 0!==a)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=a.length;t0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(t,e){var n,i=this.geometry,r=this.material,o=this.matrixWorld;if(void 0!==r&&(null===i.boundingSphere&&i.computeBoundingSphere(),Rr.copy(i.boundingSphere),Rr.applyMatrix4(o),!1!==t.ray.intersectsSphere(Rr)&&(Lr.getInverse(o),Cr.copy(t.ray).applyMatrix4(Lr),null===i.boundingBox||!1!==Cr.intersectsBox(i.boundingBox))))if(i.isBufferGeometry){var a,s,c,l,u,h,d,p,f,m=i.index,v=i.attributes.position,g=i.morphAttributes.position,y=i.morphTargetsRelative,x=i.attributes.uv,w=i.attributes.uv2,b=i.groups,_=i.drawRange;if(null!==m)if(Array.isArray(r))for(l=0,h=b.length;l0&&(E=C);for(var R=0,O=L.length;R0)for(l=0;l0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var t,e,n;for(this.computeFaceNormals(),t=0,e=this.faces.length;t0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var t,e,n,i,r;for(n=0,i=this.faces.length;n=0;n--){var f=d[n];for(this.faces.splice(f,1),a=0,s=this.faceVertexUvs.length;a0,v=p.vertexNormals.length>0,g=1!==p.color.r||1!==p.color.g||1!==p.color.b,y=p.vertexColors.length>0,x=0;if(x=S(x,0,0),x=S(x,1,!0),x=S(x,2,!1),x=S(x,3,f),x=S(x,4,m),x=S(x,5,v),x=S(x,6,g),x=S(x,7,y),a.push(x),a.push(p.a,p.b,p.c),a.push(p.materialIndex),f){var w=this.faceVertexUvs[0][r];a.push(E(w[0]),E(w[1]),E(w[2]))}if(m&&a.push(M(p.normal)),v){var b=p.vertexNormals;a.push(M(b[0]),M(b[1]),M(b[2]))}if(g&&a.push(A(p.color)),y){var _=p.vertexColors;a.push(A(_[0]),A(_[1]),A(_[2]))}}function S(t,e,n){return n?t|1<0&&(t.data.colors=l),h.length>0&&(t.data.uvs=[h]),t.data.faces=a,t},clone:function(){return(new $r).copy(this)},copy:function(t){var e,n,i,r,o,a;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var s=t.vertices;for(e=0,n=s.length;e0?1:-1,l.push(L.x,L.y,L.z),u.push(y/m),u.push(1-x/v),T+=1}}for(x=0;x0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;var r={};for(var o in this.extensions)!0===this.extensions[o]&&(r[o]=!0);return Object.keys(r).length>0&&(e.extensions=r),e},ao.prototype=Object.assign(Object.create(li.prototype),{constructor:ao,isCamera:!0,copy:function(t,e){return li.prototype.copy.call(this,t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),t=new Dn),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()},updateMatrixWorld:function(t){li.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},updateWorldMatrix:function(t,e){li.prototype.updateWorldMatrix.call(this,t,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),so.prototype=Object.assign(Object.create(ao.prototype),{constructor:so,isPerspectiveCamera:!0,copy:function(t,e){return ao.prototype.copy.call(this,t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},setFocalLength:function(t){var e=.5*this.getFilmHeight()/t;this.fov=2*An.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){var t=Math.tan(.5*An.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*An.RAD2DEG*Math.atan(Math.tan(.5*An.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(t,e,n,i,r,o){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=this.near,e=t*Math.tan(.5*An.DEG2RAD*this.fov)/this.zoom,n=2*e,i=this.aspect*n,r=-.5*i,o=this.view;if(null!==this.view&&this.view.enabled){var a=o.fullWidth,s=o.fullHeight;r+=o.offsetX*i/a,e-=o.offsetY*n/s,i*=o.width/a,n*=o.height/s}var c=this.filmOffset;0!==c&&(r+=t*c/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,e,e-n,t,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){var e=li.prototype.toJSON.call(this,t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}});function co(t,e,n,i){li.call(this),this.type="CubeCamera";var r=new so(90,1,t,e);r.up.set(0,-1,0),r.lookAt(new Dn(1,0,0)),this.add(r);var o=new so(90,1,t,e);o.up.set(0,-1,0),o.lookAt(new Dn(-1,0,0)),this.add(o);var a=new so(90,1,t,e);a.up.set(0,0,1),a.lookAt(new Dn(0,1,0)),this.add(a);var s=new so(90,1,t,e);s.up.set(0,0,-1),s.lookAt(new Dn(0,-1,0)),this.add(s);var c=new so(90,1,t,e);c.up.set(0,-1,0),c.lookAt(new Dn(0,0,1)),this.add(c);var l=new so(90,1,t,e);l.up.set(0,-1,0),l.lookAt(new Dn(0,0,-1)),this.add(l),i=i||{format:Ht,magFilter:At,minFilter:At},this.renderTarget=new lo(n,i),this.renderTarget.texture.name="CubeCamera",this.update=function(t,e){null===this.parent&&this.updateMatrixWorld();var n=t.getRenderTarget(),i=this.renderTarget,u=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,t.setRenderTarget(i,0),t.render(e,r),t.setRenderTarget(i,1),t.render(e,o),t.setRenderTarget(i,2),t.render(e,a),t.setRenderTarget(i,3),t.render(e,s),t.setRenderTarget(i,4),t.render(e,c),i.texture.generateMipmaps=u,t.setRenderTarget(i,5),t.render(e,l),t.setRenderTarget(n)},this.clear=function(t,e,n,i){for(var r=t.getRenderTarget(),o=this.renderTarget,a=0;a<6;a++)t.setRenderTarget(o,a),t.clear(e,n,i);t.setRenderTarget(r)}}function lo(t,e,n){Number.isInteger(e)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),e=n),On.call(this,t,t,e)}function uo(t,e,n,i,r,o,a,s,c,l,u,h){Cn.call(this,null,o,a,s,c,l,i,r,u,h),this.image={data:t||null,width:e||1,height:n||1},this.magFilter=void 0!==c?c:wt,this.minFilter=void 0!==l?l:wt,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}co.prototype=Object.create(li.prototype),co.prototype.constructor=co,lo.prototype=Object.create(On.prototype),lo.prototype.constructor=lo,lo.prototype.isWebGLCubeRenderTarget=!0,lo.prototype.fromEquirectangularTexture=function(t,e){this.texture.type=e.type,this.texture.format=e.format,this.texture.encoding=e.encoding;var n=new ui,i={uniforms:{tEquirect:{value:null}},vertexShader:["varying vec3 vWorldDirection;","vec3 transformDirection( in vec3 dir, in mat4 matrix ) {","\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );","}","void main() {","\tvWorldDirection = transformDirection( position, modelMatrix );","\t#include ","\t#include ","}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;","varying vec3 vWorldDirection;","#define RECIPROCAL_PI 0.31830988618","#define RECIPROCAL_PI2 0.15915494","void main() {","\tvec3 direction = normalize( vWorldDirection );","\tvec2 sampleUV;","\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;","\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;","\tgl_FragColor = texture2D( tEquirect, sampleUV );","}"].join("\n")},r=new oo({type:"CubemapFromEquirect",uniforms:no(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:g,blending:M});r.uniforms.tEquirect.value=e;var o=new qr(new eo(5,5,5),r);n.add(o);var a=new co(1,10,1);return a.renderTarget=this,a.renderTarget.texture.name="CubeCameraTexture",a.update(t,n),o.geometry.dispose(),o.material.dispose(),this},uo.prototype=Object.create(Cn.prototype),uo.prototype.constructor=uo,uo.prototype.isDataTexture=!0;var ho=new Ti,po=new Dn;function fo(t,e,n,i,r,o){this.planes=[void 0!==t?t:new zi,void 0!==e?e:new zi,void 0!==n?n:new zi,void 0!==i?i:new zi,void 0!==r?r:new zi,void 0!==o?o:new zi]}Object.assign(fo.prototype,{set:function(t,e,n,i,r,o){var a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(n),a[3].copy(i),a[4].copy(r),a[5].copy(o),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){for(var e=this.planes,n=0;n<6;n++)e[n].copy(t.planes[n]);return this},setFromProjectionMatrix:function(t){var e=this.planes,n=t.elements,i=n[0],r=n[1],o=n[2],a=n[3],s=n[4],c=n[5],l=n[6],u=n[7],h=n[8],d=n[9],p=n[10],f=n[11],m=n[12],v=n[13],g=n[14],y=n[15];return e[0].setComponents(a-i,u-s,f-h,y-m).normalize(),e[1].setComponents(a+i,u+s,f+h,y+m).normalize(),e[2].setComponents(a+r,u+c,f+d,y+v).normalize(),e[3].setComponents(a-r,u-c,f-d,y-v).normalize(),e[4].setComponents(a-o,u-l,f-p,y-g).normalize(),e[5].setComponents(a+o,u+l,f+p,y+g).normalize(),this},intersectsObject:function(t){var e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),ho.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(ho)},intersectsSprite:function(t){return ho.center.set(0,0,0),ho.radius=.7071067811865476,ho.applyMatrix4(t.matrixWorld),this.intersectsSphere(ho)},intersectsSphere:function(t){for(var e=this.planes,n=t.center,i=-t.radius,r=0;r<6;r++){if(e[r].distanceToPoint(n)0?t.max.x:t.min.x,po.y=i.normal.y>0?t.max.y:t.min.y,po.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint(po)<0)return!1}return!0},containsPoint:function(t){for(var e=this.planes,n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}});var mo={common:{diffuse:{value:new tr(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new Tn},uv2Transform:{value:new Tn},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new En(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new tr(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new tr(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Tn}},sprite:{diffuse:{value:new tr(15658734)},opacity:{value:1},center:{value:new En(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Tn}}};function vo(){var t=null,e=!1,n=null;function i(r,o){!1!==e&&(n(r,o),t.requestAnimationFrame(i))}return{start:function(){!0!==e&&null!==n&&(t.requestAnimationFrame(i),e=!0)},stop:function(){e=!1},setAnimationLoop:function(t){n=t},setContext:function(e){t=e}}}function go(t,e){var n=e.isWebGL2,i=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),i.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);var n=i.get(e);n&&(t.deleteBuffer(n.buffer),i.delete(e))},update:function(e,r){e.isInterleavedBufferAttribute&&(e=e.data);var o=i.get(e);void 0===o?i.set(e,function(e,n){var i=e.array,r=e.usage,o=t.createBuffer();t.bindBuffer(n,o),t.bufferData(n,i,r),e.onUploadCallback();var a=5126;return i instanceof Float32Array?a=5126:i instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):i instanceof Uint16Array?a=5123:i instanceof Int16Array?a=5122:i instanceof Uint32Array?a=5125:i instanceof Int32Array?a=5124:i instanceof Int8Array?a=5120:i instanceof Uint8Array&&(a=5121),{buffer:o,type:a,bytesPerElement:i.BYTES_PER_ELEMENT,version:e.version}}(e,r)):o.version 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvarying vec3 vViewPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",common:"#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n return m[ 2 ][ 3 ] == - 1.0;\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_maxMipLevel 8.0\n#define cubeUV_minMipLevel 4.0\n#define cubeUV_maxTileSize 256.0\n#define cubeUV_minTileSize 16.0\nfloat getFace(vec3 direction) {\n vec3 absDirection = abs(direction);\n float face = -1.0;\n if (absDirection.x > absDirection.z) {\n if (absDirection.x > absDirection.y)\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if (absDirection.z > absDirection.y)\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n}\nvec2 getUV(vec3 direction, float face) {\n vec2 uv;\n if (face == 0.0) {\n uv = vec2(-direction.z, direction.y) / abs(direction.x);\n } else if (face == 1.0) {\n uv = vec2(direction.x, -direction.z) / abs(direction.y);\n } else if (face == 2.0) {\n uv = direction.xy / abs(direction.z);\n } else if (face == 3.0) {\n uv = vec2(direction.z, direction.y) / abs(direction.x);\n } else if (face == 4.0) {\n uv = direction.xz / abs(direction.y);\n } else {\n uv = vec2(-direction.x, direction.y) / abs(direction.z);\n }\n return 0.5 * (uv + 1.0);\n}\nvec3 bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) {\n float face = getFace(direction);\n float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0);\n mipInt = max(mipInt, cubeUV_minMipLevel);\n float faceSize = exp2(mipInt);\n float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize);\n vec2 uv = getUV(direction, face) * (faceSize - 1.0);\n vec2 f = fract(uv);\n uv += 0.5 - f;\n if (face > 2.0) {\n uv.y += faceSize;\n face -= 3.0;\n }\n uv.x += face * faceSize;\n if(mipInt < cubeUV_maxMipLevel){\n uv.y += 2.0 * cubeUV_maxTileSize;\n }\n uv.y += filterInt * 2.0 * cubeUV_minTileSize;\n uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize);\n uv *= texelSize;\n vec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x += texelSize;\n vec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.y += texelSize;\n vec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x -= texelSize;\n vec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n vec3 tm = mix(tl, tr, f.x);\n vec3 bm = mix(bl, br, f.x);\n return mix(tm, bm, f.y);\n}\n#define r0 1.0\n#define v0 0.339\n#define m0 -2.0\n#define r1 0.8\n#define v1 0.276\n#define m1 -1.0\n#define r4 0.4\n#define v4 0.046\n#define m4 2.0\n#define r5 0.305\n#define v5 0.016\n#define m5 3.0\n#define r6 0.21\n#define v6 0.0038\n#define m6 4.0\nfloat roughnessToMip(float roughness) {\n float mip = 0.0;\n if (roughness >= r1) {\n mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0;\n } else if (roughness >= r4) {\n mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1;\n } else if (roughness >= r5) {\n mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4;\n } else if (roughness >= r6) {\n mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5;\n } else {\n mip = -2.0 * log2(1.16 * roughness); }\n return mip;\n}\nvec4 textureCubeUV(sampler2D envMap, vec3 sampleDir, float roughness) {\n float mip = clamp(roughnessToMip(roughness), m0, cubeUV_maxMipLevel);\n float mipF = fract(mip);\n float mipInt = floor(mip);\n vec3 color0 = bilinearCubeUV(envMap, sampleDir, mipInt);\n if (mipF == 0.0) {\n return vec4(color0, 1.0);\n } else {\n vec3 color1 = bilinearCubeUV(envMap, sampleDir, mipInt + 1.0);\n return vec4(mix(color0, color1, mipF), 1.0);\n }\n}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\ttransformedNormal = mat3( instanceMatrix ) * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\t\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\treflectVec = normalize( reflectVec );\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t vec3 reflectVec = reflect( -viewDir, normal );\n\t\t reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t vec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) { \n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = -mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t\tfloat shadowCameraNear;\n\t\tfloat shadowCameraFar;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = saturate( clearcoat );\tmaterial.clearcoatRoughness = max( clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( pointLight.shadow, directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( spotLight.shadow, directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( directionalLight.shadow, directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\t\tmat3 tsn = mat3( S, T, N );\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\t#endif\n#endif",clearcoat_normalmap_pars_fragment:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= all( bvec2( directionalLight.shadow, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= all( bvec2( spotLight.shadow, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= all( bvec2( pointLight.shadow, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );\n}",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"#include \nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include \n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV;\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_ENVMAP\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSPARENCY\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSPARENCY\n\tuniform float transparency;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSPARENCY\n\t\tdiffuseColor.a *= saturate( 1. - transparency + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}"},bo={basic:{uniforms:io([mo.common,mo.specularmap,mo.envmap,mo.aomap,mo.lightmap,mo.fog]),vertexShader:wo.meshbasic_vert,fragmentShader:wo.meshbasic_frag},lambert:{uniforms:io([mo.common,mo.specularmap,mo.envmap,mo.aomap,mo.lightmap,mo.emissivemap,mo.fog,mo.lights,{emissive:{value:new tr(0)}}]),vertexShader:wo.meshlambert_vert,fragmentShader:wo.meshlambert_frag},phong:{uniforms:io([mo.common,mo.specularmap,mo.envmap,mo.aomap,mo.lightmap,mo.emissivemap,mo.bumpmap,mo.normalmap,mo.displacementmap,mo.fog,mo.lights,{emissive:{value:new tr(0)},specular:{value:new tr(1118481)},shininess:{value:30}}]),vertexShader:wo.meshphong_vert,fragmentShader:wo.meshphong_frag},standard:{uniforms:io([mo.common,mo.envmap,mo.aomap,mo.lightmap,mo.emissivemap,mo.bumpmap,mo.normalmap,mo.displacementmap,mo.roughnessmap,mo.metalnessmap,mo.fog,mo.lights,{emissive:{value:new tr(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:wo.meshphysical_vert,fragmentShader:wo.meshphysical_frag},toon:{uniforms:io([mo.common,mo.specularmap,mo.aomap,mo.lightmap,mo.emissivemap,mo.bumpmap,mo.normalmap,mo.displacementmap,mo.gradientmap,mo.fog,mo.lights,{emissive:{value:new tr(0)},specular:{value:new tr(1118481)},shininess:{value:30}}]),vertexShader:wo.meshtoon_vert,fragmentShader:wo.meshtoon_frag},matcap:{uniforms:io([mo.common,mo.bumpmap,mo.normalmap,mo.displacementmap,mo.fog,{matcap:{value:null}}]),vertexShader:wo.meshmatcap_vert,fragmentShader:wo.meshmatcap_frag},points:{uniforms:io([mo.points,mo.fog]),vertexShader:wo.points_vert,fragmentShader:wo.points_frag},dashed:{uniforms:io([mo.common,mo.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:wo.linedashed_vert,fragmentShader:wo.linedashed_frag},depth:{uniforms:io([mo.common,mo.displacementmap]),vertexShader:wo.depth_vert,fragmentShader:wo.depth_frag},normal:{uniforms:io([mo.common,mo.bumpmap,mo.normalmap,mo.displacementmap,{opacity:{value:1}}]),vertexShader:wo.normal_vert,fragmentShader:wo.normal_frag},sprite:{uniforms:io([mo.sprite,mo.fog]),vertexShader:wo.sprite_vert,fragmentShader:wo.sprite_frag},background:{uniforms:{uvTransform:{value:new Tn},t2D:{value:null}},vertexShader:wo.background_vert,fragmentShader:wo.background_frag},cube:{uniforms:io([mo.envmap,{opacity:{value:1}}]),vertexShader:wo.cube_vert,fragmentShader:wo.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:wo.equirect_vert,fragmentShader:wo.equirect_frag},distanceRGBA:{uniforms:io([mo.common,mo.displacementmap,{referencePosition:{value:new Dn},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:wo.distanceRGBA_vert,fragmentShader:wo.distanceRGBA_frag},shadow:{uniforms:io([mo.lights,mo.fog,{color:{value:new tr(0)},opacity:{value:1}}]),vertexShader:wo.shadow_vert,fragmentShader:wo.shadow_frag}};function _o(t,e,n,i){var r,o,a=new tr(0),s=0,c=null,l=0,u=null;function h(t,n){e.buffers.color.setClear(t.r,t.g,t.b,n,i)}return{getClearColor:function(){return a},setClearColor:function(t,e){a.set(t),h(a,s=void 0!==e?e:1)},getClearAlpha:function(){return s},setClearAlpha:function(t){h(a,s=t)},render:function(e,i,d,p){var f=i.background,m=t.xr,y=m.getSession&&m.getSession();if(y&&"additive"===y.environmentBlendMode&&(f=null),null===f?h(a,s):f&&f.isColor&&(h(f,1),p=!0),(t.autoClear||p)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),f&&(f.isCubeTexture||f.isWebGLCubeRenderTarget||f.mapping===mt)){void 0===o&&((o=new qr(new eo(1,1,1),new oo({type:"BackgroundCubeMaterial",uniforms:no(bo.cube.uniforms),vertexShader:bo.cube.vertexShader,fragmentShader:bo.cube.fragmentShader,side:g,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),o.geometry.deleteAttribute("uv"),o.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(o.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(o));var x=f.isWebGLCubeRenderTarget?f.texture:f;o.material.uniforms.envMap.value=x,o.material.uniforms.flipEnvMap.value=x.isCubeTexture?-1:1,c===f&&l===x.version&&u===t.toneMapping||(o.material.needsUpdate=!0,c=f,l=x.version,u=t.toneMapping),e.unshift(o,o.geometry,o.material,0,0,null)}else f&&f.isTexture&&(void 0===r&&((r=new qr(new xo(2,2),new oo({type:"BackgroundMaterial",uniforms:no(bo.background.uniforms),vertexShader:bo.background.vertexShader,fragmentShader:bo.background.fragmentShader,side:v,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(r.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(r)),r.material.uniforms.t2D.value=f,!0===f.matrixAutoUpdate&&f.updateMatrix(),r.material.uniforms.uvTransform.value.copy(f.matrix),c===f&&l===f.version&&u===t.toneMapping||(r.material.needsUpdate=!0,c=f,l=f.version,u=t.toneMapping),e.unshift(r,r.geometry,r.material,0,0,null))}}}function So(t,e,n,i){var r,o=i.isWebGL2;this.setMode=function(t){r=t},this.render=function(e,i){t.drawArrays(r,e,i),n.update(i,r)},this.renderInstances=function(i,a,s,c){if(0!==c){var l,u;if(o)l=t,u="drawArraysInstanced";else if(u="drawArraysInstancedANGLE",null===(l=e.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[u](r,a,s,c),n.update(s,r,c)}}}function Mo(t,e,n){var i;function r(e){if("highp"===e){if(t.getShaderPrecisionFormat(35633,36338).precision>0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}var o="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&t instanceof WebGL2ComputeRenderingContext,a=void 0!==n.precision?n.precision:"highp",s=r(a);s!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",s,"instead."),a=s);var c=!0===n.logarithmicDepthBuffer,l=t.getParameter(34930),u=t.getParameter(35660),h=t.getParameter(3379),d=t.getParameter(34076),p=t.getParameter(34921),f=t.getParameter(36347),m=t.getParameter(36348),v=t.getParameter(36349),g=u>0,y=o||!!e.get("OES_texture_float");return{isWebGL2:o,getMaxAnisotropy:function(){if(void 0!==i)return i;var n=e.get("EXT_texture_filter_anisotropic");return i=null!==n?t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:r,precision:a,logarithmicDepthBuffer:c,maxTextures:l,maxVertexTextures:u,maxTextureSize:h,maxCubemapSize:d,maxAttributes:p,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:v,vertexTextures:g,floatFragmentTextures:y,floatVertexTextures:g&&y,maxSamples:o?t.getParameter(36183):0}}function Ao(){var t=this,e=null,n=0,i=!1,r=!1,o=new zi,a=new Tn,s={value:null,needsUpdate:!1};function c(){s.value!==e&&(s.value=e,s.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function l(e,n,i,r){var c=null!==e?e.length:0,l=null;if(0!==c){if(l=s.value,!0!==r||null===l){var u=i+4*c,h=n.matrixWorldInverse;a.getNormalMatrix(h),(null===l||l.length65535?vr:fr)(n,1);p.version=a,e.update(p,34963);var f=r.get(t);f&&e.remove(f),r.set(t,p)}return{get:function(t,e){var r=i.get(e);return r||(e.addEventListener("dispose",o),e.isBufferGeometry?r=e:e.isGeometry&&(void 0===e._bufferGeometry&&(e._bufferGeometry=(new Pr).setFromObject(t)),r=e._bufferGeometry),i.set(e,r),n.memory.geometries++,r)},update:function(t){var n=t.index,i=t.attributes;for(var r in null!==n&&e.update(n,34963),i)e.update(i[r],34962);var o=t.morphAttributes;for(var r in o)for(var a=o[r],s=0,c=a.length;s0)return t;var r=e*n,o=Vo[r];if(void 0===o&&(o=new Float32Array(r),Vo[r]=o),0!==e){i.toArray(o,0);for(var a=1,s=0;a!==e;++a)s+=n,t[a].toArray(o,s)}return o}function qo(t,e){if(t.length!==e.length)return!1;for(var n=0,i=t.length;n/gm;function Ua(t){return t.replace(Va,ja)}function ja(t,e){var n=wo[e];if(void 0===n)throw new Error("Can not resolve #include <"+e+">");return Ua(n)}var Ha=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;function Ga(t){return t.replace(Ha,Wa)}function Wa(t,e,n,i){for(var r="",o=parseInt(e);o0?t.gammaFactor:1,w=n.isWebGL2?"":function(t){return[t.extensionDerivatives||t.envMapCubeUV||t.bumpMap||t.tangentSpaceNormalMap||t.clearcoatNormalMap||t.flatShading||"physical"===t.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Da).join("\n")}(n),b=function(t){var e=[];for(var n in t){var i=t[n];!1!==i&&e.push("#define "+n+" "+i)}return e.join("\n")}(l),_=c.createProgram(),S=n.numMultiviewViews;if(n.isRawShaderMaterial?((i=[b].filter(Da).join("\n")).length>0&&(i+="\n"),(r=[w,b].filter(Da).join("\n")).length>0&&(r+="\n")):(i=[qa(n),"#define SHADER_NAME "+n.shaderName,b,n.instancing?"#define USE_INSTANCING":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+x,"#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+g:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+d:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Da).join("\n"),r=[w,qa(n),"#define SHADER_NAME "+n.shaderName,b,n.alphaTest?"#define ALPHATEST "+n.alphaTest+(n.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+x,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+v:"",n.envMap?"#define "+g:"",n.envMap?"#define "+y:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.sheen?"#define USE_SHEEN":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+d:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==it?"#define TONE_MAPPING":"",n.toneMapping!==it?wo.tonemapping_pars_fragment:"",n.toneMapping!==it?Ba("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.outputEncoding||n.mapEncoding||n.matcapEncoding||n.envMapEncoding||n.emissiveMapEncoding||n.lightMapEncoding?wo.encodings_pars_fragment:"",n.mapEncoding?Na("mapTexelToLinear",n.mapEncoding):"",n.matcapEncoding?Na("matcapTexelToLinear",n.matcapEncoding):"",n.envMapEncoding?Na("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMapEncoding?Na("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMapEncoding?Na("lightMapTexelToLinear",n.lightMapEncoding):"",n.outputEncoding?(o="linearToOutputTexel",a=n.outputEncoding,s=Fa(a),"vec4 "+o+"( vec4 value ) { return LinearTo"+s[0]+s[1]+"; }"):"",n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(Da).join("\n")),u=za(u=ka(u=Ua(u),n),n),h=za(h=ka(h=Ua(h),n),n),u=Ga(u),h=Ga(h),n.isWebGL2&&!n.isRawShaderMaterial){var M=!1,A=/^\s*#version\s+300\s+es\s*\n/;n.isShaderMaterial&&null!==u.match(A)&&null!==h.match(A)&&(M=!0,u=u.replace(A,""),h=h.replace(A,"")),i=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+i,r=["#version 300 es\n","#define varying in",M?"":"out highp vec4 pc_fragColor;",M?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+r,S>0&&(i=(i=i.replace("#version 300 es\n",["#version 300 es\n","#extension GL_OVR_multiview2 : require","layout(num_views = "+S+") in;","#define VIEW_ID gl_ViewID_OVR"].join("\n"))).replace(["uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;"].join("\n"),["uniform mat4 modelViewMatrices["+S+"];","uniform mat4 projectionMatrices["+S+"];","uniform mat4 viewMatrices["+S+"];","uniform mat3 normalMatrices["+S+"];","#define modelViewMatrix modelViewMatrices[VIEW_ID]","#define projectionMatrix projectionMatrices[VIEW_ID]","#define viewMatrix viewMatrices[VIEW_ID]","#define normalMatrix normalMatrices[VIEW_ID]"].join("\n")),r=(r=r.replace("#version 300 es\n",["#version 300 es\n","#extension GL_OVR_multiview2 : require","#define VIEW_ID gl_ViewID_OVR"].join("\n"))).replace("uniform mat4 viewMatrix;",["uniform mat4 viewMatrices["+S+"];","#define viewMatrix viewMatrices[VIEW_ID]"].join("\n")))}var E,T,P=r+h,L=Ra(c,35633,i+u),C=Ra(c,35632,P);if(c.attachShader(_,L),c.attachShader(_,C),void 0!==n.index0AttributeName?c.bindAttribLocation(_,0,n.index0AttributeName):!0===n.morphTargets&&c.bindAttribLocation(_,0,"position"),c.linkProgram(_),t.debug.checkShaderErrors){var R=c.getProgramInfoLog(_).trim(),O=c.getShaderInfoLog(L).trim(),F=c.getShaderInfoLog(C).trim(),I=!0,N=!0;if(!1===c.getProgramParameter(_,35714)){I=!1;var B=Ia(c,L,"vertex"),D=Ia(c,C,"fragment");console.error("THREE.WebGLProgram: shader error: ",c.getError(),"35715",c.getProgramParameter(_,35715),"gl.getProgramInfoLog",R,B,D)}else""!==R?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",R):""!==O&&""!==F||(N=!1);N&&(this.diagnostics={runnable:I,programLog:R,vertexShader:{log:O,prefix:i},fragmentShader:{log:F,prefix:r}})}return c.deleteShader(L),c.deleteShader(C),this.getUniforms=function(){return void 0===E&&(E=new Ca(c,_)),E},this.getAttributes=function(){return void 0===T&&(T=function(t,e){for(var n={},i=t.getProgramParameter(e,35721),r=0;r0,maxBones:M,useVertexTexture:a,morphTargets:i.morphTargets,morphNormals:i.morphNormals,maxMorphTargets:t.maxMorphTargets,maxMorphNormals:t.maxMorphNormals,numDirLights:h.directional.length,numPointLights:h.point.length,numSpotLights:h.spot.length,numRectAreaLights:h.rectArea.length,numHemiLights:h.hemi.length,numDirLightShadows:h.directionalShadowMap.length,numPointLightShadows:h.pointShadowMap.length,numSpotLightShadows:h.spotShadowMap.length,numClippingPlanes:m,numClipIntersection:v,dithering:i.dithering,shadowMapEnabled:t.shadowMap.enabled&&p.length>0,shadowMapType:t.shadowMap.type,toneMapping:i.toneMapped?t.toneMapping:it,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:i.premultipliedAlpha,alphaTest:i.alphaTest,doubleSided:i.side===y,flipSided:i.side===g,depthPacking:void 0!==i.depthPacking&&i.depthPacking,index0AttributeName:i.index0AttributeName,extensionDerivatives:i.extensions&&i.extensions.derivatives,extensionFragDepth:i.extensions&&i.extensions.frawbuffers,extensionDrawbuffers:i.extensions&&i.extensions.drawbuffers,extensionShaderTextureLOD:i.extensions&&i.extensions.shaderTextureLOD,rendererExtensionFragDepth:r||null!==e.get("EXT_frag_depth"),rendererExtensionDrawBuffers:r||null!==e.get("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:r||null!==e.get("EXT_shader_texture_lod"),onBeforeCompile:i.onBeforeCompile}},this.getProgramCacheKey=function(e){var n=[];if(e.shaderID?n.push(e.shaderID):(n.push(e.fragmentShader),n.push(e.vertexShader)),void 0!==e.defines)for(var i in e.defines)n.push(i),n.push(e.defines[i]);if(void 0===e.isRawShaderMaterial){for(var r=0;r1&&n.sort(t||Ka),i.length>1&&i.sort(e||Za)}}}function $a(){var t=new WeakMap;function e(n){var i=n.target;i.removeEventListener("dispose",e),t.delete(i)}return{get:function(n,i){var r,o=t.get(n);return void 0===o?(r=new Ja,t.set(n,new WeakMap),t.get(n).set(i,r),n.addEventListener("dispose",e)):void 0===(r=o.get(i))&&(r=new Ja,o.set(i,r)),r},dispose:function(){t=new WeakMap}}}function ts(){var t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];var n;switch(e.type){case"DirectionalLight":n={direction:new Dn,color:new tr,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new En};break;case"SpotLight":n={position:new Dn,direction:new Dn,color:new tr,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new En};break;case"PointLight":n={position:new Dn,color:new tr,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new En,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":n={direction:new Dn,skyColor:new tr,groundColor:new tr};break;case"RectAreaLight":n={color:new tr,position:new Dn,halfWidth:new Dn,halfHeight:new Dn}}return t[e.id]=n,n}}}var es=0;function ns(t,e){return(e.castShadow?1:0)-(t.castShadow?1:0)}function is(){for(var t=new ts,e={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},n=0;n<9;n++)e.probe.push(new Dn);var i=new Dn,r=new Wn,o=new Wn;return{setup:function(n,a,s){for(var c=0,l=0,u=0,h=0;h<9;h++)e.probe[h].set(0,0,0);var d=0,p=0,f=0,m=0,v=0,g=0,y=0,x=0,w=s.matrixWorldInverse;n.sort(ns),h=0;for(var b=n.length;h\nvoid main() {\n float mean = 0.0;\n float squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n #ifdef HORIZONAL_PASS\n vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean * HALF_SAMPLE_RATE;\n squared_mean = squared_mean * HALF_SAMPLE_RATE;\n float std_dev = sqrt( squared_mean - mean * mean );\n gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),d=h.clone();d.defines.HORIZONAL_PASS=1;var f=new Pr;f.setAttribute("position",new lr(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var x=new qr(f,h),w=this;function b(n,i){var r=e.update(x);h.uniforms.shadow_pass.value=n.map.texture,h.uniforms.resolution.value=n.mapSize,h.uniforms.radius.value=n.radius,t.setRenderTarget(n.mapPass),t.clear(),t.renderBufferDirect(i,null,r,h,x,null),d.uniforms.shadow_pass.value=n.mapPass.texture,d.uniforms.resolution.value=n.mapSize,d.uniforms.radius.value=n.radius,t.setRenderTarget(n.map),t.clear(),t.renderBufferDirect(i,null,r,d,x,null)}function _(t,e,n){var i=t<<0|e<<1|n<<2,r=s[i];return void 0===r&&(r=new as({depthPacking:qe,morphTargets:t,skinning:e}),s[i]=r),r}function S(t,e,n){var i=t<<0|e<<1|n<<2,r=c[i];return void 0===r&&(r=new ss({morphTargets:t,skinning:e}),c[i]=r),r}function A(e,n,i,r,o,a){var s=e.geometry,c=null,h=_,d=e.customDepthMaterial;if(!0===i.isPointLight&&(h=S,d=e.customDistanceMaterial),void 0===d){var p=!1;!0===n.morphTargets&&(!0===s.isBufferGeometry?p=s.morphAttributes&&s.morphAttributes.position&&s.morphAttributes.position.length>0:!0===s.isGeometry&&(p=s.morphTargets&&s.morphTargets.length>0));var f=!1;!0===e.isSkinnedMesh&&(!0===n.skinning?f=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",e)),c=h(p,f,!0===e.isInstancedMesh)}else c=d;if(t.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length){var v=c.uuid,g=n.uuid,y=l[v];void 0===y&&(y={},l[v]=y);var x=y[g];void 0===x&&(x=c.clone(),y[g]=x),c=x}return c.visible=n.visible,c.wireframe=n.wireframe,c.side=a===m?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:u[n.side],c.clipShadows=n.clipShadows,c.clippingPlanes=n.clippingPlanes,c.clipIntersection=n.clipIntersection,c.wireframeLinewidth=n.wireframeLinewidth,c.linewidth=n.linewidth,!0===i.isPointLight&&!0===c.isMeshDistanceMaterial&&(c.referencePosition.setFromMatrixPosition(i.matrixWorld),c.nearDistance=r,c.farDistance=o),c}function E(n,r,o,a,s){if(!1!==n.visible){if(n.layers.test(r.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&s===m)&&(!n.frustumCulled||i.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,n.matrixWorld);var c=e.update(n),l=n.material;if(Array.isArray(l))for(var u=c.groups,h=0,d=u.length;hn||r.y>n)&&(console.warn("THREE.WebGLShadowMap:",v,"has shadow exceeding max texture size, reducing"),r.x>n&&(o.x=Math.floor(n/y.x),r.x=o.x*y.x,g.mapSize.x=o.x),r.y>n&&(o.y=Math.floor(n/y.y),r.y=o.y*y.y,g.mapSize.y=o.y)),null===g.map&&!g.isPointLightShadow&&this.type===m){var x={minFilter:At,magFilter:At,format:Gt};g.map=new On(r.x,r.y,x),g.map.texture.name=v.name+".shadowMap",g.mapPass=new On(r.x,r.y,x),g.camera.updateProjectionMatrix()}if(null===g.map){x={minFilter:wt,magFilter:wt,format:Gt};g.map=new On(r.x,r.y,x),g.map.texture.name=v.name+".shadowMap",g.camera.updateProjectionMatrix()}t.setRenderTarget(g.map),t.clear();for(var _=g.getViewportCount(),S=0;S<_;S++){var A=g.getViewport(S);a.set(o.x*A.x,o.y*A.y,o.x*A.z,o.y*A.w),d.viewport(a),g.updateMatrices(v,S),i=g.getFrustum(),E(s,c,g.camera,v,this.type)}g.isPointLightShadow||this.type!==m||b(g,c)}else console.warn("THREE.WebGLShadowMap:",v,"has no shadow.")}w.needsUpdate=!1,t.setRenderTarget(l,u,h)}}}function ls(t,e,n){var i=n.isWebGL2;var r=new function(){var e=!1,n=new Rn,i=null,r=new Rn(0,0,0,0);return{setMask:function(n){i===n||e||(t.colorMask(n,n,n,n),i=n)},setLocked:function(t){e=t},setClear:function(e,i,o,a,s){!0===s&&(e*=a,i*=a,o*=a),n.set(e,i,o,a),!1===r.equals(n)&&(t.clearColor(e,i,o,a),r.copy(n))},reset:function(){e=!1,i=null,r.set(-1,0,0,0)}}},o=new function(){var e=!1,n=null,i=null,r=null;return{setTest:function(t){t?xt(2929):wt(2929)},setMask:function(i){n===i||e||(t.depthMask(i),n=i)},setFunc:function(e){if(i!==e){if(e)switch(e){case q:t.depthFunc(512);break;case X:t.depthFunc(519);break;case Y:t.depthFunc(513);break;case Q:t.depthFunc(515);break;case K:t.depthFunc(514);break;case Z:t.depthFunc(518);break;case J:t.depthFunc(516);break;case $:t.depthFunc(517);break;default:t.depthFunc(515)}else t.depthFunc(515);i=e}},setLocked:function(t){e=t},setClear:function(e){r!==e&&(t.clearDepth(e),r=e)},reset:function(){e=!1,n=null,i=null,r=null}}},l=new function(){var e=!1,n=null,i=null,r=null,o=null,a=null,s=null,c=null,l=null;return{setTest:function(t){e||(t?xt(2960):wt(2960))},setMask:function(i){n===i||e||(t.stencilMask(i),n=i)},setFunc:function(e,n,a){i===e&&r===n&&o===a||(t.stencilFunc(e,n,a),i=e,r=n,o=a)},setOp:function(e,n,i){a===e&&s===n&&c===i||(t.stencilOp(e,n,i),a=e,s=n,c=i)},setLocked:function(t){e=t},setClear:function(e){l!==e&&(t.clearStencil(e),l=e)},reset:function(){e=!1,n=null,i=null,r=null,o=null,a=null,s=null,c=null,l=null}}},u=t.getParameter(34921),h=new Uint8Array(u),d=new Uint8Array(u),p=new Uint8Array(u),f={},m=null,v=null,x=null,w=null,b=null,_=null,S=null,tt=null,et=null,nt=!1,it=null,rt=null,ot=null,at=null,st=null,ct=t.getParameter(35661),lt=!1,ut=0,ht=t.getParameter(7938);-1!==ht.indexOf("WebGL")?(ut=parseFloat(/^WebGL\ ([0-9])/.exec(ht)[1]),lt=ut>=1):-1!==ht.indexOf("OpenGL ES")&&(ut=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(ht)[1]),lt=ut>=2);var dt=null,pt={},ft=new Rn,mt=new Rn;function vt(e,n,i){var r=new Uint8Array(4),o=t.createTexture();t.bindTexture(e,o),t.texParameteri(e,10241,9728),t.texParameteri(e,10240,9728);for(var a=0;ai||t.height>i)&&(r=i/Math.max(t.width,t.height)),r<1||!0===e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){var o=e?An.floorPowerOfTwo:Math.floor,a=o(r*t.width),c=o(r*t.height);void 0===s&&(s=m(a,c));var l=n?m(a,c):s;return l.width=a,l.height=c,l.getContext("2d").drawImage(t,0,0,a,c),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+a+"x"+c+")."),l}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function g(t){return An.isPowerOfTwo(t.width)&&An.isPowerOfTwo(t.height)}function y(t,e){return t.generateMipmaps&&e&&t.minFilter!==wt&&t.minFilter!==At}function x(e,n,r,o){t.generateMipmap(e),i.get(n).__maxMipLevel=Math.log(Math.max(r,o))*Math.LOG2E}function w(n,i,r){if(!1===c)return i;if(null!==n){if(void 0!==t[n])return t[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}var o=i;return 6403===i&&(5126===r&&(o=33326),5131===r&&(o=33325),5121===r&&(o=33321)),6407===i&&(5126===r&&(o=34837),5131===r&&(o=34843),5121===r&&(o=32849)),6408===i&&(5126===r&&(o=34836),5131===r&&(o=34842),5121===r&&(o=32856)),33325===o||33326===o||34842===o||34836===o?e.get("EXT_color_buffer_float"):34843!==o&&34837!==o||console.warn("THREE.WebGLRenderer: Floating point textures with RGB format not supported. Please use RGBA instead."),o}function b(t){return t===wt||t===bt||t===St?9728:9729}function _(e){var n=e.target;n.removeEventListener("dispose",_),function(e){var n=i.get(e);if(void 0===n.__webglInit)return;t.deleteTexture(n.__webglTexture),i.remove(e)}(n),n.isVideoTexture&&p.delete(n),a.memory.textures--}function S(e){var n=e.target;n.removeEventListener("dispose",S),function(e){var n=i.get(e),r=i.get(e.texture);if(!e)return;void 0!==r.__webglTexture&&t.deleteTexture(r.__webglTexture);e.depthTexture&&e.depthTexture.dispose();if(e.isWebGLCubeRenderTarget)for(var o=0;o<6;o++)t.deleteFramebuffer(n.__webglFramebuffer[o]),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer[o]);else t.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer);if(e.isWebGLMultiviewRenderTarget){t.deleteTexture(n.__webglColorTexture),t.deleteTexture(n.__webglDepthStencilTexture),a.memory.textures-=2;o=0;for(var s=n.__webglViewFramebuffers.length;o0&&r.__version!==t.version){var o=t.image;if(void 0===o)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==o.complete)return void O(r,t,e);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+e),n.bindTexture(3553,r.__webglTexture)}function E(e,r){if(6===e.image.length){var a=i.get(e);if(e.version>0&&a.__version!==e.version){R(a,e),n.activeTexture(33984+r),n.bindTexture(34067,a.__webglTexture),t.pixelStorei(37440,e.flipY);for(var s=e&&(e.isCompressedTexture||e.image[0].isCompressedTexture),l=e.image[0]&&e.image[0].isDataTexture,h=[],d=0;d<6;d++)h[d]=s||l?l?e.image[d].image:e.image[d]:v(e.image[d],!1,!0,u);var p,f=h[0],m=g(f)||c,b=o.convert(e.format),_=o.convert(e.type),S=w(e.internalFormat,b,_);if(C(34067,e,m),s){for(d=0;d<6;d++){p=h[d].mipmaps;for(var M=0;M1||i.get(o).__currentAnisotropy)&&(t.texParameterf(n,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,r.getMaxAnisotropy())),i.get(o).__currentAnisotropy=o.anisotropy)}}function R(e,n){void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",_),e.__webglTexture=t.createTexture(),a.memory.textures++)}function O(e,i,r){var a=3553;i.isDataTexture2DArray&&(a=35866),i.isDataTexture3D&&(a=32879),R(e,i),n.activeTexture(33984+r),n.bindTexture(a,e.__webglTexture),t.pixelStorei(37440,i.flipY),t.pixelStorei(37441,i.premultiplyAlpha),t.pixelStorei(3317,i.unpackAlignment);var s=function(t){return!c&&(t.wrapS!==yt||t.wrapT!==yt||t.minFilter!==wt&&t.minFilter!==At)}(i)&&!1===g(i.image),l=v(i.image,s,!1,h),u=g(l)||c,d=o.convert(i.format),p=o.convert(i.type),f=w(i.internalFormat,d,p);C(a,i,u);var m,b=i.mipmaps;if(i.isDepthTexture){if(f=6402,i.type===Bt){if(!1===c)throw new Error("Float Depth Texture only supported in WebGL2.0");f=36012}else c&&(f=33189);i.format===Yt&&6402===f&&i.type!==Ft&&i.type!==Nt&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),i.type=Ft,p=o.convert(i.type)),i.format===Qt&&(f=34041,i.type!==Ut&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),i.type=Ut,p=o.convert(i.type))),n.texImage2D(3553,0,f,l.width,l.height,0,d,p,null)}else if(i.isDataTexture)if(b.length>0&&u){for(var _=0,S=b.length;_0&&u){for(_=0,S=b.length;_=l&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+l),M+=1,t},this.resetTextureUnits=function(){M=0},this.setTexture2D=A,this.setTexture2DArray=function(t,e){var r=i.get(t);t.version>0&&r.__version!==t.version?O(r,t,e):(n.activeTexture(33984+e),n.bindTexture(35866,r.__webglTexture))},this.setTexture3D=function(t,e){var r=i.get(t);t.version>0&&r.__version!==t.version?O(r,t,e):(n.activeTexture(33984+e),n.bindTexture(32879,r.__webglTexture))},this.setTextureCube=E,this.setTextureCubeDynamic=T,this.setupRenderTarget=function(r){var s=i.get(r),l=i.get(r.texture);r.addEventListener("dispose",S),l.__webglTexture=t.createTexture(),a.memory.textures++;var u=!0===r.isWebGLCubeRenderTarget,h=!0===r.isWebGLMultisampleRenderTarget,d=!0===r.isWebGLMultiviewRenderTarget,p=g(r)||c;if(u){s.__webglFramebuffer=[];for(var f=0;f<6;f++)s.__webglFramebuffer[f]=t.createFramebuffer()}else if(s.__webglFramebuffer=t.createFramebuffer(),h)if(c){s.__webglMultisampledFramebuffer=t.createFramebuffer(),s.__webglColorRenderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,s.__webglColorRenderbuffer);var m=o.convert(r.texture.format),v=o.convert(r.texture.type),b=w(r.texture.internalFormat,m,v),_=B(r);t.renderbufferStorageMultisample(36161,_,b,r.width,r.height),t.bindFramebuffer(36160,s.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(36160,36064,36161,s.__webglColorRenderbuffer),t.bindRenderbuffer(36161,null),r.depthBuffer&&(s.__webglDepthRenderbuffer=t.createRenderbuffer(),I(s.__webglDepthRenderbuffer,r,!0)),t.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");else if(d){var M=r.width,A=r.height,E=r.numViews;t.bindFramebuffer(36160,s.__webglFramebuffer);var T=e.get("OVR_multiview2");a.memory.textures+=2;var P=t.createTexture();t.bindTexture(35866,P),t.texParameteri(35866,10240,9728),t.texParameteri(35866,10241,9728),t.texImage3D(35866,0,32856,M,A,E,0,6408,5121,null),T.framebufferTextureMultiviewOVR(36160,36064,P,0,0,E);var L=t.createTexture();t.bindTexture(35866,L),t.texParameteri(35866,10240,9728),t.texParameteri(35866,10241,9728),t.texImage3D(35866,0,35056,M,A,E,0,34041,34042,null),T.framebufferTextureMultiviewOVR(36160,33306,L,0,0,E);var R=new Array(E);for(f=0;fh)return!1;for(var n=1,i=e.length;n=0){var l=r[s];if(void 0!==l){var u=l.normalized,h=l.itemSize;if(void 0===(S=b.get(l)))continue;var d=S.buffer,g=S.type,y=S.bytesPerElement;if(l.isInterleavedBufferAttribute){var x=l.data,w=x.stride,_=l.offset;x&&x.isInstancedInterleavedBuffer?(v.enableAttributeAndDivisor(c,x.meshPerAttribute),void 0===e.maxInstancedCount&&(e.maxInstancedCount=x.meshPerAttribute*x.count)):v.enableAttribute(c),p.bindBuffer(34962,d),p.vertexAttribPointer(c,h,g,u,w*y,_*y)}else l.isInstancedBufferAttribute?(v.enableAttributeAndDivisor(c,l.meshPerAttribute),void 0===e.maxInstancedCount&&(e.maxInstancedCount=l.meshPerAttribute*l.count)):v.enableAttribute(c),p.bindBuffer(34962,d),p.vertexAttribPointer(c,h,g,u,0,0)}else if("instanceMatrix"===s){var S;if(void 0===(S=b.get(t.instanceMatrix)))continue;d=S.buffer,g=S.type;v.enableAttributeAndDivisor(c+0,1),v.enableAttributeAndDivisor(c+1,1),v.enableAttributeAndDivisor(c+2,1),v.enableAttributeAndDivisor(c+3,1),p.bindBuffer(34962,d),p.vertexAttribPointer(c+0,4,g,!1,64,0),p.vertexAttribPointer(c+1,4,g,!1,64,16),p.vertexAttribPointer(c+2,4,g,!1,64,32),p.vertexAttribPointer(c+3,4,g,!1,64,48)}else if(void 0!==a){var M=a[s];if(void 0!==M)switch(M.length){case 2:p.vertexAttrib2fv(c,M);break;case 3:p.vertexAttrib3fv(c,M);break;case 4:p.vertexAttrib4fv(c,M);break;default:p.vertexAttrib1fv(c,M)}}}}v.disableUnusedAttributes()}(r,n,i,s),null!==l&&p.bindBuffer(34963,h.buffer));var y=null!==l?l.count:u.count,x=n.drawRange.start*d,w=n.drawRange.count*d,S=null!==o?o.start*d:0,M=null!==o?o.count*d:1/0,A=Math.max(x,S),E=Math.min(y,x+w,S+M)-1,T=Math.max(0,E-A+1);if(0!==T){if(r.isMesh)!0===i.wireframe?(v.setLineWidth(i.wireframeLinewidth*st()),g.setMode(1)):g.setMode(4);else if(r.isLine){var R=i.linewidth;void 0===R&&(R=1),v.setLineWidth(R*st()),r.isLineSegments?g.setMode(1):r.isLineLoop?g.setMode(2):g.setMode(3)}else r.isPoints?g.setMode(0):r.isSprite&&g.setMode(4);r.isInstancedMesh?g.renderInstances(n,A,T,r.count):n.isInstancedBufferGeometry?g.renderInstances(n,A,T,n.maxInstancedCount):g.render(A,T)}},this.compile=function(t,e){(d=E.get(t,e)).init(),t.traverse((function(t){t.isLight&&(d.pushLight(t),t.castShadow&&d.pushShadow(t))})),d.setupLights(e);var n={};t.traverse((function(e){if(e.material)if(Array.isArray(e.material))for(var i=0;i=0&&t.numSupportedMorphTargets++}if(t.morphNormals){t.numSupportedMorphNormals=0;for(p=0;p=0&&t.numSupportedMorphNormals++}var f=i.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(i.numClippingPlanes=et.numPlanes,i.numIntersection=et.numIntersection,f.clippingPlanes=et.uniform),i.fog=e.fog,i.needsLights=function(t){return t.isMeshLambertMaterial||t.isMeshToonMaterial||t.isMeshPhongMaterial||t.isMeshStandardMaterial||t.isShadowMaterial||t.isShaderMaterial&&!0===t.lights}(t),i.lightsStateVersion=a,i.needsLights&&(f.ambientLightColor.value=r.state.ambient,f.lightProbe.value=r.state.probe,f.directionalLights.value=r.state.directional,f.spotLights.value=r.state.spot,f.rectAreaLights.value=r.state.rectArea,f.pointLights.value=r.state.point,f.hemisphereLights.value=r.state.hemi,f.directionalShadowMap.value=r.state.directionalShadowMap,f.directionalShadowMatrix.value=r.state.directionalShadowMatrix,f.spotShadowMap.value=r.state.spotShadowMap,f.spotShadowMatrix.value=r.state.spotShadowMatrix,f.pointShadowMap.value=r.state.pointShadowMap,f.pointShadowMatrix.value=r.state.pointShadowMatrix);var m=i.program.getUniforms(),v=Ca.seqWithValue(m.seq,f);i.uniformsList=v}function Mt(t,e,n,i){w.resetTextureUnits();var r=e.fog,o=n.isMeshStandardMaterial?e.environment:null,a=x.get(n),s=d.state.lights;if(nt&&(it||t!==U)){var c=t===U&&n.id===z;et.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,t,a,c)}n.version===a.__version?void 0===a.program||n.fog&&a.fog!==r||a.environment!==o||a.needsLights&&a.lightsStateVersion!==s.state.version?St(n,e,i):void 0===a.numClippingPlanes||a.numClippingPlanes===et.numPlanes&&a.numIntersection===et.numIntersection?a.outputEncoding!==O.outputEncoding&&St(n,e,i):St(n,e,i):(St(n,e,i),a.__version=n.version);var l,u,h=!1,f=!1,y=!1,b=a.program,_=b.getUniforms(),S=a.uniforms;if(v.useProgram(b.program)&&(h=!0,f=!0,y=!0),n.id!==z&&(z=n.id,f=!0),h||U!==t){if(b.numMultiviewViews>0?ht.updateCameraProjectionMatricesUniform(t,_):_.setValue(p,"projectionMatrix",t.projectionMatrix),m.logarithmicDepthBuffer&&_.setValue(p,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),U!==t&&(U=t,f=!0,y=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshStandardMaterial||n.envMap){var M=_.map.cameraPosition;void 0!==M&&M.setValue(p,at.setFromMatrixPosition(t.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&_.setValue(p,"isOrthographic",!0===t.isOrthographicCamera),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.skinning)&&(b.numMultiviewViews>0?ht.updateCameraViewMatricesUniform(t,_):_.setValue(p,"viewMatrix",t.matrixWorldInverse))}if(n.skinning){_.setOptional(p,i,"bindMatrix"),_.setOptional(p,i,"bindMatrixInverse");var A=i.skeleton;if(A){var E=A.bones;if(m.floatVertexTextures){if(void 0===A.boneTexture){var T=Math.sqrt(4*E.length);T=An.ceilPowerOfTwo(T),T=Math.max(T,4);var P=new Float32Array(T*T*4);P.set(A.boneMatrices);var L=new uo(P,T,T,Gt,Bt);A.boneMatrices=P,A.boneTexture=L,A.boneTextureSize=T}_.setValue(p,"boneTexture",A.boneTexture,w),_.setValue(p,"boneTextureSize",A.boneTextureSize)}else _.setOptional(p,A,"boneMatrices")}}return(f||a.receiveShadow!==i.receiveShadow)&&(a.receiveShadow=i.receiveShadow,_.setValue(p,"receiveShadow",i.receiveShadow)),f&&(_.setValue(p,"toneMappingExposure",O.toneMappingExposure),_.setValue(p,"toneMappingWhitePoint",O.toneMappingWhitePoint),a.needsLights&&(u=y,(l=S).ambientLightColor.needsUpdate=u,l.lightProbe.needsUpdate=u,l.directionalLights.needsUpdate=u,l.pointLights.needsUpdate=u,l.spotLights.needsUpdate=u,l.rectAreaLights.needsUpdate=u,l.hemisphereLights.needsUpdate=u),r&&n.fog&&function(t,e){t.fogColor.value.copy(e.color),e.isFog?(t.fogNear.value=e.near,t.fogFar.value=e.far):e.isFogExp2&&(t.fogDensity.value=e.density)}(S,r),n.isMeshBasicMaterial?At(S,n):n.isMeshLambertMaterial?(At(S,n),function(t,e){e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap)}(S,n)):n.isMeshToonMaterial?(At(S,n),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4),e.gradientMap&&(t.gradientMap.value=e.gradientMap);e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===g&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===g&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(S,n)):n.isMeshPhongMaterial?(At(S,n),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===g&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===g&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(S,n)):n.isMeshStandardMaterial?(At(S,n,o),n.isMeshPhysicalMaterial?function(t,e,n){Et(t,e,n),t.reflectivity.value=e.reflectivity,t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.sheen&&t.sheen.value.copy(e.sheen);e.clearcoatNormalMap&&(t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),t.clearcoatNormalMap.value=e.clearcoatNormalMap,e.side===g&&t.clearcoatNormalScale.value.negate());t.transparency.value=e.transparency}(S,n,o):Et(S,n,o)):n.isMeshMatcapMaterial?(At(S,n),function(t,e){e.matcap&&(t.matcap.value=e.matcap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===g&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===g&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(S,n)):n.isMeshDepthMaterial?(At(S,n),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(S,n)):n.isMeshDistanceMaterial?(At(S,n),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias);t.referencePosition.value.copy(e.referencePosition),t.nearDistance.value=e.nearDistance,t.farDistance.value=e.farDistance}(S,n)):n.isMeshNormalMaterial?(At(S,n),function(t,e){e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===g&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===g&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(S,n)):n.isLineBasicMaterial?(function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity}(S,n),n.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(S,n)):n.isPointsMaterial?function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*Y,t.scale.value=.5*X,e.map&&(t.map.value=e.map);e.alphaMap&&(t.alphaMap.value=e.alphaMap);var n;e.map?n=e.map:e.alphaMap&&(n=e.alphaMap);void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),t.uvTransform.value.copy(n.matrix))}(S,n):n.isSpriteMaterial?function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map);e.alphaMap&&(t.alphaMap.value=e.alphaMap);var n;e.map?n=e.map:e.alphaMap&&(n=e.alphaMap);void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),t.uvTransform.value.copy(n.matrix))}(S,n):n.isShadowMaterial&&(S.color.value.copy(n.color),S.opacity.value=n.opacity),void 0!==S.ltc_1&&(S.ltc_1.value=mo.LTC_1),void 0!==S.ltc_2&&(S.ltc_2.value=mo.LTC_2),Ca.upload(p,a.uniformsList,S,w),n.isShaderMaterial&&(n.uniformsNeedUpdate=!1)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(Ca.upload(p,a.uniformsList,S,w),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&_.setValue(p,"center",i.center),b.numMultiviewViews>0?ht.updateObjectMatricesUniforms(i,t,_):(_.setValue(p,"modelViewMatrix",i.modelViewMatrix),_.setValue(p,"normalMatrix",i.normalMatrix)),_.setValue(p,"modelMatrix",i.matrixWorld),b}function At(t,e,n){t.opacity.value=e.opacity,e.color&&t.diffuse.value.copy(e.color),e.emissive&&t.emissive.value.copy(e.emissive).multiplyScalar(e.emissiveIntensity),e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.specularMap&&(t.specularMap.value=e.specularMap);var i,r,o=e.envMap||n;o&&(t.envMap.value=o,t.flipEnvMap.value=o.isCubeTexture?-1:1,t.reflectivity.value=e.reflectivity,t.refractionRatio.value=e.refractionRatio,t.maxMipLevel.value=x.get(o).__maxMipLevel),e.lightMap&&(t.lightMap.value=e.lightMap,t.lightMapIntensity.value=e.lightMapIntensity),e.aoMap&&(t.aoMap.value=e.aoMap,t.aoMapIntensity.value=e.aoMapIntensity),e.map?i=e.map:e.specularMap?i=e.specularMap:e.displacementMap?i=e.displacementMap:e.normalMap?i=e.normalMap:e.bumpMap?i=e.bumpMap:e.roughnessMap?i=e.roughnessMap:e.metalnessMap?i=e.metalnessMap:e.alphaMap?i=e.alphaMap:e.emissiveMap&&(i=e.emissiveMap),void 0!==i&&(i.isWebGLRenderTarget&&(i=i.texture),!0===i.matrixAutoUpdate&&i.updateMatrix(),t.uvTransform.value.copy(i.matrix)),e.aoMap?r=e.aoMap:e.lightMap&&(r=e.lightMap),void 0!==r&&(r.isWebGLRenderTarget&&(r=r.texture),!0===r.matrixAutoUpdate&&r.updateMatrix(),t.uv2Transform.value.copy(r.matrix))}function Et(t,e,n){t.roughness.value=e.roughness,t.metalness.value=e.metalness,e.roughnessMap&&(t.roughnessMap.value=e.roughnessMap),e.metalnessMap&&(t.metalnessMap.value=e.metalnessMap),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===g&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===g&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),(e.envMap||n)&&(t.envMapIntensity.value=e.envMapIntensity)}xt.setAnimationLoop((function(t){ut.isPresenting||yt&&yt(t)})),"undefined"!=typeof window&&xt.setContext(window),this.setAnimationLoop=function(t){yt=t,ut.setAnimationLoop(t),xt.start()},this.render=function(t,e){var n,i;if(void 0!==arguments[2]&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),n=arguments[2]),void 0!==arguments[3]&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),i=arguments[3]),e&&e.isCamera){if(!F){V.geometry=null,V.program=null,V.wireframe=!1,z=-1,U=null,!0===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),ut.enabled&&ut.isPresenting&&(e=ut.getCamera(e)),(d=E.get(t,e)).init(),t.onBeforeRender(O,t,e,n||D),ot.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),tt.setFromProjectionMatrix(ot),it=this.localClippingEnabled,nt=et.init(this.clippingPlanes,it,e),(h=A.get(t,e)).init(),wt(t,e,0,O.sortObjects),!0===O.sortObjects&&h.sort(Q,K),nt&&et.beginShadows();var r=d.state.shadowsArray;dt.render(r,t,e),d.setupLights(e),nt&&et.endShadows(),this.info.autoReset&&this.info.reset(),void 0!==n&&this.setRenderTarget(n),ut.enabled&&ht.isAvailable()&&ht.attachCamera(e),T.render(h,t,e,i);var o=h.opaque,a=h.transparent;if(t.overrideMaterial){var s=t.overrideMaterial;o.length&&bt(o,t,e,s),a.length&&bt(a,t,e,s)}else o.length&&bt(o,t,e),a.length&&bt(a,t,e);t.onAfterRender(O,t,e),null!==D&&(w.updateRenderTargetMipmap(D),w.updateMultisampleRenderTarget(D)),v.buffers.depth.setTest(!0),v.buffers.depth.setMask(!0),v.buffers.color.setMask(!0),v.setPolygonOffset(!1),ut.enabled&&ht.isAvailable()&&ht.detachCamera(e),h=null,d=null}}else console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.setFramebuffer=function(t){I!==t&&null===D&&p.bindFramebuffer(36160,t),I=t},this.getActiveCubeFace=function(){return N},this.getActiveMipmapLevel=function(){return B},this.getRenderTarget=function(){return D},this.setRenderTarget=function(t,e,n){D=t,N=e,B=n,t&&void 0===x.get(t).__webglFramebuffer&&w.setupRenderTarget(t);var i=I,r=!1;if(t){var o=x.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(i=o[e||0],r=!0):i=t.isWebGLMultisampleRenderTarget?x.get(t).__webglMultisampledFramebuffer:o,H.copy(t.viewport),G.copy(t.scissor),W=t.scissorTest}else H.copy(Z).multiplyScalar(Y).floor(),G.copy(J).multiplyScalar(Y).floor(),W=$;if(k!==i&&(p.bindFramebuffer(36160,i),k=i),v.viewport(H),v.scissor(G),v.setScissorTest(W),r){var a=x.get(t.texture);p.framebufferTexture2D(36160,36064,34069+(e||0),a.__webglTexture,n||0)}},this.readRenderTargetPixels=function(t,e,n,i,r,o,a){if(t&&t.isWebGLRenderTarget){var s=x.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==a&&(s=s[a]),s){var c=!1;s!==k&&(p.bindFramebuffer(36160,s),c=!0);try{var l=t.texture,u=l.format,h=l.type;if(u!==Gt&&R.convert(u)!==p.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(h===Ct||R.convert(h)===p.getParameter(35738)||h===Bt&&(m.isWebGL2||f.get("OES_texture_float")||f.get("WEBGL_color_buffer_float"))||h===Dt&&(m.isWebGL2?f.get("EXT_color_buffer_float"):f.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===p.checkFramebufferStatus(36160)?e>=0&&e<=t.width-i&&n>=0&&n<=t.height-r&&p.readPixels(e,n,i,r,R.convert(u),R.convert(h),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{c&&p.bindFramebuffer(36160,k)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(t,e,n){void 0===n&&(n=0);var i=Math.pow(2,-n),r=Math.floor(e.image.width*i),o=Math.floor(e.image.height*i),a=R.convert(e.format);w.setTexture2D(e,0),p.copyTexImage2D(3553,n,a,t.x,t.y,r,o,0),v.unbindTexture()},this.copyTextureToTexture=function(t,e,n,i){var r=e.image.width,o=e.image.height,a=R.convert(n.format),s=R.convert(n.type);w.setTexture2D(n,0),e.isDataTexture?p.texSubImage2D(3553,i||0,t.x,t.y,r,o,a,s,e.image.data):p.texSubImage2D(3553,i||0,t.x,t.y,a,s,e.image),v.unbindTexture()},this.initTexture=function(t){w.setTexture2D(t,0),v.unbindTexture()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function ys(t,e){this.name="",this.color=new tr(t),this.density=void 0!==e?e:25e-5}function xs(t,e,n){this.name="",this.color=new tr(t),this.near=void 0!==e?e:1,this.far=void 0!==n?n:1e3}function ws(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=dn,this.updateRange={offset:0,count:-1},this.version=0}ds.prototype=Object.assign(Object.create(On.prototype),{constructor:ds,isWebGLMultiviewRenderTarget:!0,copy:function(t){return On.prototype.copy.call(this,t),this.numViews=t.numViews,this},setNumViews:function(t){return this.numViews!==t&&(this.numViews=t,this.dispose()),this}}),fs.prototype=Object.assign(Object.create(so.prototype),{constructor:fs,isArrayCamera:!0}),ms.prototype=Object.assign(Object.create(li.prototype),{constructor:ms,isGroup:!0}),Object.assign(vs.prototype,bn.prototype),Object.assign(ys.prototype,{isFogExp2:!0,clone:function(){return new ys(this.color,this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}),Object.assign(xs.prototype,{isFog:!0,clone:function(){return new xs(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}),Object.defineProperty(ws.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(ws.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this},copyAt:function(t,e,n){t*=this.stride,n*=e.stride;for(var i=0,r=this.stride;it.far||e.push({distance:s,point:As.clone(),uv:Ki.getUV(As,Rs,Os,Fs,Is,Ns,Bs,new En),face:null,object:this})}},clone:function(){return new this.constructor(this.material).copy(this)},copy:function(t){return li.prototype.copy.call(this,t),void 0!==t.center&&this.center.copy(t.center),this}});var zs=new Dn,Vs=new Dn;function Us(){li.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}function js(t,e){t&&t.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),qr.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Wn,this.bindMatrixInverse=new Wn}Us.prototype=Object.assign(Object.create(li.prototype),{constructor:Us,isLOD:!0,copy:function(t){li.prototype.copy.call(this,t,!1);for(var e=t.levels,n=0,i=e.length;n0){for(var n=1,i=e.length;n0){zs.setFromMatrixPosition(this.matrixWorld);var n=t.ray.origin.distanceTo(zs);this.getObjectForDistance(n).raycast(t,e)}},update:function(t){var e=this.levels;if(e.length>1){zs.setFromMatrixPosition(t.matrixWorld),Vs.setFromMatrixPosition(this.matrixWorld);var n=zs.distanceTo(Vs);e[0].object.visible=!0;for(var i=1,r=e.length;i=e[i].distance;i++)e[i-1].object.visible=!1,e[i].object.visible=!0;for(;i0&&(Qs[0].instanceId=r,Qs[0].object=this,e.push(Qs[0]),Qs.length=0)},setMatrixAt:function(t,e){e.toArray(this.instanceMatrix.array,16*t)},updateMorphTargets:function(){}}),Js.prototype=Object.create(ar.prototype),Js.prototype.constructor=Js,Js.prototype.isLineBasicMaterial=!0,Js.prototype.copy=function(t){return ar.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this};var $s=new Dn,tc=new Dn,ec=new Wn,nc=new Ni,ic=new Ti;function rc(t,e,n){1===n&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),li.call(this),this.type="Line",this.geometry=void 0!==t?t:new Pr,this.material=void 0!==e?e:new Js}rc.prototype=Object.assign(Object.create(li.prototype),{constructor:rc,isLine:!0,computeLineDistances:function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var e=t.attributes.position,n=[0],i=1,r=e.count;ia))u.applyMatrix4(this.matrixWorld),(b=t.ray.origin.distanceTo(u))t.far||e.push({distance:b,point:l.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}else for(m=0,v=p.length/3-1;ma))u.applyMatrix4(this.matrixWorld),(b=t.ray.origin.distanceTo(u))t.far||e.push({distance:b,point:l.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}}else if(i.isGeometry){var x=i.vertices,w=x.length;for(m=0;ma))u.applyMatrix4(this.matrixWorld),(b=t.ray.origin.distanceTo(u))t.far||e.push({distance:b,point:l.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var oc=new Dn,ac=new Dn;function sc(t,e){rc.call(this,t,e),this.type="LineSegments"}function cc(t,e){rc.call(this,t,e),this.type="LineLoop"}function lc(t){ar.call(this),this.type="PointsMaterial",this.color=new tr(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(t)}sc.prototype=Object.assign(Object.create(rc.prototype),{constructor:sc,isLineSegments:!0,computeLineDistances:function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var e=t.attributes.position,n=[],i=0,r=e.count;ir.far)return;o.push({distance:l,distanceToRay:Math.sqrt(s),point:c,index:e,face:null,object:a})}}function vc(t,e,n,i,r,o,a,s,c){Cn.call(this,t,e,n,i,r,o,a,s,c),this.format=void 0!==a?a:Ht,this.minFilter=void 0!==o?o:At,this.magFilter=void 0!==r?r:At,this.generateMipmaps=!1}function gc(t,e,n,i,r,o,a,s,c,l,u,h){Cn.call(this,null,o,a,s,c,l,i,r,u,h),this.image={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}function yc(t,e,n,i,r,o,a,s,c){Cn.call(this,t,e,n,i,r,o,a,s,c),this.needsUpdate=!0}function xc(t,e,n,i,r,o,a,s,c,l){if((l=void 0!==l?l:Yt)!==Yt&&l!==Qt)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&l===Yt&&(n=Ft),void 0===n&&l===Qt&&(n=Ut),Cn.call(this,null,i,r,o,a,s,l,n,c),this.image={width:t,height:e},this.magFilter=void 0!==a?a:wt,this.minFilter=void 0!==s?s:wt,this.flipY=!1,this.generateMipmaps=!1}function wc(t){Pr.call(this),this.type="WireframeGeometry";var e,n,i,r,o,a,s,c,l,u,h=[],d=[0,0],p={},f=["a","b","c"];if(t&&t.isGeometry){var m=t.faces;for(e=0,i=m.length;e=0?(t(g-l,v,d),p.subVectors(h,d)):(t(g+l,v,d),p.subVectors(d,h)),v-l>=0?(t(g,v-l,d),f.subVectors(h,d)):(t(g,v+l,d),f.subVectors(d,h)),u.crossVectors(p,f).normalize(),s.push(u.x,u.y,u.z),c.push(g,v)}}for(i=0;i.9&&a<.1&&(e<.2&&(o[t+0]+=1),n<.2&&(o[t+2]+=1),i<.2&&(o[t+4]+=1))}}()}(),this.setAttribute("position",new gr(r,3)),this.setAttribute("normal",new gr(r.slice(),3)),this.setAttribute("uv",new gr(o,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}function Ac(t,e){$r.call(this),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Ec(t,e)),this.mergeVertices()}function Ec(t,e){Mc.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],t,e),this.type="TetrahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Tc(t,e){$r.call(this),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Pc(t,e)),this.mergeVertices()}function Pc(t,e){Mc.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],t,e),this.type="OctahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Lc(t,e){$r.call(this),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Cc(t,e)),this.mergeVertices()}function Cc(t,e){var n=(1+Math.sqrt(5))/2,i=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1];Mc.call(this,i,[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],t,e),this.type="IcosahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Rc(t,e){$r.call(this),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Oc(t,e)),this.mergeVertices()}function Oc(t,e){var n=(1+Math.sqrt(5))/2,i=1/n,r=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,i];Mc.call(this,r,[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e),this.type="DodecahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Fc(t,e,n,i,r,o){$r.call(this),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:i,closed:r},void 0!==o&&console.warn("THREE.TubeGeometry: taper has been removed.");var a=new Ic(t,e,n,i,r);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals,this.fromBufferGeometry(a),this.mergeVertices()}function Ic(t,e,n,i,r){Pr.call(this),this.type="TubeBufferGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:i,closed:r},e=e||64,n=n||1,i=i||8,r=r||!1;var o=t.computeFrenetFrames(e,r);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;var a,s,c=new Dn,l=new Dn,u=new En,h=new Dn,d=[],p=[],f=[],m=[];function v(r){h=t.getPointAt(r/e,h);var a=o.normals[r],u=o.binormals[r];for(s=0;s<=i;s++){var f=s/i*Math.PI*2,m=Math.sin(f),v=-Math.cos(f);l.x=v*a.x+m*u.x,l.y=v*a.y+m*u.y,l.z=v*a.z+m*u.z,l.normalize(),p.push(l.x,l.y,l.z),c.x=h.x+n*l.x,c.y=h.y+n*l.y,c.z=h.z+n*l.z,d.push(c.x,c.y,c.z)}}!function(){for(a=0;a0){var a=r[o[0]];if(void 0!==a)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=a.length;t0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),vc.prototype=Object.assign(Object.create(Cn.prototype),{constructor:vc,isVideoTexture:!0,update:function(){var t=this.image;t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),gc.prototype=Object.create(Cn.prototype),gc.prototype.constructor=gc,gc.prototype.isCompressedTexture=!0,yc.prototype=Object.create(Cn.prototype),yc.prototype.constructor=yc,yc.prototype.isCanvasTexture=!0,xc.prototype=Object.create(Cn.prototype),xc.prototype.constructor=xc,xc.prototype.isDepthTexture=!0,wc.prototype=Object.create(Pr.prototype),wc.prototype.constructor=wc,bc.prototype=Object.create($r.prototype),bc.prototype.constructor=bc,_c.prototype=Object.create(Pr.prototype),_c.prototype.constructor=_c,Sc.prototype=Object.create($r.prototype),Sc.prototype.constructor=Sc,Mc.prototype=Object.create(Pr.prototype),Mc.prototype.constructor=Mc,Ac.prototype=Object.create($r.prototype),Ac.prototype.constructor=Ac,Ec.prototype=Object.create(Mc.prototype),Ec.prototype.constructor=Ec,Tc.prototype=Object.create($r.prototype),Tc.prototype.constructor=Tc,Pc.prototype=Object.create(Mc.prototype),Pc.prototype.constructor=Pc,Lc.prototype=Object.create($r.prototype),Lc.prototype.constructor=Lc,Cc.prototype=Object.create(Mc.prototype),Cc.prototype.constructor=Cc,Rc.prototype=Object.create($r.prototype),Rc.prototype.constructor=Rc,Oc.prototype=Object.create(Mc.prototype),Oc.prototype.constructor=Oc,Fc.prototype=Object.create($r.prototype),Fc.prototype.constructor=Fc,Ic.prototype=Object.create(Pr.prototype),Ic.prototype.constructor=Ic,Ic.prototype.toJSON=function(){var t=Pr.prototype.toJSON.call(this);return t.path=this.parameters.path.toJSON(),t},Nc.prototype=Object.create($r.prototype),Nc.prototype.constructor=Nc,Bc.prototype=Object.create(Pr.prototype),Bc.prototype.constructor=Bc,Dc.prototype=Object.create($r.prototype),Dc.prototype.constructor=Dc,kc.prototype=Object.create(Pr.prototype),kc.prototype.constructor=kc;var zc=function(t,e,n){n=n||2;var i,r,o,a,s,c,l,u=e&&e.length,h=u?e[0]*n:t.length,d=Vc(t,0,h,n,!0),p=[];if(!d||d.next===d.prev)return p;if(u&&(d=function(t,e,n,i){var r,o,a,s,c,l=[];for(r=0,o=e.length;r80*n){i=o=t[0],r=a=t[1];for(var f=n;fo&&(o=s),c>a&&(a=c);l=0!==(l=Math.max(o-i,a-r))?1/l:0}return jc(d,p,n,i,r,l),p};function Vc(t,e,n,i,r){var o,a;if(r===function(t,e,n,i){for(var r=0,o=e,a=n-i;o0)for(o=e;o=e;o-=i)a=rl(o,t[o],t[o+1],a);return a&&tl(a,a.next)&&(ol(a),a=a.next),a}function Uc(t,e){if(!t)return t;e||(e=t);var n,i=t;do{if(n=!1,i.steiner||!tl(i,i.next)&&0!==$c(i.prev,i,i.next))i=i.next;else{if(ol(i),(i=e=i.prev)===i.next)break;n=!0}}while(n||i!==e);return e}function jc(t,e,n,i,r,o,a){if(t){!a&&o&&function(t,e,n,i){var r=t;do{null===r.z&&(r.z=Qc(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,n,i,r,o,a,s,c,l=1;do{for(n=t,t=null,o=null,a=0;n;){for(a++,i=n,s=0,e=0;e0||c>0&&i;)0!==s&&(0===c||!i||n.z<=i.z)?(r=n,n=n.nextZ,s--):(r=i,i=i.nextZ,c--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;n=i}o.nextZ=null,l*=2}while(a>1)}(r)}(t,i,r,o);for(var s,c,l=t;t.prev!==t.next;)if(s=t.prev,c=t.next,o?Gc(t,i,r,o):Hc(t))e.push(s.i/n),e.push(t.i/n),e.push(c.i/n),ol(t),t=c.next,l=c.next;else if((t=c)===l){a?1===a?jc(t=Wc(t,e,n),e,n,i,r,o,2):2===a&&qc(t,e,n,i,r,o):jc(Uc(t),e,n,i,r,o,1);break}}}function Hc(t){var e=t.prev,n=t,i=t.next;if($c(e,n,i)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(Zc(e.x,e.y,n.x,n.y,i.x,i.y,r.x,r.y)&&$c(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function Gc(t,e,n,i){var r=t.prev,o=t,a=t.next;if($c(r,o,a)>=0)return!1;for(var s=r.xo.x?r.x>a.x?r.x:a.x:o.x>a.x?o.x:a.x,u=r.y>o.y?r.y>a.y?r.y:a.y:o.y>a.y?o.y:a.y,h=Qc(s,c,e,n,i),d=Qc(l,u,e,n,i),p=t.prevZ,f=t.nextZ;p&&p.z>=h&&f&&f.z<=d;){if(p!==t.prev&&p!==t.next&&Zc(r.x,r.y,o.x,o.y,a.x,a.y,p.x,p.y)&&$c(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==t.prev&&f!==t.next&&Zc(r.x,r.y,o.x,o.y,a.x,a.y,f.x,f.y)&&$c(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=h;){if(p!==t.prev&&p!==t.next&&Zc(r.x,r.y,o.x,o.y,a.x,a.y,p.x,p.y)&&$c(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&Zc(r.x,r.y,o.x,o.y,a.x,a.y,f.x,f.y)&&$c(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function Wc(t,e,n){var i=t;do{var r=i.prev,o=i.next.next;!tl(r,o)&&el(r,i,i.next,o)&&nl(r,o)&&nl(o,r)&&(e.push(r.i/n),e.push(i.i/n),e.push(o.i/n),ol(i),ol(i.next),i=t=o),i=i.next}while(i!==t);return i}function qc(t,e,n,i,r,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&Jc(a,s)){var c=il(a,s);return a=Uc(a,a.next),c=Uc(c,c.next),jc(a,e,n,i,r,o),void jc(c,e,n,i,r,o)}s=s.next}a=a.next}while(a!==t)}function Xc(t,e){return t.x-e.x}function Yc(t,e){if(e=function(t,e){var n,i=e,r=t.x,o=t.y,a=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var s=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=r&&s>a){if(a=s,s===r){if(o===i.y)return i;if(o===i.next.y)return i.next}n=i.x=i.x&&i.x>=u&&r!==i.x&&Zc(on.x)&&nl(i,t)&&(n=i,d=c),i=i.next;return n}(t,e)){var n=il(e,t);Uc(n,n.next)}}function Qc(t,e,n,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Kc(t){var e=t,n=t;do{(e.x=0&&(t-a)*(i-s)-(n-a)*(e-s)>=0&&(n-a)*(o-s)-(r-a)*(i-s)>=0}function Jc(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&el(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&nl(t,e)&&nl(e,t)&&function(t,e){var n=t,i=!1,r=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==t);return i}(t,e)}function $c(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function tl(t,e){return t.x===e.x&&t.y===e.y}function el(t,e,n,i){return!!(tl(t,n)&&tl(e,i)||tl(t,i)&&tl(n,e))||$c(t,e,n)>0!=$c(t,e,i)>0&&$c(n,i,t)>0!=$c(n,i,e)>0}function nl(t,e){return $c(t.prev,t,t.next)<0?$c(t,e,t.next)>=0&&$c(t,t.prev,e)>=0:$c(t,e,t.prev)<0||$c(t,t.next,e)<0}function il(t,e){var n=new al(t.i,t.x,t.y),i=new al(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function rl(t,e,n,i){var r=new al(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function ol(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function al(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var sl={area:function(t){for(var e=t.length,n=0,i=e-1,r=0;r2&&t[e-1].equals(t[0])&&t.pop()}function ll(t,e){for(var n=0;nNumber.EPSILON){var d=Math.sqrt(u),p=Math.sqrt(c*c+l*l),f=e.x-s/d,m=e.y+a/d,v=((n.x-l/p-f)*l-(n.y+c/p-m)*c)/(a*l-s*c),g=(i=f+a*v-t.x)*i+(r=m+s*v-t.y)*r;if(g<=2)return new En(i,r);o=Math.sqrt(g/2)}else{var y=!1;a>Number.EPSILON?c>Number.EPSILON&&(y=!0):a<-Number.EPSILON?c<-Number.EPSILON&&(y=!0):Math.sign(s)===Math.sign(l)&&(y=!0),y?(i=-s,r=a,o=Math.sqrt(u)):(i=a,r=s,o=Math.sqrt(u/2))}return new En(i/o,r/o)}for(var V=[],U=0,j=L.length,H=j-1,G=U+1;U=0;R--){for(F=R/p,I=u*Math.cos(F*Math.PI/2),O=h*Math.sin(F*Math.PI/2)+d,U=0,j=L.length;U=0;){n=U,(i=U-1)<0&&(i=t.length-1);var r=0,o=s+2*p;for(r=0;r0)&&f.push(_,S,A),(c!==n-1||l0&&g(!0),e>0&&g(!1)),this.setIndex(l),this.setAttribute("position",new gr(u,3)),this.setAttribute("normal",new gr(h,3)),this.setAttribute("uv",new gr(d,2))}function Pl(t,e,n,i,r,o,a){El.call(this,0,t,e,n,i,r,o,a),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:o,thetaLength:a}}function Ll(t,e,n,i,r,o,a){Tl.call(this,0,t,e,n,i,r,o,a),this.type="ConeBufferGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:o,thetaLength:a}}function Cl(t,e,n,i){$r.call(this),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:i},this.fromBufferGeometry(new Rl(t,e,n,i)),this.mergeVertices()}function Rl(t,e,n,i){Pr.call(this),this.type="CircleBufferGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:i},t=t||1,e=void 0!==e?Math.max(3,e):8,n=void 0!==n?n:0,i=void 0!==i?i:2*Math.PI;var r,o,a=[],s=[],c=[],l=[],u=new Dn,h=new En;for(s.push(0,0,0),c.push(0,0,1),l.push(.5,.5),o=0,r=3;o<=e;o++,r+=3){var d=n+o/e*i;u.x=t*Math.cos(d),u.y=t*Math.sin(d),s.push(u.x,u.y,u.z),c.push(0,0,1),h.x=(s[r]/t+1)/2,h.y=(s[r+1]/t+1)/2,l.push(h.x,h.y)}for(r=1;r<=e;r++)a.push(r,r+1,0);this.setIndex(a),this.setAttribute("position",new gr(s,3)),this.setAttribute("normal",new gr(c,3)),this.setAttribute("uv",new gr(l,2))}fl.prototype=Object.create($r.prototype),fl.prototype.constructor=fl,ml.prototype=Object.create(hl.prototype),ml.prototype.constructor=ml,vl.prototype=Object.create($r.prototype),vl.prototype.constructor=vl,gl.prototype=Object.create(Pr.prototype),gl.prototype.constructor=gl,yl.prototype=Object.create($r.prototype),yl.prototype.constructor=yl,xl.prototype=Object.create(Pr.prototype),xl.prototype.constructor=xl,wl.prototype=Object.create($r.prototype),wl.prototype.constructor=wl,bl.prototype=Object.create(Pr.prototype),bl.prototype.constructor=bl,_l.prototype=Object.create($r.prototype),_l.prototype.constructor=_l,_l.prototype.toJSON=function(){var t=$r.prototype.toJSON.call(this);return Ml(this.parameters.shapes,t)},Sl.prototype=Object.create(Pr.prototype),Sl.prototype.constructor=Sl,Sl.prototype.toJSON=function(){var t=Pr.prototype.toJSON.call(this);return Ml(this.parameters.shapes,t)},Al.prototype=Object.create(Pr.prototype),Al.prototype.constructor=Al,El.prototype=Object.create($r.prototype),El.prototype.constructor=El,Tl.prototype=Object.create(Pr.prototype),Tl.prototype.constructor=Tl,Pl.prototype=Object.create(El.prototype),Pl.prototype.constructor=Pl,Ll.prototype=Object.create(Tl.prototype),Ll.prototype.constructor=Ll,Cl.prototype=Object.create($r.prototype),Cl.prototype.constructor=Cl,Rl.prototype=Object.create(Pr.prototype),Rl.prototype.constructor=Rl;var Ol=Object.freeze({__proto__:null,WireframeGeometry:wc,ParametricGeometry:bc,ParametricBufferGeometry:_c,TetrahedronGeometry:Ac,TetrahedronBufferGeometry:Ec,OctahedronGeometry:Tc,OctahedronBufferGeometry:Pc,IcosahedronGeometry:Lc,IcosahedronBufferGeometry:Cc,DodecahedronGeometry:Rc,DodecahedronBufferGeometry:Oc,PolyhedronGeometry:Sc,PolyhedronBufferGeometry:Mc,TubeGeometry:Fc,TubeBufferGeometry:Ic,TorusKnotGeometry:Nc,TorusKnotBufferGeometry:Bc,TorusGeometry:Dc,TorusBufferGeometry:kc,TextGeometry:fl,TextBufferGeometry:ml,SphereGeometry:vl,SphereBufferGeometry:gl,RingGeometry:yl,RingBufferGeometry:xl,PlaneGeometry:yo,PlaneBufferGeometry:xo,LatheGeometry:wl,LatheBufferGeometry:bl,ShapeGeometry:_l,ShapeBufferGeometry:Sl,ExtrudeGeometry:ul,ExtrudeBufferGeometry:hl,EdgesGeometry:Al,ConeGeometry:Pl,ConeBufferGeometry:Ll,CylinderGeometry:El,CylinderBufferGeometry:Tl,CircleGeometry:Cl,CircleBufferGeometry:Rl,BoxGeometry:to,BoxBufferGeometry:eo});function Fl(t){ar.call(this),this.type="ShadowMaterial",this.color=new tr(0),this.transparent=!0,this.setValues(t)}function Il(t){oo.call(this,t),this.type="RawShaderMaterial"}function Nl(t){ar.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new tr(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new tr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Xe,this.normalScale=new En(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Bl(t){Nl.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearcoat=0,this.clearcoatRoughness=0,this.sheen=null,this.clearcoatNormalScale=new En(1,1),this.clearcoatNormalMap=null,this.transparency=0,this.setValues(t)}function Dl(t){ar.call(this),this.type="MeshPhongMaterial",this.color=new tr(16777215),this.specular=new tr(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new tr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Xe,this.normalScale=new En(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=tt,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function kl(t){ar.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new tr(16777215),this.specular=new tr(1118481),this.shininess=30,this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new tr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Xe,this.normalScale=new En(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function zl(t){ar.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Xe,this.normalScale=new En(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Vl(t){ar.call(this),this.type="MeshLambertMaterial",this.color=new tr(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new tr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=tt,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Ul(t){ar.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new tr(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Xe,this.normalScale=new En(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function jl(t){Js.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}Fl.prototype=Object.create(ar.prototype),Fl.prototype.constructor=Fl,Fl.prototype.isShadowMaterial=!0,Fl.prototype.copy=function(t){return ar.prototype.copy.call(this,t),this.color.copy(t.color),this},Il.prototype=Object.create(oo.prototype),Il.prototype.constructor=Il,Il.prototype.isRawShaderMaterial=!0,Nl.prototype=Object.create(ar.prototype),Nl.prototype.constructor=Nl,Nl.prototype.isMeshStandardMaterial=!0,Nl.prototype.copy=function(t){return ar.prototype.copy.call(this,t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Bl.prototype=Object.create(Nl.prototype),Bl.prototype.constructor=Bl,Bl.prototype.isMeshPhysicalMaterial=!0,Bl.prototype.copy=function(t){return Nl.prototype.copy.call(this,t),this.defines={STANDARD:"",PHYSICAL:""},this.reflectivity=t.reflectivity,this.clearcoat=t.clearcoat,this.clearcoatRoughness=t.clearcoatRoughness,t.sheen?this.sheen=(this.sheen||new tr).copy(t.sheen):this.sheen=null,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.transparency=t.transparency,this},Dl.prototype=Object.create(ar.prototype),Dl.prototype.constructor=Dl,Dl.prototype.isMeshPhongMaterial=!0,Dl.prototype.copy=function(t){return ar.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},kl.prototype=Object.create(ar.prototype),kl.prototype.constructor=kl,kl.prototype.isMeshToonMaterial=!0,kl.prototype.copy=function(t){return ar.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},zl.prototype=Object.create(ar.prototype),zl.prototype.constructor=zl,zl.prototype.isMeshNormalMaterial=!0,zl.prototype.copy=function(t){return ar.prototype.copy.call(this,t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Vl.prototype=Object.create(ar.prototype),Vl.prototype.constructor=Vl,Vl.prototype.isMeshLambertMaterial=!0,Vl.prototype.copy=function(t){return ar.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Ul.prototype=Object.create(ar.prototype),Ul.prototype.constructor=Ul,Ul.prototype.isMeshMatcapMaterial=!0,Ul.prototype.copy=function(t){return ar.prototype.copy.call(this,t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},jl.prototype=Object.create(Js.prototype),jl.prototype.constructor=jl,jl.prototype.isLineDashedMaterial=!0,jl.prototype.copy=function(t){return Js.prototype.copy.call(this,t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this};var Hl=Object.freeze({__proto__:null,ShadowMaterial:Fl,SpriteMaterial:Ms,RawShaderMaterial:Il,ShaderMaterial:oo,PointsMaterial:lc,MeshPhysicalMaterial:Bl,MeshStandardMaterial:Nl,MeshPhongMaterial:Dl,MeshToonMaterial:kl,MeshNormalMaterial:zl,MeshLambertMaterial:Vl,MeshDepthMaterial:as,MeshDistanceMaterial:ss,MeshBasicMaterial:sr,MeshMatcapMaterial:Ul,LineDashedMaterial:jl,LineBasicMaterial:Js,Material:ar}),Gl={arraySlice:function(t,e,n){return Gl.isTypedArray(t)?new t.constructor(t.subarray(e,void 0!==n?n:t.length)):t.slice(e,n)},convertArray:function(t,e,n){return!t||!n&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(t){for(var e=t.length,n=new Array(e),i=0;i!==e;++i)n[i]=i;return n.sort((function(e,n){return t[e]-t[n]})),n},sortedArray:function(t,e,n){for(var i=t.length,r=new t.constructor(i),o=0,a=0;a!==i;++o)for(var s=n[o]*e,c=0;c!==e;++c)r[a++]=t[s+c];return r},flattenJSON:function(t,e,n,i){for(var r=1,o=t[0];void 0!==o&&void 0===o[i];)o=t[r++];if(void 0!==o){var a=o[i];if(void 0!==a)if(Array.isArray(a))do{void 0!==(a=o[i])&&(e.push(o.time),n.push.apply(n,a)),o=t[r++]}while(void 0!==o);else if(void 0!==a.toArray)do{void 0!==(a=o[i])&&(e.push(o.time),a.toArray(n,n.length)),o=t[r++]}while(void 0!==o);else do{void 0!==(a=o[i])&&(e.push(o.time),n.push(a)),o=t[r++]}while(void 0!==o)}},subclip:function(t,e,n,i,r){r=r||30;var o=t.clone();o.name=e;for(var a=[],s=0;s=i)){u.push(c.times[d]);for(var f=0;fo.tracks[s].times[0]&&(m=o.tracks[s].times[0]);for(s=0;s=r)break t;var s=e[1];t=(r=e[--n-1]))break e}o=n,n=0}for(;n>>1;te;)--o;if(++o,0!==r||o!==i){r>=o&&(r=(o=Math.max(o,1))-1);var a=this.getValueSize();this.times=Gl.arraySlice(n,r,o),this.values=Gl.arraySlice(this.values,r*a,o*a)}return this},validate:function(){var t=!0,e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);var n=this.times,i=this.values,r=n.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);for(var o=null,a=0;a!==r;a++){var s=n[a];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,s),t=!1;break}if(null!==o&&o>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,s,o),t=!1;break}o=s}if(void 0!==i&&Gl.isTypedArray(i)){a=0;for(var c=i.length;a!==c;++a){var l=i[a];if(isNaN(l)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,l),t=!1;break}}}return t},optimize:function(){for(var t=Gl.arraySlice(this.times),e=Gl.arraySlice(this.values),n=this.getValueSize(),i=this.getInterpolation()===Ce,r=1,o=t.length-1,a=1;a0){t[r]=t[o];for(f=o*n,m=r*n,d=0;d!==n;++d)e[m+d]=e[f+d];++r}return r!==t.length?(this.times=Gl.arraySlice(t,0,r),this.values=Gl.arraySlice(e,0,r*n)):(this.times=t,this.values=e),this},clone:function(){var t=Gl.arraySlice(this.times,0),e=Gl.arraySlice(this.values,0),n=new(0,this.constructor)(this.name,t,e);return n.createInterpolant=this.createInterpolant,n}}),Kl.prototype=Object.assign(Object.create(Ql.prototype),{constructor:Kl,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:Pe,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Zl.prototype=Object.assign(Object.create(Ql.prototype),{constructor:Zl,ValueTypeName:"color"}),Jl.prototype=Object.assign(Object.create(Ql.prototype),{constructor:Jl,ValueTypeName:"number"}),$l.prototype=Object.assign(Object.create(Wl.prototype),{constructor:$l,interpolate_:function(t,e,n,i){for(var r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,c=(n-e)/(i-e),l=s+a;s!==l;s+=4)In.slerpFlat(r,0,o,s-a,o,s,c);return r}}),tu.prototype=Object.assign(Object.create(Ql.prototype),{constructor:tu,ValueTypeName:"quaternion",DefaultInterpolation:Le,InterpolantFactoryMethodLinear:function(t){return new $l(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),eu.prototype=Object.assign(Object.create(Ql.prototype),{constructor:eu,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:Pe,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),nu.prototype=Object.assign(Object.create(Ql.prototype),{constructor:nu,ValueTypeName:"vector"}),Object.assign(iu,{parse:function(t){for(var e=[],n=t.tracks,i=1/(t.fps||1),r=0,o=n.length;r!==o;++r)e.push(ru(n[r]).scale(i));return new iu(t.name,t.duration,e)},toJSON:function(t){for(var e=[],n=t.tracks,i={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid},r=0,o=n.length;r!==o;++r)e.push(Ql.toJSON(n[r]));return i},CreateFromMorphTargetSequence:function(t,e,n,i){for(var r=e.length,o=[],a=0;a1){var l=i[h=c[1]];l||(i[h]=l=[]),l.push(s)}}var u=[];for(var h in i)u.push(iu.CreateFromMorphTargetSequence(h,i[h],e,n));return u},parseAnimation:function(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(t,e,n,i,r){if(0!==n.length){var o=[],a=[];Gl.flattenJSON(n,o,a,i),0!==o.length&&r.push(new t(e,o,a))}},i=[],r=t.name||"default",o=t.length||-1,a=t.fps||30,s=t.hierarchy||[],c=0;c0||0===t.search(/^data\:image\/jpeg/);r.format=i?Ht:Gt,r.needsUpdate=!0,void 0!==e&&e(r)}),n,i),r}}),Object.assign(gu.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(t,e){var n=this.getUtoTmapping(t);return this.getPoint(n,e)},getPoints:function(t){void 0===t&&(t=5);for(var e=[],n=0;n<=t;n++)e.push(this.getPoint(n/t));return e},getSpacedPoints:function(t){void 0===t&&(t=5);for(var e=[],n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,n,i=[],r=this.getPoint(0),o=0;for(i.push(0),n=1;n<=t;n++)o+=(e=this.getPoint(n/t)).distanceTo(r),i.push(o),r=e;return this.cacheArcLengths=i,i},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){var n,i=this.getLengths(),r=0,o=i.length;n=e||t*i[o-1];for(var a,s=0,c=o-1;s<=c;)if((a=i[r=Math.floor(s+(c-s)/2)]-n)<0)s=r+1;else{if(!(a>0)){c=r;break}c=r-1}if(i[r=c]===n)return r/(o-1);var l=i[r];return(r+(n-l)/(i[r+1]-l))/(o-1)},getTangent:function(t){var e=t-1e-4,n=t+1e-4;e<0&&(e=0),n>1&&(n=1);var i=this.getPoint(e);return this.getPoint(n).clone().sub(i).normalize()},getTangentAt:function(t){var e=this.getUtoTmapping(t);return this.getTangent(e)},computeFrenetFrames:function(t,e){var n,i,r,o=new Dn,a=[],s=[],c=[],l=new Dn,u=new Wn;for(n=0;n<=t;n++)i=n/t,a[n]=this.getTangentAt(i),a[n].normalize();s[0]=new Dn,c[0]=new Dn;var h=Number.MAX_VALUE,d=Math.abs(a[0].x),p=Math.abs(a[0].y),f=Math.abs(a[0].z);for(d<=h&&(h=d,o.set(1,0,0)),p<=h&&(h=p,o.set(0,1,0)),f<=h&&o.set(0,0,1),l.crossVectors(a[0],o).normalize(),s[0].crossVectors(a[0],l),c[0].crossVectors(a[0],s[0]),n=1;n<=t;n++)s[n]=s[n-1].clone(),c[n]=c[n-1].clone(),l.crossVectors(a[n-1],a[n]),l.length()>Number.EPSILON&&(l.normalize(),r=Math.acos(An.clamp(a[n-1].dot(a[n]),-1,1)),s[n].applyMatrix4(u.makeRotationAxis(l,r))),c[n].crossVectors(a[n],s[n]);if(!0===e)for(r=Math.acos(An.clamp(s[0].dot(s[t]),-1,1)),r/=t,a[0].dot(l.crossVectors(s[0],s[t]))>0&&(r=-r),n=1;n<=t;n++)s[n].applyMatrix4(u.makeRotationAxis(a[n],r*n)),c[n].crossVectors(a[n],s[n]);return{tangents:a,normals:s,binormals:c}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this},toJSON:function(){var t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t},fromJSON:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}),yu.prototype=Object.create(gu.prototype),yu.prototype.constructor=yu,yu.prototype.isEllipseCurve=!0,yu.prototype.getPoint=function(t,e){for(var n=e||new En,i=2*Math.PI,r=this.aEndAngle-this.aStartAngle,o=Math.abs(r)i;)r-=i;r0?0:(Math.floor(Math.abs(u)/c)+1)*c:0===h&&u===c-1&&(u=c-2,h=1),this.closed||u>0?n=s[(u-1)%c]:(bu.subVectors(s[0],s[1]).add(s[0]),n=bu),i=s[u%c],r=s[(u+1)%c],this.closed||u+2i.length-2?i.length-1:o+1],u=i[o>i.length-3?i.length-1:o+2];return n.set(Eu(a,s.x,c.x,l.x,u.x),Eu(a,s.y,c.y,l.y,u.y)),n},Nu.prototype.copy=function(t){gu.prototype.copy.call(this,t),this.points=[];for(var e=0,n=t.points.length;e=e){var r=n[i]-e,o=this.curves[i],a=o.getLength(),s=0===a?0:1-r/a;return o.getPointAt(s)}i++}return null},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,n=0,i=this.curves.length;n1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(t){gu.prototype.copy.call(this,t),this.curves=[];for(var e=0,n=t.curves.length;e0){var l=c.getPoint(0);l.equals(this.currentPoint)||this.lineTo(l.x,l.y)}this.curves.push(c);var u=c.getPoint(1);return this.currentPoint.copy(u),this},copy:function(t){return Du.prototype.copy.call(this,t),this.currentPoint.copy(t.currentPoint),this},toJSON:function(){var t=Du.prototype.toJSON.call(this);return t.currentPoint=this.currentPoint.toArray(),t},fromJSON:function(t){return Du.prototype.fromJSON.call(this,t),this.currentPoint.fromArray(t.currentPoint),this}}),zu.prototype=Object.assign(Object.create(ku.prototype),{constructor:zu,getPointsHoles:function(t){for(var e=[],n=0,i=this.holes.length;n0){var o=new fu(new au(e));o.setCrossOrigin(this.crossOrigin);for(var a=0,s=t.length;a0?new js(a,s):new qr(a,s);break;case"InstancedMesh":a=r(t.geometry),s=o(t.material);var c=t.count,l=t.instanceMatrix;(i=new Zs(a,s,c)).instanceMatrix=new lr(new Float32Array(l.array),16);break;case"LOD":i=new Us;break;case"Line":i=new rc(r(t.geometry),o(t.material),t.mode);break;case"LineLoop":i=new cc(r(t.geometry),o(t.material));break;case"LineSegments":i=new sc(r(t.geometry),o(t.material));break;case"PointCloud":case"Points":i=new fc(r(t.geometry),o(t.material));break;case"Sprite":i=new Ds(o(t.material));break;case"Group":i=new ms;break;default:i=new li}if(i.uuid=t.uuid,void 0!==t.name&&(i.name=t.name),void 0!==t.matrix?(i.matrix.fromArray(t.matrix),void 0!==t.matrixAutoUpdate&&(i.matrixAutoUpdate=t.matrixAutoUpdate),i.matrixAutoUpdate&&i.matrix.decompose(i.position,i.quaternion,i.scale)):(void 0!==t.position&&i.position.fromArray(t.position),void 0!==t.rotation&&i.rotation.fromArray(t.rotation),void 0!==t.quaternion&&i.quaternion.fromArray(t.quaternion),void 0!==t.scale&&i.scale.fromArray(t.scale)),void 0!==t.castShadow&&(i.castShadow=t.castShadow),void 0!==t.receiveShadow&&(i.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.bias&&(i.shadow.bias=t.shadow.bias),void 0!==t.shadow.radius&&(i.shadow.radius=t.shadow.radius),void 0!==t.shadow.mapSize&&i.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(i.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(i.visible=t.visible),void 0!==t.frustumCulled&&(i.frustumCulled=t.frustumCulled),void 0!==t.renderOrder&&(i.renderOrder=t.renderOrder),void 0!==t.userData&&(i.userData=t.userData),void 0!==t.layers&&(i.layers.mask=t.layers),void 0!==t.children)for(var u=t.children,h=0;hNumber.EPSILON){if(l<0&&(a=e[o],c=-c,s=e[r],l=-l),t.ys.y)continue;if(t.y===a.y){if(t.x===a.x)return!0}else{var u=l*(t.x-a.x)-c*(t.y-a.y);if(0===u)return!0;if(u<0)continue;i=!i}}else{if(t.y!==a.y)continue;if(s.x<=t.x&&t.x<=a.x||a.x<=t.x&&t.x<=s.x)return!0}}return i}var r=sl.isClockWise,o=this.subPaths;if(0===o.length)return[];if(!0===e)return n(o);var a,s,c,l=[];if(1===o.length)return s=o[0],(c=new zu).curves=s.curves,l.push(c),l;var u=!r(o[0].getPoints());u=t?!u:u;var h,d,p=[],f=[],m=[],v=0;f[v]=void 0,m[v]=[];for(var g=0,y=o.length;g1){for(var x=!1,w=[],b=0,_=f.length;b<_;b++)p[b]=[];for(b=0,_=f.length;b<_;b++)for(var S=m[b],M=0;M0&&(x||(m=p))}g=0;for(var P=f.length;g0){this.source.connect(this.filters[0]);for(var t=1,e=this.filters.length;t0){this.source.disconnect(this.filters[0]);for(var t=1,e=this.filters.length;t=.5)for(var o=0;o!==r;++o)t[e+o]=t[n+o]},_slerp:function(t,e,n,i){In.slerpFlat(t,e,t,e,t,n,i)},_lerp:function(t,e,n,i,r){for(var o=1-i,a=0;a!==r;++a){var s=e+a;t[s]=t[s]*o+t[n+a]*i}}});var Dh=new RegExp("[\\[\\]\\.:\\/]","g"),kh="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",zh=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),Vh=/(WCOD+)?/.source.replace("WCOD",kh),Uh=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),jh=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Hh=new RegExp("^"+zh+Vh+Uh+jh+"$"),Gh=["material","materials","bones"];function Wh(t,e,n){var i=n||qh.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,i)}function qh(t,e,n){this.path=e,this.parsedPath=n||qh.parseTrackName(e),this.node=qh.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}function Xh(){this.uuid=An.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var t={};this._indicesByUUID=t;for(var e=0,n=arguments.length;e!==n;++e)t[arguments[e].uuid]=e;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var i=this;this.stats={objects:{get total(){return i._objects.length},get inUse(){return this.total-i.nCachedObjects_}},get bindingsPerObject(){return i._bindings.length}}}function Yh(t,e,n){this._mixer=t,this._clip=e,this._localRoot=n||null;for(var i=e.tracks,r=i.length,o=new Array(r),a={endingStart:Re,endingEnd:Re},s=0;s!==r;++s){var c=i[s].createInterpolant(null);o[s]=c,c.settings=a}this._interpolantSettings=a,this._interpolants=o,this._propertyBindings=new Array(r),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Ee,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function Qh(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function Kh(t){"string"==typeof t&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),t=arguments[1]),this.value=t}function Zh(t,e,n){ws.call(this,t,e),this.meshPerAttribute=n||1}function Jh(t,e,n,i){this.ray=new Ni(t,e),this.near=n||0,this.far=i||1/0,this.camera=null,this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function $h(t,e){return t.distance-e.distance}function td(t,e,n,i){if(!1!==t.visible&&(t.raycast(e,n),!0===i))for(var r=t.children,o=0,a=r.length;o=e){var u=e++,h=t[u];n[h.uuid]=l,t[l]=h,n[c]=u,t[u]=s;for(var d=0,p=r;d!==p;++d){var f=i[d],m=f[u],v=f[l];f[l]=m,f[u]=v}}}this.nCachedObjects_=e},uncache:function(){for(var t=this._objects,e=t.length,n=this.nCachedObjects_,i=this._indicesByUUID,r=this._bindings,o=r.length,a=0,s=arguments.length;a!==s;++a){var c=arguments[a],l=c.uuid,u=i[l];if(void 0!==u)if(delete i[l],u0)for(var c=this._interpolants,l=this._propertyBindings,u=0,h=c.length;u!==h;++u)c[u].evaluate(a),l[u].accumulate(i,s)}else this._updateWeight(t)},_updateWeight:function(t){var e=0;if(this.enabled){e=this.weight;var n=this._weightInterpolant;if(null!==n){var i=n.evaluate(t)[0];e*=i,t>n.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=e,e},_updateTimeScale:function(t){var e=0;if(!this.paused){e=this.timeScale;var n=this._timeScaleInterpolant;if(null!==n)e*=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}return this._effectiveTimeScale=e,e},_updateTime:function(t){var e=this.time+t,n=this._clip.duration,i=this.loop,r=this._loopCount,o=i===Te;if(0===t)return-1===r?e:o&&1==(1&r)?n-e:e;if(i===Ae){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(e>=n)e=n;else{if(!(e<0)){this.time=e;break t}e=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=e,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===r&&(t>=0?(r=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),e>=n||e<0){var a=Math.floor(e/n);e-=n*a,r+=Math.abs(a);var s=this.repetitions-r;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,e=t>0?n:0,this.time=e,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===s){var c=t<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=r,this.time=e,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=e;if(o&&1==(1&r))return n-e}return e},_setEndings:function(t,e,n){var i=this._interpolantSettings;n?(i.endingStart=Oe,i.endingEnd=Oe):(i.endingStart=t?this.zeroSlopeAtStart?Oe:Re:Fe,i.endingEnd=e?this.zeroSlopeAtEnd?Oe:Re:Fe)},_scheduleFading:function(t,e,n){var i=this._mixer,r=i.time,o=this._weightInterpolant;null===o&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);var a=o.parameterPositions,s=o.sampleValues;return a[0]=r,s[0]=e,a[1]=r+t,s[1]=n,this}}),Qh.prototype=Object.assign(Object.create(bn.prototype),{constructor:Qh,_bindAction:function(t,e){var n=t._localRoot||this._root,i=t._clip.tracks,r=i.length,o=t._propertyBindings,a=t._interpolants,s=n.uuid,c=this._bindingsByRootAndName,l=c[s];void 0===l&&(l={},c[s]=l);for(var u=0;u!==r;++u){var h=i[u],d=h.name,p=l[d];if(void 0!==p)o[u]=p;else{if(void 0!==(p=o[u])){null===p._cacheIndex&&(++p.referenceCount,this._addInactiveBinding(p,s,d));continue}var f=e&&e._propertyBindings[u].binding.parsedPath;++(p=new Bh(qh.create(n,d,f),h.ValueTypeName,h.getValueSize())).referenceCount,this._addInactiveBinding(p,s,d),o[u]=p}a[u].resultBuffer=p.buffer}},_activateAction:function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){var e=(t._localRoot||this._root).uuid,n=t._clip.uuid,i=this._actionsByClip[n];this._bindAction(t,i&&i.knownActions[0]),this._addInactiveAction(t,n,e)}for(var r=t._propertyBindings,o=0,a=r.length;o!==a;++o){var s=r[o];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){for(var e=t._propertyBindings,n=0,i=e.length;n!==i;++n){var r=e[n];0==--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(t)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}},_isActiveAction:function(t){var e=t._cacheIndex;return null!==e&&ethis.max.x||t.ythis.max.y)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y},getParameter:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .getParameter() target is now required"),e=new En),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(t){return!(t.max.xthis.max.x||t.max.ythis.max.y)},clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .clampPoint() target is now required"),e=new En),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){return id.copy(t).clamp(this.min,this.max).sub(t).length()},intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}});var od=new Dn,ad=new Dn;function sd(t,e){this.start=void 0!==t?t:new Dn,this.end=void 0!==e?e:new Dn}function cd(t){li.call(this),this.material=t,this.render=function(){}}Object.assign(sd.prototype,{set:function(t,e){return this.start.copy(t),this.end.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.start.copy(t.start),this.end.copy(t.end),this},getCenter:function(t){return void 0===t&&(console.warn("THREE.Line3: .getCenter() target is now required"),t=new Dn),t.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){return void 0===t&&(console.warn("THREE.Line3: .delta() target is now required"),t=new Dn),t.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,e){return void 0===e&&(console.warn("THREE.Line3: .at() target is now required"),e=new Dn),this.delta(e).multiplyScalar(t).add(this.start)},closestPointToPointParameter:function(t,e){od.subVectors(t,this.start),ad.subVectors(this.end,this.start);var n=ad.dot(ad),i=ad.dot(od)/n;return e&&(i=An.clamp(i,0,1)),i},closestPointToPoint:function(t,e,n){var i=this.closestPointToPointParameter(t,e);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new Dn),this.delta(n).multiplyScalar(i).add(this.start)},applyMatrix4:function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},equals:function(t){return t.start.equals(this.start)&&t.end.equals(this.end)}}),cd.prototype=Object.create(li.prototype),cd.prototype.constructor=cd,cd.prototype.isImmediateRenderObject=!0;var ld=new Dn;function ud(t,e){li.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e;for(var n=new Pr,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],r=0,o=1;r<32;r++,o++){var a=r/32*Math.PI*2,s=o/32*Math.PI*2;i.push(Math.cos(a),Math.sin(a),1,Math.cos(s),Math.sin(s),1)}n.setAttribute("position",new gr(i,3));var c=new Js({fog:!1});this.cone=new sc(n,c),this.add(this.cone),this.update()}ud.prototype=Object.create(li.prototype),ud.prototype.constructor=ud,ud.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},ud.prototype.update=function(){this.light.updateMatrixWorld();var t=this.light.distance?this.light.distance:1e3,e=t*Math.tan(this.light.angle);this.cone.scale.set(e,e,t),ld.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(ld),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)};var hd=new Dn,dd=new Wn,pd=new Wn;function fd(t){for(var e=function t(e){var n=[];e&&e.isBone&&n.push(e);for(var i=0;i.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{Bd.set(t.z,0,-t.x).normalize();var e=Math.acos(t.y);this.quaternion.setFromAxisAngle(Bd,e)}},Dd.prototype.setLength=function(t,e,n){void 0===e&&(e=.2*t),void 0===n&&(n=.2*e),this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(n,e,n),this.cone.position.y=t,this.cone.updateMatrix()},Dd.prototype.setColor=function(t){this.line.material.color.set(t),this.cone.material.color.set(t)},Dd.prototype.copy=function(t){return li.prototype.copy.call(this,t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this},Dd.prototype.clone=function(){return(new this.constructor).copy(this)},kd.prototype=Object.create(sc.prototype),kd.prototype.constructor=kd;var zd,Vd,Ud,jd,Hd=Math.pow(2,8),Gd=[.125,.215,.35,.446,.526,.582],Wd=5+Gd.length,qd={[De]:0,[ke]:1,[Ve]:2,[je]:3,[He]:4,[Ge]:5,[ze]:6},Xd=new Xu,Yd=(zd=20,Vd=new Float32Array(zd),Ud=new Dn(0,1,0),(jd=new Il({defines:{n:zd},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:Vd},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:Ud},inputEncoding:{value:qd[De]},outputEncoding:{value:qd[De]}},vertexShader:gp(),fragmentShader:`\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform int samples;\nuniform float weights[n];\nuniform bool latitudinal;\nuniform float dTheta;\nuniform float mipInt;\nuniform vec3 poleAxis;\n\n${yp()}\n\n#define ENVMAP_TYPE_CUBE_UV\n#include \n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tfor (int i = 0; i < n; i++) {\n\t\tif (i >= samples)\n\t\t\tbreak;\n\t\tfor (int dir = -1; dir < 2; dir += 2) {\n\t\t\tif (i == 0 && dir == 1)\n\t\t\t\tcontinue;\n\t\t\tvec3 axis = latitudinal ? poleAxis : cross(poleAxis, vOutputDirection);\n\t\t\tif (all(equal(axis, vec3(0.0))))\n\t\t\t\taxis = cross(vec3(0.0, 1.0, 0.0), vOutputDirection);\n\t\t\taxis = normalize(axis);\n\t\t\tfloat theta = dTheta * float(dir * i);\n\t\t\tfloat cosTheta = cos(theta);\n\t\t\t// Rodrigues' axis-angle rotation\n\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross(axis, vOutputDirection) * sin(theta)\n\t\t\t\t\t+ axis * dot(axis, vOutputDirection) * (1.0 - cosTheta);\n\t\t\tgl_FragColor.rgb +=\n\t\t\t\t\tweights[i] * bilinearCubeUV(envMap, sampleDirection, mipInt);\n\t\t}\n\t}\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t`,blending:M,depthTest:!1,depthWrite:!1})).type="SphericalGaussianBlur",jd),Qd=null,Kd=null,{_lodPlanes:Zd,_sizeLods:Jd,_sigmas:$d}=function(){for(var t=[],e=[],n=[],i=8,r=0;r4?a=Gd[r-8+4-1]:0==r&&(a=0),n.push(a);for(var s=1/(o-1),c=-s/2,l=1+s/2,u=[c,c,l,c,l,l,c,c,l,l,c,l],h=new Float32Array(108),d=new Float32Array(72),p=new Float32Array(36),f=0;f<6;f++){var m=f%3*2/3-1,v=f>2?0:-1,g=[m,v,0,m+2/3,v,0,m+2/3,v+1,0,m,v,0,m+2/3,v+1,0,m,v+1,0];h.set(g,18*f),d.set(u,12*f);var y=[f,f,f,f,f,f];p.set(y,6*f)}var x=new Pr;x.setAttribute("position",new lr(h,3)),x.setAttribute("uv",new lr(d,2)),x.setAttribute("faceIndex",new lr(p,1)),t.push(x),i>4&&i--}return{_lodPlanes:t,_sizeLods:e,_sigmas:n}}(),tp=null,ep=null,np=null,ip=(1+Math.sqrt(5))/2,rp=1/ip,op=[new Dn(1,1,1),new Dn(-1,1,1),new Dn(1,1,-1),new Dn(-1,1,-1),new Dn(0,ip,rp),new Dn(0,ip,-rp),new Dn(rp,0,ip),new Dn(-rp,0,ip),new Dn(ip,rp,0),new Dn(-ip,rp,0)];function ap(t){ep=t,lp(Yd)}function sp(t){var e={magFilter:wt,minFilter:wt,generateMipmaps:!1,type:t?t.type:Ct,format:t?t.format:Xt,encoding:t?t.encoding:Ve,depthBuffer:!1,stencilBuffer:!1},n=up(e);return n.depthBuffer=!t,tp=up(e),n}function cp(t){tp.dispose(),ep.setRenderTarget(np),t.scissorTest=!1,t.setSize(t.width,t.height)}function lp(t){var e=new ui;e.add(new qr(Zd[0],t)),ep.compile(e,Xd)}function up(t){var e=new On(3*Hd,3*Hd,t);return e.texture.mapping=mt,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function hp(t,e,n,i,r){t.viewport.set(e,n,i,r),t.scissor.set(e,n,i,r)}function dp(t){var e=ep.autoClear;ep.autoClear=!1;for(var n=1;n20&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${d} samples when the maximum is set to 20`);for(var p=[],f=0,m=0;m<20;++m){var v=m/h,g=Math.exp(-v*v/2);p.push(g),0==m?f+=g:m4?i-8+4:0),3*y,2*y),ep.setRenderTarget(e),ep.render(s,Xd)}function mp(){var t=new Il({uniforms:{envMap:{value:null},texelSize:{value:new En(1,1)},inputEncoding:{value:qd[De]},outputEncoding:{value:qd[De]}},vertexShader:gp(),fragmentShader:`\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform vec2 texelSize;\n\n${yp()}\n\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tvec3 outputDirection = normalize(vOutputDirection);\n\tvec2 uv;\n\tuv.y = asin(clamp(outputDirection.y, -1.0, 1.0)) * RECIPROCAL_PI + 0.5;\n\tuv.x = atan(outputDirection.z, outputDirection.x) * RECIPROCAL_PI2 + 0.5;\n\tvec2 f = fract(uv / texelSize - 0.5);\n\tuv -= f * texelSize;\n\tvec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.x += texelSize.x;\n\tvec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.y += texelSize.y;\n\tvec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.x -= texelSize.x;\n\tvec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tvec3 tm = mix(tl, tr, f.x);\n\tvec3 bm = mix(bl, br, f.x);\n\tgl_FragColor.rgb = mix(tm, bm, f.y);\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t`,blending:M,depthTest:!1,depthWrite:!1});return t.type="EquirectangularToCubeUV",t}function vp(){var t=new Il({uniforms:{envMap:{value:null},inputEncoding:{value:qd[De]},outputEncoding:{value:qd[De]}},vertexShader:gp(),fragmentShader:`\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform samplerCube envMap;\n\n${yp()}\n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tgl_FragColor.rgb = envMapTexelToLinear(textureCube(envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ))).rgb;\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t`,blending:M,depthTest:!1,depthWrite:!1});return t.type="CubemapToCubeUV",t}function gp(){return"\nprecision mediump float;\nprecision mediump int;\nattribute vec3 position;\nattribute vec2 uv;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\nvec3 getDirection(vec2 uv, float face) {\n\tuv = 2.0 * uv - 1.0;\n\tvec3 direction = vec3(uv, 1.0);\n\tif (face == 0.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 1.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 3.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.x *= -1.0;\n\t} else if (face == 4.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.y *= -1.0;\n\t} else if (face == 5.0) {\n\t\tdirection.xz *= -1.0;\n\t}\n\treturn direction;\n}\nvoid main() {\n\tvOutputDirection = getDirection(uv, faceIndex);\n\tgl_Position = vec4( position, 1.0 );\n}\n\t"}function yp(){return"\nuniform int inputEncoding;\nuniform int outputEncoding;\n\n#include \n\nvec4 inputTexelToLinear(vec4 value){\n\tif(inputEncoding == 0){\n\t\treturn value;\n\t}else if(inputEncoding == 1){\n\t\treturn sRGBToLinear(value);\n\t}else if(inputEncoding == 2){\n\t\treturn RGBEToLinear(value);\n\t}else if(inputEncoding == 3){\n\t\treturn RGBMToLinear(value, 7.0);\n\t}else if(inputEncoding == 4){\n\t\treturn RGBMToLinear(value, 16.0);\n\t}else if(inputEncoding == 5){\n\t\treturn RGBDToLinear(value, 256.0);\n\t}else{\n\t\treturn GammaToLinear(value, 2.2);\n\t}\n}\n\nvec4 linearToOutputTexel(vec4 value){\n\tif(outputEncoding == 0){\n\t\treturn value;\n\t}else if(outputEncoding == 1){\n\t\treturn LinearTosRGB(value);\n\t}else if(outputEncoding == 2){\n\t\treturn LinearToRGBE(value);\n\t}else if(outputEncoding == 3){\n\t\treturn LinearToRGBM(value, 7.0);\n\t}else if(outputEncoding == 4){\n\t\treturn LinearToRGBM(value, 16.0);\n\t}else if(outputEncoding == 5){\n\t\treturn LinearToRGBD(value, 256.0);\n\t}else{\n\t\treturn LinearToGamma(value, 2.2);\n\t}\n}\n\nvec4 envMapTexelToLinear(vec4 color) {\n\treturn inputTexelToLinear(color);\n}\n\t"}function xp(t,e,n,i,r,o,a){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new rr(t,e,n,r,o,a)}ap.prototype={constructor:ap,fromScene:function(t,e=0,n=.1,i=100){np=ep.getRenderTarget();var r=sp();return function(t,e,n,i){var r=new so(90,1,e,n),o=[1,1,1,1,-1,1],a=[1,1,-1,-1,-1,1],s=ep.outputEncoding,c=ep.toneMapping,l=ep.toneMappingExposure,u=ep.getClearColor(),h=ep.getClearAlpha();ep.toneMapping=rt,ep.toneMappingExposure=1,ep.outputEncoding=De,t.scale.z*=-1;var d=t.background;if(d&&d.isColor){d.convertSRGBToLinear();var p=Math.max(d.r,d.g,d.b),f=Math.min(Math.max(Math.ceil(Math.log2(p)),-128),127);d=d.multiplyScalar(Math.pow(2,-f));var m=(f+128)/255;ep.setClearColor(d,m),t.background=null}for(var v=0;v<6;v++){var g=v%3;0==g?(r.up.set(0,o[v],0),r.lookAt(a[v],0,0)):1==g?(r.up.set(0,0,o[v]),r.lookAt(0,a[v],0)):(r.up.set(0,o[v],0),r.lookAt(0,0,a[v])),hp(i,g*Hd,v>2?Hd:0,Hd,Hd),ep.setRenderTarget(i),ep.render(t,r)}ep.toneMapping=c,ep.toneMappingExposure=l,ep.outputEncoding=s,ep.setClearColor(u,h),t.scale.z*=-1}(t,n,i,r),e>0&&pp(r,0,0,e),dp(r),cp(r),r},fromEquirectangular:function(t){return t.magFilter=wt,t.minFilter=wt,t.generateMipmaps=!1,this.fromCubemap(t)},fromCubemap:function(t){np=ep.getRenderTarget();var e=sp(t);return function(t,e){var n=new ui;t.isCubeTexture?null==Kd&&(Kd=vp()):null==Qd&&(Qd=mp());var i=t.isCubeTexture?Kd:Qd;n.add(new qr(Zd[0],i));var r=i.uniforms;r.envMap.value=t,t.isCubeTexture||r.texelSize.value.set(1/t.image.width,1/t.image.height);r.inputEncoding.value=qd[t.encoding],r.outputEncoding.value=qd[t.encoding],hp(e,0,0,3*Hd,2*Hd),ep.setRenderTarget(e),ep.render(n,Xd)}(t,e),dp(e),cp(e),e},compileCubemapShader:function(){null==Kd&&lp(Kd=vp())},compileEquirectangularShader:function(){null==Qd&&lp(Qd=mp())},dispose:function(){Yd.dispose(),null!=Kd&&Kd.dispose(),null!=Qd&&Qd.dispose();for(var t=0;t (http://steffe.se)",keywords:["cannon.js","cannon","physics","engine","3d"],main:"./src/Cannon.js",engines:{node:"*"},repository:{type:"git",url:"https://github.com/schteppe/cannon.js.git"},bugs:{url:"https://github.com/schteppe/cannon.js/issues"},licenses:[{type:"MIT"}],devDependencies:{browserify:"*",grunt:"^0.4.5","grunt-browserify":"^2.1.4","grunt-contrib-concat":"~0.1.3","grunt-contrib-jshint":"~0.1.1","grunt-contrib-nodeunit":"^0.4.1","grunt-contrib-uglify":"^0.5.1","grunt-contrib-yuidoc":"^0.5.2",jshint:"latest",nodeunit:"^0.9.0","uglify-js":"latest"},dependencies:{typescript:"^3.7.4"}}},{}],2:[function(t,e,n){e.exports={version:t("../package.json").version,AABB:t("./collision/AABB"),ArrayCollisionMatrix:t("./collision/ArrayCollisionMatrix"),Body:t("./objects/Body"),Box:t("./shapes/Box"),Broadphase:t("./collision/Broadphase"),Constraint:t("./constraints/Constraint"),ContactEquation:t("./equations/ContactEquation"),Narrowphase:t("./world/Narrowphase"),ConeTwistConstraint:t("./constraints/ConeTwistConstraint"),ContactMaterial:t("./material/ContactMaterial"),ConvexPolyhedron:t("./shapes/ConvexPolyhedron"),Cylinder:t("./shapes/Cylinder"),DistanceConstraint:t("./constraints/DistanceConstraint"),Equation:t("./equations/Equation"),EventTarget:t("./utils/EventTarget"),FrictionEquation:t("./equations/FrictionEquation"),GSSolver:t("./solver/GSSolver"),GridBroadphase:t("./collision/GridBroadphase"),Heightfield:t("./shapes/Heightfield"),HingeConstraint:t("./constraints/HingeConstraint"),LockConstraint:t("./constraints/LockConstraint"),Mat3:t("./math/Mat3"),Material:t("./material/Material"),NaiveBroadphase:t("./collision/NaiveBroadphase"),ObjectCollisionMatrix:t("./collision/ObjectCollisionMatrix"),Pool:t("./utils/Pool"),Particle:t("./shapes/Particle"),Plane:t("./shapes/Plane"),PointToPointConstraint:t("./constraints/PointToPointConstraint"),Quaternion:t("./math/Quaternion"),Ray:t("./collision/Ray"),RaycastVehicle:t("./objects/RaycastVehicle"),RaycastResult:t("./collision/RaycastResult"),RigidVehicle:t("./objects/RigidVehicle"),RotationalEquation:t("./equations/RotationalEquation"),RotationalMotorEquation:t("./equations/RotationalMotorEquation"),SAPBroadphase:t("./collision/SAPBroadphase"),SPHSystem:t("./objects/SPHSystem"),Shape:t("./shapes/Shape"),Solver:t("./solver/Solver"),Sphere:t("./shapes/Sphere"),SplitSolver:t("./solver/SplitSolver"),Spring:t("./objects/Spring"),Transform:t("./math/Transform"),Trimesh:t("./shapes/Trimesh"),Vec3:t("./math/Vec3"),Vec3Pool:t("./utils/Vec3Pool"),World:t("./world/World")}},{"../package.json":1,"./collision/AABB":3,"./collision/ArrayCollisionMatrix":4,"./collision/Broadphase":5,"./collision/GridBroadphase":6,"./collision/NaiveBroadphase":7,"./collision/ObjectCollisionMatrix":8,"./collision/Ray":10,"./collision/RaycastResult":11,"./collision/SAPBroadphase":12,"./constraints/ConeTwistConstraint":13,"./constraints/Constraint":14,"./constraints/DistanceConstraint":15,"./constraints/HingeConstraint":16,"./constraints/LockConstraint":17,"./constraints/PointToPointConstraint":18,"./equations/ContactEquation":20,"./equations/Equation":21,"./equations/FrictionEquation":22,"./equations/RotationalEquation":23,"./equations/RotationalMotorEquation":24,"./material/ContactMaterial":25,"./material/Material":26,"./math/Mat3":28,"./math/Quaternion":29,"./math/Transform":30,"./math/Vec3":31,"./objects/Body":32,"./objects/RaycastVehicle":33,"./objects/RigidVehicle":34,"./objects/SPHSystem":35,"./objects/Spring":36,"./shapes/Box":38,"./shapes/ConvexPolyhedron":39,"./shapes/Cylinder":40,"./shapes/Heightfield":41,"./shapes/Particle":42,"./shapes/Plane":43,"./shapes/Shape":44,"./shapes/Sphere":45,"./shapes/Trimesh":46,"./solver/GSSolver":47,"./solver/Solver":48,"./solver/SplitSolver":49,"./utils/EventTarget":50,"./utils/Pool":52,"./utils/Vec3Pool":55,"./world/Narrowphase":56,"./world/World":57}],3:[function(t,e,n){var i=t("../math/Vec3");function r(t){t=t||{},this.lowerBound=new i,t.lowerBound&&this.lowerBound.copy(t.lowerBound),this.upperBound=new i,t.upperBound&&this.upperBound.copy(t.upperBound)}t("../utils/Utils"),e.exports=r;var o=new i;r.prototype.setFromPoints=function(t,e,n,i){var r=this.lowerBound,a=this.upperBound,s=n;r.copy(t[0]),s&&s.vmult(r,r),a.copy(r);for(var c=1;ca.x&&(a.x=l.x),l.xa.y&&(a.y=l.y),l.ya.z&&(a.z=l.z),l.z=r.x&&e.y<=i.y&&n.y>=r.y&&e.z<=i.z&&n.z>=r.z},r.prototype.getCorners=function(t,e,n,i,r,o,a,s){var c=this.lowerBound,l=this.upperBound;t.copy(c),e.set(l.x,c.y,c.z),n.set(l.x,l.y,c.z),i.set(c.x,l.y,l.z),r.set(l.x,c.y,l.z),o.set(c.x,l.y,c.z),a.set(c.x,c.y,l.z),s.copy(l)};var a=[new i,new i,new i,new i,new i,new i,new i,new i];r.prototype.toLocalFrame=function(t,e){var n=a,i=n[0],r=n[1],o=n[2],s=n[3],c=n[4],l=n[5],u=n[6],h=n[7];this.getCorners(i,r,o,s,c,l,u,h);for(var d=0;8!==d;d++){var p=n[d];t.pointToLocal(p,p)}return e.setFromPoints(n)},r.prototype.toWorldFrame=function(t,e){var n=a,i=n[0],r=n[1],o=n[2],s=n[3],c=n[4],l=n[5],u=n[6],h=n[7];this.getCorners(i,r,o,s,c,l,u,h);for(var d=0;8!==d;d++){var p=n[d];t.pointToWorld(p,p)}return e.setFromPoints(n)},r.prototype.overlapsRay=function(t){var e=1/t._direction.x,n=1/t._direction.y,i=1/t._direction.z,r=(this.lowerBound.x-t.from.x)*e,o=(this.upperBound.x-t.from.x)*e,a=(this.lowerBound.y-t.from.y)*n,s=(this.upperBound.y-t.from.y)*n,c=(this.lowerBound.z-t.from.z)*i,l=(this.upperBound.z-t.from.z)*i,u=Math.max(Math.max(Math.min(r,o),Math.min(a,s)),Math.min(c,l)),h=Math.min(Math.min(Math.max(r,o),Math.max(a,s)),Math.max(c,l));return!(h<0||u>h)}},{"../math/Vec3":31,"../utils/Utils":54}],4:[function(t,e,n){function i(){this.matrix=[]}e.exports=i,i.prototype.get=function(t,e){if(t=t.index,(e=e.index)>t){var n=e;e=t,t=n}return this.matrix[(t*(t+1)>>1)+e-1]},i.prototype.set=function(t,e,n){if(t=t.index,(e=e.index)>t){var i=e;e=t,t=i}this.matrix[(t*(t+1)>>1)+e-1]=n?1:0},i.prototype.reset=function(){for(var t=0,e=this.matrix.length;t!==e;t++)this.matrix[t]=0},i.prototype.setNumObjects=function(t){this.matrix.length=t*(t-1)>>1}},{}],5:[function(t,e,n){var i=t("../objects/Body"),r=t("../math/Vec3"),o=t("../math/Quaternion");function a(){this.world=null,this.useBoundingBoxes=!1,this.dirty=!0}t("../shapes/Shape"),t("../shapes/Plane"),e.exports=a,a.prototype.collisionPairs=function(t,e,n){throw new Error("collisionPairs not implemented for this BroadPhase class!")},a.prototype.needBroadphaseCollision=function(t,e){return 0!=(t.collisionFilterGroup&e.collisionFilterMask)&&0!=(e.collisionFilterGroup&t.collisionFilterMask)&&(0==(t.type&i.STATIC)&&t.sleepState!==i.SLEEPING||0==(e.type&i.STATIC)&&e.sleepState!==i.SLEEPING)},a.prototype.intersectionTest=function(t,e,n,i){this.useBoundingBoxes?this.doBoundingBoxBroadphase(t,e,n,i):this.doBoundingSphereBroadphase(t,e,n,i)};var s=new r;new r,new o,new r,a.prototype.doBoundingSphereBroadphase=function(t,e,n,i){var r=s;e.position.vsub(t.position,r);var o=Math.pow(t.boundingRadius+e.boundingRadius,2);r.norm2()n.norm2()},a.prototype.aabbQuery=function(t,e,n){return console.warn(".aabbQuery is not implemented in this Broadphase subclass."),[]}},{"../math/Quaternion":29,"../math/Vec3":31,"../objects/Body":32,"../shapes/Plane":43,"../shapes/Shape":44}],6:[function(t,e,n){e.exports=a;var i=t("./Broadphase"),r=t("../math/Vec3"),o=t("../shapes/Shape");function a(t,e,n,o,a){i.apply(this),this.nx=n||10,this.ny=o||10,this.nz=a||10,this.aabbMin=t||new r(100,100,100),this.aabbMax=e||new r(-100,-100,-100);var s=this.nx*this.ny*this.nz;if(s<=0)throw"GridBroadphase: Each dimension's n must be >0";this.bins=[],this.binLengths=[],this.bins.length=s,this.binLengths.length=s;for(var c=0;c=l&&(s=l-1),c<0?c=0:c>=u&&(c=u-1),f<0?f=0:f>=h&&(f=h-1),m<0?m=0:m>=l&&(m=l-1),v<0?v=0:v>=u&&(v=u-1),S<0?S=0:S>=h&&(S=h-1),c*=p,f*=1,m*=d,v*=p,S*=1;for(var M=s*=d;M<=m;M+=d)for(var A=c;A<=v;A+=p)for(var E=f;E<=S;E+=1){var T=M+A+E;C[T][R[T]++]=a}}for(c=Math.min,a=Math.max,F=0;F!==i;F++){var B=(et=r[F]).shape;switch(B.type){case P:var D=et.position.x,k=et.position.y,z=et.position.z,V=B.radius;N(D-V,k-V,z-V,D+V,k+V,z+V,et);break;case L:B.worldNormalNeedsUpdate&&B.computeWorldNormal(et.quaternion);var U=B.worldNormal,j=g+.5*S-et.position.x,H=y+.5*M-et.position.y,G=x+.5*A-et.position.z,W=s;W.set(j,H,G);for(var q=0,X=0;q!==l;q++,X+=d,W.y=H,W.x+=S)for(var Y=0,Q=0;Y!==u;Y++,Q+=p,W.z=G,W.y+=M)for(var K=0,Z=0;K!==h;K++,Z+=1,W.z+=A)if(W.dot(U)1){var tt=C[F];for(q=0;q!==$;q++){var et=tt[q];for(Y=0;Y!==q;Y++){var nt=tt[Y];this.needBroadphaseCollision(et,nt)&&this.intersectionTest(et,nt,e,n)}}}}this.makePairsUnique(e,n)}},{"../math/Vec3":31,"../shapes/Shape":44,"./Broadphase":5}],7:[function(t,e,n){e.exports=o;var i=t("./Broadphase"),r=t("./AABB");function o(){i.apply(this)}o.prototype=new i,o.prototype.constructor=o,o.prototype.collisionPairs=function(t,e,n){var i,r,o,a,s=t.bodies,c=s.length;for(i=0;i!==c;i++)for(r=0;r!==i;r++)o=s[i],a=s[r],this.needBroadphaseCollision(o,a)&&this.intersectionTest(o,a,e,n)},new r,o.prototype.aabbQuery=function(t,e,n){n=n||[];for(var i=0;it){var n=e;e=t,t=n}return t+"-"+e in this.matrix},i.prototype.set=function(t,e,n){if(t=t.id,(e=e.id)>t){var i=e;e=t,t=i}n?this.matrix[t+"-"+e]=!0:delete this.matrix[t+"-"+e]},i.prototype.reset=function(){this.matrix={}},i.prototype.setNumObjects=function(t){}},{}],9:[function(t,e,n){function i(){this.current=[],this.previous=[]}function r(t,e){t.push((4294901760&e)>>16,65535&e)}e.exports=i,i.prototype.getKey=function(t,e){if(ei[r];)r++;if(n!==i[r]){for(e=i.length-1;e>=r;e--)i[e+1]=i[e];i[r]=n}},i.prototype.tick=function(){var t=this.current;this.current=this.previous,this.previous=t,this.current.length=0},i.prototype.getDiff=function(t,e){for(var n=this.current,i=this.previous,o=n.length,a=i.length,s=0,c=0;ci[s];)s++;l===i[s]||r(t,l)}for(s=0,c=0;cn[s];)s++;n[s]===u||r(e,u)}}},{}],10:[function(t,e,n){e.exports=l;var i=t("../math/Vec3"),r=t("../math/Quaternion"),o=t("../math/Transform"),a=(t("../shapes/ConvexPolyhedron"),t("../shapes/Box"),t("../collision/RaycastResult")),s=t("../shapes/Shape"),c=t("../collision/AABB");function l(t,e){this.from=t?t.clone():new i,this.to=e?e.clone():new i,this._direction=new i,this.precision=1e-4,this.checkCollisionResponse=!0,this.skipBackfaces=!1,this.collisionFilterMask=-1,this.collisionFilterGroup=-1,this.mode=l.ANY,this.result=new a,this.hasHit=!1,this.callback=function(t){}}l.prototype.constructor=l,l.CLOSEST=1,l.ANY=2,l.ALL=4;var u=new c,h=[];l.prototype.intersectWorld=function(t,e){return this.mode=e.mode||l.ANY,this.result=e.result||new a,this.skipBackfaces=!!e.skipBackfaces,this.collisionFilterMask=void 0!==e.collisionFilterMask?e.collisionFilterMask:-1,this.collisionFilterGroup=void 0!==e.collisionFilterGroup?e.collisionFilterGroup:-1,e.from&&this.from.copy(e.from),e.to&&this.to.copy(e.to),this.callback=e.callback||function(){},this.hasHit=!1,this.result.reset(),this._updateDirection(),this.getAABB(u),h.length=0,t.broadphase.aabbQuery(t,u,h),this.intersectBodies(h),this.hasHit};var d=new i,p=new i;function f(t,e,n,i){i.vsub(e,D),n.vsub(e,d),t.vsub(e,p);var r,o,a=D.dot(D),s=D.dot(d),c=D.dot(p),l=d.dot(d),u=d.dot(p);return(r=l*c-s*u)>=0&&(o=a*u-s*c)>=0&&r+ot.boundingSphereRadius)){var r=this[t.type];r&&r.call(this,t,e,n,i,t)}},new i,new i;var g=new i,y=new i,x=new i,w=new i;new i,new a,l.prototype.intersectBox=function(t,e,n,i,r){return this.intersectConvex(t.convexPolyhedronRepresentation,e,n,i,r)},l.prototype[s.types.BOX]=l.prototype.intersectBox,l.prototype.intersectPlane=function(t,e,n,r,o){var a=this.from,s=this.to,c=this._direction,l=new i(0,0,1);e.vmult(l,l);var u=new i;a.vsub(n,u);var h=u.dot(l);if(s.vsub(n,u),!(h*u.dot(l)>0||a.distanceTo(s)=0&&f<=1&&(o.lerp(a,f,d),d.vsub(n,p),p.normalize(),this.reportIntersection(p,d,r,i,-1)),this.result._shouldStop)return;m>=0&&m<=1&&(o.lerp(a,m,d),d.vsub(n,p),p.normalize(),this.reportIntersection(p,d,r,i,-1))}},l.prototype[s.types.SPHERE]=l.prototype.intersectSphere;var T=new i,P=(new i,new i,new i);l.prototype.intersectConvex=function(t,e,n,i,r,o){for(var a=T,s=P,c=o&&o.faceList||null,l=t.faces,u=t.vertices,h=t.faceNormals,d=this._direction,p=this.from,m=this.to,v=p.distanceTo(m),b=c?c.length:l.length,_=this.result,S=0;!_._shouldStop&&Sv||this.reportIntersection(a,g,r,i,M)}}}}},l.prototype[s.types.CONVEXPOLYHEDRON]=l.prototype.intersectConvex;var L=new i,C=new i,R=new i,O=new i,F=new i,I=new i,N=(new c,[]),B=new o;l.prototype.intersectTrimesh=function(t,e,n,i,r,a){var s=L,c=N,l=B,u=P,h=C,d=R,p=O,m=I,v=F,b=(a&&a.faceList,t.indices),_=(t.vertices,t.faceNormals,this.from),S=this.to,M=this._direction;l.position.copy(n),l.quaternion.copy(e),o.vectorToLocalFrame(n,e,M,h),o.pointToLocalFrame(n,e,_,d),o.pointToLocalFrame(n,e,S,p),p.x*=t.scale.x,p.y*=t.scale.y,p.z*=t.scale.z,d.x*=t.scale.x,d.y*=t.scale.y,d.z*=t.scale.z,p.vsub(d,h),h.normalize();var A=d.distanceSquared(p);t.tree.rayQuery(this,l,c);for(var E=0,T=c.length;!this.result._shouldStop&&E!==T;E++){var D=c[E];t.getNormal(D,s),t.getVertex(b[3*D],y),y.vsub(d,u);var k=h.dot(s),z=s.dot(u)/k;if(!(z<0)){h.scale(z,g),g.vadd(d,g),t.getVertex(b[3*D+1],x),t.getVertex(b[3*D+2],w);var V=g.distanceSquared(d);!f(g,x,y,w)&&!f(g,y,x,w)||V>A||(o.vectorToWorldFrame(e,s,v),o.pointToWorldFrame(n,e,g,m),this.reportIntersection(v,m,r,i,D))}}c.length=0},l.prototype[s.types.TRIMESH]=l.prototype.intersectTrimesh,l.prototype.reportIntersection=function(t,e,n,i,r){var o=this.from,a=this.to,s=o.distanceTo(e),c=this.result;if(!(this.skipBackfaces&&t.dot(this._direction)>0))switch(c.hitFaceIndex=void 0!==r?r:-1,this.mode){case l.ALL:this.hasHit=!0,c.set(o,a,t,e,n,i,s),c.hasHit=!0,this.callback(c);break;case l.CLOSEST:(s=0&&!(t[r].aabb.lowerBound.x<=i.aabb.lowerBound.x);r--)t[r+1]=t[r];t[r+1]=i}return t},r.insertionSortY=function(t){for(var e=1,n=t.length;e=0&&!(t[r].aabb.lowerBound.y<=i.aabb.lowerBound.y);r--)t[r+1]=t[r];t[r+1]=i}return t},r.insertionSortZ=function(t){for(var e=1,n=t.length;e=0&&!(t[r].aabb.lowerBound.z<=i.aabb.lowerBound.z);r--)t[r+1]=t[r];t[r+1]=i}return t},r.prototype.collisionPairs=function(t,e,n){var i,o,a=this.axisList,s=a.length,c=this.axisIndex;for(this.dirty&&(this.sortList(),this.dirty=!1),i=0;i!==s;i++){var l=a[i];for(o=i+1;om?f>v?0:2:m>v?1:2},r.prototype.aabbQuery=function(t,e,n){n=n||[],this.dirty&&(this.sortList(),this.dirty=!1);var i=this.axisIndex,r="x";1===i&&(r="y"),2===i&&(r="z");for(var o=this.axisList,a=(e.lowerBound[r],e.upperBound[r],0);a.499&&(n=2*Math.atan2(o,c),i=Math.PI/2,r=0),l<-.499&&(n=-2*Math.atan2(o,c),i=-Math.PI/2,r=0),isNaN(n)){var u=o*o,h=a*a,d=s*s;n=Math.atan2(2*a*c-2*o*s,1-2*h-2*d),i=Math.asin(2*l),r=Math.atan2(2*o*c-2*a*s,1-2*u-2*d)}break;default:throw new Error("Euler order "+e+" not supported yet.")}t.y=n,t.z=i,t.x=r},r.prototype.setFromEuler=function(t,e,n,i){i=i||"XYZ";var r=Math.cos(t/2),o=Math.cos(e/2),a=Math.cos(n/2),s=Math.sin(t/2),c=Math.sin(e/2),l=Math.sin(n/2);return"XYZ"===i?(this.x=s*o*a+r*c*l,this.y=r*c*a-s*o*l,this.z=r*o*l+s*c*a,this.w=r*o*a-s*c*l):"YXZ"===i?(this.x=s*o*a+r*c*l,this.y=r*c*a-s*o*l,this.z=r*o*l-s*c*a,this.w=r*o*a+s*c*l):"ZXY"===i?(this.x=s*o*a-r*c*l,this.y=r*c*a+s*o*l,this.z=r*o*l+s*c*a,this.w=r*o*a-s*c*l):"ZYX"===i?(this.x=s*o*a-r*c*l,this.y=r*c*a+s*o*l,this.z=r*o*l-s*c*a,this.w=r*o*a+s*c*l):"YZX"===i?(this.x=s*o*a+r*c*l,this.y=r*c*a+s*o*l,this.z=r*o*l-s*c*a,this.w=r*o*a-s*c*l):"XZY"===i&&(this.x=s*o*a-r*c*l,this.y=r*c*a-s*o*l,this.z=r*o*l+s*c*a,this.w=r*o*a+s*c*l),this},r.prototype.clone=function(){return new r(this.x,this.y,this.z,this.w)},r.prototype.slerp=function(t,e,n){n=n||new r;var i,o,a,s,c,l=this.x,u=this.y,h=this.z,d=this.w,p=t.x,f=t.y,m=t.z,v=t.w;return(o=l*p+u*f+h*m+d*v)<0&&(o=-o,p=-p,f=-f,m=-m,v=-v),1-o>1e-6?(i=Math.acos(o),a=Math.sin(i),s=Math.sin((1-e)*i)/a,c=Math.sin(e*i)/a):(s=1-e,c=e),n.x=s*l+c*p,n.y=s*u+c*f,n.z=s*h+c*m,n.w=s*d+c*v,n},r.prototype.integrate=function(t,e,n,i){i=i||new r;var o=t.x*n.x,a=t.y*n.y,s=t.z*n.z,c=this.x,l=this.y,u=this.z,h=this.w,d=.5*e;return i.x+=d*(o*h+a*u-s*l),i.y+=d*(a*h+s*c-o*u),i.z+=d*(s*h+o*l-a*c),i.w+=d*(-o*c-a*l-s*u),i}},{"./Vec3":31}],30:[function(t,e,n){var i=t("./Vec3"),r=t("./Quaternion");function o(t){t=t||{},this.position=new i,t.position&&this.position.copy(t.position),this.quaternion=new r,t.quaternion&&this.quaternion.copy(t.quaternion)}e.exports=o;var a=new r;o.pointToLocalFrame=function(t,e,n,r){return r=r||new i,n.vsub(t,r),e.conjugate(a),a.vmult(r,r),r},o.prototype.pointToLocal=function(t,e){return o.pointToLocalFrame(this.position,this.quaternion,t,e)},o.pointToWorldFrame=function(t,e,n,r){return r=r||new i,e.vmult(n,r),r.vadd(t,r),r},o.prototype.pointToWorld=function(t,e){return o.pointToWorldFrame(this.position,this.quaternion,t,e)},o.prototype.vectorToWorldFrame=function(t,e){return e=e||new i,this.quaternion.vmult(t,e),e},o.vectorToWorldFrame=function(t,e,n){return t.vmult(e,n),n},o.vectorToLocalFrame=function(t,e,n,r){return r=r||new i,e.w*=-1,e.vmult(n,r),e.w*=-1,r}},{"./Quaternion":29,"./Vec3":31}],31:[function(t,e,n){e.exports=r;var i=t("./Mat3");function r(t,e,n){this.x=t||0,this.y=e||0,this.z=n||0}r.ZERO=new r(0,0,0),r.UNIT_X=new r(1,0,0),r.UNIT_Y=new r(0,1,0),r.UNIT_Z=new r(0,0,1),r.prototype.cross=function(t,e){var n=t.x,i=t.y,o=t.z,a=this.x,s=this.y,c=this.z;return(e=e||new r).x=s*o-c*i,e.y=c*n-a*o,e.z=a*i-s*n,e},r.prototype.set=function(t,e,n){return this.x=t,this.y=e,this.z=n,this},r.prototype.setZero=function(){this.x=this.y=this.z=0},r.prototype.vadd=function(t,e){if(!e)return new r(this.x+t.x,this.y+t.y,this.z+t.z);e.x=t.x+this.x,e.y=t.y+this.y,e.z=t.z+this.z},r.prototype.vsub=function(t,e){if(!e)return new r(this.x-t.x,this.y-t.y,this.z-t.z);e.x=this.x-t.x,e.y=this.y-t.y,e.z=this.z-t.z},r.prototype.crossmat=function(){return new i([0,-this.z,this.y,this.z,0,-this.x,-this.y,this.x,0])},r.prototype.normalize=function(){var t=this.x,e=this.y,n=this.z,i=Math.sqrt(t*t+e*e+n*n);if(i>0){var r=1/i;this.x*=r,this.y*=r,this.z*=r}else this.x=0,this.y=0,this.z=0;return i},r.prototype.unit=function(t){t=t||new r;var e=this.x,n=this.y,i=this.z,o=Math.sqrt(e*e+n*n+i*i);return o>0?(o=1/o,t.x=e*o,t.y=n*o,t.z=i*o):(t.x=1,t.y=0,t.z=0),t},r.prototype.norm=function(){var t=this.x,e=this.y,n=this.z;return Math.sqrt(t*t+e*e+n*n)},r.prototype.length=r.prototype.norm,r.prototype.norm2=function(){return this.dot(this)},r.prototype.lengthSquared=r.prototype.norm2,r.prototype.distanceTo=function(t){var e=this.x,n=this.y,i=this.z,r=t.x,o=t.y,a=t.z;return Math.sqrt((r-e)*(r-e)+(o-n)*(o-n)+(a-i)*(a-i))},r.prototype.distanceSquared=function(t){var e=this.x,n=this.y,i=this.z,r=t.x,o=t.y,a=t.z;return(r-e)*(r-e)+(o-n)*(o-n)+(a-i)*(a-i)},r.prototype.mult=function(t,e){e=e||new r;var n=this.x,i=this.y,o=this.z;return e.x=t*n,e.y=t*i,e.z=t*o,e},r.prototype.vmul=function(t,e){return(e=e||new r).x=t.x*this.x,e.y=t.y*this.y,e.z=t.z*this.z,e},r.prototype.scale=r.prototype.mult,r.prototype.addScaledVector=function(t,e,n){return(n=n||new r).x=this.x+t*e.x,n.y=this.y+t*e.y,n.z=this.z+t*e.z,n},r.prototype.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z},r.prototype.isZero=function(){return 0===this.x&&0===this.y&&0===this.z},r.prototype.negate=function(t){return(t=t||new r).x=-this.x,t.y=-this.y,t.z=-this.z,t};var o=new r,a=new r;r.prototype.tangents=function(t,e){var n=this.norm();if(n>0){var i=o,r=1/n;i.set(this.x*r,this.y*r,this.z*r);var s=a;Math.abs(i.x)<.9?(s.set(1,0,0),i.cross(s,t)):(s.set(0,1,0),i.cross(s,t)),i.cross(t,e)}else t.set(1,0,0),e.set(0,1,0)},r.prototype.toString=function(){return this.x+","+this.y+","+this.z},r.prototype.toArray=function(){return[this.x,this.y,this.z]},r.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},r.prototype.lerp=function(t,e,n){var i=this.x,r=this.y,o=this.z;n.x=i+(t.x-i)*e,n.y=r+(t.y-r)*e,n.z=o+(t.z-o)*e},r.prototype.almostEquals=function(t,e){return void 0===e&&(e=1e-6),!(Math.abs(this.x-t.x)>e||Math.abs(this.y-t.y)>e||Math.abs(this.z-t.z)>e)},r.prototype.almostZero=function(t){return void 0===t&&(t=1e-6),!(Math.abs(this.x)>t||Math.abs(this.y)>t||Math.abs(this.z)>t)};var s=new r;r.prototype.isAntiparallelTo=function(t,e){return this.negate(s),s.almostEquals(t,e)},r.prototype.clone=function(){return new r(this.x,this.y,this.z)}},{"./Mat3":28}],32:[function(t,e,n){e.exports=l;var i=t("../utils/EventTarget"),r=(t("../shapes/Shape"),t("../math/Vec3")),o=t("../math/Mat3"),a=t("../math/Quaternion"),s=(t("../material/Material"),t("../collision/AABB")),c=t("../shapes/Box");function l(t){t=t||{},i.apply(this),this.id=l.idCounter++,this.world=null,this.preStep=null,this.postStep=null,this.vlambda=new r,this.collisionFilterGroup="number"==typeof t.collisionFilterGroup?t.collisionFilterGroup:1,this.collisionFilterMask="number"==typeof t.collisionFilterMask?t.collisionFilterMask:-1,this.collisionResponse=!0,this.position=new r,this.previousPosition=new r,this.interpolatedPosition=new r,this.initPosition=new r,t.position&&(this.position.copy(t.position),this.previousPosition.copy(t.position),this.interpolatedPosition.copy(t.position),this.initPosition.copy(t.position)),this.velocity=new r,t.velocity&&this.velocity.copy(t.velocity),this.initVelocity=new r,this.force=new r;var e="number"==typeof t.mass?t.mass:0;this.mass=e,this.invMass=e>0?1/e:0,this.material=t.material||null,this.linearDamping="number"==typeof t.linearDamping?t.linearDamping:.01,this.type=e<=0?l.STATIC:l.DYNAMIC,typeof t.type==typeof l.STATIC&&(this.type=t.type),this.allowSleep=void 0===t.allowSleep||t.allowSleep,this.sleepState=0,this.sleepSpeedLimit=void 0!==t.sleepSpeedLimit?t.sleepSpeedLimit:.03,this.sleepTimeLimit=void 0!==t.sleepTimeLimit?t.sleepTimeLimit:1,this.timeLastSleepy=0,this._wakeUpAfterNarrowphase=!1,this.torque=new r,this.quaternion=new a,this.initQuaternion=new a,this.previousQuaternion=new a,this.interpolatedQuaternion=new a,t.quaternion&&(this.quaternion.copy(t.quaternion),this.initQuaternion.copy(t.quaternion),this.previousQuaternion.copy(t.quaternion),this.interpolatedQuaternion.copy(t.quaternion)),this.angularVelocity=new r,t.angularVelocity&&this.angularVelocity.copy(t.angularVelocity),this.initAngularVelocity=new r,this.shapes=[],this.shapeOffsets=[],this.shapeOrientations=[],this.inertia=new r,this.invInertia=new r,this.invInertiaWorld=new o,this.invMassSolve=0,this.invInertiaSolve=new r,this.invInertiaWorldSolve=new o,this.fixedRotation=void 0!==t.fixedRotation&&t.fixedRotation,this.angularDamping=void 0!==t.angularDamping?t.angularDamping:.01,this.linearFactor=new r(1,1,1),t.linearFactor&&this.linearFactor.copy(t.linearFactor),this.angularFactor=new r(1,1,1),t.angularFactor&&this.angularFactor.copy(t.angularFactor),this.aabb=new s,this.aabbNeedsUpdate=!0,this.boundingRadius=0,this.wlambda=new r,t.shape&&this.addShape(t.shape),this.updateMassProperties()}l.prototype=new i,l.prototype.constructor=l,l.COLLIDE_EVENT_NAME="collide",l.DYNAMIC=1,l.STATIC=2,l.KINEMATIC=4,l.AWAKE=0,l.SLEEPY=1,l.SLEEPING=2,l.idCounter=0,l.wakeupEvent={type:"wakeup"},l.prototype.wakeUp=function(){var t=this.sleepState;this.sleepState=0,this._wakeUpAfterNarrowphase=!1,t===l.SLEEPING&&this.dispatchEvent(l.wakeupEvent)},l.prototype.sleep=function(){this.sleepState=l.SLEEPING,this.velocity.set(0,0,0),this.angularVelocity.set(0,0,0),this._wakeUpAfterNarrowphase=!1},l.sleepyEvent={type:"sleepy"},l.sleepEvent={type:"sleep"},l.prototype.sleepTick=function(t){if(this.allowSleep){var e=this.sleepState,n=this.velocity.norm2()+this.angularVelocity.norm2(),i=Math.pow(this.sleepSpeedLimit,2);e===l.AWAKE&&ni?this.wakeUp():e===l.SLEEPY&&t-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(l.sleepEvent))}},l.prototype.updateSolveMassProperties=function(){this.sleepState===l.SLEEPING||this.type===l.KINEMATIC?(this.invMassSolve=0,this.invInertiaSolve.setZero(),this.invInertiaWorldSolve.setZero()):(this.invMassSolve=this.invMass,this.invInertiaSolve.copy(this.invInertia),this.invInertiaWorldSolve.copy(this.invInertiaWorld))},l.prototype.pointToLocalFrame=function(t,e){return e=e||new r,t.vsub(this.position,e),this.quaternion.conjugate().vmult(e,e),e},l.prototype.vectorToLocalFrame=function(t,e){return e=e||new r,this.quaternion.conjugate().vmult(t,e),e},l.prototype.pointToWorldFrame=function(t,e){return e=e||new r,this.interpolatedQuaternion.vmult(t,e),e.vadd(this.interpolatedPosition,e),e},l.prototype.vectorToWorldFrame=function(t,e){return e=e||new r,this.interpolatedQuaternion.vmult(t,e),e};var u=new r,h=new a;l.prototype.addShape=function(t,e,n){var i=new r,o=new a;return e&&i.copy(e),n&&o.copy(n),this.shapes.push(t),this.shapeOffsets.push(i),this.shapeOrientations.push(o),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,t.body=this,this},l.prototype.updateBoundingRadius=function(){for(var t=this.shapes,e=this.shapeOffsets,n=t.length,i=0,r=0;r!==n;r++){var o=t[r];o.updateBoundingSphereRadius();var a=e[r].norm(),s=o.boundingSphereRadius;a+s>i&&(i=a+s)}this.boundingRadius=i};var d=new s;l.prototype.computeAABB=function(){for(var t=this.shapes,e=this.shapeOffsets,n=this.shapeOrientations,i=t.length,r=u,o=h,a=this.quaternion,s=this.aabb,c=d,l=0;l!==i;l++){var p=t[l];a.vmult(e[l],r),r.vadd(this.position,r),n[l].mult(a,o),p.calculateWorldAABB(r,o,c.lowerBound,c.upperBound),0===l?s.copy(c):s.extend(c)}this.aabbNeedsUpdate=!1};var p=new o,f=new o;new o,l.prototype.updateInertiaWorld=function(t){var e=this.invInertia;if(e.x!==e.y||e.y!==e.z||t){var n=p,i=f;n.setRotationFromQuaternion(this.quaternion),n.transpose(i),n.scale(e,n),n.mmult(i,this.invInertiaWorld)}},new r;var m=new r;l.prototype.applyForce=function(t,e){if(this.type===l.DYNAMIC){var n=m;e.cross(t,n),this.force.vadd(t,this.force),this.torque.vadd(n,this.torque)}};var v=new r,g=new r;l.prototype.applyLocalForce=function(t,e){if(this.type===l.DYNAMIC){var n=v,i=g;this.vectorToWorldFrame(t,n),this.vectorToWorldFrame(e,i),this.applyForce(n,i)}},new r;var y=new r,x=new r;l.prototype.applyImpulse=function(t,e){if(this.type===l.DYNAMIC){var n=e,i=y;i.copy(t),i.mult(this.invMass,i),this.velocity.vadd(i,this.velocity);var r=x;n.cross(t,r),this.invInertiaWorld.vmult(r,r),this.angularVelocity.vadd(r,this.angularVelocity)}};var w=new r,b=new r;l.prototype.applyLocalImpulse=function(t,e){if(this.type===l.DYNAMIC){var n=w,i=b;this.vectorToWorldFrame(t,n),this.vectorToWorldFrame(e,i),this.applyImpulse(n,i)}};var _=new r;l.prototype.updateMassProperties=function(){var t=_;this.invMass=this.mass>0?1/this.mass:0;var e=this.inertia,n=this.fixedRotation;this.computeAABB(),t.set((this.aabb.upperBound.x-this.aabb.lowerBound.x)/2,(this.aabb.upperBound.y-this.aabb.lowerBound.y)/2,(this.aabb.upperBound.z-this.aabb.lowerBound.z)/2),c.calculateInertia(t,this.mass,e),this.invInertia.set(e.x>0&&!n?1/e.x:0,e.y>0&&!n?1/e.y:0,e.z>0&&!n?1/e.z:0),this.updateInertiaWorld(!0)},l.prototype.getVelocityAtWorldPoint=function(t,e){var n=new r;return t.vsub(this.position,n),this.angularVelocity.cross(n,e),this.velocity.vadd(e,e),e},new r,new r,new a,new a,l.prototype.integrate=function(t,e,n){if(this.previousPosition.copy(this.position),this.previousQuaternion.copy(this.quaternion),(this.type===l.DYNAMIC||this.type===l.KINEMATIC)&&this.sleepState!==l.SLEEPING){var i=this.velocity,r=this.angularVelocity,o=this.position,a=this.force,s=this.torque,c=this.quaternion,u=this.invMass,h=this.invInertiaWorld,d=this.linearFactor,p=u*t;i.x+=a.x*p*d.x,i.y+=a.y*p*d.y,i.z+=a.z*p*d.z;var f=h.elements,m=this.angularFactor,v=s.x*m.x,g=s.y*m.y,y=s.z*m.z;r.x+=t*(f[0]*v+f[1]*g+f[2]*y),r.y+=t*(f[3]*v+f[4]*g+f[5]*y),r.z+=t*(f[6]*v+f[7]*g+f[8]*y),o.x+=i.x*t,o.y+=i.y*t,o.z+=i.z*t,c.integrate(this.angularVelocity,t,this.angularFactor,c),e&&(n?c.normalizeFast():c.normalize()),this.aabbNeedsUpdate=!0,this.updateInertiaWorld()}}},{"../collision/AABB":3,"../material/Material":26,"../math/Mat3":28,"../math/Quaternion":29,"../math/Vec3":31,"../shapes/Box":38,"../shapes/Shape":44,"../utils/EventTarget":50}],33:[function(t,e,n){t("./Body");var i=t("../math/Vec3"),r=t("../math/Quaternion"),o=(t("../collision/RaycastResult"),t("../collision/Ray")),a=t("../objects/WheelInfo");function s(t){this.chassisBody=t.chassisBody,this.wheelInfos=[],this.sliding=!1,this.world=null,this.indexRightAxis=void 0!==t.indexRightAxis?t.indexRightAxis:1,this.indexForwardAxis=void 0!==t.indexForwardAxis?t.indexForwardAxis:0,this.indexUpAxis=void 0!==t.indexUpAxis?t.indexUpAxis:2,this.numWheelsOnGround=0}e.exports=s,new i,new i,new i;var c=new i,l=new i,u=new i;new o,s.prototype.addWheel=function(t){var e=new a(t=t||{}),n=this.wheelInfos.length;return this.wheelInfos.push(e),n},s.prototype.setSteeringValue=function(t,e){this.wheelInfos[e].steering=t},new i,s.prototype.applyEngineForce=function(t,e){this.wheelInfos[e].engineForce=t},s.prototype.setBrake=function(t,e){this.wheelInfos[e].brake=t},s.prototype.addToWorld=function(t){this.constraints,t.addBody(this.chassisBody);var e=this;this.preStepCallback=function(){e.updateVehicle(t.dt)},t.addEventListener("preStep",this.preStepCallback),this.world=t},s.prototype.getVehicleAxisWorld=function(t,e){e.set(0===t?1:0,1===t?1:0,2===t?1:0),this.chassisBody.vectorToWorldFrame(e,e)},s.prototype.updateVehicle=function(t){if(!(this.chassisBody.sleepState>1)){for(var e=this.wheelInfos,n=e.length,r=this.chassisBody,o=0;op.maxSuspensionForce&&(l=p.maxSuspensionForce),p.raycastResult.hitNormalWorld.scale(l*t,s),p.raycastResult.hitPointWorld.vsub(r.position,c),r.applyImpulse(s,c)}this.updateFriction(t);var u=new i,h=new i,d=new i;for(o=0;o0?1:-1)*p.customSlidingRotationalSpeed*t),Math.abs(p.brake)>Math.abs(p.engineForce)&&(p.deltaRotation=0),p.lastRotation=p.rotation,p.rotation+=p.deltaRotation,p.deltaRotation*=.99}}},s.prototype.updateSuspension=function(t){for(var e=this.chassisBody.mass,n=this.wheelInfos,i=n.length,r=0;rm&&(t.suspensionLength=m,t.raycastResult.reset());var v=t.raycastResult.hitNormalWorld.dot(t.directionWorld),g=new i;r.getVelocityAtWorldPoint(t.raycastResult.hitPointWorld,g);var y=t.raycastResult.hitNormalWorld.dot(g);if(v>=-.1)t.suspensionRelativeVelocity=0,t.clippedInvContactDotSuspension=10;else{var x=-1/v;t.suspensionRelativeVelocity=y*x,t.clippedInvContactDotSuspension=x}}else t.suspensionLength=t.suspensionRestLength+0*t.maxSuspensionTravel,t.suspensionRelativeVelocity=0,t.directionWorld.scale(-1,t.raycastResult.hitNormalWorld),t.clippedInvContactDotSuspension=1;return o},s.prototype.updateWheelTransformWorld=function(t){t.isInContact=!1;var e=this.chassisBody;e.pointToWorldFrame(t.chassisConnectionPointLocal,t.chassisConnectionPointWorld),e.vectorToWorldFrame(t.directionLocal,t.directionWorld),e.vectorToWorldFrame(t.axleLocal,t.axleWorld)},s.prototype.updateWheelTransform=function(t){var e=c,n=l,i=u,o=this.wheelInfos[t];this.updateWheelTransformWorld(o),o.directionLocal.scale(-1,e),n.copy(o.axleLocal),e.cross(n,i),i.normalize(),n.normalize();var a=o.steering,s=new r;s.setFromAxisAngle(e,a);var h=new r;h.setFromAxisAngle(n,this.lerp(o.lastRotation,o.rotation,this.world.interpolationFactor));var d=o.worldTransform.quaternion;this.chassisBody.quaternion.mult(s,d),d.mult(h,d),d.normalize();var p=o.worldTransform.position;p.copy(o.directionWorld),p.scale(this.lerp(o.lastSuspensionLength,o.suspensionLength,this.world.interpolationFactor),p),p.vadd(o.chassisConnectionPointWorld,p)},s.prototype.lerp=function(t,e,n){return t+(e-t)*(n=(n=n<0?0:n)>1?1:n)};var p=[new i(1,0,0),new i(0,1,0),new i(0,0,1)];s.prototype.getWheelTransformWorld=function(t){return this.wheelInfos[t].worldTransform};var f=new i,m=[],v=[];s.prototype.updateFriction=function(t){var e=f,n=this.wheelInfos,r=n.length,o=this.chassisBody,a=v,s=m;this.numWheelsOnGround=0;for(var c=0;c_&&(this.sliding=!0,E.sliding=!0,x=b/Math.sqrt(A),E.skidInfo*=x)}}if(this.sliding)for(c=0;c1.1)return 0;var a=E,s=T,c=P;return t.getVelocityAtWorldPoint(e,a),n.getVelocityAtWorldPoint(i,s),a.vsub(s,c),-.2*r.dot(c)*(1/(t.invMass+n.invMass))}},{"../collision/Ray":10,"../collision/RaycastResult":11,"../math/Quaternion":29,"../math/Vec3":31,"../objects/WheelInfo":37,"./Body":32}],34:[function(t,e,n){var i=t("./Body"),r=t("../shapes/Sphere"),o=t("../shapes/Box"),a=t("../math/Vec3"),s=t("../constraints/HingeConstraint");function c(t){if(this.wheelBodies=[],this.coordinateSystem=void 0===t.coordinateSystem?new a(1,2,3):t.coordinateSystem.clone(),this.chassisBody=t.chassisBody,!this.chassisBody){var e=new o(new a(5,2,.5));this.chassisBody=new i(1,e)}this.constraints=[],this.wheelAxes=[],this.wheelForces=[]}e.exports=c,c.prototype.addWheel=function(t){var e=(t=t||{}).body;e||(e=new i(1,new r(1.2))),this.wheelBodies.push(e),this.wheelForces.push(0),new a;var n=void 0!==t.position?t.position.clone():new a,o=new a;this.chassisBody.pointToWorldFrame(n,o),e.position.set(o.x,o.y,o.z);var c=void 0!==t.axis?t.axis.clone():new a(0,1,0);this.wheelAxes.push(c);var l=new s(this.chassisBody,e,{pivotA:n,axisA:c,pivotB:a.ZERO,axisB:c,collideConnected:!1});return this.constraints.push(l),this.wheelBodies.length-1},c.prototype.setSteeringValue=function(t,e){var n=this.wheelAxes[e],i=Math.cos(t),r=Math.sin(t),o=n.x,a=n.y;this.constraints[e].axisA.set(i*o-r*a,r*o+i*a,0)},c.prototype.setMotorSpeed=function(t,e){var n=this.constraints[e];n.enableMotor(),n.motorTargetVelocity=t},c.prototype.disableMotor=function(t){this.constraints[t].disableMotor()};var l=new a;c.prototype.setWheelForce=function(t,e){this.wheelForces[e]=t},c.prototype.applyWheelForce=function(t,e){var n=this.wheelAxes[e],i=this.wheelBodies[e],r=i.torque;n.scale(t,l),i.vectorToWorldFrame(l,l),r.vadd(l,r)},c.prototype.addToWorld=function(t){for(var e=this.constraints,n=this.wheelBodies.concat([this.chassisBody]),i=0;ithis.particles.length&&this.neighbors.pop())};var o=new i;r.prototype.getNeighbors=function(t,e){for(var n=this.particles.length,i=t.id,r=this.smoothingRadius*this.smoothingRadius,a=o,s=0;s!==n;s++){var c=this.particles[s];c.position.vsub(t.position,a),i!==c.id&&a.norm2()=-.1)this.suspensionRelativeVelocity=0,this.clippedInvContactDotSuspension=10;else{var r=-1/n;this.suspensionRelativeVelocity=i*r,this.clippedInvContactDotSuspension=r}}else e.suspensionLength=this.suspensionRestLength,this.suspensionRelativeVelocity=0,e.directionWorld.scale(-1,e.hitNormalWorld),this.clippedInvContactDotSuspension=1}},{"../collision/RaycastResult":11,"../math/Transform":30,"../math/Vec3":31,"../utils/Utils":54}],38:[function(t,e,n){e.exports=a;var i=t("./Shape"),r=t("../math/Vec3"),o=t("./ConvexPolyhedron");function a(t){i.call(this,{type:i.types.BOX}),this.halfExtents=t,this.convexPolyhedronRepresentation=null,this.updateConvexPolyhedronRepresentation(),this.updateBoundingSphereRadius()}a.prototype=new i,a.prototype.constructor=a,a.prototype.updateConvexPolyhedronRepresentation=function(){var t=this.halfExtents.x,e=this.halfExtents.y,n=this.halfExtents.z,i=r,a=[new i(-t,-e,-n),new i(t,-e,-n),new i(t,e,-n),new i(-t,e,-n),new i(-t,-e,n),new i(t,-e,n),new i(t,e,n),new i(-t,e,n)],s=(new i(0,0,1),new i(0,1,0),new i(1,0,0),new o(a,[[3,2,1,0],[4,5,6,7],[5,4,0,1],[2,3,7,6],[0,4,7,3],[1,2,6,5]]));this.convexPolyhedronRepresentation=s,s.material=this.material},a.prototype.calculateLocalInertia=function(t,e){return e=e||new r,a.calculateInertia(this.halfExtents,t,e),e},a.calculateInertia=function(t,e,n){var i=t;n.x=1/12*e*(2*i.y*2*i.y+2*i.z*2*i.z),n.y=1/12*e*(2*i.x*2*i.x+2*i.z*2*i.z),n.z=1/12*e*(2*i.y*2*i.y+2*i.x*2*i.x)},a.prototype.getSideNormals=function(t,e){var n=t,i=this.halfExtents;if(n[0].set(i.x,0,0),n[1].set(0,i.y,0),n[2].set(0,0,i.z),n[3].set(-i.x,0,0),n[4].set(0,-i.y,0),n[5].set(0,0,-i.z),void 0!==e)for(var r=0;r!==n.length;r++)e.vmult(n[r],n[r]);return n},a.prototype.volume=function(){return 8*this.halfExtents.x*this.halfExtents.y*this.halfExtents.z},a.prototype.updateBoundingSphereRadius=function(){this.boundingSphereRadius=this.halfExtents.norm()};var s=new r;new r,a.prototype.forEachWorldCorner=function(t,e,n){for(var i=this.halfExtents,r=[[i.x,i.y,i.z],[-i.x,i.y,i.z],[-i.x,-i.y,i.z],[-i.x,-i.y,-i.z],[i.x,-i.y,-i.z],[i.x,i.y,-i.z],[-i.x,i.y,-i.z],[i.x,-i.y,i.z]],o=0;oi.x&&(i.x=s),l>i.y&&(i.y=l),u>i.z&&(i.z=u),sp&&(p=m,d=f)}for(var v=[],g=n.faces[d],y=g.length,x=0;x=0&&this.clipFaceAgainstHull(a,t,e,v,s,c,l)};var h=new r,d=new r,p=new r,f=new r,m=new r,v=new r;a.prototype.findSeparatingAxis=function(t,e,n,i,r,o,a,s){var c=h,l=d,u=p,g=f,y=m,x=v,w=Number.MAX_VALUE;if(this.uniqueAxes)for(_=0;_!==this.uniqueAxes.length;_++){if(n.vmult(this.uniqueAxes[_],c),!1===(A=this.testSepAxis(c,t,e,n,i,r)))return!1;A0&&o.negate(o),!0};var g=[],y=[];a.prototype.testSepAxis=function(t,e,n,i,r,o){a.project(this,t,n,i,g),a.project(e,t,r,o,y);var s=g[0],c=g[1],l=y[0],u=y[1];if(se&&(e=r)}this.maxValue=e},s.prototype.setHeightValueAtIndex=function(t,e,n){this.data[t][e]=n,this.clearCachedConvexTrianglePillar(t,e,!1),t>0&&(this.clearCachedConvexTrianglePillar(t-1,e,!0),this.clearCachedConvexTrianglePillar(t-1,e,!1)),e>0&&(this.clearCachedConvexTrianglePillar(t,e-1,!0),this.clearCachedConvexTrianglePillar(t,e-1,!1)),e>0&&t>0&&this.clearCachedConvexTrianglePillar(t-1,e-1,!0)},s.prototype.getRectMinMax=function(t,e,n,i,r){r=r||[];for(var o=this.data,a=this.minValue,s=t;s<=n;s++)for(var c=e;c<=i;c++){var l=o[s][c];l>a&&(a=l)}r[0]=this.minValue,r[1]=a},s.prototype.getIndexOfPosition=function(t,e,n,i){var r=this.elementSize,o=this.data,a=Math.floor(t/r),s=Math.floor(e/r);return n[0]=a,n[1]=s,i&&(a<0&&(a=0),s<0&&(s=0),a>=o.length-1&&(a=o.length-1),s>=o[0].length-1&&(s=o[0].length-1)),!(a<0||s<0||a>=o.length-1||s>=o[0].length-1)};var c=[],l=new o,u=new o,h=new o,d=new o;s.prototype.getTriangleAt=function(t,e,n,i,r,o){var a=c;this.getIndexOfPosition(t,e,a,n);var s=a[0],l=a[1],u=this.data;n&&(s=Math.min(u.length-2,Math.max(0,s)),l=Math.min(u[0].length-2,Math.max(0,l)));var h=this.elementSize,d=Math.pow(t/h-s,2)+Math.pow(e/h-l,2)>Math.pow(t/h-(s+1),2)+Math.pow(e/h-(l+1),2);return this.getTriangle(s,l,d,i,r,o),d};var p=new o,f=new o,m=new o,v=new o,g=new o;s.prototype.getNormalAt=function(t,e,n,i){var r=p,o=f,a=m,s=v,c=g;this.getTriangleAt(t,e,n,r,o,a),o.vsub(r,s),a.vsub(r,c),s.cross(c,i),i.normalize()},s.prototype.getAabbAtIndex=function(t,e,n){var i=this.data,r=this.elementSize;n.lowerBound.set(t*r,e*r,i[t][e]),n.upperBound.set((t+1)*r,(e+1)*r,i[t+1][e+1])},s.prototype.getHeightAt=function(t,e,n){var i=this.data,r=u,o=h,a=d,s=c;this.getIndexOfPosition(t,e,s,n);var p=s[0],f=s[1];n&&(p=Math.min(i.length-2,Math.max(0,p)),f=Math.min(i[0].length-2,Math.max(0,f)));var m=this.getTriangleAt(t,e,n,r,o,a);!function(t,e,n,i,r,o,a,s,c){c.x=((o-s)*(t-a)+(a-r)*(e-s))/((o-s)*(n-a)+(a-r)*(i-s)),c.y=((s-i)*(t-a)+(n-a)*(e-s))/((o-s)*(n-a)+(a-r)*(i-s)),c.z=1-c.x-c.y}(t,e,r.x,r.y,o.x,o.y,a.x,a.y,l);var v=l;return m?i[p+1][f+1]*v.x+i[p][f+1]*v.y+i[p+1][f]*v.z:i[p][f]*v.x+i[p+1][f]*v.y+i[p][f+1]*v.z},s.prototype.getCacheConvexTrianglePillarKey=function(t,e,n){return t+"_"+e+"_"+(n?1:0)},s.prototype.getCachedConvexTrianglePillar=function(t,e,n){return this._cachedPillars[this.getCacheConvexTrianglePillarKey(t,e,n)]},s.prototype.setCachedConvexTrianglePillar=function(t,e,n,i,r){this._cachedPillars[this.getCacheConvexTrianglePillarKey(t,e,n)]={convex:i,offset:r}},s.prototype.clearCachedConvexTrianglePillar=function(t,e,n){delete this._cachedPillars[this.getCacheConvexTrianglePillarKey(t,e,n)]},s.prototype.getTriangle=function(t,e,n,i,r,o){var a=this.data,s=this.elementSize;n?(i.set((t+1)*s,(e+1)*s,a[t+1][e+1]),r.set(t*s,(e+1)*s,a[t][e+1]),o.set((t+1)*s,e*s,a[t+1][e])):(i.set(t*s,e*s,a[t][e]),r.set((t+1)*s,e*s,a[t+1][e]),o.set(t*s,(e+1)*s,a[t][e+1]))},s.prototype.getConvexTrianglePillar=function(t,e,n){var i=this.pillarConvex,a=this.pillarOffset;if(this.cacheEnabled){if(s=this.getCachedConvexTrianglePillar(t,e,n))return this.pillarConvex=s.convex,void(this.pillarOffset=s.offset);i=new r,a=new o,this.pillarConvex=i,this.pillarOffset=a}var s=this.data,c=this.elementSize,l=i.faces;i.vertices.length=6;for(var u=0;u<6;u++)i.vertices[u]||(i.vertices[u]=new o);for(l.length=5,u=0;u<5;u++)l[u]||(l[u]=[]);var h=i.vertices,d=(Math.min(s[t][e],s[t+1][e],s[t][e+1],s[t+1][e+1])-this.minValue)/2+this.minValue;n?(a.set((t+.75)*c,(e+.75)*c,d),h[0].set(.25*c,.25*c,s[t+1][e+1]-d),h[1].set(-.75*c,.25*c,s[t][e+1]-d),h[2].set(.25*c,-.75*c,s[t+1][e]-d),h[3].set(.25*c,.25*c,-d-1),h[4].set(-.75*c,.25*c,-d-1),h[5].set(.25*c,-.75*c,-d-1),l[0][0]=0,l[0][1]=1,l[0][2]=2,l[1][0]=5,l[1][1]=4,l[1][2]=3,l[2][0]=2,l[2][1]=5,l[2][2]=3,l[2][3]=0,l[3][0]=3,l[3][1]=4,l[3][2]=1,l[3][3]=0,l[4][0]=1,l[4][1]=4,l[4][2]=5,l[4][3]=2):(a.set((t+.25)*c,(e+.25)*c,d),h[0].set(-.25*c,-.25*c,s[t][e]-d),h[1].set(.75*c,-.25*c,s[t+1][e]-d),h[2].set(-.25*c,.75*c,s[t][e+1]-d),h[3].set(-.25*c,-.25*c,-d-1),h[4].set(.75*c,-.25*c,-d-1),h[5].set(-.25*c,.75*c,-d-1),l[0][0]=0,l[0][1]=1,l[0][2]=2,l[1][0]=5,l[1][1]=4,l[1][2]=3,l[2][0]=0,l[2][1]=2,l[2][2]=5,l[2][3]=3,l[3][0]=1,l[3][1]=0,l[3][2]=3,l[3][3]=4,l[4][0]=4,l[4][1]=5,l[4][2]=2,l[4][3]=1),i.computeNormals(),i.computeEdges(),i.updateBoundingSphereRadius(),this.setCachedConvexTrianglePillar(t,e,n,i,a)},s.prototype.calculateLocalInertia=function(t,e){return(e=e||new o).set(0,0,0),e},s.prototype.volume=function(){return Number.MAX_VALUE},s.prototype.calculateWorldAABB=function(t,e,n,i){n.set(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),i.set(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE)},s.prototype.updateBoundingSphereRadius=function(){var t=this.data,e=this.elementSize;this.boundingSphereRadius=new o(t.length*e,t[0].length*e,Math.max(Math.abs(this.maxValue),Math.abs(this.minValue))).norm()},s.prototype.setHeightsFromImage=function(t,e){var n=document.createElement("canvas");n.width=t.width,n.height=t.height;var i=n.getContext("2d");i.drawImage(t,0,0);var r=i.getImageData(0,0,t.width,t.height),o=this.data;o.length=0,this.elementSize=Math.abs(e.x)/r.width;for(var a=0;an.x&&(n.x=r.x),r.yn.y&&(n.y=r.y),r.zn.z&&(n.z=r.z)},c.prototype.updateAABB=function(){this.computeLocalAABB(this.aabb)},c.prototype.updateBoundingSphereRadius=function(){for(var t=0,e=this.vertices,n=new r,i=0,o=e.length/3;i!==o;i++){this.getVertex(i,n);var a=n.norm2();a>t&&(t=a)}this.boundingSphereRadius=Math.sqrt(t)},new r;var w=new o,b=new a;c.prototype.calculateWorldAABB=function(t,e,n,i){var r=w,o=b;r.position=t,r.quaternion=e,this.aabb.toWorldFrame(r,o),n.copy(o.lowerBound),i.copy(o.upperBound)},c.prototype.volume=function(){return 4*Math.PI*this.boundingSphereRadius/3},c.createTorus=function(t,e,n,i,r){t=t||1,e=e||.5,n=n||8,i=i||6,r=r||2*Math.PI;for(var o=[],a=[],s=0;s<=n;s++)for(var l=0;l<=i;l++){var u=l/i*r,h=s/n*Math.PI*2,d=(t+e*Math.cos(h))*Math.cos(u),p=(t+e*Math.cos(h))*Math.sin(u),f=e*Math.sin(h);o.push(d,p,f)}for(s=1;s<=n;s++)for(l=1;l<=i;l++){var m=(i+1)*s+l-1,v=(i+1)*(s-1)+l-1,g=(i+1)*(s-1)+l,y=(i+1)*s+l;a.push(m,v,y),a.push(v,g,y)}return new c(o,a)}},{"../collision/AABB":3,"../math/Quaternion":29,"../math/Transform":30,"../math/Vec3":31,"../utils/Octree":51,"./Shape":44}],47:[function(t,e,n){e.exports=r,t("../math/Vec3"),t("../math/Quaternion");var i=t("./Solver");function r(){i.call(this),this.iterations=10,this.tolerance=1e-7}r.prototype=new i;var o=[],a=[],s=[];r.prototype.solve=function(t,e){var n,i,r,c,l,u=0,h=this.iterations,d=this.tolerance*this.tolerance,p=this.equations,f=p.length,m=e.bodies,v=m.length,g=t;if(0!==f)for(var y=0;y!==v;y++)m[y].updateSolveMassProperties();var x=a,w=s,b=o;for(x.length=f,w.length=f,b.length=f,y=0;y!==f;y++){var _=p[y];b[y]=0,w[y]=_.computeB(g),x[y]=1/_.computeC()}if(0!==f){for(y=0;y!==v;y++){var S=(E=m[y]).vlambda,M=E.wlambda;S.set(0,0,0),M.set(0,0,0)}for(u=0;u!==h;u++){c=0;for(var A=0;A!==f;A++)_=p[A],n=w[A],i=x[A],(l=b[A])+(r=i*(n-_.computeGWlambda()-_.eps*l))<_.minForce?r=_.minForce-l:l+r>_.maxForce&&(r=_.maxForce-l),b[A]+=r,c+=r>0?r:-r,_.addToWlambda(r);if(c*c=0;t--)this.children[t].removeEmptyNodes(),this.children[t].children.length||this.children[t].data.length||this.children.splice(t,1)}},{"../collision/AABB":3,"../math/Vec3":31}],52:[function(t,e,n){function i(){this.objects=[],this.type=Object}e.exports=i,i.prototype.release=function(){for(var t=arguments.length,e=0;e!==t;e++)this.objects.push(arguments[e]);return this},i.prototype.get=function(){return 0===this.objects.length?this.constructObject():this.objects.pop()},i.prototype.constructObject=function(){throw new Error("constructObject() not implemented in this Pool subclass yet!")},i.prototype.resize=function(t){for(var e=this.objects;e.length>t;)e.pop();for(;e.lengthe){var n=e;e=t,t=n}return this.data[t+"-"+e]},i.prototype.set=function(t,e,n){if(t>e){var i=e;e=t,t=i}var r=t+"-"+e;this.get(t,e)||this.data.keys.push(r),this.data[r]=n},i.prototype.reset=function(){for(var t=this.data,e=t.keys;e.length>0;)delete t[e.pop()]}},{}],54:[function(t,e,n){function i(){}e.exports=i,i.defaults=function(t,e){for(var n in t=t||{},e)n in t||(t[n]=e[n]);return t}},{}],55:[function(t,e,n){e.exports=o;var i=t("../math/Vec3"),r=t("./Pool");function o(){r.call(this),this.type=i}o.prototype=new r,o.prototype.constructObject=function(){return new i}},{"../math/Vec3":31,"./Pool":52}],56:[function(t,e,n){e.exports=p;var i=t("../collision/AABB"),r=t("../objects/Body"),o=t("../shapes/Shape"),a=t("../collision/Ray"),s=t("../math/Vec3"),c=t("../math/Transform"),l=(t("../shapes/ConvexPolyhedron"),t("../math/Quaternion")),u=(t("../solver/Solver"),t("../utils/Vec3Pool")),h=t("../equations/ContactEquation"),d=t("../equations/FrictionEquation");function p(t){this.contactPointPool=[],this.frictionEquationPool=[],this.result=[],this.frictionResult=[],this.v3pool=new u,this.world=t,this.currentContactMaterial=null,this.enableFrictionReduction=!1}p.prototype.createContactEquation=function(t,e,n,i,r,o){var a;this.contactPointPool.length?((a=this.contactPointPool.pop()).bi=t,a.bj=e):a=new h(t,e),a.enabled=t.collisionResponse&&e.collisionResponse&&n.collisionResponse&&i.collisionResponse;var s=this.currentContactMaterial;a.restitution=s.restitution,a.setSpookParams(s.contactEquationStiffness,s.contactEquationRelaxation,this.world.dt);var c=n.material||t.material,l=i.material||e.material;return c&&l&&c.restitution>=0&&l.restitution>=0&&(a.restitution=c.restitution*l.restitution),a.si=r||n,a.sj=o||i,a},p.prototype.createFrictionEquationsFromContact=function(t,e){var n=t.bi,i=t.bj,r=t.si,o=t.sj,a=this.world,s=this.currentContactMaterial,c=s.friction,l=r.material||n.material,u=o.material||i.material;if(l&&u&&l.friction>=0&&u.friction>=0&&(c=l.friction*u.friction),c>0){var h=c*a.gravity.length(),p=n.invMass+i.invMass;p>0&&(p=1/p);var f=this.frictionEquationPool,m=f.length?f.pop():new d(n,i,h*p),v=f.length?f.pop():new d(n,i,h*p);return m.bi=v.bi=n,m.bj=v.bj=i,m.minForce=v.minForce=-h*p,m.maxForce=v.maxForce=h*p,m.ri.copy(t.ri),m.rj.copy(t.rj),v.ri.copy(t.ri),v.rj.copy(t.rj),t.ni.tangents(m.t,v.t),m.setSpookParams(s.frictionEquationStiffness,s.frictionEquationRelaxation,a.dt),v.setSpookParams(s.frictionEquationStiffness,s.frictionEquationRelaxation,a.dt),m.enabled=v.enabled=t.enabled,e.push(m,v),!0}return!1};var f=new s,m=new s,v=new s;p.prototype.createFrictionFromAverage=function(t){var e=this.result[this.result.length-1];if(this.createFrictionEquationsFromContact(e,this.frictionResult)&&1!==t){var n=this.frictionResult[this.frictionResult.length-2],i=this.frictionResult[this.frictionResult.length-1];f.setZero(),m.setZero(),v.setZero();for(var r=e.bi,o=(e.bj,0);o!==t;o++)(e=this.result[this.result.length-1-o]).bodyA!==r?(f.vadd(e.ni,f),m.vadd(e.ri,m),v.vadd(e.rj,v)):(f.vsub(e.ni,f),m.vadd(e.rj,m),v.vadd(e.ri,v));var a=1/t;m.scale(a,n.ri),v.scale(a,n.rj),i.ri.copy(n.ri),i.rj.copy(n.rj),f.normalize(),f.tangents(n.t,i.t)}};var g=new s,y=new s,x=new l,w=new l;p.prototype.getContacts=function(t,e,n,i,o,a,s){this.contactPointPool=o,this.frictionEquationPool=s,this.result=i,this.frictionResult=a;for(var c=x,l=w,u=g,h=y,d=0,p=t.length;d!==p;d++){var f=t[d],m=e[d],v=null;f.material&&m.material&&(v=n.getContactMaterial(f.material,m.material)||null);for(var b=f.type&r.KINEMATIC&&m.type&r.STATIC||f.type&r.STATIC&&m.type&r.KINEMATIC||f.type&r.KINEMATIC&&m.type&r.KINEMATIC,_=0;_S.boundingSphereRadius+A.boundingSphereRadius)){var E=null;S.material&&A.material&&(E=n.getContactMaterial(S.material,A.material)||null),this.currentContactMaterial=E||v||n.defaultContactMaterial;var T=this[S.type|A.type];T&&(S.type0&&H<0&&(g.vsub(p,y),v.copy(m),v.normalize(),G=y.dot(v),v.scale(G,y),y.vadd(p,y),(Z=y.distanceTo(g))0&&!0===i||u<=0&&!1===i))return!1;null===i&&(i=u>0)}return!0}var W=new s,q=new s,X=new s,Y=new s,Q=[new s,new s,new s,new s,new s,new s],K=new s,Z=new s,J=new s,$=new s;p.prototype[o.types.SPHERE|o.types.BOX]=p.prototype.sphereBox=function(t,e,n,i,r,o,a,s,c,l,u){var h=this.v3pool,d=Q;n.vsub(i,W),e.getSideNormals(d,o);for(var p=t.radius,f=!1,m=Z,v=J,g=$,y=null,x=0,w=0,b=0,_=null,S=0,M=d.length;S!==M&&!1===f;S++){var A=q;A.copy(d[S]);var E=A.norm();A.normalize();var T=W.dot(A);if(T0){var P=X,L=Y;P.copy(d[(S+1)%3]),L.copy(d[(S+2)%3]);var C=P.norm(),R=L.norm();P.normalize(),L.normalize();var O=W.dot(P),F=W.dot(L);if(O-C&&F-R){var I=Math.abs(T-E-p);if((null===_||I<_)&&(_=I,w=O,b=F,y=E,m.copy(A),v.copy(P),g.copy(L),x++,u))return!0}}}if(x){f=!0;var N=this.createContactEquation(a,s,t,e,c,l);m.mult(-p,N.ri),N.ni.copy(m),N.ni.negate(N.ni),m.mult(y,m),v.mult(w,v),m.vadd(v,m),g.mult(b,g),m.vadd(g,N.rj),N.ri.vadd(n,N.ri),N.ri.vsub(a.position,N.ri),N.rj.vadd(i,N.rj),N.rj.vsub(s.position,N.rj),this.result.push(N),this.createFrictionEquationsFromContact(N,this.frictionResult)}for(var B=h.get(),D=K,k=0;2!==k&&!f;k++)for(var z=0;2!==z&&!f;z++)for(var V=0;2!==V&&!f;V++)if(B.set(0,0,0),k?B.vadd(d[0],B):B.vsub(d[0],B),z?B.vadd(d[1],B):B.vsub(d[1],B),V?B.vadd(d[2],B):B.vsub(d[2],B),i.vadd(B,D),D.vsub(n,D),D.norm2()0){for(var C=[],R=0,O=S.length;R!==O;R++){var F=h.get();o.vmult(f[S[R]],F),i.vadd(F,F),C.push(F)}if(G(C,M,n)){if(u)return!0;w=!0;var I=this.createContactEquation(a,s,t,e,c,l);M.mult(-m,I.ri),M.negate(I.ni);var N=h.get();M.mult(-P,N);var B=h.get();M.mult(-m,B),n.vsub(i,I.rj),I.rj.vadd(B,I.rj),I.rj.vadd(N,I.rj),I.rj.vadd(i,I.rj),I.rj.vsub(s.position,I.rj),I.ri.vadd(n,I.ri),I.ri.vsub(a.position,I.ri),h.release(N),h.release(B),this.result.push(I),this.createFrictionEquationsFromContact(I,this.frictionResult),R=0;for(var D=C.length;R!==D;R++)h.release(C[R]);return}for(R=0;R!==S.length;R++){var k=h.get(),z=h.get();o.vmult(f[S[(R+1)%S.length]],k),o.vmult(f[S[(R+2)%S.length]],z),i.vadd(k,k),i.vadd(z,z);var V=et;z.vsub(k,V);var U=nt;V.unit(U);var j=h.get(),H=h.get();n.vsub(k,H);var W=H.dot(U);U.mult(W,j),j.vadd(k,j);var q=h.get();if(j.vsub(n,q),W>0&&W*Wt.boundingSphereRadius+e.boundingSphereRadius)&&t.findSeparatingAxis(e,n,r,i,o,p,h,d)){var f=[],m=mt;t.clipAgainstHull(n,r,e,i,o,p,-100,100,f);for(var v=0,g=0;g!==f.length;g++){if(u)return!0;var y=this.createContactEquation(a,s,t,e,c,l),x=y.ri,w=y.rj;p.negate(y.ni),f[g].normal.negate(m),m.mult(f[g].depth,m),f[g].point.vadd(m,x),w.copy(f[g].point),x.vsub(n,x),w.vsub(i,w),x.vadd(n,x),x.vsub(a.position,x),w.vadd(i,w),w.vsub(s.position,w),this.result.push(y),v++,this.enableFrictionReduction||this.createFrictionEquationsFromContact(y,this.frictionResult)}this.enableFrictionReduction&&v&&this.createFrictionFromAverage(v)}};var vt=new s,gt=new s,yt=new s;p.prototype[o.types.PLANE|o.types.PARTICLE]=p.prototype.planeParticle=function(t,e,n,i,r,o,a,s,c,l,u){var h=vt;h.set(0,0,1),a.quaternion.vmult(h,h);var d=gt;if(i.vsub(a.position,d),h.dot(d)<=0){if(u)return!0;var p=this.createContactEquation(s,a,e,t,c,l);p.ni.copy(h),p.ni.negate(p.ni),p.ri.set(0,0,0);var f=yt;h.mult(h.dot(i),f),i.vsub(f,f),p.rj.copy(f),this.result.push(p),this.createFrictionEquationsFromContact(p,this.frictionResult)}};var xt=new s;p.prototype[o.types.PARTICLE|o.types.SPHERE]=p.prototype.sphereParticle=function(t,e,n,i,r,o,a,s,c,l,u){var h=xt;if(h.set(0,0,1),i.vsub(n,h),h.norm2()<=t.radius*t.radius){if(u)return!0;var d=this.createContactEquation(s,a,e,t,c,l);h.normalize(),d.rj.copy(h),d.rj.mult(t.radius,d.rj),d.ni.copy(h),d.ni.negate(d.ni),d.ri.set(0,0,0),this.result.push(d),this.createFrictionEquationsFromContact(d,this.frictionResult)}};var wt=new l,bt=new s,_t=(new s,new s),St=new s,Mt=new s;p.prototype[o.types.PARTICLE|o.types.CONVEXPOLYHEDRON]=p.prototype.convexParticle=function(t,e,n,i,r,o,a,s,c,l,u){var h=-1,d=_t,p=Mt,f=null,m=bt;if(m.copy(i),m.vsub(n,m),r.conjugate(wt),wt.vmult(m,m),t.pointIsInside(m)){t.worldVerticesNeedsUpdate&&t.computeWorldVertices(n,r),t.worldFaceNormalsNeedsUpdate&&t.computeWorldFaceNormals(r);for(var v=0,g=t.faces.length;v!==g;v++){var y=[t.worldVertices[t.faces[v][0]]],x=t.worldFaceNormals[v];i.vsub(y[0],St);var w=-x.dot(St);if(null===f||Math.abs(w)d.length||w>d[0].length)){y<0&&(y=0),x<0&&(x=0),w<0&&(w=0),b<0&&(b=0),y>=d.length&&(y=d.length-1),x>=d.length&&(x=d.length-1),b>=d[0].length&&(b=d[0].length-1),w>=d[0].length&&(w=d[0].length-1);var _=[];e.getRectMinMax(y,w,x,b,_);var S=_[0],M=_[1];if(!(g.z-f>M||g.z+fd.length||x>d[0].length)){g<0&&(g=0),y<0&&(y=0),x<0&&(x=0),w<0&&(w=0),g>=d.length&&(g=d.length-1),y>=d.length&&(y=d.length-1),w>=d[0].length&&(w=d[0].length-1),x>=d[0].length&&(x=d[0].length-1);var b=[];e.getRectMinMax(g,x,y,w,b);var _=b[0],S=b[1];if(!(v.z-p>S||v.z+p<_))for(var M=this.result,A=g;A2)return}}}},{"../collision/AABB":3,"../collision/Ray":10,"../equations/ContactEquation":20,"../equations/FrictionEquation":22,"../math/Quaternion":29,"../math/Transform":30,"../math/Vec3":31,"../objects/Body":32,"../shapes/ConvexPolyhedron":39,"../shapes/Shape":44,"../solver/Solver":48,"../utils/Vec3Pool":55}],57:[function(t,e,n){e.exports=y,t("../shapes/Shape");var i=t("../math/Vec3"),r=t("../math/Quaternion"),o=t("../solver/GSSolver"),a=(t("../equations/ContactEquation"),t("../equations/FrictionEquation"),t("./Narrowphase")),s=t("../utils/EventTarget"),c=t("../collision/ArrayCollisionMatrix"),l=t("../collision/OverlapKeeper"),u=t("../material/Material"),h=t("../material/ContactMaterial"),d=t("../objects/Body"),p=t("../utils/TupleDictionary"),f=t("../collision/RaycastResult"),m=t("../collision/AABB"),v=t("../collision/Ray"),g=t("../collision/NaiveBroadphase");function y(t){t=t||{},s.apply(this),this.dt=-1,this.allowSleep=!!t.allowSleep,this.contacts=[],this.frictionEquations=[],this.quatNormalizeSkip=void 0!==t.quatNormalizeSkip?t.quatNormalizeSkip:0,this.quatNormalizeFast=void 0!==t.quatNormalizeFast&&t.quatNormalizeFast,this.time=0,this.interpolationFactor=0,this.stepnumber=0,this.default_dt=1/60,this.nextId=0,this.gravity=new i,t.gravity&&this.gravity.copy(t.gravity),this.broadphase=void 0!==t.broadphase?t.broadphase:new g,this.bodies=[],this.solver=void 0!==t.solver?t.solver:new o,this.constraints=[],this.narrowphase=new a(this),this.collisionMatrix=new c,this.collisionMatrixPrevious=new c,this.bodyOverlapKeeper=new l,this.shapeOverlapKeeper=new l,this.materials=[],this.contactmaterials=[],this.contactMaterialTable=new p,this.defaultMaterial=new u("default"),this.defaultContactMaterial=new h(this.defaultMaterial,this.defaultMaterial,{friction:.3,restitution:0}),this.doProfiling=!1,this.profile={solve:0,makeContactConstraints:0,broadphase:0,integrate:0,narrowphase:0},this.accumulator=0,this.subsystems=[],this.addBodyEvent={type:"addBody",body:null},this.removeBodyEvent={type:"removeBody",body:null},this.idToBodyMap={},this.broadphase.setWorld(this)}y.prototype=new s,new m;var x=new v;if(y.prototype.getContactMaterial=function(t,e){return this.contactMaterialTable.get(t.id,e.id)},y.prototype.numObjects=function(){return this.bodies.length},y.prototype.collisionMatrixTick=function(){var t=this.collisionMatrixPrevious;this.collisionMatrixPrevious=this.collisionMatrix,this.collisionMatrix=t,this.collisionMatrix.reset(),this.bodyOverlapKeeper.tick(),this.shapeOverlapKeeper.tick()},y.prototype.add=y.prototype.addBody=function(t){-1===this.bodies.indexOf(t)&&(t.index=this.bodies.length,this.bodies.push(t),t.world=this,t.initPosition.copy(t.position),t.initVelocity.copy(t.velocity),t.timeLastSleepy=this.time,t instanceof d&&(t.initAngularVelocity.copy(t.angularVelocity),t.initQuaternion.copy(t.quaternion)),this.collisionMatrix.setNumObjects(this.bodies.length),this.addBodyEvent.body=t,this.idToBodyMap[t.id]=t,this.dispatchEvent(this.addBodyEvent))},y.prototype.addConstraint=function(t){this.constraints.push(t)},y.prototype.removeConstraint=function(t){var e=this.constraints.indexOf(t);-1!==e&&this.constraints.splice(e,1)},y.prototype.rayTest=function(t,e,n){n instanceof f?this.raycastClosest(t,e,{skipBackfaces:!0},n):this.raycastAll(t,e,{skipBackfaces:!0},n)},y.prototype.raycastAll=function(t,e,n,i){return n.mode=v.ALL,n.from=t,n.to=e,n.callback=i,x.intersectWorld(this,n)},y.prototype.raycastAny=function(t,e,n,i){return n.mode=v.ANY,n.from=t,n.to=e,n.result=i,x.intersectWorld(this,n)},y.prototype.raycastClosest=function(t,e,n,i){return n.mode=v.CLOSEST,n.from=t,n.to=e,n.result=i,x.intersectWorld(this,n)},y.prototype.remove=function(t){t.world=null;var e=this.bodies.length-1,n=this.bodies,i=n.indexOf(t);if(-1!==i){n.splice(i,1);for(var r=0;r!==n.length;r++)n[r].index=r;this.collisionMatrix.setNumObjects(e),this.removeBodyEvent.body=t,delete this.idToBodyMap[t.id],this.dispatchEvent(this.removeBodyEvent)}},y.prototype.removeBody=y.prototype.remove,y.prototype.getBodyById=function(t){return this.idToBodyMap[t]},y.prototype.getShapeById=function(t){for(var e=this.bodies,n=0,i=e.length;n=t&&i=0;S-=1)(U.bodyA===i[S]&&U.bodyB===r[S]||U.bodyB===i[S]&&U.bodyA===r[S])&&(i.splice(S,1),r.splice(S,1));this.collisionMatrixTick(),l&&(e=performance.now());var M=C,A=n.length;for(y=0;y!==A;y++)M.push(n[y]);n.length=0;var E=this.frictionEquations.length;for(y=0;y!==E;y++)f.push(this.frictionEquations[y]);for(this.frictionEquations.length=0,this.narrowphase.getContacts(i,r,this,n,M,this.frictionEquations,f),l&&(u.narrowphase=performance.now()-e),l&&(e=performance.now()),y=0;y=0&&k.material.friction>=0&&(D.material.friction,k.material.friction),D.material.restitution>=0&&k.material.restitution>=0&&(U.restitution=D.material.restitution*k.material.restitution)),s.addEquation(U),D.allowSleep&&D.type===d.DYNAMIC&&D.sleepState===d.SLEEPING&&k.sleepState===d.AWAKE&&k.type!==d.STATIC&&k.velocity.norm2()+k.angularVelocity.norm2()>=2*Math.pow(k.sleepSpeedLimit,2)&&(D._wakeUpAfterNarrowphase=!0),k.allowSleep&&k.type===d.DYNAMIC&&k.sleepState===d.SLEEPING&&D.sleepState===d.AWAKE&&D.type!==d.STATIC&&D.velocity.norm2()+D.angularVelocity.norm2()>=2*Math.pow(D.sleepSpeedLimit,2)&&(k._wakeUpAfterNarrowphase=!0),this.collisionMatrix.set(D,k,!0),this.collisionMatrixPrevious.get(D,k)||(L.body=k,L.contact=U,D.dispatchEvent(L),L.body=D,k.dispatchEvent(L)),this.bodyOverlapKeeper.set(D.id,k.id),this.shapeOverlapKeeper.set(z.id,V.id)}for(this.emitContactEvents(),l&&(u.makeContactConstraints=performance.now()-e,e=performance.now()),y=0;y!==o;y++)(D=a[y])._wakeUpAfterNarrowphase&&(D.wakeUp(),D._wakeUpAfterNarrowphase=!1);for(_=p.length,y=0;y!==_;y++){var U;(U=p[y]).update(),S=0;for(var j=U.equations.length;S!==j;S++){var H=U.equations[S];s.addEquation(H)}}s.solve(t,this),l&&(u.solve=performance.now()-e),s.removeAllEquations();var G=Math.pow;for(y=0;y!==o;y++)if((D=a[y]).type&h){var W=G(I(1-D.linearDamping),t),q=D.velocity;q.mult(W,q);var X=D.angularVelocity;if(X){var Y=G(I(1-D.angularDamping),t);X.mult(Y,X)}}for(this.dispatchEvent(P),y=0;y!==o;y++)(D=a[y]).preStep&&D.preStep(D);l&&(e=performance.now());var Q=this.stepnumber%(this.quatNormalizeSkip+1)==0,K=this.quatNormalizeFast;for(y=0;y!==o;y++)a[y].integrate(t,Q,K);for(this.clearForces(),this.broadphase.dirty=!0,l&&(u.integrate=performance.now()-e),this.time+=t,this.stepnumber+=1,this.dispatchEvent(T),y=0;y!==o;y++){var Z=(D=a[y]).postStep;Z&&Z(D)}if(this.allowSleep)for(y=0;y!==o;y++)a[y].sleepTick(this.time)},y.prototype.emitContactEvents=(b=[],_=[],S={type:"beginContact",bodyA:null,bodyB:null},M={type:"endContact",bodyA:null,bodyB:null},A={type:"beginShapeContact",bodyA:null,bodyB:null,shapeA:null,shapeB:null},E={type:"endShapeContact",bodyA:null,bodyB:null,shapeA:null,shapeB:null},function(){var t=this.hasAnyEventListener("beginContact"),e=this.hasAnyEventListener("endContact");if((t||e)&&this.bodyOverlapKeeper.getDiff(b,_),t){for(var n=0,i=b.length;n1-n?0:i<-1+n?Math.PI:Math.acos(i)},e.getSignedAngleBetweenVectors=function(t,e,n,r){void 0===n&&(n=new i.Vector3(0,1,0)),void 0===r&&(r=5e-4);var o=this.getAngleBetweenVectors(t,e,r),a=(new i.Vector3).crossVectors(t,e);return n.dot(a)<0&&(o=-o),o},e.haveSameSigns=function(t,e){return t<0==e<0},e.haveDifferentSigns=function(t,e){return t<0!=e<0},e.setDefaults=function(t,e){return o.defaults({},o.clone(t),e)},e.getGlobalProperties=function(t){void 0===t&&(t="");var e=[],n=window;for(var i in n)0===i.indexOf(t)&&e.push(i);return e},e.spring=function(t,e,n,i,r){var o=e-t;n+=o/=i;var s=t+(n*=r);return new a.SimulationFrame(s,n)},e.springV=function(t,e,n,r,o){var a=(new i.Vector3).subVectors(e,t);a.divideScalar(r),n.add(a),n.multiplyScalar(o),t.add(n)},e.threeVector=function(t){return new i.Vector3(t.x,t.y,t.z)},e.cannonVector=function(t){return new r.Vec3(t.x,t.y,t.z)},e.threeQuat=function(t){return new i.Quaternion(t.x,t.y,t.z,t.w)},e.cannonQuat=function(t){return new r.Quaternion(t.x,t.y,t.z,t.w)},e.setupMeshProperties=function(t){if(t.castShadow=!0,t.receiveShadow=!0,null!==t.material.map){var e=new i.MeshPhongMaterial;e.shininess=0,e.name=t.material.name,e.map=t.material.map,e.map.anisotropy=4,e.aoMap=t.material.aoMap,e.transparent=t.material.transparent,e.skinning=t.material.skinning,t.material=e}},e.detectRelativeSide=function(t,e){var n=l(t,c.Space.Local),i=e.position.clone().sub(t.position).normalize();return n.dot(i)>0?s.Side.Left:s.Side.Right},e.easeInOutSine=function(t){return-(Math.cos(Math.PI*t)-1)/2},e.easeOutQuad=function(t){return 1-(1-t)*(1-t)},e.getRight=l,e.getUp=function(t,e){void 0===e&&(e=c.Space.Global);var n=u(t,e);return new i.Vector3(n.elements[4],n.elements[5],n.elements[6])},e.getForward=function(t,e){void 0===e&&(e=c.Space.Global);var n=u(t,e);return new i.Vector3(n.elements[8],n.elements[9],n.elements[10])},e.getBack=function(t,e){void 0===e&&(e=c.Space.Global);var n=u(t,e);return new i.Vector3(-n.elements[8],-n.elements[9],-n.elements[10])},e.getMatrix=u,e.countSleepyBodies=function(){}},function(t,e,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||i(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),r(n(66),e),r(n(67),e),r(n(26),e),r(n(68),e),r(n(69),e),r(n(17),e),r(n(9),e),r(n(70),e),r(n(71),e),r(n(72),e),r(n(73),e),r(n(74),e),r(n(75),e),r(n(76),e),r(n(77),e),r(n(78),e),r(n(79),e),r(n(80),e),r(n(81),e)},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i,r,o,a=n(0);function s(){this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}Object.assign(s.prototype,{setSize:function(){},render:function(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}}),s.FullScreenQuad=(i=new a.OrthographicCamera(-1,1,1,-1,0,1),r=new a.PlaneBufferGeometry(2,2),o=function(t){this._mesh=new a.Mesh(r,t)},Object.defineProperty(o.prototype,"material",{get:function(){return this._mesh.material},set:function(t){this._mesh.material=t}}),Object.assign(o.prototype,{dispose:function(){this._mesh.geometry.dispose()},render:function(t){t.render(this._mesh,i)}}),o)},function(t,e,n){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=function(t,e){var n=t[1]||"",i=t[3];if(!i)return n;if(e&&"function"==typeof btoa){var r=(a=i,s=btoa(unescape(encodeURIComponent(JSON.stringify(a)))),c="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(s),"/*# ".concat(c," */")),o=i.sources.map((function(t){return"/*# sourceURL=".concat(i.sourceRoot||"").concat(t," */")}));return[n].concat(o).concat([r]).join("\n")}var a,s,c;return[n].join("\n")}(e,t);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,i){"string"==typeof t&&(t=[[null,t,""]]);var r={};if(i)for(var o=0;o + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */(function(){var o="Expected a function",a="__lodash_placeholder__",s=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],c="[object Arguments]",l="[object Array]",u="[object Boolean]",h="[object Date]",d="[object Error]",p="[object Function]",f="[object GeneratorFunction]",m="[object Map]",v="[object Number]",g="[object Object]",y="[object RegExp]",x="[object Set]",w="[object String]",b="[object Symbol]",_="[object WeakMap]",S="[object ArrayBuffer]",M="[object DataView]",A="[object Float32Array]",E="[object Float64Array]",T="[object Int8Array]",P="[object Int16Array]",L="[object Int32Array]",C="[object Uint8Array]",R="[object Uint16Array]",O="[object Uint32Array]",F=/\b__p \+= '';/g,I=/\b(__p \+=) '' \+/g,N=/(__e\(.*?\)|\b__t\)) \+\n'';/g,B=/&(?:amp|lt|gt|quot|#39);/g,D=/[&<>"']/g,k=RegExp(B.source),z=RegExp(D.source),V=/<%-([\s\S]+?)%>/g,U=/<%([\s\S]+?)%>/g,j=/<%=([\s\S]+?)%>/g,H=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,G=/^\w*$/,W=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,q=/[\\^$.*+?()[\]{}|]/g,X=RegExp(q.source),Y=/^\s+/,Q=/\s/,K=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Z=/\{\n\/\* \[wrapped with (.+)\] \*/,J=/,? & /,$=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,tt=/[()=,{}\[\]\/\s]/,et=/\\(\\)?/g,nt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,it=/\w*$/,rt=/^[-+]0x[0-9a-f]+$/i,ot=/^0b[01]+$/i,at=/^\[object .+?Constructor\]$/,st=/^0o[0-7]+$/i,ct=/^(?:0|[1-9]\d*)$/,lt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ut=/($^)/,ht=/['\n\r\u2028\u2029\\]/g,dt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",pt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ft="[\\ud800-\\udfff]",mt="["+pt+"]",vt="["+dt+"]",gt="\\d+",yt="[\\u2700-\\u27bf]",xt="[a-z\\xdf-\\xf6\\xf8-\\xff]",wt="[^\\ud800-\\udfff"+pt+gt+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",bt="\\ud83c[\\udffb-\\udfff]",_t="[^\\ud800-\\udfff]",St="(?:\\ud83c[\\udde6-\\uddff]){2}",Mt="[\\ud800-\\udbff][\\udc00-\\udfff]",At="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Et="(?:"+xt+"|"+wt+")",Tt="(?:"+At+"|"+wt+")",Pt="(?:"+vt+"|"+bt+")"+"?",Lt="[\\ufe0e\\ufe0f]?"+Pt+("(?:\\u200d(?:"+[_t,St,Mt].join("|")+")[\\ufe0e\\ufe0f]?"+Pt+")*"),Ct="(?:"+[yt,St,Mt].join("|")+")"+Lt,Rt="(?:"+[_t+vt+"?",vt,St,Mt,ft].join("|")+")",Ot=RegExp("['’]","g"),Ft=RegExp(vt,"g"),It=RegExp(bt+"(?="+bt+")|"+Rt+Lt,"g"),Nt=RegExp([At+"?"+xt+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[mt,At,"$"].join("|")+")",Tt+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[mt,At+Et,"$"].join("|")+")",At+"?"+Et+"+(?:['’](?:d|ll|m|re|s|t|ve))?",At+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",gt,Ct].join("|"),"g"),Bt=RegExp("[\\u200d\\ud800-\\udfff"+dt+"\\ufe0e\\ufe0f]"),Dt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,kt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],zt=-1,Vt={};Vt[A]=Vt[E]=Vt[T]=Vt[P]=Vt[L]=Vt[C]=Vt["[object Uint8ClampedArray]"]=Vt[R]=Vt[O]=!0,Vt[c]=Vt[l]=Vt[S]=Vt[u]=Vt[M]=Vt[h]=Vt[d]=Vt[p]=Vt[m]=Vt[v]=Vt[g]=Vt[y]=Vt[x]=Vt[w]=Vt[_]=!1;var Ut={};Ut[c]=Ut[l]=Ut[S]=Ut[M]=Ut[u]=Ut[h]=Ut[A]=Ut[E]=Ut[T]=Ut[P]=Ut[L]=Ut[m]=Ut[v]=Ut[g]=Ut[y]=Ut[x]=Ut[w]=Ut[b]=Ut[C]=Ut["[object Uint8ClampedArray]"]=Ut[R]=Ut[O]=!0,Ut[d]=Ut[p]=Ut[_]=!1;var jt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ht=parseFloat,Gt=parseInt,Wt="object"==typeof t&&t&&t.Object===Object&&t,qt="object"==typeof self&&self&&self.Object===Object&&self,Xt=Wt||qt||Function("return this")(),Yt=e&&!e.nodeType&&e,Qt=Yt&&"object"==typeof i&&i&&!i.nodeType&&i,Kt=Qt&&Qt.exports===Yt,Zt=Kt&&Wt.process,Jt=function(){try{var t=Qt&&Qt.require&&Qt.require("util").types;return t||Zt&&Zt.binding&&Zt.binding("util")}catch(t){}}(),$t=Jt&&Jt.isArrayBuffer,te=Jt&&Jt.isDate,ee=Jt&&Jt.isMap,ne=Jt&&Jt.isRegExp,ie=Jt&&Jt.isSet,re=Jt&&Jt.isTypedArray;function oe(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function ae(t,e,n,i){for(var r=-1,o=null==t?0:t.length;++r-1}function de(t,e,n){for(var i=-1,r=null==t?0:t.length;++i-1;);return n}function Ne(t,e){for(var n=t.length;n--&&be(e,t[n],0)>-1;);return n}function Be(t,e){for(var n=t.length,i=0;n--;)t[n]===e&&++i;return i}var De=Ee({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),ke=Ee({"&":"&","<":"<",">":">",'"':""","'":"'"});function ze(t){return"\\"+jt[t]}function Ve(t){return Bt.test(t)}function Ue(t){var e=-1,n=Array(t.size);return t.forEach((function(t,i){n[++e]=[i,t]})),n}function je(t,e){return function(n){return t(e(n))}}function He(t,e){for(var n=-1,i=t.length,r=0,o=[];++n",""":'"',"'":"'"});var Ke=function t(e){var n,i=(e=null==e?Xt:Ke.defaults(Xt.Object(),e,Ke.pick(Xt,kt))).Array,r=e.Date,Q=e.Error,dt=e.Function,pt=e.Math,ft=e.Object,mt=e.RegExp,vt=e.String,gt=e.TypeError,yt=i.prototype,xt=dt.prototype,wt=ft.prototype,bt=e["__core-js_shared__"],_t=xt.toString,St=wt.hasOwnProperty,Mt=0,At=(n=/[^.]+$/.exec(bt&&bt.keys&&bt.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Et=wt.toString,Tt=_t.call(ft),Pt=Xt._,Lt=mt("^"+_t.call(St).replace(q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ct=Kt?e.Buffer:void 0,Rt=e.Symbol,It=e.Uint8Array,Bt=Ct?Ct.allocUnsafe:void 0,jt=je(ft.getPrototypeOf,ft),Wt=ft.create,qt=wt.propertyIsEnumerable,Yt=yt.splice,Qt=Rt?Rt.isConcatSpreadable:void 0,Zt=Rt?Rt.iterator:void 0,Jt=Rt?Rt.toStringTag:void 0,ye=function(){try{var t=to(ft,"defineProperty");return t({},"",{}),t}catch(t){}}(),Ee=e.clearTimeout!==Xt.clearTimeout&&e.clearTimeout,Ze=r&&r.now!==Xt.Date.now&&r.now,Je=e.setTimeout!==Xt.setTimeout&&e.setTimeout,$e=pt.ceil,tn=pt.floor,en=ft.getOwnPropertySymbols,nn=Ct?Ct.isBuffer:void 0,rn=e.isFinite,on=yt.join,an=je(ft.keys,ft),sn=pt.max,cn=pt.min,ln=r.now,un=e.parseInt,hn=pt.random,dn=yt.reverse,pn=to(e,"DataView"),fn=to(e,"Map"),mn=to(e,"Promise"),vn=to(e,"Set"),gn=to(e,"WeakMap"),yn=to(ft,"create"),xn=gn&&new gn,wn={},bn=Po(pn),_n=Po(fn),Sn=Po(mn),Mn=Po(vn),An=Po(gn),En=Rt?Rt.prototype:void 0,Tn=En?En.valueOf:void 0,Pn=En?En.toString:void 0;function Ln(t){if(Wa(t)&&!Ia(t)&&!(t instanceof Fn)){if(t instanceof On)return t;if(St.call(t,"__wrapped__"))return Lo(t)}return new On(t)}var Cn=function(){function t(){}return function(e){if(!Ga(e))return{};if(Wt)return Wt(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function Rn(){}function On(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}function Fn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function In(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function Zn(t,e,n,i,r,o){var a,s=1&e,l=2&e,d=4&e;if(n&&(a=r?n(t,i,r,o):n(t)),void 0!==a)return a;if(!Ga(t))return t;var _=Ia(t);if(_){if(a=function(t){var e=t.length,n=new t.constructor(e);e&&"string"==typeof t[0]&&St.call(t,"index")&&(n.index=t.index,n.input=t.input);return n}(t),!s)return yr(t,a)}else{var F=io(t),I=F==p||F==f;if(ka(t))return dr(t,s);if(F==g||F==c||I&&!r){if(a=l||I?{}:oo(t),!s)return l?function(t,e){return xr(t,no(t),e)}(t,function(t,e){return t&&xr(e,_s(e),t)}(a,t)):function(t,e){return xr(t,eo(t),e)}(t,Xn(a,t))}else{if(!Ut[F])return r?t:{};a=function(t,e,n){var i=t.constructor;switch(e){case S:return pr(t);case u:case h:return new i(+t);case M:return function(t,e){var n=e?pr(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case A:case E:case T:case P:case L:case C:case"[object Uint8ClampedArray]":case R:case O:return fr(t,n);case m:return new i;case v:case w:return new i(t);case y:return function(t){var e=new t.constructor(t.source,it.exec(t));return e.lastIndex=t.lastIndex,e}(t);case x:return new i;case b:return r=t,Tn?ft(Tn.call(r)):{}}var r}(t,F,s)}}o||(o=new kn);var N=o.get(t);if(N)return N;o.set(t,a),Ka(t)?t.forEach((function(i){a.add(Zn(i,e,n,i,t,o))})):qa(t)&&t.forEach((function(i,r){a.set(r,Zn(i,e,n,r,t,o))}));var B=_?void 0:(d?l?Xr:qr:l?_s:bs)(t);return se(B||t,(function(i,r){B&&(i=t[r=i]),Gn(a,r,Zn(i,e,n,r,t,o))})),a}function Jn(t,e,n){var i=n.length;if(null==t)return!i;for(t=ft(t);i--;){var r=n[i],o=e[r],a=t[r];if(void 0===a&&!(r in t)||!o(a))return!1}return!0}function $n(t,e,n){if("function"!=typeof t)throw new gt(o);return bo((function(){t.apply(void 0,n)}),e)}function ti(t,e,n,i){var r=-1,o=he,a=!0,s=t.length,c=[],l=e.length;if(!s)return c;n&&(e=pe(e,Re(n))),i?(o=de,a=!1):e.length>=200&&(o=Fe,a=!1,e=new Dn(e));t:for(;++r-1},Nn.prototype.set=function(t,e){var n=this.__data__,i=Wn(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this},Bn.prototype.clear=function(){this.size=0,this.__data__={hash:new In,map:new(fn||Nn),string:new In}},Bn.prototype.delete=function(t){var e=Jr(this,t).delete(t);return this.size-=e?1:0,e},Bn.prototype.get=function(t){return Jr(this,t).get(t)},Bn.prototype.has=function(t){return Jr(this,t).has(t)},Bn.prototype.set=function(t,e){var n=Jr(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this},Dn.prototype.add=Dn.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Dn.prototype.has=function(t){return this.__data__.has(t)},kn.prototype.clear=function(){this.__data__=new Nn,this.size=0},kn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},kn.prototype.get=function(t){return this.__data__.get(t)},kn.prototype.has=function(t){return this.__data__.has(t)},kn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Nn){var i=n.__data__;if(!fn||i.length<199)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new Bn(i)}return n.set(t,e),this.size=n.size,this};var ei=_r(li),ni=_r(ui,!0);function ii(t,e){var n=!0;return ei(t,(function(t,i,r){return n=!!e(t,i,r)})),n}function ri(t,e,n){for(var i=-1,r=t.length;++i0&&n(s)?e>1?ai(s,e-1,n,i,r):fe(r,s):i||(r[r.length]=s)}return r}var si=Sr(),ci=Sr(!0);function li(t,e){return t&&si(t,e,bs)}function ui(t,e){return t&&ci(t,e,bs)}function hi(t,e){return ue(e,(function(e){return Ua(t[e])}))}function di(t,e){for(var n=0,i=(e=cr(e,t)).length;null!=t&&ne}function vi(t,e){return null!=t&&St.call(t,e)}function gi(t,e){return null!=t&&e in ft(t)}function yi(t,e,n){for(var r=n?de:he,o=t[0].length,a=t.length,s=a,c=i(a),l=1/0,u=[];s--;){var h=t[s];s&&e&&(h=pe(h,Re(e))),l=cn(h.length,l),c[s]=!n&&(e||o>=120&&h.length>=120)?new Dn(s&&h):void 0}h=t[0];var d=-1,p=c[0];t:for(;++d=s)return c;var l=n[i];return c*("desc"==l?-1:1)}}return t.index-e.index}(t,e,n)}))}function Ii(t,e,n){for(var i=-1,r=e.length,o={};++i-1;)s!==t&&Yt.call(s,c,1),Yt.call(t,c,1);return t}function Bi(t,e){for(var n=t?e.length:0,i=n-1;n--;){var r=e[n];if(n==i||r!==o){var o=r;so(r)?Yt.call(t,r,1):tr(t,r)}}return t}function Di(t,e){return t+tn(hn()*(e-t+1))}function ki(t,e){var n="";if(!t||e<1||e>9007199254740991)return n;do{e%2&&(n+=t),(e=tn(e/2))&&(t+=t)}while(e);return n}function zi(t,e){return _o(vo(t,e,Xs),t+"")}function Vi(t){return Vn(Cs(t))}function Ui(t,e){var n=Cs(t);return Ao(n,Kn(e,0,n.length))}function ji(t,e,n,i){if(!Ga(t))return t;for(var r=-1,o=(e=cr(e,t)).length,a=o-1,s=t;null!=s&&++ro?0:o+e),(n=n>o?o:n)<0&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var a=i(o);++r>>1,a=t[o];null!==a&&!Ja(a)&&(n?a<=e:a=200){var l=e?null:kr(t);if(l)return Ge(l);a=!1,r=Fe,c=new Dn}else c=e?[]:s;t:for(;++i=i?t:qi(t,e,n)}var hr=Ee||function(t){return Xt.clearTimeout(t)};function dr(t,e){if(e)return t.slice();var n=t.length,i=Bt?Bt(n):new t.constructor(n);return t.copy(i),i}function pr(t){var e=new t.constructor(t.byteLength);return new It(e).set(new It(t)),e}function fr(t,e){var n=e?pr(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function mr(t,e){if(t!==e){var n=void 0!==t,i=null===t,r=t==t,o=Ja(t),a=void 0!==e,s=null===e,c=e==e,l=Ja(e);if(!s&&!l&&!o&&t>e||o&&a&&c&&!s&&!l||i&&a&&c||!n&&c||!r)return 1;if(!i&&!o&&!l&&t1?n[r-1]:void 0,a=r>2?n[2]:void 0;for(o=t.length>3&&"function"==typeof o?(r--,o):void 0,a&&co(n[0],n[1],a)&&(o=r<3?void 0:o,r=1),e=ft(e);++i-1?r[o?e[a]:a]:void 0}}function Pr(t){return Wr((function(e){var n=e.length,i=n,r=On.prototype.thru;for(t&&e.reverse();i--;){var a=e[i];if("function"!=typeof a)throw new gt(o);if(r&&!s&&"wrapper"==Qr(a))var s=new On([],!0)}for(i=s?i:n;++i1&&x.reverse(),h&&ls))return!1;var l=o.get(t),u=o.get(e);if(l&&u)return l==e&&u==t;var h=-1,d=!0,p=2&n?new Dn:void 0;for(o.set(t,e),o.set(e,t);++h-1&&t%1==0&&t1?"& ":"")+e[i],e=e.join(n>2?", ":" "),t.replace(K,"{\n/* [wrapped with "+e+"] */\n")}(i,function(t,e){return se(s,(function(n){var i="_."+n[0];e&n[1]&&!he(t,i)&&t.push(i)})),t.sort()}(function(t){var e=t.match(Z);return e?e[1].split(J):[]}(i),n)))}function Mo(t){var e=0,n=0;return function(){var i=ln(),r=16-(i-n);if(n=i,r>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Ao(t,e){var n=-1,i=t.length,r=i-1;for(e=void 0===e?i:e;++n1?t[e-1]:void 0;return n="function"==typeof n?(t.pop(),n):void 0,Qo(t,n)}));function na(t){var e=Ln(t);return e.__chain__=!0,e}function ia(t,e){return e(t)}var ra=Wr((function(t){var e=t.length,n=e?t[0]:0,i=this.__wrapped__,r=function(e){return Qn(e,t)};return!(e>1||this.__actions__.length)&&i instanceof Fn&&so(n)?((i=i.slice(n,+n+(e?1:0))).__actions__.push({func:ia,args:[r],thisArg:void 0}),new On(i,this.__chain__).thru((function(t){return e&&!t.length&&t.push(void 0),t}))):this.thru(r)}));var oa=wr((function(t,e,n){St.call(t,n)?++t[n]:Yn(t,n,1)}));var aa=Tr(Fo),sa=Tr(Io);function ca(t,e){return(Ia(t)?se:ei)(t,Zr(e,3))}function la(t,e){return(Ia(t)?ce:ni)(t,Zr(e,3))}var ua=wr((function(t,e,n){St.call(t,n)?t[n].push(e):Yn(t,n,[e])}));var ha=zi((function(t,e,n){var r=-1,o="function"==typeof e,a=Ba(t)?i(t.length):[];return ei(t,(function(t){a[++r]=o?oe(e,t,n):xi(t,e,n)})),a})),da=wr((function(t,e,n){Yn(t,n,e)}));function pa(t,e){return(Ia(t)?pe:Pi)(t,Zr(e,3))}var fa=wr((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]}));var ma=zi((function(t,e){if(null==t)return[];var n=e.length;return n>1&&co(t,e[0],e[1])?e=[]:n>2&&co(e[0],e[1],e[2])&&(e=[e[0]]),Fi(t,ai(e,1),[])})),va=Ze||function(){return Xt.Date.now()};function ga(t,e,n){return e=n?void 0:e,Vr(t,128,void 0,void 0,void 0,void 0,e=t&&null==e?t.length:e)}function ya(t,e){var n;if("function"!=typeof e)throw new gt(o);return t=rs(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}}var xa=zi((function(t,e,n){var i=1;if(n.length){var r=He(n,Kr(xa));i|=32}return Vr(t,i,e,n,r)})),wa=zi((function(t,e,n){var i=3;if(n.length){var r=He(n,Kr(wa));i|=32}return Vr(e,i,t,n,r)}));function ba(t,e,n){var i,r,a,s,c,l,u=0,h=!1,d=!1,p=!0;if("function"!=typeof t)throw new gt(o);function f(e){var n=i,o=r;return i=r=void 0,u=e,s=t.apply(o,n)}function m(t){return u=t,c=bo(g,e),h?f(t):s}function v(t){var n=t-l;return void 0===l||n>=e||n<0||d&&t-u>=a}function g(){var t=va();if(v(t))return y(t);c=bo(g,function(t){var n=e-(t-l);return d?cn(n,a-(t-u)):n}(t))}function y(t){return c=void 0,p&&i?f(t):(i=r=void 0,s)}function x(){var t=va(),n=v(t);if(i=arguments,r=this,l=t,n){if(void 0===c)return m(l);if(d)return hr(c),c=bo(g,e),f(l)}return void 0===c&&(c=bo(g,e)),s}return e=as(e)||0,Ga(n)&&(h=!!n.leading,a=(d="maxWait"in n)?sn(as(n.maxWait)||0,e):a,p="trailing"in n?!!n.trailing:p),x.cancel=function(){void 0!==c&&hr(c),u=0,i=l=r=c=void 0},x.flush=function(){return void 0===c?s:y(va())},x}var _a=zi((function(t,e){return $n(t,1,e)})),Sa=zi((function(t,e,n){return $n(t,as(e)||0,n)}));function Ma(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new gt(o);var n=function(){var i=arguments,r=e?e.apply(this,i):i[0],o=n.cache;if(o.has(r))return o.get(r);var a=t.apply(this,i);return n.cache=o.set(r,a)||o,a};return n.cache=new(Ma.Cache||Bn),n}function Aa(t){if("function"!=typeof t)throw new gt(o);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Ma.Cache=Bn;var Ea=lr((function(t,e){var n=(e=1==e.length&&Ia(e[0])?pe(e[0],Re(Zr())):pe(ai(e,1),Re(Zr()))).length;return zi((function(i){for(var r=-1,o=cn(i.length,n);++r=e})),Fa=wi(function(){return arguments}())?wi:function(t){return Wa(t)&&St.call(t,"callee")&&!qt.call(t,"callee")},Ia=i.isArray,Na=$t?Re($t):function(t){return Wa(t)&&fi(t)==S};function Ba(t){return null!=t&&Ha(t.length)&&!Ua(t)}function Da(t){return Wa(t)&&Ba(t)}var ka=nn||ac,za=te?Re(te):function(t){return Wa(t)&&fi(t)==h};function Va(t){if(!Wa(t))return!1;var e=fi(t);return e==d||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!Ya(t)}function Ua(t){if(!Ga(t))return!1;var e=fi(t);return e==p||e==f||"[object AsyncFunction]"==e||"[object Proxy]"==e}function ja(t){return"number"==typeof t&&t==rs(t)}function Ha(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function Ga(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Wa(t){return null!=t&&"object"==typeof t}var qa=ee?Re(ee):function(t){return Wa(t)&&io(t)==m};function Xa(t){return"number"==typeof t||Wa(t)&&fi(t)==v}function Ya(t){if(!Wa(t)||fi(t)!=g)return!1;var e=jt(t);if(null===e)return!0;var n=St.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&_t.call(n)==Tt}var Qa=ne?Re(ne):function(t){return Wa(t)&&fi(t)==y};var Ka=ie?Re(ie):function(t){return Wa(t)&&io(t)==x};function Za(t){return"string"==typeof t||!Ia(t)&&Wa(t)&&fi(t)==w}function Ja(t){return"symbol"==typeof t||Wa(t)&&fi(t)==b}var $a=re?Re(re):function(t){return Wa(t)&&Ha(t.length)&&!!Vt[fi(t)]};var ts=Nr(Ti),es=Nr((function(t,e){return t<=e}));function ns(t){if(!t)return[];if(Ba(t))return Za(t)?Xe(t):yr(t);if(Zt&&t[Zt])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Zt]());var e=io(t);return(e==m?Ue:e==x?Ge:Cs)(t)}function is(t){return t?(t=as(t))===1/0||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function rs(t){var e=is(t),n=e%1;return e==e?n?e-n:e:0}function os(t){return t?Kn(rs(t),0,4294967295):0}function as(t){if("number"==typeof t)return t;if(Ja(t))return NaN;if(Ga(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Ga(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ce(t);var n=ot.test(t);return n||st.test(t)?Gt(t.slice(2),n?2:8):rt.test(t)?NaN:+t}function ss(t){return xr(t,_s(t))}function cs(t){return null==t?"":Ji(t)}var ls=br((function(t,e){if(po(e)||Ba(e))xr(e,bs(e),t);else for(var n in e)St.call(e,n)&&Gn(t,n,e[n])})),us=br((function(t,e){xr(e,_s(e),t)})),hs=br((function(t,e,n,i){xr(e,_s(e),t,i)})),ds=br((function(t,e,n,i){xr(e,bs(e),t,i)})),ps=Wr(Qn);var fs=zi((function(t,e){t=ft(t);var n=-1,i=e.length,r=i>2?e[2]:void 0;for(r&&co(e[0],e[1],r)&&(i=1);++n1),e})),xr(t,Xr(t),n),i&&(n=Zn(n,7,Hr));for(var r=e.length;r--;)tr(n,e[r]);return n}));var Es=Wr((function(t,e){return null==t?{}:function(t,e){return Ii(t,e,(function(e,n){return gs(t,n)}))}(t,e)}));function Ts(t,e){if(null==t)return{};var n=pe(Xr(t),(function(t){return[t]}));return e=Zr(e),Ii(t,n,(function(t,n){return e(t,n[0])}))}var Ps=zr(bs),Ls=zr(_s);function Cs(t){return null==t?[]:Oe(t,bs(t))}var Rs=Ar((function(t,e,n){return e=e.toLowerCase(),t+(n?Os(e):e)}));function Os(t){return Vs(cs(t).toLowerCase())}function Fs(t){return(t=cs(t))&&t.replace(lt,De).replace(Ft,"")}var Is=Ar((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Ns=Ar((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Bs=Mr("toLowerCase");var Ds=Ar((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}));var ks=Ar((function(t,e,n){return t+(n?" ":"")+Vs(e)}));var zs=Ar((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Vs=Mr("toUpperCase");function Us(t,e,n){return t=cs(t),void 0===(e=n?void 0:e)?function(t){return Dt.test(t)}(t)?function(t){return t.match(Nt)||[]}(t):function(t){return t.match($)||[]}(t):t.match(e)||[]}var js=zi((function(t,e){try{return oe(t,void 0,e)}catch(t){return Va(t)?t:new Q(t)}})),Hs=Wr((function(t,e){return se(e,(function(e){e=To(e),Yn(t,e,xa(t[e],t))})),t}));function Gs(t){return function(){return t}}var Ws=Pr(),qs=Pr(!0);function Xs(t){return t}function Ys(t){return Mi("function"==typeof t?t:Zn(t,1))}var Qs=zi((function(t,e){return function(n){return xi(n,t,e)}})),Ks=zi((function(t,e){return function(n){return xi(t,n,e)}}));function Zs(t,e,n){var i=bs(e),r=hi(e,i);null!=n||Ga(e)&&(r.length||!i.length)||(n=e,e=t,t=this,r=hi(e,bs(e)));var o=!(Ga(n)&&"chain"in n&&!n.chain),a=Ua(t);return se(r,(function(n){var i=e[n];t[n]=i,a&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__),r=n.__actions__=yr(this.__actions__);return r.push({func:i,args:arguments,thisArg:t}),n.__chain__=e,n}return i.apply(t,fe([this.value()],arguments))})})),t}function Js(){}var $s=Or(pe),tc=Or(le),ec=Or(ge);function nc(t){return lo(t)?Ae(To(t)):function(t){return function(e){return di(e,t)}}(t)}var ic=Ir(),rc=Ir(!0);function oc(){return[]}function ac(){return!1}var sc=Rr((function(t,e){return t+e}),0),cc=Dr("ceil"),lc=Rr((function(t,e){return t/e}),1),uc=Dr("floor");var hc,dc=Rr((function(t,e){return t*e}),1),pc=Dr("round"),fc=Rr((function(t,e){return t-e}),0);return Ln.after=function(t,e){if("function"!=typeof e)throw new gt(o);return t=rs(t),function(){if(--t<1)return e.apply(this,arguments)}},Ln.ary=ga,Ln.assign=ls,Ln.assignIn=us,Ln.assignInWith=hs,Ln.assignWith=ds,Ln.at=ps,Ln.before=ya,Ln.bind=xa,Ln.bindAll=Hs,Ln.bindKey=wa,Ln.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Ia(t)?t:[t]},Ln.chain=na,Ln.chunk=function(t,e,n){e=(n?co(t,e,n):void 0===e)?1:sn(rs(e),0);var r=null==t?0:t.length;if(!r||e<1)return[];for(var o=0,a=0,s=i($e(r/e));or?0:r+n),(i=void 0===i||i>r?r:rs(i))<0&&(i+=r),i=n>i?0:os(i);n>>0)?(t=cs(t))&&("string"==typeof e||null!=e&&!Qa(e))&&!(e=Ji(e))&&Ve(t)?ur(Xe(t),0,n):t.split(e,n):[]},Ln.spread=function(t,e){if("function"!=typeof t)throw new gt(o);return e=null==e?0:sn(rs(e),0),zi((function(n){var i=n[e],r=ur(n,0,e);return i&&fe(r,i),oe(t,this,r)}))},Ln.tail=function(t){var e=null==t?0:t.length;return e?qi(t,1,e):[]},Ln.take=function(t,e,n){return t&&t.length?qi(t,0,(e=n||void 0===e?1:rs(e))<0?0:e):[]},Ln.takeRight=function(t,e,n){var i=null==t?0:t.length;return i?qi(t,(e=i-(e=n||void 0===e?1:rs(e)))<0?0:e,i):[]},Ln.takeRightWhile=function(t,e){return t&&t.length?nr(t,Zr(e,3),!1,!0):[]},Ln.takeWhile=function(t,e){return t&&t.length?nr(t,Zr(e,3)):[]},Ln.tap=function(t,e){return e(t),t},Ln.throttle=function(t,e,n){var i=!0,r=!0;if("function"!=typeof t)throw new gt(o);return Ga(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),ba(t,e,{leading:i,maxWait:e,trailing:r})},Ln.thru=ia,Ln.toArray=ns,Ln.toPairs=Ps,Ln.toPairsIn=Ls,Ln.toPath=function(t){return Ia(t)?pe(t,To):Ja(t)?[t]:yr(Eo(cs(t)))},Ln.toPlainObject=ss,Ln.transform=function(t,e,n){var i=Ia(t),r=i||ka(t)||$a(t);if(e=Zr(e,4),null==n){var o=t&&t.constructor;n=r?i?new o:[]:Ga(t)&&Ua(o)?Cn(jt(t)):{}}return(r?se:li)(t,(function(t,i,r){return e(n,t,i,r)})),n},Ln.unary=function(t){return ga(t,1)},Ln.union=Wo,Ln.unionBy=qo,Ln.unionWith=Xo,Ln.uniq=function(t){return t&&t.length?$i(t):[]},Ln.uniqBy=function(t,e){return t&&t.length?$i(t,Zr(e,2)):[]},Ln.uniqWith=function(t,e){return e="function"==typeof e?e:void 0,t&&t.length?$i(t,void 0,e):[]},Ln.unset=function(t,e){return null==t||tr(t,e)},Ln.unzip=Yo,Ln.unzipWith=Qo,Ln.update=function(t,e,n){return null==t?t:er(t,e,sr(n))},Ln.updateWith=function(t,e,n,i){return i="function"==typeof i?i:void 0,null==t?t:er(t,e,sr(n),i)},Ln.values=Cs,Ln.valuesIn=function(t){return null==t?[]:Oe(t,_s(t))},Ln.without=Ko,Ln.words=Us,Ln.wrap=function(t,e){return Ta(sr(e),t)},Ln.xor=Zo,Ln.xorBy=Jo,Ln.xorWith=$o,Ln.zip=ta,Ln.zipObject=function(t,e){return or(t||[],e||[],Gn)},Ln.zipObjectDeep=function(t,e){return or(t||[],e||[],ji)},Ln.zipWith=ea,Ln.entries=Ps,Ln.entriesIn=Ls,Ln.extend=us,Ln.extendWith=hs,Zs(Ln,Ln),Ln.add=sc,Ln.attempt=js,Ln.camelCase=Rs,Ln.capitalize=Os,Ln.ceil=cc,Ln.clamp=function(t,e,n){return void 0===n&&(n=e,e=void 0),void 0!==n&&(n=(n=as(n))==n?n:0),void 0!==e&&(e=(e=as(e))==e?e:0),Kn(as(t),e,n)},Ln.clone=function(t){return Zn(t,4)},Ln.cloneDeep=function(t){return Zn(t,5)},Ln.cloneDeepWith=function(t,e){return Zn(t,5,e="function"==typeof e?e:void 0)},Ln.cloneWith=function(t,e){return Zn(t,4,e="function"==typeof e?e:void 0)},Ln.conformsTo=function(t,e){return null==e||Jn(t,e,bs(e))},Ln.deburr=Fs,Ln.defaultTo=function(t,e){return null==t||t!=t?e:t},Ln.divide=lc,Ln.endsWith=function(t,e,n){t=cs(t),e=Ji(e);var i=t.length,r=n=void 0===n?i:Kn(rs(n),0,i);return(n-=e.length)>=0&&t.slice(n,r)==e},Ln.eq=Ca,Ln.escape=function(t){return(t=cs(t))&&z.test(t)?t.replace(D,ke):t},Ln.escapeRegExp=function(t){return(t=cs(t))&&X.test(t)?t.replace(q,"\\$&"):t},Ln.every=function(t,e,n){var i=Ia(t)?le:ii;return n&&co(t,e,n)&&(e=void 0),i(t,Zr(e,3))},Ln.find=aa,Ln.findIndex=Fo,Ln.findKey=function(t,e){return xe(t,Zr(e,3),li)},Ln.findLast=sa,Ln.findLastIndex=Io,Ln.findLastKey=function(t,e){return xe(t,Zr(e,3),ui)},Ln.floor=uc,Ln.forEach=ca,Ln.forEachRight=la,Ln.forIn=function(t,e){return null==t?t:si(t,Zr(e,3),_s)},Ln.forInRight=function(t,e){return null==t?t:ci(t,Zr(e,3),_s)},Ln.forOwn=function(t,e){return t&&li(t,Zr(e,3))},Ln.forOwnRight=function(t,e){return t&&ui(t,Zr(e,3))},Ln.get=vs,Ln.gt=Ra,Ln.gte=Oa,Ln.has=function(t,e){return null!=t&&ro(t,e,vi)},Ln.hasIn=gs,Ln.head=Bo,Ln.identity=Xs,Ln.includes=function(t,e,n,i){t=Ba(t)?t:Cs(t),n=n&&!i?rs(n):0;var r=t.length;return n<0&&(n=sn(r+n,0)),Za(t)?n<=r&&t.indexOf(e,n)>-1:!!r&&be(t,e,n)>-1},Ln.indexOf=function(t,e,n){var i=null==t?0:t.length;if(!i)return-1;var r=null==n?0:rs(n);return r<0&&(r=sn(i+r,0)),be(t,e,r)},Ln.inRange=function(t,e,n){return e=is(e),void 0===n?(n=e,e=0):n=is(n),function(t,e,n){return t>=cn(e,n)&&t=-9007199254740991&&t<=9007199254740991},Ln.isSet=Ka,Ln.isString=Za,Ln.isSymbol=Ja,Ln.isTypedArray=$a,Ln.isUndefined=function(t){return void 0===t},Ln.isWeakMap=function(t){return Wa(t)&&io(t)==_},Ln.isWeakSet=function(t){return Wa(t)&&"[object WeakSet]"==fi(t)},Ln.join=function(t,e){return null==t?"":on.call(t,e)},Ln.kebabCase=Is,Ln.last=Vo,Ln.lastIndexOf=function(t,e,n){var i=null==t?0:t.length;if(!i)return-1;var r=i;return void 0!==n&&(r=(r=rs(n))<0?sn(i+r,0):cn(r,i-1)),e==e?function(t,e,n){for(var i=n+1;i--;)if(t[i]===e)return i;return i}(t,e,r):we(t,Se,r,!0)},Ln.lowerCase=Ns,Ln.lowerFirst=Bs,Ln.lt=ts,Ln.lte=es,Ln.max=function(t){return t&&t.length?ri(t,Xs,mi):void 0},Ln.maxBy=function(t,e){return t&&t.length?ri(t,Zr(e,2),mi):void 0},Ln.mean=function(t){return Me(t,Xs)},Ln.meanBy=function(t,e){return Me(t,Zr(e,2))},Ln.min=function(t){return t&&t.length?ri(t,Xs,Ti):void 0},Ln.minBy=function(t,e){return t&&t.length?ri(t,Zr(e,2),Ti):void 0},Ln.stubArray=oc,Ln.stubFalse=ac,Ln.stubObject=function(){return{}},Ln.stubString=function(){return""},Ln.stubTrue=function(){return!0},Ln.multiply=dc,Ln.nth=function(t,e){return t&&t.length?Oi(t,rs(e)):void 0},Ln.noConflict=function(){return Xt._===this&&(Xt._=Pt),this},Ln.noop=Js,Ln.now=va,Ln.pad=function(t,e,n){t=cs(t);var i=(e=rs(e))?qe(t):0;if(!e||i>=e)return t;var r=(e-i)/2;return Fr(tn(r),n)+t+Fr($e(r),n)},Ln.padEnd=function(t,e,n){t=cs(t);var i=(e=rs(e))?qe(t):0;return e&&ie){var i=t;t=e,e=i}if(n||t%1||e%1){var r=hn();return cn(t+r*(e-t+Ht("1e-"+((r+"").length-1))),e)}return Di(t,e)},Ln.reduce=function(t,e,n){var i=Ia(t)?me:Te,r=arguments.length<3;return i(t,Zr(e,4),n,r,ei)},Ln.reduceRight=function(t,e,n){var i=Ia(t)?ve:Te,r=arguments.length<3;return i(t,Zr(e,4),n,r,ni)},Ln.repeat=function(t,e,n){return e=(n?co(t,e,n):void 0===e)?1:rs(e),ki(cs(t),e)},Ln.replace=function(){var t=arguments,e=cs(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Ln.result=function(t,e,n){var i=-1,r=(e=cr(e,t)).length;for(r||(r=1,t=void 0);++i9007199254740991)return[];var n=4294967295,i=cn(t,4294967295);t-=4294967295;for(var r=Le(i,e=Zr(e));++n=o)return t;var s=n-qe(i);if(s<1)return i;var c=a?ur(a,0,s).join(""):t.slice(0,s);if(void 0===r)return c+i;if(a&&(s+=c.length-s),Qa(r)){if(t.slice(s).search(r)){var l,u=c;for(r.global||(r=mt(r.source,cs(it.exec(r))+"g")),r.lastIndex=0;l=r.exec(u);)var h=l.index;c=c.slice(0,void 0===h?s:h)}}else if(t.indexOf(Ji(r),s)!=s){var d=c.lastIndexOf(r);d>-1&&(c=c.slice(0,d))}return c+i},Ln.unescape=function(t){return(t=cs(t))&&k.test(t)?t.replace(B,Qe):t},Ln.uniqueId=function(t){var e=++Mt;return cs(t)+e},Ln.upperCase=zs,Ln.upperFirst=Vs,Ln.each=ca,Ln.eachRight=la,Ln.first=Bo,Zs(Ln,(hc={},li(Ln,(function(t,e){St.call(Ln.prototype,e)||(hc[e]=t)})),hc),{chain:!1}),Ln.VERSION="4.17.21",se(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Ln[t].placeholder=Ln})),se(["drop","take"],(function(t,e){Fn.prototype[t]=function(n){n=void 0===n?1:sn(rs(n),0);var i=this.__filtered__&&!e?new Fn(this):this.clone();return i.__filtered__?i.__takeCount__=cn(n,i.__takeCount__):i.__views__.push({size:cn(n,4294967295),type:t+(i.__dir__<0?"Right":"")}),i},Fn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),se(["filter","map","takeWhile"],(function(t,e){var n=e+1,i=1==n||3==n;Fn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:Zr(t,3),type:n}),e.__filtered__=e.__filtered__||i,e}})),se(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Fn.prototype[t]=function(){return this[n](1).value()[0]}})),se(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Fn.prototype[t]=function(){return this.__filtered__?new Fn(this):this[n](1)}})),Fn.prototype.compact=function(){return this.filter(Xs)},Fn.prototype.find=function(t){return this.filter(t).head()},Fn.prototype.findLast=function(t){return this.reverse().find(t)},Fn.prototype.invokeMap=zi((function(t,e){return"function"==typeof t?new Fn(this):this.map((function(n){return xi(n,t,e)}))})),Fn.prototype.reject=function(t){return this.filter(Aa(Zr(t)))},Fn.prototype.slice=function(t,e){t=rs(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Fn(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),void 0!==e&&(n=(e=rs(e))<0?n.dropRight(-e):n.take(e-t)),n)},Fn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Fn.prototype.toArray=function(){return this.take(4294967295)},li(Fn.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),i=/^(?:head|last)$/.test(e),r=Ln[i?"take"+("last"==e?"Right":""):e],o=i||/^find/.test(e);r&&(Ln.prototype[e]=function(){var e=this.__wrapped__,a=i?[1]:arguments,s=e instanceof Fn,c=a[0],l=s||Ia(e),u=function(t){var e=r.apply(Ln,fe([t],a));return i&&h?e[0]:e};l&&n&&"function"==typeof c&&1!=c.length&&(s=l=!1);var h=this.__chain__,d=!!this.__actions__.length,p=o&&!h,f=s&&!d;if(!o&&l){e=f?e:new Fn(this);var m=t.apply(e,a);return m.__actions__.push({func:ia,args:[u],thisArg:void 0}),new On(m,h)}return p&&f?t.apply(this,a):(m=this.thru(u),p?i?m.value()[0]:m.value():m)})})),se(["pop","push","shift","sort","splice","unshift"],(function(t){var e=yt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",i=/^(?:pop|shift)$/.test(t);Ln.prototype[t]=function(){var t=arguments;if(i&&!this.__chain__){var r=this.value();return e.apply(Ia(r)?r:[],t)}return this[n]((function(n){return e.apply(Ia(n)?n:[],t)}))}})),li(Fn.prototype,(function(t,e){var n=Ln[e];if(n){var i=n.name+"";St.call(wn,i)||(wn[i]=[]),wn[i].push({name:e,func:n})}})),wn[Lr(void 0,2).name]=[{name:"wrapper",func:void 0}],Fn.prototype.clone=function(){var t=new Fn(this.__wrapped__);return t.__actions__=yr(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=yr(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=yr(this.__views__),t},Fn.prototype.reverse=function(){if(this.__filtered__){var t=new Fn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Fn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Ia(t),i=e<0,r=n?t.length:0,o=function(t,e,n){var i=-1,r=n.length;for(;++i=this.__values__.length;return{done:t,value:t?void 0:this.__values__[this.__index__++]}},Ln.prototype.plant=function(t){for(var e,n=this;n instanceof Rn;){var i=Lo(n);i.__index__=0,i.__values__=void 0,e?r.__wrapped__=i:e=i;var r=i;n=n.__wrapped__}return r.__wrapped__=t,e},Ln.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Fn){var e=t;return this.__actions__.length&&(e=new Fn(this)),(e=e.reverse()).__actions__.push({func:ia,args:[Go],thisArg:void 0}),new On(e,this.__chain__)}return this.thru(Go)},Ln.prototype.toJSON=Ln.prototype.valueOf=Ln.prototype.value=function(){return ir(this.__wrapped__,this.__actions__)},Ln.prototype.first=Ln.prototype.head,Zt&&(Ln.prototype[Zt]=function(){return this}),Ln}();Xt._=Ke,void 0===(r=function(){return Ke}.call(e,n,e,i))||(i.exports=r)}).call(this)}).call(this,n(45),n(46)(t))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.KeyBinding=void 0;var i=function(){for(var t=[],e=0;e.5?this.character.setState(new o.Walk(this.character)):this.setAppropriateStartWalkState())},e}(o.CharacterStateBase);e.Idle=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SeatType=void 0,function(t){t.Driver="driver",t.Passenger="passenger"}(e.SeatType||(e.SeatType={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EntityType=void 0,function(t){t[t.Character=0]="Character",t[t.Airplane=1]="Airplane",t[t.Car=2]="Car",t[t.Helicopter=3]="Helicopter",t[t.Decoration=4]="Decoration",t[t.System=5]="System"}(e.EntityType||(e.EntityType={}))},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.Driving=void 0;var o=n(3),a=n(27),s=function(t){function e(e,n){var i=t.call(this,e)||this;return i.seat=n,i.canFindVehiclesToEnter=!1,i.playAnimation("driving",.1),i.character.startControllingVehicle(n.vehicle,i.seat),i.seat.vehicle.onInputChange(),i.character.vehicleEntryInstance=null,i}return r(e,t),e.prototype.update=function(e){var n,i;t.prototype.update.call(this,e),!(null===(n=this.seat.door)||void 0===n?void 0:n.achievingTargetRotation)&&(null===(i=this.seat.door)||void 0===i?void 0:i.rotation)>0&&this.seat.vehicle.noDirectionPressed()&&this.character.setState(new a.CloseVehicleDoorInside(this.character,this.seat))},e}(o.CharacterStateBase);e.Driving=s},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.SpringSimulator=void 0;var o=n(0),a=n(19),s=n(21),c=n(2),l=function(t){function e(e,n,i,r,o){void 0===r&&(r=0),void 0===o&&(o=0);var a=t.call(this,e,n,i)||this;a.position=r,a.velocity=o,a.target=0,a.cache=[];for(var c=0;c<2;c++)a.cache.push(new s.SimulationFrame(r,o));return a}return r(e,t),e.prototype.simulate=function(t){this.generateFrames(t),this.position=o.MathUtils.lerp(this.cache[0].position,this.cache[1].position,this.offset/this.frameTime),this.velocity=o.MathUtils.lerp(this.cache[0].velocity,this.cache[1].velocity,this.offset/this.frameTime)},e.prototype.getFrame=function(t){return c.spring(this.lastFrame().position,this.target,this.lastFrame().velocity,this.mass,this.damping)},e}(a.SimulatorBase);e.SpringSimulator=l},function(t,e,n){"use strict";n.r(e),n.d(e,"ShaderPass",(function(){return o}));var i=n(0),r=n(4),o=function(t,e){r.a.call(this),this.textureID=void 0!==e?e:"tDiffuse",t instanceof i.ShaderMaterial?(this.uniforms=t.uniforms,this.material=t):t&&(this.uniforms=i.UniformsUtils.clone(t.uniforms),this.material=new i.ShaderMaterial({defines:Object.assign({},t.defines),uniforms:this.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader})),this.fsQuad=new r.a.FullScreenQuad(this.material)};o.prototype=Object.assign(Object.create(r.a.prototype),{constructor:o,render:function(t,e,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=n.texture),this.fsQuad.material=this.material,this.renderToScreen?(t.setRenderTarget(null),this.fsQuad.render(t)):(t.setRenderTarget(e),this.clear&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),this.fsQuad.render(t))}})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CollisionGroups=void 0,function(t){t[t.Default=1]="Default",t[t.Characters=2]="Characters",t[t.TrimeshColliders=4]="TrimeshColliders"}(e.CollisionGroups||(e.CollisionGroups={}))},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.Vehicle=void 0;var o=n(0),a=n(1),s=n(7),c=n(63),l=n(65),u=n(2),h=n(15),d=n(25),p=function(t){function e(e,n){var i=t.call(this)||this;i.updateOrder=2,i.actions={},i.seats=[],i.wheels=[],i.materials=[],i.firstPerson=!1,void 0===n&&(n={}),n.chassisConnectionPointLocal=new a.Vec3,n.axleLocal=new a.Vec3(-1,0,0),n.directionLocal=new a.Vec3(0,-1,0);var r=new a.Material("Mat");return r.friction=.01,i.collision=new a.Body({mass:50}),i.collision.material=r,i.readVehicleData(e),i.modelContainer=new o.Group,i.add(i.modelContainer),i.modelContainer.add(e.scene),i.rayCastVehicle=new a.RaycastVehicle({chassisBody:i.collision,indexUpAxis:1,indexRightAxis:0,indexForwardAxis:2}),i.wheels.forEach((function(t){n.chassisConnectionPointLocal.set(t.position.x,t.position.y+.2,t.position.z);var e=i.rayCastVehicle.addWheel(n);t.rayCastWheelInfoIndex=e})),i.help=new o.AxesHelper(2),i}return r(e,t),e.prototype.noDirectionPressed=function(){return!0},e.prototype.update=function(t){this.position.set(this.collision.interpolatedPosition.x,this.collision.interpolatedPosition.y,this.collision.interpolatedPosition.z),this.quaternion.set(this.collision.interpolatedQuaternion.x,this.collision.interpolatedQuaternion.y,this.collision.interpolatedQuaternion.z,this.collision.interpolatedQuaternion.w),this.seats.forEach((function(e){e.update(t)}));for(var e=0;e0&&(this.controllingCharacter.modelContainer.visible=!0,this.controllingCharacter.setState(new d.SwitchingSeats(this.controllingCharacter,this.controllingCharacter.occupyingSeat,this.controllingCharacter.occupyingSeat.connectedSeats[0])),this.controllingCharacter.stopControllingVehicle())},e.prototype.resetControls=function(){for(var t in this.actions)this.actions.hasOwnProperty(t)&&this.triggerAction(t,!1)},e.prototype.allowSleep=function(t){this.collision.allowSleep=t,!1===t&&this.collision.wakeUp()},e.prototype.handleKeyboardEvent=function(t,e,n){if("KeyC"===e&&!0===n&&!0===t.shiftKey)this.resetControls(),this.world.cameraOperator.characterCaller=this.controllingCharacter,this.world.inputManager.setInputReceiver(this.world.cameraOperator);else if("KeyR"===e&&!0===n&&!0===t.shiftKey)this.world.restartScenario();else for(var i in this.actions)if(this.actions.hasOwnProperty(i)){var r=this.actions[i];s.includes(r.eventCodes,e)&&this.triggerAction(i,n)}},e.prototype.setFirstPersonView=function(t){this.firstPerson=t,void 0!==this.controllingCharacter&&(this.controllingCharacter.modelContainer.visible=!t),t?this.world.cameraOperator.setRadius(0,!0):this.world.cameraOperator.setRadius(3,!0)},e.prototype.toggleFirstPersonView=function(){this.setFirstPersonView(!this.firstPerson)},e.prototype.triggerAction=function(t,e){var n=this.actions[t];n.isPressed!==e&&(n.isPressed=e,n.justPressed=!1,n.justReleased=!1,e?n.justPressed=!0:n.justReleased=!0,this.onInputChange(),n.justPressed=!1,n.justReleased=!1)},e.prototype.handleMouseButton=function(t,e,n){},e.prototype.handleMouseMove=function(t,e,n){this.world.cameraOperator.move(e,n)},e.prototype.handleMouseWheel=function(t,e){this.world.scrollTheTimeScale(e)},e.prototype.inputReceiverInit=function(){this.collision.allowSleep=!1,this.setFirstPersonView(!1)},e.prototype.inputReceiverUpdate=function(t){if(this.firstPerson){var e=(new o.Vector3).copy(this.camera.position);e.applyQuaternion(this.quaternion),this.world.cameraOperator.target.copy(e.add(this.position))}else this.world.cameraOperator.target.set(this.position.x,this.position.y+.5,this.position.z)},e.prototype.setPosition=function(t,e,n){this.collision.position.x=t,this.collision.position.y=e,this.collision.position.z=n},e.prototype.setSteeringValue=function(t){var e=this;this.wheels.forEach((function(n){n.steering&&e.rayCastVehicle.setSteeringValue(t,n.rayCastWheelInfoIndex)}))},e.prototype.applyEngineForce=function(t){var e=this;this.wheels.forEach((function(n){e.drive!==n.drive&&"awd"!==e.drive||e.rayCastVehicle.applyEngineForce(t,n.rayCastWheelInfoIndex)}))},e.prototype.setBrake=function(t,e){var n=this;this.wheels.forEach((function(i){void 0!==e&&e!==i.drive||n.rayCastVehicle.setBrake(t,i.rayCastWheelInfoIndex)}))},e.prototype.addToWorld=function(t){s.includes(t.vehicles,this)?console.warn("Adding character to a world in which it already exists."):void 0===this.rayCastVehicle?console.error("Trying to create vehicle without raycastVehicleComponent"):(this.world=t,t.vehicles.push(this),t.graphicsWorld.add(this),this.rayCastVehicle.addToWorld(t.physicsWorld),this.wheels.forEach((function(e){t.graphicsWorld.attach(e.wheelObject)})),this.materials.forEach((function(e){t.sky.csm.setupMaterial(e)})))},e.prototype.removeFromWorld=function(t){s.includes(t.vehicles,this)?(this.world=void 0,s.pull(t.vehicles,this),t.graphicsWorld.remove(this),this.rayCastVehicle.removeFromWorld(t.physicsWorld),this.wheels.forEach((function(e){t.graphicsWorld.remove(e.wheelObject)}))):console.warn("Removing character from a world in which it isn't present.")},e.prototype.readVehicleData=function(t){var e=this;t.scene.traverse((function(n){if(n.isMesh&&(u.setupMeshProperties(n),void 0!==n.material&&e.materials.push(n.material)),n.hasOwnProperty("userData")&&n.userData.hasOwnProperty("data")){if("seat"===n.userData.data&&e.seats.push(new c.VehicleSeat(e,n,t)),"camera"===n.userData.data&&(e.camera=n),"wheel"===n.userData.data&&e.wheels.push(new l.Wheel(n)),"collision"===n.userData.data)if("box"===n.userData.shape)n.visible=!1,(i=new a.Box(new a.Vec3(n.scale.x,n.scale.y,n.scale.z))).collisionFilterMask=~h.CollisionGroups.TrimeshColliders,e.collision.addShape(i,new a.Vec3(n.position.x,n.position.y,n.position.z));else if("sphere"===n.userData.shape){var i;n.visible=!1,(i=new a.Sphere(n.scale.x)).collisionFilterGroup=h.CollisionGroups.TrimeshColliders,e.collision.addShape(i,new a.Vec3(n.position.x,n.position.y,n.position.z))}"navmesh"===n.userData.data&&(n.visible=!1)}})),0===this.collision.shapes.length&&console.warn("Vehicle "+typeof this+" has no collision data."),0===this.seats.length?console.warn("Vehicle "+typeof this+" has no seats."):this.connectSeats()},e.prototype.connectSeats=function(){for(var t=0,e=this.seats;t0)for(var a=0,s=this.seats;a0&&this.noDirection())this.character.setState(new a.CloseVehicleDoorInside(this.character,this.seat));else if(null!==this.character.vehicleEntryInstance)if(this.character.vehicleEntryInstance.wantsToDrive)for(var o=0,l=this.seat.connectedSeats;o0&&(this.seat.door.physicsEnabled=!0),this.character.setState(new c.SwitchingSeats(this.character,this.seat,u));break}}else this.character.vehicleEntryInstance=null},e.prototype.onInputChange=function(){this.character.actions.seat_switch.justPressed&&this.seat.connectedSeats.length>0&&this.character.setState(new c.SwitchingSeats(this.character,this.seat,this.seat.connectedSeats[0])),this.character.actions.enter.justPressed&&(this.character.exitVehicle(),this.character.displayControls())},e}(o.CharacterStateBase);e.Sitting=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SimulatorBase=void 0;var i=function(){function t(t,e,n){this.mass=e,this.damping=n,this.frameTime=1/t,this.offset=0}return t.prototype.setFPS=function(t){this.frameTime=1/t},t.prototype.lastFrame=function(){return this.cache[this.cache.length-1]},t.prototype.generateFrames=function(t){var e=this.offset+t,n=Math.floor(e/this.frameTime);if(this.offset=e%this.frameTime,n>0){for(var i=0;i(e=parseInt(e.getAttribute("tabindex")))?1:t1&&void 0!==arguments[1]?arguments[1]:"flex";t.style.opacity="",t.style.display=e},st=function(t){t.style.opacity="",t.style.display="none"},ct=function(t,e,n){e?at(t,n):st(t)},lt=function(t){return!(!t||!(t.offsetWidth||t.offsetHeight||t.getClientRects().length))},ut=function(t){return!!(t.scrollHeight>t.clientHeight)},ht=function(t){var e=window.getComputedStyle(t),n=parseFloat(e.getPropertyValue("animation-duration")||"0"),i=parseFloat(e.getPropertyValue("transition-duration")||"0");return n>0||i>0},dt=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=j();lt(n)&&(e&&(n.style.transition="none",n.style.width="100%"),setTimeout((function(){n.style.transition="width ".concat(t/1e3,"s linear"),n.style.width="0%"}),10))},pt=function(){return"undefined"==typeof window||"undefined"==typeof document},ft='\n
\n
\n
    \n
    \n
    \n
    \n
    \n
    \n \n

    \n \n
    \n
    \n
    \n \n \n
    \n \n \n
    \n \n
    \n \n \n
    \n
    \n
    \n \n \n
    \n
    \n
    \n
    \n
    \n
    \n').replace(/(^|\n)\s*/g,""),mt=function(t){ln.isVisible()&&$!==t.target.value&&ln.resetValidationMessage(),$=t.target.value},vt=function(t){var e,n=!!(e=E())&&(e.parentNode.removeChild(e),it([document.documentElement,document.body],[M["no-backdrop"],M["toast-shown"],M["has-column"]]),!0);if(pt())f("SweetAlert2 requires document to initialize");else{var i=document.createElement("div");i.className=M.container,n&&nt(i,M["no-transition"]),Q(i,ft);var r,o,a,s,c,l,u,h,d,p="string"==typeof(r=t.target)?document.querySelector(r):r;p.appendChild(i),function(t){var e=L();e.setAttribute("role",t.toast?"alert":"dialog"),e.setAttribute("aria-live",t.toast?"polite":"assertive"),t.toast||e.setAttribute("aria-modal","true")}(t),function(t){"rtl"===window.getComputedStyle(t).direction&&nt(E(),M.rtl)}(p),o=F(),a=rt(o,M.input),s=rt(o,M.file),c=o.querySelector(".".concat(M.range," input")),l=o.querySelector(".".concat(M.range," output")),u=rt(o,M.select),h=o.querySelector(".".concat(M.checkbox," input")),d=rt(o,M.textarea),a.oninput=mt,s.onchange=mt,u.onchange=mt,h.onchange=mt,d.oninput=mt,c.oninput=function(t){mt(t),l.value=c.value},c.onchange=function(t){mt(t),c.nextSibling.value=c.value}}},gt=function(e,n){e instanceof HTMLElement?n.appendChild(e):"object"===t(e)?yt(e,n):e&&Q(n,e)},yt=function(t,e){t.jquery?xt(e,t):Q(e,t.toString())},xt=function(t,e){if(t.textContent="",0 in e)for(var n=0;n in e;n++)t.appendChild(e[n].cloneNode(!0));else t.appendChild(e.cloneNode(!0))},wt=function(){if(pt())return!1;var t=document.createElement("div"),e={WebkitAnimation:"webkitAnimationEnd",OAnimation:"oAnimationEnd oanimationend",animation:"animationend"};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&void 0!==t.style[n])return e[n];return!1}(),bt=function(t,e){var n=z(),i=D(),r=k();e.showConfirmButton||e.showCancelButton||st(n),Z(n,e,"actions"),_t(i,"confirm",e),_t(r,"cancel",e),e.buttonsStyling?function(t,e,n){if(nt([t,e],M.styled),n.confirmButtonColor&&(t.style.backgroundColor=n.confirmButtonColor),n.cancelButtonColor&&(e.style.backgroundColor=n.cancelButtonColor),!X()){var i=window.getComputedStyle(t).getPropertyValue("background-color");t.style.borderLeftColor=i,t.style.borderRightColor=i}}(i,r,e):(it([i,r],M.styled),i.style.backgroundColor=i.style.borderLeftColor=i.style.borderRightColor="",r.style.backgroundColor=r.style.borderLeftColor=r.style.borderRightColor=""),e.reverseButtons&&i.parentNode.insertBefore(r,i)};function _t(t,e,n){var i;ct(t,n["show".concat((i=e,i.charAt(0).toUpperCase()+i.slice(1)),"Button")],"inline-block"),Q(t,n["".concat(e,"ButtonText")]),t.setAttribute("aria-label",n["".concat(e,"ButtonAriaLabel")]),t.className=M[e],Z(t,n,"".concat(e,"Button")),nt(t,n["".concat(e,"ButtonClass")])}var St=function(t,e){var n=E();if(n){!function(t,e){"string"==typeof e?t.style.background=e:e||nt([document.documentElement,document.body],M["no-backdrop"])}(n,e.backdrop),!e.backdrop&&e.allowOutsideClick&&p('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`'),function(t,e){e in M?nt(t,M[e]):(p('The "position" parameter is not valid, defaulting to "center"'),nt(t,M.center))}(n,e.position),function(t,e){if(e&&"string"==typeof e){var n="grow-".concat(e);n in M&&nt(t,M[n])}}(n,e.grow),Z(n,e,"container");var i=document.body.getAttribute("data-swal2-queue-step");i&&(n.setAttribute("data-queue-step",i),document.body.removeAttribute("data-swal2-queue-step"))}},Mt={promise:new WeakMap,innerParams:new WeakMap,domCache:new WeakMap},At=["input","file","range","select","radio","checkbox","textarea"],Et=function(t){if(!Rt[t.input])return f('Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "'.concat(t.input,'"'));var e=Ct(t.input),n=Rt[t.input](e,t);at(n),setTimeout((function(){tt(n)}))},Tt=function(t,e){var n=J(F(),t);if(n)for(var i in function(t){for(var e=0;en?"".concat(e,"px"):null})).observe(t,{attributes:!0,attributeFilter:["style"]})}return t};var Ot=function(t,e){var n=F().querySelector("#".concat(M.content));e.html?(gt(e.html,n),at(n,"block")):e.text?(n.textContent=e.text,at(n,"block")):st(n),function(t,e){var n=F(),i=Mt.innerParams.get(t),r=!i||e.input!==i.input;At.forEach((function(t){var i=M[t],o=rt(n,i);Tt(t,e.inputAttributes),o.className=i,r&&st(o)})),e.input&&(r&&Et(e),Pt(e))}(t,e),Z(F(),e,"content")},Ft=function(){for(var t=C(),e=0;e\n \n
    \n
    \n '):"error"===e.icon?Q(t,'\n \n \n \n \n '):Q(t,Bt({question:"?",warning:"!",info:"i"}[e.icon]))},Bt=function(t){return'
    ').concat(t,"
    ")},Dt=[],kt=function(){return E()&&E().getAttribute("data-queue-step")},zt=function(t,e){var n=N();if(!e.progressSteps||0===e.progressSteps.length)return st(n);at(n),n.textContent="";var i=parseInt(void 0===e.currentProgressStep?kt():e.currentProgressStep);i>=e.progressSteps.length&&p("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),e.progressSteps.forEach((function(t,r){var o=function(t){var e=document.createElement("li");return nt(e,M["progress-step"]),Q(e,t),e}(t);if(n.appendChild(o),r===i&&nt(o,M["active-progress-step"]),r!==e.progressSteps.length-1){var a=function(t){var e=document.createElement("li");return nt(e,M["progress-step-line"]),t.progressStepsDistance&&(e.style.width=t.progressStepsDistance),e}(e);n.appendChild(a)}}))},Vt=function(t,e){var n=V();Z(n,e,"header"),zt(0,e),function(t,e){var n=Mt.innerParams.get(t);if(n&&e.icon===n.icon&&R())Z(R(),e,"icon");else if(Ft(),e.icon)if(-1!==Object.keys(A).indexOf(e.icon)){var i=T(".".concat(M.icon,".").concat(A[e.icon]));at(i),Nt(i,e),It(),Z(i,e,"icon"),nt(i,e.showClass.icon)}else f('Unknown icon! Expected "success", "error", "warning", "info" or "question", got "'.concat(e.icon,'"'))}(t,e),function(t,e){var n=I();if(!e.imageUrl)return st(n);at(n,""),n.setAttribute("src",e.imageUrl),n.setAttribute("alt",e.imageAlt),ot(n,"width",e.imageWidth),ot(n,"height",e.imageHeight),n.className=M.image,Z(n,e,"image")}(0,e),function(t,e){var n=O();ct(n,e.title||e.titleText),e.title&>(e.title,n),e.titleText&&(n.innerText=e.titleText),Z(n,e,"title")}(0,e),function(t,e){var n=H();Q(n,e.closeButtonHtml),Z(n,e,"closeButton"),ct(n,e.showCloseButton),n.setAttribute("aria-label",e.closeButtonAriaLabel)}(0,e)},Ut=function(t,e){t.className="".concat(M.popup," ").concat(lt(t)?e.showClass.popup:""),e.toast?(nt([document.documentElement,document.body],M["toast-shown"]),nt(t,M.toast)):nt(t,M.modal),Z(t,e,"popup"),"string"==typeof e.customClass&&nt(t,e.customClass),e.icon&&nt(t,M["icon-".concat(e.icon)])},jt=function(t,e){!function(t,e){var n=L();ot(n,"width",e.width),ot(n,"padding",e.padding),e.background&&(n.style.background=e.background),Ut(n,e)}(0,e),St(0,e),Vt(t,e),Ot(t,e),bt(0,e),function(t,e){var n=U();ct(n,e.footer),e.footer&>(e.footer,n),Z(n,e,"footer")}(0,e),"function"==typeof e.onRender&&e.onRender(L())},Ht=function(){return D()&&D().click()},Gt=function(){var t=L();t||ln.fire(),t=L();var e=z(),n=D();at(e),at(n,"inline-block"),nt([t,e],M.loading),n.disabled=!0,t.setAttribute("data-loading",!0),t.setAttribute("aria-busy",!0),t.focus()},Wt={},qt=function(){return new Promise((function(t){var e=window.scrollX,n=window.scrollY;Wt.restoreFocusTimeout=setTimeout((function(){Wt.previousActiveElement&&Wt.previousActiveElement.focus?(Wt.previousActiveElement.focus(),Wt.previousActiveElement=null):document.body&&document.body.focus(),t()}),100),void 0!==e&&void 0!==n&&window.scrollTo(e,n)}))},Xt=function(){if(Wt.timeout)return function(){var t=j(),e=parseInt(window.getComputedStyle(t).width);t.style.removeProperty("transition"),t.style.width="100%";var n=parseInt(window.getComputedStyle(t).width),i=parseInt(e/n*100);t.style.removeProperty("transition"),t.style.width="".concat(i,"%")}(),Wt.timeout.stop()},Yt=function(){if(Wt.timeout){var t=Wt.timeout.start();return dt(t),t}},Qt={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconHtml:void 0,toast:!1,animation:!0,showClass:{popup:"swal2-show",backdrop:"swal2-backdrop-show",icon:"swal2-icon-show"},hideClass:{popup:"swal2-hide",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"},customClass:void 0,target:"body",backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showCancelButton:!1,preConfirm:void 0,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:void 0,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusCancel:!1,showCloseButton:!1,closeButtonHtml:"×",closeButtonAriaLabel:"Close this dialog",showLoaderOnConfirm:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:"",timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:"",inputValue:"",inputOptions:{},inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,validationMessage:void 0,grow:!1,position:"center",progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,onBeforeOpen:void 0,onOpen:void 0,onRender:void 0,onClose:void 0,onAfterClose:void 0,onDestroy:void 0,scrollbarPadding:!0},Kt=["allowEscapeKey","allowOutsideClick","buttonsStyling","cancelButtonAriaLabel","cancelButtonColor","cancelButtonText","closeButtonAriaLabel","closeButtonHtml","confirmButtonAriaLabel","confirmButtonColor","confirmButtonText","currentProgressStep","customClass","footer","hideClass","html","icon","imageAlt","imageHeight","imageUrl","imageWidth","onAfterClose","onClose","onDestroy","progressSteps","reverseButtons","showCancelButton","showCloseButton","showConfirmButton","text","title","titleText"],Zt={animation:'showClass" and "hideClass'},Jt=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusCancel","heightAuto","keydownListenerCapture"],$t=function(t){return Object.prototype.hasOwnProperty.call(Qt,t)},te=function(t){return Zt[t]},ee=function(t){$t(t)||p('Unknown parameter "'.concat(t,'"'))},ne=function(t){-1!==Jt.indexOf(t)&&p('The parameter "'.concat(t,'" is incompatible with toasts'))},ie=function(t){te(t)&&v(t,te(t))},re=Object.freeze({isValidParameter:$t,isUpdatableParameter:function(t){return-1!==Kt.indexOf(t)},isDeprecatedParameter:te,argsToParams:function(e){var n={};return"object"!==t(e[0])||_(e[0])?["title","html","icon"].forEach((function(i,r){var o=e[r];"string"==typeof o||_(o)?n[i]=o:void 0!==o&&f("Unexpected type of ".concat(i,'! Expected "string" or "Element", got ').concat(t(o)))})):r(n,e[0]),n},isVisible:function(){return lt(L())},clickConfirm:Ht,clickCancel:function(){return k()&&k().click()},getContainer:E,getPopup:L,getTitle:O,getContent:F,getHtmlContainer:function(){return P(M["html-container"])},getImage:I,getIcon:R,getIcons:C,getCloseButton:H,getActions:z,getConfirmButton:D,getCancelButton:k,getHeader:V,getFooter:U,getTimerProgressBar:j,getFocusableElements:G,getValidationMessage:B,isLoading:X,fire:function(){for(var t=this,e=arguments.length,n=new Array(e),i=0;iwindow.innerHeight&&(Y.previousBodyPadding=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight="".concat(Y.previousBodyPadding+function(){var t=document.createElement("div");t.className=M["scrollbar-measure"],document.body.appendChild(t);var e=t.getBoundingClientRect().width-t.clientWidth;return document.body.removeChild(t),e}(),"px"))},se=function(){navigator.userAgent.match(/(CriOS|FxiOS|EdgiOS|YaBrowser|UCBrowser)/i)||L().scrollHeight>window.innerHeight-44&&(E().style.paddingBottom="".concat(44,"px"))},ce=function(){var t,e=E();e.ontouchstart=function(e){t=le(e.target)},e.ontouchmove=function(e){t&&(e.preventDefault(),e.stopPropagation())}},le=function(t){var e=E();return t===e||!(ut(e)||"INPUT"===t.tagName||ut(F())&&F().contains(t))},ue=function(){return!!window.MSInputMethodContext&&!!document.documentMode},he=function(){var t=E(),e=L();t.style.removeProperty("align-items"),e.offsetTop<0&&(t.style.alignItems="flex-start")},de={swalPromiseResolve:new WeakMap};function pe(t,e,n,i){n?ge(t,i):(qt().then((function(){return ge(t,i)})),Wt.keydownTarget.removeEventListener("keydown",Wt.keydownHandler,{capture:Wt.keydownListenerCapture}),Wt.keydownHandlerAdded=!1),e.parentNode&&!document.body.getAttribute("data-swal2-queue-step")&&e.parentNode.removeChild(e),W()&&(null!==Y.previousBodyPadding&&(document.body.style.paddingRight="".concat(Y.previousBodyPadding,"px"),Y.previousBodyPadding=null),function(){if(K(document.body,M.iosfix)){var t=parseInt(document.body.style.top,10);it(document.body,M.iosfix),document.body.style.top="",document.body.scrollTop=-1*t}}(),"undefined"!=typeof window&&ue()&&window.removeEventListener("resize",he),d(document.body.children).forEach((function(t){t.hasAttribute("data-previous-aria-hidden")?(t.setAttribute("aria-hidden",t.getAttribute("data-previous-aria-hidden")),t.removeAttribute("data-previous-aria-hidden")):t.removeAttribute("aria-hidden")}))),it([document.documentElement,document.body],[M.shown,M["height-auto"],M["no-backdrop"],M["toast-shown"],M["toast-column"]])}function fe(t){var e=L();if(e){var n=Mt.innerParams.get(this);if(n&&!K(e,n.hideClass.popup)){var i=de.swalPromiseResolve.get(this);it(e,n.showClass.popup),nt(e,n.hideClass.popup);var r=E();it(r,n.showClass.backdrop),nt(r,n.hideClass.backdrop),me(this,e,n),void 0!==t?(t.isDismissed=void 0!==t.dismiss,t.isConfirmed=void 0===t.dismiss):t={isDismissed:!0,isConfirmed:!1},i(t||{})}}}var me=function(t,e,n){var i=E(),r=wt&&ht(e),o=n.onClose,a=n.onAfterClose;null!==o&&"function"==typeof o&&o(e),r?ve(t,e,i,a):pe(t,i,q(),a)},ve=function(t,e,n,i){Wt.swalCloseEventFinishedCallback=pe.bind(null,t,n,q(),i),e.addEventListener(wt,(function(t){t.target===e&&(Wt.swalCloseEventFinishedCallback(),delete Wt.swalCloseEventFinishedCallback)}))},ge=function(t,e){setTimeout((function(){"function"==typeof e&&e(),t._destroy()}))};function ye(t,e,n){var i=Mt.domCache.get(t);e.forEach((function(t){i[t].disabled=n}))}function xe(t,e){if(!t)return!1;if("radio"===t.type)for(var n=t.parentNode.parentNode.querySelectorAll("input"),i=0;i")),vt(t)}var Se=function(t){var e=E(),n=L();"function"==typeof t.onBeforeOpen&&t.onBeforeOpen(n);var i=window.getComputedStyle(document.body).overflowY;Pe(e,n,t),Ee(e,n),W()&&(Te(e,t.scrollbarPadding,i),d(document.body.children).forEach((function(t){t===E()||function(t,e){if("function"==typeof t.contains)return t.contains(e)}(t,E())||(t.hasAttribute("aria-hidden")&&t.setAttribute("data-previous-aria-hidden",t.getAttribute("aria-hidden")),t.setAttribute("aria-hidden","true"))}))),q()||Wt.previousActiveElement||(Wt.previousActiveElement=document.activeElement),"function"==typeof t.onOpen&&setTimeout((function(){return t.onOpen(n)})),it(e,M["no-transition"])};function Me(t){var e=L();if(t.target===e){var n=E();e.removeEventListener(wt,Me),n.style.overflowY="auto"}}var Ae,Ee=function(t,e){wt&&ht(e)?(t.style.overflowY="hidden",e.addEventListener(wt,Me)):t.style.overflowY="auto"},Te=function(t,e,n){!function(){if((/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1)&&!K(document.body,M.iosfix)){var t=document.body.scrollTop;document.body.style.top="".concat(-1*t,"px"),nt(document.body,M.iosfix),ce(),se()}}(),"undefined"!=typeof window&&ue()&&(he(),window.addEventListener("resize",he)),e&&"hidden"!==n&&ae(),setTimeout((function(){t.scrollTop=0}))},Pe=function(t,e,n){nt(t,n.showClass.backdrop),at(e),nt(e,n.showClass.popup),nt([document.documentElement,document.body],M.shown),n.heightAuto&&n.backdrop&&!n.toast&&nt([document.documentElement,document.body],M["height-auto"])},Le=function(t){return t.checked?1:0},Ce=function(t){return t.checked?t.value:null},Re=function(t){return t.files.length?null!==t.getAttribute("multiple")?t.files:t.files[0]:null},Oe=function(e,n){var i=F(),r=function(t){return Ie[n.input](i,Ne(t),n)};y(n.inputOptions)||w(n.inputOptions)?(Gt(),x(n.inputOptions).then((function(t){e.hideLoading(),r(t)}))):"object"===t(n.inputOptions)?r(n.inputOptions):f("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(t(n.inputOptions)))},Fe=function(t,e){var n=t.getInput();st(n),x(e.inputValue).then((function(i){n.value="number"===e.input?parseFloat(i)||0:"".concat(i),at(n),n.focus(),t.hideLoading()})).catch((function(e){f("Error in inputValue promise: ".concat(e)),n.value="",at(n),n.focus(),t.hideLoading()}))},Ie={select:function(t,e,n){var i=rt(t,M.select),r=function(t,e,i){var r=document.createElement("option");r.value=i,Q(r,e),n.inputValue.toString()===i.toString()&&(r.selected=!0),t.appendChild(r)};e.forEach((function(t){var e=t[0],n=t[1];if(Array.isArray(n)){var o=document.createElement("optgroup");o.label=e,o.disabled=!1,i.appendChild(o),n.forEach((function(t){return r(o,t[1],t[0])}))}else r(i,n,e)})),i.focus()},radio:function(t,e,n){var i=rt(t,M.radio);e.forEach((function(t){var e=t[0],r=t[1],o=document.createElement("input"),a=document.createElement("label");o.type="radio",o.name=M.radio,o.value=e,n.inputValue.toString()===e.toString()&&(o.checked=!0);var s=document.createElement("span");Q(s,r),s.className=M.label,a.appendChild(o),a.appendChild(s),i.appendChild(a)}));var r=i.querySelectorAll("input");r.length&&r[0].focus()}},Ne=function e(n){var i=[];return"undefined"!=typeof Map&&n instanceof Map?n.forEach((function(n,r){var o=n;"object"===t(o)&&(o=e(o)),i.push([r,o])})):Object.keys(n).forEach((function(r){var o=n[r];"object"===t(o)&&(o=e(o)),i.push([r,o])})),i},Be=function(t,e){var n=function(t,e){var n=t.getInput();if(!n)return null;switch(e.input){case"checkbox":return Le(n);case"radio":return Ce(n);case"file":return Re(n);default:return e.inputAutoTrim?n.value.trim():n.value}}(t,e);e.inputValidator?(t.disableInput(),Promise.resolve().then((function(){return x(e.inputValidator(n,e.validationMessage))})).then((function(i){t.enableButtons(),t.enableInput(),i?t.showValidationMessage(i):ke(t,e,n)}))):t.getInput().checkValidity()?ke(t,e,n):(t.enableButtons(),t.showValidationMessage(e.validationMessage))},De=function(t,e){t.closePopup({value:e})},ke=function(t,e,n){e.showLoaderOnConfirm&&Gt(),e.preConfirm?(t.resetValidationMessage(),Promise.resolve().then((function(){return x(e.preConfirm(n,e.validationMessage))})).then((function(e){lt(B())||!1===e?t.hideLoading():De(t,void 0===e?n:e)}))):De(t,n)},ze=function(t,e,n){for(var i=G(),r=0;r:first-child,.swal2-container.swal2-bottom-left>:first-child,.swal2-container.swal2-bottom-right>:first-child,.swal2-container.swal2-bottom-start>:first-child,.swal2-container.swal2-bottom>:first-child{margin-top:auto}.swal2-container.swal2-grow-fullscreen>.swal2-modal{display:flex!important;flex:1;align-self:stretch;justify-content:center}.swal2-container.swal2-grow-row>.swal2-modal{display:flex!important;flex:1;align-content:center;justify-content:center}.swal2-container.swal2-grow-column{flex:1;flex-direction:column}.swal2-container.swal2-grow-column.swal2-bottom,.swal2-container.swal2-grow-column.swal2-center,.swal2-container.swal2-grow-column.swal2-top{align-items:center}.swal2-container.swal2-grow-column.swal2-bottom-left,.swal2-container.swal2-grow-column.swal2-bottom-start,.swal2-container.swal2-grow-column.swal2-center-left,.swal2-container.swal2-grow-column.swal2-center-start,.swal2-container.swal2-grow-column.swal2-top-left,.swal2-container.swal2-grow-column.swal2-top-start{align-items:flex-start}.swal2-container.swal2-grow-column.swal2-bottom-end,.swal2-container.swal2-grow-column.swal2-bottom-right,.swal2-container.swal2-grow-column.swal2-center-end,.swal2-container.swal2-grow-column.swal2-center-right,.swal2-container.swal2-grow-column.swal2-top-end,.swal2-container.swal2-grow-column.swal2-top-right{align-items:flex-end}.swal2-container.swal2-grow-column>.swal2-modal{display:flex!important;flex:1;align-content:center;justify-content:center}.swal2-container.swal2-no-transition{transition:none!important}.swal2-container:not(.swal2-top):not(.swal2-top-start):not(.swal2-top-end):not(.swal2-top-left):not(.swal2-top-right):not(.swal2-center-start):not(.swal2-center-end):not(.swal2-center-left):not(.swal2-center-right):not(.swal2-bottom):not(.swal2-bottom-start):not(.swal2-bottom-end):not(.swal2-bottom-left):not(.swal2-bottom-right):not(.swal2-grow-fullscreen)>.swal2-modal{margin:auto}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.swal2-container .swal2-modal{margin:0!important}}.swal2-popup{display:none;position:relative;box-sizing:border-box;flex-direction:column;justify-content:center;width:32em;max-width:100%;padding:1.25em;border:none;border-radius:.3125em;background:#fff;font-family:inherit;font-size:1rem}.swal2-popup:focus{outline:0}.swal2-popup.swal2-loading{overflow-y:hidden}.swal2-header{display:flex;flex-direction:column;align-items:center;padding:0 1.8em}.swal2-title{position:relative;max-width:100%;margin:0 0 .4em;padding:0;color:#595959;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}.swal2-actions{display:flex;z-index:1;flex-wrap:wrap;align-items:center;justify-content:center;width:100%;margin:1.25em auto 0}.swal2-actions:not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}.swal2-actions:not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1))}.swal2-actions:not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0,0,0,.2),rgba(0,0,0,.2))}.swal2-actions.swal2-loading .swal2-styled.swal2-confirm{box-sizing:border-box;width:2.5em;height:2.5em;margin:.46875em;padding:0;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border:.25em solid transparent;border-radius:100%;border-color:transparent;background-color:transparent!important;color:transparent!important;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-actions.swal2-loading .swal2-styled.swal2-cancel{margin-right:30px;margin-left:30px}.swal2-actions.swal2-loading :not(.swal2-styled).swal2-confirm::after{content:"";display:inline-block;width:15px;height:15px;margin-left:5px;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border:3px solid #999;border-radius:50%;border-right-color:transparent;box-shadow:1px 1px 1px #fff}.swal2-styled{margin:.3125em;padding:.625em 2em;box-shadow:none;font-weight:500}.swal2-styled:not([disabled]){cursor:pointer}.swal2-styled.swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#3085d6;color:#fff;font-size:1.0625em}.swal2-styled.swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#aaa;color:#fff;font-size:1.0625em}.swal2-styled:focus{outline:0;box-shadow:0 0 0 1px #fff,0 0 0 3px rgba(50,100,150,.4)}.swal2-styled::-moz-focus-inner{border:0}.swal2-footer{justify-content:center;margin:1.25em 0 0;padding:1em 0 0;border-top:1px solid #eee;color:#545454;font-size:1em}.swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;height:.25em;overflow:hidden;border-bottom-right-radius:.3125em;border-bottom-left-radius:.3125em}.swal2-timer-progress-bar{width:100%;height:.25em;background:rgba(0,0,0,.2)}.swal2-image{max-width:100%;margin:1.25em auto}.swal2-close{position:absolute;z-index:2;top:0;right:0;align-items:center;justify-content:center;width:1.2em;height:1.2em;padding:0;overflow:hidden;transition:color .1s ease-out;border:none;border-radius:0;background:0 0;color:#ccc;font-family:serif;font-size:2.5em;line-height:1.2;cursor:pointer}.swal2-close:hover{transform:none;background:0 0;color:#f27474}.swal2-close::-moz-focus-inner{border:0}.swal2-content{z-index:1;justify-content:center;margin:0;padding:0 1.6em;color:#545454;font-size:1.125em;font-weight:400;line-height:normal;text-align:center;word-wrap:break-word}.swal2-checkbox,.swal2-file,.swal2-input,.swal2-radio,.swal2-select,.swal2-textarea{margin:1em auto}.swal2-file,.swal2-input,.swal2-textarea{box-sizing:border-box;width:100%;transition:border-color .3s,box-shadow .3s;border:1px solid #d9d9d9;border-radius:.1875em;background:inherit;box-shadow:inset 0 1px 1px rgba(0,0,0,.06);color:inherit;font-size:1.125em}.swal2-file.swal2-inputerror,.swal2-input.swal2-inputerror,.swal2-textarea.swal2-inputerror{border-color:#f27474!important;box-shadow:0 0 2px #f27474!important}.swal2-file:focus,.swal2-input:focus,.swal2-textarea:focus{border:1px solid #b4dbed;outline:0;box-shadow:0 0 3px #c4e6f5}.swal2-file::-moz-placeholder,.swal2-input::-moz-placeholder,.swal2-textarea::-moz-placeholder{color:#ccc}.swal2-file:-ms-input-placeholder,.swal2-input:-ms-input-placeholder,.swal2-textarea:-ms-input-placeholder{color:#ccc}.swal2-file::-ms-input-placeholder,.swal2-input::-ms-input-placeholder,.swal2-textarea::-ms-input-placeholder{color:#ccc}.swal2-file::placeholder,.swal2-input::placeholder,.swal2-textarea::placeholder{color:#ccc}.swal2-range{margin:1em auto;background:#fff}.swal2-range input{width:80%}.swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}.swal2-range input,.swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}.swal2-input{height:2.625em;padding:0 .75em}.swal2-input[type=number]{max-width:10em}.swal2-file{background:inherit;font-size:1.125em}.swal2-textarea{height:6.75em;padding:.75em}.swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:inherit;color:inherit;font-size:1.125em}.swal2-checkbox,.swal2-radio{align-items:center;justify-content:center;background:#fff;color:inherit}.swal2-checkbox label,.swal2-radio label{margin:0 .6em;font-size:1.125em}.swal2-checkbox input,.swal2-radio input{margin:0 .4em}.swal2-validation-message{display:none;align-items:center;justify-content:center;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}.swal2-validation-message::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}.swal2-icon{position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:1.25em auto 1.875em;border:.25em solid transparent;border-radius:50%;font-family:inherit;line-height:5em;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}.swal2-icon.swal2-error{border-color:#f27474;color:#f27474}.swal2-icon.swal2-error .swal2-x-mark{position:relative;flex-grow:1}.swal2-icon.swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}.swal2-icon.swal2-error.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-error.swal2-icon-show .swal2-x-mark{-webkit-animation:swal2-animate-error-x-mark .5s;animation:swal2-animate-error-x-mark .5s}.swal2-icon.swal2-warning{border-color:#facea8;color:#f8bb86}.swal2-icon.swal2-info{border-color:#9de0f6;color:#3fc3ee}.swal2-icon.swal2-question{border-color:#c9dae1;color:#87adbd}.swal2-icon.swal2-success{border-color:#a5dc86;color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;transform:rotate(45deg);border-radius:50%}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}.swal2-icon.swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-.25em;left:-.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}.swal2-icon.swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}.swal2-icon.swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}.swal2-icon.swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-animate-success-line-tip .75s;animation:swal2-animate-success-line-tip .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-animate-success-line-long .75s;animation:swal2-animate-success-line-long .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-circular-line-right{-webkit-animation:swal2-rotate-success-circular-line 4.25s ease-in;animation:swal2-rotate-success-circular-line 4.25s ease-in}.swal2-progress-steps{align-items:center;margin:0 0 1.25em;padding:0;background:inherit;font-weight:600}.swal2-progress-steps li{display:inline-block;position:relative}.swal2-progress-steps .swal2-progress-step{z-index:20;width:2em;height:2em;border-radius:2em;background:#3085d6;color:#fff;line-height:2em;text-align:center}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#3085d6}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}.swal2-progress-steps .swal2-progress-step-line{z-index:10;width:2.5em;height:.4em;margin:0 -1px;background:#3085d6}[class^=swal2]{-webkit-tap-highlight-color:transparent}.swal2-show{-webkit-animation:swal2-show .3s;animation:swal2-show .3s}.swal2-hide{-webkit-animation:swal2-hide .15s forwards;animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{right:auto;left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}@supports (-ms-accelerator:true){.swal2-range input{width:100%!important}.swal2-range output{display:none}}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.swal2-range input{width:100%!important}.swal2-range output{display:none}}@-moz-document url-prefix(){.swal2-close:focus{outline:2px solid rgba(50,100,150,.4)}}@-webkit-keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@-webkit-keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@-webkit-keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@-webkit-keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@-webkit-keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@-webkit-keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@-webkit-keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@-webkit-keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@-webkit-keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@-webkit-keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@-webkit-keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@-webkit-keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto!important}body.swal2-no-backdrop .swal2-container{top:auto;right:auto;bottom:auto;left:auto;max-width:calc(100% - .625em * 2);background-color:transparent!important}body.swal2-no-backdrop .swal2-container>.swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}body.swal2-no-backdrop .swal2-container.swal2-top{top:0;left:50%;transform:translateX(-50%)}body.swal2-no-backdrop .swal2-container.swal2-top-left,body.swal2-no-backdrop .swal2-container.swal2-top-start{top:0;left:0}body.swal2-no-backdrop .swal2-container.swal2-top-end,body.swal2-no-backdrop .swal2-container.swal2-top-right{top:0;right:0}body.swal2-no-backdrop .swal2-container.swal2-center{top:50%;left:50%;transform:translate(-50%,-50%)}body.swal2-no-backdrop .swal2-container.swal2-center-left,body.swal2-no-backdrop .swal2-container.swal2-center-start{top:50%;left:0;transform:translateY(-50%)}body.swal2-no-backdrop .swal2-container.swal2-center-end,body.swal2-no-backdrop .swal2-container.swal2-center-right{top:50%;right:0;transform:translateY(-50%)}body.swal2-no-backdrop .swal2-container.swal2-bottom{bottom:0;left:50%;transform:translateX(-50%)}body.swal2-no-backdrop .swal2-container.swal2-bottom-left,body.swal2-no-backdrop .swal2-container.swal2-bottom-start{bottom:0;left:0}body.swal2-no-backdrop .swal2-container.swal2-bottom-end,body.swal2-no-backdrop .swal2-container.swal2-bottom-right{right:0;bottom:0}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll!important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static!important}}body.swal2-toast-shown .swal2-container{background-color:transparent}body.swal2-toast-shown .swal2-container.swal2-top{top:0;right:auto;bottom:auto;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{top:0;right:0;bottom:auto;left:auto}body.swal2-toast-shown .swal2-container.swal2-top-left,body.swal2-toast-shown .swal2-container.swal2-top-start{top:0;right:auto;bottom:auto;left:0}body.swal2-toast-shown .swal2-container.swal2-center-left,body.swal2-toast-shown .swal2-container.swal2-center-start{top:50%;right:auto;bottom:auto;left:0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{top:50%;right:auto;bottom:auto;left:50%;transform:translate(-50%,-50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{top:50%;right:0;bottom:auto;left:auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-left,body.swal2-toast-shown .swal2-container.swal2-bottom-start{top:auto;right:auto;bottom:0;left:0}body.swal2-toast-shown .swal2-container.swal2-bottom{top:auto;right:auto;bottom:0;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{top:auto;right:0;bottom:0;left:auto}body.swal2-toast-column .swal2-toast{flex-direction:column;align-items:stretch}body.swal2-toast-column .swal2-toast .swal2-actions{flex:1;align-self:stretch;height:2.2em;margin-top:.3125em}body.swal2-toast-column .swal2-toast .swal2-loading{justify-content:center}body.swal2-toast-column .swal2-toast .swal2-input{height:2em;margin:.3125em auto;font-size:1em}body.swal2-toast-column .swal2-toast .swal2-validation-message{font-size:1em}')},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SimulationFrame=void 0;var i=function(t,e){this.position=t,this.velocity=e};e.SimulationFrame=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Space=void 0,function(t){t.Local="local",t.Global="global"}(e.Space||(e.Space={}))},function(t,e,n){"use strict";n.r(e),n.d(e,"Detector",(function(){return i}));var i={canvas:!!window.CanvasRenderingContext2D,webgl:function(){try{var t=document.createElement("canvas");return!(!window.WebGLRenderingContext||!t.getContext("webgl")&&!t.getContext("experimental-webgl"))}catch(t){return!1}}(),workers:!!window.Worker,fileapi:window.File&&window.FileReader&&window.FileList&&window.Blob,getWebGLErrorMessage:function(){var t=document.createElement("div");return t.id="webgl-error-message",t.style.fontFamily="monospace",t.style.fontSize="13px",t.style.fontWeight="normal",t.style.textAlign="center",t.style.background="#fff",t.style.color="#000",t.style.padding="1.5em",t.style.width="400px",t.style.margin="5em auto 0",this.webgl||(t.innerHTML=window.WebGLRenderingContext?['Your graphics card does not seem to support WebGL.
    ','Find out how to get it here.'].join("\n"):['Your browser does not seem to support WebGL.
    ','Find out how to get it here.'].join("\n")),t},addGetWebGLMessage:function(t){var e,n,r;e=void 0!==(t=t||{}).parent?t.parent:document.body,n=void 0!==t.id?t.id:"oldie",(r=i.getWebGLErrorMessage()).id=n,e.appendChild(r)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UIManager=void 0;var i=function(){function t(){}return t.setUserInterfaceVisible=function(t){document.getElementById("ui-container").style.display=t?"block":"none"},t.setLoadingScreenVisible=function(t){document.getElementById("loading-screen").style.display=t?"flex":"none"},t.setFPSVisible=function(t){document.getElementById("statsBox").style.display=t?"block":"none",document.getElementById("dat-gui-container").style.top=t?"48px":"0px"},t}();e.UIManager=i},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.SwitchingSeats=void 0;var o=n(0),a=n(3),s=n(6),c=n(10),l=n(12),u=n(18),h=n(2),d=n(22),p=function(t){function e(e,n,i){var r=t.call(this,e)||this;r.startPosition=new o.Vector3,r.endPosition=new o.Vector3,r.startRotation=new o.Quaternion,r.endRotation=new o.Quaternion,r.toSeat=i,r.canFindVehiclesToEnter=!1,r.canLeaveVehicles=!1,e.leaveSeat(),r.character.occupySeat(i);var a=h.getRight(n.seatPointObject,d.Space.Local),c=i.seatPointObject.position.clone().sub(n.seatPointObject.position).normalize(),l=a.dot(c)>0?s.Side.Left:s.Side.Right;return l===s.Side.Left?r.playAnimation("sitting_shift_left",.1):l===s.Side.Right&&r.playAnimation("sitting_shift_right",.1),r.startPosition.copy(n.seatPointObject.position),r.startPosition.y+=.6,r.endPosition.copy(i.seatPointObject.position),r.endPosition.y+=.6,r.startRotation.copy(n.seatPointObject.quaternion),r.endRotation.copy(i.seatPointObject.quaternion),r}return r(e,t),e.prototype.update=function(e){if(t.prototype.update.call(this,e),this.animationEnded(e))this.toSeat.type===c.SeatType.Driver?this.character.setState(new l.Driving(this.character,this.toSeat)):this.toSeat.type===c.SeatType.Passenger&&this.character.setState(new u.Sitting(this.character,this.toSeat));else{var n=this.timer/this.animationLength,i=h.easeInOutSine(n),r=(new o.Vector3).lerpVectors(this.startPosition,this.endPosition,i);this.character.setPosition(r.x,r.y,r.z),o.Quaternion.slerp(this.startRotation,this.endRotation,this.character.quaternion,i)}},e}(a.CharacterStateBase);e.SwitchingSeats=p},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.DropRolling=void 0;var o=n(3),a=function(t){function e(e){var n=t.call(this,e)||this;return n.character.velocitySimulator.mass=1,n.character.velocitySimulator.damping=.6,n.character.setArcadeVelocityTarget(.8),n.playAnimation("drop_running_roll",.03),n}return r(e,t),e.prototype.update=function(e){t.prototype.update.call(this,e),this.character.setCameraRelativeOrientationTarget(),this.animationEnded(e)&&(this.anyDirection()?this.character.setState(new o.Walk(this.character)):this.character.setState(new o.EndWalk(this.character)))},e}(o.CharacterStateBase);e.DropRolling=a},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.CloseVehicleDoorInside=void 0;var o=n(3),a=n(6),s=n(12),c=n(10),l=n(18),u=n(2),h=function(t){function e(e,n){var i,r=t.call(this,e)||this;r.hasClosedDoor=!1,r.seat=n,r.canFindVehiclesToEnter=!1,r.canLeaveVehicles=!1;var o=u.detectRelativeSide(n.seatPointObject,n.door.doorObject);return o===a.Side.Left?r.playAnimation("close_door_sitting_left",.1):o===a.Side.Right&&r.playAnimation("close_door_sitting_right",.1),null===(i=r.seat.door)||void 0===i||i.open(),r}return r(e,t),e.prototype.update=function(e){var n;t.prototype.update.call(this,e),this.timer>.4&&!this.hasClosedDoor&&(this.hasClosedDoor=!0,null===(n=this.seat.door)||void 0===n||n.close()),this.animationEnded(e)&&(this.seat.type===c.SeatType.Driver?this.character.setState(new s.Driving(this.character,this.seat)):this.seat.type===c.SeatType.Passenger&&this.character.setState(new l.Sitting(this.character,this.seat)))},e}(o.CharacterStateBase);e.CloseVehicleDoorInside=h},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.Character=void 0;var o=n(0),a=n(1),s=n(7),c=n(2),l=n(8),u=n(84),h=n(86),d=n(9),p=n(29),f=n(87),m=n(89),v=n(12),g=n(90),y=n(15),x=n(91),w=n(92),b=n(10),_=n(93),S=n(94),M=n(11),A=function(t){function e(e){var n=t.call(this)||this;n.updateOrder=1,n.entityType=M.EntityType.Character,n.height=0,n.materials=[],n.acceleration=new o.Vector3,n.velocity=new o.Vector3,n.arcadeVelocityInfluence=new o.Vector3,n.velocityTarget=new o.Vector3,n.arcadeVelocityIsAdditive=!1,n.defaultVelocitySimulatorDamping=.8,n.defaultVelocitySimulatorMass=50,n.moveSpeed=4,n.angularVelocity=0,n.orientation=new o.Vector3(0,0,1),n.orientationTarget=new o.Vector3(0,0,1),n.defaultRotationSimulatorDamping=.5,n.defaultRotationSimulatorMass=10,n.rayResult=new a.RaycastResult,n.rayHasHit=!1,n.rayCastLength=.57,n.raySafeOffset=.03,n.wantsToJump=!1,n.initJumpSpeed=-1,n.groundImpactData=new _.GroundImpactData,n.occupyingSeat=null,n.vehicleEntryInstance=null,n.physicsEnabled=!0,n.readCharacterData(e),n.setAnimations(e.animations),n.tiltContainer=new o.Group,n.add(n.tiltContainer),n.modelContainer=new o.Group,n.modelContainer.position.y=-.57,n.tiltContainer.add(n.modelContainer),n.modelContainer.add(e.scene),n.mixer=new o.AnimationMixer(e.scene),n.velocitySimulator=new u.VectorSpringSimulator(60,n.defaultVelocitySimulatorMass,n.defaultVelocitySimulatorDamping),n.rotationSimulator=new h.RelativeSpringSimulator(60,n.defaultRotationSimulatorMass,n.defaultRotationSimulatorDamping),n.viewVector=new o.Vector3,n.actions={up:new l.KeyBinding("KeyW"),down:new l.KeyBinding("KeyS"),left:new l.KeyBinding("KeyA"),right:new l.KeyBinding("KeyD"),run:new l.KeyBinding("ShiftLeft"),jump:new l.KeyBinding("Space"),use:new l.KeyBinding("KeyE"),enter:new l.KeyBinding("KeyF"),enter_passenger:new l.KeyBinding("KeyG"),seat_switch:new l.KeyBinding("KeyX"),primary:new l.KeyBinding("Mouse0"),secondary:new l.KeyBinding("Mouse1")},n.characterCapsule=new x.CapsuleCollider({mass:1,position:new a.Vec3,height:.5,radius:.25,segments:8,friction:0}),n.characterCapsule.body.shapes.forEach((function(t){t.collisionFilterMask=~y.CollisionGroups.TrimeshColliders})),n.characterCapsule.body.allowSleep=!1,n.characterCapsule.body.collisionFilterGroup=2,n.characterCapsule.body.fixedRotation=!0,n.characterCapsule.body.updateMassProperties();var i=new o.BoxGeometry(.1,.1,.1),r=new o.MeshLambertMaterial({color:16711680});return n.raycastBox=new o.Mesh(i,r),n.raycastBox.visible=!1,n.characterCapsule.body.preStep=function(t){n.physicsPreStep(t,n)},n.characterCapsule.body.postStep=function(t){n.physicsPostStep(t,n)},n.setState(new d.Idle(n)),n}return r(e,t),e.prototype.setAnimations=function(t){this.animations=t},e.prototype.setArcadeVelocityInfluence=function(t,e,n){void 0===e&&(e=t),void 0===n&&(n=t),this.arcadeVelocityInfluence.set(t,e,n)},e.prototype.setViewVector=function(t){this.viewVector.copy(t).normalize()},e.prototype.setState=function(t){this.charState=t,this.charState.onInputChange()},e.prototype.setPosition=function(t,e,n){this.physicsEnabled?(this.characterCapsule.body.previousPosition=new a.Vec3(t,e,n),this.characterCapsule.body.position=new a.Vec3(t,e,n),this.characterCapsule.body.interpolatedPosition=new a.Vec3(t,e,n)):(this.position.x=t,this.position.y=e,this.position.z=n)},e.prototype.resetVelocity=function(){this.velocity.x=0,this.velocity.y=0,this.velocity.z=0,this.characterCapsule.body.velocity.x=0,this.characterCapsule.body.velocity.y=0,this.characterCapsule.body.velocity.z=0,this.velocitySimulator.init()},e.prototype.setArcadeVelocityTarget=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=0),this.velocityTarget.z=t,this.velocityTarget.x=e,this.velocityTarget.y=n},e.prototype.setOrientation=function(t,e){void 0===e&&(e=!1);var n=(new o.Vector3).copy(t).setY(0).normalize();this.orientationTarget.copy(n),e&&this.orientation.copy(n)},e.prototype.resetOrientation=function(){var t=c.getForward(this);this.setOrientation(t,!0)},e.prototype.setBehaviour=function(t){t.character=this,this.behaviour=t},e.prototype.setPhysicsEnabled=function(t){this.physicsEnabled=t,!0===t?this.world.physicsWorld.addBody(this.characterCapsule.body):this.world.physicsWorld.remove(this.characterCapsule.body)},e.prototype.readCharacterData=function(t){var e=this;t.scene.traverse((function(t){t.isMesh&&(c.setupMeshProperties(t),void 0!==t.material&&e.materials.push(t.material))}))},e.prototype.handleKeyboardEvent=function(t,e,n){if(void 0!==this.controlledObject)this.controlledObject.handleKeyboardEvent(t,e,n);else if("KeyC"===e&&!0===n&&!0===t.shiftKey)this.resetControls(),this.world.cameraOperator.characterCaller=this,this.world.inputManager.setInputReceiver(this.world.cameraOperator);else if("KeyR"===e&&!0===n&&!0===t.shiftKey)this.world.restartScenario();else for(var i in this.actions)if(this.actions.hasOwnProperty(i)){var r=this.actions[i];s.includes(r.eventCodes,e)&&this.triggerAction(i,n)}},e.prototype.handleMouseButton=function(t,e,n){if(void 0!==this.controlledObject)this.controlledObject.handleMouseButton(t,e,n);else for(var i in this.actions)if(this.actions.hasOwnProperty(i)){var r=this.actions[i];s.includes(r.eventCodes,e)&&this.triggerAction(i,n)}},e.prototype.handleMouseMove=function(t,e,n){void 0!==this.controlledObject?this.controlledObject.handleMouseMove(t,e,n):this.world.cameraOperator.move(e,n)},e.prototype.handleMouseWheel=function(t,e){void 0!==this.controlledObject?this.controlledObject.handleMouseWheel(t,e):this.world.scrollTheTimeScale(e)},e.prototype.triggerAction=function(t,e){var n=this.actions[t];n.isPressed!==e&&(n.isPressed=e,n.justPressed=!1,n.justReleased=!1,e?n.justPressed=!0:n.justReleased=!0,this.charState.onInputChange(),n.justPressed=!1,n.justReleased=!1)},e.prototype.takeControl=function(){void 0!==this.world?this.world.inputManager.setInputReceiver(this):console.warn("Attempting to take control of a character that doesn't belong to a world.")},e.prototype.resetControls=function(){for(var t in this.actions)this.actions.hasOwnProperty(t)&&this.triggerAction(t,!1)},e.prototype.update=function(t){var e,n,i;if(null===(e=this.behaviour)||void 0===e||e.update(t),null===(n=this.vehicleEntryInstance)||void 0===n||n.update(t),null===(i=this.charState)||void 0===i||i.update(t),this.physicsEnabled&&this.springMovement(t),this.physicsEnabled&&this.springRotation(t),this.physicsEnabled&&this.rotateModel(),void 0!==this.mixer&&this.mixer.update(t),this.physicsEnabled)this.position.set(this.characterCapsule.body.interpolatedPosition.x,this.characterCapsule.body.interpolatedPosition.y,this.characterCapsule.body.interpolatedPosition.z);else{var r=new o.Vector3;this.getWorldPosition(r),this.characterCapsule.body.position.copy(c.cannonVector(r)),this.characterCapsule.body.interpolatedPosition.copy(c.cannonVector(r))}this.updateMatrixWorld()},e.prototype.inputReceiverInit=function(){void 0===this.controlledObject?(this.world.cameraOperator.setRadius(1.6,!0),this.world.cameraOperator.followMode=!1,this.displayControls()):this.controlledObject.inputReceiverInit()},e.prototype.displayControls=function(){this.world.updateControls([{keys:["W","A","S","D"],desc:"Movement"},{keys:["Shift"],desc:"Sprint"},{keys:["Space"],desc:"Jump"},{keys:["F","or","G"],desc:"Enter vehicle"},{keys:["Shift","+","R"],desc:"Respawn"},{keys:["Shift","+","C"],desc:"Free camera"}])},e.prototype.inputReceiverUpdate=function(t){void 0!==this.controlledObject?this.controlledObject.inputReceiverUpdate(t):(this.viewVector=(new o.Vector3).subVectors(this.position,this.world.camera.position),this.getWorldPosition(this.world.cameraOperator.target))},e.prototype.setAnimation=function(t,e){if(void 0!==this.mixer){var n=o.AnimationClip.findByName(this.animations,t),i=this.mixer.clipAction(n);return null===i?(console.error("Animation "+t+" not found!"),0):(this.mixer.stopAllAction(),i.fadeIn(e),i.play(),i.getClip().duration)}},e.prototype.springMovement=function(t){this.velocitySimulator.target.copy(this.velocityTarget),this.velocitySimulator.simulate(t),this.velocity.copy(this.velocitySimulator.position),this.acceleration.copy(this.velocitySimulator.velocity)},e.prototype.springRotation=function(t){var e=c.getSignedAngleBetweenVectors(this.orientation,this.orientationTarget);this.rotationSimulator.target=e,this.rotationSimulator.simulate(t);var n=this.rotationSimulator.position;this.orientation.applyAxisAngle(new o.Vector3(0,1,0),n),this.angularVelocity=this.rotationSimulator.velocity},e.prototype.getLocalMovementDirection=function(){var t=this.actions.right.isPressed?-1:0,e=this.actions.left.isPressed?1:0,n=this.actions.up.isPressed?1:0,i=this.actions.down.isPressed?-1:0;return new o.Vector3(t+e,0,n+i).normalize()},e.prototype.getCameraRelativeMovementVector=function(){var t=this.getLocalMovementDirection(),e=new o.Vector3(this.viewVector.x,0,this.viewVector.z).normalize();return c.appplyVectorMatrixXZ(e,t)},e.prototype.setCameraRelativeOrientationTarget=function(){if(null===this.vehicleEntryInstance){var t=this.getCameraRelativeMovementVector();0===t.x&&0===t.y&&0===t.z?this.setOrientation(this.orientation):this.setOrientation(t)}},e.prototype.rotateModel=function(){this.lookAt(this.position.x+this.orientation.x,this.position.y+this.orientation.y,this.position.z+this.orientation.z),this.tiltContainer.rotation.z=2.3*-this.angularVelocity*this.velocity.length(),this.tiltContainer.position.setY(Math.cos(Math.abs(2.3*this.angularVelocity*this.velocity.length()))/2-.5)},e.prototype.jump=function(t){void 0===t&&(t=-1),this.wantsToJump=!0,this.initJumpSpeed=t},e.prototype.findVehicleToEnter=function(t){var e=new o.Vector3,n=new S.ClosestObjectFinder(this.position,10);if(this.world.vehicles.forEach((function(t){n.consider(t,t.position)})),void 0!==n.closestObject){var i=n.closestObject,r=new w.VehicleEntryInstance(this);r.wantsToDrive=t;for(var a=new S.ClosestObjectFinder(this.position),s=0,c=i.seats;s0){var u=new a.Vec3;e.rayResult.body.getVelocityAtWorldPoint(e.rayResult.hitPointWorld,u),r.add(c.threeVector(u))}var h=new o.Vector3(0,1,0),d=new o.Vector3(e.rayResult.hitNormalWorld.x,e.rayResult.hitNormalWorld.y,e.rayResult.hitNormalWorld.z),p=(new o.Quaternion).setFromUnitVectors(h,d),f=(new o.Matrix4).makeRotationFromQuaternion(p);r.applyMatrix4(f),t.velocity.x=r.x,t.velocity.y=r.y,t.velocity.z=r.z,t.position.y=e.rayResult.hitPointWorld.y+e.rayCastLength+r.y/e.world.physicsFrameRate}else t.velocity.x=r.x,t.velocity.y=r.y,t.velocity.z=r.z,e.groundImpactData.velocity.x=t.velocity.x,e.groundImpactData.velocity.y=t.velocity.y,e.groundImpactData.velocity.z=t.velocity.z;if(e.wantsToJump){if(e.initJumpSpeed>-1){t.velocity.y=0;var m=Math.max(4*e.velocitySimulator.position.length(),e.initJumpSpeed);t.velocity=c.cannonVector(e.orientation.clone().multiplyScalar(m))}else{l=new a.Vec3;e.rayResult.body.getVelocityAtWorldPoint(e.rayResult.hitPointWorld,l),t.velocity.vsub(l,t.velocity)}t.velocity.y+=4,t.position.y+=2*e.raySafeOffset,e.wantsToJump=!1}},e.prototype.addToWorld=function(t){s.includes(t.characters,this)?console.warn("Adding character to a world in which it already exists."):(this.world=t,t.characters.push(this),t.physicsWorld.addBody(this.characterCapsule.body),t.graphicsWorld.add(this),t.graphicsWorld.add(this.raycastBox),this.materials.forEach((function(e){t.sky.csm.setupMaterial(e)})))},e.prototype.removeFromWorld=function(t){s.includes(t.characters,this)?(t.inputManager.inputReceiver===this&&(t.inputManager.inputReceiver=void 0),this.world=void 0,s.pull(t.characters,this),t.physicsWorld.remove(this.characterCapsule.body),t.graphicsWorld.remove(this),t.graphicsWorld.remove(this.raycastBox)):console.warn("Removing character from a world in which it isn't present.")},e}(o.Object3D);e.Character=A},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.EnteringVehicle=void 0;var o=n(0),a=n(3),s=n(12),c=n(6),l=n(18),u=n(10),h=n(11),d=n(2),p=n(13),f=function(t){function e(e,n,i){var r=t.call(this,e)||this;r.initialPositionOffset=new o.Vector3,r.startPosition=new o.Vector3,r.endPosition=new o.Vector3,r.startRotation=new o.Quaternion,r.endRotation=new o.Quaternion,r.canFindVehiclesToEnter=!1,r.vehicle=n.vehicle,r.seat=n;var a=d.detectRelativeSide(i,n.seatPointObject);return r.animData=r.getEntryAnimations(n.vehicle.entityType),r.playAnimation(r.animData[a],.1),r.character.resetVelocity(),r.character.tiltContainer.rotation.z=0,r.character.setPhysicsEnabled(!1),r.seat.vehicle.attach(r.character),r.startPosition.copy(i.position),r.startPosition.y+=.53,r.endPosition.copy(n.seatPointObject.position),r.endPosition.y+=.6,r.initialPositionOffset.copy(r.startPosition).sub(r.character.position),r.startRotation.copy(r.character.quaternion),r.endRotation.copy(r.seat.seatPointObject.quaternion),r.factorSimulator=new p.SpringSimulator(60,10,.5),r.factorSimulator.target=1,r}return r(e,t),e.prototype.update=function(e){if(t.prototype.update.call(this,e),this.animationEnded(e))this.character.occupySeat(this.seat),this.character.setPosition(this.endPosition.x,this.endPosition.y,this.endPosition.z),this.seat.type===u.SeatType.Driver?(this.seat.door&&(this.seat.door.physicsEnabled=!0),this.character.setState(new s.Driving(this.character,this.seat))):this.seat.type===u.SeatType.Passenger&&this.character.setState(new l.Sitting(this.character,this.seat));else{this.seat.door&&(this.seat.door.physicsEnabled=!1,this.seat.door.rotation=1);var n=o.MathUtils.clamp(this.timer/(this.animationLength-this.animData.end_early),0,1),i=d.easeInOutSine(n);this.factorSimulator.simulate(e);var r=(new o.Vector3).lerpVectors(this.initialPositionOffset,new o.Vector3,this.factorSimulator.position),a=(new o.Vector3).lerpVectors(this.startPosition.clone().sub(r),this.endPosition,i);this.character.setPosition(a.x,a.y,a.z),o.Quaternion.slerp(this.startRotation,this.endRotation,this.character.quaternion,this.factorSimulator.position)}},e.prototype.getEntryAnimations=function(t){var e,n;switch(t){case h.EntityType.Airplane:return(e={})[c.Side.Left]="enter_airplane_left",e[c.Side.Right]="enter_airplane_right",e.end_early=.3,e;default:return(n={})[c.Side.Left]="sit_down_left",n[c.Side.Right]="sit_down_right",n.end_early=0,n}},e}(a.CharacterStateBase);e.EnteringVehicle=f},function(t,e,n){"use strict";var i,r=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.ExitingStateBase=void 0;var o=n(0),a=n(2),s=function(t){function e(e,n){var i,r=t.call(this,e)||this;return r.startPosition=new o.Vector3,r.endPosition=new o.Vector3,r.startRotation=new o.Quaternion,r.endRotation=new o.Quaternion,r.canFindVehiclesToEnter=!1,r.seat=n,r.vehicle=n.vehicle,null===(i=r.seat.door)||void 0===i||i.open(),r.startPosition.copy(r.character.position),r.startRotation.copy(r.character.quaternion),r.dummyObj=new o.Object3D,r}return r(e,t),e.prototype.detachCharacterFromVehicle=function(){this.character.controlledObject=void 0,this.character.resetOrientation(),this.character.world.graphicsWorld.attach(this.character),this.character.resetVelocity(),this.character.setPhysicsEnabled(!0),this.character.setPosition(this.character.position.x,this.character.position.y,this.character.position.z),this.character.inputReceiverUpdate(0),this.character.characterCapsule.body.velocity.copy(this.vehicle.rayCastVehicle.chassisBody.velocity),this.character.feetRaycast()},e.prototype.updateEndRotation=function(){var t=a.getForward(this.exitPoint);t.y=0,t.normalize(),this.character.world.graphicsWorld.attach(this.dummyObj),this.exitPoint.getWorldPosition(this.dummyObj.position);var e=this.dummyObj.position.clone().add(t);this.dummyObj.lookAt(e),this.seat.seatPointObject.parent.attach(this.dummyObj),this.endRotation.copy(this.dummyObj.quaternion)},e}(n(3).CharacterStateBase);e.ExitingStateBase=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),n(32);var i=n(42);Object.defineProperty(e,"World",{enumerable:!0,get:function(){return i.World}})},function(t,e,n){var i=n(33),r=n(34);"string"==typeof(r=r.__esModule?r.default:r)&&(r=[[t.i,r,""]]);var o={injectType:"singletonStyleTag",insert:"head",singleton:!0};i(r,o);t.exports=r.locals||{}},function(t,e,n){"use strict";var i,r=function(){return void 0===i&&(i=Boolean(window&&document&&document.all&&!window.atob)),i},o=function(){var t={};return function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}t[e]=n}return t[e]}}(),a=[];function s(t){for(var e=-1,n=0;nul.close-top {\r\n margin-top: 0\r\n}\r\n\r\n.dg.a.has-save>ul.close-bottom {\r\n margin-top: 27px\r\n}\r\n\r\n.dg.a.has-save>ul.closed {\r\n margin-top: 0\r\n}\r\n\r\n.dg.a .save-row {\r\n top: 0;\r\n z-index: 1002\r\n}\r\n\r\n.dg.a .save-row.close-top {\r\n position: relative\r\n}\r\n\r\n.dg.a .save-row.close-bottom {\r\n position: fixed\r\n}\r\n\r\n.dg li {\r\n -webkit-transition: height .1s ease-out;\r\n -o-transition: height .1s ease-out;\r\n -moz-transition: height .1s ease-out;\r\n transition: height .1s ease-out;\r\n -webkit-transition: overflow .1s linear;\r\n -o-transition: overflow .1s linear;\r\n -moz-transition: overflow .1s linear;\r\n transition: overflow .1s linear\r\n}\r\n\r\n.dg li:not(.folder) {\r\n cursor: auto;\r\n height: 33px;\r\n line-height: 33px;\r\n padding: 0 10px 0 10px\r\n}\r\n\r\n.dg li.folder {\r\n padding: 0;\r\n border-left: 4px solid transparent\r\n}\r\n\r\n.dg li.title {\r\n /* font-family: 'Allerta Stencil', sans-serif; */\r\n /* font-family: 'Patua One', cursive; */\r\n /* font-family: 'Fredoka One', cursive; */\r\n font-weight: 500;\r\n cursor: pointer;\r\n margin-left: -4px\r\n}\r\n\r\n.dg .closed li:not(.title),\r\n.dg .closed ul li,\r\n.dg .closed ul li>* {\r\n height: 0;\r\n overflow: hidden;\r\n border: 0\r\n}\r\n\r\n.dg .cr {\r\n clear: both;\r\n padding-left: 3px;\r\n height: 27px;\r\n overflow: hidden\r\n}\r\n\r\n.dg .property-name {\r\n font-size: 82%;\r\n cursor: default;\r\n float: left;\r\n clear: left;\r\n width: 40%;\r\n overflow: hidden;\r\n white-space: nowrap;\r\n text-overflow: ellipsis\r\n}\r\n\r\n.dg .cr.function .property-name {\r\n width: 100%;\r\n}\r\n\r\n.dg .c {\r\n float: left;\r\n width: 60%;\r\n position: relative\r\n}\r\n\r\n.dg .c input[type=text] {\r\n border: 0;\r\n margin-top: 4px;\r\n padding: 3px;\r\n width: 100%;\r\n float: right\r\n}\r\n\r\n.dg .has-slider input[type=text] {\r\n width: 30%;\r\n margin-left: 0\r\n}\r\n\r\n.dg .slider {\r\n float: left;\r\n width: 66%;\r\n margin-left: -5px;\r\n margin-right: 0;\r\n height: 19px;\r\n margin-top: 4px\r\n}\r\n\r\n.dg .slider-fg {\r\n height: 100%\r\n}\r\n\r\n.dg .c input[type=checkbox] {\r\n margin-top: 7px\r\n}\r\n\r\n.dg .c select {\r\n margin-top: 5px\r\n}\r\n\r\n.dg .cr.function,\r\n.dg .cr.function .property-name,\r\n.dg .cr.function *,\r\n.dg .cr.boolean,\r\n.dg .cr.boolean * {\r\n cursor: pointer\r\n}\r\n\r\n.dg .cr.color {\r\n overflow: visible\r\n}\r\n\r\n.dg .selector {\r\n display: none;\r\n position: absolute;\r\n margin-left: -9px;\r\n margin-top: 23px;\r\n z-index: 10\r\n}\r\n\r\n.dg .c:hover .selector,\r\n.dg .selector.drag {\r\n display: block\r\n}\r\n\r\n.dg li.save-row {\r\n padding: 0\r\n}\r\n\r\n.dg li.save-row .button {\r\n display: inline-block;\r\n padding: 0px 6px\r\n}\r\n\r\n.dg.dialogue {\r\n background-color: #222;\r\n width: 460px;\r\n padding: 15px;\r\n font-size: 13px;\r\n line-height: 15px\r\n}\r\n\r\n#dg-new-constructor {\r\n padding: 10px;\r\n color: #222;\r\n font-family: Monaco, monospace;\r\n font-size: 10px;\r\n border: 0;\r\n resize: none;\r\n box-shadow: inset 1px 1px 1px #888;\r\n word-wrap: break-word;\r\n margin: 12px 0;\r\n display: block;\r\n width: 440px;\r\n overflow-y: scroll;\r\n height: 100px;\r\n position: relative\r\n}\r\n\r\n#dg-local-explain {\r\n display: none;\r\n font-size: 11px;\r\n line-height: 17px;\r\n border-radius: 3px;\r\n background-color: #333;\r\n padding: 8px;\r\n margin-top: 10px\r\n}\r\n\r\n#dg-local-explain code {\r\n font-size: 10px\r\n}\r\n\r\n#dat-gui-save-locally {\r\n display: none\r\n}\r\n\r\n.dg {\r\n color: #eee;\r\n /* font-family: 'Cutive Mono', sans-serif; */\r\n /* text-shadow: 0 -1px 0 #111 */\r\n text-shadow: none;\r\n}\r\n\r\n.dg.main::-webkit-scrollbar {\r\n width: 5px;\r\n background: #1a1a1a\r\n}\r\n\r\n.dg.main::-webkit-scrollbar-corner {\r\n height: 0;\r\n display: none\r\n}\r\n\r\n.dg.main::-webkit-scrollbar-thumb {\r\n border-radius: 5px;\r\n background: #676767\r\n}\r\n\r\n.dg li:not(.folder) {\r\n background: rgb(26 26 26 / 92%);\r\n border-bottom: 1px solid #2c2c2c;\r\n -webkit-backdrop-filter: blur(10px);\r\n backdrop-filter: blur(10px);\r\n margin-left: -4px;\r\n}\r\n\r\n.dg li.save-row {\r\n line-height: 25px;\r\n background: #dad5cb;\r\n border: 0\r\n}\r\n\r\n.dg li.save-row select {\r\n margin-left: 5px;\r\n width: 108px\r\n}\r\n\r\n.dg li.save-row .button {\r\n margin-left: 5px;\r\n margin-top: 1px;\r\n border-radius: 2px;\r\n font-size: 9px;\r\n line-height: 7px;\r\n padding: 4px 4px 5px 4px;\r\n background: #c5bdad;\r\n color: #fff;\r\n text-shadow: 0 1px 0 #b0a58f;\r\n box-shadow: 0 -1px 0 #b0a58f;\r\n cursor: pointer\r\n}\r\n\r\n.dg li.save-row .button.gears {\r\n background: #c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;\r\n height: 7px;\r\n width: 8px\r\n}\r\n\r\n.dg li.save-row .button:hover {\r\n background-color: #bab19e;\r\n box-shadow: 0 -1px 0 #b0a58f\r\n}\r\n\r\n.dg li.folder {\r\n border-bottom: 0\r\n}\r\n\r\n.dg li.title {\r\n font-size: 90%;\r\n height: 33px;\r\n line-height: 33px;\r\n padding-left: 20px;\r\n background: #000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 8px 14px no-repeat;\r\n cursor: pointer;\r\n border-bottom: 1px solid rgba(255, 255, 255, 0.2);\r\n background-color: rgb(0 0 0 / 92%);\r\n}\r\n\r\n.dg .closed li.title {\r\n background-image: url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)\r\n}\r\n\r\n.dg .cr.boolean {\r\n border-left: 3px solid #806787\r\n}\r\n\r\n.dg .cr.color {\r\n border-left: 3px solid\r\n}\r\n\r\n.dg .cr.function {\r\n border-left: 3px solid #e61d5f\r\n}\r\n\r\n.dg .cr.number {\r\n border-left: 3px solid #2FA1D6\r\n}\r\n\r\n.dg .cr.number input[type=text] {\r\n color: #2FA1D6\r\n}\r\n\r\n.dg .cr.string {\r\n border-left: 3px solid #1ed36f\r\n}\r\n\r\n.dg .cr.string input[type=text] {\r\n color: #1ed36f\r\n}\r\n\r\n.dg .cr.function:hover,\r\n.dg .cr.boolean:hover {\r\n background: #111\r\n}\r\n\r\n.dg .c input[type=text] {\r\n background: #303030;\r\n outline: none\r\n}\r\n\r\n.dg .c input[type=text]:hover {\r\n background: #3c3c3c\r\n}\r\n\r\n.dg .c input[type=text]:focus {\r\n background: #494949;\r\n color: #fff\r\n}\r\n\r\n.dg .c .slider {\r\n background: #303030;\r\n cursor: ew-resize\r\n}\r\n\r\n.dg .c .slider-fg {\r\n background: #2FA1D6;\r\n max-width: 100%\r\n}\r\n\r\n.dg .c .slider:hover {\r\n background: #3c3c3c\r\n}\r\n\r\n.dg .c .slider:hover .slider-fg {\r\n background: #44abda\r\n}\r\n\r\n\r\n/* Stats box */\r\n\r\n#statsBox {\r\n position: fixed;\r\n top: 15px;\r\n height: 48px;\r\n right: 15px;\r\n opacity: 0.9;\r\n z-index: 10000;\r\n}\r\n\r\n#statsBox,\r\n.dg.ac .dg.main.a .dg .title {\r\n box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3);\r\n}\r\n\r\n.dg.ac {\r\n /* top: 48px; */\r\n user-select: none;\r\n}\r\n\r\n.dg.ac .close-button.close-bottom {\r\n display: none;\r\n}\r\n",""]),t.exports=e},function(t,e,n){(e=n(5)(!1)).push([t.i,"/* Welcome screen */\r\n\r\n#loading-screen {\r\n\tposition: absolute;\r\n\ttop: 0;\r\n\tz-index: 0;\r\n\tdisplay: flex;\r\n\tjustify-content: center;\r\n\talign-items: center;\r\n\tflex-direction: column;\r\n\ttext-align: center;\r\n\theight: 100%;\r\n\twidth: 100%;\r\n}\r\n\r\n#loader {\r\n\tdisplay: flex;\r\n\t-webkit-box-align: center;\r\n\talign-items: center;\r\n\t-webkit-box-pack: center;\r\n\tjustify-content: center;\r\n}\r\n\r\n#main-title {\r\n\tmargin-bottom: 0;\r\n}\r\n\r\n#loading-text {\r\n\tfont-size: larger;\r\n\tmargin-top: 10px;\r\n}\r\n\r\n#loading-screen-background {\r\n\tz-index: -1;\r\n\tposition: absolute;\r\n\theight: 100%;\r\n\twidth: 100%;\r\n\tbackground: -webkit-linear-gradient(top, #568db5 0%, #ccdde8 100%);\r\n\tbackground: -linear-gradient(top, #568db5 0%, #ccdde8 100%);\r\n\tbackground: -moz-linear-gradient(top, #568db5 0%, #ccdde8 100%);\r\n}",""]),t.exports=e},function(t,e,n){(e=n(5)(!1)).push([t.i,".cubeWrap {\r\n\t-webkit-perspective: 800px;\r\n\t\t\tperspective: 800px;\r\n\twidth: 300px;\r\n\toverflow: hidden;\r\n\t/* position: absolute; */\r\n\t-webkit-animation: bouncy 2s ease forwards;\r\n\t\t\tanimation: bouncy 2s ease forwards;\r\n }\r\n \r\n .cube {\r\n\tmargin: 3em auto;\r\n\twidth: 6em;\r\n\theight: 6em;\r\n\t-webkit-transform-style: preserve-3d;\r\n\t\t\ttransform-style: preserve-3d;\r\n\t-webkit-transform-origin: 50% 50% -3em;\r\n\t\t\ttransform-origin: 50% 50% -3em;\r\n\tposition: relative;\r\n\t-webkit-animation: spin 4s linear infinite;\r\n\t\t\tanimation: spin 4s linear infinite;\r\n\t-webkit-transform: rotateX(-50deg) rotateY(405deg);\r\n\t\t\ttransform: rotateX(-50deg) rotateY(405deg);\r\n }\r\n .cube div {\r\n\tposition: absolute;\r\n\twidth: 6em;\r\n\theight: 6em;\r\n\t-webkit-transform-style: preserve-3d;\r\n\t\t\ttransform-style: preserve-3d;\r\n }\r\n \r\n .faces1::before,\r\n .faces1::after,\r\n .faces2::before,\r\n .faces2::after {\r\n\tposition: absolute;\r\n\tcontent: '';\r\n\tdisplay: block;\r\n\twidth: 100%;\r\n\theight: 100%;\r\n\t-webkit-transform-style: preserve-3d;\r\n\t\t\ttransform-style: preserve-3d;\r\n }\r\n \r\n .faces1::before,\r\n .faces2::before {\r\n\t-webkit-transform: rotateY(90deg);\r\n\t\t\ttransform: rotateY(90deg);\r\n\t-webkit-transform-origin: 0 50%;\r\n\t\t\ttransform-origin: 0 50%;\r\n\tbackground-color: purple;\r\n }\r\n \r\n .faces2 {\r\n\t-webkit-transform: rotateX(180deg) translateZ(6em);\r\n\t\t\ttransform: rotateX(180deg) translateZ(6em);\r\n }\r\n \r\n .faces2::before {\r\n\tbackground-color: orange;\r\n\t-webkit-transform: rotateY(-90deg);\r\n\t\t\ttransform: rotateY(-90deg);\r\n\t-webkit-transform-origin: 100% 50%;\r\n\t\t\ttransform-origin: 100% 50%;\r\n }\r\n \r\n .faces1::after,\r\n .faces2::after {\r\n\t-webkit-transform: rotateX(-90deg);\r\n\t\t\ttransform: rotateX(-90deg);\r\n\t-webkit-transform-origin: 50% 0;\r\n\t\t\ttransform-origin: 50% 0;\r\n\tbackground-color: red;\r\n }\r\n \r\n .faces1 {\r\n\tbackground-color: #eee;\r\n }\r\n \r\n .faces2 {\r\n\tbackground-color: #f3f3f3;\r\n }\r\n \r\n .faces1::before {\r\n\tbackground-color: #f8f8f8;\r\n }\r\n \r\n .faces2::before {\r\n\tbackground-color: white;\r\n }\r\n \r\n .faces1::after {\r\n\tbackground-color: #e9e9e9;\r\n }\r\n \r\n .faces2::after {\r\n\tbackground-color: #e4e4e4;\r\n }\r\n \r\n @-webkit-keyframes spin {\r\n\t0% {\r\n\t -webkit-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);\r\n\t\t\t transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);\r\n\t}\r\n\t100% {\r\n\t -webkit-transform: rotateX(720deg) rotateY(360deg) rotateZ(0deg);\r\n\t\t\t transform: rotateX(720deg) rotateY(360deg) rotateZ(0deg);\r\n\t}\r\n }\r\n \r\n @keyframes spin {\r\n\t0% {\r\n\t -webkit-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);\r\n\t\t\t transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);\r\n\t}\r\n\t100% {\r\n\t -webkit-transform: rotateX(720deg) rotateY(360deg) rotateZ(0deg);\r\n\t\t\t transform: rotateX(720deg) rotateY(360deg) rotateZ(0deg);\r\n\t}\r\n }\r\n @-webkit-keyframes bouncy {\r\n\t/* up */\r\n\t0% {\r\n\t -webkit-transform: translateY(-600px) scale(0.8, 1.2);\r\n\t\t\t transform: translateY(-600px) scale(0.8, 1.2);\r\n\t -webkit-animation-timing-function: ease-in;\r\n\t\t\t animation-timing-function: ease-in;\r\n\t}\r\n\t/* floor */\r\n\t30% {\r\n\t -webkit-transform: translateY(0) scale(0.8, 1.2);\r\n\t\t\t transform: translateY(0) scale(0.8, 1.2);\r\n\t -webkit-animation-timing-function: ease-out;\r\n\t\t\t animation-timing-function: ease-out;\r\n\t}\r\n\t/* floor */\r\n\t32% {\r\n\t -webkit-transform: translateY(0) scale(1, 0.8);\r\n\t\t\t transform: translateY(0) scale(1, 0.8);\r\n\t -webkit-animation-timing-function: ease-out;\r\n\t\t\t animation-timing-function: ease-out;\r\n\t}\r\n\t/* up */\r\n\t45% {\r\n\t -webkit-transform: translateY(-100px) scale(0.9, 1.1);\r\n\t\t\t transform: translateY(-100px) scale(0.9, 1.1);\r\n\t -webkit-animation-timing-function: ease-in;\r\n\t\t\t animation-timing-function: ease-in;\r\n\t}\r\n\t/* floor */\r\n\t60% {\r\n\t -webkit-transform: translateY(0) scale(0.9, 1.1);\r\n\t\t\t transform: translateY(0) scale(0.9, 1.1);\r\n\t -webkit-animation-timing-function: ease-out;\r\n\t\t\t animation-timing-function: ease-out;\r\n\t}\r\n\t/* floor */\r\n\t62% {\r\n\t -webkit-transform: translateY(0) scale(1, 0.9);\r\n\t\t\t transform: translateY(0) scale(1, 0.9);\r\n\t -webkit-animation-timing-function: ease-out;\r\n\t\t\t animation-timing-function: ease-out;\r\n\t}\r\n\t/* up */\r\n\t70% {\r\n\t -webkit-transform: translateY(-30px) scale(0.9, 1.1);\r\n\t\t\t transform: translateY(-30px) scale(0.9, 1.1);\r\n\t -webkit-animation-timing-function: ease-in;\r\n\t\t\t animation-timing-function: ease-in;\r\n\t}\r\n\t/* floor */\r\n\t80% {\r\n\t -webkit-transform: translateY(0) scale(1, 1);\r\n\t\t\t transform: translateY(0) scale(1, 1);\r\n\t -webkit-animation-timing-function: ease-out;\r\n\t\t\t animation-timing-function: ease-out;\r\n\t}\r\n\t/* floor */\r\n\t82% {\r\n\t -webkit-transform: translateY(0) scale(1, 0.95);\r\n\t\t\t transform: translateY(0) scale(1, 0.95);\r\n\t -webkit-animation-timing-function: ease-out;\r\n\t\t\t animation-timing-function: ease-out;\r\n\t}\r\n\t/* up */\r\n\t85% {\r\n\t -webkit-transform: translateY(-10px) scale(0.98, 1.02);\r\n\t\t\t transform: translateY(-10px) scale(0.98, 1.02);\r\n\t -webkit-animation-timing-function: ease-in;\r\n\t\t\t animation-timing-function: ease-in;\r\n\t}\r\n\t/* floor */\r\n\t90% {\r\n\t -webkit-transform: translateY(0) scale(1, 1);\r\n\t\t\t transform: translateY(0) scale(1, 1);\r\n\t -webkit-animation-timing-function: ease-out;\r\n\t\t\t animation-timing-function: ease-out;\r\n\t}\r\n }\r\n @keyframes bouncy {\r\n\t/* up */\r\n\t0% {\r\n\t -webkit-transform: translateY(-600px) scale(0.8, 1.2);\r\n\t\t\t transform: translateY(-600px) scale(0.8, 1.2);\r\n\t -webkit-animation-timing-function: ease-in;\r\n\t\t\t animation-timing-function: ease-in;\r\n\t}\r\n\t/* floor */\r\n\t30% {\r\n\t -webkit-transform: translateY(0) scale(0.8, 1.2);\r\n\t\t\t transform: translateY(0) scale(0.8, 1.2);\r\n\t -webkit-animation-timing-function: ease-out;\r\n\t\t\t animation-timing-function: ease-out;\r\n\t}\r\n\t/* floor */\r\n\t32% {\r\n\t -webkit-transform: translateY(0) scale(1, 0.8);\r\n\t\t\t transform: translateY(0) scale(1, 0.8);\r\n\t -webkit-animation-timing-function: ease-out;\r\n\t\t\t animation-timing-function: ease-out;\r\n\t}\r\n\t/* up */\r\n\t45% {\r\n\t -webkit-transform: translateY(-100px) scale(0.9, 1.1);\r\n\t\t\t transform: translateY(-100px) scale(0.9, 1.1);\r\n\t -webkit-animation-timing-function: ease-in;\r\n\t\t\t animation-timing-function: ease-in;\r\n\t}\r\n\t/* floor */\r\n\t60% {\r\n\t -webkit-transform: translateY(0) scale(0.9, 1.1);\r\n\t\t\t transform: translateY(0) scale(0.9, 1.1);\r\n\t -webkit-animation-timing-function: ease-out;\r\n\t\t\t animation-timing-function: ease-out;\r\n\t}\r\n\t/* floor */\r\n\t62% {\r\n\t -webkit-transform: translateY(0) scale(1, 0.9);\r\n\t\t\t transform: translateY(0) scale(1, 0.9);\r\n\t -webkit-animation-timing-function: ease-out;\r\n\t\t\t animation-timing-function: ease-out;\r\n\t}\r\n\t/* up */\r\n\t70% {\r\n\t -webkit-transform: translateY(-30px) scale(0.9, 1.1);\r\n\t\t\t transform: translateY(-30px) scale(0.9, 1.1);\r\n\t -webkit-animation-timing-function: ease-in;\r\n\t\t\t animation-timing-function: ease-in;\r\n\t}\r\n\t/* floor */\r\n\t80% {\r\n\t -webkit-transform: translateY(0) scale(1, 1);\r\n\t\t\t transform: translateY(0) scale(1, 1);\r\n\t -webkit-animation-timing-function: ease-out;\r\n\t\t\t animation-timing-function: ease-out;\r\n\t}\r\n\t/* floor */\r\n\t82% {\r\n\t -webkit-transform: translateY(0) scale(1, 0.95);\r\n\t\t\t transform: translateY(0) scale(1, 0.95);\r\n\t -webkit-animation-timing-function: ease-out;\r\n\t\t\t animation-timing-function: ease-out;\r\n\t}\r\n\t/* up */\r\n\t85% {\r\n\t -webkit-transform: translateY(-10px) scale(0.98, 1.02);\r\n\t\t\t transform: translateY(-10px) scale(0.98, 1.02);\r\n\t -webkit-animation-timing-function: ease-in;\r\n\t\t\t animation-timing-function: ease-in;\r\n\t}\r\n\t/* floor */\r\n\t90% {\r\n\t -webkit-transform: translateY(0) scale(1, 1);\r\n\t\t\t transform: translateY(0) scale(1, 1);\r\n\t -webkit-animation-timing-function: ease-out;\r\n\t\t\t animation-timing-function: ease-out;\r\n\t}\r\n }\r\n ",""]),t.exports=e},function(t,e,n){(e=n(5)(!1)).push([t.i,".swal2-container {\r\n\ttext-shadow: none;\r\n}\r\n\r\n.swal2-confirm {\r\n\tdisplay: inline-block;\r\n\tbackground: #FFB900;\r\n\tborder: none;\r\n\tpadding: 12px 28px;\r\n\tcolor: #222;\r\n\toutline: none;\r\n\tborder-radius: 4px;\r\n\tfont-family: 'Solway', serif;\r\n\tfont-weight: 700;\r\n\tfont-size: 18px;\r\n\tcursor: pointer;\r\n\tmargin: 0 0 4px 0;\r\n\tbox-shadow: 0 4px 0 0 rgb(228 158 0);\r\n}\r\n\r\n.swal2-confirm:active {\r\n\tmargin: 4px 0 0 0;\r\n\tbox-shadow: 0 0px 0 0 rgb(228 158 0);\r\n}\r\n\r\ndiv.swal2-footer {\r\n\tjustify-content: space-evenly;\r\n}\r\n\r\n.button {\r\n\topacity: 0;\r\n\tbackground: black;\r\n\tpadding: 12px 15px 12px 15px;\r\n\tfont-family: \"Cutive Mono\", monospace;\r\n\tfont-size: 1.2rem;\r\n\tborder: none;\r\n\tcolor: white;\r\n\tcursor: pointer;\r\n}",""]),t.exports=e},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.World=void 0;var i=n(0),r=n(1),o=n(20),a=n(43),s=n(44),c=n(103),l=n(47),u=n(14),h=n(48),d=n(23),p=n(49),f=n(50),m=n(51),v=n(7),g=n(52),y=n(2),x=n(53),w=n(24),b=n(56),_=n(15),S=n(58),M=n(59),A=n(60),E=n(98),T=n(101),P=function(){function t(t){var e=this;this.timeScaleTarget=1,this.scenarios=[],this.characters=[],this.vehicles=[],this.paths=[],this.updatables=[];var n=this;d.Detector.webgl||o.default.fire({icon:"warning",title:"WebGL compatibility",text:"This browser doesn't seem to have the required WebGL capabilities. The application may not work correctly.",footer:'Click here for more information',showConfirmButton:!1,buttonsStyling:!1}),this.renderer=new i.WebGLRenderer,this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.setSize(window.innerWidth,window.innerHeight),this.renderer.toneMapping=i.ACESFilmicToneMapping,this.renderer.toneMappingExposure=1,this.renderer.shadowMap.enabled=!0,this.renderer.shadowMap.type=i.PCFSoftShadowMap,this.generateHTML(),window.addEventListener("resize",(function(){n.camera.aspect=window.innerWidth/window.innerHeight,n.camera.updateProjectionMatrix(),n.renderer.setSize(window.innerWidth,window.innerHeight),f.uniforms.resolution.value.set(1/(window.innerWidth*m),1/(window.innerHeight*m)),n.composer.setSize(window.innerWidth*m,window.innerHeight*m)}),!1),this.graphicsWorld=new i.Scene,this.camera=new i.PerspectiveCamera(80,window.innerWidth/window.innerHeight,.1,1010);var a=new l.RenderPass(this.graphicsWorld,this.camera),f=new u.ShaderPass(h.FXAAShader),m=this.renderer.getPixelRatio();if(f.material.uniforms.resolution.value.x=1/(window.innerWidth*m),f.material.uniforms.resolution.value.y=1/(window.innerHeight*m),this.composer=new c.EffectComposer(this.renderer),this.composer.addPass(a),this.composer.addPass(f),this.physicsWorld=new r.World,this.physicsWorld.gravity.set(0,-9.81,0),this.physicsWorld.broadphase=new r.SAPBroadphase(this.physicsWorld),this.physicsWorld.solver.iterations=10,this.physicsWorld.allowSleep=!0,this.parallelPairs=[],this.physicsFrameRate=60,this.physicsFrameTime=1/this.physicsFrameRate,this.physicsMaxPrediction=this.physicsFrameRate,this.clock=new i.Clock,this.renderDelta=0,this.logicDelta=0,this.sinceLastFrame=0,this.justRendered=!1,this.stats=p.Stats(),this.createParamsGUI(n),this.inputManager=new g.InputManager(this,this.renderer.domElement),this.cameraOperator=new s.CameraOperator(this,this.camera,this.params.Mouse_Sensitivity),this.sky=new E.Sky(this),void 0!==t){var v=new x.LoadingManager(this);v.onFinishedCallback=function(){e.update(1,1),e.setTimeScale(1),o.default.fire({title:"Welcome to Sketchbook!",text:"Feel free to explore the world and interact with available vehicles. There are also various scenarios ready to launch from the right panel.",footer:'GitHub pageDiscord server',confirmButtonText:"Okay",buttonsStyling:!1,onClose:function(){w.UIManager.setUserInterfaceVisible(!0)}})},v.loadGLTF(t,(function(t){e.loadScene(v,t)}))}else w.UIManager.setUserInterfaceVisible(!0),w.UIManager.setLoadingScreenVisible(!1),o.default.fire({icon:"success",title:"Hello world!",text:"Empty Sketchbook world was succesfully initialized. Enjoy the blueness of the sky.",buttonsStyling:!1});this.render(this)}return t.prototype.update=function(t,e){this.updatePhysics(t),this.updatables.forEach((function(n){n.update(t,e)})),this.params.Time_Scale=i.MathUtils.lerp(this.params.Time_Scale,this.timeScaleTarget,.2),this.params.Debug_Physics&&this.cannonDebugRenderer.update()},t.prototype.updatePhysics=function(t){var e=this;this.physicsWorld.step(this.physicsFrameTime,t),this.characters.forEach((function(t){e.isOutOfBounds(t.characterCapsule.body.position)&&e.outOfBoundsRespawn(t.characterCapsule.body)})),this.vehicles.forEach((function(t){if(e.isOutOfBounds(t.rayCastVehicle.chassisBody.position)){var n=new i.Vector3;t.spawnPoint.getWorldPosition(n),n.y+=1,e.outOfBoundsRespawn(t.rayCastVehicle.chassisBody,y.cannonVector(n))}}))},t.prototype.isOutOfBounds=function(t){var e=t.x>-211.882&&t.x<211.882&&t.z>-169.098&&t.z<153.232&&t.y>.107,n=t.y<14.989;return!e&&n},t.prototype.outOfBoundsRespawn=function(t,e){var n=e||new r.Vec3(0,16,0),i=new r.Quaternion(0,0,0,1);t.position.copy(n),t.interpolatedPosition.copy(n),t.quaternion.copy(i),t.interpolatedQuaternion.copy(i),t.velocity.setZero(),t.angularVelocity.setZero()},t.prototype.render=function(t){this.requestDelta=this.clock.getDelta(),requestAnimationFrame((function(){t.render(t)}));var e=this.requestDelta+this.renderDelta+this.logicDelta,n=e*this.params.Time_Scale;n=Math.min(n,1/30),t.update(n,e),this.logicDelta=this.clock.getDelta();this.sinceLastFrame+=this.requestDelta+this.renderDelta+this.logicDelta,this.sinceLastFrame%=1/60,this.stats.end(),this.stats.begin(),this.params.FXAA?this.composer.render():this.renderer.render(this.graphicsWorld,this.camera),this.renderDelta=this.clock.getDelta()},t.prototype.setTimeScale=function(t){this.params.Time_Scale=t,this.timeScaleTarget=t},t.prototype.add=function(t){t.addToWorld(this),this.registerUpdatable(t)},t.prototype.registerUpdatable=function(t){this.updatables.push(t),this.updatables.sort((function(t,e){return t.updateOrder>e.updateOrder?1:-1}))},t.prototype.remove=function(t){t.removeFromWorld(this),this.unregisterUpdatable(t)},t.prototype.unregisterUpdatable=function(t){v.pull(this.updatables,t)},t.prototype.loadScene=function(t,e){var n,r=this;e.scene.traverse((function(t){if(t.hasOwnProperty("userData")&&("Mesh"===t.type&&(y.setupMeshProperties(t),r.sky.csm.setupMaterial(t.material),"ocean"===t.material.name&&r.registerUpdatable(new T.Ocean(t,r))),t.userData.hasOwnProperty("data"))){if("physics"===t.userData.data&&t.userData.hasOwnProperty("type")){if("box"===t.userData.type)(e=new S.BoxCollider({size:new i.Vector3(t.scale.x,t.scale.y,t.scale.z)})).body.position.copy(y.cannonVector(t.position)),e.body.quaternion.copy(y.cannonQuat(t.quaternion)),e.body.computeAABB(),e.body.shapes.forEach((function(t){t.collisionFilterMask=~_.CollisionGroups.TrimeshColliders})),r.physicsWorld.addBody(e.body);else if("trimesh"===t.userData.type){var e=new M.TrimeshCollider(t,{});r.physicsWorld.addBody(e.body)}t.visible=!1}"path"===t.userData.data&&r.paths.push(new b.Path(t)),"scenario"===t.userData.data&&r.scenarios.push(new A.Scenario(t,r))}})),this.graphicsWorld.add(e.scene);for(var o=0,a=this.scenarios;o0?(this.timeScaleTarget/=1.3,this.timeScaleTarget<.003&&(this.timeScaleTarget=0)):(this.timeScaleTarget*=1.3,this.timeScaleTarget<.003&&(this.timeScaleTarget=.003),this.timeScaleTarget=Math.min(this.timeScaleTarget,1))},t.prototype.updateControls=function(t){var e="";e+='

    Controls:

    ',t.forEach((function(t){e+='
    ',t.keys.forEach((function(t){e+="+"===t||"and"===t||"or"===t||"&"===t?" "+t+" ":''+t+""})),e+=''+t.desc+"
    "})),document.getElementById("controls").innerHTML=e},t.prototype.generateHTML=function(){a("head").append(''),a("head").append(''),a("head").append(''),a('\t
    \n\t\t\t\t
    \n\t\t\t\t

    Sketchbook 0.4

    \n\t\t\t\t
    \n\t\t\t\t\t
    \n\t\t\t\t\t\t
    \n\t\t\t\t\t\t
    \n\t\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t
    Loading...
    \n\t\t\t
    \n\t\t').appendTo("body"),a('\t\n\t\t').appendTo("body"),document.body.appendChild(this.renderer.domElement),this.renderer.domElement.id="canvas"},t.prototype.createParamsGUI=function(t){var e=this;this.params={Pointer_Lock:!0,Mouse_Sensitivity:.3,Time_Scale:1,Shadows:!0,FXAA:!0,Debug_Physics:!1,Debug_FPS:!1,Sun_Elevation:50,Sun_Rotation:145};var n=new f.GUI;this.scenarioGUIFolder=n.addFolder("Scenarios"),this.scenarioGUIFolder.open();var i=n.addFolder("World");i.add(this.params,"Time_Scale",0,1).listen().onChange((function(e){t.timeScaleTarget=e})),i.add(this.params,"Sun_Elevation",0,180).listen().onChange((function(e){t.sky.phi=e})),i.add(this.params,"Sun_Rotation",0,360).listen().onChange((function(e){t.sky.theta=e}));var r=n.addFolder("Settings");r.add(this.params,"FXAA"),r.add(this.params,"Shadows").onChange((function(t){t?e.sky.csm.lights.forEach((function(t){t.castShadow=!0})):e.sky.csm.lights.forEach((function(t){t.castShadow=!1}))})),r.add(this.params,"Pointer_Lock").onChange((function(e){t.inputManager.setPointerLock(e)})),r.add(this.params,"Mouse_Sensitivity",0,1).onChange((function(e){t.cameraOperator.setSensitivity(e,.8*e)})),r.add(this.params,"Debug_Physics").onChange((function(n){n?e.cannonDebugRenderer=new m.CannonDebugRenderer(e.graphicsWorld,e.physicsWorld):(e.cannonDebugRenderer.clearMeshes(),e.cannonDebugRenderer=void 0),t.characters.forEach((function(t){t.raycastBox.visible=n}))})),r.add(this.params,"Debug_FPS").onChange((function(t){w.UIManager.setFPSVisible(t)})),n.open()},t}();e.World=P},function(t,e,n){var i; +/*! + * jQuery JavaScript Library v3.6.0 + * https://jquery.com/ + * + * Includes Sizzle.js + * https://sizzlejs.com/ + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: 2021-03-02T17:08Z + */!function(e,n){"use strict";"object"==typeof t.exports?t.exports=e.document?n(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return n(t)}:n(e)}("undefined"!=typeof window?window:this,(function(n,r){"use strict";var o=[],a=Object.getPrototypeOf,s=o.slice,c=o.flat?function(t){return o.flat.call(t)}:function(t){return o.concat.apply([],t)},l=o.push,u=o.indexOf,h={},d=h.toString,p=h.hasOwnProperty,f=p.toString,m=f.call(Object),v={},g=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType&&"function"!=typeof t.item},y=function(t){return null!=t&&t===t.window},x=n.document,w={type:!0,src:!0,nonce:!0,noModule:!0};function b(t,e,n){var i,r,o=(n=n||x).createElement("script");if(o.text=t,e)for(i in w)(r=e[i]||e.getAttribute&&e.getAttribute(i))&&o.setAttribute(i,r);n.head.appendChild(o).parentNode.removeChild(o)}function _(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?h[d.call(t)]||"object":typeof t}var S=function(t,e){return new S.fn.init(t,e)};function M(t){var e=!!t&&"length"in t&&t.length,n=_(t);return!g(t)&&!y(t)&&("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t)}S.fn=S.prototype={jquery:"3.6.0",constructor:S,length:0,toArray:function(){return s.call(this)},get:function(t){return null==t?s.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=S.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return S.each(this,t)},map:function(t){return this.pushStack(S.map(this,(function(e,n){return t.call(e,n,e)})))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,(function(t,e){return(e+1)%2})))},odd:function(){return this.pushStack(S.grep(this,(function(t,e){return e%2})))},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n+~]|"+D+")"+D+"*"),W=new RegExp(D+"|>"),q=new RegExp(V),X=new RegExp("^"+k+"$"),Y={ID:new RegExp("^#("+k+")"),CLASS:new RegExp("^\\.("+k+")"),TAG:new RegExp("^("+k+"|[*])"),ATTR:new RegExp("^"+z),PSEUDO:new RegExp("^"+V),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+D+"*(even|odd|(([+-]|)(\\d*)n|)"+D+"*(?:([+-]|)"+D+"*(\\d+)|))"+D+"*\\)|)","i"),bool:new RegExp("^(?:"+B+")$","i"),needsContext:new RegExp("^"+D+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+D+"*((?:-\\d)?\\d*)"+D+"*\\)|)(?=[^-]|$)","i")},Q=/HTML$/i,K=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,J=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,tt=/[+~]/,et=new RegExp("\\\\[\\da-fA-F]{1,6}"+D+"?|\\\\([^\\r\\n\\f])","g"),nt=function(t,e){var n="0x"+t.slice(1)-65536;return e||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},it=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,rt=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},ot=function(){d()},at=wt((function(t){return!0===t.disabled&&"fieldset"===t.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{F.apply(C=I.call(b.childNodes),b.childNodes),C[b.childNodes.length].nodeType}catch(t){F={apply:C.length?function(t,e){O.apply(t,I.call(e))}:function(t,e){for(var n=t.length,i=0;t[n++]=e[i++];);t.length=n-1}}}function st(t,e,i,r){var o,s,l,u,h,f,g,y=e&&e.ownerDocument,b=e?e.nodeType:9;if(i=i||[],"string"!=typeof t||!t||1!==b&&9!==b&&11!==b)return i;if(!r&&(d(e),e=e||p,m)){if(11!==b&&(h=$.exec(t)))if(o=h[1]){if(9===b){if(!(l=e.getElementById(o)))return i;if(l.id===o)return i.push(l),i}else if(y&&(l=y.getElementById(o))&&x(e,l)&&l.id===o)return i.push(l),i}else{if(h[2])return F.apply(i,e.getElementsByTagName(t)),i;if((o=h[3])&&n.getElementsByClassName&&e.getElementsByClassName)return F.apply(i,e.getElementsByClassName(o)),i}if(n.qsa&&!T[t+" "]&&(!v||!v.test(t))&&(1!==b||"object"!==e.nodeName.toLowerCase())){if(g=t,y=e,1===b&&(W.test(t)||G.test(t))){for((y=tt.test(t)&>(e.parentNode)||e)===e&&n.scope||((u=e.getAttribute("id"))?u=u.replace(it,rt):e.setAttribute("id",u=w)),s=(f=a(t)).length;s--;)f[s]=(u?"#"+u:":scope")+" "+xt(f[s]);g=f.join(",")}try{return F.apply(i,y.querySelectorAll(g)),i}catch(e){T(t,!0)}finally{u===w&&e.removeAttribute("id")}}}return c(t.replace(j,"$1"),e,i,r)}function ct(){var t=[];return function e(n,r){return t.push(n+" ")>i.cacheLength&&delete e[t.shift()],e[n+" "]=r}}function lt(t){return t[w]=!0,t}function ut(t){var e=p.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function ht(t,e){for(var n=t.split("|"),r=n.length;r--;)i.attrHandle[n[r]]=e}function dt(t,e){var n=e&&t,i=n&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(i)return i;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function pt(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function ft(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function mt(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&at(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function vt(t){return lt((function(e){return e=+e,lt((function(n,i){for(var r,o=t([],n.length,e),a=o.length;a--;)n[r=o[a]]&&(n[r]=!(i[r]=n[r]))}))}))}function gt(t){return t&&void 0!==t.getElementsByTagName&&t}for(e in n=st.support={},o=st.isXML=function(t){var e=t&&t.namespaceURI,n=t&&(t.ownerDocument||t).documentElement;return!Q.test(e||n&&n.nodeName||"HTML")},d=st.setDocument=function(t){var e,r,a=t?t.ownerDocument||t:b;return a!=p&&9===a.nodeType&&a.documentElement?(f=(p=a).documentElement,m=!o(p),b!=p&&(r=p.defaultView)&&r.top!==r&&(r.addEventListener?r.addEventListener("unload",ot,!1):r.attachEvent&&r.attachEvent("onunload",ot)),n.scope=ut((function(t){return f.appendChild(t).appendChild(p.createElement("div")),void 0!==t.querySelectorAll&&!t.querySelectorAll(":scope fieldset div").length})),n.attributes=ut((function(t){return t.className="i",!t.getAttribute("className")})),n.getElementsByTagName=ut((function(t){return t.appendChild(p.createComment("")),!t.getElementsByTagName("*").length})),n.getElementsByClassName=J.test(p.getElementsByClassName),n.getById=ut((function(t){return f.appendChild(t).id=w,!p.getElementsByName||!p.getElementsByName(w).length})),n.getById?(i.filter.ID=function(t){var e=t.replace(et,nt);return function(t){return t.getAttribute("id")===e}},i.find.ID=function(t,e){if(void 0!==e.getElementById&&m){var n=e.getElementById(t);return n?[n]:[]}}):(i.filter.ID=function(t){var e=t.replace(et,nt);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},i.find.ID=function(t,e){if(void 0!==e.getElementById&&m){var n,i,r,o=e.getElementById(t);if(o){if((n=o.getAttributeNode("id"))&&n.value===t)return[o];for(r=e.getElementsByName(t),i=0;o=r[i++];)if((n=o.getAttributeNode("id"))&&n.value===t)return[o]}return[]}}),i.find.TAG=n.getElementsByTagName?function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):n.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,i=[],r=0,o=e.getElementsByTagName(t);if("*"===t){for(;n=o[r++];)1===n.nodeType&&i.push(n);return i}return o},i.find.CLASS=n.getElementsByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&m)return e.getElementsByClassName(t)},g=[],v=[],(n.qsa=J.test(p.querySelectorAll))&&(ut((function(t){var e;f.appendChild(t).innerHTML="",t.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+D+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||v.push("\\["+D+"*(?:value|"+B+")"),t.querySelectorAll("[id~="+w+"-]").length||v.push("~="),(e=p.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||v.push("\\["+D+"*name"+D+"*="+D+"*(?:''|\"\")"),t.querySelectorAll(":checked").length||v.push(":checked"),t.querySelectorAll("a#"+w+"+*").length||v.push(".#.+[+~]"),t.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")})),ut((function(t){t.innerHTML="";var e=p.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&v.push("name"+D+"*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),f.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),v.push(",.*:")}))),(n.matchesSelector=J.test(y=f.matches||f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&ut((function(t){n.disconnectedMatch=y.call(t,"*"),y.call(t,"[s!='']:x"),g.push("!=",V)})),v=v.length&&new RegExp(v.join("|")),g=g.length&&new RegExp(g.join("|")),e=J.test(f.compareDocumentPosition),x=e||J.test(f.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,i=e&&e.parentNode;return t===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):t.compareDocumentPosition&&16&t.compareDocumentPosition(i)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},P=e?function(t,e){if(t===e)return h=!0,0;var i=!t.compareDocumentPosition-!e.compareDocumentPosition;return i||(1&(i=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!n.sortDetached&&e.compareDocumentPosition(t)===i?t==p||t.ownerDocument==b&&x(b,t)?-1:e==p||e.ownerDocument==b&&x(b,e)?1:u?N(u,t)-N(u,e):0:4&i?-1:1)}:function(t,e){if(t===e)return h=!0,0;var n,i=0,r=t.parentNode,o=e.parentNode,a=[t],s=[e];if(!r||!o)return t==p?-1:e==p?1:r?-1:o?1:u?N(u,t)-N(u,e):0;if(r===o)return dt(t,e);for(n=t;n=n.parentNode;)a.unshift(n);for(n=e;n=n.parentNode;)s.unshift(n);for(;a[i]===s[i];)i++;return i?dt(a[i],s[i]):a[i]==b?-1:s[i]==b?1:0},p):p},st.matches=function(t,e){return st(t,null,null,e)},st.matchesSelector=function(t,e){if(d(t),n.matchesSelector&&m&&!T[e+" "]&&(!g||!g.test(e))&&(!v||!v.test(e)))try{var i=y.call(t,e);if(i||n.disconnectedMatch||t.document&&11!==t.document.nodeType)return i}catch(t){T(e,!0)}return st(e,p,null,[t]).length>0},st.contains=function(t,e){return(t.ownerDocument||t)!=p&&d(t),x(t,e)},st.attr=function(t,e){(t.ownerDocument||t)!=p&&d(t);var r=i.attrHandle[e.toLowerCase()],o=r&&L.call(i.attrHandle,e.toLowerCase())?r(t,e,!m):void 0;return void 0!==o?o:n.attributes||!m?t.getAttribute(e):(o=t.getAttributeNode(e))&&o.specified?o.value:null},st.escape=function(t){return(t+"").replace(it,rt)},st.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},st.uniqueSort=function(t){var e,i=[],r=0,o=0;if(h=!n.detectDuplicates,u=!n.sortStable&&t.slice(0),t.sort(P),h){for(;e=t[o++];)e===t[o]&&(r=i.push(o));for(;r--;)t.splice(i[r],1)}return u=null,t},r=st.getText=function(t){var e,n="",i=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=r(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[i++];)n+=r(e);return n},(i=st.selectors={cacheLength:50,createPseudo:lt,match:Y,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(et,nt),t[3]=(t[3]||t[4]||t[5]||"").replace(et,nt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||st.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&st.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return Y.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&q.test(n)&&(e=a(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(et,nt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=M[t+" "];return e||(e=new RegExp("(^|"+D+")"+t+"("+D+"|$)"))&&M(t,(function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(i){var r=st.attr(i,t);return null==r?"!="===e:!e||(r+="","="===e?r===n:"!="===e?r!==n:"^="===e?n&&0===r.indexOf(n):"*="===e?n&&r.indexOf(n)>-1:"$="===e?n&&r.slice(-n.length)===n:"~="===e?(" "+r.replace(U," ")+" ").indexOf(n)>-1:"|="===e&&(r===n||r.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,i,r){var o="nth"!==t.slice(0,3),a="last"!==t.slice(-4),s="of-type"===e;return 1===i&&0===r?function(t){return!!t.parentNode}:function(e,n,c){var l,u,h,d,p,f,m=o!==a?"nextSibling":"previousSibling",v=e.parentNode,g=s&&e.nodeName.toLowerCase(),y=!c&&!s,x=!1;if(v){if(o){for(;m;){for(d=e;d=d[m];)if(s?d.nodeName.toLowerCase()===g:1===d.nodeType)return!1;f=m="only"===t&&!f&&"nextSibling"}return!0}if(f=[a?v.firstChild:v.lastChild],a&&y){for(x=(p=(l=(u=(h=(d=v)[w]||(d[w]={}))[d.uniqueID]||(h[d.uniqueID]={}))[t]||[])[0]===_&&l[1])&&l[2],d=p&&v.childNodes[p];d=++p&&d&&d[m]||(x=p=0)||f.pop();)if(1===d.nodeType&&++x&&d===e){u[t]=[_,p,x];break}}else if(y&&(x=p=(l=(u=(h=(d=e)[w]||(d[w]={}))[d.uniqueID]||(h[d.uniqueID]={}))[t]||[])[0]===_&&l[1]),!1===x)for(;(d=++p&&d&&d[m]||(x=p=0)||f.pop())&&((s?d.nodeName.toLowerCase()!==g:1!==d.nodeType)||!++x||(y&&((u=(h=d[w]||(d[w]={}))[d.uniqueID]||(h[d.uniqueID]={}))[t]=[_,x]),d!==e)););return(x-=r)===i||x%i==0&&x/i>=0}}},PSEUDO:function(t,e){var n,r=i.pseudos[t]||i.setFilters[t.toLowerCase()]||st.error("unsupported pseudo: "+t);return r[w]?r(e):r.length>1?(n=[t,t,"",e],i.setFilters.hasOwnProperty(t.toLowerCase())?lt((function(t,n){for(var i,o=r(t,e),a=o.length;a--;)t[i=N(t,o[a])]=!(n[i]=o[a])})):function(t){return r(t,0,n)}):r}},pseudos:{not:lt((function(t){var e=[],n=[],i=s(t.replace(j,"$1"));return i[w]?lt((function(t,e,n,r){for(var o,a=i(t,null,r,[]),s=t.length;s--;)(o=a[s])&&(t[s]=!(e[s]=o))})):function(t,r,o){return e[0]=t,i(e,null,o,n),e[0]=null,!n.pop()}})),has:lt((function(t){return function(e){return st(t,e).length>0}})),contains:lt((function(t){return t=t.replace(et,nt),function(e){return(e.textContent||r(e)).indexOf(t)>-1}})),lang:lt((function(t){return X.test(t||"")||st.error("unsupported lang: "+t),t=t.replace(et,nt).toLowerCase(),function(e){var n;do{if(n=m?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===f},focus:function(t){return t===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:mt(!1),disabled:mt(!0),checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!i.pseudos.empty(t)},header:function(t){return Z.test(t.nodeName)},input:function(t){return K.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:vt((function(){return[0]})),last:vt((function(t,e){return[e-1]})),eq:vt((function(t,e,n){return[n<0?n+e:n]})),even:vt((function(t,e){for(var n=0;ne?e:n;--i>=0;)t.push(i);return t})),gt:vt((function(t,e,n){for(var i=n<0?n+e:n;++i1?function(e,n,i){for(var r=t.length;r--;)if(!t[r](e,n,i))return!1;return!0}:t[0]}function _t(t,e,n,i,r){for(var o,a=[],s=0,c=t.length,l=null!=e;s-1&&(o[l]=!(a[l]=h))}}else g=_t(g===a?g.splice(f,g.length):g),r?r(null,a,g,c):F.apply(a,g)}))}function Mt(t){for(var e,n,r,o=t.length,a=i.relative[t[0].type],s=a||i.relative[" "],c=a?1:0,u=wt((function(t){return t===e}),s,!0),h=wt((function(t){return N(e,t)>-1}),s,!0),d=[function(t,n,i){var r=!a&&(i||n!==l)||((e=n).nodeType?u(t,n,i):h(t,n,i));return e=null,r}];c1&&bt(d),c>1&&xt(t.slice(0,c-1).concat({value:" "===t[c-2].type?"*":""})).replace(j,"$1"),n,c0,r=t.length>0,o=function(o,a,s,c,u){var h,f,v,g=0,y="0",x=o&&[],w=[],b=l,S=o||r&&i.find.TAG("*",u),M=_+=null==b?1:Math.random()||.1,A=S.length;for(u&&(l=a==p||a||u);y!==A&&null!=(h=S[y]);y++){if(r&&h){for(f=0,a||h.ownerDocument==p||(d(h),s=!m);v=t[f++];)if(v(h,a||p,s)){c.push(h);break}u&&(_=M)}n&&((h=!v&&h)&&g--,o&&x.push(h))}if(g+=y,n&&y!==g){for(f=0;v=e[f++];)v(x,w,a,s);if(o){if(g>0)for(;y--;)x[y]||w[y]||(w[y]=R.call(c));w=_t(w)}F.apply(c,w),u&&!o&&w.length>0&&g+e.length>1&&st.uniqueSort(c)}return u&&(_=M,l=b),x};return n?lt(o):o}(o,r))).selector=t}return s},c=st.select=function(t,e,n,r){var o,c,l,u,h,d="function"==typeof t&&t,p=!r&&a(t=d.selector||t);if(n=n||[],1===p.length){if((c=p[0]=p[0].slice(0)).length>2&&"ID"===(l=c[0]).type&&9===e.nodeType&&m&&i.relative[c[1].type]){if(!(e=(i.find.ID(l.matches[0].replace(et,nt),e)||[])[0]))return n;d&&(e=e.parentNode),t=t.slice(c.shift().value.length)}for(o=Y.needsContext.test(t)?0:c.length;o--&&(l=c[o],!i.relative[u=l.type]);)if((h=i.find[u])&&(r=h(l.matches[0].replace(et,nt),tt.test(c[0].type)&>(e.parentNode)||e))){if(c.splice(o,1),!(t=r.length&&xt(c)))return F.apply(n,r),n;break}}return(d||s(t,p))(r,e,!m,n,!e||tt.test(t)&>(e.parentNode)||e),n},n.sortStable=w.split("").sort(P).join("")===w,n.detectDuplicates=!!h,d(),n.sortDetached=ut((function(t){return 1&t.compareDocumentPosition(p.createElement("fieldset"))})),ut((function(t){return t.innerHTML="","#"===t.firstChild.getAttribute("href")}))||ht("type|href|height|width",(function(t,e,n){if(!n)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)})),n.attributes&&ut((function(t){return t.innerHTML="",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")}))||ht("value",(function(t,e,n){if(!n&&"input"===t.nodeName.toLowerCase())return t.defaultValue})),ut((function(t){return null==t.getAttribute("disabled")}))||ht(B,(function(t,e,n){var i;if(!n)return!0===t[e]?e.toLowerCase():(i=t.getAttributeNode(e))&&i.specified?i.value:null})),st}(n);S.find=A,S.expr=A.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=A.uniqueSort,S.text=A.getText,S.isXMLDoc=A.isXML,S.contains=A.contains,S.escapeSelector=A.escape;var E=function(t,e,n){for(var i=[],r=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(r&&S(t).is(n))break;i.push(t)}return i},T=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},P=S.expr.match.needsContext;function L(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}var C=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function R(t,e,n){return g(e)?S.grep(t,(function(t,i){return!!e.call(t,i,t)!==n})):e.nodeType?S.grep(t,(function(t){return t===e!==n})):"string"!=typeof e?S.grep(t,(function(t){return u.call(e,t)>-1!==n})):S.filter(e,t,n)}S.filter=function(t,e,n){var i=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===i.nodeType?S.find.matchesSelector(i,t)?[i]:[]:S.find.matches(t,S.grep(e,(function(t){return 1===t.nodeType})))},S.fn.extend({find:function(t){var e,n,i=this.length,r=this;if("string"!=typeof t)return this.pushStack(S(t).filter((function(){for(e=0;e1?S.uniqueSort(n):n},filter:function(t){return this.pushStack(R(this,t||[],!1))},not:function(t){return this.pushStack(R(this,t||[],!0))},is:function(t){return!!R(this,"string"==typeof t&&P.test(t)?S(t):t||[],!1).length}});var O,F=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(t,e,n){var i,r;if(!t)return this;if(n=n||O,"string"==typeof t){if(!(i="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:F.exec(t))||!i[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(i[1]){if(e=e instanceof S?e[0]:e,S.merge(this,S.parseHTML(i[1],e&&e.nodeType?e.ownerDocument||e:x,!0)),C.test(i[1])&&S.isPlainObject(e))for(i in e)g(this[i])?this[i](e[i]):this.attr(i,e[i]);return this}return(r=x.getElementById(i[2]))&&(this[0]=r,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):g(t)?void 0!==n.ready?n.ready(t):t(S):S.makeArray(t,this)}).prototype=S.fn,O=S(x);var I=/^(?:parents|prev(?:Until|All))/,N={children:!0,contents:!0,next:!0,prev:!0};function B(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}S.fn.extend({has:function(t){var e=S(t,this),n=e.length;return this.filter((function(){for(var t=0;t-1:1===n.nodeType&&S.find.matchesSelector(n,t))){o.push(n);break}return this.pushStack(o.length>1?S.uniqueSort(o):o)},index:function(t){return t?"string"==typeof t?u.call(S(t),this[0]):u.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),S.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return E(t,"parentNode")},parentsUntil:function(t,e,n){return E(t,"parentNode",n)},next:function(t){return B(t,"nextSibling")},prev:function(t){return B(t,"previousSibling")},nextAll:function(t){return E(t,"nextSibling")},prevAll:function(t){return E(t,"previousSibling")},nextUntil:function(t,e,n){return E(t,"nextSibling",n)},prevUntil:function(t,e,n){return E(t,"previousSibling",n)},siblings:function(t){return T((t.parentNode||{}).firstChild,t)},children:function(t){return T(t.firstChild)},contents:function(t){return null!=t.contentDocument&&a(t.contentDocument)?t.contentDocument:(L(t,"template")&&(t=t.content||t),S.merge([],t.childNodes))}},(function(t,e){S.fn[t]=function(n,i){var r=S.map(this,e,n);return"Until"!==t.slice(-5)&&(i=n),i&&"string"==typeof i&&(r=S.filter(i,r)),this.length>1&&(N[t]||S.uniqueSort(r),I.test(t)&&r.reverse()),this.pushStack(r)}}));var D=/[^\x20\t\r\n\f]+/g;function k(t){return t}function z(t){throw t}function V(t,e,n,i){var r;try{t&&g(r=t.promise)?r.call(t).done(e).fail(n):t&&g(r=t.then)?r.call(t,e,n):e.apply(void 0,[t].slice(i))}catch(t){n.apply(void 0,[t])}}S.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return S.each(t.match(D)||[],(function(t,n){e[n]=!0})),e}(t):S.extend({},t);var e,n,i,r,o=[],a=[],s=-1,c=function(){for(r=r||t.once,i=e=!0;a.length;s=-1)for(n=a.shift();++s-1;)o.splice(n,1),n<=s&&s--})),this},has:function(t){return t?S.inArray(t,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return r=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return r=a=[],n||e||(o=n=""),this},locked:function(){return!!r},fireWith:function(t,n){return r||(n=[t,(n=n||[]).slice?n.slice():n],a.push(n),e||c()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!i}};return l},S.extend({Deferred:function(t){var e=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],i="pending",r={state:function(){return i},always:function(){return o.done(arguments).fail(arguments),this},catch:function(t){return r.then(null,t)},pipe:function(){var t=arguments;return S.Deferred((function(n){S.each(e,(function(e,i){var r=g(t[i[4]])&&t[i[4]];o[i[1]]((function(){var t=r&&r.apply(this,arguments);t&&g(t.promise)?t.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[i[0]+"With"](this,r?[t]:arguments)}))})),t=null})).promise()},then:function(t,i,r){var o=0;function a(t,e,i,r){return function(){var s=this,c=arguments,l=function(){var n,l;if(!(t=o&&(i!==z&&(s=void 0,c=[n]),e.rejectWith(s,c))}};t?u():(S.Deferred.getStackHook&&(u.stackTrace=S.Deferred.getStackHook()),n.setTimeout(u))}}return S.Deferred((function(n){e[0][3].add(a(0,n,g(r)?r:k,n.notifyWith)),e[1][3].add(a(0,n,g(t)?t:k)),e[2][3].add(a(0,n,g(i)?i:z))})).promise()},promise:function(t){return null!=t?S.extend(t,r):r}},o={};return S.each(e,(function(t,n){var a=n[2],s=n[5];r[n[1]]=a.add,s&&a.add((function(){i=s}),e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),a.add(n[3].fire),o[n[0]]=function(){return o[n[0]+"With"](this===o?void 0:this,arguments),this},o[n[0]+"With"]=a.fireWith})),r.promise(o),t&&t.call(o,o),o},when:function(t){var e=arguments.length,n=e,i=Array(n),r=s.call(arguments),o=S.Deferred(),a=function(t){return function(n){i[t]=this,r[t]=arguments.length>1?s.call(arguments):n,--e||o.resolveWith(i,r)}};if(e<=1&&(V(t,o.done(a(n)).resolve,o.reject,!e),"pending"===o.state()||g(r[n]&&r[n].then)))return o.then();for(;n--;)V(r[n],a(n),o.reject);return o.promise()}});var U=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(t,e){n.console&&n.console.warn&&t&&U.test(t.name)&&n.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},S.readyException=function(t){n.setTimeout((function(){throw t}))};var j=S.Deferred();function H(){x.removeEventListener("DOMContentLoaded",H),n.removeEventListener("load",H),S.ready()}S.fn.ready=function(t){return j.then(t).catch((function(t){S.readyException(t)})),this},S.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--S.readyWait:S.isReady)||(S.isReady=!0,!0!==t&&--S.readyWait>0||j.resolveWith(x,[S]))}}),S.ready.then=j.then,"complete"===x.readyState||"loading"!==x.readyState&&!x.documentElement.doScroll?n.setTimeout(S.ready):(x.addEventListener("DOMContentLoaded",H),n.addEventListener("load",H));var G=function(t,e,n,i,r,o,a){var s=0,c=t.length,l=null==n;if("object"===_(n))for(s in r=!0,n)G(t,e,s,n[s],!0,o,a);else if(void 0!==i&&(r=!0,g(i)||(a=!0),l&&(a?(e.call(t,i),e=null):(l=e,e=function(t,e,n){return l.call(S(t),n)})),e))for(;s1,null,!0)},removeData:function(t){return this.each((function(){J.remove(this,t)}))}}),S.extend({queue:function(t,e,n){var i;if(t)return e=(e||"fx")+"queue",i=Z.get(t,e),n&&(!i||Array.isArray(n)?i=Z.access(t,e,S.makeArray(n)):i.push(n)),i||[]},dequeue:function(t,e){e=e||"fx";var n=S.queue(t,e),i=n.length,r=n.shift(),o=S._queueHooks(t,e);"inprogress"===r&&(r=n.shift(),i--),r&&("fx"===e&&n.unshift("inprogress"),delete o.stop,r.call(t,(function(){S.dequeue(t,e)}),o)),!i&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return Z.get(t,n)||Z.access(t,n,{empty:S.Callbacks("once memory").add((function(){Z.remove(t,[e+"queue",n])}))})}}),S.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length\x20\t\r\n\f]*)/i,gt=/^$|^module$|\/(?:java|ecma)script/i;pt=x.createDocumentFragment().appendChild(x.createElement("div")),(ft=x.createElement("input")).setAttribute("type","radio"),ft.setAttribute("checked","checked"),ft.setAttribute("name","t"),pt.appendChild(ft),v.checkClone=pt.cloneNode(!0).cloneNode(!0).lastChild.checked,pt.innerHTML="",v.noCloneChecked=!!pt.cloneNode(!0).lastChild.defaultValue,pt.innerHTML="",v.option=!!pt.lastChild;var yt={thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};function xt(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&L(t,e)?S.merge([t],n):n}function wt(t,e){for(var n=0,i=t.length;n",""]);var bt=/<|&#?\w+;/;function _t(t,e,n,i,r){for(var o,a,s,c,l,u,h=e.createDocumentFragment(),d=[],p=0,f=t.length;p-1)r&&r.push(o);else if(l=at(o),a=xt(h.appendChild(o),"script"),l&&wt(a),n)for(u=0;o=a[u++];)gt.test(o.type||"")&&n.push(o);return h}var St=/^([^.]*)(?:\.(.+)|)/;function Mt(){return!0}function At(){return!1}function Et(t,e){return t===function(){try{return x.activeElement}catch(t){}}()==("focus"===e)}function Tt(t,e,n,i,r,o){var a,s;if("object"==typeof e){for(s in"string"!=typeof n&&(i=i||n,n=void 0),e)Tt(t,s,n,i,e[s],o);return t}if(null==i&&null==r?(r=n,i=n=void 0):null==r&&("string"==typeof n?(r=i,i=void 0):(r=i,i=n,n=void 0)),!1===r)r=At;else if(!r)return t;return 1===o&&(a=r,(r=function(t){return S().off(t),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),t.each((function(){S.event.add(this,e,r,i,n)}))}function Pt(t,e,n){n?(Z.set(t,e,!1),S.event.add(t,e,{namespace:!1,handler:function(t){var i,r,o=Z.get(this,e);if(1&t.isTrigger&&this[e]){if(o.length)(S.event.special[e]||{}).delegateType&&t.stopPropagation();else if(o=s.call(arguments),Z.set(this,e,o),i=n(this,e),this[e](),o!==(r=Z.get(this,e))||i?Z.set(this,e,!1):r={},o!==r)return t.stopImmediatePropagation(),t.preventDefault(),r&&r.value}else o.length&&(Z.set(this,e,{value:S.event.trigger(S.extend(o[0],S.Event.prototype),o.slice(1),this)}),t.stopImmediatePropagation())}})):void 0===Z.get(t,e)&&S.event.add(t,e,Mt)}S.event={global:{},add:function(t,e,n,i,r){var o,a,s,c,l,u,h,d,p,f,m,v=Z.get(t);if(Q(t))for(n.handler&&(n=(o=n).handler,r=o.selector),r&&S.find.matchesSelector(ot,r),n.guid||(n.guid=S.guid++),(c=v.events)||(c=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(e){return void 0!==S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(D)||[""]).length;l--;)p=m=(s=St.exec(e[l])||[])[1],f=(s[2]||"").split(".").sort(),p&&(h=S.event.special[p]||{},p=(r?h.delegateType:h.bindType)||p,h=S.event.special[p]||{},u=S.extend({type:p,origType:m,data:i,handler:n,guid:n.guid,selector:r,needsContext:r&&S.expr.match.needsContext.test(r),namespace:f.join(".")},o),(d=c[p])||((d=c[p]=[]).delegateCount=0,h.setup&&!1!==h.setup.call(t,i,f,a)||t.addEventListener&&t.addEventListener(p,a)),h.add&&(h.add.call(t,u),u.handler.guid||(u.handler.guid=n.guid)),r?d.splice(d.delegateCount++,0,u):d.push(u),S.event.global[p]=!0)},remove:function(t,e,n,i,r){var o,a,s,c,l,u,h,d,p,f,m,v=Z.hasData(t)&&Z.get(t);if(v&&(c=v.events)){for(l=(e=(e||"").match(D)||[""]).length;l--;)if(p=m=(s=St.exec(e[l])||[])[1],f=(s[2]||"").split(".").sort(),p){for(h=S.event.special[p]||{},d=c[p=(i?h.delegateType:h.bindType)||p]||[],s=s[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=d.length;o--;)u=d[o],!r&&m!==u.origType||n&&n.guid!==u.guid||s&&!s.test(u.namespace)||i&&i!==u.selector&&("**"!==i||!u.selector)||(d.splice(o,1),u.selector&&d.delegateCount--,h.remove&&h.remove.call(t,u));a&&!d.length&&(h.teardown&&!1!==h.teardown.call(t,f,v.handle)||S.removeEvent(t,p,v.handle),delete c[p])}else for(p in c)S.event.remove(t,p+e[l],n,i,!0);S.isEmptyObject(c)&&Z.remove(t,"handle events")}},dispatch:function(t){var e,n,i,r,o,a,s=new Array(arguments.length),c=S.event.fix(t),l=(Z.get(this,"events")||Object.create(null))[c.type]||[],u=S.event.special[c.type]||{};for(s[0]=c,e=1;e=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==t.type||!0!==l.disabled)){for(o=[],a={},n=0;n-1:S.find(r,this,null,[l]).length),a[r]&&o.push(i);o.length&&s.push({elem:l,handlers:o})}return l=this,c\s*$/g;function Ot(t,e){return L(t,"table")&&L(11!==e.nodeType?e:e.firstChild,"tr")&&S(t).children("tbody")[0]||t}function Ft(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function It(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Nt(t,e){var n,i,r,o,a,s;if(1===e.nodeType){if(Z.hasData(t)&&(s=Z.get(t).events))for(r in Z.remove(e,"handle events"),s)for(n=0,i=s[r].length;n1&&"string"==typeof f&&!v.checkClone&&Ct.test(f))return t.each((function(r){var o=t.eq(r);m&&(e[0]=f.call(this,r,o.html())),Dt(o,e,n,i)}));if(d&&(o=(r=_t(e,t[0].ownerDocument,!1,t,i)).firstChild,1===r.childNodes.length&&(r=o),o||i)){for(s=(a=S.map(xt(r,"script"),Ft)).length;h0&&wt(a,!c&&xt(t,"script")),s},cleanData:function(t){for(var e,n,i,r=S.event.special,o=0;void 0!==(n=t[o]);o++)if(Q(n)){if(e=n[Z.expando]){if(e.events)for(i in e.events)r[i]?S.event.remove(n,i):S.removeEvent(n,i,e.handle);n[Z.expando]=void 0}n[J.expando]&&(n[J.expando]=void 0)}}}),S.fn.extend({detach:function(t){return kt(this,t,!0)},remove:function(t){return kt(this,t)},text:function(t){return G(this,(function(t){return void 0===t?S.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)}))}),null,t,arguments.length)},append:function(){return Dt(this,arguments,(function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Ot(this,t).appendChild(t)}))},prepend:function(){return Dt(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Ot(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return Dt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return Dt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)}))},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(S.cleanData(xt(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return S.clone(this,t,e)}))},html:function(t){return G(this,(function(t){var e=this[0]||{},n=0,i=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!Lt.test(t)&&!yt[(vt.exec(t)||["",""])[1].toLowerCase()]){t=S.htmlPrefilter(t);try{for(;n=0&&(c+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-o-c-s-.5))||0),c}function ee(t,e,n){var i=Vt(t),r=(!v.boxSizingReliable()||n)&&"border-box"===S.css(t,"boxSizing",!1,i),o=r,a=Ht(t,e,i),s="offset"+e[0].toUpperCase()+e.slice(1);if(zt.test(a)){if(!n)return a;a="auto"}return(!v.boxSizingReliable()&&r||!v.reliableTrDimensions()&&L(t,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(t,"display",!1,i))&&t.getClientRects().length&&(r="border-box"===S.css(t,"boxSizing",!1,i),(o=s in t)&&(a=t[s])),(a=parseFloat(a)||0)+te(t,e,n||(r?"border":"content"),o,i,a)+"px"}function ne(t,e,n,i,r){return new ne.prototype.init(t,e,n,i,r)}S.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=Ht(t,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(t,e,n,i){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var r,o,a,s=Y(e),c=Kt.test(e),l=t.style;if(c||(e=Yt(s)),a=S.cssHooks[e]||S.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(r=a.get(t,!1,i))?r:l[e];"string"===(o=typeof n)&&(r=it.exec(n))&&r[1]&&(n=lt(t,e,r),o="number"),null!=n&&n==n&&("number"!==o||c||(n+=r&&r[3]||(S.cssNumber[s]?"":"px")),v.clearCloneStyle||""!==n||0!==e.indexOf("background")||(l[e]="inherit"),a&&"set"in a&&void 0===(n=a.set(t,n,i))||(c?l.setProperty(e,n):l[e]=n))}},css:function(t,e,n,i){var r,o,a,s=Y(e);return Kt.test(e)||(e=Yt(s)),(a=S.cssHooks[e]||S.cssHooks[s])&&"get"in a&&(r=a.get(t,!0,n)),void 0===r&&(r=Ht(t,e,i)),"normal"===r&&e in Jt&&(r=Jt[e]),""===n||n?(o=parseFloat(r),!0===n||isFinite(o)?o||0:r):r}}),S.each(["height","width"],(function(t,e){S.cssHooks[e]={get:function(t,n,i){if(n)return!Qt.test(S.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?ee(t,e,i):Ut(t,Zt,(function(){return ee(t,e,i)}))},set:function(t,n,i){var r,o=Vt(t),a=!v.scrollboxSize()&&"absolute"===o.position,s=(a||i)&&"border-box"===S.css(t,"boxSizing",!1,o),c=i?te(t,e,i,s,o):0;return s&&a&&(c-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(o[e])-te(t,e,"border",!1,o)-.5)),c&&(r=it.exec(n))&&"px"!==(r[3]||"px")&&(t.style[e]=n,n=S.css(t,e)),$t(0,n,c)}}})),S.cssHooks.marginLeft=Gt(v.reliableMarginLeft,(function(t,e){if(e)return(parseFloat(Ht(t,"marginLeft"))||t.getBoundingClientRect().left-Ut(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),S.each({margin:"",padding:"",border:"Width"},(function(t,e){S.cssHooks[t+e]={expand:function(n){for(var i=0,r={},o="string"==typeof n?n.split(" "):[n];i<4;i++)r[t+rt[i]+e]=o[i]||o[i-2]||o[0];return r}},"margin"!==t&&(S.cssHooks[t+e].set=$t)})),S.fn.extend({css:function(t,e){return G(this,(function(t,e,n){var i,r,o={},a=0;if(Array.isArray(e)){for(i=Vt(t),r=e.length;a1)}}),S.Tween=ne,ne.prototype={constructor:ne,init:function(t,e,n,i,r,o){this.elem=t,this.prop=n,this.easing=r||S.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=i,this.unit=o||(S.cssNumber[n]?"":"px")},cur:function(){var t=ne.propHooks[this.prop];return t&&t.get?t.get(this):ne.propHooks._default.get(this)},run:function(t){var e,n=ne.propHooks[this.prop];return this.options.duration?this.pos=e=S.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):ne.propHooks._default.set(this),this}},ne.prototype.init.prototype=ne.prototype,ne.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=S.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){S.fx.step[t.prop]?S.fx.step[t.prop](t):1!==t.elem.nodeType||!S.cssHooks[t.prop]&&null==t.elem.style[Yt(t.prop)]?t.elem[t.prop]=t.now:S.style(t.elem,t.prop,t.now+t.unit)}}},ne.propHooks.scrollTop=ne.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},S.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},S.fx=ne.prototype.init,S.fx.step={};var ie,re,oe=/^(?:toggle|show|hide)$/,ae=/queueHooks$/;function se(){re&&(!1===x.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(se):n.setTimeout(se,S.fx.interval),S.fx.tick())}function ce(){return n.setTimeout((function(){ie=void 0})),ie=Date.now()}function le(t,e){var n,i=0,r={height:t};for(e=e?1:0;i<4;i+=2-e)r["margin"+(n=rt[i])]=r["padding"+n]=t;return e&&(r.opacity=r.width=t),r}function ue(t,e,n){for(var i,r=(he.tweeners[e]||[]).concat(he.tweeners["*"]),o=0,a=r.length;o1)},removeAttr:function(t){return this.each((function(){S.removeAttr(this,t)}))}}),S.extend({attr:function(t,e,n){var i,r,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===t.getAttribute?S.prop(t,e,n):(1===o&&S.isXMLDoc(t)||(r=S.attrHooks[e.toLowerCase()]||(S.expr.match.bool.test(e)?de:void 0)),void 0!==n?null===n?void S.removeAttr(t,e):r&&"set"in r&&void 0!==(i=r.set(t,n,e))?i:(t.setAttribute(e,n+""),n):r&&"get"in r&&null!==(i=r.get(t,e))?i:null==(i=S.find.attr(t,e))?void 0:i)},attrHooks:{type:{set:function(t,e){if(!v.radioValue&&"radio"===e&&L(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,i=0,r=e&&e.match(D);if(r&&1===t.nodeType)for(;n=r[i++];)t.removeAttribute(n)}}),de={set:function(t,e,n){return!1===e?S.removeAttr(t,n):t.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),(function(t,e){var n=pe[e]||S.find.attr;pe[e]=function(t,e,i){var r,o,a=e.toLowerCase();return i||(o=pe[a],pe[a]=r,r=null!=n(t,e,i)?a:null,pe[a]=o),r}}));var fe=/^(?:input|select|textarea|button)$/i,me=/^(?:a|area)$/i;function ve(t){return(t.match(D)||[]).join(" ")}function ge(t){return t.getAttribute&&t.getAttribute("class")||""}function ye(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(D)||[]}S.fn.extend({prop:function(t,e){return G(this,S.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[S.propFix[t]||t]}))}}),S.extend({prop:function(t,e,n){var i,r,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(t)||(e=S.propFix[e]||e,r=S.propHooks[e]),void 0!==n?r&&"set"in r&&void 0!==(i=r.set(t,n,e))?i:t[e]=n:r&&"get"in r&&null!==(i=r.get(t,e))?i:t[e]},propHooks:{tabIndex:{get:function(t){var e=S.find.attr(t,"tabindex");return e?parseInt(e,10):fe.test(t.nodeName)||me.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),v.optSelected||(S.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){S.propFix[this.toLowerCase()]=this})),S.fn.extend({addClass:function(t){var e,n,i,r,o,a,s,c=0;if(g(t))return this.each((function(e){S(this).addClass(t.call(this,e,ge(this)))}));if((e=ye(t)).length)for(;n=this[c++];)if(r=ge(n),i=1===n.nodeType&&" "+ve(r)+" "){for(a=0;o=e[a++];)i.indexOf(" "+o+" ")<0&&(i+=o+" ");r!==(s=ve(i))&&n.setAttribute("class",s)}return this},removeClass:function(t){var e,n,i,r,o,a,s,c=0;if(g(t))return this.each((function(e){S(this).removeClass(t.call(this,e,ge(this)))}));if(!arguments.length)return this.attr("class","");if((e=ye(t)).length)for(;n=this[c++];)if(r=ge(n),i=1===n.nodeType&&" "+ve(r)+" "){for(a=0;o=e[a++];)for(;i.indexOf(" "+o+" ")>-1;)i=i.replace(" "+o+" "," ");r!==(s=ve(i))&&n.setAttribute("class",s)}return this},toggleClass:function(t,e){var n=typeof t,i="string"===n||Array.isArray(t);return"boolean"==typeof e&&i?e?this.addClass(t):this.removeClass(t):g(t)?this.each((function(n){S(this).toggleClass(t.call(this,n,ge(this),e),e)})):this.each((function(){var e,r,o,a;if(i)for(r=0,o=S(this),a=ye(t);e=a[r++];)o.hasClass(e)?o.removeClass(e):o.addClass(e);else void 0!==t&&"boolean"!==n||((e=ge(this))&&Z.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===t?"":Z.get(this,"__className__")||""))}))},hasClass:function(t){var e,n,i=0;for(e=" "+t+" ";n=this[i++];)if(1===n.nodeType&&(" "+ve(ge(n))+" ").indexOf(e)>-1)return!0;return!1}});var xe=/\r/g;S.fn.extend({val:function(t){var e,n,i,r=this[0];return arguments.length?(i=g(t),this.each((function(n){var r;1===this.nodeType&&(null==(r=i?t.call(this,n,S(this).val()):t)?r="":"number"==typeof r?r+="":Array.isArray(r)&&(r=S.map(r,(function(t){return null==t?"":t+""}))),(e=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,r,"value")||(this.value=r))}))):r?(e=S.valHooks[r.type]||S.valHooks[r.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(r,"value"))?n:"string"==typeof(n=r.value)?n.replace(xe,""):null==n?"":n:void 0}}),S.extend({valHooks:{option:{get:function(t){var e=S.find.attr(t,"value");return null!=e?e:ve(S.text(t))}},select:{get:function(t){var e,n,i,r=t.options,o=t.selectedIndex,a="select-one"===t.type,s=a?null:[],c=a?o+1:r.length;for(i=o<0?c:a?o:0;i-1)&&(n=!0);return n||(t.selectedIndex=-1),o}}}}),S.each(["radio","checkbox"],(function(){S.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=S.inArray(S(t).val(),e)>-1}},v.checkOn||(S.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})})),v.focusin="onfocusin"in n;var we=/^(?:focusinfocus|focusoutblur)$/,be=function(t){t.stopPropagation()};S.extend(S.event,{trigger:function(t,e,i,r){var o,a,s,c,l,u,h,d,f=[i||x],m=p.call(t,"type")?t.type:t,v=p.call(t,"namespace")?t.namespace.split("."):[];if(a=d=s=i=i||x,3!==i.nodeType&&8!==i.nodeType&&!we.test(m+S.event.triggered)&&(m.indexOf(".")>-1&&(v=m.split("."),m=v.shift(),v.sort()),l=m.indexOf(":")<0&&"on"+m,(t=t[S.expando]?t:new S.Event(m,"object"==typeof t&&t)).isTrigger=r?2:3,t.namespace=v.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),e=null==e?[t]:S.makeArray(e,[t]),h=S.event.special[m]||{},r||!h.trigger||!1!==h.trigger.apply(i,e))){if(!r&&!h.noBubble&&!y(i)){for(c=h.delegateType||m,we.test(c+m)||(a=a.parentNode);a;a=a.parentNode)f.push(a),s=a;s===(i.ownerDocument||x)&&f.push(s.defaultView||s.parentWindow||n)}for(o=0;(a=f[o++])&&!t.isPropagationStopped();)d=a,t.type=o>1?c:h.bindType||m,(u=(Z.get(a,"events")||Object.create(null))[t.type]&&Z.get(a,"handle"))&&u.apply(a,e),(u=l&&a[l])&&u.apply&&Q(a)&&(t.result=u.apply(a,e),!1===t.result&&t.preventDefault());return t.type=m,r||t.isDefaultPrevented()||h._default&&!1!==h._default.apply(f.pop(),e)||!Q(i)||l&&g(i[m])&&!y(i)&&((s=i[l])&&(i[l]=null),S.event.triggered=m,t.isPropagationStopped()&&d.addEventListener(m,be),i[m](),t.isPropagationStopped()&&d.removeEventListener(m,be),S.event.triggered=void 0,s&&(i[l]=s)),t.result}},simulate:function(t,e,n){var i=S.extend(new S.Event,n,{type:t,isSimulated:!0});S.event.trigger(i,null,e)}}),S.fn.extend({trigger:function(t,e){return this.each((function(){S.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var n=this[0];if(n)return S.event.trigger(t,e,n,!0)}}),v.focusin||S.each({focus:"focusin",blur:"focusout"},(function(t,e){var n=function(t){S.event.simulate(e,t.target,S.event.fix(t))};S.event.special[e]={setup:function(){var i=this.ownerDocument||this.document||this,r=Z.access(i,e);r||i.addEventListener(t,n,!0),Z.access(i,e,(r||0)+1)},teardown:function(){var i=this.ownerDocument||this.document||this,r=Z.access(i,e)-1;r?Z.access(i,e,r):(i.removeEventListener(t,n,!0),Z.remove(i,e))}}}));var _e=n.location,Se={guid:Date.now()},Me=/\?/;S.parseXML=function(t){var e,i;if(!t||"string"!=typeof t)return null;try{e=(new n.DOMParser).parseFromString(t,"text/xml")}catch(t){}return i=e&&e.getElementsByTagName("parsererror")[0],e&&!i||S.error("Invalid XML: "+(i?S.map(i.childNodes,(function(t){return t.textContent})).join("\n"):t)),e};var Ae=/\[\]$/,Ee=/\r?\n/g,Te=/^(?:submit|button|image|reset|file)$/i,Pe=/^(?:input|select|textarea|keygen)/i;function Le(t,e,n,i){var r;if(Array.isArray(e))S.each(e,(function(e,r){n||Ae.test(t)?i(t,r):Le(t+"["+("object"==typeof r&&null!=r?e:"")+"]",r,n,i)}));else if(n||"object"!==_(e))i(t,e);else for(r in e)Le(t+"["+r+"]",e[r],n,i)}S.param=function(t,e){var n,i=[],r=function(t,e){var n=g(e)?e():e;i[i.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!S.isPlainObject(t))S.each(t,(function(){r(this.name,this.value)}));else for(n in t)Le(n,t[n],e,r);return i.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=S.prop(this,"elements");return t?S.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!S(this).is(":disabled")&&Pe.test(this.nodeName)&&!Te.test(t)&&(this.checked||!mt.test(t))})).map((function(t,e){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,(function(t){return{name:e.name,value:t.replace(Ee,"\r\n")}})):{name:e.name,value:n.replace(Ee,"\r\n")}})).get()}});var Ce=/%20/g,Re=/#.*$/,Oe=/([?&])_=[^&]*/,Fe=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ie=/^(?:GET|HEAD)$/,Ne=/^\/\//,Be={},De={},ke="*/".concat("*"),ze=x.createElement("a");function Ve(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var i,r=0,o=e.toLowerCase().match(D)||[];if(g(n))for(;i=o[r++];)"+"===i[0]?(i=i.slice(1)||"*",(t[i]=t[i]||[]).unshift(n)):(t[i]=t[i]||[]).push(n)}}function Ue(t,e,n,i){var r={},o=t===De;function a(s){var c;return r[s]=!0,S.each(t[s]||[],(function(t,s){var l=s(e,n,i);return"string"!=typeof l||o||r[l]?o?!(c=l):void 0:(e.dataTypes.unshift(l),a(l),!1)})),c}return a(e.dataTypes[0])||!r["*"]&&a("*")}function je(t,e){var n,i,r=S.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((r[n]?t:i||(i={}))[n]=e[n]);return i&&S.extend(!0,t,i),t}ze.href=_e.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:_e.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(_e.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":ke,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?je(je(t,S.ajaxSettings),e):je(S.ajaxSettings,t)},ajaxPrefilter:Ve(Be),ajaxTransport:Ve(De),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var i,r,o,a,s,c,l,u,h,d,p=S.ajaxSetup({},e),f=p.context||p,m=p.context&&(f.nodeType||f.jquery)?S(f):S.event,v=S.Deferred(),g=S.Callbacks("once memory"),y=p.statusCode||{},w={},b={},_="canceled",M={readyState:0,getResponseHeader:function(t){var e;if(l){if(!a)for(a={};e=Fe.exec(o);)a[e[1].toLowerCase()+" "]=(a[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=a[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return l?o:null},setRequestHeader:function(t,e){return null==l&&(t=b[t.toLowerCase()]=b[t.toLowerCase()]||t,w[t]=e),this},overrideMimeType:function(t){return null==l&&(p.mimeType=t),this},statusCode:function(t){var e;if(t)if(l)M.always(t[M.status]);else for(e in t)y[e]=[y[e],t[e]];return this},abort:function(t){var e=t||_;return i&&i.abort(e),A(0,e),this}};if(v.promise(M),p.url=((t||p.url||_e.href)+"").replace(Ne,_e.protocol+"//"),p.type=e.method||e.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(D)||[""],null==p.crossDomain){c=x.createElement("a");try{c.href=p.url,c.href=c.href,p.crossDomain=ze.protocol+"//"+ze.host!=c.protocol+"//"+c.host}catch(t){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=S.param(p.data,p.traditional)),Ue(Be,p,e,M),l)return M;for(h in(u=S.event&&p.global)&&0==S.active++&&S.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Ie.test(p.type),r=p.url.replace(Re,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(Ce,"+")):(d=p.url.slice(r.length),p.data&&(p.processData||"string"==typeof p.data)&&(r+=(Me.test(r)?"&":"?")+p.data,delete p.data),!1===p.cache&&(r=r.replace(Oe,"$1"),d=(Me.test(r)?"&":"?")+"_="+Se.guid+++d),p.url=r+d),p.ifModified&&(S.lastModified[r]&&M.setRequestHeader("If-Modified-Since",S.lastModified[r]),S.etag[r]&&M.setRequestHeader("If-None-Match",S.etag[r])),(p.data&&p.hasContent&&!1!==p.contentType||e.contentType)&&M.setRequestHeader("Content-Type",p.contentType),M.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+ke+"; q=0.01":""):p.accepts["*"]),p.headers)M.setRequestHeader(h,p.headers[h]);if(p.beforeSend&&(!1===p.beforeSend.call(f,M,p)||l))return M.abort();if(_="abort",g.add(p.complete),M.done(p.success),M.fail(p.error),i=Ue(De,p,e,M)){if(M.readyState=1,u&&m.trigger("ajaxSend",[M,p]),l)return M;p.async&&p.timeout>0&&(s=n.setTimeout((function(){M.abort("timeout")}),p.timeout));try{l=!1,i.send(w,A)}catch(t){if(l)throw t;A(-1,t)}}else A(-1,"No Transport");function A(t,e,a,c){var h,d,x,w,b,_=e;l||(l=!0,s&&n.clearTimeout(s),i=void 0,o=c||"",M.readyState=t>0?4:0,h=t>=200&&t<300||304===t,a&&(w=function(t,e,n){for(var i,r,o,a,s=t.contents,c=t.dataTypes;"*"===c[0];)c.shift(),void 0===i&&(i=t.mimeType||e.getResponseHeader("Content-Type"));if(i)for(r in s)if(s[r]&&s[r].test(i)){c.unshift(r);break}if(c[0]in n)o=c[0];else{for(r in n){if(!c[0]||t.converters[r+" "+c[0]]){o=r;break}a||(a=r)}o=o||a}if(o)return o!==c[0]&&c.unshift(o),n[o]}(p,M,a)),!h&&S.inArray("script",p.dataTypes)>-1&&S.inArray("json",p.dataTypes)<0&&(p.converters["text script"]=function(){}),w=function(t,e,n,i){var r,o,a,s,c,l={},u=t.dataTypes.slice();if(u[1])for(a in t.converters)l[a.toLowerCase()]=t.converters[a];for(o=u.shift();o;)if(t.responseFields[o]&&(n[t.responseFields[o]]=e),!c&&i&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),c=o,o=u.shift())if("*"===o)o=c;else if("*"!==c&&c!==o){if(!(a=l[c+" "+o]||l["* "+o]))for(r in l)if((s=r.split(" "))[1]===o&&(a=l[c+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[r]:!0!==l[r]&&(o=s[0],u.unshift(s[1]));break}if(!0!==a)if(a&&t.throws)e=a(e);else try{e=a(e)}catch(t){return{state:"parsererror",error:a?t:"No conversion from "+c+" to "+o}}}return{state:"success",data:e}}(p,w,M,h),h?(p.ifModified&&((b=M.getResponseHeader("Last-Modified"))&&(S.lastModified[r]=b),(b=M.getResponseHeader("etag"))&&(S.etag[r]=b)),204===t||"HEAD"===p.type?_="nocontent":304===t?_="notmodified":(_=w.state,d=w.data,h=!(x=w.error))):(x=_,!t&&_||(_="error",t<0&&(t=0))),M.status=t,M.statusText=(e||_)+"",h?v.resolveWith(f,[d,_,M]):v.rejectWith(f,[M,_,x]),M.statusCode(y),y=void 0,u&&m.trigger(h?"ajaxSuccess":"ajaxError",[M,p,h?d:x]),g.fireWith(f,[M,_]),u&&(m.trigger("ajaxComplete",[M,p]),--S.active||S.event.trigger("ajaxStop")))}return M},getJSON:function(t,e,n){return S.get(t,e,n,"json")},getScript:function(t,e){return S.get(t,void 0,e,"script")}}),S.each(["get","post"],(function(t,e){S[e]=function(t,n,i,r){return g(n)&&(r=r||i,i=n,n=void 0),S.ajax(S.extend({url:t,type:e,dataType:r,data:n,success:i},S.isPlainObject(t)&&t))}})),S.ajaxPrefilter((function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")})),S._evalUrl=function(t,e,n){return S.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){S.globalEval(t,e,n)}})},S.fn.extend({wrapAll:function(t){var e;return this[0]&&(g(t)&&(t=t.call(this[0])),e=S(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t})).append(this)),this},wrapInner:function(t){return g(t)?this.each((function(e){S(this).wrapInner(t.call(this,e))})):this.each((function(){var e=S(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)}))},wrap:function(t){var e=g(t);return this.each((function(n){S(this).wrapAll(e?t.call(this,n):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){S(this).replaceWith(this.childNodes)})),this}}),S.expr.pseudos.hidden=function(t){return!S.expr.pseudos.visible(t)},S.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(t){}};var He={0:200,1223:204},Ge=S.ajaxSettings.xhr();v.cors=!!Ge&&"withCredentials"in Ge,v.ajax=Ge=!!Ge,S.ajaxTransport((function(t){var e,i;if(v.cors||Ge&&!t.crossDomain)return{send:function(r,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];for(a in t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest"),r)s.setRequestHeader(a,r[a]);e=function(t){return function(){e&&(e=i=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===t?s.abort():"error"===t?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(He[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=e(),i=s.onerror=s.ontimeout=e("error"),void 0!==s.onabort?s.onabort=i:s.onreadystatechange=function(){4===s.readyState&&n.setTimeout((function(){e&&i()}))},e=e("abort");try{s.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}})),S.ajaxPrefilter((function(t){t.crossDomain&&(t.contents.script=!1)})),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return S.globalEval(t),t}}}),S.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),S.ajaxTransport("script",(function(t){var e,n;if(t.crossDomain||t.scriptAttrs)return{send:function(i,r){e=S(" + + + + \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/package-lock.json b/Sketchbook-master/Sketchbook-master/package-lock.json new file mode 100644 index 00000000..848d80ea --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/package-lock.json @@ -0,0 +1,13480 @@ +{ + "name": "sketchbook", + "version": "0.4.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "sketchbook", + "version": "0.4.0", + "license": "MIT", + "dependencies": { + "jquery": "^3.6.0", + "lodash": "^4.17.21", + "sweetalert2": "^9.17.2", + "three": "0.113.0", + "three-csm": "1.0.2" + }, + "devDependencies": { + "@types/jquery": "^3.5.5", + "@types/lodash": "^4.14.168", + "css-loader": "^3.6.0", + "style-loader": "^1.3.0", + "ts-loader": "^6.2.2", + "typescript": "^3.9.9", + "webpack": "^4.46.0", + "webpack-cli": "^3.3.12", + "webpack-dev-server": "^3.11.2", + "webpack-merge": "^4.2.2" + } + }, + "node_modules/@types/glob": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-w+LsMxKyYQm347Otw+IfBXOv9UWVjpHpCDdbBMt8Kz/xbvCYNjP+0qPh91Km3iKfSRLBB0P7fAMf0KHrPu+MyA==", + "dev": true, + "dependencies": { + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "node_modules/@types/jquery": { + "version": "3.5.6", + "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.6.tgz", + "integrity": "sha512-SmgCQRzGPId4MZQKDj9Hqc6kSXFNWZFHpELkyK8AQhf8Zr6HKfCzFv9ZC1Fv3FyQttJZOlap3qYb12h61iZAIg==", + "dev": true, + "dependencies": { + "@types/sizzle": "*" + } + }, + "node_modules/@types/json-schema": { + "version": "7.0.8", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.8.tgz", + "integrity": "sha512-YSBPTLTVm2e2OoQIDYx8HaeWJ5tTToLH67kXR7zYNGupXMEHa2++G8k+DczX2cFVgalypqtyZIcU19AFcmOpmg==", + "dev": true + }, + "node_modules/@types/lodash": { + "version": "4.14.171", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.171.tgz", + "integrity": "sha512-7eQ2xYLLI/LsicL2nejW9Wyko3lcpN6O/z0ZLHrEQsg280zIdCv1t/0m6UtBjUHokCGBQ3gYTbHzDkZ1xOBwwg==", + "dev": true + }, + "node_modules/@types/minimatch": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz", + "integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==", + "dev": true + }, + "node_modules/@types/node": { + "version": "16.4.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.4.9.tgz", + "integrity": "sha512-HXhRf581nCItzn8yevv4LYt+bJ5cBbDBAJExbDPMeU/2n5/j0ZemGpayahFBP4xL7RseaCLASLD9i9AYyDe7Nw==", + "dev": true + }, + "node_modules/@types/sizzle": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.3.tgz", + "integrity": "sha512-JYM8x9EGF163bEyhdJBpR2QX1R5naCJHC8ucJylJ3w9/CVBaskdQ8WqBf8MmQrd1kRvp/a4TS8HJ+bxzR7ZJYQ==", + "dev": true + }, + "node_modules/@webassemblyjs/ast": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.9.0.tgz", + "integrity": "sha512-C6wW5L+b7ogSDVqymbkkvuW9kruN//YisMED04xzeBBqjHa2FYnmvOlS6Xj68xWQRgWvI9cIglsjFowH/RJyEA==", + "dev": true, + "dependencies": { + "@webassemblyjs/helper-module-context": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/wast-parser": "1.9.0" + } + }, + "node_modules/@webassemblyjs/floating-point-hex-parser": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.9.0.tgz", + "integrity": "sha512-TG5qcFsS8QB4g4MhrxK5TqfdNe7Ey/7YL/xN+36rRjl/BlGE/NcBvJcqsRgCP6Z92mRE+7N50pRIi8SmKUbcQA==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-api-error": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.9.0.tgz", + "integrity": "sha512-NcMLjoFMXpsASZFxJ5h2HZRcEhDkvnNFOAKneP5RbKRzaWJN36NC4jqQHKwStIhGXu5mUWlUUk7ygdtrO8lbmw==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-buffer": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.9.0.tgz", + "integrity": "sha512-qZol43oqhq6yBPx7YM3m9Bv7WMV9Eevj6kMi6InKOuZxhw+q9hOkvq5e/PpKSiLfyetpaBnogSbNCfBwyB00CA==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-code-frame": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.9.0.tgz", + "integrity": "sha512-ERCYdJBkD9Vu4vtjUYe8LZruWuNIToYq/ME22igL+2vj2dQ2OOujIZr3MEFvfEaqKoVqpsFKAGsRdBSBjrIvZA==", + "dev": true, + "dependencies": { + "@webassemblyjs/wast-printer": "1.9.0" + } + }, + "node_modules/@webassemblyjs/helper-fsm": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-fsm/-/helper-fsm-1.9.0.tgz", + "integrity": "sha512-OPRowhGbshCb5PxJ8LocpdX9Kl0uB4XsAjl6jH/dWKlk/mzsANvhwbiULsaiqT5GZGT9qinTICdj6PLuM5gslw==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-module-context": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-module-context/-/helper-module-context-1.9.0.tgz", + "integrity": "sha512-MJCW8iGC08tMk2enck1aPW+BE5Cw8/7ph/VGZxwyvGbJwjktKkDK7vy7gAmMDx88D7mhDTCNKAW5tED+gZ0W8g==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.9.0" + } + }, + "node_modules/@webassemblyjs/helper-wasm-bytecode": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.9.0.tgz", + "integrity": "sha512-R7FStIzyNcd7xKxCZH5lE0Bqy+hGTwS3LJjuv1ZVxd9O7eHCedSdrId/hMOd20I+v8wDXEn+bjfKDLzTepoaUw==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-wasm-section": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.9.0.tgz", + "integrity": "sha512-XnMB8l3ek4tvrKUUku+IVaXNHz2YsJyOOmz+MMkZvh8h1uSJpSen6vYnw3IoQ7WwEuAhL8Efjms1ZWjqh2agvw==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-buffer": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/wasm-gen": "1.9.0" + } + }, + "node_modules/@webassemblyjs/ieee754": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.9.0.tgz", + "integrity": "sha512-dcX8JuYU/gvymzIHc9DgxTzUUTLexWwt8uCTWP3otys596io0L5aW02Gb1RjYpx2+0Jus1h4ZFqjla7umFniTg==", + "dev": true, + "dependencies": { + "@xtuc/ieee754": "^1.2.0" + } + }, + "node_modules/@webassemblyjs/leb128": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.9.0.tgz", + "integrity": "sha512-ENVzM5VwV1ojs9jam6vPys97B/S65YQtv/aanqnU7D8aSoHFX8GyhGg0CMfyKNIHBuAVjy3tlzd5QMMINa7wpw==", + "dev": true, + "dependencies": { + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webassemblyjs/utf8": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.9.0.tgz", + "integrity": "sha512-GZbQlWtopBTP0u7cHrEx+73yZKrQoBMpwkGEIqlacljhXCkVM1kMQge/Mf+csMJAjEdSwhOyLAS0AoR3AG5P8w==", + "dev": true + }, + "node_modules/@webassemblyjs/wasm-edit": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.9.0.tgz", + "integrity": "sha512-FgHzBm80uwz5M8WKnMTn6j/sVbqilPdQXTWraSjBwFXSYGirpkSWE2R9Qvz9tNiTKQvoKILpCuTjBKzOIm0nxw==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-buffer": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/helper-wasm-section": "1.9.0", + "@webassemblyjs/wasm-gen": "1.9.0", + "@webassemblyjs/wasm-opt": "1.9.0", + "@webassemblyjs/wasm-parser": "1.9.0", + "@webassemblyjs/wast-printer": "1.9.0" + } + }, + "node_modules/@webassemblyjs/wasm-gen": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.9.0.tgz", + "integrity": "sha512-cPE3o44YzOOHvlsb4+E9qSqjc9Qf9Na1OO/BHFy4OI91XDE14MjFN4lTMezzaIWdPqHnsTodGGNP+iRSYfGkjA==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/ieee754": "1.9.0", + "@webassemblyjs/leb128": "1.9.0", + "@webassemblyjs/utf8": "1.9.0" + } + }, + "node_modules/@webassemblyjs/wasm-opt": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.9.0.tgz", + "integrity": "sha512-Qkjgm6Anhm+OMbIL0iokO7meajkzQD71ioelnfPEj6r4eOFuqm4YC3VBPqXjFyyNwowzbMD+hizmprP/Fwkl2A==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-buffer": "1.9.0", + "@webassemblyjs/wasm-gen": "1.9.0", + "@webassemblyjs/wasm-parser": "1.9.0" + } + }, + "node_modules/@webassemblyjs/wasm-parser": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.9.0.tgz", + "integrity": "sha512-9+wkMowR2AmdSWQzsPEjFU7njh8HTO5MqO8vjwEHuM+AMHioNqSBONRdr0NQQ3dVQrzp0s8lTcYqzUdb7YgELA==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-api-error": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/ieee754": "1.9.0", + "@webassemblyjs/leb128": "1.9.0", + "@webassemblyjs/utf8": "1.9.0" + } + }, + "node_modules/@webassemblyjs/wast-parser": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-parser/-/wast-parser-1.9.0.tgz", + "integrity": "sha512-qsqSAP3QQ3LyZjNC/0jBJ/ToSxfYJ8kYyuiGvtn/8MK89VrNEfwj7BPQzJVHi0jGTRK2dGdJ5PRqhtjzoww+bw==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/floating-point-hex-parser": "1.9.0", + "@webassemblyjs/helper-api-error": "1.9.0", + "@webassemblyjs/helper-code-frame": "1.9.0", + "@webassemblyjs/helper-fsm": "1.9.0", + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webassemblyjs/wast-printer": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.9.0.tgz", + "integrity": "sha512-2J0nE95rHXHyQ24cWjMKJ1tqB/ds8z/cyeOZxJhcb+rW+SQASVjuznUSmdz5GpVJTzU8JkhYut0D3siFDD6wsA==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/wast-parser": "1.9.0", + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@xtuc/ieee754": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", + "dev": true + }, + "node_modules/@xtuc/long": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "dev": true + }, + "node_modules/accepts": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", + "dev": true, + "dependencies": { + "mime-types": "~2.1.24", + "negotiator": "0.6.2" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/acorn": { + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", + "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-errors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.1.tgz", + "integrity": "sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==", + "dev": true, + "peerDependencies": { + "ajv": ">=5.0.0" + } + }, + "node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true, + "peerDependencies": { + "ajv": "^6.9.1" + } + }, + "node_modules/ansi-colors": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.4.tgz", + "integrity": "sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-html": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/ansi-html/-/ansi-html-0.0.7.tgz", + "integrity": "sha1-gTWEAhliqenm/QOflA0S9WynhZ4=", + "dev": true, + "engines": [ + "node >= 0.8.0" + ], + "bin": { + "ansi-html": "bin/ansi-html" + } + }, + "node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "dev": true, + "optional": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "dev": true + }, + "node_modules/arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-flatten": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-2.1.2.tgz", + "integrity": "sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ==", + "dev": true + }, + "node_modules/array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "dependencies": { + "array-uniq": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/asn1.js": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", + "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", + "dev": true, + "dependencies": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "safer-buffer": "^2.1.0" + } + }, + "node_modules/asn1.js/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, + "node_modules/assert": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz", + "integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==", + "dev": true, + "dependencies": { + "object-assign": "^4.1.1", + "util": "0.10.3" + } + }, + "node_modules/assert/node_modules/inherits": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", + "dev": true + }, + "node_modules/assert/node_modules/util": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "dev": true, + "dependencies": { + "inherits": "2.0.1" + } + }, + "node_modules/assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/async": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", + "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "dev": true, + "dependencies": { + "lodash": "^4.17.14" + } + }, + "node_modules/async-each": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", + "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", + "dev": true + }, + "node_modules/async-limiter": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", + "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==", + "dev": true + }, + "node_modules/atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true, + "bin": { + "atob": "bin/atob.js" + }, + "engines": { + "node": ">= 4.5.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "dependencies": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/base/node_modules/define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "dependencies": { + "is-descriptor": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/batch": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", + "integrity": "sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY=", + "dev": true + }, + "node_modules/big.js": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", + "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true, + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "dev": true, + "optional": true, + "dependencies": { + "file-uri-to-path": "1.0.0" + } + }, + "node_modules/bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", + "dev": true + }, + "node_modules/bn.js": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", + "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==", + "dev": true + }, + "node_modules/body-parser": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", + "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", + "dev": true, + "dependencies": { + "bytes": "3.1.0", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "~1.1.2", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "on-finished": "~2.3.0", + "qs": "6.7.0", + "raw-body": "2.4.0", + "type-is": "~1.6.17" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/body-parser/node_modules/bytes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", + "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/body-parser/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/body-parser/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "node_modules/bonjour": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/bonjour/-/bonjour-3.5.0.tgz", + "integrity": "sha1-jokKGD2O6aI5OzhExpGkK897yfU=", + "dev": true, + "dependencies": { + "array-flatten": "^2.1.0", + "deep-equal": "^1.0.1", + "dns-equal": "^1.0.0", + "dns-txt": "^2.0.2", + "multicast-dns": "^6.0.1", + "multicast-dns-service-types": "^1.1.0" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "dev": true + }, + "node_modules/browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dev": true, + "dependencies": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "dev": true, + "dependencies": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "node_modules/browserify-des": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", + "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", + "dev": true, + "dependencies": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/browserify-rsa": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz", + "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==", + "dev": true, + "dependencies": { + "bn.js": "^5.0.0", + "randombytes": "^2.0.1" + } + }, + "node_modules/browserify-sign": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", + "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", + "dev": true, + "dependencies": { + "bn.js": "^5.1.1", + "browserify-rsa": "^4.0.1", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "elliptic": "^6.5.3", + "inherits": "^2.0.4", + "parse-asn1": "^5.1.5", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + } + }, + "node_modules/browserify-sign/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/browserify-sign/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/browserify-zlib": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "dev": true, + "dependencies": { + "pako": "~1.0.5" + } + }, + "node_modules/buffer": { + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", + "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==", + "dev": true, + "dependencies": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4", + "isarray": "^1.0.0" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "node_modules/buffer-indexof": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-indexof/-/buffer-indexof-1.1.1.tgz", + "integrity": "sha512-4/rOEg86jivtPTeOUUT61jJO1Ya1TrR/OkqCSZDyq84WJh3LuuiphBYJN+fm5xufIk4XAFcEwte/8WzC8If/1g==", + "dev": true + }, + "node_modules/buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", + "dev": true + }, + "node_modules/builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", + "dev": true + }, + "node_modules/bytes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", + "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/cacache": { + "version": "12.0.4", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.4.tgz", + "integrity": "sha512-a0tMB40oefvuInr4Cwb3GerbL9xTj1D5yg0T5xrjGCGyfvbxseIXX7BAO/u/hIXdafzOI5JC3wDwHyf24buOAQ==", + "dev": true, + "dependencies": { + "bluebird": "^3.5.5", + "chownr": "^1.1.1", + "figgy-pudding": "^3.5.1", + "glob": "^7.1.4", + "graceful-fs": "^4.1.15", + "infer-owner": "^1.0.3", + "lru-cache": "^5.1.1", + "mississippi": "^3.0.0", + "mkdirp": "^0.5.1", + "move-concurrently": "^1.0.1", + "promise-inflight": "^1.0.1", + "rimraf": "^2.6.3", + "ssri": "^6.0.1", + "unique-filename": "^1.1.1", + "y18n": "^4.0.0" + } + }, + "node_modules/cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "dependencies": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chalk/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chokidar": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", + "integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==", + "dev": true, + "optional": true, + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "dev": true + }, + "node_modules/chrome-trace-event": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", + "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", + "dev": true, + "engines": { + "node": ">=6.0" + } + }, + "node_modules/cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, + "dependencies": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/class-utils/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/class-utils/node_modules/is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/class-utils/node_modules/is-accessor-descriptor/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/class-utils/node_modules/is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/class-utils/node_modules/is-data-descriptor/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/class-utils/node_modules/is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/class-utils/node_modules/kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "dev": true, + "dependencies": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + } + }, + "node_modules/cliui/node_modules/ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/cliui/node_modules/strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "dependencies": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "node_modules/commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "node_modules/component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "dev": true + }, + "node_modules/compressible": { + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", + "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==", + "dev": true, + "dependencies": { + "mime-db": ">= 1.43.0 < 2" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/compression": { + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.4.tgz", + "integrity": "sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==", + "dev": true, + "dependencies": { + "accepts": "~1.3.5", + "bytes": "3.0.0", + "compressible": "~2.0.16", + "debug": "2.6.9", + "on-headers": "~1.0.2", + "safe-buffer": "5.1.2", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/compression/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/compression/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "node_modules/concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "engines": [ + "node >= 0.8" + ], + "dependencies": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "node_modules/connect-history-api-fallback": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz", + "integrity": "sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg==", + "dev": true, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/console-browserify": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", + "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==", + "dev": true + }, + "node_modules/constants-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", + "dev": true + }, + "node_modules/content-disposition": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", + "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", + "dev": true, + "dependencies": { + "safe-buffer": "5.1.2" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", + "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=", + "dev": true + }, + "node_modules/copy-concurrently": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz", + "integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==", + "dev": true, + "dependencies": { + "aproba": "^1.1.1", + "fs-write-stream-atomic": "^1.0.8", + "iferr": "^0.1.5", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4", + "run-queue": "^1.0.0" + } + }, + "node_modules/copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "node_modules/create-ecdh": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", + "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", + "dev": true, + "dependencies": { + "bn.js": "^4.1.0", + "elliptic": "^6.5.3" + } + }, + "node_modules/create-ecdh/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, + "node_modules/create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, + "dependencies": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "node_modules/create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, + "dependencies": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "node_modules/cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "dependencies": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "engines": { + "node": ">=4.8" + } + }, + "node_modules/cross-spawn/node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "dev": true, + "dependencies": { + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + }, + "engines": { + "node": "*" + } + }, + "node_modules/css-loader": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-3.6.0.tgz", + "integrity": "sha512-M5lSukoWi1If8dhQAUCvj4H8vUt3vOnwbQBH9DdTm/s4Ym2B/3dPMtYZeJmq7Q3S3Pa+I94DcZ7pc9bP14cWIQ==", + "dev": true, + "dependencies": { + "camelcase": "^5.3.1", + "cssesc": "^3.0.0", + "icss-utils": "^4.1.1", + "loader-utils": "^1.2.3", + "normalize-path": "^3.0.0", + "postcss": "^7.0.32", + "postcss-modules-extract-imports": "^2.0.0", + "postcss-modules-local-by-default": "^3.0.2", + "postcss-modules-scope": "^2.2.0", + "postcss-modules-values": "^3.0.0", + "postcss-value-parser": "^4.1.0", + "schema-utils": "^2.7.0", + "semver": "^6.3.0" + }, + "engines": { + "node": ">= 8.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^4.0.0 || ^5.0.0" + } + }, + "node_modules/cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "dev": true, + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/cyclist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", + "integrity": "sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=", + "dev": true + }, + "node_modules/debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/deep-equal": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz", + "integrity": "sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==", + "dev": true, + "dependencies": { + "is-arguments": "^1.0.4", + "is-date-object": "^1.0.1", + "is-regex": "^1.0.4", + "object-is": "^1.0.1", + "object-keys": "^1.1.1", + "regexp.prototype.flags": "^1.2.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/default-gateway": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/default-gateway/-/default-gateway-4.2.0.tgz", + "integrity": "sha512-h6sMrVB1VMWVrW13mSc6ia/DwYYw5MN6+exNu1OaJeFac5aSAvwM7lZ0NVfTABuSkQelr4h5oebg3KB1XPdjgA==", + "dev": true, + "dependencies": { + "execa": "^1.0.0", + "ip-regex": "^2.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "dependencies": { + "object-keys": "^1.0.12" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "dependencies": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/del": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/del/-/del-4.1.1.tgz", + "integrity": "sha512-QwGuEUouP2kVwQenAsOof5Fv8K9t3D8Ca8NxcXKrIpEHjTXK5J2nXLdP+ALI1cgv8wj7KuwBhTwBkOZSJKM5XQ==", + "dev": true, + "dependencies": { + "@types/glob": "^7.1.1", + "globby": "^6.1.0", + "is-path-cwd": "^2.0.0", + "is-path-in-cwd": "^2.0.0", + "p-map": "^2.0.0", + "pify": "^4.0.1", + "rimraf": "^2.6.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/des.js": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", + "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "node_modules/destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", + "dev": true + }, + "node_modules/detect-file": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", + "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/detect-node": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz", + "integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==", + "dev": true + }, + "node_modules/diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "dev": true, + "dependencies": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + } + }, + "node_modules/diffie-hellman/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, + "node_modules/dns-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/dns-equal/-/dns-equal-1.0.0.tgz", + "integrity": "sha1-s55/HabrCnW6nBcySzR1PEfgZU0=", + "dev": true + }, + "node_modules/dns-packet": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-1.3.4.tgz", + "integrity": "sha512-BQ6F4vycLXBvdrJZ6S3gZewt6rcrks9KBgM9vrhW+knGRqc8uEdT7fuCwloc7nny5xNoMJ17HGH0R/6fpo8ECA==", + "dev": true, + "dependencies": { + "ip": "^1.1.0", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/dns-txt": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/dns-txt/-/dns-txt-2.0.2.tgz", + "integrity": "sha1-uR2Ab10nGI5Ks+fRB9iBocxGQrY=", + "dev": true, + "dependencies": { + "buffer-indexof": "^1.0.0" + } + }, + "node_modules/domain-browser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", + "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", + "dev": true, + "engines": { + "node": ">=0.4", + "npm": ">=1.2" + } + }, + "node_modules/duplexify": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", + "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", + "dev": true + }, + "node_modules/elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "dev": true, + "dependencies": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/elliptic/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, + "node_modules/emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "node_modules/emojis-list": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", + "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/enhanced-resolve": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.5.0.tgz", + "integrity": "sha512-Nv9m36S/vxpsI+Hc4/ZGRs0n9mXqSWGGq49zxb/cJfPAQMbUtttJAlNPS4AQzaBdw/pKskw5bMbekT/Y7W/Wlg==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "memory-fs": "^0.5.0", + "tapable": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/errno": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz", + "integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==", + "dev": true, + "dependencies": { + "prr": "~1.0.1" + }, + "bin": { + "errno": "cli.js" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", + "dev": true + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/eslint-scope": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", + "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "dev": true, + "dependencies": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse/node_modules/estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", + "dev": true + }, + "node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "dev": true, + "engines": { + "node": ">=0.8.x" + } + }, + "node_modules/eventsource": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-1.1.0.tgz", + "integrity": "sha512-VSJjT5oCNrFvCS6igjzPAt5hBzQ2qPBFIbJ03zLI9SE0mxwZpMw6BfJrbFHm1a141AavMEB8JHmBhWAd66PfCg==", + "dev": true, + "dependencies": { + "original": "^1.0.0" + }, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, + "dependencies": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "node_modules/execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "dev": true, + "dependencies": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "dependencies": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-brackets/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/expand-brackets/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-brackets/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-brackets/node_modules/is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-brackets/node_modules/is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-brackets/node_modules/is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-brackets/node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-brackets/node_modules/kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-brackets/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "node_modules/expand-tilde": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", + "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", + "dev": true, + "dependencies": { + "homedir-polyfill": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/express": { + "version": "4.17.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", + "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", + "dev": true, + "dependencies": { + "accepts": "~1.3.7", + "array-flatten": "1.1.1", + "body-parser": "1.19.0", + "content-disposition": "0.5.3", + "content-type": "~1.0.4", + "cookie": "0.4.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "~1.1.2", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "~1.1.2", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.5", + "qs": "6.7.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.1.2", + "send": "0.17.1", + "serve-static": "1.14.1", + "setprototypeof": "1.1.1", + "statuses": "~1.5.0", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/express/node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=", + "dev": true + }, + "node_modules/express/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/express/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "node_modules/extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "dependencies": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "dependencies": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extglob/node_modules/define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "dependencies": { + "is-descriptor": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extglob/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extglob/node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/faye-websocket": { + "version": "0.11.4", + "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.4.tgz", + "integrity": "sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g==", + "dev": true, + "dependencies": { + "websocket-driver": ">=0.5.1" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/figgy-pudding": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", + "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==", + "dev": true + }, + "node_modules/file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "dev": true, + "optional": true + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", + "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", + "dev": true, + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "statuses": "~1.5.0", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/finalhandler/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/finalhandler/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "node_modules/find-cache-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", + "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", + "dev": true, + "dependencies": { + "commondir": "^1.0.1", + "make-dir": "^2.0.0", + "pkg-dir": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "dependencies": { + "locate-path": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/findup-sync": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz", + "integrity": "sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg==", + "dev": true, + "dependencies": { + "detect-file": "^1.0.0", + "is-glob": "^4.0.0", + "micromatch": "^3.0.4", + "resolve-dir": "^1.0.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/findup-sync/node_modules/braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "dependencies": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/braces/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "dependencies": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/fill-range/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/is-number/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "dependencies": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/findup-sync/node_modules/to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "dependencies": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/flush-write-stream": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", + "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "readable-stream": "^2.3.6" + } + }, + "node_modules/follow-redirects": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.1.tgz", + "integrity": "sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "dependencies": { + "map-cache": "^0.2.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/from2": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", + "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.0" + } + }, + "node_modules/fs-write-stream-atomic": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", + "integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "iferr": "^0.1.5", + "imurmurhash": "^0.1.4", + "readable-stream": "1 || 2" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", + "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/glob": { + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "optional": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/global-modules": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", + "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==", + "dev": true, + "dependencies": { + "global-prefix": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/global-prefix": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", + "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", + "dev": true, + "dependencies": { + "ini": "^1.3.5", + "kind-of": "^6.0.2", + "which": "^1.3.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/globby": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", + "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", + "dev": true, + "dependencies": { + "array-union": "^1.0.1", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/globby/node_modules/pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", + "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==", + "dev": true + }, + "node_modules/handle-thing": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-2.0.1.tgz", + "integrity": "sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg==", + "dev": true + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/has-symbols": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", + "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "dependencies": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "dependencies": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-values/node_modules/is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-values/node_modules/is-number/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-values/node_modules/kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/hash-base/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/hash-base/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "node_modules/hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "dev": true, + "dependencies": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/homedir-polyfill": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", + "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", + "dev": true, + "dependencies": { + "parse-passwd": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/hpack.js": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/hpack.js/-/hpack.js-2.1.6.tgz", + "integrity": "sha1-h3dMCUnlE/QuhFdbPEVoH63ioLI=", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "obuf": "^1.0.0", + "readable-stream": "^2.0.1", + "wbuf": "^1.1.0" + } + }, + "node_modules/html-entities": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-1.4.0.tgz", + "integrity": "sha512-8nxjcBcd8wovbeKx7h3wTji4e6+rhaVuPNpMqwWgnHh+N9ToqsCs6XztWRBPQ+UtzsoMAdKZtUENoVzU/EMtZA==", + "dev": true + }, + "node_modules/http-deceiver": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/http-deceiver/-/http-deceiver-1.2.7.tgz", + "integrity": "sha1-+nFolEq5pRnTN8sL7HKE3D5yPYc=", + "dev": true + }, + "node_modules/http-errors": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", + "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", + "dev": true, + "dependencies": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.1", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/http-errors/node_modules/inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "node_modules/http-parser-js": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.3.tgz", + "integrity": "sha512-t7hjvef/5HEK7RWTdUzVUhl8zkEu+LlaE0IYzdMuvbSDipxBRpOn4Uhw8ZyECEa808iVT8XCjzo6xmYt4CiLZg==", + "dev": true + }, + "node_modules/http-proxy": { + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", + "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", + "dev": true, + "dependencies": { + "eventemitter3": "^4.0.0", + "follow-redirects": "^1.0.0", + "requires-port": "^1.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/http-proxy-middleware": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.19.1.tgz", + "integrity": "sha512-yHYTgWMQO8VvwNS22eLLloAkvungsKdKTLO8AJlftYIKNfJr3GK3zK0ZCfzDDGUBttdGc8xFy1mCitvNKQtC3Q==", + "dev": true, + "dependencies": { + "http-proxy": "^1.17.0", + "is-glob": "^4.0.0", + "lodash": "^4.17.11", + "micromatch": "^3.1.10" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/http-proxy-middleware/node_modules/braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "dependencies": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/http-proxy-middleware/node_modules/braces/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/http-proxy-middleware/node_modules/fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "dependencies": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/http-proxy-middleware/node_modules/fill-range/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/http-proxy-middleware/node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/http-proxy-middleware/node_modules/is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/http-proxy-middleware/node_modules/is-number/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/http-proxy-middleware/node_modules/micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "dependencies": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/http-proxy-middleware/node_modules/to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "dependencies": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/https-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", + "dev": true + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/icss-utils": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-4.1.1.tgz", + "integrity": "sha512-4aFq7wvWyMHKgxsH8QQtGpvbASCf+eM3wPRLI6R+MgAnTCZ6STYsRvttLvRWK0Nfif5piF394St3HeJDaljGPA==", + "dev": true, + "dependencies": { + "postcss": "^7.0.14" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/iferr": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", + "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=", + "dev": true + }, + "node_modules/import-local": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz", + "integrity": "sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ==", + "dev": true, + "dependencies": { + "pkg-dir": "^3.0.0", + "resolve-cwd": "^2.0.0" + }, + "bin": { + "import-local-fixture": "fixtures/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/infer-owner": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", + "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", + "dev": true + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + }, + "node_modules/internal-ip": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/internal-ip/-/internal-ip-4.3.0.tgz", + "integrity": "sha512-S1zBo1D6zcsyuC6PMmY5+55YMILQ9av8lotMx447Bq6SAgo/sDK6y6uUKmuYhW7eacnIhFfsPmCNYdDzsnnDCg==", + "dev": true, + "dependencies": { + "default-gateway": "^4.2.0", + "ipaddr.js": "^1.9.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/interpret": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/ip": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", + "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=", + "dev": true + }, + "node_modules/ip-regex": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz", + "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-absolute-url": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-3.0.3.tgz", + "integrity": "sha512-opmNIX7uFnS96NtPmhWQgQx6/NYFgsUXYMllcfzwWKUMwfo8kku1TvE6hkNcH+Q1ts5cMVrsY7j0bxXQDciu9Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-arguments": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.0.tgz", + "integrity": "sha512-1Ij4lOMPl/xB5kBDn7I+b2ttPMKa8szhEIrXDuXQD/oe3HJLTLhqhgGspwgyGd6MOywBUqVvYicF72lkgDnIHg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "optional": true, + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "node_modules/is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-date-object": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.4.tgz", + "integrity": "sha512-/b4ZVsG7Z5XVtIxs/h9W8nvfLgSAyKYdtGWQLbqy6jA1icmgjf8WCoTKgeS4wy5tYaPePouzFMANbnj94c2Z+A==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "dependencies": { + "is-plain-object": "^2.0.4" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-path-cwd": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz", + "integrity": "sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/is-path-in-cwd": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-2.1.0.tgz", + "integrity": "sha512-rNocXHgipO+rvnP6dk3zI20RpOtrAM/kzbB258Uw5BWr3TpXi861yzjo16Dn4hUox07iw5AyeMLHWsujkjzvRQ==", + "dev": true, + "dependencies": { + "is-path-inside": "^2.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/is-path-inside": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-2.1.0.tgz", + "integrity": "sha512-wiyhTzfDWsvwAW53OBWF5zuvaOGlZ6PwYxAbPVDhpm+gM09xKQGjBq/8uYN12aDvMxnAnq3dxTyoSoRNmg5YFg==", + "dev": true, + "dependencies": { + "path-is-inside": "^1.0.2" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-regex": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.3.tgz", + "integrity": "sha512-qSVXFz28HM7y+IWX6vLCsexdlvzT1PJNFSBuaQLQ5o0IEw8UDYW6/2+eCMVyIsbM8CNLX2a/QWmSpyxYEHY7CQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-wsl": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", + "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/jquery": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz", + "integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw==" + }, + "node_modules/json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json3": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/json3/-/json3-3.3.3.tgz", + "integrity": "sha512-c7/8mbUsKigAbLkD5B010BK4D9LZm7A1pNItkEwiUZRpIN66exu/e7YQWysGun+TRKaJp8MhemM+VkfWv42aCA==", + "dev": true + }, + "node_modules/json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, + "node_modules/killable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/killable/-/killable-1.0.1.tgz", + "integrity": "sha512-LzqtLKlUwirEUyl/nicirVmNiPvYs7l5n8wOPP7fyJVpUPkvCnW/vuiXGpylGUlnPDnB7311rARzAt3Mhswpjg==", + "dev": true + }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/loader-runner": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.4.0.tgz", + "integrity": "sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw==", + "dev": true, + "engines": { + "node": ">=4.3.0 <5.0.0 || >=5.10" + } + }, + "node_modules/loader-utils": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", + "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", + "dev": true, + "dependencies": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "dependencies": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "node_modules/loglevel": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.7.1.tgz", + "integrity": "sha512-Hesni4s5UkWkwCGJMQGAh71PaLUmKFM60dHvq0zi/vDhhrzuk+4GgNbTXJ12YYQJn6ZKBDNIjYcuQGKudvqrIw==", + "dev": true, + "engines": { + "node": ">= 0.6.0" + }, + "funding": { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/loglevel" + } + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "dependencies": { + "pify": "^4.0.1", + "semver": "^5.6.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "dependencies": { + "object-visit": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dev": true, + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/memory-fs": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.5.0.tgz", + "integrity": "sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA==", + "dev": true, + "dependencies": { + "errno": "^0.1.3", + "readable-stream": "^2.0.1" + }, + "engines": { + "node": ">=4.3.0 <5.0.0 || >=5.10" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", + "dev": true + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/micromatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", + "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "dev": true, + "dependencies": { + "braces": "^3.0.1", + "picomatch": "^2.2.3" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dev": true, + "dependencies": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + }, + "bin": { + "miller-rabin": "bin/miller-rabin" + } + }, + "node_modules/miller-rabin/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true, + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.49.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.49.0.tgz", + "integrity": "sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.32", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.32.tgz", + "integrity": "sha512-hJGaVS4G4c9TSMYh2n6SQAGrC4RnfU+daP8G7cSCmaqNjiOoUY0VHCMS42pxnQmVF1GWwFhbHWn3RIxCqTmZ9A==", + "dev": true, + "dependencies": { + "mime-db": "1.49.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true + }, + "node_modules/minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "dev": true + }, + "node_modules/minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "node_modules/mississippi": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz", + "integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==", + "dev": true, + "dependencies": { + "concat-stream": "^1.5.0", + "duplexify": "^3.4.2", + "end-of-stream": "^1.1.0", + "flush-write-stream": "^1.0.0", + "from2": "^2.1.0", + "parallel-transform": "^1.1.0", + "pump": "^3.0.0", + "pumpify": "^1.3.3", + "stream-each": "^1.1.0", + "through2": "^2.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/mixin-deep": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", + "dev": true, + "dependencies": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "dependencies": { + "minimist": "^1.2.5" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/move-concurrently": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", + "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=", + "dev": true, + "dependencies": { + "aproba": "^1.1.1", + "copy-concurrently": "^1.0.0", + "fs-write-stream-atomic": "^1.0.8", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4", + "run-queue": "^1.0.3" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/multicast-dns": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/multicast-dns/-/multicast-dns-6.2.3.tgz", + "integrity": "sha512-ji6J5enbMyGRHIAkAOu3WdV8nggqviKCEKtXcOqfphZZtQrmHKycfynJ2V7eVPUA4NhJ6V7Wf4TmGbTwKE9B6g==", + "dev": true, + "dependencies": { + "dns-packet": "^1.3.1", + "thunky": "^1.0.2" + }, + "bin": { + "multicast-dns": "cli.js" + } + }, + "node_modules/multicast-dns-service-types": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/multicast-dns-service-types/-/multicast-dns-service-types-1.1.0.tgz", + "integrity": "sha1-iZ8R2WhuXgXLkbNdXw5jt3PPyQE=", + "dev": true + }, + "node_modules/nan": { + "version": "2.14.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz", + "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==", + "dev": true, + "optional": true + }, + "node_modules/nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "dependencies": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/negotiator": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", + "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, + "node_modules/nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "node_modules/node-forge": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.10.0.tgz", + "integrity": "sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA==", + "dev": true, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/node-libs-browser": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.1.tgz", + "integrity": "sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q==", + "dev": true, + "dependencies": { + "assert": "^1.1.1", + "browserify-zlib": "^0.2.0", + "buffer": "^4.3.0", + "console-browserify": "^1.1.0", + "constants-browserify": "^1.0.0", + "crypto-browserify": "^3.11.0", + "domain-browser": "^1.1.1", + "events": "^3.0.0", + "https-browserify": "^1.0.0", + "os-browserify": "^0.3.0", + "path-browserify": "0.0.1", + "process": "^0.11.10", + "punycode": "^1.2.4", + "querystring-es3": "^0.2.0", + "readable-stream": "^2.3.3", + "stream-browserify": "^2.0.1", + "stream-http": "^2.7.2", + "string_decoder": "^1.0.0", + "timers-browserify": "^2.0.4", + "tty-browserify": "0.0.0", + "url": "^0.11.0", + "util": "^0.11.0", + "vm-browserify": "^1.0.1" + } + }, + "node_modules/node-libs-browser/node_modules/punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "dependencies": { + "path-key": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "dependencies": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-copy/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-copy/node_modules/is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-copy/node_modules/is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-copy/node_modules/is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-copy/node_modules/is-descriptor/node_modules/kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-copy/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-is": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz", + "integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "dependencies": { + "isobject": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/obuf": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", + "integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==", + "dev": true + }, + "node_modules/on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "dev": true, + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/on-headers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/opn": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/opn/-/opn-5.5.0.tgz", + "integrity": "sha512-PqHpggC9bLV0VeWcdKhkpxY+3JTzetLSqTCWL/z/tFIbI6G8JCjondXklT1JinczLz2Xib62sSp0T/gKT4KksA==", + "dev": true, + "dependencies": { + "is-wsl": "^1.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/original": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/original/-/original-1.0.2.tgz", + "integrity": "sha512-hyBVl6iqqUOJ8FqRe+l/gS8H+kKYjrEndd5Pm1MfBtsEKA038HkkdbAl/72EAXGyonD/PFsvmVG+EvcIpliMBg==", + "dev": true, + "dependencies": { + "url-parse": "^1.4.3" + } + }, + "node_modules/os-browserify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", + "dev": true + }, + "node_modules/p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "dependencies": { + "p-limit": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/p-map": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", + "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/p-retry": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-3.0.1.tgz", + "integrity": "sha512-XE6G4+YTTkT2a0UWb2kjZe8xNwf8bIbnqpc/IS/idOBVhyves0mK5OJgeocjx7q5pvX/6m23xuzVPYT1uGM73w==", + "dev": true, + "dependencies": { + "retry": "^0.12.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", + "dev": true + }, + "node_modules/parallel-transform": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.2.0.tgz", + "integrity": "sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg==", + "dev": true, + "dependencies": { + "cyclist": "^1.0.1", + "inherits": "^2.0.3", + "readable-stream": "^2.1.5" + } + }, + "node_modules/parse-asn1": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", + "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==", + "dev": true, + "dependencies": { + "asn1.js": "^5.2.0", + "browserify-aes": "^1.0.0", + "evp_bytestokey": "^1.0.0", + "pbkdf2": "^3.0.3", + "safe-buffer": "^5.1.1" + } + }, + "node_modules/parse-passwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", + "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", + "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==", + "dev": true + }, + "node_modules/path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", + "dev": true + }, + "node_modules/path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, + "node_modules/path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=", + "dev": true + }, + "node_modules/pbkdf2": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", + "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", + "dev": true, + "dependencies": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + }, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/picomatch": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "dependencies": { + "pinkie": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "dev": true, + "dependencies": { + "find-up": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/portfinder": { + "version": "1.0.28", + "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.28.tgz", + "integrity": "sha512-Se+2isanIcEqf2XMHjyUKskczxbPH7dQnlMjXX6+dybayyHvAf/TCgyMRlzf/B6QDhAEFOGes0pzRo3by4AbMA==", + "dev": true, + "dependencies": { + "async": "^2.6.2", + "debug": "^3.1.1", + "mkdirp": "^0.5.5" + }, + "engines": { + "node": ">= 0.12.0" + } + }, + "node_modules/portfinder/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/postcss": { + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", + "dev": true, + "dependencies": { + "chalk": "^2.4.2", + "source-map": "^0.6.1", + "supports-color": "^6.1.0" + }, + "engines": { + "node": ">=6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + } + }, + "node_modules/postcss-modules-extract-imports": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-2.0.0.tgz", + "integrity": "sha512-LaYLDNS4SG8Q5WAWqIJgdHPJrDDr/Lv775rMBFUbgjTz6j34lUznACHcdRWroPvXANP2Vj7yNK57vp9eFqzLWQ==", + "dev": true, + "dependencies": { + "postcss": "^7.0.5" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/postcss-modules-local-by-default": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-3.0.3.tgz", + "integrity": "sha512-e3xDq+LotiGesympRlKNgaJ0PCzoUIdpH0dj47iWAui/kyTgh3CiAr1qP54uodmJhl6p9rN6BoNcdEDVJx9RDw==", + "dev": true, + "dependencies": { + "icss-utils": "^4.1.1", + "postcss": "^7.0.32", + "postcss-selector-parser": "^6.0.2", + "postcss-value-parser": "^4.1.0" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/postcss-modules-scope": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-2.2.0.tgz", + "integrity": "sha512-YyEgsTMRpNd+HmyC7H/mh3y+MeFWevy7V1evVhJWewmMbjDHIbZbOXICC2y+m1xI1UVfIT1HMW/O04Hxyu9oXQ==", + "dev": true, + "dependencies": { + "postcss": "^7.0.6", + "postcss-selector-parser": "^6.0.0" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/postcss-modules-values": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-3.0.0.tgz", + "integrity": "sha512-1//E5jCBrZ9DmRX+zCtmQtRSV6PV42Ix7Bzj9GbwJceduuf7IqP8MgeTXuRDHOWj2m0VzZD5+roFWDuU8RQjcg==", + "dev": true, + "dependencies": { + "icss-utils": "^4.0.0", + "postcss": "^7.0.6" + } + }, + "node_modules/postcss-selector-parser": { + "version": "6.0.6", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.6.tgz", + "integrity": "sha512-9LXrvaaX3+mcv5xkg5kFwqSzSH1JIObIx51PrndZwlmznwXRfxMddDvo9gve3gVR8ZTKgoFDdWkbRFmEhT4PMg==", + "dev": true, + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/postcss-value-parser": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz", + "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==", + "dev": true + }, + "node_modules/process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "dev": true, + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "node_modules/promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", + "dev": true + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dev": true, + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", + "dev": true + }, + "node_modules/public-encrypt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", + "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", + "dev": true, + "dependencies": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/public-encrypt/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + }, + "node_modules/pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/pumpify": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", + "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", + "dev": true, + "dependencies": { + "duplexify": "^3.6.0", + "inherits": "^2.0.3", + "pump": "^2.0.0" + } + }, + "node_modules/pumpify/node_modules/pump": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/qs": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", + "dev": true, + "engines": { + "node": ">=0.6" + } + }, + "node_modules/querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", + "deprecated": "The querystring API is considered Legacy. new code should use the URLSearchParams API instead.", + "dev": true, + "engines": { + "node": ">=0.4.x" + } + }, + "node_modules/querystring-es3": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", + "dev": true, + "engines": { + "node": ">=0.4.x" + } + }, + "node_modules/querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "dev": true + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "dev": true, + "dependencies": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", + "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", + "dev": true, + "dependencies": { + "bytes": "3.1.0", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/raw-body/node_modules/bytes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", + "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "optional": true, + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "dependencies": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/regexp.prototype.flags": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.3.1.tgz", + "integrity": "sha512-JiBdRBq91WlY7uRJ0ds7R+dU02i6LKi8r3BuQhNXn+kmeLN+EfHhfjqMRis1zJxnlu88hq/4dx0P2OP3APRTOA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "node_modules/repeat-element": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.4.tgz", + "integrity": "sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", + "dev": true + }, + "node_modules/resolve-cwd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", + "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", + "dev": true, + "dependencies": { + "resolve-from": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/resolve-dir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", + "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", + "dev": true, + "dependencies": { + "expand-tilde": "^2.0.0", + "global-modules": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve-dir/node_modules/global-modules": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", + "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", + "dev": true, + "dependencies": { + "global-prefix": "^1.0.1", + "is-windows": "^1.0.1", + "resolve-dir": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve-dir/node_modules/global-prefix": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", + "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", + "dev": true, + "dependencies": { + "expand-tilde": "^2.0.2", + "homedir-polyfill": "^1.0.1", + "ini": "^1.3.4", + "is-windows": "^1.0.1", + "which": "^1.2.14" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "deprecated": "https://github.com/lydell/resolve-url#deprecated", + "dev": true + }, + "node_modules/ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, + "node_modules/ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "node_modules/run-queue": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", + "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=", + "dev": true, + "dependencies": { + "aproba": "^1.1.1" + } + }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "dependencies": { + "ret": "~0.1.10" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "node_modules/schema-utils": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz", + "integrity": "sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.5", + "ajv": "^6.12.4", + "ajv-keywords": "^3.5.2" + }, + "engines": { + "node": ">= 8.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/select-hose": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz", + "integrity": "sha1-Yl2GWPhlr0Psliv8N2o3NZpJlMo=", + "dev": true + }, + "node_modules/selfsigned": { + "version": "1.10.11", + "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-1.10.11.tgz", + "integrity": "sha512-aVmbPOfViZqOZPgRBT0+3u4yZFHpmnIghLMlAcb5/xhp5ZtB/RVnKhz5vl2M32CLXAqR4kha9zfhNg0Lf/sxKA==", + "dev": true, + "dependencies": { + "node-forge": "^0.10.0" + } + }, + "node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/send": { + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", + "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", + "dev": true, + "dependencies": { + "debug": "2.6.9", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "~1.7.2", + "mime": "1.6.0", + "ms": "2.1.1", + "on-finished": "~2.3.0", + "range-parser": "~1.2.1", + "statuses": "~1.5.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/send/node_modules/debug/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + }, + "node_modules/serialize-javascript": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", + "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", + "dev": true, + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/serve-index": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz", + "integrity": "sha1-03aNabHn2C5c4FD/9bRTvqEqkjk=", + "dev": true, + "dependencies": { + "accepts": "~1.3.4", + "batch": "0.6.1", + "debug": "2.6.9", + "escape-html": "~1.0.3", + "http-errors": "~1.6.2", + "mime-types": "~2.1.17", + "parseurl": "~1.3.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/serve-index/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/serve-index/node_modules/http-errors": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", + "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", + "dev": true, + "dependencies": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.0", + "statuses": ">= 1.4.0 < 2" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/serve-index/node_modules/inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "node_modules/serve-index/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "node_modules/serve-index/node_modules/setprototypeof": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", + "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", + "dev": true + }, + "node_modules/serve-static": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", + "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", + "dev": true, + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.17.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "node_modules/set-value": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "dev": true, + "dependencies": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/set-value/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/set-value/node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", + "dev": true + }, + "node_modules/setprototypeof": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", + "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", + "dev": true + }, + "node_modules/sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dev": true, + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + }, + "bin": { + "sha.js": "bin.js" + } + }, + "node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "dependencies": { + "shebang-regex": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/signal-exit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "dev": true + }, + "node_modules/snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "dependencies": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "dependencies": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-node/node_modules/define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "dependencies": { + "is-descriptor": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "dependencies": { + "kind-of": "^3.2.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-util/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/snapdragon/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/is-accessor-descriptor/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/is-data-descriptor/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "node_modules/snapdragon/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sockjs": { + "version": "0.3.21", + "resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.21.tgz", + "integrity": "sha512-DhbPFGpxjc6Z3I+uX07Id5ZO2XwYsWOrYjaSeieES78cq+JaJvVe5q/m1uvjIQhXinhIeCFRH6JgXe+mvVMyXw==", + "dev": true, + "dependencies": { + "faye-websocket": "^0.11.3", + "uuid": "^3.4.0", + "websocket-driver": "^0.7.4" + } + }, + "node_modules/sockjs-client": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/sockjs-client/-/sockjs-client-1.5.1.tgz", + "integrity": "sha512-VnVAb663fosipI/m6pqRXakEOw7nvd7TUgdr3PlR/8V2I95QIdwT8L4nMxhyU8SmDBHYXU1TOElaKOmKLfYzeQ==", + "dev": true, + "dependencies": { + "debug": "^3.2.6", + "eventsource": "^1.0.7", + "faye-websocket": "^0.11.3", + "inherits": "^2.0.4", + "json3": "^3.3.3", + "url-parse": "^1.5.1" + } + }, + "node_modules/sockjs-client/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/source-list-map": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", + "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==", + "dev": true + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-resolve": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", + "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", + "dev": true, + "dependencies": { + "atob": "^2.1.2", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "dev": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/source-map-url": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz", + "integrity": "sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==", + "dev": true + }, + "node_modules/spdy": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/spdy/-/spdy-4.0.2.tgz", + "integrity": "sha512-r46gZQZQV+Kl9oItvl1JZZqJKGr+oEkB08A6BzkiR7593/7IbtuncXHd2YoYeTsG4157ZssMu9KYvUHLcjcDoA==", + "dev": true, + "dependencies": { + "debug": "^4.1.0", + "handle-thing": "^2.0.0", + "http-deceiver": "^1.2.7", + "select-hose": "^2.0.0", + "spdy-transport": "^3.0.0" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/spdy-transport": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdy-transport/-/spdy-transport-3.0.0.tgz", + "integrity": "sha512-hsLVFE5SjA6TCisWeJXFKniGGOpBgMLmerfO2aCyCU5s7nJ/rpAepqmFifv/GCbSbueEeAJJnmSQ2rKC/g8Fcw==", + "dev": true, + "dependencies": { + "debug": "^4.1.0", + "detect-node": "^2.0.4", + "hpack.js": "^2.1.6", + "obuf": "^1.1.2", + "readable-stream": "^3.0.6", + "wbuf": "^1.7.3" + } + }, + "node_modules/spdy-transport/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, + "dependencies": { + "extend-shallow": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ssri": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.2.tgz", + "integrity": "sha512-cepbSq/neFK7xB6A50KHN0xHDotYzq58wWCa5LeWqnPrHG8GzfEjO/4O8kpmcGW+oaxkvhEJCWgbgNk4/ZV93Q==", + "dev": true, + "dependencies": { + "figgy-pudding": "^3.5.1" + } + }, + "node_modules/static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "dependencies": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/static-extend/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/static-extend/node_modules/is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/static-extend/node_modules/is-accessor-descriptor/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/static-extend/node_modules/is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/static-extend/node_modules/is-data-descriptor/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/static-extend/node_modules/is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/static-extend/node_modules/kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/stream-browserify": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", + "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==", + "dev": true, + "dependencies": { + "inherits": "~2.0.1", + "readable-stream": "^2.0.2" + } + }, + "node_modules/stream-each": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz", + "integrity": "sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "stream-shift": "^1.0.0" + } + }, + "node_modules/stream-http": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", + "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", + "dev": true, + "dependencies": { + "builtin-status-codes": "^3.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.3.6", + "to-arraybuffer": "^1.0.0", + "xtend": "^4.0.0" + } + }, + "node_modules/stream-shift": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", + "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", + "dev": true + }, + "node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "dependencies": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/string-width/node_modules/ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/string-width/node_modules/strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/style-loader": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-1.3.0.tgz", + "integrity": "sha512-V7TCORko8rs9rIqkSrlMfkqA63DfoGBBJmK1kKGCcSi+BWb4cqz0SRsnp4l6rU5iwOEd0/2ePv68SV22VXon4Q==", + "dev": true, + "dependencies": { + "loader-utils": "^2.0.0", + "schema-utils": "^2.7.0" + }, + "engines": { + "node": ">= 8.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^4.0.0 || ^5.0.0" + } + }, + "node_modules/style-loader/node_modules/json5": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", + "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", + "dev": true, + "dependencies": { + "minimist": "^1.2.5" + }, + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/style-loader/node_modules/loader-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz", + "integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==", + "dev": true, + "dependencies": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + }, + "engines": { + "node": ">=8.9.0" + } + }, + "node_modules/supports-color": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", + "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/sweetalert2": { + "version": "9.17.2", + "resolved": "https://registry.npmjs.org/sweetalert2/-/sweetalert2-9.17.2.tgz", + "integrity": "sha512-HkpPZVMYsnhFUBLdy/LvkU9snggKP3VAuSVnPhVXjxdg02lWbFx0W8H3m7A+WMWw2diXZS1wIa4m67XkNxdvew==", + "funding": { + "url": "https://sweetalert2.github.io/#donations" + } + }, + "node_modules/tapable": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", + "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/terser": { + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.0.tgz", + "integrity": "sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw==", + "dev": true, + "dependencies": { + "commander": "^2.20.0", + "source-map": "~0.6.1", + "source-map-support": "~0.5.12" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/terser-webpack-plugin": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.5.tgz", + "integrity": "sha512-04Rfe496lN8EYruwi6oPQkG0vo8C+HT49X687FZnpPF0qMAIHONI6HEXYPKDOE8e5HjXTyKfqRd/agHtH0kOtw==", + "dev": true, + "dependencies": { + "cacache": "^12.0.2", + "find-cache-dir": "^2.1.0", + "is-wsl": "^1.1.0", + "schema-utils": "^1.0.0", + "serialize-javascript": "^4.0.0", + "source-map": "^0.6.1", + "terser": "^4.1.2", + "webpack-sources": "^1.4.0", + "worker-farm": "^1.7.0" + }, + "engines": { + "node": ">= 6.9.0" + }, + "peerDependencies": { + "webpack": "^4.0.0" + } + }, + "node_modules/terser-webpack-plugin/node_modules/schema-utils": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", + "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", + "dev": true, + "dependencies": { + "ajv": "^6.1.0", + "ajv-errors": "^1.0.0", + "ajv-keywords": "^3.1.0" + }, + "engines": { + "node": ">= 4" + } + }, + "node_modules/three": { + "version": "0.113.0", + "resolved": "https://registry.npmjs.org/three/-/three-0.113.0.tgz", + "integrity": "sha512-H1IuGiyyBciP+L8fM5WCgXSm/nYbLr+tGgY9WWu7PPBxDxki/XJovC/Hz5JI/V7d6kx+1R/8zXWEmsIotLH/aA==" + }, + "node_modules/three-csm": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/three-csm/-/three-csm-1.0.2.tgz", + "integrity": "sha512-i8FHWBba/3NUiHgu1Vsptqi/whvsq++UMpVmB5ZjKNXmtkclD6yCm4Vk9V5GF90rHaTa7ZC1SN7+awWBRy8LFQ==" + }, + "node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/thunky": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/thunky/-/thunky-1.1.0.tgz", + "integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==", + "dev": true + }, + "node_modules/timers-browserify": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.12.tgz", + "integrity": "sha512-9phl76Cqm6FhSX9Xe1ZUAMLtm1BLkKj2Qd5ApyWkXzsMRaA7dgr81kf4wJmQf/hAvg8EEyJxDo3du/0KlhPiKQ==", + "dev": true, + "dependencies": { + "setimmediate": "^1.0.4" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/to-arraybuffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", + "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", + "dev": true + }, + "node_modules/to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/to-object-path/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "dependencies": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", + "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", + "dev": true, + "engines": { + "node": ">=0.6" + } + }, + "node_modules/ts-loader": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-6.2.2.tgz", + "integrity": "sha512-HDo5kXZCBml3EUPcc7RlZOV/JGlLHwppTLEHb3SHnr5V7NXD4klMEkrhJe5wgRbaWsSXi+Y1SIBN/K9B6zWGWQ==", + "dev": true, + "dependencies": { + "chalk": "^2.3.0", + "enhanced-resolve": "^4.0.0", + "loader-utils": "^1.0.2", + "micromatch": "^4.0.0", + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8.6" + }, + "peerDependencies": { + "typescript": "*" + } + }, + "node_modules/tty-browserify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", + "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", + "dev": true + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dev": true, + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "node_modules/typescript": { + "version": "3.9.10", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", + "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/union-value": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "dev": true, + "dependencies": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/union-value/node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unique-filename": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", + "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", + "dev": true, + "dependencies": { + "unique-slug": "^2.0.0" + } + }, + "node_modules/unique-slug": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", + "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", + "dev": true, + "dependencies": { + "imurmurhash": "^0.1.4" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "dependencies": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unset-value/node_modules/has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "dependencies": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unset-value/node_modules/has-value/node_modules/isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "dependencies": { + "isarray": "1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unset-value/node_modules/has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/upath": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", + "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", + "dev": true, + "engines": { + "node": ">=4", + "yarn": "*" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "deprecated": "Please see https://github.com/lydell/urix#deprecated", + "dev": true + }, + "node_modules/url": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", + "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", + "dev": true, + "dependencies": { + "punycode": "1.3.2", + "querystring": "0.2.0" + } + }, + "node_modules/url-parse": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.3.tgz", + "integrity": "sha512-IIORyIQD9rvj0A4CLWsHkBBJuNqWpFQe224b6j9t/ABmquIS0qDU2pY6kl6AuOrL5OkCXHMCFNe1jBcuAggjvQ==", + "dev": true, + "dependencies": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, + "node_modules/url/node_modules/punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", + "dev": true + }, + "node_modules/use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/util": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", + "integrity": "sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ==", + "dev": true, + "dependencies": { + "inherits": "2.0.3" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "node_modules/util/node_modules/inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", + "dev": true, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", + "dev": true, + "bin": { + "uuid": "bin/uuid" + } + }, + "node_modules/v8-compile-cache": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", + "dev": true + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/vm-browserify": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", + "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==", + "dev": true + }, + "node_modules/watchpack": { + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.5.tgz", + "integrity": "sha512-9P3MWk6SrKjHsGkLT2KHXdQ/9SNkyoJbabxnKOoJepsvJjJG8uYTR3yTPxPQvNDI3w4Nz1xnE0TLHK4RIVe/MQ==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "neo-async": "^2.5.0" + }, + "optionalDependencies": { + "chokidar": "^3.4.1", + "watchpack-chokidar2": "^2.0.1" + } + }, + "node_modules/watchpack-chokidar2": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/watchpack-chokidar2/-/watchpack-chokidar2-2.0.1.tgz", + "integrity": "sha512-nCFfBIPKr5Sh61s4LPpy1Wtfi0HE8isJ3d2Yb5/Ppw2P2B/3eVSEBjKfN0fmHJSK14+31KwMKmcrzs2GM4P0Ww==", + "dev": true, + "optional": true, + "dependencies": { + "chokidar": "^2.1.8" + } + }, + "node_modules/watchpack-chokidar2/node_modules/anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "dev": true, + "optional": true, + "dependencies": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + } + }, + "node_modules/watchpack-chokidar2/node_modules/anymatch/node_modules/normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "optional": true, + "dependencies": { + "remove-trailing-separator": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack-chokidar2/node_modules/binary-extensions": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack-chokidar2/node_modules/braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "optional": true, + "dependencies": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack-chokidar2/node_modules/braces/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "optional": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack-chokidar2/node_modules/chokidar": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", + "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", + "deprecated": "Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.", + "dev": true, + "optional": true, + "dependencies": { + "anymatch": "^2.0.0", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "glob-parent": "^3.1.0", + "inherits": "^2.0.3", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^3.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.2.1", + "upath": "^1.1.1" + }, + "optionalDependencies": { + "fsevents": "^1.2.7" + } + }, + "node_modules/watchpack-chokidar2/node_modules/fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "optional": true, + "dependencies": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack-chokidar2/node_modules/fill-range/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "optional": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack-chokidar2/node_modules/fsevents": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", + "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", + "deprecated": "fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "dependencies": { + "bindings": "^1.5.0", + "nan": "^2.12.1" + }, + "engines": { + "node": ">= 4.0" + } + }, + "node_modules/watchpack-chokidar2/node_modules/glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "optional": true, + "dependencies": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + } + }, + "node_modules/watchpack-chokidar2/node_modules/glob-parent/node_modules/is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "optional": true, + "dependencies": { + "is-extglob": "^2.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack-chokidar2/node_modules/is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "optional": true, + "dependencies": { + "binary-extensions": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack-chokidar2/node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack-chokidar2/node_modules/is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "optional": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack-chokidar2/node_modules/is-number/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "optional": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack-chokidar2/node_modules/micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "optional": true, + "dependencies": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack-chokidar2/node_modules/readdirp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "dev": true, + "optional": true, + "dependencies": { + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/watchpack-chokidar2/node_modules/to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "optional": true, + "dependencies": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wbuf": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/wbuf/-/wbuf-1.7.3.tgz", + "integrity": "sha512-O84QOnr0icsbFGLS0O3bI5FswxzRr8/gHwWkDlQFskhSPryQXvrTMxjxGP4+iWYoauLoBvfDpkrOauZ+0iZpDA==", + "dev": true, + "dependencies": { + "minimalistic-assert": "^1.0.0" + } + }, + "node_modules/webpack": { + "version": "4.46.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.46.0.tgz", + "integrity": "sha512-6jJuJjg8znb/xRItk7bkT0+Q7AHCYjjFnvKIWQPkNIOyRqoCGvkOs0ipeQzrqz4l5FtN5ZI/ukEHroeX/o1/5Q==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-module-context": "1.9.0", + "@webassemblyjs/wasm-edit": "1.9.0", + "@webassemblyjs/wasm-parser": "1.9.0", + "acorn": "^6.4.1", + "ajv": "^6.10.2", + "ajv-keywords": "^3.4.1", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^4.5.0", + "eslint-scope": "^4.0.3", + "json-parse-better-errors": "^1.0.2", + "loader-runner": "^2.4.0", + "loader-utils": "^1.2.3", + "memory-fs": "^0.4.1", + "micromatch": "^3.1.10", + "mkdirp": "^0.5.3", + "neo-async": "^2.6.1", + "node-libs-browser": "^2.2.1", + "schema-utils": "^1.0.0", + "tapable": "^1.1.3", + "terser-webpack-plugin": "^1.4.3", + "watchpack": "^1.7.4", + "webpack-sources": "^1.4.1" + }, + "bin": { + "webpack": "bin/webpack.js" + }, + "engines": { + "node": ">=6.11.5" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependenciesMeta": { + "webpack-cli": { + "optional": true + }, + "webpack-command": { + "optional": true + } + } + }, + "node_modules/webpack-cli": { + "version": "3.3.12", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-3.3.12.tgz", + "integrity": "sha512-NVWBaz9k839ZH/sinurM+HcDvJOTXwSjYp1ku+5XKeOC03z8v5QitnK/x+lAxGXFyhdayoIf/GOpv85z3/xPag==", + "dev": true, + "dependencies": { + "chalk": "^2.4.2", + "cross-spawn": "^6.0.5", + "enhanced-resolve": "^4.1.1", + "findup-sync": "^3.0.0", + "global-modules": "^2.0.0", + "import-local": "^2.0.0", + "interpret": "^1.4.0", + "loader-utils": "^1.4.0", + "supports-color": "^6.1.0", + "v8-compile-cache": "^2.1.1", + "yargs": "^13.3.2" + }, + "bin": { + "webpack-cli": "bin/cli.js" + }, + "engines": { + "node": ">=6.11.5" + }, + "peerDependencies": { + "webpack": "4.x.x" + } + }, + "node_modules/webpack-dev-server": { + "version": "3.11.2", + "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-3.11.2.tgz", + "integrity": "sha512-A80BkuHRQfCiNtGBS1EMf2ChTUs0x+B3wGDFmOeT4rmJOHhHTCH2naNxIHhmkr0/UillP4U3yeIyv1pNp+QDLQ==", + "dev": true, + "dependencies": { + "ansi-html": "0.0.7", + "bonjour": "^3.5.0", + "chokidar": "^2.1.8", + "compression": "^1.7.4", + "connect-history-api-fallback": "^1.6.0", + "debug": "^4.1.1", + "del": "^4.1.1", + "express": "^4.17.1", + "html-entities": "^1.3.1", + "http-proxy-middleware": "0.19.1", + "import-local": "^2.0.0", + "internal-ip": "^4.3.0", + "ip": "^1.1.5", + "is-absolute-url": "^3.0.3", + "killable": "^1.0.1", + "loglevel": "^1.6.8", + "opn": "^5.5.0", + "p-retry": "^3.0.1", + "portfinder": "^1.0.26", + "schema-utils": "^1.0.0", + "selfsigned": "^1.10.8", + "semver": "^6.3.0", + "serve-index": "^1.9.1", + "sockjs": "^0.3.21", + "sockjs-client": "^1.5.0", + "spdy": "^4.0.2", + "strip-ansi": "^3.0.1", + "supports-color": "^6.1.0", + "url": "^0.11.0", + "webpack-dev-middleware": "^3.7.2", + "webpack-log": "^2.0.0", + "ws": "^6.2.1", + "yargs": "^13.3.2" + }, + "bin": { + "webpack-dev-server": "bin/webpack-dev-server.js" + }, + "engines": { + "node": ">= 6.11.5" + }, + "peerDependencies": { + "webpack": "^4.0.0 || ^5.0.0" + }, + "peerDependenciesMeta": { + "webpack-cli": { + "optional": true + } + } + }, + "node_modules/webpack-dev-server/node_modules/anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "dev": true, + "dependencies": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + } + }, + "node_modules/webpack-dev-server/node_modules/anymatch/node_modules/normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "dependencies": { + "remove-trailing-separator": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack-dev-server/node_modules/binary-extensions": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack-dev-server/node_modules/braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "dependencies": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack-dev-server/node_modules/braces/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack-dev-server/node_modules/chokidar": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", + "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", + "deprecated": "Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.", + "dev": true, + "dependencies": { + "anymatch": "^2.0.0", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "glob-parent": "^3.1.0", + "inherits": "^2.0.3", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^3.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.2.1", + "upath": "^1.1.1" + }, + "optionalDependencies": { + "fsevents": "^1.2.7" + } + }, + "node_modules/webpack-dev-server/node_modules/fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "dependencies": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack-dev-server/node_modules/fill-range/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack-dev-server/node_modules/fsevents": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", + "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", + "deprecated": "fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "dependencies": { + "bindings": "^1.5.0", + "nan": "^2.12.1" + }, + "engines": { + "node": ">= 4.0" + } + }, + "node_modules/webpack-dev-server/node_modules/glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "dependencies": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + } + }, + "node_modules/webpack-dev-server/node_modules/glob-parent/node_modules/is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack-dev-server/node_modules/is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "dependencies": { + "binary-extensions": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack-dev-server/node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack-dev-server/node_modules/is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack-dev-server/node_modules/is-number/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack-dev-server/node_modules/memory-fs": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", + "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", + "dev": true, + "dependencies": { + "errno": "^0.1.3", + "readable-stream": "^2.0.1" + } + }, + "node_modules/webpack-dev-server/node_modules/micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "dependencies": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack-dev-server/node_modules/mime": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.5.2.tgz", + "integrity": "sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg==", + "dev": true, + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/webpack-dev-server/node_modules/readdirp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/webpack-dev-server/node_modules/schema-utils": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", + "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", + "dev": true, + "dependencies": { + "ajv": "^6.1.0", + "ajv-errors": "^1.0.0", + "ajv-keywords": "^3.1.0" + }, + "engines": { + "node": ">= 4" + } + }, + "node_modules/webpack-dev-server/node_modules/to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "dependencies": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack-dev-server/node_modules/webpack-dev-middleware": { + "version": "3.7.3", + "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-3.7.3.tgz", + "integrity": "sha512-djelc/zGiz9nZj/U7PTBi2ViorGJXEWo/3ltkPbDyxCXhhEXkW0ce99falaok4TPj+AsxLiXJR0EBOb0zh9fKQ==", + "dev": true, + "dependencies": { + "memory-fs": "^0.4.1", + "mime": "^2.4.4", + "mkdirp": "^0.5.1", + "range-parser": "^1.2.1", + "webpack-log": "^2.0.0" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "webpack": "^4.0.0 || ^5.0.0" + } + }, + "node_modules/webpack-log": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/webpack-log/-/webpack-log-2.0.0.tgz", + "integrity": "sha512-cX8G2vR/85UYG59FgkoMamwHUIkSSlV3bBMRsbxVXVUk2j6NleCKjQ/WE9eYg9WY4w25O9w8wKP4rzNZFmUcUg==", + "dev": true, + "dependencies": { + "ansi-colors": "^3.0.0", + "uuid": "^3.3.2" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/webpack-merge": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-4.2.2.tgz", + "integrity": "sha512-TUE1UGoTX2Cd42j3krGYqObZbOD+xF7u28WB7tfUordytSjbWTIjK/8V0amkBfTYN4/pB/GIDlJZZ657BGG19g==", + "dev": true, + "dependencies": { + "lodash": "^4.17.15" + } + }, + "node_modules/webpack-sources": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz", + "integrity": "sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==", + "dev": true, + "dependencies": { + "source-list-map": "^2.0.0", + "source-map": "~0.6.1" + } + }, + "node_modules/webpack/node_modules/braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "dependencies": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack/node_modules/braces/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack/node_modules/fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "dependencies": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack/node_modules/fill-range/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack/node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack/node_modules/is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack/node_modules/is-number/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack/node_modules/memory-fs": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", + "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", + "dev": true, + "dependencies": { + "errno": "^0.1.3", + "readable-stream": "^2.0.1" + } + }, + "node_modules/webpack/node_modules/micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "dependencies": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/webpack/node_modules/schema-utils": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", + "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", + "dev": true, + "dependencies": { + "ajv": "^6.1.0", + "ajv-errors": "^1.0.0", + "ajv-keywords": "^3.1.0" + }, + "engines": { + "node": ">= 4" + } + }, + "node_modules/webpack/node_modules/to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "dependencies": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/websocket-driver": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz", + "integrity": "sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg==", + "dev": true, + "dependencies": { + "http-parser-js": ">=0.5.1", + "safe-buffer": ">=5.1.0", + "websocket-extensions": ">=0.1.1" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/websocket-extensions": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.4.tgz", + "integrity": "sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "node_modules/worker-farm": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.7.0.tgz", + "integrity": "sha512-rvw3QTZc8lAxyVrqcSGVm5yP/IJ2UcB3U0graE3LCFoZ0Yn2x4EoVSqJKdB/T5M+FLcRPjz4TDacRf3OCfNUzw==", + "dev": true, + "dependencies": { + "errno": "~0.1.7" + } + }, + "node_modules/wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/wrap-ansi/node_modules/strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "node_modules/ws": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.2.tgz", + "integrity": "sha512-zmhltoSR8u1cnDsD43TX59mzoMZsLKqUweyYBAIvTngR3shc0W6aOZylZmq/7hqyVxPdi+5Ud2QInblgyE72fw==", + "dev": true, + "dependencies": { + "async-limiter": "~1.0.0" + } + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true, + "engines": { + "node": ">=0.4" + } + }, + "node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "dev": true + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + }, + "node_modules/yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "dev": true, + "dependencies": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" + } + }, + "node_modules/yargs-parser": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "dev": true, + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + }, + "dependencies": { + "@types/glob": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-w+LsMxKyYQm347Otw+IfBXOv9UWVjpHpCDdbBMt8Kz/xbvCYNjP+0qPh91Km3iKfSRLBB0P7fAMf0KHrPu+MyA==", + "dev": true, + "requires": { + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "@types/jquery": { + "version": "3.5.6", + "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.6.tgz", + "integrity": "sha512-SmgCQRzGPId4MZQKDj9Hqc6kSXFNWZFHpELkyK8AQhf8Zr6HKfCzFv9ZC1Fv3FyQttJZOlap3qYb12h61iZAIg==", + "dev": true, + "requires": { + "@types/sizzle": "*" + } + }, + "@types/json-schema": { + "version": "7.0.8", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.8.tgz", + "integrity": "sha512-YSBPTLTVm2e2OoQIDYx8HaeWJ5tTToLH67kXR7zYNGupXMEHa2++G8k+DczX2cFVgalypqtyZIcU19AFcmOpmg==", + "dev": true + }, + "@types/lodash": { + "version": "4.14.171", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.171.tgz", + "integrity": "sha512-7eQ2xYLLI/LsicL2nejW9Wyko3lcpN6O/z0ZLHrEQsg280zIdCv1t/0m6UtBjUHokCGBQ3gYTbHzDkZ1xOBwwg==", + "dev": true + }, + "@types/minimatch": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz", + "integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==", + "dev": true + }, + "@types/node": { + "version": "16.4.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.4.9.tgz", + "integrity": "sha512-HXhRf581nCItzn8yevv4LYt+bJ5cBbDBAJExbDPMeU/2n5/j0ZemGpayahFBP4xL7RseaCLASLD9i9AYyDe7Nw==", + "dev": true + }, + "@types/sizzle": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.3.tgz", + "integrity": "sha512-JYM8x9EGF163bEyhdJBpR2QX1R5naCJHC8ucJylJ3w9/CVBaskdQ8WqBf8MmQrd1kRvp/a4TS8HJ+bxzR7ZJYQ==", + "dev": true + }, + "@webassemblyjs/ast": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.9.0.tgz", + "integrity": "sha512-C6wW5L+b7ogSDVqymbkkvuW9kruN//YisMED04xzeBBqjHa2FYnmvOlS6Xj68xWQRgWvI9cIglsjFowH/RJyEA==", + "dev": true, + "requires": { + "@webassemblyjs/helper-module-context": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/wast-parser": "1.9.0" + } + }, + "@webassemblyjs/floating-point-hex-parser": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.9.0.tgz", + "integrity": "sha512-TG5qcFsS8QB4g4MhrxK5TqfdNe7Ey/7YL/xN+36rRjl/BlGE/NcBvJcqsRgCP6Z92mRE+7N50pRIi8SmKUbcQA==", + "dev": true + }, + "@webassemblyjs/helper-api-error": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.9.0.tgz", + "integrity": "sha512-NcMLjoFMXpsASZFxJ5h2HZRcEhDkvnNFOAKneP5RbKRzaWJN36NC4jqQHKwStIhGXu5mUWlUUk7ygdtrO8lbmw==", + "dev": true + }, + "@webassemblyjs/helper-buffer": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.9.0.tgz", + "integrity": "sha512-qZol43oqhq6yBPx7YM3m9Bv7WMV9Eevj6kMi6InKOuZxhw+q9hOkvq5e/PpKSiLfyetpaBnogSbNCfBwyB00CA==", + "dev": true + }, + "@webassemblyjs/helper-code-frame": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.9.0.tgz", + "integrity": "sha512-ERCYdJBkD9Vu4vtjUYe8LZruWuNIToYq/ME22igL+2vj2dQ2OOujIZr3MEFvfEaqKoVqpsFKAGsRdBSBjrIvZA==", + "dev": true, + "requires": { + "@webassemblyjs/wast-printer": "1.9.0" + } + }, + "@webassemblyjs/helper-fsm": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-fsm/-/helper-fsm-1.9.0.tgz", + "integrity": "sha512-OPRowhGbshCb5PxJ8LocpdX9Kl0uB4XsAjl6jH/dWKlk/mzsANvhwbiULsaiqT5GZGT9qinTICdj6PLuM5gslw==", + "dev": true + }, + "@webassemblyjs/helper-module-context": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-module-context/-/helper-module-context-1.9.0.tgz", + "integrity": "sha512-MJCW8iGC08tMk2enck1aPW+BE5Cw8/7ph/VGZxwyvGbJwjktKkDK7vy7gAmMDx88D7mhDTCNKAW5tED+gZ0W8g==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0" + } + }, + "@webassemblyjs/helper-wasm-bytecode": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.9.0.tgz", + "integrity": "sha512-R7FStIzyNcd7xKxCZH5lE0Bqy+hGTwS3LJjuv1ZVxd9O7eHCedSdrId/hMOd20I+v8wDXEn+bjfKDLzTepoaUw==", + "dev": true + }, + "@webassemblyjs/helper-wasm-section": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.9.0.tgz", + "integrity": "sha512-XnMB8l3ek4tvrKUUku+IVaXNHz2YsJyOOmz+MMkZvh8h1uSJpSen6vYnw3IoQ7WwEuAhL8Efjms1ZWjqh2agvw==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-buffer": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/wasm-gen": "1.9.0" + } + }, + "@webassemblyjs/ieee754": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.9.0.tgz", + "integrity": "sha512-dcX8JuYU/gvymzIHc9DgxTzUUTLexWwt8uCTWP3otys596io0L5aW02Gb1RjYpx2+0Jus1h4ZFqjla7umFniTg==", + "dev": true, + "requires": { + "@xtuc/ieee754": "^1.2.0" + } + }, + "@webassemblyjs/leb128": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.9.0.tgz", + "integrity": "sha512-ENVzM5VwV1ojs9jam6vPys97B/S65YQtv/aanqnU7D8aSoHFX8GyhGg0CMfyKNIHBuAVjy3tlzd5QMMINa7wpw==", + "dev": true, + "requires": { + "@xtuc/long": "4.2.2" + } + }, + "@webassemblyjs/utf8": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.9.0.tgz", + "integrity": "sha512-GZbQlWtopBTP0u7cHrEx+73yZKrQoBMpwkGEIqlacljhXCkVM1kMQge/Mf+csMJAjEdSwhOyLAS0AoR3AG5P8w==", + "dev": true + }, + "@webassemblyjs/wasm-edit": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.9.0.tgz", + "integrity": "sha512-FgHzBm80uwz5M8WKnMTn6j/sVbqilPdQXTWraSjBwFXSYGirpkSWE2R9Qvz9tNiTKQvoKILpCuTjBKzOIm0nxw==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-buffer": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/helper-wasm-section": "1.9.0", + "@webassemblyjs/wasm-gen": "1.9.0", + "@webassemblyjs/wasm-opt": "1.9.0", + "@webassemblyjs/wasm-parser": "1.9.0", + "@webassemblyjs/wast-printer": "1.9.0" + } + }, + "@webassemblyjs/wasm-gen": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.9.0.tgz", + "integrity": "sha512-cPE3o44YzOOHvlsb4+E9qSqjc9Qf9Na1OO/BHFy4OI91XDE14MjFN4lTMezzaIWdPqHnsTodGGNP+iRSYfGkjA==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/ieee754": "1.9.0", + "@webassemblyjs/leb128": "1.9.0", + "@webassemblyjs/utf8": "1.9.0" + } + }, + "@webassemblyjs/wasm-opt": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.9.0.tgz", + "integrity": "sha512-Qkjgm6Anhm+OMbIL0iokO7meajkzQD71ioelnfPEj6r4eOFuqm4YC3VBPqXjFyyNwowzbMD+hizmprP/Fwkl2A==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-buffer": "1.9.0", + "@webassemblyjs/wasm-gen": "1.9.0", + "@webassemblyjs/wasm-parser": "1.9.0" + } + }, + "@webassemblyjs/wasm-parser": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.9.0.tgz", + "integrity": "sha512-9+wkMowR2AmdSWQzsPEjFU7njh8HTO5MqO8vjwEHuM+AMHioNqSBONRdr0NQQ3dVQrzp0s8lTcYqzUdb7YgELA==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-api-error": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/ieee754": "1.9.0", + "@webassemblyjs/leb128": "1.9.0", + "@webassemblyjs/utf8": "1.9.0" + } + }, + "@webassemblyjs/wast-parser": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-parser/-/wast-parser-1.9.0.tgz", + "integrity": "sha512-qsqSAP3QQ3LyZjNC/0jBJ/ToSxfYJ8kYyuiGvtn/8MK89VrNEfwj7BPQzJVHi0jGTRK2dGdJ5PRqhtjzoww+bw==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/floating-point-hex-parser": "1.9.0", + "@webassemblyjs/helper-api-error": "1.9.0", + "@webassemblyjs/helper-code-frame": "1.9.0", + "@webassemblyjs/helper-fsm": "1.9.0", + "@xtuc/long": "4.2.2" + } + }, + "@webassemblyjs/wast-printer": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.9.0.tgz", + "integrity": "sha512-2J0nE95rHXHyQ24cWjMKJ1tqB/ds8z/cyeOZxJhcb+rW+SQASVjuznUSmdz5GpVJTzU8JkhYut0D3siFDD6wsA==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/wast-parser": "1.9.0", + "@xtuc/long": "4.2.2" + } + }, + "@xtuc/ieee754": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", + "dev": true + }, + "@xtuc/long": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "dev": true + }, + "accepts": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", + "dev": true, + "requires": { + "mime-types": "~2.1.24", + "negotiator": "0.6.2" + } + }, + "acorn": { + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", + "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", + "dev": true + }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ajv-errors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.1.tgz", + "integrity": "sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==", + "dev": true, + "requires": {} + }, + "ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true, + "requires": {} + }, + "ansi-colors": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.4.tgz", + "integrity": "sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA==", + "dev": true + }, + "ansi-html": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/ansi-html/-/ansi-html-0.0.7.tgz", + "integrity": "sha1-gTWEAhliqenm/QOflA0S9WynhZ4=", + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "dev": true, + "optional": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "dev": true + }, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true + }, + "array-flatten": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-2.1.2.tgz", + "integrity": "sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ==", + "dev": true + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "requires": { + "array-uniq": "^1.0.1" + } + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, + "asn1.js": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", + "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", + "dev": true, + "requires": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "safer-buffer": "^2.1.0" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + } + } + }, + "assert": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz", + "integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==", + "dev": true, + "requires": { + "object-assign": "^4.1.1", + "util": "0.10.3" + }, + "dependencies": { + "inherits": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", + "dev": true + }, + "util": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "dev": true, + "requires": { + "inherits": "2.0.1" + } + } + } + }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true + }, + "async": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", + "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "dev": true, + "requires": { + "lodash": "^4.17.14" + } + }, + "async-each": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", + "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", + "dev": true + }, + "async-limiter": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", + "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==", + "dev": true + }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + } + } + }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true + }, + "batch": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", + "integrity": "sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY=", + "dev": true + }, + "big.js": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", + "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", + "dev": true + }, + "binary-extensions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "dev": true, + "optional": true + }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "dev": true, + "optional": true, + "requires": { + "file-uri-to-path": "1.0.0" + } + }, + "bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", + "dev": true + }, + "bn.js": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", + "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==", + "dev": true + }, + "body-parser": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", + "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", + "dev": true, + "requires": { + "bytes": "3.1.0", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "~1.1.2", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "on-finished": "~2.3.0", + "qs": "6.7.0", + "raw-body": "2.4.0", + "type-is": "~1.6.17" + }, + "dependencies": { + "bytes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", + "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", + "dev": true + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "bonjour": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/bonjour/-/bonjour-3.5.0.tgz", + "integrity": "sha1-jokKGD2O6aI5OzhExpGkK897yfU=", + "dev": true, + "requires": { + "array-flatten": "^2.1.0", + "deep-equal": "^1.0.1", + "dns-equal": "^1.0.0", + "dns-txt": "^2.0.2", + "multicast-dns": "^6.0.1", + "multicast-dns-service-types": "^1.1.0" + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "dev": true + }, + "browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dev": true, + "requires": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "dev": true, + "requires": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "browserify-des": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", + "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "browserify-rsa": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz", + "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==", + "dev": true, + "requires": { + "bn.js": "^5.0.0", + "randombytes": "^2.0.1" + } + }, + "browserify-sign": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", + "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", + "dev": true, + "requires": { + "bn.js": "^5.1.1", + "browserify-rsa": "^4.0.1", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "elliptic": "^6.5.3", + "inherits": "^2.0.4", + "parse-asn1": "^5.1.5", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + } + } + }, + "browserify-zlib": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "dev": true, + "requires": { + "pako": "~1.0.5" + } + }, + "buffer": { + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", + "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==", + "dev": true, + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4", + "isarray": "^1.0.0" + } + }, + "buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "buffer-indexof": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-indexof/-/buffer-indexof-1.1.1.tgz", + "integrity": "sha512-4/rOEg86jivtPTeOUUT61jJO1Ya1TrR/OkqCSZDyq84WJh3LuuiphBYJN+fm5xufIk4XAFcEwte/8WzC8If/1g==", + "dev": true + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", + "dev": true + }, + "builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", + "dev": true + }, + "bytes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", + "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=", + "dev": true + }, + "cacache": { + "version": "12.0.4", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.4.tgz", + "integrity": "sha512-a0tMB40oefvuInr4Cwb3GerbL9xTj1D5yg0T5xrjGCGyfvbxseIXX7BAO/u/hIXdafzOI5JC3wDwHyf24buOAQ==", + "dev": true, + "requires": { + "bluebird": "^3.5.5", + "chownr": "^1.1.1", + "figgy-pudding": "^3.5.1", + "glob": "^7.1.4", + "graceful-fs": "^4.1.15", + "infer-owner": "^1.0.3", + "lru-cache": "^5.1.1", + "mississippi": "^3.0.0", + "mkdirp": "^0.5.1", + "move-concurrently": "^1.0.1", + "promise-inflight": "^1.0.1", + "rimraf": "^2.6.3", + "ssri": "^6.0.1", + "unique-filename": "^1.1.1", + "y18n": "^4.0.0" + } + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + } + }, + "call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + } + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "dependencies": { + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "chokidar": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", + "integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==", + "dev": true, + "optional": true, + "requires": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "fsevents": "~2.3.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + } + }, + "chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "dev": true + }, + "chrome-trace-event": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", + "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", + "dev": true + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + } + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "dev": true, + "requires": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "dev": true + }, + "compressible": { + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", + "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==", + "dev": true, + "requires": { + "mime-db": ">= 1.43.0 < 2" + } + }, + "compression": { + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.4.tgz", + "integrity": "sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==", + "dev": true, + "requires": { + "accepts": "~1.3.5", + "bytes": "3.0.0", + "compressible": "~2.0.16", + "debug": "2.6.9", + "on-headers": "~1.0.2", + "safe-buffer": "5.1.2", + "vary": "~1.1.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "connect-history-api-fallback": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz", + "integrity": "sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg==", + "dev": true + }, + "console-browserify": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz", + "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==", + "dev": true + }, + "constants-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", + "dev": true + }, + "content-disposition": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", + "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", + "dev": true, + "requires": { + "safe-buffer": "5.1.2" + } + }, + "content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", + "dev": true + }, + "cookie": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", + "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==", + "dev": true + }, + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=", + "dev": true + }, + "copy-concurrently": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz", + "integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==", + "dev": true, + "requires": { + "aproba": "^1.1.1", + "fs-write-stream-atomic": "^1.0.8", + "iferr": "^0.1.5", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4", + "run-queue": "^1.0.0" + } + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "create-ecdh": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz", + "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "elliptic": "^6.5.3" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + } + } + }, + "create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, + "requires": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "dev": true, + "requires": { + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + } + }, + "css-loader": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-3.6.0.tgz", + "integrity": "sha512-M5lSukoWi1If8dhQAUCvj4H8vUt3vOnwbQBH9DdTm/s4Ym2B/3dPMtYZeJmq7Q3S3Pa+I94DcZ7pc9bP14cWIQ==", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "cssesc": "^3.0.0", + "icss-utils": "^4.1.1", + "loader-utils": "^1.2.3", + "normalize-path": "^3.0.0", + "postcss": "^7.0.32", + "postcss-modules-extract-imports": "^2.0.0", + "postcss-modules-local-by-default": "^3.0.2", + "postcss-modules-scope": "^2.2.0", + "postcss-modules-values": "^3.0.0", + "postcss-value-parser": "^4.1.0", + "schema-utils": "^2.7.0", + "semver": "^6.3.0" + } + }, + "cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "dev": true + }, + "cyclist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", + "integrity": "sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=", + "dev": true + }, + "debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true + }, + "deep-equal": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz", + "integrity": "sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==", + "dev": true, + "requires": { + "is-arguments": "^1.0.4", + "is-date-object": "^1.0.1", + "is-regex": "^1.0.4", + "object-is": "^1.0.1", + "object-keys": "^1.1.1", + "regexp.prototype.flags": "^1.2.0" + } + }, + "default-gateway": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/default-gateway/-/default-gateway-4.2.0.tgz", + "integrity": "sha512-h6sMrVB1VMWVrW13mSc6ia/DwYYw5MN6+exNu1OaJeFac5aSAvwM7lZ0NVfTABuSkQelr4h5oebg3KB1XPdjgA==", + "dev": true, + "requires": { + "execa": "^1.0.0", + "ip-regex": "^2.1.0" + } + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + } + }, + "del": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/del/-/del-4.1.1.tgz", + "integrity": "sha512-QwGuEUouP2kVwQenAsOof5Fv8K9t3D8Ca8NxcXKrIpEHjTXK5J2nXLdP+ALI1cgv8wj7KuwBhTwBkOZSJKM5XQ==", + "dev": true, + "requires": { + "@types/glob": "^7.1.1", + "globby": "^6.1.0", + "is-path-cwd": "^2.0.0", + "is-path-in-cwd": "^2.0.0", + "p-map": "^2.0.0", + "pify": "^4.0.1", + "rimraf": "^2.6.3" + } + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", + "dev": true + }, + "des.js": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.1.tgz", + "integrity": "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", + "dev": true + }, + "detect-file": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", + "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", + "dev": true + }, + "detect-node": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz", + "integrity": "sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==", + "dev": true + }, + "diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + } + } + }, + "dns-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/dns-equal/-/dns-equal-1.0.0.tgz", + "integrity": "sha1-s55/HabrCnW6nBcySzR1PEfgZU0=", + "dev": true + }, + "dns-packet": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-1.3.4.tgz", + "integrity": "sha512-BQ6F4vycLXBvdrJZ6S3gZewt6rcrks9KBgM9vrhW+knGRqc8uEdT7fuCwloc7nny5xNoMJ17HGH0R/6fpo8ECA==", + "dev": true, + "requires": { + "ip": "^1.1.0", + "safe-buffer": "^5.0.1" + } + }, + "dns-txt": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/dns-txt/-/dns-txt-2.0.2.tgz", + "integrity": "sha1-uR2Ab10nGI5Ks+fRB9iBocxGQrY=", + "dev": true, + "requires": { + "buffer-indexof": "^1.0.0" + } + }, + "domain-browser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", + "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", + "dev": true + }, + "duplexify": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", + "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", + "dev": true, + "requires": { + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + } + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", + "dev": true + }, + "elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "dev": true, + "requires": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + } + } + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "emojis-list": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", + "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", + "dev": true + }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", + "dev": true + }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, + "enhanced-resolve": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.5.0.tgz", + "integrity": "sha512-Nv9m36S/vxpsI+Hc4/ZGRs0n9mXqSWGGq49zxb/cJfPAQMbUtttJAlNPS4AQzaBdw/pKskw5bMbekT/Y7W/Wlg==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "memory-fs": "^0.5.0", + "tapable": "^1.0.0" + } + }, + "errno": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz", + "integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==", + "dev": true, + "requires": { + "prr": "~1.0.1" + } + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "eslint-scope": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", + "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", + "dev": true + }, + "eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", + "dev": true + }, + "events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "dev": true + }, + "eventsource": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-1.1.0.tgz", + "integrity": "sha512-VSJjT5oCNrFvCS6igjzPAt5hBzQ2qPBFIbJ03zLI9SE0mxwZpMw6BfJrbFHm1a141AavMEB8JHmBhWAd66PfCg==", + "dev": true, + "requires": { + "original": "^1.0.0" + } + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, + "requires": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "dev": true, + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "expand-tilde": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", + "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", + "dev": true, + "requires": { + "homedir-polyfill": "^1.0.1" + } + }, + "express": { + "version": "4.17.1", + "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", + "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", + "dev": true, + "requires": { + "accepts": "~1.3.7", + "array-flatten": "1.1.1", + "body-parser": "1.19.0", + "content-disposition": "0.5.3", + "content-type": "~1.0.4", + "cookie": "0.4.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "~1.1.2", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "~1.1.2", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.5", + "qs": "6.7.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.1.2", + "send": "0.17.1", + "serve-static": "1.14.1", + "setprototypeof": "1.1.1", + "statuses": "~1.5.0", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "dependencies": { + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=", + "dev": true + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + } + } + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "faye-websocket": { + "version": "0.11.4", + "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.4.tgz", + "integrity": "sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g==", + "dev": true, + "requires": { + "websocket-driver": ">=0.5.1" + } + }, + "figgy-pudding": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", + "integrity": "sha512-0btnI/H8f2pavGMN8w40mlSKOfTK2SVJmBfBeVIj3kNw0swwgzyRq0d5TJVOwodFmtvpPeWPN/MCcfuWF0Ezbw==", + "dev": true + }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "dev": true, + "optional": true + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "finalhandler": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", + "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", + "dev": true, + "requires": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "statuses": "~1.5.0", + "unpipe": "~1.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "find-cache-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", + "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^2.0.0", + "pkg-dir": "^3.0.0" + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "findup-sync": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz", + "integrity": "sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg==", + "dev": true, + "requires": { + "detect-file": "^1.0.0", + "is-glob": "^4.0.0", + "micromatch": "^3.0.4", + "resolve-dir": "^1.0.1" + }, + "dependencies": { + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + } + } + }, + "flush-write-stream": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", + "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "readable-stream": "^2.3.6" + } + }, + "follow-redirects": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.1.tgz", + "integrity": "sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg==", + "dev": true + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "dev": true + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "requires": { + "map-cache": "^0.2.2" + } + }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", + "dev": true + }, + "from2": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", + "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.0" + } + }, + "fs-write-stream-atomic": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", + "integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "iferr": "^0.1.5", + "imurmurhash": "^0.1.4", + "readable-stream": "1 || 2" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "optional": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "get-intrinsic": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", + "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + } + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true + }, + "glob": { + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "optional": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "global-modules": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", + "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==", + "dev": true, + "requires": { + "global-prefix": "^3.0.0" + } + }, + "global-prefix": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", + "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", + "dev": true, + "requires": { + "ini": "^1.3.5", + "kind-of": "^6.0.2", + "which": "^1.3.1" + } + }, + "globby": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", + "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", + "dev": true, + "requires": { + "array-union": "^1.0.1", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + }, + "dependencies": { + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + } + } + }, + "graceful-fs": { + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", + "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==", + "dev": true + }, + "handle-thing": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-2.0.1.tgz", + "integrity": "sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg==", + "dev": true + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "has-symbols": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", + "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", + "dev": true + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "dev": true, + "requires": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + } + } + }, + "hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "dev": true, + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "homedir-polyfill": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", + "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", + "dev": true, + "requires": { + "parse-passwd": "^1.0.0" + } + }, + "hpack.js": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/hpack.js/-/hpack.js-2.1.6.tgz", + "integrity": "sha1-h3dMCUnlE/QuhFdbPEVoH63ioLI=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "obuf": "^1.0.0", + "readable-stream": "^2.0.1", + "wbuf": "^1.1.0" + } + }, + "html-entities": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-1.4.0.tgz", + "integrity": "sha512-8nxjcBcd8wovbeKx7h3wTji4e6+rhaVuPNpMqwWgnHh+N9ToqsCs6XztWRBPQ+UtzsoMAdKZtUENoVzU/EMtZA==", + "dev": true + }, + "http-deceiver": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/http-deceiver/-/http-deceiver-1.2.7.tgz", + "integrity": "sha1-+nFolEq5pRnTN8sL7HKE3D5yPYc=", + "dev": true + }, + "http-errors": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", + "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", + "dev": true, + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.1", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + } + } + }, + "http-parser-js": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.3.tgz", + "integrity": "sha512-t7hjvef/5HEK7RWTdUzVUhl8zkEu+LlaE0IYzdMuvbSDipxBRpOn4Uhw8ZyECEa808iVT8XCjzo6xmYt4CiLZg==", + "dev": true + }, + "http-proxy": { + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", + "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", + "dev": true, + "requires": { + "eventemitter3": "^4.0.0", + "follow-redirects": "^1.0.0", + "requires-port": "^1.0.0" + } + }, + "http-proxy-middleware": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.19.1.tgz", + "integrity": "sha512-yHYTgWMQO8VvwNS22eLLloAkvungsKdKTLO8AJlftYIKNfJr3GK3zK0ZCfzDDGUBttdGc8xFy1mCitvNKQtC3Q==", + "dev": true, + "requires": { + "http-proxy": "^1.17.0", + "is-glob": "^4.0.0", + "lodash": "^4.17.11", + "micromatch": "^3.1.10" + }, + "dependencies": { + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + } + } + }, + "https-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", + "dev": true + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "icss-utils": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-4.1.1.tgz", + "integrity": "sha512-4aFq7wvWyMHKgxsH8QQtGpvbASCf+eM3wPRLI6R+MgAnTCZ6STYsRvttLvRWK0Nfif5piF394St3HeJDaljGPA==", + "dev": true, + "requires": { + "postcss": "^7.0.14" + } + }, + "ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true + }, + "iferr": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", + "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=", + "dev": true + }, + "import-local": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz", + "integrity": "sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ==", + "dev": true, + "requires": { + "pkg-dir": "^3.0.0", + "resolve-cwd": "^2.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "infer-owner": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", + "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true + }, + "internal-ip": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/internal-ip/-/internal-ip-4.3.0.tgz", + "integrity": "sha512-S1zBo1D6zcsyuC6PMmY5+55YMILQ9av8lotMx447Bq6SAgo/sDK6y6uUKmuYhW7eacnIhFfsPmCNYdDzsnnDCg==", + "dev": true, + "requires": { + "default-gateway": "^4.2.0", + "ipaddr.js": "^1.9.0" + } + }, + "interpret": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", + "dev": true + }, + "ip": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", + "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=", + "dev": true + }, + "ip-regex": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz", + "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=", + "dev": true + }, + "ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "dev": true + }, + "is-absolute-url": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-3.0.3.tgz", + "integrity": "sha512-opmNIX7uFnS96NtPmhWQgQx6/NYFgsUXYMllcfzwWKUMwfo8kku1TvE6hkNcH+Q1ts5cMVrsY7j0bxXQDciu9Q==", + "dev": true + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-arguments": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.0.tgz", + "integrity": "sha512-1Ij4lOMPl/xB5kBDn7I+b2ttPMKa8szhEIrXDuXQD/oe3HJLTLhqhgGspwgyGd6MOywBUqVvYicF72lkgDnIHg==", + "dev": true, + "requires": { + "call-bind": "^1.0.0" + } + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "optional": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-date-object": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.4.tgz", + "integrity": "sha512-/b4ZVsG7Z5XVtIxs/h9W8nvfLgSAyKYdtGWQLbqy6jA1icmgjf8WCoTKgeS4wy5tYaPePouzFMANbnj94c2Z+A==", + "dev": true + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-path-cwd": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz", + "integrity": "sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==", + "dev": true + }, + "is-path-in-cwd": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-2.1.0.tgz", + "integrity": "sha512-rNocXHgipO+rvnP6dk3zI20RpOtrAM/kzbB258Uw5BWr3TpXi861yzjo16Dn4hUox07iw5AyeMLHWsujkjzvRQ==", + "dev": true, + "requires": { + "is-path-inside": "^2.1.0" + } + }, + "is-path-inside": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-2.1.0.tgz", + "integrity": "sha512-wiyhTzfDWsvwAW53OBWF5zuvaOGlZ6PwYxAbPVDhpm+gM09xKQGjBq/8uYN12aDvMxnAnq3dxTyoSoRNmg5YFg==", + "dev": true, + "requires": { + "path-is-inside": "^1.0.2" + } + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "is-regex": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.3.tgz", + "integrity": "sha512-qSVXFz28HM7y+IWX6vLCsexdlvzT1PJNFSBuaQLQ5o0IEw8UDYW6/2+eCMVyIsbM8CNLX2a/QWmSpyxYEHY7CQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "has-symbols": "^1.0.2" + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, + "is-wsl": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", + "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "jquery": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz", + "integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw==" + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json3": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/json3/-/json3-3.3.3.tgz", + "integrity": "sha512-c7/8mbUsKigAbLkD5B010BK4D9LZm7A1pNItkEwiUZRpIN66exu/e7YQWysGun+TRKaJp8MhemM+VkfWv42aCA==", + "dev": true + }, + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "killable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/killable/-/killable-1.0.1.tgz", + "integrity": "sha512-LzqtLKlUwirEUyl/nicirVmNiPvYs7l5n8wOPP7fyJVpUPkvCnW/vuiXGpylGUlnPDnB7311rARzAt3Mhswpjg==", + "dev": true + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true + }, + "loader-runner": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.4.0.tgz", + "integrity": "sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw==", + "dev": true + }, + "loader-utils": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", + "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, + "loglevel": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.7.1.tgz", + "integrity": "sha512-Hesni4s5UkWkwCGJMQGAh71PaLUmKFM60dHvq0zi/vDhhrzuk+4GgNbTXJ12YYQJn6ZKBDNIjYcuQGKudvqrIw==", + "dev": true + }, + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "requires": { + "yallist": "^3.0.2" + } + }, + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "requires": { + "pify": "^4.0.1", + "semver": "^5.6.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "requires": { + "object-visit": "^1.0.0" + } + }, + "md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", + "dev": true + }, + "memory-fs": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.5.0.tgz", + "integrity": "sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA==", + "dev": true, + "requires": { + "errno": "^0.1.3", + "readable-stream": "^2.0.1" + } + }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", + "dev": true + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", + "dev": true + }, + "micromatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", + "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.2.3" + } + }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dev": true, + "requires": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + } + } + }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true + }, + "mime-db": { + "version": "1.49.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.49.0.tgz", + "integrity": "sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA==", + "dev": true + }, + "mime-types": { + "version": "2.1.32", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.32.tgz", + "integrity": "sha512-hJGaVS4G4c9TSMYh2n6SQAGrC4RnfU+daP8G7cSCmaqNjiOoUY0VHCMS42pxnQmVF1GWwFhbHWn3RIxCqTmZ9A==", + "dev": true, + "requires": { + "mime-db": "1.49.0" + } + }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "mississippi": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz", + "integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==", + "dev": true, + "requires": { + "concat-stream": "^1.5.0", + "duplexify": "^3.4.2", + "end-of-stream": "^1.1.0", + "flush-write-stream": "^1.0.0", + "from2": "^2.1.0", + "parallel-transform": "^1.1.0", + "pump": "^3.0.0", + "pumpify": "^1.3.3", + "stream-each": "^1.1.0", + "through2": "^2.0.0" + } + }, + "mixin-deep": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", + "dev": true, + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + } + }, + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "move-concurrently": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", + "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=", + "dev": true, + "requires": { + "aproba": "^1.1.1", + "copy-concurrently": "^1.0.0", + "fs-write-stream-atomic": "^1.0.8", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4", + "run-queue": "^1.0.3" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "multicast-dns": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/multicast-dns/-/multicast-dns-6.2.3.tgz", + "integrity": "sha512-ji6J5enbMyGRHIAkAOu3WdV8nggqviKCEKtXcOqfphZZtQrmHKycfynJ2V7eVPUA4NhJ6V7Wf4TmGbTwKE9B6g==", + "dev": true, + "requires": { + "dns-packet": "^1.3.1", + "thunky": "^1.0.2" + } + }, + "multicast-dns-service-types": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/multicast-dns-service-types/-/multicast-dns-service-types-1.1.0.tgz", + "integrity": "sha1-iZ8R2WhuXgXLkbNdXw5jt3PPyQE=", + "dev": true + }, + "nan": { + "version": "2.14.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz", + "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==", + "dev": true, + "optional": true + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + } + }, + "negotiator": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", + "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", + "dev": true + }, + "neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "node-forge": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.10.0.tgz", + "integrity": "sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA==", + "dev": true + }, + "node-libs-browser": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.1.tgz", + "integrity": "sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q==", + "dev": true, + "requires": { + "assert": "^1.1.1", + "browserify-zlib": "^0.2.0", + "buffer": "^4.3.0", + "console-browserify": "^1.1.0", + "constants-browserify": "^1.0.0", + "crypto-browserify": "^3.11.0", + "domain-browser": "^1.1.1", + "events": "^3.0.0", + "https-browserify": "^1.0.0", + "os-browserify": "^0.3.0", + "path-browserify": "0.0.1", + "process": "^0.11.10", + "punycode": "^1.2.4", + "querystring-es3": "^0.2.0", + "readable-stream": "^2.3.3", + "stream-browserify": "^2.0.1", + "stream-http": "^2.7.2", + "string_decoder": "^1.0.0", + "timers-browserify": "^2.0.4", + "tty-browserify": "0.0.0", + "url": "^0.11.0", + "util": "^0.11.0", + "vm-browserify": "^1.0.1" + }, + "dependencies": { + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + } + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "requires": { + "path-key": "^2.0.0" + } + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "object-is": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.5.tgz", + "integrity": "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + } + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "requires": { + "isobject": "^3.0.0" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "obuf": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", + "integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==", + "dev": true + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "dev": true, + "requires": { + "ee-first": "1.1.1" + } + }, + "on-headers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "opn": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/opn/-/opn-5.5.0.tgz", + "integrity": "sha512-PqHpggC9bLV0VeWcdKhkpxY+3JTzetLSqTCWL/z/tFIbI6G8JCjondXklT1JinczLz2Xib62sSp0T/gKT4KksA==", + "dev": true, + "requires": { + "is-wsl": "^1.1.0" + } + }, + "original": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/original/-/original-1.0.2.tgz", + "integrity": "sha512-hyBVl6iqqUOJ8FqRe+l/gS8H+kKYjrEndd5Pm1MfBtsEKA038HkkdbAl/72EAXGyonD/PFsvmVG+EvcIpliMBg==", + "dev": true, + "requires": { + "url-parse": "^1.4.3" + } + }, + "os-browserify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", + "dev": true + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-map": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", + "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", + "dev": true + }, + "p-retry": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-3.0.1.tgz", + "integrity": "sha512-XE6G4+YTTkT2a0UWb2kjZe8xNwf8bIbnqpc/IS/idOBVhyves0mK5OJgeocjx7q5pvX/6m23xuzVPYT1uGM73w==", + "dev": true, + "requires": { + "retry": "^0.12.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", + "dev": true + }, + "parallel-transform": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.2.0.tgz", + "integrity": "sha512-P2vSmIu38uIlvdcU7fDkyrxj33gTUy/ABO5ZUbGowxNCopBq/OoD42bP4UmMrJoPyk4Uqf0mu3mtWBhHCZD8yg==", + "dev": true, + "requires": { + "cyclist": "^1.0.1", + "inherits": "^2.0.3", + "readable-stream": "^2.1.5" + } + }, + "parse-asn1": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz", + "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==", + "dev": true, + "requires": { + "asn1.js": "^5.2.0", + "browserify-aes": "^1.0.0", + "evp_bytestokey": "^1.0.0", + "pbkdf2": "^3.0.3", + "safe-buffer": "^5.1.1" + } + }, + "parse-passwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", + "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", + "dev": true + }, + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "dev": true + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true + }, + "path-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", + "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==", + "dev": true + }, + "path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=", + "dev": true + }, + "pbkdf2": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", + "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", + "dev": true, + "requires": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "picomatch": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", + "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", + "dev": true + }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "^2.0.0" + } + }, + "pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "dev": true, + "requires": { + "find-up": "^3.0.0" + } + }, + "portfinder": { + "version": "1.0.28", + "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.28.tgz", + "integrity": "sha512-Se+2isanIcEqf2XMHjyUKskczxbPH7dQnlMjXX6+dybayyHvAf/TCgyMRlzf/B6QDhAEFOGes0pzRo3by4AbMA==", + "dev": true, + "requires": { + "async": "^2.6.2", + "debug": "^3.1.1", + "mkdirp": "^0.5.5" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + } + } + }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true + }, + "postcss": { + "version": "7.0.36", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.36.tgz", + "integrity": "sha512-BebJSIUMwJHRH0HAQoxN4u1CN86glsrwsW0q7T+/m44eXOUAxSNdHRkNZPYz5vVUbg17hFgOQDE7fZk7li3pZw==", + "dev": true, + "requires": { + "chalk": "^2.4.2", + "source-map": "^0.6.1", + "supports-color": "^6.1.0" + } + }, + "postcss-modules-extract-imports": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-2.0.0.tgz", + "integrity": "sha512-LaYLDNS4SG8Q5WAWqIJgdHPJrDDr/Lv775rMBFUbgjTz6j34lUznACHcdRWroPvXANP2Vj7yNK57vp9eFqzLWQ==", + "dev": true, + "requires": { + "postcss": "^7.0.5" + } + }, + "postcss-modules-local-by-default": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-3.0.3.tgz", + "integrity": "sha512-e3xDq+LotiGesympRlKNgaJ0PCzoUIdpH0dj47iWAui/kyTgh3CiAr1qP54uodmJhl6p9rN6BoNcdEDVJx9RDw==", + "dev": true, + "requires": { + "icss-utils": "^4.1.1", + "postcss": "^7.0.32", + "postcss-selector-parser": "^6.0.2", + "postcss-value-parser": "^4.1.0" + } + }, + "postcss-modules-scope": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-2.2.0.tgz", + "integrity": "sha512-YyEgsTMRpNd+HmyC7H/mh3y+MeFWevy7V1evVhJWewmMbjDHIbZbOXICC2y+m1xI1UVfIT1HMW/O04Hxyu9oXQ==", + "dev": true, + "requires": { + "postcss": "^7.0.6", + "postcss-selector-parser": "^6.0.0" + } + }, + "postcss-modules-values": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-3.0.0.tgz", + "integrity": "sha512-1//E5jCBrZ9DmRX+zCtmQtRSV6PV42Ix7Bzj9GbwJceduuf7IqP8MgeTXuRDHOWj2m0VzZD5+roFWDuU8RQjcg==", + "dev": true, + "requires": { + "icss-utils": "^4.0.0", + "postcss": "^7.0.6" + } + }, + "postcss-selector-parser": { + "version": "6.0.6", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.6.tgz", + "integrity": "sha512-9LXrvaaX3+mcv5xkg5kFwqSzSH1JIObIx51PrndZwlmznwXRfxMddDvo9gve3gVR8ZTKgoFDdWkbRFmEhT4PMg==", + "dev": true, + "requires": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + } + }, + "postcss-value-parser": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.1.0.tgz", + "integrity": "sha512-97DXOFbQJhk71ne5/Mt6cOu6yxsSfM0QGQyl0L25Gca4yGWEGJaig7l7gbCX623VqTBNGLRLaVUCnNkcedlRSQ==", + "dev": true + }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", + "dev": true + }, + "proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dev": true, + "requires": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + } + }, + "prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", + "dev": true + }, + "public-encrypt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", + "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1", + "safe-buffer": "^5.1.2" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true + } + } + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "pumpify": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", + "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", + "dev": true, + "requires": { + "duplexify": "^3.6.0", + "inherits": "^2.0.3", + "pump": "^2.0.0" + }, + "dependencies": { + "pump": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + } + } + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "qs": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", + "dev": true + }, + "querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", + "dev": true + }, + "querystring-es3": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", + "dev": true + }, + "querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "dev": true + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "dev": true, + "requires": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, + "range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "dev": true + }, + "raw-body": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", + "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", + "dev": true, + "requires": { + "bytes": "3.1.0", + "http-errors": "1.7.2", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "dependencies": { + "bytes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", + "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", + "dev": true + } + } + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "optional": true, + "requires": { + "picomatch": "^2.2.1" + } + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, + "regexp.prototype.flags": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.3.1.tgz", + "integrity": "sha512-JiBdRBq91WlY7uRJ0ds7R+dU02i6LKi8r3BuQhNXn+kmeLN+EfHhfjqMRis1zJxnlu88hq/4dx0P2OP3APRTOA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3" + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "repeat-element": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.4.tgz", + "integrity": "sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", + "dev": true + }, + "resolve-cwd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", + "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", + "dev": true, + "requires": { + "resolve-from": "^3.0.0" + } + }, + "resolve-dir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", + "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", + "dev": true, + "requires": { + "expand-tilde": "^2.0.0", + "global-modules": "^1.0.0" + }, + "dependencies": { + "global-modules": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", + "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", + "dev": true, + "requires": { + "global-prefix": "^1.0.1", + "is-windows": "^1.0.1", + "resolve-dir": "^1.0.0" + } + }, + "global-prefix": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", + "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", + "dev": true, + "requires": { + "expand-tilde": "^2.0.2", + "homedir-polyfill": "^1.0.1", + "ini": "^1.3.4", + "is-windows": "^1.0.1", + "which": "^1.2.14" + } + } + } + }, + "resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", + "dev": true + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true + }, + "retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=", + "dev": true + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "run-queue": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", + "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=", + "dev": true, + "requires": { + "aproba": "^1.1.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "requires": { + "ret": "~0.1.10" + } + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "schema-utils": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz", + "integrity": "sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.5", + "ajv": "^6.12.4", + "ajv-keywords": "^3.5.2" + } + }, + "select-hose": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz", + "integrity": "sha1-Yl2GWPhlr0Psliv8N2o3NZpJlMo=", + "dev": true + }, + "selfsigned": { + "version": "1.10.11", + "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-1.10.11.tgz", + "integrity": "sha512-aVmbPOfViZqOZPgRBT0+3u4yZFHpmnIghLMlAcb5/xhp5ZtB/RVnKhz5vl2M32CLXAqR4kha9zfhNg0Lf/sxKA==", + "dev": true, + "requires": { + "node-forge": "^0.10.0" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "send": { + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", + "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", + "dev": true, + "requires": { + "debug": "2.6.9", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "~1.7.2", + "mime": "1.6.0", + "ms": "2.1.1", + "on-finished": "~2.3.0", + "range-parser": "~1.2.1", + "statuses": "~1.5.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + }, + "dependencies": { + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + } + } + }, + "serialize-javascript": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", + "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + }, + "serve-index": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz", + "integrity": "sha1-03aNabHn2C5c4FD/9bRTvqEqkjk=", + "dev": true, + "requires": { + "accepts": "~1.3.4", + "batch": "0.6.1", + "debug": "2.6.9", + "escape-html": "~1.0.3", + "http-errors": "~1.6.2", + "mime-types": "~2.1.17", + "parseurl": "~1.3.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "http-errors": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", + "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", + "dev": true, + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.0", + "statuses": ">= 1.4.0 < 2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "setprototypeof": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", + "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", + "dev": true + } + } + }, + "serve-static": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", + "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", + "dev": true, + "requires": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.17.1" + } + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "set-value": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + } + } + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", + "dev": true + }, + "setprototypeof": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", + "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", + "dev": true + }, + "sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "signal-exit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "dev": true + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "requires": { + "kind-of": "^3.2.0" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "sockjs": { + "version": "0.3.21", + "resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.21.tgz", + "integrity": "sha512-DhbPFGpxjc6Z3I+uX07Id5ZO2XwYsWOrYjaSeieES78cq+JaJvVe5q/m1uvjIQhXinhIeCFRH6JgXe+mvVMyXw==", + "dev": true, + "requires": { + "faye-websocket": "^0.11.3", + "uuid": "^3.4.0", + "websocket-driver": "^0.7.4" + } + }, + "sockjs-client": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/sockjs-client/-/sockjs-client-1.5.1.tgz", + "integrity": "sha512-VnVAb663fosipI/m6pqRXakEOw7nvd7TUgdr3PlR/8V2I95QIdwT8L4nMxhyU8SmDBHYXU1TOElaKOmKLfYzeQ==", + "dev": true, + "requires": { + "debug": "^3.2.6", + "eventsource": "^1.0.7", + "faye-websocket": "^0.11.3", + "inherits": "^2.0.4", + "json3": "^3.3.3", + "url-parse": "^1.5.1" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + } + } + }, + "source-list-map": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", + "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "source-map-resolve": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", + "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", + "dev": true, + "requires": { + "atob": "^2.1.2", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-support": { + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "source-map-url": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz", + "integrity": "sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==", + "dev": true + }, + "spdy": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/spdy/-/spdy-4.0.2.tgz", + "integrity": "sha512-r46gZQZQV+Kl9oItvl1JZZqJKGr+oEkB08A6BzkiR7593/7IbtuncXHd2YoYeTsG4157ZssMu9KYvUHLcjcDoA==", + "dev": true, + "requires": { + "debug": "^4.1.0", + "handle-thing": "^2.0.0", + "http-deceiver": "^1.2.7", + "select-hose": "^2.0.0", + "spdy-transport": "^3.0.0" + } + }, + "spdy-transport": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdy-transport/-/spdy-transport-3.0.0.tgz", + "integrity": "sha512-hsLVFE5SjA6TCisWeJXFKniGGOpBgMLmerfO2aCyCU5s7nJ/rpAepqmFifv/GCbSbueEeAJJnmSQ2rKC/g8Fcw==", + "dev": true, + "requires": { + "debug": "^4.1.0", + "detect-node": "^2.0.4", + "hpack.js": "^2.1.6", + "obuf": "^1.1.2", + "readable-stream": "^3.0.6", + "wbuf": "^1.7.3" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + } + } + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.0" + } + }, + "ssri": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.2.tgz", + "integrity": "sha512-cepbSq/neFK7xB6A50KHN0xHDotYzq58wWCa5LeWqnPrHG8GzfEjO/4O8kpmcGW+oaxkvhEJCWgbgNk4/ZV93Q==", + "dev": true, + "requires": { + "figgy-pudding": "^3.5.1" + } + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + } + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", + "dev": true + }, + "stream-browserify": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", + "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==", + "dev": true, + "requires": { + "inherits": "~2.0.1", + "readable-stream": "^2.0.2" + } + }, + "stream-each": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz", + "integrity": "sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "stream-shift": "^1.0.0" + } + }, + "stream-http": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", + "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", + "dev": true, + "requires": { + "builtin-status-codes": "^3.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.3.6", + "to-arraybuffer": "^1.0.0", + "xtend": "^4.0.0" + } + }, + "stream-shift": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", + "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", + "dev": true + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true + }, + "style-loader": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-1.3.0.tgz", + "integrity": "sha512-V7TCORko8rs9rIqkSrlMfkqA63DfoGBBJmK1kKGCcSi+BWb4cqz0SRsnp4l6rU5iwOEd0/2ePv68SV22VXon4Q==", + "dev": true, + "requires": { + "loader-utils": "^2.0.0", + "schema-utils": "^2.7.0" + }, + "dependencies": { + "json5": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", + "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "loader-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz", + "integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + } + } + } + }, + "supports-color": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", + "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "sweetalert2": { + "version": "9.17.2", + "resolved": "https://registry.npmjs.org/sweetalert2/-/sweetalert2-9.17.2.tgz", + "integrity": "sha512-HkpPZVMYsnhFUBLdy/LvkU9snggKP3VAuSVnPhVXjxdg02lWbFx0W8H3m7A+WMWw2diXZS1wIa4m67XkNxdvew==" + }, + "tapable": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", + "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==", + "dev": true + }, + "terser": { + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.0.tgz", + "integrity": "sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw==", + "dev": true, + "requires": { + "commander": "^2.20.0", + "source-map": "~0.6.1", + "source-map-support": "~0.5.12" + } + }, + "terser-webpack-plugin": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.5.tgz", + "integrity": "sha512-04Rfe496lN8EYruwi6oPQkG0vo8C+HT49X687FZnpPF0qMAIHONI6HEXYPKDOE8e5HjXTyKfqRd/agHtH0kOtw==", + "dev": true, + "requires": { + "cacache": "^12.0.2", + "find-cache-dir": "^2.1.0", + "is-wsl": "^1.1.0", + "schema-utils": "^1.0.0", + "serialize-javascript": "^4.0.0", + "source-map": "^0.6.1", + "terser": "^4.1.2", + "webpack-sources": "^1.4.0", + "worker-farm": "^1.7.0" + }, + "dependencies": { + "schema-utils": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", + "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", + "dev": true, + "requires": { + "ajv": "^6.1.0", + "ajv-errors": "^1.0.0", + "ajv-keywords": "^3.1.0" + } + } + } + }, + "three": { + "version": "0.113.0", + "resolved": "https://registry.npmjs.org/three/-/three-0.113.0.tgz", + "integrity": "sha512-H1IuGiyyBciP+L8fM5WCgXSm/nYbLr+tGgY9WWu7PPBxDxki/XJovC/Hz5JI/V7d6kx+1R/8zXWEmsIotLH/aA==" + }, + "three-csm": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/three-csm/-/three-csm-1.0.2.tgz", + "integrity": "sha512-i8FHWBba/3NUiHgu1Vsptqi/whvsq++UMpVmB5ZjKNXmtkclD6yCm4Vk9V5GF90rHaTa7ZC1SN7+awWBRy8LFQ==" + }, + "through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "requires": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "thunky": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/thunky/-/thunky-1.1.0.tgz", + "integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==", + "dev": true + }, + "timers-browserify": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.12.tgz", + "integrity": "sha512-9phl76Cqm6FhSX9Xe1ZUAMLtm1BLkKj2Qd5ApyWkXzsMRaA7dgr81kf4wJmQf/hAvg8EEyJxDo3du/0KlhPiKQ==", + "dev": true, + "requires": { + "setimmediate": "^1.0.4" + } + }, + "to-arraybuffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", + "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", + "dev": true + }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "toidentifier": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", + "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", + "dev": true + }, + "ts-loader": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-6.2.2.tgz", + "integrity": "sha512-HDo5kXZCBml3EUPcc7RlZOV/JGlLHwppTLEHb3SHnr5V7NXD4klMEkrhJe5wgRbaWsSXi+Y1SIBN/K9B6zWGWQ==", + "dev": true, + "requires": { + "chalk": "^2.3.0", + "enhanced-resolve": "^4.0.0", + "loader-utils": "^1.0.2", + "micromatch": "^4.0.0", + "semver": "^6.0.0" + } + }, + "tty-browserify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", + "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", + "dev": true + }, + "type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "dev": true, + "requires": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + } + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "typescript": { + "version": "3.9.10", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", + "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==", + "dev": true + }, + "union-value": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + } + } + }, + "unique-filename": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", + "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", + "dev": true, + "requires": { + "unique-slug": "^2.0.0" + } + }, + "unique-slug": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", + "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4" + } + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", + "dev": true + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true + } + } + }, + "upath": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", + "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", + "dev": true + }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, + "url": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", + "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", + "dev": true, + "requires": { + "punycode": "1.3.2", + "querystring": "0.2.0" + }, + "dependencies": { + "punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", + "dev": true + } + } + }, + "url-parse": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.3.tgz", + "integrity": "sha512-IIORyIQD9rvj0A4CLWsHkBBJuNqWpFQe224b6j9t/ABmquIS0qDU2pY6kl6AuOrL5OkCXHMCFNe1jBcuAggjvQ==", + "dev": true, + "requires": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, + "use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true + }, + "util": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", + "integrity": "sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ==", + "dev": true, + "requires": { + "inherits": "2.0.3" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + } + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", + "dev": true + }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true + }, + "v8-compile-cache": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", + "dev": true + }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", + "dev": true + }, + "vm-browserify": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz", + "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==", + "dev": true + }, + "watchpack": { + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.7.5.tgz", + "integrity": "sha512-9P3MWk6SrKjHsGkLT2KHXdQ/9SNkyoJbabxnKOoJepsvJjJG8uYTR3yTPxPQvNDI3w4Nz1xnE0TLHK4RIVe/MQ==", + "dev": true, + "requires": { + "chokidar": "^3.4.1", + "graceful-fs": "^4.1.2", + "neo-async": "^2.5.0", + "watchpack-chokidar2": "^2.0.1" + } + }, + "watchpack-chokidar2": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/watchpack-chokidar2/-/watchpack-chokidar2-2.0.1.tgz", + "integrity": "sha512-nCFfBIPKr5Sh61s4LPpy1Wtfi0HE8isJ3d2Yb5/Ppw2P2B/3eVSEBjKfN0fmHJSK14+31KwMKmcrzs2GM4P0Ww==", + "dev": true, + "optional": true, + "requires": { + "chokidar": "^2.1.8" + }, + "dependencies": { + "anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "dev": true, + "optional": true, + "requires": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + }, + "dependencies": { + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "optional": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + } + } + }, + "binary-extensions": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", + "dev": true, + "optional": true + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "optional": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "optional": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "chokidar": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", + "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", + "dev": true, + "optional": true, + "requires": { + "anymatch": "^2.0.0", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "fsevents": "^1.2.7", + "glob-parent": "^3.1.0", + "inherits": "^2.0.3", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^3.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.2.1", + "upath": "^1.1.1" + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "optional": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "optional": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "fsevents": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", + "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", + "dev": true, + "optional": true, + "requires": { + "bindings": "^1.5.0", + "nan": "^2.12.1" + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "optional": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "optional": true, + "requires": { + "is-extglob": "^2.1.0" + } + } + } + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "optional": true, + "requires": { + "binary-extensions": "^1.0.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true, + "optional": true + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "optional": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "optional": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "readdirp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "dev": true, + "optional": true, + "requires": { + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "optional": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + } + } + }, + "wbuf": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/wbuf/-/wbuf-1.7.3.tgz", + "integrity": "sha512-O84QOnr0icsbFGLS0O3bI5FswxzRr8/gHwWkDlQFskhSPryQXvrTMxjxGP4+iWYoauLoBvfDpkrOauZ+0iZpDA==", + "dev": true, + "requires": { + "minimalistic-assert": "^1.0.0" + } + }, + "webpack": { + "version": "4.46.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.46.0.tgz", + "integrity": "sha512-6jJuJjg8znb/xRItk7bkT0+Q7AHCYjjFnvKIWQPkNIOyRqoCGvkOs0ipeQzrqz4l5FtN5ZI/ukEHroeX/o1/5Q==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-module-context": "1.9.0", + "@webassemblyjs/wasm-edit": "1.9.0", + "@webassemblyjs/wasm-parser": "1.9.0", + "acorn": "^6.4.1", + "ajv": "^6.10.2", + "ajv-keywords": "^3.4.1", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^4.5.0", + "eslint-scope": "^4.0.3", + "json-parse-better-errors": "^1.0.2", + "loader-runner": "^2.4.0", + "loader-utils": "^1.2.3", + "memory-fs": "^0.4.1", + "micromatch": "^3.1.10", + "mkdirp": "^0.5.3", + "neo-async": "^2.6.1", + "node-libs-browser": "^2.2.1", + "schema-utils": "^1.0.0", + "tapable": "^1.1.3", + "terser-webpack-plugin": "^1.4.3", + "watchpack": "^1.7.4", + "webpack-sources": "^1.4.1" + }, + "dependencies": { + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "memory-fs": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", + "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", + "dev": true, + "requires": { + "errno": "^0.1.3", + "readable-stream": "^2.0.1" + } + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "schema-utils": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", + "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", + "dev": true, + "requires": { + "ajv": "^6.1.0", + "ajv-errors": "^1.0.0", + "ajv-keywords": "^3.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + } + } + }, + "webpack-cli": { + "version": "3.3.12", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-3.3.12.tgz", + "integrity": "sha512-NVWBaz9k839ZH/sinurM+HcDvJOTXwSjYp1ku+5XKeOC03z8v5QitnK/x+lAxGXFyhdayoIf/GOpv85z3/xPag==", + "dev": true, + "requires": { + "chalk": "^2.4.2", + "cross-spawn": "^6.0.5", + "enhanced-resolve": "^4.1.1", + "findup-sync": "^3.0.0", + "global-modules": "^2.0.0", + "import-local": "^2.0.0", + "interpret": "^1.4.0", + "loader-utils": "^1.4.0", + "supports-color": "^6.1.0", + "v8-compile-cache": "^2.1.1", + "yargs": "^13.3.2" + } + }, + "webpack-dev-server": { + "version": "3.11.2", + "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-3.11.2.tgz", + "integrity": "sha512-A80BkuHRQfCiNtGBS1EMf2ChTUs0x+B3wGDFmOeT4rmJOHhHTCH2naNxIHhmkr0/UillP4U3yeIyv1pNp+QDLQ==", + "dev": true, + "requires": { + "ansi-html": "0.0.7", + "bonjour": "^3.5.0", + "chokidar": "^2.1.8", + "compression": "^1.7.4", + "connect-history-api-fallback": "^1.6.0", + "debug": "^4.1.1", + "del": "^4.1.1", + "express": "^4.17.1", + "html-entities": "^1.3.1", + "http-proxy-middleware": "0.19.1", + "import-local": "^2.0.0", + "internal-ip": "^4.3.0", + "ip": "^1.1.5", + "is-absolute-url": "^3.0.3", + "killable": "^1.0.1", + "loglevel": "^1.6.8", + "opn": "^5.5.0", + "p-retry": "^3.0.1", + "portfinder": "^1.0.26", + "schema-utils": "^1.0.0", + "selfsigned": "^1.10.8", + "semver": "^6.3.0", + "serve-index": "^1.9.1", + "sockjs": "^0.3.21", + "sockjs-client": "^1.5.0", + "spdy": "^4.0.2", + "strip-ansi": "^3.0.1", + "supports-color": "^6.1.0", + "url": "^0.11.0", + "webpack-dev-middleware": "^3.7.2", + "webpack-log": "^2.0.0", + "ws": "^6.2.1", + "yargs": "^13.3.2" + }, + "dependencies": { + "anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "dev": true, + "requires": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + }, + "dependencies": { + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + } + } + }, + "binary-extensions": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", + "dev": true + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "chokidar": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", + "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", + "dev": true, + "requires": { + "anymatch": "^2.0.0", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "fsevents": "^1.2.7", + "glob-parent": "^3.1.0", + "inherits": "^2.0.3", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^3.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.2.1", + "upath": "^1.1.1" + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "fsevents": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", + "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", + "dev": true, + "optional": true, + "requires": { + "bindings": "^1.5.0", + "nan": "^2.12.1" + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "^2.1.0" + } + } + } + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "requires": { + "binary-extensions": "^1.0.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "memory-fs": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", + "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", + "dev": true, + "requires": { + "errno": "^0.1.3", + "readable-stream": "^2.0.1" + } + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "mime": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.5.2.tgz", + "integrity": "sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg==", + "dev": true + }, + "readdirp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" + } + }, + "schema-utils": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", + "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", + "dev": true, + "requires": { + "ajv": "^6.1.0", + "ajv-errors": "^1.0.0", + "ajv-keywords": "^3.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + }, + "webpack-dev-middleware": { + "version": "3.7.3", + "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-3.7.3.tgz", + "integrity": "sha512-djelc/zGiz9nZj/U7PTBi2ViorGJXEWo/3ltkPbDyxCXhhEXkW0ce99falaok4TPj+AsxLiXJR0EBOb0zh9fKQ==", + "dev": true, + "requires": { + "memory-fs": "^0.4.1", + "mime": "^2.4.4", + "mkdirp": "^0.5.1", + "range-parser": "^1.2.1", + "webpack-log": "^2.0.0" + } + } + } + }, + "webpack-log": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/webpack-log/-/webpack-log-2.0.0.tgz", + "integrity": "sha512-cX8G2vR/85UYG59FgkoMamwHUIkSSlV3bBMRsbxVXVUk2j6NleCKjQ/WE9eYg9WY4w25O9w8wKP4rzNZFmUcUg==", + "dev": true, + "requires": { + "ansi-colors": "^3.0.0", + "uuid": "^3.3.2" + } + }, + "webpack-merge": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-4.2.2.tgz", + "integrity": "sha512-TUE1UGoTX2Cd42j3krGYqObZbOD+xF7u28WB7tfUordytSjbWTIjK/8V0amkBfTYN4/pB/GIDlJZZ657BGG19g==", + "dev": true, + "requires": { + "lodash": "^4.17.15" + } + }, + "webpack-sources": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz", + "integrity": "sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==", + "dev": true, + "requires": { + "source-list-map": "^2.0.0", + "source-map": "~0.6.1" + } + }, + "websocket-driver": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.4.tgz", + "integrity": "sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg==", + "dev": true, + "requires": { + "http-parser-js": ">=0.5.1", + "safe-buffer": ">=5.1.0", + "websocket-extensions": ">=0.1.1" + } + }, + "websocket-extensions": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.4.tgz", + "integrity": "sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==", + "dev": true + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "worker-farm": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.7.0.tgz", + "integrity": "sha512-rvw3QTZc8lAxyVrqcSGVm5yP/IJ2UcB3U0graE3LCFoZ0Yn2x4EoVSqJKdB/T5M+FLcRPjz4TDacRf3OCfNUzw==", + "dev": true, + "requires": { + "errno": "~0.1.7" + } + }, + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "ws": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.2.tgz", + "integrity": "sha512-zmhltoSR8u1cnDsD43TX59mzoMZsLKqUweyYBAIvTngR3shc0W6aOZylZmq/7hqyVxPdi+5Ud2QInblgyE72fw==", + "dev": true, + "requires": { + "async-limiter": "~1.0.0" + } + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true + }, + "y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "dev": true + }, + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + }, + "yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" + } + }, + "yargs-parser": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } +} diff --git a/Sketchbook-master/Sketchbook-master/package.json b/Sketchbook-master/Sketchbook-master/package.json new file mode 100644 index 00000000..90d4252a --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/package.json @@ -0,0 +1,49 @@ +{ + "name": "sketchbook", + "version": "0.4.0", + "description": "3D playground built on three.js and cannon.js", + "keywords": [ + "3d", + "threejs", + "cannonjs", + "game", + "engine", + "typescript", + "sketchbook" + ], + "main": "build/sketchbook.min.js", + "types": "build/types/sketchbook.d.ts", + "scripts": { + "dev": "webpack-dev-server --config webpack.dev.js", + "build": "webpack --config webpack.prod.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/swift502/Sketchbook.git" + }, + "author": "swift502 (http://jblaha.art/)", + "license": "MIT", + "bugs": { + "url": "https://github.com/swift502/Sketchbook/issues" + }, + "homepage": "https://github.com/swift502/Sketchbook", + "devDependencies": { + "@types/jquery": "^3.5.5", + "@types/lodash": "^4.14.168", + "css-loader": "^3.6.0", + "style-loader": "^1.3.0", + "ts-loader": "^6.2.2", + "typescript": "^3.9.9", + "webpack": "^4.46.0", + "webpack-cli": "^3.3.12", + "webpack-dev-server": "^3.11.2", + "webpack-merge": "^4.2.2" + }, + "dependencies": { + "jquery": "^3.6.0", + "lodash": "^4.17.21", + "sweetalert2": "^9.17.2", + "three": "0.113.0", + "three-csm": "1.0.2" + } +} diff --git a/Sketchbook-master/Sketchbook-master/src/blend/airplane.blend b/Sketchbook-master/Sketchbook-master/src/blend/airplane.blend new file mode 100644 index 00000000..d0c0c820 Binary files /dev/null and b/Sketchbook-master/Sketchbook-master/src/blend/airplane.blend differ diff --git a/Sketchbook-master/Sketchbook-master/src/blend/boxman.blend b/Sketchbook-master/Sketchbook-master/src/blend/boxman.blend new file mode 100644 index 00000000..08bb76c7 Binary files /dev/null and b/Sketchbook-master/Sketchbook-master/src/blend/boxman.blend differ diff --git a/Sketchbook-master/Sketchbook-master/src/blend/car.blend b/Sketchbook-master/Sketchbook-master/src/blend/car.blend new file mode 100644 index 00000000..54c71e40 Binary files /dev/null and b/Sketchbook-master/Sketchbook-master/src/blend/car.blend differ diff --git a/Sketchbook-master/Sketchbook-master/src/blend/heli.blend b/Sketchbook-master/Sketchbook-master/src/blend/heli.blend new file mode 100644 index 00000000..ad435226 Binary files /dev/null and b/Sketchbook-master/Sketchbook-master/src/blend/heli.blend differ diff --git a/Sketchbook-master/Sketchbook-master/src/blend/world.blend b/Sketchbook-master/Sketchbook-master/src/blend/world.blend new file mode 100644 index 00000000..7bd36914 Binary files /dev/null and b/Sketchbook-master/Sketchbook-master/src/blend/world.blend differ diff --git a/Sketchbook-master/Sketchbook-master/src/css/main.css b/Sketchbook-master/Sketchbook-master/src/css/main.css new file mode 100644 index 00000000..aad096e4 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/css/main.css @@ -0,0 +1,7 @@ +@import "modules/base.css"; +@import "modules/githubCorner.css"; +@import "modules/leftPanel.css"; +@import "modules/dat.gui.css"; +@import "modules/loadingScreen.css"; +@import "modules/cubeLoader.css"; +@import "modules/welcomeScreen.css"; diff --git a/Sketchbook-master/Sketchbook-master/src/css/modules/animate.css b/Sketchbook-master/Sketchbook-master/src/css/modules/animate.css new file mode 100644 index 00000000..31229651 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/css/modules/animate.css @@ -0,0 +1,4074 @@ + +@charset "UTF-8"; +/*! + * animate.css - https://animate.style/ + * Version - 4.0.0 + * Licensed under the MIT license - http://opensource.org/licenses/MIT + * + * Copyright (c) 2020 Animate.css + */ +:root { + --animate-duration: 1s; + --animate-delay: 1s; + --animate-repeat: 1; +} +.animate__animated { + -webkit-animation-duration: 1s; + animation-duration: 1s; + -webkit-animation-duration: var(--animate-duration); + animation-duration: var(--animate-duration); + -webkit-animation-fill-mode: both; + animation-fill-mode: both; +} +.animate__animated.animate__infinite { + -webkit-animation-iteration-count: infinite; + animation-iteration-count: infinite; +} +.animate__animated.animate__repeat-1 { + -webkit-animation-iteration-count: 1; + animation-iteration-count: 1; + -webkit-animation-iteration-count: var(--animate-repeat); + animation-iteration-count: var(--animate-repeat); +} +.animate__animated.animate__repeat-2 { + -webkit-animation-iteration-count: calc(1 * 2); + animation-iteration-count: calc(1 * 2); + -webkit-animation-iteration-count: calc(var(--animate-repeat) * 2); + animation-iteration-count: calc(var(--animate-repeat) * 2); +} +.animate__animated.animate__repeat-3 { + -webkit-animation-iteration-count: calc(1 * 3); + animation-iteration-count: calc(1 * 3); + -webkit-animation-iteration-count: calc(var(--animate-repeat) * 3); + animation-iteration-count: calc(var(--animate-repeat) * 3); +} +.animate__animated.animate__delay-1s { + -webkit-animation-delay: 1s; + animation-delay: 1s; + -webkit-animation-delay: var(--animate-delay); + animation-delay: var(--animate-delay); +} +.animate__animated.animate__delay-2s { + -webkit-animation-delay: calc(1s * 2); + animation-delay: calc(1s * 2); + -webkit-animation-delay: calc(var(--animate-delay) * 2); + animation-delay: calc(var(--animate-delay) * 2); +} +.animate__animated.animate__delay-3s { + -webkit-animation-delay: calc(1s * 3); + animation-delay: calc(1s * 3); + -webkit-animation-delay: calc(var(--animate-delay) * 3); + animation-delay: calc(var(--animate-delay) * 3); +} +.animate__animated.animate__delay-4s { + -webkit-animation-delay: calc(1s * 4); + animation-delay: calc(1s * 4); + -webkit-animation-delay: calc(var(--animate-delay) * 4); + animation-delay: calc(var(--animate-delay) * 4); +} +.animate__animated.animate__delay-5s { + -webkit-animation-delay: calc(1s * 5); + animation-delay: calc(1s * 5); + -webkit-animation-delay: calc(var(--animate-delay) * 5); + animation-delay: calc(var(--animate-delay) * 5); +} +.animate__animated.animate__faster { + -webkit-animation-duration: calc(1s / 2); + animation-duration: calc(1s / 2); + -webkit-animation-duration: calc(var(--animate-duration) / 2); + animation-duration: calc(var(--animate-duration) / 2); +} +.animate__animated.animate__fast { + -webkit-animation-duration: calc(1s * 0.8); + animation-duration: calc(1s * 0.8); + -webkit-animation-duration: calc(var(--animate-duration) * 0.8); + animation-duration: calc(var(--animate-duration) * 0.8); +} +.animate__animated.animate__slow { + -webkit-animation-duration: calc(1s * 2); + animation-duration: calc(1s * 2); + -webkit-animation-duration: calc(var(--animate-duration) * 2); + animation-duration: calc(var(--animate-duration) * 2); +} +.animate__animated.animate__slower { + -webkit-animation-duration: calc(1s * 3); + animation-duration: calc(1s * 3); + -webkit-animation-duration: calc(var(--animate-duration) * 3); + animation-duration: calc(var(--animate-duration) * 3); +} +@media print, (prefers-reduced-motion: reduce) { + .animate__animated { + -webkit-animation-duration: 1ms !important; + animation-duration: 1ms !important; + -webkit-transition-duration: 1ms !important; + transition-duration: 1ms !important; + -webkit-animation-iteration-count: 1 !important; + animation-iteration-count: 1 !important; + } + + .animate__animated[class*='Out'] { + opacity: 0; + } +} +/* Attention seekers */ +@-webkit-keyframes bounce { + from, + 20%, + 53%, + to { + -webkit-animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + + 40%, + 43% { + -webkit-animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06); + animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06); + -webkit-transform: translate3d(0, -30px, 0) scaleY(1.1); + transform: translate3d(0, -30px, 0) scaleY(1.1); + } + + 70% { + -webkit-animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06); + animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06); + -webkit-transform: translate3d(0, -15px, 0) scaleY(1.05); + transform: translate3d(0, -15px, 0) scaleY(1.05); + } + + 80% { + -webkit-transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + -webkit-transform: translate3d(0, 0, 0) scaleY(0.95); + transform: translate3d(0, 0, 0) scaleY(0.95); + } + + 90% { + -webkit-transform: translate3d(0, -4px, 0) scaleY(1.02); + transform: translate3d(0, -4px, 0) scaleY(1.02); + } +} +@keyframes bounce { + from, + 20%, + 53%, + to { + -webkit-animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + + 40%, + 43% { + -webkit-animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06); + animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06); + -webkit-transform: translate3d(0, -30px, 0) scaleY(1.1); + transform: translate3d(0, -30px, 0) scaleY(1.1); + } + + 70% { + -webkit-animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06); + animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06); + -webkit-transform: translate3d(0, -15px, 0) scaleY(1.05); + transform: translate3d(0, -15px, 0) scaleY(1.05); + } + + 80% { + -webkit-transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + -webkit-transform: translate3d(0, 0, 0) scaleY(0.95); + transform: translate3d(0, 0, 0) scaleY(0.95); + } + + 90% { + -webkit-transform: translate3d(0, -4px, 0) scaleY(1.02); + transform: translate3d(0, -4px, 0) scaleY(1.02); + } +} +.animate__bounce { + -webkit-animation-name: bounce; + animation-name: bounce; + -webkit-transform-origin: center bottom; + transform-origin: center bottom; +} +@-webkit-keyframes flash { + from, + 50%, + to { + opacity: 1; + } + + 25%, + 75% { + opacity: 0; + } +} +@keyframes flash { + from, + 50%, + to { + opacity: 1; + } + + 25%, + 75% { + opacity: 0; + } +} +.animate__flash { + -webkit-animation-name: flash; + animation-name: flash; +} +/* originally authored by Nick Pettit - https://github.com/nickpettit/glide */ +@-webkit-keyframes pulse { + from { + -webkit-transform: scale3d(1, 1, 1); + transform: scale3d(1, 1, 1); + } + + 50% { + -webkit-transform: scale3d(1.05, 1.05, 1.05); + transform: scale3d(1.05, 1.05, 1.05); + } + + to { + -webkit-transform: scale3d(1, 1, 1); + transform: scale3d(1, 1, 1); + } +} +@keyframes pulse { + from { + -webkit-transform: scale3d(1, 1, 1); + transform: scale3d(1, 1, 1); + } + + 50% { + -webkit-transform: scale3d(1.05, 1.05, 1.05); + transform: scale3d(1.05, 1.05, 1.05); + } + + to { + -webkit-transform: scale3d(1, 1, 1); + transform: scale3d(1, 1, 1); + } +} +.animate__pulse { + -webkit-animation-name: pulse; + animation-name: pulse; + -webkit-animation-timing-function: ease-in-out; + animation-timing-function: ease-in-out; +} +@-webkit-keyframes rubberBand { + from { + -webkit-transform: scale3d(1, 1, 1); + transform: scale3d(1, 1, 1); + } + + 30% { + -webkit-transform: scale3d(1.25, 0.75, 1); + transform: scale3d(1.25, 0.75, 1); + } + + 40% { + -webkit-transform: scale3d(0.75, 1.25, 1); + transform: scale3d(0.75, 1.25, 1); + } + + 50% { + -webkit-transform: scale3d(1.15, 0.85, 1); + transform: scale3d(1.15, 0.85, 1); + } + + 65% { + -webkit-transform: scale3d(0.95, 1.05, 1); + transform: scale3d(0.95, 1.05, 1); + } + + 75% { + -webkit-transform: scale3d(1.05, 0.95, 1); + transform: scale3d(1.05, 0.95, 1); + } + + to { + -webkit-transform: scale3d(1, 1, 1); + transform: scale3d(1, 1, 1); + } +} +@keyframes rubberBand { + from { + -webkit-transform: scale3d(1, 1, 1); + transform: scale3d(1, 1, 1); + } + + 30% { + -webkit-transform: scale3d(1.25, 0.75, 1); + transform: scale3d(1.25, 0.75, 1); + } + + 40% { + -webkit-transform: scale3d(0.75, 1.25, 1); + transform: scale3d(0.75, 1.25, 1); + } + + 50% { + -webkit-transform: scale3d(1.15, 0.85, 1); + transform: scale3d(1.15, 0.85, 1); + } + + 65% { + -webkit-transform: scale3d(0.95, 1.05, 1); + transform: scale3d(0.95, 1.05, 1); + } + + 75% { + -webkit-transform: scale3d(1.05, 0.95, 1); + transform: scale3d(1.05, 0.95, 1); + } + + to { + -webkit-transform: scale3d(1, 1, 1); + transform: scale3d(1, 1, 1); + } +} +.animate__rubberBand { + -webkit-animation-name: rubberBand; + animation-name: rubberBand; +} +@-webkit-keyframes shakeX { + from, + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + + 10%, + 30%, + 50%, + 70%, + 90% { + -webkit-transform: translate3d(-10px, 0, 0); + transform: translate3d(-10px, 0, 0); + } + + 20%, + 40%, + 60%, + 80% { + -webkit-transform: translate3d(10px, 0, 0); + transform: translate3d(10px, 0, 0); + } +} +@keyframes shakeX { + from, + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + + 10%, + 30%, + 50%, + 70%, + 90% { + -webkit-transform: translate3d(-10px, 0, 0); + transform: translate3d(-10px, 0, 0); + } + + 20%, + 40%, + 60%, + 80% { + -webkit-transform: translate3d(10px, 0, 0); + transform: translate3d(10px, 0, 0); + } +} +.animate__shakeX { + -webkit-animation-name: shakeX; + animation-name: shakeX; +} +@-webkit-keyframes shakeY { + from, + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + + 10%, + 30%, + 50%, + 70%, + 90% { + -webkit-transform: translate3d(0, -10px, 0); + transform: translate3d(0, -10px, 0); + } + + 20%, + 40%, + 60%, + 80% { + -webkit-transform: translate3d(0, 10px, 0); + transform: translate3d(0, 10px, 0); + } +} +@keyframes shakeY { + from, + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + + 10%, + 30%, + 50%, + 70%, + 90% { + -webkit-transform: translate3d(0, -10px, 0); + transform: translate3d(0, -10px, 0); + } + + 20%, + 40%, + 60%, + 80% { + -webkit-transform: translate3d(0, 10px, 0); + transform: translate3d(0, 10px, 0); + } +} +.animate__shakeY { + -webkit-animation-name: shakeY; + animation-name: shakeY; +} +@-webkit-keyframes headShake { + 0% { + -webkit-transform: translateX(0); + transform: translateX(0); + } + + 6.5% { + -webkit-transform: translateX(-6px) rotateY(-9deg); + transform: translateX(-6px) rotateY(-9deg); + } + + 18.5% { + -webkit-transform: translateX(5px) rotateY(7deg); + transform: translateX(5px) rotateY(7deg); + } + + 31.5% { + -webkit-transform: translateX(-3px) rotateY(-5deg); + transform: translateX(-3px) rotateY(-5deg); + } + + 43.5% { + -webkit-transform: translateX(2px) rotateY(3deg); + transform: translateX(2px) rotateY(3deg); + } + + 50% { + -webkit-transform: translateX(0); + transform: translateX(0); + } +} +@keyframes headShake { + 0% { + -webkit-transform: translateX(0); + transform: translateX(0); + } + + 6.5% { + -webkit-transform: translateX(-6px) rotateY(-9deg); + transform: translateX(-6px) rotateY(-9deg); + } + + 18.5% { + -webkit-transform: translateX(5px) rotateY(7deg); + transform: translateX(5px) rotateY(7deg); + } + + 31.5% { + -webkit-transform: translateX(-3px) rotateY(-5deg); + transform: translateX(-3px) rotateY(-5deg); + } + + 43.5% { + -webkit-transform: translateX(2px) rotateY(3deg); + transform: translateX(2px) rotateY(3deg); + } + + 50% { + -webkit-transform: translateX(0); + transform: translateX(0); + } +} +.animate__headShake { + -webkit-animation-timing-function: ease-in-out; + animation-timing-function: ease-in-out; + -webkit-animation-name: headShake; + animation-name: headShake; +} +@-webkit-keyframes swing { + 20% { + -webkit-transform: rotate3d(0, 0, 1, 15deg); + transform: rotate3d(0, 0, 1, 15deg); + } + + 40% { + -webkit-transform: rotate3d(0, 0, 1, -10deg); + transform: rotate3d(0, 0, 1, -10deg); + } + + 60% { + -webkit-transform: rotate3d(0, 0, 1, 5deg); + transform: rotate3d(0, 0, 1, 5deg); + } + + 80% { + -webkit-transform: rotate3d(0, 0, 1, -5deg); + transform: rotate3d(0, 0, 1, -5deg); + } + + to { + -webkit-transform: rotate3d(0, 0, 1, 0deg); + transform: rotate3d(0, 0, 1, 0deg); + } +} +@keyframes swing { + 20% { + -webkit-transform: rotate3d(0, 0, 1, 15deg); + transform: rotate3d(0, 0, 1, 15deg); + } + + 40% { + -webkit-transform: rotate3d(0, 0, 1, -10deg); + transform: rotate3d(0, 0, 1, -10deg); + } + + 60% { + -webkit-transform: rotate3d(0, 0, 1, 5deg); + transform: rotate3d(0, 0, 1, 5deg); + } + + 80% { + -webkit-transform: rotate3d(0, 0, 1, -5deg); + transform: rotate3d(0, 0, 1, -5deg); + } + + to { + -webkit-transform: rotate3d(0, 0, 1, 0deg); + transform: rotate3d(0, 0, 1, 0deg); + } +} +.animate__swing { + -webkit-transform-origin: top center; + transform-origin: top center; + -webkit-animation-name: swing; + animation-name: swing; +} +@-webkit-keyframes tada { + from { + -webkit-transform: scale3d(1, 1, 1); + transform: scale3d(1, 1, 1); + } + + 10%, + 20% { + -webkit-transform: scale3d(0.9, 0.9, 0.9) rotate3d(0, 0, 1, -3deg); + transform: scale3d(0.9, 0.9, 0.9) rotate3d(0, 0, 1, -3deg); + } + + 30%, + 50%, + 70%, + 90% { + -webkit-transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg); + transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg); + } + + 40%, + 60%, + 80% { + -webkit-transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg); + transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg); + } + + to { + -webkit-transform: scale3d(1, 1, 1); + transform: scale3d(1, 1, 1); + } +} +@keyframes tada { + from { + -webkit-transform: scale3d(1, 1, 1); + transform: scale3d(1, 1, 1); + } + + 10%, + 20% { + -webkit-transform: scale3d(0.9, 0.9, 0.9) rotate3d(0, 0, 1, -3deg); + transform: scale3d(0.9, 0.9, 0.9) rotate3d(0, 0, 1, -3deg); + } + + 30%, + 50%, + 70%, + 90% { + -webkit-transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg); + transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg); + } + + 40%, + 60%, + 80% { + -webkit-transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg); + transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg); + } + + to { + -webkit-transform: scale3d(1, 1, 1); + transform: scale3d(1, 1, 1); + } +} +.animate__tada { + -webkit-animation-name: tada; + animation-name: tada; +} +/* originally authored by Nick Pettit - https://github.com/nickpettit/glide */ +@-webkit-keyframes wobble { + from { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + + 15% { + -webkit-transform: translate3d(-25%, 0, 0) rotate3d(0, 0, 1, -5deg); + transform: translate3d(-25%, 0, 0) rotate3d(0, 0, 1, -5deg); + } + + 30% { + -webkit-transform: translate3d(20%, 0, 0) rotate3d(0, 0, 1, 3deg); + transform: translate3d(20%, 0, 0) rotate3d(0, 0, 1, 3deg); + } + + 45% { + -webkit-transform: translate3d(-15%, 0, 0) rotate3d(0, 0, 1, -3deg); + transform: translate3d(-15%, 0, 0) rotate3d(0, 0, 1, -3deg); + } + + 60% { + -webkit-transform: translate3d(10%, 0, 0) rotate3d(0, 0, 1, 2deg); + transform: translate3d(10%, 0, 0) rotate3d(0, 0, 1, 2deg); + } + + 75% { + -webkit-transform: translate3d(-5%, 0, 0) rotate3d(0, 0, 1, -1deg); + transform: translate3d(-5%, 0, 0) rotate3d(0, 0, 1, -1deg); + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +@keyframes wobble { + from { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + + 15% { + -webkit-transform: translate3d(-25%, 0, 0) rotate3d(0, 0, 1, -5deg); + transform: translate3d(-25%, 0, 0) rotate3d(0, 0, 1, -5deg); + } + + 30% { + -webkit-transform: translate3d(20%, 0, 0) rotate3d(0, 0, 1, 3deg); + transform: translate3d(20%, 0, 0) rotate3d(0, 0, 1, 3deg); + } + + 45% { + -webkit-transform: translate3d(-15%, 0, 0) rotate3d(0, 0, 1, -3deg); + transform: translate3d(-15%, 0, 0) rotate3d(0, 0, 1, -3deg); + } + + 60% { + -webkit-transform: translate3d(10%, 0, 0) rotate3d(0, 0, 1, 2deg); + transform: translate3d(10%, 0, 0) rotate3d(0, 0, 1, 2deg); + } + + 75% { + -webkit-transform: translate3d(-5%, 0, 0) rotate3d(0, 0, 1, -1deg); + transform: translate3d(-5%, 0, 0) rotate3d(0, 0, 1, -1deg); + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +.animate__wobble { + -webkit-animation-name: wobble; + animation-name: wobble; +} +@-webkit-keyframes jello { + from, + 11.1%, + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + + 22.2% { + -webkit-transform: skewX(-12.5deg) skewY(-12.5deg); + transform: skewX(-12.5deg) skewY(-12.5deg); + } + + 33.3% { + -webkit-transform: skewX(6.25deg) skewY(6.25deg); + transform: skewX(6.25deg) skewY(6.25deg); + } + + 44.4% { + -webkit-transform: skewX(-3.125deg) skewY(-3.125deg); + transform: skewX(-3.125deg) skewY(-3.125deg); + } + + 55.5% { + -webkit-transform: skewX(1.5625deg) skewY(1.5625deg); + transform: skewX(1.5625deg) skewY(1.5625deg); + } + + 66.6% { + -webkit-transform: skewX(-0.78125deg) skewY(-0.78125deg); + transform: skewX(-0.78125deg) skewY(-0.78125deg); + } + + 77.7% { + -webkit-transform: skewX(0.390625deg) skewY(0.390625deg); + transform: skewX(0.390625deg) skewY(0.390625deg); + } + + 88.8% { + -webkit-transform: skewX(-0.1953125deg) skewY(-0.1953125deg); + transform: skewX(-0.1953125deg) skewY(-0.1953125deg); + } +} +@keyframes jello { + from, + 11.1%, + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + + 22.2% { + -webkit-transform: skewX(-12.5deg) skewY(-12.5deg); + transform: skewX(-12.5deg) skewY(-12.5deg); + } + + 33.3% { + -webkit-transform: skewX(6.25deg) skewY(6.25deg); + transform: skewX(6.25deg) skewY(6.25deg); + } + + 44.4% { + -webkit-transform: skewX(-3.125deg) skewY(-3.125deg); + transform: skewX(-3.125deg) skewY(-3.125deg); + } + + 55.5% { + -webkit-transform: skewX(1.5625deg) skewY(1.5625deg); + transform: skewX(1.5625deg) skewY(1.5625deg); + } + + 66.6% { + -webkit-transform: skewX(-0.78125deg) skewY(-0.78125deg); + transform: skewX(-0.78125deg) skewY(-0.78125deg); + } + + 77.7% { + -webkit-transform: skewX(0.390625deg) skewY(0.390625deg); + transform: skewX(0.390625deg) skewY(0.390625deg); + } + + 88.8% { + -webkit-transform: skewX(-0.1953125deg) skewY(-0.1953125deg); + transform: skewX(-0.1953125deg) skewY(-0.1953125deg); + } +} +.animate__jello { + -webkit-animation-name: jello; + animation-name: jello; + -webkit-transform-origin: center; + transform-origin: center; +} +@-webkit-keyframes heartBeat { + 0% { + -webkit-transform: scale(1); + transform: scale(1); + } + + 14% { + -webkit-transform: scale(1.3); + transform: scale(1.3); + } + + 28% { + -webkit-transform: scale(1); + transform: scale(1); + } + + 42% { + -webkit-transform: scale(1.3); + transform: scale(1.3); + } + + 70% { + -webkit-transform: scale(1); + transform: scale(1); + } +} +@keyframes heartBeat { + 0% { + -webkit-transform: scale(1); + transform: scale(1); + } + + 14% { + -webkit-transform: scale(1.3); + transform: scale(1.3); + } + + 28% { + -webkit-transform: scale(1); + transform: scale(1); + } + + 42% { + -webkit-transform: scale(1.3); + transform: scale(1.3); + } + + 70% { + -webkit-transform: scale(1); + transform: scale(1); + } +} +.animate__heartBeat { + -webkit-animation-name: heartBeat; + animation-name: heartBeat; + -webkit-animation-duration: calc(1s * 1.3); + animation-duration: calc(1s * 1.3); + -webkit-animation-duration: calc(var(--animate-duration) * 1.3); + animation-duration: calc(var(--animate-duration) * 1.3); + -webkit-animation-timing-function: ease-in-out; + animation-timing-function: ease-in-out; +} +/* Back entrances */ +@-webkit-keyframes backInDown { + 0% { + -webkit-transform: translateY(-1200px) scale(0.7); + transform: translateY(-1200px) scale(0.7); + opacity: 0.7; + } + + 80% { + -webkit-transform: translateY(0px) scale(0.7); + transform: translateY(0px) scale(0.7); + opacity: 0.7; + } + + 100% { + -webkit-transform: scale(1); + transform: scale(1); + opacity: 1; + } +} +@keyframes backInDown { + 0% { + -webkit-transform: translateY(-1200px) scale(0.7); + transform: translateY(-1200px) scale(0.7); + opacity: 0.7; + } + + 80% { + -webkit-transform: translateY(0px) scale(0.7); + transform: translateY(0px) scale(0.7); + opacity: 0.7; + } + + 100% { + -webkit-transform: scale(1); + transform: scale(1); + opacity: 1; + } +} +.animate__backInDown { + -webkit-animation-name: backInDown; + animation-name: backInDown; +} +@-webkit-keyframes backInLeft { + 0% { + -webkit-transform: translateX(-2000px) scale(0.7); + transform: translateX(-2000px) scale(0.7); + opacity: 0.7; + } + + 80% { + -webkit-transform: translateX(0px) scale(0.7); + transform: translateX(0px) scale(0.7); + opacity: 0.7; + } + + 100% { + -webkit-transform: scale(1); + transform: scale(1); + opacity: 1; + } +} +@keyframes backInLeft { + 0% { + -webkit-transform: translateX(-2000px) scale(0.7); + transform: translateX(-2000px) scale(0.7); + opacity: 0.7; + } + + 80% { + -webkit-transform: translateX(0px) scale(0.7); + transform: translateX(0px) scale(0.7); + opacity: 0.7; + } + + 100% { + -webkit-transform: scale(1); + transform: scale(1); + opacity: 1; + } +} +.animate__backInLeft { + -webkit-animation-name: backInLeft; + animation-name: backInLeft; +} +@-webkit-keyframes backInRight { + 0% { + -webkit-transform: translateX(2000px) scale(0.7); + transform: translateX(2000px) scale(0.7); + opacity: 0.7; + } + + 80% { + -webkit-transform: translateX(0px) scale(0.7); + transform: translateX(0px) scale(0.7); + opacity: 0.7; + } + + 100% { + -webkit-transform: scale(1); + transform: scale(1); + opacity: 1; + } +} +@keyframes backInRight { + 0% { + -webkit-transform: translateX(2000px) scale(0.7); + transform: translateX(2000px) scale(0.7); + opacity: 0.7; + } + + 80% { + -webkit-transform: translateX(0px) scale(0.7); + transform: translateX(0px) scale(0.7); + opacity: 0.7; + } + + 100% { + -webkit-transform: scale(1); + transform: scale(1); + opacity: 1; + } +} +.animate__backInRight { + -webkit-animation-name: backInRight; + animation-name: backInRight; +} +@-webkit-keyframes backInUp { + 0% { + -webkit-transform: translateY(1200px) scale(0.7); + transform: translateY(1200px) scale(0.7); + opacity: 0.7; + } + + 80% { + -webkit-transform: translateY(0px) scale(0.7); + transform: translateY(0px) scale(0.7); + opacity: 0.7; + } + + 100% { + -webkit-transform: scale(1); + transform: scale(1); + opacity: 1; + } +} +@keyframes backInUp { + 0% { + -webkit-transform: translateY(1200px) scale(0.7); + transform: translateY(1200px) scale(0.7); + opacity: 0.7; + } + + 80% { + -webkit-transform: translateY(0px) scale(0.7); + transform: translateY(0px) scale(0.7); + opacity: 0.7; + } + + 100% { + -webkit-transform: scale(1); + transform: scale(1); + opacity: 1; + } +} +.animate__backInUp { + -webkit-animation-name: backInUp; + animation-name: backInUp; +} +/* Back exists */ +@-webkit-keyframes backOutDown { + 0% { + -webkit-transform: scale(1); + transform: scale(1); + opacity: 1; + } + + 20% { + -webkit-transform: translateY(0px) scale(0.7); + transform: translateY(0px) scale(0.7); + opacity: 0.7; + } + + 100% { + -webkit-transform: translateY(700px) scale(0.7); + transform: translateY(700px) scale(0.7); + opacity: 0.0; + } +} +@keyframes backOutDown { + 0% { + -webkit-transform: scale(1); + transform: scale(1); + opacity: 1; + } + + 20% { + -webkit-transform: translateY(0px) scale(0.7); + transform: translateY(0px) scale(0.7); + opacity: 0.7; + } + + 100% { + -webkit-transform: translateY(700px) scale(0.7); + transform: translateY(700px) scale(0.7); + opacity: 0.7; + } +} +.animate__backOutDown { + -webkit-animation-name: backOutDown; + animation-name: backOutDown; +} +@-webkit-keyframes backOutLeft { + 0% { + -webkit-transform: scale(1); + transform: scale(1); + opacity: 1; + } + + 20% { + -webkit-transform: translateX(0px) scale(0.7); + transform: translateX(0px) scale(0.7); + opacity: 0.7; + } + + 100% { + -webkit-transform: translateX(-2000px) scale(0.7); + transform: translateX(-2000px) scale(0.7); + opacity: 0.7; + } +} +@keyframes backOutLeft { + 0% { + -webkit-transform: scale(1); + transform: scale(1); + opacity: 1; + } + + 20% { + -webkit-transform: translateX(0px) scale(0.7); + transform: translateX(0px) scale(0.7); + opacity: 0.7; + } + + 100% { + -webkit-transform: translateX(-2000px) scale(0.7); + transform: translateX(-2000px) scale(0.7); + opacity: 0.7; + } +} +.animate__backOutLeft { + -webkit-animation-name: backOutLeft; + animation-name: backOutLeft; +} +@-webkit-keyframes backOutRight { + 0% { + -webkit-transform: scale(1); + transform: scale(1); + opacity: 1; + } + + 20% { + -webkit-transform: translateX(0px) scale(0.7); + transform: translateX(0px) scale(0.7); + opacity: 0.7; + } + + 100% { + -webkit-transform: translateX(2000px) scale(0.7); + transform: translateX(2000px) scale(0.7); + opacity: 0.7; + } +} +@keyframes backOutRight { + 0% { + -webkit-transform: scale(1); + transform: scale(1); + opacity: 1; + } + + 20% { + -webkit-transform: translateX(0px) scale(0.7); + transform: translateX(0px) scale(0.7); + opacity: 0.7; + } + + 100% { + -webkit-transform: translateX(2000px) scale(0.7); + transform: translateX(2000px) scale(0.7); + opacity: 0.7; + } +} +.animate__backOutRight { + -webkit-animation-name: backOutRight; + animation-name: backOutRight; +} +@-webkit-keyframes backOutUp { + 0% { + -webkit-transform: scale(1); + transform: scale(1); + opacity: 1; + } + + 20% { + -webkit-transform: translateY(0px) scale(0.7); + transform: translateY(0px) scale(0.7); + opacity: 0.7; + } + + 100% { + -webkit-transform: translateY(-700px) scale(0.7); + transform: translateY(-700px) scale(0.7); + opacity: 0.7; + } +} +@keyframes backOutUp { + 0% { + -webkit-transform: scale(1); + transform: scale(1); + opacity: 1; + } + + 20% { + -webkit-transform: translateY(0px) scale(0.7); + transform: translateY(0px) scale(0.7); + opacity: 0.7; + } + + 100% { + -webkit-transform: translateY(-700px) scale(0.7); + transform: translateY(-700px) scale(0.7); + opacity: 0.7; + } +} +.animate__backOutUp { + -webkit-animation-name: backOutUp; + animation-name: backOutUp; +} +/* Bouncing entrances */ +@-webkit-keyframes bounceIn { + from, + 20%, + 40%, + 60%, + 80%, + to { + -webkit-animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + } + + 0% { + opacity: 0; + -webkit-transform: scale3d(0.3, 0.3, 0.3); + transform: scale3d(0.3, 0.3, 0.3); + } + + 20% { + -webkit-transform: scale3d(1.1, 1.1, 1.1); + transform: scale3d(1.1, 1.1, 1.1); + } + + 40% { + -webkit-transform: scale3d(0.9, 0.9, 0.9); + transform: scale3d(0.9, 0.9, 0.9); + } + + 60% { + opacity: 1; + -webkit-transform: scale3d(1.03, 1.03, 1.03); + transform: scale3d(1.03, 1.03, 1.03); + } + + 80% { + -webkit-transform: scale3d(0.97, 0.97, 0.97); + transform: scale3d(0.97, 0.97, 0.97); + } + + to { + opacity: 1; + -webkit-transform: scale3d(1, 1, 1); + transform: scale3d(1, 1, 1); + } +} +@keyframes bounceIn { + from, + 20%, + 40%, + 60%, + 80%, + to { + -webkit-animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + } + + 0% { + opacity: 0; + -webkit-transform: scale3d(0.3, 0.3, 0.3); + transform: scale3d(0.3, 0.3, 0.3); + } + + 20% { + -webkit-transform: scale3d(1.1, 1.1, 1.1); + transform: scale3d(1.1, 1.1, 1.1); + } + + 40% { + -webkit-transform: scale3d(0.9, 0.9, 0.9); + transform: scale3d(0.9, 0.9, 0.9); + } + + 60% { + opacity: 1; + -webkit-transform: scale3d(1.03, 1.03, 1.03); + transform: scale3d(1.03, 1.03, 1.03); + } + + 80% { + -webkit-transform: scale3d(0.97, 0.97, 0.97); + transform: scale3d(0.97, 0.97, 0.97); + } + + to { + opacity: 1; + -webkit-transform: scale3d(1, 1, 1); + transform: scale3d(1, 1, 1); + } +} +.animate__bounceIn { + -webkit-animation-duration: calc(1s * 0.75); + animation-duration: calc(1s * 0.75); + -webkit-animation-duration: calc(var(--animate-duration) * 0.75); + animation-duration: calc(var(--animate-duration) * 0.75); + -webkit-animation-name: bounceIn; + animation-name: bounceIn; +} +@-webkit-keyframes bounceInDown { + from, + 60%, + 75%, + 90%, + to { + -webkit-animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + } + + 0% { + opacity: 0; + -webkit-transform: translate3d(0, -3000px, 0) scaleY(3); + transform: translate3d(0, -3000px, 0) scaleY(3); + } + + 60% { + opacity: 1; + -webkit-transform: translate3d(0, 25px, 0) scaleY(0.9); + transform: translate3d(0, 25px, 0) scaleY(0.9); + } + + 75% { + -webkit-transform: translate3d(0, -10px, 0) scaleY(0.95); + transform: translate3d(0, -10px, 0) scaleY(0.95); + } + + 90% { + -webkit-transform: translate3d(0, 5px, 0) scaleY(0.985); + transform: translate3d(0, 5px, 0) scaleY(0.985); + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +@keyframes bounceInDown { + from, + 60%, + 75%, + 90%, + to { + -webkit-animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + } + + 0% { + opacity: 0; + -webkit-transform: translate3d(0, -3000px, 0) scaleY(3); + transform: translate3d(0, -3000px, 0) scaleY(3); + } + + 60% { + opacity: 1; + -webkit-transform: translate3d(0, 25px, 0) scaleY(0.9); + transform: translate3d(0, 25px, 0) scaleY(0.9); + } + + 75% { + -webkit-transform: translate3d(0, -10px, 0) scaleY(0.95); + transform: translate3d(0, -10px, 0) scaleY(0.95); + } + + 90% { + -webkit-transform: translate3d(0, 5px, 0) scaleY(0.985); + transform: translate3d(0, 5px, 0) scaleY(0.985); + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +.animate__bounceInDown { + -webkit-animation-name: bounceInDown; + animation-name: bounceInDown; +} +@-webkit-keyframes bounceInLeft { + from, + 60%, + 75%, + 90%, + to { + -webkit-animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + } + + 0% { + opacity: 0; + -webkit-transform: translate3d(-3000px, 0, 0) scaleX(3); + transform: translate3d(-3000px, 0, 0) scaleX(3); + } + + 60% { + opacity: 1; + -webkit-transform: translate3d(25px, 0, 0) scaleX(1); + transform: translate3d(25px, 0, 0) scaleX(1); + } + + 75% { + -webkit-transform: translate3d(-10px, 0, 0) scaleX(0.98); + transform: translate3d(-10px, 0, 0) scaleX(0.98); + } + + 90% { + -webkit-transform: translate3d(5px, 0, 0) scaleX(0.995); + transform: translate3d(5px, 0, 0) scaleX(0.995); + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +@keyframes bounceInLeft { + from, + 60%, + 75%, + 90%, + to { + -webkit-animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + } + + 0% { + opacity: 0; + -webkit-transform: translate3d(-3000px, 0, 0) scaleX(3); + transform: translate3d(-3000px, 0, 0) scaleX(3); + } + + 60% { + opacity: 1; + -webkit-transform: translate3d(25px, 0, 0) scaleX(1); + transform: translate3d(25px, 0, 0) scaleX(1); + } + + 75% { + -webkit-transform: translate3d(-10px, 0, 0) scaleX(0.98); + transform: translate3d(-10px, 0, 0) scaleX(0.98); + } + + 90% { + -webkit-transform: translate3d(5px, 0, 0) scaleX(0.995); + transform: translate3d(5px, 0, 0) scaleX(0.995); + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +.animate__bounceInLeft { + -webkit-animation-name: bounceInLeft; + animation-name: bounceInLeft; +} +@-webkit-keyframes bounceInRight { + from, + 60%, + 75%, + 90%, + to { + -webkit-animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + } + + from { + opacity: 0; + -webkit-transform: translate3d(3000px, 0, 0) scaleX(3); + transform: translate3d(3000px, 0, 0) scaleX(3); + } + + 60% { + opacity: 1; + -webkit-transform: translate3d(-25px, 0, 0) scaleX(1); + transform: translate3d(-25px, 0, 0) scaleX(1); + } + + 75% { + -webkit-transform: translate3d(10px, 0, 0) scaleX(0.98); + transform: translate3d(10px, 0, 0) scaleX(0.98); + } + + 90% { + -webkit-transform: translate3d(-5px, 0, 0) scaleX(0.995); + transform: translate3d(-5px, 0, 0) scaleX(0.995); + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +@keyframes bounceInRight { + from, + 60%, + 75%, + 90%, + to { + -webkit-animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + } + + from { + opacity: 0; + -webkit-transform: translate3d(3000px, 0, 0) scaleX(3); + transform: translate3d(3000px, 0, 0) scaleX(3); + } + + 60% { + opacity: 1; + -webkit-transform: translate3d(-25px, 0, 0) scaleX(1); + transform: translate3d(-25px, 0, 0) scaleX(1); + } + + 75% { + -webkit-transform: translate3d(10px, 0, 0) scaleX(0.98); + transform: translate3d(10px, 0, 0) scaleX(0.98); + } + + 90% { + -webkit-transform: translate3d(-5px, 0, 0) scaleX(0.995); + transform: translate3d(-5px, 0, 0) scaleX(0.995); + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +.animate__bounceInRight { + -webkit-animation-name: bounceInRight; + animation-name: bounceInRight; +} +@-webkit-keyframes bounceInUp { + from, + 60%, + 75%, + 90%, + to { + -webkit-animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + } + + from { + opacity: 0; + -webkit-transform: translate3d(0, 3000px, 0) scaleY(5); + transform: translate3d(0, 3000px, 0) scaleY(5); + } + + 60% { + opacity: 1; + -webkit-transform: translate3d(0, -20px, 0) scaleY(0.9); + transform: translate3d(0, -20px, 0) scaleY(0.9); + } + + 75% { + -webkit-transform: translate3d(0, 10px, 0) scaleY(0.95); + transform: translate3d(0, 10px, 0) scaleY(0.95); + } + + 90% { + -webkit-transform: translate3d(0, -5px, 0) scaleY(0.985); + transform: translate3d(0, -5px, 0) scaleY(0.985); + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +@keyframes bounceInUp { + from, + 60%, + 75%, + 90%, + to { + -webkit-animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); + } + + from { + opacity: 0; + -webkit-transform: translate3d(0, 3000px, 0) scaleY(5); + transform: translate3d(0, 3000px, 0) scaleY(5); + } + + 60% { + opacity: 1; + -webkit-transform: translate3d(0, -20px, 0) scaleY(0.9); + transform: translate3d(0, -20px, 0) scaleY(0.9); + } + + 75% { + -webkit-transform: translate3d(0, 10px, 0) scaleY(0.95); + transform: translate3d(0, 10px, 0) scaleY(0.95); + } + + 90% { + -webkit-transform: translate3d(0, -5px, 0) scaleY(0.985); + transform: translate3d(0, -5px, 0) scaleY(0.985); + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +.animate__bounceInUp { + -webkit-animation-name: bounceInUp; + animation-name: bounceInUp; +} +/* Bouncing exits */ +@-webkit-keyframes bounceOut { + 20% { + -webkit-transform: scale3d(0.9, 0.9, 0.9); + transform: scale3d(0.9, 0.9, 0.9); + } + + 50%, + 55% { + opacity: 1; + -webkit-transform: scale3d(1.1, 1.1, 1.1); + transform: scale3d(1.1, 1.1, 1.1); + } + + to { + opacity: 0; + -webkit-transform: scale3d(0.3, 0.3, 0.3); + transform: scale3d(0.3, 0.3, 0.3); + } +} +@keyframes bounceOut { + 20% { + -webkit-transform: scale3d(0.9, 0.9, 0.9); + transform: scale3d(0.9, 0.9, 0.9); + } + + 50%, + 55% { + opacity: 1; + -webkit-transform: scale3d(1.1, 1.1, 1.1); + transform: scale3d(1.1, 1.1, 1.1); + } + + to { + opacity: 0; + -webkit-transform: scale3d(0.3, 0.3, 0.3); + transform: scale3d(0.3, 0.3, 0.3); + } +} +.animate__bounceOut { + -webkit-animation-duration: calc(1s * 0.75); + animation-duration: calc(1s * 0.75); + -webkit-animation-duration: calc(var(--animate-duration) * 0.75); + animation-duration: calc(var(--animate-duration) * 0.75); + -webkit-animation-name: bounceOut; + animation-name: bounceOut; +} +@-webkit-keyframes bounceOutDown { + 20% { + -webkit-transform: translate3d(0, 10px, 0) scaleY(0.985); + transform: translate3d(0, 10px, 0) scaleY(0.985); + } + + 40%, + 45% { + opacity: 1; + -webkit-transform: translate3d(0, -20px, 0) scaleY(0.9); + transform: translate3d(0, -20px, 0) scaleY(0.9); + } + + to { + opacity: 0; + -webkit-transform: translate3d(0, 2000px, 0) scaleY(3); + transform: translate3d(0, 2000px, 0) scaleY(3); + } +} +@keyframes bounceOutDown { + 20% { + -webkit-transform: translate3d(0, 10px, 0) scaleY(0.985); + transform: translate3d(0, 10px, 0) scaleY(0.985); + } + + 40%, + 45% { + opacity: 1; + -webkit-transform: translate3d(0, -20px, 0) scaleY(0.9); + transform: translate3d(0, -20px, 0) scaleY(0.9); + } + + to { + opacity: 0; + -webkit-transform: translate3d(0, 2000px, 0) scaleY(3); + transform: translate3d(0, 2000px, 0) scaleY(3); + } +} +.animate__bounceOutDown { + -webkit-animation-name: bounceOutDown; + animation-name: bounceOutDown; +} +@-webkit-keyframes bounceOutLeft { + 20% { + opacity: 1; + -webkit-transform: translate3d(20px, 0, 0) scaleX(0.9); + transform: translate3d(20px, 0, 0) scaleX(0.9); + } + + to { + opacity: 0; + -webkit-transform: translate3d(-2000px, 0, 0) scaleX(2); + transform: translate3d(-2000px, 0, 0) scaleX(2); + } +} +@keyframes bounceOutLeft { + 20% { + opacity: 1; + -webkit-transform: translate3d(20px, 0, 0) scaleX(0.9); + transform: translate3d(20px, 0, 0) scaleX(0.9); + } + + to { + opacity: 0; + -webkit-transform: translate3d(-2000px, 0, 0) scaleX(2); + transform: translate3d(-2000px, 0, 0) scaleX(2); + } +} +.animate__bounceOutLeft { + -webkit-animation-name: bounceOutLeft; + animation-name: bounceOutLeft; +} +@-webkit-keyframes bounceOutRight { + 20% { + opacity: 1; + -webkit-transform: translate3d(-20px, 0, 0) scaleX(0.9); + transform: translate3d(-20px, 0, 0) scaleX(0.9); + } + + to { + opacity: 0; + -webkit-transform: translate3d(2000px, 0, 0) scaleX(2); + transform: translate3d(2000px, 0, 0) scaleX(2); + } +} +@keyframes bounceOutRight { + 20% { + opacity: 1; + -webkit-transform: translate3d(-20px, 0, 0) scaleX(0.9); + transform: translate3d(-20px, 0, 0) scaleX(0.9); + } + + to { + opacity: 0; + -webkit-transform: translate3d(2000px, 0, 0) scaleX(2); + transform: translate3d(2000px, 0, 0) scaleX(2); + } +} +.animate__bounceOutRight { + -webkit-animation-name: bounceOutRight; + animation-name: bounceOutRight; +} +@-webkit-keyframes bounceOutUp { + 20% { + -webkit-transform: translate3d(0, -10px, 0) scaleY(0.985); + transform: translate3d(0, -10px, 0) scaleY(0.985); + } + + 40%, + 45% { + opacity: 1; + -webkit-transform: translate3d(0, 20px, 0) scaleY(0.9); + transform: translate3d(0, 20px, 0) scaleY(0.9); + } + + to { + opacity: 0; + -webkit-transform: translate3d(0, -2000px, 0) scaleY(3); + transform: translate3d(0, -2000px, 0) scaleY(3); + } +} +@keyframes bounceOutUp { + 20% { + -webkit-transform: translate3d(0, -10px, 0) scaleY(0.985); + transform: translate3d(0, -10px, 0) scaleY(0.985); + } + + 40%, + 45% { + opacity: 1; + -webkit-transform: translate3d(0, 20px, 0) scaleY(0.9); + transform: translate3d(0, 20px, 0) scaleY(0.9); + } + + to { + opacity: 0; + -webkit-transform: translate3d(0, -2000px, 0) scaleY(3); + transform: translate3d(0, -2000px, 0) scaleY(3); + } +} +.animate__bounceOutUp { + -webkit-animation-name: bounceOutUp; + animation-name: bounceOutUp; +} +/* Fading entrances */ +@-webkit-keyframes fadeIn { + from { + opacity: 0; + } + + to { + opacity: 1; + } +} +@keyframes fadeIn { + from { + opacity: 0; + } + + to { + opacity: 1; + } +} +.animate__fadeIn { + -webkit-animation-name: fadeIn; + animation-name: fadeIn; +} +@-webkit-keyframes fadeInDown { + from { + opacity: 0; + -webkit-transform: translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0); + } + + to { + opacity: 1; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +@keyframes fadeInDown { + from { + opacity: 0; + -webkit-transform: translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0); + } + + to { + opacity: 1; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +.animate__fadeInDown { + -webkit-animation-name: fadeInDown; + animation-name: fadeInDown; +} +@-webkit-keyframes fadeInDownBig { + from { + opacity: 0; + -webkit-transform: translate3d(0, -2000px, 0); + transform: translate3d(0, -2000px, 0); + } + + to { + opacity: 1; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +@keyframes fadeInDownBig { + from { + opacity: 0; + -webkit-transform: translate3d(0, -2000px, 0); + transform: translate3d(0, -2000px, 0); + } + + to { + opacity: 1; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +.animate__fadeInDownBig { + -webkit-animation-name: fadeInDownBig; + animation-name: fadeInDownBig; +} +@-webkit-keyframes fadeInLeft { + from { + opacity: 0; + -webkit-transform: translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0); + } + + to { + opacity: 1; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +@keyframes fadeInLeft { + from { + opacity: 0; + -webkit-transform: translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0); + } + + to { + opacity: 1; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +.animate__fadeInLeft { + -webkit-animation-name: fadeInLeft; + animation-name: fadeInLeft; +} +@-webkit-keyframes fadeInLeftBig { + from { + opacity: 0; + -webkit-transform: translate3d(-2000px, 0, 0); + transform: translate3d(-2000px, 0, 0); + } + + to { + opacity: 1; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +@keyframes fadeInLeftBig { + from { + opacity: 0; + -webkit-transform: translate3d(-2000px, 0, 0); + transform: translate3d(-2000px, 0, 0); + } + + to { + opacity: 1; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +.animate__fadeInLeftBig { + -webkit-animation-name: fadeInLeftBig; + animation-name: fadeInLeftBig; +} +@-webkit-keyframes fadeInRight { + from { + opacity: 0; + -webkit-transform: translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0); + } + + to { + opacity: 1; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +@keyframes fadeInRight { + from { + opacity: 0; + -webkit-transform: translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0); + } + + to { + opacity: 1; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +.animate__fadeInRight { + -webkit-animation-name: fadeInRight; + animation-name: fadeInRight; +} +@-webkit-keyframes fadeInRightBig { + from { + opacity: 0; + -webkit-transform: translate3d(2000px, 0, 0); + transform: translate3d(2000px, 0, 0); + } + + to { + opacity: 1; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +@keyframes fadeInRightBig { + from { + opacity: 0; + -webkit-transform: translate3d(2000px, 0, 0); + transform: translate3d(2000px, 0, 0); + } + + to { + opacity: 1; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +.animate__fadeInRightBig { + -webkit-animation-name: fadeInRightBig; + animation-name: fadeInRightBig; +} +@-webkit-keyframes fadeInUp { + from { + opacity: 0; + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); + } + + to { + opacity: 1; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +@keyframes fadeInUp { + from { + opacity: 0; + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); + } + + to { + opacity: 1; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +.animate__fadeInUp { + -webkit-animation-name: fadeInUp; + animation-name: fadeInUp; +} +@-webkit-keyframes fadeInUpBig { + from { + opacity: 0; + -webkit-transform: translate3d(0, 2000px, 0); + transform: translate3d(0, 2000px, 0); + } + + to { + opacity: 1; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +@keyframes fadeInUpBig { + from { + opacity: 0; + -webkit-transform: translate3d(0, 2000px, 0); + transform: translate3d(0, 2000px, 0); + } + + to { + opacity: 1; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +.animate__fadeInUpBig { + -webkit-animation-name: fadeInUpBig; + animation-name: fadeInUpBig; +} +@-webkit-keyframes fadeInTopLeft { + from { + opacity: 0; + -webkit-transform: translate3d(-100%, -100%, 0); + transform: translate3d(-100%, -100%, 0); + } + to { + opacity: 1; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +@keyframes fadeInTopLeft { + from { + opacity: 0; + -webkit-transform: translate3d(-100%, -100%, 0); + transform: translate3d(-100%, -100%, 0); + } + to { + opacity: 1; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +.animate__fadeInTopLeft { + -webkit-animation-name: fadeInTopLeft; + animation-name: fadeInTopLeft; +} +@-webkit-keyframes fadeInTopRight { + from { + opacity: 0; + -webkit-transform: translate3d(100%, -100%, 0); + transform: translate3d(100%, -100%, 0); + } + to { + opacity: 1; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +@keyframes fadeInTopRight { + from { + opacity: 0; + -webkit-transform: translate3d(100%, -100%, 0); + transform: translate3d(100%, -100%, 0); + } + to { + opacity: 1; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +.animate__fadeInTopRight { + -webkit-animation-name: fadeInTopRight; + animation-name: fadeInTopRight; +} +@-webkit-keyframes fadeInBottomLeft { + from { + opacity: 0; + -webkit-transform: translate3d(-100%, 100%, 0); + transform: translate3d(-100%, 100%, 0); + } + to { + opacity: 1; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +@keyframes fadeInBottomLeft { + from { + opacity: 0; + -webkit-transform: translate3d(-100%, 100%, 0); + transform: translate3d(-100%, 100%, 0); + } + to { + opacity: 1; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +.animate__fadeInBottomLeft { + -webkit-animation-name: fadeInBottomLeft; + animation-name: fadeInBottomLeft; +} +@-webkit-keyframes fadeInBottomRight { + from { + opacity: 0; + -webkit-transform: translate3d(100%, 100%, 0); + transform: translate3d(100%, 100%, 0); + } + to { + opacity: 1; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +@keyframes fadeInBottomRight { + from { + opacity: 0; + -webkit-transform: translate3d(100%, 100%, 0); + transform: translate3d(100%, 100%, 0); + } + to { + opacity: 1; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +.animate__fadeInBottomRight { + -webkit-animation-name: fadeInBottomRight; + animation-name: fadeInBottomRight; +} +/* Fading exits */ +@-webkit-keyframes fadeOut { + from { + opacity: 1; + } + + to { + opacity: 0; + } +} +@keyframes fadeOut { + from { + opacity: 1; + } + + to { + opacity: 0; + } +} +.animate__fadeOut { + -webkit-animation-name: fadeOut; + animation-name: fadeOut; +} +@-webkit-keyframes fadeOutDown { + from { + opacity: 1; + } + + to { + opacity: 0; + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); + } +} +@keyframes fadeOutDown { + from { + opacity: 1; + } + + to { + opacity: 0; + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); + } +} +.animate__fadeOutDown { + -webkit-animation-name: fadeOutDown; + animation-name: fadeOutDown; +} +@-webkit-keyframes fadeOutDownBig { + from { + opacity: 1; + } + + to { + opacity: 0; + -webkit-transform: translate3d(0, 2000px, 0); + transform: translate3d(0, 2000px, 0); + } +} +@keyframes fadeOutDownBig { + from { + opacity: 1; + } + + to { + opacity: 0; + -webkit-transform: translate3d(0, 2000px, 0); + transform: translate3d(0, 2000px, 0); + } +} +.animate__fadeOutDownBig { + -webkit-animation-name: fadeOutDownBig; + animation-name: fadeOutDownBig; +} +@-webkit-keyframes fadeOutLeft { + from { + opacity: 1; + } + + to { + opacity: 0; + -webkit-transform: translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0); + } +} +@keyframes fadeOutLeft { + from { + opacity: 1; + } + + to { + opacity: 0; + -webkit-transform: translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0); + } +} +.animate__fadeOutLeft { + -webkit-animation-name: fadeOutLeft; + animation-name: fadeOutLeft; +} +@-webkit-keyframes fadeOutLeftBig { + from { + opacity: 1; + } + + to { + opacity: 0; + -webkit-transform: translate3d(-2000px, 0, 0); + transform: translate3d(-2000px, 0, 0); + } +} +@keyframes fadeOutLeftBig { + from { + opacity: 1; + } + + to { + opacity: 0; + -webkit-transform: translate3d(-2000px, 0, 0); + transform: translate3d(-2000px, 0, 0); + } +} +.animate__fadeOutLeftBig { + -webkit-animation-name: fadeOutLeftBig; + animation-name: fadeOutLeftBig; +} +@-webkit-keyframes fadeOutRight { + from { + opacity: 1; + } + + to { + opacity: 0; + -webkit-transform: translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0); + } +} +@keyframes fadeOutRight { + from { + opacity: 1; + } + + to { + opacity: 0; + -webkit-transform: translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0); + } +} +.animate__fadeOutRight { + -webkit-animation-name: fadeOutRight; + animation-name: fadeOutRight; +} +@-webkit-keyframes fadeOutRightBig { + from { + opacity: 1; + } + + to { + opacity: 0; + -webkit-transform: translate3d(2000px, 0, 0); + transform: translate3d(2000px, 0, 0); + } +} +@keyframes fadeOutRightBig { + from { + opacity: 1; + } + + to { + opacity: 0; + -webkit-transform: translate3d(2000px, 0, 0); + transform: translate3d(2000px, 0, 0); + } +} +.animate__fadeOutRightBig { + -webkit-animation-name: fadeOutRightBig; + animation-name: fadeOutRightBig; +} +@-webkit-keyframes fadeOutUp { + from { + opacity: 1; + } + + to { + opacity: 0; + -webkit-transform: translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0); + } +} +@keyframes fadeOutUp { + from { + opacity: 1; + } + + to { + opacity: 0; + -webkit-transform: translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0); + } +} +.animate__fadeOutUp { + -webkit-animation-name: fadeOutUp; + animation-name: fadeOutUp; +} +@-webkit-keyframes fadeOutUpBig { + from { + opacity: 1; + } + + to { + opacity: 0; + -webkit-transform: translate3d(0, -2000px, 0); + transform: translate3d(0, -2000px, 0); + } +} +@keyframes fadeOutUpBig { + from { + opacity: 1; + } + + to { + opacity: 0; + -webkit-transform: translate3d(0, -2000px, 0); + transform: translate3d(0, -2000px, 0); + } +} +.animate__fadeOutUpBig { + -webkit-animation-name: fadeOutUpBig; + animation-name: fadeOutUpBig; +} +@-webkit-keyframes fadeOutTopLeft { + from { + opacity: 1; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + to { + opacity: 0; + -webkit-transform: translate3d(-100%, -100%, 0); + transform: translate3d(-100%, -100%, 0); + } +} +@keyframes fadeOutTopLeft { + from { + opacity: 1; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + to { + opacity: 0; + -webkit-transform: translate3d(-100%, -100%, 0); + transform: translate3d(-100%, -100%, 0); + } +} +.animate__fadeOutTopLeft { + -webkit-animation-name: fadeOutTopLeft; + animation-name: fadeOutTopLeft; +} +@-webkit-keyframes fadeOutTopRight { + from { + opacity: 1; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + to { + opacity: 0; + -webkit-transform: translate3d(100%, -100%, 0); + transform: translate3d(100%, -100%, 0); + } +} +@keyframes fadeOutTopRight { + from { + opacity: 1; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + to { + opacity: 0; + -webkit-transform: translate3d(100%, -100%, 0); + transform: translate3d(100%, -100%, 0); + } +} +.animate__fadeOutTopRight { + -webkit-animation-name: fadeOutTopRight; + animation-name: fadeOutTopRight; +} +@-webkit-keyframes fadeOutBottomRight { + from { + opacity: 1; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + to { + opacity: 0; + -webkit-transform: translate3d(100%, 100%, 0); + transform: translate3d(100%, 100%, 0); + } +} +@keyframes fadeOutBottomRight { + from { + opacity: 1; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + to { + opacity: 0; + -webkit-transform: translate3d(100%, 100%, 0); + transform: translate3d(100%, 100%, 0); + } +} +.animate__fadeOutBottomRight { + -webkit-animation-name: fadeOutBottomRight; + animation-name: fadeOutBottomRight; +} +@-webkit-keyframes fadeOutBottomLeft { + from { + opacity: 1; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + to { + opacity: 0; + -webkit-transform: translate3d(-100%, 100%, 0); + transform: translate3d(-100%, 100%, 0); + } +} +@keyframes fadeOutBottomLeft { + from { + opacity: 1; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + to { + opacity: 0; + -webkit-transform: translate3d(-100%, 100%, 0); + transform: translate3d(-100%, 100%, 0); + } +} +.animate__fadeOutBottomLeft { + -webkit-animation-name: fadeOutBottomLeft; + animation-name: fadeOutBottomLeft; +} +/* Flippers */ +@-webkit-keyframes flip { + from { + -webkit-transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 0) rotate3d(0, 1, 0, -360deg); + transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 0) rotate3d(0, 1, 0, -360deg); + -webkit-animation-timing-function: ease-out; + animation-timing-function: ease-out; + } + + 40% { + -webkit-transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 150px) + rotate3d(0, 1, 0, -190deg); + transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 150px) + rotate3d(0, 1, 0, -190deg); + -webkit-animation-timing-function: ease-out; + animation-timing-function: ease-out; + } + + 50% { + -webkit-transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 150px) + rotate3d(0, 1, 0, -170deg); + transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 150px) + rotate3d(0, 1, 0, -170deg); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + } + + 80% { + -webkit-transform: perspective(400px) scale3d(0.95, 0.95, 0.95) translate3d(0, 0, 0) + rotate3d(0, 1, 0, 0deg); + transform: perspective(400px) scale3d(0.95, 0.95, 0.95) translate3d(0, 0, 0) + rotate3d(0, 1, 0, 0deg); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + } + + to { + -webkit-transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 0) rotate3d(0, 1, 0, 0deg); + transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 0) rotate3d(0, 1, 0, 0deg); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + } +} +@keyframes flip { + from { + -webkit-transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 0) rotate3d(0, 1, 0, -360deg); + transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 0) rotate3d(0, 1, 0, -360deg); + -webkit-animation-timing-function: ease-out; + animation-timing-function: ease-out; + } + + 40% { + -webkit-transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 150px) + rotate3d(0, 1, 0, -190deg); + transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 150px) + rotate3d(0, 1, 0, -190deg); + -webkit-animation-timing-function: ease-out; + animation-timing-function: ease-out; + } + + 50% { + -webkit-transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 150px) + rotate3d(0, 1, 0, -170deg); + transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 150px) + rotate3d(0, 1, 0, -170deg); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + } + + 80% { + -webkit-transform: perspective(400px) scale3d(0.95, 0.95, 0.95) translate3d(0, 0, 0) + rotate3d(0, 1, 0, 0deg); + transform: perspective(400px) scale3d(0.95, 0.95, 0.95) translate3d(0, 0, 0) + rotate3d(0, 1, 0, 0deg); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + } + + to { + -webkit-transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 0) rotate3d(0, 1, 0, 0deg); + transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 0) rotate3d(0, 1, 0, 0deg); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + } +} +.animate__animated.animate__flip { + -webkit-backface-visibility: visible; + backface-visibility: visible; + -webkit-animation-name: flip; + animation-name: flip; +} +@-webkit-keyframes flipInX { + from { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + opacity: 0; + } + + 40% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + } + + 60% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 10deg); + transform: perspective(400px) rotate3d(1, 0, 0, 10deg); + opacity: 1; + } + + 80% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -5deg); + transform: perspective(400px) rotate3d(1, 0, 0, -5deg); + } + + to { + -webkit-transform: perspective(400px); + transform: perspective(400px); + } +} +@keyframes flipInX { + from { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + opacity: 0; + } + + 40% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + } + + 60% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 10deg); + transform: perspective(400px) rotate3d(1, 0, 0, 10deg); + opacity: 1; + } + + 80% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -5deg); + transform: perspective(400px) rotate3d(1, 0, 0, -5deg); + } + + to { + -webkit-transform: perspective(400px); + transform: perspective(400px); + } +} +.animate__flipInX { + -webkit-backface-visibility: visible !important; + backface-visibility: visible !important; + -webkit-animation-name: flipInX; + animation-name: flipInX; +} +@-webkit-keyframes flipInY { + from { + -webkit-transform: perspective(400px) rotate3d(0, 1, 0, 90deg); + transform: perspective(400px) rotate3d(0, 1, 0, 90deg); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + opacity: 0; + } + + 40% { + -webkit-transform: perspective(400px) rotate3d(0, 1, 0, -20deg); + transform: perspective(400px) rotate3d(0, 1, 0, -20deg); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + } + + 60% { + -webkit-transform: perspective(400px) rotate3d(0, 1, 0, 10deg); + transform: perspective(400px) rotate3d(0, 1, 0, 10deg); + opacity: 1; + } + + 80% { + -webkit-transform: perspective(400px) rotate3d(0, 1, 0, -5deg); + transform: perspective(400px) rotate3d(0, 1, 0, -5deg); + } + + to { + -webkit-transform: perspective(400px); + transform: perspective(400px); + } +} +@keyframes flipInY { + from { + -webkit-transform: perspective(400px) rotate3d(0, 1, 0, 90deg); + transform: perspective(400px) rotate3d(0, 1, 0, 90deg); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + opacity: 0; + } + + 40% { + -webkit-transform: perspective(400px) rotate3d(0, 1, 0, -20deg); + transform: perspective(400px) rotate3d(0, 1, 0, -20deg); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + } + + 60% { + -webkit-transform: perspective(400px) rotate3d(0, 1, 0, 10deg); + transform: perspective(400px) rotate3d(0, 1, 0, 10deg); + opacity: 1; + } + + 80% { + -webkit-transform: perspective(400px) rotate3d(0, 1, 0, -5deg); + transform: perspective(400px) rotate3d(0, 1, 0, -5deg); + } + + to { + -webkit-transform: perspective(400px); + transform: perspective(400px); + } +} +.animate__flipInY { + -webkit-backface-visibility: visible !important; + backface-visibility: visible !important; + -webkit-animation-name: flipInY; + animation-name: flipInY; +} +@-webkit-keyframes flipOutX { + from { + -webkit-transform: perspective(400px); + transform: perspective(400px); + } + + 30% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + opacity: 1; + } + + to { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + opacity: 0; + } +} +@keyframes flipOutX { + from { + -webkit-transform: perspective(400px); + transform: perspective(400px); + } + + 30% { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + opacity: 1; + } + + to { + -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + opacity: 0; + } +} +.animate__flipOutX { + -webkit-animation-duration: calc(1s * 0.75); + animation-duration: calc(1s * 0.75); + -webkit-animation-duration: calc(var(--animate-duration) * 0.75); + animation-duration: calc(var(--animate-duration) * 0.75); + -webkit-animation-name: flipOutX; + animation-name: flipOutX; + -webkit-backface-visibility: visible !important; + backface-visibility: visible !important; +} +@-webkit-keyframes flipOutY { + from { + -webkit-transform: perspective(400px); + transform: perspective(400px); + } + + 30% { + -webkit-transform: perspective(400px) rotate3d(0, 1, 0, -15deg); + transform: perspective(400px) rotate3d(0, 1, 0, -15deg); + opacity: 1; + } + + to { + -webkit-transform: perspective(400px) rotate3d(0, 1, 0, 90deg); + transform: perspective(400px) rotate3d(0, 1, 0, 90deg); + opacity: 0; + } +} +@keyframes flipOutY { + from { + -webkit-transform: perspective(400px); + transform: perspective(400px); + } + + 30% { + -webkit-transform: perspective(400px) rotate3d(0, 1, 0, -15deg); + transform: perspective(400px) rotate3d(0, 1, 0, -15deg); + opacity: 1; + } + + to { + -webkit-transform: perspective(400px) rotate3d(0, 1, 0, 90deg); + transform: perspective(400px) rotate3d(0, 1, 0, 90deg); + opacity: 0; + } +} +.animate__flipOutY { + -webkit-animation-duration: calc(1s * 0.75); + animation-duration: calc(1s * 0.75); + -webkit-animation-duration: calc(var(--animate-duration) * 0.75); + animation-duration: calc(var(--animate-duration) * 0.75); + -webkit-backface-visibility: visible !important; + backface-visibility: visible !important; + -webkit-animation-name: flipOutY; + animation-name: flipOutY; +} +/* Lightspeed */ +@-webkit-keyframes lightSpeedInRight { + from { + -webkit-transform: translate3d(100%, 0, 0) skewX(-30deg); + transform: translate3d(100%, 0, 0) skewX(-30deg); + opacity: 0; + } + + 60% { + -webkit-transform: skewX(20deg); + transform: skewX(20deg); + opacity: 1; + } + + 80% { + -webkit-transform: skewX(-5deg); + transform: skewX(-5deg); + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +@keyframes lightSpeedInRight { + from { + -webkit-transform: translate3d(100%, 0, 0) skewX(-30deg); + transform: translate3d(100%, 0, 0) skewX(-30deg); + opacity: 0; + } + + 60% { + -webkit-transform: skewX(20deg); + transform: skewX(20deg); + opacity: 1; + } + + 80% { + -webkit-transform: skewX(-5deg); + transform: skewX(-5deg); + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +.animate__lightSpeedInRight { + -webkit-animation-name: lightSpeedInRight; + animation-name: lightSpeedInRight; + -webkit-animation-timing-function: ease-out; + animation-timing-function: ease-out; +} +@-webkit-keyframes lightSpeedInLeft { + from { + -webkit-transform: translate3d(-100%, 0, 0) skewX(30deg); + transform: translate3d(-100%, 0, 0) skewX(30deg); + opacity: 0; + } + + 60% { + -webkit-transform: skewX(-20deg); + transform: skewX(-20deg); + opacity: 1; + } + + 80% { + -webkit-transform: skewX(5deg); + transform: skewX(5deg); + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +@keyframes lightSpeedInLeft { + from { + -webkit-transform: translate3d(-100%, 0, 0) skewX(30deg); + transform: translate3d(-100%, 0, 0) skewX(30deg); + opacity: 0; + } + + 60% { + -webkit-transform: skewX(-20deg); + transform: skewX(-20deg); + opacity: 1; + } + + 80% { + -webkit-transform: skewX(5deg); + transform: skewX(5deg); + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +.animate__lightSpeedInLeft { + -webkit-animation-name: lightSpeedInLeft; + animation-name: lightSpeedInLeft; + -webkit-animation-timing-function: ease-out; + animation-timing-function: ease-out; +} +@-webkit-keyframes lightSpeedOutRight { + from { + opacity: 1; + } + + to { + -webkit-transform: translate3d(100%, 0, 0) skewX(30deg); + transform: translate3d(100%, 0, 0) skewX(30deg); + opacity: 0; + } +} +@keyframes lightSpeedOutRight { + from { + opacity: 1; + } + + to { + -webkit-transform: translate3d(100%, 0, 0) skewX(30deg); + transform: translate3d(100%, 0, 0) skewX(30deg); + opacity: 0; + } +} +.animate__lightSpeedOutRight { + -webkit-animation-name: lightSpeedOutRight; + animation-name: lightSpeedOutRight; + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; +} +@-webkit-keyframes lightSpeedOutLeft { + from { + opacity: 1; + } + + to { + -webkit-transform: translate3d(-100%, 0, 0) skewX(-30deg); + transform: translate3d(-100%, 0, 0) skewX(-30deg); + opacity: 0; + } +} +@keyframes lightSpeedOutLeft { + from { + opacity: 1; + } + + to { + -webkit-transform: translate3d(-100%, 0, 0) skewX(-30deg); + transform: translate3d(-100%, 0, 0) skewX(-30deg); + opacity: 0; + } +} +.animate__lightSpeedOutLeft { + -webkit-animation-name: lightSpeedOutLeft; + animation-name: lightSpeedOutLeft; + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; +} +/* Rotating entrances */ +@-webkit-keyframes rotateIn { + from { + -webkit-transform: rotate3d(0, 0, 1, -200deg); + transform: rotate3d(0, 0, 1, -200deg); + opacity: 0; + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + opacity: 1; + } +} +@keyframes rotateIn { + from { + -webkit-transform: rotate3d(0, 0, 1, -200deg); + transform: rotate3d(0, 0, 1, -200deg); + opacity: 0; + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + opacity: 1; + } +} +.animate__rotateIn { + -webkit-animation-name: rotateIn; + animation-name: rotateIn; + -webkit-transform-origin: center; + transform-origin: center; +} +@-webkit-keyframes rotateInDownLeft { + from { + -webkit-transform: rotate3d(0, 0, 1, -45deg); + transform: rotate3d(0, 0, 1, -45deg); + opacity: 0; + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + opacity: 1; + } +} +@keyframes rotateInDownLeft { + from { + -webkit-transform: rotate3d(0, 0, 1, -45deg); + transform: rotate3d(0, 0, 1, -45deg); + opacity: 0; + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + opacity: 1; + } +} +.animate__rotateInDownLeft { + -webkit-animation-name: rotateInDownLeft; + animation-name: rotateInDownLeft; + -webkit-transform-origin: left bottom; + transform-origin: left bottom; +} +@-webkit-keyframes rotateInDownRight { + from { + -webkit-transform: rotate3d(0, 0, 1, 45deg); + transform: rotate3d(0, 0, 1, 45deg); + opacity: 0; + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + opacity: 1; + } +} +@keyframes rotateInDownRight { + from { + -webkit-transform: rotate3d(0, 0, 1, 45deg); + transform: rotate3d(0, 0, 1, 45deg); + opacity: 0; + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + opacity: 1; + } +} +.animate__rotateInDownRight { + -webkit-animation-name: rotateInDownRight; + animation-name: rotateInDownRight; + -webkit-transform-origin: right bottom; + transform-origin: right bottom; +} +@-webkit-keyframes rotateInUpLeft { + from { + -webkit-transform: rotate3d(0, 0, 1, 45deg); + transform: rotate3d(0, 0, 1, 45deg); + opacity: 0; + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + opacity: 1; + } +} +@keyframes rotateInUpLeft { + from { + -webkit-transform: rotate3d(0, 0, 1, 45deg); + transform: rotate3d(0, 0, 1, 45deg); + opacity: 0; + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + opacity: 1; + } +} +.animate__rotateInUpLeft { + -webkit-animation-name: rotateInUpLeft; + animation-name: rotateInUpLeft; + -webkit-transform-origin: left bottom; + transform-origin: left bottom; +} +@-webkit-keyframes rotateInUpRight { + from { + -webkit-transform: rotate3d(0, 0, 1, -90deg); + transform: rotate3d(0, 0, 1, -90deg); + opacity: 0; + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + opacity: 1; + } +} +@keyframes rotateInUpRight { + from { + -webkit-transform: rotate3d(0, 0, 1, -90deg); + transform: rotate3d(0, 0, 1, -90deg); + opacity: 0; + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + opacity: 1; + } +} +.animate__rotateInUpRight { + -webkit-animation-name: rotateInUpRight; + animation-name: rotateInUpRight; + -webkit-transform-origin: right bottom; + transform-origin: right bottom; +} +/* Rotating exits */ +@-webkit-keyframes rotateOut { + from { + opacity: 1; + } + + to { + -webkit-transform: rotate3d(0, 0, 1, 200deg); + transform: rotate3d(0, 0, 1, 200deg); + opacity: 0; + } +} +@keyframes rotateOut { + from { + opacity: 1; + } + + to { + -webkit-transform: rotate3d(0, 0, 1, 200deg); + transform: rotate3d(0, 0, 1, 200deg); + opacity: 0; + } +} +.animate__rotateOut { + -webkit-animation-name: rotateOut; + animation-name: rotateOut; + -webkit-transform-origin: center; + transform-origin: center; +} +@-webkit-keyframes rotateOutDownLeft { + from { + opacity: 1; + } + + to { + -webkit-transform: rotate3d(0, 0, 1, 45deg); + transform: rotate3d(0, 0, 1, 45deg); + opacity: 0; + } +} +@keyframes rotateOutDownLeft { + from { + opacity: 1; + } + + to { + -webkit-transform: rotate3d(0, 0, 1, 45deg); + transform: rotate3d(0, 0, 1, 45deg); + opacity: 0; + } +} +.animate__rotateOutDownLeft { + -webkit-animation-name: rotateOutDownLeft; + animation-name: rotateOutDownLeft; + -webkit-transform-origin: left bottom; + transform-origin: left bottom; +} +@-webkit-keyframes rotateOutDownRight { + from { + opacity: 1; + } + + to { + -webkit-transform: rotate3d(0, 0, 1, -45deg); + transform: rotate3d(0, 0, 1, -45deg); + opacity: 0; + } +} +@keyframes rotateOutDownRight { + from { + opacity: 1; + } + + to { + -webkit-transform: rotate3d(0, 0, 1, -45deg); + transform: rotate3d(0, 0, 1, -45deg); + opacity: 0; + } +} +.animate__rotateOutDownRight { + -webkit-animation-name: rotateOutDownRight; + animation-name: rotateOutDownRight; + -webkit-transform-origin: right bottom; + transform-origin: right bottom; +} +@-webkit-keyframes rotateOutUpLeft { + from { + opacity: 1; + } + + to { + -webkit-transform: rotate3d(0, 0, 1, -45deg); + transform: rotate3d(0, 0, 1, -45deg); + opacity: 0; + } +} +@keyframes rotateOutUpLeft { + from { + opacity: 1; + } + + to { + -webkit-transform: rotate3d(0, 0, 1, -45deg); + transform: rotate3d(0, 0, 1, -45deg); + opacity: 0; + } +} +.animate__rotateOutUpLeft { + -webkit-animation-name: rotateOutUpLeft; + animation-name: rotateOutUpLeft; + -webkit-transform-origin: left bottom; + transform-origin: left bottom; +} +@-webkit-keyframes rotateOutUpRight { + from { + opacity: 1; + } + + to { + -webkit-transform: rotate3d(0, 0, 1, 90deg); + transform: rotate3d(0, 0, 1, 90deg); + opacity: 0; + } +} +@keyframes rotateOutUpRight { + from { + opacity: 1; + } + + to { + -webkit-transform: rotate3d(0, 0, 1, 90deg); + transform: rotate3d(0, 0, 1, 90deg); + opacity: 0; + } +} +.animate__rotateOutUpRight { + -webkit-animation-name: rotateOutUpRight; + animation-name: rotateOutUpRight; + -webkit-transform-origin: right bottom; + transform-origin: right bottom; +} +/* Specials */ +@-webkit-keyframes hinge { + 0% { + -webkit-animation-timing-function: ease-in-out; + animation-timing-function: ease-in-out; + } + + 20%, + 60% { + -webkit-transform: rotate3d(0, 0, 1, 80deg); + transform: rotate3d(0, 0, 1, 80deg); + -webkit-animation-timing-function: ease-in-out; + animation-timing-function: ease-in-out; + } + + 40%, + 80% { + -webkit-transform: rotate3d(0, 0, 1, 60deg); + transform: rotate3d(0, 0, 1, 60deg); + -webkit-animation-timing-function: ease-in-out; + animation-timing-function: ease-in-out; + opacity: 1; + } + + to { + -webkit-transform: translate3d(0, 700px, 0); + transform: translate3d(0, 700px, 0); + opacity: 0; + } +} +@keyframes hinge { + 0% { + -webkit-animation-timing-function: ease-in-out; + animation-timing-function: ease-in-out; + } + + 20%, + 60% { + -webkit-transform: rotate3d(0, 0, 1, 80deg); + transform: rotate3d(0, 0, 1, 80deg); + -webkit-animation-timing-function: ease-in-out; + animation-timing-function: ease-in-out; + } + + 40%, + 80% { + -webkit-transform: rotate3d(0, 0, 1, 60deg); + transform: rotate3d(0, 0, 1, 60deg); + -webkit-animation-timing-function: ease-in-out; + animation-timing-function: ease-in-out; + opacity: 1; + } + + to { + -webkit-transform: translate3d(0, 700px, 0); + transform: translate3d(0, 700px, 0); + opacity: 0; + } +} +.animate__hinge { + -webkit-animation-duration: calc(1s * 2); + animation-duration: calc(1s * 2); + -webkit-animation-duration: calc(var(--animate-duration) * 2); + animation-duration: calc(var(--animate-duration) * 2); + -webkit-animation-name: hinge; + animation-name: hinge; + -webkit-transform-origin: top left; + transform-origin: top left; +} +@-webkit-keyframes jackInTheBox { + from { + opacity: 0; + -webkit-transform: scale(0.1) rotate(30deg); + transform: scale(0.1) rotate(30deg); + -webkit-transform-origin: center bottom; + transform-origin: center bottom; + } + + 50% { + -webkit-transform: rotate(-10deg); + transform: rotate(-10deg); + } + + 70% { + -webkit-transform: rotate(3deg); + transform: rotate(3deg); + } + + to { + opacity: 1; + -webkit-transform: scale(1); + transform: scale(1); + } +} +@keyframes jackInTheBox { + from { + opacity: 0; + -webkit-transform: scale(0.1) rotate(30deg); + transform: scale(0.1) rotate(30deg); + -webkit-transform-origin: center bottom; + transform-origin: center bottom; + } + + 50% { + -webkit-transform: rotate(-10deg); + transform: rotate(-10deg); + } + + 70% { + -webkit-transform: rotate(3deg); + transform: rotate(3deg); + } + + to { + opacity: 1; + -webkit-transform: scale(1); + transform: scale(1); + } +} +.animate__jackInTheBox { + -webkit-animation-name: jackInTheBox; + animation-name: jackInTheBox; +} +/* originally authored by Nick Pettit - https://github.com/nickpettit/glide */ +@-webkit-keyframes rollIn { + from { + opacity: 0; + -webkit-transform: translate3d(-100%, 0, 0) rotate3d(0, 0, 1, -120deg); + transform: translate3d(-100%, 0, 0) rotate3d(0, 0, 1, -120deg); + } + + to { + opacity: 1; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +@keyframes rollIn { + from { + opacity: 0; + -webkit-transform: translate3d(-100%, 0, 0) rotate3d(0, 0, 1, -120deg); + transform: translate3d(-100%, 0, 0) rotate3d(0, 0, 1, -120deg); + } + + to { + opacity: 1; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +.animate__rollIn { + -webkit-animation-name: rollIn; + animation-name: rollIn; +} +/* originally authored by Nick Pettit - https://github.com/nickpettit/glide */ +@-webkit-keyframes rollOut { + from { + opacity: 1; + } + + to { + opacity: 0; + -webkit-transform: translate3d(100%, 0, 0) rotate3d(0, 0, 1, 120deg); + transform: translate3d(100%, 0, 0) rotate3d(0, 0, 1, 120deg); + } +} +@keyframes rollOut { + from { + opacity: 1; + } + + to { + opacity: 0; + -webkit-transform: translate3d(100%, 0, 0) rotate3d(0, 0, 1, 120deg); + transform: translate3d(100%, 0, 0) rotate3d(0, 0, 1, 120deg); + } +} +.animate__rollOut { + -webkit-animation-name: rollOut; + animation-name: rollOut; +} +/* Zooming entrances */ +@-webkit-keyframes zoomIn { + from { + opacity: 0; + -webkit-transform: scale3d(0.3, 0.3, 0.3); + transform: scale3d(0.3, 0.3, 0.3); + } + + 50% { + opacity: 1; + } +} +@keyframes zoomIn { + from { + opacity: 0; + -webkit-transform: scale3d(0.3, 0.3, 0.3); + transform: scale3d(0.3, 0.3, 0.3); + } + + 50% { + opacity: 1; + } +} +.animate__zoomIn { + -webkit-animation-name: zoomIn; + animation-name: zoomIn; +} +@-webkit-keyframes zoomInDown { + from { + opacity: 0; + -webkit-transform: scale3d(0.1, 0.1, 0.1) translate3d(0, -1000px, 0); + transform: scale3d(0.1, 0.1, 0.1) translate3d(0, -1000px, 0); + -webkit-animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); + animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); + } + + 60% { + opacity: 1; + -webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(0, 60px, 0); + transform: scale3d(0.475, 0.475, 0.475) translate3d(0, 60px, 0); + -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1); + animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1); + } +} +@keyframes zoomInDown { + from { + opacity: 0; + -webkit-transform: scale3d(0.1, 0.1, 0.1) translate3d(0, -1000px, 0); + transform: scale3d(0.1, 0.1, 0.1) translate3d(0, -1000px, 0); + -webkit-animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); + animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); + } + + 60% { + opacity: 1; + -webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(0, 60px, 0); + transform: scale3d(0.475, 0.475, 0.475) translate3d(0, 60px, 0); + -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1); + animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1); + } +} +.animate__zoomInDown { + -webkit-animation-name: zoomInDown; + animation-name: zoomInDown; +} +@-webkit-keyframes zoomInLeft { + from { + opacity: 0; + -webkit-transform: scale3d(0.1, 0.1, 0.1) translate3d(-1000px, 0, 0); + transform: scale3d(0.1, 0.1, 0.1) translate3d(-1000px, 0, 0); + -webkit-animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); + animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); + } + + 60% { + opacity: 1; + -webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(10px, 0, 0); + transform: scale3d(0.475, 0.475, 0.475) translate3d(10px, 0, 0); + -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1); + animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1); + } +} +@keyframes zoomInLeft { + from { + opacity: 0; + -webkit-transform: scale3d(0.1, 0.1, 0.1) translate3d(-1000px, 0, 0); + transform: scale3d(0.1, 0.1, 0.1) translate3d(-1000px, 0, 0); + -webkit-animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); + animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); + } + + 60% { + opacity: 1; + -webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(10px, 0, 0); + transform: scale3d(0.475, 0.475, 0.475) translate3d(10px, 0, 0); + -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1); + animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1); + } +} +.animate__zoomInLeft { + -webkit-animation-name: zoomInLeft; + animation-name: zoomInLeft; +} +@-webkit-keyframes zoomInRight { + from { + opacity: 0; + -webkit-transform: scale3d(0.1, 0.1, 0.1) translate3d(1000px, 0, 0); + transform: scale3d(0.1, 0.1, 0.1) translate3d(1000px, 0, 0); + -webkit-animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); + animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); + } + + 60% { + opacity: 1; + -webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(-10px, 0, 0); + transform: scale3d(0.475, 0.475, 0.475) translate3d(-10px, 0, 0); + -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1); + animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1); + } +} +@keyframes zoomInRight { + from { + opacity: 0; + -webkit-transform: scale3d(0.1, 0.1, 0.1) translate3d(1000px, 0, 0); + transform: scale3d(0.1, 0.1, 0.1) translate3d(1000px, 0, 0); + -webkit-animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); + animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); + } + + 60% { + opacity: 1; + -webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(-10px, 0, 0); + transform: scale3d(0.475, 0.475, 0.475) translate3d(-10px, 0, 0); + -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1); + animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1); + } +} +.animate__zoomInRight { + -webkit-animation-name: zoomInRight; + animation-name: zoomInRight; +} +@-webkit-keyframes zoomInUp { + from { + opacity: 0; + -webkit-transform: scale3d(0.1, 0.1, 0.1) translate3d(0, 1000px, 0); + transform: scale3d(0.1, 0.1, 0.1) translate3d(0, 1000px, 0); + -webkit-animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); + animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); + } + + 60% { + opacity: 1; + -webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(0, -60px, 0); + transform: scale3d(0.475, 0.475, 0.475) translate3d(0, -60px, 0); + -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1); + animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1); + } +} +@keyframes zoomInUp { + from { + opacity: 0; + -webkit-transform: scale3d(0.1, 0.1, 0.1) translate3d(0, 1000px, 0); + transform: scale3d(0.1, 0.1, 0.1) translate3d(0, 1000px, 0); + -webkit-animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); + animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); + } + + 60% { + opacity: 1; + -webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(0, -60px, 0); + transform: scale3d(0.475, 0.475, 0.475) translate3d(0, -60px, 0); + -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1); + animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1); + } +} +.animate__zoomInUp { + -webkit-animation-name: zoomInUp; + animation-name: zoomInUp; +} +/* Zooming exits */ +@-webkit-keyframes zoomOut { + from { + opacity: 1; + } + + 50% { + opacity: 0; + -webkit-transform: scale3d(0.3, 0.3, 0.3); + transform: scale3d(0.3, 0.3, 0.3); + } + + to { + opacity: 0; + } +} +@keyframes zoomOut { + from { + opacity: 1; + } + + 50% { + opacity: 0; + -webkit-transform: scale3d(0.3, 0.3, 0.3); + transform: scale3d(0.3, 0.3, 0.3); + } + + to { + opacity: 0; + } +} +.animate__zoomOut { + -webkit-animation-name: zoomOut; + animation-name: zoomOut; +} +@-webkit-keyframes zoomOutDown { + 40% { + opacity: 1; + -webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(0, -60px, 0); + transform: scale3d(0.475, 0.475, 0.475) translate3d(0, -60px, 0); + -webkit-animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); + animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); + } + + to { + opacity: 0; + -webkit-transform: scale3d(0.1, 0.1, 0.1) translate3d(0, 2000px, 0); + transform: scale3d(0.1, 0.1, 0.1) translate3d(0, 2000px, 0); + -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1); + animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1); + } +} +@keyframes zoomOutDown { + 40% { + opacity: 1; + -webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(0, -60px, 0); + transform: scale3d(0.475, 0.475, 0.475) translate3d(0, -60px, 0); + -webkit-animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); + animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); + } + + to { + opacity: 0; + -webkit-transform: scale3d(0.1, 0.1, 0.1) translate3d(0, 2000px, 0); + transform: scale3d(0.1, 0.1, 0.1) translate3d(0, 2000px, 0); + -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1); + animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1); + } +} +.animate__zoomOutDown { + -webkit-animation-name: zoomOutDown; + animation-name: zoomOutDown; + -webkit-transform-origin: center bottom; + transform-origin: center bottom; +} +@-webkit-keyframes zoomOutLeft { + 40% { + opacity: 1; + -webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(42px, 0, 0); + transform: scale3d(0.475, 0.475, 0.475) translate3d(42px, 0, 0); + } + + to { + opacity: 0; + -webkit-transform: scale(0.1) translate3d(-2000px, 0, 0); + transform: scale(0.1) translate3d(-2000px, 0, 0); + } +} +@keyframes zoomOutLeft { + 40% { + opacity: 1; + -webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(42px, 0, 0); + transform: scale3d(0.475, 0.475, 0.475) translate3d(42px, 0, 0); + } + + to { + opacity: 0; + -webkit-transform: scale(0.1) translate3d(-2000px, 0, 0); + transform: scale(0.1) translate3d(-2000px, 0, 0); + } +} +.animate__zoomOutLeft { + -webkit-animation-name: zoomOutLeft; + animation-name: zoomOutLeft; + -webkit-transform-origin: left center; + transform-origin: left center; +} +@-webkit-keyframes zoomOutRight { + 40% { + opacity: 1; + -webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(-42px, 0, 0); + transform: scale3d(0.475, 0.475, 0.475) translate3d(-42px, 0, 0); + } + + to { + opacity: 0; + -webkit-transform: scale(0.1) translate3d(2000px, 0, 0); + transform: scale(0.1) translate3d(2000px, 0, 0); + } +} +@keyframes zoomOutRight { + 40% { + opacity: 1; + -webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(-42px, 0, 0); + transform: scale3d(0.475, 0.475, 0.475) translate3d(-42px, 0, 0); + } + + to { + opacity: 0; + -webkit-transform: scale(0.1) translate3d(2000px, 0, 0); + transform: scale(0.1) translate3d(2000px, 0, 0); + } +} +.animate__zoomOutRight { + -webkit-animation-name: zoomOutRight; + animation-name: zoomOutRight; + -webkit-transform-origin: right center; + transform-origin: right center; +} +@-webkit-keyframes zoomOutUp { + 40% { + opacity: 1; + -webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(0, 60px, 0); + transform: scale3d(0.475, 0.475, 0.475) translate3d(0, 60px, 0); + -webkit-animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); + animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); + } + + to { + opacity: 0; + -webkit-transform: scale3d(0.1, 0.1, 0.1) translate3d(0, -2000px, 0); + transform: scale3d(0.1, 0.1, 0.1) translate3d(0, -2000px, 0); + -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1); + animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1); + } +} +@keyframes zoomOutUp { + 40% { + opacity: 1; + -webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(0, 60px, 0); + transform: scale3d(0.475, 0.475, 0.475) translate3d(0, 60px, 0); + -webkit-animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); + animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); + } + + to { + opacity: 0; + -webkit-transform: scale3d(0.1, 0.1, 0.1) translate3d(0, -2000px, 0); + transform: scale3d(0.1, 0.1, 0.1) translate3d(0, -2000px, 0); + -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1); + animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1); + } +} +.animate__zoomOutUp { + -webkit-animation-name: zoomOutUp; + animation-name: zoomOutUp; + -webkit-transform-origin: center bottom; + transform-origin: center bottom; +} +/* Sliding entrances */ +@-webkit-keyframes slideInDown { + from { + -webkit-transform: translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0); + visibility: visible; + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +@keyframes slideInDown { + from { + -webkit-transform: translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0); + visibility: visible; + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +.animate__slideInDown { + -webkit-animation-name: slideInDown; + animation-name: slideInDown; +} +@-webkit-keyframes slideInLeft { + from { + -webkit-transform: translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0); + visibility: visible; + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +@keyframes slideInLeft { + from { + -webkit-transform: translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0); + visibility: visible; + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +.animate__slideInLeft { + -webkit-animation-name: slideInLeft; + animation-name: slideInLeft; +} +@-webkit-keyframes slideInRight { + from { + -webkit-transform: translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0); + visibility: visible; + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +@keyframes slideInRight { + from { + -webkit-transform: translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0); + visibility: visible; + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +.animate__slideInRight { + -webkit-animation-name: slideInRight; + animation-name: slideInRight; +} +@-webkit-keyframes slideInUp { + from { + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); + visibility: visible; + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +@keyframes slideInUp { + from { + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); + visibility: visible; + } + + to { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} +.animate__slideInUp { + -webkit-animation-name: slideInUp; + animation-name: slideInUp; +} +/* Sliding exits */ +@-webkit-keyframes slideOutDown { + from { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + + to { + visibility: hidden; + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); + } +} +@keyframes slideOutDown { + from { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + + to { + visibility: hidden; + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); + } +} +.animate__slideOutDown { + -webkit-animation-name: slideOutDown; + animation-name: slideOutDown; +} +@-webkit-keyframes slideOutLeft { + from { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + + to { + visibility: hidden; + -webkit-transform: translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0); + } +} +@keyframes slideOutLeft { + from { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + + to { + visibility: hidden; + -webkit-transform: translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0); + } +} +.animate__slideOutLeft { + -webkit-animation-name: slideOutLeft; + animation-name: slideOutLeft; +} +@-webkit-keyframes slideOutRight { + from { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + + to { + visibility: hidden; + -webkit-transform: translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0); + } +} +@keyframes slideOutRight { + from { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + + to { + visibility: hidden; + -webkit-transform: translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0); + } +} +.animate__slideOutRight { + -webkit-animation-name: slideOutRight; + animation-name: slideOutRight; +} +@-webkit-keyframes slideOutUp { + from { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + + to { + visibility: hidden; + -webkit-transform: translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0); + } +} +@keyframes slideOutUp { + from { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + + to { + visibility: hidden; + -webkit-transform: translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0); + } +} +.animate__slideOutUp { + -webkit-animation-name: slideOutUp; + animation-name: slideOutUp; +} diff --git a/Sketchbook-master/Sketchbook-master/src/css/modules/base.css b/Sketchbook-master/Sketchbook-master/src/css/modules/base.css new file mode 100644 index 00000000..1f7fce79 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/css/modules/base.css @@ -0,0 +1,34 @@ +/* Base */ + +body { + background-color: #ffffff; + overflow: hidden; + margin: 0; + font-family: 'Solway', serif; + color: white; + user-select: none; + text-shadow: 1px 1px 1px #000, 0px 1px 3px #000; +} + +html, +body { + width: 100%; + height: 100%; +} + +h1 { + font-weight: 400; + font-size: 50px; + font-family: 'Alfa Slab One', cursive; +} + +#canvas { + width: 100%; + height: 100%; +} + +#ui-container { + position: absolute; + top: 0; + height: 100vh; +} diff --git a/Sketchbook-master/Sketchbook-master/src/css/modules/cubeLoader.css b/Sketchbook-master/Sketchbook-master/src/css/modules/cubeLoader.css new file mode 100644 index 00000000..66422e21 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/css/modules/cubeLoader.css @@ -0,0 +1,280 @@ +.cubeWrap { + -webkit-perspective: 800px; + perspective: 800px; + width: 300px; + overflow: hidden; + /* position: absolute; */ + -webkit-animation: bouncy 2s ease forwards; + animation: bouncy 2s ease forwards; + } + + .cube { + margin: 3em auto; + width: 6em; + height: 6em; + -webkit-transform-style: preserve-3d; + transform-style: preserve-3d; + -webkit-transform-origin: 50% 50% -3em; + transform-origin: 50% 50% -3em; + position: relative; + -webkit-animation: spin 4s linear infinite; + animation: spin 4s linear infinite; + -webkit-transform: rotateX(-50deg) rotateY(405deg); + transform: rotateX(-50deg) rotateY(405deg); + } + .cube div { + position: absolute; + width: 6em; + height: 6em; + -webkit-transform-style: preserve-3d; + transform-style: preserve-3d; + } + + .faces1::before, + .faces1::after, + .faces2::before, + .faces2::after { + position: absolute; + content: ''; + display: block; + width: 100%; + height: 100%; + -webkit-transform-style: preserve-3d; + transform-style: preserve-3d; + } + + .faces1::before, + .faces2::before { + -webkit-transform: rotateY(90deg); + transform: rotateY(90deg); + -webkit-transform-origin: 0 50%; + transform-origin: 0 50%; + background-color: purple; + } + + .faces2 { + -webkit-transform: rotateX(180deg) translateZ(6em); + transform: rotateX(180deg) translateZ(6em); + } + + .faces2::before { + background-color: orange; + -webkit-transform: rotateY(-90deg); + transform: rotateY(-90deg); + -webkit-transform-origin: 100% 50%; + transform-origin: 100% 50%; + } + + .faces1::after, + .faces2::after { + -webkit-transform: rotateX(-90deg); + transform: rotateX(-90deg); + -webkit-transform-origin: 50% 0; + transform-origin: 50% 0; + background-color: red; + } + + .faces1 { + background-color: #eee; + } + + .faces2 { + background-color: #f3f3f3; + } + + .faces1::before { + background-color: #f8f8f8; + } + + .faces2::before { + background-color: white; + } + + .faces1::after { + background-color: #e9e9e9; + } + + .faces2::after { + background-color: #e4e4e4; + } + + @-webkit-keyframes spin { + 0% { + -webkit-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); + transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); + } + 100% { + -webkit-transform: rotateX(720deg) rotateY(360deg) rotateZ(0deg); + transform: rotateX(720deg) rotateY(360deg) rotateZ(0deg); + } + } + + @keyframes spin { + 0% { + -webkit-transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); + transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); + } + 100% { + -webkit-transform: rotateX(720deg) rotateY(360deg) rotateZ(0deg); + transform: rotateX(720deg) rotateY(360deg) rotateZ(0deg); + } + } + @-webkit-keyframes bouncy { + /* up */ + 0% { + -webkit-transform: translateY(-600px) scale(0.8, 1.2); + transform: translateY(-600px) scale(0.8, 1.2); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + } + /* floor */ + 30% { + -webkit-transform: translateY(0) scale(0.8, 1.2); + transform: translateY(0) scale(0.8, 1.2); + -webkit-animation-timing-function: ease-out; + animation-timing-function: ease-out; + } + /* floor */ + 32% { + -webkit-transform: translateY(0) scale(1, 0.8); + transform: translateY(0) scale(1, 0.8); + -webkit-animation-timing-function: ease-out; + animation-timing-function: ease-out; + } + /* up */ + 45% { + -webkit-transform: translateY(-100px) scale(0.9, 1.1); + transform: translateY(-100px) scale(0.9, 1.1); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + } + /* floor */ + 60% { + -webkit-transform: translateY(0) scale(0.9, 1.1); + transform: translateY(0) scale(0.9, 1.1); + -webkit-animation-timing-function: ease-out; + animation-timing-function: ease-out; + } + /* floor */ + 62% { + -webkit-transform: translateY(0) scale(1, 0.9); + transform: translateY(0) scale(1, 0.9); + -webkit-animation-timing-function: ease-out; + animation-timing-function: ease-out; + } + /* up */ + 70% { + -webkit-transform: translateY(-30px) scale(0.9, 1.1); + transform: translateY(-30px) scale(0.9, 1.1); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + } + /* floor */ + 80% { + -webkit-transform: translateY(0) scale(1, 1); + transform: translateY(0) scale(1, 1); + -webkit-animation-timing-function: ease-out; + animation-timing-function: ease-out; + } + /* floor */ + 82% { + -webkit-transform: translateY(0) scale(1, 0.95); + transform: translateY(0) scale(1, 0.95); + -webkit-animation-timing-function: ease-out; + animation-timing-function: ease-out; + } + /* up */ + 85% { + -webkit-transform: translateY(-10px) scale(0.98, 1.02); + transform: translateY(-10px) scale(0.98, 1.02); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + } + /* floor */ + 90% { + -webkit-transform: translateY(0) scale(1, 1); + transform: translateY(0) scale(1, 1); + -webkit-animation-timing-function: ease-out; + animation-timing-function: ease-out; + } + } + @keyframes bouncy { + /* up */ + 0% { + -webkit-transform: translateY(-600px) scale(0.8, 1.2); + transform: translateY(-600px) scale(0.8, 1.2); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + } + /* floor */ + 30% { + -webkit-transform: translateY(0) scale(0.8, 1.2); + transform: translateY(0) scale(0.8, 1.2); + -webkit-animation-timing-function: ease-out; + animation-timing-function: ease-out; + } + /* floor */ + 32% { + -webkit-transform: translateY(0) scale(1, 0.8); + transform: translateY(0) scale(1, 0.8); + -webkit-animation-timing-function: ease-out; + animation-timing-function: ease-out; + } + /* up */ + 45% { + -webkit-transform: translateY(-100px) scale(0.9, 1.1); + transform: translateY(-100px) scale(0.9, 1.1); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + } + /* floor */ + 60% { + -webkit-transform: translateY(0) scale(0.9, 1.1); + transform: translateY(0) scale(0.9, 1.1); + -webkit-animation-timing-function: ease-out; + animation-timing-function: ease-out; + } + /* floor */ + 62% { + -webkit-transform: translateY(0) scale(1, 0.9); + transform: translateY(0) scale(1, 0.9); + -webkit-animation-timing-function: ease-out; + animation-timing-function: ease-out; + } + /* up */ + 70% { + -webkit-transform: translateY(-30px) scale(0.9, 1.1); + transform: translateY(-30px) scale(0.9, 1.1); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + } + /* floor */ + 80% { + -webkit-transform: translateY(0) scale(1, 1); + transform: translateY(0) scale(1, 1); + -webkit-animation-timing-function: ease-out; + animation-timing-function: ease-out; + } + /* floor */ + 82% { + -webkit-transform: translateY(0) scale(1, 0.95); + transform: translateY(0) scale(1, 0.95); + -webkit-animation-timing-function: ease-out; + animation-timing-function: ease-out; + } + /* up */ + 85% { + -webkit-transform: translateY(-10px) scale(0.98, 1.02); + transform: translateY(-10px) scale(0.98, 1.02); + -webkit-animation-timing-function: ease-in; + animation-timing-function: ease-in; + } + /* floor */ + 90% { + -webkit-transform: translateY(0) scale(1, 1); + transform: translateY(0) scale(1, 1); + -webkit-animation-timing-function: ease-out; + animation-timing-function: ease-out; + } + } + \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/css/modules/dat.gui.css b/Sketchbook-master/Sketchbook-master/src/css/modules/dat.gui.css new file mode 100644 index 00000000..e768eff8 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/css/modules/dat.gui.css @@ -0,0 +1,463 @@ +/* Dat GUI */ + +.dg ul { + list-style: none; + margin: 0; + padding: 0; + width: 100%; + clear: both +} + +.dg.ac { + position: fixed; + top: 0; + left: 0; + right: 0; + height: 0; + z-index: 0 +} + +.dg:not(.ac) .main { + overflow: hidden +} + +.dg.main { + -webkit-transition: opacity .1s linear; + -o-transition: opacity .1s linear; + -moz-transition: opacity .1s linear; + transition: opacity .1s linear +} + +.dg.main.taller-than-window { + overflow-y: auto +} + +.dg.main.taller-than-window .close-button { + opacity: 1; + margin-top: -1px; + border-top: 1px solid #2c2c2c +} + +.dg.main ul.closed .close-button { + opacity: 1 !important +} + +.dg.main:hover .close-button, +.dg.main .close-button.drag { + opacity: 1 +} + +.dg.main .close-button { + -webkit-transition: opacity .1s linear; + -o-transition: opacity .1s linear; + -moz-transition: opacity .1s linear; + transition: opacity .1s linear; + border: 0; + line-height: 19px; + height: 20px; + cursor: pointer; + text-align: center; + background-color: #000 +} + +.dg.main .close-button.close-top { + position: relative +} + +.dg.main .close-button.close-bottom { + position: absolute +} + +.dg.main .close-button:hover { + background-color: #111 +} + +.dg.a { + float: right; + margin-top: 15px; + margin-right: 15px; + border-radius: 5px; + box-shadow: 0 1px 3px 0 rgb(0 0 0 / 30%); + overflow-x: hidden; + overflow-y: visible +} + +.dg.a.has-save>ul.close-top { + margin-top: 0 +} + +.dg.a.has-save>ul.close-bottom { + margin-top: 27px +} + +.dg.a.has-save>ul.closed { + margin-top: 0 +} + +.dg.a .save-row { + top: 0; + z-index: 1002 +} + +.dg.a .save-row.close-top { + position: relative +} + +.dg.a .save-row.close-bottom { + position: fixed +} + +.dg li { + -webkit-transition: height .1s ease-out; + -o-transition: height .1s ease-out; + -moz-transition: height .1s ease-out; + transition: height .1s ease-out; + -webkit-transition: overflow .1s linear; + -o-transition: overflow .1s linear; + -moz-transition: overflow .1s linear; + transition: overflow .1s linear +} + +.dg li:not(.folder) { + cursor: auto; + height: 33px; + line-height: 33px; + padding: 0 10px 0 10px +} + +.dg li.folder { + padding: 0; + border-left: 4px solid transparent +} + +.dg li.title { + /* font-family: 'Allerta Stencil', sans-serif; */ + /* font-family: 'Patua One', cursive; */ + /* font-family: 'Fredoka One', cursive; */ + font-weight: 500; + cursor: pointer; + margin-left: -4px +} + +.dg .closed li:not(.title), +.dg .closed ul li, +.dg .closed ul li>* { + height: 0; + overflow: hidden; + border: 0 +} + +.dg .cr { + clear: both; + padding-left: 3px; + height: 27px; + overflow: hidden +} + +.dg .property-name { + font-size: 82%; + cursor: default; + float: left; + clear: left; + width: 40%; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis +} + +.dg .cr.function .property-name { + width: 100%; +} + +.dg .c { + float: left; + width: 60%; + position: relative +} + +.dg .c input[type=text] { + border: 0; + margin-top: 4px; + padding: 3px; + width: 100%; + float: right +} + +.dg .has-slider input[type=text] { + width: 30%; + margin-left: 0 +} + +.dg .slider { + float: left; + width: 66%; + margin-left: -5px; + margin-right: 0; + height: 19px; + margin-top: 4px +} + +.dg .slider-fg { + height: 100% +} + +.dg .c input[type=checkbox] { + margin-top: 7px +} + +.dg .c select { + margin-top: 5px +} + +.dg .cr.function, +.dg .cr.function .property-name, +.dg .cr.function *, +.dg .cr.boolean, +.dg .cr.boolean * { + cursor: pointer +} + +.dg .cr.color { + overflow: visible +} + +.dg .selector { + display: none; + position: absolute; + margin-left: -9px; + margin-top: 23px; + z-index: 10 +} + +.dg .c:hover .selector, +.dg .selector.drag { + display: block +} + +.dg li.save-row { + padding: 0 +} + +.dg li.save-row .button { + display: inline-block; + padding: 0px 6px +} + +.dg.dialogue { + background-color: #222; + width: 460px; + padding: 15px; + font-size: 13px; + line-height: 15px +} + +#dg-new-constructor { + padding: 10px; + color: #222; + font-family: Monaco, monospace; + font-size: 10px; + border: 0; + resize: none; + box-shadow: inset 1px 1px 1px #888; + word-wrap: break-word; + margin: 12px 0; + display: block; + width: 440px; + overflow-y: scroll; + height: 100px; + position: relative +} + +#dg-local-explain { + display: none; + font-size: 11px; + line-height: 17px; + border-radius: 3px; + background-color: #333; + padding: 8px; + margin-top: 10px +} + +#dg-local-explain code { + font-size: 10px +} + +#dat-gui-save-locally { + display: none +} + +.dg { + color: #eee; + /* font-family: 'Cutive Mono', sans-serif; */ + /* text-shadow: 0 -1px 0 #111 */ + text-shadow: none; +} + +.dg.main::-webkit-scrollbar { + width: 5px; + background: #1a1a1a +} + +.dg.main::-webkit-scrollbar-corner { + height: 0; + display: none +} + +.dg.main::-webkit-scrollbar-thumb { + border-radius: 5px; + background: #676767 +} + +.dg li:not(.folder) { + background: rgb(26 26 26 / 92%); + border-bottom: 1px solid #2c2c2c; + -webkit-backdrop-filter: blur(10px); + backdrop-filter: blur(10px); + margin-left: -4px; +} + +.dg li.save-row { + line-height: 25px; + background: #dad5cb; + border: 0 +} + +.dg li.save-row select { + margin-left: 5px; + width: 108px +} + +.dg li.save-row .button { + margin-left: 5px; + margin-top: 1px; + border-radius: 2px; + font-size: 9px; + line-height: 7px; + padding: 4px 4px 5px 4px; + background: #c5bdad; + color: #fff; + text-shadow: 0 1px 0 #b0a58f; + box-shadow: 0 -1px 0 #b0a58f; + cursor: pointer +} + +.dg li.save-row .button.gears { + background: #c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat; + height: 7px; + width: 8px +} + +.dg li.save-row .button:hover { + background-color: #bab19e; + box-shadow: 0 -1px 0 #b0a58f +} + +.dg li.folder { + border-bottom: 0 +} + +.dg li.title { + font-size: 90%; + height: 33px; + line-height: 33px; + padding-left: 20px; + background: #000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 8px 14px no-repeat; + cursor: pointer; + border-bottom: 1px solid rgba(255, 255, 255, 0.2); + background-color: rgb(0 0 0 / 92%); +} + +.dg .closed li.title { + background-image: url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==) +} + +.dg .cr.boolean { + border-left: 3px solid #806787 +} + +.dg .cr.color { + border-left: 3px solid +} + +.dg .cr.function { + border-left: 3px solid #e61d5f +} + +.dg .cr.number { + border-left: 3px solid #2FA1D6 +} + +.dg .cr.number input[type=text] { + color: #2FA1D6 +} + +.dg .cr.string { + border-left: 3px solid #1ed36f +} + +.dg .cr.string input[type=text] { + color: #1ed36f +} + +.dg .cr.function:hover, +.dg .cr.boolean:hover { + background: #111 +} + +.dg .c input[type=text] { + background: #303030; + outline: none +} + +.dg .c input[type=text]:hover { + background: #3c3c3c +} + +.dg .c input[type=text]:focus { + background: #494949; + color: #fff +} + +.dg .c .slider { + background: #303030; + cursor: ew-resize +} + +.dg .c .slider-fg { + background: #2FA1D6; + max-width: 100% +} + +.dg .c .slider:hover { + background: #3c3c3c +} + +.dg .c .slider:hover .slider-fg { + background: #44abda +} + + +/* Stats box */ + +#statsBox { + position: fixed; + top: 15px; + height: 48px; + right: 15px; + opacity: 0.9; + z-index: 10000; +} + +#statsBox, +.dg.ac .dg.main.a .dg .title { + box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3); +} + +.dg.ac { + /* top: 48px; */ + user-select: none; +} + +.dg.ac .close-button.close-bottom { + display: none; +} diff --git a/Sketchbook-master/Sketchbook-master/src/css/modules/githubCorner.css b/Sketchbook-master/Sketchbook-master/src/css/modules/githubCorner.css new file mode 100644 index 00000000..b975c12e --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/css/modules/githubCorner.css @@ -0,0 +1,20 @@ +/* GitHub corner */ + +.github-corner { + position: absolute; + left: 0; + top: 0; + width: 120px; + height: 120px; + overflow: hidden; +} + +.github-corner a { + position: absolute; + right: 0; + top: 0; + left: 0; + bottom: 0; + transform: translate(-50%, -50%) rotate(-45deg); + color: #000000; +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/css/modules/leftPanel.css b/Sketchbook-master/Sketchbook-master/src/css/modules/leftPanel.css new file mode 100644 index 00000000..bb083dd4 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/css/modules/leftPanel.css @@ -0,0 +1,56 @@ +/* Left panel */ + +.left-panel { + position: fixed; + height: calc(100% - 70px); + padding-top: 70px; + flex-direction: column; + display: flex; + justify-content: space-between; + pointer-events: none; +} + +.left-panel .panel-segment { + flex-grow: 1; + flex-basis: 100px; + padding: 20px; + overflow: hidden; +} + +.flex-bottom { + display: flex; + flex-direction: column; + justify-content: flex-end; +} + +.controls-title { + margin-bottom: 12px; +} + +.ctrl-row { + margin-bottom: 6px; + display: flex; + align-items: center; +} + +.ctrl-key { + text-shadow: none; + font-weight: bold; + display: inline-block; + font-family: 'Cutive Mono', monospace; + padding: 2px 5px; + margin-right: 2px; + min-width: 10px; + text-align: center; + margin-left: 2px; + background: #eff0f2; + box-shadow: inset 0 0 25px #e8e8e8, 0 1px 0 #c3c3c3, 0 2px 0 #c9c9c9, 0 2px 3px #000; + color: #111; + border-radius: 2px; + font-size: 14px; +} + +.ctrl-desc { + margin-left: 5px; + /* font-size: 18px; */ +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/css/modules/loadingScreen.css b/Sketchbook-master/Sketchbook-master/src/css/modules/loadingScreen.css new file mode 100644 index 00000000..81de8f86 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/css/modules/loadingScreen.css @@ -0,0 +1,41 @@ +/* Welcome screen */ + +#loading-screen { + position: absolute; + top: 0; + z-index: 0; + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + text-align: center; + height: 100%; + width: 100%; +} + +#loader { + display: flex; + -webkit-box-align: center; + align-items: center; + -webkit-box-pack: center; + justify-content: center; +} + +#main-title { + margin-bottom: 0; +} + +#loading-text { + font-size: larger; + margin-top: 10px; +} + +#loading-screen-background { + z-index: -1; + position: absolute; + height: 100%; + width: 100%; + background: -webkit-linear-gradient(top, #568db5 0%, #ccdde8 100%); + background: -linear-gradient(top, #568db5 0%, #ccdde8 100%); + background: -moz-linear-gradient(top, #568db5 0%, #ccdde8 100%); +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/css/modules/welcomeScreen.css b/Sketchbook-master/Sketchbook-master/src/css/modules/welcomeScreen.css new file mode 100644 index 00000000..13594bf6 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/css/modules/welcomeScreen.css @@ -0,0 +1,39 @@ +.swal2-container { + text-shadow: none; +} + +.swal2-confirm { + display: inline-block; + background: #FFB900; + border: none; + padding: 12px 28px; + color: #222; + outline: none; + border-radius: 4px; + font-family: 'Solway', serif; + font-weight: 700; + font-size: 18px; + cursor: pointer; + margin: 0 0 4px 0; + box-shadow: 0 4px 0 0 rgb(228 158 0); +} + +.swal2-confirm:active { + margin: 4px 0 0 0; + box-shadow: 0 0px 0 0 rgb(228 158 0); +} + +div.swal2-footer { + justify-content: space-evenly; +} + +.button { + opacity: 0; + background: black; + padding: 12px 15px 12px 15px; + font-family: "Cutive Mono", monospace; + font-size: 1.2rem; + border: none; + color: white; + cursor: pointer; +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/img/original.png b/Sketchbook-master/Sketchbook-master/src/img/original.png new file mode 100644 index 00000000..bd442ac6 Binary files /dev/null and b/Sketchbook-master/Sketchbook-master/src/img/original.png differ diff --git a/Sketchbook-master/Sketchbook-master/src/img/thumbnail.png b/Sketchbook-master/Sketchbook-master/src/img/thumbnail.png new file mode 100644 index 00000000..74472cef Binary files /dev/null and b/Sketchbook-master/Sketchbook-master/src/img/thumbnail.png differ diff --git a/Sketchbook-master/Sketchbook-master/src/lib/cannon/CannonDebugRenderer.js b/Sketchbook-master/Sketchbook-master/src/lib/cannon/CannonDebugRenderer.js new file mode 100644 index 00000000..945520ad --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/lib/cannon/CannonDebugRenderer.js @@ -0,0 +1,255 @@ + +import * as THREE from 'three'; +import * as CANNON from 'cannon'; +import { Detector } from '../utils/Detector'; + +/** + * Adds Three.js primitives into the scene where all the Cannon bodies and shapes are. + * @class CannonDebugRenderer + * @param {THREE.Scene} scene + * @param {CANNON.World} world + * @param {object} [options] + */ +export var CannonDebugRenderer = function(scene, world, options){ + options = options || {}; + + this.scene = scene; + this.world = world; + + this._meshes = []; + + this._boxMaterial = new THREE.MeshBasicMaterial({ color: 0x0000ff, wireframe: true }); + this._triMaterial = new THREE.MeshBasicMaterial({ color: 0xff0000, wireframe: true }); + this._sphereMaterial = new THREE.MeshBasicMaterial({ color: 0x00ff00, wireframe: true }); + + this._sphereGeometry = new THREE.SphereGeometry(1); + this._boxGeometry = new THREE.BoxGeometry(1, 1, 1); + this._planeGeometry = new THREE.PlaneGeometry( 10, 10, 10, 10 ); + this._cylinderGeometry = new THREE.CylinderGeometry( 1, 1, 10, 10 ); +}; + +CannonDebugRenderer.prototype = { + + tmpVec0: new CANNON.Vec3(), + tmpVec1: new CANNON.Vec3(), + tmpVec2: new CANNON.Vec3(), + tmpQuat0: new CANNON.Vec3(), + + update: function(){ + + var bodies = this.world.bodies; + var meshes = this._meshes; + var shapeWorldPosition = this.tmpVec0; + var shapeWorldQuaternion = this.tmpQuat0; + + var meshIndex = 0; + + for (var i = 0; i !== bodies.length; i++) { + var body = bodies[i]; + + for (var j = 0; j !== body.shapes.length; j++) { + var shape = body.shapes[j]; + + this._updateMesh(meshIndex, body, shape); + + var mesh = meshes[meshIndex]; + + if(mesh){ + + // Get world position + body.interpolatedQuaternion.vmult(body.shapeOffsets[j], shapeWorldPosition); + body.interpolatedPosition.vadd(shapeWorldPosition, shapeWorldPosition); + + // Get world quaternion + body.quaternion.mult(body.shapeOrientations[j], shapeWorldQuaternion); + + // Copy to meshes + mesh.position.copy(shapeWorldPosition); + mesh.quaternion.copy(shapeWorldQuaternion); + } + + meshIndex++; + } + } + + for(var i = meshIndex; i < meshes.length; i++){ + var mesh = meshes[i]; + if(mesh){ + this.scene.remove(mesh); + } + } + + meshes.length = meshIndex; + }, + + _updateMesh: function(index, body, shape){ + var mesh = this._meshes[index]; + if(!this._typeMatch(mesh, shape)){ + if(mesh){ + this.scene.remove(mesh); + } + mesh = this._meshes[index] = this._createMesh(shape); + } + this._scaleMesh(mesh, shape); + }, + + _typeMatch: function(mesh, shape){ + if(!mesh){ + return false; + } + var geo = mesh.geometry; + return ( + (geo instanceof THREE.SphereGeometry && shape instanceof CANNON.Sphere) || + (geo instanceof THREE.BoxGeometry && shape instanceof CANNON.Box) || + (geo instanceof THREE.PlaneGeometry && shape instanceof CANNON.Plane) || + (geo.id === shape.geometryId && shape instanceof CANNON.ConvexPolyhedron) || + (geo.id === shape.geometryId && shape instanceof CANNON.Trimesh) || + (geo.id === shape.geometryId && shape instanceof CANNON.Heightfield) + ); + }, + + _createMesh: function(shape){ + var mesh; + + var yellow = this._sphereMaterial; + var cyan = this._boxMaterial; + var purple = this._triMaterial; + + switch(shape.type){ + + case CANNON.Shape.types.SPHERE: + mesh = new THREE.Mesh(this._sphereGeometry, yellow); + break; + + case CANNON.Shape.types.BOX: + mesh = new THREE.Mesh(this._boxGeometry, cyan); + break; + + case CANNON.Shape.types.PLANE: + mesh = new THREE.Mesh(this._planeGeometry, yellow); + break; + + case CANNON.Shape.types.CONVEXPOLYHEDRON: + // Create mesh + var geo = new THREE.Geometry(); + + // Add vertices + for (var i = 0; i < shape.vertices.length; i++) { + var v = shape.vertices[i]; + geo.vertices.push(new THREE.Vector3(v.x, v.y, v.z)); + } + + for(var i=0; i < shape.faces.length; i++){ + var face = shape.faces[i]; + + // add triangles + var a = face[0]; + for (var j = 1; j < face.length - 1; j++) { + var b = face[j]; + var c = face[j + 1]; + geo.faces.push(new THREE.Face3(a, b, c)); + } + } + geo.computeBoundingSphere(); + geo.computeFaceNormals(); + + mesh = new THREE.Mesh(geo, cyan); + shape.geometryId = geo.id; + break; + + case CANNON.Shape.types.TRIMESH: + var geometry = new THREE.Geometry(); + var v0 = this.tmpVec0; + var v1 = this.tmpVec1; + var v2 = this.tmpVec2; + for (var i = 0; i < shape.indices.length / 3; i++) { + shape.getTriangleVertices(i, v0, v1, v2); + geometry.vertices.push( + new THREE.Vector3(v0.x, v0.y, v0.z), + new THREE.Vector3(v1.x, v1.y, v1.z), + new THREE.Vector3(v2.x, v2.y, v2.z) + ); + var j = geometry.vertices.length - 3; + geometry.faces.push(new THREE.Face3(j, j+1, j+2)); + } + geometry.computeBoundingSphere(); + geometry.computeFaceNormals(); + mesh = new THREE.Mesh(geometry, purple); + shape.geometryId = geometry.id; + break; + + case CANNON.Shape.types.HEIGHTFIELD: + var geometry = new THREE.Geometry(); + + var v0 = this.tmpVec0; + var v1 = this.tmpVec1; + var v2 = this.tmpVec2; + for (var xi = 0; xi < shape.data.length - 1; xi++) { + for (var yi = 0; yi < shape.data[xi].length - 1; yi++) { + for (var k = 0; k < 2; k++) { + shape.getConvexTrianglePillar(xi, yi, k===0); + v0.copy(shape.pillarConvex.vertices[0]); + v1.copy(shape.pillarConvex.vertices[1]); + v2.copy(shape.pillarConvex.vertices[2]); + v0.vadd(shape.pillarOffset, v0); + v1.vadd(shape.pillarOffset, v1); + v2.vadd(shape.pillarOffset, v2); + geometry.vertices.push( + new THREE.Vector3(v0.x, v0.y, v0.z), + new THREE.Vector3(v1.x, v1.y, v1.z), + new THREE.Vector3(v2.x, v2.y, v2.z) + ); + var i = geometry.vertices.length - 3; + geometry.faces.push(new THREE.Face3(i, i+1, i+2)); + } + } + } + geometry.computeBoundingSphere(); + geometry.computeFaceNormals(); + mesh = new THREE.Mesh(geometry, purple); + shape.geometryId = geometry.id; + break; + } + + if(mesh){ + this.scene.add(mesh); + } + + return mesh; + }, + + _scaleMesh: function(mesh, shape){ + switch(shape.type){ + + case CANNON.Shape.types.SPHERE: + var radius = shape.radius; + mesh.scale.set(radius, radius, radius); + break; + + case CANNON.Shape.types.BOX: + mesh.scale.copy(shape.halfExtents); + mesh.scale.multiplyScalar(2); + break; + + case CANNON.Shape.types.CONVEXPOLYHEDRON: + mesh.scale.set(1,1,1); + break; + + case CANNON.Shape.types.TRIMESH: + mesh.scale.copy(shape.scale); + break; + + case CANNON.Shape.types.HEIGHTFIELD: + mesh.scale.set(1,1,1); + break; + + } + }, + + clearMeshes: function(){ + this._meshes.forEach((mesh) => { + this.scene.remove(mesh); + }); + } + +}; \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/lib/cannon/cannon.d.ts b/Sketchbook-master/Sketchbook-master/src/lib/cannon/cannon.d.ts new file mode 100644 index 00000000..49b58969 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/lib/cannon/cannon.d.ts @@ -0,0 +1,1235 @@ +// Type definitions for cannon 0.1 +// Project: https://github.com/clark-stevenson/cannon.d.ts +// Definitions by: Clark Stevenson +// Grzegorz Rozdzialik +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + + +declare module CANNON { + + export interface IAABBOptions { + + upperBound?: Vec3; + lowerBound?: Vec3; + + } + + export class AABB { + + lowerBound: Vec3; + upperBound: Vec3; + + constructor(options?: IAABBOptions); + + clone(): AABB; + copy(aabb: AABB): void; + extend(aabb: AABB): void; + getCorners(a: Vec3, b: Vec3, c: Vec3, d: Vec3, e: Vec3, f: Vec3, g: Vec3, h: Vec3): void; + overlaps(aabb: AABB): boolean; + setFromPoints(points: Vec3[], position?: Vec3, quaternion?: Quaternion, skinSize?: number): AABB; + toLocalFrame(frame: Transform, target: AABB): AABB; + toWorldFrame(frame: Transform, target: AABB): AABB; + + } + + export class ArrayCollisionMatrix { + + matrix: Mat3[]; + + get(i: number, j: number): number; + set(i: number, j: number, value: number): void; + reset(): void; + setNumObjects(n: number): void; + + } + + export class BroadPhase { + + world: World; + useBoundingBoxes: boolean; + dirty: boolean; + + collisionPairs(world: World, p1: Body[], p2: Body[]): void; + needBroadphaseCollision(bodyA: Body, bodyB: Body): boolean; + intersectionTest(bodyA: Body, bodyB: Body, pairs1: Body[], pairs2: Body[]): void; + doBoundingSphereBroadphase(bodyA: Body, bodyB: Body, pairs1: Body[], pairs2: Body[]): void; + doBoundingBoxBroadphase(bodyA: Body, bodyB: Body, pairs1: Body[], pairs2: Body[]): void; + makePairsUnique(pairs1: Body[], pairs2: Body[]): void; + setWorld(world: World): void; + boundingSphereCheck(bodyA: Body, bodyB: Body): boolean; + aabbQuery(world: World, aabb: AABB, result: Body[]): Body[]; + + } + + export class GridBroadphase extends BroadPhase { + + nx: number; + ny: number; + nz: number; + aabbMin: Vec3; + aabbMax: Vec3; + bins: any[]; + + constructor(aabbMin?: Vec3, aabbMax?: Vec3, nx?: number, ny?: number, nz?: number); + + } + + export class NaiveBroadphase extends BroadPhase { + } + + export class ObjectCollisionMatrix { + + matrix: number[]; + + get(i: number, j: number): number; + set(i: number, j: number, value: number): void; + reset(): void; + setNumObjects(n: number): void; + + } + + export class Ray { + + from: Vec3; + to: Vec3; + precision: number; + checkCollisionResponse: boolean; + + constructor(from?: Vec3, to?: Vec3); + + getAABB(result: RaycastResult): void; + + } + + export class RaycastResult { + + rayFromWorld: Vec3; + rayToWorld: Vec3; + hitNormalWorld: Vec3; + hitPointWorld: Vec3; + hasHit: boolean; + shape: Shape; + body: Body; + distance: number; + + reset(): void; + set(rayFromWorld: Vec3, rayToWorld: Vec3, hitNormalWorld: Vec3, hitPointWorld: Vec3, shape: Shape, body: Body, distance: number): void; + + } + + export class SAPBroadphase extends BroadPhase { + + static insertionSortX(a: any[]): any[]; + static insertionSortY(a: any[]): any[]; + static insertionSortZ(a: any[]): any[]; + static checkBounds(bi: Body, bj: Body, axisIndex?: number): boolean; + + axisList: any[]; + world: World; + axisIndex: number; + + constructor(world?: World); + + autoDetectAxis(): void; + aabbQuery(world: World, aabb: AABB, result?: Body[]): Body[]; + + } + + export interface IConstraintOptions { + + collideConnected?: boolean; + wakeUpBodies?: boolean; + + } + + export class Constraint { + + equations: any[]; + bodyA: Body; + bodyB: Body; + id: number; + collideConnected: boolean; + + constructor(bodyA: Body, bodyB: Body, options?: IConstraintOptions); + + update(): void; + disable(): void; + enable(): void; + + } + + export class DistanceConstraint extends Constraint { + + constructor(bodyA: Body, bodyB: Body, distance: number, maxForce?: number); + + } + + export interface IHingeConstraintOptions { + + pivotA?: Vec3; + axisA?: Vec3; + pivotB?: Vec3; + axisB?: Vec3; + maxForce?: number; + + } + + export class HingeConstraint extends Constraint { + + motorEnabled: boolean; + motorTargetVelocity: number; + motorMinForce: number; + motorMaxForce: number; + motorEquation: RotationalMotorEquation; + + constructor(bodyA: Body, bodyB: Body, options?: IHingeConstraintOptions); + + enableMotor(): void; + disableMotor(): void; + + } + + export class PointToPointConstraint extends Constraint { + + constructor(bodyA: Body, pivotA: Vec3, bodyB: Body, pivotB: Vec3, maxForce?: number); + + } + + export interface ILockConstraintOptions { + maxForce?: number; + } + + export class LockConstraint extends Constraint { + constructor(bodyA: Body, bodyB: Body, options?: ILockConstraintOptions); + } + + export interface IConeTwistConstraintOptions { + pivotA?: Vec3; + pivotB?: Vec3; + axisA?: Vec3; + axisB?: Vec3; + maxForce?: number; + } + + export class ConeTwistConstraint extends Constraint { + constructor(bodyA: Body, bodyB: Body, options?: IConeTwistConstraintOptions); + } + + + + export class Equation { + + id: number; + minForce: number; + maxForce: number; + bi: Body; + bj: Body; + a: number; + b: number; + eps: number; + jacobianElementA: JacobianElement; + jacobianElementB: JacobianElement; + enabled: boolean; + + constructor(bi: Body, bj: Body, minForce?: number, maxForce?: number); + + setSpookParams(stiffness: number, relaxation: number, timeStep: number): void; + computeB(a: number, b: number, h: number): number; + computeGq(): number; + computeGW(): number; + computeGWlamda(): number; + computeGiMf(): number; + computeGiMGt(): number; + addToWlamda(deltalambda: number): number; + computeC(): number; + + } + + export class FrictionEquation extends Equation { + + constructor(bi: Body, bj: Body, slipForce: number); + + } + + export class RotationalEquation extends Equation { + + ni: Vec3; + nj: Vec3; + nixnj: Vec3; + njxni: Vec3; + invIi: Mat3; + invIj: Mat3; + relVel: Vec3; + relForce: Vec3; + + constructor(bodyA: Body, bodyB: Body); + + } + + export class RotationalMotorEquation extends Equation { + + axisA: Vec3; + axisB: Vec3; + invLi: Mat3; + invIj: Mat3; + targetVelocity: number; + + constructor(bodyA: Body, bodyB: Body, maxForce?: number); + + } + + export class ContactEquation extends Equation { + + restitution: number; + ri: Vec3; + rj: Vec3; + penetrationVec: Vec3; + ni: Vec3; + rixn: Vec3; + rjxn: Vec3; + invIi: Mat3; + invIj: Mat3; + biInvInertiaTimesRixn: Vec3; + bjInvInertiaTimesRjxn: Vec3; + + constructor(bi: Body, bj: Body); + + } + + export interface IContactMaterialOptions { + + friction?: number; + restitution?: number; + contactEquationStiffness?: number; + contactEquationRelaxation?: number; + frictionEquationStiffness?: number; + frictionEquationRelaxation?: number; + + } + + export class ContactMaterial { + + id: number; + materials: Material[]; + friction: number; + restitution: number; + contactEquationStiffness: number; + contactEquationRelaxation: number; + frictionEquationStiffness: number; + frictionEquationRelaxation: number; + + constructor(m1: Material, m2: Material, options?: IContactMaterialOptions); + + } + + export class Material { + + name: string; + id: number; + friction:number; + restitution:number; + + constructor(name: string); + + } + + export class JacobianElement { + + spatial: Vec3; + rotational: Vec3; + + multiplyElement(element: JacobianElement): number; + multiplyVectors(spacial: Vec3, rotational: Vec3): number; + + } + + export class Mat3 { + + constructor(elements?: number[]); + + identity(): void; + setZero(): void; + setTrace(vec3: Vec3): void; + getTrace(target: Vec3): void; + vmult(v: Vec3, target?: Vec3): Vec3; + smult(s: number): void; + mmult(m: Mat3): Mat3; + scale(v: Vec3, target?: Mat3): Mat3; + solve(b: Vec3, target?: Vec3): Vec3; + e(row: number, column: number, value?: number): number; + copy(source: Mat3): Mat3; + toString(): string; + reverse(target?: Mat3): Mat3; + setRotationFromQuaternion(q: Quaternion): Mat3; + transpose(target?: Mat3): Mat3; + + } + + export class Quaternion { + + x: number; + y: number; + z: number; + w: number; + + constructor(x?: number, y?: number, z?: number, w?: number); + + set(x: number, y: number, z: number, w: number): void; + toString(): string; + toArray(): number[]; + setFromAxisAngle(axis: Vec3, angle: number): void; + toAxisAngle(targetAxis?: Vec3): any[]; + setFromVectors(u: Vec3, v: Vec3): void; + mult(q: Quaternion, target?: Quaternion): Quaternion; + inverse(target?: Quaternion): Quaternion; + conjugate(target?: Quaternion): Quaternion; + normalize(): void; + normalizeFast(): void; + vmult(v: Vec3, target?: Vec3): Vec3; + copy(source: Quaternion): Quaternion; + toEuler(target: Vec3, order?: string): void; + setFromEuler(x: number, y: number, z: number, order?: string): Quaternion; + clone(): Quaternion; + + } + + export class Transform { + + static pointToLocalFrame(position: Vec3, quaternion: Quaternion, worldPoint: Vec3, result?: Vec3): Vec3; + static pointToWorldFrame(position: Vec3, quaternion: Quaternion, localPoint: Vec3, result?: Vec3): Vec3; + + position: Vec3; + quaternion: Quaternion; + + vectorToWorldFrame(localVector: Vec3, result?: Vec3): Vec3; + vectorToLocalFrame(position: Vec3, quaternion: Quaternion, worldVector: Vec3, result?: Vec3): Vec3; + + } + + export class Vec3 { + + static ZERO: Vec3; + + constructor(x?: number, y?: number, z?: number); + + x: number; + y: number; + z: number; + + cross(v: Vec3, target: Vec3): Vec3; + set(x: number, y: number, z: number): Vec3; + setZero(): void; + vadd(v: Vec3, target: Vec3): Vec3; + vsub(v: Vec3, target: Vec3): Vec3; + crossmat(): Mat3; + normalize(): number; + unit(target: Vec3): Vec3; + norm(): number; + /** + * Get the length of the vector + * @method length + * @return {Number} + */ + length: any; + norm2(): number; + /** + * Get the squared length of the vector. + * @method lengthSquared + * @return {Number} + */ + lengthSquared: any; + distanceTo(p: Vec3): number; + distanceSquared(p: Vec3): number; + mult(scalar: number, target: Vec3): Vec3; + vmul(vector: number, target: Vec3): Vec3; + /** + * Multiply the vector with a scalar. + * @method scale + * @param {Number} scalar + * @param {Vec3} target + * @return {Vec3} + */ + scale: any; + addScaledVector(scalar: number, vector: Vec3, target: Vec3): Vec3; + dot(v: Vec3): number; + isZero(): boolean; + negate(target: Vec3): Vec3; + tangents(t1: any, t2: any): void; + toString(): string; + toArray(): number[]; + copy(source: Vec3): Vec3; + lerp(v: Vec3, t: number, target: Vec3): void; + almostEquals(v: Vec3, precision: number): boolean; + almostZero(precision: number): boolean; + isAntiparallelTo(v: Vec3, precision: number): boolean; + clone(): Vec3; + } + + export interface IBodyOptions { + position?: Vec3; + velocity?: Vec3; + angularVelocity?: Vec3; + quaternion?: Quaternion; + mass?: number; + material?: Material; + type?: number; + linearDamping?: number; + angularDamping?: number; + allowSleep?: boolean; + sleepSpeedLimit?: number; + sleepTimeLimit?: number; + collisionFilterGroup?: number; + collisionFilterMask?: number; + fixedRotation?: boolean; + shape?: Shape; + } + + export class Body extends EventTarget { + + static DYNAMIC: number; + static STATIC: number; + static KINEMATIC: number; + static AWAKE: number; + static SLEEPY: number; + static SLEEPING: number; + static sleepyEvent: IEvent; + static sleepEvent: IEvent; + + id: number; + world: World; + preStep: Function; + postStep: Function; + vlambda: Vec3; + collisionFilterGroup: number; + collisionFilterMask: number; + collisionResponse: boolean; + position: Vec3; + previousPosition: Vec3; + initPosition: Vec3; + velocity: Vec3; + initVelocity: Vec3; + force: Vec3; + mass: number; + invMass: number; + material: Material; + linearDamping: number; + type: number; + allowSleep: boolean; + sleepState: number; + sleepSpeedLimit: number; + sleepTimeLimit: number; + timeLastSleepy: number; + torque: Vec3; + quaternion: Quaternion; + initQuaternion: Quaternion; + angularVelocity: Vec3; + initAngularVelocity: Vec3; + interpolatedPosition: Vec3; + interpolatedQuaternion: Quaternion; + shapes: Shape[]; + shapeOffsets: any[]; + shapeOrientations: any[]; + inertia: Vec3; + invInertia: Vec3; + invInertiaWorld: Mat3; + invMassSolve: number; + invInertiaSolve: Vec3; + invInteriaWorldSolve: Mat3; + fixedRotation: boolean; + angularDamping: number; + aabb: AABB; + aabbNeedsUpdate: boolean; + wlambda: Vec3; + + constructor(options?: IBodyOptions); + + wakeUp(): void; + sleep(): void; + sleepTick(time: number): void; + updateSolveMassProperties(): void; + pointToLocalFrame(worldPoint: Vec3, result?: Vec3): Vec3; + pointToWorldFrame(localPoint: Vec3, result?: Vec3): Vec3; + vectorToWorldFrame(localVector: Vec3, result?: Vec3): Vec3; + addShape(shape: Shape, offset?: Vec3, orientation?: Quaternion): void; + updateBoundingRadius(): void; + computeAABB(): void; + updateInertiaWorld(force: Vec3): void; + applyForce(force: Vec3, worldPoint: Vec3): void; + applyImpulse(impulse: Vec3, worldPoint: Vec3): void; + applyLocalForce(force: Vec3, localPoint: Vec3): void; + applyLocalImpulse(impulse: Vec3, localPoint: Vec3): void; + updateMassProperties(): void; + getVelocityAtWorldPoint(worldPoint: Vec3, result: Vec3): Vec3; + + } + + export interface IRaycastVehicleOptions { + + chassisBody?: Body; + indexRightAxis?: number; + indexLeftAxis?: number; + indexUpAxis?: number; + indexForwardAxis?: number; + } + + export interface IWheelInfoOptions { + + chassisConnectionPointLocal?: Vec3; + chassisConnectionPointWorld?: Vec3; + directionLocal?: Vec3; + directionWorld?: Vec3; + axleLocal?: Vec3; + axleWorld?: Vec3; + suspensionRestLength?: number; + suspensionMaxLength?: number; + radius?: number; + suspensionStiffness?: number; + dampingCompression?: number; + dampingRelaxation?: number; + frictionSlip?: number; + steering?: number; + rotation?: number; + deltaRotation?: number; + rollInfluence?: number; + maxSuspensionForce?: number; + isFronmtWheel?: boolean; + clippedInvContactDotSuspension?: number; + suspensionRelativeVelocity?: number; + suspensionForce?: number; + skidInfo?: number; + suspensionLength?: number; + maxSuspensionTravel?: number; + useCustomSlidingRotationalSpeed?: boolean; + customSlidingRotationalSpeed?: number; + + position?: Vec3; + direction?: Vec3; + axis?: Vec3; + body?: Body; + + } + + export class WheelInfo { + /** + * Max travel distance of the suspension, in meters. + * @property {number} maxSuspensionTravel + */ + maxSuspensionTravel: number; + /** + * Speed to apply to the wheel rotation when the wheel is sliding. + * @property {number} customSlidingRotationalSpeed + */ + customSlidingRotationalSpeed: number; + /** + * If the customSlidingRotationalSpeed should be used. + * @property {Boolean} useCustomSlidingRotationalSpeed + */ + useCustomSlidingRotationalSpeed: boolean; + /** + * @property {Boolean} sliding + */ + sliding: boolean; + /** + * Connection point, defined locally in the chassis body frame. + * @property {Vec3} chassisConnectionPointLocal + */ + chassisConnectionPointLocal: Vec3; + /** + * @property {Vec3} chassisConnectionPointWorld + */ + chassisConnectionPointWorld: Vec3; + /** + * @property {Vec3} directionLocal + */ + directionLocal: Vec3; + /** + * @property {Vec3} directionWorld + */ + directionWorld: Vec3; + /** + * @property {Vec3} axleLocal + */ + axleLocal: Vec3; + /** + * @property {Vec3} axleWorld + */ + axleWorld: Vec3; + /** + * @property {number} suspensionRestLength + */ + suspensionRestLength: number; + /** + * @property {number} suspensionMaxLength + */ + suspensionMaxLength: number; + /** + * @property {number} radius + */ + radius: number; + /** + * @property {number} suspensionStiffness + */ + suspensionStiffness: number; + /** + * @property {number} dampingCompression + */ + dampingCompression: number; + /** + * @property {number} dampingRelaxation + */ + dampingRelaxation: number; + /** + * @property {number} frictionSlip + */ + frictionSlip: number; + /** + * @property {number} steering + */ + steering: number; + /** + * Rotation value, in radians. + * @property {number} rotation + */ + rotation: number; + /** + * @property {number} deltaRotation + */ + deltaRotation: number; + /** + * @property {number} rollInfluence + */ + rollInfluence: number; + /** + * @property {number} maxSuspensionForce + */ + maxSuspensionForce: number; + /** + * @property {number} engineForce + */ + engineForce: number; + /** + * @property {number} brake + */ + brake: number; + /** + * @property {number} isFrontWheel + */ + isFrontWheel: boolean; + /** + * @property {number} clippedInvContactDotSuspension + */ + clippedInvContactDotSuspension: number; + /** + * @property {number} suspensionRelativeVelocity + */ + suspensionRelativeVelocity: number; + /** + * @property {number} suspensionForce + */ + suspensionForce: number; + /** + * @property {number} skidInfo + */ + skidInfo: number; + /** + * @property {number} suspensionLength + */ + suspensionLength: number; + /** + * @property {number} sideImpulse + */ + sideImpulse: number; + /** + * @property {number} forwardImpulse + */ + forwardImpulse: number; + /** + * The result from raycasting + * @property {RaycastResult} raycastResult + */ + raycastResult: RaycastResult; + /** + * Wheel world transform + * @property {Transform} worldTransform + */ + worldTransform: Transform; + /** + * @property {boolean} isInContact + */ + isInContact: boolean; + + updateWheel(chassis: any): void; + + constructor(options?: IWheelInfoOptions); + + } + + export class RaycastVehicle { + + chassisBody: Body; + wheelInfos: WheelInfo[]; + sliding: boolean; + world: World; + iindexRightAxis: number; + indexForwardAxis: number; + indexUpAxis: number; + numWheelsOnGround: number; + currentVehicleSpeedKmHour: number; + + constructor(options?: IRaycastVehicleOptions); + + addWheel(options?: any): number; + setSteeringValue(value: number, wheelIndex: any): void; + applyEngineForce(value: number, wheelIndex: any): void; + setBrake(brake: number, wheelIndex: any): void; + addToWorld(world: any): void; + preStepCallback: () => void; + getVehicleAxisWorld(axisIndex: any, result: Vec3): void; + updateVehicle(timeStep: any): void; + updateSuspension(deltaTime: any): void; + removeFromWorld(world: any): void; + castRay(wheel: any): number; + updateWheelTransformWorld(wheel: any): void; + updateWheelTransform(wheelIndex: any): void; + getWheelTransformWorld(wheelIndex: any): any; + updateFriction(timeStep: any): void; + } + + export interface IRigidVehicleOptions { + + chassisBody: Body; + + } + + export class RigidVehicle { + + wheelBodies: Body[]; + coordinateSystem: Vec3; + chassisBody: Body; + constraints: Constraint[]; + wheelAxes: Vec3[]; + wheelForces: Vec3[]; + + constructor(options?: IRigidVehicleOptions); + + addWheel(options?: IWheelInfoOptions): Body; + setSteeringValue(value: number, wheelIndex: number): void; + setMotorSpeed(value: number, wheelIndex: number): void; + disableMotor(wheelIndex: number): void; + setWheelForce(value: number, wheelIndex: number): void; + applyWheelForce(value: number, wheelIndex: number): void; + addToWorld(world: World): void; + removeFromWorld(world: World): void; + getWheelSpeed(wheelIndex: number): number; + + } + + export class SPHSystem { + + particles: Particle[]; + density: number; + smoothingRadius: number; + speedOfSound: number; + viscosity: number; + eps: number; + pressures: number[]; + densities: number[]; + neighbors: number[]; + + add(particle: Particle): void; + remove(particle: Particle): void; + getNeighbors(particle: Particle, neighbors: Particle[]): void; + update(): void; + w(r: number): number; + gradw(rVec: Vec3, resultVec: Vec3): void; + nablaw(r: number): number; + + } + + export interface ISpringOptions { + + restLength?: number; + stiffness?: number; + damping?: number; + worldAnchorA?: Vec3; + worldAnchorB?: Vec3; + localAnchorA?: Vec3; + localAnchorB?: Vec3; + + } + + export class Spring { + + restLength: number; + stffness: number; + damping: number; + bodyA: Body; + bodyB: Body; + localAnchorA: Vec3; + localAnchorB: Vec3; + + constructor(options?: ISpringOptions); + + setWorldAnchorA(worldAnchorA: Vec3): void; + setWorldAnchorB(worldAnchorB: Vec3): void; + getWorldAnchorA(result: Vec3): void; + getWorldAnchorB(result: Vec3): void; + applyForce(): void; + + } + + export class Box extends Shape { + + static calculateIntertia(halfExtents: Vec3, mass: number, target: Vec3): void; + + boundingSphereRadius: number; + collisionResponse: boolean; + halfExtents: Vec3; + convexPolyhedronRepresentation: ConvexPolyhedron; + + constructor(halfExtents: Vec3); + + updateConvexPolyhedronRepresentation(): void; + // calculateLocalInertia(mass: number, target?: Vec3): Vec3; + getSideNormals(sixTargetVectors: boolean, quat?: Quaternion): Vec3[]; + // updateBoundingSphereRadius(): number; + volume(): number; + forEachWorldCorner(pos: Vec3, quat: Quaternion, callback: Function): void; + + } + + export class ConvexPolyhedron extends Shape { + + static computeNormal(va: Vec3, vb: Vec3, vc: Vec3, target: Vec3): void; + static project(hull: ConvexPolyhedron, axis: Vec3, pos: Vec3, quat: Quaternion, result: number[]): void; + + vertices: Vec3[]; + worldVertices: Vec3[]; + worldVerticesNeedsUpdate: boolean; + faces: number[][]; + faceNormals: Vec3[]; + uniqueEdges: Vec3[]; + + constructor(points?: Vec3[], faces?: number[]); + + computeEdges(): void; + computeNormals(): void; + getFaceNormal(i: number, target: Vec3): Vec3; + clipAgainstHull(posA: Vec3, quatA: Quaternion, hullB: Vec3, quatB: Quaternion, separatingNormal: Vec3, minDist: number, maxDist: number, result: any[]): void; + findSaparatingAxis(hullB: ConvexPolyhedron, posA: Vec3, quatA: Quaternion, posB: Vec3, quatB: Quaternion, target: Vec3, faceListA: any[], faceListB: any[]): boolean; + testSepAxis(axis: Vec3, hullB: ConvexPolyhedron, posA: Vec3, quatA: Quaternion, posB: Vec3, quatB: Quaternion): number; + getPlaneConstantOfFace(face_i: number): number; + clipFaceAgainstHull(separatingNormal: Vec3, posA: Vec3, quatA: Quaternion, worldVertsB1: Vec3[], minDist: number, maxDist: number, result: any[]): void; + clipFaceAgainstPlane(inVertices: Vec3[], outVertices: Vec3[], planeNormal: Vec3, planeConstant: number): Vec3; + computeWorldVertices(position: Vec3, quat: Quaternion): void; + computeLocalAABB(aabbmin: Vec3, aabbmax: Vec3): void; + computeWorldFaceNormals(quat: Quaternion): void; + calculateWorldAABB(pos: Vec3, quat: Quaternion, min: Vec3, max: Vec3): void; + getAveragePointLocal(target: Vec3): Vec3; + transformAllPoints(offset: Vec3, quat: Quaternion): void; + pointIsInside(p: Vec3): boolean; + + } + + export class Cylinder extends Shape { + + constructor(radiusTop: number, radiusBottom: number, height: number, numSegments: number); + + } + + export interface IHightfield { + + minValue?: number; + maxValue?: number; + elementSize: number; + + } + + export class Heightfield extends Shape { + + data: number[][]; + maxValue: number; + minValue: number; + elementSize: number; + cacheEnabled: boolean; + pillarConvex: ConvexPolyhedron; + pillarOffset: Vec3; + type: number; + + constructor(data: number[], options?: IHightfield); + + update(): void; + updateMinValue(): void; + updateMaxValue(): void; + setHeightValueAtIndex(xi: number, yi: number, value: number): void; + getRectMinMax(iMinX: number, iMinY: number, iMaxX: number, iMaxY: number, result: any[]): void; + getIndexOfPosition(x: number, y: number, result: any[], clamp: boolean): boolean; + getConvexTrianglePillar(xi: number, yi: number, getUpperTriangle: boolean): void; + + } + + export class Particle extends Shape { + + } + + export class Plane extends Shape { + + worldNormal: Vec3; + worldNormalNeedsUpdate: boolean; + boundingSphereRadius: number; + + computeWorldNormal(quat: Quaternion): void; + calculateWorldAABB(pos: Vec3, quat: Quaternion, min: number, max: number): void; + + } + + export class Shape { + + /** + * Base class for shapes + * @class Shape + * @constructor + * @param {object} [options] + * @param {number} [options.collisionFilterGroup=1] + * @param {number} [options.collisionFilterMask=-1] + * @param {number} [options.collisionResponse=true] + * @param {number} [options.material=null] + * @author schteppe + */ + constructor(options?: { + collisionFilterGroup?: number; + collisionFilterMask?: number; + collisionResponse?: number; + material?: number; + }); + /** + * Identifyer of the Shape. + * @property {number} id + */ + id: number; + /** + * The type of this shape. Must be set to an int > 0 by subclasses. + * @property type + * @type {Number} + * @see Shape.types + */ + type: Number; + /** + * The local bounding sphere radius of this shape. + * @property {Number} boundingSphereRadius + */ + boundingSphereRadius: number; + /** + * Whether to produce contact forces when in contact with other bodies. Note that contacts will be generated, but they will be disabled. + * @property {boolean} collisionResponse + */ + collisionResponse: number | boolean; + /** + * @property {Number} collisionFilterGroup + */ + collisionFilterGroup: number; + /** + * @property {Number} collisionFilterMask + */ + collisionFilterMask: number; + /** + * @property {Material} material + */ + material: number; + /** + * @property {Body} body + */ + body: any; + updateBoundingSphereRadius(): never; + volume(): number; + calculateLocalInertia(mass: number, target: Vec3): never; + + } + + export class Sphere extends Shape { + + radius: number; + + constructor(radius: number); + + } + + export class GSSolver extends Solver { + + iterations: number; + tolerance: number; + + solve(dy: number, world: World): number; + + + } + + export class Solver { + iterations: number; + equations: Equation[]; + + solve(dy: number, world: World): number; + addEquation(eq: Equation): void; + removeEquation(eq: Equation): void; + removeAllEquations(): void; + + } + + export class SplitSolver extends Solver { + + subsolver: Solver; + + constructor(subsolver: Solver); + + solve(dy: number, world: World): number; + + } + + export class EventTarget { + + addEventListener(type: string, listener: Function): EventTarget; + hasEventListener(type: string, listener: Function): boolean; + removeEventListener(type: string, listener: Function): EventTarget; + dispatchEvent(event: IEvent): IEvent; + + } + + export class Pool { + + objects: any[]; + type: any[]; + + release(): any; + get(): any; + constructObject(): any; + + } + + export class TupleDictionary { + + data: { + keys: any[]; + }; + + get(i: number, j: number): number; + set(i: number, j: number, value: number): void; + reset(): void; + + } + + export class Utils { + + static defaults(options?: any, defaults?: any): any; + + } + + export class Vec3Pool extends Pool { + + type: any; + + constructObject(): Vec3; + + } + + export class NarrowPhase { + + contactPointPool: Pool[]; + v3pool: Vec3Pool; + + } + + export class World extends EventTarget { + iterations: number; + dt: number; + allowSleep: boolean; + contacts: ContactEquation[]; + frictionEquations: FrictionEquation[]; + quatNormalizeSkip: number; + quatNormalizeFast: boolean; + time: number; + stepnumber: number; + default_dt: number; + nextId: number; + gravity: Vec3; + broadphase: NaiveBroadphase; + bodies: Body[]; + solver: Solver; + constraints: Constraint[]; + narrowPhase: NarrowPhase; + collisionMatrix: ArrayCollisionMatrix; + collisionMatrixPrevious: ArrayCollisionMatrix; + materials: Material[]; + contactmaterials: ContactMaterial[]; + contactMaterialTable: TupleDictionary; + defaultMaterial: Material; + defaultContactMaterial: ContactMaterial; + doProfiling: boolean; + profile: { + solve: number; + makeContactConstraints: number; + broadphaser: number; + integrate: number; + narrowphase: number; + }; + subsystems: any[]; + addBodyEvent: IBodyEvent; + removeBodyEvent: IBodyEvent; + + getContactMaterial(m1: Material, m2: Material): ContactMaterial; + numObjects(): number; + collisionMatrixTick(): void; + addBody(body: Body): void; + addConstraint(c: any): void; + removeConstraint(c: any): void; + rayTest(from: Vec3, to: Vec3, result: RaycastResult): void; + raycastAll(from: Vec3, to: Vec3, options: { + collisionFilterMask?: number; + collisionFilterGroup?: number; + skipBackfaces?: boolean; + checkCollisionResponse?: boolean; + }, callback: Function): boolean; + raycastAny(from: Vec3, to: Vec3, options: { + collisionFilterMask?: number; + collisionFilterGroup?: number; + skipBackfaces?: boolean; + checkCollisionResponse?: boolean; + }, result: RaycastResult): boolean; + raycastClosest(from: Vec3, to: Vec3, options: { + collisionFilterMask?: number; + collisionFilterGroup?: number; + skipBackfaces?: boolean; + checkCollisionResponse?: boolean; + }, result: RaycastResult): boolean; + remove(body: Body): void; + getBodyById(id: any): any; + getShapeById(id: any): any; + addMaterial(m: Material): void; + addContactMaterial(cmat: ContactMaterial): void; + step(dt: number, timeSinceLastCalled?: number, maxSubSteps?: number): void; + internalStep(dt: any): void; + emitContactEvents: () => void; + clearForces(): void; + } + + export interface IEvent { + + type: string; + + } + + export interface IBodyEvent extends IEvent { + + body: Body; + + } + + export interface ICollisionEvent extends IBodyEvent { + contact: any; + } + +} + + +declare module "cannon" { + export = CANNON; +} diff --git a/Sketchbook-master/Sketchbook-master/src/lib/cannon/cannon.js b/Sketchbook-master/Sketchbook-master/src/lib/cannon/cannon.js new file mode 100644 index 00000000..c905ff99 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/lib/cannon/cannon.js @@ -0,0 +1,14586 @@ +// Sat, 25 Jan 2020 14:22:34 GMT + +/* + * Copyright (c) 2015 cannon.js Authors + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&false)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.CANNON=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o (http://steffe.se)", + "keywords": [ + "cannon.js", + "cannon", + "physics", + "engine", + "3d" + ], + "main": "./src/Cannon.js", + "engines": { + "node": "*" + }, + "repository": { + "type": "git", + "url": "https://github.com/schteppe/cannon.js.git" + }, + "bugs": { + "url": "https://github.com/schteppe/cannon.js/issues" + }, + "licenses": [ + { + "type": "MIT" + } + ], + "devDependencies": { + "browserify": "*", + "grunt": "^0.4.5", + "grunt-browserify": "^2.1.4", + "grunt-contrib-concat": "~0.1.3", + "grunt-contrib-jshint": "~0.1.1", + "grunt-contrib-nodeunit": "^0.4.1", + "grunt-contrib-uglify": "^0.5.1", + "grunt-contrib-yuidoc": "^0.5.2", + "jshint": "latest", + "nodeunit": "^0.9.0", + "uglify-js": "latest" + }, + "dependencies": { + "typescript": "^3.7.4" + } +} + +},{}],2:[function(_dereq_,module,exports){ +// Export classes +module.exports = { + version : _dereq_('../package.json').version, + + AABB : _dereq_('./collision/AABB'), + ArrayCollisionMatrix : _dereq_('./collision/ArrayCollisionMatrix'), + Body : _dereq_('./objects/Body'), + Box : _dereq_('./shapes/Box'), + Broadphase : _dereq_('./collision/Broadphase'), + Constraint : _dereq_('./constraints/Constraint'), + ContactEquation : _dereq_('./equations/ContactEquation'), + Narrowphase : _dereq_('./world/Narrowphase'), + ConeTwistConstraint : _dereq_('./constraints/ConeTwistConstraint'), + ContactMaterial : _dereq_('./material/ContactMaterial'), + ConvexPolyhedron : _dereq_('./shapes/ConvexPolyhedron'), + Cylinder : _dereq_('./shapes/Cylinder'), + DistanceConstraint : _dereq_('./constraints/DistanceConstraint'), + Equation : _dereq_('./equations/Equation'), + EventTarget : _dereq_('./utils/EventTarget'), + FrictionEquation : _dereq_('./equations/FrictionEquation'), + GSSolver : _dereq_('./solver/GSSolver'), + GridBroadphase : _dereq_('./collision/GridBroadphase'), + Heightfield : _dereq_('./shapes/Heightfield'), + HingeConstraint : _dereq_('./constraints/HingeConstraint'), + LockConstraint : _dereq_('./constraints/LockConstraint'), + Mat3 : _dereq_('./math/Mat3'), + Material : _dereq_('./material/Material'), + NaiveBroadphase : _dereq_('./collision/NaiveBroadphase'), + ObjectCollisionMatrix : _dereq_('./collision/ObjectCollisionMatrix'), + Pool : _dereq_('./utils/Pool'), + Particle : _dereq_('./shapes/Particle'), + Plane : _dereq_('./shapes/Plane'), + PointToPointConstraint : _dereq_('./constraints/PointToPointConstraint'), + Quaternion : _dereq_('./math/Quaternion'), + Ray : _dereq_('./collision/Ray'), + RaycastVehicle : _dereq_('./objects/RaycastVehicle'), + RaycastResult : _dereq_('./collision/RaycastResult'), + RigidVehicle : _dereq_('./objects/RigidVehicle'), + RotationalEquation : _dereq_('./equations/RotationalEquation'), + RotationalMotorEquation : _dereq_('./equations/RotationalMotorEquation'), + SAPBroadphase : _dereq_('./collision/SAPBroadphase'), + SPHSystem : _dereq_('./objects/SPHSystem'), + Shape : _dereq_('./shapes/Shape'), + Solver : _dereq_('./solver/Solver'), + Sphere : _dereq_('./shapes/Sphere'), + SplitSolver : _dereq_('./solver/SplitSolver'), + Spring : _dereq_('./objects/Spring'), + Transform : _dereq_('./math/Transform'), + Trimesh : _dereq_('./shapes/Trimesh'), + Vec3 : _dereq_('./math/Vec3'), + Vec3Pool : _dereq_('./utils/Vec3Pool'), + World : _dereq_('./world/World'), +}; + +},{"../package.json":1,"./collision/AABB":3,"./collision/ArrayCollisionMatrix":4,"./collision/Broadphase":5,"./collision/GridBroadphase":6,"./collision/NaiveBroadphase":7,"./collision/ObjectCollisionMatrix":8,"./collision/Ray":10,"./collision/RaycastResult":11,"./collision/SAPBroadphase":12,"./constraints/ConeTwistConstraint":13,"./constraints/Constraint":14,"./constraints/DistanceConstraint":15,"./constraints/HingeConstraint":16,"./constraints/LockConstraint":17,"./constraints/PointToPointConstraint":18,"./equations/ContactEquation":20,"./equations/Equation":21,"./equations/FrictionEquation":22,"./equations/RotationalEquation":23,"./equations/RotationalMotorEquation":24,"./material/ContactMaterial":25,"./material/Material":26,"./math/Mat3":28,"./math/Quaternion":29,"./math/Transform":30,"./math/Vec3":31,"./objects/Body":32,"./objects/RaycastVehicle":33,"./objects/RigidVehicle":34,"./objects/SPHSystem":35,"./objects/Spring":36,"./shapes/Box":38,"./shapes/ConvexPolyhedron":39,"./shapes/Cylinder":40,"./shapes/Heightfield":41,"./shapes/Particle":42,"./shapes/Plane":43,"./shapes/Shape":44,"./shapes/Sphere":45,"./shapes/Trimesh":46,"./solver/GSSolver":47,"./solver/Solver":48,"./solver/SplitSolver":49,"./utils/EventTarget":50,"./utils/Pool":52,"./utils/Vec3Pool":55,"./world/Narrowphase":56,"./world/World":57}],3:[function(_dereq_,module,exports){ +var Vec3 = _dereq_('../math/Vec3'); +var Utils = _dereq_('../utils/Utils'); + +module.exports = AABB; + +/** + * Axis aligned bounding box class. + * @class AABB + * @constructor + * @param {Object} [options] + * @param {Vec3} [options.upperBound] + * @param {Vec3} [options.lowerBound] + */ +function AABB(options){ + options = options || {}; + + /** + * The lower bound of the bounding box. + * @property lowerBound + * @type {Vec3} + */ + this.lowerBound = new Vec3(); + if(options.lowerBound){ + this.lowerBound.copy(options.lowerBound); + } + + /** + * The upper bound of the bounding box. + * @property upperBound + * @type {Vec3} + */ + this.upperBound = new Vec3(); + if(options.upperBound){ + this.upperBound.copy(options.upperBound); + } +} + +var tmp = new Vec3(); + +/** + * Set the AABB bounds from a set of points. + * @method setFromPoints + * @param {Array} points An array of Vec3's. + * @param {Vec3} position + * @param {Quaternion} quaternion + * @param {number} skinSize + * @return {AABB} The self object + */ +AABB.prototype.setFromPoints = function(points, position, quaternion, skinSize){ + var l = this.lowerBound, + u = this.upperBound, + q = quaternion; + + // Set to the first point + l.copy(points[0]); + if(q){ + q.vmult(l, l); + } + u.copy(l); + + for(var i = 1; i u.x){ u.x = p.x; } + if(p.x < l.x){ l.x = p.x; } + if(p.y > u.y){ u.y = p.y; } + if(p.y < l.y){ l.y = p.y; } + if(p.z > u.z){ u.z = p.z; } + if(p.z < l.z){ l.z = p.z; } + } + + // Add offset + if (position) { + position.vadd(l, l); + position.vadd(u, u); + } + + if(skinSize){ + l.x -= skinSize; + l.y -= skinSize; + l.z -= skinSize; + u.x += skinSize; + u.y += skinSize; + u.z += skinSize; + } + + return this; +}; + +/** + * Copy bounds from an AABB to this AABB + * @method copy + * @param {AABB} aabb Source to copy from + * @return {AABB} The this object, for chainability + */ +AABB.prototype.copy = function(aabb){ + this.lowerBound.copy(aabb.lowerBound); + this.upperBound.copy(aabb.upperBound); + return this; +}; + +/** + * Clone an AABB + * @method clone + */ +AABB.prototype.clone = function(){ + return new AABB().copy(this); +}; + +/** + * Extend this AABB so that it covers the given AABB too. + * @method extend + * @param {AABB} aabb + */ +AABB.prototype.extend = function(aabb){ + this.lowerBound.x = Math.min(this.lowerBound.x, aabb.lowerBound.x); + this.upperBound.x = Math.max(this.upperBound.x, aabb.upperBound.x); + this.lowerBound.y = Math.min(this.lowerBound.y, aabb.lowerBound.y); + this.upperBound.y = Math.max(this.upperBound.y, aabb.upperBound.y); + this.lowerBound.z = Math.min(this.lowerBound.z, aabb.lowerBound.z); + this.upperBound.z = Math.max(this.upperBound.z, aabb.upperBound.z); +}; + +/** + * Returns true if the given AABB overlaps this AABB. + * @method overlaps + * @param {AABB} aabb + * @return {Boolean} + */ +AABB.prototype.overlaps = function(aabb){ + var l1 = this.lowerBound, + u1 = this.upperBound, + l2 = aabb.lowerBound, + u2 = aabb.upperBound; + + // l2 u2 + // |---------| + // |--------| + // l1 u1 + + var overlapsX = ((l2.x <= u1.x && u1.x <= u2.x) || (l1.x <= u2.x && u2.x <= u1.x)); + var overlapsY = ((l2.y <= u1.y && u1.y <= u2.y) || (l1.y <= u2.y && u2.y <= u1.y)); + var overlapsZ = ((l2.z <= u1.z && u1.z <= u2.z) || (l1.z <= u2.z && u2.z <= u1.z)); + + return overlapsX && overlapsY && overlapsZ; +}; + +// Mostly for debugging +AABB.prototype.volume = function(){ + var l = this.lowerBound, + u = this.upperBound; + return (u.x - l.x) * (u.y - l.y) * (u.z - l.z); +}; + + +/** + * Returns true if the given AABB is fully contained in this AABB. + * @method contains + * @param {AABB} aabb + * @return {Boolean} + */ +AABB.prototype.contains = function(aabb){ + var l1 = this.lowerBound, + u1 = this.upperBound, + l2 = aabb.lowerBound, + u2 = aabb.upperBound; + + // l2 u2 + // |---------| + // |---------------| + // l1 u1 + + return ( + (l1.x <= l2.x && u1.x >= u2.x) && + (l1.y <= l2.y && u1.y >= u2.y) && + (l1.z <= l2.z && u1.z >= u2.z) + ); +}; + +/** + * @method getCorners + * @param {Vec3} a + * @param {Vec3} b + * @param {Vec3} c + * @param {Vec3} d + * @param {Vec3} e + * @param {Vec3} f + * @param {Vec3} g + * @param {Vec3} h + */ +AABB.prototype.getCorners = function(a, b, c, d, e, f, g, h){ + var l = this.lowerBound, + u = this.upperBound; + + a.copy(l); + b.set( u.x, l.y, l.z ); + c.set( u.x, u.y, l.z ); + d.set( l.x, u.y, u.z ); + e.set( u.x, l.y, u.z ); + f.set( l.x, u.y, l.z ); + g.set( l.x, l.y, u.z ); + h.copy(u); +}; + +var transformIntoFrame_corners = [ + new Vec3(), + new Vec3(), + new Vec3(), + new Vec3(), + new Vec3(), + new Vec3(), + new Vec3(), + new Vec3() +]; + +/** + * Get the representation of an AABB in another frame. + * @method toLocalFrame + * @param {Transform} frame + * @param {AABB} target + * @return {AABB} The "target" AABB object. + */ +AABB.prototype.toLocalFrame = function(frame, target){ + + var corners = transformIntoFrame_corners; + var a = corners[0]; + var b = corners[1]; + var c = corners[2]; + var d = corners[3]; + var e = corners[4]; + var f = corners[5]; + var g = corners[6]; + var h = corners[7]; + + // Get corners in current frame + this.getCorners(a, b, c, d, e, f, g, h); + + // Transform them to new local frame + for(var i=0; i !== 8; i++){ + var corner = corners[i]; + frame.pointToLocal(corner, corner); + } + + return target.setFromPoints(corners); +}; + +/** + * Get the representation of an AABB in the global frame. + * @method toWorldFrame + * @param {Transform} frame + * @param {AABB} target + * @return {AABB} The "target" AABB object. + */ +AABB.prototype.toWorldFrame = function(frame, target){ + + var corners = transformIntoFrame_corners; + var a = corners[0]; + var b = corners[1]; + var c = corners[2]; + var d = corners[3]; + var e = corners[4]; + var f = corners[5]; + var g = corners[6]; + var h = corners[7]; + + // Get corners in current frame + this.getCorners(a, b, c, d, e, f, g, h); + + // Transform them to new local frame + for(var i=0; i !== 8; i++){ + var corner = corners[i]; + frame.pointToWorld(corner, corner); + } + + return target.setFromPoints(corners); +}; + +/** + * Check if the AABB is hit by a ray. + * @param {Ray} ray + * @return {number} + */ +AABB.prototype.overlapsRay = function(ray){ + var t = 0; + + // ray.direction is unit direction vector of ray + var dirFracX = 1 / ray._direction.x; + var dirFracY = 1 / ray._direction.y; + var dirFracZ = 1 / ray._direction.z; + + // this.lowerBound is the corner of AABB with minimal coordinates - left bottom, rt is maximal corner + var t1 = (this.lowerBound.x - ray.from.x) * dirFracX; + var t2 = (this.upperBound.x - ray.from.x) * dirFracX; + var t3 = (this.lowerBound.y - ray.from.y) * dirFracY; + var t4 = (this.upperBound.y - ray.from.y) * dirFracY; + var t5 = (this.lowerBound.z - ray.from.z) * dirFracZ; + var t6 = (this.upperBound.z - ray.from.z) * dirFracZ; + + // var tmin = Math.max(Math.max(Math.min(t1, t2), Math.min(t3, t4))); + // var tmax = Math.min(Math.min(Math.max(t1, t2), Math.max(t3, t4))); + var tmin = Math.max(Math.max(Math.min(t1, t2), Math.min(t3, t4)), Math.min(t5, t6)); + var tmax = Math.min(Math.min(Math.max(t1, t2), Math.max(t3, t4)), Math.max(t5, t6)); + + // if tmax < 0, ray (line) is intersecting AABB, but whole AABB is behing us + if (tmax < 0){ + //t = tmax; + return false; + } + + // if tmin > tmax, ray doesn't intersect AABB + if (tmin > tmax){ + //t = tmax; + return false; + } + + return true; +}; +},{"../math/Vec3":31,"../utils/Utils":54}],4:[function(_dereq_,module,exports){ +module.exports = ArrayCollisionMatrix; + +/** + * Collision "matrix". It's actually a triangular-shaped array of whether two bodies are touching this step, for reference next step + * @class ArrayCollisionMatrix + * @constructor + */ +function ArrayCollisionMatrix() { + + /** + * The matrix storage + * @property matrix + * @type {Array} + */ + this.matrix = []; +} + +/** + * Get an element + * @method get + * @param {Number} i + * @param {Number} j + * @return {Number} + */ +ArrayCollisionMatrix.prototype.get = function(i, j) { + i = i.index; + j = j.index; + if (j > i) { + var temp = j; + j = i; + i = temp; + } + return this.matrix[(i*(i + 1)>>1) + j-1]; +}; + +/** + * Set an element + * @method set + * @param {Number} i + * @param {Number} j + * @param {Number} value + */ +ArrayCollisionMatrix.prototype.set = function(i, j, value) { + i = i.index; + j = j.index; + if (j > i) { + var temp = j; + j = i; + i = temp; + } + this.matrix[(i*(i + 1)>>1) + j-1] = value ? 1 : 0; +}; + +/** + * Sets all elements to zero + * @method reset + */ +ArrayCollisionMatrix.prototype.reset = function() { + for (var i=0, l=this.matrix.length; i!==l; i++) { + this.matrix[i]=0; + } +}; + +/** + * Sets the max number of objects + * @method setNumObjects + * @param {Number} n + */ +ArrayCollisionMatrix.prototype.setNumObjects = function(n) { + this.matrix.length = n*(n-1)>>1; +}; + +},{}],5:[function(_dereq_,module,exports){ +var Body = _dereq_('../objects/Body'); +var Vec3 = _dereq_('../math/Vec3'); +var Quaternion = _dereq_('../math/Quaternion'); +var Shape = _dereq_('../shapes/Shape'); +var Plane = _dereq_('../shapes/Plane'); + +module.exports = Broadphase; + +/** + * Base class for broadphase implementations + * @class Broadphase + * @constructor + * @author schteppe + */ +function Broadphase(){ + /** + * The world to search for collisions in. + * @property world + * @type {World} + */ + this.world = null; + + /** + * If set to true, the broadphase uses bounding boxes for intersection test, else it uses bounding spheres. + * @property useBoundingBoxes + * @type {Boolean} + */ + this.useBoundingBoxes = false; + + /** + * Set to true if the objects in the world moved. + * @property {Boolean} dirty + */ + this.dirty = true; +} + +/** + * Get the collision pairs from the world + * @method collisionPairs + * @param {World} world The world to search in + * @param {Array} p1 Empty array to be filled with body objects + * @param {Array} p2 Empty array to be filled with body objects + */ +Broadphase.prototype.collisionPairs = function(world,p1,p2){ + throw new Error("collisionPairs not implemented for this BroadPhase class!"); +}; + +/** + * Check if a body pair needs to be intersection tested at all. + * @method needBroadphaseCollision + * @param {Body} bodyA + * @param {Body} bodyB + * @return {bool} + */ +Broadphase.prototype.needBroadphaseCollision = function(bodyA,bodyB){ + + // Check collision filter masks + if( (bodyA.collisionFilterGroup & bodyB.collisionFilterMask)===0 || (bodyB.collisionFilterGroup & bodyA.collisionFilterMask)===0){ + return false; + } + + // Check types + if(((bodyA.type & Body.STATIC)!==0 || bodyA.sleepState === Body.SLEEPING) && + ((bodyB.type & Body.STATIC)!==0 || bodyB.sleepState === Body.SLEEPING)) { + // Both bodies are static or sleeping. Skip. + return false; + } + + return true; +}; + +/** + * Check if the bounding volumes of two bodies intersect. + * @method intersectionTest + * @param {Body} bodyA + * @param {Body} bodyB + * @param {array} pairs1 + * @param {array} pairs2 + */ +Broadphase.prototype.intersectionTest = function(bodyA, bodyB, pairs1, pairs2){ + if(this.useBoundingBoxes){ + this.doBoundingBoxBroadphase(bodyA,bodyB,pairs1,pairs2); + } else { + this.doBoundingSphereBroadphase(bodyA,bodyB,pairs1,pairs2); + } +}; + +/** + * Check if the bounding spheres of two bodies are intersecting. + * @method doBoundingSphereBroadphase + * @param {Body} bodyA + * @param {Body} bodyB + * @param {Array} pairs1 bodyA is appended to this array if intersection + * @param {Array} pairs2 bodyB is appended to this array if intersection + */ +var Broadphase_collisionPairs_r = new Vec3(), // Temp objects + Broadphase_collisionPairs_normal = new Vec3(), + Broadphase_collisionPairs_quat = new Quaternion(), + Broadphase_collisionPairs_relpos = new Vec3(); +Broadphase.prototype.doBoundingSphereBroadphase = function(bodyA,bodyB,pairs1,pairs2){ + var r = Broadphase_collisionPairs_r; + bodyB.position.vsub(bodyA.position,r); + var boundingRadiusSum2 = Math.pow(bodyA.boundingRadius + bodyB.boundingRadius, 2); + var norm2 = r.norm2(); + if(norm2 < boundingRadiusSum2){ + pairs1.push(bodyA); + pairs2.push(bodyB); + } +}; + +/** + * Check if the bounding boxes of two bodies are intersecting. + * @method doBoundingBoxBroadphase + * @param {Body} bodyA + * @param {Body} bodyB + * @param {Array} pairs1 + * @param {Array} pairs2 + */ +Broadphase.prototype.doBoundingBoxBroadphase = function(bodyA,bodyB,pairs1,pairs2){ + if(bodyA.aabbNeedsUpdate){ + bodyA.computeAABB(); + } + if(bodyB.aabbNeedsUpdate){ + bodyB.computeAABB(); + } + + // Check AABB / AABB + if(bodyA.aabb.overlaps(bodyB.aabb)){ + pairs1.push(bodyA); + pairs2.push(bodyB); + } +}; + +/** + * Removes duplicate pairs from the pair arrays. + * @method makePairsUnique + * @param {Array} pairs1 + * @param {Array} pairs2 + */ +var Broadphase_makePairsUnique_temp = { keys:[] }, + Broadphase_makePairsUnique_p1 = [], + Broadphase_makePairsUnique_p2 = []; +Broadphase.prototype.makePairsUnique = function(pairs1,pairs2){ + var t = Broadphase_makePairsUnique_temp, + p1 = Broadphase_makePairsUnique_p1, + p2 = Broadphase_makePairsUnique_p2, + N = pairs1.length; + + for(var i=0; i!==N; i++){ + p1[i] = pairs1[i]; + p2[i] = pairs2[i]; + } + + pairs1.length = 0; + pairs2.length = 0; + + for(var i=0; i!==N; i++){ + var id1 = p1[i].id, + id2 = p2[i].id; + var key = id1 < id2 ? id1+","+id2 : id2+","+id1; + t[key] = i; + t.keys.push(key); + } + + for(var i=0; i!==t.keys.length; i++){ + var key = t.keys.pop(), + pairIndex = t[key]; + pairs1.push(p1[pairIndex]); + pairs2.push(p2[pairIndex]); + delete t[key]; + } +}; + +/** + * To be implemented by subcasses + * @method setWorld + * @param {World} world + */ +Broadphase.prototype.setWorld = function(world){ +}; + +/** + * Check if the bounding spheres of two bodies overlap. + * @method boundingSphereCheck + * @param {Body} bodyA + * @param {Body} bodyB + * @return {boolean} + */ +var bsc_dist = new Vec3(); +Broadphase.boundingSphereCheck = function(bodyA,bodyB){ + var dist = bsc_dist; + bodyA.position.vsub(bodyB.position,dist); + return Math.pow(bodyA.shape.boundingSphereRadius + bodyB.shape.boundingSphereRadius,2) > dist.norm2(); +}; + +/** + * Returns all the bodies within the AABB. + * @method aabbQuery + * @param {World} world + * @param {AABB} aabb + * @param {array} result An array to store resulting bodies in. + * @return {array} + */ +Broadphase.prototype.aabbQuery = function(world, aabb, result){ + console.warn('.aabbQuery is not implemented in this Broadphase subclass.'); + return []; +}; +},{"../math/Quaternion":29,"../math/Vec3":31,"../objects/Body":32,"../shapes/Plane":43,"../shapes/Shape":44}],6:[function(_dereq_,module,exports){ +module.exports = GridBroadphase; + +var Broadphase = _dereq_('./Broadphase'); +var Vec3 = _dereq_('../math/Vec3'); +var Shape = _dereq_('../shapes/Shape'); + +/** + * Axis aligned uniform grid broadphase. + * @class GridBroadphase + * @constructor + * @extends Broadphase + * @todo Needs support for more than just planes and spheres. + * @param {Vec3} aabbMin + * @param {Vec3} aabbMax + * @param {Number} nx Number of boxes along x + * @param {Number} ny Number of boxes along y + * @param {Number} nz Number of boxes along z + */ +function GridBroadphase(aabbMin,aabbMax,nx,ny,nz){ + Broadphase.apply(this); + this.nx = nx || 10; + this.ny = ny || 10; + this.nz = nz || 10; + this.aabbMin = aabbMin || new Vec3(100,100,100); + this.aabbMax = aabbMax || new Vec3(-100,-100,-100); + var nbins = this.nx * this.ny * this.nz; + if (nbins <= 0) { + throw "GridBroadphase: Each dimension's n must be >0"; + } + this.bins = []; + this.binLengths = []; //Rather than continually resizing arrays (thrashing the memory), just record length and allow them to grow + this.bins.length = nbins; + this.binLengths.length = nbins; + for (var i=0;i= nx) { xoff0 = nx - 1; } + if (yoff0 < 0) { yoff0 = 0; } else if (yoff0 >= ny) { yoff0 = ny - 1; } + if (zoff0 < 0) { zoff0 = 0; } else if (zoff0 >= nz) { zoff0 = nz - 1; } + if (xoff1 < 0) { xoff1 = 0; } else if (xoff1 >= nx) { xoff1 = nx - 1; } + if (yoff1 < 0) { yoff1 = 0; } else if (yoff1 >= ny) { yoff1 = ny - 1; } + if (zoff1 < 0) { zoff1 = 0; } else if (zoff1 >= nz) { zoff1 = nz - 1; } + + xoff0 *= xstep; + yoff0 *= ystep; + zoff0 *= zstep; + xoff1 *= xstep; + yoff1 *= ystep; + zoff1 *= zstep; + + for (var xoff = xoff0; xoff <= xoff1; xoff += xstep) { + for (var yoff = yoff0; yoff <= yoff1; yoff += ystep) { + for (var zoff = zoff0; zoff <= zoff1; zoff += zstep) { + var idx = xoff+yoff+zoff; + bins[idx][binLengths[idx]++] = bi; + } + } + } + } + + // Put all bodies into the bins + for(var i=0; i!==N; i++){ + var bi = bodies[i]; + var si = bi.shape; + + switch(si.type){ + case SPHERE: + // Put in bin + // check if overlap with other bins + var x = bi.position.x, + y = bi.position.y, + z = bi.position.z; + var r = si.radius; + + addBoxToBins(x-r, y-r, z-r, x+r, y+r, z+r, bi); + break; + + case PLANE: + if(si.worldNormalNeedsUpdate){ + si.computeWorldNormal(bi.quaternion); + } + var planeNormal = si.worldNormal; + + //Relative position from origin of plane object to the first bin + //Incremented as we iterate through the bins + var xreset = xmin + binsizeX*0.5 - bi.position.x, + yreset = ymin + binsizeY*0.5 - bi.position.y, + zreset = zmin + binsizeZ*0.5 - bi.position.z; + + var d = GridBroadphase_collisionPairs_d; + d.set(xreset, yreset, zreset); + + for (var xi = 0, xoff = 0; xi !== nx; xi++, xoff += xstep, d.y = yreset, d.x += binsizeX) { + for (var yi = 0, yoff = 0; yi !== ny; yi++, yoff += ystep, d.z = zreset, d.y += binsizeY) { + for (var zi = 0, zoff = 0; zi !== nz; zi++, zoff += zstep, d.z += binsizeZ) { + if (d.dot(planeNormal) < binRadius) { + var idx = xoff + yoff + zoff; + bins[idx][binLengths[idx]++] = bi; + } + } + } + } + break; + + default: + if (bi.aabbNeedsUpdate) { + bi.computeAABB(); + } + + addBoxToBins( + bi.aabb.lowerBound.x, + bi.aabb.lowerBound.y, + bi.aabb.lowerBound.z, + bi.aabb.upperBound.x, + bi.aabb.upperBound.y, + bi.aabb.upperBound.z, + bi); + break; + } + } + + // Check each bin + for(var i=0; i!==Nbins; i++){ + var binLength = binLengths[i]; + //Skip bins with no potential collisions + if (binLength > 1) { + var bin = bins[i]; + + // Do N^2 broadphase inside + for(var xi=0; xi!==binLength; xi++){ + var bi = bin[xi]; + for(var yi=0; yi!==xi; yi++){ + var bj = bin[yi]; + if(this.needBroadphaseCollision(bi,bj)){ + this.intersectionTest(bi,bj,pairs1,pairs2); + } + } + } + } + } + +// for (var zi = 0, zoff=0; zi < nz; zi++, zoff+= zstep) { +// console.log("layer "+zi); +// for (var yi = 0, yoff=0; yi < ny; yi++, yoff += ystep) { +// var row = ''; +// for (var xi = 0, xoff=0; xi < nx; xi++, xoff += xstep) { +// var idx = xoff + yoff + zoff; +// row += ' ' + binLengths[idx]; +// } +// console.log(row); +// } +// } + + this.makePairsUnique(pairs1,pairs2); +}; + +},{"../math/Vec3":31,"../shapes/Shape":44,"./Broadphase":5}],7:[function(_dereq_,module,exports){ +module.exports = NaiveBroadphase; + +var Broadphase = _dereq_('./Broadphase'); +var AABB = _dereq_('./AABB'); + +/** + * Naive broadphase implementation, used in lack of better ones. + * @class NaiveBroadphase + * @constructor + * @description The naive broadphase looks at all possible pairs without restriction, therefore it has complexity N^2 (which is bad) + * @extends Broadphase + */ +function NaiveBroadphase(){ + Broadphase.apply(this); +} +NaiveBroadphase.prototype = new Broadphase(); +NaiveBroadphase.prototype.constructor = NaiveBroadphase; + +/** + * Get all the collision pairs in the physics world + * @method collisionPairs + * @param {World} world + * @param {Array} pairs1 + * @param {Array} pairs2 + */ +NaiveBroadphase.prototype.collisionPairs = function(world,pairs1,pairs2){ + var bodies = world.bodies, + n = bodies.length, + i,j,bi,bj; + + // Naive N^2 ftw! + for(i=0; i!==n; i++){ + for(j=0; j!==i; j++){ + + bi = bodies[i]; + bj = bodies[j]; + + if(!this.needBroadphaseCollision(bi,bj)){ + continue; + } + + this.intersectionTest(bi,bj,pairs1,pairs2); + } + } +}; + +var tmpAABB = new AABB(); + +/** + * Returns all the bodies within an AABB. + * @method aabbQuery + * @param {World} world + * @param {AABB} aabb + * @param {array} result An array to store resulting bodies in. + * @return {array} + */ +NaiveBroadphase.prototype.aabbQuery = function(world, aabb, result){ + result = result || []; + + for(var i = 0; i < world.bodies.length; i++){ + var b = world.bodies[i]; + + if(b.aabbNeedsUpdate){ + b.computeAABB(); + } + + // Ugly hack until Body gets aabb + if(b.aabb.overlaps(aabb)){ + result.push(b); + } + } + + return result; +}; +},{"./AABB":3,"./Broadphase":5}],8:[function(_dereq_,module,exports){ +module.exports = ObjectCollisionMatrix; + +/** + * Records what objects are colliding with each other + * @class ObjectCollisionMatrix + * @constructor + */ +function ObjectCollisionMatrix() { + + /** + * The matrix storage + * @property matrix + * @type {Object} + */ + this.matrix = {}; +} + +/** + * @method get + * @param {Number} i + * @param {Number} j + * @return {Number} + */ +ObjectCollisionMatrix.prototype.get = function(i, j) { + i = i.id; + j = j.id; + if (j > i) { + var temp = j; + j = i; + i = temp; + } + return i+'-'+j in this.matrix; +}; + +/** + * @method set + * @param {Number} i + * @param {Number} j + * @param {Number} value + */ +ObjectCollisionMatrix.prototype.set = function(i, j, value) { + i = i.id; + j = j.id; + if (j > i) { + var temp = j; + j = i; + i = temp; + } + if (value) { + this.matrix[i+'-'+j] = true; + } + else { + delete this.matrix[i+'-'+j]; + } +}; + +/** + * Empty the matrix + * @method reset + */ +ObjectCollisionMatrix.prototype.reset = function() { + this.matrix = {}; +}; + +/** + * Set max number of objects + * @method setNumObjects + * @param {Number} n + */ +ObjectCollisionMatrix.prototype.setNumObjects = function(n) { +}; + +},{}],9:[function(_dereq_,module,exports){ +module.exports = OverlapKeeper; + +/** + * @class OverlapKeeper + * @constructor + */ +function OverlapKeeper() { + this.current = []; + this.previous = []; +} + +OverlapKeeper.prototype.getKey = function(i, j) { + if (j < i) { + var temp = j; + j = i; + i = temp; + } + return (i << 16) | j; +}; + + +/** + * @method set + * @param {Number} i + * @param {Number} j + */ +OverlapKeeper.prototype.set = function(i, j) { + // Insertion sort. This way the diff will have linear complexity. + var key = this.getKey(i, j); + var current = this.current; + var index = 0; + while(key > current[index]){ + index++; + } + if(key === current[index]){ + return; // Pair was already added + } + for(var j=current.length-1; j>=index; j--){ + current[j + 1] = current[j]; + } + current[index] = key; +}; + +/** + * @method tick + */ +OverlapKeeper.prototype.tick = function() { + var tmp = this.current; + this.current = this.previous; + this.previous = tmp; + this.current.length = 0; +}; + +function unpackAndPush(array, key){ + array.push((key & 0xFFFF0000) >> 16, key & 0x0000FFFF); +} + +/** + * @method getDiff + * @param {array} additions + * @param {array} removals + */ +OverlapKeeper.prototype.getDiff = function(additions, removals) { + var a = this.current; + var b = this.previous; + var al = a.length; + var bl = b.length; + + var j=0; + for (var i = 0; i < al; i++) { + var found = false; + var keyA = a[i]; + while(keyA > b[j]){ + j++; + } + found = keyA === b[j]; + + if(!found){ + unpackAndPush(additions, keyA); + } + } + j = 0; + for (var i = 0; i < bl; i++) { + var found = false; + var keyB = b[i]; + while(keyB > a[j]){ + j++; + } + found = a[j] === keyB; + + if(!found){ + unpackAndPush(removals, keyB); + } + } +}; +},{}],10:[function(_dereq_,module,exports){ +module.exports = Ray; + +var Vec3 = _dereq_('../math/Vec3'); +var Quaternion = _dereq_('../math/Quaternion'); +var Transform = _dereq_('../math/Transform'); +var ConvexPolyhedron = _dereq_('../shapes/ConvexPolyhedron'); +var Box = _dereq_('../shapes/Box'); +var RaycastResult = _dereq_('../collision/RaycastResult'); +var Shape = _dereq_('../shapes/Shape'); +var AABB = _dereq_('../collision/AABB'); + +/** + * A line in 3D space that intersects bodies and return points. + * @class Ray + * @constructor + * @param {Vec3} from + * @param {Vec3} to + */ +function Ray(from, to){ + /** + * @property {Vec3} from + */ + this.from = from ? from.clone() : new Vec3(); + + /** + * @property {Vec3} to + */ + this.to = to ? to.clone() : new Vec3(); + + /** + * @private + * @property {Vec3} _direction + */ + this._direction = new Vec3(); + + /** + * The precision of the ray. Used when checking parallelity etc. + * @property {Number} precision + */ + this.precision = 0.0001; + + /** + * Set to true if you want the Ray to take .collisionResponse flags into account on bodies and shapes. + * @property {Boolean} checkCollisionResponse + */ + this.checkCollisionResponse = true; + + /** + * If set to true, the ray skips any hits with normal.dot(rayDirection) < 0. + * @property {Boolean} skipBackfaces + */ + this.skipBackfaces = false; + + /** + * @property {number} collisionFilterMask + * @default -1 + */ + this.collisionFilterMask = -1; + + /** + * @property {number} collisionFilterGroup + * @default -1 + */ + this.collisionFilterGroup = -1; + + /** + * The intersection mode. Should be Ray.ANY, Ray.ALL or Ray.CLOSEST. + * @property {number} mode + */ + this.mode = Ray.ANY; + + /** + * Current result object. + * @property {RaycastResult} result + */ + this.result = new RaycastResult(); + + /** + * Will be set to true during intersectWorld() if the ray hit anything. + * @property {Boolean} hasHit + */ + this.hasHit = false; + + /** + * Current, user-provided result callback. Will be used if mode is Ray.ALL. + * @property {Function} callback + */ + this.callback = function(result){}; +} +Ray.prototype.constructor = Ray; + +Ray.CLOSEST = 1; +Ray.ANY = 2; +Ray.ALL = 4; + +var tmpAABB = new AABB(); +var tmpArray = []; + +/** + * Do itersection against all bodies in the given World. + * @method intersectWorld + * @param {World} world + * @param {object} options + * @return {Boolean} True if the ray hit anything, otherwise false. + */ +Ray.prototype.intersectWorld = function (world, options) { + this.mode = options.mode || Ray.ANY; + this.result = options.result || new RaycastResult(); + this.skipBackfaces = !!options.skipBackfaces; + this.collisionFilterMask = typeof(options.collisionFilterMask) !== 'undefined' ? options.collisionFilterMask : -1; + this.collisionFilterGroup = typeof(options.collisionFilterGroup) !== 'undefined' ? options.collisionFilterGroup : -1; + if(options.from){ + this.from.copy(options.from); + } + if(options.to){ + this.to.copy(options.to); + } + this.callback = options.callback || function(){}; + this.hasHit = false; + + this.result.reset(); + this._updateDirection(); + + this.getAABB(tmpAABB); + tmpArray.length = 0; + world.broadphase.aabbQuery(world, tmpAABB, tmpArray); + this.intersectBodies(tmpArray); + + return this.hasHit; +}; + +var v1 = new Vec3(), + v2 = new Vec3(); + +/* + * As per "Barycentric Technique" as named here http://www.blackpawn.com/texts/pointinpoly/default.html But without the division + */ +Ray.pointInTriangle = pointInTriangle; +function pointInTriangle(p, a, b, c) { + c.vsub(a,v0); + b.vsub(a,v1); + p.vsub(a,v2); + + var dot00 = v0.dot( v0 ); + var dot01 = v0.dot( v1 ); + var dot02 = v0.dot( v2 ); + var dot11 = v1.dot( v1 ); + var dot12 = v1.dot( v2 ); + + var u,v; + + return ( (u = dot11 * dot02 - dot01 * dot12) >= 0 ) && + ( (v = dot00 * dot12 - dot01 * dot02) >= 0 ) && + ( u + v < ( dot00 * dot11 - dot01 * dot01 ) ); +} + +/** + * Shoot a ray at a body, get back information about the hit. + * @method intersectBody + * @private + * @param {Body} body + * @param {RaycastResult} [result] Deprecated - set the result property of the Ray instead. + */ +var intersectBody_xi = new Vec3(); +var intersectBody_qi = new Quaternion(); +Ray.prototype.intersectBody = function (body, result) { + if(result){ + this.result = result; + this._updateDirection(); + } + var checkCollisionResponse = this.checkCollisionResponse; + + if(checkCollisionResponse && !body.collisionResponse){ + return; + } + + if((this.collisionFilterGroup & body.collisionFilterMask)===0 || (body.collisionFilterGroup & this.collisionFilterMask)===0){ + return; + } + + var xi = intersectBody_xi; + var qi = intersectBody_qi; + + for (var i = 0, N = body.shapes.length; i < N; i++) { + var shape = body.shapes[i]; + + if(checkCollisionResponse && !shape.collisionResponse){ + continue; // Skip + } + + if((this.collisionFilterGroup & shape.collisionFilterMask)===0 || (shape.collisionFilterGroup & this.collisionFilterMask)===0){ + continue; // Skip + } + + body.quaternion.mult(body.shapeOrientations[i], qi); + body.quaternion.vmult(body.shapeOffsets[i], xi); + xi.vadd(body.position, xi); + + this.intersectShape( + shape, + qi, + xi, + body + ); + + if(this.result._shouldStop){ + break; + } + } +}; + +/** + * @method intersectBodies + * @param {Array} bodies An array of Body objects. + * @param {RaycastResult} [result] Deprecated + */ +Ray.prototype.intersectBodies = function (bodies, result) { + if(result){ + this.result = result; + this._updateDirection(); + } + + for ( var i = 0, l = bodies.length; !this.result._shouldStop && i < l; i ++ ) { + this.intersectBody(bodies[i]); + } +}; + +/** + * Updates the _direction vector. + * @private + * @method _updateDirection + */ +Ray.prototype._updateDirection = function(){ + this.to.vsub(this.from, this._direction); + this._direction.normalize(); +}; + +/** + * @method intersectShape + * @private + * @param {Shape} shape + * @param {Quaternion} quat + * @param {Vec3} position + * @param {Body} body + */ +Ray.prototype.intersectShape = function(shape, quat, position, body){ + var from = this.from; + + + // Checking boundingSphere + var distance = distanceFromIntersection(from, this._direction, position); + if ( distance > shape.boundingSphereRadius ) { + return; + } + + var intersectMethod = this[shape.type]; + if(intersectMethod){ + intersectMethod.call(this, shape, quat, position, body, shape); + } +}; + +var vector = new Vec3(); +var normal = new Vec3(); +var intersectPoint = new Vec3(); + +var a = new Vec3(); +var b = new Vec3(); +var c = new Vec3(); +var d = new Vec3(); + +var tmpRaycastResult = new RaycastResult(); + +/** + * @method intersectBox + * @private + * @param {Shape} shape + * @param {Quaternion} quat + * @param {Vec3} position + * @param {Body} body + */ +Ray.prototype.intersectBox = function(shape, quat, position, body, reportedShape){ + return this.intersectConvex(shape.convexPolyhedronRepresentation, quat, position, body, reportedShape); +}; +Ray.prototype[Shape.types.BOX] = Ray.prototype.intersectBox; + +/** + * @method intersectPlane + * @private + * @param {Shape} shape + * @param {Quaternion} quat + * @param {Vec3} position + * @param {Body} body + */ +Ray.prototype.intersectPlane = function(shape, quat, position, body, reportedShape){ + var from = this.from; + var to = this.to; + var direction = this._direction; + + // Get plane normal + var worldNormal = new Vec3(0, 0, 1); + quat.vmult(worldNormal, worldNormal); + + var len = new Vec3(); + from.vsub(position, len); + var planeToFrom = len.dot(worldNormal); + to.vsub(position, len); + var planeToTo = len.dot(worldNormal); + + if(planeToFrom * planeToTo > 0){ + // "from" and "to" are on the same side of the plane... bail out + return; + } + + if(from.distanceTo(to) < planeToFrom){ + return; + } + + var n_dot_dir = worldNormal.dot(direction); + + if (Math.abs(n_dot_dir) < this.precision) { + // No intersection + return; + } + + var planePointToFrom = new Vec3(); + var dir_scaled_with_t = new Vec3(); + var hitPointWorld = new Vec3(); + + from.vsub(position, planePointToFrom); + var t = -worldNormal.dot(planePointToFrom) / n_dot_dir; + direction.scale(t, dir_scaled_with_t); + from.vadd(dir_scaled_with_t, hitPointWorld); + + this.reportIntersection(worldNormal, hitPointWorld, reportedShape, body, -1); +}; +Ray.prototype[Shape.types.PLANE] = Ray.prototype.intersectPlane; + +/** + * Get the world AABB of the ray. + * @method getAABB + * @param {AABB} aabb + */ +Ray.prototype.getAABB = function(result){ + var to = this.to; + var from = this.from; + result.lowerBound.x = Math.min(to.x, from.x); + result.lowerBound.y = Math.min(to.y, from.y); + result.lowerBound.z = Math.min(to.z, from.z); + result.upperBound.x = Math.max(to.x, from.x); + result.upperBound.y = Math.max(to.y, from.y); + result.upperBound.z = Math.max(to.z, from.z); +}; + +var intersectConvexOptions = { + faceList: [0] +}; +var worldPillarOffset = new Vec3(); +var intersectHeightfield_localRay = new Ray(); +var intersectHeightfield_index = []; +var intersectHeightfield_minMax = []; + +/** + * @method intersectHeightfield + * @private + * @param {Shape} shape + * @param {Quaternion} quat + * @param {Vec3} position + * @param {Body} body + */ +Ray.prototype.intersectHeightfield = function(shape, quat, position, body, reportedShape){ + var data = shape.data, + w = shape.elementSize; + + // Convert the ray to local heightfield coordinates + var localRay = intersectHeightfield_localRay; //new Ray(this.from, this.to); + localRay.from.copy(this.from); + localRay.to.copy(this.to); + Transform.pointToLocalFrame(position, quat, localRay.from, localRay.from); + Transform.pointToLocalFrame(position, quat, localRay.to, localRay.to); + localRay._updateDirection(); + + // Get the index of the data points to test against + var index = intersectHeightfield_index; + var iMinX, iMinY, iMaxX, iMaxY; + + // Set to max + iMinX = iMinY = 0; + iMaxX = iMaxY = shape.data.length - 1; + + var aabb = new AABB(); + localRay.getAABB(aabb); + + shape.getIndexOfPosition(aabb.lowerBound.x, aabb.lowerBound.y, index, true); + iMinX = Math.max(iMinX, index[0]); + iMinY = Math.max(iMinY, index[1]); + shape.getIndexOfPosition(aabb.upperBound.x, aabb.upperBound.y, index, true); + iMaxX = Math.min(iMaxX, index[0] + 1); + iMaxY = Math.min(iMaxY, index[1] + 1); + + for(var i = iMinX; i < iMaxX; i++){ + for(var j = iMinY; j < iMaxY; j++){ + + if(this.result._shouldStop){ + return; + } + + shape.getAabbAtIndex(i, j, aabb); + if(!aabb.overlapsRay(localRay)){ + continue; + } + + // Lower triangle + shape.getConvexTrianglePillar(i, j, false); + Transform.pointToWorldFrame(position, quat, shape.pillarOffset, worldPillarOffset); + this.intersectConvex(shape.pillarConvex, quat, worldPillarOffset, body, reportedShape, intersectConvexOptions); + + if(this.result._shouldStop){ + return; + } + + // Upper triangle + shape.getConvexTrianglePillar(i, j, true); + Transform.pointToWorldFrame(position, quat, shape.pillarOffset, worldPillarOffset); + this.intersectConvex(shape.pillarConvex, quat, worldPillarOffset, body, reportedShape, intersectConvexOptions); + } + } +}; +Ray.prototype[Shape.types.HEIGHTFIELD] = Ray.prototype.intersectHeightfield; + +var Ray_intersectSphere_intersectionPoint = new Vec3(); +var Ray_intersectSphere_normal = new Vec3(); + +/** + * @method intersectSphere + * @private + * @param {Shape} shape + * @param {Quaternion} quat + * @param {Vec3} position + * @param {Body} body + */ +Ray.prototype.intersectSphere = function(shape, quat, position, body, reportedShape){ + var from = this.from, + to = this.to, + r = shape.radius; + + var a = Math.pow(to.x - from.x, 2) + Math.pow(to.y - from.y, 2) + Math.pow(to.z - from.z, 2); + var b = 2 * ((to.x - from.x) * (from.x - position.x) + (to.y - from.y) * (from.y - position.y) + (to.z - from.z) * (from.z - position.z)); + var c = Math.pow(from.x - position.x, 2) + Math.pow(from.y - position.y, 2) + Math.pow(from.z - position.z, 2) - Math.pow(r, 2); + + var delta = Math.pow(b, 2) - 4 * a * c; + + var intersectionPoint = Ray_intersectSphere_intersectionPoint; + var normal = Ray_intersectSphere_normal; + + if(delta < 0){ + // No intersection + return; + + } else if(delta === 0){ + // single intersection point + from.lerp(to, delta, intersectionPoint); + + intersectionPoint.vsub(position, normal); + normal.normalize(); + + this.reportIntersection(normal, intersectionPoint, reportedShape, body, -1); + + } else { + var d1 = (- b - Math.sqrt(delta)) / (2 * a); + var d2 = (- b + Math.sqrt(delta)) / (2 * a); + + if(d1 >= 0 && d1 <= 1){ + from.lerp(to, d1, intersectionPoint); + intersectionPoint.vsub(position, normal); + normal.normalize(); + this.reportIntersection(normal, intersectionPoint, reportedShape, body, -1); + } + + if(this.result._shouldStop){ + return; + } + + if(d2 >= 0 && d2 <= 1){ + from.lerp(to, d2, intersectionPoint); + intersectionPoint.vsub(position, normal); + normal.normalize(); + this.reportIntersection(normal, intersectionPoint, reportedShape, body, -1); + } + } +}; +Ray.prototype[Shape.types.SPHERE] = Ray.prototype.intersectSphere; + + +var intersectConvex_normal = new Vec3(); +var intersectConvex_minDistNormal = new Vec3(); +var intersectConvex_minDistIntersect = new Vec3(); +var intersectConvex_vector = new Vec3(); + +/** + * @method intersectConvex + * @private + * @param {Shape} shape + * @param {Quaternion} quat + * @param {Vec3} position + * @param {Body} body + * @param {object} [options] + * @param {array} [options.faceList] + */ +Ray.prototype.intersectConvex = function intersectConvex( + shape, + quat, + position, + body, + reportedShape, + options +){ + var minDistNormal = intersectConvex_minDistNormal; + var normal = intersectConvex_normal; + var vector = intersectConvex_vector; + var minDistIntersect = intersectConvex_minDistIntersect; + var faceList = (options && options.faceList) || null; + + // Checking faces + var faces = shape.faces, + vertices = shape.vertices, + normals = shape.faceNormals; + var direction = this._direction; + + var from = this.from; + var to = this.to; + var fromToDistance = from.distanceTo(to); + + var minDist = -1; + var Nfaces = faceList ? faceList.length : faces.length; + var result = this.result; + + for (var j = 0; !result._shouldStop && j < Nfaces; j++) { + var fi = faceList ? faceList[j] : j; + + var face = faces[fi]; + var faceNormal = normals[fi]; + var q = quat; + var x = position; + + // determine if ray intersects the plane of the face + // note: this works regardless of the direction of the face normal + + // Get plane point in world coordinates... + vector.copy(vertices[face[0]]); + q.vmult(vector,vector); + vector.vadd(x,vector); + + // ...but make it relative to the ray from. We'll fix this later. + vector.vsub(from,vector); + + // Get plane normal + q.vmult(faceNormal,normal); + + // If this dot product is negative, we have something interesting + var dot = direction.dot(normal); + + // Bail out if ray and plane are parallel + if ( Math.abs( dot ) < this.precision ){ + continue; + } + + // calc distance to plane + var scalar = normal.dot(vector) / dot; + + // if negative distance, then plane is behind ray + if (scalar < 0){ + continue; + } + + // if (dot < 0) { + + // Intersection point is from + direction * scalar + direction.mult(scalar,intersectPoint); + intersectPoint.vadd(from,intersectPoint); + + // a is the point we compare points b and c with. + a.copy(vertices[face[0]]); + q.vmult(a,a); + x.vadd(a,a); + + for(var i = 1; !result._shouldStop && i < face.length - 1; i++){ + // Transform 3 vertices to world coords + b.copy(vertices[face[i]]); + c.copy(vertices[face[i+1]]); + q.vmult(b,b); + q.vmult(c,c); + x.vadd(b,b); + x.vadd(c,c); + + var distance = intersectPoint.distanceTo(from); + + if(!(pointInTriangle(intersectPoint, a, b, c) || pointInTriangle(intersectPoint, b, a, c)) || distance > fromToDistance){ + continue; + } + + this.reportIntersection(normal, intersectPoint, reportedShape, body, fi); + } + // } + } +}; +Ray.prototype[Shape.types.CONVEXPOLYHEDRON] = Ray.prototype.intersectConvex; + +var intersectTrimesh_normal = new Vec3(); +var intersectTrimesh_localDirection = new Vec3(); +var intersectTrimesh_localFrom = new Vec3(); +var intersectTrimesh_localTo = new Vec3(); +var intersectTrimesh_worldNormal = new Vec3(); +var intersectTrimesh_worldIntersectPoint = new Vec3(); +var intersectTrimesh_localAABB = new AABB(); +var intersectTrimesh_triangles = []; +var intersectTrimesh_treeTransform = new Transform(); + +/** + * @method intersectTrimesh + * @private + * @param {Shape} shape + * @param {Quaternion} quat + * @param {Vec3} position + * @param {Body} body + * @param {object} [options] + * @todo Optimize by transforming the world to local space first. + * @todo Use Octree lookup + */ +Ray.prototype.intersectTrimesh = function intersectTrimesh( + mesh, + quat, + position, + body, + reportedShape, + options +){ + var normal = intersectTrimesh_normal; + var triangles = intersectTrimesh_triangles; + var treeTransform = intersectTrimesh_treeTransform; + var minDistNormal = intersectConvex_minDistNormal; + var vector = intersectConvex_vector; + var minDistIntersect = intersectConvex_minDistIntersect; + var localAABB = intersectTrimesh_localAABB; + var localDirection = intersectTrimesh_localDirection; + var localFrom = intersectTrimesh_localFrom; + var localTo = intersectTrimesh_localTo; + var worldIntersectPoint = intersectTrimesh_worldIntersectPoint; + var worldNormal = intersectTrimesh_worldNormal; + var faceList = (options && options.faceList) || null; + + // Checking faces + var indices = mesh.indices, + vertices = mesh.vertices, + normals = mesh.faceNormals; + + var from = this.from; + var to = this.to; + var direction = this._direction; + + var minDist = -1; + treeTransform.position.copy(position); + treeTransform.quaternion.copy(quat); + + // Transform ray to local space! + Transform.vectorToLocalFrame(position, quat, direction, localDirection); + Transform.pointToLocalFrame(position, quat, from, localFrom); + Transform.pointToLocalFrame(position, quat, to, localTo); + + localTo.x *= mesh.scale.x; + localTo.y *= mesh.scale.y; + localTo.z *= mesh.scale.z; + localFrom.x *= mesh.scale.x; + localFrom.y *= mesh.scale.y; + localFrom.z *= mesh.scale.z; + + localTo.vsub(localFrom, localDirection); + localDirection.normalize(); + + var fromToDistanceSquared = localFrom.distanceSquared(localTo); + + mesh.tree.rayQuery(this, treeTransform, triangles); + + for (var i = 0, N = triangles.length; !this.result._shouldStop && i !== N; i++) { + var trianglesIndex = triangles[i]; + + mesh.getNormal(trianglesIndex, normal); + + // determine if ray intersects the plane of the face + // note: this works regardless of the direction of the face normal + + // Get plane point in world coordinates... + mesh.getVertex(indices[trianglesIndex * 3], a); + + // ...but make it relative to the ray from. We'll fix this later. + a.vsub(localFrom,vector); + + // If this dot product is negative, we have something interesting + var dot = localDirection.dot(normal); + + // Bail out if ray and plane are parallel + // if (Math.abs( dot ) < this.precision){ + // continue; + // } + + // calc distance to plane + var scalar = normal.dot(vector) / dot; + + // if negative distance, then plane is behind ray + if (scalar < 0){ + continue; + } + + // Intersection point is from + direction * scalar + localDirection.scale(scalar,intersectPoint); + intersectPoint.vadd(localFrom,intersectPoint); + + // Get triangle vertices + mesh.getVertex(indices[trianglesIndex * 3 + 1], b); + mesh.getVertex(indices[trianglesIndex * 3 + 2], c); + + var squaredDistance = intersectPoint.distanceSquared(localFrom); + + if(!(pointInTriangle(intersectPoint, b, a, c) || pointInTriangle(intersectPoint, a, b, c)) || squaredDistance > fromToDistanceSquared){ + continue; + } + + // transform intersectpoint and normal to world + Transform.vectorToWorldFrame(quat, normal, worldNormal); + Transform.pointToWorldFrame(position, quat, intersectPoint, worldIntersectPoint); + this.reportIntersection(worldNormal, worldIntersectPoint, reportedShape, body, trianglesIndex); + } + triangles.length = 0; +}; +Ray.prototype[Shape.types.TRIMESH] = Ray.prototype.intersectTrimesh; + + +/** + * @method reportIntersection + * @private + * @param {Vec3} normal + * @param {Vec3} hitPointWorld + * @param {Shape} shape + * @param {Body} body + * @return {boolean} True if the intersections should continue + */ +Ray.prototype.reportIntersection = function(normal, hitPointWorld, shape, body, hitFaceIndex){ + var from = this.from; + var to = this.to; + var distance = from.distanceTo(hitPointWorld); + var result = this.result; + + // Skip back faces? + if(this.skipBackfaces && normal.dot(this._direction) > 0){ + return; + } + + result.hitFaceIndex = typeof(hitFaceIndex) !== 'undefined' ? hitFaceIndex : -1; + + switch(this.mode){ + case Ray.ALL: + this.hasHit = true; + result.set( + from, + to, + normal, + hitPointWorld, + shape, + body, + distance + ); + result.hasHit = true; + this.callback(result); + break; + + case Ray.CLOSEST: + + // Store if closer than current closest + if(distance < result.distance || !result.hasHit){ + this.hasHit = true; + result.hasHit = true; + result.set( + from, + to, + normal, + hitPointWorld, + shape, + body, + distance + ); + } + break; + + case Ray.ANY: + + // Report and stop. + this.hasHit = true; + result.hasHit = true; + result.set( + from, + to, + normal, + hitPointWorld, + shape, + body, + distance + ); + result._shouldStop = true; + break; + } +}; + +var v0 = new Vec3(), + intersect = new Vec3(); +function distanceFromIntersection(from, direction, position) { + + // v0 is vector from from to position + position.vsub(from,v0); + var dot = v0.dot(direction); + + // intersect = direction*dot + from + direction.mult(dot,intersect); + intersect.vadd(from,intersect); + + var distance = position.distanceTo(intersect); + + return distance; +} + + +},{"../collision/AABB":3,"../collision/RaycastResult":11,"../math/Quaternion":29,"../math/Transform":30,"../math/Vec3":31,"../shapes/Box":38,"../shapes/ConvexPolyhedron":39,"../shapes/Shape":44}],11:[function(_dereq_,module,exports){ +var Vec3 = _dereq_('../math/Vec3'); + +module.exports = RaycastResult; + +/** + * Storage for Ray casting data. + * @class RaycastResult + * @constructor + */ +function RaycastResult(){ + + /** + * @property {Vec3} rayFromWorld + */ + this.rayFromWorld = new Vec3(); + + /** + * @property {Vec3} rayToWorld + */ + this.rayToWorld = new Vec3(); + + /** + * @property {Vec3} hitNormalWorld + */ + this.hitNormalWorld = new Vec3(); + + /** + * @property {Vec3} hitPointWorld + */ + this.hitPointWorld = new Vec3(); + + /** + * @property {boolean} hasHit + */ + this.hasHit = false; + + /** + * The hit shape, or null. + * @property {Shape} shape + */ + this.shape = null; + + /** + * The hit body, or null. + * @property {Body} body + */ + this.body = null; + + /** + * The index of the hit triangle, if the hit shape was a trimesh. + * @property {number} hitFaceIndex + * @default -1 + */ + this.hitFaceIndex = -1; + + /** + * Distance to the hit. Will be set to -1 if there was no hit. + * @property {number} distance + * @default -1 + */ + this.distance = -1; + + /** + * If the ray should stop traversing the bodies. + * @private + * @property {Boolean} _shouldStop + * @default false + */ + this._shouldStop = false; +} + +/** + * Reset all result data. + * @method reset + */ +RaycastResult.prototype.reset = function () { + this.rayFromWorld.setZero(); + this.rayToWorld.setZero(); + this.hitNormalWorld.setZero(); + this.hitPointWorld.setZero(); + this.hasHit = false; + this.shape = null; + this.body = null; + this.hitFaceIndex = -1; + this.distance = -1; + this._shouldStop = false; +}; + +/** + * @method abort + */ +RaycastResult.prototype.abort = function(){ + this._shouldStop = true; +}; + +/** + * @method set + * @param {Vec3} rayFromWorld + * @param {Vec3} rayToWorld + * @param {Vec3} hitNormalWorld + * @param {Vec3} hitPointWorld + * @param {Shape} shape + * @param {Body} body + * @param {number} distance + */ +RaycastResult.prototype.set = function( + rayFromWorld, + rayToWorld, + hitNormalWorld, + hitPointWorld, + shape, + body, + distance +){ + this.rayFromWorld.copy(rayFromWorld); + this.rayToWorld.copy(rayToWorld); + this.hitNormalWorld.copy(hitNormalWorld); + this.hitPointWorld.copy(hitPointWorld); + this.shape = shape; + this.body = body; + this.distance = distance; +}; +},{"../math/Vec3":31}],12:[function(_dereq_,module,exports){ +var Shape = _dereq_('../shapes/Shape'); +var Broadphase = _dereq_('../collision/Broadphase'); + +module.exports = SAPBroadphase; + +/** + * Sweep and prune broadphase along one axis. + * + * @class SAPBroadphase + * @constructor + * @param {World} [world] + * @extends Broadphase + */ +function SAPBroadphase(world){ + Broadphase.apply(this); + + /** + * List of bodies currently in the broadphase. + * @property axisList + * @type {Array} + */ + this.axisList = []; + + /** + * The world to search in. + * @property world + * @type {World} + */ + this.world = null; + + /** + * Axis to sort the bodies along. Set to 0 for x axis, and 1 for y axis. For best performance, choose an axis that the bodies are spread out more on. + * @property axisIndex + * @type {Number} + */ + this.axisIndex = 0; + + var axisList = this.axisList; + + this._addBodyHandler = function(e){ + axisList.push(e.body); + }; + + this._removeBodyHandler = function(e){ + var idx = axisList.indexOf(e.body); + if(idx !== -1){ + axisList.splice(idx,1); + } + }; + + if(world){ + this.setWorld(world); + } +} +SAPBroadphase.prototype = new Broadphase(); + +/** + * Change the world + * @method setWorld + * @param {World} world + */ +SAPBroadphase.prototype.setWorld = function(world){ + // Clear the old axis array + this.axisList.length = 0; + + // Add all bodies from the new world + for(var i=0; i=0;j--) { + if(a[j].aabb.lowerBound.x <= v.aabb.lowerBound.x){ + break; + } + a[j+1] = a[j]; + } + a[j+1] = v; + } + return a; +}; + +/** + * @static + * @method insertionSortY + * @param {Array} a + * @return {Array} + */ +SAPBroadphase.insertionSortY = function(a) { + for(var i=1,l=a.length;i=0;j--) { + if(a[j].aabb.lowerBound.y <= v.aabb.lowerBound.y){ + break; + } + a[j+1] = a[j]; + } + a[j+1] = v; + } + return a; +}; + +/** + * @static + * @method insertionSortZ + * @param {Array} a + * @return {Array} + */ +SAPBroadphase.insertionSortZ = function(a) { + for(var i=1,l=a.length;i=0;j--) { + if(a[j].aabb.lowerBound.z <= v.aabb.lowerBound.z){ + break; + } + a[j+1] = a[j]; + } + a[j+1] = v; + } + return a; +}; + +/** + * Collect all collision pairs + * @method collisionPairs + * @param {World} world + * @param {Array} p1 + * @param {Array} p2 + */ +SAPBroadphase.prototype.collisionPairs = function(world,p1,p2){ + var bodies = this.axisList, + N = bodies.length, + axisIndex = this.axisIndex, + i, j; + + if(this.dirty){ + this.sortList(); + this.dirty = false; + } + + // Look through the list + for(i=0; i !== N; i++){ + var bi = bodies[i]; + + for(j=i+1; j < N; j++){ + var bj = bodies[j]; + + if(!this.needBroadphaseCollision(bi,bj)){ + continue; + } + + if(!SAPBroadphase.checkBounds(bi,bj,axisIndex)){ + break; + } + + this.intersectionTest(bi,bj,p1,p2); + } + } +}; + +SAPBroadphase.prototype.sortList = function(){ + var axisList = this.axisList; + var axisIndex = this.axisIndex; + var N = axisList.length; + + // Update AABBs + for(var i = 0; i!==N; i++){ + var bi = axisList[i]; + if(bi.aabbNeedsUpdate){ + bi.computeAABB(); + } + } + + // Sort the list + if(axisIndex === 0){ + SAPBroadphase.insertionSortX(axisList); + } else if(axisIndex === 1){ + SAPBroadphase.insertionSortY(axisList); + } else if(axisIndex === 2){ + SAPBroadphase.insertionSortZ(axisList); + } +}; + +/** + * Check if the bounds of two bodies overlap, along the given SAP axis. + * @static + * @method checkBounds + * @param {Body} bi + * @param {Body} bj + * @param {Number} axisIndex + * @return {Boolean} + */ +SAPBroadphase.checkBounds = function(bi, bj, axisIndex){ + var biPos; + var bjPos; + + if(axisIndex === 0){ + biPos = bi.position.x; + bjPos = bj.position.x; + } else if(axisIndex === 1){ + biPos = bi.position.y; + bjPos = bj.position.y; + } else if(axisIndex === 2){ + biPos = bi.position.z; + bjPos = bj.position.z; + } + + var ri = bi.boundingRadius, + rj = bj.boundingRadius, + boundA1 = biPos - ri, + boundA2 = biPos + ri, + boundB1 = bjPos - rj, + boundB2 = bjPos + rj; + + return boundB1 < boundA2; +}; + +/** + * Computes the variance of the body positions and estimates the best + * axis to use. Will automatically set property .axisIndex. + * @method autoDetectAxis + */ +SAPBroadphase.prototype.autoDetectAxis = function(){ + var sumX=0, + sumX2=0, + sumY=0, + sumY2=0, + sumZ=0, + sumZ2=0, + bodies = this.axisList, + N = bodies.length, + invN=1/N; + + for(var i=0; i!==N; i++){ + var b = bodies[i]; + + var centerX = b.position.x; + sumX += centerX; + sumX2 += centerX*centerX; + + var centerY = b.position.y; + sumY += centerY; + sumY2 += centerY*centerY; + + var centerZ = b.position.z; + sumZ += centerZ; + sumZ2 += centerZ*centerZ; + } + + var varianceX = sumX2 - sumX*sumX*invN, + varianceY = sumY2 - sumY*sumY*invN, + varianceZ = sumZ2 - sumZ*sumZ*invN; + + if(varianceX > varianceY){ + if(varianceX > varianceZ){ + this.axisIndex = 0; + } else{ + this.axisIndex = 2; + } + } else if(varianceY > varianceZ){ + this.axisIndex = 1; + } else{ + this.axisIndex = 2; + } +}; + +/** + * Returns all the bodies within an AABB. + * @method aabbQuery + * @param {World} world + * @param {AABB} aabb + * @param {array} result An array to store resulting bodies in. + * @return {array} + */ +SAPBroadphase.prototype.aabbQuery = function(world, aabb, result){ + result = result || []; + + if(this.dirty){ + this.sortList(); + this.dirty = false; + } + + var axisIndex = this.axisIndex, axis = 'x'; + if(axisIndex === 1){ axis = 'y'; } + if(axisIndex === 2){ axis = 'z'; } + + var axisList = this.axisList; + var lower = aabb.lowerBound[axis]; + var upper = aabb.upperBound[axis]; + for(var i = 0; i < axisList.length; i++){ + var b = axisList[i]; + + if(b.aabbNeedsUpdate){ + b.computeAABB(); + } + + if(b.aabb.overlaps(aabb)){ + result.push(b); + } + } + + return result; +}; +},{"../collision/Broadphase":5,"../shapes/Shape":44}],13:[function(_dereq_,module,exports){ +module.exports = ConeTwistConstraint; + +var Constraint = _dereq_('./Constraint'); +var PointToPointConstraint = _dereq_('./PointToPointConstraint'); +var ConeEquation = _dereq_('../equations/ConeEquation'); +var RotationalEquation = _dereq_('../equations/RotationalEquation'); +var ContactEquation = _dereq_('../equations/ContactEquation'); +var Vec3 = _dereq_('../math/Vec3'); + +/** + * @class ConeTwistConstraint + * @constructor + * @author schteppe + * @param {Body} bodyA + * @param {Body} bodyB + * @param {object} [options] + * @param {Vec3} [options.pivotA] + * @param {Vec3} [options.pivotB] + * @param {Vec3} [options.axisA] + * @param {Vec3} [options.axisB] + * @param {Number} [options.maxForce=1e6] + * @extends PointToPointConstraint + */ +function ConeTwistConstraint(bodyA, bodyB, options){ + options = options || {}; + var maxForce = typeof(options.maxForce) !== 'undefined' ? options.maxForce : 1e6; + + // Set pivot point in between + var pivotA = options.pivotA ? options.pivotA.clone() : new Vec3(); + var pivotB = options.pivotB ? options.pivotB.clone() : new Vec3(); + this.axisA = options.axisA ? options.axisA.clone() : new Vec3(); + this.axisB = options.axisB ? options.axisB.clone() : new Vec3(); + + PointToPointConstraint.call(this, bodyA, pivotA, bodyB, pivotB, maxForce); + + this.collideConnected = !!options.collideConnected; + + this.angle = typeof(options.angle) !== 'undefined' ? options.angle : 0; + + /** + * @property {ConeEquation} coneEquation + */ + var c = this.coneEquation = new ConeEquation(bodyA,bodyB,options); + + /** + * @property {RotationalEquation} twistEquation + */ + var t = this.twistEquation = new RotationalEquation(bodyA,bodyB,options); + this.twistAngle = typeof(options.twistAngle) !== 'undefined' ? options.twistAngle : 0; + + // Make the cone equation push the bodies toward the cone axis, not outward + c.maxForce = 0; + c.minForce = -maxForce; + + // Make the twist equation add torque toward the initial position + t.maxForce = 0; + t.minForce = -maxForce; + + this.equations.push(c, t); +} +ConeTwistConstraint.prototype = new PointToPointConstraint(); +ConeTwistConstraint.constructor = ConeTwistConstraint; + +var ConeTwistConstraint_update_tmpVec1 = new Vec3(); +var ConeTwistConstraint_update_tmpVec2 = new Vec3(); + +ConeTwistConstraint.prototype.update = function(){ + var bodyA = this.bodyA, + bodyB = this.bodyB, + cone = this.coneEquation, + twist = this.twistEquation; + + PointToPointConstraint.prototype.update.call(this); + + // Update the axes to the cone constraint + bodyA.vectorToWorldFrame(this.axisA, cone.axisA); + bodyB.vectorToWorldFrame(this.axisB, cone.axisB); + + // Update the world axes in the twist constraint + this.axisA.tangents(twist.axisA, twist.axisA); + bodyA.vectorToWorldFrame(twist.axisA, twist.axisA); + + this.axisB.tangents(twist.axisB, twist.axisB); + bodyB.vectorToWorldFrame(twist.axisB, twist.axisB); + + cone.angle = this.angle; + twist.maxAngle = this.twistAngle; +}; + + +},{"../equations/ConeEquation":19,"../equations/ContactEquation":20,"../equations/RotationalEquation":23,"../math/Vec3":31,"./Constraint":14,"./PointToPointConstraint":18}],14:[function(_dereq_,module,exports){ +module.exports = Constraint; + +var Utils = _dereq_('../utils/Utils'); + +/** + * Constraint base class + * @class Constraint + * @author schteppe + * @constructor + * @param {Body} bodyA + * @param {Body} bodyB + * @param {object} [options] + * @param {boolean} [options.collideConnected=true] + * @param {boolean} [options.wakeUpBodies=true] + */ +function Constraint(bodyA, bodyB, options){ + options = Utils.defaults(options,{ + collideConnected : true, + wakeUpBodies : true, + }); + + /** + * Equations to be solved in this constraint + * @property equations + * @type {Array} + */ + this.equations = []; + + /** + * @property {Body} bodyA + */ + this.bodyA = bodyA; + + /** + * @property {Body} bodyB + */ + this.bodyB = bodyB; + + /** + * @property {Number} id + */ + this.id = Constraint.idCounter++; + + /** + * Set to true if you want the bodies to collide when they are connected. + * @property collideConnected + * @type {boolean} + */ + this.collideConnected = options.collideConnected; + + if(options.wakeUpBodies){ + if(bodyA){ + bodyA.wakeUp(); + } + if(bodyB){ + bodyB.wakeUp(); + } + } +} + +/** + * Update all the equations with data. + * @method update + */ +Constraint.prototype.update = function(){ + throw new Error("method update() not implmemented in this Constraint subclass!"); +}; + +/** + * Enables all equations in the constraint. + * @method enable + */ +Constraint.prototype.enable = function(){ + var eqs = this.equations; + for(var i=0; i + // G = [0 axisA 0 -axisB] + + GA.rotational.copy(axisA); + axisB.negate(GB.rotational); + + var GW = this.computeGW() - this.targetVelocity, + GiMf = this.computeGiMf(); + + var B = - GW * b - h * GiMf; + + return B; +}; + +},{"../math/Mat3":28,"../math/Vec3":31,"./Equation":21}],25:[function(_dereq_,module,exports){ +var Utils = _dereq_('../utils/Utils'); + +module.exports = ContactMaterial; + +/** + * Defines what happens when two materials meet. + * @class ContactMaterial + * @constructor + * @param {Material} m1 + * @param {Material} m2 + * @param {object} [options] + * @param {Number} [options.friction=0.3] + * @param {Number} [options.restitution=0.3] + * @param {number} [options.contactEquationStiffness=1e7] + * @param {number} [options.contactEquationRelaxation=3] + * @param {number} [options.frictionEquationStiffness=1e7] + * @param {Number} [options.frictionEquationRelaxation=3] + */ +function ContactMaterial(m1, m2, options){ + options = Utils.defaults(options, { + friction: 0.3, + restitution: 0.3, + contactEquationStiffness: 1e7, + contactEquationRelaxation: 3, + frictionEquationStiffness: 1e7, + frictionEquationRelaxation: 3 + }); + + /** + * Identifier of this material + * @property {Number} id + */ + this.id = ContactMaterial.idCounter++; + + /** + * Participating materials + * @property {Array} materials + * @todo Should be .materialA and .materialB instead + */ + this.materials = [m1, m2]; + + /** + * Friction coefficient + * @property {Number} friction + */ + this.friction = options.friction; + + /** + * Restitution coefficient + * @property {Number} restitution + */ + this.restitution = options.restitution; + + /** + * Stiffness of the produced contact equations + * @property {Number} contactEquationStiffness + */ + this.contactEquationStiffness = options.contactEquationStiffness; + + /** + * Relaxation time of the produced contact equations + * @property {Number} contactEquationRelaxation + */ + this.contactEquationRelaxation = options.contactEquationRelaxation; + + /** + * Stiffness of the produced friction equations + * @property {Number} frictionEquationStiffness + */ + this.frictionEquationStiffness = options.frictionEquationStiffness; + + /** + * Relaxation time of the produced friction equations + * @property {Number} frictionEquationRelaxation + */ + this.frictionEquationRelaxation = options.frictionEquationRelaxation; +} + +ContactMaterial.idCounter = 0; + +},{"../utils/Utils":54}],26:[function(_dereq_,module,exports){ +module.exports = Material; + +/** + * Defines a physics material. + * @class Material + * @constructor + * @param {object} [options] + * @author schteppe + */ +function Material(options){ + var name = ''; + options = options || {}; + + // Backwards compatibility fix + if(typeof(options) === 'string'){ + name = options; + options = {}; + } else if(typeof(options) === 'object') { + name = ''; + } + + /** + * @property name + * @type {String} + */ + this.name = name; + + /** + * material id. + * @property id + * @type {number} + */ + this.id = Material.idCounter++; + + /** + * Friction for this material. If non-negative, it will be used instead of the friction given by ContactMaterials. If there's no matching ContactMaterial, the value from .defaultContactMaterial in the World will be used. + * @property {number} friction + */ + this.friction = typeof(options.friction) !== 'undefined' ? options.friction : -1; + + /** + * Restitution for this material. If non-negative, it will be used instead of the restitution given by ContactMaterials. If there's no matching ContactMaterial, the value from .defaultContactMaterial in the World will be used. + * @property {number} restitution + */ + this.restitution = typeof(options.restitution) !== 'undefined' ? options.restitution : -1; +} + +Material.idCounter = 0; + +},{}],27:[function(_dereq_,module,exports){ +module.exports = JacobianElement; + +var Vec3 = _dereq_('./Vec3'); + +/** + * An element containing 6 entries, 3 spatial and 3 rotational degrees of freedom. + * @class JacobianElement + * @constructor + */ +function JacobianElement(){ + + /** + * @property {Vec3} spatial + */ + this.spatial = new Vec3(); + + /** + * @property {Vec3} rotational + */ + this.rotational = new Vec3(); +} + +/** + * Multiply with other JacobianElement + * @method multiplyElement + * @param {JacobianElement} element + * @return {Number} + */ +JacobianElement.prototype.multiplyElement = function(element){ + return element.spatial.dot(this.spatial) + element.rotational.dot(this.rotational); +}; + +/** + * Multiply with two vectors + * @method multiplyVectors + * @param {Vec3} spatial + * @param {Vec3} rotational + * @return {Number} + */ +JacobianElement.prototype.multiplyVectors = function(spatial,rotational){ + return spatial.dot(this.spatial) + rotational.dot(this.rotational); +}; + +},{"./Vec3":31}],28:[function(_dereq_,module,exports){ +module.exports = Mat3; + +var Vec3 = _dereq_('./Vec3'); + +/** + * A 3x3 matrix. + * @class Mat3 + * @constructor + * @param array elements Array of nine elements. Optional. + * @author schteppe / http://github.com/schteppe + */ +function Mat3(elements){ + /** + * A vector of length 9, containing all matrix elements + * @property {Array} elements + */ + if(elements){ + this.elements = elements; + } else { + this.elements = [0,0,0,0,0,0,0,0,0]; + } +} + +/** + * Sets the matrix to identity + * @method identity + * @todo Should perhaps be renamed to setIdentity() to be more clear. + * @todo Create another function that immediately creates an identity matrix eg. eye() + */ +Mat3.prototype.identity = function(){ + var e = this.elements; + e[0] = 1; + e[1] = 0; + e[2] = 0; + + e[3] = 0; + e[4] = 1; + e[5] = 0; + + e[6] = 0; + e[7] = 0; + e[8] = 1; +}; + +/** + * Set all elements to zero + * @method setZero + */ +Mat3.prototype.setZero = function(){ + var e = this.elements; + e[0] = 0; + e[1] = 0; + e[2] = 0; + e[3] = 0; + e[4] = 0; + e[5] = 0; + e[6] = 0; + e[7] = 0; + e[8] = 0; +}; + +/** + * Sets the matrix diagonal elements from a Vec3 + * @method setTrace + * @param {Vec3} vec3 + */ +Mat3.prototype.setTrace = function(vec3){ + var e = this.elements; + e[0] = vec3.x; + e[4] = vec3.y; + e[8] = vec3.z; +}; + +/** + * Gets the matrix diagonal elements + * @method getTrace + * @return {Vec3} + */ +Mat3.prototype.getTrace = function(target){ + var target = target || new Vec3(); + var e = this.elements; + target.x = e[0]; + target.y = e[4]; + target.z = e[8]; +}; + +/** + * Matrix-Vector multiplication + * @method vmult + * @param {Vec3} v The vector to multiply with + * @param {Vec3} target Optional, target to save the result in. + */ +Mat3.prototype.vmult = function(v,target){ + target = target || new Vec3(); + + var e = this.elements, + x = v.x, + y = v.y, + z = v.z; + target.x = e[0]*x + e[1]*y + e[2]*z; + target.y = e[3]*x + e[4]*y + e[5]*z; + target.z = e[6]*x + e[7]*y + e[8]*z; + + return target; +}; + +/** + * Matrix-scalar multiplication + * @method smult + * @param {Number} s + */ +Mat3.prototype.smult = function(s){ + for(var i=0; i1 acos and sqrt will produce errors, this cant happen if quaternion is normalised + var angle = 2 * Math.acos(this.w); + var s = Math.sqrt(1-this.w*this.w); // assuming quaternion normalised then w is less than 1, so term always positive. + if (s < 0.001) { // test to avoid divide by zero, s is always positive due to sqrt + // if s close to zero then direction of axis not important + targetAxis.x = this.x; // if it is important that axis is normalised then replace with x=1; y=z=0; + targetAxis.y = this.y; + targetAxis.z = this.z; + } else { + targetAxis.x = this.x / s; // normalise axis + targetAxis.y = this.y / s; + targetAxis.z = this.z / s; + } + return [targetAxis,angle]; +}; + +var sfv_t1 = new Vec3(), + sfv_t2 = new Vec3(); + +/** + * Set the quaternion value given two vectors. The resulting rotation will be the needed rotation to rotate u to v. + * @method setFromVectors + * @param {Vec3} u + * @param {Vec3} v + */ +Quaternion.prototype.setFromVectors = function(u,v){ + if(u.isAntiparallelTo(v)){ + var t1 = sfv_t1; + var t2 = sfv_t2; + + u.tangents(t1,t2); + this.setFromAxisAngle(t1,Math.PI); + } else { + var a = u.cross(v); + this.x = a.x; + this.y = a.y; + this.z = a.z; + this.w = Math.sqrt(Math.pow(u.norm(),2) * Math.pow(v.norm(),2)) + u.dot(v); + this.normalize(); + } + return this; +}; + +/** + * Quaternion multiplication + * @method mult + * @param {Quaternion} q + * @param {Quaternion} target Optional. + * @return {Quaternion} + */ +var Quaternion_mult_va = new Vec3(); +var Quaternion_mult_vb = new Vec3(); +var Quaternion_mult_vaxvb = new Vec3(); +Quaternion.prototype.mult = function(q,target){ + target = target || new Quaternion(); + + var ax = this.x, ay = this.y, az = this.z, aw = this.w, + bx = q.x, by = q.y, bz = q.z, bw = q.w; + + target.x = ax * bw + aw * bx + ay * bz - az * by; + target.y = ay * bw + aw * by + az * bx - ax * bz; + target.z = az * bw + aw * bz + ax * by - ay * bx; + target.w = aw * bw - ax * bx - ay * by - az * bz; + + return target; +}; + +/** + * Get the inverse quaternion rotation. + * @method inverse + * @param {Quaternion} target + * @return {Quaternion} + */ +Quaternion.prototype.inverse = function(target){ + var x = this.x, y = this.y, z = this.z, w = this.w; + target = target || new Quaternion(); + + this.conjugate(target); + var inorm2 = 1/(x*x + y*y + z*z + w*w); + target.x *= inorm2; + target.y *= inorm2; + target.z *= inorm2; + target.w *= inorm2; + + return target; +}; + +/** + * Get the quaternion conjugate + * @method conjugate + * @param {Quaternion} target + * @return {Quaternion} + */ +Quaternion.prototype.conjugate = function(target){ + target = target || new Quaternion(); + + target.x = -this.x; + target.y = -this.y; + target.z = -this.z; + target.w = this.w; + + return target; +}; + +/** + * Normalize the quaternion. Note that this changes the values of the quaternion. + * @method normalize + */ +Quaternion.prototype.normalize = function(){ + var l = Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w); + if ( l === 0 ) { + this.x = 0; + this.y = 0; + this.z = 0; + this.w = 0; + } else { + l = 1 / l; + this.x *= l; + this.y *= l; + this.z *= l; + this.w *= l; + } + return this; +}; + +/** + * Approximation of quaternion normalization. Works best when quat is already almost-normalized. + * @method normalizeFast + * @see http://jsperf.com/fast-quaternion-normalization + * @author unphased, https://github.com/unphased + */ +Quaternion.prototype.normalizeFast = function () { + var f = (3.0-(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w))/2.0; + if ( f === 0 ) { + this.x = 0; + this.y = 0; + this.z = 0; + this.w = 0; + } else { + this.x *= f; + this.y *= f; + this.z *= f; + this.w *= f; + } + return this; +}; + +/** + * Multiply the quaternion by a vector + * @method vmult + * @param {Vec3} v + * @param {Vec3} target Optional + * @return {Vec3} + */ +Quaternion.prototype.vmult = function(v,target){ + target = target || new Vec3(); + + var x = v.x, + y = v.y, + z = v.z; + + var qx = this.x, + qy = this.y, + qz = this.z, + qw = this.w; + + // q*v + var ix = qw * x + qy * z - qz * y, + iy = qw * y + qz * x - qx * z, + iz = qw * z + qx * y - qy * x, + iw = -qx * x - qy * y - qz * z; + + target.x = ix * qw + iw * -qx + iy * -qz - iz * -qy; + target.y = iy * qw + iw * -qy + iz * -qx - ix * -qz; + target.z = iz * qw + iw * -qz + ix * -qy - iy * -qx; + + return target; +}; + +/** + * Copies value of source to this quaternion. + * @method copy + * @param {Quaternion} source + * @return {Quaternion} this + */ +Quaternion.prototype.copy = function(source){ + this.x = source.x; + this.y = source.y; + this.z = source.z; + this.w = source.w; + return this; +}; + +/** + * Convert the quaternion to euler angle representation. Order: YZX, as this page describes: http://www.euclideanspace.com/maths/standards/index.htm + * @method toEuler + * @param {Vec3} target + * @param string order Three-character string e.g. "YZX", which also is default. + */ +Quaternion.prototype.toEuler = function(target,order){ + order = order || "YZX"; + + var heading, attitude, bank; + var x = this.x, y = this.y, z = this.z, w = this.w; + + switch(order){ + case "YZX": + var test = x*y + z*w; + if (test > 0.499) { // singularity at north pole + heading = 2 * Math.atan2(x,w); + attitude = Math.PI/2; + bank = 0; + } + if (test < -0.499) { // singularity at south pole + heading = -2 * Math.atan2(x,w); + attitude = - Math.PI/2; + bank = 0; + } + if(isNaN(heading)){ + var sqx = x*x; + var sqy = y*y; + var sqz = z*z; + heading = Math.atan2(2*y*w - 2*x*z , 1 - 2*sqy - 2*sqz); // Heading + attitude = Math.asin(2*test); // attitude + bank = Math.atan2(2*x*w - 2*y*z , 1 - 2*sqx - 2*sqz); // bank + } + break; + default: + throw new Error("Euler order "+order+" not supported yet."); + } + + target.y = heading; + target.z = attitude; + target.x = bank; +}; + +/** + * See http://www.mathworks.com/matlabcentral/fileexchange/20696-function-to-convert-between-dcm-euler-angles-quaternions-and-euler-vectors/content/SpinCalc.m + * @method setFromEuler + * @param {Number} x + * @param {Number} y + * @param {Number} z + * @param {String} order The order to apply angles: 'XYZ' or 'YXZ' or any other combination + */ +Quaternion.prototype.setFromEuler = function ( x, y, z, order ) { + order = order || "XYZ"; + + var c1 = Math.cos( x / 2 ); + var c2 = Math.cos( y / 2 ); + var c3 = Math.cos( z / 2 ); + var s1 = Math.sin( x / 2 ); + var s2 = Math.sin( y / 2 ); + var s3 = Math.sin( z / 2 ); + + if ( order === 'XYZ' ) { + + this.x = s1 * c2 * c3 + c1 * s2 * s3; + this.y = c1 * s2 * c3 - s1 * c2 * s3; + this.z = c1 * c2 * s3 + s1 * s2 * c3; + this.w = c1 * c2 * c3 - s1 * s2 * s3; + + } else if ( order === 'YXZ' ) { + + this.x = s1 * c2 * c3 + c1 * s2 * s3; + this.y = c1 * s2 * c3 - s1 * c2 * s3; + this.z = c1 * c2 * s3 - s1 * s2 * c3; + this.w = c1 * c2 * c3 + s1 * s2 * s3; + + } else if ( order === 'ZXY' ) { + + this.x = s1 * c2 * c3 - c1 * s2 * s3; + this.y = c1 * s2 * c3 + s1 * c2 * s3; + this.z = c1 * c2 * s3 + s1 * s2 * c3; + this.w = c1 * c2 * c3 - s1 * s2 * s3; + + } else if ( order === 'ZYX' ) { + + this.x = s1 * c2 * c3 - c1 * s2 * s3; + this.y = c1 * s2 * c3 + s1 * c2 * s3; + this.z = c1 * c2 * s3 - s1 * s2 * c3; + this.w = c1 * c2 * c3 + s1 * s2 * s3; + + } else if ( order === 'YZX' ) { + + this.x = s1 * c2 * c3 + c1 * s2 * s3; + this.y = c1 * s2 * c3 + s1 * c2 * s3; + this.z = c1 * c2 * s3 - s1 * s2 * c3; + this.w = c1 * c2 * c3 - s1 * s2 * s3; + + } else if ( order === 'XZY' ) { + + this.x = s1 * c2 * c3 - c1 * s2 * s3; + this.y = c1 * s2 * c3 - s1 * c2 * s3; + this.z = c1 * c2 * s3 + s1 * s2 * c3; + this.w = c1 * c2 * c3 + s1 * s2 * s3; + + } + + return this; +}; + +/** + * @method clone + * @return {Quaternion} + */ +Quaternion.prototype.clone = function(){ + return new Quaternion(this.x, this.y, this.z, this.w); +}; + +/** + * Performs a spherical linear interpolation between two quat + * + * @method slerp + * @param {Quaternion} toQuat second operand + * @param {Number} t interpolation amount between the self quaternion and toQuat + * @param {Quaternion} [target] A quaternion to store the result in. If not provided, a new one will be created. + * @returns {Quaternion} The "target" object + */ +Quaternion.prototype.slerp = function (toQuat, t, target) { + target = target || new Quaternion(); + + var ax = this.x, + ay = this.y, + az = this.z, + aw = this.w, + bx = toQuat.x, + by = toQuat.y, + bz = toQuat.z, + bw = toQuat.w; + + var omega, cosom, sinom, scale0, scale1; + + // calc cosine + cosom = ax * bx + ay * by + az * bz + aw * bw; + + // adjust signs (if necessary) + if ( cosom < 0.0 ) { + cosom = -cosom; + bx = - bx; + by = - by; + bz = - bz; + bw = - bw; + } + + // calculate coefficients + if ( (1.0 - cosom) > 0.000001 ) { + // standard case (slerp) + omega = Math.acos(cosom); + sinom = Math.sin(omega); + scale0 = Math.sin((1.0 - t) * omega) / sinom; + scale1 = Math.sin(t * omega) / sinom; + } else { + // "from" and "to" quaternions are very close + // ... so we can do a linear interpolation + scale0 = 1.0 - t; + scale1 = t; + } + + // calculate final values + target.x = scale0 * ax + scale1 * bx; + target.y = scale0 * ay + scale1 * by; + target.z = scale0 * az + scale1 * bz; + target.w = scale0 * aw + scale1 * bw; + + return target; +}; + +/** + * Rotate an absolute orientation quaternion given an angular velocity and a time step. + * @param {Vec3} angularVelocity + * @param {number} dt + * @param {Vec3} angularFactor + * @param {Quaternion} target + * @return {Quaternion} The "target" object + */ +Quaternion.prototype.integrate = function(angularVelocity, dt, angularFactor, target){ + target = target || new Quaternion(); + + var ax = angularVelocity.x * angularFactor.x, + ay = angularVelocity.y * angularFactor.y, + az = angularVelocity.z * angularFactor.z, + bx = this.x, + by = this.y, + bz = this.z, + bw = this.w; + + var half_dt = dt * 0.5; + + target.x += half_dt * (ax * bw + ay * bz - az * by); + target.y += half_dt * (ay * bw + az * bx - ax * bz); + target.z += half_dt * (az * bw + ax * by - ay * bx); + target.w += half_dt * (- ax * bx - ay * by - az * bz); + + return target; +}; +},{"./Vec3":31}],30:[function(_dereq_,module,exports){ +var Vec3 = _dereq_('./Vec3'); +var Quaternion = _dereq_('./Quaternion'); + +module.exports = Transform; + +/** + * @class Transform + * @constructor + */ +function Transform(options) { + options = options || {}; + + /** + * @property {Vec3} position + */ + this.position = new Vec3(); + if(options.position){ + this.position.copy(options.position); + } + + /** + * @property {Quaternion} quaternion + */ + this.quaternion = new Quaternion(); + if(options.quaternion){ + this.quaternion.copy(options.quaternion); + } +} + +var tmpQuat = new Quaternion(); + +/** + * @static + * @method pointToLocaFrame + * @param {Vec3} position + * @param {Quaternion} quaternion + * @param {Vec3} worldPoint + * @param {Vec3} result + */ +Transform.pointToLocalFrame = function(position, quaternion, worldPoint, result){ + var result = result || new Vec3(); + worldPoint.vsub(position, result); + quaternion.conjugate(tmpQuat); + tmpQuat.vmult(result, result); + return result; +}; + +/** + * Get a global point in local transform coordinates. + * @method pointToLocal + * @param {Vec3} point + * @param {Vec3} result + * @return {Vec3} The "result" vector object + */ +Transform.prototype.pointToLocal = function(worldPoint, result){ + return Transform.pointToLocalFrame(this.position, this.quaternion, worldPoint, result); +}; + +/** + * @static + * @method pointToWorldFrame + * @param {Vec3} position + * @param {Vec3} quaternion + * @param {Vec3} localPoint + * @param {Vec3} result + */ +Transform.pointToWorldFrame = function(position, quaternion, localPoint, result){ + var result = result || new Vec3(); + quaternion.vmult(localPoint, result); + result.vadd(position, result); + return result; +}; + +/** + * Get a local point in global transform coordinates. + * @method pointToWorld + * @param {Vec3} point + * @param {Vec3} result + * @return {Vec3} The "result" vector object + */ +Transform.prototype.pointToWorld = function(localPoint, result){ + return Transform.pointToWorldFrame(this.position, this.quaternion, localPoint, result); +}; + + +Transform.prototype.vectorToWorldFrame = function(localVector, result){ + var result = result || new Vec3(); + this.quaternion.vmult(localVector, result); + return result; +}; + +Transform.vectorToWorldFrame = function(quaternion, localVector, result){ + quaternion.vmult(localVector, result); + return result; +}; + +Transform.vectorToLocalFrame = function(position, quaternion, worldVector, result){ + var result = result || new Vec3(); + quaternion.w *= -1; + quaternion.vmult(worldVector, result); + quaternion.w *= -1; + return result; +}; + +},{"./Quaternion":29,"./Vec3":31}],31:[function(_dereq_,module,exports){ +module.exports = Vec3; + +var Mat3 = _dereq_('./Mat3'); + +/** + * 3-dimensional vector + * @class Vec3 + * @constructor + * @param {Number} x + * @param {Number} y + * @param {Number} z + * @author schteppe + * @example + * var v = new Vec3(1, 2, 3); + * console.log('x=' + v.x); // x=1 + */ +function Vec3(x,y,z){ + /** + * @property x + * @type {Number} + */ + this.x = x||0.0; + + /** + * @property y + * @type {Number} + */ + this.y = y||0.0; + + /** + * @property z + * @type {Number} + */ + this.z = z||0.0; +} + +/** + * @static + * @property {Vec3} ZERO + */ +Vec3.ZERO = new Vec3(0, 0, 0); + +/** + * @static + * @property {Vec3} UNIT_X + */ +Vec3.UNIT_X = new Vec3(1, 0, 0); + +/** + * @static + * @property {Vec3} UNIT_Y + */ +Vec3.UNIT_Y = new Vec3(0, 1, 0); + +/** + * @static + * @property {Vec3} UNIT_Z + */ +Vec3.UNIT_Z = new Vec3(0, 0, 1); + +/** + * Vector cross product + * @method cross + * @param {Vec3} v + * @param {Vec3} target Optional. Target to save in. + * @return {Vec3} + */ +Vec3.prototype.cross = function(v,target){ + var vx=v.x, vy=v.y, vz=v.z, x=this.x, y=this.y, z=this.z; + target = target || new Vec3(); + + target.x = (y * vz) - (z * vy); + target.y = (z * vx) - (x * vz); + target.z = (x * vy) - (y * vx); + + return target; +}; + +/** + * Set the vectors' 3 elements + * @method set + * @param {Number} x + * @param {Number} y + * @param {Number} z + * @return Vec3 + */ +Vec3.prototype.set = function(x,y,z){ + this.x = x; + this.y = y; + this.z = z; + return this; +}; + +/** + * Set all components of the vector to zero. + * @method setZero + */ +Vec3.prototype.setZero = function(){ + this.x = this.y = this.z = 0; +}; + +/** + * Vector addition + * @method vadd + * @param {Vec3} v + * @param {Vec3} target Optional. + * @return {Vec3} + */ +Vec3.prototype.vadd = function(v,target){ + if(target){ + target.x = v.x + this.x; + target.y = v.y + this.y; + target.z = v.z + this.z; + } else { + return new Vec3(this.x + v.x, + this.y + v.y, + this.z + v.z); + } +}; + +/** + * Vector subtraction + * @method vsub + * @param {Vec3} v + * @param {Vec3} target Optional. Target to save in. + * @return {Vec3} + */ +Vec3.prototype.vsub = function(v,target){ + if(target){ + target.x = this.x - v.x; + target.y = this.y - v.y; + target.z = this.z - v.z; + } else { + return new Vec3(this.x-v.x, + this.y-v.y, + this.z-v.z); + } +}; + +/** + * Get the cross product matrix a_cross from a vector, such that a x b = a_cross * b = c + * @method crossmat + * @see http://www8.cs.umu.se/kurser/TDBD24/VT06/lectures/Lecture6.pdf + * @return {Mat3} + */ +Vec3.prototype.crossmat = function(){ + return new Mat3([ 0, -this.z, this.y, + this.z, 0, -this.x, + -this.y, this.x, 0]); +}; + +/** + * Normalize the vector. Note that this changes the values in the vector. + * @method normalize + * @return {Number} Returns the norm of the vector + */ +Vec3.prototype.normalize = function(){ + var x=this.x, y=this.y, z=this.z; + var n = Math.sqrt(x*x + y*y + z*z); + if(n>0.0){ + var invN = 1/n; + this.x *= invN; + this.y *= invN; + this.z *= invN; + } else { + // Make something up + this.x = 0; + this.y = 0; + this.z = 0; + } + return n; +}; + +/** + * Get the version of this vector that is of length 1. + * @method unit + * @param {Vec3} target Optional target to save in + * @return {Vec3} Returns the unit vector + */ +Vec3.prototype.unit = function(target){ + target = target || new Vec3(); + var x=this.x, y=this.y, z=this.z; + var ninv = Math.sqrt(x*x + y*y + z*z); + if(ninv>0.0){ + ninv = 1.0/ninv; + target.x = x * ninv; + target.y = y * ninv; + target.z = z * ninv; + } else { + target.x = 1; + target.y = 0; + target.z = 0; + } + return target; +}; + +/** + * Get the length of the vector + * @method norm + * @return {Number} + * @deprecated Use .length() instead + */ +Vec3.prototype.norm = function(){ + var x=this.x, y=this.y, z=this.z; + return Math.sqrt(x*x + y*y + z*z); +}; + +/** + * Get the length of the vector + * @method length + * @return {Number} + */ +Vec3.prototype.length = Vec3.prototype.norm; + +/** + * Get the squared length of the vector + * @method norm2 + * @return {Number} + * @deprecated Use .lengthSquared() instead. + */ +Vec3.prototype.norm2 = function(){ + return this.dot(this); +}; + +/** + * Get the squared length of the vector. + * @method lengthSquared + * @return {Number} + */ +Vec3.prototype.lengthSquared = Vec3.prototype.norm2; + +/** + * Get distance from this point to another point + * @method distanceTo + * @param {Vec3} p + * @return {Number} + */ +Vec3.prototype.distanceTo = function(p){ + var x=this.x, y=this.y, z=this.z; + var px=p.x, py=p.y, pz=p.z; + return Math.sqrt((px-x)*(px-x)+ + (py-y)*(py-y)+ + (pz-z)*(pz-z)); +}; + +/** + * Get squared distance from this point to another point + * @method distanceSquared + * @param {Vec3} p + * @return {Number} + */ +Vec3.prototype.distanceSquared = function(p){ + var x=this.x, y=this.y, z=this.z; + var px=p.x, py=p.y, pz=p.z; + return (px-x)*(px-x) + (py-y)*(py-y) + (pz-z)*(pz-z); +}; + +/** + * Multiply all the components of the vector with a scalar. + * @deprecated Use .scale instead + * @method mult + * @param {Number} scalar + * @param {Vec3} target The vector to save the result in. + * @return {Vec3} + * @deprecated Use .scale() instead + */ +Vec3.prototype.mult = function(scalar,target){ + target = target || new Vec3(); + var x = this.x, + y = this.y, + z = this.z; + target.x = scalar * x; + target.y = scalar * y; + target.z = scalar * z; + return target; +}; + +/** + * Multiply the vector with an other vector, component-wise. + * @method mult + * @param {Number} vector + * @param {Vec3} target The vector to save the result in. + * @return {Vec3} + */ +Vec3.prototype.vmul = function(vector, target){ + target = target || new Vec3(); + target.x = vector.x * this.x; + target.y = vector.y * this.y; + target.z = vector.z * this.z; + return target; +}; + +/** + * Multiply the vector with a scalar. + * @method scale + * @param {Number} scalar + * @param {Vec3} target + * @return {Vec3} + */ +Vec3.prototype.scale = Vec3.prototype.mult; + +/** + * Scale a vector and add it to this vector. Save the result in "target". (target = this + vector * scalar) + * @method addScaledVector + * @param {Number} scalar + * @param {Vec3} vector + * @param {Vec3} target The vector to save the result in. + * @return {Vec3} + */ +Vec3.prototype.addScaledVector = function(scalar, vector, target){ + target = target || new Vec3(); + target.x = this.x + scalar * vector.x; + target.y = this.y + scalar * vector.y; + target.z = this.z + scalar * vector.z; + return target; +}; + +/** + * Calculate dot product + * @method dot + * @param {Vec3} v + * @return {Number} + */ +Vec3.prototype.dot = function(v){ + return this.x * v.x + this.y * v.y + this.z * v.z; +}; + +/** + * @method isZero + * @return bool + */ +Vec3.prototype.isZero = function(){ + return this.x===0 && this.y===0 && this.z===0; +}; + +/** + * Make the vector point in the opposite direction. + * @method negate + * @param {Vec3} target Optional target to save in + * @return {Vec3} + */ +Vec3.prototype.negate = function(target){ + target = target || new Vec3(); + target.x = -this.x; + target.y = -this.y; + target.z = -this.z; + return target; +}; + +/** + * Compute two artificial tangents to the vector + * @method tangents + * @param {Vec3} t1 Vector object to save the first tangent in + * @param {Vec3} t2 Vector object to save the second tangent in + */ +var Vec3_tangents_n = new Vec3(); +var Vec3_tangents_randVec = new Vec3(); +Vec3.prototype.tangents = function(t1,t2){ + var norm = this.norm(); + if(norm>0.0){ + var n = Vec3_tangents_n; + var inorm = 1/norm; + n.set(this.x*inorm,this.y*inorm,this.z*inorm); + var randVec = Vec3_tangents_randVec; + if(Math.abs(n.x) < 0.9){ + randVec.set(1,0,0); + n.cross(randVec,t1); + } else { + randVec.set(0,1,0); + n.cross(randVec,t1); + } + n.cross(t1,t2); + } else { + // The normal length is zero, make something up + t1.set(1, 0, 0); + t2.set(0, 1, 0); + } +}; + +/** + * Converts to a more readable format + * @method toString + * @return string + */ +Vec3.prototype.toString = function(){ + return this.x+","+this.y+","+this.z; +}; + +/** + * Converts to an array + * @method toArray + * @return Array + */ +Vec3.prototype.toArray = function(){ + return [this.x, this.y, this.z]; +}; + +/** + * Copies value of source to this vector. + * @method copy + * @param {Vec3} source + * @return {Vec3} this + */ +Vec3.prototype.copy = function(source){ + this.x = source.x; + this.y = source.y; + this.z = source.z; + return this; +}; + + +/** + * Do a linear interpolation between two vectors + * @method lerp + * @param {Vec3} v + * @param {Number} t A number between 0 and 1. 0 will make this function return u, and 1 will make it return v. Numbers in between will generate a vector in between them. + * @param {Vec3} target + */ +Vec3.prototype.lerp = function(v,t,target){ + var x=this.x, y=this.y, z=this.z; + target.x = x + (v.x-x)*t; + target.y = y + (v.y-y)*t; + target.z = z + (v.z-z)*t; +}; + +/** + * Check if a vector equals is almost equal to another one. + * @method almostEquals + * @param {Vec3} v + * @param {Number} precision + * @return bool + */ +Vec3.prototype.almostEquals = function(v,precision){ + if(precision===undefined){ + precision = 1e-6; + } + if( Math.abs(this.x-v.x)>precision || + Math.abs(this.y-v.y)>precision || + Math.abs(this.z-v.z)>precision){ + return false; + } + return true; +}; + +/** + * Check if a vector is almost zero + * @method almostZero + * @param {Number} precision + */ +Vec3.prototype.almostZero = function(precision){ + if(precision===undefined){ + precision = 1e-6; + } + if( Math.abs(this.x)>precision || + Math.abs(this.y)>precision || + Math.abs(this.z)>precision){ + return false; + } + return true; +}; + +var antip_neg = new Vec3(); + +/** + * Check if the vector is anti-parallel to another vector. + * @method isAntiparallelTo + * @param {Vec3} v + * @param {Number} precision Set to zero for exact comparisons + * @return {Boolean} + */ +Vec3.prototype.isAntiparallelTo = function(v,precision){ + this.negate(antip_neg); + return antip_neg.almostEquals(v,precision); +}; + +/** + * Clone the vector + * @method clone + * @return {Vec3} + */ +Vec3.prototype.clone = function(){ + return new Vec3(this.x, this.y, this.z); +}; +},{"./Mat3":28}],32:[function(_dereq_,module,exports){ +module.exports = Body; + +var EventTarget = _dereq_('../utils/EventTarget'); +var Shape = _dereq_('../shapes/Shape'); +var Vec3 = _dereq_('../math/Vec3'); +var Mat3 = _dereq_('../math/Mat3'); +var Quaternion = _dereq_('../math/Quaternion'); +var Material = _dereq_('../material/Material'); +var AABB = _dereq_('../collision/AABB'); +var Box = _dereq_('../shapes/Box'); + +/** + * Base class for all body types. + * @class Body + * @constructor + * @extends EventTarget + * @param {object} [options] + * @param {Vec3} [options.position] + * @param {Vec3} [options.velocity] + * @param {Vec3} [options.angularVelocity] + * @param {Quaternion} [options.quaternion] + * @param {number} [options.mass] + * @param {Material} [options.material] + * @param {number} [options.type] + * @param {number} [options.linearDamping=0.01] + * @param {number} [options.angularDamping=0.01] + * @param {boolean} [options.allowSleep=true] + * @param {number} [options.sleepSpeedLimit=0.1] + * @param {number} [options.sleepTimeLimit=1] + * @param {number} [options.collisionFilterGroup=1] + * @param {number} [options.collisionFilterMask=-1] + * @param {boolean} [options.fixedRotation=false] + * @param {Vec3} [options.linearFactor] + * @param {Vec3} [options.angularFactor] + * @param {Shape} [options.shape] + * @example + * var body = new Body({ + * mass: 1 + * }); + * var shape = new Sphere(1); + * body.addShape(shape); + * world.addBody(body); + */ +function Body(options){ + options = options || {}; + + EventTarget.apply(this); + + this.id = Body.idCounter++; + + /** + * Reference to the world the body is living in + * @property world + * @type {World} + */ + this.world = null; + + /** + * Callback function that is used BEFORE stepping the system. Use it to apply forces, for example. Inside the function, "this" will refer to this Body object. + * @property preStep + * @type {Function} + * @deprecated Use World events instead + */ + this.preStep = null; + + /** + * Callback function that is used AFTER stepping the system. Inside the function, "this" will refer to this Body object. + * @property postStep + * @type {Function} + * @deprecated Use World events instead + */ + this.postStep = null; + + this.vlambda = new Vec3(); + + /** + * @property {Number} collisionFilterGroup + */ + this.collisionFilterGroup = typeof(options.collisionFilterGroup) === 'number' ? options.collisionFilterGroup : 1; + + /** + * @property {Number} collisionFilterMask + */ + this.collisionFilterMask = typeof(options.collisionFilterMask) === 'number' ? options.collisionFilterMask : -1; + + /** + * Whether to produce contact forces when in contact with other bodies. Note that contacts will be generated, but they will be disabled. + * @property {Number} collisionResponse + */ + this.collisionResponse = true; + + /** + * World space position of the body. + * @property position + * @type {Vec3} + */ + this.position = new Vec3(); + + /** + * @property {Vec3} previousPosition + */ + this.previousPosition = new Vec3(); + + /** + * Interpolated position of the body. + * @property {Vec3} interpolatedPosition + */ + this.interpolatedPosition = new Vec3(); + + /** + * Initial position of the body + * @property initPosition + * @type {Vec3} + */ + this.initPosition = new Vec3(); + + if(options.position){ + this.position.copy(options.position); + this.previousPosition.copy(options.position); + this.interpolatedPosition.copy(options.position); + this.initPosition.copy(options.position); + } + + /** + * World space velocity of the body. + * @property velocity + * @type {Vec3} + */ + this.velocity = new Vec3(); + + if(options.velocity){ + this.velocity.copy(options.velocity); + } + + /** + * @property initVelocity + * @type {Vec3} + */ + this.initVelocity = new Vec3(); + + /** + * Linear force on the body in world space. + * @property force + * @type {Vec3} + */ + this.force = new Vec3(); + + var mass = typeof(options.mass) === 'number' ? options.mass : 0; + + /** + * @property mass + * @type {Number} + * @default 0 + */ + this.mass = mass; + + /** + * @property invMass + * @type {Number} + */ + this.invMass = mass > 0 ? 1.0 / mass : 0; + + /** + * @property material + * @type {Material} + */ + this.material = options.material || null; + + /** + * @property linearDamping + * @type {Number} + */ + this.linearDamping = typeof(options.linearDamping) === 'number' ? options.linearDamping : 0.01; + + /** + * One of: Body.DYNAMIC, Body.STATIC and Body.KINEMATIC. + * @property type + * @type {Number} + */ + this.type = (mass <= 0.0 ? Body.STATIC : Body.DYNAMIC); + if(typeof(options.type) === typeof(Body.STATIC)){ + this.type = options.type; + } + + /** + * If true, the body will automatically fall to sleep. + * @property allowSleep + * @type {Boolean} + * @default true + */ + this.allowSleep = typeof(options.allowSleep) !== 'undefined' ? options.allowSleep : true; + + /** + * Current sleep state. + * @property sleepState + * @type {Number} + */ + this.sleepState = 0; + + /** + * If the speed (the norm of the velocity) is smaller than this value, the body is considered sleepy. + * @property sleepSpeedLimit + * @type {Number} + * @default 0.1 + */ + this.sleepSpeedLimit = typeof(options.sleepSpeedLimit) !== 'undefined' ? options.sleepSpeedLimit : 0.03; + + /** + * If the body has been sleepy for this sleepTimeLimit seconds, it is considered sleeping. + * @property sleepTimeLimit + * @type {Number} + * @default 1 + */ + this.sleepTimeLimit = typeof(options.sleepTimeLimit) !== 'undefined' ? options.sleepTimeLimit : 1; + + this.timeLastSleepy = 0; + + this._wakeUpAfterNarrowphase = false; + + /** + * World space rotational force on the body, around center of mass. + * @property {Vec3} torque + */ + this.torque = new Vec3(); + + /** + * World space orientation of the body. + * @property quaternion + * @type {Quaternion} + */ + this.quaternion = new Quaternion(); + + /** + * @property initQuaternion + * @type {Quaternion} + */ + this.initQuaternion = new Quaternion(); + + /** + * @property {Quaternion} previousQuaternion + */ + this.previousQuaternion = new Quaternion(); + + /** + * Interpolated orientation of the body. + * @property {Quaternion} interpolatedQuaternion + */ + this.interpolatedQuaternion = new Quaternion(); + + if(options.quaternion){ + this.quaternion.copy(options.quaternion); + this.initQuaternion.copy(options.quaternion); + this.previousQuaternion.copy(options.quaternion); + this.interpolatedQuaternion.copy(options.quaternion); + } + + /** + * Angular velocity of the body, in world space. Think of the angular velocity as a vector, which the body rotates around. The length of this vector determines how fast (in radians per second) the body rotates. + * @property angularVelocity + * @type {Vec3} + */ + this.angularVelocity = new Vec3(); + + if(options.angularVelocity){ + this.angularVelocity.copy(options.angularVelocity); + } + + /** + * @property initAngularVelocity + * @type {Vec3} + */ + this.initAngularVelocity = new Vec3(); + + /** + * @property shapes + * @type {array} + */ + this.shapes = []; + + /** + * Position of each Shape in the body, given in local Body space. + * @property shapeOffsets + * @type {array} + */ + this.shapeOffsets = []; + + /** + * Orientation of each Shape, given in local Body space. + * @property shapeOrientations + * @type {array} + */ + this.shapeOrientations = []; + + /** + * @property inertia + * @type {Vec3} + */ + this.inertia = new Vec3(); + + /** + * @property {Vec3} invInertia + */ + this.invInertia = new Vec3(); + + /** + * @property {Mat3} invInertiaWorld + */ + this.invInertiaWorld = new Mat3(); + + this.invMassSolve = 0; + + /** + * @property {Vec3} invInertiaSolve + */ + this.invInertiaSolve = new Vec3(); + + /** + * @property {Mat3} invInertiaWorldSolve + */ + this.invInertiaWorldSolve = new Mat3(); + + /** + * Set to true if you don't want the body to rotate. Make sure to run .updateMassProperties() after changing this. + * @property {Boolean} fixedRotation + * @default false + */ + this.fixedRotation = typeof(options.fixedRotation) !== "undefined" ? options.fixedRotation : false; + + /** + * @property {Number} angularDamping + */ + this.angularDamping = typeof(options.angularDamping) !== 'undefined' ? options.angularDamping : 0.01; + + /** + * Use this property to limit the motion along any world axis. (1,1,1) will allow motion along all axes while (0,0,0) allows none. + * @property {Vec3} linearFactor + */ + this.linearFactor = new Vec3(1,1,1); + if(options.linearFactor){ + this.linearFactor.copy(options.linearFactor); + } + + /** + * Use this property to limit the rotational motion along any world axis. (1,1,1) will allow rotation along all axes while (0,0,0) allows none. + * @property {Vec3} angularFactor + */ + this.angularFactor = new Vec3(1,1,1); + if(options.angularFactor){ + this.angularFactor.copy(options.angularFactor); + } + + /** + * World space bounding box of the body and its shapes. + * @property aabb + * @type {AABB} + */ + this.aabb = new AABB(); + + /** + * Indicates if the AABB needs to be updated before use. + * @property aabbNeedsUpdate + * @type {Boolean} + */ + this.aabbNeedsUpdate = true; + + /** + * Total bounding radius of the Body including its shapes, relative to body.position. + * @property boundingRadius + * @type {Number} + */ + this.boundingRadius = 0; + + this.wlambda = new Vec3(); + + if(options.shape){ + this.addShape(options.shape); + } + + this.updateMassProperties(); +} +Body.prototype = new EventTarget(); +Body.prototype.constructor = Body; + +/** + * Dispatched after two bodies collide. This event is dispatched on each + * of the two bodies involved in the collision. + * @event collide + * @param {Body} body The body that was involved in the collision. + * @param {ContactEquation} contact The details of the collision. + */ +Body.COLLIDE_EVENT_NAME = "collide"; + +/** + * A dynamic body is fully simulated. Can be moved manually by the user, but normally they move according to forces. A dynamic body can collide with all body types. A dynamic body always has finite, non-zero mass. + * @static + * @property DYNAMIC + * @type {Number} + */ +Body.DYNAMIC = 1; + +/** + * A static body does not move during simulation and behaves as if it has infinite mass. Static bodies can be moved manually by setting the position of the body. The velocity of a static body is always zero. Static bodies do not collide with other static or kinematic bodies. + * @static + * @property STATIC + * @type {Number} + */ +Body.STATIC = 2; + +/** + * A kinematic body moves under simulation according to its velocity. They do not respond to forces. They can be moved manually, but normally a kinematic body is moved by setting its velocity. A kinematic body behaves as if it has infinite mass. Kinematic bodies do not collide with other static or kinematic bodies. + * @static + * @property KINEMATIC + * @type {Number} + */ +Body.KINEMATIC = 4; + + + +/** + * @static + * @property AWAKE + * @type {number} + */ +Body.AWAKE = 0; + +/** + * @static + * @property SLEEPY + * @type {number} + */ +Body.SLEEPY = 1; + +/** + * @static + * @property SLEEPING + * @type {number} + */ +Body.SLEEPING = 2; + +Body.idCounter = 0; + +/** + * Dispatched after a sleeping body has woken up. + * @event wakeup + */ +Body.wakeupEvent = { + type: "wakeup" +}; + +/** + * Wake the body up. + * @method wakeUp + */ +Body.prototype.wakeUp = function(){ + var s = this.sleepState; + this.sleepState = 0; + this._wakeUpAfterNarrowphase = false; + if(s === Body.SLEEPING){ + this.dispatchEvent(Body.wakeupEvent); + } +}; + +/** + * Force body sleep + * @method sleep + */ +Body.prototype.sleep = function(){ + this.sleepState = Body.SLEEPING; + this.velocity.set(0,0,0); + this.angularVelocity.set(0,0,0); + this._wakeUpAfterNarrowphase = false; +}; + +/** + * Dispatched after a body has gone in to the sleepy state. + * @event sleepy + */ +Body.sleepyEvent = { + type: "sleepy" +}; + +/** + * Dispatched after a body has fallen asleep. + * @event sleep + */ +Body.sleepEvent = { + type: "sleep" +}; + +/** + * Called every timestep to update internal sleep timer and change sleep state if needed. + * @method sleepTick + * @param {Number} time The world time in seconds + */ +Body.prototype.sleepTick = function(time){ + if(this.allowSleep){ + var sleepState = this.sleepState; + var speedSquared = this.velocity.norm2() + this.angularVelocity.norm2(); + var speedLimitSquared = Math.pow(this.sleepSpeedLimit,2); + if(sleepState===Body.AWAKE && speedSquared < speedLimitSquared){ + this.sleepState = Body.SLEEPY; // Sleepy + this.timeLastSleepy = time; + this.dispatchEvent(Body.sleepyEvent); + } else if(sleepState===Body.SLEEPY && speedSquared > speedLimitSquared){ + this.wakeUp(); // Wake up + } else if(sleepState===Body.SLEEPY && (time - this.timeLastSleepy ) > this.sleepTimeLimit){ + this.sleep(); // Sleeping + this.dispatchEvent(Body.sleepEvent); + } + } +}; + +/** + * If the body is sleeping, it should be immovable / have infinite mass during solve. We solve it by having a separate "solve mass". + * @method updateSolveMassProperties + */ +Body.prototype.updateSolveMassProperties = function(){ + if(this.sleepState === Body.SLEEPING || this.type === Body.KINEMATIC){ + this.invMassSolve = 0; + this.invInertiaSolve.setZero(); + this.invInertiaWorldSolve.setZero(); + } else { + this.invMassSolve = this.invMass; + this.invInertiaSolve.copy(this.invInertia); + this.invInertiaWorldSolve.copy(this.invInertiaWorld); + } +}; + +/** + * Convert a world point to local body frame. + * @method pointToLocalFrame + * @param {Vec3} worldPoint + * @param {Vec3} result + * @return {Vec3} + */ +Body.prototype.pointToLocalFrame = function(worldPoint,result){ + var result = result || new Vec3(); + worldPoint.vsub(this.position,result); + this.quaternion.conjugate().vmult(result,result); + return result; +}; + +/** + * Convert a world vector to local body frame. + * @method vectorToLocalFrame + * @param {Vec3} worldPoint + * @param {Vec3} result + * @return {Vec3} + */ +Body.prototype.vectorToLocalFrame = function(worldVector, result){ + var result = result || new Vec3(); + this.quaternion.conjugate().vmult(worldVector,result); + return result; +}; + +/** + * Convert a local body point to world frame. + * @method pointToWorldFrame + * @param {Vec3} localPoint + * @param {Vec3} result + * @return {Vec3} + */ +Body.prototype.pointToWorldFrame = function(localPoint,result){ + var result = result || new Vec3(); + this.interpolatedQuaternion.vmult(localPoint,result); + result.vadd(this.interpolatedPosition,result); + return result; +}; + +/** + * Convert a local body point to world frame. + * @method vectorToWorldFrame + * @param {Vec3} localVector + * @param {Vec3} result + * @return {Vec3} + */ +Body.prototype.vectorToWorldFrame = function(localVector, result){ + var result = result || new Vec3(); + this.interpolatedQuaternion.vmult(localVector, result); + return result; +}; + +var tmpVec = new Vec3(); +var tmpQuat = new Quaternion(); + +/** + * Add a shape to the body with a local offset and orientation. + * @method addShape + * @param {Shape} shape + * @param {Vec3} [_offset] + * @param {Quaternion} [_orientation] + * @return {Body} The body object, for chainability. + */ +Body.prototype.addShape = function(shape, _offset, _orientation){ + var offset = new Vec3(); + var orientation = new Quaternion(); + + if(_offset){ + offset.copy(_offset); + } + if(_orientation){ + orientation.copy(_orientation); + } + + this.shapes.push(shape); + this.shapeOffsets.push(offset); + this.shapeOrientations.push(orientation); + this.updateMassProperties(); + this.updateBoundingRadius(); + + this.aabbNeedsUpdate = true; + + shape.body = this; + + return this; +}; + +/** + * Update the bounding radius of the body. Should be done if any of the shapes are changed. + * @method updateBoundingRadius + */ +Body.prototype.updateBoundingRadius = function(){ + var shapes = this.shapes, + shapeOffsets = this.shapeOffsets, + N = shapes.length, + radius = 0; + + for(var i=0; i!==N; i++){ + var shape = shapes[i]; + shape.updateBoundingSphereRadius(); + var offset = shapeOffsets[i].norm(), + r = shape.boundingSphereRadius; + if(offset + r > radius){ + radius = offset + r; + } + } + + this.boundingRadius = radius; +}; + +var computeAABB_shapeAABB = new AABB(); + +/** + * Updates the .aabb + * @method computeAABB + * @todo rename to updateAABB() + */ +Body.prototype.computeAABB = function(){ + var shapes = this.shapes, + shapeOffsets = this.shapeOffsets, + shapeOrientations = this.shapeOrientations, + N = shapes.length, + offset = tmpVec, + orientation = tmpQuat, + bodyQuat = this.quaternion, + aabb = this.aabb, + shapeAABB = computeAABB_shapeAABB; + + for(var i=0; i!==N; i++){ + var shape = shapes[i]; + + // Get shape world position + bodyQuat.vmult(shapeOffsets[i], offset); + offset.vadd(this.position, offset); + + // Get shape world quaternion + shapeOrientations[i].mult(bodyQuat, orientation); + + // Get shape AABB + shape.calculateWorldAABB(offset, orientation, shapeAABB.lowerBound, shapeAABB.upperBound); + + if(i === 0){ + aabb.copy(shapeAABB); + } else { + aabb.extend(shapeAABB); + } + } + + this.aabbNeedsUpdate = false; +}; + +var uiw_m1 = new Mat3(), + uiw_m2 = new Mat3(), + uiw_m3 = new Mat3(); + +/** + * Update .inertiaWorld and .invInertiaWorld + * @method updateInertiaWorld + */ +Body.prototype.updateInertiaWorld = function(force){ + var I = this.invInertia; + if (I.x === I.y && I.y === I.z && !force) { + // If inertia M = s*I, where I is identity and s a scalar, then + // R*M*R' = R*(s*I)*R' = s*R*I*R' = s*R*R' = s*I = M + // where R is the rotation matrix. + // In other words, we don't have to transform the inertia if all + // inertia diagonal entries are equal. + } else { + var m1 = uiw_m1, + m2 = uiw_m2, + m3 = uiw_m3; + m1.setRotationFromQuaternion(this.quaternion); + m1.transpose(m2); + m1.scale(I,m1); + m1.mmult(m2,this.invInertiaWorld); + } +}; + +/** + * Apply force to a world point. This could for example be a point on the Body surface. Applying force this way will add to Body.force and Body.torque. + * @method applyForce + * @param {Vec3} force The amount of force to add. + * @param {Vec3} relativePoint A point relative to the center of mass to apply the force on. + */ +var Body_applyForce_r = new Vec3(); +var Body_applyForce_rotForce = new Vec3(); +Body.prototype.applyForce = function(force,relativePoint){ + if(this.type !== Body.DYNAMIC){ // Needed? + return; + } + + // Compute produced rotational force + var rotForce = Body_applyForce_rotForce; + relativePoint.cross(force,rotForce); + + // Add linear force + this.force.vadd(force,this.force); + + // Add rotational force + this.torque.vadd(rotForce,this.torque); +}; + +/** + * Apply force to a local point in the body. + * @method applyLocalForce + * @param {Vec3} force The force vector to apply, defined locally in the body frame. + * @param {Vec3} localPoint A local point in the body to apply the force on. + */ +var Body_applyLocalForce_worldForce = new Vec3(); +var Body_applyLocalForce_relativePointWorld = new Vec3(); +Body.prototype.applyLocalForce = function(localForce, localPoint){ + if(this.type !== Body.DYNAMIC){ + return; + } + + var worldForce = Body_applyLocalForce_worldForce; + var relativePointWorld = Body_applyLocalForce_relativePointWorld; + + // Transform the force vector to world space + this.vectorToWorldFrame(localForce, worldForce); + this.vectorToWorldFrame(localPoint, relativePointWorld); + + this.applyForce(worldForce, relativePointWorld); +}; + +/** + * Apply impulse to a world point. This could for example be a point on the Body surface. An impulse is a force added to a body during a short period of time (impulse = force * time). Impulses will be added to Body.velocity and Body.angularVelocity. + * @method applyImpulse + * @param {Vec3} impulse The amount of impulse to add. + * @param {Vec3} relativePoint A point relative to the center of mass to apply the force on. + */ +var Body_applyImpulse_r = new Vec3(); +var Body_applyImpulse_velo = new Vec3(); +var Body_applyImpulse_rotVelo = new Vec3(); +Body.prototype.applyImpulse = function(impulse, relativePoint){ + if(this.type !== Body.DYNAMIC){ + return; + } + + // Compute point position relative to the body center + var r = relativePoint; + + // Compute produced central impulse velocity + var velo = Body_applyImpulse_velo; + velo.copy(impulse); + velo.mult(this.invMass,velo); + + // Add linear impulse + this.velocity.vadd(velo, this.velocity); + + // Compute produced rotational impulse velocity + var rotVelo = Body_applyImpulse_rotVelo; + r.cross(impulse,rotVelo); + + /* + rotVelo.x *= this.invInertia.x; + rotVelo.y *= this.invInertia.y; + rotVelo.z *= this.invInertia.z; + */ + this.invInertiaWorld.vmult(rotVelo,rotVelo); + + // Add rotational Impulse + this.angularVelocity.vadd(rotVelo, this.angularVelocity); +}; + +/** + * Apply locally-defined impulse to a local point in the body. + * @method applyLocalImpulse + * @param {Vec3} force The force vector to apply, defined locally in the body frame. + * @param {Vec3} localPoint A local point in the body to apply the force on. + */ +var Body_applyLocalImpulse_worldImpulse = new Vec3(); +var Body_applyLocalImpulse_relativePoint = new Vec3(); +Body.prototype.applyLocalImpulse = function(localImpulse, localPoint){ + if(this.type !== Body.DYNAMIC){ + return; + } + + var worldImpulse = Body_applyLocalImpulse_worldImpulse; + var relativePointWorld = Body_applyLocalImpulse_relativePoint; + + // Transform the force vector to world space + this.vectorToWorldFrame(localImpulse, worldImpulse); + this.vectorToWorldFrame(localPoint, relativePointWorld); + + this.applyImpulse(worldImpulse, relativePointWorld); +}; + +var Body_updateMassProperties_halfExtents = new Vec3(); + +/** + * Should be called whenever you change the body shape or mass. + * @method updateMassProperties + */ +Body.prototype.updateMassProperties = function(){ + var halfExtents = Body_updateMassProperties_halfExtents; + + this.invMass = this.mass > 0 ? 1.0 / this.mass : 0; + var I = this.inertia; + var fixed = this.fixedRotation; + + // Approximate with AABB box + this.computeAABB(); + halfExtents.set( + (this.aabb.upperBound.x-this.aabb.lowerBound.x) / 2, + (this.aabb.upperBound.y-this.aabb.lowerBound.y) / 2, + (this.aabb.upperBound.z-this.aabb.lowerBound.z) / 2 + ); + Box.calculateInertia(halfExtents, this.mass, I); + + this.invInertia.set( + I.x > 0 && !fixed ? 1.0 / I.x : 0, + I.y > 0 && !fixed ? 1.0 / I.y : 0, + I.z > 0 && !fixed ? 1.0 / I.z : 0 + ); + this.updateInertiaWorld(true); +}; + +/** + * Get world velocity of a point in the body. + * @method getVelocityAtWorldPoint + * @param {Vec3} worldPoint + * @param {Vec3} result + * @return {Vec3} The result vector. + */ +Body.prototype.getVelocityAtWorldPoint = function(worldPoint, result){ + var r = new Vec3(); + worldPoint.vsub(this.position, r); + this.angularVelocity.cross(r, result); + this.velocity.vadd(result, result); + return result; +}; + +var torque = new Vec3(); +var invI_tau_dt = new Vec3(); +var w = new Quaternion(); +var wq = new Quaternion(); + +/** + * Move the body forward in time. + * @param {number} dt Time step + * @param {boolean} quatNormalize Set to true to normalize the body quaternion + * @param {boolean} quatNormalizeFast If the quaternion should be normalized using "fast" quaternion normalization + */ +Body.prototype.integrate = function(dt, quatNormalize, quatNormalizeFast){ + + // Save previous position + this.previousPosition.copy(this.position); + this.previousQuaternion.copy(this.quaternion); + + if(!(this.type === Body.DYNAMIC || this.type === Body.KINEMATIC) || this.sleepState === Body.SLEEPING){ // Only for dynamic + return; + } + + var velo = this.velocity, + angularVelo = this.angularVelocity, + pos = this.position, + force = this.force, + torque = this.torque, + quat = this.quaternion, + invMass = this.invMass, + invInertia = this.invInertiaWorld, + linearFactor = this.linearFactor; + + var iMdt = invMass * dt; + velo.x += force.x * iMdt * linearFactor.x; + velo.y += force.y * iMdt * linearFactor.y; + velo.z += force.z * iMdt * linearFactor.z; + + var e = invInertia.elements; + var angularFactor = this.angularFactor; + var tx = torque.x * angularFactor.x; + var ty = torque.y * angularFactor.y; + var tz = torque.z * angularFactor.z; + angularVelo.x += dt * (e[0] * tx + e[1] * ty + e[2] * tz); + angularVelo.y += dt * (e[3] * tx + e[4] * ty + e[5] * tz); + angularVelo.z += dt * (e[6] * tx + e[7] * ty + e[8] * tz); + + // Use new velocity - leap frog + pos.x += velo.x * dt; + pos.y += velo.y * dt; + pos.z += velo.z * dt; + + quat.integrate(this.angularVelocity, dt, this.angularFactor, quat); + + if(quatNormalize){ + if(quatNormalizeFast){ + quat.normalizeFast(); + } else { + quat.normalize(); + } + } + + this.aabbNeedsUpdate = true; + + // Update world inertia + this.updateInertiaWorld(); +}; + +},{"../collision/AABB":3,"../material/Material":26,"../math/Mat3":28,"../math/Quaternion":29,"../math/Vec3":31,"../shapes/Box":38,"../shapes/Shape":44,"../utils/EventTarget":50}],33:[function(_dereq_,module,exports){ +var Body = _dereq_('./Body'); +var Vec3 = _dereq_('../math/Vec3'); +var Quaternion = _dereq_('../math/Quaternion'); +var RaycastResult = _dereq_('../collision/RaycastResult'); +var Ray = _dereq_('../collision/Ray'); +var WheelInfo = _dereq_('../objects/WheelInfo'); + +module.exports = RaycastVehicle; + +/** + * Vehicle helper class that casts rays from the wheel positions towards the ground and applies forces. + * @class RaycastVehicle + * @constructor + * @param {object} [options] + * @param {Body} [options.chassisBody] The car chassis body. + * @param {integer} [options.indexRightAxis] Axis to use for right. x=0, y=1, z=2 + * @param {integer} [options.indexLeftAxis] + * @param {integer} [options.indexUpAxis] + */ +function RaycastVehicle(options){ + + /** + * @property {Body} chassisBody + */ + this.chassisBody = options.chassisBody; + + /** + * An array of WheelInfo objects. + * @property {array} wheelInfos + */ + this.wheelInfos = []; + + /** + * Will be set to true if the car is sliding. + * @property {boolean} sliding + */ + this.sliding = false; + + /** + * @property {World} world + */ + this.world = null; + + /** + * Index of the right axis, 0=x, 1=y, 2=z + * @property {integer} indexRightAxis + * @default 1 + */ + this.indexRightAxis = typeof(options.indexRightAxis) !== 'undefined' ? options.indexRightAxis : 1; + + /** + * Index of the forward axis, 0=x, 1=y, 2=z + * @property {integer} indexForwardAxis + * @default 0 + */ + this.indexForwardAxis = typeof(options.indexForwardAxis) !== 'undefined' ? options.indexForwardAxis : 0; + + /** + * Index of the up axis, 0=x, 1=y, 2=z + * @property {integer} indexUpAxis + * @default 2 + */ + this.indexUpAxis = typeof(options.indexUpAxis) !== 'undefined' ? options.indexUpAxis : 2; + + /** + * Number of wheels currently touching the ground + * @property {integer} numWheelsOnGround + */ + this.numWheelsOnGround = 0; +} + +var tmpVec1 = new Vec3(); +var tmpVec2 = new Vec3(); +var tmpVec3 = new Vec3(); +var tmpVec4 = new Vec3(); +var tmpVec5 = new Vec3(); +var tmpVec6 = new Vec3(); +var tmpRay = new Ray(); + +/** + * Add a wheel. For information about the options, see WheelInfo. + * @method addWheel + * @param {object} [options] + */ +RaycastVehicle.prototype.addWheel = function(options){ + options = options || {}; + + var info = new WheelInfo(options); + var index = this.wheelInfos.length; + this.wheelInfos.push(info); + + return index; +}; + +/** + * Set the steering value of a wheel. + * @method setSteeringValue + * @param {number} value + * @param {integer} wheelIndex + */ +RaycastVehicle.prototype.setSteeringValue = function(value, wheelIndex){ + var wheel = this.wheelInfos[wheelIndex]; + wheel.steering = value; +}; + +var torque = new Vec3(); + +/** + * Set the wheel force to apply on one of the wheels each time step + * @method applyEngineForce + * @param {number} value + * @param {integer} wheelIndex + */ +RaycastVehicle.prototype.applyEngineForce = function(value, wheelIndex){ + this.wheelInfos[wheelIndex].engineForce = value; +}; + +/** + * Set the braking force of a wheel + * @method setBrake + * @param {number} brake + * @param {integer} wheelIndex + */ +RaycastVehicle.prototype.setBrake = function(brake, wheelIndex){ + this.wheelInfos[wheelIndex].brake = brake; +}; + +/** + * Add the vehicle including its constraints to the world. + * @method addToWorld + * @param {World} world + */ +RaycastVehicle.prototype.addToWorld = function(world){ + var constraints = this.constraints; + world.addBody(this.chassisBody); + var that = this; + this.preStepCallback = function(){ + that.updateVehicle(world.dt); + }; + world.addEventListener('preStep', this.preStepCallback); + this.world = world; +}; + +/** + * Get one of the wheel axles, world-oriented. + * @private + * @method getVehicleAxisWorld + * @param {integer} axisIndex + * @param {Vec3} result + */ +RaycastVehicle.prototype.getVehicleAxisWorld = function(axisIndex, result){ + result.set( + axisIndex === 0 ? 1 : 0, + axisIndex === 1 ? 1 : 0, + axisIndex === 2 ? 1 : 0 + ); + this.chassisBody.vectorToWorldFrame(result, result); +}; + +RaycastVehicle.prototype.updateVehicle = function(timeStep){ + + if (this.chassisBody.sleepState > 1) return; + + var wheelInfos = this.wheelInfos; + var numWheels = wheelInfos.length; + var chassisBody = this.chassisBody; + + for (var i = 0; i < numWheels; i++) { + this.updateWheelTransform(i); + } + + this.currentVehicleSpeedKmHour = 3.6 * chassisBody.velocity.norm(); + + var forwardWorld = new Vec3(); + this.getVehicleAxisWorld(this.indexForwardAxis, forwardWorld); + + if (forwardWorld.dot(chassisBody.velocity) < 0){ + this.currentVehicleSpeedKmHour *= -1; + } + + // simulate suspension + for (var i = 0; i < numWheels; i++) { + this.castRay(wheelInfos[i]); + } + + this.updateSuspension(timeStep); + + var impulse = new Vec3(); + var relpos = new Vec3(); + for (var i = 0; i < numWheels; i++) { + //apply suspension force + var wheel = wheelInfos[i]; + var suspensionForce = wheel.suspensionForce; + if (suspensionForce > wheel.maxSuspensionForce) { + suspensionForce = wheel.maxSuspensionForce; + } + wheel.raycastResult.hitNormalWorld.scale(suspensionForce * timeStep, impulse); + + wheel.raycastResult.hitPointWorld.vsub(chassisBody.position, relpos); + chassisBody.applyImpulse(impulse, relpos); + } + + this.updateFriction(timeStep); + + var hitNormalWorldScaledWithProj = new Vec3(); + var fwd = new Vec3(); + var vel = new Vec3(); + for (i = 0; i < numWheels; i++) { + var wheel = wheelInfos[i]; + //var relpos = new Vec3(); + //wheel.chassisConnectionPointWorld.vsub(chassisBody.position, relpos); + chassisBody.getVelocityAtWorldPoint(wheel.chassisConnectionPointWorld, vel); + + // Hack to get the rotation in the correct direction + var m = 1; + switch(this.indexUpAxis){ + case 1: + m = -1; + break; + } + + if (wheel.isInContact) { + + this.getVehicleAxisWorld(this.indexForwardAxis, fwd); + var proj = fwd.dot(wheel.raycastResult.hitNormalWorld); + wheel.raycastResult.hitNormalWorld.scale(proj, hitNormalWorldScaledWithProj); + + fwd.vsub(hitNormalWorldScaledWithProj, fwd); + + var proj2 = fwd.dot(vel); + wheel.deltaRotation = m * proj2 * timeStep / wheel.radius; + } + + if((wheel.sliding || !wheel.isInContact) && wheel.engineForce !== 0 && wheel.useCustomSlidingRotationalSpeed){ + // Apply custom rotation when accelerating and sliding + wheel.deltaRotation = (wheel.engineForce > 0 ? 1 : -1) * wheel.customSlidingRotationalSpeed * timeStep; + } + + // Lock wheels + if(Math.abs(wheel.brake) > Math.abs(wheel.engineForce)){ + wheel.deltaRotation = 0; + } + + wheel.lastRotation = wheel.rotation; + wheel.rotation += wheel.deltaRotation; // Use the old value + wheel.deltaRotation *= 0.99; // damping of rotation when not in contact + } +}; + +RaycastVehicle.prototype.updateSuspension = function(deltaTime) { + var chassisBody = this.chassisBody; + var chassisMass = chassisBody.mass; + var wheelInfos = this.wheelInfos; + var numWheels = wheelInfos.length; + + for (var w_it = 0; w_it < numWheels; w_it++){ + var wheel = wheelInfos[w_it]; + + if (wheel.isInContact){ + var force; + + // Spring + var susp_length = wheel.suspensionRestLength; + var current_length = wheel.suspensionLength; + var length_diff = (susp_length - current_length); + + force = wheel.suspensionStiffness * length_diff * wheel.clippedInvContactDotSuspension; + + // Damper + var projected_rel_vel = wheel.suspensionRelativeVelocity; + var susp_damping; + if (projected_rel_vel < 0) { + susp_damping = wheel.dampingCompression; + } else { + susp_damping = wheel.dampingRelaxation; + } + force -= susp_damping * projected_rel_vel; + + wheel.suspensionForce = force * chassisMass; + if (wheel.suspensionForce < 0) { + wheel.suspensionForce = 0; + } + } else { + wheel.suspensionForce = 0; + } + } +}; + +/** + * Remove the vehicle including its constraints from the world. + * @method removeFromWorld + * @param {World} world + */ +RaycastVehicle.prototype.removeFromWorld = function(world){ + var constraints = this.constraints; + world.remove(this.chassisBody); + world.removeEventListener('preStep', this.preStepCallback); + this.world = null; +}; + +var castRay_rayvector = new Vec3(); +var castRay_target = new Vec3(); +RaycastVehicle.prototype.castRay = function(wheel) { + var rayvector = castRay_rayvector; + var target = castRay_target; + + this.updateWheelTransformWorld(wheel); + var chassisBody = this.chassisBody; + + var depth = -1; + + var raylen = wheel.suspensionRestLength + wheel.radius; + + wheel.directionWorld.scale(raylen, rayvector); + var source = wheel.chassisConnectionPointWorld; + source.vadd(rayvector, target); + var raycastResult = wheel.raycastResult; + + var param = 0; + + raycastResult.reset(); + // Turn off ray collision with the chassis temporarily + var oldState = chassisBody.collisionResponse; + chassisBody.collisionResponse = false; + + // Cast ray against world + this.world.rayTest(source, target, raycastResult); + chassisBody.collisionResponse = oldState; + + var object = raycastResult.body; + + wheel.raycastResult.groundObject = 0; + + wheel.lastSuspensionLength = wheel.suspensionLength; + + if (object) { + depth = raycastResult.distance; + wheel.raycastResult.hitNormalWorld = raycastResult.hitNormalWorld; + wheel.isInContact = true; + + var hitDistance = raycastResult.distance; + wheel.suspensionLength = hitDistance - wheel.radius; + + // clamp on max suspension travel + var minSuspensionLength = wheel.suspensionRestLength - wheel.maxSuspensionTravel; + var maxSuspensionLength = wheel.suspensionRestLength + wheel.maxSuspensionTravel; + if (wheel.suspensionLength < minSuspensionLength) { + wheel.suspensionLength = minSuspensionLength; + } + if (wheel.suspensionLength > maxSuspensionLength) { + wheel.suspensionLength = maxSuspensionLength; + wheel.raycastResult.reset(); + } + + var denominator = wheel.raycastResult.hitNormalWorld.dot(wheel.directionWorld); + + var chassis_velocity_at_contactPoint = new Vec3(); + chassisBody.getVelocityAtWorldPoint(wheel.raycastResult.hitPointWorld, chassis_velocity_at_contactPoint); + + var projVel = wheel.raycastResult.hitNormalWorld.dot( chassis_velocity_at_contactPoint ); + + if (denominator >= -0.1) { + wheel.suspensionRelativeVelocity = 0; + wheel.clippedInvContactDotSuspension = 1 / 0.1; + } else { + var inv = -1 / denominator; + wheel.suspensionRelativeVelocity = projVel * inv; + wheel.clippedInvContactDotSuspension = inv; + } + + } else { + + //put wheel info as in rest position + + wheel.suspensionLength = wheel.suspensionRestLength + 0 * wheel.maxSuspensionTravel; + wheel.suspensionRelativeVelocity = 0.0; + wheel.directionWorld.scale(-1, wheel.raycastResult.hitNormalWorld); + wheel.clippedInvContactDotSuspension = 1.0; + } + + return depth; +}; + +RaycastVehicle.prototype.updateWheelTransformWorld = function(wheel){ + wheel.isInContact = false; + var chassisBody = this.chassisBody; + chassisBody.pointToWorldFrame(wheel.chassisConnectionPointLocal, wheel.chassisConnectionPointWorld); + chassisBody.vectorToWorldFrame(wheel.directionLocal, wheel.directionWorld); + chassisBody.vectorToWorldFrame(wheel.axleLocal, wheel.axleWorld); +}; + + +/** + * Update one of the wheel transform. + * Note when rendering wheels: during each step, wheel transforms are updated BEFORE the chassis; ie. their position becomes invalid after the step. Thus when you render wheels, you must update wheel transforms before rendering them. See raycastVehicle demo for an example. + * @method updateWheelTransform + * @param {integer} wheelIndex The wheel index to update. + */ +RaycastVehicle.prototype.updateWheelTransform = function(wheelIndex){ + var up = tmpVec4; + var right = tmpVec5; + var fwd = tmpVec6; + + var wheel = this.wheelInfos[wheelIndex]; + this.updateWheelTransformWorld(wheel); + + wheel.directionLocal.scale(-1, up); + right.copy(wheel.axleLocal); + up.cross(right, fwd); + fwd.normalize(); + right.normalize(); + + // Rotate around steering over the wheelAxle + var steering = wheel.steering; + var steeringOrn = new Quaternion(); + steeringOrn.setFromAxisAngle(up, steering); + + var rotatingOrn = new Quaternion(); + rotatingOrn.setFromAxisAngle(right, this.lerp(wheel.lastRotation, wheel.rotation, this.world.interpolationFactor)); + + // World rotation of the wheel + var q = wheel.worldTransform.quaternion; + this.chassisBody.quaternion.mult(steeringOrn, q); + q.mult(rotatingOrn, q); + + q.normalize(); + + // world position of the wheel + var p = wheel.worldTransform.position; + p.copy(wheel.directionWorld); + p.scale(this.lerp(wheel.lastSuspensionLength, wheel.suspensionLength, this.world.interpolationFactor), p); + p.vadd(wheel.chassisConnectionPointWorld, p); +}; + +RaycastVehicle.prototype.lerp = function (value1, value2, amount) { + amount = amount < 0 ? 0 : amount; + amount = amount > 1 ? 1 : amount; + return value1 + (value2 - value1) * amount; +} + +var directions = [ + new Vec3(1, 0, 0), + new Vec3(0, 1, 0), + new Vec3(0, 0, 1) +]; + +/** + * Get the world transform of one of the wheels + * @method getWheelTransformWorld + * @param {integer} wheelIndex + * @return {Transform} + */ +RaycastVehicle.prototype.getWheelTransformWorld = function(wheelIndex) { + return this.wheelInfos[wheelIndex].worldTransform; +}; + + +var updateFriction_surfNormalWS_scaled_proj = new Vec3(); +var updateFriction_axle = []; +var updateFriction_forwardWS = []; +var sideFrictionStiffness2 = 1; +RaycastVehicle.prototype.updateFriction = function(timeStep) { + var surfNormalWS_scaled_proj = updateFriction_surfNormalWS_scaled_proj; + + //calculate the impulse, so that the wheels don't move sidewards + var wheelInfos = this.wheelInfos; + var numWheels = wheelInfos.length; + var chassisBody = this.chassisBody; + var forwardWS = updateFriction_forwardWS; + var axle = updateFriction_axle; + + this.numWheelsOnGround = 0; + + for (var i = 0; i < numWheels; i++) { + var wheel = wheelInfos[i]; + + var groundObject = wheel.raycastResult.body; + if (groundObject){ + this.numWheelsOnGround++; + } + + wheel.sideImpulse = 0; + wheel.forwardImpulse = 0; + if(!forwardWS[i]){ + forwardWS[i] = new Vec3(); + } + if(!axle[i]){ + axle[i] = new Vec3(); + } + } + + for (var i = 0; i < numWheels; i++){ + var wheel = wheelInfos[i]; + + var groundObject = wheel.raycastResult.body; + + if (groundObject) { + var axlei = axle[i]; + var wheelTrans = this.getWheelTransformWorld(i); + + // Get world axle + wheelTrans.vectorToWorldFrame(directions[this.indexRightAxis], axlei); + + var surfNormalWS = wheel.raycastResult.hitNormalWorld; + var proj = axlei.dot(surfNormalWS); + surfNormalWS.scale(proj, surfNormalWS_scaled_proj); + axlei.vsub(surfNormalWS_scaled_proj, axlei); + axlei.normalize(); + + surfNormalWS.cross(axlei, forwardWS[i]); + forwardWS[i].normalize(); + + wheel.sideImpulse = resolveSingleBilateral( + chassisBody, + wheel.raycastResult.hitPointWorld, + groundObject, + wheel.raycastResult.hitPointWorld, + axlei + ); + + wheel.sideImpulse *= sideFrictionStiffness2; + } + } + + var sideFactor = 1; + var fwdFactor = 1; + + this.sliding = false; + for (var i = 0; i < numWheels; i++) { + var wheel = wheelInfos[i]; + var groundObject = wheel.raycastResult.body; + + var rollingFriction = 0; + + wheel.slipInfo = 1; + if (groundObject) { + var defaultRollingFrictionImpulse = 0; + var maxImpulse = wheel.brake ? wheel.brake : defaultRollingFrictionImpulse; + + // btWheelContactPoint contactPt(chassisBody,groundObject,wheelInfraycastInfo.hitPointWorld,forwardWS[wheel],maxImpulse); + // rollingFriction = calcRollingFriction(contactPt); + rollingFriction = calcRollingFriction(chassisBody, groundObject, wheel.raycastResult.hitPointWorld, forwardWS[i], maxImpulse); + + rollingFriction += wheel.engineForce * timeStep; + + // rollingFriction = 0; + var factor = maxImpulse / rollingFriction; + wheel.slipInfo *= factor; + } + + //switch between active rolling (throttle), braking and non-active rolling friction (nthrottle/break) + + wheel.forwardImpulse = 0; + wheel.skidInfo = 1; + + if (groundObject) { + wheel.skidInfo = 1; + + var maximp = wheel.suspensionForce * timeStep * wheel.frictionSlip; + var maximpSide = maximp; + + var maximpSquared = maximp * maximpSide; + + wheel.forwardImpulse = rollingFriction;//wheelInfo.engineForce* timeStep; + + var x = wheel.forwardImpulse * fwdFactor; + var y = wheel.sideImpulse * sideFactor; + + var impulseSquared = x * x + y * y; + + wheel.sliding = false; + if (impulseSquared > maximpSquared) { + this.sliding = true; + wheel.sliding = true; + + var factor = maximp / Math.sqrt(impulseSquared); + + wheel.skidInfo *= factor; + } + } + } + + if (this.sliding) { + for (var i = 0; i < numWheels; i++) { + var wheel = wheelInfos[i]; + if (wheel.sideImpulse !== 0) { + if (wheel.skidInfo < 1){ + wheel.forwardImpulse *= wheel.skidInfo; + wheel.sideImpulse *= wheel.skidInfo; + } + } + } + } + + // apply the impulses + for (var i = 0; i < numWheels; i++) { + var wheel = wheelInfos[i]; + + var rel_pos = new Vec3(); + wheel.raycastResult.hitPointWorld.vsub(chassisBody.position, rel_pos); + // cannons applyimpulse is using world coord for the position + //rel_pos.copy(wheel.raycastResult.hitPointWorld); + + if (wheel.forwardImpulse !== 0) { + var impulse = new Vec3(); + forwardWS[i].scale(wheel.forwardImpulse, impulse); + chassisBody.applyImpulse(impulse, rel_pos); + } + + if (wheel.sideImpulse !== 0){ + var groundObject = wheel.raycastResult.body; + + var rel_pos2 = new Vec3(); + wheel.raycastResult.hitPointWorld.vsub(groundObject.position, rel_pos2); + //rel_pos2.copy(wheel.raycastResult.hitPointWorld); + var sideImp = new Vec3(); + axle[i].scale(wheel.sideImpulse, sideImp); + + // Scale the relative position in the up direction with rollInfluence. + // If rollInfluence is 1, the impulse will be applied on the hitPoint (easy to roll over), if it is zero it will be applied in the same plane as the center of mass (not easy to roll over). + chassisBody.vectorToLocalFrame(rel_pos, rel_pos); + rel_pos['xyz'[this.indexUpAxis]] *= wheel.rollInfluence; + chassisBody.vectorToWorldFrame(rel_pos, rel_pos); + chassisBody.applyImpulse(sideImp, rel_pos); + + //apply friction impulse on the ground + sideImp.scale(-1, sideImp); + groundObject.applyImpulse(sideImp, rel_pos2); + } + } +}; + +var calcRollingFriction_vel1 = new Vec3(); +var calcRollingFriction_vel2 = new Vec3(); +var calcRollingFriction_vel = new Vec3(); + +function calcRollingFriction(body0, body1, frictionPosWorld, frictionDirectionWorld, maxImpulse) { + var j1 = 0; + var contactPosWorld = frictionPosWorld; + + // var rel_pos1 = new Vec3(); + // var rel_pos2 = new Vec3(); + var vel1 = calcRollingFriction_vel1; + var vel2 = calcRollingFriction_vel2; + var vel = calcRollingFriction_vel; + // contactPosWorld.vsub(body0.position, rel_pos1); + // contactPosWorld.vsub(body1.position, rel_pos2); + + body0.getVelocityAtWorldPoint(contactPosWorld, vel1); + body1.getVelocityAtWorldPoint(contactPosWorld, vel2); + vel1.vsub(vel2, vel); + + var vrel = frictionDirectionWorld.dot(vel); + + var denom0 = computeImpulseDenominator(body0, frictionPosWorld, frictionDirectionWorld); + var denom1 = computeImpulseDenominator(body1, frictionPosWorld, frictionDirectionWorld); + var relaxation = 1; + var jacDiagABInv = relaxation / (denom0 + denom1); + + // calculate j that moves us to zero relative velocity + j1 = -vrel * jacDiagABInv; + + if (maxImpulse < j1) { + j1 = maxImpulse; + } + if (j1 < -maxImpulse) { + j1 = -maxImpulse; + } + + return j1; +} + +var computeImpulseDenominator_r0 = new Vec3(); +var computeImpulseDenominator_c0 = new Vec3(); +var computeImpulseDenominator_vec = new Vec3(); +var computeImpulseDenominator_m = new Vec3(); +function computeImpulseDenominator(body, pos, normal) { + var r0 = computeImpulseDenominator_r0; + var c0 = computeImpulseDenominator_c0; + var vec = computeImpulseDenominator_vec; + var m = computeImpulseDenominator_m; + + pos.vsub(body.position, r0); + r0.cross(normal, c0); + body.invInertiaWorld.vmult(c0, m); + m.cross(r0, vec); + + return body.invMass + normal.dot(vec); +} + + +var resolveSingleBilateral_vel1 = new Vec3(); +var resolveSingleBilateral_vel2 = new Vec3(); +var resolveSingleBilateral_vel = new Vec3(); + +//bilateral constraint between two dynamic objects +function resolveSingleBilateral(body1, pos1, body2, pos2, normal, impulse){ + var normalLenSqr = normal.norm2(); + if (normalLenSqr > 1.1){ + return 0; // no impulse + } + // var rel_pos1 = new Vec3(); + // var rel_pos2 = new Vec3(); + // pos1.vsub(body1.position, rel_pos1); + // pos2.vsub(body2.position, rel_pos2); + + var vel1 = resolveSingleBilateral_vel1; + var vel2 = resolveSingleBilateral_vel2; + var vel = resolveSingleBilateral_vel; + body1.getVelocityAtWorldPoint(pos1, vel1); + body2.getVelocityAtWorldPoint(pos2, vel2); + + vel1.vsub(vel2, vel); + + var rel_vel = normal.dot(vel); + + var contactDamping = 0.2; + var massTerm = 1 / (body1.invMass + body2.invMass); + var impulse = - contactDamping * rel_vel * massTerm; + + return impulse; +} +},{"../collision/Ray":10,"../collision/RaycastResult":11,"../math/Quaternion":29,"../math/Vec3":31,"../objects/WheelInfo":37,"./Body":32}],34:[function(_dereq_,module,exports){ +var Body = _dereq_('./Body'); +var Sphere = _dereq_('../shapes/Sphere'); +var Box = _dereq_('../shapes/Box'); +var Vec3 = _dereq_('../math/Vec3'); +var HingeConstraint = _dereq_('../constraints/HingeConstraint'); + +module.exports = RigidVehicle; + +/** + * Simple vehicle helper class with spherical rigid body wheels. + * @class RigidVehicle + * @constructor + * @param {Body} [options.chassisBody] + */ +function RigidVehicle(options){ + this.wheelBodies = []; + + /** + * @property coordinateSystem + * @type {Vec3} + */ + this.coordinateSystem = typeof(options.coordinateSystem)==='undefined' ? new Vec3(1, 2, 3) : options.coordinateSystem.clone(); + + /** + * @property {Body} chassisBody + */ + this.chassisBody = options.chassisBody; + + if(!this.chassisBody){ + // No chassis body given. Create it! + var chassisShape = new Box(new Vec3(5, 2, 0.5)); + this.chassisBody = new Body(1, chassisShape); + } + + /** + * @property constraints + * @type {Array} + */ + this.constraints = []; + + this.wheelAxes = []; + this.wheelForces = []; +} + +/** + * Add a wheel + * @method addWheel + * @param {object} options + * @param {boolean} [options.isFrontWheel] + * @param {Vec3} [options.position] Position of the wheel, locally in the chassis body. + * @param {Vec3} [options.direction] Slide direction of the wheel along the suspension. + * @param {Vec3} [options.axis] Axis of rotation of the wheel, locally defined in the chassis. + * @param {Body} [options.body] The wheel body. + */ +RigidVehicle.prototype.addWheel = function(options){ + options = options || {}; + var wheelBody = options.body; + if(!wheelBody){ + wheelBody = new Body(1, new Sphere(1.2)); + } + this.wheelBodies.push(wheelBody); + this.wheelForces.push(0); + + // Position constrain wheels + var zero = new Vec3(); + var position = typeof(options.position) !== 'undefined' ? options.position.clone() : new Vec3(); + + // Set position locally to the chassis + var worldPosition = new Vec3(); + this.chassisBody.pointToWorldFrame(position, worldPosition); + wheelBody.position.set(worldPosition.x, worldPosition.y, worldPosition.z); + + // Constrain wheel + var axis = typeof(options.axis) !== 'undefined' ? options.axis.clone() : new Vec3(0, 1, 0); + this.wheelAxes.push(axis); + + var hingeConstraint = new HingeConstraint(this.chassisBody, wheelBody, { + pivotA: position, + axisA: axis, + pivotB: Vec3.ZERO, + axisB: axis, + collideConnected: false + }); + this.constraints.push(hingeConstraint); + + return this.wheelBodies.length - 1; +}; + +/** + * Set the steering value of a wheel. + * @method setSteeringValue + * @param {number} value + * @param {integer} wheelIndex + * @todo check coordinateSystem + */ +RigidVehicle.prototype.setSteeringValue = function(value, wheelIndex){ + // Set angle of the hinge axis + var axis = this.wheelAxes[wheelIndex]; + + var c = Math.cos(value), + s = Math.sin(value), + x = axis.x, + y = axis.y; + this.constraints[wheelIndex].axisA.set( + c*x -s*y, + s*x +c*y, + 0 + ); +}; + +/** + * Set the target rotational speed of the hinge constraint. + * @method setMotorSpeed + * @param {number} value + * @param {integer} wheelIndex + */ +RigidVehicle.prototype.setMotorSpeed = function(value, wheelIndex){ + var hingeConstraint = this.constraints[wheelIndex]; + hingeConstraint.enableMotor(); + hingeConstraint.motorTargetVelocity = value; +}; + +/** + * Set the target rotational speed of the hinge constraint. + * @method disableMotor + * @param {number} value + * @param {integer} wheelIndex + */ +RigidVehicle.prototype.disableMotor = function(wheelIndex){ + var hingeConstraint = this.constraints[wheelIndex]; + hingeConstraint.disableMotor(); +}; + +var torque = new Vec3(); + +/** + * Set the wheel force to apply on one of the wheels each time step + * @method setWheelForce + * @param {number} value + * @param {integer} wheelIndex + */ +RigidVehicle.prototype.setWheelForce = function(value, wheelIndex){ + this.wheelForces[wheelIndex] = value; +}; + +/** + * Apply a torque on one of the wheels. + * @method applyWheelForce + * @param {number} value + * @param {integer} wheelIndex + */ +RigidVehicle.prototype.applyWheelForce = function(value, wheelIndex){ + var axis = this.wheelAxes[wheelIndex]; + var wheelBody = this.wheelBodies[wheelIndex]; + var bodyTorque = wheelBody.torque; + + axis.scale(value, torque); + wheelBody.vectorToWorldFrame(torque, torque); + bodyTorque.vadd(torque, bodyTorque); +}; + +/** + * Add the vehicle including its constraints to the world. + * @method addToWorld + * @param {World} world + */ +RigidVehicle.prototype.addToWorld = function(world){ + var constraints = this.constraints; + var bodies = this.wheelBodies.concat([this.chassisBody]); + + for (var i = 0; i < bodies.length; i++) { + world.addBody(bodies[i]); + } + + for (var i = 0; i < constraints.length; i++) { + world.addConstraint(constraints[i]); + } + + world.addEventListener('preStep', this._update.bind(this)); +}; + +RigidVehicle.prototype._update = function(){ + var wheelForces = this.wheelForces; + for (var i = 0; i < wheelForces.length; i++) { + this.applyWheelForce(wheelForces[i], i); + } +}; + +/** + * Remove the vehicle including its constraints from the world. + * @method removeFromWorld + * @param {World} world + */ +RigidVehicle.prototype.removeFromWorld = function(world){ + var constraints = this.constraints; + var bodies = this.wheelBodies.concat([this.chassisBody]); + + for (var i = 0; i < bodies.length; i++) { + world.remove(bodies[i]); + } + + for (var i = 0; i < constraints.length; i++) { + world.removeConstraint(constraints[i]); + } +}; + +var worldAxis = new Vec3(); + +/** + * Get current rotational velocity of a wheel + * @method getWheelSpeed + * @param {integer} wheelIndex + */ +RigidVehicle.prototype.getWheelSpeed = function(wheelIndex){ + var axis = this.wheelAxes[wheelIndex]; + var wheelBody = this.wheelBodies[wheelIndex]; + var w = wheelBody.angularVelocity; + this.chassisBody.vectorToWorldFrame(axis, worldAxis); + return w.dot(worldAxis); +}; + +},{"../constraints/HingeConstraint":16,"../math/Vec3":31,"../shapes/Box":38,"../shapes/Sphere":45,"./Body":32}],35:[function(_dereq_,module,exports){ +module.exports = SPHSystem; + +var Shape = _dereq_('../shapes/Shape'); +var Vec3 = _dereq_('../math/Vec3'); +var Quaternion = _dereq_('../math/Quaternion'); +var Particle = _dereq_('../shapes/Particle'); +var Body = _dereq_('../objects/Body'); +var Material = _dereq_('../material/Material'); + +/** + * Smoothed-particle hydrodynamics system + * @class SPHSystem + * @constructor + */ +function SPHSystem(){ + this.particles = []; + + /** + * Density of the system (kg/m3). + * @property {number} density + */ + this.density = 1; + + /** + * Distance below which two particles are considered to be neighbors. + * It should be adjusted so there are about 15-20 neighbor particles within this radius. + * @property {number} smoothingRadius + */ + this.smoothingRadius = 1; + this.speedOfSound = 1; + + /** + * Viscosity of the system. + * @property {number} viscosity + */ + this.viscosity = 0.01; + this.eps = 0.000001; + + // Stuff Computed per particle + this.pressures = []; + this.densities = []; + this.neighbors = []; +} + +/** + * Add a particle to the system. + * @method add + * @param {Body} particle + */ +SPHSystem.prototype.add = function(particle){ + this.particles.push(particle); + if(this.neighbors.length < this.particles.length){ + this.neighbors.push([]); + } +}; + +/** + * Remove a particle from the system. + * @method remove + * @param {Body} particle + */ +SPHSystem.prototype.remove = function(particle){ + var idx = this.particles.indexOf(particle); + if(idx !== -1){ + this.particles.splice(idx,1); + if(this.neighbors.length > this.particles.length){ + this.neighbors.pop(); + } + } +}; + +/** + * Get neighbors within smoothing volume, save in the array neighbors + * @method getNeighbors + * @param {Body} particle + * @param {Array} neighbors + */ +var SPHSystem_getNeighbors_dist = new Vec3(); +SPHSystem.prototype.getNeighbors = function(particle,neighbors){ + var N = this.particles.length, + id = particle.id, + R2 = this.smoothingRadius * this.smoothingRadius, + dist = SPHSystem_getNeighbors_dist; + for(var i=0; i!==N; i++){ + var p = this.particles[i]; + p.position.vsub(particle.position,dist); + if(id!==p.id && dist.norm2() < R2){ + neighbors.push(p); + } + } +}; + +// Temp vectors for calculation +var SPHSystem_update_dist = new Vec3(), + SPHSystem_update_a_pressure = new Vec3(), + SPHSystem_update_a_visc = new Vec3(), + SPHSystem_update_gradW = new Vec3(), + SPHSystem_update_r_vec = new Vec3(), + SPHSystem_update_u = new Vec3(); // Relative velocity +SPHSystem.prototype.update = function(){ + var N = this.particles.length, + dist = SPHSystem_update_dist, + cs = this.speedOfSound, + eps = this.eps; + + for(var i=0; i!==N; i++){ + var p = this.particles[i]; // Current particle + var neighbors = this.neighbors[i]; + + // Get neighbors + neighbors.length = 0; + this.getNeighbors(p,neighbors); + neighbors.push(this.particles[i]); // Add current too + var numNeighbors = neighbors.length; + + // Accumulate density for the particle + var sum = 0.0; + for(var j=0; j!==numNeighbors; j++){ + + //printf("Current particle has position %f %f %f\n",objects[id].pos.x(),objects[id].pos.y(),objects[id].pos.z()); + p.position.vsub(neighbors[j].position, dist); + var len = dist.norm(); + + var weight = this.w(len); + sum += neighbors[j].mass * weight; + } + + // Save + this.densities[i] = sum; + this.pressures[i] = cs * cs * (this.densities[i] - this.density); + } + + // Add forces + + // Sum to these accelerations + var a_pressure= SPHSystem_update_a_pressure; + var a_visc = SPHSystem_update_a_visc; + var gradW = SPHSystem_update_gradW; + var r_vec = SPHSystem_update_r_vec; + var u = SPHSystem_update_u; + + for(var i=0; i!==N; i++){ + + var particle = this.particles[i]; + + a_pressure.set(0,0,0); + a_visc.set(0,0,0); + + // Init vars + var Pij; + var nabla; + var Vij; + + // Sum up for all other neighbors + var neighbors = this.neighbors[i]; + var numNeighbors = neighbors.length; + + //printf("Neighbors: "); + for(var j=0; j!==numNeighbors; j++){ + + var neighbor = neighbors[j]; + //printf("%d ",nj); + + // Get r once for all.. + particle.position.vsub(neighbor.position,r_vec); + var r = r_vec.norm(); + + // Pressure contribution + Pij = -neighbor.mass * (this.pressures[i] / (this.densities[i]*this.densities[i] + eps) + this.pressures[j] / (this.densities[j]*this.densities[j] + eps)); + this.gradw(r_vec, gradW); + // Add to pressure acceleration + gradW.mult(Pij , gradW); + a_pressure.vadd(gradW, a_pressure); + + // Viscosity contribution + neighbor.velocity.vsub(particle.velocity, u); + u.mult( 1.0 / (0.0001+this.densities[i] * this.densities[j]) * this.viscosity * neighbor.mass , u ); + nabla = this.nablaw(r); + u.mult(nabla,u); + // Add to viscosity acceleration + a_visc.vadd( u, a_visc ); + } + + // Calculate force + a_visc.mult(particle.mass, a_visc); + a_pressure.mult(particle.mass, a_pressure); + + // Add force to particles + particle.force.vadd(a_visc, particle.force); + particle.force.vadd(a_pressure, particle.force); + } +}; + +// Calculate the weight using the W(r) weightfunction +SPHSystem.prototype.w = function(r){ + // 315 + var h = this.smoothingRadius; + return 315.0/(64.0*Math.PI*Math.pow(h,9)) * Math.pow(h*h-r*r,3); +}; + +// calculate gradient of the weight function +SPHSystem.prototype.gradw = function(rVec,resultVec){ + var r = rVec.norm(), + h = this.smoothingRadius; + rVec.mult(945.0/(32.0*Math.PI*Math.pow(h,9)) * Math.pow((h*h-r*r),2) , resultVec); +}; + +// Calculate nabla(W) +SPHSystem.prototype.nablaw = function(r){ + var h = this.smoothingRadius; + var nabla = 945.0/(32.0*Math.PI*Math.pow(h,9)) * (h*h-r*r)*(7*r*r - 3*h*h); + return nabla; +}; + +},{"../material/Material":26,"../math/Quaternion":29,"../math/Vec3":31,"../objects/Body":32,"../shapes/Particle":42,"../shapes/Shape":44}],36:[function(_dereq_,module,exports){ +var Vec3 = _dereq_('../math/Vec3'); + +module.exports = Spring; + +/** + * A spring, connecting two bodies. + * + * @class Spring + * @constructor + * @param {Body} bodyA + * @param {Body} bodyB + * @param {Object} [options] + * @param {number} [options.restLength] A number > 0. Default: 1 + * @param {number} [options.stiffness] A number >= 0. Default: 100 + * @param {number} [options.damping] A number >= 0. Default: 1 + * @param {Vec3} [options.worldAnchorA] Where to hook the spring to body A, in world coordinates. + * @param {Vec3} [options.worldAnchorB] + * @param {Vec3} [options.localAnchorA] Where to hook the spring to body A, in local body coordinates. + * @param {Vec3} [options.localAnchorB] + */ +function Spring(bodyA,bodyB,options){ + options = options || {}; + + /** + * Rest length of the spring. + * @property restLength + * @type {number} + */ + this.restLength = typeof(options.restLength) === "number" ? options.restLength : 1; + + /** + * Stiffness of the spring. + * @property stiffness + * @type {number} + */ + this.stiffness = options.stiffness || 100; + + /** + * Damping of the spring. + * @property damping + * @type {number} + */ + this.damping = options.damping || 1; + + /** + * First connected body. + * @property bodyA + * @type {Body} + */ + this.bodyA = bodyA; + + /** + * Second connected body. + * @property bodyB + * @type {Body} + */ + this.bodyB = bodyB; + + /** + * Anchor for bodyA in local bodyA coordinates. + * @property localAnchorA + * @type {Vec3} + */ + this.localAnchorA = new Vec3(); + + /** + * Anchor for bodyB in local bodyB coordinates. + * @property localAnchorB + * @type {Vec3} + */ + this.localAnchorB = new Vec3(); + + if(options.localAnchorA){ + this.localAnchorA.copy(options.localAnchorA); + } + if(options.localAnchorB){ + this.localAnchorB.copy(options.localAnchorB); + } + if(options.worldAnchorA){ + this.setWorldAnchorA(options.worldAnchorA); + } + if(options.worldAnchorB){ + this.setWorldAnchorB(options.worldAnchorB); + } +} + +/** + * Set the anchor point on body A, using world coordinates. + * @method setWorldAnchorA + * @param {Vec3} worldAnchorA + */ +Spring.prototype.setWorldAnchorA = function(worldAnchorA){ + this.bodyA.pointToLocalFrame(worldAnchorA,this.localAnchorA); +}; + +/** + * Set the anchor point on body B, using world coordinates. + * @method setWorldAnchorB + * @param {Vec3} worldAnchorB + */ +Spring.prototype.setWorldAnchorB = function(worldAnchorB){ + this.bodyB.pointToLocalFrame(worldAnchorB,this.localAnchorB); +}; + +/** + * Get the anchor point on body A, in world coordinates. + * @method getWorldAnchorA + * @param {Vec3} result The vector to store the result in. + */ +Spring.prototype.getWorldAnchorA = function(result){ + this.bodyA.pointToWorldFrame(this.localAnchorA,result); +}; + +/** + * Get the anchor point on body B, in world coordinates. + * @method getWorldAnchorB + * @param {Vec3} result The vector to store the result in. + */ +Spring.prototype.getWorldAnchorB = function(result){ + this.bodyB.pointToWorldFrame(this.localAnchorB,result); +}; + +var applyForce_r = new Vec3(), + applyForce_r_unit = new Vec3(), + applyForce_u = new Vec3(), + applyForce_f = new Vec3(), + applyForce_worldAnchorA = new Vec3(), + applyForce_worldAnchorB = new Vec3(), + applyForce_ri = new Vec3(), + applyForce_rj = new Vec3(), + applyForce_ri_x_f = new Vec3(), + applyForce_rj_x_f = new Vec3(), + applyForce_tmp = new Vec3(); + +/** + * Apply the spring force to the connected bodies. + * @method applyForce + */ +Spring.prototype.applyForce = function(){ + var k = this.stiffness, + d = this.damping, + l = this.restLength, + bodyA = this.bodyA, + bodyB = this.bodyB, + r = applyForce_r, + r_unit = applyForce_r_unit, + u = applyForce_u, + f = applyForce_f, + tmp = applyForce_tmp; + + var worldAnchorA = applyForce_worldAnchorA, + worldAnchorB = applyForce_worldAnchorB, + ri = applyForce_ri, + rj = applyForce_rj, + ri_x_f = applyForce_ri_x_f, + rj_x_f = applyForce_rj_x_f; + + // Get world anchors + this.getWorldAnchorA(worldAnchorA); + this.getWorldAnchorB(worldAnchorB); + + // Get offset points + worldAnchorA.vsub(bodyA.position,ri); + worldAnchorB.vsub(bodyB.position,rj); + + // Compute distance vector between world anchor points + worldAnchorB.vsub(worldAnchorA,r); + var rlen = r.norm(); + r_unit.copy(r); + r_unit.normalize(); + + // Compute relative velocity of the anchor points, u + bodyB.velocity.vsub(bodyA.velocity,u); + // Add rotational velocity + + bodyB.angularVelocity.cross(rj,tmp); + u.vadd(tmp,u); + bodyA.angularVelocity.cross(ri,tmp); + u.vsub(tmp,u); + + // F = - k * ( x - L ) - D * ( u ) + r_unit.mult(-k*(rlen-l) - d*u.dot(r_unit), f); + + // Add forces to bodies + bodyA.force.vsub(f,bodyA.force); + bodyB.force.vadd(f,bodyB.force); + + // Angular force + ri.cross(f,ri_x_f); + rj.cross(f,rj_x_f); + bodyA.torque.vsub(ri_x_f,bodyA.torque); + bodyB.torque.vadd(rj_x_f,bodyB.torque); +}; + +},{"../math/Vec3":31}],37:[function(_dereq_,module,exports){ +var Vec3 = _dereq_('../math/Vec3'); +var Transform = _dereq_('../math/Transform'); +var RaycastResult = _dereq_('../collision/RaycastResult'); +var Utils = _dereq_('../utils/Utils'); + +module.exports = WheelInfo; + +/** + * @class WheelInfo + * @constructor + * @param {Object} [options] + * + * @param {Vec3} [options.chassisConnectionPointLocal] + * @param {Vec3} [options.chassisConnectionPointWorld] + * @param {Vec3} [options.directionLocal] + * @param {Vec3} [options.directionWorld] + * @param {Vec3} [options.axleLocal] + * @param {Vec3} [options.axleWorld] + * @param {number} [options.suspensionRestLength=1] + * @param {number} [options.suspensionMaxLength=2] + * @param {number} [options.radius=1] + * @param {number} [options.suspensionStiffness=100] + * @param {number} [options.dampingCompression=10] + * @param {number} [options.dampingRelaxation=10] + * @param {number} [options.frictionSlip=10000] + * @param {number} [options.steering=0] + * @param {number} [options.rotation=0] + * @param {number} [options.deltaRotation=0] + * @param {number} [options.rollInfluence=0.01] + * @param {number} [options.maxSuspensionForce] + * @param {boolean} [options.isFrontWheel=true] + * @param {number} [options.clippedInvContactDotSuspension=1] + * @param {number} [options.suspensionRelativeVelocity=0] + * @param {number} [options.suspensionForce=0] + * @param {number} [options.skidInfo=0] + * @param {number} [options.suspensionLength=0] + * @param {number} [options.maxSuspensionTravel=1] + * @param {boolean} [options.useCustomSlidingRotationalSpeed=false] + * @param {number} [options.customSlidingRotationalSpeed=-0.1] + */ +function WheelInfo(options){ + options = Utils.defaults(options, { + chassisConnectionPointLocal: new Vec3(), + chassisConnectionPointWorld: new Vec3(), + directionLocal: new Vec3(), + directionWorld: new Vec3(), + axleLocal: new Vec3(), + axleWorld: new Vec3(), + suspensionRestLength: 1, + suspensionMaxLength: 2, + radius: 1, + suspensionStiffness: 100, + dampingCompression: 10, + dampingRelaxation: 10, + frictionSlip: 1, + steering: 0, + rotation: 0, + deltaRotation: 0, + rollInfluence: 1, + maxSuspensionForce: Number.MAX_VALUE, + isFrontWheel: true, + clippedInvContactDotSuspension: 1, + suspensionRelativeVelocity: 0, + suspensionForce: 0, + skidInfo: 0, + suspensionLength: 0, + maxSuspensionTravel: 1, + useCustomSlidingRotationalSpeed: false, + customSlidingRotationalSpeed: -0.1 + }); + + /** + * Max travel distance of the suspension, in meters. + * @property {number} maxSuspensionTravel + */ + this.maxSuspensionTravel = options.maxSuspensionTravel; + + /** + * Speed to apply to the wheel rotation when the wheel is sliding. + * @property {number} customSlidingRotationalSpeed + */ + this.customSlidingRotationalSpeed = options.customSlidingRotationalSpeed; + + /** + * If the customSlidingRotationalSpeed should be used. + * @property {Boolean} useCustomSlidingRotationalSpeed + */ + this.useCustomSlidingRotationalSpeed = options.useCustomSlidingRotationalSpeed; + + /** + * @property {Boolean} sliding + */ + this.sliding = false; + + /** + * Connection point, defined locally in the chassis body frame. + * @property {Vec3} chassisConnectionPointLocal + */ + this.chassisConnectionPointLocal = options.chassisConnectionPointLocal.clone(); + + /** + * @property {Vec3} chassisConnectionPointWorld + */ + this.chassisConnectionPointWorld = options.chassisConnectionPointWorld.clone(); + + /** + * @property {Vec3} directionLocal + */ + this.directionLocal = options.directionLocal.clone(); + + /** + * @property {Vec3} directionWorld + */ + this.directionWorld = options.directionWorld.clone(); + + /** + * @property {Vec3} axleLocal + */ + this.axleLocal = options.axleLocal.clone(); + + /** + * @property {Vec3} axleWorld + */ + this.axleWorld = options.axleWorld.clone(); + + /** + * @property {number} suspensionRestLength + */ + this.suspensionRestLength = options.suspensionRestLength; + + /** + * @property {number} suspensionMaxLength + */ + this.suspensionMaxLength = options.suspensionMaxLength; + + /** + * @property {number} radius + */ + this.radius = options.radius; + + /** + * @property {number} suspensionStiffness + */ + this.suspensionStiffness = options.suspensionStiffness; + + /** + * @property {number} dampingCompression + */ + this.dampingCompression = options.dampingCompression; + + /** + * @property {number} dampingRelaxation + */ + this.dampingRelaxation = options.dampingRelaxation; + + /** + * @property {number} frictionSlip + */ + this.frictionSlip = options.frictionSlip; + + /** + * @property {number} steering + */ + this.steering = 0; + + /** + * Rotation value, in radians. + * @property {number} rotation + */ + this.rotation = 0; + + /** + * Rotation value, in radians. + * @property {number} lastRotation + */ + this.lastRotation = 0; + + /** + * @property {number} deltaRotation + */ + this.deltaRotation = 0; + + /** + * @property {number} rollInfluence + */ + this.rollInfluence = options.rollInfluence; + + /** + * @property {number} maxSuspensionForce + */ + this.maxSuspensionForce = options.maxSuspensionForce; + + /** + * @property {number} engineForce + */ + this.engineForce = 0; + + /** + * @property {number} brake + */ + this.brake = 0; + + /** + * @property {number} isFrontWheel + */ + this.isFrontWheel = options.isFrontWheel; + + /** + * @property {number} clippedInvContactDotSuspension + */ + this.clippedInvContactDotSuspension = 1; + + /** + * @property {number} suspensionRelativeVelocity + */ + this.suspensionRelativeVelocity = 0; + + /** + * @property {number} suspensionForce + */ + this.suspensionForce = 0; + + /** + * @property {number} skidInfo + */ + this.skidInfo = 0; + + /** + * @property {number} suspensionLength + */ + this.suspensionLength = 0; + + /** + * @property {number} lastSuspensionLength + */ + this.lastSuspensionLength = 0; + + /** + * @property {number} sideImpulse + */ + this.sideImpulse = 0; + + /** + * @property {number} forwardImpulse + */ + this.forwardImpulse = 0; + + /** + * The result from raycasting + * @property {RaycastResult} raycastResult + */ + this.raycastResult = new RaycastResult(); + + /** + * Wheel world transform + * @property {Transform} worldTransform + */ + this.worldTransform = new Transform(); + + /** + * @property {boolean} isInContact + */ + this.isInContact = false; +} + +var chassis_velocity_at_contactPoint = new Vec3(); +var relpos = new Vec3(); +var chassis_velocity_at_contactPoint = new Vec3(); +WheelInfo.prototype.updateWheel = function(chassis){ + var raycastResult = this.raycastResult; + + if (this.isInContact){ + var project= raycastResult.hitNormalWorld.dot(raycastResult.directionWorld); + raycastResult.hitPointWorld.vsub(chassis.position, relpos); + chassis.getVelocityAtWorldPoint(relpos, chassis_velocity_at_contactPoint); + var projVel = raycastResult.hitNormalWorld.dot( chassis_velocity_at_contactPoint ); + if (project >= -0.1) { + this.suspensionRelativeVelocity = 0.0; + this.clippedInvContactDotSuspension = 1.0 / 0.1; + } else { + var inv = -1 / project; + this.suspensionRelativeVelocity = projVel * inv; + this.clippedInvContactDotSuspension = inv; + } + + } else { + // Not in contact : position wheel in a nice (rest length) position + raycastResult.suspensionLength = this.suspensionRestLength; + this.suspensionRelativeVelocity = 0.0; + raycastResult.directionWorld.scale(-1, raycastResult.hitNormalWorld); + this.clippedInvContactDotSuspension = 1.0; + } +}; +},{"../collision/RaycastResult":11,"../math/Transform":30,"../math/Vec3":31,"../utils/Utils":54}],38:[function(_dereq_,module,exports){ +module.exports = Box; + +var Shape = _dereq_('./Shape'); +var Vec3 = _dereq_('../math/Vec3'); +var ConvexPolyhedron = _dereq_('./ConvexPolyhedron'); + +/** + * A 3d box shape. + * @class Box + * @constructor + * @param {Vec3} halfExtents + * @author schteppe + * @extends Shape + */ +function Box(halfExtents){ + Shape.call(this, { + type: Shape.types.BOX + }); + + /** + * @property halfExtents + * @type {Vec3} + */ + this.halfExtents = halfExtents; + + /** + * Used by the contact generator to make contacts with other convex polyhedra for example + * @property convexPolyhedronRepresentation + * @type {ConvexPolyhedron} + */ + this.convexPolyhedronRepresentation = null; + + this.updateConvexPolyhedronRepresentation(); + this.updateBoundingSphereRadius(); +} +Box.prototype = new Shape(); +Box.prototype.constructor = Box; + +/** + * Updates the local convex polyhedron representation used for some collisions. + * @method updateConvexPolyhedronRepresentation + */ +Box.prototype.updateConvexPolyhedronRepresentation = function(){ + var sx = this.halfExtents.x; + var sy = this.halfExtents.y; + var sz = this.halfExtents.z; + var V = Vec3; + + var vertices = [ + new V(-sx,-sy,-sz), + new V( sx,-sy,-sz), + new V( sx, sy,-sz), + new V(-sx, sy,-sz), + new V(-sx,-sy, sz), + new V( sx,-sy, sz), + new V( sx, sy, sz), + new V(-sx, sy, sz) + ]; + + var indices = [ + [3,2,1,0], // -z + [4,5,6,7], // +z + [5,4,0,1], // -y + [2,3,7,6], // +y + [0,4,7,3], // -x + [1,2,6,5], // +x + ]; + + var axes = [ + new V(0, 0, 1), + new V(0, 1, 0), + new V(1, 0, 0) + ]; + + var h = new ConvexPolyhedron(vertices, indices); + this.convexPolyhedronRepresentation = h; + h.material = this.material; +}; + +/** + * @method calculateLocalInertia + * @param {Number} mass + * @param {Vec3} target + * @return {Vec3} + */ +Box.prototype.calculateLocalInertia = function(mass,target){ + target = target || new Vec3(); + Box.calculateInertia(this.halfExtents, mass, target); + return target; +}; + +Box.calculateInertia = function(halfExtents,mass,target){ + var e = halfExtents; + target.x = 1.0 / 12.0 * mass * ( 2*e.y*2*e.y + 2*e.z*2*e.z ); + target.y = 1.0 / 12.0 * mass * ( 2*e.x*2*e.x + 2*e.z*2*e.z ); + target.z = 1.0 / 12.0 * mass * ( 2*e.y*2*e.y + 2*e.x*2*e.x ); +}; + +/** + * Get the box 6 side normals + * @method getSideNormals + * @param {array} sixTargetVectors An array of 6 vectors, to store the resulting side normals in. + * @param {Quaternion} quat Orientation to apply to the normal vectors. If not provided, the vectors will be in respect to the local frame. + * @return {array} + */ +Box.prototype.getSideNormals = function(sixTargetVectors,quat){ + var sides = sixTargetVectors; + var ex = this.halfExtents; + sides[0].set( ex.x, 0, 0); + sides[1].set( 0, ex.y, 0); + sides[2].set( 0, 0, ex.z); + sides[3].set( -ex.x, 0, 0); + sides[4].set( 0, -ex.y, 0); + sides[5].set( 0, 0, -ex.z); + + if(quat!==undefined){ + for(var i=0; i!==sides.length; i++){ + quat.vmult(sides[i],sides[i]); + } + } + + return sides; +}; + +Box.prototype.volume = function(){ + return 8.0 * this.halfExtents.x * this.halfExtents.y * this.halfExtents.z; +}; + +Box.prototype.updateBoundingSphereRadius = function(){ + this.boundingSphereRadius = this.halfExtents.norm(); +}; + +var worldCornerTempPos = new Vec3(); +var worldCornerTempNeg = new Vec3(); +Box.prototype.forEachWorldCorner = function(pos,quat,callback){ + + var e = this.halfExtents; + var corners = [[ e.x, e.y, e.z], + [ -e.x, e.y, e.z], + [ -e.x, -e.y, e.z], + [ -e.x, -e.y, -e.z], + [ e.x, -e.y, -e.z], + [ e.x, e.y, -e.z], + [ -e.x, e.y, -e.z], + [ e.x, -e.y, e.z]]; + for(var i=0; i max.x){ + max.x = x; + } + if(y > max.y){ + max.y = y; + } + if(z > max.z){ + max.z = z; + } + + if(x < min.x){ + min.x = x; + } + if(y < min.y){ + min.y = y; + } + if(z < min.z){ + min.z = z; + } + } + + // Get each axis max + // min.set(Infinity,Infinity,Infinity); + // max.set(-Infinity,-Infinity,-Infinity); + // this.forEachWorldCorner(pos,quat,function(x,y,z){ + // if(x > max.x){ + // max.x = x; + // } + // if(y > max.y){ + // max.y = y; + // } + // if(z > max.z){ + // max.z = z; + // } + + // if(x < min.x){ + // min.x = x; + // } + // if(y < min.y){ + // min.y = y; + // } + // if(z < min.z){ + // min.z = z; + // } + // }); +}; + +},{"../math/Vec3":31,"./ConvexPolyhedron":39,"./Shape":44}],39:[function(_dereq_,module,exports){ +module.exports = ConvexPolyhedron; + +var Shape = _dereq_('./Shape'); +var Vec3 = _dereq_('../math/Vec3'); +var Quaternion = _dereq_('../math/Quaternion'); +var Transform = _dereq_('../math/Transform'); + +/** + * A set of polygons describing a convex shape. + * @class ConvexPolyhedron + * @constructor + * @extends Shape + * @description The shape MUST be convex for the code to work properly. No polygons may be coplanar (contained + * in the same 3D plane), instead these should be merged into one polygon. + * + * @param {array} points An array of Vec3's + * @param {array} faces Array of integer arrays, describing which vertices that is included in each face. + * + * @author qiao / https://github.com/qiao (original author, see https://github.com/qiao/three.js/commit/85026f0c769e4000148a67d45a9e9b9c5108836f) + * @author schteppe / https://github.com/schteppe + * @see http://www.altdevblogaday.com/2011/05/13/contact-generation-between-3d-convex-meshes/ + * @see http://bullet.googlecode.com/svn/trunk/src/BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp + * + * @todo Move the clipping functions to ContactGenerator? + * @todo Automatically merge coplanar polygons in constructor. + */ +function ConvexPolyhedron(points, faces, uniqueAxes) { + Shape.call(this, { + type: Shape.types.CONVEXPOLYHEDRON + }); + + /** + * Array of Vec3 + * @property vertices + * @type {Array} + */ + this.vertices = points||[]; + + this.worldVertices = []; // World transformed version of .vertices + this.worldVerticesNeedsUpdate = true; + + /** + * Array of integer arrays, indicating which vertices each face consists of + * @property faces + * @type {Array} + */ + this.faces = faces||[]; + + /** + * Array of Vec3 + * @property faceNormals + * @type {Array} + */ + this.faceNormals = []; + this.computeNormals(); + + this.worldFaceNormalsNeedsUpdate = true; + this.worldFaceNormals = []; // World transformed version of .faceNormals + + /** + * Array of Vec3 + * @property uniqueEdges + * @type {Array} + */ + this.uniqueEdges = []; + + /** + * If given, these locally defined, normalized axes are the only ones being checked when doing separating axis check. + * @property {Array} uniqueAxes + */ + this.uniqueAxes = uniqueAxes ? uniqueAxes.slice() : null; + + this.computeEdges(); + this.updateBoundingSphereRadius(); +} +ConvexPolyhedron.prototype = new Shape(); +ConvexPolyhedron.prototype.constructor = ConvexPolyhedron; + +var computeEdges_tmpEdge = new Vec3(); +/** + * Computes uniqueEdges + * @method computeEdges + */ +ConvexPolyhedron.prototype.computeEdges = function(){ + var faces = this.faces; + var vertices = this.vertices; + var nv = vertices.length; + var edges = this.uniqueEdges; + + edges.length = 0; + + var edge = computeEdges_tmpEdge; + + for(var i=0; i !== faces.length; i++){ + var face = faces[i]; + var numVertices = face.length; + for(var j = 0; j !== numVertices; j++){ + var k = ( j+1 ) % numVertices; + vertices[face[j]].vsub(vertices[face[k]], edge); + edge.normalize(); + var found = false; + for(var p=0; p !== edges.length; p++){ + if (edges[p].almostEquals(edge) || edges[p].almostEquals(edge)){ + found = true; + break; + } + } + + if (!found){ + edges.push(edge.clone()); + } + } + } +}; + +/** + * Compute the normals of the faces. Will reuse existing Vec3 objects in the .faceNormals array if they exist. + * @method computeNormals + */ +ConvexPolyhedron.prototype.computeNormals = function(){ + this.faceNormals.length = this.faces.length; + + // Generate normals + for(var i=0; i dmax){ + dmax = d; + closestFaceB = face; + } + } + var worldVertsB1 = []; + var polyB = hullB.faces[closestFaceB]; + var numVertices = polyB.length; + for(var e0=0; e0=0){ + this.clipFaceAgainstHull(separatingNormal, + posA, + quatA, + worldVertsB1, + minDist, + maxDist, + result); + } +}; + +/** + * Find the separating axis between this hull and another + * @method findSeparatingAxis + * @param {ConvexPolyhedron} hullB + * @param {Vec3} posA + * @param {Quaternion} quatA + * @param {Vec3} posB + * @param {Quaternion} quatB + * @param {Vec3} target The target vector to save the axis in + * @return {bool} Returns false if a separation is found, else true + */ +var fsa_faceANormalWS3 = new Vec3(), + fsa_Worldnormal1 = new Vec3(), + fsa_deltaC = new Vec3(), + fsa_worldEdge0 = new Vec3(), + fsa_worldEdge1 = new Vec3(), + fsa_Cross = new Vec3(); +ConvexPolyhedron.prototype.findSeparatingAxis = function(hullB,posA,quatA,posB,quatB,target, faceListA, faceListB){ + var faceANormalWS3 = fsa_faceANormalWS3, + Worldnormal1 = fsa_Worldnormal1, + deltaC = fsa_deltaC, + worldEdge0 = fsa_worldEdge0, + worldEdge1 = fsa_worldEdge1, + Cross = fsa_Cross; + + var dmin = Number.MAX_VALUE; + var hullA = this; + var curPlaneTests=0; + + if(!hullA.uniqueAxes){ + + var numFacesA = faceListA ? faceListA.length : hullA.faces.length; + + // Test face normals from hullA + for(var i=0; i0.0){ + target.negate(target); + } + + return true; +}; + +var maxminA=[], maxminB=[]; + +/** + * Test separating axis against two hulls. Both hulls are projected onto the axis and the overlap size is returned if there is one. + * @method testSepAxis + * @param {Vec3} axis + * @param {ConvexPolyhedron} hullB + * @param {Vec3} posA + * @param {Quaternion} quatA + * @param {Vec3} posB + * @param {Quaternion} quatB + * @return {number} The overlap depth, or FALSE if no penetration. + */ +ConvexPolyhedron.prototype.testSepAxis = function(axis, hullB, posA, quatA, posB, quatB){ + var hullA=this; + ConvexPolyhedron.project(hullA, axis, posA, quatA, maxminA); + ConvexPolyhedron.project(hullB, axis, posB, quatB, maxminB); + var maxA = maxminA[0]; + var minA = maxminA[1]; + var maxB = maxminB[0]; + var minB = maxminB[1]; + if(maxA= 0, so output intersection + var newv = new Vec3(); + firstVertex.lerp(lastVertex, + n_dot_first / (n_dot_first - n_dot_last), + newv); + outVertices.push(newv); + } + } else { + if(n_dot_last<0){ + // Start >= 0, end < 0 so output intersection and end + var newv = new Vec3(); + firstVertex.lerp(lastVertex, + n_dot_first / (n_dot_first - n_dot_last), + newv); + outVertices.push(newv); + outVertices.push(lastVertex); + } + } + firstVertex = lastVertex; + n_dot_first = n_dot_last; + } + return outVertices; +}; + +// Updates .worldVertices and sets .worldVerticesNeedsUpdate to false. +ConvexPolyhedron.prototype.computeWorldVertices = function(position,quat){ + var N = this.vertices.length; + while(this.worldVertices.length < N){ + this.worldVertices.push( new Vec3() ); + } + + var verts = this.vertices, + worldVerts = this.worldVertices; + for(var i=0; i!==N; i++){ + quat.vmult( verts[i] , worldVerts[i] ); + position.vadd( worldVerts[i] , worldVerts[i] ); + } + + this.worldVerticesNeedsUpdate = false; +}; + +var computeLocalAABB_worldVert = new Vec3(); +ConvexPolyhedron.prototype.computeLocalAABB = function(aabbmin,aabbmax){ + var n = this.vertices.length, + vertices = this.vertices, + worldVert = computeLocalAABB_worldVert; + + aabbmin.set(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE); + aabbmax.set(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE); + + for(var i=0; i aabbmax.x){ + aabbmax.x = v.x; + } + if (v.y < aabbmin.y){ + aabbmin.y = v.y; + } else if(v.y > aabbmax.y){ + aabbmax.y = v.y; + } + if (v.z < aabbmin.z){ + aabbmin.z = v.z; + } else if(v.z > aabbmax.z){ + aabbmax.z = v.z; + } + } +}; + +/** + * Updates .worldVertices and sets .worldVerticesNeedsUpdate to false. + * @method computeWorldFaceNormals + * @param {Quaternion} quat + */ +ConvexPolyhedron.prototype.computeWorldFaceNormals = function(quat){ + var N = this.faceNormals.length; + while(this.worldFaceNormals.length < N){ + this.worldFaceNormals.push( new Vec3() ); + } + + var normals = this.faceNormals, + worldNormals = this.worldFaceNormals; + for(var i=0; i!==N; i++){ + quat.vmult( normals[i] , worldNormals[i] ); + } + + this.worldFaceNormalsNeedsUpdate = false; +}; + +/** + * @method updateBoundingSphereRadius + */ +ConvexPolyhedron.prototype.updateBoundingSphereRadius = function(){ + // Assume points are distributed with local (0,0,0) as center + var max2 = 0; + var verts = this.vertices; + for(var i=0, N=verts.length; i!==N; i++) { + var norm2 = verts[i].norm2(); + if(norm2 > max2){ + max2 = norm2; + } + } + this.boundingSphereRadius = Math.sqrt(max2); +}; + +var tempWorldVertex = new Vec3(); + +/** + * @method calculateWorldAABB + * @param {Vec3} pos + * @param {Quaternion} quat + * @param {Vec3} min + * @param {Vec3} max + */ +ConvexPolyhedron.prototype.calculateWorldAABB = function(pos,quat,min,max){ + var n = this.vertices.length, verts = this.vertices; + var minx,miny,minz,maxx,maxy,maxz; + for(var i=0; i maxx || maxx===undefined){ + maxx = v.x; + } + + if (v.y < miny || miny===undefined){ + miny = v.y; + } + + if(v.y > maxy || maxy===undefined){ + maxy = v.y; + } + + if (v.z < minz || minz===undefined){ + minz = v.z; + } + + if(v.z > maxz || maxz===undefined){ + maxz = v.z; + } + } + min.set(minx,miny,minz); + max.set(maxx,maxy,maxz); +}; + +/** + * Get approximate convex volume + * @method volume + * @return {Number} + */ +ConvexPolyhedron.prototype.volume = function(){ + return 4.0 * Math.PI * this.boundingSphereRadius / 3.0; +}; + +/** + * Get an average of all the vertices positions + * @method getAveragePointLocal + * @param {Vec3} target + * @return {Vec3} + */ +ConvexPolyhedron.prototype.getAveragePointLocal = function(target){ + target = target || new Vec3(); + var n = this.vertices.length, + verts = this.vertices; + for(var i=0; i0) || (r1>0 && r2<0)){ + return false; // Encountered some other sign. Exit. + } else { + } + } + + // If we got here, all dot products were of the same sign. + return positiveResult ? 1 : -1; +}; + +/** + * Get max and min dot product of a convex hull at position (pos,quat) projected onto an axis. Results are saved in the array maxmin. + * @static + * @method project + * @param {ConvexPolyhedron} hull + * @param {Vec3} axis + * @param {Vec3} pos + * @param {Quaternion} quat + * @param {array} result result[0] and result[1] will be set to maximum and minimum, respectively. + */ +var project_worldVertex = new Vec3(); +var project_localAxis = new Vec3(); +var project_localOrigin = new Vec3(); +ConvexPolyhedron.project = function(hull, axis, pos, quat, result){ + var n = hull.vertices.length, + worldVertex = project_worldVertex, + localAxis = project_localAxis, + max = 0, + min = 0, + localOrigin = project_localOrigin, + vs = hull.vertices; + + localOrigin.setZero(); + + // Transform the axis to local + Transform.vectorToLocalFrame(pos, quat, axis, localAxis); + Transform.pointToLocalFrame(pos, quat, localOrigin, localOrigin); + var add = localOrigin.dot(localAxis); + + min = max = vs[0].dot(localAxis); + + for(var i = 1; i < n; i++){ + var val = vs[i].dot(localAxis); + + if(val > max){ + max = val; + } + + if(val < min){ + min = val; + } + } + + min -= add; + max -= add; + + if(min > max){ + // Inconsistent - swap + var temp = min; + min = max; + max = temp; + } + // Output + result[0] = max; + result[1] = min; +}; + +},{"../math/Quaternion":29,"../math/Transform":30,"../math/Vec3":31,"./Shape":44}],40:[function(_dereq_,module,exports){ +module.exports = Cylinder; + +var Shape = _dereq_('./Shape'); +var Vec3 = _dereq_('../math/Vec3'); +var Quaternion = _dereq_('../math/Quaternion'); +var ConvexPolyhedron = _dereq_('./ConvexPolyhedron'); + +/** + * @class Cylinder + * @constructor + * @extends ConvexPolyhedron + * @author schteppe / https://github.com/schteppe + * @param {Number} radiusTop + * @param {Number} radiusBottom + * @param {Number} height + * @param {Number} numSegments The number of segments to build the cylinder out of + */ +function Cylinder( radiusTop, radiusBottom, height , numSegments ) { + var N = numSegments, + verts = [], + axes = [], + faces = [], + bottomface = [], + topface = [], + cos = Math.cos, + sin = Math.sin; + + // First bottom point + verts.push(new Vec3(radiusBottom*cos(0), + radiusBottom*sin(0), + -height*0.5)); + bottomface.push(0); + + // First top point + verts.push(new Vec3(radiusTop*cos(0), + radiusTop*sin(0), + height*0.5)); + topface.push(1); + + for(var i=0; i { convex: ..., offset: ... } + // for example: + // _cachedPillars["0_2_1"] + this._cachedPillars = {}; +} +Heightfield.prototype = new Shape(); + +/** + * Call whenever you change the data array. + * @method update + */ +Heightfield.prototype.update = function(){ + this._cachedPillars = {}; +}; + +/** + * Update the .minValue property + * @method updateMinValue + */ +Heightfield.prototype.updateMinValue = function(){ + var data = this.data; + var minValue = data[0][0]; + for(var i=0; i !== data.length; i++){ + for(var j=0; j !== data[i].length; j++){ + var v = data[i][j]; + if(v < minValue){ + minValue = v; + } + } + } + this.minValue = minValue; +}; + +/** + * Update the .maxValue property + * @method updateMaxValue + */ +Heightfield.prototype.updateMaxValue = function(){ + var data = this.data; + var maxValue = data[0][0]; + for(var i=0; i !== data.length; i++){ + for(var j=0; j !== data[i].length; j++){ + var v = data[i][j]; + if(v > maxValue){ + maxValue = v; + } + } + } + this.maxValue = maxValue; +}; + +/** + * Set the height value at an index. Don't forget to update maxValue and minValue after you're done. + * @method setHeightValueAtIndex + * @param {integer} xi + * @param {integer} yi + * @param {number} value + */ +Heightfield.prototype.setHeightValueAtIndex = function(xi, yi, value){ + var data = this.data; + data[xi][yi] = value; + + // Invalidate cache + this.clearCachedConvexTrianglePillar(xi, yi, false); + if(xi > 0){ + this.clearCachedConvexTrianglePillar(xi - 1, yi, true); + this.clearCachedConvexTrianglePillar(xi - 1, yi, false); + } + if(yi > 0){ + this.clearCachedConvexTrianglePillar(xi, yi - 1, true); + this.clearCachedConvexTrianglePillar(xi, yi - 1, false); + } + if(yi > 0 && xi > 0){ + this.clearCachedConvexTrianglePillar(xi - 1, yi - 1, true); + } +}; + +/** + * Get max/min in a rectangle in the matrix data + * @method getRectMinMax + * @param {integer} iMinX + * @param {integer} iMinY + * @param {integer} iMaxX + * @param {integer} iMaxY + * @param {array} [result] An array to store the results in. + * @return {array} The result array, if it was passed in. Minimum will be at position 0 and max at 1. + */ +Heightfield.prototype.getRectMinMax = function (iMinX, iMinY, iMaxX, iMaxY, result) { + result = result || []; + + // Get max and min of the data + var data = this.data, + max = this.minValue; // Set first value + for(var i = iMinX; i <= iMaxX; i++){ + for(var j = iMinY; j <= iMaxY; j++){ + var height = data[i][j]; + if(height > max){ + max = height; + } + } + } + + result[0] = this.minValue; + result[1] = max; +}; + + + +/** + * Get the index of a local position on the heightfield. The indexes indicate the rectangles, so if your terrain is made of N x N height data points, you will have rectangle indexes ranging from 0 to N-1. + * @method getIndexOfPosition + * @param {number} x + * @param {number} y + * @param {array} result Two-element array + * @param {boolean} clamp If the position should be clamped to the heightfield edge. + * @return {boolean} + */ +Heightfield.prototype.getIndexOfPosition = function (x, y, result, clamp) { + + // Get the index of the data points to test against + var w = this.elementSize; + var data = this.data; + var xi = Math.floor(x / w); + var yi = Math.floor(y / w); + + result[0] = xi; + result[1] = yi; + + if(clamp){ + // Clamp index to edges + if(xi < 0){ xi = 0; } + if(yi < 0){ yi = 0; } + if(xi >= data.length - 1){ xi = data.length - 1; } + if(yi >= data[0].length - 1){ yi = data[0].length - 1; } + } + + // Bail out if we are out of the terrain + if(xi < 0 || yi < 0 || xi >= data.length-1 || yi >= data[0].length-1){ + return false; + } + + return true; +}; + + +var getHeightAt_idx = []; +var getHeightAt_weights = new Vec3(); +var getHeightAt_a = new Vec3(); +var getHeightAt_b = new Vec3(); +var getHeightAt_c = new Vec3(); + +Heightfield.prototype.getTriangleAt = function(x, y, edgeClamp, a, b, c){ + var idx = getHeightAt_idx; + this.getIndexOfPosition(x, y, idx, edgeClamp); + var xi = idx[0]; + var yi = idx[1]; + + var data = this.data; + if(edgeClamp){ + xi = Math.min(data.length - 2, Math.max(0, xi)); + yi = Math.min(data[0].length - 2, Math.max(0, yi)); + } + + var elementSize = this.elementSize; + var lowerDist2 = Math.pow(x / elementSize - xi, 2) + Math.pow(y / elementSize - yi, 2); + var upperDist2 = Math.pow(x / elementSize - (xi + 1), 2) + Math.pow(y / elementSize - (yi + 1), 2); + var upper = lowerDist2 > upperDist2; + this.getTriangle(xi, yi, upper, a, b, c); + return upper; +}; + +var getNormalAt_a = new Vec3(); +var getNormalAt_b = new Vec3(); +var getNormalAt_c = new Vec3(); +var getNormalAt_e0 = new Vec3(); +var getNormalAt_e1 = new Vec3(); +Heightfield.prototype.getNormalAt = function(x, y, edgeClamp, result){ + var a = getNormalAt_a; + var b = getNormalAt_b; + var c = getNormalAt_c; + var e0 = getNormalAt_e0; + var e1 = getNormalAt_e1; + this.getTriangleAt(x, y, edgeClamp, a, b, c); + b.vsub(a, e0); + c.vsub(a, e1); + e0.cross(e1, result); + result.normalize(); +}; + + +/** + * Get an AABB of a square in the heightfield + * @param {number} xi + * @param {number} yi + * @param {AABB} result + */ +Heightfield.prototype.getAabbAtIndex = function(xi, yi, result){ + var data = this.data; + var elementSize = this.elementSize; + + result.lowerBound.set( + xi * elementSize, + yi * elementSize, + data[xi][yi] + ); + result.upperBound.set( + (xi + 1) * elementSize, + (yi + 1) * elementSize, + data[xi + 1][yi + 1] + ); +}; + + +/** + * Get the height in the heightfield at a given position + * @param {number} x + * @param {number} y + * @param {boolean} edgeClamp + * @return {number} + */ +Heightfield.prototype.getHeightAt = function(x, y, edgeClamp){ + var data = this.data; + var a = getHeightAt_a; + var b = getHeightAt_b; + var c = getHeightAt_c; + var idx = getHeightAt_idx; + + this.getIndexOfPosition(x, y, idx, edgeClamp); + var xi = idx[0]; + var yi = idx[1]; + if(edgeClamp){ + xi = Math.min(data.length - 2, Math.max(0, xi)); + yi = Math.min(data[0].length - 2, Math.max(0, yi)); + } + var upper = this.getTriangleAt(x, y, edgeClamp, a, b, c); + barycentricWeights(x, y, a.x, a.y, b.x, b.y, c.x, c.y, getHeightAt_weights); + + var w = getHeightAt_weights; + + if(upper){ + + // Top triangle verts + return data[xi + 1][yi + 1] * w.x + data[xi][yi + 1] * w.y + data[xi + 1][yi] * w.z; + + } else { + + // Top triangle verts + return data[xi][yi] * w.x + data[xi + 1][yi] * w.y + data[xi][yi + 1] * w.z; + } +}; + +// from https://en.wikipedia.org/wiki/Barycentric_coordinate_system +function barycentricWeights(x, y, ax, ay, bx, by, cx, cy, result){ + result.x = ((by - cy) * (x - cx) + (cx - bx) * (y - cy)) / ((by - cy) * (ax - cx) + (cx - bx) * (ay - cy)); + result.y = ((cy - ay) * (x - cx) + (ax - cx) * (y - cy)) / ((by - cy) * (ax - cx) + (cx - bx) * (ay - cy)); + result.z = 1 - result.x - result.y; +} + +Heightfield.prototype.getCacheConvexTrianglePillarKey = function(xi, yi, getUpperTriangle){ + return xi + '_' + yi + '_' + (getUpperTriangle ? 1 : 0); +}; + +Heightfield.prototype.getCachedConvexTrianglePillar = function(xi, yi, getUpperTriangle){ + return this._cachedPillars[this.getCacheConvexTrianglePillarKey(xi, yi, getUpperTriangle)]; +}; + +Heightfield.prototype.setCachedConvexTrianglePillar = function(xi, yi, getUpperTriangle, convex, offset){ + this._cachedPillars[this.getCacheConvexTrianglePillarKey(xi, yi, getUpperTriangle)] = { + convex: convex, + offset: offset + }; +}; + +Heightfield.prototype.clearCachedConvexTrianglePillar = function(xi, yi, getUpperTriangle){ + delete this._cachedPillars[this.getCacheConvexTrianglePillarKey(xi, yi, getUpperTriangle)]; +}; + +/** + * Get a triangle from the heightfield + * @param {number} xi + * @param {number} yi + * @param {boolean} upper + * @param {Vec3} a + * @param {Vec3} b + * @param {Vec3} c + */ +Heightfield.prototype.getTriangle = function(xi, yi, upper, a, b, c){ + var data = this.data; + var elementSize = this.elementSize; + + if(upper){ + + // Top triangle verts + a.set( + (xi + 1) * elementSize, + (yi + 1) * elementSize, + data[xi + 1][yi + 1] + ); + b.set( + xi * elementSize, + (yi + 1) * elementSize, + data[xi][yi + 1] + ); + c.set( + (xi + 1) * elementSize, + yi * elementSize, + data[xi + 1][yi] + ); + + } else { + + // Top triangle verts + a.set( + xi * elementSize, + yi * elementSize, + data[xi][yi] + ); + b.set( + (xi + 1) * elementSize, + yi * elementSize, + data[xi + 1][yi] + ); + c.set( + xi * elementSize, + (yi + 1) * elementSize, + data[xi][yi + 1] + ); + } +}; + +/** + * Get a triangle in the terrain in the form of a triangular convex shape. + * @method getConvexTrianglePillar + * @param {integer} i + * @param {integer} j + * @param {boolean} getUpperTriangle + */ +Heightfield.prototype.getConvexTrianglePillar = function(xi, yi, getUpperTriangle){ + var result = this.pillarConvex; + var offsetResult = this.pillarOffset; + + if(this.cacheEnabled){ + var data = this.getCachedConvexTrianglePillar(xi, yi, getUpperTriangle); + if(data){ + this.pillarConvex = data.convex; + this.pillarOffset = data.offset; + return; + } + + result = new ConvexPolyhedron(); + offsetResult = new Vec3(); + + this.pillarConvex = result; + this.pillarOffset = offsetResult; + } + + var data = this.data; + var elementSize = this.elementSize; + var faces = result.faces; + + // Reuse verts if possible + result.vertices.length = 6; + for (var i = 0; i < 6; i++) { + if(!result.vertices[i]){ + result.vertices[i] = new Vec3(); + } + } + + // Reuse faces if possible + faces.length = 5; + for (var i = 0; i < 5; i++) { + if(!faces[i]){ + faces[i] = []; + } + } + + var verts = result.vertices; + + var h = (Math.min( + data[xi][yi], + data[xi+1][yi], + data[xi][yi+1], + data[xi+1][yi+1] + ) - this.minValue ) / 2 + this.minValue; + + if (!getUpperTriangle) { + + // Center of the triangle pillar - all polygons are given relative to this one + offsetResult.set( + (xi + 0.25) * elementSize, // sort of center of a triangle + (yi + 0.25) * elementSize, + h // vertical center + ); + + // Top triangle verts + verts[0].set( + -0.25 * elementSize, + -0.25 * elementSize, + data[xi][yi] - h + ); + verts[1].set( + 0.75 * elementSize, + -0.25 * elementSize, + data[xi + 1][yi] - h + ); + verts[2].set( + -0.25 * elementSize, + 0.75 * elementSize, + data[xi][yi + 1] - h + ); + + // bottom triangle verts + verts[3].set( + -0.25 * elementSize, + -0.25 * elementSize, + -h-1 + ); + verts[4].set( + 0.75 * elementSize, + -0.25 * elementSize, + -h-1 + ); + verts[5].set( + -0.25 * elementSize, + 0.75 * elementSize, + -h-1 + ); + + // top triangle + faces[0][0] = 0; + faces[0][1] = 1; + faces[0][2] = 2; + + // bottom triangle + faces[1][0] = 5; + faces[1][1] = 4; + faces[1][2] = 3; + + // -x facing quad + faces[2][0] = 0; + faces[2][1] = 2; + faces[2][2] = 5; + faces[2][3] = 3; + + // -y facing quad + faces[3][0] = 1; + faces[3][1] = 0; + faces[3][2] = 3; + faces[3][3] = 4; + + // +xy facing quad + faces[4][0] = 4; + faces[4][1] = 5; + faces[4][2] = 2; + faces[4][3] = 1; + + + } else { + + // Center of the triangle pillar - all polygons are given relative to this one + offsetResult.set( + (xi + 0.75) * elementSize, // sort of center of a triangle + (yi + 0.75) * elementSize, + h // vertical center + ); + + // Top triangle verts + verts[0].set( + 0.25 * elementSize, + 0.25 * elementSize, + data[xi + 1][yi + 1] - h + ); + verts[1].set( + -0.75 * elementSize, + 0.25 * elementSize, + data[xi][yi + 1] - h + ); + verts[2].set( + 0.25 * elementSize, + -0.75 * elementSize, + data[xi + 1][yi] - h + ); + + // bottom triangle verts + verts[3].set( + 0.25 * elementSize, + 0.25 * elementSize, + - h-1 + ); + verts[4].set( + -0.75 * elementSize, + 0.25 * elementSize, + - h-1 + ); + verts[5].set( + 0.25 * elementSize, + -0.75 * elementSize, + - h-1 + ); + + // Top triangle + faces[0][0] = 0; + faces[0][1] = 1; + faces[0][2] = 2; + + // bottom triangle + faces[1][0] = 5; + faces[1][1] = 4; + faces[1][2] = 3; + + // +x facing quad + faces[2][0] = 2; + faces[2][1] = 5; + faces[2][2] = 3; + faces[2][3] = 0; + + // +y facing quad + faces[3][0] = 3; + faces[3][1] = 4; + faces[3][2] = 1; + faces[3][3] = 0; + + // -xy facing quad + faces[4][0] = 1; + faces[4][1] = 4; + faces[4][2] = 5; + faces[4][3] = 2; + } + + result.computeNormals(); + result.computeEdges(); + result.updateBoundingSphereRadius(); + + this.setCachedConvexTrianglePillar(xi, yi, getUpperTriangle, result, offsetResult); +}; + +Heightfield.prototype.calculateLocalInertia = function(mass, target){ + target = target || new Vec3(); + target.set(0, 0, 0); + return target; +}; + +Heightfield.prototype.volume = function(){ + return Number.MAX_VALUE; // The terrain is infinite +}; + +Heightfield.prototype.calculateWorldAABB = function(pos, quat, min, max){ + // TODO: do it properly + min.set(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE); + max.set(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE); +}; + +Heightfield.prototype.updateBoundingSphereRadius = function(){ + // Use the bounding box of the min/max values + var data = this.data, + s = this.elementSize; + this.boundingSphereRadius = new Vec3(data.length * s, data[0].length * s, Math.max(Math.abs(this.maxValue), Math.abs(this.minValue))).norm(); +}; + +/** + * Sets the height values from an image. Currently only supported in browser. + * @method setHeightsFromImage + * @param {Image} image + * @param {Vec3} scale + */ +Heightfield.prototype.setHeightsFromImage = function(image, scale){ + var canvas = document.createElement('canvas'); + canvas.width = image.width; + canvas.height = image.height; + var context = canvas.getContext('2d'); + context.drawImage(image, 0, 0); + var imageData = context.getImageData(0, 0, image.width, image.height); + + var matrix = this.data; + matrix.length = 0; + this.elementSize = Math.abs(scale.x) / imageData.width; + for(var i=0; i 0 by subclasses. + * @property type + * @type {Number} + * @see Shape.types + */ + this.type = options.type || 0; + + /** + * The local bounding sphere radius of this shape. + * @property {Number} boundingSphereRadius + */ + this.boundingSphereRadius = 0; + + /** + * Whether to produce contact forces when in contact with other bodies. Note that contacts will be generated, but they will be disabled. + * @property {boolean} collisionResponse + */ + this.collisionResponse = options.collisionResponse ? options.collisionResponse : true; + + /** + * @property {Number} collisionFilterGroup + */ + this.collisionFilterGroup = options.collisionFilterGroup !== undefined ? options.collisionFilterGroup : 1; + + /** + * @property {Number} collisionFilterMask + */ + this.collisionFilterMask = options.collisionFilterMask !== undefined ? options.collisionFilterMask : -1; + + /** + * @property {Material} material + */ + this.material = options.material ? options.material : null; + + /** + * @property {Body} body + */ + this.body = null; +} +Shape.prototype.constructor = Shape; + +/** + * Computes the bounding sphere radius. The result is stored in the property .boundingSphereRadius + * @method updateBoundingSphereRadius + */ +Shape.prototype.updateBoundingSphereRadius = function(){ + throw "computeBoundingSphereRadius() not implemented for shape type "+this.type; +}; + +/** + * Get the volume of this shape + * @method volume + * @return {Number} + */ +Shape.prototype.volume = function(){ + throw "volume() not implemented for shape type "+this.type; +}; + +/** + * Calculates the inertia in the local frame for this shape. + * @method calculateLocalInertia + * @param {Number} mass + * @param {Vec3} target + * @see http://en.wikipedia.org/wiki/List_of_moments_of_inertia + */ +Shape.prototype.calculateLocalInertia = function(mass,target){ + throw "calculateLocalInertia() not implemented for shape type "+this.type; +}; + +Shape.idCounter = 0; + +/** + * The available shape types. + * @static + * @property types + * @type {Object} + */ +Shape.types = { + SPHERE:1, + PLANE:2, + BOX:4, + COMPOUND:8, + CONVEXPOLYHEDRON:16, + HEIGHTFIELD:32, + PARTICLE:64, + CYLINDER:128, + TRIMESH:256 +}; + + +},{"../material/Material":26,"../math/Quaternion":29,"../math/Vec3":31,"./Shape":44}],45:[function(_dereq_,module,exports){ +module.exports = Sphere; + +var Shape = _dereq_('./Shape'); +var Vec3 = _dereq_('../math/Vec3'); + +/** + * Spherical shape + * @class Sphere + * @constructor + * @extends Shape + * @param {Number} radius The radius of the sphere, a non-negative number. + * @author schteppe / http://github.com/schteppe + */ +function Sphere(radius){ + Shape.call(this, { + type: Shape.types.SPHERE + }); + + /** + * @property {Number} radius + */ + this.radius = radius !== undefined ? radius : 1.0; + + if(this.radius < 0){ + throw new Error('The sphere radius cannot be negative.'); + } + + this.updateBoundingSphereRadius(); +} +Sphere.prototype = new Shape(); +Sphere.prototype.constructor = Sphere; + +Sphere.prototype.calculateLocalInertia = function(mass,target){ + target = target || new Vec3(); + var I = 2.0*mass*this.radius*this.radius/5.0; + target.x = I; + target.y = I; + target.z = I; + return target; +}; + +Sphere.prototype.volume = function(){ + return 4.0 * Math.PI * Math.pow(this.radius, 3) / 3.0; +}; + +Sphere.prototype.updateBoundingSphereRadius = function(){ + this.boundingSphereRadius = this.radius; +}; + +Sphere.prototype.calculateWorldAABB = function(pos,quat,min,max){ + var r = this.radius; + var axes = ['x','y','z']; + for(var i=0; i u.x){ + u.x = v.x; + } + + if(v.y < l.y){ + l.y = v.y; + } else if(v.y > u.y){ + u.y = v.y; + } + + if(v.z < l.z){ + l.z = v.z; + } else if(v.z > u.z){ + u.z = v.z; + } + } +}; + + +/** + * Update the .aabb property + * @method updateAABB + */ +Trimesh.prototype.updateAABB = function(){ + this.computeLocalAABB(this.aabb); +}; + +/** + * Will update the .boundingSphereRadius property + * @method updateBoundingSphereRadius + */ +Trimesh.prototype.updateBoundingSphereRadius = function(){ + // Assume points are distributed with local (0,0,0) as center + var max2 = 0; + var vertices = this.vertices; + var v = new Vec3(); + for(var i=0, N=vertices.length / 3; i !== N; i++) { + this.getVertex(i, v); + var norm2 = v.norm2(); + if(norm2 > max2){ + max2 = norm2; + } + } + this.boundingSphereRadius = Math.sqrt(max2); +}; + +var tempWorldVertex = new Vec3(); +var calculateWorldAABB_frame = new Transform(); +var calculateWorldAABB_aabb = new AABB(); + +/** + * @method calculateWorldAABB + * @param {Vec3} pos + * @param {Quaternion} quat + * @param {Vec3} min + * @param {Vec3} max + */ +Trimesh.prototype.calculateWorldAABB = function(pos,quat,min,max){ + /* + var n = this.vertices.length / 3, + verts = this.vertices; + var minx,miny,minz,maxx,maxy,maxz; + + var v = tempWorldVertex; + for(var i=0; i maxx || maxx===undefined){ + maxx = v.x; + } + + if (v.y < miny || miny===undefined){ + miny = v.y; + } else if(v.y > maxy || maxy===undefined){ + maxy = v.y; + } + + if (v.z < minz || minz===undefined){ + minz = v.z; + } else if(v.z > maxz || maxz===undefined){ + maxz = v.z; + } + } + min.set(minx,miny,minz); + max.set(maxx,maxy,maxz); + */ + + // Faster approximation using local AABB + var frame = calculateWorldAABB_frame; + var result = calculateWorldAABB_aabb; + frame.position = pos; + frame.quaternion = quat; + this.aabb.toWorldFrame(frame, result); + min.copy(result.lowerBound); + max.copy(result.upperBound); +}; + +/** + * Get approximate volume + * @method volume + * @return {Number} + */ +Trimesh.prototype.volume = function(){ + return 4.0 * Math.PI * this.boundingSphereRadius / 3.0; +}; + +/** + * Create a Trimesh instance, shaped as a torus. + * @static + * @method createTorus + * @param {number} [radius=1] + * @param {number} [tube=0.5] + * @param {number} [radialSegments=8] + * @param {number} [tubularSegments=6] + * @param {number} [arc=6.283185307179586] + * @return {Trimesh} A torus + */ +Trimesh.createTorus = function (radius, tube, radialSegments, tubularSegments, arc) { + radius = radius || 1; + tube = tube || 0.5; + radialSegments = radialSegments || 8; + tubularSegments = tubularSegments || 6; + arc = arc || Math.PI * 2; + + var vertices = []; + var indices = []; + + for ( var j = 0; j <= radialSegments; j ++ ) { + for ( var i = 0; i <= tubularSegments; i ++ ) { + var u = i / tubularSegments * arc; + var v = j / radialSegments * Math.PI * 2; + + var x = ( radius + tube * Math.cos( v ) ) * Math.cos( u ); + var y = ( radius + tube * Math.cos( v ) ) * Math.sin( u ); + var z = tube * Math.sin( v ); + + vertices.push( x, y, z ); + } + } + + for ( var j = 1; j <= radialSegments; j ++ ) { + for ( var i = 1; i <= tubularSegments; i ++ ) { + var a = ( tubularSegments + 1 ) * j + i - 1; + var b = ( tubularSegments + 1 ) * ( j - 1 ) + i - 1; + var c = ( tubularSegments + 1 ) * ( j - 1 ) + i; + var d = ( tubularSegments + 1 ) * j + i; + + indices.push(a, b, d); + indices.push(b, c, d); + } + } + + return new Trimesh(vertices, indices); +}; + +},{"../collision/AABB":3,"../math/Quaternion":29,"../math/Transform":30,"../math/Vec3":31,"../utils/Octree":51,"./Shape":44}],47:[function(_dereq_,module,exports){ +module.exports = GSSolver; + +var Vec3 = _dereq_('../math/Vec3'); +var Quaternion = _dereq_('../math/Quaternion'); +var Solver = _dereq_('./Solver'); + +/** + * Constraint equation Gauss-Seidel solver. + * @class GSSolver + * @constructor + * @todo The spook parameters should be specified for each constraint, not globally. + * @author schteppe / https://github.com/schteppe + * @see https://www8.cs.umu.se/kurser/5DV058/VT09/lectures/spooknotes.pdf + * @extends Solver + */ +function GSSolver(){ + Solver.call(this); + + /** + * The number of solver iterations determines quality of the constraints in the world. The more iterations, the more correct simulation. More iterations need more computations though. If you have a large gravity force in your world, you will need more iterations. + * @property iterations + * @type {Number} + * @todo write more about solver and iterations in the wiki + */ + this.iterations = 10; + + /** + * When tolerance is reached, the system is assumed to be converged. + * @property tolerance + * @type {Number} + */ + this.tolerance = 1e-7; +} +GSSolver.prototype = new Solver(); + +var GSSolver_solve_lambda = []; // Just temporary number holders that we want to reuse each solve. +var GSSolver_solve_invCs = []; +var GSSolver_solve_Bs = []; +GSSolver.prototype.solve = function(dt,world){ + var iter = 0, + maxIter = this.iterations, + tolSquared = this.tolerance*this.tolerance, + equations = this.equations, + Neq = equations.length, + bodies = world.bodies, + Nbodies = bodies.length, + h = dt, + q, B, invC, deltalambda, deltalambdaTot, GWlambda, lambdaj; + + // Update solve mass + if(Neq !== 0){ + for(var i=0; i!==Nbodies; i++){ + bodies[i].updateSolveMassProperties(); + } + } + + // Things that does not change during iteration can be computed once + var invCs = GSSolver_solve_invCs, + Bs = GSSolver_solve_Bs, + lambda = GSSolver_solve_lambda; + invCs.length = Neq; + Bs.length = Neq; + lambda.length = Neq; + for(var i=0; i!==Neq; i++){ + var c = equations[i]; + lambda[i] = 0.0; + Bs[i] = c.computeB(h); + invCs[i] = 1.0 / c.computeC(); + } + + if(Neq !== 0){ + + // Reset vlambda + for(var i=0; i!==Nbodies; i++){ + var b=bodies[i], + vlambda=b.vlambda, + wlambda=b.wlambda; + vlambda.set(0,0,0); + wlambda.set(0,0,0); + } + + // Iterate over equations + for(iter=0; iter!==maxIter; iter++){ + + // Accumulate the total error for each iteration. + deltalambdaTot = 0.0; + + for(var j=0; j!==Neq; j++){ + + var c = equations[j]; + + // Compute iteration + B = Bs[j]; + invC = invCs[j]; + lambdaj = lambda[j]; + GWlambda = c.computeGWlambda(); + deltalambda = invC * ( B - GWlambda - c.eps * lambdaj ); + + // Clamp if we are not within the min/max interval + if(lambdaj + deltalambda < c.minForce){ + deltalambda = c.minForce - lambdaj; + } else if(lambdaj + deltalambda > c.maxForce){ + deltalambda = c.maxForce - lambdaj; + } + lambda[j] += deltalambda; + + deltalambdaTot += deltalambda > 0.0 ? deltalambda : -deltalambda; // abs(deltalambda) + + c.addToWlambda(deltalambda); + } + + // If the total error is small enough - stop iterate + if(deltalambdaTot*deltalambdaTot < tolSquared){ + break; + } + } + + // Add result to velocity + for(var i=0; i!==Nbodies; i++){ + var b=bodies[i], + v=b.velocity, + w=b.angularVelocity; + + b.vlambda.vmul(b.linearFactor, b.vlambda); + v.vadd(b.vlambda, v); + + b.wlambda.vmul(b.angularFactor, b.wlambda); + w.vadd(b.wlambda, w); + } + + // Set the .multiplier property of each equation + var l = equations.length; + var invDt = 1 / h; + while(l--){ + equations[l].multiplier = lambda[l] * invDt; + } + } + + return iter; +}; + +},{"../math/Quaternion":29,"../math/Vec3":31,"./Solver":48}],48:[function(_dereq_,module,exports){ +module.exports = Solver; + +/** + * Constraint equation solver base class. + * @class Solver + * @constructor + * @author schteppe / https://github.com/schteppe + */ +function Solver(){ + /** + * All equations to be solved + * @property {Array} equations + */ + this.equations = []; +} + +/** + * Should be implemented in subclasses! + * @method solve + * @param {Number} dt + * @param {World} world + */ +Solver.prototype.solve = function(dt,world){ + // Should return the number of iterations done! + return 0; +}; + +/** + * Add an equation + * @method addEquation + * @param {Equation} eq + */ +Solver.prototype.addEquation = function(eq){ + if (eq.enabled) { + this.equations.push(eq); + } +}; + +/** + * Remove an equation + * @method removeEquation + * @param {Equation} eq + */ +Solver.prototype.removeEquation = function(eq){ + var eqs = this.equations; + var i = eqs.indexOf(eq); + if(i !== -1){ + eqs.splice(i,1); + } +}; + +/** + * Add all equations + * @method removeAllEquations + */ +Solver.prototype.removeAllEquations = function(){ + this.equations.length = 0; +}; + + +},{}],49:[function(_dereq_,module,exports){ +module.exports = SplitSolver; + +var Vec3 = _dereq_('../math/Vec3'); +var Quaternion = _dereq_('../math/Quaternion'); +var Solver = _dereq_('./Solver'); +var Body = _dereq_('../objects/Body'); + +/** + * Splits the equations into islands and solves them independently. Can improve performance. + * @class SplitSolver + * @constructor + * @extends Solver + * @param {Solver} subsolver + */ +function SplitSolver(subsolver){ + Solver.call(this); + this.iterations = 10; + this.tolerance = 1e-7; + this.subsolver = subsolver; + this.nodes = []; + this.nodePool = []; + + // Create needed nodes, reuse if possible + while(this.nodePool.length < 128){ + this.nodePool.push(this.createNode()); + } +} +SplitSolver.prototype = new Solver(); + +// Returns the number of subsystems +var SplitSolver_solve_nodes = []; // All allocated node objects +var SplitSolver_solve_nodePool = []; // All allocated node objects +var SplitSolver_solve_eqs = []; // Temp array +var SplitSolver_solve_bds = []; // Temp array +var SplitSolver_solve_dummyWorld = {bodies:[]}; // Temp object + +var STATIC = Body.STATIC; +function getUnvisitedNode(nodes){ + var Nnodes = nodes.length; + for(var i=0; i!==Nnodes; i++){ + var node = nodes[i]; + if(!node.visited && !(node.body.type & STATIC)){ + return node; + } + } + return false; +} + +var queue = []; +function bfs(root,visitFunc,bds,eqs){ + queue.push(root); + root.visited = true; + visitFunc(root,bds,eqs); + while(queue.length) { + var node = queue.pop(); + // Loop over unvisited child nodes + var child; + while((child = getUnvisitedNode(node.children))) { + child.visited = true; + visitFunc(child,bds,eqs); + queue.push(child); + } + } +} + +function visitFunc(node,bds,eqs){ + bds.push(node.body); + var Neqs = node.eqs.length; + for(var i=0; i!==Neqs; i++){ + var eq = node.eqs[i]; + if(eqs.indexOf(eq) === -1){ + eqs.push(eq); + } + } +} + +SplitSolver.prototype.createNode = function(){ + return { body:null, children:[], eqs:[], visited:false }; +}; + +/** + * Solve the subsystems + * @method solve + * @param {Number} dt + * @param {World} world + */ +SplitSolver.prototype.solve = function(dt,world){ + var nodes=SplitSolver_solve_nodes, + nodePool=this.nodePool, + bodies=world.bodies, + equations=this.equations, + Neq=equations.length, + Nbodies=bodies.length, + subsolver=this.subsolver; + + // Create needed nodes, reuse if possible + while(nodePool.length < Nbodies){ + nodePool.push(this.createNode()); + } + nodes.length = Nbodies; + for (var i = 0; i < Nbodies; i++) { + nodes[i] = nodePool[i]; + } + + // Reset node values + for(var i=0; i!==Nbodies; i++){ + var node = nodes[i]; + node.body = bodies[i]; + node.children.length = 0; + node.eqs.length = 0; + node.visited = false; + } + for(var k=0; k!==Neq; k++){ + var eq=equations[k], + i=bodies.indexOf(eq.bi), + j=bodies.indexOf(eq.bj), + ni=nodes[i], + nj=nodes[j]; + ni.children.push(nj); + ni.eqs.push(eq); + nj.children.push(ni); + nj.eqs.push(eq); + } + + var child, n=0, eqs=SplitSolver_solve_eqs; + + subsolver.tolerance = this.tolerance; + subsolver.iterations = this.iterations; + + var dummyWorld = SplitSolver_solve_dummyWorld; + while((child = getUnvisitedNode(nodes))){ + eqs.length = 0; + dummyWorld.bodies.length = 0; + bfs(child, visitFunc, dummyWorld.bodies, eqs); + + var Neqs = eqs.length; + + eqs = eqs.sort(sortById); + + for(var i=0; i!==Neqs; i++){ + subsolver.addEquation(eqs[i]); + } + + var iter = subsolver.solve(dt,dummyWorld); + subsolver.removeAllEquations(); + n++; + } + + return n; +}; + +function sortById(a, b){ + return b.id - a.id; +} +},{"../math/Quaternion":29,"../math/Vec3":31,"../objects/Body":32,"./Solver":48}],50:[function(_dereq_,module,exports){ +module.exports = EventTarget; + +/** + * Base class for objects that dispatches events. + * @class EventTarget + * @constructor + */ +function EventTarget(){ +} + +/** + * Add an event listener + * @method addEventListener + * @param {String} type + * @param {Function} listener + * @return {EventTarget} The self object, for chainability. + */ +EventTarget.prototype.addEventListener = function ( type, listener ) { + if ( this._listeners === undefined ){ this._listeners = {}; } + var listeners = this._listeners; + if ( listeners[ type ] === undefined ) { + listeners[ type ] = []; + } + if ( listeners[ type ].indexOf( listener ) === - 1 ) { + listeners[ type ].push( listener ); + } + return this; +}, + +/** + * Check if an event listener is added + * @method hasEventListener + * @param {String} type + * @param {Function} listener + * @return {Boolean} + */ +EventTarget.prototype.hasEventListener = function ( type, listener ) { + if ( this._listeners === undefined ){ return false; } + var listeners = this._listeners; + if ( listeners[ type ] !== undefined && listeners[ type ].indexOf( listener ) !== - 1 ) { + return true; + } + return false; +}, + +/** + * Check if any event listener of the given type is added + * @method hasAnyEventListener + * @param {String} type + * @return {Boolean} + */ +EventTarget.prototype.hasAnyEventListener = function ( type ) { + if ( this._listeners === undefined ){ return false; } + var listeners = this._listeners; + return ( listeners[ type ] !== undefined ); +}, + +/** + * Remove an event listener + * @method removeEventListener + * @param {String} type + * @param {Function} listener + * @return {EventTarget} The self object, for chainability. + */ +EventTarget.prototype.removeEventListener = function ( type, listener ) { + if ( this._listeners === undefined ){ return this; } + var listeners = this._listeners; + if ( listeners[type] === undefined ){ return this; } + var index = listeners[ type ].indexOf( listener ); + if ( index !== - 1 ) { + listeners[ type ].splice( index, 1 ); + } + return this; +}, + +/** + * Emit an event. + * @method dispatchEvent + * @param {Object} event + * @param {String} event.type + * @return {EventTarget} The self object, for chainability. + */ +EventTarget.prototype.dispatchEvent = function ( event ) { + if ( this._listeners === undefined ){ return this; } + var listeners = this._listeners; + var listenerArray = listeners[ event.type ]; + if ( listenerArray !== undefined ) { + event.target = this; + for ( var i = 0, l = listenerArray.length; i < l; i ++ ) { + listenerArray[ i ].call( this, event ); + } + } + return this; +} + +},{}],51:[function(_dereq_,module,exports){ +var AABB = _dereq_('../collision/AABB'); +var Vec3 = _dereq_('../math/Vec3'); + +module.exports = Octree; + +/** + * @class OctreeNode + * @param {object} [options] + * @param {Octree} [options.root] + * @param {AABB} [options.aabb] + */ +function OctreeNode(options){ + options = options || {}; + + /** + * The root node + * @property {OctreeNode} root + */ + this.root = options.root || null; + + /** + * Boundary of this node + * @property {AABB} aabb + */ + this.aabb = options.aabb ? options.aabb.clone() : new AABB(); + + /** + * Contained data at the current node level. + * @property {Array} data + */ + this.data = []; + + /** + * Children to this node + * @property {Array} children + */ + this.children = []; +} + +/** + * @class Octree + * @param {AABB} aabb The total AABB of the tree + * @param {object} [options] + * @param {number} [options.maxDepth=8] + * @extends OctreeNode + */ +function Octree(aabb, options){ + options = options || {}; + options.root = null; + options.aabb = aabb; + OctreeNode.call(this, options); + + /** + * Maximum subdivision depth + * @property {number} maxDepth + */ + this.maxDepth = typeof(options.maxDepth) !== 'undefined' ? options.maxDepth : 8; +} +Octree.prototype = new OctreeNode(); + +OctreeNode.prototype.reset = function(aabb, options){ + this.children.length = this.data.length = 0; +}; + +/** + * Insert data into this node + * @method insert + * @param {AABB} aabb + * @param {object} elementData + * @return {boolean} True if successful, otherwise false + */ +OctreeNode.prototype.insert = function(aabb, elementData, level){ + var nodeData = this.data; + level = level || 0; + + // Ignore objects that do not belong in this node + if (!this.aabb.contains(aabb)){ + return false; // object cannot be added + } + + var children = this.children; + + if(level < (this.maxDepth || this.root.maxDepth)){ + // Subdivide if there are no children yet + var subdivided = false; + if (!children.length){ + this.subdivide(); + subdivided = true; + } + + // add to whichever node will accept it + for (var i = 0; i !== 8; i++) { + if (children[i].insert(aabb, elementData, level + 1)){ + return true; + } + } + + if(subdivided){ + // No children accepted! Might as well just remove em since they contain none + children.length = 0; + } + } + + // Too deep, or children didnt want it. add it in current node + nodeData.push(elementData); + + return true; +}; + +var halfDiagonal = new Vec3(); + +/** + * Create 8 equally sized children nodes and put them in the .children array. + * @method subdivide + */ +OctreeNode.prototype.subdivide = function() { + var aabb = this.aabb; + var l = aabb.lowerBound; + var u = aabb.upperBound; + + var children = this.children; + + children.push( + new OctreeNode({ aabb: new AABB({ lowerBound: new Vec3(0,0,0) }) }), + new OctreeNode({ aabb: new AABB({ lowerBound: new Vec3(1,0,0) }) }), + new OctreeNode({ aabb: new AABB({ lowerBound: new Vec3(1,1,0) }) }), + new OctreeNode({ aabb: new AABB({ lowerBound: new Vec3(1,1,1) }) }), + new OctreeNode({ aabb: new AABB({ lowerBound: new Vec3(0,1,1) }) }), + new OctreeNode({ aabb: new AABB({ lowerBound: new Vec3(0,0,1) }) }), + new OctreeNode({ aabb: new AABB({ lowerBound: new Vec3(1,0,1) }) }), + new OctreeNode({ aabb: new AABB({ lowerBound: new Vec3(0,1,0) }) }) + ); + + u.vsub(l, halfDiagonal); + halfDiagonal.scale(0.5, halfDiagonal); + + var root = this.root || this; + + for (var i = 0; i !== 8; i++) { + var child = children[i]; + + // Set current node as root + child.root = root; + + // Compute bounds + var lowerBound = child.aabb.lowerBound; + lowerBound.x *= halfDiagonal.x; + lowerBound.y *= halfDiagonal.y; + lowerBound.z *= halfDiagonal.z; + + lowerBound.vadd(l, lowerBound); + + // Upper bound is always lower bound + halfDiagonal + lowerBound.vadd(halfDiagonal, child.aabb.upperBound); + } +}; + +/** + * Get all data, potentially within an AABB + * @method aabbQuery + * @param {AABB} aabb + * @param {array} result + * @return {array} The "result" object + */ +OctreeNode.prototype.aabbQuery = function(aabb, result) { + + var nodeData = this.data; + + // abort if the range does not intersect this node + // if (!this.aabb.overlaps(aabb)){ + // return result; + // } + + // Add objects at this level + // Array.prototype.push.apply(result, nodeData); + + // Add child data + // @todo unwrap recursion into a queue / loop, that's faster in JS + var children = this.children; + + + // for (var i = 0, N = this.children.length; i !== N; i++) { + // children[i].aabbQuery(aabb, result); + // } + + var queue = [this]; + while (queue.length) { + var node = queue.pop(); + if (node.aabb.overlaps(aabb)){ + Array.prototype.push.apply(result, node.data); + } + Array.prototype.push.apply(queue, node.children); + } + + return result; +}; + +var tmpAABB = new AABB(); + +/** + * Get all data, potentially intersected by a ray. + * @method rayQuery + * @param {Ray} ray + * @param {Transform} treeTransform + * @param {array} result + * @return {array} The "result" object + */ +OctreeNode.prototype.rayQuery = function(ray, treeTransform, result) { + + // Use aabb query for now. + // @todo implement real ray query which needs less lookups + ray.getAABB(tmpAABB); + tmpAABB.toLocalFrame(treeTransform, tmpAABB); + this.aabbQuery(tmpAABB, result); + + return result; +}; + +/** + * @method removeEmptyNodes + */ +OctreeNode.prototype.removeEmptyNodes = function() { + for (var i = this.children.length - 1; i >= 0; i--) { + this.children[i].removeEmptyNodes(); + if(!this.children[i].children.length && !this.children[i].data.length){ + this.children.splice(i, 1); + } + } +}; +},{"../collision/AABB":3,"../math/Vec3":31}],52:[function(_dereq_,module,exports){ +module.exports = Pool; + +/** + * For pooling objects that can be reused. + * @class Pool + * @constructor + */ +function Pool(){ + /** + * The pooled objects + * @property {Array} objects + */ + this.objects = []; + + /** + * Constructor of the objects + * @property {mixed} type + */ + this.type = Object; +} + +/** + * Release an object after use + * @method release + * @param {Object} obj + */ +Pool.prototype.release = function(){ + var Nargs = arguments.length; + for(var i=0; i!==Nargs; i++){ + this.objects.push(arguments[i]); + } + return this; +}; + +/** + * Get an object + * @method get + * @return {mixed} + */ +Pool.prototype.get = function(){ + if(this.objects.length===0){ + return this.constructObject(); + } else { + return this.objects.pop(); + } +}; + +/** + * Construct an object. Should be implmented in each subclass. + * @method constructObject + * @return {mixed} + */ +Pool.prototype.constructObject = function(){ + throw new Error("constructObject() not implemented in this Pool subclass yet!"); +}; + +/** + * @method resize + * @param {number} size + * @return {Pool} Self, for chaining + */ +Pool.prototype.resize = function (size) { + var objects = this.objects; + + while (objects.length > size) { + objects.pop(); + } + + while (objects.length < size) { + objects.push(this.constructObject()); + } + + return this; +}; + + +},{}],53:[function(_dereq_,module,exports){ +module.exports = TupleDictionary; + +/** + * @class TupleDictionary + * @constructor + */ +function TupleDictionary() { + + /** + * The data storage + * @property data + * @type {Object} + */ + this.data = { keys:[] }; +} + +/** + * @method get + * @param {Number} i + * @param {Number} j + * @return {Number} + */ +TupleDictionary.prototype.get = function(i, j) { + if (i > j) { + // swap + var temp = j; + j = i; + i = temp; + } + return this.data[i+'-'+j]; +}; + +/** + * @method set + * @param {Number} i + * @param {Number} j + * @param {Number} value + */ +TupleDictionary.prototype.set = function(i, j, value) { + if (i > j) { + var temp = j; + j = i; + i = temp; + } + var key = i+'-'+j; + + // Check if key already exists + if(!this.get(i,j)){ + this.data.keys.push(key); + } + + this.data[key] = value; +}; + +/** + * @method reset + */ +TupleDictionary.prototype.reset = function() { + var data = this.data, + keys = data.keys; + while(keys.length > 0){ + var key = keys.pop(); + delete data[key]; + } +}; + +},{}],54:[function(_dereq_,module,exports){ +function Utils(){} + +module.exports = Utils; + +/** + * Extend an options object with default values. + * @static + * @method defaults + * @param {object} options The options object. May be falsy: in this case, a new object is created and returned. + * @param {object} defaults An object containing default values. + * @return {object} The modified options object. + */ +Utils.defaults = function(options, defaults){ + options = options || {}; + + for(var key in defaults){ + if(!(key in options)){ + options[key] = defaults[key]; + } + } + + return options; +}; + +},{}],55:[function(_dereq_,module,exports){ +module.exports = Vec3Pool; + +var Vec3 = _dereq_('../math/Vec3'); +var Pool = _dereq_('./Pool'); + +/** + * @class Vec3Pool + * @constructor + * @extends Pool + */ +function Vec3Pool(){ + Pool.call(this); + this.type = Vec3; +} +Vec3Pool.prototype = new Pool(); + +/** + * Construct a vector + * @method constructObject + * @return {Vec3} + */ +Vec3Pool.prototype.constructObject = function(){ + return new Vec3(); +}; + +},{"../math/Vec3":31,"./Pool":52}],56:[function(_dereq_,module,exports){ +module.exports = Narrowphase; + +var AABB = _dereq_('../collision/AABB'); +var Body = _dereq_('../objects/Body'); +var Shape = _dereq_('../shapes/Shape'); +var Ray = _dereq_('../collision/Ray'); +var Vec3 = _dereq_('../math/Vec3'); +var Transform = _dereq_('../math/Transform'); +var ConvexPolyhedron = _dereq_('../shapes/ConvexPolyhedron'); +var Quaternion = _dereq_('../math/Quaternion'); +var Solver = _dereq_('../solver/Solver'); +var Vec3Pool = _dereq_('../utils/Vec3Pool'); +var ContactEquation = _dereq_('../equations/ContactEquation'); +var FrictionEquation = _dereq_('../equations/FrictionEquation'); + +/** + * Helper class for the World. Generates ContactEquations. + * @class Narrowphase + * @constructor + * @todo Sphere-ConvexPolyhedron contacts + * @todo Contact reduction + * @todo should move methods to prototype + */ +function Narrowphase(world){ + + /** + * Internal storage of pooled contact points. + * @property {Array} contactPointPool + */ + this.contactPointPool = []; + + this.frictionEquationPool = []; + + this.result = []; + this.frictionResult = []; + + /** + * Pooled vectors. + * @property {Vec3Pool} v3pool + */ + this.v3pool = new Vec3Pool(); + + this.world = world; + this.currentContactMaterial = null; + + /** + * @property {Boolean} enableFrictionReduction + */ + this.enableFrictionReduction = false; +} + +/** + * Make a contact object, by using the internal pool or creating a new one. + * @method createContactEquation + * @param {Body} bi + * @param {Body} bj + * @param {Shape} si + * @param {Shape} sj + * @param {Shape} overrideShapeA + * @param {Shape} overrideShapeB + * @return {ContactEquation} + */ +Narrowphase.prototype.createContactEquation = function(bi, bj, si, sj, overrideShapeA, overrideShapeB){ + var c; + if(this.contactPointPool.length){ + c = this.contactPointPool.pop(); + c.bi = bi; + c.bj = bj; + } else { + c = new ContactEquation(bi, bj); + } + + c.enabled = bi.collisionResponse && bj.collisionResponse && si.collisionResponse && sj.collisionResponse; + + var cm = this.currentContactMaterial; + + c.restitution = cm.restitution; + + c.setSpookParams( + cm.contactEquationStiffness, + cm.contactEquationRelaxation, + this.world.dt + ); + + var matA = si.material || bi.material; + var matB = sj.material || bj.material; + if(matA && matB && matA.restitution >= 0 && matB.restitution >= 0){ + c.restitution = matA.restitution * matB.restitution; + } + + c.si = overrideShapeA || si; + c.sj = overrideShapeB || sj; + + return c; +}; + +Narrowphase.prototype.createFrictionEquationsFromContact = function(contactEquation, outArray){ + var bodyA = contactEquation.bi; + var bodyB = contactEquation.bj; + var shapeA = contactEquation.si; + var shapeB = contactEquation.sj; + + var world = this.world; + var cm = this.currentContactMaterial; + + // If friction or restitution were specified in the material, use them + var friction = cm.friction; + var matA = shapeA.material || bodyA.material; + var matB = shapeB.material || bodyB.material; + if(matA && matB && matA.friction >= 0 && matB.friction >= 0){ + friction = matA.friction * matB.friction; + } + + if(friction > 0){ + + // Create 2 tangent equations + var mug = friction * world.gravity.length(); + var reducedMass = (bodyA.invMass + bodyB.invMass); + if(reducedMass > 0){ + reducedMass = 1/reducedMass; + } + var pool = this.frictionEquationPool; + var c1 = pool.length ? pool.pop() : new FrictionEquation(bodyA,bodyB,mug*reducedMass); + var c2 = pool.length ? pool.pop() : new FrictionEquation(bodyA,bodyB,mug*reducedMass); + + c1.bi = c2.bi = bodyA; + c1.bj = c2.bj = bodyB; + c1.minForce = c2.minForce = -mug*reducedMass; + c1.maxForce = c2.maxForce = mug*reducedMass; + + // Copy over the relative vectors + c1.ri.copy(contactEquation.ri); + c1.rj.copy(contactEquation.rj); + c2.ri.copy(contactEquation.ri); + c2.rj.copy(contactEquation.rj); + + // Construct tangents + contactEquation.ni.tangents(c1.t, c2.t); + + // Set spook params + c1.setSpookParams(cm.frictionEquationStiffness, cm.frictionEquationRelaxation, world.dt); + c2.setSpookParams(cm.frictionEquationStiffness, cm.frictionEquationRelaxation, world.dt); + + c1.enabled = c2.enabled = contactEquation.enabled; + + outArray.push(c1, c2); + + return true; + } + + return false; +}; + +var averageNormal = new Vec3(); +var averageContactPointA = new Vec3(); +var averageContactPointB = new Vec3(); + +// Take the average N latest contact point on the plane. +Narrowphase.prototype.createFrictionFromAverage = function(numContacts){ + // The last contactEquation + var c = this.result[this.result.length - 1]; + + // Create the result: two "average" friction equations + if (!this.createFrictionEquationsFromContact(c, this.frictionResult) || numContacts === 1) { + return; + } + + var f1 = this.frictionResult[this.frictionResult.length - 2]; + var f2 = this.frictionResult[this.frictionResult.length - 1]; + + averageNormal.setZero(); + averageContactPointA.setZero(); + averageContactPointB.setZero(); + + var bodyA = c.bi; + var bodyB = c.bj; + for(var i=0; i!==numContacts; i++){ + c = this.result[this.result.length - 1 - i]; + if(c.bodyA !== bodyA){ + averageNormal.vadd(c.ni, averageNormal); + averageContactPointA.vadd(c.ri, averageContactPointA); + averageContactPointB.vadd(c.rj, averageContactPointB); + } else { + averageNormal.vsub(c.ni, averageNormal); + averageContactPointA.vadd(c.rj, averageContactPointA); + averageContactPointB.vadd(c.ri, averageContactPointB); + } + } + + var invNumContacts = 1 / numContacts; + averageContactPointA.scale(invNumContacts, f1.ri); + averageContactPointB.scale(invNumContacts, f1.rj); + f2.ri.copy(f1.ri); // Should be the same + f2.rj.copy(f1.rj); + averageNormal.normalize(); + averageNormal.tangents(f1.t, f2.t); + // return eq; +}; + + +var tmpVec1 = new Vec3(); +var tmpVec2 = new Vec3(); +var tmpQuat1 = new Quaternion(); +var tmpQuat2 = new Quaternion(); + +/** + * Generate all contacts between a list of body pairs + * @method getContacts + * @param {array} p1 Array of body indices + * @param {array} p2 Array of body indices + * @param {World} world + * @param {array} result Array to store generated contacts + * @param {array} oldcontacts Optional. Array of reusable contact objects + */ +Narrowphase.prototype.getContacts = function(p1, p2, world, result, oldcontacts, frictionResult, frictionPool){ + // Save old contact objects + this.contactPointPool = oldcontacts; + this.frictionEquationPool = frictionPool; + this.result = result; + this.frictionResult = frictionResult; + + var qi = tmpQuat1; + var qj = tmpQuat2; + var xi = tmpVec1; + var xj = tmpVec2; + + for(var k=0, N=p1.length; k!==N; k++){ + + // Get current collision bodies + var bi = p1[k], + bj = p2[k]; + + // Get contact material + var bodyContactMaterial = null; + if(bi.material && bj.material){ + bodyContactMaterial = world.getContactMaterial(bi.material,bj.material) || null; + } + + var justTest = ( + ( + (bi.type & Body.KINEMATIC) && (bj.type & Body.STATIC) + ) || ( + (bi.type & Body.STATIC) && (bj.type & Body.KINEMATIC) + ) || ( + (bi.type & Body.KINEMATIC) && (bj.type & Body.KINEMATIC) + ) + ); + + for (var i = 0; i < bi.shapes.length; i++) { + bi.quaternion.mult(bi.shapeOrientations[i], qi); + bi.quaternion.vmult(bi.shapeOffsets[i], xi); + xi.vadd(bi.position, xi); + var si = bi.shapes[i]; + + for (var j = 0; j < bj.shapes.length; j++) { + + // Compute world transform of shapes + bj.quaternion.mult(bj.shapeOrientations[j], qj); + bj.quaternion.vmult(bj.shapeOffsets[j], xj); + xj.vadd(bj.position, xj); + var sj = bj.shapes[j]; + + // if(!((si.collisionFilterMask & sj.collisionFilterGroup) && (sj.collisionFilterMask & si.collisionFilterGroup))){ + // continue; + // } + + if((si.collisionFilterGroup & sj.collisionFilterMask)===0 || (sj.collisionFilterGroup & si.collisionFilterMask)===0){ + continue; + } + + if(xi.distanceTo(xj) > si.boundingSphereRadius + sj.boundingSphereRadius){ + continue; + } + + // Get collision material + var shapeContactMaterial = null; + if(si.material && sj.material){ + shapeContactMaterial = world.getContactMaterial(si.material,sj.material) || null; + } + + this.currentContactMaterial = shapeContactMaterial || bodyContactMaterial || world.defaultContactMaterial; + + // Get contacts + var resolver = this[si.type | sj.type]; + if(resolver){ + var retval = false; + if (si.type < sj.type) { + retval = resolver.call(this, si, sj, xi, xj, qi, qj, bi, bj, si, sj, justTest); + } else { + retval = resolver.call(this, sj, si, xj, xi, qj, qi, bj, bi, si, sj, justTest); + } + + if(retval && justTest){ + // Register overlap + world.shapeOverlapKeeper.set(si.id, sj.id); + world.bodyOverlapKeeper.set(bi.id, bj.id); + } + } + } + } + } +}; + +var numWarnings = 0; +var maxWarnings = 10; + +function warn(msg){ + if(numWarnings > maxWarnings){ + return; + } + + numWarnings++; + + console.warn(msg); +} + +Narrowphase.prototype[Shape.types.BOX | Shape.types.BOX] = +Narrowphase.prototype.boxBox = function(si,sj,xi,xj,qi,qj,bi,bj,rsi,rsj,justTest){ + si.convexPolyhedronRepresentation.material = si.material; + sj.convexPolyhedronRepresentation.material = sj.material; + si.convexPolyhedronRepresentation.collisionResponse = si.collisionResponse; + sj.convexPolyhedronRepresentation.collisionResponse = sj.collisionResponse; + return this.convexConvex(si.convexPolyhedronRepresentation,sj.convexPolyhedronRepresentation,xi,xj,qi,qj,bi,bj,si,sj,justTest); +}; + +Narrowphase.prototype[Shape.types.BOX | Shape.types.CONVEXPOLYHEDRON] = +Narrowphase.prototype.boxConvex = function(si,sj,xi,xj,qi,qj,bi,bj,rsi,rsj,justTest){ + si.convexPolyhedronRepresentation.material = si.material; + si.convexPolyhedronRepresentation.collisionResponse = si.collisionResponse; + return this.convexConvex(si.convexPolyhedronRepresentation,sj,xi,xj,qi,qj,bi,bj,si,sj,justTest); +}; + +Narrowphase.prototype[Shape.types.BOX | Shape.types.PARTICLE] = +Narrowphase.prototype.boxParticle = function(si,sj,xi,xj,qi,qj,bi,bj,rsi,rsj,justTest){ + si.convexPolyhedronRepresentation.material = si.material; + si.convexPolyhedronRepresentation.collisionResponse = si.collisionResponse; + return this.convexParticle(si.convexPolyhedronRepresentation,sj,xi,xj,qi,qj,bi,bj,si,sj,justTest); +}; + +/** + * @method sphereSphere + * @param {Shape} si + * @param {Shape} sj + * @param {Vec3} xi + * @param {Vec3} xj + * @param {Quaternion} qi + * @param {Quaternion} qj + * @param {Body} bi + * @param {Body} bj + */ +Narrowphase.prototype[Shape.types.SPHERE] = +Narrowphase.prototype.sphereSphere = function(si,sj,xi,xj,qi,qj,bi,bj,rsi,rsj,justTest){ + if(justTest){ + return xi.distanceSquared(xj) < Math.pow(si.radius + sj.radius, 2); + } + + // We will have only one contact in this case + var r = this.createContactEquation(bi,bj,si,sj,rsi,rsj); + + // Contact normal + xj.vsub(xi, r.ni); + r.ni.normalize(); + + // Contact point locations + r.ri.copy(r.ni); + r.rj.copy(r.ni); + r.ri.mult(si.radius, r.ri); + r.rj.mult(-sj.radius, r.rj); + + r.ri.vadd(xi, r.ri); + r.ri.vsub(bi.position, r.ri); + + r.rj.vadd(xj, r.rj); + r.rj.vsub(bj.position, r.rj); + + this.result.push(r); + + this.createFrictionEquationsFromContact(r, this.frictionResult); +}; + +/** + * @method planeTrimesh + * @param {Shape} si + * @param {Shape} sj + * @param {Vec3} xi + * @param {Vec3} xj + * @param {Quaternion} qi + * @param {Quaternion} qj + * @param {Body} bi + * @param {Body} bj + */ +var planeTrimesh_normal = new Vec3(); +var planeTrimesh_relpos = new Vec3(); +var planeTrimesh_projected = new Vec3(); +Narrowphase.prototype[Shape.types.PLANE | Shape.types.TRIMESH] = +Narrowphase.prototype.planeTrimesh = function( + planeShape, + trimeshShape, + planePos, + trimeshPos, + planeQuat, + trimeshQuat, + planeBody, + trimeshBody, + rsi, + rsj, + justTest +){ + // Make contacts! + var v = new Vec3(); + + var normal = planeTrimesh_normal; + normal.set(0,0,1); + planeQuat.vmult(normal,normal); // Turn normal according to plane + + for(var i=0; i 0 && positionAlongEdgeB < 0){ + + // Now check the orthogonal distance from edge to sphere center + localSpherePos.vsub(edgeVertexA, tmp); + + edgeVectorUnit.copy(edgeVector); + edgeVectorUnit.normalize(); + positionAlongEdgeA = tmp.dot(edgeVectorUnit); + + edgeVectorUnit.scale(positionAlongEdgeA, tmp); + tmp.vadd(edgeVertexA, tmp); + + // tmp is now the sphere center position projected to the edge, defined locally in the trimesh frame + var dist = tmp.distanceTo(localSpherePos); + if(dist < sphereShape.radius){ + + if(justTest){ + return true; + } + + var r = this.createContactEquation(sphereBody, trimeshBody, sphereShape, trimeshShape,rsi,rsj); + + tmp.vsub(localSpherePos, r.ni); + r.ni.normalize(); + r.ni.scale(sphereShape.radius, r.ri); + r.ri.vadd(spherePos, r.ri); + r.ri.vsub(sphereBody.position, r.ri); + + Transform.pointToWorldFrame(trimeshPos, trimeshQuat, tmp, tmp); + tmp.vsub(trimeshBody.position, r.rj); + + Transform.vectorToWorldFrame(trimeshQuat, r.ni, r.ni); + Transform.vectorToWorldFrame(trimeshQuat, r.ri, r.ri); + + this.result.push(r); + this.createFrictionEquationsFromContact(r, this.frictionResult); + } + } + } + } + + // Triangle faces + var va = sphereTrimesh_va; + var vb = sphereTrimesh_vb; + var vc = sphereTrimesh_vc; + var normal = sphereTrimesh_normal; + for(var i=0, N = triangles.length; i !== N; i++){ + trimeshShape.getTriangleVertices(triangles[i], va, vb, vc); + trimeshShape.getNormal(triangles[i], normal); + localSpherePos.vsub(va, tmp); + var dist = tmp.dot(normal); + normal.scale(dist, tmp); + localSpherePos.vsub(tmp, tmp); + + // tmp is now the sphere position projected to the triangle plane + dist = tmp.distanceTo(localSpherePos); + if(Ray.pointInTriangle(tmp, va, vb, vc) && dist < sphereShape.radius){ + if(justTest){ + return true; + } + var r = this.createContactEquation(sphereBody, trimeshBody, sphereShape, trimeshShape,rsi,rsj); + + tmp.vsub(localSpherePos, r.ni); + r.ni.normalize(); + r.ni.scale(sphereShape.radius, r.ri); + r.ri.vadd(spherePos, r.ri); + r.ri.vsub(sphereBody.position, r.ri); + + Transform.pointToWorldFrame(trimeshPos, trimeshQuat, tmp, tmp); + tmp.vsub(trimeshBody.position, r.rj); + + Transform.vectorToWorldFrame(trimeshQuat, r.ni, r.ni); + Transform.vectorToWorldFrame(trimeshQuat, r.ri, r.ri); + + this.result.push(r); + this.createFrictionEquationsFromContact(r, this.frictionResult); + } + } + + triangles.length = 0; +}; + +var point_on_plane_to_sphere = new Vec3(); +var plane_to_sphere_ortho = new Vec3(); + +/** + * @method spherePlane + * @param {Shape} si + * @param {Shape} sj + * @param {Vec3} xi + * @param {Vec3} xj + * @param {Quaternion} qi + * @param {Quaternion} qj + * @param {Body} bi + * @param {Body} bj + */ +Narrowphase.prototype[Shape.types.SPHERE | Shape.types.PLANE] = +Narrowphase.prototype.spherePlane = function(si,sj,xi,xj,qi,qj,bi,bj,rsi,rsj,justTest){ + // We will have one contact in this case + var r = this.createContactEquation(bi,bj,si,sj,rsi,rsj); + + // Contact normal + r.ni.set(0,0,1); + qj.vmult(r.ni, r.ni); + r.ni.negate(r.ni); // body i is the sphere, flip normal + r.ni.normalize(); // Needed? + + // Vector from sphere center to contact point + r.ni.mult(si.radius, r.ri); + + // Project down sphere on plane + xi.vsub(xj, point_on_plane_to_sphere); + r.ni.mult(r.ni.dot(point_on_plane_to_sphere), plane_to_sphere_ortho); + point_on_plane_to_sphere.vsub(plane_to_sphere_ortho,r.rj); // The sphere position projected to plane + + if(-point_on_plane_to_sphere.dot(r.ni) <= si.radius){ + + if(justTest){ + return true; + } + + // Make it relative to the body + var ri = r.ri; + var rj = r.rj; + ri.vadd(xi, ri); + ri.vsub(bi.position, ri); + rj.vadd(xj, rj); + rj.vsub(bj.position, rj); + + this.result.push(r); + this.createFrictionEquationsFromContact(r, this.frictionResult); + } +}; + +// See http://bulletphysics.com/Bullet/BulletFull/SphereTriangleDetector_8cpp_source.html +var pointInPolygon_edge = new Vec3(); +var pointInPolygon_edge_x_normal = new Vec3(); +var pointInPolygon_vtp = new Vec3(); +function pointInPolygon(verts, normal, p){ + var positiveResult = null; + var N = verts.length; + for(var i=0; i!==N; i++){ + var v = verts[i]; + + // Get edge to the next vertex + var edge = pointInPolygon_edge; + verts[(i+1) % (N)].vsub(v,edge); + + // Get cross product between polygon normal and the edge + var edge_x_normal = pointInPolygon_edge_x_normal; + //var edge_x_normal = new Vec3(); + edge.cross(normal,edge_x_normal); + + // Get vector between point and current vertex + var vertex_to_p = pointInPolygon_vtp; + p.vsub(v,vertex_to_p); + + // This dot product determines which side of the edge the point is + var r = edge_x_normal.dot(vertex_to_p); + + // If all such dot products have same sign, we are inside the polygon. + if(positiveResult===null || (r>0 && positiveResult===true) || (r<=0 && positiveResult===false)){ + if(positiveResult===null){ + positiveResult = r>0; + } + continue; + } else { + return false; // Encountered some other sign. Exit. + } + } + + // If we got here, all dot products were of the same sign. + return true; +} + +var box_to_sphere = new Vec3(); +var sphereBox_ns = new Vec3(); +var sphereBox_ns1 = new Vec3(); +var sphereBox_ns2 = new Vec3(); +var sphereBox_sides = [new Vec3(),new Vec3(),new Vec3(),new Vec3(),new Vec3(),new Vec3()]; +var sphereBox_sphere_to_corner = new Vec3(); +var sphereBox_side_ns = new Vec3(); +var sphereBox_side_ns1 = new Vec3(); +var sphereBox_side_ns2 = new Vec3(); + +/** + * @method sphereBox + * @param {Shape} si + * @param {Shape} sj + * @param {Vec3} xi + * @param {Vec3} xj + * @param {Quaternion} qi + * @param {Quaternion} qj + * @param {Body} bi + * @param {Body} bj + */ +Narrowphase.prototype[Shape.types.SPHERE | Shape.types.BOX] = +Narrowphase.prototype.sphereBox = function(si,sj,xi,xj,qi,qj,bi,bj,rsi,rsj,justTest){ + var v3pool = this.v3pool; + + // we refer to the box as body j + var sides = sphereBox_sides; + xi.vsub(xj,box_to_sphere); + sj.getSideNormals(sides,qj); + var R = si.radius; + var penetrating_sides = []; + + // Check side (plane) intersections + var found = false; + + // Store the resulting side penetration info + var side_ns = sphereBox_side_ns; + var side_ns1 = sphereBox_side_ns1; + var side_ns2 = sphereBox_side_ns2; + var side_h = null; + var side_penetrations = 0; + var side_dot1 = 0; + var side_dot2 = 0; + var side_distance = null; + for(var idx=0,nsides=sides.length; idx!==nsides && found===false; idx++){ + // Get the plane side normal (ns) + var ns = sphereBox_ns; + ns.copy(sides[idx]); + + var h = ns.norm(); + ns.normalize(); + + // The normal/distance dot product tells which side of the plane we are + var dot = box_to_sphere.dot(ns); + + if(dot0){ + // Intersects plane. Now check the other two dimensions + var ns1 = sphereBox_ns1; + var ns2 = sphereBox_ns2; + ns1.copy(sides[(idx+1)%3]); + ns2.copy(sides[(idx+2)%3]); + var h1 = ns1.norm(); + var h2 = ns2.norm(); + ns1.normalize(); + ns2.normalize(); + var dot1 = box_to_sphere.dot(ns1); + var dot2 = box_to_sphere.dot(ns2); + if(dot1

    -h1 && dot2

    -h2){ + var dist = Math.abs(dot-h-R); + if(side_distance===null || dist < side_distance){ + side_distance = dist; + side_dot1 = dot1; + side_dot2 = dot2; + side_h = h; + side_ns.copy(ns); + side_ns1.copy(ns1); + side_ns2.copy(ns2); + side_penetrations++; + + if(justTest){ + return true; + } + } + } + } + } + if(side_penetrations){ + found = true; + var r = this.createContactEquation(bi,bj,si,sj,rsi,rsj); + side_ns.mult(-R,r.ri); // Sphere r + r.ni.copy(side_ns); + r.ni.negate(r.ni); // Normal should be out of sphere + side_ns.mult(side_h,side_ns); + side_ns1.mult(side_dot1,side_ns1); + side_ns.vadd(side_ns1,side_ns); + side_ns2.mult(side_dot2,side_ns2); + side_ns.vadd(side_ns2,r.rj); + + // Make relative to bodies + r.ri.vadd(xi, r.ri); + r.ri.vsub(bi.position, r.ri); + r.rj.vadd(xj, r.rj); + r.rj.vsub(bj.position, r.rj); + + this.result.push(r); + this.createFrictionEquationsFromContact(r, this.frictionResult); + } + + // Check corners + var rj = v3pool.get(); + var sphere_to_corner = sphereBox_sphere_to_corner; + for(var j=0; j!==2 && !found; j++){ + for(var k=0; k!==2 && !found; k++){ + for(var l=0; l!==2 && !found; l++){ + rj.set(0,0,0); + if(j){ + rj.vadd(sides[0],rj); + } else { + rj.vsub(sides[0],rj); + } + if(k){ + rj.vadd(sides[1],rj); + } else { + rj.vsub(sides[1],rj); + } + if(l){ + rj.vadd(sides[2],rj); + } else { + rj.vsub(sides[2],rj); + } + + // World position of corner + xj.vadd(rj,sphere_to_corner); + sphere_to_corner.vsub(xi,sphere_to_corner); + + if(sphere_to_corner.norm2() < R*R){ + if(justTest){ + return true; + } + found = true; + var r = this.createContactEquation(bi,bj,si,sj,rsi,rsj); + r.ri.copy(sphere_to_corner); + r.ri.normalize(); + r.ni.copy(r.ri); + r.ri.mult(R,r.ri); + r.rj.copy(rj); + + // Make relative to bodies + r.ri.vadd(xi, r.ri); + r.ri.vsub(bi.position, r.ri); + r.rj.vadd(xj, r.rj); + r.rj.vsub(bj.position, r.rj); + + this.result.push(r); + this.createFrictionEquationsFromContact(r, this.frictionResult); + } + } + } + } + v3pool.release(rj); + rj = null; + + // Check edges + var edgeTangent = v3pool.get(); + var edgeCenter = v3pool.get(); + var r = v3pool.get(); // r = edge center to sphere center + var orthogonal = v3pool.get(); + var dist = v3pool.get(); + var Nsides = sides.length; + for(var j=0; j!==Nsides && !found; j++){ + for(var k=0; k!==Nsides && !found; k++){ + if(j%3 !== k%3){ + // Get edge tangent + sides[k].cross(sides[j],edgeTangent); + edgeTangent.normalize(); + sides[j].vadd(sides[k], edgeCenter); + r.copy(xi); + r.vsub(edgeCenter,r); + r.vsub(xj,r); + var orthonorm = r.dot(edgeTangent); // distance from edge center to sphere center in the tangent direction + edgeTangent.mult(orthonorm,orthogonal); // Vector from edge center to sphere center in the tangent direction + + // Find the third side orthogonal to this one + var l = 0; + while(l===j%3 || l===k%3){ + l++; + } + + // vec from edge center to sphere projected to the plane orthogonal to the edge tangent + dist.copy(xi); + dist.vsub(orthogonal,dist); + dist.vsub(edgeCenter,dist); + dist.vsub(xj,dist); + + // Distances in tangent direction and distance in the plane orthogonal to it + var tdist = Math.abs(orthonorm); + var ndist = dist.norm(); + + if(tdist < sides[l].norm() && ndist si.boundingSphereRadius + sj.boundingSphereRadius){ + // return; + // } + + // Check corners + for(var i=0; i!==verts.length; i++){ + var v = verts[i]; + + // World position of corner + var worldCorner = sphereConvex_worldCorner; + qj.vmult(v,worldCorner); + xj.vadd(worldCorner,worldCorner); + var sphere_to_corner = sphereConvex_sphereToCorner; + worldCorner.vsub(xi, sphere_to_corner); + if(sphere_to_corner.norm2() < R * R){ + if(justTest){ + return true; + } + found = true; + var r = this.createContactEquation(bi,bj,si,sj,rsi,rsj); + r.ri.copy(sphere_to_corner); + r.ri.normalize(); + r.ni.copy(r.ri); + r.ri.mult(R,r.ri); + worldCorner.vsub(xj,r.rj); + + // Should be relative to the body. + r.ri.vadd(xi, r.ri); + r.ri.vsub(bi.position, r.ri); + + // Should be relative to the body. + r.rj.vadd(xj, r.rj); + r.rj.vsub(bj.position, r.rj); + + this.result.push(r); + this.createFrictionEquationsFromContact(r, this.frictionResult); + return; + } + } + + // Check side (plane) intersections + var found = false; + for(var i=0, nfaces=faces.length; i!==nfaces && found===false; i++){ + var normal = normals[i]; + var face = faces[i]; + + // Get world-transformed normal of the face + var worldNormal = sphereConvex_worldNormal; + qj.vmult(normal,worldNormal); + + // Get a world vertex from the face + var worldPoint = sphereConvex_worldPoint; + qj.vmult(verts[face[0]],worldPoint); + worldPoint.vadd(xj,worldPoint); + + // Get a point on the sphere, closest to the face normal + var worldSpherePointClosestToPlane = sphereConvex_worldSpherePointClosestToPlane; + worldNormal.mult(-R, worldSpherePointClosestToPlane); + xi.vadd(worldSpherePointClosestToPlane, worldSpherePointClosestToPlane); + + // Vector from a face point to the closest point on the sphere + var penetrationVec = sphereConvex_penetrationVec; + worldSpherePointClosestToPlane.vsub(worldPoint,penetrationVec); + + // The penetration. Negative value means overlap. + var penetration = penetrationVec.dot(worldNormal); + + var worldPointToSphere = sphereConvex_sphereToWorldPoint; + xi.vsub(worldPoint, worldPointToSphere); + + if(penetration < 0 && worldPointToSphere.dot(worldNormal)>0){ + // Intersects plane. Now check if the sphere is inside the face polygon + var faceVerts = []; // Face vertices, in world coords + for(var j=0, Nverts=face.length; j!==Nverts; j++){ + var worldVertex = v3pool.get(); + qj.vmult(verts[face[j]], worldVertex); + xj.vadd(worldVertex,worldVertex); + faceVerts.push(worldVertex); + } + + if(pointInPolygon(faceVerts,worldNormal,xi)){ // Is the sphere center in the face polygon? + if(justTest){ + return true; + } + found = true; + var r = this.createContactEquation(bi,bj,si,sj,rsi,rsj); + + worldNormal.mult(-R, r.ri); // Contact offset, from sphere center to contact + worldNormal.negate(r.ni); // Normal pointing out of sphere + + var penetrationVec2 = v3pool.get(); + worldNormal.mult(-penetration, penetrationVec2); + var penetrationSpherePoint = v3pool.get(); + worldNormal.mult(-R, penetrationSpherePoint); + + //xi.vsub(xj).vadd(penetrationSpherePoint).vadd(penetrationVec2 , r.rj); + xi.vsub(xj,r.rj); + r.rj.vadd(penetrationSpherePoint,r.rj); + r.rj.vadd(penetrationVec2 , r.rj); + + // Should be relative to the body. + r.rj.vadd(xj, r.rj); + r.rj.vsub(bj.position, r.rj); + + // Should be relative to the body. + r.ri.vadd(xi, r.ri); + r.ri.vsub(bi.position, r.ri); + + v3pool.release(penetrationVec2); + v3pool.release(penetrationSpherePoint); + + this.result.push(r); + this.createFrictionEquationsFromContact(r, this.frictionResult); + + // Release world vertices + for(var j=0, Nfaceverts=faceVerts.length; j!==Nfaceverts; j++){ + v3pool.release(faceVerts[j]); + } + + return; // We only expect *one* face contact + } else { + // Edge? + for(var j=0; j!==face.length; j++){ + + // Get two world transformed vertices + var v1 = v3pool.get(); + var v2 = v3pool.get(); + qj.vmult(verts[face[(j+1)%face.length]], v1); + qj.vmult(verts[face[(j+2)%face.length]], v2); + xj.vadd(v1, v1); + xj.vadd(v2, v2); + + // Construct edge vector + var edge = sphereConvex_edge; + v2.vsub(v1,edge); + + // Construct the same vector, but normalized + var edgeUnit = sphereConvex_edgeUnit; + edge.unit(edgeUnit); + + // p is xi projected onto the edge + var p = v3pool.get(); + var v1_to_xi = v3pool.get(); + xi.vsub(v1, v1_to_xi); + var dot = v1_to_xi.dot(edgeUnit); + edgeUnit.mult(dot, p); + p.vadd(v1, p); + + // Compute a vector from p to the center of the sphere + var xi_to_p = v3pool.get(); + p.vsub(xi, xi_to_p); + + // Collision if the edge-sphere distance is less than the radius + // AND if p is in between v1 and v2 + if(dot > 0 && dot*dot si.boundingSphereRadius + sj.boundingSphereRadius){ + return; + } + + if(si.findSeparatingAxis(sj,xi,qi,xj,qj,sepAxis,faceListA,faceListB)){ + var res = []; + var q = convexConvex_q; + si.clipAgainstHull(xi,qi,sj,xj,qj,sepAxis,-100,100,res); + var numContacts = 0; + for(var j = 0; j !== res.length; j++){ + if(justTest){ + return true; + } + var r = this.createContactEquation(bi,bj,si,sj,rsi,rsj), + ri = r.ri, + rj = r.rj; + sepAxis.negate(r.ni); + res[j].normal.negate(q); + q.mult(res[j].depth, q); + res[j].point.vadd(q, ri); + rj.copy(res[j].point); + + // Contact points are in world coordinates. Transform back to relative + ri.vsub(xi,ri); + rj.vsub(xj,rj); + + // Make relative to bodies + ri.vadd(xi, ri); + ri.vsub(bi.position, ri); + rj.vadd(xj, rj); + rj.vsub(bj.position, rj); + + this.result.push(r); + numContacts++; + if(!this.enableFrictionReduction){ + this.createFrictionEquationsFromContact(r, this.frictionResult); + } + } + if(this.enableFrictionReduction && numContacts){ + this.createFrictionFromAverage(numContacts); + } + } +}; + + +/** + * @method convexTrimesh + * @param {Array} result + * @param {Shape} si + * @param {Shape} sj + * @param {Vec3} xi + * @param {Vec3} xj + * @param {Quaternion} qi + * @param {Quaternion} qj + * @param {Body} bi + * @param {Body} bj + */ +// Narrowphase.prototype[Shape.types.CONVEXPOLYHEDRON | Shape.types.TRIMESH] = +// Narrowphase.prototype.convexTrimesh = function(si,sj,xi,xj,qi,qj,bi,bj,rsi,rsj,faceListA,faceListB){ +// var sepAxis = convexConvex_sepAxis; + +// if(xi.distanceTo(xj) > si.boundingSphereRadius + sj.boundingSphereRadius){ +// return; +// } + +// // Construct a temp hull for each triangle +// var hullB = new ConvexPolyhedron(); + +// hullB.faces = [[0,1,2]]; +// var va = new Vec3(); +// var vb = new Vec3(); +// var vc = new Vec3(); +// hullB.vertices = [ +// va, +// vb, +// vc +// ]; + +// for (var i = 0; i < sj.indices.length / 3; i++) { + +// var triangleNormal = new Vec3(); +// sj.getNormal(i, triangleNormal); +// hullB.faceNormals = [triangleNormal]; + +// sj.getTriangleVertices(i, va, vb, vc); + +// var d = si.testSepAxis(triangleNormal, hullB, xi, qi, xj, qj); +// if(!d){ +// triangleNormal.scale(-1, triangleNormal); +// d = si.testSepAxis(triangleNormal, hullB, xi, qi, xj, qj); + +// if(!d){ +// continue; +// } +// } + +// var res = []; +// var q = convexConvex_q; +// si.clipAgainstHull(xi,qi,hullB,xj,qj,triangleNormal,-100,100,res); +// for(var j = 0; j !== res.length; j++){ +// var r = this.createContactEquation(bi,bj,si,sj,rsi,rsj), +// ri = r.ri, +// rj = r.rj; +// r.ni.copy(triangleNormal); +// r.ni.negate(r.ni); +// res[j].normal.negate(q); +// q.mult(res[j].depth, q); +// res[j].point.vadd(q, ri); +// rj.copy(res[j].point); + +// // Contact points are in world coordinates. Transform back to relative +// ri.vsub(xi,ri); +// rj.vsub(xj,rj); + +// // Make relative to bodies +// ri.vadd(xi, ri); +// ri.vsub(bi.position, ri); +// rj.vadd(xj, rj); +// rj.vsub(bj.position, rj); + +// result.push(r); +// } +// } +// }; + +var particlePlane_normal = new Vec3(); +var particlePlane_relpos = new Vec3(); +var particlePlane_projected = new Vec3(); + +/** + * @method particlePlane + * @param {Array} result + * @param {Shape} si + * @param {Shape} sj + * @param {Vec3} xi + * @param {Vec3} xj + * @param {Quaternion} qi + * @param {Quaternion} qj + * @param {Body} bi + * @param {Body} bj + */ +Narrowphase.prototype[Shape.types.PLANE | Shape.types.PARTICLE] = +Narrowphase.prototype.planeParticle = function(sj,si,xj,xi,qj,qi,bj,bi,rsi,rsj,justTest){ + var normal = particlePlane_normal; + normal.set(0,0,1); + bj.quaternion.vmult(normal,normal); // Turn normal according to plane orientation + var relpos = particlePlane_relpos; + xi.vsub(bj.position,relpos); + var dot = normal.dot(relpos); + if(dot <= 0.0){ + + if(justTest){ + return true; + } + + var r = this.createContactEquation(bi,bj,si,sj,rsi,rsj); + r.ni.copy(normal); // Contact normal is the plane normal + r.ni.negate(r.ni); + r.ri.set(0,0,0); // Center of particle + + // Get particle position projected on plane + var projected = particlePlane_projected; + normal.mult(normal.dot(xi),projected); + xi.vsub(projected,projected); + //projected.vadd(bj.position,projected); + + // rj is now the projected world position minus plane position + r.rj.copy(projected); + this.result.push(r); + this.createFrictionEquationsFromContact(r, this.frictionResult); + } +}; + +var particleSphere_normal = new Vec3(); + +/** + * @method particleSphere + * @param {Array} result + * @param {Shape} si + * @param {Shape} sj + * @param {Vec3} xi + * @param {Vec3} xj + * @param {Quaternion} qi + * @param {Quaternion} qj + * @param {Body} bi + * @param {Body} bj + */ +Narrowphase.prototype[Shape.types.PARTICLE | Shape.types.SPHERE] = +Narrowphase.prototype.sphereParticle = function(sj,si,xj,xi,qj,qi,bj,bi,rsi,rsj,justTest){ + // The normal is the unit vector from sphere center to particle center + var normal = particleSphere_normal; + normal.set(0,0,1); + xi.vsub(xj,normal); + var lengthSquared = normal.norm2(); + + if(lengthSquared <= sj.radius * sj.radius){ + if(justTest){ + return true; + } + var r = this.createContactEquation(bi,bj,si,sj,rsi,rsj); + normal.normalize(); + r.rj.copy(normal); + r.rj.mult(sj.radius,r.rj); + r.ni.copy(normal); // Contact normal + r.ni.negate(r.ni); + r.ri.set(0,0,0); // Center of particle + this.result.push(r); + this.createFrictionEquationsFromContact(r, this.frictionResult); + } +}; + +// WIP +var cqj = new Quaternion(); +var convexParticle_local = new Vec3(); +var convexParticle_normal = new Vec3(); +var convexParticle_penetratedFaceNormal = new Vec3(); +var convexParticle_vertexToParticle = new Vec3(); +var convexParticle_worldPenetrationVec = new Vec3(); + +/** + * @method convexParticle + * @param {Array} result + * @param {Shape} si + * @param {Shape} sj + * @param {Vec3} xi + * @param {Vec3} xj + * @param {Quaternion} qi + * @param {Quaternion} qj + * @param {Body} bi + * @param {Body} bj + */ +Narrowphase.prototype[Shape.types.PARTICLE | Shape.types.CONVEXPOLYHEDRON] = +Narrowphase.prototype.convexParticle = function(sj,si,xj,xi,qj,qi,bj,bi,rsi,rsj,justTest){ + var penetratedFaceIndex = -1; + var penetratedFaceNormal = convexParticle_penetratedFaceNormal; + var worldPenetrationVec = convexParticle_worldPenetrationVec; + var minPenetration = null; + var numDetectedFaces = 0; + + // Convert particle position xi to local coords in the convex + var local = convexParticle_local; + local.copy(xi); + local.vsub(xj,local); // Convert position to relative the convex origin + qj.conjugate(cqj); + cqj.vmult(local,local); + + if(sj.pointIsInside(local)){ + + if(sj.worldVerticesNeedsUpdate){ + sj.computeWorldVertices(xj,qj); + } + if(sj.worldFaceNormalsNeedsUpdate){ + sj.computeWorldFaceNormals(qj); + } + + // For each world polygon in the polyhedra + for(var i=0,nfaces=sj.faces.length; i!==nfaces; i++){ + + // Construct world face vertices + var verts = [ sj.worldVertices[ sj.faces[i][0] ] ]; + var normal = sj.worldFaceNormals[i]; + + // Check how much the particle penetrates the polygon plane. + xi.vsub(verts[0],convexParticle_vertexToParticle); + var penetration = -normal.dot(convexParticle_vertexToParticle); + if(minPenetration===null || Math.abs(penetration) data.length || iMinY > data[0].length){ + return; + } + + // Clamp index to edges + if(iMinX < 0){ iMinX = 0; } + if(iMaxX < 0){ iMaxX = 0; } + if(iMinY < 0){ iMinY = 0; } + if(iMaxY < 0){ iMaxY = 0; } + if(iMinX >= data.length){ iMinX = data.length - 1; } + if(iMaxX >= data.length){ iMaxX = data.length - 1; } + if(iMaxY >= data[0].length){ iMaxY = data[0].length - 1; } + if(iMinY >= data[0].length){ iMinY = data[0].length - 1; } + + var minMax = []; + hfShape.getRectMinMax(iMinX, iMinY, iMaxX, iMaxY, minMax); + var min = minMax[0]; + var max = minMax[1]; + + // Bail out if we're cant touch the bounding height box + if(localConvexPos.z - radius > max || localConvexPos.z + radius < min){ + return; + } + + for(var i = iMinX; i < iMaxX; i++){ + for(var j = iMinY; j < iMaxY; j++){ + + var intersecting = false; + + // Lower triangle + hfShape.getConvexTrianglePillar(i, j, false); + Transform.pointToWorldFrame(hfPos, hfQuat, hfShape.pillarOffset, worldPillarOffset); + if (convexPos.distanceTo(worldPillarOffset) < hfShape.pillarConvex.boundingSphereRadius + convexShape.boundingSphereRadius) { + intersecting = this.convexConvex(convexShape, hfShape.pillarConvex, convexPos, worldPillarOffset, convexQuat, hfQuat, convexBody, hfBody, null, null, justTest, faceList, null); + } + + if(justTest && intersecting){ + return true; + } + + // Upper triangle + hfShape.getConvexTrianglePillar(i, j, true); + Transform.pointToWorldFrame(hfPos, hfQuat, hfShape.pillarOffset, worldPillarOffset); + if (convexPos.distanceTo(worldPillarOffset) < hfShape.pillarConvex.boundingSphereRadius + convexShape.boundingSphereRadius) { + intersecting = this.convexConvex(convexShape, hfShape.pillarConvex, convexPos, worldPillarOffset, convexQuat, hfQuat, convexBody, hfBody, null, null, justTest, faceList, null); + } + + if(justTest && intersecting){ + return true; + } + } + } +}; + +var sphereHeightfield_tmp1 = new Vec3(); +var sphereHeightfield_tmp2 = new Vec3(); + +/** + * @method sphereHeightfield + */ +Narrowphase.prototype[Shape.types.SPHERE | Shape.types.HEIGHTFIELD] = +Narrowphase.prototype.sphereHeightfield = function ( + sphereShape, + hfShape, + spherePos, + hfPos, + sphereQuat, + hfQuat, + sphereBody, + hfBody, + rsi, + rsj, + justTest +){ + var data = hfShape.data, + radius = sphereShape.radius, + w = hfShape.elementSize, + worldPillarOffset = sphereHeightfield_tmp2; + + // Get sphere position to heightfield local! + var localSpherePos = sphereHeightfield_tmp1; + Transform.pointToLocalFrame(hfPos, hfQuat, spherePos, localSpherePos); + + // Get the index of the data points to test against + var iMinX = Math.floor((localSpherePos.x - radius) / w) - 1, + iMaxX = Math.ceil((localSpherePos.x + radius) / w) + 1, + iMinY = Math.floor((localSpherePos.y - radius) / w) - 1, + iMaxY = Math.ceil((localSpherePos.y + radius) / w) + 1; + + // Bail out if we are out of the terrain + if(iMaxX < 0 || iMaxY < 0 || iMinX > data.length || iMinY > data[0].length){ + return; + } + + // Clamp index to edges + if(iMinX < 0){ iMinX = 0; } + if(iMaxX < 0){ iMaxX = 0; } + if(iMinY < 0){ iMinY = 0; } + if(iMaxY < 0){ iMaxY = 0; } + if(iMinX >= data.length){ iMinX = data.length - 1; } + if(iMaxX >= data.length){ iMaxX = data.length - 1; } + if(iMaxY >= data[0].length){ iMaxY = data[0].length - 1; } + if(iMinY >= data[0].length){ iMinY = data[0].length - 1; } + + var minMax = []; + hfShape.getRectMinMax(iMinX, iMinY, iMaxX, iMaxY, minMax); + var min = minMax[0]; + var max = minMax[1]; + + // Bail out if we're cant touch the bounding height box + if(localSpherePos.z - radius > max || localSpherePos.z + radius < min){ + return; + } + + var result = this.result; + for(var i = iMinX; i < iMaxX; i++){ + for(var j = iMinY; j < iMaxY; j++){ + + var numContactsBefore = result.length; + + var intersecting = false; + + // Lower triangle + hfShape.getConvexTrianglePillar(i, j, false); + Transform.pointToWorldFrame(hfPos, hfQuat, hfShape.pillarOffset, worldPillarOffset); + if (spherePos.distanceTo(worldPillarOffset) < hfShape.pillarConvex.boundingSphereRadius + sphereShape.boundingSphereRadius) { + intersecting = this.sphereConvex(sphereShape, hfShape.pillarConvex, spherePos, worldPillarOffset, sphereQuat, hfQuat, sphereBody, hfBody, sphereShape, hfShape, justTest); + } + + if(justTest && intersecting){ + return true; + } + + // Upper triangle + hfShape.getConvexTrianglePillar(i, j, true); + Transform.pointToWorldFrame(hfPos, hfQuat, hfShape.pillarOffset, worldPillarOffset); + if (spherePos.distanceTo(worldPillarOffset) < hfShape.pillarConvex.boundingSphereRadius + sphereShape.boundingSphereRadius) { + intersecting = this.sphereConvex(sphereShape, hfShape.pillarConvex, spherePos, worldPillarOffset, sphereQuat, hfQuat, sphereBody, hfBody, sphereShape, hfShape, justTest); + } + + if(justTest && intersecting){ + return true; + } + + var numContacts = result.length - numContactsBefore; + + if(numContacts > 2){ + return; + } + /* + // Skip all but 1 + for (var k = 0; k < numContacts - 1; k++) { + result.pop(); + } + */ + } + } +}; + +},{"../collision/AABB":3,"../collision/Ray":10,"../equations/ContactEquation":20,"../equations/FrictionEquation":22,"../math/Quaternion":29,"../math/Transform":30,"../math/Vec3":31,"../objects/Body":32,"../shapes/ConvexPolyhedron":39,"../shapes/Shape":44,"../solver/Solver":48,"../utils/Vec3Pool":55}],57:[function(_dereq_,module,exports){ +/* global performance */ + +module.exports = World; + +var Shape = _dereq_('../shapes/Shape'); +var Vec3 = _dereq_('../math/Vec3'); +var Quaternion = _dereq_('../math/Quaternion'); +var GSSolver = _dereq_('../solver/GSSolver'); +var ContactEquation = _dereq_('../equations/ContactEquation'); +var FrictionEquation = _dereq_('../equations/FrictionEquation'); +var Narrowphase = _dereq_('./Narrowphase'); +var EventTarget = _dereq_('../utils/EventTarget'); +var ArrayCollisionMatrix = _dereq_('../collision/ArrayCollisionMatrix'); +var OverlapKeeper = _dereq_('../collision/OverlapKeeper'); +var Material = _dereq_('../material/Material'); +var ContactMaterial = _dereq_('../material/ContactMaterial'); +var Body = _dereq_('../objects/Body'); +var TupleDictionary = _dereq_('../utils/TupleDictionary'); +var RaycastResult = _dereq_('../collision/RaycastResult'); +var AABB = _dereq_('../collision/AABB'); +var Ray = _dereq_('../collision/Ray'); +var NaiveBroadphase = _dereq_('../collision/NaiveBroadphase'); + +/** + * The physics world + * @class World + * @constructor + * @extends EventTarget + * @param {object} [options] + * @param {Vec3} [options.gravity] + * @param {boolean} [options.allowSleep] + * @param {Broadphase} [options.broadphase] + * @param {Solver} [options.solver] + * @param {boolean} [options.quatNormalizeFast] + * @param {number} [options.quatNormalizeSkip] + */ +function World(options){ + options = options || {}; + EventTarget.apply(this); + + /** + * Currently / last used timestep. Is set to -1 if not available. This value is updated before each internal step, which means that it is "fresh" inside event callbacks. + * @property {Number} dt + */ + this.dt = -1; + + /** + * Makes bodies go to sleep when they've been inactive + * @property allowSleep + * @type {Boolean} + * @default false + */ + this.allowSleep = !!options.allowSleep; + + /** + * All the current contacts (instances of ContactEquation) in the world. + * @property contacts + * @type {Array} + */ + this.contacts = []; + this.frictionEquations = []; + + /** + * How often to normalize quaternions. Set to 0 for every step, 1 for every second etc.. A larger value increases performance. If bodies tend to explode, set to a smaller value (zero to be sure nothing can go wrong). + * @property quatNormalizeSkip + * @type {Number} + * @default 0 + */ + this.quatNormalizeSkip = options.quatNormalizeSkip !== undefined ? options.quatNormalizeSkip : 0; + + /** + * Set to true to use fast quaternion normalization. It is often enough accurate to use. If bodies tend to explode, set to false. + * @property quatNormalizeFast + * @type {Boolean} + * @see Quaternion.normalizeFast + * @see Quaternion.normalize + * @default false + */ + this.quatNormalizeFast = options.quatNormalizeFast !== undefined ? options.quatNormalizeFast : false; + + /** + * The wall-clock time since simulation start + * @property time + * @type {Number} + */ + this.time = 0.0; + + + /** + * Factor for interpolation 0-1 + * @property interpolationFactor + * @type {Number} + */ + this.interpolationFactor = 0; + + + /** + * Number of timesteps taken since start + * @property stepnumber + * @type {Number} + */ + this.stepnumber = 0; + + /// Default and last timestep sizes + this.default_dt = 1/60; + + this.nextId = 0; + /** + * @property gravity + * @type {Vec3} + */ + this.gravity = new Vec3(); + if(options.gravity){ + this.gravity.copy(options.gravity); + } + + /** + * The broadphase algorithm to use. Default is NaiveBroadphase + * @property broadphase + * @type {Broadphase} + */ + this.broadphase = options.broadphase !== undefined ? options.broadphase : new NaiveBroadphase(); + + /** + * @property bodies + * @type {Array} + */ + this.bodies = []; + + /** + * The solver algorithm to use. Default is GSSolver + * @property solver + * @type {Solver} + */ + this.solver = options.solver !== undefined ? options.solver : new GSSolver(); + + /** + * @property constraints + * @type {Array} + */ + this.constraints = []; + + /** + * @property narrowphase + * @type {Narrowphase} + */ + this.narrowphase = new Narrowphase(this); + + /** + * @property {ArrayCollisionMatrix} collisionMatrix + * @type {ArrayCollisionMatrix} + */ + this.collisionMatrix = new ArrayCollisionMatrix(); + + /** + * CollisionMatrix from the previous step. + * @property {ArrayCollisionMatrix} collisionMatrixPrevious + * @type {ArrayCollisionMatrix} + */ + this.collisionMatrixPrevious = new ArrayCollisionMatrix(); + + this.bodyOverlapKeeper = new OverlapKeeper(); + this.shapeOverlapKeeper = new OverlapKeeper(); + + /** + * All added materials + * @property materials + * @type {Array} + */ + this.materials = []; + + /** + * @property contactmaterials + * @type {Array} + */ + this.contactmaterials = []; + + /** + * Used to look up a ContactMaterial given two instances of Material. + * @property {TupleDictionary} contactMaterialTable + */ + this.contactMaterialTable = new TupleDictionary(); + + this.defaultMaterial = new Material("default"); + + /** + * This contact material is used if no suitable contactmaterial is found for a contact. + * @property defaultContactMaterial + * @type {ContactMaterial} + */ + this.defaultContactMaterial = new ContactMaterial(this.defaultMaterial, this.defaultMaterial, { friction: 0.3, restitution: 0.0 }); + + /** + * @property doProfiling + * @type {Boolean} + */ + this.doProfiling = false; + + /** + * @property profile + * @type {Object} + */ + this.profile = { + solve:0, + makeContactConstraints:0, + broadphase:0, + integrate:0, + narrowphase:0, + }; + + /** + * Time accumulator for interpolation. See http://gafferongames.com/game-physics/fix-your-timestep/ + * @property {Number} accumulator + */ + this.accumulator = 0; + + /** + * @property subsystems + * @type {Array} + */ + this.subsystems = []; + + /** + * Dispatched after a body has been added to the world. + * @event addBody + * @param {Body} body The body that has been added to the world. + */ + this.addBodyEvent = { + type:"addBody", + body : null + }; + + /** + * Dispatched after a body has been removed from the world. + * @event removeBody + * @param {Body} body The body that has been removed from the world. + */ + this.removeBodyEvent = { + type:"removeBody", + body : null + }; + + this.idToBodyMap = {}; + + this.broadphase.setWorld(this); +} +World.prototype = new EventTarget(); + +// Temp stuff +var tmpAABB1 = new AABB(); +var tmpArray1 = []; +var tmpRay = new Ray(); + +/** + * Get the contact material between materials m1 and m2 + * @method getContactMaterial + * @param {Material} m1 + * @param {Material} m2 + * @return {ContactMaterial} The contact material if it was found. + */ +World.prototype.getContactMaterial = function(m1,m2){ + return this.contactMaterialTable.get(m1.id,m2.id); //this.contactmaterials[this.mats2cmat[i+j*this.materials.length]]; +}; + +/** + * Get number of objects in the world. + * @method numObjects + * @return {Number} + * @deprecated + */ +World.prototype.numObjects = function(){ + return this.bodies.length; +}; + +/** + * Store old collision state info + * @method collisionMatrixTick + */ +World.prototype.collisionMatrixTick = function(){ + var temp = this.collisionMatrixPrevious; + this.collisionMatrixPrevious = this.collisionMatrix; + this.collisionMatrix = temp; + this.collisionMatrix.reset(); + + this.bodyOverlapKeeper.tick(); + this.shapeOverlapKeeper.tick(); +}; + +/** + * Add a rigid body to the simulation. + * @method add + * @param {Body} body + * @todo If the simulation has not yet started, why recrete and copy arrays for each body? Accumulate in dynamic arrays in this case. + * @todo Adding an array of bodies should be possible. This would save some loops too + * @deprecated Use .addBody instead + */ +World.prototype.add = World.prototype.addBody = function(body){ + if(this.bodies.indexOf(body) !== -1){ + return; + } + body.index = this.bodies.length; + this.bodies.push(body); + body.world = this; + body.initPosition.copy(body.position); + body.initVelocity.copy(body.velocity); + body.timeLastSleepy = this.time; + if(body instanceof Body){ + body.initAngularVelocity.copy(body.angularVelocity); + body.initQuaternion.copy(body.quaternion); + } + this.collisionMatrix.setNumObjects(this.bodies.length); + this.addBodyEvent.body = body; + this.idToBodyMap[body.id] = body; + this.dispatchEvent(this.addBodyEvent); +}; + +/** + * Add a constraint to the simulation. + * @method addConstraint + * @param {Constraint} c + */ +World.prototype.addConstraint = function(c){ + this.constraints.push(c); +}; + +/** + * Removes a constraint + * @method removeConstraint + * @param {Constraint} c + */ +World.prototype.removeConstraint = function(c){ + var idx = this.constraints.indexOf(c); + if(idx!==-1){ + this.constraints.splice(idx,1); + } +}; + +/** + * Raycast test + * @method rayTest + * @param {Vec3} from + * @param {Vec3} to + * @param {RaycastResult} result + * @deprecated Use .raycastAll, .raycastClosest or .raycastAny instead. + */ +World.prototype.rayTest = function(from, to, result){ + if(result instanceof RaycastResult){ + // Do raycastclosest + this.raycastClosest(from, to, { + skipBackfaces: true + }, result); + } else { + // Do raycastAll + this.raycastAll(from, to, { + skipBackfaces: true + }, result); + } +}; + +/** + * Ray cast against all bodies. The provided callback will be executed for each hit with a RaycastResult as single argument. + * @method raycastAll + * @param {Vec3} from + * @param {Vec3} to + * @param {Object} options + * @param {number} [options.collisionFilterMask=-1] + * @param {number} [options.collisionFilterGroup=-1] + * @param {boolean} [options.skipBackfaces=false] + * @param {boolean} [options.checkCollisionResponse=true] + * @param {Function} callback + * @return {boolean} True if any body was hit. + */ +World.prototype.raycastAll = function(from, to, options, callback){ + options.mode = Ray.ALL; + options.from = from; + options.to = to; + options.callback = callback; + return tmpRay.intersectWorld(this, options); +}; + +/** + * Ray cast, and stop at the first result. Note that the order is random - but the method is fast. + * @method raycastAny + * @param {Vec3} from + * @param {Vec3} to + * @param {Object} options + * @param {number} [options.collisionFilterMask=-1] + * @param {number} [options.collisionFilterGroup=-1] + * @param {boolean} [options.skipBackfaces=false] + * @param {boolean} [options.checkCollisionResponse=true] + * @param {RaycastResult} result + * @return {boolean} True if any body was hit. + */ +World.prototype.raycastAny = function(from, to, options, result){ + options.mode = Ray.ANY; + options.from = from; + options.to = to; + options.result = result; + return tmpRay.intersectWorld(this, options); +}; + +/** + * Ray cast, and return information of the closest hit. + * @method raycastClosest + * @param {Vec3} from + * @param {Vec3} to + * @param {Object} options + * @param {number} [options.collisionFilterMask=-1] + * @param {number} [options.collisionFilterGroup=-1] + * @param {boolean} [options.skipBackfaces=false] + * @param {boolean} [options.checkCollisionResponse=true] + * @param {RaycastResult} result + * @return {boolean} True if any body was hit. + */ +World.prototype.raycastClosest = function(from, to, options, result){ + options.mode = Ray.CLOSEST; + options.from = from; + options.to = to; + options.result = result; + return tmpRay.intersectWorld(this, options); +}; + +/** + * Remove a rigid body from the simulation. + * @method remove + * @param {Body} body + * @deprecated Use .removeBody instead + */ +World.prototype.remove = function(body){ + body.world = null; + var n = this.bodies.length - 1, + bodies = this.bodies, + idx = bodies.indexOf(body); + if(idx !== -1){ + bodies.splice(idx, 1); // Todo: should use a garbage free method + + // Recompute index + for(var i=0; i!==bodies.length; i++){ + bodies[i].index = i; + } + + this.collisionMatrix.setNumObjects(n); + this.removeBodyEvent.body = body; + delete this.idToBodyMap[body.id]; + this.dispatchEvent(this.removeBodyEvent); + } +}; + +/** + * Remove a rigid body from the simulation. + * @method removeBody + * @param {Body} body + */ +World.prototype.removeBody = World.prototype.remove; + +World.prototype.getBodyById = function(id){ + return this.idToBodyMap[id]; +}; + +// TODO Make a faster map +World.prototype.getShapeById = function(id){ + var bodies = this.bodies; + for(var i=0, bl = bodies.length; i= dt && substeps < maxSubSteps) { + // Do fixed steps to catch up + this.internalStep(dt); + this.accumulator -= dt; + substeps++; + } + // Get rid of excess simulation time + this.accumulator %= dt; + + var t = this.accumulator / dt; + this.interpolationFactor = t; + for(var j=0; j !== this.bodies.length; j++){ + var b = this.bodies[j]; + b.previousPosition.lerp(b.position, t, b.interpolatedPosition); + b.previousQuaternion.slerp(b.quaternion, t, b.interpolatedQuaternion); + b.previousQuaternion.normalize(); + } + this.time += timeSinceLastCalled; + } +}; + +var + /** + * Dispatched after the world has stepped forward in time. + * @event postStep + */ + World_step_postStepEvent = {type:"postStep"}, // Reusable event objects to save memory + /** + * Dispatched before the world steps forward in time. + * @event preStep + */ + World_step_preStepEvent = {type:"preStep"}, + World_step_collideEvent = {type:Body.COLLIDE_EVENT_NAME, body:null, contact:null }, + World_step_oldContacts = [], // Pools for unused objects + World_step_frictionEquationPool = [], + World_step_p1 = [], // Reusable arrays for collision pairs + World_step_p2 = [], + World_step_gvec = new Vec3(), // Temporary vectors and quats + World_step_vi = new Vec3(), + World_step_vj = new Vec3(), + World_step_wi = new Vec3(), + World_step_wj = new Vec3(), + World_step_t1 = new Vec3(), + World_step_t2 = new Vec3(), + World_step_rixn = new Vec3(), + World_step_rjxn = new Vec3(), + World_step_step_q = new Quaternion(), + World_step_step_w = new Quaternion(), + World_step_step_wq = new Quaternion(), + invI_tau_dt = new Vec3(), + clamp01 = function(n) { return Math.min(Math.max(n, 0.0), 1.0); }; +World.prototype.internalStep = function(dt){ + this.dt = dt; + + var world = this, + that = this, + contacts = this.contacts, + p1 = World_step_p1, + p2 = World_step_p2, + N = this.numObjects(), + bodies = this.bodies, + solver = this.solver, + gravity = this.gravity, + doProfiling = this.doProfiling, + profile = this.profile, + DYNAMIC = Body.DYNAMIC, + profilingStart, + constraints = this.constraints, + frictionEquationPool = World_step_frictionEquationPool, + gnorm = gravity.norm(), + gx = gravity.x, + gy = gravity.y, + gz = gravity.z, + i=0; + + if(doProfiling){ + profilingStart = performance.now(); + } + + // Add gravity to all objects + for(i=0; i!==N; i++){ + var bi = bodies[i]; + if(bi.type === DYNAMIC){ // Only for dynamic bodies + var f = bi.force, m = bi.mass; + f.x += m*gx; + f.y += m*gy; + f.z += m*gz; + } + } + + // Update subsystems + for(var i=0, Nsubsystems=this.subsystems.length; i!==Nsubsystems; i++){ + this.subsystems[i].update(); + } + + // Collision detection + if(doProfiling){ profilingStart = performance.now(); } + p1.length = 0; // Clean up pair arrays from last step + p2.length = 0; + this.broadphase.collisionPairs(this,p1,p2); + if(doProfiling){ profile.broadphase = performance.now() - profilingStart; } + + // Remove constrained pairs with collideConnected == false + var Nconstraints = constraints.length; + for(i=0; i!==Nconstraints; i++){ + var c = constraints[i]; + if(!c.collideConnected){ + for(var j = p1.length-1; j>=0; j-=1){ + if( (c.bodyA === p1[j] && c.bodyB === p2[j]) || + (c.bodyB === p1[j] && c.bodyA === p2[j])){ + p1.splice(j, 1); + p2.splice(j, 1); + } + } + } + } + + this.collisionMatrixTick(); + + // Generate contacts + if(doProfiling){ profilingStart = performance.now(); } + var oldcontacts = World_step_oldContacts; + var NoldContacts = contacts.length; + + for(i=0; i!==NoldContacts; i++){ + oldcontacts.push(contacts[i]); + } + contacts.length = 0; + + // Transfer FrictionEquation from current list to the pool for reuse + var NoldFrictionEquations = this.frictionEquations.length; + for(i=0; i!==NoldFrictionEquations; i++){ + frictionEquationPool.push(this.frictionEquations[i]); + } + this.frictionEquations.length = 0; + + this.narrowphase.getContacts( + p1, + p2, + this, + contacts, + oldcontacts, // To be reused + this.frictionEquations, + frictionEquationPool + ); + + if(doProfiling){ + profile.narrowphase = performance.now() - profilingStart; + } + + // Loop over all collisions + if(doProfiling){ + profilingStart = performance.now(); + } + + // Add all friction eqs + for (var i = 0; i < this.frictionEquations.length; i++) { + solver.addEquation(this.frictionEquations[i]); + } + + var ncontacts = contacts.length; + for(var k=0; k!==ncontacts; k++){ + + // Current contact + var c = contacts[k]; + + // Get current collision indeces + var bi = c.bi, + bj = c.bj, + si = c.si, + sj = c.sj; + + // Get collision properties + var cm; + if(bi.material && bj.material){ + cm = this.getContactMaterial(bi.material,bj.material) || this.defaultContactMaterial; + } else { + cm = this.defaultContactMaterial; + } + + // c.enabled = bi.collisionResponse && bj.collisionResponse && si.collisionResponse && sj.collisionResponse; + + var mu = cm.friction; + // c.restitution = cm.restitution; + + // If friction or restitution were specified in the material, use them + if(bi.material && bj.material){ + if(bi.material.friction >= 0 && bj.material.friction >= 0){ + mu = bi.material.friction * bj.material.friction; + } + + if(bi.material.restitution >= 0 && bj.material.restitution >= 0){ + c.restitution = bi.material.restitution * bj.material.restitution; + } + } + + // c.setSpookParams( + // cm.contactEquationStiffness, + // cm.contactEquationRelaxation, + // dt + // ); + + solver.addEquation(c); + + // // Add friction constraint equation + // if(mu > 0){ + + // // Create 2 tangent equations + // var mug = mu * gnorm; + // var reducedMass = (bi.invMass + bj.invMass); + // if(reducedMass > 0){ + // reducedMass = 1/reducedMass; + // } + // var pool = frictionEquationPool; + // var c1 = pool.length ? pool.pop() : new FrictionEquation(bi,bj,mug*reducedMass); + // var c2 = pool.length ? pool.pop() : new FrictionEquation(bi,bj,mug*reducedMass); + // this.frictionEquations.push(c1, c2); + + // c1.bi = c2.bi = bi; + // c1.bj = c2.bj = bj; + // c1.minForce = c2.minForce = -mug*reducedMass; + // c1.maxForce = c2.maxForce = mug*reducedMass; + + // // Copy over the relative vectors + // c1.ri.copy(c.ri); + // c1.rj.copy(c.rj); + // c2.ri.copy(c.ri); + // c2.rj.copy(c.rj); + + // // Construct tangents + // c.ni.tangents(c1.t, c2.t); + + // // Set spook params + // c1.setSpookParams(cm.frictionEquationStiffness, cm.frictionEquationRelaxation, dt); + // c2.setSpookParams(cm.frictionEquationStiffness, cm.frictionEquationRelaxation, dt); + + // c1.enabled = c2.enabled = c.enabled; + + // // Add equations to solver + // solver.addEquation(c1); + // solver.addEquation(c2); + // } + + if( bi.allowSleep && + bi.type === Body.DYNAMIC && + bi.sleepState === Body.SLEEPING && + bj.sleepState === Body.AWAKE && + bj.type !== Body.STATIC + ){ + var speedSquaredB = bj.velocity.norm2() + bj.angularVelocity.norm2(); + var speedLimitSquaredB = Math.pow(bj.sleepSpeedLimit,2); + if(speedSquaredB >= speedLimitSquaredB*2){ + bi._wakeUpAfterNarrowphase = true; + } + } + + if( bj.allowSleep && + bj.type === Body.DYNAMIC && + bj.sleepState === Body.SLEEPING && + bi.sleepState === Body.AWAKE && + bi.type !== Body.STATIC + ){ + var speedSquaredA = bi.velocity.norm2() + bi.angularVelocity.norm2(); + var speedLimitSquaredA = Math.pow(bi.sleepSpeedLimit,2); + if(speedSquaredA >= speedLimitSquaredA*2){ + bj._wakeUpAfterNarrowphase = true; + } + } + + // Now we know that i and j are in contact. Set collision matrix state + this.collisionMatrix.set(bi, bj, true); + + if (!this.collisionMatrixPrevious.get(bi, bj)) { + // First contact! + // We reuse the collideEvent object, otherwise we will end up creating new objects for each new contact, even if there's no event listener attached. + World_step_collideEvent.body = bj; + World_step_collideEvent.contact = c; + bi.dispatchEvent(World_step_collideEvent); + + World_step_collideEvent.body = bi; + bj.dispatchEvent(World_step_collideEvent); + } + + this.bodyOverlapKeeper.set(bi.id, bj.id); + this.shapeOverlapKeeper.set(si.id, sj.id); + } + + this.emitContactEvents(); + + if(doProfiling){ + profile.makeContactConstraints = performance.now() - profilingStart; + profilingStart = performance.now(); + } + + // Wake up bodies + for(i=0; i!==N; i++){ + var bi = bodies[i]; + if(bi._wakeUpAfterNarrowphase){ + bi.wakeUp(); + bi._wakeUpAfterNarrowphase = false; + } + } + + // Add user-added constraints + var Nconstraints = constraints.length; + for(i=0; i!==Nconstraints; i++){ + var c = constraints[i]; + c.update(); + for(var j=0, Neq=c.equations.length; j!==Neq; j++){ + var eq = c.equations[j]; + solver.addEquation(eq); + } + } + + // Solve the constrained system + solver.solve(dt,this); + + if(doProfiling){ + profile.solve = performance.now() - profilingStart; + } + + // Remove all contacts from solver + solver.removeAllEquations(); + + // Apply damping, see http://code.google.com/p/bullet/issues/detail?id=74 for details + var pow = Math.pow; + for(i=0; i!==N; i++){ + var bi = bodies[i]; + if(bi.type & DYNAMIC){ // Only for dynamic bodies + var ld = pow(clamp01(1.0 - bi.linearDamping),dt); + var v = bi.velocity; + v.mult(ld,v); + var av = bi.angularVelocity; + if(av){ + var ad = pow(clamp01(1.0 - bi.angularDamping),dt); + av.mult(ad,av); + } + } + } + + this.dispatchEvent(World_step_preStepEvent); + + // Invoke pre-step callbacks + for(i=0; i!==N; i++){ + var bi = bodies[i]; + if(bi.preStep){ + // bi.preStep.call(bi); + bi.preStep(bi); + } + } + + // Leap frog + // vnew = v + h*f/m + // xnew = x + h*vnew + if(doProfiling){ + profilingStart = performance.now(); + } + var stepnumber = this.stepnumber; + var quatNormalize = stepnumber % (this.quatNormalizeSkip + 1) === 0; + var quatNormalizeFast = this.quatNormalizeFast; + + for(i=0; i!==N; i++){ + bodies[i].integrate(dt, quatNormalize, quatNormalizeFast); + } + this.clearForces(); + + this.broadphase.dirty = true; + + if(doProfiling){ + profile.integrate = performance.now() - profilingStart; + } + + // Update world time + this.time += dt; + this.stepnumber += 1; + + this.dispatchEvent(World_step_postStepEvent); + + // Invoke post-step callbacks + for(i=0; i!==N; i++){ + var bi = bodies[i]; + var postStep = bi.postStep; + if(postStep){ + // postStep.call(bi); + postStep(bi); + } + } + + // Sleeping update + if(this.allowSleep){ + for(i=0; i!==N; i++){ + bodies[i].sleepTick(this.time); + } + } +}; + +World.prototype.emitContactEvents = (function(){ + var additions = []; + var removals = []; + var beginContactEvent = { + type: 'beginContact', + bodyA: null, + bodyB: null + }; + var endContactEvent = { + type: 'endContact', + bodyA: null, + bodyB: null + }; + var beginShapeContactEvent = { + type: 'beginShapeContact', + bodyA: null, + bodyB: null, + shapeA: null, + shapeB: null + }; + var endShapeContactEvent = { + type: 'endShapeContact', + bodyA: null, + bodyB: null, + shapeA: null, + shapeB: null + }; + return function(){ + var hasBeginContact = this.hasAnyEventListener('beginContact'); + var hasEndContact = this.hasAnyEventListener('endContact'); + + if(hasBeginContact || hasEndContact){ + this.bodyOverlapKeeper.getDiff(additions, removals); + } + + if(hasBeginContact){ + for (var i = 0, l = additions.length; i < l; i += 2) { + beginContactEvent.bodyA = this.getBodyById(additions[i]); + beginContactEvent.bodyB = this.getBodyById(additions[i+1]); + this.dispatchEvent(beginContactEvent); + } + beginContactEvent.bodyA = beginContactEvent.bodyB = null; + } + + if(hasEndContact){ + for (var i = 0, l = removals.length; i < l; i += 2) { + endContactEvent.bodyA = this.getBodyById(removals[i]); + endContactEvent.bodyB = this.getBodyById(removals[i+1]); + this.dispatchEvent(endContactEvent); + } + endContactEvent.bodyA = endContactEvent.bodyB = null; + } + + additions.length = removals.length = 0; + + var hasBeginShapeContact = this.hasAnyEventListener('beginShapeContact'); + var hasEndShapeContact = this.hasAnyEventListener('endShapeContact'); + + if(hasBeginShapeContact || hasEndShapeContact){ + this.shapeOverlapKeeper.getDiff(additions, removals); + } + + if(hasBeginShapeContact){ + for (var i = 0, l = additions.length; i < l; i += 2) { + var shapeA = this.getShapeById(additions[i]); + var shapeB = this.getShapeById(additions[i+1]); + beginShapeContactEvent.shapeA = shapeA; + beginShapeContactEvent.shapeB = shapeB; + beginShapeContactEvent.bodyA = shapeA.body; + beginShapeContactEvent.bodyB = shapeB.body; + this.dispatchEvent(beginShapeContactEvent); + } + beginShapeContactEvent.bodyA = beginShapeContactEvent.bodyB = beginShapeContactEvent.shapeA = beginShapeContactEvent.shapeB = null; + } + + if(hasEndShapeContact){ + for (var i = 0, l = removals.length; i < l; i += 2) { + var shapeA = this.getShapeById(removals[i]); + var shapeB = this.getShapeById(removals[i+1]); + + if (shapeA && shapeB) { + endShapeContactEvent.shapeA = shapeA; + endShapeContactEvent.shapeB = shapeB; + endShapeContactEvent.bodyA = shapeA.body; + endShapeContactEvent.bodyB = shapeB.body; + this.dispatchEvent(endShapeContactEvent); + } + } + endShapeContactEvent.bodyA = endShapeContactEvent.bodyB = endShapeContactEvent.shapeA = endShapeContactEvent.shapeB = null; + } + + }; +})(); + +/** + * Sets all body forces in the world to zero. + * @method clearForces + */ +World.prototype.clearForces = function(){ + var bodies = this.bodies; + var N = bodies.length; + for(var i=0; i !== N; i++){ + var b = bodies[i], + force = b.force, + tau = b.torque; + + b.force.set(0,0,0); + b.torque.set(0,0,0); + } +}; + +},{"../collision/AABB":3,"../collision/ArrayCollisionMatrix":4,"../collision/NaiveBroadphase":7,"../collision/OverlapKeeper":9,"../collision/Ray":10,"../collision/RaycastResult":11,"../equations/ContactEquation":20,"../equations/FrictionEquation":22,"../material/ContactMaterial":25,"../material/Material":26,"../math/Quaternion":29,"../math/Vec3":31,"../objects/Body":32,"../shapes/Shape":44,"../solver/GSSolver":47,"../utils/EventTarget":50,"../utils/TupleDictionary":53,"./Narrowphase":56}]},{},[2]) +(2) +}); \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/lib/shaders/SkyShader.js b/Sketchbook-master/Sketchbook-master/src/lib/shaders/SkyShader.js new file mode 100644 index 00000000..159526eb --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/lib/shaders/SkyShader.js @@ -0,0 +1,207 @@ +/** + * Based on "A Practical Analytic Model for Daylight" + * aka The Preetham Model, the de facto standard analytic skydome model + * http://www.cs.utah.edu/~shirley/papers/sunsky/sunsky.pdf + * + * First implemented by Simon Wallner + * http://www.simonwallner.at/projects/atmospheric-scattering + * + * Improved by Martin Upitis + * http://blenderartists.org/forum/showthread.php?245954-preethams-sky-impementation-HDR + * + * Three.js integration by zz85 http://twitter.com/blurspline + * Node.js module implementation by Danila Loginov https://loginov.rocks + */ + +const THREE = require('three'); + +export let SkyShader = { + + uniforms: { + luminance: {value: 1}, + turbidity: {value: 2}, + rayleigh: {value: 1}, + mieCoefficient: {value: 0.005}, + mieDirectionalG: {value: 0.8}, + sunPosition: {value: new THREE.Vector3()}, + cameraPos: {value: new THREE.Vector3()} + }, + + vertexShader: ` + uniform vec3 sunPosition; + uniform float rayleigh; + uniform float turbidity; + uniform float mieCoefficient; + + varying vec3 vWorldPosition; + varying vec3 vSunDirection; + varying float vSunfade; + varying vec3 vBetaR; + varying vec3 vBetaM; + varying float vSunE; + + const vec3 up = vec3( 0.0, 1.0, 0.0 ); + + // constants for atmospheric scattering + const float e = 2.71828182845904523536028747135266249775724709369995957; + const float pi = 3.141592653589793238462643383279502884197169; + + // wavelength of used primaries, according to preetham + const vec3 lambda = vec3( 680E-9, 550E-9, 450E-9 ); + // this pre-calcuation replaces older TotalRayleigh(vec3 lambda) function: + // (8.0 * pow(pi, 3.0) * pow(pow(n, 2.0) - 1.0, 2.0) * (6.0 + 3.0 * pn)) / (3.0 * N * pow(lambda, vec3(4.0)) * (6.0 - 7.0 * pn)) + const vec3 totalRayleigh = vec3( 5.804542996261093E-6, 1.3562911419845635E-5, 3.0265902468824876E-5 ); + + // mie stuff + // K coefficient for the primaries + const float v = 4.0; + const vec3 K = vec3( 0.686, 0.678, 0.666 ); + // MieConst = pi * pow( ( 2.0 * pi ) / lambda, vec3( v - 2.0 ) ) * K + const vec3 MieConst = vec3( 1.8399918514433978E14, 2.7798023919660528E14, 4.0790479543861094E14 ); + + // earth shadow hack + // cutoffAngle = pi / 1.95; + const float cutoffAngle = 1.6110731556870734; + const float steepness = 1.5; + const float EE = 1000.0; + + float sunIntensity( float zenithAngleCos ) { + zenithAngleCos = clamp( zenithAngleCos, -1.0, 1.0 ); + return EE * max( 0.0, 1.0 - pow( e, -( ( cutoffAngle - acos( zenithAngleCos ) ) / steepness ) ) ); + } + + vec3 totalMie( float T ) { + float c = ( 0.2 * T ) * 10E-18; + return 0.434 * c * MieConst; + } + + void main() { + + vec4 worldPosition = modelMatrix * vec4( position, 1.0 ); + vWorldPosition = worldPosition.xyz; + + gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); + + vSunDirection = normalize( sunPosition ); + + vSunE = sunIntensity( dot( vSunDirection, up ) ); + + vSunfade = 1.0 - clamp( 1.0 - exp( ( sunPosition.y / 450000.0 ) ), 0.0, 1.0 ); + + float rayleighCoefficient = rayleigh - ( 1.0 * ( 1.0 - vSunfade ) ); + + // extinction (absorbtion + out scattering) + // rayleigh coefficients + vBetaR = totalRayleigh * rayleighCoefficient; + + // mie coefficients + vBetaM = totalMie( turbidity ) * mieCoefficient; + + } + `, + + fragmentShader: + ` + varying vec3 vWorldPosition; + varying vec3 vSunDirection; + varying float vSunfade; + varying vec3 vBetaR; + varying vec3 vBetaM; + varying float vSunE; + + uniform float luminance; + uniform float mieDirectionalG; + uniform vec3 cameraPos; + + // constants for atmospheric scattering + const float pi = 3.141592653589793238462643383279502884197169; + + const float n = 1.0003; // refractive index of air + const float N = 2.545E25; // number of molecules per unit volume for air at + // 288.15K and 1013mb (sea level -45 celsius) + + // optical length at zenith for molecules + const float rayleighZenithLength = 8.4E3; + const float mieZenithLength = 1.25E3; + const vec3 up = vec3( 0.0, 1.0, 0.0 ); + // 66 arc seconds -> degrees, and the cosine of that + const float sunAngularDiameterCos = 0.999956676946448443553574619906976478926848692873900859324; + + // 3.0 / ( 16.0 * pi ) + const float THREE_OVER_SIXTEENPI = 0.05968310365946075; + // 1.0 / ( 4.0 * pi ) + const float ONE_OVER_FOURPI = 0.07957747154594767; + + float rayleighPhase( float cosTheta ) { + return THREE_OVER_SIXTEENPI * ( 1.0 + pow( cosTheta, 2.0 ) ); + } + + float hgPhase( float cosTheta, float g ) { + float g2 = pow( g, 2.0 ); + float inverse = 1.0 / pow( 1.0 - 2.0 * g * cosTheta + g2, 1.5 ); + return ONE_OVER_FOURPI * ( ( 1.0 - g2 ) * inverse ); + } + + // Filmic ToneMapping http://filmicgames.com/archives/75 + const float A = 0.15; + const float B = 0.50; + const float C = 0.10; + const float D = 0.20; + const float E = 0.02; + const float F = 0.30; + + const float whiteScale = 1.0748724675633854; // 1.0 / Uncharted2Tonemap(1000.0) + + vec3 Uncharted2Tonemap( vec3 x ) { + return ( ( x * ( A * x + C * B ) + D * E ) / ( x * ( A * x + B ) + D * F ) ) - E / F; + } + + void main() { + // optical length + // cutoff angle at 90 to avoid singularity in next formula. + float zenithAngle = acos( max( 0.0, dot( up, normalize( vWorldPosition - cameraPos ) ) ) ); + float inverse = 1.0 / ( cos( zenithAngle ) + 0.15 * pow( 93.885 - ( ( zenithAngle * 180.0 ) / pi ), -1.253 ) ); + float sR = rayleighZenithLength * inverse; + float sM = mieZenithLength * inverse; + + // combined extinction factor + vec3 Fex = exp( -( vBetaR * sR + vBetaM * sM ) ); + + // in scattering + float cosTheta = dot( normalize( vWorldPosition - cameraPos ), vSunDirection ); + + float rPhase = rayleighPhase( cosTheta * 0.5 + 0.5 ); + vec3 betaRTheta = vBetaR * rPhase; + + float mPhase = hgPhase( cosTheta, mieDirectionalG ); + vec3 betaMTheta = vBetaM * mPhase; + + vec3 Lin = pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * ( 1.0 - Fex ), vec3( 1.5 ) ); + Lin *= mix( vec3( 1.0 ), pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * Fex, vec3( 1.0 / 2.0 ) ), clamp( pow( 1.0 - dot( up, vSunDirection ), 5.0 ), 0.0, 1.0 ) ); + + // nightsky + vec3 direction = normalize( vWorldPosition - cameraPos ); + float theta = acos( direction.y ); // elevation --> y-axis, [-pi/2, pi/2] + float phi = atan( direction.z, direction.x ); // azimuth --> x-axis [-pi/2, pi/2] + vec2 uv = vec2( phi, theta ) / vec2( 2.0 * pi, pi ) + vec2( 0.5, 0.0 ); + vec3 L0 = vec3( 0.1 ) * Fex; + + // composition + solar disc + float sundisk = smoothstep( sunAngularDiameterCos, sunAngularDiameterCos + 0.00002, cosTheta ); + L0 += ( vSunE * 19000.0 * Fex ) * sundisk; + + vec3 texColor = ( Lin + L0 ) * 0.04 + vec3( 0.0, 0.0003, 0.00075 ); + + //vec3 curr = Uncharted2Tonemap( ( log2( 2.0 / pow( luminance, 4.0 ) ) ) * texColor ); + // vec3 color = texColor * whiteScale; + vec3 color = texColor * 0.3; + + vec3 retColor = pow( color, vec3( 1.0 / ( 1.2 + ( 1.2 * vSunfade ) ) ) ); + + gl_FragColor = vec4( retColor, 1.0 ); + + #if defined( TONE_MAPPING ) + gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); + #endif + } ` + }; \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/lib/shaders/WaterShader.js b/Sketchbook-master/Sketchbook-master/src/lib/shaders/WaterShader.js new file mode 100644 index 00000000..9ea7b179 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/lib/shaders/WaterShader.js @@ -0,0 +1,284 @@ +/** + * Ocean shader for three.js + * + * Created by Jonathan Blaire https://codepen.io/knoland + * Original pen https://codepen.io/knoland/pen/XKxAJb + * + * Adapted for Sketchbook by Jan Bláha + * https://github.com/swift502/Sketchbook + */ + +const THREE = require('three'); + +export let WaterShader = { + + uniforms: { + iGlobalTime: { + type: 'f', + value: 0.1 + }, + iResolution: { + type: 'v2', + value: new THREE.Vector2() + }, + cameraPos: {value: new THREE.Vector3()}, + lightDir: {value: new THREE.Vector3()} + }, + + vertexShader: ` + + varying vec3 vWorldPosition; + varying vec2 vTexCoord; + + void main() { + vec4 worldPosition = modelMatrix * vec4( position, 1.0 ); + vWorldPosition = worldPosition.xyz; + + vTexCoord = uv; + + gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); + } + `, + + fragmentShader: + ` + uniform float iGlobalTime; + uniform vec2 iResolution; + uniform vec3 cameraPos; + uniform vec3 lightDir; + + varying vec3 vWorldPosition; + varying vec2 vTexCoord; + + const int NUM_STEPS = 8; + const float PI = 3.1415; + const float EPSILON = 1e-3; + + // sea variables + const int ITER_GEOMETRY = 3; + const int ITER_FRAGMENT = 5; + const float SEA_HEIGHT = 0.6; + const float SEA_CHOPPY = 1.0; + const float SEA_SPEED = 1.0; + const float SEA_FREQ = 0.16; + const vec3 SEA_BASE = vec3(0.1,0.19,0.22); + const vec3 SEA_WATER_COLOR = vec3(0.8,0.9,0.6); + mat2 octave_m = mat2(1.6,1.2,-1.2,1.6); + + mat3 fromEuler(vec3 ang) { + vec2 a1 = vec2(sin(ang.x),cos(ang.x)); + vec2 a2 = vec2(sin(ang.y),cos(ang.y)); + vec2 a3 = vec2(sin(ang.z),cos(ang.z)); + mat3 m; + m[0] = vec3( + a1.y*a3.y+a1.x*a2.x*a3.x, + a1.y*a2.x*a3.x+a3.y*a1.x, + -a2.y*a3.x + ); + m[1] = vec3(-a2.y*a1.x,a1.y*a2.y,a2.x); + m[2] = vec3( + a3.y*a1.x*a2.x+a1.y*a3.x, + a1.x*a3.x-a1.y*a3.y*a2.x, + a2.y*a3.y + ); + return m; + } + + float hash( vec2 p ) { + float h = dot(p,vec2(127.1,311.7)); + return fract(sin(h)*43758.5453123); + } + + float noise( in vec2 p ) { + vec2 i = floor(p); + vec2 f = fract(p); + vec2 u = f * f * (3.0 - 2.0 * f); + return -1.0 + 2.0 * mix( + mix( + hash(i + vec2(0.0,0.0) + ), + hash(i + vec2(1.0,0.0)), u.x), + mix(hash(i + vec2(0.0,1.0) ), + hash(i + vec2(1.0,1.0) ), u.x), + u.y + ); + } + + float diffuse(vec3 n,vec3 l,float p) { + return pow(dot(n,l) * 0.4 + 0.6,p); + } + + float specular(vec3 n,vec3 l,vec3 e,float s) { + float nrm = (s + 8.0) / (3.1415 * 8.0); + return pow(max(dot(reflect(e,n),l),0.0),s) * nrm; + } + + vec3 getSkyColor(vec3 e) { + e.y = max(e.y, 0.0); + vec3 ret; + ret.x = pow(1.0 - e.y, 2.0); + ret.y = 1.0 - e.y; + ret.z = 0.6+(1.0 - e.y) * 0.4; + return ret; + } + + + float sea_octave(vec2 uv, float choppy) { + uv += noise(uv); + vec2 wv = 1.0 - abs(sin(uv)); + vec2 swv = abs(cos(uv)); + wv = mix(wv, swv, wv); + return pow(1.0 - pow(wv.x * wv.y, 0.65), choppy); + } + + float map(vec3 p) { + float freq = SEA_FREQ; + float amp = SEA_HEIGHT ; + float choppy = SEA_CHOPPY; + vec2 uv = p.xz; + uv.x *= 0.75; + + float SEA_TIME = iGlobalTime * SEA_SPEED; + float d, h = 0.0; + for(int i = 0; i < ITER_GEOMETRY; i++) { + d = sea_octave((uv + SEA_TIME) * freq, choppy); + d += sea_octave((uv - SEA_TIME) * freq, choppy); + h += d * amp; + uv *= octave_m; + freq *= 1.9; + amp *= 0.22; + choppy = mix(choppy, 1.0, 0.2); + } + return p.y - h; + } + + float map_detailed(vec3 p) { + float freq = SEA_FREQ; + float amp = SEA_HEIGHT; + float choppy = SEA_CHOPPY; + vec2 uv = p.xz; + uv.x *= 0.75; + + float SEA_TIME = iGlobalTime * SEA_SPEED; + float d, h = 0.0; + for(int i = 0; i < ITER_FRAGMENT; i++) { + d = sea_octave((uv+SEA_TIME) * freq, choppy); + d += sea_octave((uv-SEA_TIME) * freq, choppy); + h += d * amp; + uv *= octave_m; + freq *= 1.9; + amp *= 0.22; + choppy = mix(choppy,1.0,0.2); + } + return p.y - h; + } + + vec3 getSeaColor( + vec3 p, + vec3 n, + vec3 l, + vec3 eye, + vec3 dist + ) { + float fresnel = 1.0 - max(dot(n,-eye),0.0); + fresnel = pow(fresnel,3.0) * 0.65; + + vec3 reflected = getSkyColor(reflect(eye,n)); + vec3 refracted = SEA_BASE + diffuse(n,l,80.0) * SEA_WATER_COLOR * 0.12; + + vec3 color = mix(refracted,reflected,fresnel); + + float atten = max(1.0 - dot(dist,dist) * 0.001, 0.0); + color += SEA_WATER_COLOR * (p.y - SEA_HEIGHT) * 0.18 * atten; + + float night = dot(l, vec3(0.0, 1.0, 0.0)); + night = clamp(night + 0.1, 0.0, 0.5) * 2.0; + color *= vec3(night); + + color += vec3(specular(n,l,eye,60.0)); + + return color; + } + + // tracing + vec3 getNormal(vec3 p, float eps) { + vec3 n; + n.y = map_detailed(p); + n.x = map_detailed(vec3(p.x+eps,p.y,p.z)) - n.y; + n.z = map_detailed(vec3(p.x,p.y,p.z+eps)) - n.y; + n.y = eps; + return normalize(n); + } + + float heightMapTracing(vec3 ori, vec3 dir, out vec3 p) { + + vec3 oriComp = ori; + oriComp.y -= vWorldPosition.y - SEA_HEIGHT; + + float tm = 0.0; + float tx = 1000.0; + float hx = map(oriComp + dir * tx); + + if(hx > 0.0) { + return tx; + } + + float hm = map(oriComp + dir * tm); + float tmid = 0.0; + for(int i = 0; i < NUM_STEPS; i++) { + tmid = mix(tm,tx, hm/(hm-hx)); + p = oriComp + dir * tmid; + float hmid = map(p); + if(hmid < 0.0) { + tx = tmid; + hx = hmid; + } else { + tm = tmid; + hm = hmid; + } + } + + return tmid; + } + + void main() { + float time = iGlobalTime * 0.3; + + // ray + vec3 ang = vec3( + sin(time*3.0)*0.1,sin(time)*0.2+0.3,time + ); + + vec3 dir = normalize( vWorldPosition - cameraPos ); + + // tracing + vec3 p; + heightMapTracing(cameraPos,dir,p); + vec3 dist = vWorldPosition - cameraPos; + float EPSILON_NRM = 0.1 / iResolution.x; + vec3 n = getNormal( + p, + dot(dist,dist) * EPSILON_NRM + ); + + // color + vec3 color = mix( + getSkyColor(dir), + getSeaColor(p,n,lightDir,dir,dist), + pow(smoothstep(0.0,-0.05,dir.y),0.3) + ); + + // post + gl_FragColor = vec4(pow(color,vec3(0.8)), 1.0) * 1.2; + + float fogfac = clamp(length(dist), 300.0, 600.0); + fogfac -= 300.0; + fogfac /= 300.0; + gl_FragColor.a = 1.0 - fogfac; + + #if defined( TONE_MAPPING ) + gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); + #endif + } + ` +}; \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/lib/utils/Detector.js b/Sketchbook-master/Sketchbook-master/src/lib/utils/Detector.js new file mode 100644 index 00000000..92d916b6 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/lib/utils/Detector.js @@ -0,0 +1,74 @@ +/* eslint-disable no-var*/ + +/** + * @author alteredq / http://alteredqualia.com/ + * @author mr.doob / http://mrdoob.com/ + */ + +export var Detector = { + + canvas: !!window.CanvasRenderingContext2D, + webgl: (function () { + + try { + + var canvas = document.createElement('canvas'); + return !!(window.WebGLRenderingContext && (canvas.getContext('webgl') || canvas.getContext('experimental-webgl'))); + + } catch (e) { + + return false; + + } + + })(), + workers: !!window.Worker, + fileapi: window.File && window.FileReader && window.FileList && window.Blob, + + getWebGLErrorMessage: function () { + + var element = document.createElement('div'); + element.id = 'webgl-error-message'; + element.style.fontFamily = 'monospace'; + element.style.fontSize = '13px'; + element.style.fontWeight = 'normal'; + element.style.textAlign = 'center'; + element.style.background = '#fff'; + element.style.color = '#000'; + element.style.padding = '1.5em'; + element.style.width = '400px'; + element.style.margin = '5em auto 0'; + + if (!this.webgl) { + + element.innerHTML = window.WebGLRenderingContext ? [ + 'Your graphics card does not seem to support WebGL.
    ', + 'Find out how to get it here.' + ].join('\n') : [ + 'Your browser does not seem to support WebGL.
    ', + 'Find out how to get it here.' + ].join('\n'); + + } + + return element; + + }, + + addGetWebGLMessage: function (parameters) { + + var parent, id, element; + + parameters = parameters || {}; + + parent = parameters.parent !== undefined ? parameters.parent : document.body; + id = parameters.id !== undefined ? parameters.id : 'oldie'; + + element = Detector.getWebGLErrorMessage(); + element.id = id; + + parent.appendChild(element); + + } + +}; \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/lib/utils/Stats.js b/Sketchbook-master/Sketchbook-master/src/lib/utils/Stats.js new file mode 100644 index 00000000..78b10d14 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/lib/utils/Stats.js @@ -0,0 +1,177 @@ +/* eslint-disable no-var*/ + +/** + * @author mrdoob / http://mrdoob.com/ + */ + +export var Stats = function () { + + var mode = 0; + + var container = document.createElement('div'); + container.id = 'statsBox'; + container.style.display = 'none'; + document.getElementById('ui-container').appendChild(container); + // container.addEventListener('click', function (event) { + + // event.preventDefault(); + // showPanel(++mode % container.children.length); + + // }, false); + + function addPanel(panel) { + + container.appendChild(panel.dom); + return panel; + + } + + function showPanel(id) { + + for (var i = 0; i < container.children.length; i++) { + + // container.children[i].style.display = i === id ? 'block' : 'none'; + container.children[i].style.display = 'inline-block'; + } + + mode = id; + + } + + var beginTime = (performance || Date).now(), + prevTime = beginTime, + frames = 0; + + var fpsPanel = addPanel(new Stats.Panel('FPS', '#0ff', '#002')); + var msPanel = addPanel(new Stats.Panel('MS', '#0f0', '#020')); + + if (self.performance && self.performance.memory) { + + var memPanel = addPanel(new Stats.Panel('MB', '#f08', '#201')); + + } + + showPanel(0); + + return { + + REVISION: 16, + + dom: container, + + addPanel: addPanel, + showPanel: showPanel, + + begin: function () { + + beginTime = (performance || Date).now(); + + }, + + end: function () { + + frames++; + + var time = (performance || Date).now(); + + msPanel.update(time - beginTime, 200); + + if (time > prevTime + 1000) { + + fpsPanel.update((frames * 1000) / (time - prevTime), 100); + + prevTime = time; + frames = 0; + + if (memPanel) { + + var memory = performance.memory; + memPanel.update(memory.usedJSHeapSize / 1048576, memory.jsHeapSizeLimit / 1048576); + + } + + } + + return time; + + }, + + update: function () { + + beginTime = this.end(); + + }, + + // Backwards Compatibility + + domElement: container, + setMode: showPanel + + }; + +}; + +Stats.Panel = function (name, fg, bg) { + + var min = Infinity, + max = 0, + round = Math.round; + var PR = round(window.devicePixelRatio || 1); + + var WIDTH = 100 * PR, + HEIGHT = 48 * PR, + TEXT_X = 3 * PR, + TEXT_Y = 2 * PR, + GRAPH_X = 3 * PR, + GRAPH_Y = 15 * PR, + GRAPH_WIDTH = 94 * PR, + GRAPH_HEIGHT = 30 * PR; + + var canvas = document.createElement('canvas'); + canvas.width = WIDTH; + canvas.height = HEIGHT; + canvas.style.cssText = 'width:100px;height:48px'; + + var context = canvas.getContext('2d'); + context.font = 'bold ' + (9 * PR) + 'px Helvetica,Arial,sans-serif'; + context.textBaseline = 'top'; + + context.fillStyle = bg; + context.fillRect(0, 0, WIDTH, HEIGHT); + + context.fillStyle = fg; + context.fillText(name, TEXT_X, TEXT_Y); + context.fillRect(GRAPH_X, GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT); + + context.fillStyle = bg; + context.globalAlpha = 0.9; + context.fillRect(GRAPH_X, GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT); + + return { + + dom: canvas, + + update: function (value, maxValue) { + + min = Math.min(min, value); + max = Math.max(max, value); + + context.fillStyle = bg; + context.globalAlpha = 1; + context.fillRect(0, 0, WIDTH, GRAPH_Y); + context.fillStyle = fg; + context.fillText(round(value) + ' ' + name + ' (' + round(min) + '-' + round(max) + ')', TEXT_X, TEXT_Y); + + context.drawImage(canvas, GRAPH_X + PR, GRAPH_Y, GRAPH_WIDTH - PR, GRAPH_HEIGHT, GRAPH_X, GRAPH_Y, GRAPH_WIDTH - PR, GRAPH_HEIGHT); + + context.fillRect(GRAPH_X + GRAPH_WIDTH - PR, GRAPH_Y, PR, GRAPH_HEIGHT); + + context.fillStyle = bg; + context.globalAlpha = 0.9; + context.fillRect(GRAPH_X + GRAPH_WIDTH - PR, GRAPH_Y, PR, round((1 - (value / maxValue)) * GRAPH_HEIGHT)); + + } + + }; + +}; \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/lib/utils/THREE.quickhull.js b/Sketchbook-master/Sketchbook-master/src/lib/utils/THREE.quickhull.js new file mode 100644 index 00000000..4e7d4588 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/lib/utils/THREE.quickhull.js @@ -0,0 +1,452 @@ +/** + + QuickHull + --------- + + The MIT License + + Copyright © 2010-2014 three.js authors + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + + THE SOFTWARE. + + + @author mark lundin / http://mark-lundin.com + + This is a 3D implementation of the Quick Hull algorithm. + It is a fast way of computing a convex hull with average complexity + of O(n log(n)). + It uses depends on three.js and is supposed to create THREE.Geometry. + + It's also very messy + + */ + + import * as THREE from 'three'; + +export const quickhull = (function(){ + + + var faces = [], + faceStack = [], + i, NUM_POINTS, extremes, + max = 0, + dcur, current, j, v0, v1, v2, v3, + N, D; + + var ab, ac, ax, + suba, subb, normal, + diff, subaA, subaB, subC; + + function reset(){ + + ab = new THREE.Vector3(), + ac = new THREE.Vector3(), + ax = new THREE.Vector3(), + suba = new THREE.Vector3(), + subb = new THREE.Vector3(), + normal = new THREE.Vector3(), + diff = new THREE.Vector3(), + subaA = new THREE.Vector3(), + subaB = new THREE.Vector3(), + subC = new THREE.Vector3(); + + } + + //temporary vectors + + function process( points ){ + + // Iterate through all the faces and remove + while( faceStack.length > 0 ){ + cull( faceStack.shift(), points ); + } + } + + + var norm = function(){ + + var ca = new THREE.Vector3(), + ba = new THREE.Vector3(), + N = new THREE.Vector3(); + + return function( a, b, c ){ + + ca.subVectors( c, a ); + ba.subVectors( b, a ); + + N.crossVectors( ca, ba ); + + return N.normalize(); + } + + }(); + + + function getNormal( face, points ){ + + if( face.normal !== undefined ) return face.normal; + + var p0 = points[face[0]], + p1 = points[face[1]], + p2 = points[face[2]]; + + ab.subVectors( p1, p0 ); + ac.subVectors( p2, p0 ); + normal.crossVectors( ac, ab ); + normal.normalize(); + + return face.normal = normal.clone(); + + } + + + function assignPoints( face, pointset, points ){ + + // ASSIGNING POINTS TO FACE + var p0 = points[face[0]], + dots = [], apex, + norm = getNormal( face, points ); + + + // Sory all the points by there distance from the plane + pointset.sort( function( aItem, bItem ){ + + + dots[aItem.x/3] = dots[aItem.x/3] !== undefined ? dots[aItem.x/3] : norm.dot( suba.subVectors( aItem, p0 )); + dots[bItem.x/3] = dots[bItem.x/3] !== undefined ? dots[bItem.x/3] : norm.dot( subb.subVectors( bItem, p0 )); + + return dots[aItem.x/3] - dots[bItem.x/3] ; + }); + + //TODO :: Must be a faster way of finding and index in this array + var index = pointset.length; + + if( index === 1 ) dots[pointset[0].x/3] = norm.dot( suba.subVectors( pointset[0], p0 )); + while( index-- > 0 && dots[pointset[index].x/3] > 0 ) + + var point; + if( index + 1 < pointset.length && dots[pointset[index+1].x/3] > 0 ){ + + face.visiblePoints = pointset.splice( index + 1 ); + } + } + + + + + function cull( face, points ){ + + var i = faces.length, + dot, visibleFace, currentFace, + visibleFaces = [face]; + + var apex = points.indexOf( face.visiblePoints.pop() ); + + // Iterate through all other faces... + while( i-- > 0 ){ + currentFace = faces[i]; + if( currentFace !== face ){ + // ...and check if they're pointing in the same direction + dot = getNormal( currentFace, points ).dot( diff.subVectors( points[apex], points[currentFace[0]] )); + if( dot > 0 ){ + visibleFaces.push( currentFace ); + } + } + } + + var index, neighbouringIndex, vertex; + + // Determine Perimeter - Creates a bounded horizon + + // 1. Pick an edge A out of all possible edges + // 2. Check if A is shared by any other face. a->b === b->a + // 2.1 for each edge in each triangle, isShared = ( f1.a == f2.a && f1.b == f2.b ) || ( f1.a == f2.b && f1.b == f2.a ) + // 3. If not shared, then add to convex horizon set, + //pick an end point (N) of the current edge A and choose a new edge NA connected to A. + //Restart from 1. + // 4. If A is shared, it is not an horizon edge, therefore flag both faces that share this edge as candidates for culling + // 5. If candidate geometry is a degenrate triangle (ie. the tangent space normal cannot be computed) then remove that triangle from all further processing + + + var j = i = visibleFaces.length; + var isDistinct = false, + hasOneVisibleFace = i === 1, + cull = [], + perimeter = [], + edgeIndex = 0, compareFace, nextIndex, + a, b; + + var allPoints = []; + var originFace = [visibleFaces[0][0], visibleFaces[0][1], visibleFaces[0][1], visibleFaces[0][2], visibleFaces[0][2], visibleFaces[0][0]]; + + + if( visibleFaces.length === 1 ){ + currentFace = visibleFaces[0]; + + perimeter = [currentFace[0], currentFace[1], currentFace[1], currentFace[2], currentFace[2], currentFace[0]]; + // remove visible face from list of faces + if( faceStack.indexOf( currentFace ) > -1 ){ + faceStack.splice( faceStack.indexOf( currentFace ), 1 ); + } + + + if( currentFace.visiblePoints ) allPoints = allPoints.concat( currentFace.visiblePoints ); + faces.splice( faces.indexOf( currentFace ), 1 ); + + }else{ + + while( i-- > 0 ){ // for each visible face + + currentFace = visibleFaces[i]; + + // remove visible face from list of faces + if( faceStack.indexOf( currentFace ) > -1 ){ + faceStack.splice( faceStack.indexOf( currentFace ), 1 ); + } + + if( currentFace.visiblePoints ) allPoints = allPoints.concat( currentFace.visiblePoints ); + faces.splice( faces.indexOf( currentFace ), 1 ); + + + var isSharedEdge; + cEdgeIndex = 0; + + while( cEdgeIndex < 3 ){ // Iterate through it's edges + + isSharedEdge = false; + j = visibleFaces.length; + a = currentFace[cEdgeIndex] + b = currentFace[(cEdgeIndex+1)%3]; + + + while( j-- > 0 && !isSharedEdge ){ // find another visible faces + + compareFace = visibleFaces[j]; + edgeIndex = 0; + + // isSharedEdge = compareFace == currentFace; + if( compareFace !== currentFace ){ + + while( edgeIndex < 3 && !isSharedEdge ){ //Check all it's indices + + nextIndex = ( edgeIndex + 1 ); + isSharedEdge = ( compareFace[edgeIndex] === a && compareFace[nextIndex%3] === b ) || + ( compareFace[edgeIndex] === b && compareFace[nextIndex%3] === a ); + + edgeIndex++; + } + } + } + + if( !isSharedEdge || hasOneVisibleFace ){ + perimeter.push( a ); + perimeter.push( b ); + } + + cEdgeIndex++; + } + } + } + + // create new face for all pairs around edge + i = 0; + var l = perimeter.length/2; + var f; + + while( i < l ){ + f = [ perimeter[i*2+1], apex, perimeter[i*2] ]; + assignPoints( f, allPoints, points ); + faces.push( f ) + if( f.visiblePoints !== undefined )faceStack.push( f ); + i++; + } + + } + + var distSqPointSegment = function(){ + + var ab = new THREE.Vector3(), + ac = new THREE.Vector3(), + bc = new THREE.Vector3(); + + return function( a, b, c ){ + + ab.subVectors( b, a ); + ac.subVectors( c, a ); + bc.subVectors( c, b ); + + var e = ac.dot(ab); + if (e < 0.0) return ac.dot( ac ); + var f = ab.dot( ab ); + if (e >= f) return bc.dot( bc ); + return ac.dot( ac ) - e * e / f; + + } + + }(); + + + + + + return function( geometry ){ + + reset(); + + + points = geometry.vertices; + faces = [], + faceStack = [], + i = NUM_POINTS = points.length, + extremes = points.slice( 0, 6 ), + max = 0; + + + + /* + * FIND EXTREMETIES + */ + while( i-- > 0 ){ + if( points[i].x < extremes[0].x ) extremes[0] = points[i]; + if( points[i].x > extremes[1].x ) extremes[1] = points[i]; + + if( points[i].y < extremes[2].y ) extremes[2] = points[i]; + if( points[i].y < extremes[3].y ) extremes[3] = points[i]; + + if( points[i].z < extremes[4].z ) extremes[4] = points[i]; + if( points[i].z < extremes[5].z ) extremes[5] = points[i]; + } + + + /* + * Find the longest line between the extremeties + */ + + j = i = 6; + while( i-- > 0 ){ + j = i - 1; + while( j-- > 0 ){ + if( max < (dcur = extremes[i].distanceToSquared( extremes[j] )) ){ + max = dcur; + v0 = extremes[ i ]; + v1 = extremes[ j ]; + + } + } + } + + + // 3. Find the most distant point to the line segment, this creates a plane + i = 6; + max = 0; + while( i-- > 0 ){ + dcur = distSqPointSegment( v0, v1, extremes[i]); + if( max < dcur ){ + max = dcur; + v2 = extremes[ i ]; + } + } + + + // 4. Find the most distant point to the plane. + + N = norm(v0, v1, v2); + D = N.dot( v0 ); + + + max = 0; + i = NUM_POINTS; + while( i-- > 0 ){ + dcur = Math.abs( points[i].dot( N ) - D ); + if( max < dcur ){ + max = dcur; + v3 = points[i]; + } + } + + + + var v0Index = points.indexOf( v0 ), + v1Index = points.indexOf( v1 ), + v2Index = points.indexOf( v2 ), + v3Index = points.indexOf( v3 ); + + + // We now have a tetrahedron as the base geometry. + // Now we must subdivide the + + var tetrahedron =[ + [ v2Index, v1Index, v0Index ], + [ v1Index, v3Index, v0Index ], + [ v2Index, v3Index, v1Index ], + [ v0Index, v3Index, v2Index ], + ]; + + + + subaA.subVectors( v1, v0 ).normalize(); + subaB.subVectors( v2, v0 ).normalize(); + subC.subVectors ( v3, v0 ).normalize(); + var sign = subC.dot( new THREE.Vector3().crossVectors( subaB, subaA )); + + + // Reverse the winding if negative sign + if( sign < 0 ){ + tetrahedron[0].reverse(); + tetrahedron[1].reverse(); + tetrahedron[2].reverse(); + tetrahedron[3].reverse(); + } + + + //One for each face of the pyramid + var pointsCloned = points.slice(); + pointsCloned.splice( pointsCloned.indexOf( v0 ), 1 ); + pointsCloned.splice( pointsCloned.indexOf( v1 ), 1 ); + pointsCloned.splice( pointsCloned.indexOf( v2 ), 1 ); + pointsCloned.splice( pointsCloned.indexOf( v3 ), 1 ); + + + var i = tetrahedron.length; + while( i-- > 0 ){ + assignPoints( tetrahedron[i], pointsCloned, points ); + if( tetrahedron[i].visiblePoints !== undefined ){ + faceStack.push( tetrahedron[i] ); + } + faces.push( tetrahedron[i] ); + } + + process( points ); + + + // Assign to our geometry object + + var ll = faces.length; + while( ll-- > 0 ){ + geometry.faces[ll] = new THREE.Face3( faces[ll][2], faces[ll][1], faces[ll][0], faces[ll].normal ) + } + + geometry.normalsNeedUpdate = true; + + return geometry; + + } + +}()) diff --git a/Sketchbook-master/Sketchbook-master/src/lib/utils/dat.gui.js b/Sketchbook-master/Sketchbook-master/src/lib/utils/dat.gui.js new file mode 100644 index 00000000..d4c51a53 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/lib/utils/dat.gui.js @@ -0,0 +1,2610 @@ +/* eslint-disable */ + +/** + * dat-gui JavaScript Controller Library + * http://code.google.com/p/dat-gui + * + * Copyright 2011 Data Arts Team, Google Creative Lab + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ + +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global.dat = factory()); +}(this, (function () { + 'use strict'; + + // function ___$insertStyle(css) { + // if (!css) { + // return; + // } + // if (typeof window === 'undefined') { + // return; + // } + + // var style = document.createElement('style'); + + // style.setAttribute('type', 'text/css'); + // style.innerHTML = css; + // document.head.appendChild(style); + + // return css; + // } + + function colorToString(color, forceCSSHex) { + var colorFormat = color.__state.conversionName.toString(); + var r = Math.round(color.r); + var g = Math.round(color.g); + var b = Math.round(color.b); + var a = color.a; + var h = Math.round(color.h); + var s = color.s.toFixed(1); + var v = color.v.toFixed(1); + if (forceCSSHex || colorFormat === 'THREE_CHAR_HEX' || colorFormat === 'SIX_CHAR_HEX') { + var str = color.hex.toString(16); + while (str.length < 6) { + str = '0' + str; + } + return '#' + str; + } else if (colorFormat === 'CSS_RGB') { + return 'rgb(' + r + ',' + g + ',' + b + ')'; + } else if (colorFormat === 'CSS_RGBA') { + return 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')'; + } else if (colorFormat === 'HEX') { + return '0x' + color.hex.toString(16); + } else if (colorFormat === 'RGB_ARRAY') { + return '[' + r + ',' + g + ',' + b + ']'; + } else if (colorFormat === 'RGBA_ARRAY') { + return '[' + r + ',' + g + ',' + b + ',' + a + ']'; + } else if (colorFormat === 'RGB_OBJ') { + return '{r:' + r + ',g:' + g + ',b:' + b + '}'; + } else if (colorFormat === 'RGBA_OBJ') { + return '{r:' + r + ',g:' + g + ',b:' + b + ',a:' + a + '}'; + } else if (colorFormat === 'HSV_OBJ') { + return '{h:' + h + ',s:' + s + ',v:' + v + '}'; + } else if (colorFormat === 'HSVA_OBJ') { + return '{h:' + h + ',s:' + s + ',v:' + v + ',a:' + a + '}'; + } + return 'unknown format'; + } + + var ARR_EACH = Array.prototype.forEach; + var ARR_SLICE = Array.prototype.slice; + var Common = { + BREAK: {}, + extend: function extend(target) { + this.each(ARR_SLICE.call(arguments, 1), function (obj) { + var keys = this.isObject(obj) ? Object.keys(obj) : []; + keys.forEach(function (key) { + if (!this.isUndefined(obj[key])) { + target[key] = obj[key]; + } + }.bind(this)); + }, this); + return target; + }, + defaults: function defaults(target) { + this.each(ARR_SLICE.call(arguments, 1), function (obj) { + var keys = this.isObject(obj) ? Object.keys(obj) : []; + keys.forEach(function (key) { + if (this.isUndefined(target[key])) { + target[key] = obj[key]; + } + }.bind(this)); + }, this); + return target; + }, + compose: function compose() { + var toCall = ARR_SLICE.call(arguments); + return function () { + var args = ARR_SLICE.call(arguments); + for (var i = toCall.length - 1; i >= 0; i--) { + args = [toCall[i].apply(this, args)]; + } + return args[0]; + }; + }, + each: function each(obj, itr, scope) { + if (!obj) { + return; + } + if (ARR_EACH && obj.forEach && obj.forEach === ARR_EACH) { + obj.forEach(itr, scope); + } else if (obj.length === obj.length + 0) { + var key = void 0; + var l = void 0; + for (key = 0, l = obj.length; key < l; key++) { + if (key in obj && itr.call(scope, obj[key], key) === this.BREAK) { + return; + } + } + } else { + for (var _key in obj) { + if (itr.call(scope, obj[_key], _key) === this.BREAK) { + return; + } + } + } + }, + defer: function defer(fnc) { + setTimeout(fnc, 0); + }, + debounce: function debounce(func, threshold, callImmediately) { + var timeout = void 0; + return function () { + var obj = this; + var args = arguments; + + function delayed() { + timeout = null; + if (!callImmediately) func.apply(obj, args); + } + var callNow = callImmediately || !timeout; + clearTimeout(timeout); + timeout = setTimeout(delayed, threshold); + if (callNow) { + func.apply(obj, args); + } + }; + }, + toArray: function toArray(obj) { + if (obj.toArray) return obj.toArray(); + return ARR_SLICE.call(obj); + }, + isUndefined: function isUndefined(obj) { + return obj === undefined; + }, + isNull: function isNull(obj) { + return obj === null; + }, + isNaN: function (_isNaN) { + function isNaN(_x) { + return _isNaN.apply(this, arguments); + } + isNaN.toString = function () { + return _isNaN.toString(); + }; + return isNaN; + }(function (obj) { + return isNaN(obj); + }), + isArray: Array.isArray || function (obj) { + return obj.constructor === Array; + }, + isObject: function isObject(obj) { + return obj === Object(obj); + }, + isNumber: function isNumber(obj) { + return obj === obj + 0; + }, + isString: function isString(obj) { + return obj === obj + ''; + }, + isBoolean: function isBoolean(obj) { + return obj === false || obj === true; + }, + isFunction: function isFunction(obj) { + return Object.prototype.toString.call(obj) === '[object Function]'; + } + }; + + var INTERPRETATIONS = [{ + litmus: Common.isString, + conversions: { + THREE_CHAR_HEX: { + read: function read(original) { + var test = original.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i); + if (test === null) { + return false; + } + return { + space: 'HEX', + hex: parseInt('0x' + test[1].toString() + test[1].toString() + test[2].toString() + test[2].toString() + test[3].toString() + test[3].toString(), 0) + }; + }, + write: colorToString + }, + SIX_CHAR_HEX: { + read: function read(original) { + var test = original.match(/^#([A-F0-9]{6})$/i); + if (test === null) { + return false; + } + return { + space: 'HEX', + hex: parseInt('0x' + test[1].toString(), 0) + }; + }, + write: colorToString + }, + CSS_RGB: { + read: function read(original) { + var test = original.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/); + if (test === null) { + return false; + } + return { + space: 'RGB', + r: parseFloat(test[1]), + g: parseFloat(test[2]), + b: parseFloat(test[3]) + }; + }, + write: colorToString + }, + CSS_RGBA: { + read: function read(original) { + var test = original.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/); + if (test === null) { + return false; + } + return { + space: 'RGB', + r: parseFloat(test[1]), + g: parseFloat(test[2]), + b: parseFloat(test[3]), + a: parseFloat(test[4]) + }; + }, + write: colorToString + } + } + }, + { + litmus: Common.isNumber, + conversions: { + HEX: { + read: function read(original) { + return { + space: 'HEX', + hex: original, + conversionName: 'HEX' + }; + }, + write: function write(color) { + return color.hex; + } + } + } + }, + { + litmus: Common.isArray, + conversions: { + RGB_ARRAY: { + read: function read(original) { + if (original.length !== 3) { + return false; + } + return { + space: 'RGB', + r: original[0], + g: original[1], + b: original[2] + }; + }, + write: function write(color) { + return [color.r, color.g, color.b]; + } + }, + RGBA_ARRAY: { + read: function read(original) { + if (original.length !== 4) return false; + return { + space: 'RGB', + r: original[0], + g: original[1], + b: original[2], + a: original[3] + }; + }, + write: function write(color) { + return [color.r, color.g, color.b, color.a]; + } + } + } + }, + { + litmus: Common.isObject, + conversions: { + RGBA_OBJ: { + read: function read(original) { + if (Common.isNumber(original.r) && Common.isNumber(original.g) && Common.isNumber(original.b) && Common.isNumber(original.a)) { + return { + space: 'RGB', + r: original.r, + g: original.g, + b: original.b, + a: original.a + }; + } + return false; + }, + write: function write(color) { + return { + r: color.r, + g: color.g, + b: color.b, + a: color.a + }; + } + }, + RGB_OBJ: { + read: function read(original) { + if (Common.isNumber(original.r) && Common.isNumber(original.g) && Common.isNumber(original.b)) { + return { + space: 'RGB', + r: original.r, + g: original.g, + b: original.b + }; + } + return false; + }, + write: function write(color) { + return { + r: color.r, + g: color.g, + b: color.b + }; + } + }, + HSVA_OBJ: { + read: function read(original) { + if (Common.isNumber(original.h) && Common.isNumber(original.s) && Common.isNumber(original.v) && Common.isNumber(original.a)) { + return { + space: 'HSV', + h: original.h, + s: original.s, + v: original.v, + a: original.a + }; + } + return false; + }, + write: function write(color) { + return { + h: color.h, + s: color.s, + v: color.v, + a: color.a + }; + } + }, + HSV_OBJ: { + read: function read(original) { + if (Common.isNumber(original.h) && Common.isNumber(original.s) && Common.isNumber(original.v)) { + return { + space: 'HSV', + h: original.h, + s: original.s, + v: original.v + }; + } + return false; + }, + write: function write(color) { + return { + h: color.h, + s: color.s, + v: color.v + }; + } + } + } + } + ]; + var result = void 0; + var toReturn = void 0; + var interpret = function interpret() { + toReturn = false; + var original = arguments.length > 1 ? Common.toArray(arguments) : arguments[0]; + Common.each(INTERPRETATIONS, function (family) { + if (family.litmus(original)) { + Common.each(family.conversions, function (conversion, conversionName) { + result = conversion.read(original); + if (toReturn === false && result !== false) { + toReturn = result; + result.conversionName = conversionName; + result.conversion = conversion; + return Common.BREAK; + } + }); + return Common.BREAK; + } + }); + return toReturn; + }; + + var tmpComponent = void 0; + var ColorMath = { + hsv_to_rgb: function hsv_to_rgb(h, s, v) { + var hi = Math.floor(h / 60) % 6; + var f = h / 60 - Math.floor(h / 60); + var p = v * (1.0 - s); + var q = v * (1.0 - f * s); + var t = v * (1.0 - (1.0 - f) * s); + var c = [ + [v, t, p], + [q, v, p], + [p, v, t], + [p, q, v], + [t, p, v], + [v, p, q] + ][hi]; + return { + r: c[0] * 255, + g: c[1] * 255, + b: c[2] * 255 + }; + }, + rgb_to_hsv: function rgb_to_hsv(r, g, b) { + var min = Math.min(r, g, b); + var max = Math.max(r, g, b); + var delta = max - min; + var h = void 0; + var s = void 0; + if (max !== 0) { + s = delta / max; + } else { + return { + h: NaN, + s: 0, + v: 0 + }; + } + if (r === max) { + h = (g - b) / delta; + } else if (g === max) { + h = 2 + (b - r) / delta; + } else { + h = 4 + (r - g) / delta; + } + h /= 6; + if (h < 0) { + h += 1; + } + return { + h: h * 360, + s: s, + v: max / 255 + }; + }, + rgb_to_hex: function rgb_to_hex(r, g, b) { + var hex = this.hex_with_component(0, 2, r); + hex = this.hex_with_component(hex, 1, g); + hex = this.hex_with_component(hex, 0, b); + return hex; + }, + component_from_hex: function component_from_hex(hex, componentIndex) { + return hex >> componentIndex * 8 & 0xFF; + }, + hex_with_component: function hex_with_component(hex, componentIndex, value) { + return value << (tmpComponent = componentIndex * 8) | hex & ~(0xFF << tmpComponent); + } + }; + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { + return typeof obj; + } : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + + + + + + + + + + + + var classCallCheck = function (instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + }; + + var createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + + + + + + + + var get = function get(object, property, receiver) { + if (object === null) object = Function.prototype; + var desc = Object.getOwnPropertyDescriptor(object, property); + + if (desc === undefined) { + var parent = Object.getPrototypeOf(object); + + if (parent === null) { + return undefined; + } else { + return get(parent, property, receiver); + } + } else if ("value" in desc) { + return desc.value; + } else { + var getter = desc.get; + + if (getter === undefined) { + return undefined; + } + + return getter.call(receiver); + } + }; + + var inherits = function (subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + } + + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + }; + + + + + + + + + + + + var possibleConstructorReturn = function (self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return call && (typeof call === "object" || typeof call === "function") ? call : self; + }; + + var Color = function () { + function Color() { + classCallCheck(this, Color); + this.__state = interpret.apply(this, arguments); + if (this.__state === false) { + throw new Error('Failed to interpret color arguments'); + } + this.__state.a = this.__state.a || 1; + } + createClass(Color, [{ + key: 'toString', + value: function toString() { + return colorToString(this); + } + }, { + key: 'toHexString', + value: function toHexString() { + return colorToString(this, true); + } + }, { + key: 'toOriginal', + value: function toOriginal() { + return this.__state.conversion.write(this); + } + }]); + return Color; + }(); + + function defineRGBComponent(target, component, componentHexIndex) { + Object.defineProperty(target, component, { + get: function get$$1() { + if (this.__state.space === 'RGB') { + return this.__state[component]; + } + Color.recalculateRGB(this, component, componentHexIndex); + return this.__state[component]; + }, + set: function set$$1(v) { + if (this.__state.space !== 'RGB') { + Color.recalculateRGB(this, component, componentHexIndex); + this.__state.space = 'RGB'; + } + this.__state[component] = v; + } + }); + } + + function defineHSVComponent(target, component) { + Object.defineProperty(target, component, { + get: function get$$1() { + if (this.__state.space === 'HSV') { + return this.__state[component]; + } + Color.recalculateHSV(this); + return this.__state[component]; + }, + set: function set$$1(v) { + if (this.__state.space !== 'HSV') { + Color.recalculateHSV(this); + this.__state.space = 'HSV'; + } + this.__state[component] = v; + } + }); + } + Color.recalculateRGB = function (color, component, componentHexIndex) { + if (color.__state.space === 'HEX') { + color.__state[component] = ColorMath.component_from_hex(color.__state.hex, componentHexIndex); + } else if (color.__state.space === 'HSV') { + Common.extend(color.__state, ColorMath.hsv_to_rgb(color.__state.h, color.__state.s, color.__state.v)); + } else { + throw new Error('Corrupted color state'); + } + }; + Color.recalculateHSV = function (color) { + var result = ColorMath.rgb_to_hsv(color.r, color.g, color.b); + Common.extend(color.__state, { + s: result.s, + v: result.v + }); + if (!Common.isNaN(result.h)) { + color.__state.h = result.h; + } else if (Common.isUndefined(color.__state.h)) { + color.__state.h = 0; + } + }; + Color.COMPONENTS = ['r', 'g', 'b', 'h', 's', 'v', 'hex', 'a']; + defineRGBComponent(Color.prototype, 'r', 2); + defineRGBComponent(Color.prototype, 'g', 1); + defineRGBComponent(Color.prototype, 'b', 0); + defineHSVComponent(Color.prototype, 'h'); + defineHSVComponent(Color.prototype, 's'); + defineHSVComponent(Color.prototype, 'v'); + Object.defineProperty(Color.prototype, 'a', { + get: function get$$1() { + return this.__state.a; + }, + set: function set$$1(v) { + this.__state.a = v; + } + }); + Object.defineProperty(Color.prototype, 'hex', { + get: function get$$1() { + if (!this.__state.space !== 'HEX') { + this.__state.hex = ColorMath.rgb_to_hex(this.r, this.g, this.b); + } + return this.__state.hex; + }, + set: function set$$1(v) { + this.__state.space = 'HEX'; + this.__state.hex = v; + } + }); + + var Controller = function () { + function Controller(object, property) { + classCallCheck(this, Controller); + this.initialValue = object[property]; + this.domElement = document.createElement('div'); + this.object = object; + this.property = property; + this.__onChange = undefined; + this.__onFinishChange = undefined; + } + createClass(Controller, [{ + key: 'onChange', + value: function onChange(fnc) { + this.__onChange = fnc; + return this; + } + }, { + key: 'onFinishChange', + value: function onFinishChange(fnc) { + this.__onFinishChange = fnc; + return this; + } + }, { + key: 'setValue', + value: function setValue(newValue) { + this.object[this.property] = newValue; + if (this.__onChange) { + this.__onChange.call(this, newValue); + } + this.updateDisplay(); + return this; + } + }, { + key: 'getValue', + value: function getValue() { + return this.object[this.property]; + } + }, { + key: 'updateDisplay', + value: function updateDisplay() { + return this; + } + }, { + key: 'isModified', + value: function isModified() { + return this.initialValue !== this.getValue(); + } + }]); + return Controller; + }(); + + var EVENT_MAP = { + HTMLEvents: ['change'], + MouseEvents: ['click', 'mousemove', 'mousedown', 'mouseup', 'mouseover'], + KeyboardEvents: ['keydown'] + }; + var EVENT_MAP_INV = {}; + Common.each(EVENT_MAP, function (v, k) { + Common.each(v, function (e) { + EVENT_MAP_INV[e] = k; + }); + }); + var CSS_VALUE_PIXELS = /(\d+(\.\d+)?)px/; + + function cssValueToPixels(val) { + if (val === '0' || Common.isUndefined(val)) { + return 0; + } + var match = val.match(CSS_VALUE_PIXELS); + if (!Common.isNull(match)) { + return parseFloat(match[1]); + } + return 0; + } + var dom = { + makeSelectable: function makeSelectable(elem, selectable) { + if (elem === undefined || elem.style === undefined) return; + elem.onselectstart = selectable ? function () { + return false; + } : function () {}; + elem.style.MozUserSelect = selectable ? 'auto' : 'none'; + elem.style.KhtmlUserSelect = selectable ? 'auto' : 'none'; + elem.unselectable = selectable ? 'on' : 'off'; + }, + makeFullscreen: function makeFullscreen(elem, hor, vert) { + var vertical = vert; + var horizontal = hor; + if (Common.isUndefined(horizontal)) { + horizontal = true; + } + if (Common.isUndefined(vertical)) { + vertical = true; + } + elem.style.position = 'absolute'; + if (horizontal) { + elem.style.left = 0; + elem.style.right = 0; + } + if (vertical) { + elem.style.top = 0; + elem.style.bottom = 0; + } + }, + fakeEvent: function fakeEvent(elem, eventType, pars, aux) { + var params = pars || {}; + var className = EVENT_MAP_INV[eventType]; + if (!className) { + throw new Error('Event type ' + eventType + ' not supported.'); + } + var evt = document.createEvent(className); + switch (className) { + case 'MouseEvents': + { + var clientX = params.x || params.clientX || 0; + var clientY = params.y || params.clientY || 0; + evt.initMouseEvent(eventType, params.bubbles || false, params.cancelable || true, window, params.clickCount || 1, 0, + 0, + clientX, + clientY, + false, false, false, false, 0, null); + break; + } + case 'KeyboardEvents': + { + var init = evt.initKeyboardEvent || evt.initKeyEvent; + Common.defaults(params, { + cancelable: true, + ctrlKey: false, + altKey: false, + shiftKey: false, + metaKey: false, + keyCode: undefined, + charCode: undefined + }); + init(eventType, params.bubbles || false, params.cancelable, window, params.ctrlKey, params.altKey, params.shiftKey, params.metaKey, params.keyCode, params.charCode); + break; + } + default: + { + evt.initEvent(eventType, params.bubbles || false, params.cancelable || true); + break; + } + } + Common.defaults(evt, aux); + elem.dispatchEvent(evt); + }, + bind: function bind(elem, event, func, newBool) { + var bool = newBool || false; + if (elem.addEventListener) { + elem.addEventListener(event, func, bool); + } else if (elem.attachEvent) { + elem.attachEvent('on' + event, func); + } + return dom; + }, + unbind: function unbind(elem, event, func, newBool) { + var bool = newBool || false; + if (elem.removeEventListener) { + elem.removeEventListener(event, func, bool); + } else if (elem.detachEvent) { + elem.detachEvent('on' + event, func); + } + return dom; + }, + addClass: function addClass(elem, className) { + if (elem.className === undefined) { + elem.className = className; + } else if (elem.className !== className) { + var classes = elem.className.split(/ +/); + if (classes.indexOf(className) === -1) { + classes.push(className); + elem.className = classes.join(' ').replace(/^\s+/, '').replace(/\s+$/, ''); + } + } + return dom; + }, + removeClass: function removeClass(elem, className) { + if (className) { + if (elem.className === className) { + elem.removeAttribute('class'); + } else { + var classes = elem.className.split(/ +/); + var index = classes.indexOf(className); + if (index !== -1) { + classes.splice(index, 1); + elem.className = classes.join(' '); + } + } + } else { + elem.className = undefined; + } + return dom; + }, + hasClass: function hasClass(elem, className) { + return new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)').test(elem.className) || false; + }, + getWidth: function getWidth(elem) { + var style = getComputedStyle(elem); + return cssValueToPixels(style['border-left-width']) + cssValueToPixels(style['border-right-width']) + cssValueToPixels(style['padding-left']) + cssValueToPixels(style['padding-right']) + cssValueToPixels(style.width); + }, + getHeight: function getHeight(elem) { + var style = getComputedStyle(elem); + return cssValueToPixels(style['border-top-width']) + cssValueToPixels(style['border-bottom-width']) + cssValueToPixels(style['padding-top']) + cssValueToPixels(style['padding-bottom']) + cssValueToPixels(style.height); + }, + getOffset: function getOffset(el) { + var elem = el; + var offset = { + left: 0, + top: 0 + }; + if (elem.offsetParent) { + do { + offset.left += elem.offsetLeft; + offset.top += elem.offsetTop; + elem = elem.offsetParent; + } while (elem); + } + return offset; + }, + isActive: function isActive(elem) { + return elem === document.activeElement && (elem.type || elem.href); + } + }; + + var BooleanController = function (_Controller) { + inherits(BooleanController, _Controller); + + function BooleanController(object, property) { + classCallCheck(this, BooleanController); + var _this2 = possibleConstructorReturn(this, (BooleanController.__proto__ || Object.getPrototypeOf(BooleanController)).call(this, object, property)); + var _this = _this2; + _this2.__prev = _this2.getValue(); + _this2.__checkbox = document.createElement('input'); + _this2.__checkbox.setAttribute('type', 'checkbox'); + + function onChange() { + _this.setValue(!_this.__prev); + } + dom.bind(_this2.__checkbox, 'change', onChange, false); + _this2.domElement.appendChild(_this2.__checkbox); + _this2.updateDisplay(); + return _this2; + } + createClass(BooleanController, [{ + key: 'setValue', + value: function setValue(v) { + var toReturn = get(BooleanController.prototype.__proto__ || Object.getPrototypeOf(BooleanController.prototype), 'setValue', this).call(this, v); + if (this.__onFinishChange) { + this.__onFinishChange.call(this, this.getValue()); + } + this.__prev = this.getValue(); + return toReturn; + } + }, { + key: 'updateDisplay', + value: function updateDisplay() { + if (this.getValue() === true) { + this.__checkbox.setAttribute('checked', 'checked'); + this.__checkbox.checked = true; + this.__prev = true; + } else { + this.__checkbox.checked = false; + this.__prev = false; + } + return get(BooleanController.prototype.__proto__ || Object.getPrototypeOf(BooleanController.prototype), 'updateDisplay', this).call(this); + } + }]); + return BooleanController; + }(Controller); + + var OptionController = function (_Controller) { + inherits(OptionController, _Controller); + + function OptionController(object, property, opts) { + classCallCheck(this, OptionController); + var _this2 = possibleConstructorReturn(this, (OptionController.__proto__ || Object.getPrototypeOf(OptionController)).call(this, object, property)); + var options = opts; + var _this = _this2; + _this2.__select = document.createElement('select'); + if (Common.isArray(options)) { + var map = {}; + Common.each(options, function (element) { + map[element] = element; + }); + options = map; + } + Common.each(options, function (value, key) { + var opt = document.createElement('option'); + opt.innerHTML = key; + opt.setAttribute('value', value); + _this.__select.appendChild(opt); + }); + _this2.updateDisplay(); + dom.bind(_this2.__select, 'change', function () { + var desiredValue = this.options[this.selectedIndex].value; + _this.setValue(desiredValue); + }); + _this2.domElement.appendChild(_this2.__select); + return _this2; + } + createClass(OptionController, [{ + key: 'setValue', + value: function setValue(v) { + var toReturn = get(OptionController.prototype.__proto__ || Object.getPrototypeOf(OptionController.prototype), 'setValue', this).call(this, v); + if (this.__onFinishChange) { + this.__onFinishChange.call(this, this.getValue()); + } + return toReturn; + } + }, { + key: 'updateDisplay', + value: function updateDisplay() { + if (dom.isActive(this.__select)) return this; + this.__select.value = this.getValue(); + return get(OptionController.prototype.__proto__ || Object.getPrototypeOf(OptionController.prototype), 'updateDisplay', this).call(this); + } + }]); + return OptionController; + }(Controller); + + var StringController = function (_Controller) { + inherits(StringController, _Controller); + + function StringController(object, property) { + classCallCheck(this, StringController); + var _this2 = possibleConstructorReturn(this, (StringController.__proto__ || Object.getPrototypeOf(StringController)).call(this, object, property)); + var _this = _this2; + + function onChange() { + _this.setValue(_this.__input.value); + } + + function onBlur() { + if (_this.__onFinishChange) { + _this.__onFinishChange.call(_this, _this.getValue()); + } + } + _this2.__input = document.createElement('input'); + _this2.__input.setAttribute('type', 'text'); + dom.bind(_this2.__input, 'keyup', onChange); + dom.bind(_this2.__input, 'change', onChange); + dom.bind(_this2.__input, 'blur', onBlur); + dom.bind(_this2.__input, 'keydown', function (e) { + if (e.keyCode === 13) { + this.blur(); + } + }); + _this2.updateDisplay(); + _this2.domElement.appendChild(_this2.__input); + return _this2; + } + createClass(StringController, [{ + key: 'updateDisplay', + value: function updateDisplay() { + if (!dom.isActive(this.__input)) { + this.__input.value = this.getValue(); + } + return get(StringController.prototype.__proto__ || Object.getPrototypeOf(StringController.prototype), 'updateDisplay', this).call(this); + } + }]); + return StringController; + }(Controller); + + function numDecimals(x) { + var _x = x.toString(); + if (_x.indexOf('.') > -1) { + return _x.length - _x.indexOf('.') - 1; + } + return 0; + } + var NumberController = function (_Controller) { + inherits(NumberController, _Controller); + + function NumberController(object, property, params) { + classCallCheck(this, NumberController); + var _this = possibleConstructorReturn(this, (NumberController.__proto__ || Object.getPrototypeOf(NumberController)).call(this, object, property)); + var _params = params || {}; + _this.__min = _params.min; + _this.__max = _params.max; + _this.__step = _params.step; + if (Common.isUndefined(_this.__step)) { + if (_this.initialValue === 0) { + _this.__impliedStep = 1; + } else { + _this.__impliedStep = Math.pow(10, Math.floor(Math.log(Math.abs(_this.initialValue)) / Math.LN10)) / 10; + } + } else { + _this.__impliedStep = _this.__step; + } + _this.__precision = numDecimals(_this.__impliedStep); + return _this; + } + createClass(NumberController, [{ + key: 'setValue', + value: function setValue(v) { + var _v = v; + if (this.__min !== undefined && _v < this.__min) { + _v = this.__min; + } else if (this.__max !== undefined && _v > this.__max) { + _v = this.__max; + } + if (this.__step !== undefined && _v % this.__step !== 0) { + _v = Math.round(_v / this.__step) * this.__step; + } + return get(NumberController.prototype.__proto__ || Object.getPrototypeOf(NumberController.prototype), 'setValue', this).call(this, _v); + } + }, { + key: 'min', + value: function min(minValue) { + this.__min = minValue; + return this; + } + }, { + key: 'max', + value: function max(maxValue) { + this.__max = maxValue; + return this; + } + }, { + key: 'step', + value: function step(stepValue) { + this.__step = stepValue; + this.__impliedStep = stepValue; + this.__precision = numDecimals(stepValue); + return this; + } + }]); + return NumberController; + }(Controller); + + function roundToDecimal(value, decimals) { + var tenTo = Math.pow(10, decimals); + return Math.round(value * tenTo) / tenTo; + } + var NumberControllerBox = function (_NumberController) { + inherits(NumberControllerBox, _NumberController); + + function NumberControllerBox(object, property, params) { + classCallCheck(this, NumberControllerBox); + var _this2 = possibleConstructorReturn(this, (NumberControllerBox.__proto__ || Object.getPrototypeOf(NumberControllerBox)).call(this, object, property, params)); + _this2.__truncationSuspended = false; + var _this = _this2; + var prevY = void 0; + + function onChange() { + var attempted = parseFloat(_this.__input.value); + if (!Common.isNaN(attempted)) { + _this.setValue(attempted); + } + } + + function onFinish() { + if (_this.__onFinishChange) { + _this.__onFinishChange.call(_this, _this.getValue()); + } + } + + function onBlur() { + onFinish(); + } + + function onMouseDrag(e) { + var diff = prevY - e.clientY; + _this.setValue(_this.getValue() + diff * _this.__impliedStep); + prevY = e.clientY; + } + + function onMouseUp() { + dom.unbind(window, 'mousemove', onMouseDrag); + dom.unbind(window, 'mouseup', onMouseUp); + onFinish(); + } + + function onMouseDown(e) { + dom.bind(window, 'mousemove', onMouseDrag); + dom.bind(window, 'mouseup', onMouseUp); + prevY = e.clientY; + } + _this2.__input = document.createElement('input'); + _this2.__input.setAttribute('type', 'text'); + dom.bind(_this2.__input, 'change', onChange); + dom.bind(_this2.__input, 'blur', onBlur); + dom.bind(_this2.__input, 'mousedown', onMouseDown); + dom.bind(_this2.__input, 'keydown', function (e) { + if (e.keyCode === 13) { + _this.__truncationSuspended = true; + this.blur(); + _this.__truncationSuspended = false; + onFinish(); + } + }); + _this2.updateDisplay(); + _this2.domElement.appendChild(_this2.__input); + return _this2; + } + createClass(NumberControllerBox, [{ + key: 'updateDisplay', + value: function updateDisplay() { + this.__input.value = this.__truncationSuspended ? this.getValue() : roundToDecimal(this.getValue(), this.__precision); + return get(NumberControllerBox.prototype.__proto__ || Object.getPrototypeOf(NumberControllerBox.prototype), 'updateDisplay', this).call(this); + } + }]); + return NumberControllerBox; + }(NumberController); + + function map(v, i1, i2, o1, o2) { + return o1 + (o2 - o1) * ((v - i1) / (i2 - i1)); + } + var NumberControllerSlider = function (_NumberController) { + inherits(NumberControllerSlider, _NumberController); + + function NumberControllerSlider(object, property, min, max, step) { + classCallCheck(this, NumberControllerSlider); + var _this2 = possibleConstructorReturn(this, (NumberControllerSlider.__proto__ || Object.getPrototypeOf(NumberControllerSlider)).call(this, object, property, { + min: min, + max: max, + step: step + })); + var _this = _this2; + _this2.__background = document.createElement('div'); + _this2.__foreground = document.createElement('div'); + dom.bind(_this2.__background, 'mousedown', onMouseDown); + dom.bind(_this2.__background, 'touchstart', onTouchStart); + dom.addClass(_this2.__background, 'slider'); + dom.addClass(_this2.__foreground, 'slider-fg'); + + function onMouseDown(e) { + document.activeElement.blur(); + dom.bind(window, 'mousemove', onMouseDrag); + dom.bind(window, 'mouseup', onMouseUp); + onMouseDrag(e); + } + + function onMouseDrag(e) { + e.preventDefault(); + var bgRect = _this.__background.getBoundingClientRect(); + _this.setValue(map(e.clientX, bgRect.left, bgRect.right, _this.__min, _this.__max)); + return false; + } + + function onMouseUp() { + dom.unbind(window, 'mousemove', onMouseDrag); + dom.unbind(window, 'mouseup', onMouseUp); + if (_this.__onFinishChange) { + _this.__onFinishChange.call(_this, _this.getValue()); + } + } + + function onTouchStart(e) { + if (e.touches.length !== 1) { + return; + } + dom.bind(window, 'touchmove', onTouchMove); + dom.bind(window, 'touchend', onTouchEnd); + onTouchMove(e); + } + + function onTouchMove(e) { + var clientX = e.touches[0].clientX; + var bgRect = _this.__background.getBoundingClientRect(); + _this.setValue(map(clientX, bgRect.left, bgRect.right, _this.__min, _this.__max)); + } + + function onTouchEnd() { + dom.unbind(window, 'touchmove', onTouchMove); + dom.unbind(window, 'touchend', onTouchEnd); + if (_this.__onFinishChange) { + _this.__onFinishChange.call(_this, _this.getValue()); + } + } + _this2.updateDisplay(); + _this2.__background.appendChild(_this2.__foreground); + _this2.domElement.appendChild(_this2.__background); + return _this2; + } + createClass(NumberControllerSlider, [{ + key: 'updateDisplay', + value: function updateDisplay() { + var pct = (this.getValue() - this.__min) / (this.__max - this.__min); + this.__foreground.style.width = pct * 100 + '%'; + return get(NumberControllerSlider.prototype.__proto__ || Object.getPrototypeOf(NumberControllerSlider.prototype), 'updateDisplay', this).call(this); + } + }]); + return NumberControllerSlider; + }(NumberController); + + var FunctionController = function (_Controller) { + inherits(FunctionController, _Controller); + + function FunctionController(object, property, text) { + classCallCheck(this, FunctionController); + var _this2 = possibleConstructorReturn(this, (FunctionController.__proto__ || Object.getPrototypeOf(FunctionController)).call(this, object, property)); + var _this = _this2; + _this2.__button = document.createElement('div'); + _this2.__button.innerHTML = text === undefined ? 'Fire' : text; + dom.bind(_this2.__button, 'click', function (e) { + e.preventDefault(); + _this.fire(); + return false; + }); + dom.addClass(_this2.__button, 'button'); + _this2.domElement.appendChild(_this2.__button); + return _this2; + } + createClass(FunctionController, [{ + key: 'fire', + value: function fire() { + if (this.__onChange) { + this.__onChange.call(this); + } + this.getValue().call(this.object); + if (this.__onFinishChange) { + this.__onFinishChange.call(this, this.getValue()); + } + } + }]); + return FunctionController; + }(Controller); + + var ColorController = function (_Controller) { + inherits(ColorController, _Controller); + + function ColorController(object, property) { + classCallCheck(this, ColorController); + var _this2 = possibleConstructorReturn(this, (ColorController.__proto__ || Object.getPrototypeOf(ColorController)).call(this, object, property)); + _this2.__color = new Color(_this2.getValue()); + _this2.__temp = new Color(0); + var _this = _this2; + _this2.domElement = document.createElement('div'); + dom.makeSelectable(_this2.domElement, false); + _this2.__selector = document.createElement('div'); + _this2.__selector.className = 'selector'; + _this2.__saturation_field = document.createElement('div'); + _this2.__saturation_field.className = 'saturation-field'; + _this2.__field_knob = document.createElement('div'); + _this2.__field_knob.className = 'field-knob'; + _this2.__field_knob_border = '2px solid '; + _this2.__hue_knob = document.createElement('div'); + _this2.__hue_knob.className = 'hue-knob'; + _this2.__hue_field = document.createElement('div'); + _this2.__hue_field.className = 'hue-field'; + _this2.__input = document.createElement('input'); + _this2.__input.type = 'text'; + _this2.__input_textShadow = '0 1px 1px '; + dom.bind(_this2.__input, 'keydown', function (e) { + if (e.keyCode === 13) { + onBlur.call(this); + } + }); + dom.bind(_this2.__input, 'blur', onBlur); + dom.bind(_this2.__selector, 'mousedown', function () { + dom.addClass(this, 'drag').bind(window, 'mouseup', function () { + dom.removeClass(_this.__selector, 'drag'); + }); + }); + dom.bind(_this2.__selector, 'touchstart', function () { + dom.addClass(this, 'drag').bind(window, 'touchend', function () { + dom.removeClass(_this.__selector, 'drag'); + }); + }); + var valueField = document.createElement('div'); + Common.extend(_this2.__selector.style, { + width: '122px', + height: '102px', + padding: '3px', + backgroundColor: '#222', + boxShadow: '0px 1px 3px rgba(0,0,0,0.3)' + }); + Common.extend(_this2.__field_knob.style, { + position: 'absolute', + width: '12px', + height: '12px', + border: _this2.__field_knob_border + (_this2.__color.v < 0.5 ? '#fff' : '#000'), + boxShadow: '0px 1px 3px rgba(0,0,0,0.5)', + borderRadius: '12px', + zIndex: 1 + }); + Common.extend(_this2.__hue_knob.style, { + position: 'absolute', + width: '15px', + height: '2px', + borderRight: '4px solid #fff', + zIndex: 1 + }); + Common.extend(_this2.__saturation_field.style, { + width: '100px', + height: '100px', + border: '1px solid #555', + marginRight: '3px', + display: 'inline-block', + cursor: 'pointer' + }); + Common.extend(valueField.style, { + width: '100%', + height: '100%', + background: 'none' + }); + linearGradient(valueField, 'top', 'rgba(0,0,0,0)', '#000'); + Common.extend(_this2.__hue_field.style, { + width: '15px', + height: '100px', + border: '1px solid #555', + cursor: 'ns-resize', + position: 'absolute', + top: '3px', + right: '3px' + }); + hueGradient(_this2.__hue_field); + Common.extend(_this2.__input.style, { + outline: 'none', + textAlign: 'center', + color: '#fff', + border: 0, + // fontWeight: 'bold', + textShadow: _this2.__input_textShadow + 'rgba(0,0,0,0.7)' + }); + dom.bind(_this2.__saturation_field, 'mousedown', fieldDown); + dom.bind(_this2.__saturation_field, 'touchstart', fieldDown); + dom.bind(_this2.__field_knob, 'mousedown', fieldDown); + dom.bind(_this2.__field_knob, 'touchstart', fieldDown); + dom.bind(_this2.__hue_field, 'mousedown', fieldDownH); + dom.bind(_this2.__hue_field, 'touchstart', fieldDownH); + + function fieldDown(e) { + setSV(e); + dom.bind(window, 'mousemove', setSV); + dom.bind(window, 'touchmove', setSV); + dom.bind(window, 'mouseup', fieldUpSV); + dom.bind(window, 'touchend', fieldUpSV); + } + + function fieldDownH(e) { + setH(e); + dom.bind(window, 'mousemove', setH); + dom.bind(window, 'touchmove', setH); + dom.bind(window, 'mouseup', fieldUpH); + dom.bind(window, 'touchend', fieldUpH); + } + + function fieldUpSV() { + dom.unbind(window, 'mousemove', setSV); + dom.unbind(window, 'touchmove', setSV); + dom.unbind(window, 'mouseup', fieldUpSV); + dom.unbind(window, 'touchend', fieldUpSV); + onFinish(); + } + + function fieldUpH() { + dom.unbind(window, 'mousemove', setH); + dom.unbind(window, 'touchmove', setH); + dom.unbind(window, 'mouseup', fieldUpH); + dom.unbind(window, 'touchend', fieldUpH); + onFinish(); + } + + function onBlur() { + var i = interpret(this.value); + if (i !== false) { + _this.__color.__state = i; + _this.setValue(_this.__color.toOriginal()); + } else { + this.value = _this.__color.toString(); + } + } + + function onFinish() { + if (_this.__onFinishChange) { + _this.__onFinishChange.call(_this, _this.__color.toOriginal()); + } + } + _this2.__saturation_field.appendChild(valueField); + _this2.__selector.appendChild(_this2.__field_knob); + _this2.__selector.appendChild(_this2.__saturation_field); + _this2.__selector.appendChild(_this2.__hue_field); + _this2.__hue_field.appendChild(_this2.__hue_knob); + _this2.domElement.appendChild(_this2.__input); + _this2.domElement.appendChild(_this2.__selector); + _this2.updateDisplay(); + + function setSV(e) { + if (e.type.indexOf('touch') === -1) { + e.preventDefault(); + } + var fieldRect = _this.__saturation_field.getBoundingClientRect(); + var _ref = e.touches && e.touches[0] || e, + clientX = _ref.clientX, + clientY = _ref.clientY; + var s = (clientX - fieldRect.left) / (fieldRect.right - fieldRect.left); + var v = 1 - (clientY - fieldRect.top) / (fieldRect.bottom - fieldRect.top); + if (v > 1) { + v = 1; + } else if (v < 0) { + v = 0; + } + if (s > 1) { + s = 1; + } else if (s < 0) { + s = 0; + } + _this.__color.v = v; + _this.__color.s = s; + _this.setValue(_this.__color.toOriginal()); + return false; + } + + function setH(e) { + if (e.type.indexOf('touch') === -1) { + e.preventDefault(); + } + var fieldRect = _this.__hue_field.getBoundingClientRect(); + var _ref2 = e.touches && e.touches[0] || e, + clientY = _ref2.clientY; + var h = 1 - (clientY - fieldRect.top) / (fieldRect.bottom - fieldRect.top); + if (h > 1) { + h = 1; + } else if (h < 0) { + h = 0; + } + _this.__color.h = h * 360; + _this.setValue(_this.__color.toOriginal()); + return false; + } + return _this2; + } + createClass(ColorController, [{ + key: 'updateDisplay', + value: function updateDisplay() { + var i = interpret(this.getValue()); + if (i !== false) { + var mismatch = false; + Common.each(Color.COMPONENTS, function (component) { + if (!Common.isUndefined(i[component]) && !Common.isUndefined(this.__color.__state[component]) && i[component] !== this.__color.__state[component]) { + mismatch = true; + return {}; + } + }, this); + if (mismatch) { + Common.extend(this.__color.__state, i); + } + } + Common.extend(this.__temp.__state, this.__color.__state); + this.__temp.a = 1; + var flip = this.__color.v < 0.5 || this.__color.s > 0.5 ? 255 : 0; + var _flip = 255 - flip; + Common.extend(this.__field_knob.style, { + marginLeft: 100 * this.__color.s - 7 + 'px', + marginTop: 100 * (1 - this.__color.v) - 7 + 'px', + backgroundColor: this.__temp.toHexString(), + border: this.__field_knob_border + 'rgb(' + flip + ',' + flip + ',' + flip + ')' + }); + this.__hue_knob.style.marginTop = (1 - this.__color.h / 360) * 100 + 'px'; + this.__temp.s = 1; + this.__temp.v = 1; + linearGradient(this.__saturation_field, 'left', '#fff', this.__temp.toHexString()); + this.__input.value = this.__color.toString(); + Common.extend(this.__input.style, { + backgroundColor: this.__color.toHexString(), + color: 'rgb(' + flip + ',' + flip + ',' + flip + ')', + textShadow: this.__input_textShadow + 'rgba(' + _flip + ',' + _flip + ',' + _flip + ',.7)' + }); + } + }]); + return ColorController; + }(Controller); + var vendors = ['-moz-', '-o-', '-webkit-', '-ms-', '']; + + function linearGradient(elem, x, a, b) { + elem.style.background = ''; + Common.each(vendors, function (vendor) { + elem.style.cssText += 'background: ' + vendor + 'linear-gradient(' + x + ', ' + a + ' 0%, ' + b + ' 100%); '; + }); + } + + function hueGradient(elem) { + elem.style.background = ''; + elem.style.cssText += 'background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);'; + elem.style.cssText += 'background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'; + elem.style.cssText += 'background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'; + elem.style.cssText += 'background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'; + elem.style.cssText += 'background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'; + } + + var css = { + load: function load(url, indoc) { + var doc = indoc || document; + var link = doc.createElement('link'); + link.type = 'text/css'; + link.rel = 'stylesheet'; + link.href = url; + doc.getElementsByTagName('head')[0].appendChild(link); + }, + inject: function inject(cssContent, indoc) { + var doc = indoc || document; + var injected = document.createElement('style'); + injected.type = 'text/css'; + injected.innerHTML = cssContent; + var head = doc.getElementsByTagName('head')[0]; + try { + head.appendChild(injected); + } catch (e) {} + } + }; + + var saveDialogContents = "
    \n\n Here's the new load parameter for your GUI's constructor:\n\n \n\n
    \n\n Automatically save\n values to localStorage on exit.\n\n
    The values saved to localStorage will\n override those passed to dat.GUI's constructor. This makes it\n easier to work incrementally, but localStorage is fragile,\n and your friends may not see the same values you do.\n\n
    \n\n
    \n\n
    "; + + var ControllerFactory = function ControllerFactory(object, property) { + var initialValue = object[property]; + if (Common.isArray(arguments[2]) || Common.isObject(arguments[2])) { + return new OptionController(object, property, arguments[2]); + } + if (Common.isNumber(initialValue)) { + if (Common.isNumber(arguments[2]) && Common.isNumber(arguments[3])) { + if (Common.isNumber(arguments[4])) { + return new NumberControllerSlider(object, property, arguments[2], arguments[3], arguments[4]); + } + return new NumberControllerSlider(object, property, arguments[2], arguments[3]); + } + if (Common.isNumber(arguments[4])) { + return new NumberControllerBox(object, property, { + min: arguments[2], + max: arguments[3], + step: arguments[4] + }); + } + return new NumberControllerBox(object, property, { + min: arguments[2], + max: arguments[3] + }); + } + if (Common.isString(initialValue)) { + return new StringController(object, property); + } + if (Common.isFunction(initialValue)) { + return new FunctionController(object, property, ''); + } + if (Common.isBoolean(initialValue)) { + return new BooleanController(object, property); + } + return null; + }; + + function requestAnimationFrame(callback) { + setTimeout(callback, 1000 / 60); + } + var requestAnimationFrame$1 = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || requestAnimationFrame; + + var CenteredDiv = function () { + function CenteredDiv() { + classCallCheck(this, CenteredDiv); + this.backgroundElement = document.createElement('div'); + Common.extend(this.backgroundElement.style, { + backgroundColor: 'rgba(0,0,0,0.8)', + top: 0, + left: 0, + display: 'none', + zIndex: '1000', + opacity: 0, + WebkitTransition: 'opacity 0.2s linear', + transition: 'opacity 0.2s linear' + }); + dom.makeFullscreen(this.backgroundElement); + this.backgroundElement.style.position = 'fixed'; + this.domElement = document.createElement('div'); + Common.extend(this.domElement.style, { + position: 'fixed', + display: 'none', + zIndex: '1001', + opacity: 0, + WebkitTransition: '-webkit-transform 0.2s ease-out, opacity 0.2s linear', + transition: 'transform 0.2s ease-out, opacity 0.2s linear' + }); + document.body.appendChild(this.backgroundElement); + document.body.appendChild(this.domElement); + var _this = this; + dom.bind(this.backgroundElement, 'click', function () { + _this.hide(); + }); + } + createClass(CenteredDiv, [{ + key: 'show', + value: function show() { + var _this = this; + this.backgroundElement.style.display = 'block'; + this.domElement.style.display = 'block'; + this.domElement.style.opacity = 0; + this.domElement.style.webkitTransform = 'scale(1.1)'; + this.layout(); + Common.defer(function () { + _this.backgroundElement.style.opacity = 1; + _this.domElement.style.opacity = 1; + _this.domElement.style.webkitTransform = 'scale(1)'; + }); + } + }, { + key: 'hide', + value: function hide() { + var _this = this; + var hide = function hide() { + _this.domElement.style.display = 'none'; + _this.backgroundElement.style.display = 'none'; + dom.unbind(_this.domElement, 'webkitTransitionEnd', hide); + dom.unbind(_this.domElement, 'transitionend', hide); + dom.unbind(_this.domElement, 'oTransitionEnd', hide); + }; + dom.bind(this.domElement, 'webkitTransitionEnd', hide); + dom.bind(this.domElement, 'transitionend', hide); + dom.bind(this.domElement, 'oTransitionEnd', hide); + this.backgroundElement.style.opacity = 0; + this.domElement.style.opacity = 0; + this.domElement.style.webkitTransform = 'scale(1.1)'; + } + }, { + key: 'layout', + value: function layout() { + this.domElement.style.left = window.innerWidth / 2 - dom.getWidth(this.domElement) / 2 + 'px'; + this.domElement.style.top = window.innerHeight / 2 - dom.getHeight(this.domElement) / 2 + 'px'; + } + }]); + return CenteredDiv; + }(); + + // var styleSheet = ___$insertStyle(".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear;border:0;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button.close-top{position:relative}.dg.main .close-button.close-bottom{position:absolute}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-y:visible}.dg.a.has-save>ul.close-top{margin-top:0}.dg.a.has-save>ul.close-bottom{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{top:0;z-index:1002}.dg.a .save-row.close-top{position:relative}.dg.a .save-row.close-bottom{position:fixed}.dg li{-webkit-transition:height .1s ease-out;-o-transition:height .1s ease-out;-moz-transition:height .1s ease-out;transition:height .1s ease-out;-webkit-transition:overflow .1s linear;-o-transition:overflow .1s linear;-moz-transition:overflow .1s linear;transition:overflow .1s linear}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid transparent}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px;overflow:hidden}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%;position:relative}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:7px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .cr.color{overflow:visible}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2FA1D6}.dg .cr.number input[type=text]{color:#2FA1D6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2FA1D6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\n"); + + // css.inject(styleSheet); + var CSS_NAMESPACE = 'dg'; + var HIDE_KEY_CODE = 72; + var CLOSE_BUTTON_HEIGHT = 20; + var DEFAULT_DEFAULT_PRESET_NAME = 'Default'; + var SUPPORTS_LOCAL_STORAGE = function () { + try { + return 'localStorage' in window && window.localStorage !== null; + } catch (e) { + return false; + } + }(); + var SAVE_DIALOGUE = void 0; + var autoPlaceVirgin = true; + var autoPlaceContainer = void 0; + var hide = false; + var hideableGuis = []; + var GUI = function GUI(pars) { + var _this = this; + var params = pars || {}; + this.domElement = document.createElement('div'); + this.__ul = document.createElement('ul'); + this.domElement.appendChild(this.__ul); + dom.addClass(this.domElement, CSS_NAMESPACE); + this.__folders = {}; + this.__controllers = []; + this.__rememberedObjects = []; + this.__rememberedObjectIndecesToControllers = []; + this.__listening = []; + params = Common.defaults(params, { + closeOnTop: false, + autoPlace: true, + width: GUI.DEFAULT_WIDTH + }); + params = Common.defaults(params, { + resizable: params.autoPlace, + hideable: params.autoPlace + }); + if (!Common.isUndefined(params.load)) { + if (params.preset) { + params.load.preset = params.preset; + } + } else { + params.load = { + preset: DEFAULT_DEFAULT_PRESET_NAME + }; + } + if (Common.isUndefined(params.parent) && params.hideable) { + hideableGuis.push(this); + } + params.resizable = Common.isUndefined(params.parent) && params.resizable; + if (params.autoPlace && Common.isUndefined(params.scrollable)) { + params.scrollable = true; + } + var useLocalStorage = SUPPORTS_LOCAL_STORAGE && localStorage.getItem(getLocalStorageHash(this, 'isLocal')) === 'true'; + var saveToLocalStorage = void 0; + Object.defineProperties(this, { + parent: { + get: function get$$1() { + return params.parent; + } + }, + scrollable: { + get: function get$$1() { + return params.scrollable; + } + }, + autoPlace: { + get: function get$$1() { + return params.autoPlace; + } + }, + closeOnTop: { + get: function get$$1() { + return params.closeOnTop; + } + }, + preset: { + get: function get$$1() { + if (_this.parent) { + return _this.getRoot().preset; + } + return params.load.preset; + }, + set: function set$$1(v) { + if (_this.parent) { + _this.getRoot().preset = v; + } else { + params.load.preset = v; + } + setPresetSelectIndex(this); + _this.revert(); + } + }, + width: { + get: function get$$1() { + return params.width; + }, + set: function set$$1(v) { + params.width = v; + setWidth(_this, v); + } + }, + name: { + get: function get$$1() { + return params.name; + }, + set: function set$$1(v) { + params.name = v; + if (titleRowName) { + titleRowName.innerHTML = params.name; + } + } + }, + closed: { + get: function get$$1() { + return params.closed; + }, + set: function set$$1(v) { + params.closed = v; + if (params.closed) { + dom.addClass(_this.__ul, GUI.CLASS_CLOSED); + } else { + dom.removeClass(_this.__ul, GUI.CLASS_CLOSED); + } + this.onResize(); + if (_this.__closeButton) { + _this.__closeButton.innerHTML = v ? GUI.TEXT_OPEN : GUI.TEXT_CLOSED; + } + } + }, + load: { + get: function get$$1() { + return params.load; + } + }, + useLocalStorage: { + get: function get$$1() { + return useLocalStorage; + }, + set: function set$$1(bool) { + if (SUPPORTS_LOCAL_STORAGE) { + useLocalStorage = bool; + if (bool) { + dom.bind(window, 'unload', saveToLocalStorage); + } else { + dom.unbind(window, 'unload', saveToLocalStorage); + } + localStorage.setItem(getLocalStorageHash(_this, 'isLocal'), bool); + } + } + } + }); + if (Common.isUndefined(params.parent)) { + params.closed = false; + dom.addClass(this.domElement, GUI.CLASS_MAIN); + dom.makeSelectable(this.domElement, false); + if (SUPPORTS_LOCAL_STORAGE) { + if (useLocalStorage) { + _this.useLocalStorage = true; + var savedGui = localStorage.getItem(getLocalStorageHash(this, 'gui')); + if (savedGui) { + params.load = JSON.parse(savedGui); + } + } + } + this.__closeButton = document.createElement('div'); + this.__closeButton.innerHTML = GUI.TEXT_CLOSED; + dom.addClass(this.__closeButton, GUI.CLASS_CLOSE_BUTTON); + if (params.closeOnTop) { + dom.addClass(this.__closeButton, GUI.CLASS_CLOSE_TOP); + this.domElement.insertBefore(this.__closeButton, this.domElement.childNodes[0]); + } else { + dom.addClass(this.__closeButton, GUI.CLASS_CLOSE_BOTTOM); + this.domElement.appendChild(this.__closeButton); + } + dom.bind(this.__closeButton, 'click', function () { + _this.closed = !_this.closed; + }); + } else { + if (params.closed === undefined) { + params.closed = true; + } + var _titleRowName = document.createTextNode(params.name); + dom.addClass(_titleRowName, 'controller-name'); + var titleRow = addRow(_this, _titleRowName); + var onClickTitle = function onClickTitle(e) { + e.preventDefault(); + _this.closed = !_this.closed; + return false; + }; + dom.addClass(this.__ul, GUI.CLASS_CLOSED); + dom.addClass(titleRow, 'title'); + dom.bind(titleRow, 'click', onClickTitle); + if (!params.closed) { + this.closed = false; + } + } + if (params.autoPlace) { + if (Common.isUndefined(params.parent)) { + if (autoPlaceVirgin) { + autoPlaceContainer = document.createElement('div'); + autoPlaceContainer.id = 'dat-gui-container'; + dom.addClass(autoPlaceContainer, CSS_NAMESPACE); + dom.addClass(autoPlaceContainer, GUI.CLASS_AUTO_PLACE_CONTAINER); + // document.body.appendChild(autoPlaceContainer); + document.getElementById('ui-container').appendChild(autoPlaceContainer); + autoPlaceVirgin = false; + } + autoPlaceContainer.appendChild(this.domElement); + dom.addClass(this.domElement, GUI.CLASS_AUTO_PLACE); + } + if (!this.parent) { + setWidth(_this, params.width); + } + } + // this.__resizeHandler = function () { + // _this.onResizeDebounced(); + // }; + // dom.bind(window, 'resize', this.__resizeHandler); + // dom.bind(this.__ul, 'webkitTransitionEnd', this.__resizeHandler); + // dom.bind(this.__ul, 'transitionend', this.__resizeHandler); + // dom.bind(this.__ul, 'oTransitionEnd', this.__resizeHandler); + // this.onResize(); + // if (params.resizable) { + // addResizeHandle(this); + // } + saveToLocalStorage = function saveToLocalStorage() { + if (SUPPORTS_LOCAL_STORAGE && localStorage.getItem(getLocalStorageHash(_this, 'isLocal')) === 'true') { + localStorage.setItem(getLocalStorageHash(_this, 'gui'), JSON.stringify(_this.getSaveObject())); + } + }; + this.saveToLocalStorageIfPossible = saveToLocalStorage; + + function resetWidth() { + var root = _this.getRoot(); + root.width += 1; + Common.defer(function () { + root.width -= 1; + }); + } + if (!params.parent) { + resetWidth(); + } + }; + GUI.toggleHide = function () { + hide = !hide; + Common.each(hideableGuis, function (gui) { + gui.domElement.style.display = hide ? 'none' : ''; + }); + }; + GUI.CLASS_AUTO_PLACE = 'a'; + GUI.CLASS_AUTO_PLACE_CONTAINER = 'ac'; + GUI.CLASS_MAIN = 'main'; + GUI.CLASS_CONTROLLER_ROW = 'cr'; + GUI.CLASS_TOO_TALL = 'taller-than-window'; + GUI.CLASS_CLOSED = 'closed'; + GUI.CLASS_CLOSE_BUTTON = 'close-button'; + GUI.CLASS_CLOSE_TOP = 'close-top'; + GUI.CLASS_CLOSE_BOTTOM = 'close-bottom'; + GUI.CLASS_DRAG = 'drag'; + GUI.DEFAULT_WIDTH = 300; + GUI.TEXT_CLOSED = 'Close Controls'; + GUI.TEXT_OPEN = 'Open Controls'; + GUI._keydownHandler = function (e) { + if (document.activeElement.type !== 'text' && (e.which === HIDE_KEY_CODE || e.keyCode === HIDE_KEY_CODE)) { + GUI.toggleHide(); + } + }; + dom.bind(window, 'keydown', GUI._keydownHandler, false); + Common.extend(GUI.prototype, { + add: function add(object, property) { + return _add(this, object, property, { + factoryArgs: Array.prototype.slice.call(arguments, 2) + }); + }, + addColor: function addColor(object, property) { + return _add(this, object, property, { + color: true + }); + }, + remove: function remove(controller) { + this.__ul.removeChild(controller.__li); + this.__controllers.splice(this.__controllers.indexOf(controller), 1); + var _this = this; + Common.defer(function () { + _this.onResize(); + }); + }, + destroy: function destroy() { + if (this.parent) { + throw new Error('Only the root GUI should be removed with .destroy(). ' + 'For subfolders, use gui.removeFolder(folder) instead.'); + } + if (this.autoPlace) { + autoPlaceContainer.removeChild(this.domElement); + } + var _this = this; + Common.each(this.__folders, function (subfolder) { + _this.removeFolder(subfolder); + }); + dom.unbind(window, 'keydown', GUI._keydownHandler, false); + removeListeners(this); + }, + addFolder: function addFolder(name) { + if (this.__folders[name] !== undefined) { + throw new Error('You already have a folder in this GUI by the' + ' name "' + name + '"'); + } + var newGuiParams = { + name: name, + parent: this + }; + newGuiParams.autoPlace = this.autoPlace; + if (this.load && + this.load.folders && + this.load.folders[name]) { + newGuiParams.closed = this.load.folders[name].closed; + newGuiParams.load = this.load.folders[name]; + } + var gui = new GUI(newGuiParams); + this.__folders[name] = gui; + var li = addRow(this, gui.domElement); + dom.addClass(li, 'folder'); + return gui; + }, + removeFolder: function removeFolder(folder) { + this.__ul.removeChild(folder.domElement.parentElement); + delete this.__folders[folder.name]; + if (this.load && + this.load.folders && + this.load.folders[folder.name]) { + delete this.load.folders[folder.name]; + } + removeListeners(folder); + var _this = this; + Common.each(folder.__folders, function (subfolder) { + folder.removeFolder(subfolder); + }); + Common.defer(function () { + _this.onResize(); + }); + }, + open: function open() { + this.closed = false; + }, + close: function close() { + this.closed = true; + }, + onResize: function onResize() { + var root = this.getRoot(); + if (root.scrollable) { + var top = dom.getOffset(root.__ul).top; + var h = 0; + Common.each(root.__ul.childNodes, function (node) { + if (!(root.autoPlace && node === root.__save_row)) { + h += dom.getHeight(node); + } + }); + if (window.innerHeight - top - CLOSE_BUTTON_HEIGHT < h) { + dom.addClass(root.domElement, GUI.CLASS_TOO_TALL); + root.__ul.style.height = window.innerHeight - top - CLOSE_BUTTON_HEIGHT + 'px'; + } else { + dom.removeClass(root.domElement, GUI.CLASS_TOO_TALL); + root.__ul.style.height = 'auto'; + } + } + if (root.__resize_handle) { + Common.defer(function () { + root.__resize_handle.style.height = root.__ul.offsetHeight + 'px'; + }); + } + if (root.__closeButton) { + root.__closeButton.style.width = root.width + 'px'; + } + }, + onResizeDebounced: Common.debounce(function () { + this.onResize(); + }, 50), + remember: function remember() { + if (Common.isUndefined(SAVE_DIALOGUE)) { + SAVE_DIALOGUE = new CenteredDiv(); + SAVE_DIALOGUE.domElement.innerHTML = saveDialogContents; + } + if (this.parent) { + throw new Error('You can only call remember on a top level GUI.'); + } + var _this = this; + Common.each(Array.prototype.slice.call(arguments), function (object) { + if (_this.__rememberedObjects.length === 0) { + addSaveMenu(_this); + } + if (_this.__rememberedObjects.indexOf(object) === -1) { + _this.__rememberedObjects.push(object); + } + }); + if (this.autoPlace) { + setWidth(this, this.width); + } + }, + getRoot: function getRoot() { + var gui = this; + while (gui.parent) { + gui = gui.parent; + } + return gui; + }, + getSaveObject: function getSaveObject() { + var toReturn = this.load; + toReturn.closed = this.closed; + if (this.__rememberedObjects.length > 0) { + toReturn.preset = this.preset; + if (!toReturn.remembered) { + toReturn.remembered = {}; + } + toReturn.remembered[this.preset] = getCurrentPreset(this); + } + toReturn.folders = {}; + Common.each(this.__folders, function (element, key) { + toReturn.folders[key] = element.getSaveObject(); + }); + return toReturn; + }, + save: function save() { + if (!this.load.remembered) { + this.load.remembered = {}; + } + this.load.remembered[this.preset] = getCurrentPreset(this); + markPresetModified(this, false); + this.saveToLocalStorageIfPossible(); + }, + saveAs: function saveAs(presetName) { + if (!this.load.remembered) { + this.load.remembered = {}; + this.load.remembered[DEFAULT_DEFAULT_PRESET_NAME] = getCurrentPreset(this, true); + } + this.load.remembered[presetName] = getCurrentPreset(this); + this.preset = presetName; + addPresetOption(this, presetName, true); + this.saveToLocalStorageIfPossible(); + }, + revert: function revert(gui) { + Common.each(this.__controllers, function (controller) { + if (!this.getRoot().load.remembered) { + controller.setValue(controller.initialValue); + } else { + recallSavedValue(gui || this.getRoot(), controller); + } + if (controller.__onFinishChange) { + controller.__onFinishChange.call(controller, controller.getValue()); + } + }, this); + Common.each(this.__folders, function (folder) { + folder.revert(folder); + }); + if (!gui) { + markPresetModified(this.getRoot(), false); + } + }, + listen: function listen(controller) { + var init = this.__listening.length === 0; + this.__listening.push(controller); + if (init) { + updateDisplays(this.__listening); + } + }, + updateDisplay: function updateDisplay() { + Common.each(this.__controllers, function (controller) { + controller.updateDisplay(); + }); + Common.each(this.__folders, function (folder) { + folder.updateDisplay(); + }); + } + }); + + function addRow(gui, newDom, liBefore) { + var li = document.createElement('li'); + if (newDom) { + li.appendChild(newDom); + } + if (liBefore) { + gui.__ul.insertBefore(li, liBefore); + } else { + gui.__ul.appendChild(li); + } + gui.onResize(); + return li; + } + + function removeListeners(gui) { + dom.unbind(window, 'resize', gui.__resizeHandler); + if (gui.saveToLocalStorageIfPossible) { + dom.unbind(window, 'unload', gui.saveToLocalStorageIfPossible); + } + } + + function markPresetModified(gui, modified) { + var opt = gui.__preset_select[gui.__preset_select.selectedIndex]; + if (modified) { + opt.innerHTML = opt.value + '*'; + } else { + opt.innerHTML = opt.value; + } + } + + function augmentController(gui, li, controller) { + controller.__li = li; + controller.__gui = gui; + Common.extend(controller, { + options: function options(_options) { + if (arguments.length > 1) { + var nextSibling = controller.__li.nextElementSibling; + controller.remove(); + return _add(gui, controller.object, controller.property, { + before: nextSibling, + factoryArgs: [Common.toArray(arguments)] + }); + } + if (Common.isArray(_options) || Common.isObject(_options)) { + var _nextSibling = controller.__li.nextElementSibling; + controller.remove(); + return _add(gui, controller.object, controller.property, { + before: _nextSibling, + factoryArgs: [_options] + }); + } + }, + name: function name(_name) { + controller.__li.firstElementChild.firstElementChild.innerHTML = _name; + return controller; + }, + listen: function listen() { + controller.__gui.listen(controller); + return controller; + }, + remove: function remove() { + controller.__gui.remove(controller); + return controller; + } + }); + if (controller instanceof NumberControllerSlider) { + var box = new NumberControllerBox(controller.object, controller.property, { + min: controller.__min, + max: controller.__max, + step: controller.__step + }); + Common.each(['updateDisplay', 'onChange', 'onFinishChange', 'step'], function (method) { + var pc = controller[method]; + var pb = box[method]; + controller[method] = box[method] = function () { + var args = Array.prototype.slice.call(arguments); + pb.apply(box, args); + return pc.apply(controller, args); + }; + }); + dom.addClass(li, 'has-slider'); + controller.domElement.insertBefore(box.domElement, controller.domElement.firstElementChild); + } else if (controller instanceof NumberControllerBox) { + var r = function r(returned) { + if (Common.isNumber(controller.__min) && Common.isNumber(controller.__max)) { + var oldName = controller.__li.firstElementChild.firstElementChild.innerHTML; + var wasListening = controller.__gui.__listening.indexOf(controller) > -1; + controller.remove(); + var newController = _add(gui, controller.object, controller.property, { + before: controller.__li.nextElementSibling, + factoryArgs: [controller.__min, controller.__max, controller.__step] + }); + newController.name(oldName); + if (wasListening) newController.listen(); + return newController; + } + return returned; + }; + controller.min = Common.compose(r, controller.min); + controller.max = Common.compose(r, controller.max); + } else if (controller instanceof BooleanController) { + dom.bind(li, 'click', function () { + dom.fakeEvent(controller.__checkbox, 'click'); + }); + dom.bind(controller.__checkbox, 'click', function (e) { + e.stopPropagation(); + }); + } else if (controller instanceof FunctionController) { + dom.bind(li, 'click', function () { + dom.fakeEvent(controller.__button, 'click'); + }); + dom.bind(li, 'mouseover', function () { + dom.addClass(controller.__button, 'hover'); + }); + dom.bind(li, 'mouseout', function () { + dom.removeClass(controller.__button, 'hover'); + }); + } else if (controller instanceof ColorController) { + dom.addClass(li, 'color'); + controller.updateDisplay = Common.compose(function (val) { + li.style.borderLeftColor = controller.__color.toString(); + return val; + }, controller.updateDisplay); + controller.updateDisplay(); + } + controller.setValue = Common.compose(function (val) { + if (gui.getRoot().__preset_select && controller.isModified()) { + markPresetModified(gui.getRoot(), true); + } + return val; + }, controller.setValue); + } + + function recallSavedValue(gui, controller) { + var root = gui.getRoot(); + var matchedIndex = root.__rememberedObjects.indexOf(controller.object); + if (matchedIndex !== -1) { + var controllerMap = root.__rememberedObjectIndecesToControllers[matchedIndex]; + if (controllerMap === undefined) { + controllerMap = {}; + root.__rememberedObjectIndecesToControllers[matchedIndex] = controllerMap; + } + controllerMap[controller.property] = controller; + if (root.load && root.load.remembered) { + var presetMap = root.load.remembered; + var preset = void 0; + if (presetMap[gui.preset]) { + preset = presetMap[gui.preset]; + } else if (presetMap[DEFAULT_DEFAULT_PRESET_NAME]) { + preset = presetMap[DEFAULT_DEFAULT_PRESET_NAME]; + } else { + return; + } + if (preset[matchedIndex] && preset[matchedIndex][controller.property] !== undefined) { + var value = preset[matchedIndex][controller.property]; + controller.initialValue = value; + controller.setValue(value); + } + } + } + } + + function _add(gui, object, property, params) { + if (object[property] === undefined) { + throw new Error('Object "' + object + '" has no property "' + property + '"'); + } + var controller = void 0; + if (params.color) { + controller = new ColorController(object, property); + } else { + var factoryArgs = [object, property].concat(params.factoryArgs); + controller = ControllerFactory.apply(gui, factoryArgs); + } + if (params.before instanceof Controller) { + params.before = params.before.__li; + } + recallSavedValue(gui, controller); + dom.addClass(controller.domElement, 'c'); + var name = document.createElement('span'); + dom.addClass(name, 'property-name'); + name.innerHTML = controller.property; + var container = document.createElement('div'); + container.appendChild(name); + container.appendChild(controller.domElement); + var li = addRow(gui, container, params.before); + dom.addClass(li, GUI.CLASS_CONTROLLER_ROW); + if (controller instanceof ColorController) { + dom.addClass(li, 'color'); + } else { + dom.addClass(li, _typeof(controller.getValue())); + } + augmentController(gui, li, controller); + gui.__controllers.push(controller); + return controller; + } + + function getLocalStorageHash(gui, key) { + return document.location.href + '.' + key; + } + + function addPresetOption(gui, name, setSelected) { + var opt = document.createElement('option'); + opt.innerHTML = name; + opt.value = name; + gui.__preset_select.appendChild(opt); + if (setSelected) { + gui.__preset_select.selectedIndex = gui.__preset_select.length - 1; + } + } + + function showHideExplain(gui, explain) { + explain.style.display = gui.useLocalStorage ? 'block' : 'none'; + } + + function addSaveMenu(gui) { + var div = gui.__save_row = document.createElement('li'); + dom.addClass(gui.domElement, 'has-save'); + gui.__ul.insertBefore(div, gui.__ul.firstChild); + dom.addClass(div, 'save-row'); + var gears = document.createElement('span'); + gears.innerHTML = ' '; + dom.addClass(gears, 'button gears'); + var button = document.createElement('span'); + button.innerHTML = 'Save'; + dom.addClass(button, 'button'); + dom.addClass(button, 'save'); + var button2 = document.createElement('span'); + button2.innerHTML = 'New'; + dom.addClass(button2, 'button'); + dom.addClass(button2, 'save-as'); + var button3 = document.createElement('span'); + button3.innerHTML = 'Revert'; + dom.addClass(button3, 'button'); + dom.addClass(button3, 'revert'); + var select = gui.__preset_select = document.createElement('select'); + if (gui.load && gui.load.remembered) { + Common.each(gui.load.remembered, function (value, key) { + addPresetOption(gui, key, key === gui.preset); + }); + } else { + addPresetOption(gui, DEFAULT_DEFAULT_PRESET_NAME, false); + } + dom.bind(select, 'change', function () { + for (var index = 0; index < gui.__preset_select.length; index++) { + gui.__preset_select[index].innerHTML = gui.__preset_select[index].value; + } + gui.preset = this.value; + }); + div.appendChild(select); + div.appendChild(gears); + div.appendChild(button); + div.appendChild(button2); + div.appendChild(button3); + if (SUPPORTS_LOCAL_STORAGE) { + var explain = document.getElementById('dg-local-explain'); + var localStorageCheckBox = document.getElementById('dg-local-storage'); + var saveLocally = document.getElementById('dg-save-locally'); + saveLocally.style.display = 'block'; + if (localStorage.getItem(getLocalStorageHash(gui, 'isLocal')) === 'true') { + localStorageCheckBox.setAttribute('checked', 'checked'); + } + showHideExplain(gui, explain); + dom.bind(localStorageCheckBox, 'change', function () { + gui.useLocalStorage = !gui.useLocalStorage; + showHideExplain(gui, explain); + }); + } + var newConstructorTextArea = document.getElementById('dg-new-constructor'); + dom.bind(newConstructorTextArea, 'keydown', function (e) { + if (e.metaKey && (e.which === 67 || e.keyCode === 67)) { + SAVE_DIALOGUE.hide(); + } + }); + dom.bind(gears, 'click', function () { + newConstructorTextArea.innerHTML = JSON.stringify(gui.getSaveObject(), undefined, 2); + SAVE_DIALOGUE.show(); + newConstructorTextArea.focus(); + newConstructorTextArea.select(); + }); + dom.bind(button, 'click', function () { + gui.save(); + }); + dom.bind(button2, 'click', function () { + var presetName = prompt('Enter a new preset name.'); + if (presetName) { + gui.saveAs(presetName); + } + }); + dom.bind(button3, 'click', function () { + gui.revert(); + }); + } + + function addResizeHandle(gui) { + var pmouseX = void 0; + gui.__resize_handle = document.createElement('div'); + Common.extend(gui.__resize_handle.style, { + width: '6px', + marginLeft: '-3px', + height: '200px', + cursor: 'ew-resize', + position: 'absolute' + }); + + function drag(e) { + e.preventDefault(); + gui.width += pmouseX - e.clientX; + gui.onResize(); + pmouseX = e.clientX; + return false; + } + + function dragStop() { + dom.removeClass(gui.__closeButton, GUI.CLASS_DRAG); + dom.unbind(window, 'mousemove', drag); + dom.unbind(window, 'mouseup', dragStop); + } + + function dragStart(e) { + e.preventDefault(); + pmouseX = e.clientX; + dom.addClass(gui.__closeButton, GUI.CLASS_DRAG); + dom.bind(window, 'mousemove', drag); + dom.bind(window, 'mouseup', dragStop); + return false; + } + dom.bind(gui.__resize_handle, 'mousedown', dragStart); + dom.bind(gui.__closeButton, 'mousedown', dragStart); + gui.domElement.insertBefore(gui.__resize_handle, gui.domElement.firstElementChild); + } + + function setWidth(gui, w) { + gui.domElement.style.width = w + 'px'; + if (gui.__save_row && gui.autoPlace) { + gui.__save_row.style.width = w + 'px'; + } + if (gui.__closeButton) { + gui.__closeButton.style.width = w + 'px'; + } + } + + function getCurrentPreset(gui, useInitialValues) { + var toReturn = {}; + Common.each(gui.__rememberedObjects, function (val, index) { + var savedValues = {}; + var controllerMap = gui.__rememberedObjectIndecesToControllers[index]; + Common.each(controllerMap, function (controller, property) { + savedValues[property] = useInitialValues ? controller.initialValue : controller.getValue(); + }); + toReturn[index] = savedValues; + }); + return toReturn; + } + + function setPresetSelectIndex(gui) { + for (var index = 0; index < gui.__preset_select.length; index++) { + if (gui.__preset_select[index].value === gui.preset) { + gui.__preset_select.selectedIndex = index; + } + } + } + + function updateDisplays(controllerArray) { + if (controllerArray.length !== 0) { + requestAnimationFrame$1.call(window, function () { + updateDisplays(controllerArray); + }); + } + Common.each(controllerArray, function (c) { + c.updateDisplay(); + }); + } + + var index = { + color: { + Color: Color, + math: ColorMath, + interpret: interpret + }, + controllers: { + Controller: Controller, + BooleanController: BooleanController, + OptionController: OptionController, + StringController: StringController, + NumberController: NumberController, + NumberControllerBox: NumberControllerBox, + NumberControllerSlider: NumberControllerSlider, + FunctionController: FunctionController, + ColorController: ColorController + }, + dom: { + dom: dom + }, + gui: { + GUI: GUI + }, + GUI: GUI + }; + + return index; + +}))); +//# sourceMappingURL=dat.gui.js.map \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/lib/utils/three-to-cannon.js b/Sketchbook-master/Sketchbook-master/src/lib/utils/three-to-cannon.js new file mode 100644 index 00000000..220f4963 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/lib/utils/three-to-cannon.js @@ -0,0 +1,371 @@ +import * as THREE from 'three'; +import * as CANNON from 'cannon'; +import { quickhull } from './THREE.quickhull'; + +var PI_2 = Math.PI / 2; + +var Type = { + BOX: 'Box', + CYLINDER: 'Cylinder', + SPHERE: 'Sphere', + HULL: 'ConvexPolyhedron', + MESH: 'Trimesh' +}; + +/** + * Given a THREE.Object3D instance, creates a corresponding CANNON shape. + * @param {THREE.Object3D} object + * @return {CANNON.Shape} + */ +export const threeToCannon = function (object, options) { + options = options || {}; + + var geometry; + + if (options.type === Type.BOX) { + return createBoundingBoxShape(object); + } else if (options.type === Type.CYLINDER) { + return createBoundingCylinderShape(object, options); + } else if (options.type === Type.SPHERE) { + return createBoundingSphereShape(object, options); + } else if (options.type === Type.HULL) { + return createConvexPolyhedron(object); + } else if (options.type === Type.MESH) { + geometry = getGeometry(object); + return geometry ? createTrimeshShape(geometry) : null; + } else if (options.type) { + throw new Error('[CANNON.threeToCannon] Invalid type "%s".', options.type); + } + + geometry = getGeometry(object); + if (!geometry) return null; + + var type = geometry.metadata + ? geometry.metadata.type + : geometry.type; + + switch (type) { + case 'BoxGeometry': + case 'BoxBufferGeometry': + return createBoxShape(geometry); + case 'CylinderGeometry': + case 'CylinderBufferGeometry': + return createCylinderShape(geometry); + case 'PlaneGeometry': + case 'PlaneBufferGeometry': + return createPlaneShape(geometry); + case 'SphereGeometry': + case 'SphereBufferGeometry': + return createSphereShape(geometry); + case 'TubeGeometry': + case 'Geometry': + case 'BufferGeometry': + return createBoundingBoxShape(object); + default: + console.warn('Unrecognized geometry: "%s". Using bounding box as shape.', geometry.type); + return createBoxShape(geometry); + } +}; + +threeToCannon.Type = Type; + +/****************************************************************************** + * Shape construction + */ + + /** + * @param {THREE.Geometry} geometry + * @return {CANNON.Shape} + */ + function createBoxShape (geometry) { + var vertices = getVertices(geometry); + + if (!vertices.length) return null; + + geometry.computeBoundingBox(); + var box = geometry.boundingBox; + return new CANNON.Box(new CANNON.Vec3( + (box.max.x - box.min.x) / 2, + (box.max.y - box.min.y) / 2, + (box.max.z - box.min.z) / 2 + )); + } + +/** + * Bounding box needs to be computed with the entire mesh, not just geometry. + * @param {THREE.Object3D} mesh + * @return {CANNON.Shape} + */ +function createBoundingBoxShape (object) { + var shape, localPosition, + box = new THREE.Box3(); + + var clone = object.clone(); + clone.quaternion.set(0, 0, 0, 1); + clone.updateMatrixWorld(); + + box.setFromObject(clone); + + if (!isFinite(box.min.lengthSq())) return null; + + shape = new CANNON.Box(new CANNON.Vec3( + (box.max.x - box.min.x) / 2, + (box.max.y - box.min.y) / 2, + (box.max.z - box.min.z) / 2 + )); + + localPosition = box.translate(clone.position.negate()).getCenter(new THREE.Vector3()); + if (localPosition.lengthSq()) { + shape.offset = localPosition; + } + + return shape; +} + +/** + * Computes 3D convex hull as a CANNON.ConvexPolyhedron. + * @param {THREE.Object3D} mesh + * @return {CANNON.Shape} + */ +function createConvexPolyhedron (object) { + var i, vertices, faces, hull, + eps = 1e-4, + geometry = getGeometry(object); + + if (!geometry || !geometry.vertices.length) return null; + + // Perturb. + for (i = 0; i < geometry.vertices.length; i++) { + geometry.vertices[i].x += (Math.random() - 0.5) * eps; + geometry.vertices[i].y += (Math.random() - 0.5) * eps; + geometry.vertices[i].z += (Math.random() - 0.5) * eps; + } + + // Compute the 3D convex hull. + hull = quickhull(geometry); + + // Convert from THREE.Vector3 to CANNON.Vec3. + vertices = new Array(hull.vertices.length); + for (i = 0; i < hull.vertices.length; i++) { + vertices[i] = new CANNON.Vec3(hull.vertices[i].x, hull.vertices[i].y, hull.vertices[i].z); + } + + // Convert from THREE.Face to Array. + faces = new Array(hull.faces.length); + for (i = 0; i < hull.faces.length; i++) { + faces[i] = [hull.faces[i].a, hull.faces[i].b, hull.faces[i].c]; + } + + return new CANNON.ConvexPolyhedron(vertices, faces); +} + +/** + * @param {THREE.Geometry} geometry + * @return {CANNON.Shape} + */ +function createCylinderShape (geometry) { + var shape, + params = geometry.metadata + ? geometry.metadata.parameters + : geometry.parameters; + shape = new CANNON.Cylinder( + params.radiusTop, + params.radiusBottom, + params.height, + params.radialSegments + ); + + // Include metadata for serialization. + shape._type = CANNON.Shape.types.CYLINDER; // Patch schteppe/cannon.js#329. + shape.radiusTop = params.radiusTop; + shape.radiusBottom = params.radiusBottom; + shape.height = params.height; + shape.numSegments = params.radialSegments; + + shape.orientation = new CANNON.Quaternion(); + shape.orientation.setFromEuler(THREE.Math.degToRad(90), 0, 0, 'XYZ').normalize(); + return shape; +} + +/** + * @param {THREE.Object3D} object + * @return {CANNON.Shape} + */ +function createBoundingCylinderShape (object, options) { + var shape, height, radius, + box = new THREE.Box3(), + axes = ['x', 'y', 'z'], + majorAxis = options.cylinderAxis || 'y', + minorAxes = axes.splice(axes.indexOf(majorAxis), 1) && axes; + + box.setFromObject(object); + + if (!isFinite(box.min.lengthSq())) return null; + + // Compute cylinder dimensions. + height = box.max[majorAxis] - box.min[majorAxis]; + radius = 0.5 * Math.max( + box.max[minorAxes[0]] - box.min[minorAxes[0]], + box.max[minorAxes[1]] - box.min[minorAxes[1]] + ); + + // Create shape. + shape = new CANNON.Cylinder(radius, radius, height, 12); + + // Include metadata for serialization. + shape._type = CANNON.Shape.types.CYLINDER; // Patch schteppe/cannon.js#329. + shape.radiusTop = radius; + shape.radiusBottom = radius; + shape.height = height; + shape.numSegments = 12; + + shape.orientation = new CANNON.Quaternion(); + shape.orientation.setFromEuler( + majorAxis === 'y' ? PI_2 : 0, + majorAxis === 'z' ? PI_2 : 0, + 0, + 'XYZ' + ).normalize(); + return shape; +} + +/** + * @param {THREE.Geometry} geometry + * @return {CANNON.Shape} + */ +function createPlaneShape (geometry) { + geometry.computeBoundingBox(); + var box = geometry.boundingBox; + return new CANNON.Box(new CANNON.Vec3( + (box.max.x - box.min.x) / 2 || 0.1, + (box.max.y - box.min.y) / 2 || 0.1, + (box.max.z - box.min.z) / 2 || 0.1 + )); +} + +/** + * @param {THREE.Geometry} geometry + * @return {CANNON.Shape} + */ +function createSphereShape (geometry) { + var params = geometry.metadata + ? geometry.metadata.parameters + : geometry.parameters; + return new CANNON.Sphere(params.radius); +} + +/** + * @param {THREE.Object3D} object + * @return {CANNON.Shape} + */ +function createBoundingSphereShape (object, options) { + if (options.sphereRadius) { + return new CANNON.Sphere(options.sphereRadius); + } + var geometry = getGeometry(object); + if (!geometry) return null; + geometry.computeBoundingSphere(); + return new CANNON.Sphere(geometry.boundingSphere.radius); +} + +/** + * @param {THREE.Geometry} geometry + * @return {CANNON.Shape} + */ +function createTrimeshShape (geometry) { + var indices, + vertices = getVertices(geometry); + + if (!vertices.length) return null; + + indices = Object.keys(vertices).map(Number); + return new CANNON.Trimesh(vertices, indices); +} + +/****************************************************************************** + * Utils + */ + +/** + * Returns a single geometry for the given object. If the object is compound, + * its geometries are automatically merged. + * @param {THREE.Object3D} object + * @return {THREE.Geometry} + */ +function getGeometry (object) { + var matrix, mesh, + meshes = getMeshes(object), + tmp = new THREE.Geometry(), + combined = new THREE.Geometry(); + + if (meshes.length === 0) return null; + + // Apply scale – it can't easily be applied to a CANNON.Shape later. + if (meshes.length === 1) { + var position = new THREE.Vector3(), + quaternion = new THREE.Quaternion(), + scale = new THREE.Vector3(); + if (meshes[0].geometry.isBufferGeometry) { + if (meshes[0].geometry.attributes.position + && meshes[0].geometry.attributes.position.itemSize > 2) { + tmp.fromBufferGeometry(meshes[0].geometry); + } + } else { + tmp = meshes[0].geometry.clone(); + } + tmp.metadata = meshes[0].geometry.metadata; + meshes[0].updateMatrixWorld(); + meshes[0].matrixWorld.decompose(position, quaternion, scale); + return tmp.scale(scale.x, scale.y, scale.z); + } + + // Recursively merge geometry, preserving local transforms. + while ((mesh = meshes.pop())) { + mesh.updateMatrixWorld(); + if (mesh.geometry.isBufferGeometry) { + if (mesh.geometry.attributes.position + && mesh.geometry.attributes.position.itemSize > 2) { + var tmpGeom = new THREE.Geometry(); + tmpGeom.fromBufferGeometry(mesh.geometry); + combined.merge(tmpGeom, mesh.matrixWorld); + tmpGeom.dispose(); + } + } else { + combined.merge(mesh.geometry, mesh.matrixWorld); + } + } + + matrix = new THREE.Matrix4(); + matrix.scale(object.scale); + combined.applyMatrix(matrix); + return combined; +} + +/** + * @param {THREE.Geometry} geometry + * @return {Array} + */ +function getVertices (geometry) { + if (!geometry.attributes) { + geometry = new THREE.BufferGeometry().fromGeometry(geometry); + } + return (geometry.attributes.position || {}).array || []; +} + +/** + * Returns a flat array of THREE.Mesh instances from the given object. If + * nested transformations are found, they are applied to child meshes + * as mesh.userData.matrix, so that each mesh has its position/rotation/scale + * independently of all of its parents except the top-level object. + * @param {THREE.Object3D} object + * @return {Array} + */ +function getMeshes (object) { + var meshes = []; + object.traverse(function (o) { + if (o.type === 'Mesh') { + meshes.push(o); + } + }); + return meshes; +} diff --git a/Sketchbook-master/Sketchbook-master/src/ts/characters/Character.ts b/Sketchbook-master/Sketchbook-master/src/ts/characters/Character.ts new file mode 100644 index 00000000..03f3b739 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/characters/Character.ts @@ -0,0 +1,989 @@ +import * as THREE from 'three'; +import * as CANNON from 'cannon'; +import * as _ from 'lodash'; +import * as Utils from '../core/FunctionLibrary'; + +import { KeyBinding } from '../core/KeyBinding'; +import { VectorSpringSimulator } from '../physics/spring_simulation/VectorSpringSimulator'; +import { RelativeSpringSimulator } from '../physics/spring_simulation/RelativeSpringSimulator'; +import { Idle } from './character_states/Idle'; +import { EnteringVehicle } from './character_states/vehicles/EnteringVehicle'; +import { ExitingVehicle } from './character_states/vehicles/ExitingVehicle'; +import { OpenVehicleDoor as OpenVehicleDoor } from './character_states/vehicles/OpenVehicleDoor'; +import { Driving } from './character_states/vehicles/Driving'; +import { ExitingAirplane } from './character_states/vehicles/ExitingAirplane'; +import { ICharacterAI } from '../interfaces/ICharacterAI'; +import { World } from '../world/World'; +import { IControllable } from '../interfaces/IControllable'; +import { ICharacterState } from '../interfaces/ICharacterState'; +import { IWorldEntity } from '../interfaces/IWorldEntity'; +import { VehicleSeat } from '../vehicles/VehicleSeat'; +import { Vehicle } from '../vehicles/Vehicle'; +import { CollisionGroups } from '../enums/CollisionGroups'; +import { CapsuleCollider } from '../physics/colliders/CapsuleCollider'; +import { VehicleEntryInstance } from './VehicleEntryInstance'; +import { SeatType } from '../enums/SeatType'; +import { GroundImpactData } from './GroundImpactData'; +import { ClosestObjectFinder } from '../core/ClosestObjectFinder'; +import { Object3D } from 'three'; +import { EntityType } from '../enums/EntityType'; + +export class Character extends THREE.Object3D implements IWorldEntity +{ + public updateOrder: number = 1; + public entityType: EntityType = EntityType.Character; + + public height: number = 0; + public tiltContainer: THREE.Group; + public modelContainer: THREE.Group; + public materials: THREE.Material[] = []; + public mixer: THREE.AnimationMixer; + public animations: any[]; + + // Movement + public acceleration: THREE.Vector3 = new THREE.Vector3(); + public velocity: THREE.Vector3 = new THREE.Vector3(); + public arcadeVelocityInfluence: THREE.Vector3 = new THREE.Vector3(); + public velocityTarget: THREE.Vector3 = new THREE.Vector3(); + public arcadeVelocityIsAdditive: boolean = false; + + public defaultVelocitySimulatorDamping: number = 0.8; + public defaultVelocitySimulatorMass: number = 50; + public velocitySimulator: VectorSpringSimulator; + public moveSpeed: number = 4; + public angularVelocity: number = 0; + public orientation: THREE.Vector3 = new THREE.Vector3(0, 0, 1); + public orientationTarget: THREE.Vector3 = new THREE.Vector3(0, 0, 1); + public defaultRotationSimulatorDamping: number = 0.5; + public defaultRotationSimulatorMass: number = 10; + public rotationSimulator: RelativeSpringSimulator; + public viewVector: THREE.Vector3; + public actions: { [action: string]: KeyBinding }; + public characterCapsule: CapsuleCollider; + + // Ray casting + public rayResult: CANNON.RaycastResult = new CANNON.RaycastResult(); + public rayHasHit: boolean = false; + public rayCastLength: number = 0.57; + public raySafeOffset: number = 0.03; + public wantsToJump: boolean = false; + public initJumpSpeed: number = -1; + public groundImpactData: GroundImpactData = new GroundImpactData(); + public raycastBox: THREE.Mesh; + + public world: World; + public charState: ICharacterState; + public behaviour: ICharacterAI; + + // Vehicles + public controlledObject: IControllable; + public occupyingSeat: VehicleSeat = null; + public vehicleEntryInstance: VehicleEntryInstance = null; + + private physicsEnabled: boolean = true; + + constructor(gltf: any) + { + super(); + + this.readCharacterData(gltf); + this.setAnimations(gltf.animations); + + // The visuals group is centered for easy character tilting + this.tiltContainer = new THREE.Group(); + this.add(this.tiltContainer); + + // Model container is used to reliably ground the character, as animation can alter the position of the model itself + this.modelContainer = new THREE.Group(); + this.modelContainer.position.y = -0.57; + this.tiltContainer.add(this.modelContainer); + this.modelContainer.add(gltf.scene); + + this.mixer = new THREE.AnimationMixer(gltf.scene); + + this.velocitySimulator = new VectorSpringSimulator(60, this.defaultVelocitySimulatorMass, this.defaultVelocitySimulatorDamping); + this.rotationSimulator = new RelativeSpringSimulator(60, this.defaultRotationSimulatorMass, this.defaultRotationSimulatorDamping); + + this.viewVector = new THREE.Vector3(); + + // Actions + this.actions = { + 'up': new KeyBinding('KeyW'), + 'down': new KeyBinding('KeyS'), + 'left': new KeyBinding('KeyA'), + 'right': new KeyBinding('KeyD'), + 'run': new KeyBinding('ShiftLeft'), + 'jump': new KeyBinding('Space'), + 'use': new KeyBinding('KeyE'), + 'enter': new KeyBinding('KeyF'), + 'enter_passenger': new KeyBinding('KeyG'), + 'seat_switch': new KeyBinding('KeyX'), + 'primary': new KeyBinding('Mouse0'), + 'secondary': new KeyBinding('Mouse1'), + }; + + // Physics + // Player Capsule + this.characterCapsule = new CapsuleCollider({ + mass: 1, + position: new CANNON.Vec3(), + height: 0.5, + radius: 0.25, + segments: 8, + friction: 0.0 + }); + // capsulePhysics.physical.collisionFilterMask = ~CollisionGroups.Trimesh; + this.characterCapsule.body.shapes.forEach((shape) => { + // tslint:disable-next-line: no-bitwise + shape.collisionFilterMask = ~CollisionGroups.TrimeshColliders; + }); + this.characterCapsule.body.allowSleep = false; + + // Move character to different collision group for raycasting + this.characterCapsule.body.collisionFilterGroup = 2; + + // Disable character rotation + this.characterCapsule.body.fixedRotation = true; + this.characterCapsule.body.updateMassProperties(); + + // Ray cast debug + const boxGeo = new THREE.BoxGeometry(0.1, 0.1, 0.1); + const boxMat = new THREE.MeshLambertMaterial({ + color: 0xff0000 + }); + this.raycastBox = new THREE.Mesh(boxGeo, boxMat); + this.raycastBox.visible = false; + + // Physics pre/post step callback bindings + this.characterCapsule.body.preStep = (body: CANNON.Body) => { this.physicsPreStep(body, this); }; + this.characterCapsule.body.postStep = (body: CANNON.Body) => { this.physicsPostStep(body, this); }; + + // States + this.setState(new Idle(this)); + } + + public setAnimations(animations: []): void + { + this.animations = animations; + } + + public setArcadeVelocityInfluence(x: number, y: number = x, z: number = x): void + { + this.arcadeVelocityInfluence.set(x, y, z); + } + + public setViewVector(vector: THREE.Vector3): void + { + this.viewVector.copy(vector).normalize(); + } + + /** + * Set state to the player. Pass state class (function) name. + * @param {function} State + */ + public setState(state: ICharacterState): void + { + this.charState = state; + this.charState.onInputChange(); + } + + public setPosition(x: number, y: number, z: number): void + { + if (this.physicsEnabled) + { + this.characterCapsule.body.previousPosition = new CANNON.Vec3(x, y, z); + this.characterCapsule.body.position = new CANNON.Vec3(x, y, z); + this.characterCapsule.body.interpolatedPosition = new CANNON.Vec3(x, y, z); + } + else + { + this.position.x = x; + this.position.y = y; + this.position.z = z; + } + } + + public resetVelocity(): void + { + this.velocity.x = 0; + this.velocity.y = 0; + this.velocity.z = 0; + + this.characterCapsule.body.velocity.x = 0; + this.characterCapsule.body.velocity.y = 0; + this.characterCapsule.body.velocity.z = 0; + + this.velocitySimulator.init(); + } + + public setArcadeVelocityTarget(velZ: number, velX: number = 0, velY: number = 0): void + { + this.velocityTarget.z = velZ; + this.velocityTarget.x = velX; + this.velocityTarget.y = velY; + } + + public setOrientation(vector: THREE.Vector3, instantly: boolean = false): void + { + let lookVector = new THREE.Vector3().copy(vector).setY(0).normalize(); + this.orientationTarget.copy(lookVector); + + if (instantly) + { + this.orientation.copy(lookVector); + } + } + + public resetOrientation(): void + { + const forward = Utils.getForward(this); + this.setOrientation(forward, true); + } + + public setBehaviour(behaviour: ICharacterAI): void + { + behaviour.character = this; + this.behaviour = behaviour; + } + + public setPhysicsEnabled(value: boolean): void { + this.physicsEnabled = value; + + if (value === true) + { + this.world.physicsWorld.addBody(this.characterCapsule.body); + } + else + { + this.world.physicsWorld.remove(this.characterCapsule.body); + } + } + + public readCharacterData(gltf: any): void + { + gltf.scene.traverse((child) => { + + if (child.isMesh) + { + Utils.setupMeshProperties(child); + + if (child.material !== undefined) + { + this.materials.push(child.material); + } + } + }); + } + + public handleKeyboardEvent(event: KeyboardEvent, code: string, pressed: boolean): void + { + if (this.controlledObject !== undefined) + { + this.controlledObject.handleKeyboardEvent(event, code, pressed); + } + else + { + // Free camera + if (code === 'KeyC' && pressed === true && event.shiftKey === true) + { + this.resetControls(); + this.world.cameraOperator.characterCaller = this; + this.world.inputManager.setInputReceiver(this.world.cameraOperator); + } + else if (code === 'KeyR' && pressed === true && event.shiftKey === true) + { + this.world.restartScenario(); + } + else + { + for (const action in this.actions) { + if (this.actions.hasOwnProperty(action)) { + const binding = this.actions[action]; + + if (_.includes(binding.eventCodes, code)) + { + this.triggerAction(action, pressed); + } + } + } + } + } + } + + public handleMouseButton(event: MouseEvent, code: string, pressed: boolean): void + { + if (this.controlledObject !== undefined) + { + this.controlledObject.handleMouseButton(event, code, pressed); + } + else + { + for (const action in this.actions) { + if (this.actions.hasOwnProperty(action)) { + const binding = this.actions[action]; + + if (_.includes(binding.eventCodes, code)) + { + this.triggerAction(action, pressed); + } + } + } + } + } + + public handleMouseMove(event: MouseEvent, deltaX: number, deltaY: number): void + { + if (this.controlledObject !== undefined) + { + this.controlledObject.handleMouseMove(event, deltaX, deltaY); + } + else + { + this.world.cameraOperator.move(deltaX, deltaY); + } + } + + public handleMouseWheel(event: WheelEvent, value: number): void + { + if (this.controlledObject !== undefined) + { + this.controlledObject.handleMouseWheel(event, value); + } + else + { + this.world.scrollTheTimeScale(value); + } + } + + public triggerAction(actionName: string, value: boolean): void + { + // Get action and set it's parameters + let action = this.actions[actionName]; + + if (action.isPressed !== value) + { + // Set value + action.isPressed = value; + + // Reset the 'just' attributes + action.justPressed = false; + action.justReleased = false; + + // Set the 'just' attributes + if (value) action.justPressed = true; + else action.justReleased = true; + + // Tell player to handle states according to new input + this.charState.onInputChange(); + + // Reset the 'just' attributes + action.justPressed = false; + action.justReleased = false; + } + } + + public takeControl(): void + { + if (this.world !== undefined) + { + this.world.inputManager.setInputReceiver(this); + } + else + { + console.warn('Attempting to take control of a character that doesn\'t belong to a world.'); + } + } + + public resetControls(): void + { + for (const action in this.actions) { + if (this.actions.hasOwnProperty(action)) { + this.triggerAction(action, false); + } + } + } + + public update(timeStep: number): void + { + this.behaviour?.update(timeStep); + this.vehicleEntryInstance?.update(timeStep); + // console.log(this.occupyingSeat); + this.charState?.update(timeStep); + + // this.visuals.position.copy(this.modelOffset); + if (this.physicsEnabled) this.springMovement(timeStep); + if (this.physicsEnabled) this.springRotation(timeStep); + if (this.physicsEnabled) this.rotateModel(); + if (this.mixer !== undefined) this.mixer.update(timeStep); + + // Sync physics/graphics + if (this.physicsEnabled) + { + this.position.set( + this.characterCapsule.body.interpolatedPosition.x, + this.characterCapsule.body.interpolatedPosition.y, + this.characterCapsule.body.interpolatedPosition.z + ); + } + else { + let newPos = new THREE.Vector3(); + this.getWorldPosition(newPos); + + this.characterCapsule.body.position.copy(Utils.cannonVector(newPos)); + this.characterCapsule.body.interpolatedPosition.copy(Utils.cannonVector(newPos)); + } + + this.updateMatrixWorld(); + } + + public inputReceiverInit(): void + { + if (this.controlledObject !== undefined) + { + this.controlledObject.inputReceiverInit(); + return; + } + + this.world.cameraOperator.setRadius(1.6, true); + this.world.cameraOperator.followMode = false; + // this.world.dirLight.target = this; + + this.displayControls(); + } + + public displayControls(): void + { + this.world.updateControls([ + { + keys: ['W', 'A', 'S', 'D'], + desc: 'Movement' + }, + { + keys: ['Shift'], + desc: 'Sprint' + }, + { + keys: ['Space'], + desc: 'Jump' + }, + { + keys: ['F', 'or', 'G'], + desc: 'Enter vehicle' + }, + { + keys: ['Shift', '+', 'R'], + desc: 'Respawn' + }, + { + keys: ['Shift', '+', 'C'], + desc: 'Free camera' + }, + ]); + } + + public inputReceiverUpdate(timeStep: number): void + { + if (this.controlledObject !== undefined) + { + this.controlledObject.inputReceiverUpdate(timeStep); + } + else + { + // Look in camera's direction + this.viewVector = new THREE.Vector3().subVectors(this.position, this.world.camera.position); + this.getWorldPosition(this.world.cameraOperator.target); + } + + } + + public setAnimation(clipName: string, fadeIn: number): number + { + if (this.mixer !== undefined) + { + // gltf + let clip = THREE.AnimationClip.findByName( this.animations, clipName ); + + let action = this.mixer.clipAction(clip); + if (action === null) + { + console.error(`Animation ${clipName} not found!`); + return 0; + } + + this.mixer.stopAllAction(); + action.fadeIn(fadeIn); + action.play(); + + return action.getClip().duration; + } + } + + public springMovement(timeStep: number): void + { + // Simulator + this.velocitySimulator.target.copy(this.velocityTarget); + this.velocitySimulator.simulate(timeStep); + + // Update values + this.velocity.copy(this.velocitySimulator.position); + this.acceleration.copy(this.velocitySimulator.velocity); + } + + public springRotation(timeStep: number): void + { + // Spring rotation + // Figure out angle between current and target orientation + let angle = Utils.getSignedAngleBetweenVectors(this.orientation, this.orientationTarget); + + // Simulator + this.rotationSimulator.target = angle; + this.rotationSimulator.simulate(timeStep); + let rot = this.rotationSimulator.position; + + // Updating values + this.orientation.applyAxisAngle(new THREE.Vector3(0, 1, 0), rot); + this.angularVelocity = this.rotationSimulator.velocity; + } + + public getLocalMovementDirection(): THREE.Vector3 + { + const positiveX = this.actions.right.isPressed ? -1 : 0; + const negativeX = this.actions.left.isPressed ? 1 : 0; + const positiveZ = this.actions.up.isPressed ? 1 : 0; + const negativeZ = this.actions.down.isPressed ? -1 : 0; + + return new THREE.Vector3(positiveX + negativeX, 0, positiveZ + negativeZ).normalize(); + } + + public getCameraRelativeMovementVector(): THREE.Vector3 + { + const localDirection = this.getLocalMovementDirection(); + const flatViewVector = new THREE.Vector3(this.viewVector.x, 0, this.viewVector.z).normalize(); + + return Utils.appplyVectorMatrixXZ(flatViewVector, localDirection); + } + + public setCameraRelativeOrientationTarget(): void + { + if (this.vehicleEntryInstance === null) + { + let moveVector = this.getCameraRelativeMovementVector(); + + if (moveVector.x === 0 && moveVector.y === 0 && moveVector.z === 0) + { + this.setOrientation(this.orientation); + } + else + { + this.setOrientation(moveVector); + } + } + } + + public rotateModel(): void + { + this.lookAt(this.position.x + this.orientation.x, this.position.y + this.orientation.y, this.position.z + this.orientation.z); + this.tiltContainer.rotation.z = (-this.angularVelocity * 2.3 * this.velocity.length()); + this.tiltContainer.position.setY((Math.cos(Math.abs(this.angularVelocity * 2.3 * this.velocity.length())) / 2) - 0.5); + } + + public jump(initJumpSpeed: number = -1): void + { + this.wantsToJump = true; + this.initJumpSpeed = initJumpSpeed; + } + + public findVehicleToEnter(wantsToDrive: boolean): void + { + // reusable world position variable + let worldPos = new THREE.Vector3(); + + // Find best vehicle + let vehicleFinder = new ClosestObjectFinder(this.position, 10); + this.world.vehicles.forEach((vehicle) => + { + vehicleFinder.consider(vehicle, vehicle.position); + }); + + if (vehicleFinder.closestObject !== undefined) + { + let vehicle = vehicleFinder.closestObject; + let vehicleEntryInstance = new VehicleEntryInstance(this); + vehicleEntryInstance.wantsToDrive = wantsToDrive; + + // Find best seat + let seatFinder = new ClosestObjectFinder(this.position); + for (const seat of vehicle.seats) + { + if (wantsToDrive) + { + // Consider driver seats + if (seat.type === SeatType.Driver) + { + seat.seatPointObject.getWorldPosition(worldPos); + seatFinder.consider(seat, worldPos); + } + // Consider passenger seats connected to driver seats + else if (seat.type === SeatType.Passenger) + { + for (const connSeat of seat.connectedSeats) + { + if (connSeat.type === SeatType.Driver) + { + seat.seatPointObject.getWorldPosition(worldPos); + seatFinder.consider(seat, worldPos); + break; + } + } + } + } + else + { + // Consider passenger seats + if (seat.type === SeatType.Passenger) + { + seat.seatPointObject.getWorldPosition(worldPos); + seatFinder.consider(seat, worldPos); + } + } + } + + if (seatFinder.closestObject !== undefined) + { + let targetSeat = seatFinder.closestObject; + vehicleEntryInstance.targetSeat = targetSeat; + + let entryPointFinder = new ClosestObjectFinder(this.position); + + for (const point of targetSeat.entryPoints) { + point.getWorldPosition(worldPos); + entryPointFinder.consider(point, worldPos); + } + + if (entryPointFinder.closestObject !== undefined) + { + vehicleEntryInstance.entryPoint = entryPointFinder.closestObject; + this.triggerAction('up', true); + this.vehicleEntryInstance = vehicleEntryInstance; + } + } + } + } + + public enterVehicle(seat: VehicleSeat, entryPoint: THREE.Object3D): void + { + this.resetControls(); + + if (seat.door?.rotation < 0.5) + { + this.setState(new OpenVehicleDoor(this, seat, entryPoint)); + } + else + { + this.setState(new EnteringVehicle(this, seat, entryPoint)); + } + } + + public teleportToVehicle(vehicle: Vehicle, seat: VehicleSeat): void + { + this.resetVelocity(); + this.rotateModel(); + this.setPhysicsEnabled(false); + (vehicle as unknown as THREE.Object3D).attach(this); + + this.setPosition(seat.seatPointObject.position.x, seat.seatPointObject.position.y + 0.6, seat.seatPointObject.position.z); + this.quaternion.copy(seat.seatPointObject.quaternion); + + this.occupySeat(seat); + this.setState(new Driving(this, seat)); + + this.startControllingVehicle(vehicle, seat); + } + + public startControllingVehicle(vehicle: IControllable, seat: VehicleSeat): void + { + if (this.controlledObject !== vehicle) + { + this.transferControls(vehicle); + this.resetControls(); + + this.controlledObject = vehicle; + this.controlledObject.allowSleep(false); + vehicle.inputReceiverInit(); + + vehicle.controllingCharacter = this; + } + } + + public transferControls(entity: IControllable): void + { + // Currently running through all actions of this character and the vehicle, + // comparing keycodes of actions and based on that triggering vehicle's actions + // Maybe we should ask input manager what's the current state of the keyboard + // and read those values... TODO + for (const action1 in this.actions) { + if (this.actions.hasOwnProperty(action1)) { + for (const action2 in entity.actions) { + if (entity.actions.hasOwnProperty(action2)) { + + let a1 = this.actions[action1]; + let a2 = entity.actions[action2]; + + a1.eventCodes.forEach((code1) => { + a2.eventCodes.forEach((code2) => { + if (code1 === code2) + { + entity.triggerAction(action2, a1.isPressed); + } + }); + }); + } + } + } + } + } + + public stopControllingVehicle(): void + { + if (this.controlledObject?.controllingCharacter === this) + { + this.controlledObject.allowSleep(true); + this.controlledObject.controllingCharacter = undefined; + this.controlledObject.resetControls(); + this.controlledObject = undefined; + this.inputReceiverInit(); + } + } + + public exitVehicle(): void + { + if (this.occupyingSeat !== null) + { + if (this.occupyingSeat.vehicle.entityType === EntityType.Airplane) + { + this.setState(new ExitingAirplane(this, this.occupyingSeat)); + } + else + { + this.setState(new ExitingVehicle(this, this.occupyingSeat)); + } + + this.stopControllingVehicle(); + } + } + + public occupySeat(seat: VehicleSeat): void + { + this.occupyingSeat = seat; + seat.occupiedBy = this; + } + + public leaveSeat(): void + { + if (this.occupyingSeat !== null) + { + this.occupyingSeat.occupiedBy = null; + this.occupyingSeat = null; + } + } + + public physicsPreStep(body: CANNON.Body, character: Character): void + { + character.feetRaycast(); + + // Raycast debug + if (character.rayHasHit) + { + if (character.raycastBox.visible) { + character.raycastBox.position.x = character.rayResult.hitPointWorld.x; + character.raycastBox.position.y = character.rayResult.hitPointWorld.y; + character.raycastBox.position.z = character.rayResult.hitPointWorld.z; + } + } + else + { + if (character.raycastBox.visible) { + character.raycastBox.position.set(body.position.x, body.position.y - character.rayCastLength - character.raySafeOffset, body.position.z); + } + } + } + + public feetRaycast(): void + { + // Player ray casting + // Create ray + let body = this.characterCapsule.body; + const start = new CANNON.Vec3(body.position.x, body.position.y, body.position.z); + const end = new CANNON.Vec3(body.position.x, body.position.y - this.rayCastLength - this.raySafeOffset, body.position.z); + // Raycast options + const rayCastOptions = { + collisionFilterMask: CollisionGroups.Default, + skipBackfaces: true /* ignore back faces */ + }; + // Cast the ray + this.rayHasHit = this.world.physicsWorld.raycastClosest(start, end, rayCastOptions, this.rayResult); + } + + public physicsPostStep(body: CANNON.Body, character: Character): void + { + // Get velocities + let simulatedVelocity = new THREE.Vector3(body.velocity.x, body.velocity.y, body.velocity.z); + + // Take local velocity + let arcadeVelocity = new THREE.Vector3().copy(character.velocity).multiplyScalar(character.moveSpeed); + // Turn local into global + arcadeVelocity = Utils.appplyVectorMatrixXZ(character.orientation, arcadeVelocity); + + let newVelocity = new THREE.Vector3(); + + // Additive velocity mode + if (character.arcadeVelocityIsAdditive) + { + newVelocity.copy(simulatedVelocity); + + let globalVelocityTarget = Utils.appplyVectorMatrixXZ(character.orientation, character.velocityTarget); + let add = new THREE.Vector3().copy(arcadeVelocity).multiply(character.arcadeVelocityInfluence); + + if (Math.abs(simulatedVelocity.x) < Math.abs(globalVelocityTarget.x * character.moveSpeed) || Utils.haveDifferentSigns(simulatedVelocity.x, arcadeVelocity.x)) { newVelocity.x += add.x; } + if (Math.abs(simulatedVelocity.y) < Math.abs(globalVelocityTarget.y * character.moveSpeed) || Utils.haveDifferentSigns(simulatedVelocity.y, arcadeVelocity.y)) { newVelocity.y += add.y; } + if (Math.abs(simulatedVelocity.z) < Math.abs(globalVelocityTarget.z * character.moveSpeed) || Utils.haveDifferentSigns(simulatedVelocity.z, arcadeVelocity.z)) { newVelocity.z += add.z; } + } + else + { + newVelocity = new THREE.Vector3( + THREE.MathUtils.lerp(simulatedVelocity.x, arcadeVelocity.x, character.arcadeVelocityInfluence.x), + THREE.MathUtils.lerp(simulatedVelocity.y, arcadeVelocity.y, character.arcadeVelocityInfluence.y), + THREE.MathUtils.lerp(simulatedVelocity.z, arcadeVelocity.z, character.arcadeVelocityInfluence.z), + ); + } + + // If we're hitting the ground, stick to ground + if (character.rayHasHit) + { + // Flatten velocity + newVelocity.y = 0; + + // Move on top of moving objects + if (character.rayResult.body.mass > 0) + { + let pointVelocity = new CANNON.Vec3(); + character.rayResult.body.getVelocityAtWorldPoint(character.rayResult.hitPointWorld, pointVelocity); + newVelocity.add(Utils.threeVector(pointVelocity)); + } + + // Measure the normal vector offset from direct "up" vector + // and transform it into a matrix + let up = new THREE.Vector3(0, 1, 0); + let normal = new THREE.Vector3(character.rayResult.hitNormalWorld.x, character.rayResult.hitNormalWorld.y, character.rayResult.hitNormalWorld.z); + let q = new THREE.Quaternion().setFromUnitVectors(up, normal); + let m = new THREE.Matrix4().makeRotationFromQuaternion(q); + + // Rotate the velocity vector + newVelocity.applyMatrix4(m); + + // Compensate for gravity + // newVelocity.y -= body.world.physicsWorld.gravity.y / body.character.world.physicsFrameRate; + + // Apply velocity + body.velocity.x = newVelocity.x; + body.velocity.y = newVelocity.y; + body.velocity.z = newVelocity.z; + // Ground character + body.position.y = character.rayResult.hitPointWorld.y + character.rayCastLength + (newVelocity.y / character.world.physicsFrameRate); + } + else + { + // If we're in air + body.velocity.x = newVelocity.x; + body.velocity.y = newVelocity.y; + body.velocity.z = newVelocity.z; + + // Save last in-air information + character.groundImpactData.velocity.x = body.velocity.x; + character.groundImpactData.velocity.y = body.velocity.y; + character.groundImpactData.velocity.z = body.velocity.z; + } + + // Jumping + if (character.wantsToJump) + { + // If initJumpSpeed is set + if (character.initJumpSpeed > -1) + { + // Flatten velocity + body.velocity.y = 0; + let speed = Math.max(character.velocitySimulator.position.length() * 4, character.initJumpSpeed); + body.velocity = Utils.cannonVector(character.orientation.clone().multiplyScalar(speed)); + } + else { + // Moving objects compensation + let add = new CANNON.Vec3(); + character.rayResult.body.getVelocityAtWorldPoint(character.rayResult.hitPointWorld, add); + body.velocity.vsub(add, body.velocity); + } + + // Add positive vertical velocity + body.velocity.y += 4; + // Move above ground by 2x safe offset value + body.position.y += character.raySafeOffset * 2; + // Reset flag + character.wantsToJump = false; + } + } + + public addToWorld(world: World): void + { + if (_.includes(world.characters, this)) + { + console.warn('Adding character to a world in which it already exists.'); + } + else + { + // Set world + this.world = world; + + // Register character + world.characters.push(this); + + // Register physics + world.physicsWorld.addBody(this.characterCapsule.body); + + // Add to graphicsWorld + world.graphicsWorld.add(this); + world.graphicsWorld.add(this.raycastBox); + + // Shadow cascades + this.materials.forEach((mat) => + { + world.sky.csm.setupMaterial(mat); + }); + } + } + + public removeFromWorld(world: World): void + { + if (!_.includes(world.characters, this)) + { + console.warn('Removing character from a world in which it isn\'t present.'); + } + else + { + if (world.inputManager.inputReceiver === this) + { + world.inputManager.inputReceiver = undefined; + } + + this.world = undefined; + + // Remove from characters + _.pull(world.characters, this); + + // Remove physics + world.physicsWorld.remove(this.characterCapsule.body); + + // Remove visuals + world.graphicsWorld.remove(this); + world.graphicsWorld.remove(this.raycastBox); + } + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/characters/GroundImpactData.ts b/Sketchbook-master/Sketchbook-master/src/ts/characters/GroundImpactData.ts new file mode 100644 index 00000000..ec3b28f5 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/characters/GroundImpactData.ts @@ -0,0 +1,6 @@ +import * as THREE from 'three'; + +export class GroundImpactData +{ + public velocity: THREE.Vector3 = new THREE.Vector3(); +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/characters/VehicleEntryInstance.ts b/Sketchbook-master/Sketchbook-master/src/ts/characters/VehicleEntryInstance.ts new file mode 100644 index 00000000..14e7a08a --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/characters/VehicleEntryInstance.ts @@ -0,0 +1,30 @@ +import * as THREE from 'three'; +import { VehicleSeat } from '../vehicles/VehicleSeat'; +import { Character } from './Character'; + +export class VehicleEntryInstance +{ + public character: Character; + public targetSeat: VehicleSeat; + public entryPoint: THREE.Object3D; + public wantsToDrive: boolean = false; + + constructor(character: Character) + { + this.character = character; + } + + public update(timeStep: number): void + { + let entryPointWorldPos = new THREE.Vector3(); + this.entryPoint.getWorldPosition(entryPointWorldPos); + let viewVector = new THREE.Vector3().subVectors(entryPointWorldPos, this.character.position); + this.character.setOrientation(viewVector); + + let heightDifference = viewVector.y; + viewVector.y = 0; + if (this.character.charState.canEnterVehicles && viewVector.length() < 0.2 && heightDifference < 2) { + this.character.enterVehicle(this.targetSeat, this.entryPoint); + } + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/characters/character_ai/FollowPath.ts b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_ai/FollowPath.ts new file mode 100644 index 00000000..b53f534b --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_ai/FollowPath.ts @@ -0,0 +1,78 @@ +import * as THREE from 'three'; +import * as CANNON from 'cannon'; +import * as Utils from '../../core/FunctionLibrary'; + +import { FollowTarget } from './FollowTarget'; +import { ICharacterAI } from '../../interfaces/ICharacterAI'; +import { PathNode } from '../../world/PathNode'; +import { Vehicle } from '../../vehicles/Vehicle'; + +export class FollowPath extends FollowTarget implements ICharacterAI +{ + public nodeRadius: number; + public reverse: boolean = false; + + private staleTimer: number = 0; + private targetNode: PathNode; + + constructor(firstNode: PathNode, nodeRadius: number) + { + super(firstNode.object, 0); + this.nodeRadius = nodeRadius; + this.targetNode = firstNode; + } + + public update(timeStep: number): void + { + super.update(timeStep); + + // Todo only compute once in followTarget + let source = new THREE.Vector3(); + let target = new THREE.Vector3(); + this.character.getWorldPosition(source); + this.target.getWorldPosition(target); + let viewVector = new THREE.Vector3().subVectors(target, source); + viewVector.y = 0; + + let targetToNextNode = this.targetNode.nextNode.object.position.clone().sub(this.targetNode.object.position); + targetToNextNode.y = 0; + targetToNextNode.normalize(); + let slowDownAngle = viewVector.clone().normalize().dot(targetToNextNode); + let speed = (this.character.controlledObject as unknown as Vehicle).collision.velocity.length(); + + // console.log(slowDownAngle, viewVector.length(), speed); + if ((slowDownAngle < 0.7 && viewVector.length() < 50 && speed > 10)) + { + this.character.controlledObject.triggerAction('reverse', true); + this.character.controlledObject.triggerAction('throttle', false); + } + + if (speed < 1 || (this.character.controlledObject as unknown as Vehicle).rayCastVehicle.numWheelsOnGround === 0) this.staleTimer += timeStep; + else this.staleTimer = 0; + if (this.staleTimer > 5) + { + let worldPos = new THREE.Vector3(); + this.targetNode.object.getWorldPosition(worldPos); + worldPos.y += 3; + (this.character.controlledObject as unknown as Vehicle).collision.position = Utils.cannonVector(worldPos); + (this.character.controlledObject as unknown as Vehicle).collision.interpolatedPosition = Utils.cannonVector(worldPos); + (this.character.controlledObject as unknown as Vehicle).collision.angularVelocity = new CANNON.Vec3(); + (this.character.controlledObject as unknown as Vehicle).collision.quaternion.copy((this.character.controlledObject as unknown as Vehicle).collision.initQuaternion); + this.staleTimer = 0; + } + + if (viewVector.length() < this.nodeRadius) + { + if (this.reverse) + { + super.setTarget(this.targetNode.previousNode.object); + this.targetNode = this.targetNode.previousNode; + } + else + { + super.setTarget(this.targetNode.nextNode.object); + this.targetNode = this.targetNode.nextNode; + } + } + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/characters/character_ai/FollowTarget.ts b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_ai/FollowTarget.ts new file mode 100644 index 00000000..26f8ea26 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_ai/FollowTarget.ts @@ -0,0 +1,126 @@ +import * as THREE from 'three'; +import { ICharacterAI } from '../../interfaces/ICharacterAI'; +import * as Utils from '../../core/FunctionLibrary'; +import { Vehicle } from '../../vehicles/Vehicle'; +import { Character } from '../Character'; +import { Car } from '../../vehicles/Car'; +import { EntityType } from '../../enums/EntityType'; + +export class FollowTarget implements ICharacterAI +{ + public character: Character; + public isTargetReached: boolean; + + public target: THREE.Object3D; + private stopDistance: number; + + constructor(target: THREE.Object3D, stopDistance: number = 1.3) + { + this.target = target; + this.stopDistance = stopDistance; + } + + public setTarget(target: THREE.Object3D): void + { + this.target = target; + } + + public update(timeStep: number): void + { + if (this.character.controlledObject !== undefined) + { + let source = new THREE.Vector3(); + let target = new THREE.Vector3(); + + this.character.getWorldPosition(source); + this.target.getWorldPosition(target); + + let viewVector = new THREE.Vector3().subVectors(target, source); + + // Follow character + if (viewVector.length() > this.stopDistance) + { + this.isTargetReached = false; + } + else + { + this.isTargetReached = true; + } + + let forward = new THREE.Vector3(0, 0, 1).applyQuaternion((this.character.controlledObject as unknown as THREE.Object3D).quaternion); + viewVector.y = 0; + viewVector.normalize(); + let angle = Utils.getSignedAngleBetweenVectors(forward, viewVector); + + let goingForward = forward.dot(Utils.threeVector((this.character.controlledObject as unknown as Vehicle).collision.velocity)) > 0; + let speed = (this.character.controlledObject as unknown as Vehicle).collision.velocity.length(); + + if (forward.dot(viewVector) < 0.0) + { + this.character.controlledObject.triggerAction('reverse', true); + this.character.controlledObject.triggerAction('throttle', false); + } + else + { + this.character.controlledObject.triggerAction('throttle', true); + this.character.controlledObject.triggerAction('reverse', false); + } + + if (Math.abs(angle) > 0.15) + { + if (forward.dot(viewVector) > 0 || goingForward) + { + if (angle > 0) + { + this.character.controlledObject.triggerAction('left', true); + this.character.controlledObject.triggerAction('right', false); + } + else + { + this.character.controlledObject.triggerAction('right', true); + this.character.controlledObject.triggerAction('left', false); + } + } + else + { + if (angle > 0) + { + this.character.controlledObject.triggerAction('right', true); + this.character.controlledObject.triggerAction('left', false); + } + else + { + this.character.controlledObject.triggerAction('left', true); + this.character.controlledObject.triggerAction('right', false); + } + } + } + else + { + this.character.controlledObject.triggerAction('left', false); + this.character.controlledObject.triggerAction('right', false); + } + } + else + { + let viewVector = new THREE.Vector3().subVectors(this.target.position, this.character.position); + this.character.setViewVector(viewVector); + + // Follow character + if (viewVector.length() > this.stopDistance) + { + this.isTargetReached = false; + this.character.triggerAction('up', true); + } + // Stand still + else + { + this.isTargetReached = true; + this.character.triggerAction('up', false); + + // Look at character + this.character.setOrientation(viewVector); + } + } + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/characters/character_ai/RandomBehaviour.ts b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_ai/RandomBehaviour.ts new file mode 100644 index 00000000..da74c558 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_ai/RandomBehaviour.ts @@ -0,0 +1,41 @@ +import * as THREE from 'three'; +import { ICharacterAI } from '../../interfaces/ICharacterAI'; +import { Character } from '../Character'; + +export class RandomBehaviour implements ICharacterAI +{ + public character: Character; + private randomFrequency: number; + + constructor(randomFrequency: number = 100) + { + this.randomFrequency = randomFrequency; + } + + public update(timeStep: number): void + { + let rndInt = Math.floor(Math.random() * this.randomFrequency); + let rndBool = Math.random() > 0.5 ? true : false; + + if (rndInt === 0) + { + this.character.setViewVector(new THREE.Vector3(Math.random() - 0.5, Math.random() - 0.5, Math.random() - 0.5)); + + this.character.triggerAction('up', true); + this.character.charState.update(timeStep); + this.character.triggerAction('up', false); + } + else if (rndInt === 1) + { + this.character.triggerAction('up', rndBool); + } + else if (rndInt === 2) + { + this.character.triggerAction('run', rndBool); + } + else if (rndInt === 3) + { + this.character.triggerAction('jump', rndBool); + } + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/CharacterStateBase.ts b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/CharacterStateBase.ts new file mode 100644 index 00000000..3d438ffb --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/CharacterStateBase.ts @@ -0,0 +1,170 @@ +import * as THREE from 'three'; +import * as Utils from '../../core/FunctionLibrary'; +import { + DropIdle, + DropRolling, + DropRunning, + Falling, + Sprint, + StartWalkBackLeft, + StartWalkBackRight, + StartWalkForward, + StartWalkLeft, + StartWalkRight, + Walk, +} from './_stateLibrary'; +import { Character } from '../Character'; +import { ICharacterState } from '../../interfaces/ICharacterState'; + +export abstract class CharacterStateBase implements ICharacterState +{ + public character: Character; + public timer: number; + public animationLength: any; + + public canFindVehiclesToEnter: boolean; + public canEnterVehicles: boolean; + public canLeaveVehicles: boolean; + + constructor(character: Character) + { + this.character = character; + + this.character.velocitySimulator.damping = this.character.defaultVelocitySimulatorDamping; + this.character.velocitySimulator.mass = this.character.defaultVelocitySimulatorMass; + + this.character.rotationSimulator.damping = this.character.defaultRotationSimulatorDamping; + this.character.rotationSimulator.mass = this.character.defaultRotationSimulatorMass; + + this.character.arcadeVelocityIsAdditive = false; + this.character.setArcadeVelocityInfluence(1, 0, 1); + + this.canFindVehiclesToEnter = true; + this.canEnterVehicles = false; + this.canLeaveVehicles = true; + + this.timer = 0; + } + + public update(timeStep: number): void + { + this.timer += timeStep; + } + + public onInputChange(): void + { + if (this.canFindVehiclesToEnter && this.character.actions.enter.justPressed) + { + this.character.findVehicleToEnter(true); + } + else if (this.canFindVehiclesToEnter && this.character.actions.enter_passenger.justPressed) + { + this.character.findVehicleToEnter(false); + } + else if (this.canEnterVehicles && this.character.vehicleEntryInstance !== null) + { + if (this.character.actions.up.justPressed || + this.character.actions.down.justPressed || + this.character.actions.left.justPressed || + this.character.actions.right.justPressed) + { + this.character.vehicleEntryInstance = null; + this.character.actions.up.isPressed = false; + } + } + } + + public noDirection(): boolean + { + return !this.character.actions.up.isPressed && !this.character.actions.down.isPressed && !this.character.actions.left.isPressed && !this.character.actions.right.isPressed; + } + + public anyDirection(): boolean + { + return this.character.actions.up.isPressed || this.character.actions.down.isPressed || this.character.actions.left.isPressed || this.character.actions.right.isPressed; + } + + public fallInAir(): void + { + if (!this.character.rayHasHit) { this.character.setState(new Falling(this.character)); } + } + + public animationEnded(timeStep: number): boolean + { + if (this.character.mixer !== undefined) + { + if (this.animationLength === undefined) + { + console.error(this.constructor.name + 'Error: Set this.animationLength in state constructor!'); + return false; + } + else + { + return this.timer > this.animationLength - timeStep; + } + } + else { return true; } + } + + public setAppropriateDropState(): void + { + if (this.character.groundImpactData.velocity.y < -6) + { + this.character.setState(new DropRolling(this.character)); + } + else if (this.anyDirection()) + { + if (this.character.groundImpactData.velocity.y < -2) + { + this.character.setState(new DropRunning(this.character)); + } + else + { + if (this.character.actions.run.isPressed) + { + this.character.setState(new Sprint(this.character)); + } + else + { + this.character.setState(new Walk(this.character)); + } + } + } + else + { + this.character.setState(new DropIdle(this.character)); + } + } + + public setAppropriateStartWalkState(): void + { + let range = Math.PI; + let angle = Utils.getSignedAngleBetweenVectors(this.character.orientation, this.character.getCameraRelativeMovementVector()); + + if (angle > range * 0.8) + { + this.character.setState(new StartWalkBackLeft(this.character)); + } + else if (angle < -range * 0.8) + { + this.character.setState(new StartWalkBackRight(this.character)); + } + else if (angle > range * 0.3) + { + this.character.setState(new StartWalkLeft(this.character)); + } + else if (angle < -range * 0.3) + { + this.character.setState(new StartWalkRight(this.character)); + } + else + { + this.character.setState(new StartWalkForward(this.character)); + } + } + + protected playAnimation(animName: string, fadeIn: number): void + { + this.animationLength = this.character.setAnimation(animName, fadeIn); + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/DropIdle.ts b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/DropIdle.ts new file mode 100644 index 00000000..d0aadbc3 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/DropIdle.ts @@ -0,0 +1,53 @@ +import { + CharacterStateBase, + Idle, + JumpIdle, + StartWalkForward, +} from './_stateLibrary'; +import { ICharacterState } from '../../interfaces/ICharacterState'; +import { Character } from '../Character'; + +export class DropIdle extends CharacterStateBase implements ICharacterState +{ + constructor(character: Character) + { + super(character); + + this.character.velocitySimulator.damping = 0.5; + this.character.velocitySimulator.mass = 7; + + this.character.setArcadeVelocityTarget(0); + this.playAnimation('drop_idle', 0.1); + + if (this.anyDirection()) + { + this.character.setState(new StartWalkForward(character)); + } + } + + public update(timeStep: number): void + { + super.update(timeStep); + this.character.setCameraRelativeOrientationTarget(); + if (this.animationEnded(timeStep)) + { + this.character.setState(new Idle(this.character)); + } + this.fallInAir(); + } + + public onInputChange(): void + { + super.onInputChange(); + + if (this.character.actions.jump.justPressed) + { + this.character.setState(new JumpIdle(this.character)); + } + + if (this.anyDirection()) + { + this.character.setState(new StartWalkForward(this.character)); + } + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/DropRolling.ts b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/DropRolling.ts new file mode 100644 index 00000000..53399202 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/DropRolling.ts @@ -0,0 +1,41 @@ +import +{ + CharacterStateBase, + EndWalk, + Walk, +} from './_stateLibrary'; +import { ICharacterState } from '../../interfaces/ICharacterState'; +import { Character } from '../Character'; + +export class DropRolling extends CharacterStateBase implements ICharacterState +{ + constructor(character: Character) + { + super(character); + + this.character.velocitySimulator.mass = 1; + this.character.velocitySimulator.damping = 0.6; + + this.character.setArcadeVelocityTarget(0.8); + this.playAnimation('drop_running_roll', 0.03); + } + + public update(timeStep: number): void + { + super.update(timeStep); + + this.character.setCameraRelativeOrientationTarget(); + + if (this.animationEnded(timeStep)) + { + if (this.anyDirection()) + { + this.character.setState(new Walk(this.character)); + } + else + { + this.character.setState(new EndWalk(this.character)); + } + } + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/DropRunning.ts b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/DropRunning.ts new file mode 100644 index 00000000..b1d347b4 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/DropRunning.ts @@ -0,0 +1,53 @@ +import +{ + CharacterStateBase, + EndWalk, + JumpRunning, + Sprint, + Walk, +} from './_stateLibrary'; +import { ICharacterState } from '../../interfaces/ICharacterState'; +import { Character } from '../Character'; + +export class DropRunning extends CharacterStateBase implements ICharacterState +{ + constructor(character: Character) + { + super(character); + + this.character.setArcadeVelocityTarget(0.8); + this.playAnimation('drop_running', 0.1); + } + + public update(timeStep: number): void + { + super.update(timeStep); + + this.character.setCameraRelativeOrientationTarget(); + + if (this.animationEnded(timeStep)) + { + this.character.setState(new Walk(this.character)); + } + } + + public onInputChange(): void + { + super.onInputChange(); + + if (this.noDirection()) + { + this.character.setState(new EndWalk(this.character)); + } + + if (this.anyDirection() && this.character.actions.run.justPressed) + { + this.character.setState(new Sprint(this.character)); + } + + if (this.character.actions.jump.justPressed) + { + this.character.setState(new JumpRunning(this.character)); + } + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/EndWalk.ts b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/EndWalk.ts new file mode 100644 index 00000000..0ada5854 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/EndWalk.ts @@ -0,0 +1,63 @@ +import +{ + CharacterStateBase, + Idle, + JumpIdle, + Sprint, + Walk, +} from './_stateLibrary'; +import { ICharacterState } from '../../interfaces/ICharacterState'; +import { Character } from '../Character'; + +export class EndWalk extends CharacterStateBase implements ICharacterState +{ + constructor(character: Character) + { + super(character); + + this.character.setArcadeVelocityTarget(0); + this.animationLength = character.setAnimation('stop', 0.1); + } + + public update(timeStep: number): void + { + super.update(timeStep); + + if (this.animationEnded(timeStep)) + { + + this.character.setState(new Idle(this.character)); + } + + this.fallInAir(); + } + + public onInputChange(): void + { + super.onInputChange(); + + if (this.character.actions.jump.justPressed) + { + this.character.setState(new JumpIdle(this.character)); + } + + if (this.anyDirection()) + { + if (this.character.actions.run.isPressed) + { + this.character.setState(new Sprint(this.character)); + } + else + { + if (this.character.velocity.length() > 0.5) + { + this.character.setState(new Walk(this.character)); + } + else + { + this.setAppropriateStartWalkState(); + } + } + } + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/Falling.ts b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/Falling.ts new file mode 100644 index 00000000..33c242ed --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/Falling.ts @@ -0,0 +1,35 @@ +import +{ + CharacterStateBase, +} from './_stateLibrary'; +import { ICharacterState } from '../../interfaces/ICharacterState'; +import { Character } from '../Character'; + +export class Falling extends CharacterStateBase implements ICharacterState +{ + constructor(character: Character) + { + super(character); + + this.character.velocitySimulator.mass = 100; + this.character.rotationSimulator.damping = 0.3; + + this.character.arcadeVelocityIsAdditive = true; + this.character.setArcadeVelocityInfluence(0.05, 0, 0.05); + + this.playAnimation('falling', 0.3); + } + + public update(timeStep: number): void + { + super.update(timeStep); + + this.character.setCameraRelativeOrientationTarget(); + this.character.setArcadeVelocityTarget(this.anyDirection() ? 0.8 : 0); + + if (this.character.rayHasHit) + { + this.setAppropriateDropState(); + } + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/Idle.ts b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/Idle.ts new file mode 100644 index 00000000..a9701e34 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/Idle.ts @@ -0,0 +1,50 @@ +import +{ + CharacterStateBase, + JumpIdle, + Walk, +} from './_stateLibrary'; +import { ICharacterState } from '../../interfaces/ICharacterState'; +import { Character } from '../Character'; + +export class Idle extends CharacterStateBase implements ICharacterState +{ + constructor(character: Character) + { + super(character); + + this.character.velocitySimulator.damping = 0.6; + this.character.velocitySimulator.mass = 10; + + this.character.setArcadeVelocityTarget(0); + this.playAnimation('idle', 0.1); + } + + public update(timeStep: number): void + { + super.update(timeStep); + + this.fallInAir(); + } + public onInputChange(): void + { + super.onInputChange(); + + if (this.character.actions.jump.justPressed) + { + this.character.setState(new JumpIdle(this.character)); + } + + if (this.anyDirection()) + { + if (this.character.velocity.length() > 0.5) + { + this.character.setState(new Walk(this.character)); + } + else + { + this.setAppropriateStartWalkState(); + } + } + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/IdleRotateLeft.ts b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/IdleRotateLeft.ts new file mode 100644 index 00000000..e21d0eb3 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/IdleRotateLeft.ts @@ -0,0 +1,60 @@ +import +{ + CharacterStateBase, + Idle, + JumpIdle, + Walk, +} from './_stateLibrary'; +import { ICharacterState } from '../../interfaces/ICharacterState'; +import { Character } from '../Character'; + +export class IdleRotateLeft extends CharacterStateBase implements ICharacterState +{ + constructor(character: Character) + { + super(character); + + this.character.rotationSimulator.mass = 30; + this.character.rotationSimulator.damping = 0.6; + + this.character.velocitySimulator.damping = 0.6; + this.character.velocitySimulator.mass = 10; + + this.character.setArcadeVelocityTarget(0); + this.playAnimation('rotate_left', 0.1); + } + + public update(timeStep: number): void + { + super.update(timeStep); + + if (this.animationEnded(timeStep)) + { + this.character.setState(new Idle(this.character)); + } + + this.fallInAir(); + } + + public onInputChange(): void + { + super.onInputChange(); + + if (this.character.actions.jump.justPressed) + { + this.character.setState(new JumpIdle(this.character)); + } + + if (this.anyDirection()) + { + if (this.character.velocity.length() > 0.5) + { + this.character.setState(new Walk(this.character)); + } + else + { + this.setAppropriateStartWalkState(); + } + } + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/IdleRotateRight.ts b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/IdleRotateRight.ts new file mode 100644 index 00000000..73a5a6e3 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/IdleRotateRight.ts @@ -0,0 +1,60 @@ +import +{ + CharacterStateBase, + Idle, + JumpIdle, + Walk, +} from './_stateLibrary'; +import { ICharacterState } from '../../interfaces/ICharacterState'; +import { Character } from '../Character'; + +export class IdleRotateRight extends CharacterStateBase implements ICharacterState +{ + constructor(character: Character) + { + super(character); + + this.character.rotationSimulator.mass = 30; + this.character.rotationSimulator.damping = 0.6; + + this.character.velocitySimulator.damping = 0.6; + this.character.velocitySimulator.mass = 10; + + this.character.setArcadeVelocityTarget(0); + this.playAnimation('rotate_right', 0.1); + } + + public update(timeStep: number): void + { + super.update(timeStep); + + if (this.animationEnded(timeStep)) + { + this.character.setState(new Idle(this.character)); + } + + this.fallInAir(); + } + + public onInputChange(): void + { + super.onInputChange(); + + if (this.character.actions.jump.justPressed) + { + this.character.setState(new JumpIdle(this.character)); + } + + if (this.anyDirection()) + { + if (this.character.velocity.length() > 0.5) + { + this.character.setState(new Walk(this.character)); + } + else + { + this.setAppropriateStartWalkState(); + } + } + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/JumpIdle.ts b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/JumpIdle.ts new file mode 100644 index 00000000..c1f7e168 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/JumpIdle.ts @@ -0,0 +1,63 @@ +import +{ + CharacterStateBase, + Falling, +} from './_stateLibrary'; +import { ICharacterState } from '../../interfaces/ICharacterState'; +import { Character } from '../Character'; + +export class JumpIdle extends CharacterStateBase implements ICharacterState +{ + private alreadyJumped: boolean; + + constructor(character: Character) + { + super(character); + + this.character.velocitySimulator.mass = 50; + + this.character.setArcadeVelocityTarget(0); + this.playAnimation('jump_idle', 0.1); + this.alreadyJumped = false; + } + + public update(timeStep: number): void + { + super.update(timeStep); + + // Move in air + if (this.alreadyJumped) + { + this.character.setCameraRelativeOrientationTarget(); + this.character.setArcadeVelocityTarget(this.anyDirection() ? 0.8 : 0); + } + + // Physically jump + if (this.timer > 0.2 && !this.alreadyJumped) + { + this.character.jump(); + this.alreadyJumped = true; + + this.character.velocitySimulator.mass = 100; + this.character.rotationSimulator.damping = 0.3; + + if (this.character.rayResult.body.velocity.length() > 0) + { + this.character.setArcadeVelocityInfluence(0, 0, 0); + } + else + { + this.character.setArcadeVelocityInfluence(0.3, 0, 0.3); + } + + } + else if (this.timer > 0.3 && this.character.rayHasHit) + { + this.setAppropriateDropState(); + } + else if (this.animationEnded(timeStep)) + { + this.character.setState(new Falling(this.character)); + } + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/JumpRunning.ts b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/JumpRunning.ts new file mode 100644 index 00000000..37f5b423 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/JumpRunning.ts @@ -0,0 +1,52 @@ +import +{ + CharacterStateBase, + Falling, +} from './_stateLibrary'; +import { ICharacterState } from '../../interfaces/ICharacterState'; +import { Character } from '../Character'; + +export class JumpRunning extends CharacterStateBase implements ICharacterState +{ + private alreadyJumped: boolean; + + constructor(character: Character) + { + super(character); + + this.character.velocitySimulator.mass = 100; + this.playAnimation('jump_running', 0.03); + this.alreadyJumped = false; + } + + public update(timeStep: number): void + { + super.update(timeStep); + + this.character.setCameraRelativeOrientationTarget(); + + // Move in air + if (this.alreadyJumped) + { + this.character.setArcadeVelocityTarget(this.anyDirection() ? 0.8 : 0); + } + // Physically jump + if (this.timer > 0.13 && !this.alreadyJumped) + { + this.character.jump(4); + this.alreadyJumped = true; + + this.character.rotationSimulator.damping = 0.3; + this.character.arcadeVelocityIsAdditive = true; + this.character.setArcadeVelocityInfluence(0.05, 0, 0.05); + } + else if (this.timer > 0.24 && this.character.rayHasHit) + { + this.setAppropriateDropState(); + } + else if (this.animationEnded(timeStep)) + { + this.character.setState(new Falling(this.character)); + } + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/Sprint.ts b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/Sprint.ts new file mode 100644 index 00000000..2e564bb6 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/Sprint.ts @@ -0,0 +1,52 @@ +import +{ + CharacterStateBase, + EndWalk, + JumpRunning, + Walk, +} from './_stateLibrary'; +import { Character } from '../Character'; + +export class Sprint extends CharacterStateBase +{ + constructor(character: Character) + { + super(character); + + this.canEnterVehicles = true; + + this.character.velocitySimulator.mass = 10; + this.character.rotationSimulator.damping = 0.8; + this.character.rotationSimulator.mass = 50; + + this.character.setArcadeVelocityTarget(1.4); + this.playAnimation('sprint', 0.1); + } + + public update(timeStep: number): void + { + super.update(timeStep); + this.character.setCameraRelativeOrientationTarget(); + this.fallInAir(); + } + + public onInputChange(): void + { + super.onInputChange(); + + if (!this.character.actions.run.isPressed) + { + this.character.setState(new Walk(this.character)); + } + + if (this.character.actions.jump.justPressed) + { + this.character.setState(new JumpRunning(this.character)); + } + + if (this.noDirection()) + { + this.character.setState(new EndWalk(this.character)); + } + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/StartWalkBackLeft.ts b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/StartWalkBackLeft.ts new file mode 100644 index 00000000..96d65951 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/StartWalkBackLeft.ts @@ -0,0 +1,11 @@ +import { StartWalkBase } from './_stateLibrary'; +import { Character } from '../Character'; + +export class StartWalkBackLeft extends StartWalkBase +{ + constructor(character: Character) + { + super(character); + this.animationLength = character.setAnimation('start_back_left', 0.1); + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/StartWalkBackRight.ts b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/StartWalkBackRight.ts new file mode 100644 index 00000000..3bfab24a --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/StartWalkBackRight.ts @@ -0,0 +1,11 @@ +import {StartWalkBase} from './_stateLibrary'; +import { Character } from '../Character'; + +export class StartWalkBackRight extends StartWalkBase +{ + constructor(character: Character) + { + super(character); + this.animationLength = character.setAnimation('start_back_right', 0.1); + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/StartWalkBase.ts b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/StartWalkBase.ts new file mode 100644 index 00000000..bce39cd5 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/StartWalkBase.ts @@ -0,0 +1,99 @@ +import * as Utils from '../../core/FunctionLibrary'; +import +{ + CharacterStateBase, + Idle, + IdleRotateLeft, + IdleRotateRight, + JumpRunning, + Sprint, + Walk, +} from './_stateLibrary'; +import { Character } from '../Character'; + +export class StartWalkBase extends CharacterStateBase +{ + constructor(character: Character) + { + super(character); + + this.canEnterVehicles = true; + this.character.rotationSimulator.mass = 20; + this.character.rotationSimulator.damping = 0.7; + + this.character.setArcadeVelocityTarget(0.8); + // this.character.velocitySimulator.damping = 0.5; + // this.character.velocitySimulator.mass = 1; + } + + public update(timeStep: number): void + { + super.update(timeStep); + + if (this.animationEnded(timeStep)) + { + this.character.setState(new Walk(this.character)); + } + + this.character.setCameraRelativeOrientationTarget(); + + // + // Different velocity treating experiments + // + + // let matrix = new THREE.Matrix3(); + // let o = new THREE.Vector3().copy(this.character.orientation); + // matrix.set( + // o.z, 0, o.x, + // 0, 1, 0, + // -o.x, 0, o.z); + // let inverse = new THREE.Matrix3().getInverse(matrix); + // let directionVector = this.character.getCameraRelativeMovementVector(); + // directionVector = directionVector.applyMatrix3(inverse); + // directionVector.normalize(); + + // this.character.setArcadeVelocity(directionVector.z * 0.8, directionVector.x * 0.8); + + this.fallInAir(); + } + + public onInputChange(): void + { + super.onInputChange(); + + if (this.character.actions.jump.justPressed) + { + this.character.setState(new JumpRunning(this.character)); + } + + if (this.noDirection()) + { + if (this.timer < 0.1) + { + let angle = Utils.getSignedAngleBetweenVectors(this.character.orientation, this.character.orientationTarget); + + if (angle > Math.PI * 0.4) + { + this.character.setState(new IdleRotateLeft(this.character)); + } + else if (angle < -Math.PI * 0.4) + { + this.character.setState(new IdleRotateRight(this.character)); + } + else + { + this.character.setState(new Idle(this.character)); + } + } + else + { + this.character.setState(new Idle(this.character)); + } + } + + if (this.character.actions.run.justPressed) + { + this.character.setState(new Sprint(this.character)); + } + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/StartWalkForward.ts b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/StartWalkForward.ts new file mode 100644 index 00000000..b9a952ac --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/StartWalkForward.ts @@ -0,0 +1,11 @@ +import {StartWalkBase} from './_stateLibrary'; +import { Character } from '../Character'; + +export class StartWalkForward extends StartWalkBase +{ + constructor(character: Character) + { + super(character); + this.animationLength = character.setAnimation('start_forward', 0.1); + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/StartWalkLeft.ts b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/StartWalkLeft.ts new file mode 100644 index 00000000..2b9d668a --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/StartWalkLeft.ts @@ -0,0 +1,11 @@ +import {StartWalkBase} from './_stateLibrary'; +import { Character } from '../Character'; + +export class StartWalkLeft extends StartWalkBase +{ + constructor(character: Character) + { + super(character); + this.animationLength = character.setAnimation('start_left', 0.1); + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/StartWalkRight.ts b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/StartWalkRight.ts new file mode 100644 index 00000000..010f4c8c --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/StartWalkRight.ts @@ -0,0 +1,11 @@ +import {StartWalkBase} from './_stateLibrary'; +import { Character } from '../Character'; + +export class StartWalkRight extends StartWalkBase +{ + constructor(character: Character) + { + super(character); + this.animationLength = character.setAnimation('start_right', 0.1); + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/Walk.ts b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/Walk.ts new file mode 100644 index 00000000..84636f52 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/Walk.ts @@ -0,0 +1,67 @@ +import +{ + CharacterStateBase, + EndWalk, + Idle, + JumpRunning, + Sprint, +} from './_stateLibrary'; +import { Character } from '../Character'; + +export class Walk extends CharacterStateBase +{ + constructor(character: Character) + { + super(character); + + this.canEnterVehicles = true; + this.character.setArcadeVelocityTarget(0.8); + this.playAnimation('run', 0.1); + } + + public update(timeStep: number): void + { + super.update(timeStep); + + this.character.setCameraRelativeOrientationTarget(); + + this.fallInAir(); + } + + public onInputChange(): void + { + super.onInputChange(); + + if (this.noDirection()) + { + this.character.setState(new EndWalk(this.character)); + } + + if (this.character.actions.run.isPressed) + { + this.character.setState(new Sprint(this.character)); + } + + if (this.character.actions.run.justPressed) + { + this.character.setState(new Sprint(this.character)); + } + + if (this.character.actions.jump.justPressed) + { + this.character.setState(new JumpRunning(this.character)); + } + + if (this.noDirection()) + { + if (this.character.velocity.length() > 1) + { + this.character.setState(new EndWalk(this.character)); + } + else + { + this.character.setState(new Idle(this.character)); + } + } + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/_stateLibrary.ts b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/_stateLibrary.ts new file mode 100644 index 00000000..8d5ee74a --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/_stateLibrary.ts @@ -0,0 +1,19 @@ +export * from './CharacterStateBase'; +export * from './DropIdle'; +export * from './DropRolling'; +export * from './DropRunning'; +export * from './EndWalk'; +export * from './Falling'; +export * from './Idle'; +export * from './IdleRotateLeft'; +export * from './IdleRotateRight'; +export * from './JumpIdle'; +export * from './JumpRunning'; +export * from './Sprint'; +export * from './StartWalkBase'; +export * from './StartWalkBackLeft'; +export * from './StartWalkBackRight'; +export * from './StartWalkForward'; +export * from './StartWalkLeft'; +export * from './StartWalkRight'; +export * from './Walk'; \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/vehicles/CloseVehicleDoorInside.ts b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/vehicles/CloseVehicleDoorInside.ts new file mode 100644 index 00000000..3b9ea909 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/vehicles/CloseVehicleDoorInside.ts @@ -0,0 +1,61 @@ +import +{ + CharacterStateBase, +} from '../_stateLibrary'; +import { Character } from '../../Character'; +import { VehicleSeat } from '../../../vehicles/VehicleSeat'; +import { Side } from '../../../enums/Side'; +import { Driving } from './Driving'; +import { SeatType } from '../../../enums/SeatType'; +import { Sitting } from './Sitting'; +import * as Utils from '../../../core/FunctionLibrary'; + +export class CloseVehicleDoorInside extends CharacterStateBase +{ + private seat: VehicleSeat; + private hasClosedDoor: boolean = false; + + constructor(character: Character, seat: VehicleSeat) + { + super(character); + + this.seat = seat; + this.canFindVehiclesToEnter = false; + this.canLeaveVehicles = false; + + const side = Utils.detectRelativeSide(seat.seatPointObject, seat.door.doorObject); + if (side === Side.Left) + { + this.playAnimation('close_door_sitting_left', 0.1); + } + else if (side === Side.Right) + { + this.playAnimation('close_door_sitting_right', 0.1); + } + + this.seat.door?.open(); + } + + public update(timeStep: number): void + { + super.update(timeStep); + + if (this.timer > 0.4 && !this.hasClosedDoor) + { + this.hasClosedDoor = true; + this.seat.door?.close(); + } + + if (this.animationEnded(timeStep)) + { + if (this.seat.type === SeatType.Driver) + { + this.character.setState(new Driving(this.character, this.seat)); + } + else if (this.seat.type === SeatType.Passenger) + { + this.character.setState(new Sitting(this.character, this.seat)); + } + } + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/vehicles/CloseVehicleDoorOutside.ts b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/vehicles/CloseVehicleDoorOutside.ts new file mode 100644 index 00000000..3b000645 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/vehicles/CloseVehicleDoorOutside.ts @@ -0,0 +1,50 @@ +import +{ + CharacterStateBase, +} from '../_stateLibrary'; +import { Character } from '../../Character'; +import { VehicleSeat } from '../../../vehicles/VehicleSeat'; +import { Side } from '../../../enums/Side'; +import { Idle } from '../Idle'; +import * as Utils from '../../../core/FunctionLibrary'; + +export class CloseVehicleDoorOutside extends CharacterStateBase +{ + private seat: VehicleSeat; + private hasClosedDoor: boolean = false; + + constructor(character: Character, seat: VehicleSeat) + { + super(character); + + this.seat = seat; + this.canFindVehiclesToEnter = false; + + const side = Utils.detectRelativeSide(seat.seatPointObject, seat.door.doorObject); + if (side === Side.Left) + { + this.playAnimation('close_door_standing_right', 0.1); + } + else if (side === Side.Right) + { + this.playAnimation('close_door_standing_left', 0.1); + } + } + + public update(timeStep: number): void + { + super.update(timeStep); + + if (this.timer > 0.3 && !this.hasClosedDoor) + { + this.hasClosedDoor = true; + this.seat.door.close(); + } + + if (this.animationEnded(timeStep)) + { + this.character.setState(new Idle(this.character)); + this.character.leaveSeat(); + } + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/vehicles/Driving.ts b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/vehicles/Driving.ts new file mode 100644 index 00000000..098152a0 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/vehicles/Driving.ts @@ -0,0 +1,35 @@ +import +{ + CharacterStateBase, +} from '../_stateLibrary'; +import { Character } from '../../Character'; +import { VehicleSeat } from 'src/ts/vehicles/VehicleSeat'; +import { CloseVehicleDoorInside } from './CloseVehicleDoorInside'; + +export class Driving extends CharacterStateBase +{ + private seat: VehicleSeat; + + constructor(character: Character, seat: VehicleSeat) + { + super(character); + + this.seat = seat; + this.canFindVehiclesToEnter = false; + this.playAnimation('driving', 0.1); + + this.character.startControllingVehicle(seat.vehicle, this.seat); + this.seat.vehicle.onInputChange(); + this.character.vehicleEntryInstance = null; + } + + public update(timeStep: number): void + { + super.update(timeStep); + + if (!this.seat.door?.achievingTargetRotation && this.seat.door?.rotation > 0 && this.seat.vehicle.noDirectionPressed()) + { + this.character.setState(new CloseVehicleDoorInside(this.character, this.seat)); + } + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/vehicles/EnteringVehicle.ts b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/vehicles/EnteringVehicle.ts new file mode 100644 index 00000000..486ffb32 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/vehicles/EnteringVehicle.ts @@ -0,0 +1,119 @@ +import * as THREE from 'three'; +import +{ + CharacterStateBase, +} from '../_stateLibrary'; +import { Character } from '../../Character'; +import { IControllable } from '../../../interfaces/IControllable'; +import { Driving } from './Driving'; +import { VehicleSeat } from '../../../vehicles/VehicleSeat'; +import { Side } from '../../../enums/Side'; +import { Sitting } from './Sitting'; +import { SeatType } from '../../../enums/SeatType'; +import { EntityType } from '../../../enums/EntityType'; +import { Object3D } from 'three'; +import * as Utils from '../../../core/FunctionLibrary'; +import { SpringSimulator } from '../../../physics/spring_simulation/SpringSimulator'; + +export class EnteringVehicle extends CharacterStateBase +{ + private vehicle: IControllable; + private animData: any; + private seat: VehicleSeat; + + private initialPositionOffset: THREE.Vector3 = new THREE.Vector3(); + private startPosition: THREE.Vector3 = new THREE.Vector3(); + private endPosition: THREE.Vector3 = new THREE.Vector3(); + private startRotation: THREE.Quaternion = new THREE.Quaternion(); + private endRotation: THREE.Quaternion = new THREE.Quaternion(); + + private factorSimulator: SpringSimulator; + + constructor(character: Character, seat: VehicleSeat, entryPoint: Object3D) + { + super(character); + + this.canFindVehiclesToEnter = false; + this.vehicle = seat.vehicle; + this.seat = seat; + + const side = Utils.detectRelativeSide(entryPoint, seat.seatPointObject); + this.animData = this.getEntryAnimations(seat.vehicle.entityType); + this.playAnimation(this.animData[side], 0.1); + + this.character.resetVelocity(); + this.character.tiltContainer.rotation.z = 0; + this.character.setPhysicsEnabled(false); + (this.seat.vehicle as unknown as THREE.Object3D).attach(this.character); + + this.startPosition.copy(entryPoint.position); + this.startPosition.y += 0.53; + this.endPosition.copy(seat.seatPointObject.position); + this.endPosition.y += 0.6; + this.initialPositionOffset.copy(this.startPosition).sub(this.character.position); + + this.startRotation.copy(this.character.quaternion); + this.endRotation.copy(this.seat.seatPointObject.quaternion); + + this.factorSimulator = new SpringSimulator(60, 10, 0.5); + this.factorSimulator.target = 1; + } + + public update(timeStep: number): void + { + super.update(timeStep); + + if (this.animationEnded(timeStep)) + { + this.character.occupySeat(this.seat); + this.character.setPosition(this.endPosition.x, this.endPosition.y, this.endPosition.z); + + if (this.seat.type === SeatType.Driver) + { + if (this.seat.door) this.seat.door.physicsEnabled = true; + this.character.setState(new Driving(this.character, this.seat)); + } + else if (this.seat.type === SeatType.Passenger) + { + this.character.setState(new Sitting(this.character, this.seat)); + } + } + else + { + if (this.seat.door) + { + this.seat.door.physicsEnabled = false; + this.seat.door.rotation = 1; + } + + let factor = THREE.MathUtils.clamp(this.timer / (this.animationLength - this.animData.end_early), 0, 1); + let sineFactor = Utils.easeInOutSine(factor); + this.factorSimulator.simulate(timeStep); + + let currentPosOffset = new THREE.Vector3().lerpVectors(this.initialPositionOffset, new THREE.Vector3(), this.factorSimulator.position); + let lerpPosition = new THREE.Vector3().lerpVectors(this.startPosition.clone().sub(currentPosOffset), this.endPosition, sineFactor); + this.character.setPosition(lerpPosition.x, lerpPosition.y, lerpPosition.z); + + THREE.Quaternion.slerp(this.startRotation, this.endRotation, this.character.quaternion, this.factorSimulator.position); + } + } + + private getEntryAnimations(type: EntityType): any + { + switch (type) + { + case EntityType.Airplane: + return { + [Side.Left]: 'enter_airplane_left', + [Side.Right]: 'enter_airplane_right', + end_early: 0.3 + }; + default: + return { + [Side.Left]: 'sit_down_left', + [Side.Right]: 'sit_down_right', + end_early: 0.0 + }; + } + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/vehicles/ExitingAirplane.ts b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/vehicles/ExitingAirplane.ts new file mode 100644 index 00000000..ed4e9890 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/vehicles/ExitingAirplane.ts @@ -0,0 +1,52 @@ +import * as THREE from 'three'; +import * as Utils from '../../../core/FunctionLibrary'; + +import { Character } from '../../Character'; +import { VehicleSeat } from '../../../vehicles/VehicleSeat'; +import { Falling } from '../Falling'; +import { ExitingStateBase } from './ExitingStateBase'; +import { Vehicle } from '../../../vehicles/Vehicle'; + +export class ExitingAirplane extends ExitingStateBase +{ + + constructor(character: Character, seat: VehicleSeat) + { + super(character, seat); + + this.endPosition.copy(this.startPosition); + this.endPosition.y += 1; + + const quat = Utils.threeQuat((seat.vehicle as unknown as Vehicle).collision.quaternion); + const forward = new THREE.Vector3(0, 0, 1).applyQuaternion(quat); + this.exitPoint = new THREE.Object3D(); + this.exitPoint.lookAt(forward); + this.exitPoint.position.copy(this.endPosition); + + this.playAnimation('jump_idle', 0.1); + } + + public update(timeStep: number): void + { + super.update(timeStep); + + if (this.animationEnded(timeStep)) + { + this.detachCharacterFromVehicle(); + this.character.setState(new Falling(this.character)); + this.character.leaveSeat(); + } + else + { + let beginningCutoff = 0.3; + let factor = THREE.MathUtils.clamp(((this.timer / this.animationLength) - beginningCutoff) * (1 / (1 - beginningCutoff)), 0, 1); + let smoothFactor = Utils.easeOutQuad(factor); + let lerpPosition = new THREE.Vector3().lerpVectors(this.startPosition, this.endPosition, smoothFactor); + this.character.setPosition(lerpPosition.x, lerpPosition.y, lerpPosition.z); + + // Rotation + this.updateEndRotation(); + THREE.Quaternion.slerp(this.startRotation, this.endRotation, this.character.quaternion, smoothFactor); + } + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/vehicles/ExitingStateBase.ts b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/vehicles/ExitingStateBase.ts new file mode 100644 index 00000000..47d50c43 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/vehicles/ExitingStateBase.ts @@ -0,0 +1,66 @@ +import * as THREE from 'three'; +import * as Utils from '../../../core/FunctionLibrary'; + +import +{ + CharacterStateBase, +} from '../_stateLibrary'; +import { Character } from '../../Character'; +import { VehicleSeat } from '../../../vehicles/VehicleSeat'; +import { IControllable } from '../../../interfaces/IControllable'; +import { Vehicle } from 'src/ts/vehicles/Vehicle'; + +export abstract class ExitingStateBase extends CharacterStateBase +{ + protected vehicle: IControllable; + protected seat: VehicleSeat; + protected startPosition: THREE.Vector3 = new THREE.Vector3(); + protected endPosition: THREE.Vector3 = new THREE.Vector3(); + protected startRotation: THREE.Quaternion = new THREE.Quaternion(); + protected endRotation: THREE.Quaternion = new THREE.Quaternion(); + protected exitPoint: THREE.Object3D; + protected dummyObj: THREE.Object3D; + + constructor(character: Character, seat: VehicleSeat) + { + super(character); + + this.canFindVehiclesToEnter = false; + this.seat = seat; + this.vehicle = seat.vehicle; + + this.seat.door?.open(); + + this.startPosition.copy(this.character.position); + this.startRotation.copy(this.character.quaternion); + + this.dummyObj = new THREE.Object3D(); + } + + public detachCharacterFromVehicle(): void + { + this.character.controlledObject = undefined; + this.character.resetOrientation(); + this.character.world.graphicsWorld.attach(this.character); + this.character.resetVelocity(); + this.character.setPhysicsEnabled(true); + this.character.setPosition(this.character.position.x, this.character.position.y, this.character.position.z); + this.character.inputReceiverUpdate(0); + this.character.characterCapsule.body.velocity.copy((this.vehicle as unknown as Vehicle).rayCastVehicle.chassisBody.velocity); + this.character.feetRaycast(); + } + + public updateEndRotation(): void + { + const forward = Utils.getForward(this.exitPoint); + forward.y = 0; + forward.normalize(); + + this.character.world.graphicsWorld.attach(this.dummyObj); + this.exitPoint.getWorldPosition(this.dummyObj.position); + let target = this.dummyObj.position.clone().add(forward); + this.dummyObj.lookAt(target); + this.seat.seatPointObject.parent.attach(this.dummyObj); + this.endRotation.copy(this.dummyObj.quaternion); + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/vehicles/ExitingVehicle.ts b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/vehicles/ExitingVehicle.ts new file mode 100644 index 00000000..311c2c60 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/vehicles/ExitingVehicle.ts @@ -0,0 +1,85 @@ +import * as THREE from 'three'; +import * as Utils from '../../../core/FunctionLibrary'; + +import { Character } from '../../Character'; +import { Side } from '../../../enums/Side'; +import { VehicleSeat } from '../../../vehicles/VehicleSeat'; +import { Idle } from '../Idle'; +import { CloseVehicleDoorOutside } from './CloseVehicleDoorOutside'; +import { Vehicle } from 'src/ts/vehicles/Vehicle'; +import { Falling } from '../Falling'; +import { DropRolling } from '../DropRolling'; +import { ExitingStateBase } from './ExitingStateBase'; + +export class ExitingVehicle extends ExitingStateBase +{ + constructor(character: Character, seat: VehicleSeat) + { + super(character, seat); + + this.exitPoint = seat.entryPoints[0]; + + this.endPosition.copy(this.exitPoint.position); + this.endPosition.y += 0.52; + + const side = Utils.detectRelativeSide(seat.seatPointObject, this.exitPoint); + if (side === Side.Left) + { + this.playAnimation('stand_up_left', 0.1); + } + else if (side === Side.Right) + { + this.playAnimation('stand_up_right', 0.1); + } + } + + public update(timeStep: number): void + { + super.update(timeStep); + + if (this.animationEnded(timeStep)) + { + this.detachCharacterFromVehicle(); + + this.seat.door.physicsEnabled = true; + + if (!this.character.rayHasHit) + { + this.character.setState(new Falling(this.character)); + this.character.leaveSeat(); + } + else if ((this.vehicle as unknown as Vehicle).collision.velocity.length() > 1) + { + this.character.setState(new DropRolling(this.character)); + this.character.leaveSeat(); + } + else if (this.anyDirection() || this.seat.door === undefined) + { + this.character.setState(new Idle(this.character)); + this.character.leaveSeat(); + } + else + { + this.character.setState(new CloseVehicleDoorOutside(this.character, this.seat)); + } + } + else + { + // Door + if (this.seat.door) + { + this.seat.door.physicsEnabled = false; + } + + // Position + let factor = this.timer / this.animationLength; + let smoothFactor = Utils.easeInOutSine(factor); + let lerpPosition = new THREE.Vector3().lerpVectors(this.startPosition, this.endPosition, smoothFactor); + this.character.setPosition(lerpPosition.x, lerpPosition.y, lerpPosition.z); + + // Rotation + this.updateEndRotation(); + THREE.Quaternion.slerp(this.startRotation, this.endRotation, this.character.quaternion, smoothFactor); + } + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/vehicles/OpenVehicleDoor.ts b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/vehicles/OpenVehicleDoor.ts new file mode 100644 index 00000000..7970d0e4 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/vehicles/OpenVehicleDoor.ts @@ -0,0 +1,97 @@ +import * as THREE from 'three'; +import +{ + CharacterStateBase, +} from '../_stateLibrary'; +import { Character } from '../../Character'; +import { VehicleSeat } from '../../../vehicles/VehicleSeat'; +import { Side } from '../../../enums/Side'; +import { Idle } from '../Idle'; +import { EnteringVehicle } from './EnteringVehicle'; +import * as Utils from '../../../core/FunctionLibrary'; +import { SpringSimulator } from '../../../physics/spring_simulation/SpringSimulator'; + +export class OpenVehicleDoor extends CharacterStateBase +{ + private seat: VehicleSeat; + private entryPoint: THREE.Object3D; + private hasOpenedDoor: boolean = false; + + private startPosition: THREE.Vector3 = new THREE.Vector3(); + private endPosition: THREE.Vector3 = new THREE.Vector3(); + private startRotation: THREE.Quaternion = new THREE.Quaternion(); + private endRotation: THREE.Quaternion = new THREE.Quaternion(); + + private factorSimluator: SpringSimulator; + + constructor(character: Character, seat: VehicleSeat, entryPoint: THREE.Object3D) + { + super(character); + + this.canFindVehiclesToEnter = false; + this.seat = seat; + this.entryPoint = entryPoint; + + const side = Utils.detectRelativeSide(entryPoint, seat.seatPointObject); + if (side === Side.Left) + { + this.playAnimation('open_door_standing_left', 0.1); + } + else if (side === Side.Right) + { + this.playAnimation('open_door_standing_right', 0.1); + } + + this.character.resetVelocity(); + this.character.rotateModel(); + this.character.setPhysicsEnabled(false); + + this.character.setPhysicsEnabled(false); + (this.seat.vehicle as unknown as THREE.Object3D).attach(this.character); + + this.startPosition.copy(this.character.position); + this.endPosition.copy(this.entryPoint.position); + this.endPosition.y += 0.53; + + this.startRotation.copy(this.character.quaternion); + this.endRotation.copy(this.entryPoint.quaternion); + + this.factorSimluator = new SpringSimulator(60, 10, 0.5); + this.factorSimluator.target = 1; + } + + public update(timeStep: number): void + { + super.update(timeStep); + + if (this.timer > 0.3 && !this.hasOpenedDoor) + { + this.hasOpenedDoor = true; + this.seat.door?.open(); + } + + if (this.animationEnded(timeStep)) + { + if (this.anyDirection()) + { + this.character.vehicleEntryInstance = null; + this.character.world.graphicsWorld.attach(this.character); + this.character.setPhysicsEnabled(true); + this.character.setState(new Idle(this.character)); + } + else + { + this.character.setState(new EnteringVehicle(this.character, this.seat, this.entryPoint)); + } + } + else + { + this.factorSimluator.simulate(timeStep); + + let lerpPosition = new THREE.Vector3().lerpVectors(this.startPosition, this.endPosition, this.factorSimluator.position); + this.character.setPosition(lerpPosition.x, lerpPosition.y, lerpPosition.z); + + THREE.Quaternion.slerp(this.startRotation, this.endRotation, this.character.quaternion, this.factorSimluator.position); + } + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/vehicles/Sitting.ts b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/vehicles/Sitting.ts new file mode 100644 index 00000000..d8c19067 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/vehicles/Sitting.ts @@ -0,0 +1,78 @@ +import +{ + CharacterStateBase, +} from '../_stateLibrary'; +import { Character } from '../../Character'; +import { VehicleSeat } from 'src/ts/vehicles/VehicleSeat'; +import { CloseVehicleDoorInside } from './CloseVehicleDoorInside'; +import { SeatType } from '../../../enums/SeatType'; +import { SwitchingSeats } from './SwitchingSeats'; + +export class Sitting extends CharacterStateBase +{ + private seat: VehicleSeat; + + constructor(character: Character, seat: VehicleSeat) + { + super(character); + + this.seat = seat; + this.canFindVehiclesToEnter = false; + + this.character.world.updateControls([ + { + keys: ['X'], + desc: 'Switch seats', + }, + { + keys: ['F'], + desc: 'Leave seat', + } + ]); + + this.playAnimation('sitting', 0.1); + } + + public update(timeStep: number): void + { + super.update(timeStep); + + if (!this.seat.door?.achievingTargetRotation && this.seat.door?.rotation > 0 && this.noDirection()) + { + this.character.setState(new CloseVehicleDoorInside(this.character, this.seat)); + } + else if (this.character.vehicleEntryInstance !== null) + { + if (this.character.vehicleEntryInstance.wantsToDrive) + { + for (const possibleDriverSeat of this.seat.connectedSeats) + { + if (possibleDriverSeat.type === SeatType.Driver) + { + if (this.seat.door?.rotation > 0) this.seat.door.physicsEnabled = true; + this.character.setState(new SwitchingSeats(this.character, this.seat, possibleDriverSeat)); + break; + } + } + } + else + { + this.character.vehicleEntryInstance = null; + } + } + } + + public onInputChange(): void + { + if (this.character.actions.seat_switch.justPressed && this.seat.connectedSeats.length > 0) + { + this.character.setState(new SwitchingSeats(this.character, this.seat, this.seat.connectedSeats[0])); + } + + if (this.character.actions.enter.justPressed) + { + this.character.exitVehicle(); + this.character.displayControls(); + } + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/vehicles/SwitchingSeats.ts b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/vehicles/SwitchingSeats.ts new file mode 100644 index 00000000..accea389 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/characters/character_states/vehicles/SwitchingSeats.ts @@ -0,0 +1,83 @@ +import * as THREE from 'three'; +import +{ + CharacterStateBase, +} from '../_stateLibrary'; +import { Character } from '../../Character'; +import { VehicleSeat } from '../../../vehicles/VehicleSeat'; +import { Side } from '../../../enums/Side'; +import { SeatType } from '../../../enums/SeatType'; +import { Driving } from './Driving'; +import { Sitting } from './Sitting'; +import * as Utils from '../../../core/FunctionLibrary'; +import { Space } from '../../../enums/Space'; + +export class SwitchingSeats extends CharacterStateBase +{ + private toSeat: VehicleSeat; + + private startPosition: THREE.Vector3 = new THREE.Vector3(); + private endPosition: THREE.Vector3 = new THREE.Vector3(); + private startRotation: THREE.Quaternion = new THREE.Quaternion(); + private endRotation: THREE.Quaternion = new THREE.Quaternion(); + + constructor(character: Character, fromSeat: VehicleSeat, toSeat: VehicleSeat) + { + super(character); + + this.toSeat = toSeat; + this.canFindVehiclesToEnter = false; + this.canLeaveVehicles = false; + + character.leaveSeat(); + this.character.occupySeat(toSeat); + + const right = Utils.getRight(fromSeat.seatPointObject, Space.Local); + const viewVector = toSeat.seatPointObject.position.clone().sub(fromSeat.seatPointObject.position).normalize(); + const side = right.dot(viewVector) > 0 ? Side.Left : Side.Right; + + if (side === Side.Left) + { + this.playAnimation('sitting_shift_left', 0.1); + } + else if (side === Side.Right) + { + this.playAnimation('sitting_shift_right', 0.1); + } + + this.startPosition.copy(fromSeat.seatPointObject.position); + this.startPosition.y += 0.6; + this.endPosition.copy(toSeat.seatPointObject.position); + this.endPosition.y += 0.6; + + this.startRotation.copy(fromSeat.seatPointObject.quaternion); + this.endRotation.copy(toSeat.seatPointObject.quaternion); + } + + public update(timeStep: number): void + { + super.update(timeStep); + + if (this.animationEnded(timeStep)) + { + if (this.toSeat.type === SeatType.Driver) + { + this.character.setState(new Driving(this.character, this.toSeat)); + } + else if (this.toSeat.type === SeatType.Passenger) + { + this.character.setState(new Sitting(this.character, this.toSeat)); + } + } + else + { + let factor = this.timer / this.animationLength; + let sineFactor = Utils.easeInOutSine(factor); + + let lerpPosition = new THREE.Vector3().lerpVectors(this.startPosition, this.endPosition, sineFactor); + this.character.setPosition(lerpPosition.x, lerpPosition.y, lerpPosition.z); + + THREE.Quaternion.slerp(this.startRotation, this.endRotation, this.character.quaternion, sineFactor); + } + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/core/CameraOperator.ts b/Sketchbook-master/Sketchbook-master/src/ts/core/CameraOperator.ts new file mode 100644 index 00000000..d288523d --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/core/CameraOperator.ts @@ -0,0 +1,204 @@ +import * as THREE from 'three'; +import * as Utils from './FunctionLibrary'; +import { World } from '../world/World'; +import { IInputReceiver } from '../interfaces/IInputReceiver'; +import { KeyBinding } from './KeyBinding'; +import { Character } from '../characters/Character'; +import _ = require('lodash'); +import { IUpdatable } from '../interfaces/IUpdatable'; + +export class CameraOperator implements IInputReceiver, IUpdatable +{ + public updateOrder: number = 4; + + public world: World; + public camera: THREE.Camera; + public target: THREE.Vector3; + public sensitivity: THREE.Vector2; + public radius: number = 1; + public theta: number; + public phi: number; + public onMouseDownPosition: THREE.Vector2; + public onMouseDownTheta: any; + public onMouseDownPhi: any; + public targetRadius: number = 1; + + public movementSpeed: number; + public actions: { [action: string]: KeyBinding }; + + public upVelocity: number = 0; + public forwardVelocity: number = 0; + public rightVelocity: number = 0; + + public followMode: boolean = false; + + public characterCaller: Character; + + constructor(world: World, camera: THREE.Camera, sensitivityX: number = 1, sensitivityY: number = sensitivityX * 0.8) + { + this.world = world; + this.camera = camera; + this.target = new THREE.Vector3(); + this.sensitivity = new THREE.Vector2(sensitivityX, sensitivityY); + + this.movementSpeed = 0.06; + this.radius = 3; + this.theta = 0; + this.phi = 0; + + this.onMouseDownPosition = new THREE.Vector2(); + this.onMouseDownTheta = this.theta; + this.onMouseDownPhi = this.phi; + + this.actions = { + 'forward': new KeyBinding('KeyW'), + 'back': new KeyBinding('KeyS'), + 'left': new KeyBinding('KeyA'), + 'right': new KeyBinding('KeyD'), + 'up': new KeyBinding('KeyE'), + 'down': new KeyBinding('KeyQ'), + 'fast': new KeyBinding('ShiftLeft'), + }; + + world.registerUpdatable(this); + } + + public setSensitivity(sensitivityX: number, sensitivityY: number = sensitivityX): void + { + this.sensitivity = new THREE.Vector2(sensitivityX, sensitivityY); + } + + public setRadius(value: number, instantly: boolean = false): void + { + this.targetRadius = Math.max(0.001, value); + if (instantly === true) + { + this.radius = value; + } + } + + public move(deltaX: number, deltaY: number): void + { + this.theta -= deltaX * (this.sensitivity.x / 2); + this.theta %= 360; + this.phi += deltaY * (this.sensitivity.y / 2); + this.phi = Math.min(85, Math.max(-85, this.phi)); + } + + public update(timeScale: number): void + { + if (this.followMode === true) + { + this.camera.position.y = THREE.MathUtils.clamp(this.camera.position.y, this.target.y, Number.POSITIVE_INFINITY); + this.camera.lookAt(this.target); + let newPos = this.target.clone().add(new THREE.Vector3().subVectors(this.camera.position, this.target).normalize().multiplyScalar(this.targetRadius)); + this.camera.position.x = newPos.x; + this.camera.position.y = newPos.y; + this.camera.position.z = newPos.z; + } + else + { + this.radius = THREE.MathUtils.lerp(this.radius, this.targetRadius, 0.1); + + this.camera.position.x = this.target.x + this.radius * Math.sin(this.theta * Math.PI / 180) * Math.cos(this.phi * Math.PI / 180); + this.camera.position.y = this.target.y + this.radius * Math.sin(this.phi * Math.PI / 180); + this.camera.position.z = this.target.z + this.radius * Math.cos(this.theta * Math.PI / 180) * Math.cos(this.phi * Math.PI / 180); + this.camera.updateMatrix(); + this.camera.lookAt(this.target); + } + } + + public handleKeyboardEvent(event: KeyboardEvent, code: string, pressed: boolean): void + { + // Free camera + if (code === 'KeyC' && pressed === true && event.shiftKey === true) + { + if (this.characterCaller !== undefined) + { + this.world.inputManager.setInputReceiver(this.characterCaller); + this.characterCaller = undefined; + } + } + else + { + for (const action in this.actions) { + if (this.actions.hasOwnProperty(action)) { + const binding = this.actions[action]; + + if (_.includes(binding.eventCodes, code)) + { + binding.isPressed = pressed; + } + } + } + } + } + + public handleMouseWheel(event: WheelEvent, value: number): void + { + this.world.scrollTheTimeScale(value); + } + + public handleMouseButton(event: MouseEvent, code: string, pressed: boolean): void + { + for (const action in this.actions) { + if (this.actions.hasOwnProperty(action)) { + const binding = this.actions[action]; + + if (_.includes(binding.eventCodes, code)) + { + binding.isPressed = pressed; + } + } + } + } + + public handleMouseMove(event: MouseEvent, deltaX: number, deltaY: number): void + { + this.move(deltaX, deltaY); + } + + public inputReceiverInit(): void + { + this.target.copy(this.camera.position); + this.setRadius(0, true); + // this.world.dirLight.target = this.world.camera; + + this.world.updateControls([ + { + keys: ['W', 'S', 'A', 'D'], + desc: 'Move around' + }, + { + keys: ['E', 'Q'], + desc: 'Move up / down' + }, + { + keys: ['Shift'], + desc: 'Speed up' + }, + { + keys: ['Shift', '+', 'C'], + desc: 'Exit free camera mode' + }, + ]); + } + + public inputReceiverUpdate(timeStep: number): void + { + // Set fly speed + let speed = this.movementSpeed * (this.actions.fast.isPressed ? timeStep * 600 : timeStep * 60); + + const up = Utils.getUp(this.camera); + const right = Utils.getRight(this.camera); + const forward = Utils.getBack(this.camera); + + this.upVelocity = THREE.MathUtils.lerp(this.upVelocity, +this.actions.up.isPressed - +this.actions.down.isPressed, 0.3); + this.forwardVelocity = THREE.MathUtils.lerp(this.forwardVelocity, +this.actions.forward.isPressed - +this.actions.back.isPressed, 0.3); + this.rightVelocity = THREE.MathUtils.lerp(this.rightVelocity, +this.actions.right.isPressed - +this.actions.left.isPressed, 0.3); + + this.target.add(up.multiplyScalar(speed * this.upVelocity)); + this.target.add(forward.multiplyScalar(speed * this.forwardVelocity)); + this.target.add(right.multiplyScalar(speed * this.rightVelocity)); + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/core/ClosestObjectFinder.ts b/Sketchbook-master/Sketchbook-master/src/ts/core/ClosestObjectFinder.ts new file mode 100644 index 00000000..49b8dc82 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/core/ClosestObjectFinder.ts @@ -0,0 +1,27 @@ +import * as THREE from 'three'; + +export class ClosestObjectFinder +{ + public closestObject: T; + + private closestDistance: number = Number.POSITIVE_INFINITY; + private referencePosition: THREE.Vector3; + private maxDistance: number = Number.POSITIVE_INFINITY; + + constructor(referencePosition: THREE.Vector3, maxDistance?: number) + { + this.referencePosition = referencePosition; + if (maxDistance !== undefined) this.maxDistance = maxDistance; + } + + public consider(object: T, objectPosition: THREE.Vector3): void + { + let distance = this.referencePosition.distanceTo(objectPosition); + + if (distance < this.maxDistance && distance < this.closestDistance) + { + this.closestDistance = distance; + this.closestObject = object; + } + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/core/FunctionLibrary.ts b/Sketchbook-master/Sketchbook-master/src/ts/core/FunctionLibrary.ts new file mode 100644 index 00000000..ff0ff2aa --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/core/FunctionLibrary.ts @@ -0,0 +1,373 @@ +import * as THREE from 'three'; +import * as CANNON from 'cannon'; +import * as _ from 'lodash'; +import { SimulationFrame } from '../physics/spring_simulation/SimulationFrame'; +import { World } from '../world/World'; +import { Side } from '../enums/Side'; +import { Object3D } from 'three'; +import { Space } from '../enums/Space'; + +export function createCapsuleGeometry(radius: number = 1, height: number = 2, N: number = 32): THREE.Geometry +{ + const geometry = new THREE.Geometry(); + const TWOPI = Math.PI * 2; + const PID2 = 1.570796326794896619231322; + + const normals = []; + + // top cap + for (let i = 0; i <= N / 4; i++) + { + for (let j = 0; j <= N; j++) + { + let theta = j * TWOPI / N; + let phi = -PID2 + Math.PI * i / (N / 2); + let vertex = new THREE.Vector3(); + let normal = new THREE.Vector3(); + vertex.x = radius * Math.cos(phi) * Math.cos(theta); + vertex.y = radius * Math.cos(phi) * Math.sin(theta); + vertex.z = radius * Math.sin(phi); + vertex.z -= height / 2; + normal.x = vertex.x; + normal.y = vertex.y; + normal.z = vertex.z; + geometry.vertices.push(vertex); + normals.push(normal); + } + } + + // bottom cap + for (let i = N / 4; i <= N / 2; i++) + { + for (let j = 0; j <= N; j++) + { + let theta = j * TWOPI / N; + let phi = -PID2 + Math.PI * i / (N / 2); + let vertex = new THREE.Vector3(); + let normal = new THREE.Vector3(); + vertex.x = radius * Math.cos(phi) * Math.cos(theta); + vertex.y = radius * Math.cos(phi) * Math.sin(theta); + vertex.z = radius * Math.sin(phi); + vertex.z += height / 2; + normal.x = vertex.x; + normal.y = vertex.y; + normal.z = vertex.z; + geometry.vertices.push(vertex); + normals.push(normal); + } + } + + for (let i = 0; i <= N / 2; i++) + { + for (let j = 0; j < N; j++) + { + let vec = new THREE.Vector4( + i * (N + 1) + j, + i * (N + 1) + (j + 1), + (i + 1) * (N + 1) + (j + 1), + (i + 1) * (N + 1) + j + ); + + if (i === N / 4) + { + let face1 = new THREE.Face3(vec.x, vec.y, vec.z, [ + normals[vec.x], + normals[vec.y], + normals[vec.z] + ]); + + let face2 = new THREE.Face3(vec.x, vec.z, vec.w, [ + normals[vec.x], + normals[vec.z], + normals[vec.w] + ]); + + geometry.faces.push(face2); + geometry.faces.push(face1); + } else + { + let face1 = new THREE.Face3(vec.x, vec.y, vec.z, [ + normals[vec.x], + normals[vec.y], + normals[vec.z] + ]); + + let face2 = new THREE.Face3(vec.x, vec.z, vec.w, [ + normals[vec.x], + normals[vec.z], + normals[vec.w] + ]); + + geometry.faces.push(face1); + geometry.faces.push(face2); + } + } + // if(i==(N/4)) break; // N/4 is when the center segments are solved + } + + geometry.rotateX(Math.PI / 2); + geometry.computeVertexNormals(); + geometry.computeFaceNormals(); + + return geometry; +} + +//#endregion + +//#region Math + +/** + * Constructs a 2D matrix from first vector, replacing the Y axes with the global Y axis, + * and applies this matrix to the second vector. Saves performance when compared to full 3D matrix application. + * Useful for character rotation, as it only happens on the Y axis. + * @param {Vector3} a Vector to construct 2D matrix from + * @param {Vector3} b Vector to apply basis to + */ +export function appplyVectorMatrixXZ(a: THREE.Vector3, b: THREE.Vector3): THREE.Vector3 +{ + return new THREE.Vector3( + (a.x * b.z + a.z * b.x), + b.y, + (a.z * b.z + -a.x * b.x) + ); +} + +export function round(value: number, decimals: number = 0): number +{ + return Math.round(value * Math.pow(10, decimals)) / Math.pow(10, decimals); +} + +export function roundVector(vector: THREE.Vector3, decimals: number = 0): THREE.Vector3 +{ + return new THREE.Vector3( + this.round(vector.x, decimals), + this.round(vector.y, decimals), + this.round(vector.z, decimals), + ); +} + +/** + * Finds an angle between two vectors + * @param {THREE.Vector3} v1 + * @param {THREE.Vector3} v2 + */ +export function getAngleBetweenVectors(v1: THREE.Vector3, v2: THREE.Vector3, dotTreshold: number = 0.0005): number +{ + let angle: number; + let dot = v1.dot(v2); + + // If dot is close to 1, we'll round angle to zero + if (dot > 1 - dotTreshold) + { + angle = 0; + } + else + { + // Dot too close to -1 + if (dot < -1 + dotTreshold) + { + angle = Math.PI; + } + else + { + // Get angle difference in radians + angle = Math.acos(dot); + } + } + + return angle; +} + +/** + * Finds an angle between two vectors with a sign relative to normal vector + */ +export function getSignedAngleBetweenVectors(v1: THREE.Vector3, v2: THREE.Vector3, normal: THREE.Vector3 = new THREE.Vector3(0, 1, 0), dotTreshold: number = 0.0005): number +{ + let angle = this.getAngleBetweenVectors(v1, v2, dotTreshold); + + // Get vector pointing up or down + let cross = new THREE.Vector3().crossVectors(v1, v2); + // Compare cross with normal to find out direction + if (normal.dot(cross) < 0) + { + angle = -angle; + } + + return angle; +} + +export function haveSameSigns(n1: number, n2: number): boolean +{ + return (n1 < 0) === (n2 < 0); +} + +export function haveDifferentSigns(n1: number, n2: number): boolean +{ + return (n1 < 0) !== (n2 < 0); +} + +//#endregion + +//#region Miscellaneous + +export function setDefaults(options: {}, defaults: {}): {} +{ + return _.defaults({}, _.clone(options), defaults); +} + +export function getGlobalProperties(prefix: string = ''): any[] +{ + let keyValues = []; + let global = window; // window for browser environments + for (let prop in global) + { + // check the prefix + if (prop.indexOf(prefix) === 0) { + keyValues.push(prop /*+ "=" + global[prop]*/); + } + } + return keyValues; // build the string +} + +export function spring(source: number, dest: number, velocity: number, mass: number, damping: number): SimulationFrame +{ + let acceleration = dest - source; + acceleration /= mass; + velocity += acceleration; + velocity *= damping; + + let position = source + velocity; + + return new SimulationFrame(position, velocity); +} + +export function springV(source: THREE.Vector3, dest: THREE.Vector3, velocity: THREE.Vector3, mass: number, damping: number): void +{ + let acceleration = new THREE.Vector3().subVectors(dest, source); + acceleration.divideScalar(mass); + velocity.add(acceleration); + velocity.multiplyScalar(damping); + source.add(velocity); +} + +export function threeVector(vec: CANNON.Vec3): THREE.Vector3 +{ + return new THREE.Vector3(vec.x, vec.y, vec.z); +} + +export function cannonVector(vec: THREE.Vector3): CANNON.Vec3 +{ + return new CANNON.Vec3(vec.x, vec.y, vec.z); +} + +export function threeQuat(quat: CANNON.Quaternion): THREE.Quaternion +{ + return new THREE.Quaternion(quat.x, quat.y, quat.z, quat.w); +} + +export function cannonQuat(quat: THREE.Quaternion): CANNON.Quaternion +{ + return new CANNON.Quaternion(quat.x, quat.y, quat.z, quat.w); +} + +export function setupMeshProperties(child: any): void +{ + child.castShadow = true; + child.receiveShadow = true; + + if (child.material.map !== null) + { + let mat = new THREE.MeshPhongMaterial(); + mat.shininess = 0; + mat.name = child.material.name; + mat.map = child.material.map; + mat.map.anisotropy = 4; + mat.aoMap = child.material.aoMap; + mat.transparent = child.material.transparent; + mat.skinning = child.material.skinning; + // mat.map.encoding = THREE.LinearEncoding; + child.material = mat; + } +} + +export function detectRelativeSide(from: Object3D, to: Object3D): Side +{ + const right = getRight(from, Space.Local); + const viewVector = to.position.clone().sub(from.position).normalize(); + + return right.dot(viewVector) > 0 ? Side.Left : Side.Right; +} + +export function easeInOutSine(x: number): number +{ + return -(Math.cos(Math.PI * x) - 1) / 2; +} + +export function easeOutQuad(x: number): number +{ + return 1 - (1 - x) * (1 - x); +} + +export function getRight(obj: THREE.Object3D, space: Space = Space.Global): THREE.Vector3 +{ + const matrix = getMatrix(obj, space); + return new THREE.Vector3( + matrix.elements[0], + matrix.elements[1], + matrix.elements[2] + ); +} + +export function getUp(obj: THREE.Object3D, space: Space = Space.Global): THREE.Vector3 +{ + const matrix = getMatrix(obj, space); + return new THREE.Vector3( + matrix.elements[4], + matrix.elements[5], + matrix.elements[6] + ); +} + +export function getForward(obj: THREE.Object3D, space: Space = Space.Global): THREE.Vector3 +{ + const matrix = getMatrix(obj, space); + return new THREE.Vector3( + matrix.elements[8], + matrix.elements[9], + matrix.elements[10] + ); +} + +export function getBack(obj: THREE.Object3D, space: Space = Space.Global): THREE.Vector3 +{ + const matrix = getMatrix(obj, space); + return new THREE.Vector3( + -matrix.elements[8], + -matrix.elements[9], + -matrix.elements[10] + ); +} + +export function getMatrix(obj: THREE.Object3D, space: Space): THREE.Matrix4 +{ + switch (space) + { + case Space.Local: return obj.matrix; + case Space.Global: return obj.matrixWorld; + } +} + +export function countSleepyBodies(): any +{ + // let awake = 0; + // let sleepy = 0; + // let asleep = 0; + // this.physicsWorld.bodies.forEach((body) => + // { + // if (body.sleepState === 0) awake++; + // if (body.sleepState === 1) sleepy++; + // if (body.sleepState === 2) asleep++; + // }); +} + +//#endregion \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/core/InfoStack.ts b/Sketchbook-master/Sketchbook-master/src/ts/core/InfoStack.ts new file mode 100644 index 00000000..9a319a7b --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/core/InfoStack.ts @@ -0,0 +1,42 @@ +import { InfoStackMessage } from './InfoStackMessage'; +import { IWorldEntity } from '../interfaces/IWorldEntity'; +import { EntityType } from '../enums/EntityType'; +import { World } from '../world/World'; + +export class InfoStack implements IWorldEntity +{ + public updateOrder: number = 3; + public entityType: EntityType = EntityType.System; + + public messages: InfoStackMessage[] = []; + public entranceAnimation: string = 'animate__slideInLeft'; + public exitAnimation: string = 'animate__backOutDown'; + + public messageDuration: number = 3; + + public addMessage(text: string): void + { + let messageElement = document.createElement('div'); + messageElement.classList.add('console-message', 'animate__animated', this.entranceAnimation); + messageElement.style.setProperty('--animate-duration', '0.3s'); + let textElement = document.createTextNode(text); + messageElement.appendChild(textElement); + document.getElementById('console').prepend(messageElement); + this.messages.push(new InfoStackMessage(this, messageElement)); + } + + public update(timeStep: number): void + { + for (const message of this.messages) { + message.update(timeStep); + } + } + + public addToWorld(world: World): void + { + } + + public removeFromWorld(world: World): void + { + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/core/InfoStackMessage.ts b/Sketchbook-master/Sketchbook-master/src/ts/core/InfoStackMessage.ts new file mode 100644 index 00000000..e30b73cd --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/core/InfoStackMessage.ts @@ -0,0 +1,38 @@ +import { InfoStack } from './InfoStack'; + +export class InfoStackMessage +{ + public domElement: HTMLElement; + + private customConsole: InfoStack; + private elapsedTime: number = 0; + private removalTriggered: boolean = false; + + constructor(console: InfoStack, domElement: HTMLElement) + { + this.customConsole = console; + this.domElement = domElement; + } + + public update(timeStep: number): void + { + this.elapsedTime += timeStep; + + if (this.elapsedTime > this.customConsole.messageDuration && !this.removalTriggered) + { + this.triggerRemoval(); + } + } + + private triggerRemoval(): void + { + this.removalTriggered = true; + this.domElement.classList.remove(this.customConsole.entranceAnimation); + this.domElement.classList.add(this.customConsole.exitAnimation); + this.domElement.style.setProperty('--animate-duration', '1s'); + + this.domElement.addEventListener('animationend', () => { + this.domElement.parentNode.removeChild(this.domElement); + }); + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/core/InputManager.ts b/Sketchbook-master/Sketchbook-master/src/ts/core/InputManager.ts new file mode 100644 index 00000000..b15442c7 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/core/InputManager.ts @@ -0,0 +1,166 @@ +import { World } from '../world/World'; +import { IInputReceiver } from '../interfaces/IInputReceiver'; +import { EntityType } from '../enums/EntityType'; +import { IUpdatable } from '../interfaces/IUpdatable'; + +export class InputManager implements IUpdatable +{ + public updateOrder: number = 3; + + public world: World; + public domElement: any; + public pointerLock: any; + public isLocked: boolean; + public inputReceiver: IInputReceiver; + + public boundOnMouseDown: (evt: any) => void; + public boundOnMouseMove: (evt: any) => void; + public boundOnMouseUp: (evt: any) => void; + public boundOnMouseWheelMove: (evt: any) => void; + public boundOnPointerlockChange: (evt: any) => void; + public boundOnPointerlockError: (evt: any) => void; + public boundOnKeyDown: (evt: any) => void; + public boundOnKeyUp: (evt: any) => void; + + constructor(world: World, domElement: HTMLElement) + { + this.world = world; + this.pointerLock = world.params.Pointer_Lock; + this.domElement = domElement || document.body; + this.isLocked = false; + + // Bindings for later event use + // Mouse + this.boundOnMouseDown = (evt) => this.onMouseDown(evt); + this.boundOnMouseMove = (evt) => this.onMouseMove(evt); + this.boundOnMouseUp = (evt) => this.onMouseUp(evt); + this.boundOnMouseWheelMove = (evt) => this.onMouseWheelMove(evt); + + // Pointer lock + this.boundOnPointerlockChange = (evt) => this.onPointerlockChange(evt); + this.boundOnPointerlockError = (evt) => this.onPointerlockError(evt); + + // Keys + this.boundOnKeyDown = (evt) => this.onKeyDown(evt); + this.boundOnKeyUp = (evt) => this.onKeyUp(evt); + + // Init event listeners + // Mouse + this.domElement.addEventListener('mousedown', this.boundOnMouseDown, false); + document.addEventListener('wheel', this.boundOnMouseWheelMove, false); + document.addEventListener('pointerlockchange', this.boundOnPointerlockChange, false); + document.addEventListener('pointerlockerror', this.boundOnPointerlockError, false); + + // Keys + document.addEventListener('keydown', this.boundOnKeyDown, false); + document.addEventListener('keyup', this.boundOnKeyUp, false); + + world.registerUpdatable(this); + } + + public update(timestep: number, unscaledTimeStep: number): void + { + if (this.inputReceiver === undefined && this.world !== undefined && this.world.cameraOperator !== undefined) + { + this.setInputReceiver(this.world.cameraOperator); + } + + this.inputReceiver?.inputReceiverUpdate(unscaledTimeStep); + } + + public setInputReceiver(receiver: IInputReceiver): void + { + this.inputReceiver = receiver; + this.inputReceiver.inputReceiverInit(); + } + + public setPointerLock(enabled: boolean): void + { + this.pointerLock = enabled; + } + + public onPointerlockChange(event: MouseEvent): void + { + if (document.pointerLockElement === this.domElement) + { + this.domElement.addEventListener('mousemove', this.boundOnMouseMove, false); + this.domElement.addEventListener('mouseup', this.boundOnMouseUp, false); + this.isLocked = true; + } + else + { + this.domElement.removeEventListener('mousemove', this.boundOnMouseMove, false); + this.domElement.removeEventListener('mouseup', this.boundOnMouseUp, false); + this.isLocked = false; + } + } + + public onPointerlockError(event: MouseEvent): void + { + console.error('PointerLockControls: Unable to use Pointer Lock API'); + } + + public onMouseDown(event: MouseEvent): void + { + if (this.pointerLock) + { + this.domElement.requestPointerLock(); + } + else + { + this.domElement.addEventListener('mousemove', this.boundOnMouseMove, false); + this.domElement.addEventListener('mouseup', this.boundOnMouseUp, false); + } + + if (this.inputReceiver !== undefined) + { + this.inputReceiver.handleMouseButton(event, 'mouse' + event.button, true); + } + } + + public onMouseMove(event: MouseEvent): void + { + if (this.inputReceiver !== undefined) + { + this.inputReceiver.handleMouseMove(event, event.movementX, event.movementY); + } + } + + public onMouseUp(event: MouseEvent): void + { + if (!this.pointerLock) + { + this.domElement.removeEventListener('mousemove', this.boundOnMouseMove, false); + this.domElement.removeEventListener('mouseup', this.boundOnMouseUp, false); + } + + if (this.inputReceiver !== undefined) + { + this.inputReceiver.handleMouseButton(event, 'mouse' + event.button, false); + } + } + + public onKeyDown(event: KeyboardEvent): void + { + if (this.inputReceiver !== undefined) + { + this.inputReceiver.handleKeyboardEvent(event, event.code, true); + } + } + + public onKeyUp(event: KeyboardEvent): void + { + if (this.inputReceiver !== undefined) + { + this.inputReceiver.handleKeyboardEvent(event, event.code, false); + } + } + + public onMouseWheelMove(event: WheelEvent): void + { + if (this.inputReceiver !== undefined) + { + this.inputReceiver.handleMouseWheel(event, event.deltaY); + } + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/core/KeyBinding.ts b/Sketchbook-master/Sketchbook-master/src/ts/core/KeyBinding.ts new file mode 100644 index 00000000..433ede3d --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/core/KeyBinding.ts @@ -0,0 +1,12 @@ +export class KeyBinding +{ + public eventCodes: string[]; + public isPressed: boolean = false; + public justPressed: boolean = false; + public justReleased: boolean = false; + + constructor(...code: string[]) + { + this.eventCodes = code; + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/core/LoadingManager.ts b/Sketchbook-master/Sketchbook-master/src/ts/core/LoadingManager.ts new file mode 100644 index 00000000..da2e937a --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/core/LoadingManager.ts @@ -0,0 +1,123 @@ +import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader'; +import { LoadingTrackerEntry } from './LoadingTrackerEntry'; +import { UIManager } from './UIManager'; +import { Scenario } from '../world/Scenario'; +import Swal from 'sweetalert2'; +import { World } from '../world/World'; + +export class LoadingManager +{ + public firstLoad: boolean = true; + public onFinishedCallback: () => void; + + private world: World; + private gltfLoader: GLTFLoader; + private loadingTracker: LoadingTrackerEntry[] = []; + + constructor(world: World) + { + this.world = world; + this.gltfLoader = new GLTFLoader(); + + this.world.setTimeScale(0); + UIManager.setUserInterfaceVisible(false); + UIManager.setLoadingScreenVisible(true); + } + + public loadGLTF(path: string, onLoadingFinished: (gltf: any) => void): void + { + let trackerEntry = this.addLoadingEntry(path); + + this.gltfLoader.load(path, + (gltf) => + { + onLoadingFinished(gltf); + this.doneLoading(trackerEntry); + }, + (xhr) => + { + if ( xhr.lengthComputable ) + { + trackerEntry.progress = xhr.loaded / xhr.total; + } + }, + (error) => + { + console.error(error); + }); + } + + public addLoadingEntry(path: string): LoadingTrackerEntry + { + let entry = new LoadingTrackerEntry(path); + this.loadingTracker.push(entry); + + return entry; + } + + public doneLoading(trackerEntry: LoadingTrackerEntry): void + { + trackerEntry.finished = true; + trackerEntry.progress = 1; + + if (this.isLoadingDone()) + { + if (this.onFinishedCallback !== undefined) + { + this.onFinishedCallback(); + } + else + { + UIManager.setUserInterfaceVisible(true); + } + + UIManager.setLoadingScreenVisible(false); + } + } + + public createWelcomeScreenCallback(scenario: Scenario): void + { + if (this.onFinishedCallback === undefined) + { + this.onFinishedCallback = () => + { + this.world.update(1, 1); + + Swal.fire({ + title: scenario.descriptionTitle, + html: scenario.descriptionContent, + confirmButtonText: 'Play', + buttonsStyling: false, + onClose: () => { + this.world.setTimeScale(1); + UIManager.setUserInterfaceVisible(true); + } + }); + }; + } + } + + private getLoadingPercentage(): number + { + let done = true; + let total = 0; + let finished = 0; + + for (const item of this.loadingTracker) + { + total++; + finished += item.progress; + if (!item.finished) done = false; + } + + return (finished / total) * 100; + } + + private isLoadingDone(): boolean + { + for (const entry of this.loadingTracker) { + if (!entry.finished) return false; + } + return true; + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/core/LoadingTrackerEntry.ts b/Sketchbook-master/Sketchbook-master/src/ts/core/LoadingTrackerEntry.ts new file mode 100644 index 00000000..98ac65ed --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/core/LoadingTrackerEntry.ts @@ -0,0 +1,11 @@ +export class LoadingTrackerEntry +{ + public path: string; + public progress: number = 0; + public finished: boolean = false; + + constructor(path: string) + { + this.path = path; + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/core/UIManager.ts b/Sketchbook-master/Sketchbook-master/src/ts/core/UIManager.ts new file mode 100644 index 00000000..10a68170 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/core/UIManager.ts @@ -0,0 +1,18 @@ +export class UIManager +{ + public static setUserInterfaceVisible(value: boolean): void + { + document.getElementById('ui-container').style.display = value ? 'block' : 'none'; + } + + public static setLoadingScreenVisible(value: boolean): void + { + document.getElementById('loading-screen').style.display = value ? 'flex' : 'none'; + } + + public static setFPSVisible(value: boolean): void + { + document.getElementById('statsBox').style.display = value ? 'block' : 'none'; + document.getElementById('dat-gui-container').style.top = value ? '48px' : '0px'; + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/enums/CollisionGroups.ts b/Sketchbook-master/Sketchbook-master/src/ts/enums/CollisionGroups.ts new file mode 100644 index 00000000..51e6c12d --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/enums/CollisionGroups.ts @@ -0,0 +1,5 @@ +export enum CollisionGroups { + Default = 1, + Characters = 2, + TrimeshColliders = 4 +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/enums/EntityType.ts b/Sketchbook-master/Sketchbook-master/src/ts/enums/EntityType.ts new file mode 100644 index 00000000..13f15adf --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/enums/EntityType.ts @@ -0,0 +1,8 @@ +export enum EntityType { + Character, + Airplane, + Car, + Helicopter, + Decoration, + System +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/enums/SeatType.ts b/Sketchbook-master/Sketchbook-master/src/ts/enums/SeatType.ts new file mode 100644 index 00000000..b4ad2e71 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/enums/SeatType.ts @@ -0,0 +1,4 @@ +export enum SeatType { + Driver = 'driver', + Passenger = 'passenger', +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/enums/Side.ts b/Sketchbook-master/Sketchbook-master/src/ts/enums/Side.ts new file mode 100644 index 00000000..66239f7b --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/enums/Side.ts @@ -0,0 +1,5 @@ +export enum Side +{ + Left = 'left', + Right = 'right' +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/enums/Space.ts b/Sketchbook-master/Sketchbook-master/src/ts/enums/Space.ts new file mode 100644 index 00000000..32bf1db7 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/enums/Space.ts @@ -0,0 +1,5 @@ +export enum Space +{ + Local = 'local', + Global = 'global' +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/interfaces/ICharacterAI.ts b/Sketchbook-master/Sketchbook-master/src/ts/interfaces/ICharacterAI.ts new file mode 100644 index 00000000..c7d1c44a --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/interfaces/ICharacterAI.ts @@ -0,0 +1,6 @@ +import { Character } from '../characters/Character'; + +export interface ICharacterAI { + character: Character; + update(timeStep: number): void; +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/interfaces/ICharacterState.ts b/Sketchbook-master/Sketchbook-master/src/ts/interfaces/ICharacterState.ts new file mode 100644 index 00000000..82d885f0 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/interfaces/ICharacterState.ts @@ -0,0 +1,8 @@ +export interface ICharacterState { + canFindVehiclesToEnter: boolean; // Find a suitable car and run towards it + canEnterVehicles: boolean; // Actually get into the vehicle + canLeaveVehicles: boolean; + + update(timeStep: number): void; + onInputChange(): void; +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/interfaces/ICollider.ts b/Sketchbook-master/Sketchbook-master/src/ts/interfaces/ICollider.ts new file mode 100644 index 00000000..b6f40397 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/interfaces/ICollider.ts @@ -0,0 +1,8 @@ +export interface ICollider { + body: CANNON.Body; + + // physical: CANNON.Body; + // visual: THREE.Mesh; + + // getVisualModel(options: any): THREE.Mesh; +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/interfaces/IControllable.ts b/Sketchbook-master/Sketchbook-master/src/ts/interfaces/IControllable.ts new file mode 100644 index 00000000..3f1d6d1e --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/interfaces/IControllable.ts @@ -0,0 +1,18 @@ +import { Character } from '../characters/Character'; +import { IInputReceiver } from './IInputReceiver'; +import { VehicleSeat } from '../vehicles/VehicleSeat'; +import { EntityType } from '../enums/EntityType'; + +export interface IControllable extends IInputReceiver +{ + entityType: EntityType; + seats: VehicleSeat[]; + position: THREE.Vector3; + controllingCharacter: Character; + + triggerAction(actionName: string, value: boolean): void; + resetControls(): void; + allowSleep(value: boolean): void; + onInputChange(): void; + noDirectionPressed(): boolean; +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/interfaces/IInputReceiver.ts b/Sketchbook-master/Sketchbook-master/src/ts/interfaces/IInputReceiver.ts new file mode 100644 index 00000000..7c6b2468 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/interfaces/IInputReceiver.ts @@ -0,0 +1,14 @@ +import { KeyBinding } from '../core/KeyBinding'; + +export interface IInputReceiver +{ + actions: { [action: string]: KeyBinding }; + + handleKeyboardEvent(event: KeyboardEvent, code: string, pressed: boolean): void; + handleMouseButton(event: MouseEvent, code: string, pressed: boolean): void; + handleMouseMove(event: MouseEvent, deltaX: number, deltaY: number): void; + handleMouseWheel(event: WheelEvent, value: number): void; + + inputReceiverInit(): void; + inputReceiverUpdate(timeStep: number): void; +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/interfaces/ISpawnPoint.ts b/Sketchbook-master/Sketchbook-master/src/ts/interfaces/ISpawnPoint.ts new file mode 100644 index 00000000..bb2e2833 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/interfaces/ISpawnPoint.ts @@ -0,0 +1,7 @@ +import { World } from '../world/World'; +import { LoadingManager } from '../core/LoadingManager'; + +export interface ISpawnPoint +{ + spawn(loadingManager: LoadingManager, world: World): void; +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/interfaces/IUpdatable.ts b/Sketchbook-master/Sketchbook-master/src/ts/interfaces/IUpdatable.ts new file mode 100644 index 00000000..4eb3e534 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/interfaces/IUpdatable.ts @@ -0,0 +1,5 @@ +export interface IUpdatable +{ + updateOrder: number; + update(timestep: number, unscaledTimeStep: number): void; +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/interfaces/IWorldEntity.ts b/Sketchbook-master/Sketchbook-master/src/ts/interfaces/IWorldEntity.ts new file mode 100644 index 00000000..35c35c65 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/interfaces/IWorldEntity.ts @@ -0,0 +1,11 @@ +import { World } from '../world/World'; +import { EntityType } from '../enums/EntityType'; +import { IUpdatable } from './IUpdatable'; + +export interface IWorldEntity extends IUpdatable +{ + entityType: EntityType; + + addToWorld(world: World): void; + removeFromWorld(world: World): void; +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/physics/colliders/BoxCollider.ts b/Sketchbook-master/Sketchbook-master/src/ts/physics/colliders/BoxCollider.ts new file mode 100644 index 00000000..ca737af7 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/physics/colliders/BoxCollider.ts @@ -0,0 +1,44 @@ +import * as CANNON from 'cannon'; +import * as THREE from 'three'; +import * as Utils from '../../core/FunctionLibrary'; +import { ICollider } from '../../interfaces/ICollider'; + +export class BoxCollider implements ICollider +{ + public options: any; + public body: CANNON.Body; + public debugModel: THREE.Mesh; + + constructor(options: any) + { + let defaults = { + mass: 0, + position: new THREE.Vector3(), + size: new THREE.Vector3(0.3, 0.3, 0.3), + friction: 0.3 + }; + options = Utils.setDefaults(options, defaults); + this.options = options; + + options.position = new CANNON.Vec3(options.position.x, options.position.y, options.position.z); + options.size = new CANNON.Vec3(options.size.x, options.size.y, options.size.z); + + let mat = new CANNON.Material('boxMat'); + mat.friction = options.friction; + // mat.restitution = 0.7; + + let shape = new CANNON.Box(options.size); + // shape.material = mat; + + // Add phys sphere + let physBox = new CANNON.Body({ + mass: options.mass, + position: options.position, + shape + }); + + physBox.material = mat; + + this.body = physBox; + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/physics/colliders/CapsuleCollider.ts b/Sketchbook-master/Sketchbook-master/src/ts/physics/colliders/CapsuleCollider.ts new file mode 100644 index 00000000..5fabbc8d --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/physics/colliders/CapsuleCollider.ts @@ -0,0 +1,46 @@ +import * as CANNON from 'cannon'; +import * as THREE from 'three'; +import * as Utils from '../../core/FunctionLibrary'; +import { ICollider } from '../../interfaces/ICollider'; + +export class CapsuleCollider implements ICollider +{ + public options: any; + public body: CANNON.Body; + // public visual: THREE.Mesh; + + constructor(options: any) + { + let defaults = { + mass: 0, + position: new CANNON.Vec3(), + height: 0.5, + radius: 0.3, + segments: 8, + friction: 0.3 + }; + options = Utils.setDefaults(options, defaults); + this.options = options; + + let mat = new CANNON.Material('capsuleMat'); + mat.friction = options.friction; + + let capsuleBody = new CANNON.Body({ + mass: options.mass, + position: options.position + }); + + // Compound shape + let sphereShape = new CANNON.Sphere(options.radius); + + // Materials + capsuleBody.material = mat; + // sphereShape.material = mat; + + capsuleBody.addShape(sphereShape, new CANNON.Vec3(0, 0, 0)); + capsuleBody.addShape(sphereShape, new CANNON.Vec3(0, options.height / 2, 0)); + capsuleBody.addShape(sphereShape, new CANNON.Vec3(0, -options.height / 2, 0)); + + this.body = capsuleBody; + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/physics/colliders/ConvexCollider.ts b/Sketchbook-master/Sketchbook-master/src/ts/physics/colliders/ConvexCollider.ts new file mode 100644 index 00000000..50d944cc --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/physics/colliders/ConvexCollider.ts @@ -0,0 +1,58 @@ +import * as CANNON from 'cannon'; +import * as THREE from 'three'; +import * as Utils from '../../core/FunctionLibrary'; +import { ICollider } from '../../interfaces/ICollider'; +import {Mesh, Vector3} from 'three'; +import {Object3D} from 'three'; + +export class ConvexCollider implements ICollider +{ + public mesh: any; + public options: any; + public body: CANNON.Body; + public debugModel: any; + + constructor(mesh: Object3D, options: any) + { + this.mesh = mesh.clone(); + + let defaults = { + mass: 0, + position: mesh.position, + friction: 0.3 + }; + options = Utils.setDefaults(options, defaults); + this.options = options; + + let mat = new CANNON.Material('convMat'); + mat.friction = options.friction; + // mat.restitution = 0.7; + + if (this.mesh.geometry.isBufferGeometry) + { + this.mesh.geometry = new THREE.Geometry().fromBufferGeometry(this.mesh.geometry); + } + + let cannonPoints = this.mesh.geometry.vertices.map((v: Vector3) => { + return new CANNON.Vec3( v.x, v.y, v.z ); + }); + + let cannonFaces = this.mesh.geometry.faces.map((f: any) => { + return [f.a, f.b, f.c]; + }); + + let shape = new CANNON.ConvexPolyhedron(cannonPoints, cannonFaces); + // shape.material = mat; + + // Add phys sphere + let physBox = new CANNON.Body({ + mass: options.mass, + position: options.position, + shape + }); + + physBox.material = mat; + + this.body = physBox; + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/physics/colliders/SphereCollider.ts b/Sketchbook-master/Sketchbook-master/src/ts/physics/colliders/SphereCollider.ts new file mode 100644 index 00000000..9645c8f0 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/physics/colliders/SphereCollider.ts @@ -0,0 +1,39 @@ +import * as CANNON from 'cannon'; +import * as THREE from 'three'; +import * as Utils from '../../core/FunctionLibrary'; +import { ICollider } from '../../interfaces/ICollider'; + +export class SphereCollider implements ICollider +{ + public options: any; + public body: CANNON.Body; + public debugModel: THREE.Mesh; + + constructor(options: any) + { + let defaults = { + mass: 0, + position: new CANNON.Vec3(), + radius: 0.3, + friction: 0.3 + }; + options = Utils.setDefaults(options, defaults); + this.options = options; + + let mat = new CANNON.Material('sphereMat'); + mat.friction = options.friction; + + let shape = new CANNON.Sphere(options.radius); + // shape.material = mat; + + // Add phys sphere + let physSphere = new CANNON.Body({ + mass: options.mass, + position: options.position, + shape + }); + physSphere.material = mat; + + this.body = physSphere; + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/physics/colliders/TrimeshCollider.ts b/Sketchbook-master/Sketchbook-master/src/ts/physics/colliders/TrimeshCollider.ts new file mode 100644 index 00000000..0110ece2 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/physics/colliders/TrimeshCollider.ts @@ -0,0 +1,47 @@ +import * as CANNON from 'cannon'; +import * as THREE from 'three'; +import * as Utils from '../../core/FunctionLibrary'; +import {ICollider} from '../../interfaces/ICollider'; +import {Object3D} from 'three'; +import { threeToCannon } from '../../../lib/utils/three-to-cannon'; + +export class TrimeshCollider implements ICollider +{ + public mesh: any; + public options: any; + public body: CANNON.Body; + public debugModel: any; + + constructor(mesh: Object3D, options: any) + { + this.mesh = mesh.clone(); + + let defaults = { + mass: 0, + position: mesh.position, + rotation: mesh.quaternion, + friction: 0.3 + }; + options = Utils.setDefaults(options, defaults); + this.options = options; + + let mat = new CANNON.Material('triMat'); + mat.friction = options.friction; + // mat.restitution = 0.7; + + let shape = threeToCannon(this.mesh, {type: threeToCannon.Type.MESH}); + // shape['material'] = mat; + + // Add phys sphere + let physBox = new CANNON.Body({ + mass: options.mass, + position: options.position, + quaternion: options.rotation, + shape: shape + }); + + physBox.material = mat; + + this.body = physBox; + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/physics/spring_simulation/RelativeSpringSimulator.ts b/Sketchbook-master/Sketchbook-master/src/ts/physics/spring_simulation/RelativeSpringSimulator.ts new file mode 100644 index 00000000..f3e0bede --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/physics/spring_simulation/RelativeSpringSimulator.ts @@ -0,0 +1,76 @@ +import * as THREE from 'three'; +import { SimulatorBase } from './SimulatorBase'; +import { SimulationFrame } from './SimulationFrame'; +import { spring } from '../../core/FunctionLibrary'; + +export class RelativeSpringSimulator extends SimulatorBase +{ + public position: number; + public velocity: number; + public target: number; + public lastLerp: number; + public cache: SimulationFrame[]; + + constructor(fps: number, mass: number, damping: number, startPosition: number = 0, startVelocity: number = 0) + { + // Construct base + super(fps, mass, damping); + + // Simulated values + this.position = startPosition; + this.velocity = startVelocity; + + // Simulation parameters + this.target = 0; + + // Last lerped position for relative output + this.lastLerp = 0; + + // Initialize cache by pushing two frames + this.cache = []; // At least two frames + for (let i = 0; i < 2; i++) + { + this.cache.push({ + position: startPosition, + velocity: startVelocity, + }); + } + } + + /** + * Advances the simulation by given time step + * @param {number} timeStep + */ + public simulate(timeStep: number): void + { + this.generateFrames(timeStep); + + // SpringR lerping + // Lerp from 0 to next frame + let lerp = THREE.MathUtils.lerp(0, this.cache[1].position, this.offset / this.frameTime); + + // Substract last lerp from current to make output relative + this.position = (lerp - this.lastLerp); + this.lastLerp = lerp; + + this.velocity = THREE.MathUtils.lerp(this.cache[0].velocity, this.cache[1].velocity, this.offset / this.frameTime); + } + + /** + * Gets another simulation frame + */ + public getFrame(isLastFrame: boolean): SimulationFrame + { + let newFrame = Object.assign({}, this.lastFrame()); + + if (isLastFrame) + { + // Reset position + newFrame.position = 0; + // Transition to next frame + this.lastLerp = this.lastLerp - this.lastFrame().position; + } + + return spring(newFrame.position, this.target, newFrame.velocity, this.mass, this.damping); + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/physics/spring_simulation/SimulationFrame.ts b/Sketchbook-master/Sketchbook-master/src/ts/physics/spring_simulation/SimulationFrame.ts new file mode 100644 index 00000000..8077702e --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/physics/spring_simulation/SimulationFrame.ts @@ -0,0 +1,10 @@ +export class SimulationFrame { + public position: number; + public velocity: number; + + constructor(position: number, velocity: number) + { + this.position = position; + this.velocity = velocity; + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/physics/spring_simulation/SimulationFrameVector.ts b/Sketchbook-master/Sketchbook-master/src/ts/physics/spring_simulation/SimulationFrameVector.ts new file mode 100644 index 00000000..99764241 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/physics/spring_simulation/SimulationFrameVector.ts @@ -0,0 +1,10 @@ +export class SimulationFrameVector { + public position: THREE.Vector3; + public velocity: THREE.Vector3; + + constructor(position: THREE.Vector3, velocity: THREE.Vector3) + { + this.position = position; + this.velocity = velocity; + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/physics/spring_simulation/SimulatorBase.ts b/Sketchbook-master/Sketchbook-master/src/ts/physics/spring_simulation/SimulatorBase.ts new file mode 100644 index 00000000..38d6d53b --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/physics/spring_simulation/SimulatorBase.ts @@ -0,0 +1,52 @@ +export abstract class SimulatorBase +{ + public mass: any; + public damping: any; + public frameTime: number; + public offset: number; + public abstract cache: any[]; + + constructor(fps: number, mass: number, damping: number) + { + this.mass = mass; + this.damping = damping; + this.frameTime = 1 / fps; + this.offset = 0; + } + + public setFPS(value: number): void + { + this.frameTime = 1 / value; + } + + public lastFrame(): any + { + return this.cache[this.cache.length - 1]; + } + + /** + * Generates frames between last simulation call and the current one + * @param {timeStep} timeStep + */ + public generateFrames(timeStep: number): void + { + // Update cache + // Find out how many frames needs to be generated + let totalTimeStep = this.offset + timeStep; + let framesToGenerate = Math.floor(totalTimeStep / this.frameTime); + this.offset = totalTimeStep % this.frameTime; + + // Generate simulation frames + if (framesToGenerate > 0) + { + for (let i = 0; i < framesToGenerate; i++) + { + this.cache.push(this.getFrame(i + 1 === framesToGenerate)); + } + this.cache = this.cache.slice(-2); + } + } + + public abstract getFrame(isLastFrame: boolean): any; + public abstract simulate(timeStep: number): void; +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/physics/spring_simulation/SpringSimulator.ts b/Sketchbook-master/Sketchbook-master/src/ts/physics/spring_simulation/SpringSimulator.ts new file mode 100644 index 00000000..e74d448e --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/physics/spring_simulation/SpringSimulator.ts @@ -0,0 +1,56 @@ +import * as THREE from 'three'; +import { SimulatorBase } from './SimulatorBase'; +import { SimulationFrame } from './SimulationFrame'; +import { spring } from '../../core/FunctionLibrary'; + +export class SpringSimulator extends SimulatorBase +{ + public position: number; + public velocity: number; + public target: number; + public cache: SimulationFrame[]; + + constructor(fps: number, mass: number, damping: number, startPosition: number = 0, startVelocity: number = 0) + { + // Construct base + super(fps, mass, damping); + + // Simulated values + this.position = startPosition; + this.velocity = startVelocity; + + // Simulation parameters + this.target = 0; + + // Initialize cache by pushing two frames + this.cache = []; // At least two frames + for (let i = 0; i < 2; i++) + { + this.cache.push( + new SimulationFrame(startPosition, startVelocity), + ); + } + } + + /** + * Advances the simulation by given time step + * @param {number} timeStep + */ + public simulate(timeStep: number): void + { + // Generate new frames + this.generateFrames(timeStep); + + // Return values interpolated between cached frames + this.position = THREE.MathUtils.lerp(this.cache[0].position, this.cache[1].position, this.offset / this.frameTime); + this.velocity = THREE.MathUtils.lerp(this.cache[0].velocity, this.cache[1].velocity, this.offset / this.frameTime); + } + + /** + * Gets another simulation frame + */ + public getFrame(isLastFrame: boolean): SimulationFrame + { + return spring(this.lastFrame().position, this.target, this.lastFrame().velocity, this.mass, this.damping); + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/physics/spring_simulation/VectorSpringSimulator.ts b/Sketchbook-master/Sketchbook-master/src/ts/physics/spring_simulation/VectorSpringSimulator.ts new file mode 100644 index 00000000..7c974c9e --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/physics/spring_simulation/VectorSpringSimulator.ts @@ -0,0 +1,65 @@ +import * as THREE from 'three'; +import { SimulatorBase } from './SimulatorBase'; +import { SimulationFrameVector } from './SimulationFrameVector'; +import { springV } from '../../core/FunctionLibrary'; + +export class VectorSpringSimulator extends SimulatorBase +{ + public position: THREE.Vector3; + public velocity: THREE.Vector3; + public target: THREE.Vector3; + public cache: SimulationFrameVector[]; + + constructor(fps: number, mass: number, damping: number) + { + // Construct base + super(fps, mass, damping); + + this.init(); + } + + public init(): void + { + this.position = new THREE.Vector3(); + this.velocity = new THREE.Vector3(); + this.target = new THREE.Vector3(); + + // Initialize cache by pushing two frames + this.cache = []; + for (let i = 0; i < 2; i++) + { + this.cache.push( + new SimulationFrameVector(new THREE.Vector3(), new THREE.Vector3()), + ); + } + } + + /** + * Advances the simulation by given time step + * @param {number} timeStep + */ + public simulate(timeStep: number): void + { + // Generate new frames + this.generateFrames(timeStep); + + // Return interpolation + this.position.lerpVectors(this.cache[0].position, this.cache[1].position, this.offset / this.frameTime); + this.velocity.lerpVectors(this.cache[0].velocity, this.cache[1].velocity, this.offset / this.frameTime); + } + + /** + * Gets another simulation frame + */ + public getFrame(isLastFrame: boolean): SimulationFrameVector + { + // Deep clone data from previous frame + let newSpring = new SimulationFrameVector(this.lastFrame().position.clone(), this.lastFrame().velocity.clone()); + + // Calculate new Spring + springV(newSpring.position, this.target, newSpring.velocity, this.mass, this.damping); + + // Return new Spring + return newSpring; + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/sketchbook.ts b/Sketchbook-master/Sketchbook-master/src/ts/sketchbook.ts new file mode 100644 index 00000000..ae93c3ea --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/sketchbook.ts @@ -0,0 +1,2 @@ +import '../css/main.css'; +export { World } from './world/World'; \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/vehicles/Airplane.ts b/Sketchbook-master/Sketchbook-master/src/ts/vehicles/Airplane.ts new file mode 100644 index 00000000..ee76620a --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/vehicles/Airplane.ts @@ -0,0 +1,418 @@ +import * as THREE from 'three'; +import * as CANNON from 'cannon'; + +import { Vehicle } from './Vehicle'; +import { IControllable } from '../interfaces/IControllable'; +import { IWorldEntity } from '../interfaces/IWorldEntity'; +import { KeyBinding } from '../core/KeyBinding'; +import { SpringSimulator } from '../physics/spring_simulation/SpringSimulator'; +import * as Utils from '../core/FunctionLibrary'; +import { EntityType } from '../enums/EntityType'; + +export class Airplane extends Vehicle implements IControllable, IWorldEntity +{ + public entityType: EntityType = EntityType.Airplane; + public rotor: THREE.Object3D; + public leftAileron: THREE.Object3D; + public rightAileron: THREE.Object3D; + public elevators: THREE.Object3D[] = []; + public rudder: THREE.Object3D; + + private steeringSimulator: SpringSimulator; + private aileronSimulator: SpringSimulator; + private elevatorSimulator: SpringSimulator; + private rudderSimulator: SpringSimulator; + + private enginePower: number = 0; + private lastDrag: number = 0; + + constructor(gltf: any) + { + super(gltf, { + radius: 0.12, + suspensionStiffness: 150, + suspensionRestLength: 0.25, + dampingRelaxation: 5, + dampingCompression: 5, + directionLocal: new CANNON.Vec3(0, -1, 0), + axleLocal: new CANNON.Vec3(-1, 0, 0), + chassisConnectionPointLocal: new CANNON.Vec3(), + }); + + this.readAirplaneData(gltf); + + this.collision.preStep = (body: CANNON.Body) => { this.physicsPreStep(body, this); }; + + this.actions = { + 'throttle': new KeyBinding('ShiftLeft'), + 'brake': new KeyBinding('Space'), + 'wheelBrake': new KeyBinding('KeyB'), + 'pitchUp': new KeyBinding('KeyS'), + 'pitchDown': new KeyBinding('KeyW'), + 'yawLeft': new KeyBinding('KeyQ'), + 'yawRight': new KeyBinding('KeyE'), + 'rollLeft': new KeyBinding('KeyA'), + 'rollRight': new KeyBinding('KeyD'), + 'exitVehicle': new KeyBinding('KeyF'), + 'seat_switch': new KeyBinding('KeyX'), + 'view': new KeyBinding('KeyV'), + }; + + this.steeringSimulator = new SpringSimulator(60, 10, 0.6); + this.aileronSimulator = new SpringSimulator(60, 5, 0.6); + this.elevatorSimulator = new SpringSimulator(60, 7, 0.6); + this.rudderSimulator = new SpringSimulator(60, 10, 0.6); + } + + public noDirectionPressed(): boolean + { + let result = + !this.actions.throttle.isPressed && + !this.actions.brake.isPressed && + !this.actions.yawLeft.isPressed && + !this.actions.yawRight.isPressed && + !this.actions.rollLeft.isPressed && + !this.actions.rollRight.isPressed; + + return result; + } + + public update(timeStep: number): void + { + super.update(timeStep); + + // Rotors visuals + if (this.controllingCharacter !== undefined) + { + if (this.enginePower < 1) this.enginePower += timeStep * 0.4; + if (this.enginePower > 1) this.enginePower = 1; + } + else + { + if (this.enginePower > 0) this.enginePower -= timeStep * 0.12; + if (this.enginePower < 0) this.enginePower = 0; + } + this.rotor.rotateX(this.enginePower * timeStep * 60); + + // Steering + if (this.rayCastVehicle.numWheelsOnGround > 0) + { + if ((this.actions.yawLeft.isPressed || this.actions.rollLeft.isPressed) + && !this.actions.yawRight.isPressed && !this.actions.rollRight.isPressed) + { + this.steeringSimulator.target = 0.8; + } + else if ((this.actions.yawRight.isPressed || this.actions.rollRight.isPressed) + && !this.actions.yawLeft.isPressed && !this.actions.rollLeft.isPressed) + { + this.steeringSimulator.target = -0.8; + } + else + { + this.steeringSimulator.target = 0; + } + } + else + { + this.steeringSimulator.target = 0; + } + this.steeringSimulator.simulate(timeStep); + this.setSteeringValue(this.steeringSimulator.position); + + const partsRotationAmount = 0.7; + + // Ailerons + if (this.actions.rollLeft.isPressed && !this.actions.rollRight.isPressed) + { + this.aileronSimulator.target = partsRotationAmount; + } + else if (!this.actions.rollLeft.isPressed && this.actions.rollRight.isPressed) + { + this.aileronSimulator.target = -partsRotationAmount; + } + else + { + this.aileronSimulator.target = 0; + } + + // Elevators + if (this.actions.pitchUp.isPressed && !this.actions.pitchDown.isPressed) + { + this.elevatorSimulator.target = partsRotationAmount; + } + else if (!this.actions.pitchUp.isPressed && this.actions.pitchDown.isPressed) + { + this.elevatorSimulator.target = -partsRotationAmount; + } + else + { + this.elevatorSimulator.target = 0; + } + + // Rudder + if (this.actions.yawLeft.isPressed && !this.actions.yawRight.isPressed) + { + this.rudderSimulator.target = partsRotationAmount; + } + else if (!this.actions.yawLeft.isPressed && this.actions.yawRight.isPressed) + { + this.rudderSimulator.target = -partsRotationAmount; + } + else + { + this.rudderSimulator.target = 0; + } + + // Run rotation simulators + this.aileronSimulator.simulate(timeStep); + this.elevatorSimulator.simulate(timeStep); + this.rudderSimulator.simulate(timeStep); + + // Rotate parts + this.leftAileron.rotation.y = this.aileronSimulator.position; + this.rightAileron.rotation.y = -this.aileronSimulator.position; + this.elevators.forEach((elevator) => + { + elevator.rotation.y = this.elevatorSimulator.position; + }); + this.rudder.rotation.y = this.rudderSimulator.position; + } + + public physicsPreStep(body: CANNON.Body, plane: Airplane): void + { + let quat = Utils.threeQuat(body.quaternion); + let right = new THREE.Vector3(1, 0, 0).applyQuaternion(quat); + let up = new THREE.Vector3(0, 1, 0).applyQuaternion(quat); + let forward = new THREE.Vector3(0, 0, 1).applyQuaternion(quat); + + const velocity = new CANNON.Vec3().copy(this.collision.velocity); + let velLength1 = body.velocity.length(); + const currentSpeed = velocity.dot(Utils.cannonVector(forward)); + + // Rotation controls influence + let flightModeInfluence = currentSpeed / 10; + flightModeInfluence = THREE.MathUtils.clamp(flightModeInfluence, 0, 1); + + let lowerMassInfluence = currentSpeed / 10; + lowerMassInfluence = THREE.MathUtils.clamp(lowerMassInfluence, 0, 1); + this.collision.mass = 50 * (1 - (lowerMassInfluence * 0.6)); + + // Rotation stabilization + let lookVelocity = body.velocity.clone(); + lookVelocity.normalize(); + let rotStabVelocity = new THREE.Quaternion().setFromUnitVectors(forward, Utils.threeVector(lookVelocity)); + rotStabVelocity.x *= 0.3; + rotStabVelocity.y *= 0.3; + rotStabVelocity.z *= 0.3; + rotStabVelocity.w *= 0.3; + let rotStabEuler = new THREE.Euler().setFromQuaternion(rotStabVelocity); + + let rotStabInfluence = THREE.MathUtils.clamp(velLength1 - 1, 0, 0.1); // Only with speed greater than 1 UPS + rotStabInfluence *= (this.rayCastVehicle.numWheelsOnGround > 0 && currentSpeed < 0 ? 0 : 1); // Reverse fix + let loopFix = (this.actions.throttle.isPressed && currentSpeed > 0 ? 0 : 1); + + body.angularVelocity.x += rotStabEuler.x * rotStabInfluence * loopFix; + body.angularVelocity.y += rotStabEuler.y * rotStabInfluence; + body.angularVelocity.z += rotStabEuler.z * rotStabInfluence * loopFix; + + // Pitch + if (plane.actions.pitchUp.isPressed) + { + body.angularVelocity.x -= right.x * 0.04 * flightModeInfluence * this.enginePower; + body.angularVelocity.y -= right.y * 0.04 * flightModeInfluence * this.enginePower; + body.angularVelocity.z -= right.z * 0.04 * flightModeInfluence * this.enginePower; + } + if (plane.actions.pitchDown.isPressed) + { + body.angularVelocity.x += right.x * 0.04 * flightModeInfluence * this.enginePower; + body.angularVelocity.y += right.y * 0.04 * flightModeInfluence * this.enginePower; + body.angularVelocity.z += right.z * 0.04 * flightModeInfluence * this.enginePower; + } + + // Yaw + if (plane.actions.yawLeft.isPressed) + { + body.angularVelocity.x += up.x * 0.02 * flightModeInfluence * this.enginePower; + body.angularVelocity.y += up.y * 0.02 * flightModeInfluence * this.enginePower; + body.angularVelocity.z += up.z * 0.02 * flightModeInfluence * this.enginePower; + } + if (plane.actions.yawRight.isPressed) + { + body.angularVelocity.x -= up.x * 0.02 * flightModeInfluence * this.enginePower; + body.angularVelocity.y -= up.y * 0.02 * flightModeInfluence * this.enginePower; + body.angularVelocity.z -= up.z * 0.02 * flightModeInfluence * this.enginePower; + } + + // Roll + if (plane.actions.rollLeft.isPressed) + { + body.angularVelocity.x -= forward.x * 0.055 * flightModeInfluence * this.enginePower; + body.angularVelocity.y -= forward.y * 0.055 * flightModeInfluence * this.enginePower; + body.angularVelocity.z -= forward.z * 0.055 * flightModeInfluence * this.enginePower; + } + if (plane.actions.rollRight.isPressed) + { + body.angularVelocity.x += forward.x * 0.055 * flightModeInfluence * this.enginePower; + body.angularVelocity.y += forward.y * 0.055 * flightModeInfluence * this.enginePower; + body.angularVelocity.z += forward.z * 0.055 * flightModeInfluence * this.enginePower; + } + + // Thrust + let speedModifier = 0.02; + if (plane.actions.throttle.isPressed && !plane.actions.brake.isPressed) + { + speedModifier = 0.06; + } + else if (!plane.actions.throttle.isPressed && plane.actions.brake.isPressed) + { + speedModifier = -0.05; + } + else if (this.rayCastVehicle.numWheelsOnGround > 0) + { + speedModifier = 0; + } + + body.velocity.x += (velLength1 * this.lastDrag + speedModifier) * forward.x * this.enginePower; + body.velocity.y += (velLength1 * this.lastDrag + speedModifier) * forward.y * this.enginePower; + body.velocity.z += (velLength1 * this.lastDrag + speedModifier) * forward.z * this.enginePower; + + // document.getElementById('car-debug').innerHTML = 'Speed: ' + Utils.round(currentSpeed, 2) + ''; + // document.getElementById('car-debug').innerHTML += '
    ' + 'Power output: ' + Utils.round(velLength1 * this.lastDrag, 2) + ''; + + // Drag + let velLength2 = body.velocity.length(); + const drag = Math.pow(velLength2, 1) * 0.003 * this.enginePower; + body.velocity.x -= body.velocity.x * drag; + body.velocity.y -= body.velocity.y * drag; + body.velocity.z -= body.velocity.z * drag; + this.lastDrag = drag; + + // Lift + let lift = Math.pow(velLength2, 1) * 0.005 * this.enginePower; + lift = THREE.MathUtils.clamp(lift, 0, 0.05); + body.velocity.x += up.x * lift; + body.velocity.y += up.y * lift; + body.velocity.z += up.z * lift; + + // Gravity + // body.velocity.y -= 0.1; + + // document.getElementById('car-debug').innerHTML += '
    ' + 'Drag: ' + Utils.round(drag, 3) + ''; + // document.getElementById('car-debug').innerHTML += '
    ' + 'Lift: ' + Utils.round(lift, 3) + ''; + + // Angular damping + body.angularVelocity.x = THREE.MathUtils.lerp(body.angularVelocity.x, body.angularVelocity.x * 0.98, flightModeInfluence); + body.angularVelocity.y = THREE.MathUtils.lerp(body.angularVelocity.y, body.angularVelocity.y * 0.98, flightModeInfluence); + body.angularVelocity.z = THREE.MathUtils.lerp(body.angularVelocity.z, body.angularVelocity.z * 0.98, flightModeInfluence); + } + + public onInputChange(): void + { + super.onInputChange(); + + const brakeForce = 100; + + if (this.actions.exitVehicle.justPressed && this.controllingCharacter !== undefined) + { + this.forceCharacterOut(); + } + if (this.actions.wheelBrake.justPressed) + { + this.setBrake(brakeForce); + } + if (this.actions.wheelBrake.justReleased) + { + this.setBrake(0); + } + if (this.actions.view.justPressed) + { + this.toggleFirstPersonView(); + } + } + + public readAirplaneData(gltf: any): void + { + gltf.scene.traverse((child) => { + if (child.hasOwnProperty('userData')) + { + if (child.userData.hasOwnProperty('data')) + { + if (child.userData.data === 'rotor') + { + this.rotor = child; + } + if (child.userData.data === 'rudder') + { + this.rudder = child; + } + if (child.userData.data === 'elevator') + { + this.elevators.push(child); + } + if (child.userData.data === 'aileron') + { + if (child.userData.hasOwnProperty('side')) + { + if (child.userData.side === 'left') + { + this.leftAileron = child; + } + else if (child.userData.side === 'right') + { + this.rightAileron = child; + } + } + } + } + } + }); + } + + public inputReceiverInit(): void + { + super.inputReceiverInit(); + + this.world.updateControls([ + { + keys: ['Shift'], + desc: 'Accelerate' + }, + { + keys: ['Space'], + desc: 'Decelerate' + }, + { + keys: ['W', 'S'], + desc: 'Elevators' + }, + { + keys: ['A', 'D'], + desc: 'Ailerons' + }, + { + keys: ['Q', 'E'], + desc: 'Rudder / Steering' + }, + { + keys: ['B'], + desc: 'Brake' + }, + { + keys: ['V'], + desc: 'View select' + }, + { + keys: ['F'], + desc: 'Exit vehicle' + }, + { + keys: ['Shift', '+', 'R'], + desc: 'Respawn' + }, + { + keys: ['Shift', '+', 'C'], + desc: 'Free camera' + }, + ]); + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/vehicles/Car.ts b/Sketchbook-master/Sketchbook-master/src/ts/vehicles/Car.ts new file mode 100644 index 00000000..9e4554b2 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/vehicles/Car.ts @@ -0,0 +1,345 @@ +import * as CANNON from 'cannon'; + +import { Vehicle } from './Vehicle'; +import { IControllable } from '../interfaces/IControllable'; +import { KeyBinding } from '../core/KeyBinding'; +import * as THREE from 'three'; +import * as Utils from '../core/FunctionLibrary'; +import { SpringSimulator } from '../physics/spring_simulation/SpringSimulator'; +import { World } from '../world/World'; +import { EntityType } from '../enums/EntityType'; + +export class Car extends Vehicle implements IControllable +{ + public entityType: EntityType = EntityType.Car; + public drive: string = 'awd'; + get speed(): number { + return this._speed; + } + private _speed: number = 0; + + // private wheelsDebug: THREE.Mesh[] = []; + private steeringWheel: THREE.Object3D; + private airSpinTimer: number = 0; + + private steeringSimulator: SpringSimulator; + private gear: number = 1; + + // Transmission + private shiftTimer: number; + private timeToShift: number = 0.2; + + private canTiltForwards: boolean = false; + private characterWantsToExit: boolean = false; + + constructor(gltf: any) + { + super(gltf, { + radius: 0.25, + suspensionStiffness: 20, + suspensionRestLength: 0.35, + maxSuspensionTravel: 1, + frictionSlip: 0.8, + dampingRelaxation: 2, + dampingCompression: 2, + rollInfluence: 0.8 + }); + + this.readCarData(gltf); + + this.collision.preStep = (body: CANNON.Body) => { this.physicsPreStep(body, this); }; + + this.actions = { + 'throttle': new KeyBinding('KeyW'), + 'reverse': new KeyBinding('KeyS'), + 'brake': new KeyBinding('Space'), + 'left': new KeyBinding('KeyA'), + 'right': new KeyBinding('KeyD'), + 'exitVehicle': new KeyBinding('KeyF'), + 'seat_switch': new KeyBinding('KeyX'), + 'view': new KeyBinding('KeyV'), + }; + + this.steeringSimulator = new SpringSimulator(60, 10, 0.6); + } + + public noDirectionPressed(): boolean + { + let result = + !this.actions.throttle.isPressed && + !this.actions.reverse.isPressed && + !this.actions.left.isPressed && + !this.actions.right.isPressed; + + return result; + } + + public update(timeStep: number): void + { + super.update(timeStep); + + const tiresHaveContact = this.rayCastVehicle.numWheelsOnGround > 0; + + // Air spin + if (!tiresHaveContact) + { + // Timer grows when car is off ground, resets once you touch the ground again + this.airSpinTimer += timeStep; + if (!this.actions.throttle.isPressed) this.canTiltForwards = true; + } + else + { + this.canTiltForwards = false; + this.airSpinTimer = 0; + } + + // Engine + const engineForce = 500; + const maxGears = 5; + const gearsMaxSpeeds = { + 'R': -4, + '0': 0, + '1': 5, + '2': 9, + '3': 13, + '4': 17, + '5': 22, + }; + + if (this.shiftTimer > 0) + { + this.shiftTimer -= timeStep; + if (this.shiftTimer < 0) this.shiftTimer = 0; + } + else + { + // Transmission + if (this.actions.reverse.isPressed) + { + const powerFactor = (gearsMaxSpeeds['R'] - this.speed) / Math.abs(gearsMaxSpeeds['R']); + const force = (engineForce / this.gear) * (Math.abs(powerFactor) ** 1); + + this.applyEngineForce(force); + } + else + { + const powerFactor = (gearsMaxSpeeds[this.gear] - this.speed) / (gearsMaxSpeeds[this.gear] - gearsMaxSpeeds[this.gear - 1]); + + if (powerFactor < 0.1 && this.gear < maxGears) this.shiftUp(); + else if (this.gear > 1 && powerFactor > 1.2) this.shiftDown(); + else if (this.actions.throttle.isPressed) + { + const force = (engineForce / this.gear) * (powerFactor ** 1); + this.applyEngineForce(-force); + } + } + } + + // Steering + this.steeringSimulator.simulate(timeStep); + this.setSteeringValue(this.steeringSimulator.position); + if (this.steeringWheel !== undefined) this.steeringWheel.rotation.z = -this.steeringSimulator.position * 2; + + if (this.rayCastVehicle.numWheelsOnGround < 3 && Math.abs(this.collision.velocity.length()) < 0.5) + { + this.collision.quaternion.copy(this.collision.initQuaternion); + } + + // Getting out + if (this.characterWantsToExit && this.controllingCharacter !== undefined && this.controllingCharacter.charState.canLeaveVehicles) + { + let speed = this.collision.velocity.length(); + + if (speed > 0.1 && speed < 4) + { + this.triggerAction('brake', true); + } + else + { + this.forceCharacterOut(); + } + } + } + + public shiftUp(): void + { + this.gear++; + this.shiftTimer = this.timeToShift; + + this.applyEngineForce(0); + } + + public shiftDown(): void + { + this.gear--; + this.shiftTimer = this.timeToShift; + + this.applyEngineForce(0); + } + + public physicsPreStep(body: CANNON.Body, car: Car): void + { + // Constants + const quat = Utils.threeQuat(body.quaternion); + const forward = new THREE.Vector3(0, 0, 1).applyQuaternion(quat); + const right = new THREE.Vector3(1, 0, 0).applyQuaternion(quat); + const up = new THREE.Vector3(0, 1, 0).applyQuaternion(quat); + + // Measure speed + this._speed = this.collision.velocity.dot(Utils.cannonVector(forward)); + + // Air spin + // It takes 2 seconds until you have max spin air control since you leave the ground + let airSpinInfluence = THREE.MathUtils.clamp(this.airSpinTimer / 2, 0, 1); + airSpinInfluence *= THREE.MathUtils.clamp(this.speed, 0, 1); + + const flipSpeedFactor = THREE.MathUtils.clamp(1 - this.speed, 0, 1); + const upFactor = (up.dot(new THREE.Vector3(0, -1, 0)) / 2) + 0.5; + const flipOverInfluence = flipSpeedFactor * upFactor * 3; + + const maxAirSpinMagnitude = 2.0; + const airSpinAcceleration = 0.15; + const angVel = this.collision.angularVelocity; + + const spinVectorForward = Utils.cannonVector(forward.clone()); + const spinVectorRight = Utils.cannonVector(right.clone()); + + const effectiveSpinVectorForward = Utils.cannonVector(forward.clone().multiplyScalar(airSpinAcceleration * (airSpinInfluence + flipOverInfluence))); + const effectiveSpinVectorRight = Utils.cannonVector(right.clone().multiplyScalar(airSpinAcceleration * (airSpinInfluence))); + + // Right + if (this.actions.right.isPressed && !this.actions.left.isPressed) { + if (angVel.dot(spinVectorForward) < maxAirSpinMagnitude) { + angVel.vadd(effectiveSpinVectorForward, angVel); + } + } else + // Left + if (this.actions.left.isPressed && !this.actions.right.isPressed) { + if (angVel.dot(spinVectorForward) > -maxAirSpinMagnitude) { + angVel.vsub(effectiveSpinVectorForward, angVel); + } + } + + // Forwards + if (this.canTiltForwards && this.actions.throttle.isPressed && !this.actions.reverse.isPressed) { + if (angVel.dot(spinVectorRight) < maxAirSpinMagnitude) { + angVel.vadd(effectiveSpinVectorRight, angVel); + } + } else + // Backwards + if (this.actions.reverse.isPressed && !this.actions.throttle.isPressed) { + if (angVel.dot(spinVectorRight) > -maxAirSpinMagnitude) { + angVel.vsub(effectiveSpinVectorRight, angVel); + } + } + + // Steering + const velocity = new CANNON.Vec3().copy(this.collision.velocity); + velocity.normalize(); + let driftCorrection = Utils.getSignedAngleBetweenVectors(Utils.threeVector(velocity), forward); + + const maxSteerVal = 0.8; + let speedFactor = THREE.MathUtils.clamp(this.speed * 0.3, 1, Number.MAX_VALUE); + + if (this.actions.right.isPressed) + { + let steering = Math.min(-maxSteerVal / speedFactor, -driftCorrection); + this.steeringSimulator.target = THREE.MathUtils.clamp(steering, -maxSteerVal, maxSteerVal); + } + else if (this.actions.left.isPressed) + { + let steering = Math.max(maxSteerVal / speedFactor, -driftCorrection); + this.steeringSimulator.target = THREE.MathUtils.clamp(steering, -maxSteerVal, maxSteerVal); + } + else this.steeringSimulator.target = 0; + + // Update doors + this.seats.forEach((seat) => { + seat.door?.preStepCallback(); + }); + } + + public onInputChange(): void { + super.onInputChange(); + + const brakeForce = 1000000; + + if (this.actions.exitVehicle.justPressed) + { + this.characterWantsToExit = true; + } + if (this.actions.exitVehicle.justReleased) + { + this.characterWantsToExit = false; + this.triggerAction('brake', false); + } + if (this.actions.throttle.justReleased || this.actions.reverse.justReleased) + { + this.applyEngineForce(0); + } + if (this.actions.brake.justPressed) + { + this.setBrake(brakeForce, 'rwd'); + } + if (this.actions.brake.justReleased) + { + this.setBrake(0, 'rwd'); + } + if (this.actions.view.justPressed) + { + this.toggleFirstPersonView(); + } + } + + public inputReceiverInit(): void + { + super.inputReceiverInit(); + + this.world.updateControls([ + { + keys: ['W', 'S'], + desc: 'Accelerate, Brake / Reverse' + }, + { + keys: ['A', 'D'], + desc: 'Steering' + }, + { + keys: ['Space'], + desc: 'Handbrake' + }, + { + keys: ['V'], + desc: 'View select' + }, + { + keys: ['F'], + desc: 'Exit vehicle' + }, + { + keys: ['Shift', '+', 'R'], + desc: 'Respawn' + }, + { + keys: ['Shift', '+', 'C'], + desc: 'Free camera' + }, + ]); + } + + public readCarData(gltf: any): void + { + gltf.scene.traverse((child: THREE.Object3D) => { + if (child.hasOwnProperty('userData')) + { + if (child.userData.hasOwnProperty('data')) + { + if (child.userData.data === 'steering_wheel') + { + this.steeringWheel = child; + } + } + } + }); + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/vehicles/Helicopter.ts b/Sketchbook-master/Sketchbook-master/src/ts/vehicles/Helicopter.ts new file mode 100644 index 00000000..96ca5905 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/vehicles/Helicopter.ts @@ -0,0 +1,252 @@ +import * as THREE from 'three'; +import * as CANNON from 'cannon'; +import * as Utils from '../core/FunctionLibrary'; + +import { Vehicle } from './Vehicle'; +import { IControllable } from '../interfaces/IControllable'; +import { IWorldEntity } from '../interfaces/IWorldEntity'; +import { KeyBinding } from '../core/KeyBinding'; +import { World } from '../world/World'; +import { EntityType } from '../enums/EntityType'; + +export class Helicopter extends Vehicle implements IControllable, IWorldEntity +{ + public entityType: EntityType = EntityType.Helicopter; + public rotors: THREE.Object3D[] = []; + private enginePower: number = 0; + + constructor(gltf: any) + { + super(gltf); + + this.readHelicopterData(gltf); + + this.collision.preStep = (body: CANNON.Body) => { this.physicsPreStep(body, this); }; + + this.actions = { + 'ascend': new KeyBinding('ShiftLeft'), + 'descend': new KeyBinding('Space'), + 'pitchUp': new KeyBinding('KeyS'), + 'pitchDown': new KeyBinding('KeyW'), + 'yawLeft': new KeyBinding('KeyQ'), + 'yawRight': new KeyBinding('KeyE'), + 'rollLeft': new KeyBinding('KeyA'), + 'rollRight': new KeyBinding('KeyD'), + 'exitVehicle': new KeyBinding('KeyF'), + 'seat_switch': new KeyBinding('KeyX'), + 'view': new KeyBinding('KeyV'), + }; + } + + public noDirectionPressed(): boolean + { + let result = + !this.actions.ascend.isPressed && + !this.actions.descend.isPressed; + + return result; + } + + public update(timeStep: number): void + { + super.update(timeStep); + + // Rotors visuals + if (this.controllingCharacter !== undefined) + { + if (this.enginePower < 1) this.enginePower += timeStep * 0.2; + if (this.enginePower > 1) this.enginePower = 1; + } + else + { + if (this.enginePower > 0) this.enginePower -= timeStep * 0.06; + if (this.enginePower < 0) this.enginePower = 0; + } + + this.rotors.forEach((rotor) => + { + rotor.rotateX(this.enginePower * timeStep * 30); + }); + } + + public onInputChange(): void + { + super.onInputChange(); + + if (this.actions.exitVehicle.justPressed && this.controllingCharacter !== undefined) + { + this.forceCharacterOut(); + } + if (this.actions.view.justPressed) + { + this.toggleFirstPersonView(); + } + } + + public physicsPreStep(body: CANNON.Body, heli: Helicopter): void + { + let quat = Utils.threeQuat(body.quaternion); + let right = new THREE.Vector3(1, 0, 0).applyQuaternion(quat); + let globalUp = new THREE.Vector3(0, 1, 0); + let up = new THREE.Vector3(0, 1, 0).applyQuaternion(quat); + let forward = new THREE.Vector3(0, 0, 1).applyQuaternion(quat); + + // Throttle + if (heli.actions.ascend.isPressed) + { + body.velocity.x += up.x * 0.15 * this.enginePower; + body.velocity.y += up.y * 0.15 * this.enginePower; + body.velocity.z += up.z * 0.15 * this.enginePower; + } + if (heli.actions.descend.isPressed) + { + body.velocity.x -= up.x * 0.15 * this.enginePower; + body.velocity.y -= up.y * 0.15 * this.enginePower; + body.velocity.z -= up.z * 0.15 * this.enginePower; + } + + // Vertical stabilization + let gravity = heli.world.physicsWorld.gravity; + let gravityCompensation = new CANNON.Vec3(-gravity.x, -gravity.y, -gravity.z).length(); + gravityCompensation *= heli.world.physicsFrameTime; + gravityCompensation *= 0.98; + let dot = globalUp.dot(up); + gravityCompensation *= Math.sqrt(THREE.MathUtils.clamp(dot, 0, 1)); + + let vertDamping = new THREE.Vector3(0, body.velocity.y, 0).multiplyScalar(-0.01); + let vertStab = up.clone(); + vertStab.multiplyScalar(gravityCompensation); + vertStab.add(vertDamping); + vertStab.multiplyScalar(heli.enginePower); + + body.velocity.x += vertStab.x; + body.velocity.y += vertStab.y; + body.velocity.z += vertStab.z; + + // Positional damping + body.velocity.x *= THREE.MathUtils.lerp(1, 0.995, this.enginePower); + body.velocity.z *= THREE.MathUtils.lerp(1, 0.995, this.enginePower); + + // Rotation stabilization + if (this.controllingCharacter !== undefined) + { + let rotStabVelocity = new THREE.Quaternion().setFromUnitVectors(up, globalUp); + rotStabVelocity.x *= 0.3; + rotStabVelocity.y *= 0.3; + rotStabVelocity.z *= 0.3; + rotStabVelocity.w *= 0.3; + let rotStabEuler = new THREE.Euler().setFromQuaternion(rotStabVelocity); + + body.angularVelocity.x += rotStabEuler.x * this.enginePower; + body.angularVelocity.y += rotStabEuler.y * this.enginePower; + body.angularVelocity.z += rotStabEuler.z * this.enginePower; + } + + // Pitch + if (heli.actions.pitchUp.isPressed) + { + body.angularVelocity.x -= right.x * 0.07 * this.enginePower; + body.angularVelocity.y -= right.y * 0.07 * this.enginePower; + body.angularVelocity.z -= right.z * 0.07 * this.enginePower; + } + if (heli.actions.pitchDown.isPressed) + { + body.angularVelocity.x += right.x * 0.07 * this.enginePower; + body.angularVelocity.y += right.y * 0.07 * this.enginePower; + body.angularVelocity.z += right.z * 0.07 * this.enginePower; + } + + // Yaw + if (heli.actions.yawLeft.isPressed) + { + body.angularVelocity.x += up.x * 0.07 * this.enginePower; + body.angularVelocity.y += up.y * 0.07 * this.enginePower; + body.angularVelocity.z += up.z * 0.07 * this.enginePower; + } + if (heli.actions.yawRight.isPressed) + { + body.angularVelocity.x -= up.x * 0.07 * this.enginePower; + body.angularVelocity.y -= up.y * 0.07 * this.enginePower; + body.angularVelocity.z -= up.z * 0.07 * this.enginePower; + } + + // Roll + if (heli.actions.rollLeft.isPressed) + { + body.angularVelocity.x -= forward.x * 0.07 * this.enginePower; + body.angularVelocity.y -= forward.y * 0.07 * this.enginePower; + body.angularVelocity.z -= forward.z * 0.07 * this.enginePower; + } + if (heli.actions.rollRight.isPressed) + { + body.angularVelocity.x += forward.x * 0.07 * this.enginePower; + body.angularVelocity.y += forward.y * 0.07 * this.enginePower; + body.angularVelocity.z += forward.z * 0.07 * this.enginePower; + } + + // Angular damping + body.angularVelocity.x *= 0.97; + body.angularVelocity.y *= 0.97; + body.angularVelocity.z *= 0.97; + } + + public readHelicopterData(gltf: any): void + { + gltf.scene.traverse((child) => { + if (child.hasOwnProperty('userData')) + { + if (child.userData.hasOwnProperty('data')) + { + if (child.userData.data === 'rotor') + { + this.rotors.push(child); + } + } + } + }); + } + + public inputReceiverInit(): void + { + super.inputReceiverInit(); + + this.world.updateControls([ + { + keys: ['Shift'], + desc: 'Ascend' + }, + { + keys: ['Space'], + desc: 'Descend' + }, + { + keys: ['W', 'S'], + desc: 'Pitch' + }, + { + keys: ['Q', 'E'], + desc: 'Yaw' + }, + { + keys: ['A', 'D'], + desc: 'Roll' + }, + { + keys: ['V'], + desc: 'View select' + }, + { + keys: ['F'], + desc: 'Exit vehicle' + }, + { + keys: ['Shift', '+', 'R'], + desc: 'Respawn' + }, + { + keys: ['Shift', '+', 'C'], + desc: 'Free camera' + }, + ]); + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/vehicles/Vehicle.ts b/Sketchbook-master/Sketchbook-master/src/ts/vehicles/Vehicle.ts new file mode 100644 index 00000000..2cfc8a8b --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/vehicles/Vehicle.ts @@ -0,0 +1,467 @@ +import { Character } from '../characters/Character'; +import * as THREE from 'three'; +import * as CANNON from 'cannon'; +import { World } from '../world/World'; +import _ = require('lodash'); +import { KeyBinding } from '../core/KeyBinding'; +import { VehicleSeat } from './VehicleSeat'; +import { Wheel } from './Wheel'; +import { VehicleDoor } from './VehicleDoor'; +import * as Utils from '../core/FunctionLibrary'; +import { CollisionGroups } from '../enums/CollisionGroups'; +import { SwitchingSeats } from '../characters/character_states/vehicles/SwitchingSeats'; +import { EntityType } from '../enums/EntityType'; +import { IWorldEntity } from '../interfaces/IWorldEntity'; + +export abstract class Vehicle extends THREE.Object3D implements IWorldEntity +{ + public updateOrder: number = 2; + public abstract entityType: EntityType; + + public controllingCharacter: Character; + public actions: { [action: string]: KeyBinding; } = {}; + public rayCastVehicle: CANNON.RaycastVehicle; + public seats: VehicleSeat[] = []; + public wheels: Wheel[] = []; + public drive: string; + public camera: any; + public world: World; + public help: THREE.AxesHelper; + public collision: CANNON.Body; + public materials: THREE.Material[] = []; + public spawnPoint: THREE.Object3D; + private modelContainer: THREE.Group; + + private firstPerson: boolean = false; + + constructor(gltf: any, handlingSetup?: any) + { + super(); + + if (handlingSetup === undefined) handlingSetup = {}; + handlingSetup.chassisConnectionPointLocal = new CANNON.Vec3(), + handlingSetup.axleLocal = new CANNON.Vec3(-1, 0, 0); + handlingSetup.directionLocal = new CANNON.Vec3(0, -1, 0); + + // Physics mat + let mat = new CANNON.Material('Mat'); + mat.friction = 0.01; + + // Collision body + this.collision = new CANNON.Body({ mass: 50 }); + this.collision.material = mat; + + // Read GLTF + this.readVehicleData(gltf); + + this.modelContainer = new THREE.Group(); + this.add(this.modelContainer); + this.modelContainer.add(gltf.scene); + // this.setModel(gltf.scene); + + // Raycast vehicle component + this.rayCastVehicle = new CANNON.RaycastVehicle({ + chassisBody: this.collision, + indexUpAxis: 1, + indexRightAxis: 0, + indexForwardAxis: 2 + }); + + this.wheels.forEach((wheel) => + { + handlingSetup.chassisConnectionPointLocal.set(wheel.position.x, wheel.position.y + 0.2, wheel.position.z); + const index = this.rayCastVehicle.addWheel(handlingSetup); + wheel.rayCastWheelInfoIndex = index; + }); + + this.help = new THREE.AxesHelper(2); + } + + public noDirectionPressed(): boolean + { + return true; + } + + public update(timeStep: number): void + { + this.position.set( + this.collision.interpolatedPosition.x, + this.collision.interpolatedPosition.y, + this.collision.interpolatedPosition.z + ); + + this.quaternion.set( + this.collision.interpolatedQuaternion.x, + this.collision.interpolatedQuaternion.y, + this.collision.interpolatedQuaternion.z, + this.collision.interpolatedQuaternion.w + ); + + this.seats.forEach((seat: VehicleSeat) => { + seat.update(timeStep); + }); + + for (let i = 0; i < this.rayCastVehicle.wheelInfos.length; i++) + { + this.rayCastVehicle.updateWheelTransform(i); + let transform = this.rayCastVehicle.wheelInfos[i].worldTransform; + + let wheelObject = this.wheels[i].wheelObject; + wheelObject.position.copy(Utils.threeVector(transform.position)); + wheelObject.quaternion.copy(Utils.threeQuat(transform.quaternion)); + + let upAxisWorld = new CANNON.Vec3(); + this.rayCastVehicle.getVehicleAxisWorld(this.rayCastVehicle.indexUpAxis, upAxisWorld); + } + + this.updateMatrixWorld(); + } + + public forceCharacterOut(): void + { + this.controllingCharacter.modelContainer.visible = true; + this.controllingCharacter.exitVehicle(); + } + + public onInputChange(): void + { + if (this.actions.seat_switch.justPressed && this.controllingCharacter?.occupyingSeat?.connectedSeats.length > 0) + { + this.controllingCharacter.modelContainer.visible = true; + this.controllingCharacter.setState( + new SwitchingSeats( + this.controllingCharacter, + this.controllingCharacter.occupyingSeat, + this.controllingCharacter.occupyingSeat.connectedSeats[0] + ) + ); + this.controllingCharacter.stopControllingVehicle(); + } + } + + public resetControls(): void + { + for (const action in this.actions) { + if (this.actions.hasOwnProperty(action)) { + this.triggerAction(action, false); + } + } + } + + public allowSleep(value: boolean): void + { + this.collision.allowSleep = value; + + if (value === false) + { + this.collision.wakeUp(); + } + } + + public handleKeyboardEvent(event: KeyboardEvent, code: string, pressed: boolean): void + { + // Free camera + if (code === 'KeyC' && pressed === true && event.shiftKey === true) + { + this.resetControls(); + this.world.cameraOperator.characterCaller = this.controllingCharacter; + this.world.inputManager.setInputReceiver(this.world.cameraOperator); + } + else if (code === 'KeyR' && pressed === true && event.shiftKey === true) + { + this.world.restartScenario(); + } + else + { + for (const action in this.actions) { + if (this.actions.hasOwnProperty(action)) { + const binding = this.actions[action]; + + if (_.includes(binding.eventCodes, code)) + { + this.triggerAction(action, pressed); + } + } + } + } + } + + public setFirstPersonView(value: boolean): void + { + this.firstPerson = value; + if (this.controllingCharacter !== undefined) this.controllingCharacter.modelContainer.visible = !value; + + if (value) + { + this.world.cameraOperator.setRadius(0, true); + } + else + { + this.world.cameraOperator.setRadius(3, true); + } + } + + public toggleFirstPersonView(): void + { + this.setFirstPersonView(!this.firstPerson); + } + + public triggerAction(actionName: string, value: boolean): void + { + // Get action and set it's parameters + let action = this.actions[actionName]; + + if (action.isPressed !== value) + { + // Set value + action.isPressed = value; + + // Reset the 'just' attributes + action.justPressed = false; + action.justReleased = false; + + // Set the 'just' attributes + if (value) action.justPressed = true; + else action.justReleased = true; + + this.onInputChange(); + + // Reset the 'just' attributes + action.justPressed = false; + action.justReleased = false; + } + } + + public handleMouseButton(event: MouseEvent, code: string, pressed: boolean): void + { + return; + } + + public handleMouseMove(event: MouseEvent, deltaX: number, deltaY: number): void + { + this.world.cameraOperator.move(deltaX, deltaY); + } + + public handleMouseWheel(event: WheelEvent, value: number): void + { + this.world.scrollTheTimeScale(value); + } + + public inputReceiverInit(): void + { + this.collision.allowSleep = false; + this.setFirstPersonView(false); + } + + public inputReceiverUpdate(timeStep: number): void + { + if (this.firstPerson) + { + // this.world.cameraOperator.target.set( + // this.position.x + this.camera.position.x, + // this.position.y + this.camera.position.y, + // this.position.z + this.camera.position.z + // ); + + let temp = new THREE.Vector3().copy(this.camera.position); + temp.applyQuaternion(this.quaternion); + this.world.cameraOperator.target.copy(temp.add(this.position)); + } + else + { + // Position camera + this.world.cameraOperator.target.set( + this.position.x, + this.position.y + 0.5, + this.position.z + ); + } + } + + public setPosition(x: number, y: number, z: number): void + { + this.collision.position.x = x; + this.collision.position.y = y; + this.collision.position.z = z; + } + + public setSteeringValue(val: number): void + { + this.wheels.forEach((wheel) => + { + if (wheel.steering) this.rayCastVehicle.setSteeringValue(val, wheel.rayCastWheelInfoIndex); + }); + } + + public applyEngineForce(force: number): void + { + this.wheels.forEach((wheel) => + { + if (this.drive === wheel.drive || this.drive === 'awd') + { + this.rayCastVehicle.applyEngineForce(force, wheel.rayCastWheelInfoIndex); + } + }); + } + + public setBrake(brakeForce: number, driveFilter?: string): void + { + this.wheels.forEach((wheel) => + { + if (driveFilter === undefined || driveFilter === wheel.drive) + { + this.rayCastVehicle.setBrake(brakeForce, wheel.rayCastWheelInfoIndex); + } + }); + } + + public addToWorld(world: World): void + { + if (_.includes(world.vehicles, this)) + { + console.warn('Adding character to a world in which it already exists.'); + } + else if (this.rayCastVehicle === undefined) + { + console.error('Trying to create vehicle without raycastVehicleComponent'); + } + else + { + this.world = world; + world.vehicles.push(this); + world.graphicsWorld.add(this); + // world.physicsWorld.addBody(this.collision); + this.rayCastVehicle.addToWorld(world.physicsWorld); + + this.wheels.forEach((wheel) => + { + world.graphicsWorld.attach(wheel.wheelObject); + }); + + this.materials.forEach((mat) => + { + world.sky.csm.setupMaterial(mat); + }); + } + } + + public removeFromWorld(world: World): void + { + if (!_.includes(world.vehicles, this)) + { + console.warn('Removing character from a world in which it isn\'t present.'); + } + else + { + this.world = undefined; + _.pull(world.vehicles, this); + world.graphicsWorld.remove(this); + // world.physicsWorld.remove(this.collision); + this.rayCastVehicle.removeFromWorld(world.physicsWorld); + + this.wheels.forEach((wheel) => + { + world.graphicsWorld.remove(wheel.wheelObject); + }); + } + } + + public readVehicleData(gltf: any): void + { + gltf.scene.traverse((child) => { + + if (child.isMesh) + { + Utils.setupMeshProperties(child); + + if (child.material !== undefined) + { + this.materials.push(child.material); + } + } + + if (child.hasOwnProperty('userData')) + { + if (child.userData.hasOwnProperty('data')) + { + if (child.userData.data === 'seat') + { + this.seats.push(new VehicleSeat(this, child, gltf)); + } + if (child.userData.data === 'camera') + { + this.camera = child; + } + if (child.userData.data === 'wheel') + { + this.wheels.push(new Wheel(child)); + } + if (child.userData.data === 'collision') + { + if (child.userData.shape === 'box') + { + child.visible = false; + + let phys = new CANNON.Box(new CANNON.Vec3(child.scale.x, child.scale.y, child.scale.z)); + phys.collisionFilterMask = ~CollisionGroups.TrimeshColliders; + this.collision.addShape(phys, new CANNON.Vec3(child.position.x, child.position.y, child.position.z)); + } + else if (child.userData.shape === 'sphere') + { + child.visible = false; + + let phys = new CANNON.Sphere(child.scale.x); + phys.collisionFilterGroup = CollisionGroups.TrimeshColliders; + this.collision.addShape(phys, new CANNON.Vec3(child.position.x, child.position.y, child.position.z)); + } + } + if (child.userData.data === 'navmesh') + { + child.visible = false; + } + } + } + }); + + if (this.collision.shapes.length === 0) + { + console.warn('Vehicle ' + typeof(this) + ' has no collision data.'); + } + if (this.seats.length === 0) + { + console.warn('Vehicle ' + typeof(this) + ' has no seats.'); + } + else + { + this.connectSeats(); + } + } + + private connectSeats(): void + { + for (const firstSeat of this.seats) + { + if (firstSeat.connectedSeatsString !== undefined) + { + // Get list of connected seat names + let conn_seat_names = firstSeat.connectedSeatsString.split(';'); + for (const conn_seat_name of conn_seat_names) + { + // If name not empty + if (conn_seat_name.length > 0) + { + // Run through seat list and connect seats to this seat, + // based on this seat's connected seats list + for (const secondSeat of this.seats) + { + if (secondSeat.seatPointObject.name === conn_seat_name) + { + firstSeat.connectedSeats.push(secondSeat); + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/vehicles/VehicleDoor.ts b/Sketchbook-master/Sketchbook-master/src/ts/vehicles/VehicleDoor.ts new file mode 100644 index 00000000..355cb4aa --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/vehicles/VehicleDoor.ts @@ -0,0 +1,159 @@ +import * as THREE from 'three'; +import * as CANNON from 'cannon'; +import { Vehicle } from './Vehicle'; +import * as Utils from '../core/FunctionLibrary'; +import { VehicleSeat } from './VehicleSeat'; +import { Side } from '../enums/Side'; + +export class VehicleDoor +{ + public vehicle: Vehicle; + public seat: VehicleSeat; + public doorObject: THREE.Object3D; + public doorVelocity: number = 0; + public doorWorldPos: THREE.Vector3 = new THREE.Vector3(); + public lastTrailerPos: THREE.Vector3 = new THREE.Vector3(); + public lastTrailerVel: THREE.Vector3 = new THREE.Vector3(); + + public rotation: number = 0; + public achievingTargetRotation: boolean = false; + public physicsEnabled: boolean = false; + public targetRotation: number = 0; + public rotationSpeed: number = 5; + + public lastVehicleVel: THREE.Vector3 = new THREE.Vector3(); + public lastVehiclePos: THREE.Vector3 = new THREE.Vector3(); + + private sideMultiplier: number; + + constructor(seat: VehicleSeat, object: THREE.Object3D) + { + this.seat = seat; + this.vehicle = seat.vehicle as unknown as Vehicle; + this.doorObject = object; + + const side = Utils.detectRelativeSide(this.seat.seatPointObject, this.doorObject); + if (side === Side.Left) this.sideMultiplier = -1; + else if (side === Side.Right) this.sideMultiplier = 1; + else this.sideMultiplier = 0; + } + + public update(timestep: number): void + { + if (this.achievingTargetRotation) + { + if (this.rotation < this.targetRotation) + { + this.rotation += timestep * this.rotationSpeed; + + if (this.rotation > this.targetRotation) + { + this.rotation = this.targetRotation; + // this.resetPhysTrailer(); + this.achievingTargetRotation = false; + this.physicsEnabled = true; + } + } + else if (this.rotation > this.targetRotation) + { + this.rotation -= timestep * this.rotationSpeed; + + if (this.rotation < this.targetRotation) + { + this.rotation = this.targetRotation; + // this.resetPhysTrailer(); + this.achievingTargetRotation = false; + this.physicsEnabled = false; + } + } + } + + this.doorObject.setRotationFromEuler(new THREE.Euler(0, this.sideMultiplier * this.rotation, 0)); + } + + public preStepCallback(): void + { + if (this.physicsEnabled && !this.achievingTargetRotation) + { + // Door world position + this.doorObject.getWorldPosition(this.doorWorldPos); + + // Get acceleration + let vehicleVel = Utils.threeVector(this.vehicle.rayCastVehicle.chassisBody.velocity); + let vehicleVelDiff = vehicleVel.clone().sub(this.lastVehicleVel); + + // Get vectors + const quat = Utils.threeQuat(this.vehicle.rayCastVehicle.chassisBody.quaternion); + const back = new THREE.Vector3(0, 0, -1).applyQuaternion(quat); + const up = new THREE.Vector3(0, 1, 0).applyQuaternion(quat); + + // Get imaginary positions + let trailerPos = back.clone().applyAxisAngle(up, this.sideMultiplier * this.rotation).add(this.doorWorldPos); + let trailerPushedPos = trailerPos.clone().sub(vehicleVelDiff); + + // Update last values + this.lastVehicleVel.copy(vehicleVel); + this.lastTrailerPos.copy(trailerPos); + + // Measure angle difference + let v1 = trailerPos.clone().sub(this.doorWorldPos).normalize(); + let v2 = trailerPushedPos.clone().sub(this.doorWorldPos).normalize(); + let angle = Utils.getSignedAngleBetweenVectors(v1, v2, up); + + // Apply door velocity + this.doorVelocity += this.sideMultiplier * angle * 0.05; + this.rotation += this.doorVelocity; + + // Bounce door when it reaches rotation limit + if (this.rotation < 0) + { + this.rotation = 0; + + if (this.doorVelocity < -0.08) + { + this.close(); + this.doorVelocity = 0; + } + else + { + this.doorVelocity = -this.doorVelocity / 2; + } + } + if (this.rotation > 1) + { + this.rotation = 1; + this.doorVelocity = -this.doorVelocity / 2; + } + + // Damping + this.doorVelocity = this.doorVelocity * 0.98; + } + } + + public open(): void + { + // this.resetPhysTrailer(); + this.achievingTargetRotation = true; + this.targetRotation = 1; + } + + public close(): void + { + this.achievingTargetRotation = true; + this.targetRotation = 0; + } + + public resetPhysTrailer(): void + { + // Door world position + this.doorObject.getWorldPosition(this.doorWorldPos); + + // Get acceleration + this.lastVehicleVel = new THREE.Vector3(); + + // Get vectors + const quat = Utils.threeQuat(this.vehicle.rayCastVehicle.chassisBody.quaternion); + const back = new THREE.Vector3(0, 0, -1).applyQuaternion(quat); + this.lastTrailerPos.copy(back.add(this.doorWorldPos)); + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/vehicles/VehicleSeat.ts b/Sketchbook-master/Sketchbook-master/src/ts/vehicles/VehicleSeat.ts new file mode 100644 index 00000000..7c19908e --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/vehicles/VehicleSeat.ts @@ -0,0 +1,77 @@ +import * as THREE from 'three'; +import { SeatType } from '../enums/SeatType'; +import { Side } from '../enums/Side'; +import { IControllable } from '../interfaces/IControllable'; +import { VehicleDoor } from './VehicleDoor'; +import { Vehicle } from './Vehicle'; +import { Character } from '../characters/Character'; + +export class VehicleSeat +{ + public vehicle: IControllable; + public seatPointObject: THREE.Object3D; + + // String of names of connected seats + public connectedSeatsString: string; + // Actual seatPoint objects, need to be identified + // by parsing connectedSeatsString *after* all seats are imported + public connectedSeats: VehicleSeat[] = []; + + public type: SeatType; + public entryPoints: THREE.Object3D[] = []; + public door: VehicleDoor; + + public occupiedBy: Character = null; + + constructor(vehicle: IControllable, object: THREE.Object3D, gltf: any) + { + this.vehicle = vehicle; + this.seatPointObject = object; + + if (object.hasOwnProperty('userData') && object.userData.hasOwnProperty('data')) + { + if (object.userData.hasOwnProperty('door_object')) + { + this.door = new VehicleDoor(this, gltf.scene.getObjectByName(object.userData.door_object)); + } + + if (object.userData.hasOwnProperty('entry_points')) + { + let entry_points = (object.userData.entry_points as string).split(';'); + for (const entry_point of entry_points) + { + if (entry_point.length > 0) + { + this.entryPoints.push(gltf.scene.getObjectByName(entry_point)); + } + } + } + else + { + console.error('Seat object ' + object + ' has no entry point reference property.'); + } + + if (object.userData.hasOwnProperty('seat_type')) + { + this.type = object.userData.seat_type; + } + else + { + console.error('Seat object ' + object + ' has no seat type property.'); + } + + if (object.userData.hasOwnProperty('connected_seats')) + { + this.connectedSeatsString = object.userData.connected_seats; + } + } + } + + public update(timeStep: number): void + { + if (this.door !== undefined) + { + this.door.update(timeStep); + } + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/vehicles/Wheel.ts b/Sketchbook-master/Sketchbook-master/src/ts/vehicles/Wheel.ts new file mode 100644 index 00000000..05e110c6 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/vehicles/Wheel.ts @@ -0,0 +1,30 @@ +import { WheelInfo } from 'cannon'; + +export class Wheel +{ + public wheelObject: THREE.Object3D; + public position: THREE.Vector3; + public steering: boolean = false; + public drive: string; // Drive type "fwd" or "rwd" + public rayCastWheelInfoIndex: number; // Linked to a raycast vehicle WheelInfo structure + + constructor(wheelObject: THREE.Object3D) + { + this.wheelObject = wheelObject; + + this.position = wheelObject.position; + + if (wheelObject.hasOwnProperty('userData') && wheelObject.userData.hasOwnProperty('data')) + { + if (wheelObject.userData.hasOwnProperty('steering')) + { + this.steering = (wheelObject.userData.steering === 'true'); + } + + if (wheelObject.userData.hasOwnProperty('drive')) + { + this.drive = wheelObject.userData.drive; + } + } + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/world/CharacterSpawnPoint.ts b/Sketchbook-master/Sketchbook-master/src/ts/world/CharacterSpawnPoint.ts new file mode 100644 index 00000000..3d367730 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/world/CharacterSpawnPoint.ts @@ -0,0 +1,34 @@ +import { ISpawnPoint } from '../interfaces/ISpawnPoint'; +import * as THREE from 'three'; +import { World } from './World'; +import { Character } from '../characters/Character'; +import { LoadingManager } from '../core/LoadingManager'; +import * as Utils from '../core/FunctionLibrary'; + +export class CharacterSpawnPoint implements ISpawnPoint +{ + private object: THREE.Object3D; + + constructor(object: THREE.Object3D) + { + this.object = object; + } + + public spawn(loadingManager: LoadingManager, world: World): void + { + loadingManager.loadGLTF('build/assets/boxman.glb', (model) => + { + let player = new Character(model); + + let worldPos = new THREE.Vector3(); + this.object.getWorldPosition(worldPos); + player.setPosition(worldPos.x, worldPos.y, worldPos.z); + + let forward = Utils.getForward(this.object); + player.setOrientation(forward, true); + + world.add(player); + player.takeControl(); + }); + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/world/Ocean.ts b/Sketchbook-master/Sketchbook-master/src/ts/world/Ocean.ts new file mode 100644 index 00000000..00f356a7 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/world/Ocean.ts @@ -0,0 +1,38 @@ +import * as THREE from 'three'; + +import { World } from './World'; +import { WaterShader } from '../../lib/shaders/WaterShader'; +import { IUpdatable } from '../interfaces/IUpdatable'; + +export class Ocean implements IUpdatable +{ + public updateOrder: number = 10; + public material: THREE.ShaderMaterial; + + private world: World; + + constructor(object: any, world: World) + { + this.world = world; + + let uniforms = THREE.UniformsUtils.clone(WaterShader.uniforms); + uniforms.iResolution.value.x = window.innerWidth; + uniforms.iResolution.value.y = window.innerHeight; + + this.material = new THREE.ShaderMaterial({ + uniforms: uniforms, + fragmentShader: WaterShader.fragmentShader, + vertexShader: WaterShader.vertexShader, + }); + + object.material = this.material; + object.material.transparent = true; + } + + public update(timeStep: number): void + { + this.material.uniforms.cameraPos.value.copy(this.world.camera.position); + this.material.uniforms.lightDir.value.copy(new THREE.Vector3().copy(this.world.sky.sunPosition).normalize()); + this.material.uniforms.iGlobalTime.value += timeStep; + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/world/Path.ts b/Sketchbook-master/Sketchbook-master/src/ts/world/Path.ts new file mode 100644 index 00000000..0f1e125a --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/world/Path.ts @@ -0,0 +1,43 @@ +import { PathNode } from './PathNode'; + +export class Path +{ + public nodes: {[nodeName: string]: PathNode} = {}; + private rootNode: THREE.Object3D; + + constructor(root: THREE.Object3D) + { + this.rootNode = root; + + this.rootNode.traverse((child) => { + this.addNode(child); + }); + + this.connectNodes(); + } + + public addNode(child: any): void + { + if (child.hasOwnProperty('userData') && child.userData.hasOwnProperty('data')) + { + if (child.userData.data === 'pathNode') + { + let node = new PathNode(child, this); + this.nodes[child.name] = node; + } + } + } + + public connectNodes(): void + { + for (const nodeName in this.nodes) + { + if (this.nodes.hasOwnProperty(nodeName)) + { + const node = this.nodes[nodeName]; + node.nextNode = this.nodes[node.object.userData.nextNode]; + node.previousNode = this.nodes[node.object.userData.previousNode]; + } + } + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/world/PathNode.ts b/Sketchbook-master/Sketchbook-master/src/ts/world/PathNode.ts new file mode 100644 index 00000000..b906d47b --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/world/PathNode.ts @@ -0,0 +1,16 @@ +import { Path } from './Path'; +import { Object3D } from 'three'; + +export class PathNode +{ + public object: Object3D; + public path: Path; + public nextNode: PathNode; + public previousNode: PathNode; + + constructor(child: THREE.Object3D, path: Path) + { + this.object = child; + this.path = path; + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/world/Scenario.ts b/Sketchbook-master/Sketchbook-master/src/ts/world/Scenario.ts new file mode 100644 index 00000000..772ceb4f --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/world/Scenario.ts @@ -0,0 +1,120 @@ +import { ISpawnPoint } from '../interfaces/ISpawnPoint'; +import { VehicleSpawnPoint } from './VehicleSpawnPoint'; +import { CharacterSpawnPoint } from './CharacterSpawnPoint'; +import { World } from '../world/World'; +import { LoadingManager } from '../core/LoadingManager'; + +export class Scenario +{ + public id: string; + public name: string; + public spawnAlways: boolean = false; + public default: boolean = false; + public world: World; + public descriptionTitle: string; + public descriptionContent: string; + + private rootNode: THREE.Object3D; + private spawnPoints: ISpawnPoint[] = []; + private invisible: boolean = false; + private initialCameraAngle: number; + + constructor(root: THREE.Object3D, world: World) + { + this.rootNode = root; + this.world = world; + this.id = root.name; + + // Scenario + if (root.userData.hasOwnProperty('name')) + { + this.name = root.userData.name; + } + if (root.userData.hasOwnProperty('default') && root.userData.default === 'true') + { + this.default = true; + } + if (root.userData.hasOwnProperty('spawn_always') && root.userData.spawn_always === 'true') + { + this.spawnAlways = true; + } + if (root.userData.hasOwnProperty('invisible') && root.userData.invisible === 'true') + { + this.invisible = true; + } + if (root.userData.hasOwnProperty('desc_title')) + { + this.descriptionTitle = root.userData.desc_title; + } + if (root.userData.hasOwnProperty('desc_content')) + { + this.descriptionContent = root.userData.desc_content; + } + if (root.userData.hasOwnProperty('camera_angle')) + { + this.initialCameraAngle = root.userData.camera_angle; + } + + if (!this.invisible) this.createLaunchLink(); + + // Find all scenario spawns and enitites + root.traverse((child) => { + if (child.hasOwnProperty('userData') && child.userData.hasOwnProperty('data')) + { + if (child.userData.data === 'spawn') + { + if (child.userData.type === 'car' || child.userData.type === 'airplane' || child.userData.type === 'heli') + { + let sp = new VehicleSpawnPoint(child); + + if (child.userData.hasOwnProperty('type')) + { + sp.type = child.userData.type; + } + + if (child.userData.hasOwnProperty('driver')) + { + sp.driver = child.userData.driver; + + if (child.userData.driver === 'ai' && child.userData.hasOwnProperty('first_node')) + { + sp.firstAINode = child.userData.first_node; + } + } + + this.spawnPoints.push(sp); + } + else if (child.userData.type === 'player') + { + let sp = new CharacterSpawnPoint(child); + this.spawnPoints.push(sp); + } + } + } + }); + } + + public createLaunchLink(): void + { + this.world.params[this.name] = () => + { + this.world.launchScenario(this.id); + }; + this.world.scenarioGUIFolder.add(this.world.params, this.name); + } + + public launch(loadingManager: LoadingManager, world: World): void + { + this.spawnPoints.forEach((sp) => { + sp.spawn(loadingManager, world); + }); + + if (!this.spawnAlways) + { + loadingManager.createWelcomeScreenCallback(this); + + world.cameraOperator.theta = this.initialCameraAngle; + world.cameraOperator.phi = 15; + } + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/world/Sky.ts b/Sketchbook-master/Sketchbook-master/src/ts/world/Sky.ts new file mode 100644 index 00000000..23c6e32d --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/world/Sky.ts @@ -0,0 +1,134 @@ +import { SkyShader } from '../../lib/shaders/SkyShader'; +import * as THREE from 'three'; +import { World } from './World'; +import { EntityType } from '../enums/EntityType'; +import { IUpdatable } from '../interfaces/IUpdatable'; +import { default as CSM } from 'three-csm'; + +export class Sky extends THREE.Object3D implements IUpdatable +{ + public updateOrder: number = 5; + + public sunPosition: THREE.Vector3 = new THREE.Vector3(); + public csm: CSM; + + set theta(value: number) { + this._theta = value; + this.refreshSunPosition(); + } + + set phi(value: number) { + this._phi = value; + this.refreshSunPosition(); + this.refreshHemiIntensity(); + } + + private _phi: number = 50; + private _theta: number = 145; + + private hemiLight: THREE.HemisphereLight; + private maxHemiIntensity: number = 0.9; + private minHemiIntensity: number = 0.3; + + private skyMesh: THREE.Mesh; + private skyMaterial: THREE.ShaderMaterial; + + private world: World; + + constructor(world: World) + { + super(); + + this.world = world; + + // Sky material + this.skyMaterial = new THREE.ShaderMaterial({ + uniforms: THREE.UniformsUtils.clone(SkyShader.uniforms), + fragmentShader: SkyShader.fragmentShader, + vertexShader: SkyShader.vertexShader, + side: THREE.BackSide + }); + + // Mesh + this.skyMesh = new THREE.Mesh( + new THREE.SphereBufferGeometry(1000, 24, 12), + this.skyMaterial + ); + this.attach(this.skyMesh); + + // Ambient light + this.hemiLight = new THREE.HemisphereLight( 0xffffff, 0xffffff, 1.0 ); + this.refreshHemiIntensity(); + this.hemiLight.color.setHSL( 0.59, 0.4, 0.6 ); + this.hemiLight.groundColor.setHSL( 0.095, 0.2, 0.75 ); + this.hemiLight.position.set( 0, 50, 0 ); + this.world.graphicsWorld.add( this.hemiLight ); + + // CSM + // New version + // let splitsCallback = (amount, near, far, target) => + // { + // for (let i = amount - 1; i >= 0; i--) + // { + // target.push(Math.pow(1 / 3, i)); + // } + // }; + + // Legacy + let splitsCallback = (amount, near, far) => + { + let arr = []; + + for (let i = amount - 1; i >= 0; i--) + { + arr.push(Math.pow(1 / 4, i)); + } + + return arr; + }; + + this.csm = new CSM({ + fov: 80, + far: 250, // maxFar + lightIntensity: 2.5, + cascades: 3, + shadowMapSize: 2048, + camera: world.camera, + parent: world.graphicsWorld, + mode: 'custom', + customSplitsCallback: splitsCallback + }); + this.csm.fade = true; + + this.refreshSunPosition(); + + world.graphicsWorld.add(this); + world.registerUpdatable(this); + } + + public update(timeScale: number): void + { + this.position.copy(this.world.camera.position); + this.refreshSunPosition(); + + this.csm.update(this.world.camera.matrix); + this.csm.lightDirection = new THREE.Vector3(-this.sunPosition.x, -this.sunPosition.y, -this.sunPosition.z).normalize(); + } + + public refreshSunPosition(): void + { + const sunDistance = 10; + + this.sunPosition.x = sunDistance * Math.sin(this._theta * Math.PI / 180) * Math.cos(this._phi * Math.PI / 180); + this.sunPosition.y = sunDistance * Math.sin(this._phi * Math.PI / 180); + this.sunPosition.z = sunDistance * Math.cos(this._theta * Math.PI / 180) * Math.cos(this._phi * Math.PI / 180); + + this.skyMaterial.uniforms.sunPosition.value.copy(this.sunPosition); + this.skyMaterial.uniforms.cameraPos.value.copy(this.world.camera.position); + } + + public refreshHemiIntensity(): void + { + this.hemiLight.intensity = this.minHemiIntensity + Math.pow(1 - (Math.abs(this._phi - 90) / 90), 0.25) * (this.maxHemiIntensity - this.minHemiIntensity); + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/world/VehicleSpawnPoint.ts b/Sketchbook-master/Sketchbook-master/src/ts/world/VehicleSpawnPoint.ts new file mode 100644 index 00000000..5cf03c45 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/world/VehicleSpawnPoint.ts @@ -0,0 +1,98 @@ +import * as THREE from 'three'; +import { ISpawnPoint } from '../interfaces/ISpawnPoint'; +import { World } from '../world/World'; +import { Helicopter } from '../vehicles/Helicopter'; +import { Airplane } from '../vehicles/Airplane'; +import { Car } from '../vehicles/Car'; +import * as Utils from '../core/FunctionLibrary'; +import { Vehicle } from '../vehicles/Vehicle'; +import { Character } from '../characters/Character'; +import { FollowPath } from '../characters/character_ai/FollowPath'; +import { LoadingManager } from '../core/LoadingManager'; +import { IWorldEntity } from '../interfaces/IWorldEntity'; + +export class VehicleSpawnPoint implements ISpawnPoint +{ + public type: string; + public driver: string; + public firstAINode: string; + + private object: THREE.Object3D; + + constructor(object: THREE.Object3D) + { + this.object = object; + } + + public spawn(loadingManager: LoadingManager, world: World): void + { + loadingManager.loadGLTF('build/assets/' + this.type + '.glb', (model: any) => + { + let vehicle: Vehicle = this.getNewVehicleByType(model, this.type); + vehicle.spawnPoint = this.object; + + let worldPos = new THREE.Vector3(); + let worldQuat = new THREE.Quaternion(); + this.object.getWorldPosition(worldPos); + this.object.getWorldQuaternion(worldQuat); + + vehicle.setPosition(worldPos.x, worldPos.y + 1, worldPos.z); + vehicle.collision.quaternion.copy(Utils.cannonQuat(worldQuat)); + world.add(vehicle); + + if (this.driver !== undefined) + { + loadingManager.loadGLTF('build/assets/boxman.glb', (charModel) => + { + let character = new Character(charModel); + world.add(character); + character.teleportToVehicle(vehicle, vehicle.seats[0]); + + if (this.driver === 'player') + { + character.takeControl(); + } + else if (this.driver === 'ai') + { + if (this.firstAINode !== undefined) + { + let nodeFound = false; + for (const pathName in world.paths) { + if (world.paths.hasOwnProperty(pathName)) { + const path = world.paths[pathName]; + + for (const nodeName in path.nodes) { + if (Object.prototype.hasOwnProperty.call(path.nodes, nodeName)) { + const node = path.nodes[nodeName]; + + if (node.object.name === this.firstAINode) + { + character.setBehaviour(new FollowPath(node, 10)); + nodeFound = true; + } + } + } + } + } + + if (!nodeFound) + { + console.error('Path node ' + this.firstAINode + 'not found.'); + } + } + } + }); + } + }); + } + + private getNewVehicleByType(model: any, type: string): Vehicle + { + switch (type) + { + case 'car': return new Car(model); + case 'heli': return new Helicopter(model); + case 'airplane': return new Airplane(model); + } + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/src/ts/world/World.ts b/Sketchbook-master/Sketchbook-master/src/ts/world/World.ts new file mode 100644 index 00000000..266b6a2b --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/src/ts/world/World.ts @@ -0,0 +1,621 @@ +import * as THREE from 'three'; +import * as CANNON from 'cannon'; +import Swal from 'sweetalert2'; +import * as $ from 'jquery'; + +import { CameraOperator } from '../core/CameraOperator'; +import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer'; +import { RenderPass } from 'three/examples/jsm/postprocessing/RenderPass'; +import { ShaderPass } from 'three/examples/jsm/postprocessing/ShaderPass'; +import { FXAAShader } from 'three/examples/jsm/shaders/FXAAShader'; + +import { Detector } from '../../lib/utils/Detector'; +import { Stats } from '../../lib/utils/Stats'; +import * as GUI from '../../lib/utils/dat.gui'; +import { CannonDebugRenderer } from '../../lib/cannon/CannonDebugRenderer'; +import * as _ from 'lodash'; + +import { InputManager } from '../core/InputManager'; +import * as Utils from '../core/FunctionLibrary'; +import { LoadingManager } from '../core/LoadingManager'; +import { InfoStack } from '../core/InfoStack'; +import { UIManager } from '../core/UIManager'; +import { IWorldEntity } from '../interfaces/IWorldEntity'; +import { IUpdatable } from '../interfaces/IUpdatable'; +import { Character } from '../characters/Character'; +import { Path } from './Path'; +import { CollisionGroups } from '../enums/CollisionGroups'; +import { BoxCollider } from '../physics/colliders/BoxCollider'; +import { TrimeshCollider } from '../physics/colliders/TrimeshCollider'; +import { Vehicle } from '../vehicles/Vehicle'; +import { Scenario } from './Scenario'; +import { Sky } from './Sky'; +import { Ocean } from './Ocean'; + +export class World +{ + public renderer: THREE.WebGLRenderer; + public camera: THREE.PerspectiveCamera; + public composer: any; + public stats: Stats; + public graphicsWorld: THREE.Scene; + public sky: Sky; + public physicsWorld: CANNON.World; + public parallelPairs: any[]; + public physicsFrameRate: number; + public physicsFrameTime: number; + public physicsMaxPrediction: number; + public clock: THREE.Clock; + public renderDelta: number; + public logicDelta: number; + public requestDelta: number; + public sinceLastFrame: number; + public justRendered: boolean; + public params: any; + public inputManager: InputManager; + public cameraOperator: CameraOperator; + public timeScaleTarget: number = 1; + public console: InfoStack; + public cannonDebugRenderer: CannonDebugRenderer; + public scenarios: Scenario[] = []; + public characters: Character[] = []; + public vehicles: Vehicle[] = []; + public paths: Path[] = []; + public scenarioGUIFolder: any; + public updatables: IUpdatable[] = []; + + private lastScenarioID: string; + + constructor(worldScenePath?: any) + { + const scope = this; + + // WebGL not supported + if (!Detector.webgl) + { + Swal.fire({ + icon: 'warning', + title: 'WebGL compatibility', + text: 'This browser doesn\'t seem to have the required WebGL capabilities. The application may not work correctly.', + footer: 'Click here for more information', + showConfirmButton: false, + buttonsStyling: false + }); + } + + // Renderer + this.renderer = new THREE.WebGLRenderer(); + this.renderer.setPixelRatio(window.devicePixelRatio); + this.renderer.setSize(window.innerWidth, window.innerHeight); + this.renderer.toneMapping = THREE.ACESFilmicToneMapping; + this.renderer.toneMappingExposure = 1.0; + this.renderer.shadowMap.enabled = true; + this.renderer.shadowMap.type = THREE.PCFSoftShadowMap; + + this.generateHTML(); + + // Auto window resize + function onWindowResize(): void + { + scope.camera.aspect = window.innerWidth / window.innerHeight; + scope.camera.updateProjectionMatrix(); + scope.renderer.setSize(window.innerWidth, window.innerHeight); + fxaaPass.uniforms['resolution'].value.set(1 / (window.innerWidth * pixelRatio), 1 / (window.innerHeight * pixelRatio)); + scope.composer.setSize(window.innerWidth * pixelRatio, window.innerHeight * pixelRatio); + } + window.addEventListener('resize', onWindowResize, false); + + // Three.js scene + this.graphicsWorld = new THREE.Scene(); + this.camera = new THREE.PerspectiveCamera(80, window.innerWidth / window.innerHeight, 0.1, 1010); + + // Passes + let renderPass = new RenderPass( this.graphicsWorld, this.camera ); + let fxaaPass = new ShaderPass( FXAAShader ); + + // FXAA + let pixelRatio = this.renderer.getPixelRatio(); + fxaaPass.material['uniforms'].resolution.value.x = 1 / ( window.innerWidth * pixelRatio ); + fxaaPass.material['uniforms'].resolution.value.y = 1 / ( window.innerHeight * pixelRatio ); + + // Composer + this.composer = new EffectComposer( this.renderer ); + this.composer.addPass( renderPass ); + this.composer.addPass( fxaaPass ); + + // Physics + this.physicsWorld = new CANNON.World(); + this.physicsWorld.gravity.set(0, -9.81, 0); + this.physicsWorld.broadphase = new CANNON.SAPBroadphase(this.physicsWorld); + this.physicsWorld.solver.iterations = 10; + this.physicsWorld.allowSleep = true; + + this.parallelPairs = []; + this.physicsFrameRate = 60; + this.physicsFrameTime = 1 / this.physicsFrameRate; + this.physicsMaxPrediction = this.physicsFrameRate; + + // RenderLoop + this.clock = new THREE.Clock(); + this.renderDelta = 0; + this.logicDelta = 0; + this.sinceLastFrame = 0; + this.justRendered = false; + + // Stats (FPS, Frame time, Memory) + this.stats = Stats(); + // Create right panel GUI + this.createParamsGUI(scope); + + // Initialization + this.inputManager = new InputManager(this, this.renderer.domElement); + this.cameraOperator = new CameraOperator(this, this.camera, this.params.Mouse_Sensitivity); + this.sky = new Sky(this); + + // Load scene if path is supplied + if (worldScenePath !== undefined) + { + let loadingManager = new LoadingManager(this); + loadingManager.onFinishedCallback = () => + { + this.update(1, 1); + this.setTimeScale(1); + + Swal.fire({ + title: 'Welcome to Sketchbook!', + text: 'Feel free to explore the world and interact with available vehicles. There are also various scenarios ready to launch from the right panel.', + footer: 'GitHub pageDiscord server', + confirmButtonText: 'Okay', + buttonsStyling: false, + onClose: () => { + UIManager.setUserInterfaceVisible(true); + } + }); + }; + loadingManager.loadGLTF(worldScenePath, (gltf) => + { + this.loadScene(loadingManager, gltf); + } + ); + } + else + { + UIManager.setUserInterfaceVisible(true); + UIManager.setLoadingScreenVisible(false); + Swal.fire({ + icon: 'success', + title: 'Hello world!', + text: 'Empty Sketchbook world was succesfully initialized. Enjoy the blueness of the sky.', + buttonsStyling: false + }); + } + + this.render(this); + } + + // Update + // Handles all logic updates. + public update(timeStep: number, unscaledTimeStep: number): void + { + this.updatePhysics(timeStep); + + // Update registred objects + this.updatables.forEach((entity) => { + entity.update(timeStep, unscaledTimeStep); + }); + + // Lerp time scale + this.params.Time_Scale = THREE.MathUtils.lerp(this.params.Time_Scale, this.timeScaleTarget, 0.2); + + // Physics debug + if (this.params.Debug_Physics) this.cannonDebugRenderer.update(); + } + + public updatePhysics(timeStep: number): void + { + // Step the physics world + this.physicsWorld.step(this.physicsFrameTime, timeStep); + + this.characters.forEach((char) => { + if (this.isOutOfBounds(char.characterCapsule.body.position)) + { + this.outOfBoundsRespawn(char.characterCapsule.body); + } + }); + + this.vehicles.forEach((vehicle) => { + if (this.isOutOfBounds(vehicle.rayCastVehicle.chassisBody.position)) + { + let worldPos = new THREE.Vector3(); + vehicle.spawnPoint.getWorldPosition(worldPos); + worldPos.y += 1; + this.outOfBoundsRespawn(vehicle.rayCastVehicle.chassisBody, Utils.cannonVector(worldPos)); + } + }); + } + + public isOutOfBounds(position: CANNON.Vec3): boolean + { + let inside = position.x > -211.882 && position.x < 211.882 && + position.z > -169.098 && position.z < 153.232 && + position.y > 0.107; + let belowSeaLevel = position.y < 14.989; + + return !inside && belowSeaLevel; + } + + public outOfBoundsRespawn(body: CANNON.Body, position?: CANNON.Vec3): void + { + let newPos = position || new CANNON.Vec3(0, 16, 0); + let newQuat = new CANNON.Quaternion(0, 0, 0, 1); + + body.position.copy(newPos); + body.interpolatedPosition.copy(newPos); + body.quaternion.copy(newQuat); + body.interpolatedQuaternion.copy(newQuat); + body.velocity.setZero(); + body.angularVelocity.setZero(); + } + + /** + * Rendering loop. + * Implements fps limiter and frame-skipping + * Calls world's "update" function before rendering. + * @param {World} world + */ + public render(world: World): void + { + this.requestDelta = this.clock.getDelta(); + + requestAnimationFrame(() => + { + world.render(world); + }); + + // Getting timeStep + let unscaledTimeStep = (this.requestDelta + this.renderDelta + this.logicDelta) ; + let timeStep = unscaledTimeStep * this.params.Time_Scale; + timeStep = Math.min(timeStep, 1 / 30); // min 30 fps + + // Logic + world.update(timeStep, unscaledTimeStep); + + // Measuring logic time + this.logicDelta = this.clock.getDelta(); + + // Frame limiting + let interval = 1 / 60; + this.sinceLastFrame += this.requestDelta + this.renderDelta + this.logicDelta; + this.sinceLastFrame %= interval; + + // Stats end + this.stats.end(); + this.stats.begin(); + + // Actual rendering with a FXAA ON/OFF switch + if (this.params.FXAA) this.composer.render(); + else this.renderer.render(this.graphicsWorld, this.camera); + + // Measuring render time + this.renderDelta = this.clock.getDelta(); + } + + public setTimeScale(value: number): void + { + this.params.Time_Scale = value; + this.timeScaleTarget = value; + } + + public add(worldEntity: IWorldEntity): void + { + worldEntity.addToWorld(this); + this.registerUpdatable(worldEntity); + } + + public registerUpdatable(registree: IUpdatable): void + { + this.updatables.push(registree); + this.updatables.sort((a, b) => (a.updateOrder > b.updateOrder) ? 1 : -1); + } + + public remove(worldEntity: IWorldEntity): void + { + worldEntity.removeFromWorld(this); + this.unregisterUpdatable(worldEntity); + } + + public unregisterUpdatable(registree: IUpdatable): void + { + _.pull(this.updatables, registree); + } + + public loadScene(loadingManager: LoadingManager, gltf: any): void + { + gltf.scene.traverse((child) => { + if (child.hasOwnProperty('userData')) + { + if (child.type === 'Mesh') + { + Utils.setupMeshProperties(child); + this.sky.csm.setupMaterial(child.material); + + if (child.material.name === 'ocean') + { + this.registerUpdatable(new Ocean(child, this)); + } + } + + if (child.userData.hasOwnProperty('data')) + { + if (child.userData.data === 'physics') + { + if (child.userData.hasOwnProperty('type')) + { + // Convex doesn't work! Stick to boxes! + if (child.userData.type === 'box') + { + let phys = new BoxCollider({size: new THREE.Vector3(child.scale.x, child.scale.y, child.scale.z)}); + phys.body.position.copy(Utils.cannonVector(child.position)); + phys.body.quaternion.copy(Utils.cannonQuat(child.quaternion)); + phys.body.computeAABB(); + + phys.body.shapes.forEach((shape) => { + shape.collisionFilterMask = ~CollisionGroups.TrimeshColliders; + }); + + this.physicsWorld.addBody(phys.body); + } + else if (child.userData.type === 'trimesh') + { + let phys = new TrimeshCollider(child, {}); + this.physicsWorld.addBody(phys.body); + } + + child.visible = false; + } + } + + if (child.userData.data === 'path') + { + this.paths.push(new Path(child)); + } + + if (child.userData.data === 'scenario') + { + this.scenarios.push(new Scenario(child, this)); + } + } + } + }); + + this.graphicsWorld.add(gltf.scene); + + // Launch default scenario + let defaultScenarioID: string; + for (const scenario of this.scenarios) { + if (scenario.default) { + defaultScenarioID = scenario.id; + break; + } + } + if (defaultScenarioID !== undefined) this.launchScenario(defaultScenarioID, loadingManager); + } + + public launchScenario(scenarioID: string, loadingManager?: LoadingManager): void + { + this.lastScenarioID = scenarioID; + + this.clearEntities(); + + // Launch default scenario + if (!loadingManager) loadingManager = new LoadingManager(this); + for (const scenario of this.scenarios) { + if (scenario.id === scenarioID || scenario.spawnAlways) { + scenario.launch(loadingManager, this); + } + } + } + + public restartScenario(): void + { + if (this.lastScenarioID !== undefined) + { + document.exitPointerLock(); + this.launchScenario(this.lastScenarioID); + } + else + { + console.warn('Can\'t restart scenario. Last scenarioID is undefined.'); + } + } + + public clearEntities(): void + { + for (let i = 0; i < this.characters.length; i++) { + this.remove(this.characters[i]); + i--; + } + + for (let i = 0; i < this.vehicles.length; i++) { + this.remove(this.vehicles[i]); + i--; + } + } + + public scrollTheTimeScale(scrollAmount: number): void + { + // Changing time scale with scroll wheel + const timeScaleBottomLimit = 0.003; + const timeScaleChangeSpeed = 1.3; + + if (scrollAmount > 0) + { + this.timeScaleTarget /= timeScaleChangeSpeed; + if (this.timeScaleTarget < timeScaleBottomLimit) this.timeScaleTarget = 0; + } + else + { + this.timeScaleTarget *= timeScaleChangeSpeed; + if (this.timeScaleTarget < timeScaleBottomLimit) this.timeScaleTarget = timeScaleBottomLimit; + this.timeScaleTarget = Math.min(this.timeScaleTarget, 1); + } + } + + public updateControls(controls: any): void + { + let html = ''; + html += '

    Controls:

    '; + + controls.forEach((row) => + { + html += '
    '; + row.keys.forEach((key) => { + if (key === '+' || key === 'and' || key === 'or' || key === '&') html += ' ' + key + ' '; + else html += '' + key + ''; + }); + + html += '' + row.desc + '
    '; + }); + + document.getElementById('controls').innerHTML = html; + } + + private generateHTML(): void + { + // Fonts + $('head').append(''); + $('head').append(''); + $('head').append(''); + + // Loader + $(`
    +
    +

    Sketchbook 0.4

    +
    +
    +
    +
    +
    +
    +
    Loading...
    +
    + `).appendTo('body'); + + // UI + $(` + `).appendTo('body'); + + // Canvas + document.body.appendChild(this.renderer.domElement); + this.renderer.domElement.id = 'canvas'; + } + + private createParamsGUI(scope: World): void + { + this.params = { + Pointer_Lock: true, + Mouse_Sensitivity: 0.3, + Time_Scale: 1, + Shadows: true, + FXAA: true, + Debug_Physics: false, + Debug_FPS: false, + Sun_Elevation: 50, + Sun_Rotation: 145, + }; + + const gui = new GUI.GUI(); + + // Scenario + this.scenarioGUIFolder = gui.addFolder('Scenarios'); + this.scenarioGUIFolder.open(); + + // World + let worldFolder = gui.addFolder('World'); + worldFolder.add(this.params, 'Time_Scale', 0, 1).listen() + .onChange((value) => + { + scope.timeScaleTarget = value; + }); + worldFolder.add(this.params, 'Sun_Elevation', 0, 180).listen() + .onChange((value) => + { + scope.sky.phi = value; + }); + worldFolder.add(this.params, 'Sun_Rotation', 0, 360).listen() + .onChange((value) => + { + scope.sky.theta = value; + }); + + // Input + let settingsFolder = gui.addFolder('Settings'); + settingsFolder.add(this.params, 'FXAA'); + settingsFolder.add(this.params, 'Shadows') + .onChange((enabled) => + { + if (enabled) + { + this.sky.csm.lights.forEach((light) => { + light.castShadow = true; + }); + } + else + { + this.sky.csm.lights.forEach((light) => { + light.castShadow = false; + }); + } + }); + settingsFolder.add(this.params, 'Pointer_Lock') + .onChange((enabled) => + { + scope.inputManager.setPointerLock(enabled); + }); + settingsFolder.add(this.params, 'Mouse_Sensitivity', 0, 1) + .onChange((value) => + { + scope.cameraOperator.setSensitivity(value, value * 0.8); + }); + settingsFolder.add(this.params, 'Debug_Physics') + .onChange((enabled) => + { + if (enabled) + { + this.cannonDebugRenderer = new CannonDebugRenderer( this.graphicsWorld, this.physicsWorld ); + } + else + { + this.cannonDebugRenderer.clearMeshes(); + this.cannonDebugRenderer = undefined; + } + + scope.characters.forEach((char) => + { + char.raycastBox.visible = enabled; + }); + }); + settingsFolder.add(this.params, 'Debug_FPS') + .onChange((enabled) => + { + UIManager.setFPSVisible(enabled); + }); + + gui.open(); + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/tools/PathGen.py b/Sketchbook-master/Sketchbook-master/tools/PathGen.py new file mode 100644 index 00000000..6e722a57 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/tools/PathGen.py @@ -0,0 +1,60 @@ +# Script aiding the creation of Sketchbook AI paths in Blender. +# Converts a vertex chain to a linked list of Sketchbook path nodes +# with the nodes' object data in the correct format. + +import bpy + +obj = bpy.context.selected_objects[0] +mesh = obj.data + +# Create node wrapper +parent = bpy.data.objects.new( obj.name + '_path', None ) +bpy.context.collection.objects.link(parent) +parent.empty_display_size = 1 +parent.empty_display_type = 'PLAIN_AXES' +parent.location = obj.location + +# Identify vertex neighbors +vertNeighbors = {} +for edge in mesh.edges: + v1 = edge.vertices[0] + v2 = edge.vertices[1] + + if str(v1) not in vertNeighbors: + vertNeighbors[str(v1)] = [] + vertNeighbors[str(v1)].append(v2) + + if str(v2) not in vertNeighbors: + vertNeighbors[str(v2)] = [] + vertNeighbors[str(v2)].append(v1) + +def getNodeName(index): + return obj.name + '_node' + str(index) + +# Generate path nodes +finished = [] +def generateNode(index, previousIndex): + + v = mesh.vertices[int(index)] + pos = v.co + + empty = bpy.data.objects.new( getNodeName(v.index), None ) + bpy.context.collection.objects.link(empty) + empty.empty_display_size = 1 + empty.empty_display_type = 'PLAIN_AXES' + empty.location = pos + empty.parent = parent + + nextIndex = vertNeighbors[str(index)][0] + if nextIndex == previousIndex: nextIndex = vertNeighbors[str(index)][1] + + empty['data'] = 'pathNode' + empty['path'] = obj.name + empty['nextNode'] = getNodeName(nextIndex) + empty['previousNode'] = getNodeName(previousIndex) + + finished.append(index) + if nextIndex not in finished: + generateNode(nextIndex, index) + +generateNode(0, vertNeighbors['0'][0]) diff --git a/Sketchbook-master/Sketchbook-master/tsconfig.json b/Sketchbook-master/Sketchbook-master/tsconfig.json new file mode 100644 index 00000000..eb499b98 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/tsconfig.json @@ -0,0 +1,16 @@ +{ + "include": [ + "src/ts/**/*" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "moduleResolution": "node", + "declaration": true, + "declarationDir": "build/types", + "baseUrl": ".", + "paths": { + "cannon" : ["src/lib/cannon/cannon"] + } + } +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/tslint.json b/Sketchbook-master/Sketchbook-master/tslint.json new file mode 100644 index 00000000..7a0afb34 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/tslint.json @@ -0,0 +1,42 @@ +{ + "defaultSeverity": "error", + "extends": [ + "tslint:recommended" + ], + "jsRules": {}, + "rules": { + "one-line": false, + "no-empty": false, + "no-console": false, + "indent": [true, "tabs"], + "object-literal-shorthand": false, + "quotemark": [true, "single"], + "prefer-const": false, + "eofline": false, + "max-line-length": false, + "no-trailing-whitespace": false, + "ordered-imports": false, + "import-spacing": false, + "trailing-comma": false, + "curly": false, + "object-literal-sort-keys": false, + "object-literal-key-quotes": false, + "variable-name": false, + "typedef": [ + true, + "call-signature", + "parameter", + "property-declaration", + "variable-declaration-ignore-function", + "member-variable-declaration", + "object-destructuring", + "array-destructuring" + ] + }, + "linterOptions": { + "exclude": [ + "build" + ] + }, + "rulesDirectory": [] +} \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/webpack.common.js b/Sketchbook-master/Sketchbook-master/webpack.common.js new file mode 100644 index 00000000..abab1a7e --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/webpack.common.js @@ -0,0 +1,38 @@ +const path = require('path'); + +module.exports = { + entry: { + app: './src/ts/sketchbook.ts' + }, + output: { + filename: './build/sketchbook.min.js', + library: 'Sketchbook', + libraryTarget: 'umd', + path: path.resolve(__dirname) + }, + resolve: { + alias: { + cannon: path.resolve(__dirname, './src/lib/cannon/cannon.js') + }, + extensions: [ '.tsx', '.ts', '.js' ], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/, + }, + { + test: /\.css$/, + use: [ + { loader: 'style-loader', options: { injectType: 'singletonStyleTag' } }, + { loader: 'css-loader' }, + ] + } + ] + }, + performance: { + hints: false + } +}; \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/webpack.dev.js b/Sketchbook-master/Sketchbook-master/webpack.dev.js new file mode 100644 index 00000000..5b14607f --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/webpack.dev.js @@ -0,0 +1,11 @@ +const merge = require('webpack-merge'); +const common = require('./webpack.common.js'); + +module.exports = merge(common, { + mode: 'development', + devtool: 'inline-source-map', + devServer: { + // progress: true, + liveReload: false + }, +}); \ No newline at end of file diff --git a/Sketchbook-master/Sketchbook-master/webpack.prod.js b/Sketchbook-master/Sketchbook-master/webpack.prod.js new file mode 100644 index 00000000..eda8ea94 --- /dev/null +++ b/Sketchbook-master/Sketchbook-master/webpack.prod.js @@ -0,0 +1,13 @@ +const webpack = require('webpack'); +const merge = require('webpack-merge'); +const common = require('./webpack.common.js'); + +module.exports = merge(common, { + mode: 'production', + plugins: [ + new webpack.BannerPlugin({ + banner: + `Sketchbook 0.4 (https://github.com/swift502/Sketchbook)\nBuilt on three.js (https://github.com/mrdoob/three.js) and cannon.js (https://github.com/schteppe/cannon.js)`, + }), + ] +}); \ No newline at end of file diff --git a/mincrat.html b/mincrat.html index b641a60a..ad300042 100644 --- a/mincrat.html +++ b/mincrat.html @@ -56,6 +56,7 @@ Doom fun windos Monkey Mart +
    diff --git a/numbers/NumberMunchers-master/files/pacman-master/pacman-master/index.html b/numbers/NumberMunchers-master/files/pacman-master/pacman-master/index.html index faaf7fb7..e8de6790 100644 --- a/numbers/NumberMunchers-master/files/pacman-master/pacman-master/index.html +++ b/numbers/NumberMunchers-master/files/pacman-master/pacman-master/index.html @@ -216,6 +216,7 @@
    - help -
    + GitHub - Lucio PANEPINTO - Pac-Man Putchuwww.putchu.be