coinwind/public/static/js/app.0686eba8.js

1 line
683 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["app"],{0:function(e,t,n){e.exports=n("56d7")},"06ed":function(e,t,n){},"087a":function(e,t,n){},"098e":function(e,t){e.exports={singleCurrency:{title:"创世空投",desc:"只需质押一些代币,即可挖取",pledge:"质押",pledgeNum:"质押数量",receive:"可领取",harvest:"收取",networkPledge:"全网质押量",redeem:"赎回",stakeTips1:"质押数量不能大于当前可用余额",stakeTips2:"质押数量不能等于0",blindBox:"盲盒",redeemTips:"您还有未收取的盲盒,请先收取后再赎回",balance:"可用余额",maskInput:"请输入质押数量",pledgeAll:"全部质押",confirm:"确认",pledgeSuccess:"质押成功",receivedSuccess:"领取成功",redeemSuccess:"赎回成功",rulesTitle:"空投规则",rulesDesc:'创世空投活动已于UTC时间2021年9月16日12:00正式结束同时"星能采矿船-能量池"正式启动能量池现已支持BLIN,USDT,BNB,BAKE,CHR,ETH,SKILL,TLM单币质押产出BLIN。请参与创世空投活动的用户尽快领取盲盒并可根据自己的意愿随时赎回质押资产此页面将于用户相关质押资产全部赎回后关闭。',rulesDesc1:"特别说明:如已质押资产在能量池中有相同币种,用户则无需赎回质押资产,智能合约已自动切换为能量池质押。",rulesCoin:"币种",rulesCoinNum:"数量",viewAll:"点击查看全部"},common:{confirming:"确认中",errMsg1:"用户拒绝了请求",errMsg2:"请求的方法和/或帐户未经用户授权",errMsg3:"提供者不支持请求的方法",errMsg4:"提供者与所有链断开连接",errMsg5:"提供者未连接到请求的链",errMsg6:"解析错误 无效的 JSON",errMsg7:"购买失败,余额不足",errMsg8:"操作失败",connect:"连接钱包",farms:"星能采矿船",genesisAirdrop:"创世空投",webSite:"官网",ido:"星际空间站",home:"首页",nftStore:"NFT星系",nftStoreItem1:"翡翠帝国",nftStoreItem2:"影视星球",nftStoreItem3:"电竞大陆",nftStoreItem4:"文化丰碑",trade:"交易",exchange:"兑换",fluidity:"流动性",park:"星空传送门",info:"信息",market:"自由市场",nftMining:"NFT池",syrup:"能量池",liquidityMining:"LP池",copySuccess:"复制成功",buy:"购买",providerInfo:"找不到提供程序",myCard:"我的NFT",myBlindbox:"我的盲盒",comingSoon:"即将到来",back:"返回",noData:"暂无数据",version:"版本",publicBeta:"公测",requestErr:"请求出错了",openBoxTips:"点击箱子开启盲盒",congratulationsGet:"恭喜您获得",card:"卡牌",total:"总计获得1张",staking:"去激活挖矿",opening:"开启中"},ido:{label1:"数量",label2:"价格",label3:"比例",label4:"开始时间",label5:"结束时间",submit:"确认提交",submitEd:"已提交",submitSuccess:"提交成功",walletBalance:"钱包余额",statusText1:"未开始",statusText2:"进行中",statusText3:"已结束",statusText4:"已售罄",statusText5:"已购买",aboutTitle:"简介",timeFormat:"DD 天 HH 时 mm 分 ss 秒",aboutDesc1:"Blin Metaverse 是一个基于币安智能链的去中心化综合 NFT 基础设施。 旨在通过IP、虚拟社交、NFT资产铸造、确权和链上价值流通重塑实现多元化虚拟现实交互的综合去中心化NFT基础设施。",aboutDesc2:"BLIN 是 Blin Metaverse 基于 DAO 治理的平台代币。",stationTitle:"如何发射自己的星际空间站?",stationDesc:"使用 Blin Metaverse 启动您的项目Blin Metaverse 是一个使用自动做市商 (AMM) 模型的去中心化交易平台和NFT一键铸造、拍卖平台。 (点击文字立即申请)"},home:{buy:"立即购买",staking:"立即质押",auditAuthority:"审计",walletOfSupport:"支持",loadmoreCard:"查看更多卡牌"},blindbox:{title:"盲盒",desc:"盲盒可开启随机获得高价值NFT卡牌。",name:"名称",series:"系列",price:"价格",num:"数量",individual:"个",luckyDrawDesc:"翡翠帝国盲盒开启有机率获得翡翠帝国系列六种NFT卡牌帝王绿之源、紫罗兰之源、红翡之源、蓝翡之源、墨翠之源、勇士之源。",buy:"立即购买",buySuccess:"购买成功"},nftDetails:{title:"NFT卡牌",desc:"NFT卡牌有收藏权益或可质押挖矿获得BLIN。",name:"名称",series:"系列",id:"编号",price:"价格",priceValue:"价值",num:"数量",sheet:"张",buy:"立即购买",buySuccess:"购买成功",walletBalance:"钱包余额",insufficientQuantity:"剩余数量不足"},swap:{title:"兑换",desc:"即时交易代币",from:"从",to:"到",balance:"可用余额",slippage:"滑点",settings:"设置",submit:"提交",max:"最大",submitSuccess:"提交成功",tips1:"请输入正确的数量",tips2:"输入的数量不能大于余额"},farms:{title:"流动性挖矿",desc:"抵押流动性池代币以赚取。",quantityReceived:"可领取",earningsReceived:"已领取的收益",freshmanIncome:"新生收益",stakingValue:"全网质押价值"},userCard:{title:"我的NFT",desc:"拥有的NFT卡牌都在这里。",wholeCardTitle:"完整的NFT卡牌",goPledge:"去质押挖矿",brokenCardTitle:"破碎NFT卡牌",brokenCardDesc:"破碎的NFT卡牌可升级为完整的NFT卡牌。",synthesis:"合成",notEnough:"您的破碎之源不足以合成",synthesisSuccess:"合成成功"},userBlindbox:{title:"我的盲盒",desc:"未开启的盲盒都在这里。点击开启按钮可开启盲盒。",open:"开启",blindboxTips:"您有盲盒待领取",receiveSuccess:"领取成功"},pledge:{title:"NFT挖矿",desc:"查看您所拥有的NFT卡牌赚取挖矿收益。",earned:"已赚取",harvest:"收取",balance:"钱包余额",walletCardTitle:"钱包里的NFT卡牌",miningCardTitle:"挖矿中的NFT卡牌",goView:"去查看",activity:"活跃度",activation:"激活挖矿",transfer:"转让",upgrade:"升级卡牌",receiveBox:"领取周边盒",redeem:"赎回",profit:"收益",increase:"增加活跃度",receiveProfit:"领取收益",popupTitle1:"增加活跃度",extendable:"可延长",day:"天",popup1Input1:"请输入活跃度天数",popup1Tips1:"请输入活跃度天数",popup1Tips2:"活跃度天数不能大于最大可延长天数",popup1Tips3:"活跃度天数不能小于1",popupTitle2:"填写收货地址",popup2Input1:"请输入您的收件人名称",popup2Input2:"请输入您的手机号",popup2Input3:"请输入您的收货地址",popup2Tips1:"收件人名称不能为空",popup2Tips2:"手机号不能为空",popup2Tips3:"收货地址不能为空",popupTitle3:"转让卡牌",popup3Input1:"请输入接收人地址",popup3Tips1:"请输入卡牌接收人的地址",pledgeSuccess:"质押成功",notBeUpgraded:"当前卡牌不能升级",updateSuccess:"升级成功",submitSuccess:"提交成功",transferSuccess:"转让成功",insufficientBalance:"余额不足",receivedSuccess:"领取成功",redemptionSuccess:"赎回成功",estimatePrice:"预计需支付",dayToMore:"超出天数",toRedeem:"去赎回"},energyPool:{title:"能量池",desc:"只需质押一些代币即可赚取。高年化利率,低风险。",pledge:"质押",pledgeNum:"质押数量",receive:"可领取",harvest:"收取",networkPledge:"全网质押量",redeem:"赎回",apr:"年化利率",stakeTips1:"质押数量不能大于当前可用余额",stakeTips2:"质押数量不能等于0",balance:"可用余额",maskInput:"请输入质押数量",pledgeAll:"全部质押",confirm:"确认",pledgeSuccess:"质押成功",receivedSuccess:"领取成功",redeemSuccess:"赎回成功",rulesDesc:"用户质押相应数量币种即可进行能量池挖矿。",rulesCoin:"币种",rulesCoinNum:"数量",viewAll:"点击查看全部"},portal:{title:"电竞大陆",desc:"即将通过传送门进行传送"}}},"099f":function(e,t,n){"use strict";n.r(t);var i=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"swap-tool"},[i("div",{staticClass:"swap-tool-hd"},[i("h3",{staticClass:"tool-title"},[e._v(e._s(e.title))]),e._v(" "),i("div",{staticClass:"tool-item-wrap"},[i("div",{staticClass:"tool-item",on:{click:function(t){return e.$emit("toleranceClick")}}},[i("img",{attrs:{src:n("4903"),alt:""}})]),e._v(" "),e._m(0)])]),e._v(" "),i("div",{staticClass:"swap-tool-bd"},[e._v(e._s(e.desc))]),e._v(" "),e._t("default")],2)},r=[function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"tool-item"},[i("img",{attrs:{src:n("e5fc"),alt:""}})])}],a={name:"SwapTool",props:{title:{type:String,default:""},desc:{type:String,default:""}}},o=a,s=(n("a7c7"),n("2877")),c=Object(s["a"])(o,i,r,!1,null,"6791b6d3",null);t["default"]=c.exports},"0afc":function(e,t,n){"use strict";var i=n("d2e7"),r=n.n(i);r.a},"0dd4":function(e,t,n){"use strict";n.r(t);var i=function(){var e=this,t=e.$createElement;e._self._c;return e._m(0)},r=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"starfield"},[n("div",{staticClass:"static"}),e._v(" "),n("div",{staticClass:"moving-1"}),e._v(" "),n("div",{staticClass:"moving-2"}),e._v(" "),n("div",{staticClass:"moving-3"})])}],a=(n("a69f"),n("3b2b"),n("1c4c"),n("386d"),n("7514"),n("0d6d"),n("14b9"),n("6b54"),n("0b21"),n("2e37"),n("f400"),n("4917"),n("a481"),n("28a5"),n("7f7f"),n("87f3"),n("55dd"),n("456d"),n("ac6a"),n("5df3"),n("10ad"),n("c5f6"),n("7cdf"),n("673e"),n("4dda"),n("63d9"),n("9c29"),n("b6e4"),n("af56"),n("15ac"),n("6aa23"),n("34ef"),n("b05c"),n("53ca"));(function(t,i){"object"===("undefined"===typeof exports?"undefined":Object(a["a"])(exports))&&"undefined"!==typeof e?i(exports):"function"===typeof define&&n("3c35")?define(["exports"],i):(t=t||self,i(t.THREE={}))})(void 0,(function(e){function t(){}function n(e,t){void 0===e&&(e=0),void 0===t&&(t=0),this.x=e,this.y=t}function i(){this.elements=[1,0,0,0,1,0,0,0,1],0<arguments.length&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}function r(e,t,a,o,s,c,l,u,h,d){Object.defineProperty(this,"id",{value:Za++}),this.uuid=qa.generateUUID(),this.name="",this.image=void 0!==e?e:r.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==t?t:r.DEFAULT_MAPPING,this.wrapS=void 0!==a?a:1001,this.wrapT=void 0!==o?o:1001,this.magFilter=void 0!==s?s:1006,this.minFilter=void 0!==c?c:1008,this.anisotropy=void 0!==h?h:1,this.format=void 0!==l?l:1023,this.internalFormat=null,this.type=void 0!==u?u:1009,this.offset=new n(0,0),this.repeat=new n(1,1),this.center=new n(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new i,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==d?d:3e3,this.version=0,this.onUpdate=null}function o(e,t,n,i){void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=0),void 0===i&&(i=1),this.x=e,this.y=t,this.z=n,this.w=i}function s(e,t,n){this.width=e,this.height=t,this.scissor=new o(0,0,e,t),this.scissorTest=!1,this.viewport=new o(0,0,e,t),n=n||{},this.texture=new r(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=e,this.texture.image.height=t,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:1006,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 c(e,t,n){s.call(this,e,t,n),this.samples=4}function l(e,t,n,i){void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=0),void 0===i&&(i=1),this._x=e,this._y=t,this._z=n,this._w=i}function u(e,t,n){void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=0),this.x=e,this.y=t,this.z=n}function h(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0<arguments.length&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function d(e,t,n,i){void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=0),void 0===i&&(i=d.DefaultOrder),this._x=e,this._y=t,this._z=n,this._order=i}function p(){this.mask=1}function f(){Object.defineProperty(this,"id",{value:so++}),this.uuid=qa.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=f.DefaultUp.clone();var e=new u,t=new d,n=new l,r=new u(1,1,1);t._onChange((function(){n.setFromEuler(t,!1)})),n._onChange((function(){t.setFromQuaternion(n,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new h},normalMatrix:{value:new i}}),this.matrix=new h,this.matrixWorld=new h,this.matrixAutoUpdate=f.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new p,this.visible=!0,this.receiveShadow=this.castShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function m(){f.call(this),this.type="Scene",this.overrideMaterial=this.fog=this.environment=this.background=null,this.autoUpdate=!0,"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function g(e,t){this.min=void 0!==e?e:new u(1/0,1/0,1/0),this.max=void 0!==t?t:new u(-1/0,-1/0,-1/0)}function v(e,t,n,i,r){for(var a=0,o=e.length-3;a<=o;a+=3){Io.fromArray(e,a);var s=r.x*Math.abs(Io.x)+r.y*Math.abs(Io.y)+r.z*Math.abs(Io.z),c=t.dot(Io),l=n.dot(Io),u=i.dot(Io);if(Math.max(-Math.max(c,l,u),Math.min(c,l,u))>s)return!1}return!0}function y(e,t){this.center=void 0!==e?e:new u,this.radius=void 0!==t?t:-1}function x(e,t){this.origin=void 0!==e?e:new u,this.direction=void 0!==t?t:new u(0,0,-1)}function b(e,t){this.normal=void 0!==e?e:new u(1,0,0),this.constant=void 0!==t?t:0}function w(e,t,n){this.a=void 0!==e?e:new u,this.b=void 0!==t?t:new u,this.c=void 0!==n?n:new u}function _(e,t,n){return void 0===t&&void 0===n?this.set(e):this.setRGB(e,t,n)}function M(e,t,n){return 0>n&&(n+=1),1<n&&--n,n<1/6?e+6*(t-e)*n:.5>n?t:n<2/3?e+6*(t-e)*(2/3-n):e}function S(e){return.04045>e?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function T(e){return.0031308>e?12.92*e:1.055*Math.pow(e,.41666)-.055}function E(e,t,n,i,r,a){this.a=e,this.b=t,this.c=n,this.normal=i&&i.isVector3?i:new u,this.vertexNormals=Array.isArray(i)?i:[],this.color=r&&r.isColor?r:new _,this.vertexColors=Array.isArray(r)?r:[],this.materialIndex=void 0!==a?a:0}function A(){Object.defineProperty(this,"id",{value:rs++}),this.uuid=qa.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.blending=1,this.side=0,this.vertexColors=this.flatShading=!1,this.opacity=1,this.transparent=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendEquationAlpha=this.blendDstAlpha=this.blendSrcAlpha=null,this.depthFunc=3,this.depthWrite=this.depthTest=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilZPass=this.stencilZFail=this.stencilFail=7680,this.stencilWrite=!1,this.clippingPlanes=null,this.clipShadows=this.clipIntersection=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetUnits=this.polygonOffsetFactor=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.toneMapped=this.visible=!0,this.userData={},this.version=0}function L(e){A.call(this),this.type="MeshBasicMaterial",this.color=new _(16777215),this.lightMap=this.map=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.envMap=this.alphaMap=this.specularMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.morphTargets=this.skinning=!1,this.setValues(e)}function C(e,t,n){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===n,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}function R(e,t,n){C.call(this,new Int8Array(e),t,n)}function P(e,t,n){C.call(this,new Uint8Array(e),t,n)}function O(e,t,n){C.call(this,new Uint8ClampedArray(e),t,n)}function I(e,t,n){C.call(this,new Int16Array(e),t,n)}function D(e,t,n){C.call(this,new Uint16Array(e),t,n)}function N(e,t,n){C.call(this,new Int32Array(e),t,n)}function B(e,t,n){C.call(this,new Uint32Array(e),t,n)}function F(e,t,n){C.call(this,new Float32Array(e),t,n)}function U(e,t,n){C.call(this,new Float64Array(e),t,n)}function z(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingSphere=this.boundingBox=null,this.groupsNeedUpdate=this.uvsNeedUpdate=this.colorsNeedUpdate=this.normalsNeedUpdate=this.verticesNeedUpdate=!1}function G(e){if(0===e.length)return-1/0;for(var t=e[0],n=1,i=e.length;n<i;++n)e[n]>t&&(t=e[n]);return t}function k(){Object.defineProperty(this,"id",{value:ss+=2}),this.uuid=qa.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingSphere=this.boundingBox=null,this.drawRange={start:0,count:1/0},this.userData={}}function H(e,t){f.call(this),this.type="Mesh",this.geometry=void 0!==e?e:new k,this.material=void 0!==t?t:new L,this.updateMorphTargets()}function j(e,t,n,i,r,a,o,s){return null===(1===t.side?i.intersectTriangle(o,a,r,!0,s):i.intersectTriangle(r,a,o,2!==t.side,s))?null:(Rs.copy(s),Rs.applyMatrix4(e.matrixWorld),t=n.ray.origin.distanceTo(Rs),t<n.near||t>n.far?null:{distance:t,point:Rs.clone(),object:e})}function V(e,t,i,r,a,o,s,c,l,u,h,d){if(vs.fromBufferAttribute(a,u),ys.fromBufferAttribute(a,h),xs.fromBufferAttribute(a,d),a=e.morphTargetInfluences,t.morphTargets&&o&&a){Ms.set(0,0,0),Ss.set(0,0,0),Ts.set(0,0,0);for(var p=0,f=o.length;p<f;p++){var m=a[p],g=o[p];0!==m&&(bs.fromBufferAttribute(g,u),ws.fromBufferAttribute(g,h),_s.fromBufferAttribute(g,d),s?(Ms.addScaledVector(bs,m),Ss.addScaledVector(ws,m),Ts.addScaledVector(_s,m)):(Ms.addScaledVector(bs.sub(vs),m),Ss.addScaledVector(ws.sub(ys),m),Ts.addScaledVector(_s.sub(xs),m)))}vs.add(Ms),ys.add(Ss),xs.add(Ts)}return e.isSkinnedMesh&&(e.boneTransform(u,vs),e.boneTransform(h,ys),e.boneTransform(d,xs)),(e=j(e,t,i,r,vs,ys,xs,Cs))&&(c&&(Es.fromBufferAttribute(c,u),As.fromBufferAttribute(c,h),Ls.fromBufferAttribute(c,d),e.uv=w.getUV(Cs,vs,ys,xs,Es,As,Ls,new n)),l&&(Es.fromBufferAttribute(l,u),As.fromBufferAttribute(l,h),Ls.fromBufferAttribute(l,d),e.uv2=w.getUV(Cs,vs,ys,xs,Es,As,Ls,new n)),c=new E(u,h,d),w.getNormal(vs,ys,xs,c.normal),e.face=c),e}function W(){Object.defineProperty(this,"id",{value:Ps+=2}),this.uuid=qa.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingSphere=this.boundingBox=null,this.groupsNeedUpdate=this.lineDistancesNeedUpdate=this.colorsNeedUpdate=this.normalsNeedUpdate=this.uvsNeedUpdate=this.verticesNeedUpdate=this.elementsNeedUpdate=!1}function q(e){var t,n={};for(t in e)for(var i in n[t]={},e[t]){var r=e[t][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture)?n[t][i]=r.clone():Array.isArray(r)?n[t][i]=r.slice():n[t][i]=r}return n}function Y(e){for(var t={},n=0;n<e.length;n++){var i,r=q(e[n]);for(i in r)t[i]=r[i]}return t}function X(e){A.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.morphNormals=this.morphTargets=this.skinning=this.clipping=this.lights=this.fog=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,void 0!==e&&(void 0!==e.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))}function Z(){f.call(this),this.type="Camera",this.matrixWorldInverse=new h,this.projectionMatrix=new h,this.projectionMatrixInverse=new h}function J(e,t,n,i){Z.call(this),this.type="PerspectiveCamera",this.fov=void 0!==e?e:50,this.zoom=1,this.near=void 0!==n?n:.1,this.far=void 0!==i?i:2e3,this.focus=10,this.aspect=void 0!==t?t:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function Q(e,t,n){if(f.call(this),this.type="CubeCamera",!0!==n.isWebGLCubeRenderTarget)console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");else{this.renderTarget=n;var i=new J(90,1,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new u(1,0,0)),this.add(i);var r=new J(90,1,e,t);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new u(-1,0,0)),this.add(r);var a=new J(90,1,e,t);a.layers=this.layers,a.up.set(0,0,1),a.lookAt(new u(0,1,0)),this.add(a);var o=new J(90,1,e,t);o.layers=this.layers,o.up.set(0,0,-1),o.lookAt(new u(0,-1,0)),this.add(o);var s=new J(90,1,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new u(0,0,1)),this.add(s);var c=new J(90,1,e,t);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new u(0,0,-1)),this.add(c),this.update=function(e,t){null===this.parent&&this.updateMatrixWorld();var l=e.xr.enabled,u=e.getRenderTarget();e.xr.enabled=!1;var h=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,i),e.setRenderTarget(n,1),e.render(t,r),e.setRenderTarget(n,2),e.render(t,a),e.setRenderTarget(n,3),e.render(t,o),e.setRenderTarget(n,4),e.render(t,s),n.texture.generateMipmaps=h,e.setRenderTarget(n,5),e.render(t,c),e.setRenderTarget(u),e.xr.enabled=l},this.clear=function(e,t,i,r){for(var a=e.getRenderTarget(),o=0;6>o;o++)e.setRenderTarget(n,o),e.clear(t,i,r);e.setRenderTarget(a)}}}function K(e,t,n){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n),s.call(this,e,e,t)}function $(e,t,n,i,a,o,s,c,l,u,h,d){r.call(this,null,o,s,c,l,u,i,a,h,d),this.image={data:e||null,width:t||1,height:n||1},this.magFilter=void 0!==l?l:1003,this.minFilter=void 0!==u?u:1003,this.flipY=this.generateMipmaps=!1,this.unpackAlignment=1,this.needsUpdate=!0}function ee(e,t,n,i,r,a){this.planes=[void 0!==e?e:new b,void 0!==t?t:new b,void 0!==n?n:new b,void 0!==i?i:new b,void 0!==r?r:new b,void 0!==a?a:new b]}function te(){function e(n,a){i(n,a),r=t.requestAnimationFrame(e)}var t=null,n=!1,i=null,r=null;return{start:function(){!0!==n&&null!==i&&(r=t.requestAnimationFrame(e),n=!0)},stop:function(){t.cancelAnimationFrame(r),n=!1},setAnimationLoop:function(e){i=e},setContext:function(e){t=e}}}function ne(e,t){function n(t,n){var i=t.array,r=t.usage,a=e.createBuffer();return e.bindBuffer(n,a),e.bufferData(n,i,r),t.onUploadCallback(),n=5126,i instanceof Float32Array?n=5126:i instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):i instanceof Uint16Array?n=5123:i instanceof Int16Array?n=5122:i instanceof Uint32Array?n=5125:i instanceof Int32Array?n=5124:i instanceof Int8Array?n=5120:i instanceof Uint8Array&&(n=5121),{buffer:a,type:n,bytesPerElement:i.BYTES_PER_ELEMENT,version:t.version}}var i=t.isWebGL2,r=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),r.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);var n=r.get(t);n&&(e.deleteBuffer(n.buffer),r.delete(t))},update:function(t,a){t.isInterleavedBufferAttribute&&(t=t.data);var o=r.get(t);if(void 0===o)r.set(t,n(t,a));else if(o.version<t.version){var s=t.array,c=t.updateRange;e.bindBuffer(a,o.buffer),-1===c.count?e.bufferSubData(a,0,s):(i?e.bufferSubData(a,c.offset*s.BYTES_PER_ELEMENT,s,c.offset,c.count):e.bufferSubData(a,c.offset*s.BYTES_PER_ELEMENT,s.subarray(c.offset,c.offset+c.count)),c.count=-1),o.version=t.version}}}}function ie(e,t,n,i){W.call(this),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i},this.fromBufferGeometry(new re(e,t,n,i)),this.mergeVertices()}function re(e,t,n,i){k.call(this),this.type="PlaneBufferGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i},e=e||1,t=t||1;var r=e/2,a=t/2;n=Math.floor(n)||1,i=Math.floor(i)||1;var o=n+1,s=i+1,c=e/n,l=t/i;t=[],e=[];for(var u=[],h=[],d=0;d<s;d++)for(var p=d*l-a,f=0;f<o;f++)e.push(f*c-r,-p,0),u.push(0,0,1),h.push(f/n),h.push(1-d/i);for(r=0;r<i;r++)for(a=0;a<n;a++)s=a+o*(r+1),c=a+1+o*(r+1),l=a+1+o*r,t.push(a+o*r,s,l),t.push(s,c,l);this.setIndex(t),this.setAttribute("position",new F(e,3)),this.setAttribute("normal",new F(u,3)),this.setAttribute("uv",new F(h,2))}function ae(e,t,n,i){function r(e,n){t.buffers.color.setClear(e.r,e.g,e.b,n,i)}var a,o,s=new _(0),c=0,l=null,u=0,h=null;return{getClearColor:function(){return s},setClearColor:function(e,t){s.set(e),c=void 0!==t?t:1,r(s,c)},getClearAlpha:function(){return c},setClearAlpha:function(e){c=e,r(s,c)},render:function(t,i,d,p){i=!0===i.isScene?i.background:null,d=e.xr,(d=d.getSession&&d.getSession())&&"additive"===d.environmentBlendMode&&(i=null),null===i?r(s,c):i&&i.isColor&&(r(i,1),p=!0),(e.autoClear||p)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),i&&(i.isCubeTexture||i.isWebGLCubeRenderTarget||306===i.mapping)?(void 0===o&&(o=new H(new Bs(1,1,1),new X({name:"BackgroundCubeMaterial",uniforms:q(Hs.cube.uniforms),vertexShader:Hs.cube.vertexShader,fragmentShader:Hs.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),o.geometry.deleteAttribute("normal"),o.geometry.deleteAttribute("uv"),o.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(o.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(o)),p=i.isWebGLCubeRenderTarget?i.texture:i,o.material.uniforms.envMap.value=p,o.material.uniforms.flipEnvMap.value=p.isCubeTexture?-1:1,l===i&&u===p.version&&h===e.toneMapping||(o.material.needsUpdate=!0,l=i,u=p.version,h=e.toneMapping),t.unshift(o,o.geometry,o.material,0,0,null)):i&&i.isTexture&&(void 0===a&&(a=new H(new re(2,2),new X({name:"BackgroundMaterial",uniforms:q(Hs.background.uniforms),vertexShader:Hs.background.vertexShader,fragmentShader:Hs.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(a)),a.material.uniforms.t2D.value=i,!0===i.matrixAutoUpdate&&i.updateMatrix(),a.material.uniforms.uvTransform.value.copy(i.matrix),l===i&&u===i.version&&h===e.toneMapping||(a.material.needsUpdate=!0,l=i,u=i.version,h=e.toneMapping),t.unshift(a,a.geometry,a.material,0,0,null))}}}function oe(e,t,n,i){function r(t){return i.isWebGL2?e.bindVertexArray(t):m.bindVertexArrayOES(t)}function a(t){return i.isWebGL2?e.deleteVertexArray(t):m.deleteVertexArrayOES(t)}function o(e){for(var t=[],n=[],i=[],r=0;r<f;r++)t[r]=0,n[r]=0,i[r]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:n,attributeDivisors:i,object:e,attributes:{}}}function s(){for(var e=x.newAttributes,t=0,n=e.length;t<n;t++)e[t]=0}function c(e){l(e,0)}function l(n,r){var a=x.enabledAttributes,o=x.attributeDivisors;x.newAttributes[n]=1,0===a[n]&&(e.enableVertexAttribArray(n),a[n]=1),o[n]!==r&&((i.isWebGL2?e:t.get("ANGLE_instanced_arrays"))[i.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,r),o[n]=r)}function u(){for(var t=x.newAttributes,n=x.enabledAttributes,i=0,r=n.length;i<r;i++)n[i]!==t[i]&&(e.disableVertexAttribArray(i),n[i]=0)}function h(t,n,r,a,o,s){!0!==i.isWebGL2||5124!==r&&5125!==r?e.vertexAttribPointer(t,n,r,a,o,s):e.vertexAttribIPointer(t,n,r,a,o,s)}function d(){p(),x!==y&&(x=y,r(x.object))}function p(){y.geometry=null,y.program=null,y.wireframe=!1}var f=e.getParameter(34921),m=i.isWebGL2?null:t.get("OES_vertex_array_object"),g=i.isWebGL2||null!==m,v={},y=o(null),x=y;return{setup:function(a,d,p,f,y){var b=!1;if(g){b=!0===d.wireframe;var w=v[f.id];void 0===w&&(w={},v[f.id]=w);var _=w[p.id];void 0===_&&(_={},w[p.id]=_),w=_[b],void 0===w&&(w=o(i.isWebGL2?e.createVertexArray():m.createVertexArrayOES()),_[b]=w),b=w,x!==b&&(x=b,r(x.object));e:if(b=x.attributes,_=f.attributes,Object.keys(b).length!==Object.keys(_).length)b=!0;else{for(var M in _){w=b[M];var S=_[M];if(w.attribute!==S||w.data!==S.data){b=!0;break e}}b=!1}if(b){for(var T in M={},_=f.attributes,_)w=_[T],S={},S.attribute=w,w.data&&(S.data=w.data),M[T]=S;x.attributes=M}}else T=!0===d.wireframe,(x.geometry!==f.id||x.program!==p.id||x.wireframe!==T)&&(x.geometry=f.id,x.program=p.id,x.wireframe=T,b=!0);if(!0===a.isInstancedMesh&&(b=!0),null!==y&&n.update(y,34963),b){if(!1!==i.isWebGL2||!a.isInstancedMesh&&!f.isInstancedBufferGeometry||null!==t.get("ANGLE_instanced_arrays")){for(var E in s(),T=f.attributes,p=p.getAttributes(),d=d.defaultAttributeValues,p)if(M=p[E],0<=M){var A=T[E];if(void 0!==A){b=A.normalized,_=A.itemSize;var L=n.get(A);if(void 0!==L)if(w=L.buffer,S=L.type,L=L.bytesPerElement,A.isInterleavedBufferAttribute){var C=A.data,R=C.stride;A=A.offset,C&&C.isInstancedInterleavedBuffer?(l(M,C.meshPerAttribute),void 0===f._maxInstanceCount&&(f._maxInstanceCount=C.meshPerAttribute*C.count)):c(M),e.bindBuffer(34962,w),h(M,_,S,b,R*L,A*L)}else A.isInstancedBufferAttribute?(l(M,A.meshPerAttribute),void 0===f._maxInstanceCount&&(f._maxInstanceCount=A.meshPerAttribute*A.count)):c(M),e.bindBuffer(34962,w),h(M,_,S,b,0,0)}else if("instanceMatrix"===E)_=n.get(a.instanceMatrix),void 0!==_&&(b=_.buffer,_=_.type,l(M+0,1),l(M+1,1),l(M+2,1),l(M+3,1),e.bindBuffer(34962,b),e.vertexAttribPointer(M+0,4,_,!1,64,0),e.vertexAttribPointer(M+1,4,_,!1,64,16),e.vertexAttribPointer(M+2,4,_,!1,64,32),e.vertexAttribPointer(M+3,4,_,!1,64,48));else if(void 0!==d&&(b=d[E],void 0!==b))switch(b.length){case 2:e.vertexAttrib2fv(M,b);break;case 3:e.vertexAttrib3fv(M,b);break;case 4:e.vertexAttrib4fv(M,b);break;default:e.vertexAttrib1fv(M,b)}}u()}null!==y&&e.bindBuffer(34963,n.get(y).buffer)}},reset:d,resetDefaultState:p,dispose:function(){for(var e in d(),v){var t,n=v[e];for(t in n){var i,r=n[t];for(i in r)a(r[i].object),delete r[i];delete n[t]}delete v[e]}},releaseStatesOfGeometry:function(e){if(void 0!==v[e.id]){var t,n=v[e.id];for(t in n){var i,r=n[t];for(i in r)a(r[i].object),delete r[i];delete n[t]}delete v[e.id]}},releaseStatesOfProgram:function(e){for(var t in v){var n=v[t];if(void 0!==n[e.id]){var i,r=n[e.id];for(i in r)a(r[i].object),delete r[i];delete n[e.id]}}},initAttributes:s,enableAttribute:c,disableUnusedAttributes:u}}function se(e,t,n,i){var r,a=i.isWebGL2;this.setMode=function(e){r=e},this.render=function(t,i){e.drawArrays(r,t,i),n.update(i,r)},this.renderInstances=function(i,o,s,c){if(0!==c){if(a){i=e;var l="drawArraysInstanced"}else if(i=t.get("ANGLE_instanced_arrays"),l="drawArraysInstancedANGLE",null===i)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");i[l](r,o,s,c),n.update(s,r,c)}}}function ce(e,t,n){function i(t){if("highp"===t){if(0<e.getShaderPrecisionFormat(35633,36338).precision&&0<e.getShaderPrecisionFormat(35632,36338).precision)return"highp";t="mediump"}return"mediump"===t&&0<e.getShaderPrecisionFormat(35633,36337).precision&&0<e.getShaderPrecisionFormat(35632,36337).precision?"mediump":"lowp"}var r,a="undefined"!==typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||"undefined"!==typeof WebGL2ComputeRenderingContext&&e instanceof WebGL2ComputeRenderingContext,o=void 0!==n.precision?n.precision:"highp",s=i(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s),n=!0===n.logarithmicDepthBuffer,s=e.getParameter(34930);var c=e.getParameter(35660),l=e.getParameter(3379),u=e.getParameter(34076),h=e.getParameter(34921),d=e.getParameter(36347),p=e.getParameter(36348),f=e.getParameter(36349),m=0<c,g=a||!!t.get("OES_texture_float"),v=m&&g,y=a?e.getParameter(36183):0;return{isWebGL2:a,getMaxAnisotropy:function(){if(void 0!==r)return r;var n=t.get("EXT_texture_filter_anisotropic");return r=null!==n?e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:i,precision:o,logarithmicDepthBuffer:n,maxTextures:s,maxVertexTextures:c,maxTextureSize:l,maxCubemapSize:u,maxAttributes:h,maxVertexUniforms:d,maxVaryings:p,maxFragmentUniforms:f,vertexTextures:m,floatFragmentTextures:g,floatVertexTextures:v,maxSamples:y}}function le(){function e(){u.value!==r&&(u.value=r,u.needsUpdate=0<a),n.numPlanes=a,n.numIntersection=0}function t(e,t,i,r){var a=null!==e?e.length:0,o=null;if(0!==a){if(o=u.value,!0!==r||null===o)for(r=i+4*a,t=t.matrixWorldInverse,l.getNormalMatrix(t),(null===o||o.length<r)&&(o=new Float32Array(r)),r=0;r!==a;++r,i+=4)c.copy(e[r]).applyMatrix4(t,l),c.normal.toArray(o,i),o[i+3]=c.constant;u.value=o,u.needsUpdate=!0}return n.numPlanes=a,n.numIntersection=0,o}var n=this,r=null,a=0,o=!1,s=!1,c=new b,l=new i,u={value:null,needsUpdate:!1};this.uniform=u,this.numIntersection=this.numPlanes=0,this.init=function(e,n,i){var s=0!==e.length||n||0!==a||o;return o=n,r=t(e,i,0),a=e.length,s},this.beginShadows=function(){s=!0,t(null)},this.endShadows=function(){s=!1,e()},this.setState=function(n,i,c,l,h,d){if(!o||null===n||0===n.length||s&&!c)s?t(null):e();else{c=s?0:a;var p=4*c,f=h.clippingState||null;for(u.value=f,f=t(n,l,p,d),n=0;n!==p;++n)f[n]=r[n];h.clippingState=f,this.numIntersection=i?this.numPlanes:0,this.numPlanes+=c}}}function ue(e){var t={};return{get:function(n){if(void 0!==t[n])return t[n];switch(n){case"WEBGL_depth_texture":var i=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=e.getExtension(n)}return null===i&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),t[n]=i}}}function he(e,t,n,i){function r(e){e=e.target;var a=o.get(e);for(var c in null!==a.index&&t.remove(a.index),a.attributes)t.remove(a.attributes[c]);e.removeEventListener("dispose",r),o.delete(e),(c=s.get(a))&&(t.remove(c),s.delete(a)),i.releaseStatesOfGeometry(e),!0===e.isInstancedBufferGeometry&&delete e._maxInstanceCount,n.memory.geometries--}function a(e){var n=[],i=e.index,r=e.attributes.position;if(null!==i){r=i.array,i=i.version;for(var a=0,o=r.length;a<o;a+=3){var c=r[a+0],l=r[a+1],u=r[a+2];n.push(c,l,l,u,u,c)}}else for(a=r.array,i=r.version,r=0,a=a.length/3-1;r<a;r+=3)o=r+0,c=r+1,l=r+2,n.push(o,c,c,l,l,o);n=new(65535<G(n)?B:D)(n,1),n.version=i,(i=s.get(e))&&t.remove(i),s.set(e,n)}var o=new WeakMap,s=new WeakMap;return{get:function(e,t){var i=o.get(t);return i||(t.addEventListener("dispose",r),t.isBufferGeometry?i=t:t.isGeometry&&(void 0===t._bufferGeometry&&(t._bufferGeometry=(new k).setFromObject(e)),i=t._bufferGeometry),o.set(t,i),n.memory.geometries++,i)},update:function(e){var n=e.attributes;for(r in n)t.update(n[r],34962);for(var i in e=e.morphAttributes,e){n=e[i];for(var r=0,a=n.length;r<a;r++)t.update(n[r],34962)}},getWireframeAttribute:function(e){var t=s.get(e);if(t){var n=e.index;null!==n&&t.version<n.version&&a(e)}else a(e);return s.get(e)}}}function de(e,t,n,i){var r,a,o,s=i.isWebGL2;this.setMode=function(e){r=e},this.setIndex=function(e){a=e.type,o=e.bytesPerElement},this.render=function(t,i){e.drawElements(r,i,a,t*o),n.update(i,r)},this.renderInstances=function(i,c,l,u){if(0!==u){if(s){i=e;var h="drawElementsInstanced"}else if(i=t.get("ANGLE_instanced_arrays"),h="drawElementsInstancedANGLE",null===i)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");i[h](r,l,a,c*o,u),n.update(l,r,u)}}}function pe(e){var t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function(){t.frame++,t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(e,n,i){switch(i=i||1,t.calls++,n){case 4:t.triangles+=e/3*i;break;case 1:t.lines+=e/2*i;break;case 3:t.lines+=i*(e-1);break;case 2:t.lines+=i*e;break;case 0:t.points+=i*e;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",n)}}}}function fe(e,t){return e[0]-t[0]}function me(e,t){return Math.abs(t[1])-Math.abs(e[1])}function ge(e){for(var t={},n=new Float32Array(8),i=[],r=0;8>r;r++)i[r]=[r,0];return{update:function(r,a,o,s){var c=r.morphTargetInfluences;r=void 0===c?0:c.length;var l=t[a.id];if(void 0===l){l=[];for(var u=0;u<r;u++)l[u]=[u,0];t[a.id]=l}for(u=0;u<r;u++){var h=l[u];h[0]=u,h[1]=c[u]}for(l.sort(me),c=0;8>c;c++)c<r&&l[c][1]?(i[c][0]=l[c][0],i[c][1]=l[c][1]):(i[c][0]=Number.MAX_SAFE_INTEGER,i[c][1]=0);for(i.sort(fe),r=o.morphTargets&&a.morphAttributes.position,o=o.morphNormals&&a.morphAttributes.normal,c=l=0;8>c;c++)h=i[c],u=h[0],h=h[1],u!==Number.MAX_SAFE_INTEGER&&h?(r&&a.getAttribute("morphTarget"+c)!==r[u]&&a.setAttribute("morphTarget"+c,r[u]),o&&a.getAttribute("morphNormal"+c)!==o[u]&&a.setAttribute("morphNormal"+c,o[u]),n[c]=h,l+=h):(r&&void 0!==a.getAttribute("morphTarget"+c)&&a.deleteAttribute("morphTarget"+c),o&&void 0!==a.getAttribute("morphNormal"+c)&&a.deleteAttribute("morphNormal"+c),n[c]=0);a=a.morphTargetsRelative?1:1-l,s.getUniforms().setValue(e,"morphTargetBaseInfluence",a),s.getUniforms().setValue(e,"morphTargetInfluences",n)}}}function ve(e,t,n,i){var r=new WeakMap;return{update:function(e){var a=i.render.frame,o=e.geometry,s=t.get(e,o);return r.get(s)!==a&&(o.isGeometry&&s.updateFromObject(e),t.update(s),r.set(s,a)),e.isInstancedMesh&&n.update(e.instanceMatrix,34962),s},dispose:function(){r=new WeakMap}}}function ye(e,t,n,i,a,o,s,c,l,u){e=void 0!==e?e:[],r.call(this,e,void 0!==t?t:301,n,i,a,o,void 0!==s?s:1022,c,l,u),this.flipY=!1}function xe(e,t,n,i){r.call(this,null),this.image={data:e||null,width:t||1,height:n||1,depth:i||1},this.minFilter=this.magFilter=1003,this.wrapR=1001,this.flipY=this.generateMipmaps=!1,this.needsUpdate=!0}function be(e,t,n,i){r.call(this,null),this.image={data:e||null,width:t||1,height:n||1,depth:i||1},this.minFilter=this.magFilter=1003,this.wrapR=1001,this.flipY=this.generateMipmaps=!1,this.needsUpdate=!0}function we(e,t,n){var i=e[0];if(0>=i||0<i)return e;var r=t*n,a=Ys[r];if(void 0===a&&(a=new Float32Array(r),Ys[r]=a),0!==t)for(i.toArray(a,0),i=1,r=0;i!==t;++i)r+=n,e[i].toArray(a,r);return a}function _e(e,t){if(e.length!==t.length)return!1;for(var n=0,i=e.length;n<i;n++)if(e[n]!==t[n])return!1;return!0}function Me(e,t){for(var n=0,i=t.length;n<i;n++)e[n]=t[n]}function Se(e,t){var n=Xs[t];void 0===n&&(n=new Int32Array(t),Xs[t]=n);for(var i=0;i!==t;++i)n[i]=e.allocateTextureUnit();return n}function Te(e,t){var n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function Ee(e,t){var n=this.cache;void 0!==t.x?n[0]===t.x&&n[1]===t.y||(e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y):_e(n,t)||(e.uniform2fv(this.addr,t),Me(n,t))}function Ae(e,t){var n=this.cache;void 0!==t.x?n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z):void 0!==t.r?n[0]===t.r&&n[1]===t.g&&n[2]===t.b||(e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b):_e(n,t)||(e.uniform3fv(this.addr,t),Me(n,t))}function Le(e,t){var n=this.cache;void 0!==t.x?n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w):_e(n,t)||(e.uniform4fv(this.addr,t),Me(n,t))}function Ce(e,t){var n=this.cache,i=t.elements;void 0===i?_e(n,t)||(e.uniformMatrix2fv(this.addr,!1,t),Me(n,t)):_e(n,i)||(Qs.set(i),e.uniformMatrix2fv(this.addr,!1,Qs),Me(n,i))}function Re(e,t){var n=this.cache,i=t.elements;void 0===i?_e(n,t)||(e.uniformMatrix3fv(this.addr,!1,t),Me(n,t)):_e(n,i)||(Js.set(i),e.uniformMatrix3fv(this.addr,!1,Js),Me(n,i))}function Pe(e,t){var n=this.cache,i=t.elements;void 0===i?_e(n,t)||(e.uniformMatrix4fv(this.addr,!1,t),Me(n,t)):_e(n,i)||(Zs.set(i),e.uniformMatrix4fv(this.addr,!1,Zs),Me(n,i))}function Oe(e,t,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.safeSetTexture2D(t||js,r)}function Ie(e,t,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.setTexture2DArray(t||Vs,r)}function De(e,t,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.setTexture3D(t||Ws,r)}function Ne(e,t,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.safeSetTextureCube(t||qs,r)}function Be(e,t){var n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function Fe(e,t){var n=this.cache;_e(n,t)||(e.uniform2iv(this.addr,t),Me(n,t))}function Ue(e,t){var n=this.cache;_e(n,t)||(e.uniform3iv(this.addr,t),Me(n,t))}function ze(e,t){var n=this.cache;_e(n,t)||(e.uniform4iv(this.addr,t),Me(n,t))}function Ge(e,t){var n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function ke(e){switch(e){case 5126:return Te;case 35664:return Ee;case 35665:return Ae;case 35666:return Le;case 35674:return Ce;case 35675:return Re;case 35676:return Pe;case 5124:case 35670:return Be;case 35667:case 35671:return Fe;case 35668:case 35672:return Ue;case 35669:case 35673:return ze;case 5125:return Ge;case 35678:case 36198:case 36298:case 36306:case 35682:return Oe;case 35679:case 36299:case 36307:return De;case 35680:case 36300:case 36308:case 36293:return Ne;case 36289:case 36303:case 36311:case 36292:return Ie}}function He(e,t){e.uniform1fv(this.addr,t)}function je(e,t){e.uniform1iv(this.addr,t)}function Ve(e,t){e.uniform2iv(this.addr,t)}function We(e,t){e.uniform3iv(this.addr,t)}function qe(e,t){e.uniform4iv(this.addr,t)}function Ye(e,t){t=we(t,this.size,2),e.uniform2fv(this.addr,t)}function Xe(e,t){t=we(t,this.size,3),e.uniform3fv(this.addr,t)}function Ze(e,t){t=we(t,this.size,4),e.uniform4fv(this.addr,t)}function Je(e,t){t=we(t,this.size,4),e.uniformMatrix2fv(this.addr,!1,t)}function Qe(e,t){t=we(t,this.size,9),e.uniformMatrix3fv(this.addr,!1,t)}function Ke(e,t){t=we(t,this.size,16),e.uniformMatrix4fv(this.addr,!1,t)}function $e(e,t,n){var i=t.length,r=Se(n,i);for(e.uniform1iv(this.addr,r),e=0;e!==i;++e)n.safeSetTexture2D(t[e]||js,r[e])}function et(e,t,n){var i=t.length,r=Se(n,i);for(e.uniform1iv(this.addr,r),e=0;e!==i;++e)n.safeSetTextureCube(t[e]||qs,r[e])}function tt(e){switch(e){case 5126:return He;case 35664:return Ye;case 35665:return Xe;case 35666:return Ze;case 35674:return Je;case 35675:return Qe;case 35676:return Ke;case 5124:case 35670:return je;case 35667:case 35671:return Ve;case 35668:case 35672:return We;case 35669:case 35673:return qe;case 35678:case 36198:case 36298:case 36306:case 35682:return $e;case 35680:case 36300:case 36308:case 36293:return et}}function nt(e,t,n){this.id=e,this.addr=n,this.cache=[],this.setValue=ke(t.type)}function it(e,t,n){this.id=e,this.addr=n,this.cache=[],this.size=t.size,this.setValue=tt(t.type)}function rt(e){this.id=e,this.seq=[],this.map={}}function at(e,t){this.seq=[],this.map={};for(var n=e.getProgramParameter(t,35718),i=0;i<n;++i){var r=e.getActiveUniform(t,i),a=e.getUniformLocation(t,r.name),o=this,s=r.name,c=s.length;for(Ks.lastIndex=0;;){var l=Ks.exec(s),u=Ks.lastIndex,h=l[1],d=l[3];if("]"===l[2]&&(h|=0),void 0===d||"["===d&&u+2===c){s=o,r=void 0===d?new nt(h,r,a):new it(h,r,a),s.seq.push(r),s.map[r.id]=r;break}d=o.map[h],void 0===d&&(d=new rt(h),h=o,o=d,h.seq.push(o),h.map[o.id]=o),o=d}}}function ot(e,t,n){return t=e.createShader(t),e.shaderSource(t,n),e.compileShader(t),t}function st(e){switch(e){case 3e3:return["Linear","( value )"];case 3001:return["sRGB","( value )"];case 3002:return["RGBE","( value )"];case 3004:return["RGBM","( value, 7.0 )"];case 3005:return["RGBM","( value, 16.0 )"];case 3006:return["RGBD","( value, 256.0 )"];case 3007:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case 3003:return["LogLuv","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",e),["Linear","( value )"]}}function ct(e,t,n){var i=e.getShaderParameter(t,35713),r=e.getShaderInfoLog(t).trim();if(i&&""===r)return"";for(e=e.getShaderSource(t).split("\n"),t=0;t<e.length;t++)e[t]=t+1+": "+e[t];return e=e.join("\n"),"THREE.WebGLShader: gl.getShaderInfoLog() "+n+"\n"+r+e}function lt(e,t){return t=st(t),"vec4 "+e+"( vec4 value ) { return "+t[0]+"ToLinear"+t[1]+"; }"}function ut(e,t){return t=st(t),"vec4 "+e+"( vec4 value ) { return LinearTo"+t[0]+t[1]+"; }"}function ht(e,t){switch(t){case 1:t="Linear";break;case 2:t="Reinhard";break;case 3:t="OptimizedCineon";break;case 4:t="ACESFilmic";break;case 5:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",t),t="Linear"}return"vec3 "+e+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function dt(e){var t,n=[];for(t in e){var i=e[t];!1!==i&&n.push("#define "+t+" "+i)}return n.join("\n")}function pt(e){return""!==e}function ft(e,t){return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function mt(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}function gt(e,t){if(e=ks[t],void 0===e)throw Error("Can not resolve #include <"+t+">");return e.replace(ec,gt)}function vt(e,t,n,i){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),yt(e,t,n,i)}function yt(e,t,n,i){for(e="",t=parseInt(t);t<parseInt(n);t++)e+=i.replace(/\[ i \]/g,"[ "+t+" ]").replace(/UNROLLED_LOOP_INDEX/g,t);return e}function xt(e){var t="precision "+e.precision+" float;\nprecision "+e.precision+" int;";return"highp"===e.precision?t+="\n#define HIGH_PRECISION":"mediump"===e.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===e.precision&&(t+="\n#define LOW_PRECISION"),t}function bt(e){var t="SHADOWMAP_TYPE_BASIC";return 1===e.shadowMapType?t="SHADOWMAP_TYPE_PCF":2===e.shadowMapType?t="SHADOWMAP_TYPE_PCF_SOFT":3===e.shadowMapType&&(t="SHADOWMAP_TYPE_VSM"),t}function wt(e){var t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case 301:case 302:t="ENVMAP_TYPE_CUBE";break;case 306:case 307:t="ENVMAP_TYPE_CUBE_UV";break;case 303:case 304:t="ENVMAP_TYPE_EQUIREC"}return t}function _t(e){var t="ENVMAP_MODE_REFLECTION";if(e.envMap)switch(e.envMapMode){case 302:case 304:t="ENVMAP_MODE_REFRACTION"}return t}function Mt(e){var t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case 0:t="ENVMAP_BLENDING_MULTIPLY";break;case 1:t="ENVMAP_BLENDING_MIX";break;case 2:t="ENVMAP_BLENDING_ADD"}return t}function St(e,t,n,i){var r,a,o=e.getContext(),s=n.defines,c=n.vertexShader,l=n.fragmentShader,u=bt(n),h=wt(n),d=_t(n),p=Mt(n),f=0<e.gammaFactor?e.gammaFactor:1,m=n.isWebGL2?"":[n.extensionDerivatives||n.envMapCubeUV||n.bumpMap||n.tangentSpaceNormalMap||n.clearcoatNormalMap||n.flatShading||"physical"===n.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(n.extensionFragDepth||n.logarithmicDepthBuffer)&&n.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",n.extensionDrawBuffers&&n.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(pt).join("\n"),g=dt(s),v=o.createProgram();return n.isRawShaderMaterial?(s=[g].filter(pt).join("\n"),0<s.length&&(s+="\n"),u=[m,g].filter(pt).join("\n"),0<u.length&&(u+="\n")):(s=[xt(n),"#define SHADER_NAME "+n.shaderName,g,n.instancing?"#define USE_INSTANCING":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+f,"#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 "+d:"",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.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",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 "+u:"",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(pt).join("\n"),u=[m,xt(n),"#define SHADER_NAME "+n.shaderName,g,n.alphaTest?"#define ALPHATEST "+n.alphaTest+(n.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+f,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 "+h:"",n.envMap?"#define "+d:"",n.envMap?"#define "+p:"",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.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",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 "+u:"",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;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?ks.tonemapping_pars_fragment:"",0!==n.toneMapping?ht("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",ks.encodings_pars_fragment,n.map?lt("mapTexelToLinear",n.mapEncoding):"",n.matcap?lt("matcapTexelToLinear",n.matcapEncoding):"",n.envMap?lt("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMap?lt("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMap?lt("lightMapTexelToLinear",n.lightMapEncoding):"",ut("linearToOutputTexel",n.outputEncoding),n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(pt).join("\n")),c=c.replace(ec,gt),c=ft(c,n),c=mt(c,n),l=l.replace(ec,gt),l=ft(l,n),l=mt(l,n),c=c.replace(nc,yt).replace(tc,vt),l=l.replace(nc,yt).replace(tc,vt),n.isWebGL2&&!n.isRawShaderMaterial&&(h=!1,d=/^\s*#version\s+300\s+es\s*\n/,n.isShaderMaterial&&null!==c.match(d)&&null!==l.match(d)&&(h=!0,c=c.replace(d,""),l=l.replace(d,"")),s="#version 300 es\n\n#define attribute in\n#define varying out\n#define texture2D texture\n"+s,u=["#version 300 es\n\n#define varying in",h?"":"out highp vec4 pc_fragColor;",h?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth\n#define texture2D texture\n#define textureCube texture\n#define texture2DProj textureProj\n#define texture2DLodEXT textureLod\n#define texture2DProjLodEXT textureProjLod\n#define textureCubeLodEXT textureLod\n#define texture2DGradEXT textureGrad\n#define texture2DProjGradEXT textureProjGrad\n#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+u),l=u+l,c=ot(o,35633,s+c),l=ot(o,35632,l),o.attachShader(v,c),o.attachShader(v,l),void 0!==n.index0AttributeName?o.bindAttribLocation(v,0,n.index0AttributeName):!0===n.morphTargets&&o.bindAttribLocation(v,0,"position"),o.linkProgram(v),e.debug.checkShaderErrors&&(e=o.getProgramInfoLog(v).trim(),h=o.getShaderInfoLog(c).trim(),d=o.getShaderInfoLog(l).trim(),f=p=!0,!1===o.getProgramParameter(v,35714)?(p=!1,m=ct(o,c,"vertex"),g=ct(o,l,"fragment"),console.error("THREE.WebGLProgram: shader error: ",o.getError(),"35715",o.getProgramParameter(v,35715),"gl.getProgramInfoLog",e,m,g)):""!==e?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",e):""!==h&&""!==d||(f=!1),f&&(this.diagnostics={runnable:p,programLog:e,vertexShader:{log:h,prefix:s},fragmentShader:{log:d,prefix:u}})),o.deleteShader(c),o.deleteShader(l),this.getUniforms=function(){return void 0===r&&(r=new at(o,v)),r},this.getAttributes=function(){if(void 0===a){for(var e={},t=o.getProgramParameter(v,35721),n=0;n<t;n++){var i=o.getActiveAttrib(v,n).name;e[i]=o.getAttribLocation(v,i)}a=e}return a},this.destroy=function(){i.releaseStatesOfProgram(this),o.deleteProgram(v),this.program=void 0},this.name=n.shaderName,this.id=$s++,this.cacheKey=t,this.usedTimes=1,this.program=v,this.vertexShader=c,this.fragmentShader=l,this}function Tt(e,t,n,i){function r(e){if(e)e.isTexture?t=e.encoding:e.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),t=e.texture.encoding);else var t=3e3;return t}var a=[],o=n.isWebGL2,s=n.logarithmicDepthBuffer,c=n.floatVertexTextures,l=n.maxVertexUniforms,u=n.vertexTextures,h=n.precision,d={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},p="precision isWebGL2 supportsVertexTextures outputEncoding instancing map mapEncoding matcap matcapEncoding envMap envMapMode envMapEncoding envMapCubeUV lightMap lightMapEncoding aoMap emissiveMap emissiveMapEncoding bumpMap normalMap objectSpaceNormalMap tangentSpaceNormalMap clearcoatMap clearcoatRoughnessMap clearcoatNormalMap displacementMap specularMap roughnessMap metalnessMap gradientMap alphaMap combine vertexColors vertexTangents vertexUvs uvsVertexOnly fog useFog fogExp2 flatShading sizeAttenuation logarithmicDepthBuffer skinning maxBones useVertexTexture morphTargets morphNormals maxMorphTargets maxMorphNormals premultipliedAlpha numDirLights numPointLights numSpotLights numHemiLights numRectAreaLights numDirLightShadows numPointLightShadows numSpotLightShadows shadowMapEnabled shadowMapType toneMapping physicallyCorrectLights alphaTest doubleSided flipSided numClippingPlanes numClipIntersection depthPacking dithering sheen".split(" ");return{getParameters:function(i,a,p,f,m,g,v){var y=f.fog;f=i.isMeshStandardMaterial?f.environment:null,f=i.envMap||f;var x=d[i.type];if(v.isSkinnedMesh){var b=v.skeleton.bones;if(c)b=1024;else{var w=Math.min(Math.floor((l-20)/4),b.length);w<b.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+b.length+" bones. This GPU supports "+w+"."),b=0):b=w}}else b=0;null!==i.precision&&(h=n.getMaxPrecision(i.precision),h!==i.precision&&console.warn("THREE.WebGLProgram.getParameters:",i.precision,"not supported, using",h,"instead.")),x?(w=Hs[x],w={name:i.name||i.type,uniforms:Fs.clone(w.uniforms),vertexShader:w.vertexShader,fragmentShader:w.fragmentShader}):w={name:i.name||i.type,uniforms:i.uniforms,vertexShader:i.vertexShader,fragmentShader:i.fragmentShader},i.onBeforeCompile(w,e);var _=e.getRenderTarget();return{isWebGL2:o,shaderID:x,shaderName:w.name,uniforms:w.uniforms,vertexShader:w.vertexShader,fragmentShader:w.fragmentShader,defines:i.defines,isRawShaderMaterial:i.isRawShaderMaterial,isShaderMaterial:i.isShaderMaterial,precision:h,instancing:!0===v.isInstancedMesh,supportsVertexTextures:u,outputEncoding:null!==_?r(_.texture):e.outputEncoding,map:!!i.map,mapEncoding:r(i.map),matcap:!!i.matcap,matcapEncoding:r(i.matcap),envMap:!!f,envMapMode:f&&f.mapping,envMapEncoding:r(f),envMapCubeUV:!!f&&(306===f.mapping||307===f.mapping),lightMap:!!i.lightMap,lightMapEncoding:r(i.lightMap),aoMap:!!i.aoMap,emissiveMap:!!i.emissiveMap,emissiveMapEncoding:r(i.emissiveMap),bumpMap:!!i.bumpMap,normalMap:!!i.normalMap,objectSpaceNormalMap:1===i.normalMapType,tangentSpaceNormalMap:0===i.normalMapType,clearcoatMap:!!i.clearcoatMap,clearcoatRoughnessMap:!!i.clearcoatRoughnessMap,clearcoatNormalMap:!!i.clearcoatNormalMap,displacementMap:!!i.displacementMap,roughnessMap:!!i.roughnessMap,metalnessMap:!!i.metalnessMap,specularMap:!!i.specularMap,alphaMap:!!i.alphaMap,gradientMap:!!i.gradientMap,sheen:!!i.sheen,combine:i.combine,vertexTangents:i.normalMap&&i.vertexTangents,vertexColors:i.vertexColors,vertexUvs:!!i.map||!!i.bumpMap||!!i.normalMap||!!i.specularMap||!!i.alphaMap||!!i.emissiveMap||!!i.roughnessMap||!!i.metalnessMap||!!i.clearcoatMap||!!i.clearcoatRoughnessMap||!!i.clearcoatNormalMap||!!i.displacementMap,uvsVertexOnly:!(i.map||i.bumpMap||i.normalMap||i.specularMap||i.alphaMap||i.emissiveMap||i.roughnessMap||i.metalnessMap||i.clearcoatNormalMap)&&!!i.displacementMap,fog:!!y,useFog:i.fog,fogExp2:y&&y.isFogExp2,flatShading:i.flatShading,sizeAttenuation:i.sizeAttenuation,logarithmicDepthBuffer:s,skinning:i.skinning&&0<b,maxBones:b,useVertexTexture:c,morphTargets:i.morphTargets,morphNormals:i.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:a.directional.length,numPointLights:a.point.length,numSpotLights:a.spot.length,numRectAreaLights:a.rectArea.length,numHemiLights:a.hemi.length,numDirLightShadows:a.directionalShadowMap.length,numPointLightShadows:a.pointShadowMap.length,numSpotLightShadows:a.spotShadowMap.length,numClippingPlanes:m,numClipIntersection:g,dithering:i.dithering,shadowMapEnabled:e.shadowMap.enabled&&0<p.length,shadowMapType:e.shadowMap.type,toneMapping:i.toneMapped?e.toneMapping:0,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:i.premultipliedAlpha,alphaTest:i.alphaTest,doubleSided:2===i.side,flipSided:1===i.side,depthPacking:void 0!==i.depthPacking&&i.depthPacking,index0AttributeName:i.index0AttributeName,extensionDerivatives:i.extensions&&i.extensions.derivatives,extensionFragDepth:i.extensions&&i.extensions.fragDepth,extensionDrawBuffers:i.extensions&&i.extensions.drawBuffers,extensionShaderTextureLOD:i.extensions&&i.extensions.shaderTextureLOD,rendererExtensionFragDepth:o||null!==t.get("EXT_frag_depth"),rendererExtensionDrawBuffers:o||null!==t.get("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:o||null!==t.get("EXT_shader_texture_lod"),customProgramCacheKey:i.customProgramCacheKey()}},getProgramCacheKey:function(t){var n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.fragmentShader),n.push(t.vertexShader)),void 0!==t.defines)for(var i in t.defines)n.push(i),n.push(t.defines[i]);if(void 0===t.isRawShaderMaterial){for(i=0;i<p.length;i++)n.push(t[p[i]]);n.push(e.outputEncoding),n.push(e.gammaFactor)}return n.push(t.customProgramCacheKey),n.join()},acquireProgram:function(t,n){for(var r,o=0,s=a.length;o<s;o++){var c=a[o];if(c.cacheKey===n){r=c,++r.usedTimes;break}}return void 0===r&&(r=new St(e,n,t,i),a.push(r)),r},releaseProgram:function(e){if(0===--e.usedTimes){var t=a.indexOf(e);a[t]=a[a.length-1],a.pop(),e.destroy()}},programs:a}}function Et(){var e=new WeakMap;return{get:function(t){var n=e.get(t);return void 0===n&&(n={},e.set(t,n)),n},remove:function(t){e.delete(t)},update:function(t,n,i){e.get(t)[n]=i},dispose:function(){e=new WeakMap}}}function At(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.program!==t.program?e.program.id-t.program.id:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function Lt(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function Ct(){function e(e,i,r,o,s,c){var l=t[n];return void 0===l?(l={id:e.id,object:e,geometry:i,material:r,program:r.program||a,groupOrder:o,renderOrder:e.renderOrder,z:s,group:c},t[n]=l):(l.id=e.id,l.object=e,l.geometry=i,l.material=r,l.program=r.program||a,l.groupOrder=o,l.renderOrder=e.renderOrder,l.z=s,l.group=c),n++,l}var t=[],n=0,i=[],r=[],a={id:-1};return{opaque:i,transparent:r,init:function(){n=0,i.length=0,r.length=0},push:function(t,n,a,o,s,c){t=e(t,n,a,o,s,c),(!0===a.transparent?r:i).push(t)},unshift:function(t,n,a,o,s,c){t=e(t,n,a,o,s,c),(!0===a.transparent?r:i).unshift(t)},finish:function(){for(var e=n,i=t.length;e<i;e++){var r=t[e];if(null===r.id)break;r.id=null,r.object=null,r.geometry=null,r.material=null,r.program=null,r.group=null}},sort:function(e,t){1<i.length&&i.sort(e||At),1<r.length&&r.sort(t||Lt)}}}function Rt(){function e(n){n=n.target,n.removeEventListener("dispose",e),t.delete(n)}var t=new WeakMap;return{get:function(n,i){var r=t.get(n);if(void 0===r){var a=new Ct;t.set(n,new WeakMap),t.get(n).set(i,a),n.addEventListener("dispose",e)}else a=r.get(i),void 0===a&&(a=new Ct,r.set(i,a));return a},dispose:function(){t=new WeakMap}}}function Pt(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];switch(t.type){case"DirectionalLight":var n={direction:new u,color:new _};break;case"SpotLight":n={position:new u,direction:new u,color:new _,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new u,color:new _,distance:0,decay:0};break;case"HemisphereLight":n={direction:new u,skyColor:new _,groundColor:new _};break;case"RectAreaLight":n={color:new _,position:new u,halfWidth:new u,halfHeight:new u}}return e[t.id]=n}}}function Ot(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];switch(t.type){case"DirectionalLight":var i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new n};break;case"SpotLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new n};break;case"PointLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new n,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=i}}}function It(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function Dt(){for(var e=new Pt,t=Ot(),n={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:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},i=0;9>i;i++)n.probe.push(new u);var r=new u,a=new h,o=new h;return{setup:function(i,s,c){for(var l=s=0,u=0,h=0;9>h;h++)n.probe[h].set(0,0,0);var d=h=0,p=0,f=0,m=0,g=0,v=0,y=0;c=c.matrixWorldInverse,i.sort(It);for(var x=0,b=i.length;x<b;x++){var w=i[x],_=w.color,M=w.intensity,S=w.distance,T=w.shadow&&w.shadow.map?w.shadow.map.texture:null;if(w.isAmbientLight)s+=_.r*M,l+=_.g*M,u+=_.b*M;else if(w.isLightProbe)for(T=0;9>T;T++)n.probe[T].addScaledVector(w.sh.coefficients[T],M);else if(w.isDirectionalLight){if(M=e.get(w),M.color.copy(w.color).multiplyScalar(w.intensity),M.direction.setFromMatrixPosition(w.matrixWorld),r.setFromMatrixPosition(w.target.matrixWorld),M.direction.sub(r),M.direction.transformDirection(c),w.castShadow){var E=w.shadow;_=t.get(w),_.shadowBias=E.bias,_.shadowNormalBias=E.normalBias,_.shadowRadius=E.radius,_.shadowMapSize=E.mapSize,n.directionalShadow[h]=_,n.directionalShadowMap[h]=T,n.directionalShadowMatrix[h]=w.shadow.matrix,g++}n.directional[h]=M,h++}else w.isSpotLight?(E=e.get(w),E.position.setFromMatrixPosition(w.matrixWorld),E.position.applyMatrix4(c),E.color.copy(_).multiplyScalar(M),E.distance=S,E.direction.setFromMatrixPosition(w.matrixWorld),r.setFromMatrixPosition(w.target.matrixWorld),E.direction.sub(r),E.direction.transformDirection(c),E.coneCos=Math.cos(w.angle),E.penumbraCos=Math.cos(w.angle*(1-w.penumbra)),E.decay=w.decay,w.castShadow&&(M=w.shadow,_=t.get(w),_.shadowBias=M.bias,_.shadowNormalBias=M.normalBias,_.shadowRadius=M.radius,_.shadowMapSize=M.mapSize,n.spotShadow[p]=_,n.spotShadowMap[p]=T,n.spotShadowMatrix[p]=w.shadow.matrix,y++),n.spot[p]=E,p++):w.isRectAreaLight?(T=e.get(w),T.color.copy(_).multiplyScalar(M),T.position.setFromMatrixPosition(w.matrixWorld),T.position.applyMatrix4(c),o.identity(),a.copy(w.matrixWorld),a.premultiply(c),o.extractRotation(a),T.halfWidth.set(.5*w.width,0,0),T.halfHeight.set(0,.5*w.height,0),T.halfWidth.applyMatrix4(o),T.halfHeight.applyMatrix4(o),n.rectArea[f]=T,f++):w.isPointLight?(M=e.get(w),M.position.setFromMatrixPosition(w.matrixWorld),M.position.applyMatrix4(c),M.color.copy(w.color).multiplyScalar(w.intensity),M.distance=w.distance,M.decay=w.decay,w.castShadow&&(E=w.shadow,_=t.get(w),_.shadowBias=E.bias,_.shadowNormalBias=E.normalBias,_.shadowRadius=E.radius,_.shadowMapSize=E.mapSize,_.shadowCameraNear=E.camera.near,_.shadowCameraFar=E.camera.far,n.pointShadow[d]=_,n.pointShadowMap[d]=T,n.pointShadowMatrix[d]=w.shadow.matrix,v++),n.point[d]=M,d++):w.isHemisphereLight&&(T=e.get(w),T.direction.setFromMatrixPosition(w.matrixWorld),T.direction.transformDirection(c),T.direction.normalize(),T.skyColor.copy(w.color).multiplyScalar(M),T.groundColor.copy(w.groundColor).multiplyScalar(M),n.hemi[m]=T,m++)}n.ambient[0]=s,n.ambient[1]=l,n.ambient[2]=u,i=n.hash,i.directionalLength===h&&i.pointLength===d&&i.spotLength===p&&i.rectAreaLength===f&&i.hemiLength===m&&i.numDirectionalShadows===g&&i.numPointShadows===v&&i.numSpotShadows===y||(n.directional.length=h,n.spot.length=p,n.rectArea.length=f,n.point.length=d,n.hemi.length=m,n.directionalShadow.length=g,n.directionalShadowMap.length=g,n.pointShadow.length=v,n.pointShadowMap.length=v,n.spotShadow.length=y,n.spotShadowMap.length=y,n.directionalShadowMatrix.length=g,n.pointShadowMatrix.length=v,n.spotShadowMatrix.length=y,i.directionalLength=h,i.pointLength=d,i.spotLength=p,i.rectAreaLength=f,i.hemiLength=m,i.numDirectionalShadows=g,i.numPointShadows=v,i.numSpotShadows=y,n.version=ic++)},state:n}}function Nt(){var e=new Dt,t=[],n=[];return{init:function(){t.length=0,n.length=0},state:{lightsArray:t,shadowsArray:n,lights:e},setupLights:function(i){e.setup(t,n,i)},pushLight:function(e){t.push(e)},pushShadow:function(e){n.push(e)}}}function Bt(){function e(n){n=n.target,n.removeEventListener("dispose",e),t.delete(n)}var t=new WeakMap;return{get:function(n,i){if(!1===t.has(n)){var r=new Nt;t.set(n,new WeakMap),t.get(n).set(i,r),n.addEventListener("dispose",e)}else!1===t.get(n).has(i)?(r=new Nt,t.get(n).set(i,r)):r=t.get(n).get(i);return r},dispose:function(){t=new WeakMap}}}function Ft(e){A.call(this),this.type="MeshDepthMaterial",this.depthPacking=3200,this.morphTargets=this.skinning=!1,this.displacementMap=this.alphaMap=this.map=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}function Ut(e){A.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new u,this.nearDistance=1,this.farDistance=1e3,this.morphTargets=this.skinning=!1,this.displacementMap=this.alphaMap=this.map=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}function zt(e,t,i){function r(e,t,n){n=e<<0|t<<1|n<<2;var i=f[n];return void 0===i&&(i=new Ft({depthPacking:3201,morphTargets:e,skinning:t}),f[n]=i),i}function a(e,t,n){n=e<<0|t<<1|n<<2;var i=m[n];return void 0===i&&(i=new Ut({morphTargets:e,skinning:t}),m[n]=i),i}function c(t,n,i,o,s,c,l){var u=r,h=t.customDepthMaterial;return!0===o.isPointLight&&(u=a,h=t.customDistanceMaterial),void 0===h?(h=!1,!0===i.morphTargets&&(h=n.morphAttributes&&n.morphAttributes.position&&0<n.morphAttributes.position.length),n=!1,!0===t.isSkinnedMesh&&(!0===i.skinning?n=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t)),t=u(h,n,!0===t.isInstancedMesh)):t=h,e.localClippingEnabled&&!0===i.clipShadows&&0!==i.clippingPlanes.length&&(h=t.uuid,u=i.uuid,n=g[h],void 0===n&&(n={},g[h]=n),h=n[u],void 0===h&&(h=t.clone(),n[u]=h),t=h),t.visible=i.visible,t.wireframe=i.wireframe,t.side=3===l?null!==i.shadowSide?i.shadowSide:i.side:null!==i.shadowSide?i.shadowSide:v[i.side],t.clipShadows=i.clipShadows,t.clippingPlanes=i.clippingPlanes,t.clipIntersection=i.clipIntersection,t.wireframeLinewidth=i.wireframeLinewidth,t.linewidth=i.linewidth,!0===o.isPointLight&&!0===t.isMeshDistanceMaterial&&(t.referencePosition.setFromMatrixPosition(o.matrixWorld),t.nearDistance=s,t.farDistance=c),t}function l(n,i,r,a,o){if(!1!==n.visible){if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&3===o)&&(!n.frustumCulled||u.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(r.matrixWorldInverse,n.matrixWorld);var s=t.update(n),h=n.material;if(Array.isArray(h))for(var d=s.groups,p=0,f=d.length;p<f;p++){var m=d[p],g=h[m.materialIndex];g&&g.visible&&(g=c(n,s,g,a,r.near,r.far,o),e.renderBufferDirect(r,null,s,g,n,m))}else h.visible&&(h=c(n,s,h,a,r.near,r.far,o),e.renderBufferDirect(r,null,s,h,n,null))}for(n=n.children,s=0,h=n.length;s<h;s++)l(n[s],i,r,a,o)}}var u=new ee,h=new n,d=new n,p=new o,f=[],m=[],g={},v={0:1,1:0,2:2},y=new X({defines:{SAMPLE_RATE:.25,HALF_SAMPLE_RATE:.125},uniforms:{shadow_pass:{value:null},resolution:{value:new n},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\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}"}),x=y.clone();x.defines.HORIZONAL_PASS=1;var b=new k;b.setAttribute("position",new C(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var w=new H(b,y),_=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1,this.render=function(n,r,a){if(!1!==_.enabled&&(!1!==_.autoUpdate||!1!==_.needsUpdate)&&0!==n.length){var o=e.getRenderTarget(),c=e.getActiveCubeFace(),f=e.getActiveMipmapLevel(),m=e.state;m.setBlending(0),m.buffers.color.setClear(1,1,1,1),m.buffers.depth.setTest(!0),m.setScissorTest(!1);for(var g=0,v=n.length;g<v;g++){var b=n[g],M=b.shadow;if(!1!==M.autoUpdate||!1!==M.needsUpdate)if(void 0===M)console.warn("THREE.WebGLShadowMap:",b,"has no shadow.");else{h.copy(M.mapSize);var S=M.getFrameExtents();h.multiply(S),d.copy(M.mapSize),(h.x>i||h.y>i)&&(h.x>i&&(d.x=Math.floor(i/S.x),h.x=d.x*S.x,M.mapSize.x=d.x),h.y>i&&(d.y=Math.floor(i/S.y),h.y=d.y*S.y,M.mapSize.y=d.y)),null!==M.map||M.isPointLightShadow||3!==this.type||(S={minFilter:1006,magFilter:1006,format:1023},M.map=new s(h.x,h.y,S),M.map.texture.name=b.name+".shadowMap",M.mapPass=new s(h.x,h.y,S),M.camera.updateProjectionMatrix()),null===M.map&&(M.map=new s(h.x,h.y,{minFilter:1003,magFilter:1003,format:1023}),M.map.texture.name=b.name+".shadowMap",M.camera.updateProjectionMatrix()),e.setRenderTarget(M.map),e.clear(),S=M.getViewportCount();for(var T=0;T<S;T++){var E=M.getViewport(T);p.set(d.x*E.x,d.y*E.y,d.x*E.z,d.y*E.w),m.viewport(p),M.updateMatrices(b,T),u=M.getFrustum(),l(r,a,M.camera,b,this.type)}M.isPointLightShadow||3!==this.type||(b=M,S=a,T=t.update(w),y.uniforms.shadow_pass.value=b.map.texture,y.uniforms.resolution.value=b.mapSize,y.uniforms.radius.value=b.radius,e.setRenderTarget(b.mapPass),e.clear(),e.renderBufferDirect(S,null,T,y,w,null),x.uniforms.shadow_pass.value=b.mapPass.texture,x.uniforms.resolution.value=b.mapSize,x.uniforms.radius.value=b.radius,e.setRenderTarget(b.map),e.clear(),e.renderBufferDirect(S,null,T,x,w,null)),M.needsUpdate=!1}}_.needsUpdate=!1,e.setRenderTarget(o,c,f)}}}function Gt(e,t,n){function i(t,n,i){var r=new Uint8Array(4),a=e.createTexture();for(e.bindTexture(t,a),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728),t=0;t<i;t++)e.texImage2D(n+t,0,6408,1,1,0,6408,5121,r);return a}function r(t){!0!==m[t]&&(e.enable(t),m[t]=!0)}function a(t){!1!==m[t]&&(e.disable(t),m[t]=!1)}function s(t,n,i,o,s,c,l,u){if(0===t)v&&(a(3042),v=!1);else if(v||(r(3042),v=!0),5!==t){if(t!==y||u!==T){if(100===x&&100===_||(e.blendEquation(32774),_=x=100),u)switch(t){case 1:e.blendFuncSeparate(1,771,1,771);break;case 2:e.blendFunc(1,1);break;case 3:e.blendFuncSeparate(0,0,769,771);break;case 4:e.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case 1:e.blendFuncSeparate(770,771,1,771);break;case 2:e.blendFunc(770,1);break;case 3:e.blendFunc(0,769);break;case 4:e.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}S=M=w=b=null,y=t,T=u}}else s=s||n,c=c||i,l=l||o,n===x&&s===_||(e.blendEquationSeparate(z[n],z[s]),x=n,_=s),i===b&&o===w&&c===M&&l===S||(e.blendFuncSeparate(G[i],G[o],G[c],G[l]),b=i,w=o,M=c,S=l),y=t,T=null}function c(t){E!==t&&(t?e.frontFace(2304):e.frontFace(2305),E=t)}function l(t){0!==t?(r(2884),t!==A&&(1===t?e.cullFace(1029):2===t?e.cullFace(1028):e.cullFace(1032))):a(2884),A=t}function u(t,n,i){t?(r(32823),(C!==n||R!==i)&&(e.polygonOffset(n,i),C=n,R=i)):a(32823)}function h(t){void 0===t&&(t=33984+P-1),D!==t&&(e.activeTexture(t),D=t)}n=n.isWebGL2;var d=new function(){var t=!1,n=new o,i=null,r=new o(0,0,0,0);return{setMask:function(n){i===n||t||(e.colorMask(n,n,n,n),i=n)},setLocked:function(e){t=e},setClear:function(t,i,a,o,s){!0===s&&(t*=o,i*=o,a*=o),n.set(t,i,a,o),!1===r.equals(n)&&(e.clearColor(t,i,a,o),r.copy(n))},reset:function(){t=!1,i=null,r.set(-1,0,0,0)}}},p=new function(){var t=!1,n=null,i=null,o=null;return{setTest:function(e){e?r(2929):a(2929)},setMask:function(i){n===i||t||(e.depthMask(i),n=i)},setFunc:function(t){if(i!==t){if(t)switch(t){case 0:e.depthFunc(512);break;case 1:e.depthFunc(519);break;case 2:e.depthFunc(513);break;case 3:e.depthFunc(515);break;case 4:e.depthFunc(514);break;case 5:e.depthFunc(518);break;case 6:e.depthFunc(516);break;case 7:e.depthFunc(517);break;default:e.depthFunc(515)}else e.depthFunc(515);i=t}},setLocked:function(e){t=e},setClear:function(t){o!==t&&(e.clearDepth(t),o=t)},reset:function(){t=!1,o=i=n=null}}},f=new function(){var t=!1,n=null,i=null,o=null,s=null,c=null,l=null,u=null,h=null;return{setTest:function(e){t||(e?r(2960):a(2960))},setMask:function(i){n===i||t||(e.stencilMask(i),n=i)},setFunc:function(t,n,r){i===t&&o===n&&s===r||(e.stencilFunc(t,n,r),i=t,o=n,s=r)},setOp:function(t,n,i){c===t&&l===n&&u===i||(e.stencilOp(t,n,i),c=t,l=n,u=i)},setLocked:function(e){t=e},setClear:function(t){h!==t&&(e.clearStencil(t),h=t)},reset:function(){t=!1,h=u=l=c=s=o=i=n=null}}},m={},g=null,v=null,y=null,x=null,b=null,w=null,_=null,M=null,S=null,T=!1,E=null,A=null,L=null,C=null,R=null,P=e.getParameter(35661),O=!1,I=0;I=e.getParameter(7938),-1!==I.indexOf("WebGL")?(I=parseFloat(/^WebGL ([0-9])/.exec(I)[1]),O=1<=I):-1!==I.indexOf("OpenGL ES")&&(I=parseFloat(/^OpenGL ES ([0-9])/.exec(I)[1]),O=2<=I);var D=null,N={},B=new o,F=new o,U={};U[3553]=i(3553,3553,1),U[34067]=i(34067,34069,6),d.setClear(0,0,0,1),p.setClear(1),f.setClear(0),r(2929),p.setFunc(3),c(!1),l(1),r(2884),s(0);var z={100:32774,101:32778,102:32779};n?(z[103]=32775,z[104]=32776):(t=t.get("EXT_blend_minmax"),null!==t&&(z[103]=t.MIN_EXT,z[104]=t.MAX_EXT));var G={200:0,201:1,202:768,204:770,210:776,208:774,206:772,203:769,205:771,209:775,207:773};return{buffers:{color:d,depth:p,stencil:f},enable:r,disable:a,useProgram:function(t){return g!==t&&(e.useProgram(t),g=t,!0)},setBlending:s,setMaterial:function(e,t){2===e.side?a(2884):r(2884);var n=1===e.side;t&&(n=!n),c(n),1===e.blending&&!1===e.transparent?s(0):s(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha),p.setFunc(e.depthFunc),p.setTest(e.depthTest),p.setMask(e.depthWrite),d.setMask(e.colorWrite),t=e.stencilWrite,f.setTest(t),t&&(f.setMask(e.stencilWriteMask),f.setFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask),f.setOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),u(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits)},setFlipSided:c,setCullFace:l,setLineWidth:function(t){t!==L&&(O&&e.lineWidth(t),L=t)},setPolygonOffset:u,setScissorTest:function(e){e?r(3089):a(3089)},activeTexture:h,bindTexture:function(t,n){null===D&&h();var i=N[D];void 0===i&&(i={type:void 0,texture:void 0},N[D]=i),i.type===t&&i.texture===n||(e.bindTexture(t,n||U[t]),i.type=t,i.texture=n)},unbindTexture:function(){var t=N[D];void 0!==t&&void 0!==t.type&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{e.texImage2D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage3D:function(){try{e.texImage3D.apply(e,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(t){!1===B.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),B.copy(t))},viewport:function(t){!1===F.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),F.copy(t))},reset:function(){m={},D=null,N={},A=E=y=g=null,d.reset(),p.reset(),f.reset()}}}function kt(e,t,n,i,r,a,o){function s(e,t){return O?new OffscreenCanvas(e,t):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function c(e,t,n,i){var r=1;if((e.width>i||e.height>i)&&(r=i/Math.max(e.width,e.height)),1>r||!0===t){if("undefined"!==typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&e instanceof ImageBitmap)return i=t?qa.floorPowerOfTwo:Math.floor,t=i(r*e.width),r=i(r*e.height),void 0===T&&(T=s(t,r)),n=n?s(t,r):T,n.width=t,n.height=r,n.getContext("2d").drawImage(e,0,0,t,r),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+t+"x"+r+")."),n;"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+").")}return e}function l(e){return qa.isPowerOfTwo(e.width)&&qa.isPowerOfTwo(e.height)}function u(e,t){return e.generateMipmaps&&t&&1003!==e.minFilter&&1006!==e.minFilter}function h(t,n,r,a){e.generateMipmap(t),i.get(n).__maxMipLevel=Math.log(Math.max(r,a))*Math.LOG2E}function d(n,i,r){if(!1===E)return i;if(null!==n){if(void 0!==e[n])return e[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}return n=i,6403===i&&(5126===r&&(n=33326),5131===r&&(n=33325),5121===r&&(n=33321)),6407===i&&(5126===r&&(n=34837),5131===r&&(n=34843),5121===r&&(n=32849)),6408===i&&(5126===r&&(n=34836),5131===r&&(n=34842),5121===r&&(n=32856)),33325!==n&&33326!==n&&34842!==n&&34836!==n||t.get("EXT_color_buffer_float"),n}function p(e){return 1003===e||1004===e||1005===e?9728:9729}function f(t){t=t.target,t.removeEventListener("dispose",f);var n=i.get(t);void 0!==n.__webglInit&&(e.deleteTexture(n.__webglTexture),i.remove(t)),t.isVideoTexture&&P.delete(t),o.memory.textures--}function m(t){t=t.target,t.removeEventListener("dispose",m);var n=i.get(t),r=i.get(t.texture);if(t){if(void 0!==r.__webglTexture&&e.deleteTexture(r.__webglTexture),t.depthTexture&&t.depthTexture.dispose(),t.isWebGLCubeRenderTarget)for(r=0;6>r;r++)e.deleteFramebuffer(n.__webglFramebuffer[r]),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[r]);else e.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&e.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer&&e.deleteRenderbuffer(n.__webglColorRenderbuffer),n.__webglDepthRenderbuffer&&e.deleteRenderbuffer(n.__webglDepthRenderbuffer);i.remove(t.texture),i.remove(t)}o.memory.textures--}function g(e,t){var r=i.get(e);if(e.isVideoTexture){var a=o.render.frame;P.get(e)!==a&&(P.set(e,a),e.update())}if(0<e.version&&r.__version!==e.version)if(a=e.image,void 0===a)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==a.complete)return void w(r,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}n.activeTexture(33984+t),n.bindTexture(3553,r.__webglTexture)}function v(t,r){if(6===t.image.length){var o=i.get(t);if(0<t.version&&o.__version!==t.version){b(o,t),n.activeTexture(33984+r),n.bindTexture(34067,o.__webglTexture),e.pixelStorei(37440,t.flipY);var s=t&&(t.isCompressedTexture||t.image[0].isCompressedTexture),p=t.image[0]&&t.image[0].isDataTexture;r=[];for(var f=0;6>f;f++)r[f]=s||p?p?t.image[f].image:t.image[f]:c(t.image[f],!1,!0,L);f=r[0];var m=l(f)||E,g=a.convert(t.format),v=a.convert(t.type),y=d(t.internalFormat,g,v);if(x(34067,t,m),s){for(p=0;6>p;p++){var w=r[p].mipmaps;for(s=0;s<w.length;s++){var _=w[s];1023!==t.format&&1022!==t.format?null!==g?n.compressedTexImage2D(34069+p,s,y,_.width,_.height,0,_.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):n.texImage2D(34069+p,s,y,_.width,_.height,0,g,v,_.data)}}o.__maxMipLevel=w.length-1}else{for(w=t.mipmaps,s=0;6>s;s++)if(p)for(n.texImage2D(34069+s,0,y,r[s].width,r[s].height,0,g,v,r[s].data),_=0;_<w.length;_++){var M=w[_].image[s].image;n.texImage2D(34069+s,_+1,y,M.width,M.height,0,g,v,M.data)}else for(n.texImage2D(34069+s,0,y,g,v,r[s]),_=0;_<w.length;_++)n.texImage2D(34069+s,_+1,y,g,v,w[_].image[s]);o.__maxMipLevel=w.length}u(t,m)&&h(34067,t,f.width,f.height),o.__version=t.version,t.onUpdate&&t.onUpdate(t)}else n.activeTexture(33984+r),n.bindTexture(34067,o.__webglTexture)}}function y(e,t){n.activeTexture(33984+t),n.bindTexture(34067,i.get(e).__webglTexture)}function x(n,a,o){o?(e.texParameteri(n,10242,D[a.wrapS]),e.texParameteri(n,10243,D[a.wrapT]),32879!==n&&35866!==n||e.texParameteri(n,32882,D[a.wrapR]),e.texParameteri(n,10240,N[a.magFilter]),e.texParameteri(n,10241,N[a.minFilter])):(e.texParameteri(n,10242,33071),e.texParameteri(n,10243,33071),32879!==n&&35866!==n||e.texParameteri(n,32882,33071),1001===a.wrapS&&1001===a.wrapT||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),e.texParameteri(n,10240,p(a.magFilter)),e.texParameteri(n,10241,p(a.minFilter)),1003!==a.minFilter&&1006!==a.minFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),!(o=t.get("EXT_texture_filter_anisotropic"))||1015===a.type&&null===t.get("OES_texture_float_linear")||1016===a.type&&null===(E||t.get("OES_texture_half_float_linear"))||!(1<a.anisotropy||i.get(a).__currentAnisotropy)||(e.texParameterf(n,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,r.getMaxAnisotropy())),i.get(a).__currentAnisotropy=a.anisotropy)}function b(t,n){void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",f),t.__webglTexture=e.createTexture(),o.memory.textures++)}function w(t,i,r){var o=3553;i.isDataTexture2DArray&&(o=35866),i.isDataTexture3D&&(o=32879),b(t,i),n.activeTexture(33984+r),n.bindTexture(o,t.__webglTexture),e.pixelStorei(37440,i.flipY),e.pixelStorei(37441,i.premultiplyAlpha),e.pixelStorei(3317,i.unpackAlignment),r=!E&&(1001!==i.wrapS||1001!==i.wrapT||1003!==i.minFilter&&1006!==i.minFilter),r=r&&!1===l(i.image),r=c(i.image,r,!1,C);var s=l(r)||E,p=a.convert(i.format),f=a.convert(i.type),m=d(i.internalFormat,p,f);x(o,i,s);var g=i.mipmaps;if(i.isDepthTexture)m=6402,E?m=1015===i.type?36012:1014===i.type?33190:1020===i.type?35056:33189:1015===i.type&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),1026===i.format&&6402===m&&1012!==i.type&&1014!==i.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),i.type=1012,f=a.convert(i.type)),1027===i.format&&6402===m&&(m=34041,1020!==i.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),i.type=1020,f=a.convert(i.type))),n.texImage2D(3553,0,m,r.width,r.height,0,p,f,null);else if(i.isDataTexture)if(0<g.length&&s){for(var v=0,y=g.length;v<y;v++){var w=g[v];n.texImage2D(3553,v,m,w.width,w.height,0,p,f,w.data)}i.generateMipmaps=!1,t.__maxMipLevel=g.length-1}else n.texImage2D(3553,0,m,r.width,r.height,0,p,f,r.data),t.__maxMipLevel=0;else if(i.isCompressedTexture){for(v=0,y=g.length;v<y;v++)w=g[v],1023!==i.format&&1022!==i.format?null!==p?n.compressedTexImage2D(3553,v,m,w.width,w.height,0,w.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texImage2D(3553,v,m,w.width,w.height,0,p,f,w.data);t.__maxMipLevel=g.length-1}else if(i.isDataTexture2DArray)n.texImage3D(35866,0,m,r.width,r.height,r.depth,0,p,f,r.data),t.__maxMipLevel=0;else if(i.isDataTexture3D)n.texImage3D(32879,0,m,r.width,r.height,r.depth,0,p,f,r.data),t.__maxMipLevel=0;else if(0<g.length&&s){for(v=0,y=g.length;v<y;v++)w=g[v],n.texImage2D(3553,v,m,p,f,w);i.generateMipmaps=!1,t.__maxMipLevel=g.length-1}else n.texImage2D(3553,0,m,p,f,r),t.__maxMipLevel=0;u(i,s)&&h(o,i,r.width,r.height),t.__version=i.version,i.onUpdate&&i.onUpdate(i)}function _(t,r,o,s){var c=a.convert(r.texture.format),l=a.convert(r.texture.type),u=d(r.texture.internalFormat,c,l);n.texImage2D(s,0,u,r.width,r.height,0,c,l,null),e.bindFramebuffer(36160,t),e.framebufferTexture2D(36160,o,s,i.get(r.texture).__webglTexture,0),e.bindFramebuffer(36160,null)}function M(t,n,i){if(e.bindRenderbuffer(36161,t),n.depthBuffer&&!n.stencilBuffer){var r=33189;i?((i=n.depthTexture)&&i.isDepthTexture&&(1015===i.type?r=36012:1014===i.type&&(r=33190)),i=S(n),e.renderbufferStorageMultisample(36161,i,r,n.width,n.height)):e.renderbufferStorage(36161,r,n.width,n.height),e.framebufferRenderbuffer(36160,36096,36161,t)}else n.depthBuffer&&n.stencilBuffer?(i?(i=S(n),e.renderbufferStorageMultisample(36161,i,35056,n.width,n.height)):e.renderbufferStorage(36161,34041,n.width,n.height),e.framebufferRenderbuffer(36160,33306,36161,t)):(t=a.convert(n.texture.format),r=a.convert(n.texture.type),t=d(n.texture.internalFormat,t,r),i?(i=S(n),e.renderbufferStorageMultisample(36161,i,t,n.width,n.height)):e.renderbufferStorage(36161,t,n.width,n.height));e.bindRenderbuffer(36161,null)}function S(e){return E&&e.isWebGLMultisampleRenderTarget?Math.min(R,e.samples):0}var T,E=r.isWebGL2,A=r.maxTextures,L=r.maxCubemapSize,C=r.maxTextureSize,R=r.maxSamples,P=new WeakMap,O=!1;try{O="undefined"!==typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(U){}var I=0,D={1e3:10497,1001:33071,1002:33648},N={1003:9728,1004:9984,1005:9986,1006:9729,1007:9985,1008:9987},B=!1,F=!1;this.allocateTextureUnit=function(){var e=I;return e>=A&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+A),I+=1,e},this.resetTextureUnits=function(){I=0},this.setTexture2D=g,this.setTexture2DArray=function(e,t){var r=i.get(e);0<e.version&&r.__version!==e.version?w(r,e,t):(n.activeTexture(33984+t),n.bindTexture(35866,r.__webglTexture))},this.setTexture3D=function(e,t){var r=i.get(e);0<e.version&&r.__version!==e.version?w(r,e,t):(n.activeTexture(33984+t),n.bindTexture(32879,r.__webglTexture))},this.setTextureCube=v,this.setTextureCubeDynamic=y,this.setupRenderTarget=function(t){var r=i.get(t),s=i.get(t.texture);t.addEventListener("dispose",m),s.__webglTexture=e.createTexture(),o.memory.textures++;var c=!0===t.isWebGLCubeRenderTarget,p=!0===t.isWebGLMultisampleRenderTarget,f=l(t)||E;if(!E||1022!==t.texture.format||1015!==t.texture.type&&1016!==t.texture.type||(t.texture.format=1023,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),c)for(r.__webglFramebuffer=[],p=0;6>p;p++)r.__webglFramebuffer[p]=e.createFramebuffer();else if(r.__webglFramebuffer=e.createFramebuffer(),p)if(E){r.__webglMultisampledFramebuffer=e.createFramebuffer(),r.__webglColorRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,r.__webglColorRenderbuffer),p=a.convert(t.texture.format);var v=a.convert(t.texture.type);p=d(t.texture.internalFormat,p,v),v=S(t),e.renderbufferStorageMultisample(36161,v,p,t.width,t.height),e.bindFramebuffer(36160,r.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064,36161,r.__webglColorRenderbuffer),e.bindRenderbuffer(36161,null),t.depthBuffer&&(r.__webglDepthRenderbuffer=e.createRenderbuffer(),M(r.__webglDepthRenderbuffer,t,!0)),e.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(c){for(n.bindTexture(34067,s.__webglTexture),x(34067,t.texture,f),s=0;6>s;s++)_(r.__webglFramebuffer[s],t,36064,34069+s);u(t.texture,f)&&h(34067,t.texture,t.width,t.height),n.bindTexture(34067,null)}else n.bindTexture(3553,s.__webglTexture),x(3553,t.texture,f),_(r.__webglFramebuffer,t,36064,3553),u(t.texture,f)&&h(3553,t.texture,t.width,t.height),n.bindTexture(3553,null);if(t.depthBuffer){if(r=i.get(t),f=!0===t.isWebGLCubeRenderTarget,t.depthTexture){if(f)throw Error("target.depthTexture not supported in Cube render targets");if(t&&t.isWebGLCubeRenderTarget)throw Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(36160,r.__webglFramebuffer),!t.depthTexture||!t.depthTexture.isDepthTexture)throw Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");if(i.get(t.depthTexture).__webglTexture&&t.depthTexture.image.width===t.width&&t.depthTexture.image.height===t.height||(t.depthTexture.image.width=t.width,t.depthTexture.image.height=t.height,t.depthTexture.needsUpdate=!0),g(t.depthTexture,0),r=i.get(t.depthTexture).__webglTexture,1026===t.depthTexture.format)e.framebufferTexture2D(36160,36096,3553,r,0);else{if(1027!==t.depthTexture.format)throw Error("Unknown depthTexture format");e.framebufferTexture2D(36160,33306,3553,r,0)}}else if(f)for(r.__webglDepthbuffer=[],f=0;6>f;f++)e.bindFramebuffer(36160,r.__webglFramebuffer[f]),r.__webglDepthbuffer[f]=e.createRenderbuffer(),M(r.__webglDepthbuffer[f],t,!1);else e.bindFramebuffer(36160,r.__webglFramebuffer),r.__webglDepthbuffer=e.createRenderbuffer(),M(r.__webglDepthbuffer,t,!1);e.bindFramebuffer(36160,null)}},this.updateRenderTargetMipmap=function(e){var t=e.texture,r=l(e)||E;if(u(t,r)){r=e.isWebGLCubeRenderTarget?34067:3553;var a=i.get(t).__webglTexture;n.bindTexture(r,a),h(r,t,e.width,e.height),n.bindTexture(r,null)}},this.updateMultisampleRenderTarget=function(t){if(t.isWebGLMultisampleRenderTarget)if(E){var n=i.get(t);e.bindFramebuffer(36008,n.__webglMultisampledFramebuffer),e.bindFramebuffer(36009,n.__webglFramebuffer);var r=t.width,a=t.height,o=16384;t.depthBuffer&&(o|=256),t.stencilBuffer&&(o|=1024),e.blitFramebuffer(0,0,r,a,0,0,r,a,o,9728),e.bindFramebuffer(36160,n.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(e,t){e&&e.isWebGLRenderTarget&&(!1===B&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),B=!0),e=e.texture),g(e,t)},this.safeSetTextureCube=function(e,t){e&&e.isWebGLCubeRenderTarget&&(!1===F&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),F=!0),e=e.texture),e&&e.isCubeTexture||Array.isArray(e.image)&&6===e.image.length?v(e,t):y(e,t)}}function Ht(e,t,n){var i=n.isWebGL2;return{convert:function(e){if(1009===e)return 5121;if(1017===e)return 32819;if(1018===e)return 32820;if(1019===e)return 33635;if(1010===e)return 5120;if(1011===e)return 5122;if(1012===e)return 5123;if(1013===e)return 5124;if(1014===e)return 5125;if(1015===e)return 5126;if(1016===e){if(i)return 5131;var n=t.get("OES_texture_half_float");return null!==n?n.HALF_FLOAT_OES:null}if(1021===e)return 6406;if(1022===e)return 6407;if(1023===e)return 6408;if(1024===e)return 6409;if(1025===e)return 6410;if(1026===e)return 6402;if(1027===e)return 34041;if(1028===e)return 6403;if(1029===e)return 36244;if(1030===e)return 33319;if(1031===e)return 33320;if(1032===e)return 36248;if(1033===e)return 36249;if(33776===e||33777===e||33778===e||33779===e){if(n=t.get("WEBGL_compressed_texture_s3tc"),null===n)return null;if(33776===e)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===e)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===e)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===e)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===e||35841===e||35842===e||35843===e){if(n=t.get("WEBGL_compressed_texture_pvrtc"),null===n)return null;if(35840===e)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===e)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===e)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===e)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===e)return n=t.get("WEBGL_compressed_texture_etc1"),null!==n?n.COMPRESSED_RGB_ETC1_WEBGL:null;if((37492===e||37496===e)&&(n=t.get("WEBGL_compressed_texture_etc"),null!==n)){if(37492===e)return n.COMPRESSED_RGB8_ETC2;if(37496===e)return n.COMPRESSED_RGBA8_ETC2_EAC}return 37808===e||37809===e||37810===e||37811===e||37812===e||37813===e||37814===e||37815===e||37816===e||37817===e||37818===e||37819===e||37820===e||37821===e||37840===e||37841===e||37842===e||37843===e||37844===e||37845===e||37846===e||37847===e||37848===e||37849===e||37850===e||37851===e||37852===e||37853===e?(n=t.get("WEBGL_compressed_texture_astc"),null!==n?e:null):36492===e?(n=t.get("EXT_texture_compression_bptc"),null!==n?e:null):1020===e?i?34042:(n=t.get("WEBGL_depth_texture"),null!==n?n.UNSIGNED_INT_24_8_WEBGL:null):void 0}}}function jt(e){J.call(this),this.cameras=e||[]}function Vt(){f.call(this),this.type="Group"}function Wt(){this._grip=this._targetRay=null}function qt(e,t){function n(e){var t=g.get(e.inputSource);t&&t.dispatchEvent({type:e.type})}function i(){g.forEach((function(e,t){e.disconnect(t)})),g.clear(),e.setFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),E.stop(),c.isPresenting=!1,c.dispatchEvent({type:"sessionend"})}function r(e){d=e,E.setContext(l),E.start(),c.isPresenting=!0,c.dispatchEvent({type:"sessionstart"})}function a(e){for(var t=l.inputSources,n=0;n<m.length;n++)g.set(t[n],m[n]);for(t=0;t<e.removed.length;t++){n=e.removed[t];var i=g.get(n);i&&(i.dispatchEvent({type:"disconnected",data:n}),g.delete(n))}for(t=0;t<e.added.length;t++)n=e.added[t],(i=g.get(n))&&i.dispatchEvent({type:"connected",data:n})}function s(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.getInverse(e.matrixWorld)}var c=this,l=null,h=1,d=null,p="local-floor",f=null,m=[],g=new Map,v=new J;v.layers.enable(1),v.viewport=new o;var y=new J;y.layers.enable(2),y.viewport=new o;var x=[v,y],b=new jt;b.layers.enable(1),b.layers.enable(2);var w=null,_=null;this.isPresenting=this.enabled=!1,this.getController=function(e){var t=m[e];return void 0===t&&(t=new Wt,m[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){var t=m[e];return void 0===t&&(t=new Wt,m[e]=t),t.getGripSpace()},this.setFramebufferScaleFactor=function(e){h=e,!0===c.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(e){p=e,!0===c.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return d},this.getSession=function(){return l},this.setSession=function(e){l=e,null!==l&&(l.addEventListener("select",n),l.addEventListener("selectstart",n),l.addEventListener("selectend",n),l.addEventListener("squeeze",n),l.addEventListener("squeezestart",n),l.addEventListener("squeezeend",n),l.addEventListener("end",i),e=t.getContextAttributes(),!0!==e.xrCompatible&&t.makeXRCompatible(),e=new XRWebGLLayer(l,t,{antialias:e.antialias,alpha:e.alpha,depth:e.depth,stencil:e.stencil,framebufferScaleFactor:h}),l.updateRenderState({baseLayer:e}),l.requestReferenceSpace(p).then(r),l.addEventListener("inputsourceschange",a))};var M=new u,S=new u;this.getCamera=function(e){b.near=y.near=v.near=e.near,b.far=y.far=v.far=e.far,w===b.near&&_===b.far||(l.updateRenderState({depthNear:b.near,depthFar:b.far}),w=b.near,_=b.far);var t=e.parent,n=b.cameras;s(b,t);for(var i=0;i<n.length;i++)s(n[i],t);for(e.matrixWorld.copy(b.matrixWorld),e=e.children,t=0,i=e.length;t<i;t++)e[t].updateMatrixWorld(!0);if(2===n.length){M.setFromMatrixPosition(v.matrixWorld),S.setFromMatrixPosition(y.matrixWorld),n=M.distanceTo(S);var r=v.projectionMatrix.elements,a=y.projectionMatrix.elements,o=r[14]/(r[10]-1);e=r[14]/(r[10]+1),t=(r[9]+1)/r[5],i=(r[9]-1)/r[5];var c=(r[8]-1)/r[0],u=(a[8]+1)/a[0];a=o*c,r=o*u,u=n/(-c+u),c=u*-c,v.matrixWorld.decompose(b.position,b.quaternion,b.scale),b.translateX(c),b.translateZ(u),b.matrixWorld.compose(b.position,b.quaternion,b.scale),b.matrixWorldInverse.getInverse(b.matrixWorld),o+=u,u=e+u,b.projectionMatrix.makePerspective(a-c,r+(n-c),t*e/u*o,i*e/u*o,o,u)}else b.projectionMatrix.copy(v.projectionMatrix);return b};var T=null,E=new te;E.setAnimationLoop((function(t,n){if(f=n.getViewerPose(d),null!==f){var i=f.views,r=l.renderState.baseLayer;e.setFramebuffer(r.framebuffer);var a=!1;i.length!==b.cameras.length&&(b.cameras.length=0,a=!0);for(var o=0;o<i.length;o++){var s=i[o],c=r.getViewport(s),u=x[o];u.matrix.fromArray(s.transform.matrix),u.projectionMatrix.fromArray(s.projectionMatrix),u.viewport.set(c.x,c.y,c.width,c.height),0===o&&b.matrix.copy(u.matrix),!0===a&&b.cameras.push(u)}}for(i=l.inputSources,r=0;r<m.length;r++)m[r].update(i[r],n,d);T&&T(t,n)})),this.setAnimationLoop=function(e){T=e},this.dispose=function(){}}function Yt(e){function t(t,n,i){if(t.opacity.value=n.opacity,n.color&&t.diffuse.value.copy(n.color),n.emissive&&t.emissive.value.copy(n.emissive).multiplyScalar(n.emissiveIntensity),n.map&&(t.map.value=n.map),n.alphaMap&&(t.alphaMap.value=n.alphaMap),n.specularMap&&(t.specularMap.value=n.specularMap),(i=n.envMap||i)&&(t.envMap.value=i,t.flipEnvMap.value=i.isCubeTexture?-1:1,t.reflectivity.value=n.reflectivity,t.refractionRatio.value=n.refractionRatio,t.maxMipLevel.value=e.get(i).__maxMipLevel),n.lightMap&&(t.lightMap.value=n.lightMap,t.lightMapIntensity.value=n.lightMapIntensity),n.aoMap&&(t.aoMap.value=n.aoMap,t.aoMapIntensity.value=n.aoMapIntensity),n.map)var r=n.map;else n.specularMap?r=n.specularMap:n.displacementMap?r=n.displacementMap:n.normalMap?r=n.normalMap:n.bumpMap?r=n.bumpMap:n.roughnessMap?r=n.roughnessMap:n.metalnessMap?r=n.metalnessMap:n.alphaMap?r=n.alphaMap:n.emissiveMap&&(r=n.emissiveMap);if(void 0!==r&&(r.isWebGLRenderTarget&&(r=r.texture),!0===r.matrixAutoUpdate&&r.updateMatrix(),t.uvTransform.value.copy(r.matrix)),n.aoMap)var a=n.aoMap;else n.lightMap&&(a=n.lightMap);void 0!==a&&(a.isWebGLRenderTarget&&(a=a.texture),!0===a.matrixAutoUpdate&&a.updateMatrix(),t.uv2Transform.value.copy(a.matrix))}function n(e,t,n){e.roughness.value=t.roughness,e.metalness.value=t.metalness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap),t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,1===t.side&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),1===t.side&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),(t.envMap||n)&&(e.envMapIntensity.value=t.envMapIntensity)}return{refreshFogUniforms:function(e,t){e.fogColor.value.copy(t.color),t.isFog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t.isFogExp2&&(e.fogDensity.value=t.density)},refreshMaterialUniforms:function(e,i,r,a,o){if(i.isMeshBasicMaterial)t(e,i);else if(i.isMeshLambertMaterial)t(e,i),i.emissiveMap&&(e.emissiveMap.value=i.emissiveMap);else if(i.isMeshToonMaterial)t(e,i),i.gradientMap&&(e.gradientMap.value=i.gradientMap),i.emissiveMap&&(e.emissiveMap.value=i.emissiveMap),i.bumpMap&&(e.bumpMap.value=i.bumpMap,e.bumpScale.value=i.bumpScale,1===i.side&&(e.bumpScale.value*=-1)),i.normalMap&&(e.normalMap.value=i.normalMap,e.normalScale.value.copy(i.normalScale),1===i.side&&e.normalScale.value.negate()),i.displacementMap&&(e.displacementMap.value=i.displacementMap,e.displacementScale.value=i.displacementScale,e.displacementBias.value=i.displacementBias);else if(i.isMeshPhongMaterial)t(e,i),e.specular.value.copy(i.specular),e.shininess.value=Math.max(i.shininess,1e-4),i.emissiveMap&&(e.emissiveMap.value=i.emissiveMap),i.bumpMap&&(e.bumpMap.value=i.bumpMap,e.bumpScale.value=i.bumpScale,1===i.side&&(e.bumpScale.value*=-1)),i.normalMap&&(e.normalMap.value=i.normalMap,e.normalScale.value.copy(i.normalScale),1===i.side&&e.normalScale.value.negate()),i.displacementMap&&(e.displacementMap.value=i.displacementMap,e.displacementScale.value=i.displacementScale,e.displacementBias.value=i.displacementBias);else if(i.isMeshStandardMaterial)t(e,i,r),i.isMeshPhysicalMaterial?(n(e,i,r),e.reflectivity.value=i.reflectivity,e.clearcoat.value=i.clearcoat,e.clearcoatRoughness.value=i.clearcoatRoughness,i.sheen&&e.sheen.value.copy(i.sheen),i.clearcoatMap&&(e.clearcoatMap.value=i.clearcoatMap),i.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=i.clearcoatRoughnessMap),i.clearcoatNormalMap&&(e.clearcoatNormalScale.value.copy(i.clearcoatNormalScale),e.clearcoatNormalMap.value=i.clearcoatNormalMap,1===i.side&&e.clearcoatNormalScale.value.negate()),e.transparency.value=i.transparency):n(e,i,r);else if(i.isMeshMatcapMaterial)t(e,i),i.matcap&&(e.matcap.value=i.matcap),i.bumpMap&&(e.bumpMap.value=i.bumpMap,e.bumpScale.value=i.bumpScale,1===i.side&&(e.bumpScale.value*=-1)),i.normalMap&&(e.normalMap.value=i.normalMap,e.normalScale.value.copy(i.normalScale),1===i.side&&e.normalScale.value.negate()),i.displacementMap&&(e.displacementMap.value=i.displacementMap,e.displacementScale.value=i.displacementScale,e.displacementBias.value=i.displacementBias);else if(i.isMeshDepthMaterial)t(e,i),i.displacementMap&&(e.displacementMap.value=i.displacementMap,e.displacementScale.value=i.displacementScale,e.displacementBias.value=i.displacementBias);else if(i.isMeshDistanceMaterial)t(e,i),i.displacementMap&&(e.displacementMap.value=i.displacementMap,e.displacementScale.value=i.displacementScale,e.displacementBias.value=i.displacementBias),e.referencePosition.value.copy(i.referencePosition),e.nearDistance.value=i.nearDistance,e.farDistance.value=i.farDistance;else if(i.isMeshNormalMaterial)t(e,i),i.bumpMap&&(e.bumpMap.value=i.bumpMap,e.bumpScale.value=i.bumpScale,1===i.side&&(e.bumpScale.value*=-1)),i.normalMap&&(e.normalMap.value=i.normalMap,e.normalScale.value.copy(i.normalScale),1===i.side&&e.normalScale.value.negate()),i.displacementMap&&(e.displacementMap.value=i.displacementMap,e.displacementScale.value=i.displacementScale,e.displacementBias.value=i.displacementBias);else if(i.isLineBasicMaterial)e.diffuse.value.copy(i.color),e.opacity.value=i.opacity,i.isLineDashedMaterial&&(e.dashSize.value=i.dashSize,e.totalSize.value=i.dashSize+i.gapSize,e.scale.value=i.scale);else if(i.isPointsMaterial){if(e.diffuse.value.copy(i.color),e.opacity.value=i.opacity,e.size.value=i.size*a,e.scale.value=.5*o,i.map&&(e.map.value=i.map),i.alphaMap&&(e.alphaMap.value=i.alphaMap),i.map)var s=i.map;else i.alphaMap&&(s=i.alphaMap);void 0!==s&&(!0===s.matrixAutoUpdate&&s.updateMatrix(),e.uvTransform.value.copy(s.matrix))}else if(i.isSpriteMaterial){if(e.diffuse.value.copy(i.color),e.opacity.value=i.opacity,e.rotation.value=i.rotation,i.map&&(e.map.value=i.map),i.alphaMap&&(e.alphaMap.value=i.alphaMap),i.map)var c=i.map;else i.alphaMap&&(c=i.alphaMap);void 0!==c&&(!0===c.matrixAutoUpdate&&c.updateMatrix(),e.uvTransform.value.copy(c.matrix))}else i.isShadowMaterial?(e.color.value.copy(i.color),e.opacity.value=i.opacity):i.isShaderMaterial&&(i.uniformsNeedUpdate=!1)}}}function Xt(e){function t(e,t){for(var n=0;n<e.length;n++){var i=v.getContext(e[n],t);if(null!==i)return i}return null}function i(){C=new ue(Fe),R=new ce(Fe,C,e),!1===R.isWebGL2&&(C.get("WEBGL_depth_texture"),C.get("OES_texture_float"),C.get("OES_texture_half_float"),C.get("OES_texture_half_float_linear"),C.get("OES_standard_derivatives"),C.get("OES_element_index_uint"),C.get("OES_vertex_array_object"),C.get("ANGLE_instanced_arrays")),C.get("OES_texture_float_linear"),q=new Ht(Fe,C,R),P=new Gt(Fe,C,R),P.scissor(be.copy(Le).multiplyScalar(Se).floor()),P.viewport(xe.copy(Ae).multiplyScalar(Se).floor()),O=new pe(Fe),I=new Et,D=new kt(Fe,C,P,I,R,q,O),N=new ne(Fe,R),Y=new oe(Fe,C,N,R),B=new he(Fe,N,O,Y),F=new ve(Fe,B,N,O),j=new ge(Fe),U=new Tt(X,C,R,Y),z=new Yt(I),G=new Rt,k=new Bt,H=new ae(X,P,F,M),V=new se(Fe,C,O,R),W=new de(Fe,C,O,R),O.programs=U.programs,X.capabilities=R,X.extensions=C,X.properties=I,X.renderLists=G,X.state=P,X.info=O}function r(e){e.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),Z=!0}function a(){console.log("THREE.WebGLRenderer: Context Restored."),Z=!1,i()}function s(e){e=e.target,e.removeEventListener("dispose",s),c(e),I.remove(e)}function c(e){var t=I.get(e).program;e.program=void 0,void 0!==t&&U.releaseProgram(t)}function l(e,t){e.render((function(e){X.renderBufferImmediate(e,t)}))}function d(e,t,n,i){if(!1!==e.visible){if(e.layers.test(t.layers))if(e.isGroup)n=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)L.pushLight(e),e.castShadow&&L.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||Re.intersectsSprite(e)){i&&Ne.setFromMatrixPosition(e.matrixWorld).applyMatrix4(De);var r=F.update(e),a=e.material;a.visible&&A.push(e,r,a,n,Ne.z,null)}}else if(e.isImmediateRenderObject)i&&Ne.setFromMatrixPosition(e.matrixWorld).applyMatrix4(De),A.push(e,null,e.material,n,Ne.z,null);else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.frame!==O.render.frame&&(e.skeleton.update(),e.skeleton.frame=O.render.frame),!e.frustumCulled||Re.intersectsObject(e)))if(i&&Ne.setFromMatrixPosition(e.matrixWorld).applyMatrix4(De),r=F.update(e),a=e.material,Array.isArray(a))for(var o=r.groups,s=0,c=o.length;s<c;s++){var l=o[s],u=a[l.materialIndex];u&&u.visible&&A.push(e,r,u,n,Ne.z,l)}else a.visible&&A.push(e,r,a,n,Ne.z,null);for(e=e.children,r=0,a=e.length;r<a;r++)d(e[r],t,n,i)}}function p(e,t,n){for(var i=!0===t.isScene?t.overrideMaterial:null,r=0,a=e.length;r<a;r++){var o=e[r],s=o.object,c=o.geometry,l=null===i?o.material:i;if(o=o.group,n.isArrayCamera){ye=n;for(var u=n.cameras,h=0,d=u.length;h<d;h++){var p=u[h];s.layers.test(p.layers)&&(P.viewport(xe.copy(p.viewport)),L.setupLights(p),f(s,t,p,c,l,o))}}else ye=null,f(s,t,n,c,l,o)}}function f(e,t,n,i,r,a){if(e.onBeforeRender(X,t,n,i,r,a),L=k.get(t,ye||n),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),e.isImmediateRenderObject){var o=g(n,t,r,e);P.setMaterial(r),Y.reset(),l(e,o)}else X.renderBufferDirect(n,t,i,r,e,a);e.onAfterRender(X,t,n,i,r,a),L=k.get(t,ye||n)}function m(e,t,n){!0!==t.isScene&&(t=Be);var i=I.get(e),r=L.state.lights,a=r.state.version;n=U.getParameters(e,r.state,L.state.shadowsArray,t,Pe.numPlanes,Pe.numIntersection,n);var o=U.getProgramCacheKey(n),l=i.program,u=!0;if(void 0===l)e.addEventListener("dispose",s);else if(l.cacheKey!==o)c(e);else{if(i.lightsStateVersion!==a)i.lightsStateVersion=a;else if(void 0!==n.shaderID)return;u=!1}if(u&&(l=U.acquireProgram(n,o),i.program=l,i.uniforms=n.uniforms,i.outputEncoding=n.outputEncoding,e.program=l),n=l.getAttributes(),e.morphTargets)for(o=e.numSupportedMorphTargets=0;o<X.maxMorphTargets;o++)0<=n["morphTarget"+o]&&e.numSupportedMorphTargets++;if(e.morphNormals)for(o=e.numSupportedMorphNormals=0;o<X.maxMorphNormals;o++)0<=n["morphNormal"+o]&&e.numSupportedMorphNormals++;n=i.uniforms,(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(i.numClippingPlanes=Pe.numPlanes,i.numIntersection=Pe.numIntersection,n.clippingPlanes=Pe.uniform),i.environment=e.isMeshStandardMaterial?t.environment:null,i.fog=t.fog,i.needsLights=e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights,i.lightsStateVersion=a,i.needsLights&&(n.ambientLightColor.value=r.state.ambient,n.lightProbe.value=r.state.probe,n.directionalLights.value=r.state.directional,n.directionalLightShadows.value=r.state.directionalShadow,n.spotLights.value=r.state.spot,n.spotLightShadows.value=r.state.spotShadow,n.rectAreaLights.value=r.state.rectArea,n.pointLights.value=r.state.point,n.pointLightShadows.value=r.state.pointShadow,n.hemisphereLights.value=r.state.hemi,n.directionalShadowMap.value=r.state.directionalShadowMap,n.directionalShadowMatrix.value=r.state.directionalShadowMatrix,n.spotShadowMap.value=r.state.spotShadowMap,n.spotShadowMatrix.value=r.state.spotShadowMatrix,n.pointShadowMap.value=r.state.pointShadowMap,n.pointShadowMatrix.value=r.state.pointShadowMatrix),e=i.program.getUniforms(),e=at.seqWithValue(e.seq,n),i.uniformsList=e}function g(e,t,n,i){!0!==t.isScene&&(t=Be),D.resetTextureUnits();var r=t.fog,a=n.isMeshStandardMaterial?t.environment:null,o=null===ie?X.outputEncoding:ie.texture.encoding,s=I.get(n),c=L.state.lights;!0!==Oe||!0!==Ie&&e===me||Pe.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,e,s,e===me&&n.id===fe),n.version===s.__version?void 0===s.program||n.fog&&s.fog!==r||s.environment!==a||s.needsLights&&s.lightsStateVersion!==c.state.version?m(n,t,i):void 0===s.numClippingPlanes||s.numClippingPlanes===Pe.numPlanes&&s.numIntersection===Pe.numIntersection?s.outputEncoding!==o&&m(n,t,i):m(n,t,i):(m(n,t,i),s.__version=n.version);var l=!1,u=!1,h=!1;if(t=s.program,o=t.getUniforms(),c=s.uniforms,P.useProgram(t.program)&&(h=u=l=!0),n.id!==fe&&(fe=n.id,u=!0),(l||me!==e)&&(o.setValue(Fe,"projectionMatrix",e.projectionMatrix),R.logarithmicDepthBuffer&&o.setValue(Fe,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),me!==e&&(me=e,h=u=!0),(n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshStandardMaterial||n.envMap)&&(l=o.map.cameraPosition,void 0!==l&&l.setValue(Fe,Ne.setFromMatrixPosition(e.matrixWorld))),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&o.setValue(Fe,"isOrthographic",!0===e.isOrthographicCamera),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.isShadowMaterial||n.skinning)&&o.setValue(Fe,"viewMatrix",e.matrixWorldInverse)),n.skinning&&(o.setOptional(Fe,i,"bindMatrix"),o.setOptional(Fe,i,"bindMatrixInverse"),e=i.skeleton))if(l=e.bones,R.floatVertexTextures){if(void 0===e.boneTexture){l=Math.sqrt(4*l.length),l=qa.ceilPowerOfTwo(l),l=Math.max(l,4);var d=new Float32Array(l*l*4);d.set(e.boneMatrices);var p=new $(d,l,l,1023,1015);e.boneMatrices=d,e.boneTexture=p,e.boneTextureSize=l}o.setValue(Fe,"boneTexture",e.boneTexture,D),o.setValue(Fe,"boneTextureSize",e.boneTextureSize)}else o.setOptional(Fe,e,"boneMatrices");return(u||s.receiveShadow!==i.receiveShadow)&&(s.receiveShadow=i.receiveShadow,o.setValue(Fe,"receiveShadow",i.receiveShadow)),u&&(o.setValue(Fe,"toneMappingExposure",X.toneMappingExposure),s.needsLights&&(u=h,c.ambientLightColor.needsUpdate=u,c.lightProbe.needsUpdate=u,c.directionalLights.needsUpdate=u,c.directionalLightShadows.needsUpdate=u,c.pointLights.needsUpdate=u,c.pointLightShadows.needsUpdate=u,c.spotLights.needsUpdate=u,c.spotLightShadows.needsUpdate=u,c.rectAreaLights.needsUpdate=u,c.hemisphereLights.needsUpdate=u),r&&n.fog&&z.refreshFogUniforms(c,r),z.refreshMaterialUniforms(c,n,a,Se,Me),void 0!==c.ltc_1&&(c.ltc_1.value=Gs.LTC_1),void 0!==c.ltc_2&&(c.ltc_2.value=Gs.LTC_2),at.upload(Fe,s.uniformsList,c,D)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(at.upload(Fe,s.uniformsList,c,D),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&o.setValue(Fe,"center",i.center),o.setValue(Fe,"modelViewMatrix",i.modelViewMatrix),o.setValue(Fe,"normalMatrix",i.normalMatrix),o.setValue(Fe,"modelMatrix",i.matrixWorld),t}e=e||{};var v=void 0!==e.canvas?e.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),y=void 0!==e.context?e.context:null,x=void 0!==e.alpha&&e.alpha,b=void 0===e.depth||e.depth,w=void 0===e.stencil||e.stencil,_=void 0!==e.antialias&&e.antialias,M=void 0===e.premultipliedAlpha||e.premultipliedAlpha,S=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,T=void 0!==e.powerPreference?e.powerPreference:"default",E=void 0!==e.failIfMajorPerformanceCaveat&&e.failIfMajorPerformanceCaveat,A=null,L=null;this.domElement=v,this.debug={checkShaderErrors:!0},this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=3e3,this.physicallyCorrectLights=!1,this.toneMapping=0,this.toneMappingExposure=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var C,R,P,O,I,D,N,B,F,U,z,G,k,H,j,V,W,q,Y,X=this,Z=!1,J=null,Q=0,K=0,ie=null,re=null,fe=-1,me=null,ye=null,xe=new o,be=new o,we=null,_e=v.width,Me=v.height,Se=1,Te=null,Ee=null,Ae=new o(0,0,_e,Me),Le=new o(0,0,_e,Me),Ce=!1,Re=new ee,Pe=new le,Oe=!1,Ie=!1,De=new h,Ne=new u,Be={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0},Fe=y;try{if(y={alpha:x,depth:b,stencil:w,antialias:_,premultipliedAlpha:M,preserveDrawingBuffer:S,powerPreference:T,failIfMajorPerformanceCaveat:E},v.addEventListener("webglcontextlost",r,!1),v.addEventListener("webglcontextrestored",a,!1),null===Fe&&(x=["webgl2","webgl","experimental-webgl"],!0===X.isWebGL1Renderer&&x.shift(),Fe=t(x,y),null===Fe)){if(t(x))throw Error("Error creating WebGL context with your selected attributes.");throw Error("Error creating WebGL context.")}void 0===Fe.getShaderPrecisionFormat&&(Fe.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(He){throw console.error("THREE.WebGLRenderer: "+He.message),He}i();var Ue=new qt(X,Fe);this.xr=Ue;var ze=new zt(X,F,R.maxTextureSize);this.shadowMap=ze,this.getContext=function(){return Fe},this.getContextAttributes=function(){return Fe.getContextAttributes()},this.forceContextLoss=function(){var e=C.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){var e=C.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return Se},this.setPixelRatio=function(e){void 0!==e&&(Se=e,this.setSize(_e,Me,!1))},this.getSize=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),e=new n),e.set(_e,Me)},this.setSize=function(e,t,n){Ue.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(_e=e,Me=t,v.width=Math.floor(e*Se),v.height=Math.floor(t*Se),!1!==n&&(v.style.width=e+"px",v.style.height=t+"px"),this.setViewport(0,0,e,t))},this.getDrawingBufferSize=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),e=new n),e.set(_e*Se,Me*Se).floor()},this.setDrawingBufferSize=function(e,t,n){_e=e,Me=t,Se=n,v.width=Math.floor(e*n),v.height=Math.floor(t*n),this.setViewport(0,0,e,t)},this.getCurrentViewport=function(e){return void 0===e&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),e=new o),e.copy(xe)},this.getViewport=function(e){return e.copy(Ae)},this.setViewport=function(e,t,n,i){e.isVector4?Ae.set(e.x,e.y,e.z,e.w):Ae.set(e,t,n,i),P.viewport(xe.copy(Ae).multiplyScalar(Se).floor())},this.getScissor=function(e){return e.copy(Le)},this.setScissor=function(e,t,n,i){e.isVector4?Le.set(e.x,e.y,e.z,e.w):Le.set(e,t,n,i),P.scissor(be.copy(Le).multiplyScalar(Se).floor())},this.getScissorTest=function(){return Ce},this.setScissorTest=function(e){P.setScissorTest(Ce=e)},this.setOpaqueSort=function(e){Te=e},this.setTransparentSort=function(e){Ee=e},this.getClearColor=function(){return H.getClearColor()},this.setClearColor=function(){H.setClearColor.apply(H,arguments)},this.getClearAlpha=function(){return H.getClearAlpha()},this.setClearAlpha=function(){H.setClearAlpha.apply(H,arguments)},this.clear=function(e,t,n){var i=0;(void 0===e||e)&&(i|=16384),(void 0===t||t)&&(i|=256),(void 0===n||n)&&(i|=1024),Fe.clear(i)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){v.removeEventListener("webglcontextlost",r,!1),v.removeEventListener("webglcontextrestored",a,!1),G.dispose(),k.dispose(),I.dispose(),F.dispose(),Y.dispose(),Ue.dispose(),ke.stop()},this.renderBufferImmediate=function(e,t){Y.initAttributes();var n=I.get(e);e.hasPositions&&!n.position&&(n.position=Fe.createBuffer()),e.hasNormals&&!n.normal&&(n.normal=Fe.createBuffer()),e.hasUvs&&!n.uv&&(n.uv=Fe.createBuffer()),e.hasColors&&!n.color&&(n.color=Fe.createBuffer()),t=t.getAttributes(),e.hasPositions&&(Fe.bindBuffer(34962,n.position),Fe.bufferData(34962,e.positionArray,35048),Y.enableAttribute(t.position),Fe.vertexAttribPointer(t.position,3,5126,!1,0,0)),e.hasNormals&&(Fe.bindBuffer(34962,n.normal),Fe.bufferData(34962,e.normalArray,35048),Y.enableAttribute(t.normal),Fe.vertexAttribPointer(t.normal,3,5126,!1,0,0)),e.hasUvs&&(Fe.bindBuffer(34962,n.uv),Fe.bufferData(34962,e.uvArray,35048),Y.enableAttribute(t.uv),Fe.vertexAttribPointer(t.uv,2,5126,!1,0,0)),e.hasColors&&(Fe.bindBuffer(34962,n.color),Fe.bufferData(34962,e.colorArray,35048),Y.enableAttribute(t.color),Fe.vertexAttribPointer(t.color,3,5126,!1,0,0)),Y.disableUnusedAttributes(),Fe.drawArrays(4,0,e.count),e.count=0},this.renderBufferDirect=function(e,t,n,i,r,a){null===t&&(t=Be);var o=r.isMesh&&0>r.matrixWorld.determinant();if(e=g(e,t,i,r),P.setMaterial(i,o),o=n.index,t=n.attributes.position,null===o){if(void 0===t||0===t.count)return}else if(0===o.count)return;var s=1;if(!0===i.wireframe&&(o=B.getWireframeAttribute(n),s=2),(i.morphTargets||i.morphNormals)&&j.update(r,n,i,e),Y.setup(r,i,e,n,o),e=V,null!==o){var c=N.get(o);e=W,e.setIndex(c)}var l=n.drawRange.start*s,u=null!==a?a.start*s:0;c=Math.max(l,u),a=Math.max(0,Math.min(null!==o?o.count:t.count,l+n.drawRange.count*s,u+(null!==a?a.count*s:1/0))-1-c+1),0!==a&&(r.isMesh?!0===i.wireframe?(P.setLineWidth(i.wireframeLinewidth*(null===ie?Se:1)),e.setMode(1)):e.setMode(4):r.isLine?(i=i.linewidth,void 0===i&&(i=1),P.setLineWidth(i*(null===ie?Se:1)),r.isLineSegments?e.setMode(1):r.isLineLoop?e.setMode(2):e.setMode(3)):r.isPoints?e.setMode(0):r.isSprite&&e.setMode(4),r.isInstancedMesh?e.renderInstances(n,c,a,r.count):n.isInstancedBufferGeometry?e.renderInstances(n,c,a,Math.min(n.instanceCount,n._maxInstanceCount)):e.render(c,a))},this.compile=function(e,t){L=k.get(e,t),L.init(),e.traverse((function(e){e.isLight&&(L.pushLight(e),e.castShadow&&L.pushShadow(e))})),L.setupLights(t);var n=new WeakMap;e.traverse((function(t){var i=t.material;if(i)if(Array.isArray(i))for(var r=0;r<i.length;r++){var a=i[r];!1===n.has(a)&&(m(a,e,t),n.set(a))}else!1===n.has(i)&&(m(i,e,t),n.set(i))}))};var Ge=null,ke=new te;ke.setAnimationLoop((function(e){Ue.isPresenting||Ge&&Ge(e)})),"undefined"!==typeof window&&ke.setContext(window),this.setAnimationLoop=function(e){Ge=e,Ue.setAnimationLoop(e),null===e?ke.stop():ke.start()},this.render=function(e,t,n,i){if(void 0!==n){console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead.");var r=n}if(void 0!==i){console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead.");var a=i}void 0!==t&&!0!==t.isCamera?console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera."):!0!==Z&&(Y.resetDefaultState(),fe=-1,me=null,!0===e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),!0===Ue.enabled&&!0===Ue.isPresenting&&(t=Ue.getCamera(t)),!0===e.isScene&&e.onBeforeRender(X,e,t,r||ie),L=k.get(e,t),L.init(),De.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),Re.setFromProjectionMatrix(De),Ie=this.localClippingEnabled,Oe=Pe.init(this.clippingPlanes,Ie,t),A=G.get(e,t),A.init(),d(e,t,0,X.sortObjects),A.finish(),!0===X.sortObjects&&A.sort(Te,Ee),!0===Oe&&Pe.beginShadows(),ze.render(L.state.shadowsArray,e,t),L.setupLights(t),!0===Oe&&Pe.endShadows(),!0===this.info.autoReset&&this.info.reset(),void 0!==r&&this.setRenderTarget(r),H.render(A,e,t,a),n=A.opaque,i=A.transparent,0<n.length&&p(n,e,t),0<i.length&&p(i,e,t),!0===e.isScene&&e.onAfterRender(X,e,t),null!==ie&&(D.updateRenderTargetMipmap(ie),D.updateMultisampleRenderTarget(ie)),P.buffers.depth.setTest(!0),P.buffers.depth.setMask(!0),P.buffers.color.setMask(!0),P.setPolygonOffset(!1),L=A=null)},this.setFramebuffer=function(e){J!==e&&null===ie&&Fe.bindFramebuffer(36160,e),J=e},this.getActiveCubeFace=function(){return Q},this.getActiveMipmapLevel=function(){return K},this.getRenderTarget=function(){return ie},this.setRenderTarget=function(e,t,n){ie=e,Q=t,K=n,e&&void 0===I.get(e).__webglFramebuffer&&D.setupRenderTarget(e);var i=J,r=!1;e?(i=I.get(e).__webglFramebuffer,e.isWebGLCubeRenderTarget?(i=i[t||0],r=!0):i=e.isWebGLMultisampleRenderTarget?I.get(e).__webglMultisampledFramebuffer:i,xe.copy(e.viewport),be.copy(e.scissor),we=e.scissorTest):(xe.copy(Ae).multiplyScalar(Se).floor(),be.copy(Le).multiplyScalar(Se).floor(),we=Ce),re!==i&&(Fe.bindFramebuffer(36160,i),re=i),P.viewport(xe),P.scissor(be),P.setScissorTest(we),r&&(e=I.get(e.texture),Fe.framebufferTexture2D(36160,36064,34069+(t||0),e.__webglTexture,n||0))},this.readRenderTargetPixels=function(e,t,n,i,r,a,o){if(e&&e.isWebGLRenderTarget){var s=I.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==o&&(s=s[o]),s){o=!1,s!==re&&(Fe.bindFramebuffer(36160,s),o=!0);try{var c=e.texture,l=c.format,u=c.type;1023!==l&&q.convert(l)!==Fe.getParameter(35739)?console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."):1009===u||q.convert(u)===Fe.getParameter(35738)||1015===u&&(R.isWebGL2||C.get("OES_texture_float")||C.get("WEBGL_color_buffer_float"))||1016===u&&(R.isWebGL2?C.get("EXT_color_buffer_float"):C.get("EXT_color_buffer_half_float"))?36053===Fe.checkFramebufferStatus(36160)?0<=t&&t<=e.width-i&&0<=n&&n<=e.height-r&&Fe.readPixels(t,n,i,r,q.convert(l),q.convert(u),a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."):console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.")}finally{o&&Fe.bindFramebuffer(36160,re)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(e,t,n){void 0===n&&(n=0);var i=Math.pow(2,-n),r=Math.floor(t.image.width*i);i=Math.floor(t.image.height*i);var a=q.convert(t.format);D.setTexture2D(t,0),Fe.copyTexImage2D(3553,n,a,e.x,e.y,r,i,0),P.unbindTexture()},this.copyTextureToTexture=function(e,t,n,i){void 0===i&&(i=0);var r=t.image.width,a=t.image.height,o=q.convert(n.format),s=q.convert(n.type);D.setTexture2D(n,0),Fe.pixelStorei(37440,n.flipY),Fe.pixelStorei(37441,n.premultiplyAlpha),Fe.pixelStorei(3317,n.unpackAlignment),t.isDataTexture?Fe.texSubImage2D(3553,i,e.x,e.y,r,a,o,s,t.image.data):t.isCompressedTexture?Fe.compressedTexSubImage2D(3553,i,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,o,t.mipmaps[0].data):Fe.texSubImage2D(3553,i,e.x,e.y,o,s,t.image),0===i&&n.generateMipmaps&&Fe.generateMipmap(3553),P.unbindTexture()},this.initTexture=function(e){D.setTexture2D(e,0),P.unbindTexture()},"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function Zt(e){Xt.call(this,e)}function Jt(e,t){this.name="",this.color=new _(e),this.density=void 0!==t?t:25e-5}function Qt(e,t,n){this.name="",this.color=new _(e),this.near=void 0!==t?t:1,this.far=void 0!==n?n:1e3}function Kt(e,t){this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=qa.generateUUID()}function $t(e,t,n,i){this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=!0===i}function en(e){A.call(this),this.type="SpriteMaterial",this.color=new _(16777215),this.alphaMap=this.map=null,this.rotation=0,this.transparent=this.sizeAttenuation=!0,this.setValues(e)}function tn(e){if(f.call(this),this.type="Sprite",void 0===ac){ac=new k;var t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]);t=new Kt(t,5),ac.setIndex([0,1,2,0,2,3]),ac.setAttribute("position",new $t(t,3,0,!1)),ac.setAttribute("uv",new $t(t,2,3,!1))}this.geometry=ac,this.material=void 0!==e?e:new en,this.center=new n(.5,.5)}function nn(e,t,n,i,r,a){lc.subVectors(e,n).addScalar(.5).multiply(i),void 0!==r?(uc.x=a*lc.x-r*lc.y,uc.y=r*lc.x+a*lc.y):uc.copy(lc),e.copy(t),e.x+=uc.x,e.y+=uc.y,e.applyMatrix4(hc)}function rn(){f.call(this),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}function an(e,t){e&&e.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),H.call(this,e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new h,this.bindMatrixInverse=new h}function on(e,t){if(e=e||[],this.bones=e.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),this.frame=-1,void 0===t)this.calculateInverses();else if(this.bones.length===t.length)this.boneInverses=t.slice(0);else for(console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[],e=0,t=this.bones.length;e<t;e++)this.boneInverses.push(new h)}function sn(){f.call(this),this.type="Bone"}function cn(e,t,n){H.call(this,e,t),this.instanceMatrix=new C(new Float32Array(16*n),16),this.count=n,this.frustumCulled=!1}function ln(e){A.call(this),this.type="LineBasicMaterial",this.color=new _(16777215),this.linewidth=1,this.linejoin=this.linecap="round",this.morphTargets=!1,this.setValues(e)}function un(e,t,n){1===n&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),f.call(this),this.type="Line",this.geometry=void 0!==e?e:new k,this.material=void 0!==t?t:new ln,this.updateMorphTargets()}function hn(e,t){un.call(this,e,t),this.type="LineSegments"}function dn(e,t){un.call(this,e,t),this.type="LineLoop"}function pn(e){A.call(this),this.type="PointsMaterial",this.color=new _(16777215),this.alphaMap=this.map=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(e)}function fn(e,t){f.call(this),this.type="Points",this.geometry=void 0!==e?e:new k,this.material=void 0!==t?t:new pn,this.updateMorphTargets()}function mn(e,t,n,i,r,a,o){var s=Dc.distanceSqToPoint(e);s<n&&(n=new u,Dc.closestPointToPoint(e,n),n.applyMatrix4(i),e=r.ray.origin.distanceTo(n),e<r.near||e>r.far||a.push({distance:e,distanceToRay:Math.sqrt(s),point:n,index:t,face:null,object:o}))}function gn(e,t,n,i,a,o,s,c,l){r.call(this,e,t,n,i,a,o,s,c,l),this.format=void 0!==s?s:1022,this.minFilter=void 0!==o?o:1006,this.magFilter=void 0!==a?a:1006,this.generateMipmaps=!1}function vn(e,t,n,i,a,o,s,c,l,u,h,d){r.call(this,null,o,s,c,l,u,i,a,h,d),this.image={width:t,height:n},this.mipmaps=e,this.generateMipmaps=this.flipY=!1}function yn(e,t,n,i,a,o,s,c,l){r.call(this,e,t,n,i,a,o,s,c,l),this.needsUpdate=!0}function xn(e,t,n,i,a,o,s,c,l,u){if(u=void 0!==u?u:1026,1026!==u&&1027!==u)throw Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&1026===u&&(n=1012),void 0===n&&1027===u&&(n=1020),r.call(this,null,i,a,o,s,c,u,n,l),this.image={width:e,height:t},this.magFilter=void 0!==s?s:1003,this.minFilter=void 0!==c?c:1003,this.generateMipmaps=this.flipY=!1}function bn(e){k.call(this),this.type="WireframeGeometry";var t=[],n=[0,0],i={},r=["a","b","c"];if(e&&e.isGeometry){for(var a=e.faces,o=0,s=a.length;o<s;o++)for(var c=a[o],l=0;3>l;l++){var h=c[r[l]],d=c[r[(l+1)%3]];n[0]=Math.min(h,d),n[1]=Math.max(h,d),h=n[0]+","+n[1],void 0===i[h]&&(i[h]={index1:n[0],index2:n[1]})}for(var p in i)n=i[p],a=e.vertices[n.index1],t.push(a.x,a.y,a.z),a=e.vertices[n.index2],t.push(a.x,a.y,a.z)}else if(e&&e.isBufferGeometry)if(p=new u,null!==e.index){for(r=e.attributes.position,o=e.index,e=e.groups,0===e.length&&(e=[{start:0,count:o.count,materialIndex:0}]),s=0,c=e.length;s<c;++s)for(h=e[s],l=d=h.start,h=d+h.count;l<h;l+=3)for(d=0;3>d;d++){var f=o.getX(l+d),m=o.getX(l+(d+1)%3);n[0]=Math.min(f,m),n[1]=Math.max(f,m),f=n[0]+","+n[1],void 0===i[f]&&(i[f]={index1:n[0],index2:n[1]})}for(a in i)n=i[a],p.fromBufferAttribute(r,n.index1),t.push(p.x,p.y,p.z),p.fromBufferAttribute(r,n.index2),t.push(p.x,p.y,p.z)}else for(i=e.attributes.position,n=0,a=i.count/3;n<a;n++)for(e=0;3>e;e++)p.fromBufferAttribute(i,3*n+e),t.push(p.x,p.y,p.z),p.fromBufferAttribute(i,3*n+(e+1)%3),t.push(p.x,p.y,p.z);this.setAttribute("position",new F(t,3))}function wn(e,t,n){W.call(this),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:n},this.fromBufferGeometry(new _n(e,t,n)),this.mergeVertices()}function _n(e,t,n){k.call(this),this.type="ParametricBufferGeometry",this.parameters={func:e,slices:t,stacks:n};var i=[],r=[],a=[],o=[],s=new u,c=new u,l=new u,h=new u,d=new u;3>e.length&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");for(var p=t+1,f=0;f<=n;f++)for(var m=f/n,g=0;g<=t;g++){var v=g/t;e(v,m,c),r.push(c.x,c.y,c.z),0<=v-1e-5?(e(v-1e-5,m,l),h.subVectors(c,l)):(e(v+1e-5,m,l),h.subVectors(l,c)),0<=m-1e-5?(e(v,m-1e-5,l),d.subVectors(c,l)):(e(v,m+1e-5,l),d.subVectors(l,c)),s.crossVectors(h,d).normalize(),a.push(s.x,s.y,s.z),o.push(v,m)}for(e=0;e<n;e++)for(s=0;s<t;s++)c=e*p+s+1,l=(e+1)*p+s+1,h=(e+1)*p+s,i.push(e*p+s,c,h),i.push(c,l,h);this.setIndex(i),this.setAttribute("position",new F(r,3)),this.setAttribute("normal",new F(a,3)),this.setAttribute("uv",new F(o,2))}function Mn(e,t,n,i){W.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:i},this.fromBufferGeometry(new Sn(e,t,n,i)),this.mergeVertices()}function Sn(e,t,i,r){function a(e){c.push(e.x,e.y,e.z)}function o(t,n){t*=3,n.x=e[t+0],n.y=e[t+1],n.z=e[t+2]}function s(e,t,n,i){0>i&&1===e.x&&(l[t]=e.x-1),0===n.x&&0===n.z&&(l[t]=i/2/Math.PI+.5)}k.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:e,indices:t,radius:i,detail:r},i=i||1,r=r||0;var c=[],l=[];(function(e){for(var n=new u,i=new u,r=new u,s=0;s<t.length;s+=3){o(t[s+0],n),o(t[s+1],i),o(t[s+2],r);for(var c=n,l=i,h=r,d=Math.pow(2,e),p=[],f=0;f<=d;f++){p[f]=[];for(var m=c.clone().lerp(h,f/d),g=l.clone().lerp(h,f/d),v=d-f,y=0;y<=v;y++)p[f][y]=0===y&&f===d?m:m.clone().lerp(g,y/v)}for(c=0;c<d;c++)for(l=0;l<2*(d-c)-1;l++)h=Math.floor(l/2),0===l%2?(a(p[c][h+1]),a(p[c+1][h]),a(p[c][h])):(a(p[c][h+1]),a(p[c+1][h+1]),a(p[c+1][h]))}})(r),function(e){for(var t=new u,n=0;n<c.length;n+=3)t.x=c[n+0],t.y=c[n+1],t.z=c[n+2],t.normalize().multiplyScalar(e),c[n+0]=t.x,c[n+1]=t.y,c[n+2]=t.z}(i),function(){for(var e=new u,t=0;t<c.length;t+=3)e.x=c[t+0],e.y=c[t+1],e.z=c[t+2],l.push(Math.atan2(e.z,-e.x)/2/Math.PI+.5,1-(Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))/Math.PI+.5));e=new u,t=new u;for(var i=new u,r=new u,a=new n,o=new n,h=new n,d=0,p=0;d<c.length;d+=9,p+=6){e.set(c[d+0],c[d+1],c[d+2]),t.set(c[d+3],c[d+4],c[d+5]),i.set(c[d+6],c[d+7],c[d+8]),a.set(l[p+0],l[p+1]),o.set(l[p+2],l[p+3]),h.set(l[p+4],l[p+5]),r.copy(e).add(t).add(i).divideScalar(3);var f=Math.atan2(r.z,-r.x);s(a,p+0,e,f),s(o,p+2,t,f),s(h,p+4,i,f)}for(e=0;e<l.length;e+=6)t=l[e+0],i=l[e+2],r=l[e+4],a=Math.min(t,i,r),.9<Math.max(t,i,r)&&.1>a&&(.2>t&&(l[e+0]+=1),.2>i&&(l[e+2]+=1),.2>r&&(l[e+4]+=1))}(),this.setAttribute("position",new F(c,3)),this.setAttribute("normal",new F(c.slice(),3)),this.setAttribute("uv",new F(l,2)),0===r?this.computeVertexNormals():this.normalizeNormals()}function Tn(e,t){W.call(this),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new En(e,t)),this.mergeVertices()}function En(e,t){Sn.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],e,t),this.type="TetrahedronBufferGeometry",this.parameters={radius:e,detail:t}}function An(e,t){W.call(this),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Ln(e,t)),this.mergeVertices()}function Ln(e,t){Sn.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],e,t),this.type="OctahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Cn(e,t){W.call(this),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Rn(e,t)),this.mergeVertices()}function Rn(e,t){var n=(1+Math.sqrt(5))/2;Sn.call(this,[-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],[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],e,t),this.type="IcosahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Pn(e,t){W.call(this),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new On(e,t)),this.mergeVertices()}function On(e,t){var n=(1+Math.sqrt(5))/2,i=1/n;Sn.call(this,[-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],[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],e,t),this.type="DodecahedronBufferGeometry",this.parameters={radius:e,detail:t}}function In(e,t,n,i,r,a){W.call(this),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:i,closed:r},void 0!==a&&console.warn("THREE.TubeGeometry: taper has been removed."),e=new Dn(e,t,n,i,r),this.tangents=e.tangents,this.normals=e.normals,this.binormals=e.binormals,this.fromBufferGeometry(e),this.mergeVertices()}function Dn(e,t,i,r,a){function o(n){d=e.getPointAt(n/t,d);var a=s.normals[n];n=s.binormals[n];for(var o=0;o<=r;o++){var u=o/r*Math.PI*2,h=Math.sin(u);u=-Math.cos(u),l.x=u*a.x+h*n.x,l.y=u*a.y+h*n.y,l.z=u*a.z+h*n.z,l.normalize(),f.push(l.x,l.y,l.z),c.x=d.x+i*l.x,c.y=d.y+i*l.y,c.z=d.z+i*l.z,p.push(c.x,c.y,c.z)}}k.call(this),this.type="TubeBufferGeometry",this.parameters={path:e,tubularSegments:t,radius:i,radialSegments:r,closed:a},t=t||64,i=i||1,r=r||8,a=a||!1;var s=e.computeFrenetFrames(t,a);this.tangents=s.tangents,this.normals=s.normals,this.binormals=s.binormals;var c=new u,l=new u,h=new n,d=new u,p=[],f=[],m=[],g=[];(function(){for(var e=0;e<t;e++)o(e);for(o(!1===a?t:0),e=0;e<=t;e++)for(var n=0;n<=r;n++)h.x=e/t,h.y=n/r,m.push(h.x,h.y);for(e=1;e<=t;e++)for(n=1;n<=r;n++){var i=(r+1)*e+(n-1),s=(r+1)*e+n,c=(r+1)*(e-1)+n;g.push((r+1)*(e-1)+(n-1),i,c),g.push(i,s,c)}})(),this.setIndex(g),this.setAttribute("position",new F(p,3)),this.setAttribute("normal",new F(f,3)),this.setAttribute("uv",new F(m,2))}function Nn(e,t,n,i,r,a,o){W.call(this),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:i,p:r,q:a},void 0!==o&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new Bn(e,t,n,i,r,a)),this.mergeVertices()}function Bn(e,t,n,i,r,a){function o(e,t,n,i,r){var a=Math.sin(e);t=n/t*e,n=Math.cos(t),r.x=i*(2+n)*.5*Math.cos(e),r.y=i*(2+n)*a*.5,r.z=i*Math.sin(t)*.5}k.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:i,p:r,q:a},e=e||1,t=t||.4,n=Math.floor(n)||64,i=Math.floor(i)||8,r=r||2,a=a||3;for(var s=[],c=[],l=[],h=[],d=new u,p=new u,f=new u,m=new u,g=new u,v=new u,y=new u,x=0;x<=n;++x){var b=x/n*r*Math.PI*2;for(o(b,r,a,e,f),o(b+.01,r,a,e,m),v.subVectors(m,f),y.addVectors(m,f),g.crossVectors(v,y),y.crossVectors(g,v),g.normalize(),y.normalize(),b=0;b<=i;++b){var w=b/i*Math.PI*2,_=-t*Math.cos(w);w=t*Math.sin(w),d.x=f.x+(_*y.x+w*g.x),d.y=f.y+(_*y.y+w*g.y),d.z=f.z+(_*y.z+w*g.z),c.push(d.x,d.y,d.z),p.subVectors(d,f).normalize(),l.push(p.x,p.y,p.z),h.push(x/n),h.push(b/i)}}for(e=1;e<=n;e++)for(t=1;t<=i;t++)r=(i+1)*e+(t-1),a=(i+1)*e+t,d=(i+1)*(e-1)+t,s.push((i+1)*(e-1)+(t-1),r,d),s.push(r,a,d);this.setIndex(s),this.setAttribute("position",new F(c,3)),this.setAttribute("normal",new F(l,3)),this.setAttribute("uv",new F(h,2))}function Fn(e,t,n,i,r){W.call(this),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:i,arc:r},this.fromBufferGeometry(new Un(e,t,n,i,r)),this.mergeVertices()}function Un(e,t,n,i,r){k.call(this),this.type="TorusBufferGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:i,arc:r},e=e||1,t=t||.4,n=Math.floor(n)||8,i=Math.floor(i)||6,r=r||2*Math.PI;for(var a=[],o=[],s=[],c=[],l=new u,h=new u,d=new u,p=0;p<=n;p++)for(var f=0;f<=i;f++){var m=f/i*r,g=p/n*Math.PI*2;h.x=(e+t*Math.cos(g))*Math.cos(m),h.y=(e+t*Math.cos(g))*Math.sin(m),h.z=t*Math.sin(g),o.push(h.x,h.y,h.z),l.x=e*Math.cos(m),l.y=e*Math.sin(m),d.subVectors(h,l).normalize(),s.push(d.x,d.y,d.z),c.push(f/i),c.push(p/n)}for(e=1;e<=n;e++)for(t=1;t<=i;t++)r=(i+1)*(e-1)+t-1,l=(i+1)*(e-1)+t,h=(i+1)*e+t,a.push((i+1)*e+t-1,r,h),a.push(r,l,h);this.setIndex(a),this.setAttribute("position",new F(o,3)),this.setAttribute("normal",new F(s,3)),this.setAttribute("uv",new F(c,2))}function zn(e,t,n,i,r){for(var a,o=0,s=t,c=n-i;s<n;s+=i)o+=(e[c]-e[s])*(e[s+1]+e[c+1]),c=s;if(r===0<o)for(r=t;r<n;r+=i)a=ti(r,e[r],e[r+1],a);else for(r=n-i;r>=t;r-=i)a=ti(r,e[r],e[r+1],a);return a&&Zn(a,a.next)&&(ni(a),a=a.next),a}function Gn(e,t){if(!e)return e;t||(t=e);do{var n=!1;if(e.steiner||!Zn(e,e.next)&&0!==Xn(e.prev,e,e.next))e=e.next;else{if(ni(e),e=t=e.prev,e===e.next)break;n=!0}}while(n||e!==t);return t}function kn(e,t,n,i,r,a,o){if(e){if(!o&&a){var s=e,c=s;do{null===c.z&&(c.z=Wn(c.x,c.y,i,r,a)),c.prevZ=c.prev,c=c.nextZ=c.next}while(c!==s);c.prevZ.nextZ=null,c.prevZ=null,s=c;var l,u,h,d,p=1;do{c=s;var f=s=null;for(u=0;c;){u++;var m=c;for(l=h=0;l<p&&(h++,m=m.nextZ,m);l++);for(d=p;0<h||0<d&&m;)0!==h&&(0===d||!m||c.z<=m.z)?(l=c,c=c.nextZ,h--):(l=m,m=m.nextZ,d--),f?f.nextZ=l:s=l,l.prevZ=f,f=l;c=m}f.nextZ=null,p*=2}while(1<u)}for(s=e;e.prev!==e.next;){if(c=e.prev,m=e.next,a)f=Hn(e,i,r,a);else e:if(f=e,u=f.prev,h=f,p=f.next,0<=Xn(u,h,p))f=!1;else{for(l=f.next.next;l!==f.prev;){if(Yn(u.x,u.y,h.x,h.y,p.x,p.y,l.x,l.y)&&0<=Xn(l.prev,l,l.next)){f=!1;break e}l=l.next}f=!0}if(f)t.push(c.i/n),t.push(e.i/n),t.push(m.i/n),ni(e),s=e=m.next;else if(e=m,e===s){if(o){if(1===o){e=Gn(e),o=t,s=n,c=e;do{m=c.prev,f=c.next.next,!Zn(m,f)&&Jn(m,c,c.next,f)&&$n(m,f)&&$n(f,m)&&(o.push(m.i/s),o.push(c.i/s),o.push(f.i/s),ni(c),ni(c.next),c=e=f),c=c.next}while(c!==e);e=Gn(c),kn(e,t,n,i,r,a,2)}else if(2===o)e:{o=e;do{for(s=o.next.next;s!==o.prev;){if(c=o.i!==s.i){if(c=o,m=s,f=c.next.i!==m.i&&c.prev.i!==m.i){t:{f=c;do{if(f.i!==c.i&&f.next.i!==c.i&&f.i!==m.i&&f.next.i!==m.i&&Jn(f,f.next,c,m)){f=!0;break t}f=f.next}while(f!==c);f=!1}f=!f}if(f){if(f=$n(c,m)&&$n(m,c)){f=c,u=!1,h=(c.x+m.x)/2,p=(c.y+m.y)/2;do{f.y>p!==f.next.y>p&&f.next.y!==f.y&&h<(f.next.x-f.x)*(p-f.y)/(f.next.y-f.y)+f.x&&(u=!u),f=f.next}while(f!==c);f=u}f=f&&(Xn(c.prev,c,m.prev)||Xn(c,m.prev,m))||Zn(c,m)&&0<Xn(c.prev,c,c.next)&&0<Xn(m.prev,m,m.next)}c=f}if(c){e=ei(o,s),o=Gn(o,o.next),e=Gn(e,e.next),kn(o,t,n,i,r,a),kn(e,t,n,i,r,a);break e}s=s.next}o=o.next}while(o!==e)}}else kn(Gn(e),t,n,i,r,a,1);break}}}}function Hn(e,t,n,i){var r=e.prev,a=e.next;if(0<=Xn(r,e,a))return!1;var o=r.x>e.x?r.x>a.x?r.x:a.x:e.x>a.x?e.x:a.x,s=r.y>e.y?r.y>a.y?r.y:a.y:e.y>a.y?e.y:a.y,c=Wn(r.x<e.x?r.x<a.x?r.x:a.x:e.x<a.x?e.x:a.x,r.y<e.y?r.y<a.y?r.y:a.y:e.y<a.y?e.y:a.y,t,n,i);for(t=Wn(o,s,t,n,i),n=e.prevZ,i=e.nextZ;n&&n.z>=c&&i&&i.z<=t;){if(n!==e.prev&&n!==e.next&&Yn(r.x,r.y,e.x,e.y,a.x,a.y,n.x,n.y)&&0<=Xn(n.prev,n,n.next))return!1;if(n=n.prevZ,i!==e.prev&&i!==e.next&&Yn(r.x,r.y,e.x,e.y,a.x,a.y,i.x,i.y)&&0<=Xn(i.prev,i,i.next))return!1;i=i.nextZ}for(;n&&n.z>=c;){if(n!==e.prev&&n!==e.next&&Yn(r.x,r.y,e.x,e.y,a.x,a.y,n.x,n.y)&&0<=Xn(n.prev,n,n.next))return!1;n=n.prevZ}for(;i&&i.z<=t;){if(i!==e.prev&&i!==e.next&&Yn(r.x,r.y,e.x,e.y,a.x,a.y,i.x,i.y)&&0<=Xn(i.prev,i,i.next))return!1;i=i.nextZ}return!0}function jn(e,t){return e.x-t.x}function Vn(e,t){var n=t,i=e.x,r=e.y,a=-1/0;do{if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){var o=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(o<=i&&o>a){if(a=o,o===i){if(r===n.y)return n;if(r===n.next.y)return n.next}var s=n.x<n.next.x?n:n.next}}n=n.next}while(n!==t);if(!s)return null;if(i===a)return s;t=s,o=s.x;var c=s.y,l=1/0;n=s;do{if(i>=n.x&&n.x>=o&&i!==n.x&&Yn(r<c?i:a,r,o,c,r<c?a:i,r,n.x,n.y)){var u,h=Math.abs(r-n.y)/(i-n.x);if((u=$n(n,e))&&!(u=h<l)&&(u=h===l)&&!(u=n.x>s.x)&&(u=n.x===s.x)){u=s;var d=n;u=0>Xn(u.prev,u,d.prev)&&0>Xn(d.next,u,u.next)}u&&(s=n,l=h)}n=n.next}while(n!==t);return s}function Wn(e,t,n,i,r){return e=32767*(e-n)*r,t=32767*(t-i)*r,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),1431655765&(e|e<<1)|(1431655765&(t|t<<1))<<1}function qn(e){var t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function Yn(e,t,n,i,r,a,o,s){return 0<=(r-o)*(t-s)-(e-o)*(a-s)&&0<=(e-o)*(i-s)-(n-o)*(t-s)&&0<=(n-o)*(a-s)-(r-o)*(i-s)}function Xn(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Zn(e,t){return e.x===t.x&&e.y===t.y}function Jn(e,t,n,i){var r=Kn(Xn(e,t,n)),a=Kn(Xn(e,t,i)),o=Kn(Xn(n,i,e)),s=Kn(Xn(n,i,t));return!!(r!==a&&o!==s||0===r&&Qn(e,n,t)||0===a&&Qn(e,i,t)||0===o&&Qn(n,e,i)||0===s&&Qn(n,t,i))}function Qn(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Kn(e){return 0<e?1:0>e?-1:0}function $n(e,t){return 0>Xn(e.prev,e,e.next)?0<=Xn(e,t,e.next)&&0<=Xn(e,e.prev,t):0>Xn(e,t,e.prev)||0>Xn(e,e.next,t)}function ei(e,t){var n=new ii(e.i,e.x,e.y),i=new ii(t.i,t.x,t.y),r=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,a.next=i,i.prev=a,i}function ti(e,t,n,i){return e=new ii(e,t,n),i?(e.next=i.next,e.prev=i,i.next.prev=e,i.next=e):(e.prev=e,e.next=e),e}function ni(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function ii(e,t,n){this.i=e,this.x=t,this.y=n,this.nextZ=this.prevZ=this.z=this.next=this.prev=null,this.steiner=!1}function ri(e){var t=e.length;2<t&&e[t-1].equals(e[0])&&e.pop()}function ai(e,t){for(var n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}function oi(e,t){W.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},this.fromBufferGeometry(new si(e,t)),this.mergeVertices()}function si(e,t){function i(e){function i(e,t,n){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(n).add(e)}function s(e,t,i){var r=e.x-t.x,a=e.y-t.y,o=i.x-e.x,s=i.y-e.y,c=r*r+a*a;if(Math.abs(r*s-a*o)>Number.EPSILON){var l=Math.sqrt(c),u=Math.sqrt(o*o+s*s);if(c=t.x-a/l,t=t.y+r/l,s=((i.x-s/u-c)*s-(i.y+o/u-t)*o)/(r*s-a*o),o=c+r*s-e.x,r=t+a*s-e.y,a=o*o+r*r,2>=a)return new n(o,r);a=Math.sqrt(a/2)}else e=!1,r>Number.EPSILON?o>Number.EPSILON&&(e=!0):r<-Number.EPSILON?o<-Number.EPSILON&&(e=!0):Math.sign(a)===Math.sign(s)&&(e=!0),e?(o=-a,a=Math.sqrt(c)):(o=r,r=a,a=Math.sqrt(c/2));return new n(o/a,r/a)}function c(e,t){for(var n=e.length;0<=--n;){var i=n,o=n-1;0>o&&(o=e.length-1);for(var s=0,c=g+2*_;s<c;s++){var l=N*s,u=N*(s+1),h=t+o+l,f=t+o+u;u=t+i+u,d(t+i+l),d(h),d(u),d(h),d(f),d(u),l=a.length/3,l=S.generateSideWallUV(r,a,l-6,l-3,l-2,l-1),p(l[0]),p(l[1]),p(l[3]),p(l[1]),p(l[2]),p(l[3])}}}function l(e,t,n){f.push(e),f.push(t),f.push(n)}function h(e,t,n){d(e),d(t),d(n),e=a.length/3,e=S.generateTopUV(r,a,e-3,e-2,e-1),p(e[0]),p(e[1]),p(e[2])}function d(e){a.push(f[3*e]),a.push(f[3*e+1]),a.push(f[3*e+2])}function p(e){o.push(e.x),o.push(e.y)}var f=[],m=void 0!==t.curveSegments?t.curveSegments:12,g=void 0!==t.steps?t.steps:1,v=void 0!==t.depth?t.depth:100,y=void 0===t.bevelEnabled||t.bevelEnabled,x=void 0!==t.bevelThickness?t.bevelThickness:6,b=void 0!==t.bevelSize?t.bevelSize:x-2,w=void 0!==t.bevelOffset?t.bevelOffset:0,_=void 0!==t.bevelSegments?t.bevelSegments:3,M=t.extrudePath,S=void 0!==t.UVGenerator?t.UVGenerator:zc;void 0!==t.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),v=t.amount);var T=!1;if(M){var E=M.getSpacedPoints(g);T=!0,y=!1;var A=M.computeFrenetFrames(g,!1),L=new u,C=new u,R=new u}y||(w=b=x=_=0),e=e.extractPoints(m),M=e.shape;var P=e.holes;if(!Uc.isClockWise(M))for(M=M.reverse(),e=0,m=P.length;e<m;e++){var O=P[e];Uc.isClockWise(O)&&(P[e]=O.reverse())}var I=Uc.triangulateShape(M,P),D=M;for(e=0,m=P.length;e<m;e++)M=M.concat(P[e]);var N=M.length,B=I.length;e=[],m=0,O=D.length;for(var F=O-1,U=m+1;m<O;m++,F++,U++)F===O&&(F=0),U===O&&(U=0),e[m]=s(D[m],D[F],D[U]);m=[],O=e.concat(),U=0;for(var z=P.length;U<z;U++){var G=P[U];F=[];for(var k=0,H=G.length,j=H-1,V=k+1;k<H;k++,j++,V++)j===H&&(j=0),V===H&&(V=0),F[k]=s(G[k],G[j],G[V]);m.push(F),O=O.concat(F)}for(U=0;U<_;U++){for(F=U/_,z=x*Math.cos(F*Math.PI/2),G=b*Math.sin(F*Math.PI/2)+w,F=0,k=D.length;F<k;F++)H=i(D[F],e[F],G),l(H.x,H.y,-z);for(k=0,H=P.length;k<H;k++){j=P[k],F=m[k],V=0;for(var W=j.length;V<W;V++){var q=i(j[V],F[V],G);l(q.x,q.y,-z)}}}for(F=b+w,U=0;U<N;U++)z=y?i(M[U],O[U],F):M[U],T?(C.copy(A.normals[0]).multiplyScalar(z.x),L.copy(A.binormals[0]).multiplyScalar(z.y),R.copy(E[0]).add(C).add(L),l(R.x,R.y,R.z)):l(z.x,z.y,0);for(U=1;U<=g;U++)for(z=0;z<N;z++)G=y?i(M[z],O[z],F):M[z],T?(C.copy(A.normals[U]).multiplyScalar(G.x),L.copy(A.binormals[U]).multiplyScalar(G.y),R.copy(E[U]).add(C).add(L),l(R.x,R.y,R.z)):l(G.x,G.y,v/g*U);for(A=_-1;0<=A;A--){for(C=A/_,L=x*Math.cos(C*Math.PI/2),C=b*Math.sin(C*Math.PI/2)+w,R=0,M=D.length;R<M;R++)O=i(D[R],e[R],C),l(O.x,O.y,v+L);for(R=0,M=P.length;R<M;R++)for(O=P[R],F=m[R],U=0,z=O.length;U<z;U++)G=i(O[U],F[U],C),T?l(G.x,G.y+E[g-1].y,E[g-1].x+L):l(G.x,G.y,v+L)}(function(){var e=a.length/3;if(y){for(var t=0*N,n=0;n<B;n++){var i=I[n];h(i[2]+t,i[1]+t,i[0]+t)}for(t=N*(g+2*_),n=0;n<B;n++)i=I[n],h(i[0]+t,i[1]+t,i[2]+t)}else{for(t=0;t<B;t++)n=I[t],h(n[2],n[1],n[0]);for(t=0;t<B;t++)n=I[t],h(n[0]+N*g,n[1]+N*g,n[2]+N*g)}r.addGroup(e,a.length/3-e,0)})(),function(){var e=a.length/3,t=0;c(D,t),t+=D.length;for(var n=0,i=P.length;n<i;n++){var o=P[n];c(o,t),t+=o.length}r.addGroup(e,a.length/3-e,1)}()}k.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];for(var r=this,a=[],o=[],s=0,c=e.length;s<c;s++)i(e[s]);this.setAttribute("position",new F(a,3)),this.setAttribute("uv",new F(o,2)),this.computeVertexNormals()}function ci(e,t,n){if(n.shapes=[],Array.isArray(e))for(var i=0,r=e.length;i<r;i++)n.shapes.push(e[i].uuid);else n.shapes.push(e.uuid);return void 0!==t.extrudePath&&(n.options.extrudePath=t.extrudePath.toJSON()),n}function li(e,t){W.call(this),this.type="TextGeometry",this.parameters={text:e,parameters:t},this.fromBufferGeometry(new ui(e,t)),this.mergeVertices()}function ui(e,t){t=t||{};var n=t.font;if(!n||!n.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new W;e=n.generateShapes(e,t.size),t.depth=void 0!==t.height?t.height:50,void 0===t.bevelThickness&&(t.bevelThickness=10),void 0===t.bevelSize&&(t.bevelSize=8),void 0===t.bevelEnabled&&(t.bevelEnabled=!1),si.call(this,e,t),this.type="TextBufferGeometry"}function hi(e,t,n,i,r,a,o){W.call(this),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:i,phiLength:r,thetaStart:a,thetaLength:o},this.fromBufferGeometry(new di(e,t,n,i,r,a,o)),this.mergeVertices()}function di(e,t,n,i,r,a,o){k.call(this),this.type="SphereBufferGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:i,phiLength:r,thetaStart:a,thetaLength:o},e=e||1,t=Math.max(3,Math.floor(t)||8),n=Math.max(2,Math.floor(n)||6),i=void 0!==i?i:0,r=void 0!==r?r:2*Math.PI,a=void 0!==a?a:0,o=void 0!==o?o:Math.PI;for(var s=Math.min(a+o,Math.PI),c=0,l=[],h=new u,d=new u,p=[],f=[],m=[],g=[],v=0;v<=n;v++){var y=[],x=v/n,b=0;0==v&&0==a?b=.5/t:v==n&&s==Math.PI&&(b=-.5/t);for(var w=0;w<=t;w++){var _=w/t;h.x=-e*Math.cos(i+_*r)*Math.sin(a+x*o),h.y=e*Math.cos(a+x*o),h.z=e*Math.sin(i+_*r)*Math.sin(a+x*o),f.push(h.x,h.y,h.z),d.copy(h).normalize(),m.push(d.x,d.y,d.z),g.push(_+b,1-x),y.push(c++)}l.push(y)}for(e=0;e<n;e++)for(i=0;i<t;i++)r=l[e][i+1],o=l[e][i],c=l[e+1][i],h=l[e+1][i+1],(0!==e||0<a)&&p.push(r,o,h),(e!==n-1||s<Math.PI)&&p.push(o,c,h);this.setIndex(p),this.setAttribute("position",new F(f,3)),this.setAttribute("normal",new F(m,3)),this.setAttribute("uv",new F(g,2))}function pi(e,t,n,i,r,a){W.call(this),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:i,thetaStart:r,thetaLength:a},this.fromBufferGeometry(new fi(e,t,n,i,r,a)),this.mergeVertices()}function fi(e,t,i,r,a,o){k.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:i,phiSegments:r,thetaStart:a,thetaLength:o},e=e||.5,t=t||1,a=void 0!==a?a:0,o=void 0!==o?o:2*Math.PI,i=void 0!==i?Math.max(3,i):8,r=void 0!==r?Math.max(1,r):1;var s=[],c=[],l=[],h=[],d=e;e=(t-e)/r;for(var p=new u,f=new n,m=0;m<=r;m++){for(var g=0;g<=i;g++){var v=a+g/i*o;p.x=d*Math.cos(v),p.y=d*Math.sin(v),c.push(p.x,p.y,p.z),l.push(0,0,1),f.x=(p.x/t+1)/2,f.y=(p.y/t+1)/2,h.push(f.x,f.y)}d+=e}for(t=0;t<r;t++)for(a=t*(i+1),o=0;o<i;o++)d=o+a,e=d+i+1,p=d+i+2,f=d+1,s.push(d,e,f),s.push(e,p,f);this.setIndex(s),this.setAttribute("position",new F(c,3)),this.setAttribute("normal",new F(l,3)),this.setAttribute("uv",new F(h,2))}function mi(e,t,n,i){W.call(this),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:i},this.fromBufferGeometry(new gi(e,t,n,i)),this.mergeVertices()}function gi(e,t,i,r){k.call(this),this.type="LatheBufferGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:r},t=Math.floor(t)||12,i=i||0,r=r||2*Math.PI,r=qa.clamp(r,0,2*Math.PI);for(var a=[],o=[],s=[],c=1/t,l=new u,h=new n,d=0;d<=t;d++){var p=i+d*c*r,f=Math.sin(p);p=Math.cos(p);for(var m=0;m<=e.length-1;m++)l.x=e[m].x*f,l.y=e[m].y,l.z=e[m].x*p,o.push(l.x,l.y,l.z),h.x=d/t,h.y=m/(e.length-1),s.push(h.x,h.y)}for(i=0;i<t;i++)for(c=0;c<e.length-1;c++)l=c+i*e.length,h=l+e.length,d=l+e.length+1,f=l+1,a.push(l,h,f),a.push(h,d,f);if(this.setIndex(a),this.setAttribute("position",new F(o,3)),this.setAttribute("uv",new F(s,2)),this.computeVertexNormals(),r===2*Math.PI)for(r=this.attributes.normal.array,a=new u,o=new u,s=new u,t=t*e.length*3,c=i=0;i<e.length;i++,c+=3)a.x=r[c+0],a.y=r[c+1],a.z=r[c+2],o.x=r[t+c+0],o.y=r[t+c+1],o.z=r[t+c+2],s.addVectors(a,o).normalize(),r[c+0]=r[t+c+0]=s.x,r[c+1]=r[t+c+1]=s.y,r[c+2]=r[t+c+2]=s.z}function vi(e,t){W.call(this),this.type="ShapeGeometry","object"===Object(a["a"])(t)&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),t=t.curveSegments),this.parameters={shapes:e,curveSegments:t},this.fromBufferGeometry(new yi(e,t)),this.mergeVertices()}function yi(e,t){function n(e){var n=r.length/3,s=e.extractPoints(t);e=s.shape;var l=s.holes;!1===Uc.isClockWise(e)&&(e=e.reverse()),s=0;for(var u=l.length;s<u;s++){var h=l[s];!0===Uc.isClockWise(h)&&(l[s]=h.reverse())}for(s=Uc.triangulateShape(e,l),u=0,h=l.length;u<h;u++)e=e.concat(l[u]);for(l=0,u=e.length;l<u;l++)h=e[l],r.push(h.x,h.y,0),a.push(0,0,1),o.push(h.x,h.y);for(e=0,l=s.length;e<l;e++)u=s[e],i.push(u[0]+n,u[1]+n,u[2]+n),c+=3}k.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:e,curveSegments:t},t=t||12;var i=[],r=[],a=[],o=[],s=0,c=0;if(!1===Array.isArray(e))n(e);else for(var l=0;l<e.length;l++)n(e[l]),this.addGroup(s,c,l),s+=c,c=0;this.setIndex(i),this.setAttribute("position",new F(r,3)),this.setAttribute("normal",new F(a,3)),this.setAttribute("uv",new F(o,2))}function xi(e,t){if(t.shapes=[],Array.isArray(e))for(var n=0,i=e.length;n<i;n++)t.shapes.push(e[n].uuid);else t.shapes.push(e.uuid);return t}function bi(e,t){k.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:t};var n=[];t=Math.cos(qa.DEG2RAD*(void 0!==t?t:1));var i=[0,0],r={},a=["a","b","c"];if(e.isBufferGeometry){var o=new W;o.fromBufferGeometry(e)}else o=e.clone();o.mergeVertices(),o.computeFaceNormals(),e=o.vertices,o=o.faces;for(var s=0,c=o.length;s<c;s++)for(var l=o[s],u=0;3>u;u++){var h=l[a[u]],d=l[a[(u+1)%3]];i[0]=Math.min(h,d),i[1]=Math.max(h,d),h=i[0]+","+i[1],void 0===r[h]?r[h]={index1:i[0],index2:i[1],face1:s,face2:void 0}:r[h].face2=s}for(h in r)i=r[h],(void 0===i.face2||o[i.face1].normal.dot(o[i.face2].normal)<=t)&&(a=e[i.index1],n.push(a.x,a.y,a.z),a=e[i.index2],n.push(a.x,a.y,a.z));this.setAttribute("position",new F(n,3))}function wi(e,t,n,i,r,a,o,s){W.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:r,openEnded:a,thetaStart:o,thetaLength:s},this.fromBufferGeometry(new _i(e,t,n,i,r,a,o,s)),this.mergeVertices()}function _i(e,t,i,r,a,o,s,c){function l(i){var a,o=new n,l=new u,v=0,b=!0===i?e:t,w=!0===i?1:-1,_=g;for(a=1;a<=r;a++)p.push(0,y*w,0),f.push(0,w,0),m.push(.5,.5),g++;a=g;for(var M=0;M<=r;M++){var S=M/r*c+s,T=Math.cos(S);S=Math.sin(S),l.x=b*S,l.y=y*w,l.z=b*T,p.push(l.x,l.y,l.z),f.push(0,w,0),o.x=.5*T+.5,o.y=.5*S*w+.5,m.push(o.x,o.y),g++}for(o=0;o<r;o++)l=_+o,b=a+o,!0===i?d.push(b,b+1,l):d.push(b+1,b,l),v+=3;h.addGroup(x,v,!0===i?1:2),x+=v}k.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:i,radialSegments:r,heightSegments:a,openEnded:o,thetaStart:s,thetaLength:c};var h=this;e=void 0!==e?e:1,t=void 0!==t?t:1,i=i||1,r=Math.floor(r)||8,a=Math.floor(a)||1,o=void 0!==o&&o,s=void 0!==s?s:0,c=void 0!==c?c:2*Math.PI;var d=[],p=[],f=[],m=[],g=0,v=[],y=i/2,x=0;(function(){for(var n=new u,o=new u,l=0,b=(t-e)/i,w=0;w<=a;w++){for(var _=[],M=w/a,S=M*(t-e)+e,T=0;T<=r;T++){var E=T/r,A=E*c+s,L=Math.sin(A);A=Math.cos(A),o.x=S*L,o.y=-M*i+y,o.z=S*A,p.push(o.x,o.y,o.z),n.set(L,b,A).normalize(),f.push(n.x,n.y,n.z),m.push(E,1-M),_.push(g++)}v.push(_)}for(n=0;n<r;n++)for(o=0;o<a;o++)b=v[o+1][n],w=v[o+1][n+1],_=v[o][n+1],d.push(v[o][n],b,_),d.push(b,w,_),l+=6;h.addGroup(x,l,0),x+=l})(),!1===o&&(0<e&&l(!0),0<t&&l(!1)),this.setIndex(d),this.setAttribute("position",new F(p,3)),this.setAttribute("normal",new F(f,3)),this.setAttribute("uv",new F(m,2))}function Mi(e,t,n,i,r,a,o){wi.call(this,0,e,t,n,i,r,a,o),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:a,thetaLength:o}}function Si(e,t,n,i,r,a,o){_i.call(this,0,e,t,n,i,r,a,o),this.type="ConeBufferGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:a,thetaLength:o}}function Ti(e,t,n,i){W.call(this),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},this.fromBufferGeometry(new Ei(e,t,n,i)),this.mergeVertices()}function Ei(e,t,i,r){k.call(this),this.type="CircleBufferGeometry",this.parameters={radius:e,segments:t,thetaStart:i,thetaLength:r},e=e||1,t=void 0!==t?Math.max(3,t):8,i=void 0!==i?i:0,r=void 0!==r?r:2*Math.PI;var a=[],o=[],s=[],c=[],l=new u,h=new n;o.push(0,0,0),s.push(0,0,1),c.push(.5,.5);for(var d=0,p=3;d<=t;d++,p+=3){var f=i+d/t*r;l.x=e*Math.cos(f),l.y=e*Math.sin(f),o.push(l.x,l.y,l.z),s.push(0,0,1),h.x=(o[p]/e+1)/2,h.y=(o[p+1]/e+1)/2,c.push(h.x,h.y)}for(e=1;e<=t;e++)a.push(e,e+1,0);this.setIndex(a),this.setAttribute("position",new F(o,3)),this.setAttribute("normal",new F(s,3)),this.setAttribute("uv",new F(c,2))}function Ai(e){A.call(this),this.type="ShadowMaterial",this.color=new _(0),this.transparent=!0,this.setValues(e)}function Li(e){X.call(this,e),this.type="RawShaderMaterial"}function Ci(e){A.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new _(16777215),this.roughness=1,this.metalness=0,this.lightMap=this.map=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _(0),this.emissiveIntensity=1,this.bumpMap=this.emissiveMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new n(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.envMap=this.alphaMap=this.metalnessMap=this.roughnessMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.vertexTangents=this.morphNormals=this.morphTargets=this.skinning=!1,this.setValues(e)}function Ri(e){Ci.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new n(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,this.sheen=null,this.transparency=0,this.setValues(e)}function Pi(e){A.call(this),this.type="MeshPhongMaterial",this.color=new _(16777215),this.specular=new _(1118481),this.shininess=30,this.lightMap=this.map=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _(0),this.emissiveIntensity=1,this.bumpMap=this.emissiveMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new n(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.envMap=this.alphaMap=this.specularMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.morphNormals=this.morphTargets=this.skinning=!1,this.setValues(e)}function Oi(e){A.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new _(16777215),this.lightMap=this.gradientMap=this.map=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _(0),this.emissiveIntensity=1,this.bumpMap=this.emissiveMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new n(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.morphNormals=this.morphTargets=this.skinning=!1,this.setValues(e)}function Ii(e){A.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new n(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.morphNormals=this.morphTargets=this.skinning=this.fog=!1,this.setValues(e)}function Di(e){A.call(this),this.type="MeshLambertMaterial",this.color=new _(16777215),this.lightMap=this.map=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new _(0),this.emissiveIntensity=1,this.envMap=this.alphaMap=this.specularMap=this.emissiveMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.morphNormals=this.morphTargets=this.skinning=!1,this.setValues(e)}function Ni(e){A.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new _(16777215),this.bumpMap=this.map=this.matcap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new n(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.morphNormals=this.morphTargets=this.skinning=!1,this.setValues(e)}function Bi(e){ln.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}function Fi(e,t,n,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==i?i:new t.constructor(n),this.sampleValues=t,this.valueSize=n}function Ui(e,t,n,i){Fi.call(this,e,t,n,i),this._offsetNext=this._weightNext=this._offsetPrev=this._weightPrev=-0}function zi(e,t,n,i){Fi.call(this,e,t,n,i)}function Gi(e,t,n,i){Fi.call(this,e,t,n,i)}function ki(e,t,n,i){if(void 0===e)throw Error("THREE.KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Hc.convertArray(t,this.TimeBufferType),this.values=Hc.convertArray(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}function Hi(e,t,n){ki.call(this,e,t,n)}function ji(e,t,n,i){ki.call(this,e,t,n,i)}function Vi(e,t,n,i){ki.call(this,e,t,n,i)}function Wi(e,t,n,i){Fi.call(this,e,t,n,i)}function qi(e,t,n,i){ki.call(this,e,t,n,i)}function Yi(e,t,n,i){ki.call(this,e,t,n,i)}function Xi(e,t,n,i){ki.call(this,e,t,n,i)}function Zi(e,t,n,i){this.name=e,this.tracks=n,this.duration=void 0!==t?t:-1,this.blendMode=void 0!==i?i:2500,this.uuid=qa.generateUUID(),0>this.duration&&this.resetDuration()}function Ji(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Vi;case"vector":case"vector2":case"vector3":case"vector4":return Xi;case"color":return ji;case"quaternion":return qi;case"bool":case"boolean":return Hi;case"string":return Yi}throw Error("THREE.KeyframeTrack: Unsupported typeName: "+e)}function Qi(e){if(void 0===e.type)throw Error("THREE.KeyframeTrack: track type undefined, can not parse");var t=Ji(e.type);if(void 0===e.times){var n=[],i=[];Hc.flattenJSON(e.keys,n,i,"value"),e.times=n,e.values=i}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}function Ki(e,t,n){var i=this,r=!1,a=0,o=0,s=void 0,c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){o++,!1===r&&void 0!==i.onStart&&i.onStart(e,a,o),r=!0},this.itemEnd=function(e){a++,void 0!==i.onProgress&&i.onProgress(e,a,o),a===o&&(r=!1,void 0!==i.onLoad)&&i.onLoad()},this.itemError=function(e){void 0!==i.onError&&i.onError(e)},this.resolveURL=function(e){return s?s(e):e},this.setURLModifier=function(e){return s=e,this},this.addHandler=function(e,t){return c.push(e,t),this},this.removeHandler=function(e){return e=c.indexOf(e),-1!==e&&c.splice(e,2),this},this.getHandler=function(e){for(var t=0,n=c.length;t<n;t+=2){var i=c[t],r=c[t+1];if(i.global&&(i.lastIndex=0),i.test(e))return r}return null}}function $i(e){this.manager=void 0!==e?e:Vc,this.crossOrigin="anonymous",this.resourcePath=this.path="",this.requestHeader={}}function er(e){$i.call(this,e)}function tr(e){$i.call(this,e)}function nr(e){$i.call(this,e)}function ir(e){$i.call(this,e)}function rr(e){$i.call(this,e)}function ar(e){$i.call(this,e)}function or(e){$i.call(this,e)}function sr(){this.type="Curve",this.arcLengthDivisions=200}function cr(e,t,n,i,r,a,o,s){sr.call(this),this.type="EllipseCurve",this.aX=e||0,this.aY=t||0,this.xRadius=n||1,this.yRadius=i||1,this.aStartAngle=r||0,this.aEndAngle=a||2*Math.PI,this.aClockwise=o||!1,this.aRotation=s||0}function lr(e,t,n,i,r,a){cr.call(this,e,t,n,n,i,r,a),this.type="ArcCurve"}function ur(){var e=0,t=0,n=0,i=0;return{initCatmullRom:function(r,a,o,s,c){r=c*(o-r),s=c*(s-a),e=a,t=r,n=-3*a+3*o-2*r-s,i=2*a-2*o+r+s},initNonuniformCatmullRom:function(r,a,o,s,c,l,u){r=((a-r)/c-(o-r)/(c+l)+(o-a)/l)*l,s=((o-a)/l-(s-a)/(l+u)+(s-o)/u)*l,e=a,t=r,n=-3*a+3*o-2*r-s,i=2*a-2*o+r+s},calc:function(r){var a=r*r;return e+t*r+n*a+i*a*r}}}function hr(e,t,n,i){sr.call(this),this.type="CatmullRomCurve3",this.points=e||[],this.closed=t||!1,this.curveType=n||"centripetal",this.tension=i||.5}function dr(e,t,n,i,r){t=.5*(i-t),r=.5*(r-n);var a=e*e;return(2*n-2*i+t+r)*e*a+(-3*n+3*i-2*t-r)*a+t*e+n}function pr(e,t,n,i){var r=1-e;return r*r*t+2*(1-e)*e*n+e*e*i}function fr(e,t,n,i,r){var a=1-e,o=1-e;return a*a*a*t+3*o*o*e*n+3*(1-e)*e*e*i+e*e*e*r}function mr(e,t,i,r){sr.call(this),this.type="CubicBezierCurve",this.v0=e||new n,this.v1=t||new n,this.v2=i||new n,this.v3=r||new n}function gr(e,t,n,i){sr.call(this),this.type="CubicBezierCurve3",this.v0=e||new u,this.v1=t||new u,this.v2=n||new u,this.v3=i||new u}function vr(e,t){sr.call(this),this.type="LineCurve",this.v1=e||new n,this.v2=t||new n}function yr(e,t){sr.call(this),this.type="LineCurve3",this.v1=e||new u,this.v2=t||new u}function xr(e,t,i){sr.call(this),this.type="QuadraticBezierCurve",this.v0=e||new n,this.v1=t||new n,this.v2=i||new n}function br(e,t,n){sr.call(this),this.type="QuadraticBezierCurve3",this.v0=e||new u,this.v1=t||new u,this.v2=n||new u}function wr(e){sr.call(this),this.type="SplineCurve",this.points=e||[]}function _r(){sr.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function Mr(e){_r.call(this),this.type="Path",this.currentPoint=new n,e&&this.setFromPoints(e)}function Sr(e){Mr.call(this,e),this.uuid=qa.generateUUID(),this.type="Shape",this.holes=[]}function Tr(e,t){f.call(this),this.type="Light",this.color=new _(e),this.intensity=void 0!==t?t:1,this.receiveShadow=void 0}function Er(e,t,n){Tr.call(this,e,n),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(f.DefaultUp),this.updateMatrix(),this.groundColor=new _(t)}function Ar(e){this.camera=e,this.normalBias=this.bias=0,this.radius=1,this.mapSize=new n(512,512),this.mapPass=this.map=null,this.matrix=new h,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new ee,this._frameExtents=new n(1,1),this._viewportCount=1,this._viewports=[new o(0,0,1,1)]}function Lr(){Ar.call(this,new J(50,1,.5,500))}function Cr(e,t,n,i,r,a){Tr.call(this,e,t),this.type="SpotLight",this.position.copy(f.DefaultUp),this.updateMatrix(),this.target=new f,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(e){this.intensity=e/Math.PI}}),this.distance=void 0!==n?n:0,this.angle=void 0!==i?i:Math.PI/3,this.penumbra=void 0!==r?r:0,this.decay=void 0!==a?a:1,this.shadow=new Lr}function Rr(){Ar.call(this,new J(90,1,.5,500)),this._frameExtents=new n(4,2),this._viewportCount=6,this._viewports=[new o(2,1,1,1),new o(0,1,1,1),new o(3,1,1,1),new o(1,1,1,1),new o(3,0,1,1),new o(1,0,1,1)],this._cubeDirections=[new u(1,0,0),new u(-1,0,0),new u(0,0,1),new u(0,0,-1),new u(0,1,0),new u(0,-1,0)],this._cubeUps=[new u(0,1,0),new u(0,1,0),new u(0,1,0),new u(0,1,0),new u(0,0,1),new u(0,0,-1)]}function Pr(e,t,n,i){Tr.call(this,e,t),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(e){this.intensity=e/(4*Math.PI)}}),this.distance=void 0!==n?n:0,this.decay=void 0!==i?i:1,this.shadow=new Rr}function Or(e,t,n,i,r,a){Z.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=void 0!==e?e:-1,this.right=void 0!==t?t:1,this.top=void 0!==n?n:1,this.bottom=void 0!==i?i:-1,this.near=void 0!==r?r:.1,this.far=void 0!==a?a:2e3,this.updateProjectionMatrix()}function Ir(){Ar.call(this,new Or(-5,5,5,-5,.5,500))}function Dr(e,t){Tr.call(this,e,t),this.type="DirectionalLight",this.position.copy(f.DefaultUp),this.updateMatrix(),this.target=new f,this.shadow=new Ir}function Nr(e,t){Tr.call(this,e,t),this.type="AmbientLight",this.castShadow=void 0}function Br(e,t,n,i){Tr.call(this,e,t),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==i?i:10}function Fr(){this.coefficients=[];for(var e=0;9>e;e++)this.coefficients.push(new u)}function Ur(e,t){Tr.call(this,void 0,t),this.type="LightProbe",this.sh=void 0!==e?e:new Fr}function zr(e){$i.call(this,e),this.textures={}}function Gr(){k.call(this),this.type="InstancedBufferGeometry",this.instanceCount=1/0}function kr(e,t,n,i){"number"===typeof n&&(i=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),C.call(this,e,t,n),this.meshPerAttribute=i||1}function Hr(e){$i.call(this,e)}function jr(e){$i.call(this,e)}function Vr(e){"undefined"===typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"===typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),$i.call(this,e),this.options={premultiplyAlpha:"none"}}function Wr(){this.type="ShapePath",this.color=new _,this.subPaths=[],this.currentPath=null}function qr(e){this.type="Font",this.data=e}function Yr(e){$i.call(this,e)}function Xr(e){$i.call(this,e)}function Zr(e,t,n){Ur.call(this,void 0,n),e=(new _).set(e),n=(new _).set(t),t=new u(e.r,e.g,e.b),e=new u(n.r,n.g,n.b),n=Math.sqrt(Math.PI);var i=n*Math.sqrt(.75);this.sh.coefficients[0].copy(t).add(e).multiplyScalar(n),this.sh.coefficients[1].copy(t).sub(e).multiplyScalar(i)}function Jr(e,t){Ur.call(this,void 0,t),e=(new _).set(e),this.sh.coefficients[0].set(e.r,e.g,e.b).multiplyScalar(2*Math.sqrt(Math.PI))}function Qr(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new J,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new J,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}function Kr(e){this.autoStart=void 0===e||e,this.elapsedTime=this.oldTime=this.startTime=0,this.running=!1}function $r(){f.call(this),this.type="AudioListener",this.context=il.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Kr}function ea(e){f.call(this),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.offset=this.loopEnd=this.loopStart=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this._progress=this._startedAt=0,this.filters=[]}function ta(e){ea.call(this,e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}function na(e,t){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=void 0!==t?t:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}function ia(e,t,n){switch(this.binding=e,this.valueSize=n,t){case"quaternion":e=this._slerp,t=this._slerpAdditive;var i=this._setAdditiveIdentityQuaternion;this.buffer=new Float64Array(6*n),this._workIndex=5;break;case"string":case"bool":t=e=this._select,i=this._setAdditiveIdentityOther,this.buffer=Array(5*n);break;default:e=this._lerp,t=this._lerpAdditive,i=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*n)}this._mixBufferRegion=e,this._mixBufferRegionAdditive=t,this._setIdentity=i,this._origIndex=3,this._addIndex=4,this.referenceCount=this.useCount=this.cumulativeWeightAdditive=this.cumulativeWeight=0}function ra(e,t,n){n=n||aa.parseTrackName(t),this._targetGroup=e,this._bindings=e.subscribe_(t,n)}function aa(e,t,n){this.path=t,this.parsedPath=n||aa.parseTrackName(t),this.node=aa.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}function oa(){this.uuid=qa.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var e={};this._indicesByUUID=e;for(var t=0,n=arguments.length;t!==n;++t)e[arguments[t].uuid]=t;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 sa(e,t,n,i){this._mixer=e,this._clip=t,this._localRoot=n||null,this.blendMode=i||t.blendMode,e=t.tracks,t=e.length,n=Array(t),i={endingStart:2400,endingEnd:2400};for(var r=0;r!==t;++r){var a=e[r].createInterpolant(null);n[r]=a,a.settings=i}this._interpolantSettings=i,this._interpolants=n,this._propertyBindings=Array(t),this._weightInterpolant=this._timeScaleInterpolant=this._byClipCacheIndex=this._cacheIndex=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this._effectiveWeight=this.weight=this._effectiveTimeScale=this.timeScale=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtEnd=this.zeroSlopeAtStart=!0}function ca(e){this._root=e,this._initMemoryManager(),this.time=this._accuIndex=0,this.timeScale=1}function la(e,t){"string"===typeof e&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=t),this.value=e}function ua(e,t,n){Kt.call(this,e,t),this.meshPerAttribute=n||1}function ha(e,t,n,i){this.ray=new x(e,t),this.near=n||0,this.far=i||1/0,this.camera=null,this.layers=new p,this.params={Mesh:{},Line:{threshold:1},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 da(e,t){return e.distance-t.distance}function pa(e,t,n,i){if(e.layers.test(t.layers)&&e.raycast(t,n),!0===i){e=e.children,i=0;for(var r=e.length;i<r;i++)pa(e[i],t,n,!0)}}function fa(e,t,n){return this.radius=void 0!==e?e:1,this.phi=void 0!==t?t:0,this.theta=void 0!==n?n:0,this}function ma(e,t,n){return this.radius=void 0!==e?e:1,this.theta=void 0!==t?t:0,this.y=void 0!==n?n:0,this}function ga(e,t){this.min=void 0!==e?e:new n(1/0,1/0),this.max=void 0!==t?t:new n(-1/0,-1/0)}function va(e,t){this.start=void 0!==e?e:new u,this.end=void 0!==t?t:new u}function ya(e){f.call(this),this.material=e,this.render=function(){},this.hasUvs=this.hasColors=this.hasNormals=this.hasPositions=!1,this.uvArray=this.colorArray=this.normalArray=this.positionArray=null,this.count=0}function xa(e,t){f.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t,e=new k,t=[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];for(var n=0,i=1;32>n;n++,i++){var r=n/32*Math.PI*2,a=i/32*Math.PI*2;t.push(Math.cos(r),Math.sin(r),1,Math.cos(a),Math.sin(a),1)}e.setAttribute("position",new F(t,3)),t=new ln({fog:!1,toneMapped:!1}),this.cone=new hn(e,t),this.add(this.cone),this.update()}function ba(e){var t=[];e&&e.isBone&&t.push(e);for(var n=0;n<e.children.length;n++)t.push.apply(t,ba(e.children[n]));return t}function wa(e){for(var t=ba(e),n=new k,i=[],r=[],a=new _(0,0,1),o=new _(0,1,0),s=0;s<t.length;s++){var c=t[s];c.parent&&c.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),r.push(a.r,a.g,a.b),r.push(o.r,o.g,o.b))}n.setAttribute("position",new F(i,3)),n.setAttribute("color",new F(r,3)),i=new ln({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0}),hn.call(this,n,i),this.type="SkeletonHelper",this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}function _a(e,t,n){this.light=e,this.light.updateMatrixWorld(),this.color=n,e=new di(t,4,2),t=new L({wireframe:!0,fog:!1,toneMapped:!1}),H.call(this,e,t),this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}function Ma(e,t,n){f.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,e=new Ln(t),e.rotateY(.5*Math.PI),this.material=new L({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0),t=e.getAttribute("position"),t=new Float32Array(3*t.count),e.setAttribute("color",new C(t,3)),this.add(new H(e,this.material)),this.update()}function Sa(e,t,n,i){e=e||10,t=t||10,n=new _(void 0!==n?n:4473924),i=new _(void 0!==i?i:8947848);var r=t/2,a=e/t,o=e/2;e=[];for(var s=[],c=0,l=0,u=-o;c<=t;c++,u+=a){e.push(-o,0,u,o,0,u),e.push(u,0,-o,u,0,o);var h=c===r?n:i;h.toArray(s,l),l+=3,h.toArray(s,l),l+=3,h.toArray(s,l),l+=3,h.toArray(s,l),l+=3}t=new k,t.setAttribute("position",new F(e,3)),t.setAttribute("color",new F(s,3)),n=new ln({vertexColors:!0,toneMapped:!1}),hn.call(this,t,n),this.type="GridHelper"}function Ta(e,t,n,i,r,a){e=e||10,t=t||16,n=n||8,i=i||64,r=new _(void 0!==r?r:4473924),a=new _(void 0!==a?a:8947848);for(var o=[],s=[],c=0;c<=t;c++){var l=c/t*2*Math.PI,u=Math.sin(l)*e;l=Math.cos(l)*e,o.push(0,0,0),o.push(u,0,l),u=1&c?r:a,s.push(u.r,u.g,u.b),s.push(u.r,u.g,u.b)}for(t=0;t<=n;t++)for(c=1&t?r:a,u=e-e/n*t,l=0;l<i;l++){var h=l/i*2*Math.PI,d=Math.sin(h)*u;h=Math.cos(h)*u,o.push(d,0,h),s.push(c.r,c.g,c.b),h=(l+1)/i*2*Math.PI,d=Math.sin(h)*u,h=Math.cos(h)*u,o.push(d,0,h),s.push(c.r,c.g,c.b)}e=new k,e.setAttribute("position",new F(o,3)),e.setAttribute("color",new F(s,3)),o=new ln({vertexColors:!0,toneMapped:!1}),hn.call(this,e,o),this.type="PolarGridHelper"}function Ea(e,t,n){f.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,void 0===t&&(t=1),e=new k,e.setAttribute("position",new F([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3)),t=new ln({fog:!1,toneMapped:!1}),this.lightPlane=new un(e,t),this.add(this.lightPlane),e=new k,e.setAttribute("position",new F([0,0,0,0,0,1],3)),this.targetLine=new un(e,t),this.add(this.targetLine),this.update()}function Aa(e){function t(e,t,i){n(e,i),n(t,i)}function n(e,t){a.push(0,0,0),o.push(t.r,t.g,t.b),void 0===s[e]&&(s[e]=[]),s[e].push(a.length/3-1)}var i=new k,r=new ln({color:16777215,vertexColors:!0,toneMapped:!1}),a=[],o=[],s={},c=new _(16755200),l=new _(16711680),u=new _(43775),h=new _(16777215),d=new _(3355443);t("n1","n2",c),t("n2","n4",c),t("n4","n3",c),t("n3","n1",c),t("f1","f2",c),t("f2","f4",c),t("f4","f3",c),t("f3","f1",c),t("n1","f1",c),t("n2","f2",c),t("n3","f3",c),t("n4","f4",c),t("p","n1",l),t("p","n2",l),t("p","n3",l),t("p","n4",l),t("u1","u2",u),t("u2","u3",u),t("u3","u1",u),t("c","t",h),t("p","c",d),t("cn1","cn2",d),t("cn3","cn4",d),t("cf1","cf2",d),t("cf3","cf4",d),i.setAttribute("position",new F(a,3)),i.setAttribute("color",new F(o,3)),hn.call(this,i,r),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=s,this.update()}function La(e,t,n,i,r,a,o){if(Nl.set(r,a,o).unproject(i),e=t[e],void 0!==e)for(n=n.getAttribute("position"),t=0,i=e.length;t<i;t++)n.setXYZ(e[t],Nl.x,Nl.y,Nl.z)}function Ca(e,t){this.object=e,void 0===t&&(t=16776960),e=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]);var n=new Float32Array(24),i=new k;i.setIndex(new C(e,1)),i.setAttribute("position",new C(n,3)),hn.call(this,i,new ln({color:t,toneMapped:!1})),this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}function Ra(e,t){this.type="Box3Helper",this.box=e,t=t||16776960,e=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]);var n=new k;n.setIndex(new C(e,1)),n.setAttribute("position",new F([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),hn.call(this,n,new ln({color:t,toneMapped:!1})),this.type="Box3Helper",this.geometry.computeBoundingSphere()}function Pa(e,t,n){this.plane=e,this.size=void 0===t?1:t,e=void 0!==n?n:16776960,t=new k,t.setAttribute("position",new F([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,0,1,0,0,0],3)),t.computeBoundingSphere(),un.call(this,t,new ln({color:e,toneMapped:!1})),this.type="PlaneHelper",t=new k,t.setAttribute("position",new F([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),t.computeBoundingSphere(),this.add(new H(t,new L({color:e,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}function Oa(e,t,n,i,r,a){f.call(this),this.type="ArrowHelper",void 0===e&&(e=new u(0,0,1)),void 0===t&&(t=new u(0,0,0)),void 0===n&&(n=1),void 0===i&&(i=16776960),void 0===r&&(r=.2*n),void 0===a&&(a=.2*r),void 0===Ul&&(Ul=new k,Ul.setAttribute("position",new F([0,0,0,0,1,0],3)),zl=new _i(0,.5,1,5,1),zl.translate(0,-.5,0)),this.position.copy(t),this.line=new un(Ul,new ln({color:i,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new H(zl,new L({color:i,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,r,a)}function Ia(e){e=e||1;var t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e];e=new k,e.setAttribute("position",new F(t,3)),e.setAttribute("color",new F([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),t=new ln({vertexColors:!0,toneMapped:!1}),hn.call(this,e,t),this.type="AxesHelper"}function Da(e){this._renderer=e,this._pingPongRenderTarget=null,e=new Float32Array(20);var t=new u(0,1,0);this._blurMaterial=new Li({name:"SphericalGaussianBlur",defines:{n:20},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:t},inputEncoding:{value:Vl[3e3]},outputEncoding:{value:Vl[3e3]}},vertexShader:za(),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"+Ga()+"\n\n#define ENVMAP_TYPE_CUBE_UV\n#include <cube_uv_reflection_fragment>\n\nvec3 getSample(float theta, vec3 axis) {\n\tfloat cosTheta = cos(theta);\n\t// Rodrigues' axis-angle rotation\n\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t+ cross(axis, vOutputDirection) * sin(theta)\n\t\t+ axis * dot(axis, vOutputDirection) * (1.0 - cosTheta);\n\treturn bilinearCubeUV(envMap, sampleDirection, mipInt);\n}\n\nvoid main() {\n\tvec3 axis = latitudinal ? poleAxis : cross(poleAxis, vOutputDirection);\n\tif (all(equal(axis, vec3(0.0))))\n\t\taxis = vec3(vOutputDirection.z, 0.0, - vOutputDirection.x);\n\taxis = normalize(axis);\n\tgl_FragColor = vec4(0.0);\n\tgl_FragColor.rgb += weights[0] * getSample(0.0, axis);\n\tfor (int i = 1; i < n; i++) {\n\t\tif (i >= samples)\n\t\t\tbreak;\n\t\tfloat theta = dTheta * float(i);\n\t\tgl_FragColor.rgb += weights[i] * getSample(-1.0 * theta, axis);\n\t\tgl_FragColor.rgb += weights[i] * getSample(theta, axis);\n\t}\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t",blending:0,depthTest:!1,depthWrite:!1}),this._cubemapShader=this._equirectShader=null,this._compileMaterial(this._blurMaterial)}function Na(e){return e=new s(3*kl,3*kl,e),e.texture.mapping=306,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function Ba(e,t,n,i,r){e.viewport.set(t,n,i,r),e.scissor.set(t,n,i,r)}function Fa(){var e=new n(1,1);return new Li({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:e},inputEncoding:{value:Vl[3e3]},outputEncoding:{value:Vl[3e3]}},vertexShader:za(),fragmentShader:"\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform vec2 texelSize;\n\n"+Ga()+"\n\n#include <common>\n\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tvec3 outputDirection = normalize(vOutputDirection);\n\tvec2 uv = equirectUv( outputDirection );\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:0,depthTest:!1,depthWrite:!1})}function Ua(){return new Li({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:Vl[3e3]},outputEncoding:{value:Vl[3e3]}},vertexShader:za(),fragmentShader:"\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform samplerCube envMap;\n\n"+Ga()+"\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:0,depthTest:!1,depthWrite:!1})}function za(){return"\nprecision mediump float;\nprecision mediump int;\nattribute vec3 position;\nattribute vec2 uv;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\n\n// RH coordinate system; PMREM face-indexing convention\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; // ( 1, v, u ) pos x\n\t} else if (face == 1.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\t} else if (face == 2.0) {\n\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\t} else if (face == 3.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\t} else if (face == 4.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\t} else if (face == 5.0) {\n\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\t}\n\treturn direction;\n}\n\nvoid main() {\n\tvOutputDirection = getDirection(uv, faceIndex);\n\tgl_Position = vec4( position, 1.0 );\n}\n\t"}function Ga(){return"\nuniform int inputEncoding;\nuniform int outputEncoding;\n\n#include <encodings_pars_fragment>\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 ka(e){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),hr.call(this,e),this.type="catmullrom",this.closed=!0}function Ha(e){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),hr.call(this,e),this.type="catmullrom"}function ja(e){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),hr.call(this,e),this.type="catmullrom"}void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(e){return"number"===typeof e&&isFinite(e)&&Math.floor(e)===e}),void 0===Math.sign&&(Math.sign=function(e){return 0>e?-1:0<e?1:+e}),!1==="name"in Function.prototype&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(e){if(void 0===e||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var i=arguments[n];if(void 0!==i&&null!==i)for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t}),Object.assign(t.prototype,{addEventListener:function(e,t){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)},hasEventListener:function(e,t){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)},removeEventListener:function(e,t){void 0!==this._listeners&&(e=this._listeners[e],void 0!==e&&(t=e.indexOf(t),-1!==t&&e.splice(t,1)))},dispatchEvent:function(e){if(void 0!==this._listeners){var t=this._listeners[e.type];if(void 0!==t){e.target=this,t=t.slice(0);for(var n=0,i=t.length;n<i;n++)t[n].call(this,e)}}}});for(var Va=[],Wa=0;256>Wa;Wa++)Va[Wa]=(16>Wa?"0":"")+Wa.toString(16);var qa={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return(Va[255&e]+Va[e>>8&255]+Va[e>>16&255]+Va[e>>24&255]+"-"+Va[255&t]+Va[t>>8&255]+"-"+Va[t>>16&15|64]+Va[t>>24&255]+"-"+Va[63&n|128]+Va[n>>8&255]+"-"+Va[n>>16&255]+Va[n>>24&255]+Va[255&i]+Va[i>>8&255]+Va[i>>16&255]+Va[i>>24&255]).toUpperCase()},clamp:function(e,t,n){return Math.max(t,Math.min(n,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,n,i,r){return i+(e-t)*(r-i)/(n-t)},lerp:function(e,t,n){return(1-n)*e+n*t},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*(3-2*e))},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*e*(e*(6*e-15)+10))},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},degToRad:function(e){return e*qa.DEG2RAD},radToDeg:function(e){return e*qa.RAD2DEG},isPowerOfTwo:function(e){return 0===(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,n,i,r){var a=Math.cos,o=Math.sin,s=a(n/2);n=o(n/2);var c=a((t+i)/2),l=o((t+i)/2),u=a((t-i)/2),h=o((t-i)/2);switch(a=a((i-t)/2),t=o((i-t)/2),r){case"XYX":e.set(s*l,n*u,n*h,s*c);break;case"YZY":e.set(n*h,s*l,n*u,s*c);break;case"ZXZ":e.set(n*u,n*h,s*l,s*c);break;case"XZX":e.set(s*l,n*t,n*a,s*c);break;case"YXY":e.set(n*a,s*l,n*t,s*c);break;case"ZYZ":e.set(n*t,n*a,s*l,s*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}};Object.defineProperties(n.prototype,{width:{get:function(){return this.x},set:function(e){this.x=e}},height:{get:function(){return this.y},set:function(e){this.y=e}}}),Object.assign(n.prototype,{isVector2:!0,set:function(e,t){return this.x=e,this.y=t,this},setScalar:function(e){return this.y=this.x=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(e){return this.x=e.x,this.y=e.y,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)},addScalar:function(e){return this.x+=e,this.y+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)},subScalar:function(e){return this.x-=e,this.y-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this},multiply:function(e){return this.x*=e.x,this.y*=e.y,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return this.x/=e.x,this.y/=e.y,this},divideScalar:function(e){return this.multiplyScalar(1/e)},applyMatrix3:function(e){var t=this.x,n=this.y;return e=e.elements,this.x=e[0]*t+e[3]*n+e[6],this.y=e[1]*t+e[4]*n+e[7],this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this},clampScalar:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,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=0>this.x?Math.ceil(this.x):Math.floor(this.x),this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(e){return this.x*e.x+this.y*e.y},cross:function(e){return this.x*e.y-this.y*e.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(){return Math.atan2(-this.y,-this.x)+Math.PI},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x;return e=this.y-e.y,t*t+e*e},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this},lerpVectors:function(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this},equals:function(e){return e.x===this.x&&e.y===this.y},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this},rotateAround:function(e,t){var n=Math.cos(t);t=Math.sin(t);var i=this.x-e.x,r=this.y-e.y;return this.x=i*n-r*t+e.x,this.y=i*t+r*n+e.y,this},random:function(){return this.x=Math.random(),this.y=Math.random(),this}}),Object.assign(i.prototype,{isMatrix3:!0,set:function(e,t,n,i,r,a,o,s,c){var l=this.elements;return l[0]=e,l[1]=i,l[2]=o,l[3]=t,l[4]=r,l[5]=s,l[6]=n,l[7]=a,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(e){var t=this.elements;return e=e.elements,t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],this},extractBasis:function(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this},setFromMatrix4:function(e){return e=e.elements,this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},multiply:function(e){return this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,i=t.elements;t=this.elements,e=n[0];var r=n[3],a=n[6],o=n[1],s=n[4],c=n[7],l=n[2],u=n[5];n=n[8];var h=i[0],d=i[3],p=i[6],f=i[1],m=i[4],g=i[7],v=i[2],y=i[5];return i=i[8],t[0]=e*h+r*f+a*v,t[3]=e*d+r*m+a*y,t[6]=e*p+r*g+a*i,t[1]=o*h+s*f+c*v,t[4]=o*d+s*m+c*y,t[7]=o*p+s*g+c*i,t[2]=l*h+u*f+n*v,t[5]=l*d+u*m+n*y,t[8]=l*p+u*g+n*i,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this},determinant:function(){var e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],o=e[5],s=e[6],c=e[7];return e=e[8],t*a*e-t*o*c-n*r*e+n*o*s+i*r*c-i*a*s},getInverse:function(e,t){void 0!==t&&console.warn("THREE.Matrix3: .getInverse() can no longer be configured to throw on degenerate.");var n=e.elements;e=this.elements,t=n[0];var i=n[1],r=n[2],a=n[3],o=n[4],s=n[5],c=n[6],l=n[7];n=n[8];var u=n*o-s*l,h=s*c-n*a,d=l*a-o*c,p=t*u+i*h+r*d;return 0===p?this.set(0,0,0,0,0,0,0,0,0):(p=1/p,e[0]=u*p,e[1]=(r*l-n*i)*p,e[2]=(s*i-r*o)*p,e[3]=h*p,e[4]=(n*t-r*c)*p,e[5]=(r*a-s*t)*p,e[6]=d*p,e[7]=(i*c-l*t)*p,e[8]=(o*t-i*a)*p,this)},transpose:function(){var e=this.elements,t=e[1];return 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(e){return this.setFromMatrix4(e).getInverse(this).transpose()},transposeIntoArray:function(e){var t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this},setUvTransform:function(e,t,n,i,r,a,o){var s=Math.cos(r);r=Math.sin(r),this.set(n*s,n*r,-n*(s*a+r*o)+a+e,-i*r,i*s,-i*(-r*a+s*o)+o+t,0,0,1)},scale:function(e,t){var n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this},rotate:function(e){var t=Math.cos(e);e=Math.sin(e);var n=this.elements,i=n[0],r=n[3],a=n[6],o=n[1],s=n[4],c=n[7];return n[0]=t*i+e*o,n[3]=t*r+e*s,n[6]=t*a+e*c,n[1]=-e*i+t*o,n[4]=-e*r+t*s,n[7]=-e*a+t*c,this},translate:function(e,t){var n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this},equals:function(e){var t=this.elements;e=e.elements;for(var n=0;9>n;n++)if(t[n]!==e[n])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var n=0;9>n;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}});var Ya,Xa={getDataURL:function(e){if(/^data:/i.test(e.src)||"undefined"==typeof HTMLCanvasElement)return e.src;if(!(e instanceof HTMLCanvasElement)){void 0===Ya&&(Ya=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Ya.width=e.width,Ya.height=e.height;var t=Ya.getContext("2d");e instanceof ImageData?t.putImageData(e,0,0):t.drawImage(e,0,0,e.width,e.height),e=Ya}return 2048<e.width||2048<e.height?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}},Za=0;r.DEFAULT_IMAGE=void 0,r.DEFAULT_MAPPING=300,r.prototype=Object.assign(Object.create(t.prototype),{constructor:r,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(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){var t=void 0===e||"string"===typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.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=qa.generateUUID()),!t&&void 0===e.images[i.uuid]){if(Array.isArray(i))for(var r=[],a=0,o=i.length;a<o;a++)r.push(Xa.getDataURL(i[a]));else r=Xa.getDataURL(i);e.images[i.uuid]={uuid:i.uuid,url:r}}n.image=i.uuid}return t||(e.textures[this.uuid]=n),n},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(e){if(300!==this.mapping)return e;if(e.applyMatrix3(this.matrix),0>e.x||1<e.x)switch(this.wrapS){case 1e3:e.x-=Math.floor(e.x);break;case 1001:e.x=0>e.x?0:1;break;case 1002:e.x=1===Math.abs(Math.floor(e.x)%2)?Math.ceil(e.x)-e.x:e.x-Math.floor(e.x)}if(0>e.y||1<e.y)switch(this.wrapT){case 1e3:e.y-=Math.floor(e.y);break;case 1001:e.y=0>e.y?0:1;break;case 1002:e.y=1===Math.abs(Math.floor(e.y)%2)?Math.ceil(e.y)-e.y:e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}}),Object.defineProperty(r.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.defineProperties(o.prototype,{width:{get:function(){return this.z},set:function(e){this.z=e}},height:{get:function(){return this.w},set:function(e){this.w=e}}}),Object.assign(o.prototype,{isVector4:!0,set:function(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this},setScalar:function(e){return this.w=this.z=this.y=this.x=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setW:function(e){return this.w=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},applyMatrix4:function(e){var t=this.x,n=this.y,i=this.z,r=this.w;return e=e.elements,this.x=e[0]*t+e[4]*n+e[8]*i+e[12]*r,this.y=e[1]*t+e[5]*n+e[9]*i+e[13]*r,this.z=e[2]*t+e[6]*n+e[10]*i+e[14]*r,this.w=e[3]*t+e[7]*n+e[11]*i+e[15]*r,this},divideScalar:function(e){return this.multiplyScalar(1/e)},setAxisAngleFromQuaternion:function(e){this.w=2*Math.acos(e.w);var t=Math.sqrt(1-e.w*e.w);return 1e-4>t?(this.x=1,this.z=this.y=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this},setAxisAngleFromRotationMatrix:function(e){e=e.elements;var t=e[0],n=e[4],i=e[8],r=e[1],a=e[5],o=e[9],s=e[2],c=e[6],l=e[10];return.01>Math.abs(n-r)&&.01>Math.abs(i-s)&&.01>Math.abs(o-c)?.1>Math.abs(n+r)&&.1>Math.abs(i+s)&&.1>Math.abs(o+c)&&.1>Math.abs(t+a+l-3)?(this.set(1,0,0,0),this):(e=Math.PI,t=(t+1)/2,a=(a+1)/2,l=(l+1)/2,n=(n+r)/4,i=(i+s)/4,o=(o+c)/4,t>a&&t>l?.01>t?(c=0,n=s=.707106781):(c=Math.sqrt(t),s=n/c,n=i/c):a>l?.01>a?(c=.707106781,s=0,n=.707106781):(s=Math.sqrt(a),c=n/s,n=o/s):.01>l?(s=c=.707106781,n=0):(n=Math.sqrt(l),c=i/n,s=o/n),this.set(c,s,n,e),this):(e=Math.sqrt((c-o)*(c-o)+(i-s)*(i-s)+(r-n)*(r-n)),.001>Math.abs(e)&&(e=1),this.x=(c-o)/e,this.y=(i-s)/e,this.z=(r-n)/e,this.w=Math.acos((t+a+l-1)/2),this)},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this},clampScalar:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,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=0>this.x?Math.ceil(this.x):Math.floor(this.x),this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y),this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z),this.w=0>this.w?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(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.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(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this},lerpVectors:function(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this},random:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}}),s.prototype=Object.assign(Object.create(t.prototype),{constructor:s,isWebGLRenderTarget:!0,setSize:function(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this.texture.image.width=e,this.texture.image.height=t,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.width=e.width,this.height=e.height,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),c.prototype=Object.assign(Object.create(s.prototype),{constructor:c,isWebGLMultisampleRenderTarget:!0,copy:function(e){return s.prototype.copy.call(this,e),this.samples=e.samples,this}}),Object.assign(l,{slerp:function(e,t,n,i){return n.copy(e).slerp(t,i)},slerpFlat:function(e,t,n,i,r,a,o){var s=n[i+0],c=n[i+1],l=n[i+2];n=n[i+3],i=r[a+0];var u=r[a+1],h=r[a+2];if(r=r[a+3],n!==r||s!==i||c!==u||l!==h){a=1-o;var d=s*i+c*u+l*h+n*r,p=0<=d?1:-1,f=1-d*d;f>Number.EPSILON&&(f=Math.sqrt(f),d=Math.atan2(f,d*p),a=Math.sin(a*d)/f,o=Math.sin(o*d)/f),p*=o,s=s*a+i*p,c=c*a+u*p,l=l*a+h*p,n=n*a+r*p,a===1-o&&(o=1/Math.sqrt(s*s+c*c+l*l+n*n),s*=o,c*=o,l*=o,n*=o)}e[t]=s,e[t+1]=c,e[t+2]=l,e[t+3]=n},multiplyQuaternionsFlat:function(e,t,n,i,r,a){var o=n[i],s=n[i+1],c=n[i+2];n=n[i+3],i=r[a];var l=r[a+1],u=r[a+2];return r=r[a+3],e[t]=o*r+n*i+s*u-c*l,e[t+1]=s*r+n*l+c*i-o*u,e[t+2]=c*r+n*u+o*l-s*i,e[t+3]=n*r-o*i-s*l-c*u,e}}),Object.defineProperties(l.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},w:{get:function(){return this._w},set:function(e){this._w=e,this._onChangeCallback()}}}),Object.assign(l.prototype,{isQuaternion:!0,set:function(e,t,n,i){return this._x=e,this._y=t,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(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this},setFromEuler:function(e,t){if(!e||!e.isEuler)throw Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=e._x,i=e._y,r=e._z;e=e.order;var a=Math.cos,o=Math.sin,s=a(n/2),c=a(i/2);switch(a=a(r/2),n=o(n/2),i=o(i/2),r=o(r/2),e){case"XYZ":this._x=n*c*a+s*i*r,this._y=s*i*a-n*c*r,this._z=s*c*r+n*i*a,this._w=s*c*a-n*i*r;break;case"YXZ":this._x=n*c*a+s*i*r,this._y=s*i*a-n*c*r,this._z=s*c*r-n*i*a,this._w=s*c*a+n*i*r;break;case"ZXY":this._x=n*c*a-s*i*r,this._y=s*i*a+n*c*r,this._z=s*c*r+n*i*a,this._w=s*c*a-n*i*r;break;case"ZYX":this._x=n*c*a-s*i*r,this._y=s*i*a+n*c*r,this._z=s*c*r-n*i*a,this._w=s*c*a+n*i*r;break;case"YZX":this._x=n*c*a+s*i*r,this._y=s*i*a+n*c*r,this._z=s*c*r-n*i*a,this._w=s*c*a-n*i*r;break;case"XZY":this._x=n*c*a-s*i*r,this._y=s*i*a-n*c*r,this._z=s*c*r+n*i*a,this._w=s*c*a+n*i*r;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+e)}return!1!==t&&this._onChangeCallback(),this},setFromAxisAngle:function(e,t){t/=2;var n=Math.sin(t);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(t),this._onChangeCallback(),this},setFromRotationMatrix:function(e){var t=e.elements,n=t[0];e=t[4];var i=t[8],r=t[1],a=t[5],o=t[9],s=t[2],c=t[6];t=t[10];var l=n+a+t;return 0<l?(n=.5/Math.sqrt(l+1),this._w=.25/n,this._x=(c-o)*n,this._y=(i-s)*n,this._z=(r-e)*n):n>a&&n>t?(n=2*Math.sqrt(1+n-a-t),this._w=(c-o)/n,this._x=.25*n,this._y=(e+r)/n,this._z=(i+s)/n):a>t?(n=2*Math.sqrt(1+a-n-t),this._w=(i-s)/n,this._x=(e+r)/n,this._y=.25*n,this._z=(o+c)/n):(n=2*Math.sqrt(1+t-n-a),this._w=(r-e)/n,this._x=(i+s)/n,this._y=(o+c)/n,this._z=.25*n),this._onChangeCallback(),this},setFromUnitVectors:function(e,t){var n=e.dot(t)+1;return 1e-6>n?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0):(this._x=0,this._y=-e.z,this._z=e.y)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x),this._w=n,this.normalize()},angleTo:function(e){return 2*Math.acos(Math.abs(qa.clamp(this.dot(e),-1,1)))},rotateTowards:function(e,t){var n=this.angleTo(e);return 0===n||this.slerp(e,Math.min(1,t/n)),this},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},dot:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._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 e=this.length();return 0===e?(this._z=this._y=this._x=0,this._w=1):(e=1/e,this._x*=e,this._y*=e,this._z*=e,this._w*=e),this._onChangeCallback(),this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)},premultiply:function(e){return this.multiplyQuaternions(e,this)},multiplyQuaternions:function(e,t){var n=e._x,i=e._y,r=e._z;e=e._w;var a=t._x,o=t._y,s=t._z;return t=t._w,this._x=n*t+e*a+i*s-r*o,this._y=i*t+e*o+r*a-n*s,this._z=r*t+e*s+n*o-i*a,this._w=e*t-n*a-i*o-r*s,this._onChangeCallback(),this},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var n=this._x,i=this._y,r=this._z,a=this._w,o=a*e._w+n*e._x+i*e._y+r*e._z;if(0>o?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),1<=o)return this._w=a,this._x=n,this._y=i,this._z=r,this;if(e=1-o*o,e<=Number.EPSILON)return o=1-t,this._w=o*a+t*this._w,this._x=o*n+t*this._x,this._y=o*i+t*this._y,this._z=o*r+t*this._z,this.normalize(),this._onChangeCallback(),this;e=Math.sqrt(e);var s=Math.atan2(e,o);return o=Math.sin((1-t)*s)/e,t=Math.sin(t*s)/e,this._w=a*o+this._w*t,this._x=n*o+this._x*t,this._y=i*o+this._y*t,this._z=r*o+this._z*t,this._onChangeCallback(),this},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},fromArray:function(e,t){return void 0===t&&(t=0),this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e},fromBufferAttribute:function(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}});var Ja=new u,Qa=new l;Object.assign(u.prototype,{isVector3:!0,set:function(e,t,n){return this.x=e,this.y=t,this.z=n,this},setScalar:function(e){return this.z=this.y=this.x=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this},multiplyVectors:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this},applyEuler:function(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(Qa.setFromEuler(e))},applyAxisAngle:function(e,t){return this.applyQuaternion(Qa.setFromAxisAngle(e,t))},applyMatrix3:function(e){var t=this.x,n=this.y,i=this.z;return e=e.elements,this.x=e[0]*t+e[3]*n+e[6]*i,this.y=e[1]*t+e[4]*n+e[7]*i,this.z=e[2]*t+e[5]*n+e[8]*i,this},applyNormalMatrix:function(e){return this.applyMatrix3(e).normalize()},applyMatrix4:function(e){var t=this.x,n=this.y,i=this.z;e=e.elements;var r=1/(e[3]*t+e[7]*n+e[11]*i+e[15]);return this.x=(e[0]*t+e[4]*n+e[8]*i+e[12])*r,this.y=(e[1]*t+e[5]*n+e[9]*i+e[13])*r,this.z=(e[2]*t+e[6]*n+e[10]*i+e[14])*r,this},applyQuaternion:function(e){var t=this.x,n=this.y,i=this.z,r=e.x,a=e.y,o=e.z;e=e.w;var s=e*t+a*i-o*n,c=e*n+o*t-r*i,l=e*i+r*n-a*t;return t=-r*t-a*n-o*i,this.x=s*e+t*-r+c*-o-l*-a,this.y=c*e+t*-a+l*-r-s*-o,this.z=l*e+t*-o+s*-a-c*-r,this},project:function(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)},unproject:function(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)},transformDirection:function(e){var t=this.x,n=this.y,i=this.z;return e=e.elements,this.x=e[0]*t+e[4]*n+e[8]*i,this.y=e[1]*t+e[5]*n+e[9]*i,this.z=e[2]*t+e[6]*n+e[10]*i,this.normalize()},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},divideScalar:function(e){return this.multiplyScalar(1/e)},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this},clampScalar:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,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=0>this.x?Math.ceil(this.x):Math.floor(this.x),this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y),this.z=0>this.z?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(e){return this.x*e.x+this.y*e.y+this.z*e.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(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this},lerpVectors:function(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this},cross:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)},crossVectors:function(e,t){var n=e.x,i=e.y;e=e.z;var r=t.x,a=t.y;return t=t.z,this.x=i*t-e*a,this.y=e*r-n*t,this.z=n*a-i*r,this},projectOnVector:function(e){var t=e.lengthSq();return 0===t?this.set(0,0,0):(t=e.dot(this)/t,this.copy(e).multiplyScalar(t))},projectOnPlane:function(e){return Ja.copy(this).projectOnVector(e),this.sub(Ja)},reflect:function(e){return this.sub(Ja.copy(e).multiplyScalar(2*this.dot(e)))},angleTo:function(e){var t=Math.sqrt(this.lengthSq()*e.lengthSq());return 0===t?Math.PI/2:(e=this.dot(e)/t,Math.acos(qa.clamp(e,-1,1)))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y;return e=this.z-e.z,t*t+n*n+e*e},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)},setFromSpherical:function(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)},setFromSphericalCoords:function(e,t,n){var i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this},setFromCylindrical:function(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)},setFromCylindricalCoords:function(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this},setFromMatrixPosition:function(e){return e=e.elements,this.x=e[12],this.y=e[13],this.z=e[14],this},setFromMatrixScale:function(e){var t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length();return e=this.setFromMatrixColumn(e,2).length(),this.x=t,this.y=n,this.z=e,this},setFromMatrixColumn:function(e,t){return this.fromArray(e.elements,4*t)},setFromMatrix3Column:function(e,t){return this.fromArray(e.elements,3*t)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this},random:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}});var Ka=new u,$a=new h,eo=new u(0,0,0),to=new u(1,1,1),no=new u,io=new u,ro=new u;Object.assign(h.prototype,{isMatrix4:!0,set:function(e,t,n,i,r,a,o,s,c,l,u,h,d,p,f,m){var g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=i,g[1]=r,g[5]=a,g[9]=o,g[13]=s,g[2]=c,g[6]=l,g[10]=u,g[14]=h,g[3]=d,g[7]=p,g[11]=f,g[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 h).fromArray(this.elements)},copy:function(e){var t=this.elements;return e=e.elements,t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],this},copyPosition:function(e){var t=this.elements;return e=e.elements,t[12]=e[12],t[13]=e[13],t[14]=e[14],this},extractBasis:function(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis:function(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this},extractRotation:function(e){var t=this.elements,n=e.elements,i=1/Ka.setFromMatrixColumn(e,0).length(),r=1/Ka.setFromMatrixColumn(e,1).length();return e=1/Ka.setFromMatrixColumn(e,2).length(),t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*r,t[5]=n[5]*r,t[6]=n[6]*r,t[7]=0,t[8]=n[8]*e,t[9]=n[9]*e,t[10]=n[10]*e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromEuler:function(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,n=e.x,i=e.y,r=e.z,a=Math.cos(n);n=Math.sin(n);var o=Math.cos(i);i=Math.sin(i);var s=Math.cos(r);if(r=Math.sin(r),"XYZ"===e.order){e=a*s;var c=a*r,l=n*s,u=n*r;t[0]=o*s,t[4]=-o*r,t[8]=i,t[1]=c+l*i,t[5]=e-u*i,t[9]=-n*o,t[2]=u-e*i,t[6]=l+c*i,t[10]=a*o}else"YXZ"===e.order?(e=o*s,c=o*r,l=i*s,u=i*r,t[0]=e+u*n,t[4]=l*n-c,t[8]=a*i,t[1]=a*r,t[5]=a*s,t[9]=-n,t[2]=c*n-l,t[6]=u+e*n,t[10]=a*o):"ZXY"===e.order?(e=o*s,c=o*r,l=i*s,u=i*r,t[0]=e-u*n,t[4]=-a*r,t[8]=l+c*n,t[1]=c+l*n,t[5]=a*s,t[9]=u-e*n,t[2]=-a*i,t[6]=n,t[10]=a*o):"ZYX"===e.order?(e=a*s,c=a*r,l=n*s,u=n*r,t[0]=o*s,t[4]=l*i-c,t[8]=e*i+u,t[1]=o*r,t[5]=u*i+e,t[9]=c*i-l,t[2]=-i,t[6]=n*o,t[10]=a*o):"YZX"===e.order?(e=a*o,c=a*i,l=n*o,u=n*i,t[0]=o*s,t[4]=u-e*r,t[8]=l*r+c,t[1]=r,t[5]=a*s,t[9]=-n*s,t[2]=-i*s,t[6]=c*r+l,t[10]=e-u*r):"XZY"===e.order&&(e=a*o,c=a*i,l=n*o,u=n*i,t[0]=o*s,t[4]=-r,t[8]=i*s,t[1]=e*r+u,t[5]=a*s,t[9]=c*r-l,t[2]=l*r-c,t[6]=n*s,t[10]=u*r+e);return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromQuaternion:function(e){return this.compose(eo,e,to)},lookAt:function(e,t,n){var i=this.elements;return ro.subVectors(e,t),0===ro.lengthSq()&&(ro.z=1),ro.normalize(),no.crossVectors(n,ro),0===no.lengthSq()&&(1===Math.abs(n.z)?ro.x+=1e-4:ro.z+=1e-4,ro.normalize(),no.crossVectors(n,ro)),no.normalize(),io.crossVectors(ro,no),i[0]=no.x,i[4]=io.x,i[8]=ro.x,i[1]=no.y,i[5]=io.y,i[9]=ro.y,i[2]=no.z,i[6]=io.z,i[10]=ro.z,this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,i=t.elements;t=this.elements,e=n[0];var r=n[4],a=n[8],o=n[12],s=n[1],c=n[5],l=n[9],u=n[13],h=n[2],d=n[6],p=n[10],f=n[14],m=n[3],g=n[7],v=n[11];n=n[15];var y=i[0],x=i[4],b=i[8],w=i[12],_=i[1],M=i[5],S=i[9],T=i[13],E=i[2],A=i[6],L=i[10],C=i[14],R=i[3],P=i[7],O=i[11];return i=i[15],t[0]=e*y+r*_+a*E+o*R,t[4]=e*x+r*M+a*A+o*P,t[8]=e*b+r*S+a*L+o*O,t[12]=e*w+r*T+a*C+o*i,t[1]=s*y+c*_+l*E+u*R,t[5]=s*x+c*M+l*A+u*P,t[9]=s*b+c*S+l*L+u*O,t[13]=s*w+c*T+l*C+u*i,t[2]=h*y+d*_+p*E+f*R,t[6]=h*x+d*M+p*A+f*P,t[10]=h*b+d*S+p*L+f*O,t[14]=h*w+d*T+p*C+f*i,t[3]=m*y+g*_+v*E+n*R,t[7]=m*x+g*M+v*A+n*P,t[11]=m*b+g*S+v*L+n*O,t[15]=m*w+g*T+v*C+n*i,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this},determinant:function(){var e=this.elements,t=e[0],n=e[4],i=e[8],r=e[12],a=e[1],o=e[5],s=e[9],c=e[13],l=e[2],u=e[6],h=e[10],d=e[14];return e[3]*(+r*s*u-i*c*u-r*o*h+n*c*h+i*o*d-n*s*d)+e[7]*(+t*s*d-t*c*h+r*a*h-i*a*d+i*c*l-r*s*l)+e[11]*(+t*c*u-t*o*d-r*a*u+n*a*d+r*o*l-n*c*l)+e[15]*(-i*o*l-t*s*u+t*o*h+i*a*u-n*a*h+n*s*l)},transpose:function(){var e=this.elements,t=e[1];return 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(e,t,n){var i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this},getInverse:function(e,t){void 0!==t&&console.warn("THREE.Matrix4: .getInverse() can no longer be configured to throw on degenerate."),t=this.elements;var n=e.elements;e=n[0];var i=n[1],r=n[2],a=n[3],o=n[4],s=n[5],c=n[6],l=n[7],u=n[8],h=n[9],d=n[10],p=n[11],f=n[12],m=n[13],g=n[14];n=n[15];var v=h*g*l-m*d*l+m*c*p-s*g*p-h*c*n+s*d*n,y=f*d*l-u*g*l-f*c*p+o*g*p+u*c*n-o*d*n,x=u*m*l-f*h*l+f*s*p-o*m*p-u*s*n+o*h*n,b=f*h*c-u*m*c-f*s*d+o*m*d+u*s*g-o*h*g,w=e*v+i*y+r*x+a*b;return 0===w?this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0):(w=1/w,t[0]=v*w,t[1]=(m*d*a-h*g*a-m*r*p+i*g*p+h*r*n-i*d*n)*w,t[2]=(s*g*a-m*c*a+m*r*l-i*g*l-s*r*n+i*c*n)*w,t[3]=(h*c*a-s*d*a-h*r*l+i*d*l+s*r*p-i*c*p)*w,t[4]=y*w,t[5]=(u*g*a-f*d*a+f*r*p-e*g*p-u*r*n+e*d*n)*w,t[6]=(f*c*a-o*g*a-f*r*l+e*g*l+o*r*n-e*c*n)*w,t[7]=(o*d*a-u*c*a+u*r*l-e*d*l-o*r*p+e*c*p)*w,t[8]=x*w,t[9]=(f*h*a-u*m*a-f*i*p+e*m*p+u*i*n-e*h*n)*w,t[10]=(o*m*a-f*s*a+f*i*l-e*m*l-o*i*n+e*s*n)*w,t[11]=(u*s*a-o*h*a-u*i*l+e*h*l+o*i*p-e*s*p)*w,t[12]=b*w,t[13]=(u*m*r-f*h*r+f*i*d-e*m*d-u*i*g+e*h*g)*w,t[14]=(f*s*r-o*m*r-f*i*c+e*m*c+o*i*g-e*s*g)*w,t[15]=(o*h*r-u*s*r+u*i*c-e*h*c-o*i*d+e*s*d)*w,this)},scale:function(e){var t=this.elements,n=e.x,i=e.y;return e=e.z,t[0]*=n,t[4]*=i,t[8]*=e,t[1]*=n,t[5]*=i,t[9]*=e,t[2]*=n,t[6]*=i,t[10]*=e,t[3]*=n,t[7]*=i,t[11]*=e,this},getMaxScaleOnAxis:function(){var e=this.elements;return Math.sqrt(Math.max(e[0]*e[0]+e[1]*e[1]+e[2]*e[2],e[4]*e[4]+e[5]*e[5]+e[6]*e[6],e[8]*e[8]+e[9]*e[9]+e[10]*e[10]))},makeTranslation:function(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this},makeRotationX:function(e){var t=Math.cos(e);return e=Math.sin(e),this.set(1,0,0,0,0,t,-e,0,0,e,t,0,0,0,0,1),this},makeRotationY:function(e){var t=Math.cos(e);return e=Math.sin(e),this.set(t,0,e,0,0,1,0,0,-e,0,t,0,0,0,0,1),this},makeRotationZ:function(e){var t=Math.cos(e);return e=Math.sin(e),this.set(t,-e,0,0,e,t,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(e,t){var n=Math.cos(t);t=Math.sin(t);var i=1-n,r=e.x,a=e.y;e=e.z;var o=i*r,s=i*a;return this.set(o*r+n,o*a-t*e,o*e+t*a,0,o*a+t*e,s*a+n,s*e-t*r,0,o*e-t*a,s*e+t*r,i*e*e+n,0,0,0,0,1),this},makeScale:function(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this},makeShear:function(e,t,n){return this.set(1,t,n,0,e,1,n,0,e,t,1,0,0,0,0,1),this},compose:function(e,t,n){var i=this.elements,r=t._x,a=t._y,o=t._z,s=t._w,c=r+r,l=a+a,u=o+o;t=r*c;var h=r*l;r*=u;var d=a*l;a*=u,o*=u,c*=s,l*=s,s*=u,u=n.x;var p=n.y;return n=n.z,i[0]=(1-(d+o))*u,i[1]=(h+s)*u,i[2]=(r-l)*u,i[3]=0,i[4]=(h-s)*p,i[5]=(1-(t+o))*p,i[6]=(a+c)*p,i[7]=0,i[8]=(r+l)*n,i[9]=(a-c)*n,i[10]=(1-(t+d))*n,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this},decompose:function(e,t,n){var i=this.elements,r=Ka.set(i[0],i[1],i[2]).length(),a=Ka.set(i[4],i[5],i[6]).length(),o=Ka.set(i[8],i[9],i[10]).length();0>this.determinant()&&(r=-r),e.x=i[12],e.y=i[13],e.z=i[14],$a.copy(this),e=1/r,i=1/a;var s=1/o;return $a.elements[0]*=e,$a.elements[1]*=e,$a.elements[2]*=e,$a.elements[4]*=i,$a.elements[5]*=i,$a.elements[6]*=i,$a.elements[8]*=s,$a.elements[9]*=s,$a.elements[10]*=s,t.setFromRotationMatrix($a),n.x=r,n.y=a,n.z=o,this},makePerspective:function(e,t,n,i,r,a){void 0===a&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var o=this.elements;return o[0]=2*r/(t-e),o[4]=0,o[8]=(t+e)/(t-e),o[12]=0,o[1]=0,o[5]=2*r/(n-i),o[9]=(n+i)/(n-i),o[13]=0,o[2]=0,o[6]=0,o[10]=-(a+r)/(a-r),o[14]=-2*a*r/(a-r),o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this},makeOrthographic:function(e,t,n,i,r,a){var o=this.elements,s=1/(t-e),c=1/(n-i),l=1/(a-r);return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-(t+e)*s,o[1]=0,o[5]=2*c,o[9]=0,o[13]=-(n+i)*c,o[2]=0,o[6]=0,o[10]=-2*l,o[14]=-(a+r)*l,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this},equals:function(e){var t=this.elements;e=e.elements;for(var n=0;16>n;n++)if(t[n]!==e[n])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var n=0;16>n;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}});var ao=new h,oo=new l;d.RotationOrders="XYZ YZX ZXY XZY YXZ ZYX".split(" "),d.DefaultOrder="XYZ",Object.defineProperties(d.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},order:{get:function(){return this._order},set:function(e){this._order=e,this._onChangeCallback()}}}),Object.assign(d.prototype,{isEuler:!0,set:function(e,t,n,i){return this._x=e,this._y=t,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(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this},setFromRotationMatrix:function(e,t,n){var i=qa.clamp,r=e.elements;e=r[0];var a=r[4],o=r[8],s=r[1],c=r[5],l=r[9],u=r[2],h=r[6];switch(r=r[10],t=t||this._order,t){case"XYZ":this._y=Math.asin(i(o,-1,1)),.9999999>Math.abs(o)?(this._x=Math.atan2(-l,r),this._z=Math.atan2(-a,e)):(this._x=Math.atan2(h,c),this._z=0);break;case"YXZ":this._x=Math.asin(-i(l,-1,1)),.9999999>Math.abs(l)?(this._y=Math.atan2(o,r),this._z=Math.atan2(s,c)):(this._y=Math.atan2(-u,e),this._z=0);break;case"ZXY":this._x=Math.asin(i(h,-1,1)),.9999999>Math.abs(h)?(this._y=Math.atan2(-u,r),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(s,e));break;case"ZYX":this._y=Math.asin(-i(u,-1,1)),.9999999>Math.abs(u)?(this._x=Math.atan2(h,r),this._z=Math.atan2(s,e)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(i(s,-1,1)),.9999999>Math.abs(s)?(this._x=Math.atan2(-l,c),this._y=Math.atan2(-u,e)):(this._x=0,this._y=Math.atan2(o,r));break;case"XZY":this._z=Math.asin(-i(a,-1,1)),.9999999>Math.abs(a)?(this._x=Math.atan2(h,c),this._y=Math.atan2(o,e)):(this._x=Math.atan2(-l,r),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!1!==n&&this._onChangeCallback(),this},setFromQuaternion:function(e,t,n){return ao.makeRotationFromQuaternion(e),this.setFromRotationMatrix(ao,t,n)},setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:function(e){return oo.setFromEuler(this),this.setFromQuaternion(oo,e)},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order},fromArray:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e},toVector3:function(e){return e?e.set(this._x,this._y,this._z):new u(this._x,this._y,this._z)},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}}),Object.assign(p.prototype,{set:function(e){this.mask=1<<e|0},enable:function(e){this.mask=this.mask|1<<e|0},enableAll:function(){this.mask=-1},toggle:function(e){this.mask^=1<<e|0},disable:function(e){this.mask&=~(1<<e|0)},disableAll:function(){this.mask=0},test:function(e){return 0!==(this.mask&e.mask)}});var so=0,co=new u,lo=new l,uo=new h,ho=new u,po=new u,fo=new u,mo=new l,go=new u(1,0,0),vo=new u(0,1,0),yo=new u(0,0,1),xo={type:"added"},bo={type:"removed"};f.DefaultUp=new u(0,1,0),f.DefaultMatrixAutoUpdate=!0,f.prototype=Object.assign(Object.create(t.prototype),{constructor:f,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix4:function(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(e){return this.quaternion.premultiply(e),this},setRotationFromAxisAngle:function(e,t){this.quaternion.setFromAxisAngle(e,t)},setRotationFromEuler:function(e){this.quaternion.setFromEuler(e,!0)},setRotationFromMatrix:function(e){this.quaternion.setFromRotationMatrix(e)},setRotationFromQuaternion:function(e){this.quaternion.copy(e)},rotateOnAxis:function(e,t){return lo.setFromAxisAngle(e,t),this.quaternion.multiply(lo),this},rotateOnWorldAxis:function(e,t){return lo.setFromAxisAngle(e,t),this.quaternion.premultiply(lo),this},rotateX:function(e){return this.rotateOnAxis(go,e)},rotateY:function(e){return this.rotateOnAxis(vo,e)},rotateZ:function(e){return this.rotateOnAxis(yo,e)},translateOnAxis:function(e,t){return co.copy(e).applyQuaternion(this.quaternion),this.position.add(co.multiplyScalar(t)),this},translateX:function(e){return this.translateOnAxis(go,e)},translateY:function(e){return this.translateOnAxis(vo,e)},translateZ:function(e){return this.translateOnAxis(yo,e)},localToWorld:function(e){return e.applyMatrix4(this.matrixWorld)},worldToLocal:function(e){return e.applyMatrix4(uo.getInverse(this.matrixWorld))},lookAt:function(e,t,n){e.isVector3?ho.copy(e):ho.set(e,t,n),e=this.parent,this.updateWorldMatrix(!0,!1),po.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?uo.lookAt(po,ho,this.up):uo.lookAt(ho,po,this.up),this.quaternion.setFromRotationMatrix(uo),e&&(uo.extractRotation(e.matrixWorld),lo.setFromRotationMatrix(uo),this.quaternion.premultiply(lo.inverse()))},add:function(e){if(1<arguments.length){for(var t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,this.children.push(e),e.dispatchEvent(xo)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)},remove:function(e){if(1<arguments.length){for(var t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}return t=this.children.indexOf(e),-1!==t&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(bo)),this},attach:function(e){return this.updateWorldMatrix(!0,!1),uo.getInverse(this.matrixWorld),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),uo.multiply(e.parent.matrixWorld)),e.applyMatrix4(uo),e.updateWorldMatrix(!1,!1),this.add(e),this},getObjectById:function(e){return this.getObjectByProperty("id",e)},getObjectByName:function(e){return this.getObjectByProperty("name",e)},getObjectByProperty:function(e,t){if(this[e]===t)return this;for(var n=0,i=this.children.length;n<i;n++){var r=this.children[n].getObjectByProperty(e,t);if(void 0!==r)return r}},getWorldPosition:function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),e=new u),this.updateMatrixWorld(!0),e.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),e=new l),this.updateMatrixWorld(!0),this.matrixWorld.decompose(po,e,fo),e},getWorldScale:function(e){return void 0===e&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),e=new u),this.updateMatrixWorld(!0),this.matrixWorld.decompose(po,mo,e),e},getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),e=new u),this.updateMatrixWorld(!0);var t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()},raycast:function(){},traverse:function(e){e(this);for(var t=this.children,n=0,i=t.length;n<i;n++)t[n].traverse(e)},traverseVisible:function(e){if(!1!==this.visible){e(this);for(var t=this.children,n=0,i=t.length;n<i;n++)t[n].traverseVisible(e)}},traverseAncestors:function(e){var t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);for(var t=this.children,n=0,i=t.length;n<i;n++)t[n].updateMatrixWorld(e)},updateWorldMatrix:function(e,t){var n=this.parent;if(!0===e&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===t)for(e=this.children,t=0,n=e.length;t<n;t++)e[t].updateWorldMatrix(!1,!0)},toJSON:function(e){function t(t,n){return void 0===t[n.uuid]&&(t[n.uuid]=n.toJSON(e)),n.uuid}function n(e){var t,n=[];for(t in e){var i=e[t];delete i.metadata,n.push(i)}return n}var i=void 0===e||"string"===typeof e,r={};i&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{}},r.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var a={};if(a.uuid=this.uuid,a.type=this.type,""!==this.name&&(a.name=this.name),!0===this.castShadow&&(a.castShadow=!0),!0===this.receiveShadow&&(a.receiveShadow=!0),!1===this.visible&&(a.visible=!1),!1===this.frustumCulled&&(a.frustumCulled=!1),0!==this.renderOrder&&(a.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(a.userData=this.userData),a.layers=this.layers.mask,a.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(a.matrixAutoUpdate=!1),this.isInstancedMesh&&(a.type="InstancedMesh",a.count=this.count,a.instanceMatrix=this.instanceMatrix.toJSON()),this.isMesh||this.isLine||this.isPoints){a.geometry=t(e.geometries,this.geometry);var o=this.geometry.parameters;if(void 0!==o&&void 0!==o.shapes)if(o=o.shapes,Array.isArray(o))for(var s=0,c=o.length;s<c;s++)t(e.shapes,o[s]);else t(e.shapes,o)}if(void 0!==this.material)if(Array.isArray(this.material)){for(o=[],s=0,c=this.material.length;s<c;s++)o.push(t(e.materials,this.material[s]));a.material=o}else a.material=t(e.materials,this.material);if(0<this.children.length)for(a.children=[],o=0;o<this.children.length;o++)a.children.push(this.children[o].toJSON(e).object);if(i){i=n(e.geometries),o=n(e.materials),s=n(e.textures),c=n(e.images);var l=n(e.shapes);0<i.length&&(r.geometries=i),0<o.length&&(r.materials=o),0<s.length&&(r.textures=s),0<c.length&&(r.images=c),0<l.length&&(r.shapes=l)}return r.object=a,r},clone:function(e){return(new this.constructor).copy(this,e)},copy:function(e,t){if(void 0===t&&(t=!0),this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(t=0;t<e.children.length;t++)this.add(e.children[t].clone());return this}}),m.prototype=Object.assign(Object.create(f.prototype),{constructor:m,isScene:!0,copy:function(e,t){return f.prototype.copy.call(this,e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this},toJSON:function(e){var t=f.prototype.toJSON.call(this,e);return null!==this.background&&(t.object.background=this.background.toJSON(e)),null!==this.environment&&(t.object.environment=this.environment.toJSON(e)),null!==this.fog&&(t.object.fog=this.fog.toJSON()),t},dispose:function(){this.dispatchEvent({type:"dispose"})}});var wo=[new u,new u,new u,new u,new u,new u,new u,new u],_o=new u,Mo=new g,So=new u,To=new u,Eo=new u,Ao=new u,Lo=new u,Co=new u,Ro=new u,Po=new u,Oo=new u,Io=new u;Object.assign(g.prototype,{isBox3:!0,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromArray:function(e){for(var t=1/0,n=1/0,i=1/0,r=-1/0,a=-1/0,o=-1/0,s=0,c=e.length;s<c;s+=3){var l=e[s],u=e[s+1],h=e[s+2];l<t&&(t=l),u<n&&(n=u),h<i&&(i=h),l>r&&(r=l),u>a&&(a=u),h>o&&(o=h)}return this.min.set(t,n,i),this.max.set(r,a,o),this},setFromBufferAttribute:function(e){for(var t=1/0,n=1/0,i=1/0,r=-1/0,a=-1/0,o=-1/0,s=0,c=e.count;s<c;s++){var l=e.getX(s),u=e.getY(s),h=e.getZ(s);l<t&&(t=l),u<n&&(n=u),h<i&&(i=h),l>r&&(r=l),u>a&&(a=u),h>o&&(o=h)}return this.min.set(t,n,i),this.max.set(r,a,o),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(e,t){return t=_o.copy(t).multiplyScalar(.5),this.min.copy(e).sub(t),this.max.copy(e).add(t),this},setFromObject:function(e){return this.makeEmpty(),this.expandByObject(e)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(e){return void 0===e&&(console.warn("THREE.Box3: .getCenter() target is now required"),e=new u),this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){return void 0===e&&(console.warn("THREE.Box3: .getSize() target is now required"),e=new u),this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},expandByObject:function(e){e.updateWorldMatrix(!1,!1);var t=e.geometry;void 0!==t&&(null===t.boundingBox&&t.computeBoundingBox(),Mo.copy(t.boundingBox),Mo.applyMatrix4(e.matrixWorld),this.union(Mo)),e=e.children,t=0;for(var n=e.length;t<n;t++)this.expandByObject(e[t]);return this},containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z},getParameter:function(e,t){return void 0===t&&(console.warn("THREE.Box3: .getParameter() target is now required"),t=new u),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)},intersectsSphere:function(e){return this.clampPoint(e.center,_o),_o.distanceToSquared(e.center)<=e.radius*e.radius},intersectsPlane:function(e){if(0<e.normal.x)var t=e.normal.x*this.min.x,n=e.normal.x*this.max.x;else t=e.normal.x*this.max.x,n=e.normal.x*this.min.x;return 0<e.normal.y?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),0<e.normal.z?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant},intersectsTriangle:function(e){return!this.isEmpty()&&(this.getCenter(Ro),Po.subVectors(this.max,Ro),So.subVectors(e.a,Ro),To.subVectors(e.b,Ro),Eo.subVectors(e.c,Ro),Ao.subVectors(To,So),Lo.subVectors(Eo,To),Co.subVectors(So,Eo),e=[0,-Ao.z,Ao.y,0,-Lo.z,Lo.y,0,-Co.z,Co.y,Ao.z,0,-Ao.x,Lo.z,0,-Lo.x,Co.z,0,-Co.x,-Ao.y,Ao.x,0,-Lo.y,Lo.x,0,-Co.y,Co.x,0],!!v(e,So,To,Eo,Po)&&(e=[1,0,0,0,1,0,0,0,1],!!v(e,So,To,Eo,Po)&&(Oo.crossVectors(Ao,Lo),e=[Oo.x,Oo.y,Oo.z],v(e,So,To,Eo,Po))))},clampPoint:function(e,t){return void 0===t&&(console.warn("THREE.Box3: .clampPoint() target is now required"),t=new u),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(e){return _o.copy(e).clamp(this.min,this.max).sub(e).length()},getBoundingSphere:function(e){return void 0===e&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(e.center),e.radius=.5*this.getSize(_o).length(),e},intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},applyMatrix4:function(e){return this.isEmpty()||(wo[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),wo[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),wo[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),wo[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),wo[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),wo[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),wo[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),wo[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(wo)),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}});var Do=new g;Object.assign(y.prototype,{set:function(e,t){return this.center.copy(e),this.radius=t,this},setFromPoints:function(e,t){var n=this.center;void 0!==t?n.copy(t):Do.setFromPoints(e).getCenter(n);for(var i=t=0,r=e.length;i<r;i++)t=Math.max(t,n.distanceToSquared(e[i]));return this.radius=Math.sqrt(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.center.copy(e.center),this.radius=e.radius,this},isEmpty:function(){return 0>this.radius},makeEmpty:function(){return this.center.set(0,0,0),this.radius=-1,this},containsPoint:function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(e){return e.distanceTo(this.center)-this.radius},intersectsSphere:function(e){var t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t},intersectsBox:function(e){return e.intersectsSphere(this)},intersectsPlane:function(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius},clampPoint:function(e,t){var n=this.center.distanceToSquared(e);return void 0===t&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),t=new u),t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t},getBoundingBox:function(e){return void 0===e&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),e=new g),this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)},applyMatrix4:function(e){return this.center.applyMatrix4(e),this.radius*=e.getMaxScaleOnAxis(),this},translate:function(e){return this.center.add(e),this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius}});var No=new u,Bo=new u,Fo=new u,Uo=new u,zo=new u,Go=new u,ko=new u;Object.assign(x.prototype,{set:function(e,t){return this.origin.copy(e),this.direction.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this},at:function(e,t){return void 0===t&&(console.warn("THREE.Ray: .at() target is now required"),t=new u),t.copy(this.direction).multiplyScalar(e).add(this.origin)},lookAt:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this},recast:function(e){return this.origin.copy(this.at(e,No)),this},closestPointToPoint:function(e,t){return void 0===t&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),t=new u),t.subVectors(e,this.origin),e=t.dot(this.direction),0>e?t.copy(this.origin):t.copy(this.direction).multiplyScalar(e).add(this.origin)},distanceToPoint:function(e){return Math.sqrt(this.distanceSqToPoint(e))},distanceSqToPoint:function(e){var t=No.subVectors(e,this.origin).dot(this.direction);return 0>t?this.origin.distanceToSquared(e):(No.copy(this.direction).multiplyScalar(t).add(this.origin),No.distanceToSquared(e))},distanceSqToSegment:function(e,t,n,i){Bo.copy(e).add(t).multiplyScalar(.5),Fo.copy(t).sub(e).normalize(),Uo.copy(this.origin).sub(Bo);var r=.5*e.distanceTo(t),a=-this.direction.dot(Fo),o=Uo.dot(this.direction),s=-Uo.dot(Fo),c=Uo.lengthSq(),l=Math.abs(1-a*a);if(0<l){e=a*s-o,t=a*o-s;var u=r*l;0<=e?t>=-u?t<=u?(r=1/l,e*=r,t*=r,a=e*(e+a*t+2*o)+t*(a*e+t+2*s)+c):(t=r,e=Math.max(0,-(a*t+o)),a=-e*e+t*(t+2*s)+c):(t=-r,e=Math.max(0,-(a*t+o)),a=-e*e+t*(t+2*s)+c):t<=-u?(e=Math.max(0,-(-a*r+o)),t=0<e?-r:Math.min(Math.max(-r,-s),r),a=-e*e+t*(t+2*s)+c):t<=u?(e=0,t=Math.min(Math.max(-r,-s),r),a=t*(t+2*s)+c):(e=Math.max(0,-(a*r+o)),t=0<e?r:Math.min(Math.max(-r,-s),r),a=-e*e+t*(t+2*s)+c)}else t=0<a?-r:r,e=Math.max(0,-(a*t+o)),a=-e*e+t*(t+2*s)+c;return n&&n.copy(this.direction).multiplyScalar(e).add(this.origin),i&&i.copy(Fo).multiplyScalar(t).add(Bo),a},intersectSphere:function(e,t){No.subVectors(e.center,this.origin);var n=No.dot(this.direction),i=No.dot(No)-n*n;return e=e.radius*e.radius,i>e?null:(e=Math.sqrt(e-i),i=n-e,n+=e,0>i&&0>n?null:0>i?this.at(n,t):this.at(i,t))},intersectsSphere:function(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius},distanceToPlane:function(e){var t=e.normal.dot(this.direction);return 0===t?0===e.distanceToPoint(this.origin)?0:null:(e=-(this.origin.dot(e.normal)+e.constant)/t,0<=e?e:null)},intersectPlane:function(e,t){return e=this.distanceToPlane(e),null===e?null:this.at(e,t)},intersectsPlane:function(e){var t=e.distanceToPoint(this.origin);return 0===t||0>e.normal.dot(this.direction)*t},intersectBox:function(e,t){var n=1/this.direction.x,i=1/this.direction.y,r=1/this.direction.z,a=this.origin;if(0<=n){var o=(e.min.x-a.x)*n;n*=e.max.x-a.x}else o=(e.max.x-a.x)*n,n*=e.min.x-a.x;if(0<=i){var s=(e.min.y-a.y)*i;i*=e.max.y-a.y}else s=(e.max.y-a.y)*i,i*=e.min.y-a.y;return o>i||s>n?null:((s>o||o!==o)&&(o=s),(i<n||n!==n)&&(n=i),0<=r?(s=(e.min.z-a.z)*r,e=(e.max.z-a.z)*r):(s=(e.max.z-a.z)*r,e=(e.min.z-a.z)*r),o>e||s>n?null:((s>o||o!==o)&&(o=s),(e<n||n!==n)&&(n=e),0>n?null:this.at(0<=o?o:n,t)))},intersectsBox:function(e){return null!==this.intersectBox(e,No)},intersectTriangle:function(e,t,n,i,r){if(zo.subVectors(t,e),Go.subVectors(n,e),ko.crossVectors(zo,Go),t=this.direction.dot(ko),0<t){if(i)return null;i=1}else{if(!(0>t))return null;i=-1,t=-t}return Uo.subVectors(this.origin,e),e=i*this.direction.dot(Go.crossVectors(Uo,Go)),0>e?null:(n=i*this.direction.dot(zo.cross(Uo)),0>n||e+n>t?null:(e=-i*Uo.dot(ko),0>e?null:this.at(e/t,r)))},applyMatrix4:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this},equals:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}});var Ho=new u,jo=new u,Vo=new i;Object.assign(b.prototype,{isPlane:!0,set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(e,t,n){return t=Ho.subVectors(n,t).cross(jo.subVectors(e,t)).normalize(),this.setFromNormalAndCoplanarPoint(t,e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this},normalize:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(e){return this.normal.dot(e)+this.constant},distanceToSphere:function(e){return this.distanceToPoint(e.center)-e.radius},projectPoint:function(e,t){return void 0===t&&(console.warn("THREE.Plane: .projectPoint() target is now required"),t=new u),t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)},intersectLine:function(e,t){void 0===t&&(console.warn("THREE.Plane: .intersectLine() target is now required"),t=new u);var n=e.delta(Ho),i=this.normal.dot(n);if(0===i){if(0===this.distanceToPoint(e.start))return t.copy(e.start)}else if(i=-(e.start.dot(this.normal)+this.constant)/i,!(0>i||1<i))return t.copy(n).multiplyScalar(i).add(e.start)},intersectsLine:function(e){var t=this.distanceToPoint(e.start);return e=this.distanceToPoint(e.end),0>t&&0<e||0>e&&0<t},intersectsBox:function(e){return e.intersectsPlane(this)},intersectsSphere:function(e){return e.intersectsPlane(this)},coplanarPoint:function(e){return void 0===e&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),e=new u),e.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(e,t){return t=t||Vo.getNormalMatrix(e),e=this.coplanarPoint(Ho).applyMatrix4(e),t=this.normal.applyMatrix3(t).normalize(),this.constant=-e.dot(t),this},translate:function(e){return this.constant-=e.dot(this.normal),this},equals:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}});var Wo=new u,qo=new u,Yo=new u,Xo=new u,Zo=new u,Jo=new u,Qo=new u,Ko=new u,$o=new u,es=new u;Object.assign(w,{getNormal:function(e,t,n,i){return void 0===i&&(console.warn("THREE.Triangle: .getNormal() target is now required"),i=new u),i.subVectors(n,t),Wo.subVectors(e,t),i.cross(Wo),e=i.lengthSq(),0<e?i.multiplyScalar(1/Math.sqrt(e)):i.set(0,0,0)},getBarycoord:function(e,t,n,i,r){Wo.subVectors(i,t),qo.subVectors(n,t),Yo.subVectors(e,t),e=Wo.dot(Wo),t=Wo.dot(qo),n=Wo.dot(Yo);var a=qo.dot(qo);i=qo.dot(Yo);var o=e*a-t*t;return void 0===r&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),r=new u),0===o?r.set(-2,-1,-1):(o=1/o,a=(a*n-t*i)*o,e=(e*i-t*n)*o,r.set(1-a-e,e,a))},containsPoint:function(e,t,n,i){return w.getBarycoord(e,t,n,i,Xo),0<=Xo.x&&0<=Xo.y&&1>=Xo.x+Xo.y},getUV:function(e,t,n,i,r,a,o,s){return this.getBarycoord(e,t,n,i,Xo),s.set(0,0),s.addScaledVector(r,Xo.x),s.addScaledVector(a,Xo.y),s.addScaledVector(o,Xo.z),s},isFrontFacing:function(e,t,n,i){return Wo.subVectors(n,t),qo.subVectors(e,t),0>Wo.cross(qo).dot(i)}}),Object.assign(w.prototype,{set:function(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this},setFromPointsAndIndices:function(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},getArea:function(){return Wo.subVectors(this.c,this.b),qo.subVectors(this.a,this.b),.5*Wo.cross(qo).length()},getMidpoint:function(e){return void 0===e&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),e=new u),e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(e){return w.getNormal(this.a,this.b,this.c,e)},getPlane:function(e){return void 0===e&&(console.warn("THREE.Triangle: .getPlane() target is now required"),e=new b),e.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(e,t){return w.getBarycoord(e,this.a,this.b,this.c,t)},getUV:function(e,t,n,i,r){return w.getUV(e,this.a,this.b,this.c,t,n,i,r)},containsPoint:function(e){return w.containsPoint(e,this.a,this.b,this.c)},isFrontFacing:function(e){return w.isFrontFacing(this.a,this.b,this.c,e)},intersectsBox:function(e){return e.intersectsTriangle(this)},closestPointToPoint:function(e,t){void 0===t&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),t=new u);var n=this.a,i=this.b,r=this.c;Zo.subVectors(i,n),Jo.subVectors(r,n),Ko.subVectors(e,n);var a=Zo.dot(Ko),o=Jo.dot(Ko);if(0>=a&&0>=o)return t.copy(n);$o.subVectors(e,i);var s=Zo.dot($o),c=Jo.dot($o);if(0<=s&&c<=s)return t.copy(i);var l=a*c-s*o;if(0>=l&&0<=a&&0>=s)return i=a/(a-s),t.copy(n).addScaledVector(Zo,i);es.subVectors(e,r),e=Zo.dot(es);var h=Jo.dot(es);return 0<=h&&e<=h?t.copy(r):(a=e*o-a*h,0>=a&&0<=o&&0>=h?(l=o/(o-h),t.copy(n).addScaledVector(Jo,l)):(o=s*h-e*c,0>=o&&0<=c-s&&0<=e-h?(Qo.subVectors(r,i),l=(c-s)/(c-s+(e-h)),t.copy(i).addScaledVector(Qo,l)):(r=1/(o+a+l),i=a*r,l*=r,t.copy(n).addScaledVector(Zo,i).addScaledVector(Jo,l))))},equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}});var ts={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},ns={h:0,s:0,l:0},is={h:0,s:0,l:0};Object.assign(_.prototype,{isColor:!0,r:1,g:1,b:1,set:function(e){return e&&e.isColor?this.copy(e):"number"===typeof e?this.setHex(e):"string"===typeof e&&this.setStyle(e),this},setScalar:function(e){return this.b=this.g=this.r=e,this},setHex:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this},setRGB:function(e,t,n){return this.r=e,this.g=t,this.b=n,this},setHSL:function(e,t,n){return e=qa.euclideanModulo(e,1),t=qa.clamp(t,0,1),n=qa.clamp(n,0,1),0===t?this.r=this.g=this.b=n:(t=.5>=n?n*(1+t):n+t-n*t,n=2*n-t,this.r=M(n,t,e+1/3),this.g=M(n,t,e),this.b=M(n,t,e-1/3)),this},setStyle:function(e){function t(t){void 0!==t&&1>parseFloat(t)&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var i=n[2];switch(n[1]){case"rgb":case"rgba":if(n=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(i))return this.r=Math.min(255,parseInt(n[1],10))/255,this.g=Math.min(255,parseInt(n[2],10))/255,this.b=Math.min(255,parseInt(n[3],10))/255,t(n[5]),this;if(n=/^(\d+)%\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(i))return this.r=Math.min(100,parseInt(n[1],10))/100,this.g=Math.min(100,parseInt(n[2],10))/100,this.b=Math.min(100,parseInt(n[3],10))/100,t(n[5]),this;break;case"hsl":case"hsla":if(n=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(i)){i=parseFloat(n[1])/360;var r=parseInt(n[2],10)/100,a=parseInt(n[3],10)/100;return t(n[5]),this.setHSL(i,r,a)}}}else if(n=/^#([A-Fa-f0-9]+)$/.exec(e)){if(n=n[1],i=n.length,3===i)return this.r=parseInt(n.charAt(0)+n.charAt(0),16)/255,this.g=parseInt(n.charAt(1)+n.charAt(1),16)/255,this.b=parseInt(n.charAt(2)+n.charAt(2),16)/255,this;if(6===i)return this.r=parseInt(n.charAt(0)+n.charAt(1),16)/255,this.g=parseInt(n.charAt(2)+n.charAt(3),16)/255,this.b=parseInt(n.charAt(4)+n.charAt(5),16)/255,this}return e&&0<e.length?this.setColorName(e):this},setColorName:function(e){var t=ts[e];return void 0!==t?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},copyGammaToLinear:function(e,t){return void 0===t&&(t=2),this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this},copyLinearToGamma:function(e,t){return void 0===t&&(t=2),t=0<t?1/t:1,this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this},convertGammaToLinear:function(e){return this.copyGammaToLinear(this,e),this},convertLinearToGamma:function(e){return this.copyLinearToGamma(this,e),this},copySRGBToLinear:function(e){return this.r=S(e.r),this.g=S(e.g),this.b=S(e.b),this},copyLinearToSRGB:function(e){return this.r=T(e.r),this.g=T(e.g),this.b=T(e.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(e){void 0===e&&(console.warn("THREE.Color: .getHSL() target is now required"),e={h:0,s:0,l:0});var t,n=this.r,i=this.g,r=this.b,a=Math.max(n,i,r),o=Math.min(n,i,r),s=(o+a)/2;if(o===a)o=t=0;else{var c=a-o;switch(o=.5>=s?c/(a+o):c/(2-a-o),a){case n:t=(i-r)/c+(i<r?6:0);break;case i:t=(r-n)/c+2;break;case r:t=(n-i)/c+4}t/=6}return e.h=t,e.s=o,e.l=s,e},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(e,t,n){return this.getHSL(ns),ns.h+=e,ns.s+=t,ns.l+=n,this.setHSL(ns.h,ns.s,ns.l),this},add:function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this},addColors:function(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this},addScalar:function(e){return this.r+=e,this.g+=e,this.b+=e,this},sub:function(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this},multiply:function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this},multiplyScalar:function(e){return this.r*=e,this.g*=e,this.b*=e,this},lerp:function(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this},lerpHSL:function(e,t){this.getHSL(ns),e.getHSL(is),e=qa.lerp(ns.h,is.h,t);var n=qa.lerp(ns.s,is.s,t);return t=qa.lerp(ns.l,is.l,t),this.setHSL(e,n,t),this},equals:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b},fromArray:function(e,t){return void 0===t&&(t=0),this.r=e[t],this.g=e[t+1],this.b=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e},fromBufferAttribute:function(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),!0===e.normalized&&(this.r/=255,this.g/=255,this.b/=255),this},toJSON:function(){return this.getHex()}}),_.NAMES=ts,Object.assign(E.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.a=e.a,this.b=e.b,this.c=e.c,this.normal.copy(e.normal),this.color.copy(e.color),this.materialIndex=e.materialIndex;for(var t=0,n=e.vertexNormals.length;t<n;t++)this.vertexNormals[t]=e.vertexNormals[t].clone();for(t=0,n=e.vertexColors.length;t<n;t++)this.vertexColors[t]=e.vertexColors[t].clone();return this}});var rs=0;A.prototype=Object.assign(Object.create(t.prototype),{constructor:A,isMaterial:!0,onBeforeCompile:function(){},customProgramCacheKey:function(){return this.onBeforeCompile.toString()},setValues:function(e){if(void 0!==e)for(var t in e){var n=e[t];if(void 0===n)console.warn("THREE.Material: '"+t+"' parameter is undefined.");else if("shading"===t)console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===n;else{var i=this[t];void 0===i?console.warn("THREE."+this.type+": '"+t+"' is not a property of this material."):i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}},toJSON:function(e){function t(e){var t,n=[];for(t in e){var i=e[t];delete i.metadata,n.push(i)}return n}var n=void 0===e||"string"===typeof e;n&&(e={textures:{},images:{}});var i={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};return i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(i.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,i.reflectivity=this.reflectivity,i.refractionRatio=this.refractionRatio,void 0!==this.combine&&(i.combine=this.combine),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.size&&(i.size=this.size),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(i.blending=this.blending),!0===this.flatShading&&(i.flatShading=this.flatShading),0!==this.side&&(i.side=this.side),this.vertexColors&&(i.vertexColors=!0),1>this.opacity&&(i.opacity=this.opacity),!0===this.transparent&&(i.transparent=this.transparent),i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,i.stencilWrite=this.stencilWrite,i.stencilWriteMask=this.stencilWriteMask,i.stencilFunc=this.stencilFunc,i.stencilRef=this.stencilRef,i.stencilFuncMask=this.stencilFuncMask,i.stencilFail=this.stencilFail,i.stencilZFail=this.stencilZFail,i.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),0<this.alphaTest&&(i.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(i.wireframe=this.wireframe),1<this.wireframeLinewidth&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(i.morphTargets=!0),!0===this.morphNormals&&(i.morphNormals=!0),!0===this.skinning&&(i.skinning=!0),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),n&&(n=t(e.textures),e=t(e.images),0<n.length&&(i.textures=n),0<e.length&&(i.images=e)),i},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.flatShading=e.flatShading,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;var t=e.clippingPlanes,n=null;if(null!==t){var i=t.length;n=Array(i);for(var r=0;r!==i;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(A.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),L.prototype=Object.create(A.prototype),L.prototype.constructor=L,L.prototype.isMeshBasicMaterial=!0,L.prototype.copy=function(e){return A.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this};var as=new u,os=new n;Object.defineProperty(C.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(C.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.itemSize,n*=t.itemSize;for(var i=0,r=this.itemSize;i<r;i++)this.array[e+i]=t.array[n+i];return this},copyArray:function(e){return this.array.set(e),this},copyColorsArray:function(e){for(var t=this.array,n=0,i=0,r=e.length;i<r;i++){var a=e[i];void 0===a&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",i),a=new _),t[n++]=a.r,t[n++]=a.g,t[n++]=a.b}return this},copyVector2sArray:function(e){for(var t=this.array,i=0,r=0,a=e.length;r<a;r++){var o=e[r];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",r),o=new n),t[i++]=o.x,t[i++]=o.y}return this},copyVector3sArray:function(e){for(var t=this.array,n=0,i=0,r=e.length;i<r;i++){var a=e[i];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",i),a=new u),t[n++]=a.x,t[n++]=a.y,t[n++]=a.z}return this},copyVector4sArray:function(e){for(var t=this.array,n=0,i=0,r=e.length;i<r;i++){var a=e[i];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",i),a=new o),t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n++]=a.w}return this},applyMatrix3:function(e){if(2===this.itemSize)for(var t=0,n=this.count;t<n;t++)os.fromBufferAttribute(this,t),os.applyMatrix3(e),this.setXY(t,os.x,os.y);else if(3===this.itemSize)for(t=0,n=this.count;t<n;t++)as.fromBufferAttribute(this,t),as.applyMatrix3(e),this.setXYZ(t,as.x,as.y,as.z);return this},applyMatrix4:function(e){for(var t=0,n=this.count;t<n;t++)as.x=this.getX(t),as.y=this.getY(t),as.z=this.getZ(t),as.applyMatrix4(e),this.setXYZ(t,as.x,as.y,as.z);return this},applyNormalMatrix:function(e){for(var t=0,n=this.count;t<n;t++)as.x=this.getX(t),as.y=this.getY(t),as.z=this.getZ(t),as.applyNormalMatrix(e),this.setXYZ(t,as.x,as.y,as.z);return this},transformDirection:function(e){for(var t=0,n=this.count;t<n;t++)as.x=this.getX(t),as.y=this.getY(t),as.z=this.getZ(t),as.transformDirection(e),this.setXYZ(t,as.x,as.y,as.z);return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},getX:function(e){return this.array[e*this.itemSize]},setX:function(e,t){return this.array[e*this.itemSize]=t,this},getY:function(e){return this.array[e*this.itemSize+1]},setY:function(e,t){return this.array[e*this.itemSize+1]=t,this},getZ:function(e){return this.array[e*this.itemSize+2]},setZ:function(e,t){return this.array[e*this.itemSize+2]=t,this},getW:function(e){return this.array[e*this.itemSize+3]},setW:function(e,t){return this.array[e*this.itemSize+3]=t,this},setXY:function(e,t,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this},setXYZ:function(e,t,n,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this},setXYZW:function(e,t,n,i,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=r,this},onUpload:function(e){return this.onUploadCallback=e,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)},toJSON:function(){return{itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized}}}),R.prototype=Object.create(C.prototype),R.prototype.constructor=R,P.prototype=Object.create(C.prototype),P.prototype.constructor=P,O.prototype=Object.create(C.prototype),O.prototype.constructor=O,I.prototype=Object.create(C.prototype),I.prototype.constructor=I,D.prototype=Object.create(C.prototype),D.prototype.constructor=D,N.prototype=Object.create(C.prototype),N.prototype.constructor=N,B.prototype=Object.create(C.prototype),B.prototype.constructor=B,F.prototype=Object.create(C.prototype),F.prototype.constructor=F,U.prototype=Object.create(C.prototype),U.prototype.constructor=U,Object.assign(z.prototype,{computeGroups:function(e){var t=[],n=void 0,i=e.faces;for(e=0;e<i.length;e++){var r=i[e];if(r.materialIndex!==n){n=r.materialIndex,void 0!==a&&(a.count=3*e-a.start,t.push(a));var a={start:3*e,materialIndex:n}}}void 0!==a&&(a.count=3*e-a.start,t.push(a)),this.groups=t},fromGeometry:function(e){var t=e.faces,i=e.vertices,r=e.faceVertexUvs,a=r[0]&&0<r[0].length,o=r[1]&&0<r[1].length,s=e.morphTargets,c=s.length;if(0<c){for(var l=[],u=0;u<c;u++)l[u]={name:s[u].name,data:[]};this.morphTargets.position=l}u=e.morphNormals;var h=u.length;if(0<h){for(var d=[],p=0;p<h;p++)d[p]={name:u[p].name,data:[]};this.morphTargets.normal=d}p=e.skinIndices;var f=e.skinWeights,m=p.length===i.length,g=f.length===i.length;0<i.length&&0===t.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(var v=0;v<t.length;v++){var y=t[v];this.vertices.push(i[y.a],i[y.b],i[y.c]);var x=y.vertexNormals;for(3===x.length?this.normals.push(x[0],x[1],x[2]):(x=y.normal,this.normals.push(x,x,x)),x=y.vertexColors,3===x.length?this.colors.push(x[0],x[1],x[2]):(x=y.color,this.colors.push(x,x,x)),!0===a&&(x=r[0][v],void 0!==x?this.uvs.push(x[0],x[1],x[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",v),this.uvs.push(new n,new n,new n))),!0===o&&(x=r[1][v],void 0!==x?this.uvs2.push(x[0],x[1],x[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",v),this.uvs2.push(new n,new n,new n))),x=0;x<c;x++){var b=s[x].vertices;l[x].data.push(b[y.a],b[y.b],b[y.c])}for(x=0;x<h;x++)b=u[x].vertexNormals[v],d[x].data.push(b.a,b.b,b.c);m&&this.skinIndices.push(p[y.a],p[y.b],p[y.c]),g&&this.skinWeights.push(f[y.a],f[y.b],f[y.c])}return this.computeGroups(e),this.verticesNeedUpdate=e.verticesNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this}});var ss=1,cs=new h,ls=new f,us=new u,hs=new g,ds=new g,ps=new u;k.prototype=Object.assign(Object.create(t.prototype),{constructor:k,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(e){Array.isArray(e)?this.index=new(65535<G(e)?B:D)(e,1):this.index=e},getAttribute:function(e){return this.attributes[e]},setAttribute:function(e,t){return this.attributes[e]=t,this},deleteAttribute:function(e){return delete this.attributes[e],this},addGroup:function(e,t,n){this.groups.push({start:e,count:t,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix4:function(e){var t=this.attributes.position;if(void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0),t=this.attributes.normal,void 0!==t){var n=(new i).getNormalMatrix(e);t.applyNormalMatrix(n),t.needsUpdate=!0}return t=this.attributes.tangent,void 0!==t&&(t.transformDirection(e),t.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(e){return cs.makeRotationX(e),this.applyMatrix4(cs),this},rotateY:function(e){return cs.makeRotationY(e),this.applyMatrix4(cs),this},rotateZ:function(e){return cs.makeRotationZ(e),this.applyMatrix4(cs),this},translate:function(e,t,n){return cs.makeTranslation(e,t,n),this.applyMatrix4(cs),this},scale:function(e,t,n){return cs.makeScale(e,t,n),this.applyMatrix4(cs),this},lookAt:function(e){return ls.lookAt(e),ls.updateMatrix(),this.applyMatrix4(ls.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(us).negate(),this.translate(us.x,us.y,us.z),this},setFromObject:function(e){var t=e.geometry;if(e.isPoints||e.isLine){e=new F(3*t.vertices.length,3);var n=new F(3*t.colors.length,3);this.setAttribute("position",e.copyVector3sArray(t.vertices)),this.setAttribute("color",n.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length&&(e=new F(t.lineDistances.length,1),this.setAttribute("lineDistance",e.copyArray(t.lineDistances))),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone())}else e.isMesh&&t&&t.isGeometry&&this.fromGeometry(t);return this},setFromPoints:function(e){for(var t=[],n=0,i=e.length;n<i;n++){var r=e[n];t.push(r.x,r.y,r.z||0)}return this.setAttribute("position",new F(t,3)),this},updateFromObject:function(e){var t=e.geometry;if(e.isMesh){var n=t.__directGeometry;if(!0===t.elementsNeedUpdate&&(n=void 0,t.elementsNeedUpdate=!1),void 0===n)return this.fromGeometry(t);n.verticesNeedUpdate=t.verticesNeedUpdate,n.normalsNeedUpdate=t.normalsNeedUpdate,n.colorsNeedUpdate=t.colorsNeedUpdate,n.uvsNeedUpdate=t.uvsNeedUpdate,n.groupsNeedUpdate=t.groupsNeedUpdate,t.verticesNeedUpdate=!1,t.normalsNeedUpdate=!1,t.colorsNeedUpdate=!1,t.uvsNeedUpdate=!1,t.groupsNeedUpdate=!1,t=n}return!0===t.verticesNeedUpdate&&(n=this.attributes.position,void 0!==n&&(n.copyVector3sArray(t.vertices),n.needsUpdate=!0),t.verticesNeedUpdate=!1),!0===t.normalsNeedUpdate&&(n=this.attributes.normal,void 0!==n&&(n.copyVector3sArray(t.normals),n.needsUpdate=!0),t.normalsNeedUpdate=!1),!0===t.colorsNeedUpdate&&(n=this.attributes.color,void 0!==n&&(n.copyColorsArray(t.colors),n.needsUpdate=!0),t.colorsNeedUpdate=!1),t.uvsNeedUpdate&&(n=this.attributes.uv,void 0!==n&&(n.copyVector2sArray(t.uvs),n.needsUpdate=!0),t.uvsNeedUpdate=!1),t.lineDistancesNeedUpdate&&(n=this.attributes.lineDistance,void 0!==n&&(n.copyArray(t.lineDistances),n.needsUpdate=!0),t.lineDistancesNeedUpdate=!1),t.groupsNeedUpdate&&(t.computeGroups(e.geometry),this.groups=t.groups,t.groupsNeedUpdate=!1),this},fromGeometry:function(e){return e.__directGeometry=(new z).fromGeometry(e),this.fromDirectGeometry(e.__directGeometry)},fromDirectGeometry:function(e){var t=new Float32Array(3*e.vertices.length);for(var n in this.setAttribute("position",new C(t,3).copyVector3sArray(e.vertices)),0<e.normals.length&&(t=new Float32Array(3*e.normals.length),this.setAttribute("normal",new C(t,3).copyVector3sArray(e.normals))),0<e.colors.length&&(t=new Float32Array(3*e.colors.length),this.setAttribute("color",new C(t,3).copyColorsArray(e.colors))),0<e.uvs.length&&(t=new Float32Array(2*e.uvs.length),this.setAttribute("uv",new C(t,2).copyVector2sArray(e.uvs))),0<e.uvs2.length&&(t=new Float32Array(2*e.uvs2.length),this.setAttribute("uv2",new C(t,2).copyVector2sArray(e.uvs2))),this.groups=e.groups,e.morphTargets){t=[];for(var i=e.morphTargets[n],r=0,a=i.length;r<a;r++){var o=i[r],s=new F(3*o.data.length,3);s.name=o.name,t.push(s.copyVector3sArray(o.data))}this.morphAttributes[n]=t}return 0<e.skinIndices.length&&(n=new F(4*e.skinIndices.length,4),this.setAttribute("skinIndex",n.copyVector4sArray(e.skinIndices))),0<e.skinWeights.length&&(n=new F(4*e.skinWeights.length,4),this.setAttribute("skinWeight",n.copyVector4sArray(e.skinWeights))),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new g);var e=this.attributes.position,t=this.morphAttributes.position;if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t){e=0;for(var n=t.length;e<n;e++)hs.setFromBufferAttribute(t[e]),this.morphTargetsRelative?(ps.addVectors(this.boundingBox.min,hs.min),this.boundingBox.expandByPoint(ps),ps.addVectors(this.boundingBox.max,hs.max),this.boundingBox.expandByPoint(ps)):(this.boundingBox.expandByPoint(hs.min),this.boundingBox.expandByPoint(hs.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new y);var e=this.attributes.position,t=this.morphAttributes.position;if(e){var n=this.boundingSphere.center;if(hs.setFromBufferAttribute(e),t)for(var i=0,r=t.length;i<r;i++)ds.setFromBufferAttribute(t[i]),this.morphTargetsRelative?(ps.addVectors(hs.min,ds.min),hs.expandByPoint(ps),ps.addVectors(hs.max,ds.max),hs.expandByPoint(ps)):(hs.expandByPoint(ds.min),hs.expandByPoint(ds.max));hs.getCenter(n),r=i=0;for(var a=e.count;r<a;r++)ps.fromBufferAttribute(e,r),i=Math.max(i,n.distanceToSquared(ps));if(t)for(r=0,a=t.length;r<a;r++)for(var o=t[r],s=this.morphTargetsRelative,c=0,l=o.count;c<l;c++)ps.fromBufferAttribute(o,c),s&&(us.fromBufferAttribute(e,c),ps.add(us)),i=Math.max(i,n.distanceToSquared(ps));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}},computeFaceNormals:function(){},computeVertexNormals:function(){var e=this.index,t=this.getAttribute("position");if(void 0!==t){var n=this.getAttribute("normal");if(void 0===n)n=new C(new Float32Array(3*t.count),3),this.setAttribute("normal",n);else for(var i=0,r=n.count;i<r;i++)n.setXYZ(i,0,0,0);i=new u,r=new u;var a=new u,o=new u,s=new u,c=new u,l=new u,h=new u;if(e)for(var d=0,p=e.count;d<p;d+=3){var f=e.getX(d+0),m=e.getX(d+1),g=e.getX(d+2);i.fromBufferAttribute(t,f),r.fromBufferAttribute(t,m),a.fromBufferAttribute(t,g),l.subVectors(a,r),h.subVectors(i,r),l.cross(h),o.fromBufferAttribute(n,f),s.fromBufferAttribute(n,m),c.fromBufferAttribute(n,g),o.add(l),s.add(l),c.add(l),n.setXYZ(f,o.x,o.y,o.z),n.setXYZ(m,s.x,s.y,s.z),n.setXYZ(g,c.x,c.y,c.z)}else for(e=0,o=t.count;e<o;e+=3)i.fromBufferAttribute(t,e+0),r.fromBufferAttribute(t,e+1),a.fromBufferAttribute(t,e+2),l.subVectors(a,r),h.subVectors(i,r),l.cross(h),n.setXYZ(e+0,l.x,l.y,l.z),n.setXYZ(e+1,l.x,l.y,l.z),n.setXYZ(e+2,l.x,l.y,l.z);this.normalizeNormals(),n.needsUpdate=!0}},merge:function(e,t){if(e&&e.isBufferGeometry){void 0===t&&(t=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));var n,i=this.attributes;for(n in i)if(void 0!==e.attributes[n]){var r=i[n].array,a=e.attributes[n],o=a.array,s=a.itemSize*t;a=Math.min(o.length,r.length-s);for(var c=0;c<a;c++,s++)r[s]=o[c]}return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e)},normalizeNormals:function(){for(var e=this.attributes.normal,t=0,n=e.count;t<n;t++)ps.fromBufferAttribute(e,t),ps.normalize(),e.setXYZ(t,ps.x,ps.y,ps.z)},toNonIndexed:function(){function e(e,t){var n=e.array,i=e.itemSize;e=e.normalized;for(var r,a=new n.constructor(t.length*i),o=0,s=0,c=t.length;s<c;s++){r=t[s]*i;for(var l=0;l<i;l++)a[o++]=n[r++]}return new C(a,i,e)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var t=new k,n=this.index.array,i=this.attributes;for(o in i){var r=e(i[o],n);t.setAttribute(o,r)}for(var a in i=this.morphAttributes,i){var o=[];r=i[a];for(var s=0,c=r.length;s<c;s++){var l=e(r[s],n);o.push(l)}t.morphAttributes[a]=o}for(t.morphTargetsRelative=this.morphTargetsRelative,n=this.groups,a=0,i=n.length;a<i;a++)o=n[a],t.addGroup(o.start,o.count,o.materialIndex);return t},toJSON:function(){var e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),0<Object.keys(this.userData).length&&(e.userData=this.userData),void 0!==this.parameters){var t=this.parameters;for(n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};var n=this.index;for(var i in null!==n&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)}),n=this.attributes,n){var r=n[i],a=r.toJSON(e.data);""!==r.name&&(a.name=r.name),e.data.attributes[i]=a}for(t in i={},n=!1,this.morphAttributes){r=this.morphAttributes[t],a=[];for(var o=0,s=r.length;o<s;o++){var c=r[o],l=c.toJSON(e.data);""!==c.name&&(l.name=c.name),a.push(l)}0<a.length&&(i[t]=a,n=!0)}return n&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative),t=this.groups,0<t.length&&(e.data.groups=JSON.parse(JSON.stringify(t))),t=this.boundingSphere,null!==t&&(e.data.boundingSphere={center:t.center.toArray(),radius:t.radius}),e},clone:function(){return(new k).copy(this)},copy:function(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingSphere=this.boundingBox=null;var t={};this.name=e.name;var n=e.index;for(var i in null!==n&&this.setIndex(n.clone(t)),n=e.attributes,n)this.setAttribute(i,n[i].clone(t));for(var r in i=e.morphAttributes,i){n=[];for(var a=i[r],o=0,s=a.length;o<s;o++)n.push(a[o].clone(t));this.morphAttributes[r]=n}for(this.morphTargetsRelative=e.morphTargetsRelative,t=e.groups,r=0,i=t.length;r<i;r++)n=t[r],this.addGroup(n.start,n.count,n.materialIndex);return t=e.boundingBox,null!==t&&(this.boundingBox=t.clone()),t=e.boundingSphere,null!==t&&(this.boundingSphere=t.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var fs=new h,ms=new x,gs=new y,vs=new u,ys=new u,xs=new u,bs=new u,ws=new u,_s=new u,Ms=new u,Ss=new u,Ts=new u,Es=new n,As=new n,Ls=new n,Cs=new u,Rs=new u;H.prototype=Object.assign(Object.create(f.prototype),{constructor:H,isMesh:!0,copy:function(e){return f.prototype.copy.call(this,e),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=e.material,this.geometry=e.geometry,this},updateMorphTargets:function(){var e=this.geometry;if(e.isBufferGeometry){e=e.morphAttributes;var t=Object.keys(e);if(0<t.length&&(e=e[t[0]],void 0!==e)){this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0;for(var n=e.length;t<n;t++){var i=e[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[i]=t}}}else e=e.morphTargets,void 0!==e&&0<e.length&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")},raycast:function(e,t){var i=this.geometry,r=this.material,a=this.matrixWorld;if(void 0!==r&&(null===i.boundingSphere&&i.computeBoundingSphere(),gs.copy(i.boundingSphere),gs.applyMatrix4(a),!1!==e.ray.intersectsSphere(gs)&&(fs.getInverse(a),ms.copy(e.ray).applyMatrix4(fs),null===i.boundingBox||!1!==ms.intersectsBox(i.boundingBox))))if(i.isBufferGeometry){var o=i.index,s=i.attributes.position;a=i.morphAttributes.position;var c=i.morphTargetsRelative,l=i.attributes.uv,u=i.attributes.uv2,h=i.groups,d=i.drawRange;if(null!==o)if(Array.isArray(r))for(var p=0,f=h.length;p<f;p++)for(var m=h[p],g=r[m.materialIndex],v=Math.max(m.start,d.start),y=Math.min(m.start+m.count,d.start+d.count);v<y;v+=3){i=o.getX(v);var x=o.getX(v+1),b=o.getX(v+2);(i=V(this,g,e,ms,s,a,c,l,u,i,x,b))&&(i.faceIndex=Math.floor(v/3),i.face.materialIndex=m.materialIndex,t.push(i))}else for(h=Math.max(0,d.start),d=Math.min(o.count,d.start+d.count);h<d;h+=3)i=o.getX(h),p=o.getX(h+1),f=o.getX(h+2),(i=V(this,r,e,ms,s,a,c,l,u,i,p,f))&&(i.faceIndex=Math.floor(h/3),t.push(i));else if(void 0!==s)if(Array.isArray(r))for(o=0,p=h.length;o<p;o++)for(f=h[o],m=r[f.materialIndex],g=Math.max(f.start,d.start),v=Math.min(f.start+f.count,d.start+d.count);g<v;g+=3)(i=V(this,m,e,ms,s,a,c,l,u,g,g+1,g+2))&&(i.faceIndex=Math.floor(g/3),i.face.materialIndex=f.materialIndex,t.push(i));else for(h=Math.max(0,d.start),d=Math.min(s.count,d.start+d.count);h<d;h+=3)(i=V(this,r,e,ms,s,a,c,l,u,h,h+1,h+2))&&(i.faceIndex=Math.floor(h/3),t.push(i))}else if(i.isGeometry)for(a=Array.isArray(r),c=i.vertices,l=i.faces,i=i.faceVertexUvs[0],0<i.length&&(s=i),u=0,d=l.length;u<d;u++)h=l[u],i=a?r[h.materialIndex]:r,void 0!==i&&(o=c[h.a],p=c[h.b],f=c[h.c],i=j(this,i,e,ms,o,p,f,Cs))&&(s&&s[u]&&(m=s[u],Es.copy(m[0]),As.copy(m[1]),Ls.copy(m[2]),i.uv=w.getUV(Cs,o,p,f,Es,As,Ls,new n)),i.face=h,i.faceIndex=u,t.push(i))}});var Ps=0,Os=new h,Is=new f,Ds=new u;W.prototype=Object.assign(Object.create(t.prototype),{constructor:W,isGeometry:!0,applyMatrix4:function(e){for(var t=(new i).getNormalMatrix(e),n=0,r=this.vertices.length;n<r;n++)this.vertices[n].applyMatrix4(e);for(e=0,n=this.faces.length;e<n;e++){r=this.faces[e],r.normal.applyMatrix3(t).normalize();for(var a=0,o=r.vertexNormals.length;a<o;a++)r.vertexNormals[a].applyMatrix3(t).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.normalsNeedUpdate=this.verticesNeedUpdate=!0,this},rotateX:function(e){return Os.makeRotationX(e),this.applyMatrix4(Os),this},rotateY:function(e){return Os.makeRotationY(e),this.applyMatrix4(Os),this},rotateZ:function(e){return Os.makeRotationZ(e),this.applyMatrix4(Os),this},translate:function(e,t,n){return Os.makeTranslation(e,t,n),this.applyMatrix4(Os),this},scale:function(e,t,n){return Os.makeScale(e,t,n),this.applyMatrix4(Os),this},lookAt:function(e){return Is.lookAt(e),Is.updateMatrix(),this.applyMatrix4(Is.matrix),this},fromBufferGeometry:function(e){function t(e,t,r,a){var o=void 0===c?[]:[i.colors[e].clone(),i.colors[t].clone(),i.colors[r].clone()],d=void 0===s?[]:[(new u).fromBufferAttribute(s,e),(new u).fromBufferAttribute(s,t),(new u).fromBufferAttribute(s,r)];a=new E(e,t,r,d,o,a),i.faces.push(a),void 0!==l&&i.faceVertexUvs[0].push([(new n).fromBufferAttribute(l,e),(new n).fromBufferAttribute(l,t),(new n).fromBufferAttribute(l,r)]),void 0!==h&&i.faceVertexUvs[1].push([(new n).fromBufferAttribute(h,e),(new n).fromBufferAttribute(h,t),(new n).fromBufferAttribute(h,r)])}var i=this,r=null!==e.index?e.index:void 0,a=e.attributes;if(void 0===a.position)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var o=a.position,s=a.normal,c=a.color,l=a.uv,h=a.uv2;for(void 0!==h&&(this.faceVertexUvs[1]=[]),a=0;a<o.count;a++)i.vertices.push((new u).fromBufferAttribute(o,a)),void 0!==c&&i.colors.push((new _).fromBufferAttribute(c,a));if(a=e.groups,0<a.length)for(o=0;o<a.length;o++){var d=a[o],p=d.start,f=p;for(p+=d.count;f<p;f+=3)void 0!==r?t(r.getX(f),r.getX(f+1),r.getX(f+2),d.materialIndex):t(f,f+1,f+2,d.materialIndex)}else if(void 0!==r)for(a=0;a<r.count;a+=3)t(r.getX(a),r.getX(a+1),r.getX(a+2));else for(r=0;r<o.count;r+=3)t(r,r+1,r+2);return this.computeFaceNormals(),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Ds).negate(),this.translate(Ds.x,Ds.y,Ds.z),this},normalize:function(){this.computeBoundingSphere();var e=this.boundingSphere.center,t=this.boundingSphere.radius;t=0===t?1:1/t;var n=new h;return n.set(t,0,0,-t*e.x,0,t,0,-t*e.y,0,0,t,-t*e.z,0,0,0,1),this.applyMatrix4(n),this},computeFaceNormals:function(){for(var e=new u,t=new u,n=0,i=this.faces.length;n<i;n++){var r=this.faces[n],a=this.vertices[r.a],o=this.vertices[r.b];e.subVectors(this.vertices[r.c],o),t.subVectors(a,o),e.cross(t),e.normalize(),r.normal.copy(e)}},computeVertexNormals:function(e){void 0===e&&(e=!0);for(var t=Array(this.vertices.length),n=0,i=this.vertices.length;n<i;n++)t[n]=new u;if(e){e=new u,n=new u,i=0;for(var r=this.faces.length;i<r;i++){var a=this.faces[i],o=this.vertices[a.a],s=this.vertices[a.b];e.subVectors(this.vertices[a.c],s),n.subVectors(o,s),e.cross(n),t[a.a].add(e),t[a.b].add(e),t[a.c].add(e)}}else for(this.computeFaceNormals(),e=0,n=this.faces.length;e<n;e++)i=this.faces[e],t[i.a].add(i.normal),t[i.b].add(i.normal),t[i.c].add(i.normal);for(e=0,n=this.vertices.length;e<n;e++)t[e].normalize();for(e=0,n=this.faces.length;e<n;e++)i=this.faces[e],r=i.vertexNormals,3===r.length?(r[0].copy(t[i.a]),r[1].copy(t[i.b]),r[2].copy(t[i.c])):(r[0]=t[i.a].clone(),r[1]=t[i.b].clone(),r[2]=t[i.c].clone());0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){this.computeFaceNormals();for(var e=0,t=this.faces.length;e<t;e++){var n=this.faces[e],i=n.vertexNormals;3===i.length?(i[0].copy(n.normal),i[1].copy(n.normal),i[2].copy(n.normal)):(i[0]=n.normal.clone(),i[1]=n.normal.clone(),i[2]=n.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){for(var e=0,t=this.faces.length;e<t;e++){var n=this.faces[e];n.__originalFaceNormal?n.__originalFaceNormal.copy(n.normal):n.__originalFaceNormal=n.normal.clone(),n.__originalVertexNormals||(n.__originalVertexNormals=[]);for(var i=0,r=n.vertexNormals.length;i<r;i++)n.__originalVertexNormals[i]?n.__originalVertexNormals[i].copy(n.vertexNormals[i]):n.__originalVertexNormals[i]=n.vertexNormals[i].clone()}for(e=new W,e.faces=this.faces,t=0,n=this.morphTargets.length;t<n;t++){if(!this.morphNormals[t]){this.morphNormals[t]={},this.morphNormals[t].faceNormals=[],this.morphNormals[t].vertexNormals=[],i=this.morphNormals[t].faceNormals,r=this.morphNormals[t].vertexNormals;for(var a=0,o=this.faces.length;a<o;a++){var s=new u,c={a:new u,b:new u,c:new u};i.push(s),r.push(c)}}for(i=this.morphNormals[t],e.vertices=this.morphTargets[t].vertices,e.computeFaceNormals(),e.computeVertexNormals(),r=0,a=this.faces.length;r<a;r++)o=this.faces[r],s=i.vertexNormals[r],i.faceNormals[r].copy(o.normal),s.a.copy(o.vertexNormals[0]),s.b.copy(o.vertexNormals[1]),s.c.copy(o.vertexNormals[2])}for(e=0,t=this.faces.length;e<t;e++)n=this.faces[e],n.normal=n.__originalFaceNormal,n.vertexNormals=n.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new g),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new y),this.boundingSphere.setFromPoints(this.vertices)},merge:function(e,t,n){if(e&&e.isGeometry){var r,a=this.vertices.length,o=this.vertices,s=e.vertices,c=this.faces,l=e.faces,u=this.colors,h=e.colors;void 0===n&&(n=0),void 0!==t&&(r=(new i).getNormalMatrix(t));for(var d=0,p=s.length;d<p;d++){var f=s[d].clone();void 0!==t&&f.applyMatrix4(t),o.push(f)}for(t=0,o=h.length;t<o;t++)u.push(h[t].clone());for(u=0,h=l.length;u<h;u++){t=l[u],p=t.vertexNormals,s=t.vertexColors,o=new E(t.a+a,t.b+a,t.c+a),o.normal.copy(t.normal),void 0!==r&&o.normal.applyMatrix3(r).normalize(),f=0;for(var m=p.length;f<m;f++)d=p[f].clone(),void 0!==r&&d.applyMatrix3(r).normalize(),o.vertexNormals.push(d);for(o.color.copy(t.color),p=0,f=s.length;p<f;p++)d=s[p],o.vertexColors.push(d.clone());o.materialIndex=t.materialIndex+n,c.push(o)}for(n=0,r=e.faceVertexUvs.length;n<r;n++)for(a=e.faceVertexUvs[n],void 0===this.faceVertexUvs[n]&&(this.faceVertexUvs[n]=[]),c=0,l=a.length;c<l;c++){for(u=a[c],h=[],t=0,o=u.length;t<o;t++)h.push(u[t].clone());this.faceVertexUvs[n].push(h)}}else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e)},mergeMesh:function(e){e&&e.isMesh?(e.matrixAutoUpdate&&e.updateMatrix(),this.merge(e.geometry,e.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",e)},mergeVertices:function(){for(var e={},t=[],n=[],i=Math.pow(10,4),r=0,a=this.vertices.length;r<a;r++){var o=this.vertices[r];o=Math.round(o.x*i)+"_"+Math.round(o.y*i)+"_"+Math.round(o.z*i),void 0===e[o]?(e[o]=r,t.push(this.vertices[r]),n[r]=t.length-1):n[r]=n[e[o]]}for(e=[],i=0,r=this.faces.length;i<r;i++)for(a=this.faces[i],a.a=n[a.a],a.b=n[a.b],a.c=n[a.c],a=[a.a,a.b,a.c],o=0;3>o;o++)if(a[o]===a[(o+1)%3]){e.push(i);break}for(n=e.length-1;0<=n;n--)for(i=e[n],this.faces.splice(i,1),r=0,a=this.faceVertexUvs.length;r<a;r++)this.faceVertexUvs[r].splice(i,1);return n=this.vertices.length-t.length,this.vertices=t,n},setFromPoints:function(e){this.vertices=[];for(var t=0,n=e.length;t<n;t++){var i=e[t];this.vertices.push(new u(i.x,i.y,i.z||0))}return this},sortFacesByMaterialIndex:function(){for(var e=this.faces,t=e.length,n=0;n<t;n++)e[n]._id=n;e.sort((function(e,t){return e.materialIndex-t.materialIndex})),n=this.faceVertexUvs[0];var i,r,a=this.faceVertexUvs[1];n&&n.length===t&&(i=[]),a&&a.length===t&&(r=[]);for(var o=0;o<t;o++){var s=e[o]._id;i&&i.push(n[s]),r&&r.push(a[s])}i&&(this.faceVertexUvs[0]=i),r&&(this.faceVertexUvs[1]=r)},toJSON:function(){function e(e,t,n){return n?e|1<<t:e&~(1<<t)}function t(e){var t=e.x.toString()+e.y.toString()+e.z.toString();return void 0!==l[t]||(l[t]=c.length/3,c.push(e.x,e.y,e.z)),l[t]}function n(e){var t=e.r.toString()+e.g.toString()+e.b.toString();return void 0!==h[t]||(h[t]=u.length,u.push(e.getHex())),h[t]}function i(e){var t=e.x.toString()+e.y.toString();return void 0!==p[t]||(p[t]=d.length/2,d.push(e.x,e.y)),p[t]}var r={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),void 0!==this.parameters){var a,o=this.parameters;for(a in o)void 0!==o[a]&&(r[a]=o[a]);return r}for(o=[],a=0;a<this.vertices.length;a++){var s=this.vertices[a];o.push(s.x,s.y,s.z)}a=[];var c=[],l={},u=[],h={},d=[],p={};for(s=0;s<this.faces.length;s++){var f=this.faces[s],m=void 0!==this.faceVertexUvs[0][s],g=0<f.normal.length(),v=0<f.vertexNormals.length,y=1!==f.color.r||1!==f.color.g||1!==f.color.b,x=0<f.vertexColors.length,b=0;b=e(b,0,0),b=e(b,1,!0),b=e(b,2,!1),b=e(b,3,m),b=e(b,4,g),b=e(b,5,v),b=e(b,6,y),b=e(b,7,x),a.push(b),a.push(f.a,f.b,f.c),a.push(f.materialIndex),m&&(m=this.faceVertexUvs[0][s],a.push(i(m[0]),i(m[1]),i(m[2]))),g&&a.push(t(f.normal)),v&&(g=f.vertexNormals,a.push(t(g[0]),t(g[1]),t(g[2]))),y&&a.push(n(f.color)),x&&(f=f.vertexColors,a.push(n(f[0]),n(f[1]),n(f[2])))}return r.data={},r.data.vertices=o,r.data.normals=c,0<u.length&&(r.data.colors=u),0<d.length&&(r.data.uvs=[d]),r.data.faces=a,r},clone:function(){return(new W).copy(this)},copy:function(e){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingSphere=this.boundingBox=null,this.name=e.name;for(var t=e.vertices,n=0,i=t.length;n<i;n++)this.vertices.push(t[n].clone());for(t=e.colors,n=0,i=t.length;n<i;n++)this.colors.push(t[n].clone());for(t=e.faces,n=0,i=t.length;n<i;n++)this.faces.push(t[n].clone());for(t=0,n=e.faceVertexUvs.length;t<n;t++){i=e.faceVertexUvs[t],void 0===this.faceVertexUvs[t]&&(this.faceVertexUvs[t]=[]);for(var r=0,a=i.length;r<a;r++){for(var o=i[r],s=[],c=0,l=o.length;c<l;c++)s.push(o[c].clone());this.faceVertexUvs[t].push(s)}}for(t=e.morphTargets,n=0,i=t.length;n<i;n++){if(r={},r.name=t[n].name,void 0!==t[n].vertices)for(r.vertices=[],a=0,o=t[n].vertices.length;a<o;a++)r.vertices.push(t[n].vertices[a].clone());if(void 0!==t[n].normals)for(r.normals=[],a=0,o=t[n].normals.length;a<o;a++)r.normals.push(t[n].normals[a].clone());this.morphTargets.push(r)}for(t=e.morphNormals,n=0,i=t.length;n<i;n++){if(r={},void 0!==t[n].vertexNormals)for(r.vertexNormals=[],a=0,o=t[n].vertexNormals.length;a<o;a++)s=t[n].vertexNormals[a],c={},c.a=s.a.clone(),c.b=s.b.clone(),c.c=s.c.clone(),r.vertexNormals.push(c);if(void 0!==t[n].faceNormals)for(r.faceNormals=[],a=0,o=t[n].faceNormals.length;a<o;a++)r.faceNormals.push(t[n].faceNormals[a].clone());this.morphNormals.push(r)}for(t=e.skinWeights,n=0,i=t.length;n<i;n++)this.skinWeights.push(t[n].clone());for(t=e.skinIndices,n=0,i=t.length;n<i;n++)this.skinIndices.push(t[n].clone());for(t=e.lineDistances,n=0,i=t.length;n<i;n++)this.lineDistances.push(t[n]);return t=e.boundingBox,null!==t&&(this.boundingBox=t.clone()),t=e.boundingSphere,null!==t&&(this.boundingSphere=t.clone()),this.elementsNeedUpdate=e.elementsNeedUpdate,this.verticesNeedUpdate=e.verticesNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.lineDistancesNeedUpdate=e.lineDistancesNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var Ns=function(e){function t(t,n,i,r,a,o){e.call(this),this.type="BoxGeometry",this.parameters={width:t,height:n,depth:i,widthSegments:r,heightSegments:a,depthSegments:o},this.fromBufferGeometry(new Bs(t,n,i,r,a,o)),this.mergeVertices()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t}(W),Bs=function(e){function t(t,n,i,r,a,o){function s(e,t,n,i,r,a,o,s,g,v,y){var x=a/g,b=o/v,w=a/2,_=o/2,M=s/2;o=g+1;for(var S=v+1,T=a=0,E=new u,A=0;A<S;A++)for(var L=A*b-_,C=0;C<o;C++)E[e]=(C*x-w)*i,E[t]=L*r,E[n]=M,h.push(E.x,E.y,E.z),E[e]=0,E[t]=0,E[n]=0<s?1:-1,d.push(E.x,E.y,E.z),p.push(C/g),p.push(1-A/v),a+=1;for(e=0;e<v;e++)for(t=0;t<g;t++)n=f+t+o*(e+1),i=f+(t+1)+o*(e+1),r=f+(t+1)+o*e,l.push(f+t+o*e,n,r),l.push(n,i,r),T+=6;c.addGroup(m,T,y),m+=T,f+=a}e.call(this),this.type="BoxBufferGeometry",this.parameters={width:t,height:n,depth:i,widthSegments:r,heightSegments:a,depthSegments:o};var c=this;t=t||1,n=n||1,i=i||1,r=Math.floor(r)||1,a=Math.floor(a)||1,o=Math.floor(o)||1;var l=[],h=[],d=[],p=[],f=0,m=0;s("z","y","x",-1,-1,i,n,t,o,a,0),s("z","y","x",1,-1,i,n,-t,o,a,1),s("x","z","y",1,1,t,i,n,r,o,2),s("x","z","y",1,-1,t,i,-n,r,o,3),s("x","y","z",1,-1,t,n,i,r,a,4),s("x","y","z",-1,-1,t,n,-i,r,a,5),this.setIndex(l),this.setAttribute("position",new F(h,3)),this.setAttribute("normal",new F(d,3)),this.setAttribute("uv",new F(p,2))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t}(k),Fs={clone:q,merge:Y};X.prototype=Object.create(A.prototype),X.prototype.constructor=X,X.prototype.isShaderMaterial=!0,X.prototype.copy=function(e){return A.prototype.copy.call(this,e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=q(e.uniforms),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.extensions=Object.assign({},e.extensions),this},X.prototype.toJSON=function(e){var t=A.prototype.toJSON.call(this,e);for(var n in t.uniforms={},this.uniforms){var i=this.uniforms[n].value;t.uniforms[n]=i&&i.isTexture?{type:"t",value:i.toJSON(e).uuid}:i&&i.isColor?{type:"c",value:i.getHex()}:i&&i.isVector2?{type:"v2",value:i.toArray()}:i&&i.isVector3?{type:"v3",value:i.toArray()}:i&&i.isVector4?{type:"v4",value:i.toArray()}:i&&i.isMatrix3?{type:"m3",value:i.toArray()}:i&&i.isMatrix4?{type:"m4",value:i.toArray()}:{value:i}}for(var r in 0<Object.keys(this.defines).length&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,e={},this.extensions)!0===this.extensions[r]&&(e[r]=!0);return 0<Object.keys(e).length&&(t.extensions=e),t},Z.prototype=Object.assign(Object.create(f.prototype),{constructor:Z,isCamera:!0,copy:function(e,t){return f.prototype.copy.call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this},getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),e=new u),this.updateMatrixWorld(!0);var t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()},updateMatrixWorld:function(e){f.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},updateWorldMatrix:function(e,t){f.prototype.updateWorldMatrix.call(this,e,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),J.prototype=Object.assign(Object.create(Z.prototype),{constructor:J,isPerspectiveCamera:!0,copy:function(e,t){return Z.prototype.copy.call(this,e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this},setFocalLength:function(e){e=.5*this.getFilmHeight()/e,this.fov=2*qa.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){var e=Math.tan(.5*qa.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e},getEffectiveFOV:function(){return 2*qa.RAD2DEG*Math.atan(Math.tan(.5*qa.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(e,t,n,i,r,a){this.aspect=e/t,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=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=this.near,t=e*Math.tan(.5*qa.DEG2RAD*this.fov)/this.zoom,n=2*t,i=this.aspect*n,r=-.5*i,a=this.view;if(null!==this.view&&this.view.enabled){var o=a.fullWidth,s=a.fullHeight;r+=a.offsetX*i/o,t-=a.offsetY*n/s,i*=a.width/o,n*=a.height/s}a=this.filmOffset,0!==a&&(r+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,t,t-n,e,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){return e=f.prototype.toJSON.call(this,e),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}}),Q.prototype=Object.create(f.prototype),Q.prototype.constructor=Q,K.prototype=Object.create(s.prototype),K.prototype.constructor=K,K.prototype.isWebGLCubeRenderTarget=!0,K.prototype.fromEquirectangularTexture=function(e,t){this.texture.type=t.type,this.texture.format=t.format,this.texture.encoding=t.encoding;var n=new m,i=new X({name:"CubemapFromEquirect",uniforms:q({tEquirect:{value:null}}),vertexShader:"varying vec3 vWorldDirection;\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",fragmentShader:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n}",side:1,blending:0});return i.uniforms.tEquirect.value=t,t=new H(new Bs(5,5,5),i),n.add(t),new Q(1,10,this).update(e,n),t.geometry.dispose(),t.material.dispose(),this},$.prototype=Object.create(r.prototype),$.prototype.constructor=$,$.prototype.isDataTexture=!0;var Us=new y,zs=new u;Object.assign(ee.prototype,{set:function(e,t,n,i,r,a){var o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(i),o[4].copy(r),o[5].copy(a),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){for(var t=this.planes,n=0;6>n;n++)t[n].copy(e.planes[n]);return this},setFromProjectionMatrix:function(e){var t=this.planes,n=e.elements;e=n[0];var i=n[1],r=n[2],a=n[3],o=n[4],s=n[5],c=n[6],l=n[7],u=n[8],h=n[9],d=n[10],p=n[11],f=n[12],m=n[13],g=n[14];return n=n[15],t[0].setComponents(a-e,l-o,p-u,n-f).normalize(),t[1].setComponents(a+e,l+o,p+u,n+f).normalize(),t[2].setComponents(a+i,l+s,p+h,n+m).normalize(),t[3].setComponents(a-i,l-s,p-h,n-m).normalize(),t[4].setComponents(a-r,l-c,p-d,n-g).normalize(),t[5].setComponents(a+r,l+c,p+d,n+g).normalize(),this},intersectsObject:function(e){var t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),Us.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(Us)},intersectsSprite:function(e){return Us.center.set(0,0,0),Us.radius=.7071067811865476,Us.applyMatrix4(e.matrixWorld),this.intersectsSphere(Us)},intersectsSphere:function(e){var t=this.planes,n=e.center;e=-e.radius;for(var i=0;6>i;i++)if(t[i].distanceToPoint(n)<e)return!1;return!0},intersectsBox:function(e){for(var t=this.planes,n=0;6>n;n++){var i=t[n];if(zs.x=0<i.normal.x?e.max.x:e.min.x,zs.y=0<i.normal.y?e.max.y:e.min.y,zs.z=0<i.normal.z?e.max.z:e.min.z,0>i.distanceToPoint(zs))return!1}return!0},containsPoint:function(e){for(var t=this.planes,n=0;6>n;n++)if(0>t[n].distanceToPoint(e))return!1;return!0}});var Gs={common:{diffuse:{value:new _(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new i},uv2Transform:{value:new i},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 n(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 _(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},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 _(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new i}},sprite:{diffuse:{value:new _(15658734)},opacity:{value:1},center:{value:new n(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new i}}};ie.prototype=Object.create(W.prototype),ie.prototype.constructor=ie,re.prototype=Object.create(k.prototype),re.prototype.constructor=re;var ks={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif( cutoffDistance > 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_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - 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.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\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}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\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); } else if (face == 1.0) {\n uv = vec2(-direction.x, -direction.z) / abs(direction.y); } else if (face == 2.0) {\n uv = vec2(-direction.x, direction.y) / abs(direction.z); } else if (face == 3.0) {\n uv = vec2(-direction.z, direction.y) / abs(direction.x); } else if (face == 4.0) {\n uv = vec2(-direction.x, direction.z) / abs(direction.y); } else {\n uv = vec2(direction.x, direction.y) / abs(direction.z); }\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\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * 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\treflectVec = normalize( reflectVec );\n\t\tvec2 sampleUV = equirectUv( reflectVec );\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\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 = equirectUv( reflectVec );\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#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;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\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\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\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\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\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\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\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\t#pragma unroll_loop_end\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};\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};\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};\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;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3\tdiffuseColor;\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}\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 = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.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#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\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\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\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\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\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\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\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\t#pragma unroll_loop_end\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_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t\t#pragma unroll_loop_end\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_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#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\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ 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\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ 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\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ 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\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ 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\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ 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\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\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\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\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;\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}\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 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",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 <tonemapping_fragment>\n\t#include <encodings_fragment>\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 <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\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 <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\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 <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\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 <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\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 <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\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 <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\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 <lightmap_fragment>\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 <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\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 <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\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 <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\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 <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\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 <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\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 <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\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 <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\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 <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\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 <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\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 <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\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 <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\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 <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\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 <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\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 <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\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 <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\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 <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",shadow_vert:"#include <common>\n#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\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 <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}"},Hs={basic:{uniforms:Y([Gs.common,Gs.specularmap,Gs.envmap,Gs.aomap,Gs.lightmap,Gs.fog]),vertexShader:ks.meshbasic_vert,fragmentShader:ks.meshbasic_frag},lambert:{uniforms:Y([Gs.common,Gs.specularmap,Gs.envmap,Gs.aomap,Gs.lightmap,Gs.emissivemap,Gs.fog,Gs.lights,{emissive:{value:new _(0)}}]),vertexShader:ks.meshlambert_vert,fragmentShader:ks.meshlambert_frag},phong:{uniforms:Y([Gs.common,Gs.specularmap,Gs.envmap,Gs.aomap,Gs.lightmap,Gs.emissivemap,Gs.bumpmap,Gs.normalmap,Gs.displacementmap,Gs.fog,Gs.lights,{emissive:{value:new _(0)},specular:{value:new _(1118481)},shininess:{value:30}}]),vertexShader:ks.meshphong_vert,fragmentShader:ks.meshphong_frag},standard:{uniforms:Y([Gs.common,Gs.envmap,Gs.aomap,Gs.lightmap,Gs.emissivemap,Gs.bumpmap,Gs.normalmap,Gs.displacementmap,Gs.roughnessmap,Gs.metalnessmap,Gs.fog,Gs.lights,{emissive:{value:new _(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ks.meshphysical_vert,fragmentShader:ks.meshphysical_frag},toon:{uniforms:Y([Gs.common,Gs.aomap,Gs.lightmap,Gs.emissivemap,Gs.bumpmap,Gs.normalmap,Gs.displacementmap,Gs.gradientmap,Gs.fog,Gs.lights,{emissive:{value:new _(0)}}]),vertexShader:ks.meshtoon_vert,fragmentShader:ks.meshtoon_frag},matcap:{uniforms:Y([Gs.common,Gs.bumpmap,Gs.normalmap,Gs.displacementmap,Gs.fog,{matcap:{value:null}}]),vertexShader:ks.meshmatcap_vert,fragmentShader:ks.meshmatcap_frag},points:{uniforms:Y([Gs.points,Gs.fog]),vertexShader:ks.points_vert,fragmentShader:ks.points_frag},dashed:{uniforms:Y([Gs.common,Gs.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ks.linedashed_vert,fragmentShader:ks.linedashed_frag},depth:{uniforms:Y([Gs.common,Gs.displacementmap]),vertexShader:ks.depth_vert,fragmentShader:ks.depth_frag},normal:{uniforms:Y([Gs.common,Gs.bumpmap,Gs.normalmap,Gs.displacementmap,{opacity:{value:1}}]),vertexShader:ks.normal_vert,fragmentShader:ks.normal_frag},sprite:{uniforms:Y([Gs.sprite,Gs.fog]),vertexShader:ks.sprite_vert,fragmentShader:ks.sprite_frag},background:{uniforms:{uvTransform:{value:new i},t2D:{value:null}},vertexShader:ks.background_vert,fragmentShader:ks.background_frag},cube:{uniforms:Y([Gs.envmap,{opacity:{value:1}}]),vertexShader:ks.cube_vert,fragmentShader:ks.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ks.equirect_vert,fragmentShader:ks.equirect_frag},distanceRGBA:{uniforms:Y([Gs.common,Gs.displacementmap,{referencePosition:{value:new u},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ks.distanceRGBA_vert,fragmentShader:ks.distanceRGBA_frag},shadow:{uniforms:Y([Gs.lights,Gs.fog,{color:{value:new _(0)},opacity:{value:1}}]),vertexShader:ks.shadow_vert,fragmentShader:ks.shadow_frag}};Hs.physical={uniforms:Y([Hs.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new n(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new _(0)},transparency:{value:0}}]),vertexShader:ks.meshphysical_vert,fragmentShader:ks.meshphysical_frag},ye.prototype=Object.create(r.prototype),ye.prototype.constructor=ye,ye.prototype.isCubeTexture=!0,Object.defineProperty(ye.prototype,"images",{get:function(){return this.image},set:function(e){this.image=e}}),xe.prototype=Object.create(r.prototype),xe.prototype.constructor=xe,xe.prototype.isDataTexture2DArray=!0,be.prototype=Object.create(r.prototype),be.prototype.constructor=be,be.prototype.isDataTexture3D=!0;var js=new r,Vs=new xe,Ws=new be,qs=new ye,Ys=[],Xs=[],Zs=new Float32Array(16),Js=new Float32Array(9),Qs=new Float32Array(4);it.prototype.updateCache=function(e){var t=this.cache;e instanceof Float32Array&&t.length!==e.length&&(this.cache=new Float32Array(e.length)),Me(t,e)},rt.prototype.setValue=function(e,t,n){for(var i=this.seq,r=0,a=i.length;r!==a;++r){var o=i[r];o.setValue(e,t[o.id],n)}};var Ks=/([\w\d_]+)(\])?(\[|\.)?/g;at.prototype.setValue=function(e,t,n,i){t=this.map[t],void 0!==t&&t.setValue(e,n,i)},at.prototype.setOptional=function(e,t,n){t=t[n],void 0!==t&&this.setValue(e,n,t)},at.upload=function(e,t,n,i){for(var r=0,a=t.length;r!==a;++r){var o=t[r],s=n[o.id];!1!==s.needsUpdate&&o.setValue(e,s.value,i)}},at.seqWithValue=function(e,t){for(var n=[],i=0,r=e.length;i!==r;++i){var a=e[i];a.id in t&&n.push(a)}return n};var $s=0,ec=/^[ \t]*#include +<([\w\d./]+)>/gm,tc=/#pragma unroll_loop[\s]+?for \( int i = (\d+); i < (\d+); i \+\+ \) \{([\s\S]+?)(?=\})\}/g,nc=/#pragma unroll_loop_start[\s]+?for \( int i = (\d+); i < (\d+); i \+\+ \) \{([\s\S]+?)(?=\})\}[\s]+?#pragma unroll_loop_end/g,ic=0;Ft.prototype=Object.create(A.prototype),Ft.prototype.constructor=Ft,Ft.prototype.isMeshDepthMaterial=!0,Ft.prototype.copy=function(e){return A.prototype.copy.call(this,e),this.depthPacking=e.depthPacking,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this},Ut.prototype=Object.create(A.prototype),Ut.prototype.constructor=Ut,Ut.prototype.isMeshDistanceMaterial=!0,Ut.prototype.copy=function(e){return A.prototype.copy.call(this,e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this},jt.prototype=Object.assign(Object.create(J.prototype),{constructor:jt,isArrayCamera:!0}),Vt.prototype=Object.assign(Object.create(f.prototype),{constructor:Vt,isGroup:!0}),Object.assign(Wt.prototype,{constructor:Wt,getTargetRaySpace:function(){return null===this._targetRay&&(this._targetRay=new Vt,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1),this._targetRay},getGripSpace:function(){return null===this._grip&&(this._grip=new Vt,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1),this._grip},dispatchEvent:function(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),this},disconnect:function(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),this},update:function(e,t,n){var i=null,r=null,a=this._targetRay,o=this._grip;return e&&(null!==a&&(i=t.getPose(e.targetRaySpace,n),null!==i&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale))),null!==o&&e.gripSpace&&(r=t.getPose(e.gripSpace,n),null!==r&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale)))),null!==a&&(a.visible=null!==i),null!==o&&(o.visible=null!==r),this}}),Object.assign(qt.prototype,t.prototype),Zt.prototype=Object.assign(Object.create(Xt.prototype),{constructor:Zt,isWebGL1Renderer:!0}),Object.assign(Jt.prototype,{isFogExp2:!0,clone:function(){return new Jt(this.color,this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}),Object.assign(Qt.prototype,{isFog:!0,clone:function(){return new Qt(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}),Object.defineProperty(Kt.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(Kt.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.stride,n*=t.stride;for(var i=0,r=this.stride;i<r;i++)this.array[e+i]=t.array[n+i];return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},clone:function(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=qa.generateUUID()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer),e=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),e=new Kt(e,this.stride),e.setUsage(this.usage),e},onUpload:function(e){return this.onUploadCallback=e,this},toJSON:function(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=qa.generateUUID()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}});var rc=new u;Object.defineProperties($t.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign($t.prototype,{isInterleavedBufferAttribute:!0,applyMatrix4:function(e){for(var t=0,n=this.data.count;t<n;t++)rc.x=this.getX(t),rc.y=this.getY(t),rc.z=this.getZ(t),rc.applyMatrix4(e),this.setXYZ(t,rc.x,rc.y,rc.z);return this},setX:function(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this},setY:function(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this},setZ:function(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this},setW:function(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this},getX:function(e){return this.data.array[e*this.data.stride+this.offset]},getY:function(e){return this.data.array[e*this.data.stride+this.offset+1]},getZ:function(e){return this.data.array[e*this.data.stride+this.offset+2]},getW:function(e){return this.data.array[e*this.data.stride+this.offset+3]},setXY:function(e,t,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this},setXYZ:function(e,t,n,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this},setXYZW:function(e,t,n,i,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this.data.array[e+3]=r,this},clone:function(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data."),e=[];for(var t=0;t<this.count;t++)for(var n=t*this.data.stride+this.offset,i=0;i<this.itemSize;i++)e.push(this.data.array[n+i]);return new C(new this.array.constructor(e),this.itemSize,this.normalized)}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new $t(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)},toJSON:function(e){if(void 0===e){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data."),e=[];for(var t=0;t<this.count;t++)for(var n=t*this.data.stride+this.offset,i=0;i<this.itemSize;i++)e.push(this.data.array[n+i]);return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}),en.prototype=Object.create(A.prototype),en.prototype.constructor=en,en.prototype.isSpriteMaterial=!0,en.prototype.copy=function(e){return A.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this};var ac,oc=new u,sc=new u,cc=new u,lc=new n,uc=new n,hc=new h,dc=new u,pc=new u,fc=new u,mc=new n,gc=new n,vc=new n;tn.prototype=Object.assign(Object.create(f.prototype),{constructor:tn,isSprite:!0,raycast:function(e,t){null===e.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),sc.setFromMatrixScale(this.matrixWorld),hc.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),cc.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&sc.multiplyScalar(-cc.z);var i=this.material.rotation;if(0!==i)var r=Math.cos(i),a=Math.sin(i);i=this.center,nn(dc.set(-.5,-.5,0),cc,i,sc,a,r),nn(pc.set(.5,-.5,0),cc,i,sc,a,r),nn(fc.set(.5,.5,0),cc,i,sc,a,r),mc.set(0,0),gc.set(1,0),vc.set(1,1);var o=e.ray.intersectTriangle(dc,pc,fc,!1,oc);null===o&&(nn(pc.set(-.5,.5,0),cc,i,sc,a,r),gc.set(0,1),o=e.ray.intersectTriangle(dc,fc,pc,!1,oc),null===o)||(a=e.ray.origin.distanceTo(oc),a<e.near||a>e.far||t.push({distance:a,point:oc.clone(),uv:w.getUV(oc,dc,pc,fc,mc,gc,vc,new n),face:null,object:this}))},copy:function(e){return f.prototype.copy.call(this,e),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}});var yc=new u,xc=new u;rn.prototype=Object.assign(Object.create(f.prototype),{constructor:rn,isLOD:!0,copy:function(e){f.prototype.copy.call(this,e,!1);for(var t=e.levels,n=0,i=t.length;n<i;n++){var r=t[n];this.addLevel(r.object.clone(),r.distance)}return this.autoUpdate=e.autoUpdate,this},addLevel:function(e,t){void 0===t&&(t=0),t=Math.abs(t);var n,i=this.levels;for(n=0;n<i.length&&!(t<i[n].distance);n++);return i.splice(n,0,{distance:t,object:e}),this.add(e),this},getCurrentLevel:function(){return this._currentLevel},getObjectForDistance:function(e){var t=this.levels;if(0<t.length){var n,i=1;for(n=t.length;i<n&&!(e<t[i].distance);i++);return t[i-1].object}return null},raycast:function(e,t){if(0<this.levels.length){yc.setFromMatrixPosition(this.matrixWorld);var n=e.ray.origin.distanceTo(yc);this.getObjectForDistance(n).raycast(e,t)}},update:function(e){var t=this.levels;if(1<t.length){var n;yc.setFromMatrixPosition(e.matrixWorld),xc.setFromMatrixPosition(this.matrixWorld),e=yc.distanceTo(xc)/e.zoom,t[0].object.visible=!0;var i=1;for(n=t.length;i<n;i++){if(!(e>=t[i].distance))break;t[i-1].object.visible=!1,t[i].object.visible=!0}for(this._currentLevel=i-1;i<n;i++)t[i].object.visible=!1}},toJSON:function(e){e=f.prototype.toJSON.call(this,e),!1===this.autoUpdate&&(e.object.autoUpdate=!1),e.object.levels=[];for(var t=this.levels,n=0,i=t.length;n<i;n++){var r=t[n];e.object.levels.push({object:r.object.uuid,distance:r.distance})}return e}}),an.prototype=Object.assign(Object.create(H.prototype),{constructor:an,isSkinnedMesh:!0,copy:function(e){return H.prototype.copy.call(this,e),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,this},bind:function(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.getInverse(t)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){for(var e=new o,t=this.geometry.attributes.skinWeight,n=0,i=t.count;n<i;n++){e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.w=t.getW(n);var r=1/e.manhattanLength();1/0!==r?e.multiplyScalar(r):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}},updateMatrixWorld:function(e){H.prototype.updateMatrixWorld.call(this,e),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},boneTransform:function(){var e=new u,t=new o,n=new o,i=new u,r=new h;return function(a,o){var s=this.skeleton,c=this.geometry;for(t.fromBufferAttribute(c.attributes.skinIndex,a),n.fromBufferAttribute(c.attributes.skinWeight,a),e.fromBufferAttribute(c.attributes.position,a).applyMatrix4(this.bindMatrix),o.set(0,0,0),a=0;4>a;a++)if(c=n.getComponent(a),0!==c){var l=t.getComponent(a);r.multiplyMatrices(s.bones[l].matrixWorld,s.boneInverses[l]),o.addScaledVector(i.copy(e).applyMatrix4(r),c)}return o.applyMatrix4(this.bindMatrixInverse)}}()});var bc=new h,wc=new h;Object.assign(on.prototype,{calculateInverses:function(){this.boneInverses=[];for(var e=0,t=this.bones.length;e<t;e++){var n=new h;this.bones[e]&&n.getInverse(this.bones[e].matrixWorld),this.boneInverses.push(n)}},pose:function(){for(var e=0,t=this.bones.length;e<t;e++){var n=this.bones[e];n&&n.matrixWorld.getInverse(this.boneInverses[e])}for(e=0,t=this.bones.length;e<t;e++)(n=this.bones[e])&&(n.parent&&n.parent.isBone?(n.matrix.getInverse(n.parent.matrixWorld),n.matrix.multiply(n.matrixWorld)):n.matrix.copy(n.matrixWorld),n.matrix.decompose(n.position,n.quaternion,n.scale))},update:function(){for(var e=this.bones,t=this.boneInverses,n=this.boneMatrices,i=this.boneTexture,r=0,a=e.length;r<a;r++)bc.multiplyMatrices(e[r]?e[r].matrixWorld:wc,t[r]),bc.toArray(n,16*r);void 0!==i&&(i.needsUpdate=!0)},clone:function(){return new on(this.bones,this.boneInverses)},getBoneByName:function(e){for(var t=0,n=this.bones.length;t<n;t++){var i=this.bones[t];if(i.name===e)return i}},dispose:function(){this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=void 0)}}),sn.prototype=Object.assign(Object.create(f.prototype),{constructor:sn,isBone:!0});var _c=new h,Mc=new h,Sc=[],Tc=new H;cn.prototype=Object.assign(Object.create(H.prototype),{constructor:cn,isInstancedMesh:!0,copy:function(e){return H.prototype.copy.call(this,e),this.instanceMatrix.copy(e.instanceMatrix),this.count=e.count,this},getMatrixAt:function(e,t){t.fromArray(this.instanceMatrix.array,16*e)},raycast:function(e,t){var n=this.matrixWorld,i=this.count;if(Tc.geometry=this.geometry,Tc.material=this.material,void 0!==Tc.material)for(var r=0;r<i;r++){this.getMatrixAt(r,_c),Mc.multiplyMatrices(n,_c),Tc.matrixWorld=Mc,Tc.raycast(e,Sc);for(var a=0,o=Sc.length;a<o;a++){var s=Sc[a];s.instanceId=r,s.object=this,t.push(s)}Sc.length=0}},setMatrixAt:function(e,t){t.toArray(this.instanceMatrix.array,16*e)},updateMorphTargets:function(){}}),ln.prototype=Object.create(A.prototype),ln.prototype.constructor=ln,ln.prototype.isLineBasicMaterial=!0,ln.prototype.copy=function(e){return A.prototype.copy.call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.morphTargets=e.morphTargets,this};var Ec=new u,Ac=new u,Lc=new h,Cc=new x,Rc=new y;un.prototype=Object.assign(Object.create(f.prototype),{constructor:un,isLine:!0,copy:function(e){return f.prototype.copy.call(this,e),this.material=e.material,this.geometry=e.geometry,this},computeLineDistances:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[0],i=1,r=t.count;i<r;i++)Ec.fromBufferAttribute(t,i-1),Ac.fromBufferAttribute(t,i),n[i]=n[i-1],n[i]+=Ec.distanceTo(Ac);e.setAttribute("lineDistance",new F(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry)for(t=e.vertices,e=e.lineDistances,e[0]=0,n=1,i=t.length;n<i;n++)e[n]=e[n-1],e[n]+=t[n-1].distanceTo(t[n]);return this},raycast:function(e,t){var n=this.geometry,i=this.matrixWorld,r=e.params.Line.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),Rc.copy(n.boundingSphere),Rc.applyMatrix4(i),Rc.radius+=r,!1!==e.ray.intersectsSphere(Rc)){Lc.getInverse(i),Cc.copy(e.ray).applyMatrix4(Lc),i=r/((this.scale.x+this.scale.y+this.scale.z)/3),i*=i;var a=new u,o=new u;r=new u;var s=new u,c=this&&this.isLineSegments?2:1;if(n.isBufferGeometry){var l=n.index;if(n=n.attributes.position.array,null!==l){l=l.array;for(var h=0,d=l.length-1;h<d;h+=c){var p=l[h+1];a.fromArray(n,3*l[h]),o.fromArray(n,3*p),Cc.distanceSqToSegment(a,o,s,r)>i||(s.applyMatrix4(this.matrixWorld),p=e.ray.origin.distanceTo(s),p<e.near||p>e.far||t.push({distance:p,point:r.clone().applyMatrix4(this.matrixWorld),index:h,face:null,faceIndex:null,object:this}))}}else for(l=0,h=n.length/3-1;l<h;l+=c)a.fromArray(n,3*l),o.fromArray(n,3*l+3),Cc.distanceSqToSegment(a,o,s,r)>i||(s.applyMatrix4(this.matrixWorld),d=e.ray.origin.distanceTo(s),d<e.near||d>e.far||t.push({distance:d,point:r.clone().applyMatrix4(this.matrixWorld),index:l,face:null,faceIndex:null,object:this}))}else if(n.isGeometry)for(a=n.vertices,o=a.length,n=0;n<o-1;n+=c)Cc.distanceSqToSegment(a[n],a[n+1],s,r)>i||(s.applyMatrix4(this.matrixWorld),l=e.ray.origin.distanceTo(s),l<e.near||l>e.far||t.push({distance:l,point:r.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this}))}},updateMorphTargets:function(){var e=this.geometry;if(e.isBufferGeometry){e=e.morphAttributes;var t=Object.keys(e);if(0<t.length&&(e=e[t[0]],void 0!==e)){this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0;for(var n=e.length;t<n;t++){var i=e[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[i]=t}}}else e=e.morphTargets,void 0!==e&&0<e.length&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}});var Pc=new u,Oc=new u;hn.prototype=Object.assign(Object.create(un.prototype),{constructor:hn,isLineSegments:!0,computeLineDistances:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[],i=0,r=t.count;i<r;i+=2)Pc.fromBufferAttribute(t,i),Oc.fromBufferAttribute(t,i+1),n[i]=0===i?0:n[i-1],n[i+1]=n[i]+Pc.distanceTo(Oc);e.setAttribute("lineDistance",new F(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry)for(t=e.vertices,e=e.lineDistances,n=0,i=t.length;n<i;n+=2)Pc.copy(t[n]),Oc.copy(t[n+1]),e[n]=0===n?0:e[n-1],e[n+1]=e[n]+Pc.distanceTo(Oc);return this}}),dn.prototype=Object.assign(Object.create(un.prototype),{constructor:dn,isLineLoop:!0}),pn.prototype=Object.create(A.prototype),pn.prototype.constructor=pn,pn.prototype.isPointsMaterial=!0,pn.prototype.copy=function(e){return A.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.morphTargets=e.morphTargets,this};var Ic=new h,Dc=new x,Nc=new y,Bc=new u;fn.prototype=Object.assign(Object.create(f.prototype),{constructor:fn,isPoints:!0,copy:function(e){return f.prototype.copy.call(this,e),this.material=e.material,this.geometry=e.geometry,this},raycast:function(e,t){var n=this.geometry,i=this.matrixWorld,r=e.params.Points.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),Nc.copy(n.boundingSphere),Nc.applyMatrix4(i),Nc.radius+=r,!1!==e.ray.intersectsSphere(Nc))if(Ic.getInverse(i),Dc.copy(e.ray).applyMatrix4(Ic),r/=(this.scale.x+this.scale.y+this.scale.z)/3,r*=r,n.isBufferGeometry){var a=n.index;if(n=n.attributes.position.array,null!==a){a=a.array;for(var o=0,s=a.length;o<s;o++){var c=a[o];Bc.fromArray(n,3*c),mn(Bc,c,r,i,e,t,this)}}else for(a=0,o=n.length/3;a<o;a++)Bc.fromArray(n,3*a),mn(Bc,a,r,i,e,t,this)}else for(n=n.vertices,a=0,o=n.length;a<o;a++)mn(n[a],a,r,i,e,t,this)},updateMorphTargets:function(){var e=this.geometry;if(e.isBufferGeometry){e=e.morphAttributes;var t=Object.keys(e);if(0<t.length&&(e=e[t[0]],void 0!==e)){this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0;for(var n=e.length;t<n;t++){var i=e[t].name||String(t);this.morphTargetInfluences.push(0),this.morphTargetDictionary[i]=t}}}else e=e.morphTargets,void 0!==e&&0<e.length&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}),gn.prototype=Object.assign(Object.create(r.prototype),{constructor:gn,isVideoTexture:!0,update:function(){var e=this.image;e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),vn.prototype=Object.create(r.prototype),vn.prototype.constructor=vn,vn.prototype.isCompressedTexture=!0,yn.prototype=Object.create(r.prototype),yn.prototype.constructor=yn,yn.prototype.isCanvasTexture=!0,xn.prototype=Object.create(r.prototype),xn.prototype.constructor=xn,xn.prototype.isDepthTexture=!0,bn.prototype=Object.create(k.prototype),bn.prototype.constructor=bn,wn.prototype=Object.create(W.prototype),wn.prototype.constructor=wn,_n.prototype=Object.create(k.prototype),_n.prototype.constructor=_n,Mn.prototype=Object.create(W.prototype),Mn.prototype.constructor=Mn,Sn.prototype=Object.create(k.prototype),Sn.prototype.constructor=Sn,Tn.prototype=Object.create(W.prototype),Tn.prototype.constructor=Tn,En.prototype=Object.create(Sn.prototype),En.prototype.constructor=En,An.prototype=Object.create(W.prototype),An.prototype.constructor=An,Ln.prototype=Object.create(Sn.prototype),Ln.prototype.constructor=Ln,Cn.prototype=Object.create(W.prototype),Cn.prototype.constructor=Cn,Rn.prototype=Object.create(Sn.prototype),Rn.prototype.constructor=Rn,Pn.prototype=Object.create(W.prototype),Pn.prototype.constructor=Pn,On.prototype=Object.create(Sn.prototype),On.prototype.constructor=On,In.prototype=Object.create(W.prototype),In.prototype.constructor=In,Dn.prototype=Object.create(k.prototype),Dn.prototype.constructor=Dn,Dn.prototype.toJSON=function(){var e=k.prototype.toJSON.call(this);return e.path=this.parameters.path.toJSON(),e},Nn.prototype=Object.create(W.prototype),Nn.prototype.constructor=Nn,Bn.prototype=Object.create(k.prototype),Bn.prototype.constructor=Bn,Fn.prototype=Object.create(W.prototype),Fn.prototype.constructor=Fn,Un.prototype=Object.create(k.prototype),Un.prototype.constructor=Un;var Fc={triangulate:function(e,t,n){n=n||2;var i,r=t&&t.length,a=r?t[0]*n:e.length,o=zn(e,0,a,n,!0),s=[];if(!o||o.next===o.prev)return s;if(r){var c,l=n;r=[];var u=0;for(c=t.length;u<c;u++){var h=t[u]*l,d=u<c-1?t[u+1]*l:e.length;h=zn(e,h,d,l,!1),h===h.next&&(h.steiner=!0),r.push(qn(h))}for(r.sort(jn),u=0;u<r.length;u++)l=r[u],t=o,(t=Vn(l,t))&&(l=ei(t,l),Gn(t,t.next),Gn(l,l.next)),o=Gn(o,o.next)}if(e.length>80*n){var p=i=e[0],f=r=e[1];for(l=n;l<a;l+=n)u=e[l],t=e[l+1],u<p&&(p=u),t<f&&(f=t),u>i&&(i=u),t>r&&(r=t);i=Math.max(i-p,r-f),i=0!==i?1/i:0}return kn(o,s,n,p,f,i),s}},Uc={area:function(e){for(var t=e.length,n=0,i=t-1,r=0;r<t;i=r++)n+=e[i].x*e[r].y-e[r].x*e[i].y;return.5*n},isClockWise:function(e){return 0>Uc.area(e)},triangulateShape:function(e,t){var n=[],i=[],r=[];ri(e),ai(n,e),e=e.length,t.forEach(ri);for(var a=0;a<t.length;a++)i.push(e),e+=t[a].length,ai(n,t[a]);for(t=Fc.triangulate(n,i),n=0;n<t.length;n+=3)r.push(t.slice(n,n+3));return r}};oi.prototype=Object.create(W.prototype),oi.prototype.constructor=oi,oi.prototype.toJSON=function(){var e=W.prototype.toJSON.call(this);return ci(this.parameters.shapes,this.parameters.options,e)},si.prototype=Object.create(k.prototype),si.prototype.constructor=si,si.prototype.toJSON=function(){var e=k.prototype.toJSON.call(this);return ci(this.parameters.shapes,this.parameters.options,e)};var zc={generateTopUV:function(e,t,i,r,a){e=t[3*r],r=t[3*r+1];var o=t[3*a];return a=t[3*a+1],[new n(t[3*i],t[3*i+1]),new n(e,r),new n(o,a)]},generateSideWallUV:function(e,t,i,r,a,o){e=t[3*i];var s=t[3*i+1];i=t[3*i+2];var c=t[3*r],l=t[3*r+1];r=t[3*r+2];var u=t[3*a],h=t[3*a+1];a=t[3*a+2];var d=t[3*o],p=t[3*o+1];return t=t[3*o+2],.01>Math.abs(s-l)?[new n(e,1-i),new n(c,1-r),new n(u,1-a),new n(d,1-t)]:[new n(s,1-i),new n(l,1-r),new n(h,1-a),new n(p,1-t)]}};li.prototype=Object.create(W.prototype),li.prototype.constructor=li,ui.prototype=Object.create(si.prototype),ui.prototype.constructor=ui,hi.prototype=Object.create(W.prototype),hi.prototype.constructor=hi,di.prototype=Object.create(k.prototype),di.prototype.constructor=di,pi.prototype=Object.create(W.prototype),pi.prototype.constructor=pi,fi.prototype=Object.create(k.prototype),fi.prototype.constructor=fi,mi.prototype=Object.create(W.prototype),mi.prototype.constructor=mi,gi.prototype=Object.create(k.prototype),gi.prototype.constructor=gi,vi.prototype=Object.create(W.prototype),vi.prototype.constructor=vi,vi.prototype.toJSON=function(){var e=W.prototype.toJSON.call(this);return xi(this.parameters.shapes,e)},yi.prototype=Object.create(k.prototype),yi.prototype.constructor=yi,yi.prototype.toJSON=function(){var e=k.prototype.toJSON.call(this);return xi(this.parameters.shapes,e)},bi.prototype=Object.create(k.prototype),bi.prototype.constructor=bi,wi.prototype=Object.create(W.prototype),wi.prototype.constructor=wi,_i.prototype=Object.create(k.prototype),_i.prototype.constructor=_i,Mi.prototype=Object.create(wi.prototype),Mi.prototype.constructor=Mi,Si.prototype=Object.create(_i.prototype),Si.prototype.constructor=Si,Ti.prototype=Object.create(W.prototype),Ti.prototype.constructor=Ti,Ei.prototype=Object.create(k.prototype),Ei.prototype.constructor=Ei;var Gc=Object.freeze({__proto__:null,WireframeGeometry:bn,ParametricGeometry:wn,ParametricBufferGeometry:_n,TetrahedronGeometry:Tn,TetrahedronBufferGeometry:En,OctahedronGeometry:An,OctahedronBufferGeometry:Ln,IcosahedronGeometry:Cn,IcosahedronBufferGeometry:Rn,DodecahedronGeometry:Pn,DodecahedronBufferGeometry:On,PolyhedronGeometry:Mn,PolyhedronBufferGeometry:Sn,TubeGeometry:In,TubeBufferGeometry:Dn,TorusKnotGeometry:Nn,TorusKnotBufferGeometry:Bn,TorusGeometry:Fn,TorusBufferGeometry:Un,TextGeometry:li,TextBufferGeometry:ui,SphereGeometry:hi,SphereBufferGeometry:di,RingGeometry:pi,RingBufferGeometry:fi,PlaneGeometry:ie,PlaneBufferGeometry:re,LatheGeometry:mi,LatheBufferGeometry:gi,ShapeGeometry:vi,ShapeBufferGeometry:yi,ExtrudeGeometry:oi,ExtrudeBufferGeometry:si,EdgesGeometry:bi,ConeGeometry:Mi,ConeBufferGeometry:Si,CylinderGeometry:wi,CylinderBufferGeometry:_i,CircleGeometry:Ti,CircleBufferGeometry:Ei,BoxGeometry:Ns,BoxBufferGeometry:Bs});Ai.prototype=Object.create(A.prototype),Ai.prototype.constructor=Ai,Ai.prototype.isShadowMaterial=!0,Ai.prototype.copy=function(e){return A.prototype.copy.call(this,e),this.color.copy(e.color),this},Li.prototype=Object.create(X.prototype),Li.prototype.constructor=Li,Li.prototype.isRawShaderMaterial=!0,Ci.prototype=Object.create(A.prototype),Ci.prototype.constructor=Ci,Ci.prototype.isMeshStandardMaterial=!0,Ci.prototype.copy=function(e){return A.prototype.copy.call(this,e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.vertexTangents=e.vertexTangents,this},Ri.prototype=Object.create(Ci.prototype),Ri.prototype.constructor=Ri,Ri.prototype.isMeshPhysicalMaterial=!0,Ri.prototype.copy=function(e){return Ci.prototype.copy.call(this,e),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.reflectivity=e.reflectivity,this.sheen=e.sheen?(this.sheen||new _).copy(e.sheen):null,this.transparency=e.transparency,this},Pi.prototype=Object.create(A.prototype),Pi.prototype.constructor=Pi,Pi.prototype.isMeshPhongMaterial=!0,Pi.prototype.copy=function(e){return A.prototype.copy.call(this,e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Oi.prototype=Object.create(A.prototype),Oi.prototype.constructor=Oi,Oi.prototype.isMeshToonMaterial=!0,Oi.prototype.copy=function(e){return A.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Ii.prototype=Object.create(A.prototype),Ii.prototype.constructor=Ii,Ii.prototype.isMeshNormalMaterial=!0,Ii.prototype.copy=function(e){return A.prototype.copy.call(this,e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Di.prototype=Object.create(A.prototype),Di.prototype.constructor=Di,Di.prototype.isMeshLambertMaterial=!0,Di.prototype.copy=function(e){return A.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Ni.prototype=Object.create(A.prototype),Ni.prototype.constructor=Ni,Ni.prototype.isMeshMatcapMaterial=!0,Ni.prototype.copy=function(e){return A.prototype.copy.call(this,e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Bi.prototype=Object.create(ln.prototype),Bi.prototype.constructor=Bi,Bi.prototype.isLineDashedMaterial=!0,Bi.prototype.copy=function(e){return ln.prototype.copy.call(this,e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this};var kc=Object.freeze({__proto__:null,ShadowMaterial:Ai,SpriteMaterial:en,RawShaderMaterial:Li,ShaderMaterial:X,PointsMaterial:pn,MeshPhysicalMaterial:Ri,MeshStandardMaterial:Ci,MeshPhongMaterial:Pi,MeshToonMaterial:Oi,MeshNormalMaterial:Ii,MeshLambertMaterial:Di,MeshDepthMaterial:Ft,MeshDistanceMaterial:Ut,MeshBasicMaterial:L,MeshMatcapMaterial:Ni,LineDashedMaterial:Bi,LineBasicMaterial:ln,Material:A}),Hc={arraySlice:function(e,t,n){return Hc.isTypedArray(e)?new e.constructor(e.subarray(t,void 0!==n?n:e.length)):e.slice(t,n)},convertArray:function(e,t,n){return!e||!n&&e.constructor===t?e:"number"===typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)},isTypedArray:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},getKeyframeOrder:function(e){for(var t=e.length,n=Array(t),i=0;i!==t;++i)n[i]=i;return n.sort((function(t,n){return e[t]-e[n]})),n},sortedArray:function(e,t,n){for(var i=e.length,r=new e.constructor(i),a=0,o=0;o!==i;++a)for(var s=n[a]*t,c=0;c!==t;++c)r[o++]=e[s+c];return r},flattenJSON:function(e,t,n,i){for(var r=1,a=e[0];void 0!==a&&void 0===a[i];)a=e[r++];if(void 0!==a){var o=a[i];if(void 0!==o)if(Array.isArray(o))do{o=a[i],void 0!==o&&(t.push(a.time),n.push.apply(n,o)),a=e[r++]}while(void 0!==a);else if(void 0!==o.toArray)do{o=a[i],void 0!==o&&(t.push(a.time),o.toArray(n,n.length)),a=e[r++]}while(void 0!==a);else do{o=a[i],void 0!==o&&(t.push(a.time),n.push(o)),a=e[r++]}while(void 0!==a)}},subclip:function(e,t,n,i,r){r=r||30,e=e.clone(),e.name=t,t=[];for(var a=0;a<e.tracks.length;++a){for(var o=e.tracks[a],s=o.getValueSize(),c=[],l=[],u=0;u<o.times.length;++u){var h=o.times[u]*r;if(!(h<n||h>=i))for(c.push(o.times[u]),h=0;h<s;++h)l.push(o.values[u*s+h])}0!==c.length&&(o.times=Hc.convertArray(c,o.times.constructor),o.values=Hc.convertArray(l,o.values.constructor),t.push(o))}for(e.tracks=t,n=1/0,i=0;i<e.tracks.length;++i)n>e.tracks[i].times[0]&&(n=e.tracks[i].times[0]);for(i=0;i<e.tracks.length;++i)e.tracks[i].shift(-1*n);return e.resetDuration(),e},makeClipAdditive:function(e,t,n,i){void 0===t&&(t=0),void 0===n&&(n=e),(void 0===i||0>=i)&&(i=30);var r=e.tracks.length,a=t/i;for(t=function(t){var i=n.tracks[t],r=i.ValueTypeName;if("bool"!==r&&"string"!==r&&(t=e.tracks.find((function(e){return e.name===i.name&&e.ValueTypeName===r})),void 0!==t)){var o=i.getValueSize(),s=i.times.length-1,c=void 0;a<=i.times[0]?c=Hc.arraySlice(i.values,0,i.valueSize):a>=i.times[s]?c=Hc.arraySlice(i.values,s*o):(c=i.createInterpolant(),c.evaluate(a),c=c.resultBuffer),"quaternion"===r&&new l(c[0],c[1],c[2],c[3]).normalize().conjugate().toArray(c),s=t.times.length;for(var u=0;u<s;++u){var h=u*o;if("quaternion"===r)l.multiplyQuaternionsFlat(t.values,h,c,0,t.values,h);else for(var d=0;d<o;++d)t.values[h+d]-=c[d]}}},i=0;i<r;++i)t(i);return e.blendMode=2501,e}};Object.assign(Fi.prototype,{evaluate:function(e){var t=this.parameterPositions,n=this._cachedIndex,i=t[n],r=t[n-1];e:{t:{n:{i:if(!(e<i)){for(var a=n+2;;){if(void 0===i){if(e<r)break i;return this._cachedIndex=n=t.length,this.afterEnd_(n-1,e,r)}if(n===a)break;if(r=i,i=t[++n],e<i)break t}i=t.length;break n}if(e>=r)break e;for(a=t[1],e<a&&(n=2,r=a),a=n-2;;){if(void 0===r)return this._cachedIndex=0,this.beforeStart_(0,e,i);if(n===a)break;if(i=r,r=t[--n-1],e>=r)break t}i=n,n=0}for(;n<i;)r=n+i>>>1,e<t[r]?i=r:n=r+1;if(i=t[n],r=t[n-1],void 0===r)return this._cachedIndex=0,this.beforeStart_(0,e,i);if(void 0===i)return this._cachedIndex=n=t.length,this.afterEnd_(n-1,r,e)}this._cachedIndex=n,this.intervalChanged_(n,r,i)}return this.interpolate_(n,r,e,i)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(e){var t=this.resultBuffer,n=this.sampleValues,i=this.valueSize;e*=i;for(var r=0;r!==i;++r)t[r]=n[e+r];return t},interpolate_:function(){throw Error("call to abstract method")},intervalChanged_:function(){}}),Object.assign(Fi.prototype,{beforeStart_:Fi.prototype.copySampleValue_,afterEnd_:Fi.prototype.copySampleValue_}),Ui.prototype=Object.assign(Object.create(Fi.prototype),{constructor:Ui,DefaultSettings_:{endingStart:2400,endingEnd:2400},intervalChanged_:function(e,t,n){var i=this.parameterPositions,r=e-2,a=e+1,o=i[r],s=i[a];if(void 0===o)switch(this.getSettings_().endingStart){case 2401:r=e,o=2*t-n;break;case 2402:r=i.length-2,o=t+i[r]-i[r+1];break;default:r=e,o=n}if(void 0===s)switch(this.getSettings_().endingEnd){case 2401:a=e,s=2*n-t;break;case 2402:a=1,s=n+i[1]-i[0];break;default:a=e-1,s=t}e=.5*(n-t),i=this.valueSize,this._weightPrev=e/(t-o),this._weightNext=e/(s-n),this._offsetPrev=r*i,this._offsetNext=a*i},interpolate_:function(e,t,n,i){var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize;e*=o;var s=e-o,c=this._offsetPrev,l=this._offsetNext,u=this._weightPrev,h=this._weightNext,d=(n-t)/(i-t);for(n=d*d,i=n*d,t=-u*i+2*u*n-u*d,u=(1+u)*i+(-1.5-2*u)*n+(-.5+u)*d+1,d=(-1-h)*i+(1.5+h)*n+.5*d,h=h*i-h*n,n=0;n!==o;++n)r[n]=t*a[c+n]+u*a[s+n]+d*a[e+n]+h*a[l+n];return r}}),zi.prototype=Object.assign(Object.create(Fi.prototype),{constructor:zi,interpolate_:function(e,t,n,i){var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize;e*=o;var s=e-o;for(t=(n-t)/(i-t),n=1-t,i=0;i!==o;++i)r[i]=a[s+i]*n+a[e+i]*t;return r}}),Gi.prototype=Object.assign(Object.create(Fi.prototype),{constructor:Gi,interpolate_:function(e){return this.copySampleValue_(e-1)}}),Object.assign(ki,{toJSON:function(e){var t=e.constructor;if(void 0!==t.toJSON)t=t.toJSON(e);else{t={name:e.name,times:Hc.convertArray(e.times,Array),values:Hc.convertArray(e.values,Array)};var n=e.getInterpolation();n!==e.DefaultInterpolation&&(t.interpolation=n)}return t.type=e.ValueTypeName,t}}),Object.assign(ki.prototype,{constructor:ki,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:2301,InterpolantFactoryMethodDiscrete:function(e){return new Gi(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodLinear:function(e){return new zi(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:function(e){return new Ui(this.times,this.values,this.getValueSize(),e)},setInterpolation:function(e){switch(e){case 2300:var t=this.InterpolantFactoryMethodDiscrete;break;case 2301:t=this.InterpolantFactoryMethodLinear;break;case 2302:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){if(t="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name,void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw Error(t);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",t),this}return this.createInterpolant=t,this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}},getValueSize:function(){return this.values.length/this.times.length},shift:function(e){if(0!==e)for(var t=this.times,n=0,i=t.length;n!==i;++n)t[n]+=e;return this},scale:function(e){if(1!==e)for(var t=this.times,n=0,i=t.length;n!==i;++n)t[n]*=e;return this},trim:function(e,t){for(var n=this.times,i=n.length,r=0,a=i-1;r!==i&&n[r]<e;)++r;for(;-1!==a&&n[a]>t;)--a;return++a,0===r&&a===i||(r>=a&&(a=Math.max(a,1),r=a-1),e=this.getValueSize(),this.times=Hc.arraySlice(n,r,a),this.values=Hc.arraySlice(this.values,r*e,a*e)),this},validate:function(){var e=!0,t=this.getValueSize();0!==t-Math.floor(t)&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);var n=this.times;t=this.values;var i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);for(var r=null,a=0;a!==i;a++){var o=n[a];if("number"===typeof o&&isNaN(o)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,o),e=!1;break}if(null!==r&&r>o){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,o,r),e=!1;break}r=o}if(void 0!==t&&Hc.isTypedArray(t))for(n=0,i=t.length;n!==i;++n)if(r=t[n],isNaN(r)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,n,r),e=!1;break}return e},optimize:function(){for(var e=Hc.arraySlice(this.times),t=Hc.arraySlice(this.values),n=this.getValueSize(),i=2302===this.getInterpolation(),r=e.length-1,a=1,o=1;o<r;++o){var s=!1,c=e[o];if(c!==e[o+1]&&(1!==o||c!==c[0]))if(i)s=!0;else{c=o*n;for(var l=c-n,u=c+n,h=0;h!==n;++h){var d=t[c+h];if(d!==t[l+h]||d!==t[u+h]){s=!0;break}}}if(s){if(o!==a)for(e[a]=e[o],s=o*n,c=a*n,l=0;l!==n;++l)t[c+l]=t[s+l];++a}}if(0<r){for(e[a]=e[r],i=r*n,r=a*n,o=0;o!==n;++o)t[r+o]=t[i+o];++a}return a!==e.length?(this.times=Hc.arraySlice(e,0,a),this.values=Hc.arraySlice(t,0,a*n)):(this.times=e,this.values=t),this},clone:function(){var e=Hc.arraySlice(this.times,0),t=Hc.arraySlice(this.values,0);return e=new this.constructor(this.name,e,t),e.createInterpolant=this.createInterpolant,e}}),Hi.prototype=Object.assign(Object.create(ki.prototype),{constructor:Hi,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),ji.prototype=Object.assign(Object.create(ki.prototype),{constructor:ji,ValueTypeName:"color"}),Vi.prototype=Object.assign(Object.create(ki.prototype),{constructor:Vi,ValueTypeName:"number"}),Wi.prototype=Object.assign(Object.create(Fi.prototype),{constructor:Wi,interpolate_:function(e,t,n,i){var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize;for(t=(n-t)/(i-t),e*=o,n=e+o;e!==n;e+=4)l.slerpFlat(r,0,a,e-o,a,e,t);return r}}),qi.prototype=Object.assign(Object.create(ki.prototype),{constructor:qi,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(e){return new Wi(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),Yi.prototype=Object.assign(Object.create(ki.prototype),{constructor:Yi,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Xi.prototype=Object.assign(Object.create(ki.prototype),{constructor:Xi,ValueTypeName:"vector"}),Object.assign(Zi,{parse:function(e){for(var t=[],n=e.tracks,i=1/(e.fps||1),r=0,a=n.length;r!==a;++r)t.push(Qi(n[r]).scale(i));return new Zi(e.name,e.duration,t,e.blendMode)},toJSON:function(e){var t=[],n=e.tracks;e={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(var i=0,r=n.length;i!==r;++i)t.push(ki.toJSON(n[i]));return e},CreateFromMorphTargetSequence:function(e,t,n,i){for(var r=t.length,a=[],o=0;o<r;o++){var s=[],c=[];s.push((o+r-1)%r,o,(o+1)%r),c.push(0,1,0);var l=Hc.getKeyframeOrder(s);s=Hc.sortedArray(s,1,l),c=Hc.sortedArray(c,1,l),i||0!==s[0]||(s.push(r),c.push(c[0])),a.push(new Vi(".morphTargetInfluences["+t[o].name+"]",s,c).scale(1/n))}return new Zi(e,-1,a)},findByName:function(e,t){var n=e;for(Array.isArray(e)||(n=e.geometry&&e.geometry.animations||e.animations),e=0;e<n.length;e++)if(n[e].name===t)return n[e];return null},CreateClipsFromMorphTargetSequences:function(e,t,n){for(var i={},r=/^([\w-]*?)([\d]+)$/,a=0,o=e.length;a<o;a++){var s=e[a],c=s.name.match(r);if(c&&1<c.length){c=c[1];var l=i[c];l||(i[c]=l=[]),l.push(s)}}for(var u in e=[],i)e.push(Zi.CreateFromMorphTargetSequence(u,i[u],t,n));return e},parseAnimation:function(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;var n=function(e,t,n,i,r){if(0!==n.length){var a=[],o=[];Hc.flattenJSON(n,a,o,i),0!==a.length&&r.push(new e(t,a,o))}},i=[],r=e.name||"default",a=e.fps||30,o=e.blendMode,s=e.length||-1;e=e.hierarchy||[];for(var c=0;c<e.length;c++){var l=e[c].keys;if(l&&0!==l.length)if(l[0].morphTargets){s={};var u=void 0;for(u=0;u<l.length;u++)if(l[u].morphTargets)for(var h=0;h<l[u].morphTargets.length;h++)s[l[u].morphTargets[h]]=-1;for(var d in s){h=[];for(var p=[],f=0;f!==l[u].morphTargets.length;++f){var m=l[u];h.push(m.time),p.push(m.morphTarget===d?1:0)}i.push(new Vi(".morphTargetInfluence["+d+"]",h,p))}s=s.length*(a||1)}else u=".bones["+t[c].name+"]",n(Xi,u+".position",l,"pos",i),n(qi,u+".quaternion",l,"rot",i),n(Xi,u+".scale",l,"scl",i)}return 0===i.length?null:new Zi(r,s,i,o)}}),Object.assign(Zi.prototype,{resetDuration:function(){for(var e=0,t=0,n=this.tracks.length;t!==n;++t){var i=this.tracks[t];e=Math.max(e,i.times[i.times.length-1])}return this.duration=e,this},trim:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this},validate:function(){for(var e=!0,t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e},optimize:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this},clone:function(){for(var e=[],t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new Zi(this.name,this.duration,e,this.blendMode)}});var jc={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}},Vc=new Ki;Object.assign($i.prototype,{load:function(){},loadAsync:function(e,t){var n=this;return new Promise((function(i,r){n.load(e,i,t,r)}))},parse:function(){},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this},setResourcePath:function(e){return this.resourcePath=e,this},setRequestHeader:function(e){return this.requestHeader=e,this}});var Wc={};er.prototype=Object.assign(Object.create($i.prototype),{constructor:er,load:function(e,t,n,i){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var r=this,a=jc.get(e);if(void 0!==a)return r.manager.itemStart(e),setTimeout((function(){t&&t(a),r.manager.itemEnd(e)}),0),a;if(void 0===Wc[e]){var o=e.match(/^data:(.*?)(;base64)?,(.*)$/);if(o){n=o[1];var s=!!o[2];o=o[3],o=decodeURIComponent(o),s&&(o=atob(o));try{var c=(this.responseType||"").toLowerCase();switch(c){case"arraybuffer":case"blob":var l=new Uint8Array(o.length);for(s=0;s<o.length;s++)l[s]=o.charCodeAt(s);var u="blob"===c?new Blob([l.buffer],{type:n}):l.buffer;break;case"document":u=(new DOMParser).parseFromString(o,n);break;case"json":u=JSON.parse(o);break;default:u=o}setTimeout((function(){t&&t(u),r.manager.itemEnd(e)}),0)}catch(d){setTimeout((function(){i&&i(d),r.manager.itemError(e),r.manager.itemEnd(e)}),0)}}else{Wc[e]=[],Wc[e].push({onLoad:t,onProgress:n,onError:i});var h=new XMLHttpRequest;for(s in h.open("GET",e,!0),h.addEventListener("load",(function(t){var n=this.response,i=Wc[e];if(delete Wc[e],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),jc.add(e,n),t=0;for(var a=i.length;t<a;t++){var o=i[t];o.onLoad&&o.onLoad(n)}}else{for(n=0,a=i.length;n<a;n++)o=i[n],o.onError&&o.onError(t);r.manager.itemError(e)}r.manager.itemEnd(e)}),!1),h.addEventListener("progress",(function(t){for(var n=Wc[e],i=0,r=n.length;i<r;i++){var a=n[i];a.onProgress&&a.onProgress(t)}}),!1),h.addEventListener("error",(function(t){var n=Wc[e];delete Wc[e];for(var i=0,a=n.length;i<a;i++){var o=n[i];o.onError&&o.onError(t)}r.manager.itemError(e),r.manager.itemEnd(e)}),!1),h.addEventListener("abort",(function(t){var n=Wc[e];delete Wc[e];for(var i=0,a=n.length;i<a;i++){var o=n[i];o.onError&&o.onError(t)}r.manager.itemError(e),r.manager.itemEnd(e)}),!1),void 0!==this.responseType&&(h.responseType=this.responseType),void 0!==this.withCredentials&&(h.withCredentials=this.withCredentials),h.overrideMimeType&&h.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)h.setRequestHeader(s,this.requestHeader[s]);h.send(null)}return r.manager.itemStart(e),h}Wc[e].push({onLoad:t,onProgress:n,onError:i})},setResponseType:function(e){return this.responseType=e,this},setWithCredentials:function(e){return this.withCredentials=e,this},setMimeType:function(e){return this.mimeType=e,this}}),tr.prototype=Object.assign(Object.create($i.prototype),{constructor:tr,load:function(e,t,n,i){var r=this,a=new er(r.manager);a.setPath(r.path),a.load(e,(function(n){try{t(r.parse(JSON.parse(n)))}catch(a){i?i(a):console.error(a),r.manager.itemError(e)}}),n,i)},parse:function(e){for(var t=[],n=0;n<e.length;n++){var i=Zi.parse(e[n]);t.push(i)}return t}}),nr.prototype=Object.assign(Object.create($i.prototype),{constructor:nr,load:function(e,t,n,i){function r(r){c.load(e[r],(function(e){e=a.parse(e,!0),o[r]={width:e.width,height:e.height,format:e.format,mipmaps:e.mipmaps},l+=1,6===l&&(1===e.mipmapCount&&(s.minFilter=1006),s.format=e.format,s.needsUpdate=!0,t&&t(s))}),n,i)}var a=this,o=[],s=new vn;s.image=o;var c=new er(this.manager);c.setPath(this.path),c.setResponseType("arraybuffer");var l=0;if(Array.isArray(e))for(var u=0,h=e.length;u<h;++u)r(u);else c.load(e,(function(e){if(e=a.parse(e,!0),e.isCubemap)for(var n=e.mipmaps.length/e.mipmapCount,i=0;i<n;i++){o[i]={mipmaps:[]};for(var r=0;r<e.mipmapCount;r++)o[i].mipmaps.push(e.mipmaps[i*e.mipmapCount+r]),o[i].format=e.format,o[i].width=e.width,o[i].height=e.height}else s.image.width=e.width,s.image.height=e.height,s.mipmaps=e.mipmaps;1===e.mipmapCount&&(s.minFilter=1006),s.format=e.format,s.needsUpdate=!0,t&&t(s)}),n,i);return s}}),ir.prototype=Object.assign(Object.create($i.prototype),{constructor:ir,load:function(e,t,n,i){var r=this,a=new $,o=new er(this.manager);return o.setResponseType("arraybuffer"),o.setPath(this.path),o.load(e,(function(e){(e=r.parse(e))&&(void 0!==e.image?a.image=e.image:void 0!==e.data&&(a.image.width=e.width,a.image.height=e.height,a.image.data=e.data),a.wrapS=void 0!==e.wrapS?e.wrapS:1001,a.wrapT=void 0!==e.wrapT?e.wrapT:1001,a.magFilter=void 0!==e.magFilter?e.magFilter:1006,a.minFilter=void 0!==e.minFilter?e.minFilter:1006,a.anisotropy=void 0!==e.anisotropy?e.anisotropy:1,void 0!==e.format&&(a.format=e.format),void 0!==e.type&&(a.type=e.type),void 0!==e.mipmaps&&(a.mipmaps=e.mipmaps,a.minFilter=1008),1===e.mipmapCount&&(a.minFilter=1006),a.needsUpdate=!0,t&&t(a,e))}),n,i),a}}),rr.prototype=Object.assign(Object.create($i.prototype),{constructor:rr,load:function(e,t,n,i){function r(){c.removeEventListener("load",r,!1),c.removeEventListener("error",a,!1),jc.add(e,this),t&&t(this),o.manager.itemEnd(e)}function a(t){c.removeEventListener("load",r,!1),c.removeEventListener("error",a,!1),i&&i(t),o.manager.itemError(e),o.manager.itemEnd(e)}void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var o=this,s=jc.get(e);if(void 0!==s)return o.manager.itemStart(e),setTimeout((function(){t&&t(s),o.manager.itemEnd(e)}),0),s;var c=document.createElementNS("http://www.w3.org/1999/xhtml","img");return c.addEventListener("load",r,!1),c.addEventListener("error",a,!1),"data:"!==e.substr(0,5)&&void 0!==this.crossOrigin&&(c.crossOrigin=this.crossOrigin),o.manager.itemStart(e),c.src=e,c}}),ar.prototype=Object.assign(Object.create($i.prototype),{constructor:ar,load:function(e,t,n,i){function r(n){o.load(e[n],(function(e){a.images[n]=e,s++,6===s&&(a.needsUpdate=!0,t&&t(a))}),void 0,i)}var a=new ye,o=new rr(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);var s=0;for(n=0;n<e.length;++n)r(n);return a}}),or.prototype=Object.assign(Object.create($i.prototype),{constructor:or,load:function(e,t,n,i){var a=new r,o=new rr(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,(function(n){a.image=n,n=0<e.search(/\.jpe?g($|\?)/i)||0===e.search(/^data:image\/jpeg/),a.format=n?1022:1023,a.needsUpdate=!0,void 0!==t&&t(a)}),n,i),a}}),Object.assign(sr.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e,t){return e=this.getUtoTmapping(e),this.getPoint(e,t)},getPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return t},getSpacedPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t},getLength:function(){var e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(void 0===e&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t=[],n=this.getPoint(0),i=0;t.push(0);for(var r=1;r<=e;r++){var a=this.getPoint(r/e);i+=a.distanceTo(n),t.push(i),n=a}return this.cacheArcLengths=t},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var n=this.getLengths(),i=n.length;t=t||e*n[i-1];for(var r,a=0,o=i-1;a<=o;)if(e=Math.floor(a+(o-a)/2),r=n[e]-t,0>r)a=e+1;else{if(!(0<r)){o=e;break}o=e-1}return e=o,n[e]===t?e/(i-1):(a=n[e],(e+(t-a)/(n[e+1]-a))/(i-1))},getTangent:function(e,t){var i=e-1e-4;return e+=1e-4,0>i&&(i=0),1<e&&(e=1),i=this.getPoint(i),e=this.getPoint(e),t=t||(i.isVector2?new n:new u),t.copy(e).sub(i).normalize(),t},getTangentAt:function(e,t){return e=this.getUtoTmapping(e),this.getTangent(e,t)},computeFrenetFrames:function(e,t){for(var n=new u,i=[],r=[],a=[],o=new u,s=new h,c=0;c<=e;c++)i[c]=this.getTangentAt(c/e,new u),i[c].normalize();r[0]=new u,a[0]=new u,c=Number.MAX_VALUE;var l=Math.abs(i[0].x),d=Math.abs(i[0].y),p=Math.abs(i[0].z);for(l<=c&&(c=l,n.set(1,0,0)),d<=c&&(c=d,n.set(0,1,0)),p<=c&&n.set(0,0,1),o.crossVectors(i[0],n).normalize(),r[0].crossVectors(i[0],o),a[0].crossVectors(i[0],r[0]),n=1;n<=e;n++)r[n]=r[n-1].clone(),a[n]=a[n-1].clone(),o.crossVectors(i[n-1],i[n]),o.length()>Number.EPSILON&&(o.normalize(),c=Math.acos(qa.clamp(i[n-1].dot(i[n]),-1,1)),r[n].applyMatrix4(s.makeRotationAxis(o,c))),a[n].crossVectors(i[n],r[n]);if(!0===t)for(t=Math.acos(qa.clamp(r[0].dot(r[e]),-1,1)),t/=e,0<i[0].dot(o.crossVectors(r[0],r[e]))&&(t=-t),o=1;o<=e;o++)r[o].applyMatrix4(s.makeRotationAxis(i[o],t*o)),a[o].crossVectors(i[o],r[o]);return{tangents:i,normals:r,binormals:a}},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this},toJSON:function(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e},fromJSON:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}),cr.prototype=Object.create(sr.prototype),cr.prototype.constructor=cr,cr.prototype.isEllipseCurve=!0,cr.prototype.getPoint=function(e,t){t=t||new n;for(var i=2*Math.PI,r=this.aEndAngle-this.aStartAngle,a=Math.abs(r)<Number.EPSILON;0>r;)r+=i;for(;r>i;)r-=i;r<Number.EPSILON&&(r=a?0:i),!0!==this.aClockwise||a||(r=r===i?-i:r-i),i=this.aStartAngle+e*r,e=this.aX+this.xRadius*Math.cos(i);var o=this.aY+this.yRadius*Math.sin(i);return 0!==this.aRotation&&(i=Math.cos(this.aRotation),r=Math.sin(this.aRotation),a=e-this.aX,o-=this.aY,e=a*i-o*r+this.aX,o=a*r+o*i+this.aY),t.set(e,o)},cr.prototype.copy=function(e){return sr.prototype.copy.call(this,e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this},cr.prototype.toJSON=function(){var e=sr.prototype.toJSON.call(this);return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e},cr.prototype.fromJSON=function(e){return sr.prototype.fromJSON.call(this,e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this},lr.prototype=Object.create(cr.prototype),lr.prototype.constructor=lr,lr.prototype.isArcCurve=!0;var qc=new u,Yc=new ur,Xc=new ur,Zc=new ur;hr.prototype=Object.create(sr.prototype),hr.prototype.constructor=hr,hr.prototype.isCatmullRomCurve3=!0,hr.prototype.getPoint=function(e,t){t=t||new u;var n=this.points,i=n.length;e*=i-(this.closed?0:1);var r=Math.floor(e);if(e-=r,this.closed?r+=0<r?0:(Math.floor(Math.abs(r)/i)+1)*i:0===e&&r===i-1&&(r=i-2,e=1),this.closed||0<r)var a=n[(r-1)%i];else qc.subVectors(n[0],n[1]).add(n[0]),a=qc;var o=n[r%i],s=n[(r+1)%i];if(this.closed||r+2<i?n=n[(r+2)%i]:(qc.subVectors(n[i-1],n[i-2]).add(n[i-1]),n=qc),"centripetal"===this.curveType||"chordal"===this.curveType){var c="chordal"===this.curveType?.5:.25;i=Math.pow(a.distanceToSquared(o),c),r=Math.pow(o.distanceToSquared(s),c),c=Math.pow(s.distanceToSquared(n),c),1e-4>r&&(r=1),1e-4>i&&(i=r),1e-4>c&&(c=r),Yc.initNonuniformCatmullRom(a.x,o.x,s.x,n.x,i,r,c),Xc.initNonuniformCatmullRom(a.y,o.y,s.y,n.y,i,r,c),Zc.initNonuniformCatmullRom(a.z,o.z,s.z,n.z,i,r,c)}else"catmullrom"===this.curveType&&(Yc.initCatmullRom(a.x,o.x,s.x,n.x,this.tension),Xc.initCatmullRom(a.y,o.y,s.y,n.y,this.tension),Zc.initCatmullRom(a.z,o.z,s.z,n.z,this.tension));return t.set(Yc.calc(e),Xc.calc(e),Zc.calc(e)),t},hr.prototype.copy=function(e){sr.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++)this.points.push(e.points[t].clone());return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},hr.prototype.toJSON=function(){var e=sr.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++)e.points.push(this.points[t].toArray());return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e},hr.prototype.fromJSON=function(e){sr.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var i=e.points[t];this.points.push((new u).fromArray(i))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},mr.prototype=Object.create(sr.prototype),mr.prototype.constructor=mr,mr.prototype.isCubicBezierCurve=!0,mr.prototype.getPoint=function(e,t){t=t||new n;var i=this.v0,r=this.v1,a=this.v2,o=this.v3;return t.set(fr(e,i.x,r.x,a.x,o.x),fr(e,i.y,r.y,a.y,o.y)),t},mr.prototype.copy=function(e){return sr.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},mr.prototype.toJSON=function(){var e=sr.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},mr.prototype.fromJSON=function(e){return sr.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},gr.prototype=Object.create(sr.prototype),gr.prototype.constructor=gr,gr.prototype.isCubicBezierCurve3=!0,gr.prototype.getPoint=function(e,t){t=t||new u;var n=this.v0,i=this.v1,r=this.v2,a=this.v3;return t.set(fr(e,n.x,i.x,r.x,a.x),fr(e,n.y,i.y,r.y,a.y),fr(e,n.z,i.z,r.z,a.z)),t},gr.prototype.copy=function(e){return sr.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},gr.prototype.toJSON=function(){var e=sr.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},gr.prototype.fromJSON=function(e){return sr.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},vr.prototype=Object.create(sr.prototype),vr.prototype.constructor=vr,vr.prototype.isLineCurve=!0,vr.prototype.getPoint=function(e,t){return t=t||new n,1===e?t.copy(this.v2):(t.copy(this.v2).sub(this.v1),t.multiplyScalar(e).add(this.v1)),t},vr.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},vr.prototype.getTangent=function(e,t){return e=t||new n,e.copy(this.v2).sub(this.v1).normalize(),e},vr.prototype.copy=function(e){return sr.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},vr.prototype.toJSON=function(){var e=sr.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},vr.prototype.fromJSON=function(e){return sr.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},yr.prototype=Object.create(sr.prototype),yr.prototype.constructor=yr,yr.prototype.isLineCurve3=!0,yr.prototype.getPoint=function(e,t){return t=t||new u,1===e?t.copy(this.v2):(t.copy(this.v2).sub(this.v1),t.multiplyScalar(e).add(this.v1)),t},yr.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},yr.prototype.copy=function(e){return sr.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},yr.prototype.toJSON=function(){var e=sr.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},yr.prototype.fromJSON=function(e){return sr.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},xr.prototype=Object.create(sr.prototype),xr.prototype.constructor=xr,xr.prototype.isQuadraticBezierCurve=!0,xr.prototype.getPoint=function(e,t){t=t||new n;var i=this.v0,r=this.v1,a=this.v2;return t.set(pr(e,i.x,r.x,a.x),pr(e,i.y,r.y,a.y)),t},xr.prototype.copy=function(e){return sr.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},xr.prototype.toJSON=function(){var e=sr.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},xr.prototype.fromJSON=function(e){return sr.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},br.prototype=Object.create(sr.prototype),br.prototype.constructor=br,br.prototype.isQuadraticBezierCurve3=!0,br.prototype.getPoint=function(e,t){t=t||new u;var n=this.v0,i=this.v1,r=this.v2;return t.set(pr(e,n.x,i.x,r.x),pr(e,n.y,i.y,r.y),pr(e,n.z,i.z,r.z)),t},br.prototype.copy=function(e){return sr.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},br.prototype.toJSON=function(){var e=sr.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},br.prototype.fromJSON=function(e){return sr.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},wr.prototype=Object.create(sr.prototype),wr.prototype.constructor=wr,wr.prototype.isSplineCurve=!0,wr.prototype.getPoint=function(e,t){t=t||new n;var i=this.points,r=(i.length-1)*e;e=Math.floor(r),r-=e;var a=i[0===e?e:e-1],o=i[e],s=i[e>i.length-2?i.length-1:e+1];return i=i[e>i.length-3?i.length-1:e+2],t.set(dr(r,a.x,o.x,s.x,i.x),dr(r,a.y,o.y,s.y,i.y)),t},wr.prototype.copy=function(e){sr.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++)this.points.push(e.points[t].clone());return this},wr.prototype.toJSON=function(){var e=sr.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++)e.points.push(this.points[t].toArray());return e},wr.prototype.fromJSON=function(e){sr.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,i=e.points.length;t<i;t++){var r=e.points[t];this.points.push((new n).fromArray(r))}return this};var Jc=Object.freeze({__proto__:null,ArcCurve:lr,CatmullRomCurve3:hr,CubicBezierCurve:mr,CubicBezierCurve3:gr,EllipseCurve:cr,LineCurve:vr,LineCurve3:yr,QuadraticBezierCurve:xr,QuadraticBezierCurve3:br,SplineCurve:wr});_r.prototype=Object.assign(Object.create(sr.prototype),{constructor:_r,add:function(e){this.curves.push(e)},closePath:function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new vr(t,e))},getPoint:function(e){var t=e*this.getLength(),n=this.getCurveLengths();for(e=0;e<n.length;){if(n[e]>=t)return t=n[e]-t,e=this.curves[e],n=e.getLength(),e.getPointAt(0===n?0:1-t/n);e++}return null},getLength:function(){var e=this.getCurveLengths();return e[e.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 e=[],t=0,n=0,i=this.curves.length;n<i;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e},getSpacedPoints:function(e){void 0===e&&(e=40);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t},getPoints:function(e){e=e||12;for(var t,n=[],i=0,r=this.curves;i<r.length;i++){var a=r[i];a=a.getPoints(a&&a.isEllipseCurve?2*e:a&&(a.isLineCurve||a.isLineCurve3)?1:a&&a.isSplineCurve?e*a.points.length:e);for(var o=0;o<a.length;o++){var s=a[o];t&&t.equals(s)||(n.push(s),t=s)}}return this.autoClose&&1<n.length&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(e){sr.prototype.copy.call(this,e),this.curves=[];for(var t=0,n=e.curves.length;t<n;t++)this.curves.push(e.curves[t].clone());return this.autoClose=e.autoClose,this},toJSON:function(){var e=sr.prototype.toJSON.call(this);e.autoClose=this.autoClose,e.curves=[];for(var t=0,n=this.curves.length;t<n;t++)e.curves.push(this.curves[t].toJSON());return e},fromJSON:function(e){sr.prototype.fromJSON.call(this,e),this.autoClose=e.autoClose,this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var i=e.curves[t];this.curves.push((new Jc[i.type]).fromJSON(i))}return this}}),Mr.prototype=Object.assign(Object.create(_r.prototype),{constructor:Mr,setFromPoints:function(e){this.moveTo(e[0].x,e[0].y);for(var t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this},moveTo:function(e,t){return this.currentPoint.set(e,t),this},lineTo:function(e,t){var i=new vr(this.currentPoint.clone(),new n(e,t));return this.curves.push(i),this.currentPoint.set(e,t),this},quadraticCurveTo:function(e,t,i,r){return e=new xr(this.currentPoint.clone(),new n(e,t),new n(i,r)),this.curves.push(e),this.currentPoint.set(i,r),this},bezierCurveTo:function(e,t,i,r,a,o){return e=new mr(this.currentPoint.clone(),new n(e,t),new n(i,r),new n(a,o)),this.curves.push(e),this.currentPoint.set(a,o),this},splineThru:function(e){var t=[this.currentPoint.clone()].concat(e);return t=new wr(t),this.curves.push(t),this.currentPoint.copy(e[e.length-1]),this},arc:function(e,t,n,i,r,a){return this.absarc(e+this.currentPoint.x,t+this.currentPoint.y,n,i,r,a),this},absarc:function(e,t,n,i,r,a){return this.absellipse(e,t,n,n,i,r,a),this},ellipse:function(e,t,n,i,r,a,o,s){return this.absellipse(e+this.currentPoint.x,t+this.currentPoint.y,n,i,r,a,o,s),this},absellipse:function(e,t,n,i,r,a,o,s){return e=new cr(e,t,n,i,r,a,o,s),0<this.curves.length&&(t=e.getPoint(0),t.equals(this.currentPoint)||this.lineTo(t.x,t.y)),this.curves.push(e),e=e.getPoint(1),this.currentPoint.copy(e),this},copy:function(e){return _r.prototype.copy.call(this,e),this.currentPoint.copy(e.currentPoint),this},toJSON:function(){var e=_r.prototype.toJSON.call(this);return e.currentPoint=this.currentPoint.toArray(),e},fromJSON:function(e){return _r.prototype.fromJSON.call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}),Sr.prototype=Object.assign(Object.create(Mr.prototype),{constructor:Sr,getPointsHoles:function(e){for(var t=[],n=0,i=this.holes.length;n<i;n++)t[n]=this.holes[n].getPoints(e);return t},extractPoints:function(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}},copy:function(e){Mr.prototype.copy.call(this,e),this.holes=[];for(var t=0,n=e.holes.length;t<n;t++)this.holes.push(e.holes[t].clone());return this},toJSON:function(){var e=Mr.prototype.toJSON.call(this);e.uuid=this.uuid,e.holes=[];for(var t=0,n=this.holes.length;t<n;t++)e.holes.push(this.holes[t].toJSON());return e},fromJSON:function(e){Mr.prototype.fromJSON.call(this,e),this.uuid=e.uuid,this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var i=e.holes[t];this.holes.push((new Mr).fromJSON(i))}return this}}),Tr.prototype=Object.assign(Object.create(f.prototype),{constructor:Tr,isLight:!0,copy:function(e){return f.prototype.copy.call(this,e),this.color.copy(e.color),this.intensity=e.intensity,this},toJSON:function(e){return e=f.prototype.toJSON.call(this,e),e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}),Er.prototype=Object.assign(Object.create(Tr.prototype),{constructor:Er,isHemisphereLight:!0,copy:function(e){return Tr.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}),Object.assign(Ar.prototype,{_projScreenMatrix:new h,_lightPositionWorld:new u,_lookTarget:new u,getViewportCount:function(){return this._viewportCount},getFrustum:function(){return this._frustum},updateMatrices:function(e){var t=this.camera,n=this.matrix,i=this._projScreenMatrix,r=this._lookTarget,a=this._lightPositionWorld;a.setFromMatrixPosition(e.matrixWorld),t.position.copy(a),r.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(r),t.updateMatrixWorld(),i.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(i),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(t.projectionMatrix),n.multiply(t.matrixWorldInverse)},getViewport:function(e){return this._viewports[e]},getFrameExtents:function(){return this._frameExtents},copy:function(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var e={};return 0!==this.bias&&(e.bias=this.bias),0!==this.normalBias&&(e.normalBias=this.normalBias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}),Lr.prototype=Object.assign(Object.create(Ar.prototype),{constructor:Lr,isSpotLightShadow:!0,updateMatrices:function(e){var t=this.camera,n=2*qa.RAD2DEG*e.angle,i=this.mapSize.width/this.mapSize.height,r=e.distance||t.far;n===t.fov&&i===t.aspect&&r===t.far||(t.fov=n,t.aspect=i,t.far=r,t.updateProjectionMatrix()),Ar.prototype.updateMatrices.call(this,e)}}),Cr.prototype=Object.assign(Object.create(Tr.prototype),{constructor:Cr,isSpotLight:!0,copy:function(e){return Tr.prototype.copy.call(this,e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),Rr.prototype=Object.assign(Object.create(Ar.prototype),{constructor:Rr,isPointLightShadow:!0,updateMatrices:function(e,t){void 0===t&&(t=0);var n=this.camera,i=this.matrix,r=this._lightPositionWorld,a=this._lookTarget,o=this._projScreenMatrix;r.setFromMatrixPosition(e.matrixWorld),n.position.copy(r),a.copy(n.position),a.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(a),n.updateMatrixWorld(),i.makeTranslation(-r.x,-r.y,-r.z),o.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(o)}}),Pr.prototype=Object.assign(Object.create(Tr.prototype),{constructor:Pr,isPointLight:!0,copy:function(e){return Tr.prototype.copy.call(this,e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}),Or.prototype=Object.assign(Object.create(Z.prototype),{constructor:Or,isOrthographicCamera:!0,copy:function(e,t){return Z.prototype.copy.call(this,e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this},setViewOffset:function(e,t,n,i,r,a){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=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,r=n-e;n+=e,e=i+t,t=i-t,null!==this.view&&this.view.enabled&&(i=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom,r+=i*this.view.offsetX,n=r+i*this.view.width,e-=t*this.view.offsetY,t=e-t*this.view.height),this.projectionMatrix.makeOrthographic(r,n,e,t,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){return e=f.prototype.toJSON.call(this,e),e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}),Ir.prototype=Object.assign(Object.create(Ar.prototype),{constructor:Ir,isDirectionalLightShadow:!0,updateMatrices:function(e){Ar.prototype.updateMatrices.call(this,e)}}),Dr.prototype=Object.assign(Object.create(Tr.prototype),{constructor:Dr,isDirectionalLight:!0,copy:function(e){return Tr.prototype.copy.call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),Nr.prototype=Object.assign(Object.create(Tr.prototype),{constructor:Nr,isAmbientLight:!0}),Br.prototype=Object.assign(Object.create(Tr.prototype),{constructor:Br,isRectAreaLight:!0,copy:function(e){return Tr.prototype.copy.call(this,e),this.width=e.width,this.height=e.height,this},toJSON:function(e){return e=Tr.prototype.toJSON.call(this,e),e.object.width=this.width,e.object.height=this.height,e}}),Object.assign(Fr.prototype,{isSphericalHarmonics3:!0,set:function(e){for(var t=0;9>t;t++)this.coefficients[t].copy(e[t]);return this},zero:function(){for(var e=0;9>e;e++)this.coefficients[e].set(0,0,0);return this},getAt:function(e,t){var n=e.x,i=e.y;e=e.z;var r=this.coefficients;return t.copy(r[0]).multiplyScalar(.282095),t.addScaledVector(r[1],.488603*i),t.addScaledVector(r[2],.488603*e),t.addScaledVector(r[3],.488603*n),t.addScaledVector(r[4],1.092548*n*i),t.addScaledVector(r[5],1.092548*i*e),t.addScaledVector(r[6],.315392*(3*e*e-1)),t.addScaledVector(r[7],1.092548*n*e),t.addScaledVector(r[8],.546274*(n*n-i*i)),t},getIrradianceAt:function(e,t){var n=e.x,i=e.y;e=e.z;var r=this.coefficients;return t.copy(r[0]).multiplyScalar(.886227),t.addScaledVector(r[1],1.023328*i),t.addScaledVector(r[2],1.023328*e),t.addScaledVector(r[3],1.023328*n),t.addScaledVector(r[4],.858086*n*i),t.addScaledVector(r[5],.858086*i*e),t.addScaledVector(r[6],.743125*e*e-.247708),t.addScaledVector(r[7],.858086*n*e),t.addScaledVector(r[8],.429043*(n*n-i*i)),t},add:function(e){for(var t=0;9>t;t++)this.coefficients[t].add(e.coefficients[t]);return this},addScaledSH:function(e,t){for(var n=0;9>n;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this},scale:function(e){for(var t=0;9>t;t++)this.coefficients[t].multiplyScalar(e);return this},lerp:function(e,t){for(var n=0;9>n;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this},equals:function(e){for(var t=0;9>t;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0},copy:function(e){return this.set(e.coefficients)},clone:function(){return(new this.constructor).copy(this)},fromArray:function(e,t){void 0===t&&(t=0);for(var n=this.coefficients,i=0;9>i;i++)n[i].fromArray(e,t+3*i);return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);for(var n=this.coefficients,i=0;9>i;i++)n[i].toArray(e,t+3*i);return e}}),Object.assign(Fr,{getBasisAt:function(e,t){var n=e.x,i=e.y;e=e.z,t[0]=.282095,t[1]=.488603*i,t[2]=.488603*e,t[3]=.488603*n,t[4]=1.092548*n*i,t[5]=1.092548*i*e,t[6]=.315392*(3*e*e-1),t[7]=1.092548*n*e,t[8]=.546274*(n*n-i*i)}}),Ur.prototype=Object.assign(Object.create(Tr.prototype),{constructor:Ur,isLightProbe:!0,copy:function(e){return Tr.prototype.copy.call(this,e),this.sh.copy(e.sh),this},fromJSON:function(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this},toJSON:function(e){return e=Tr.prototype.toJSON.call(this,e),e.object.sh=this.sh.toArray(),e}}),zr.prototype=Object.assign(Object.create($i.prototype),{constructor:zr,load:function(e,t,n,i){var r=this,a=new er(r.manager);a.setPath(r.path),a.load(e,(function(n){try{t(r.parse(JSON.parse(n)))}catch(a){i?i(a):console.error(a),r.manager.itemError(e)}}),n,i)},parse:function(e){function t(e){return void 0===r[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),r[e]}var r=this.textures,a=new kc[e.type];if(void 0!==e.uuid&&(a.uuid=e.uuid),void 0!==e.name&&(a.name=e.name),void 0!==e.color&&a.color.setHex(e.color),void 0!==e.roughness&&(a.roughness=e.roughness),void 0!==e.metalness&&(a.metalness=e.metalness),void 0!==e.sheen&&(a.sheen=(new _).setHex(e.sheen)),void 0!==e.emissive&&a.emissive.setHex(e.emissive),void 0!==e.specular&&a.specular.setHex(e.specular),void 0!==e.shininess&&(a.shininess=e.shininess),void 0!==e.clearcoat&&(a.clearcoat=e.clearcoat),void 0!==e.clearcoatRoughness&&(a.clearcoatRoughness=e.clearcoatRoughness),void 0!==e.fog&&(a.fog=e.fog),void 0!==e.flatShading&&(a.flatShading=e.flatShading),void 0!==e.blending&&(a.blending=e.blending),void 0!==e.combine&&(a.combine=e.combine),void 0!==e.side&&(a.side=e.side),void 0!==e.opacity&&(a.opacity=e.opacity),void 0!==e.transparent&&(a.transparent=e.transparent),void 0!==e.alphaTest&&(a.alphaTest=e.alphaTest),void 0!==e.depthTest&&(a.depthTest=e.depthTest),void 0!==e.depthWrite&&(a.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(a.colorWrite=e.colorWrite),void 0!==e.stencilWrite&&(a.stencilWrite=e.stencilWrite),void 0!==e.stencilWriteMask&&(a.stencilWriteMask=e.stencilWriteMask),void 0!==e.stencilFunc&&(a.stencilFunc=e.stencilFunc),void 0!==e.stencilRef&&(a.stencilRef=e.stencilRef),void 0!==e.stencilFuncMask&&(a.stencilFuncMask=e.stencilFuncMask),void 0!==e.stencilFail&&(a.stencilFail=e.stencilFail),void 0!==e.stencilZFail&&(a.stencilZFail=e.stencilZFail),void 0!==e.stencilZPass&&(a.stencilZPass=e.stencilZPass),void 0!==e.wireframe&&(a.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(a.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(a.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(a.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(a.rotation=e.rotation),1!==e.linewidth&&(a.linewidth=e.linewidth),void 0!==e.dashSize&&(a.dashSize=e.dashSize),void 0!==e.gapSize&&(a.gapSize=e.gapSize),void 0!==e.scale&&(a.scale=e.scale),void 0!==e.polygonOffset&&(a.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(a.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(a.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.skinning&&(a.skinning=e.skinning),void 0!==e.morphTargets&&(a.morphTargets=e.morphTargets),void 0!==e.morphNormals&&(a.morphNormals=e.morphNormals),void 0!==e.dithering&&(a.dithering=e.dithering),void 0!==e.vertexTangents&&(a.vertexTangents=e.vertexTangents),void 0!==e.visible&&(a.visible=e.visible),void 0!==e.toneMapped&&(a.toneMapped=e.toneMapped),void 0!==e.userData&&(a.userData=e.userData),void 0!==e.vertexColors&&(a.vertexColors="number"===typeof e.vertexColors?0<e.vertexColors:e.vertexColors),void 0!==e.uniforms)for(var s in e.uniforms){var c=e.uniforms[s];switch(a.uniforms[s]={},c.type){case"t":a.uniforms[s].value=t(c.value);break;case"c":a.uniforms[s].value=(new _).setHex(c.value);break;case"v2":a.uniforms[s].value=(new n).fromArray(c.value);break;case"v3":a.uniforms[s].value=(new u).fromArray(c.value);break;case"v4":a.uniforms[s].value=(new o).fromArray(c.value);break;case"m3":a.uniforms[s].value=(new i).fromArray(c.value);case"m4":a.uniforms[s].value=(new h).fromArray(c.value);break;default:a.uniforms[s].value=c.value}}if(void 0!==e.defines&&(a.defines=e.defines),void 0!==e.vertexShader&&(a.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(a.fragmentShader=e.fragmentShader),void 0!==e.extensions)for(var l in e.extensions)a.extensions[l]=e.extensions[l];return void 0!==e.shading&&(a.flatShading=1===e.shading),void 0!==e.size&&(a.size=e.size),void 0!==e.sizeAttenuation&&(a.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(a.map=t(e.map)),void 0!==e.matcap&&(a.matcap=t(e.matcap)),void 0!==e.alphaMap&&(a.alphaMap=t(e.alphaMap)),void 0!==e.bumpMap&&(a.bumpMap=t(e.bumpMap)),void 0!==e.bumpScale&&(a.bumpScale=e.bumpScale),void 0!==e.normalMap&&(a.normalMap=t(e.normalMap)),void 0!==e.normalMapType&&(a.normalMapType=e.normalMapType),void 0!==e.normalScale&&(s=e.normalScale,!1===Array.isArray(s)&&(s=[s,s]),a.normalScale=(new n).fromArray(s)),void 0!==e.displacementMap&&(a.displacementMap=t(e.displacementMap)),void 0!==e.displacementScale&&(a.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(a.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(a.roughnessMap=t(e.roughnessMap)),void 0!==e.metalnessMap&&(a.metalnessMap=t(e.metalnessMap)),void 0!==e.emissiveMap&&(a.emissiveMap=t(e.emissiveMap)),void 0!==e.emissiveIntensity&&(a.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(a.specularMap=t(e.specularMap)),void 0!==e.envMap&&(a.envMap=t(e.envMap)),void 0!==e.envMapIntensity&&(a.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(a.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(a.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(a.lightMap=t(e.lightMap)),void 0!==e.lightMapIntensity&&(a.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(a.aoMap=t(e.aoMap)),void 0!==e.aoMapIntensity&&(a.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(a.gradientMap=t(e.gradientMap)),void 0!==e.clearcoatMap&&(a.clearcoatMap=t(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(a.clearcoatRoughnessMap=t(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(a.clearcoatNormalMap=t(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(a.clearcoatNormalScale=(new n).fromArray(e.clearcoatNormalScale)),a},setTextures:function(e){return this.textures=e,this}});var Qc={decodeText:function(e){if("undefined"!==typeof TextDecoder)return(new TextDecoder).decode(e);for(var t="",n=0,i=e.length;n<i;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch(r){return t}},extractUrlBase:function(e){var t=e.lastIndexOf("/");return-1===t?"./":e.substr(0,t+1)}};Gr.prototype=Object.assign(Object.create(k.prototype),{constructor:Gr,isInstancedBufferGeometry:!0,copy:function(e){return k.prototype.copy.call(this,e),this.instanceCount=e.instanceCount,this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var e=k.prototype.toJSON.call(this);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}),kr.prototype=Object.assign(Object.create(C.prototype),{constructor:kr,isInstancedBufferAttribute:!0,copy:function(e){return C.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this},toJSON:function(){var e=C.prototype.toJSON.call(this);return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}),Hr.prototype=Object.assign(Object.create($i.prototype),{constructor:Hr,load:function(e,t,n,i){var r=this,a=new er(r.manager);a.setPath(r.path),a.load(e,(function(n){try{t(r.parse(JSON.parse(n)))}catch(a){i?i(a):console.error(a),r.manager.itemError(e)}}),n,i)},parse:function(e){function t(e,t){if(void 0!==n[t])return n[t];var r=e.interleavedBuffers[t],a=r.buffer;return void 0!==i[a]?a=i[a]:(e=new Uint32Array(e.arrayBuffers[a]).buffer,a=i[a]=e),a=new Kc[r.type](a),a=new Kt(a,r.stride),a.uuid=r.uuid,n[t]=a}var n={},i={},r=e.isInstancedBufferGeometry?new Gr:new k,a=e.data.index;for(var o in void 0!==a&&(a=new Kc[a.type](a.array),r.setIndex(new C(a,1))),a=e.data.attributes,a){var s=a[o],c=void 0;s.isInterleavedBufferAttribute?(c=t(e.data,s.data),c=new $t(c,s.itemSize,s.offset,s.normalized)):(c=new Kc[s.type](s.array),c=new(s.isInstancedBufferAttribute?kr:C)(c,s.itemSize,s.normalized)),void 0!==s.name&&(c.name=s.name),r.setAttribute(o,c)}if(o=e.data.morphAttributes)for(var l in o){a=o[l],s=[],c=0;for(var h=a.length;c<h;c++){var d=a[c],p=void 0;d.isInterleavedBufferAttribute?(p=t(e.data,d.data),p=new $t(p,d.itemSize,d.offset,d.normalized)):(p=new Kc[d.type](d.array),p=new C(p,d.itemSize,d.normalized)),void 0!==d.name&&(p.name=d.name),s.push(p)}r.morphAttributes[l]=s}if(e.data.morphTargetsRelative&&(r.morphTargetsRelative=!0),l=e.data.groups||e.data.drawcalls||e.data.offsets,void 0!==l)for(o=0,a=l.length;o!==a;++o)s=l[o],r.addGroup(s.start,s.count,s.materialIndex);return l=e.data.boundingSphere,void 0!==l&&(o=new u,void 0!==l.center&&o.fromArray(l.center),r.boundingSphere=new y(o,l.radius)),e.name&&(r.name=e.name),e.userData&&(r.userData=e.userData),r}});var Kc={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!==typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};jr.prototype=Object.assign(Object.create($i.prototype),{constructor:jr,load:function(e,t,n,i){var r=this,a=""===this.path?Qc.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||a,a=new er(r.manager),a.setPath(this.path),a.load(e,(function(n){var a=null;try{a=JSON.parse(n)}catch(o){return void 0!==i&&i(o),void console.error("THREE:ObjectLoader: Can't parse "+e+".",o.message)}n=a.metadata,void 0===n||void 0===n.type||"geometry"===n.type.toLowerCase()?console.error("THREE.ObjectLoader: Can't load "+e):r.parse(a,t)}),n,i)},parse:function(e,t){var n=this.parseShape(e.shapes);n=this.parseGeometries(e.geometries,n);var i=this.parseImages(e.images,(function(){void 0!==t&&t(r)}));i=this.parseTextures(e.textures,i),i=this.parseMaterials(e.materials,i);var r=this.parseObject(e.object,n,i);return e.animations&&(r.animations=this.parseAnimations(e.animations)),void 0!==e.images&&0!==e.images.length||void 0===t||t(r),r},parseShape:function(e){var t={};if(void 0!==e)for(var n=0,i=e.length;n<i;n++){var r=(new Sr).fromJSON(e[n]);t[r.uuid]=r}return t},parseGeometries:function(e,t){var n={};if(void 0!==e)for(var i=new Hr,r=0,a=e.length;r<a;r++){var o=void 0,s=e[r];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":o=new Gc[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":o=new Gc[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":o=new Gc[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":o=new Gc[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":o=new Gc[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":o=new Gc[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":o=new Gc[s.type](s.radius,s.detail);break;case"RingGeometry":case"RingBufferGeometry":o=new Gc[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":o=new Gc[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":o=new Gc[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case"TubeGeometry":case"TubeBufferGeometry":o=new Gc[s.type]((new Jc[s.path.type]).fromJSON(s.path),s.tubularSegments,s.radius,s.radialSegments,s.closed);break;case"LatheGeometry":case"LatheBufferGeometry":o=new Gc[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":o=new Gc[s.type](s.vertices,s.indices,s.radius,s.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":o=[];for(var c=0,l=s.shapes.length;c<l;c++)o.push(t[s.shapes[c]]);o=new Gc[s.type](o,s.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":for(o=[],c=0,l=s.shapes.length;c<l;c++)o.push(t[s.shapes[c]]);c=s.options.extrudePath,void 0!==c&&(s.options.extrudePath=(new Jc[c.type]).fromJSON(c)),o=new Gc[s.type](o,s.options);break;case"BufferGeometry":case"InstancedBufferGeometry":o=i.parse(s);break;case"Geometry":console.error('THREE.ObjectLoader: Loading "Geometry" is not supported anymore.');break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+s.type+'"');continue}o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),!0===o.isBufferGeometry&&void 0!==s.userData&&(o.userData=s.userData),n[s.uuid]=o}return n},parseMaterials:function(e,t){var n={},i={};if(void 0!==e){var r=new zr;r.setTextures(t),t=0;for(var a=e.length;t<a;t++){var o=e[t];if("MultiMaterial"===o.type){for(var s=[],c=0;c<o.materials.length;c++){var l=o.materials[c];void 0===n[l.uuid]&&(n[l.uuid]=r.parse(l)),s.push(n[l.uuid])}i[o.uuid]=s}else void 0===n[o.uuid]&&(n[o.uuid]=r.parse(o)),i[o.uuid]=n[o.uuid]}}return i},parseAnimations:function(e){for(var t=[],n=0;n<e.length;n++){var i=e[n],r=Zi.parse(i);void 0!==i.uuid&&(r.uuid=i.uuid),t.push(r)}return t},parseImages:function(e,t){function n(e){return i.manager.itemStart(e),a.load(e,(function(){i.manager.itemEnd(e)}),void 0,(function(){i.manager.itemError(e),i.manager.itemEnd(e)}))}var i=this,r={};if(void 0!==e&&0<e.length){t=new Ki(t);var a=new rr(t);a.setCrossOrigin(this.crossOrigin),t=0;for(var o=e.length;t<o;t++){var s=e[t],c=s.url;if(Array.isArray(c)){r[s.uuid]=[];for(var l=0,u=c.length;l<u;l++){var h=c[l];h=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(h)?h:i.resourcePath+h,r[s.uuid].push(n(h))}}else c=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(s.url)?s.url:i.resourcePath+s.url,r[s.uuid]=n(c)}}return r},parseTextures:function(e,t){function n(e,t){return"number"===typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),t[e])}var i={};if(void 0!==e)for(var a=0,o=e.length;a<o;a++){var s=e[a];void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===t[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image);var c=void 0;c=Array.isArray(t[s.image])?new ye(t[s.image]):new r(t[s.image]),c.needsUpdate=!0,c.uuid=s.uuid,void 0!==s.name&&(c.name=s.name),void 0!==s.mapping&&(c.mapping=n(s.mapping,$c)),void 0!==s.offset&&c.offset.fromArray(s.offset),void 0!==s.repeat&&c.repeat.fromArray(s.repeat),void 0!==s.center&&c.center.fromArray(s.center),void 0!==s.rotation&&(c.rotation=s.rotation),void 0!==s.wrap&&(c.wrapS=n(s.wrap[0],el),c.wrapT=n(s.wrap[1],el)),void 0!==s.format&&(c.format=s.format),void 0!==s.type&&(c.type=s.type),void 0!==s.encoding&&(c.encoding=s.encoding),void 0!==s.minFilter&&(c.minFilter=n(s.minFilter,tl)),void 0!==s.magFilter&&(c.magFilter=n(s.magFilter,tl)),void 0!==s.anisotropy&&(c.anisotropy=s.anisotropy),void 0!==s.flipY&&(c.flipY=s.flipY),void 0!==s.premultiplyAlpha&&(c.premultiplyAlpha=s.premultiplyAlpha),void 0!==s.unpackAlignment&&(c.unpackAlignment=s.unpackAlignment),i[s.uuid]=c}return i},parseObject:function(e,t,n){function i(e){return void 0===t[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),t[e]}function r(e){if(void 0!==e){if(Array.isArray(e)){for(var t=[],i=0,r=e.length;i<r;i++){var a=e[i];void 0===n[a]&&console.warn("THREE.ObjectLoader: Undefined material",a),t.push(n[a])}return t}return void 0===n[e]&&console.warn("THREE.ObjectLoader: Undefined material",e),n[e]}}switch(e.type){case"Scene":var a=new m;void 0!==e.background&&Number.isInteger(e.background)&&(a.background=new _(e.background)),void 0!==e.fog&&("Fog"===e.fog.type?a.fog=new Qt(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(a.fog=new Jt(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":a=new J(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(a.focus=e.focus),void 0!==e.zoom&&(a.zoom=e.zoom),void 0!==e.filmGauge&&(a.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(a.filmOffset=e.filmOffset),void 0!==e.view&&(a.view=Object.assign({},e.view));break;case"OrthographicCamera":a=new Or(e.left,e.right,e.top,e.bottom,e.near,e.far),void 0!==e.zoom&&(a.zoom=e.zoom),void 0!==e.view&&(a.view=Object.assign({},e.view));break;case"AmbientLight":a=new Nr(e.color,e.intensity);break;case"DirectionalLight":a=new Dr(e.color,e.intensity);break;case"PointLight":a=new Pr(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":a=new Br(e.color,e.intensity,e.width,e.height);break;case"SpotLight":a=new Cr(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":a=new Er(e.color,e.groundColor,e.intensity);break;case"LightProbe":a=(new Ur).fromJSON(e);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":a=i(e.geometry);var o=r(e.material);a=new H(a,o);break;case"InstancedMesh":a=i(e.geometry),o=r(e.material);var s=e.instanceMatrix;a=new cn(a,o,e.count),a.instanceMatrix=new C(new Float32Array(s.array),16);break;case"LOD":a=new rn;break;case"Line":a=new un(i(e.geometry),r(e.material),e.mode);break;case"LineLoop":a=new dn(i(e.geometry),r(e.material));break;case"LineSegments":a=new hn(i(e.geometry),r(e.material));break;case"PointCloud":case"Points":a=new fn(i(e.geometry),r(e.material));break;case"Sprite":a=new tn(r(e.material));break;case"Group":a=new Vt;break;default:a=new f}if(a.uuid=e.uuid,void 0!==e.name&&(a.name=e.name),void 0!==e.matrix?(a.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(a.matrixAutoUpdate=e.matrixAutoUpdate),a.matrixAutoUpdate&&a.matrix.decompose(a.position,a.quaternion,a.scale)):(void 0!==e.position&&a.position.fromArray(e.position),void 0!==e.rotation&&a.rotation.fromArray(e.rotation),void 0!==e.quaternion&&a.quaternion.fromArray(e.quaternion),void 0!==e.scale&&a.scale.fromArray(e.scale)),void 0!==e.castShadow&&(a.castShadow=e.castShadow),void 0!==e.receiveShadow&&(a.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(a.shadow.bias=e.shadow.bias),void 0!==e.shadow.normalBias&&(a.shadow.normalBias=e.shadow.normalBias),void 0!==e.shadow.radius&&(a.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&a.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(a.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(a.visible=e.visible),void 0!==e.frustumCulled&&(a.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(a.renderOrder=e.renderOrder),void 0!==e.userData&&(a.userData=e.userData),void 0!==e.layers&&(a.layers.mask=e.layers),void 0!==e.children)for(s=e.children,o=0;o<s.length;o++)a.add(this.parseObject(s[o],t,n));if("LOD"===e.type)for(void 0!==e.autoUpdate&&(a.autoUpdate=e.autoUpdate),e=e.levels,s=0;s<e.length;s++){o=e[s];var c=a.getObjectByProperty("uuid",o.object);void 0!==c&&a.addLevel(c,o.distance)}return a}});var $c={UVMapping:300,CubeReflectionMapping:301,CubeRefractionMapping:302,EquirectangularReflectionMapping:303,EquirectangularRefractionMapping:304,CubeUVReflectionMapping:306,CubeUVRefractionMapping:307},el={RepeatWrapping:1e3,ClampToEdgeWrapping:1001,MirroredRepeatWrapping:1002},tl={NearestFilter:1003,NearestMipmapNearestFilter:1004,NearestMipmapLinearFilter:1005,LinearFilter:1006,LinearMipmapNearestFilter:1007,LinearMipmapLinearFilter:1008};Vr.prototype=Object.assign(Object.create($i.prototype),{constructor:Vr,setOptions:function(e){return this.options=e,this},load:function(e,t,n,i){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var r=this,a=jc.get(e);if(void 0!==a)return r.manager.itemStart(e),setTimeout((function(){t&&t(a),r.manager.itemEnd(e)}),0),a;fetch(e).then((function(e){return e.blob()})).then((function(e){return createImageBitmap(e,r.options)})).then((function(n){jc.add(e,n),t&&t(n),r.manager.itemEnd(e)})).catch((function(t){i&&i(t),r.manager.itemError(e),r.manager.itemEnd(e)})),r.manager.itemStart(e)}}),Object.assign(Wr.prototype,{moveTo:function(e,t){return this.currentPath=new Mr,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this},lineTo:function(e,t){return this.currentPath.lineTo(e,t),this},quadraticCurveTo:function(e,t,n,i){return this.currentPath.quadraticCurveTo(e,t,n,i),this},bezierCurveTo:function(e,t,n,i,r,a){return this.currentPath.bezierCurveTo(e,t,n,i,r,a),this},splineThru:function(e){return this.currentPath.splineThru(e),this},toShapes:function(e,t){function n(e){for(var t=[],n=0,i=e.length;n<i;n++){var r=e[n],a=new Sr;a.curves=r.curves,t.push(a)}return t}function i(e,t){for(var n=t.length,i=!1,r=n-1,a=0;a<n;r=a++){var o=t[r],s=t[a],c=s.x-o.x,l=s.y-o.y;if(Math.abs(l)>Number.EPSILON){if(0>l&&(o=t[a],c=-c,s=t[r],l=-l),!(e.y<o.y||e.y>s.y))if(e.y===o.y){if(e.x===o.x)return!0}else{if(r=l*(e.x-o.x)-c*(e.y-o.y),0===r)return!0;0>r||(i=!i)}}else if(e.y===o.y&&(s.x<=e.x&&e.x<=o.x||o.x<=e.x&&e.x<=s.x))return!0}return i}var r=Uc.isClockWise,a=this.subPaths;if(0===a.length)return[];if(!0===t)return n(a);if(t=[],1===a.length){var o=a[0],s=new Sr;return s.curves=o.curves,t.push(s),t}var c=!r(a[0].getPoints());c=e?!c:c,s=[];var l=[],u=[],h=0;l[h]=void 0,u[h]=[];for(var d=0,p=a.length;d<p;d++){o=a[d];var f=o.getPoints(),m=r(f);(m=e?!m:m)?(!c&&l[h]&&h++,l[h]={s:new Sr,p:f},l[h].s.curves=o.curves,c&&h++,u[h]=[]):u[h].push({h:o,p:f[0]})}if(!l[0])return n(a);if(1<l.length){for(e=!1,r=[],a=0,o=l.length;a<o;a++)s[a]=[];for(a=0,o=l.length;a<o;a++)for(m=u[a],c=0;c<m.length;c++){for(h=m[c],f=!0,d=0;d<l.length;d++)i(h.p,l[d].p)&&(a!==d&&r.push({froms:a,tos:d,hole:c}),f?(f=!1,s[d].push(h)):e=!0);f&&s[a].push(h)}0<r.length&&(e||(u=s))}for(r=0,a=l.length;r<a;r++)for(s=l[r].s,t.push(s),e=u[r],o=0,m=e.length;o<m;o++)s.holes.push(e[o].h);return t}}),Object.assign(qr.prototype,{isFont:!0,generateShapes:function(e,t){void 0===t&&(t=100);var n=[],i=t;t=this.data;var r=Array.from?Array.from(e):String(e).split("");i/=t.resolution;var a=(t.boundingBox.yMax-t.boundingBox.yMin+t.underlineThickness)*i;e=[];for(var o=0,s=0,c=0;c<r.length;c++){var l=r[c];if("\n"===l)o=0,s-=a;else{var u=l;l=i;var h=o,d=s,p=t,f=p.glyphs[u]||p.glyphs["?"];if(f){if(u=new Wr,f.o){p=f._cachedOutline||(f._cachedOutline=f.o.split(" "));for(var m=0,g=p.length;m<g;)switch(p[m++]){case"m":var v=p[m++]*l+h,y=p[m++]*l+d;u.moveTo(v,y);break;case"l":v=p[m++]*l+h,y=p[m++]*l+d,u.lineTo(v,y);break;case"q":var x=p[m++]*l+h,b=p[m++]*l+d,w=p[m++]*l+h,_=p[m++]*l+d;u.quadraticCurveTo(w,_,x,b);break;case"b":x=p[m++]*l+h,b=p[m++]*l+d,w=p[m++]*l+h,_=p[m++]*l+d,v=p[m++]*l+h,y=p[m++]*l+d,u.bezierCurveTo(w,_,v,y,x,b)}}l={offsetX:f.ha*l,path:u}}else console.error('THREE.Font: character "'+u+'" does not exists in font family '+p.familyName+"."),l=void 0;o+=l.offsetX,e.push(l.path)}}for(t=0,r=e.length;t<r;t++)Array.prototype.push.apply(n,e[t].toShapes());return n}}),Yr.prototype=Object.assign(Object.create($i.prototype),{constructor:Yr,load:function(e,t,n,i){var r=this,a=new er(this.manager);a.setPath(this.path),a.load(e,(function(e){try{var n=JSON.parse(e)}catch(i){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(e.substring(65,e.length-2))}e=r.parse(n),t&&t(e)}),n,i)},parse:function(e){return new qr(e)}});var nl,il={getContext:function(){return void 0===nl&&(nl=new(window.AudioContext||window.webkitAudioContext)),nl},setContext:function(e){nl=e}};Xr.prototype=Object.assign(Object.create($i.prototype),{constructor:Xr,load:function(e,t,n,i){var r=this,a=new er(r.manager);a.setResponseType("arraybuffer"),a.setPath(r.path),a.load(e,(function(n){try{var a=n.slice(0);il.getContext().decodeAudioData(a,(function(e){t(e)}))}catch(o){i?i(o):console.error(o),r.manager.itemError(e)}}),n,i)}}),Zr.prototype=Object.assign(Object.create(Ur.prototype),{constructor:Zr,isHemisphereLightProbe:!0,copy:function(e){return Ur.prototype.copy.call(this,e),this},toJSON:function(e){return Ur.prototype.toJSON.call(this,e)}}),Jr.prototype=Object.assign(Object.create(Ur.prototype),{constructor:Jr,isAmbientLightProbe:!0,copy:function(e){return Ur.prototype.copy.call(this,e),this},toJSON:function(e){return Ur.prototype.toJSON.call(this,e)}});var rl=new h,al=new h;Object.assign(Qr.prototype,{update:function(e){var t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep;var n=e.projectionMatrix.clone(),i=t.eyeSep/2,r=i*t.near/t.focus,a=t.near*Math.tan(qa.DEG2RAD*t.fov*.5)/t.zoom;al.elements[12]=-i,rl.elements[12]=i,i=-a*t.aspect+r;var o=a*t.aspect+r;n.elements[0]=2*t.near/(o-i),n.elements[8]=(o+i)/(o-i),this.cameraL.projectionMatrix.copy(n),i=-a*t.aspect-r,o=a*t.aspect-r,n.elements[0]=2*t.near/(o-i),n.elements[8]=(o+i)/(o-i),this.cameraR.projectionMatrix.copy(n)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(al),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(rl)}}),Object.assign(Kr.prototype,{start:function(){this.oldTime=this.startTime=("undefined"===typeof performance?Date:performance).now(),this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.autoStart=this.running=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var t=("undefined"===typeof performance?Date:performance).now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}});var ol=new u,sl=new l,cl=new u,ll=new u;$r.prototype=Object.assign(Object.create(f.prototype),{constructor:$r,getInput:function(){return this.gain},removeFilter:function(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this},getFilter:function(){return this.filter},setFilter:function(e){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this},updateMatrixWorld:function(e){f.prototype.updateMatrixWorld.call(this,e),e=this.context.listener;var t=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(ol,sl,cl),ll.set(0,0,-1).applyQuaternion(sl),e.positionX){var n=this.context.currentTime+this.timeDelta;e.positionX.linearRampToValueAtTime(ol.x,n),e.positionY.linearRampToValueAtTime(ol.y,n),e.positionZ.linearRampToValueAtTime(ol.z,n),e.forwardX.linearRampToValueAtTime(ll.x,n),e.forwardY.linearRampToValueAtTime(ll.y,n),e.forwardZ.linearRampToValueAtTime(ll.z,n),e.upX.linearRampToValueAtTime(t.x,n),e.upY.linearRampToValueAtTime(t.y,n),e.upZ.linearRampToValueAtTime(t.z,n)}else e.setPosition(ol.x,ol.y,ol.z),e.setOrientation(ll.x,ll.y,ll.z,t.x,t.y,t.z)}}),ea.prototype=Object.assign(Object.create(f.prototype),{constructor:ea,getOutput:function(){return this.gain},setNodeSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this},setMediaElementSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this},setMediaStreamSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this},setBuffer:function(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(e){if(void 0===e&&(e=0),!0===this.isPlaying)console.warn("THREE.Audio: Audio is already playing.");else{if(!1!==this.hasPlaybackControl)return this._startedAt=this.context.currentTime+e,e=this.context.createBufferSource(),e.buffer=this.buffer,e.loop=this.loop,e.loopStart=this.loopStart,e.loopEnd=this.loopEnd,e.onended=this.onEnded.bind(this),e.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=e,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect();console.warn("THREE.Audio: this Audio has no playback control.")}},pause:function(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress%=this.duration||this.buffer.duration),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")},stop:function(){if(!1!==this.hasPlaybackControl)return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")},connect:function(){if(0<this.filters.length){this.source.connect(this.filters[0]);for(var e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(0<this.filters.length){this.source.disconnect(this.filters[0]);for(var e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(e){return e||(e=[]),!0===this.isPlaying?(this.disconnect(),this.filters=e,this.connect()):this.filters=e,this},setDetune:function(e){if(this.detune=e,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this},getDetune:function(){return this.detune},getFilter:function(){return this.getFilters()[0]},setFilter:function(e){return this.setFilters(e?[e]:[])},setPlaybackRate:function(e){if(!1!==this.hasPlaybackControl)return this.playbackRate=e,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(e){if(!1!==this.hasPlaybackControl)return this.loop=e,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")},setLoopStart:function(e){return this.loopStart=e,this},setLoopEnd:function(e){return this.loopEnd=e,this},getVolume:function(){return this.gain.gain.value},setVolume:function(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}});var ul=new u,hl=new l,dl=new u,pl=new u;ta.prototype=Object.assign(Object.create(ea.prototype),{constructor:ta,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(e){return this.panner.refDistance=e,this},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(e){return this.panner.rolloffFactor=e,this},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(e){return this.panner.distanceModel=e,this},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(e){return this.panner.maxDistance=e,this},setDirectionalCone:function(e,t,n){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=n,this},updateMatrixWorld:function(e){if(f.prototype.updateMatrixWorld.call(this,e),!0!==this.hasPlaybackControl||!1!==this.isPlaying)if(this.matrixWorld.decompose(ul,hl,dl),pl.set(0,0,1).applyQuaternion(hl),e=this.panner,e.positionX){var t=this.context.currentTime+this.listener.timeDelta;e.positionX.linearRampToValueAtTime(ul.x,t),e.positionY.linearRampToValueAtTime(ul.y,t),e.positionZ.linearRampToValueAtTime(ul.z,t),e.orientationX.linearRampToValueAtTime(pl.x,t),e.orientationY.linearRampToValueAtTime(pl.y,t),e.orientationZ.linearRampToValueAtTime(pl.z,t)}else e.setPosition(ul.x,ul.y,ul.z),e.setOrientation(pl.x,pl.y,pl.z)}}),Object.assign(na.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var e=0,t=this.getFrequencyData(),n=0;n<t.length;n++)e+=t[n];return e/t.length}}),Object.assign(ia.prototype,{accumulate:function(e,t){var n=this.buffer,i=this.valueSize;e=e*i+i;var r=this.cumulativeWeight;if(0===r){for(r=0;r!==i;++r)n[e+r]=n[r];r=t}else r+=t,this._mixBufferRegion(n,e,0,t/r,i);this.cumulativeWeight=r},accumulateAdditive:function(e){var t=this.buffer,n=this.valueSize,i=n*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(t,i,0,e,n),this.cumulativeWeightAdditive+=e},apply:function(e){var t=this.valueSize,n=this.buffer;e=e*t+t;var i=this.cumulativeWeight,r=this.cumulativeWeightAdditive,a=this.binding;for(this.cumulativeWeightAdditive=this.cumulativeWeight=0,1>i&&this._mixBufferRegion(n,e,t*this._origIndex,1-i,t),0<r&&this._mixBufferRegionAdditive(n,e,this._addIndex*t,1,t),i=t,r=t+t;i!==r;++i)if(n[i]!==n[i+t]){a.setValue(n,e);break}},saveOriginalState:function(){var e=this.buffer,t=this.valueSize,n=t*this._origIndex;this.binding.getValue(e,n);for(var i=t;i!==n;++i)e[i]=e[n+i%t];this._setIdentity(),this.cumulativeWeightAdditive=this.cumulativeWeight=0},restoreOriginalState:function(){this.binding.setValue(this.buffer,3*this.valueSize)},_setAdditiveIdentityNumeric:function(){for(var e=this._addIndex*this.valueSize,t=e+this.valueSize;e<t;e++)this.buffer[e]=0},_setAdditiveIdentityQuaternion:function(){this._setAdditiveIdentityNumeric(),this.buffer[4*this._addIndex+3]=1},_setAdditiveIdentityOther:function(){for(var e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize,n=0;n<this.valueSize;n++)this.buffer[t+n]=this.buffer[e+n]},_select:function(e,t,n,i,r){if(.5<=i)for(i=0;i!==r;++i)e[t+i]=e[n+i]},_slerp:function(e,t,n,i){l.slerpFlat(e,t,e,t,e,n,i)},_slerpAdditive:function(e,t,n,i,r){r*=this._workIndex,l.multiplyQuaternionsFlat(e,r,e,t,e,n),l.slerpFlat(e,t,e,t,e,r,i)},_lerp:function(e,t,n,i,r){for(var a=1-i,o=0;o!==r;++o){var s=t+o;e[s]=e[s]*a+e[n+o]*i}},_lerpAdditive:function(e,t,n,i,r){for(var a=0;a!==r;++a){var o=t+a;e[o]+=e[n+a]*i}}});var fl=/[\[\]\.:\/]/g,ml="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",gl=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),vl=/(WCOD+)?/.source.replace("WCOD",ml),yl=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),xl=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),bl=new RegExp("^"+gl+vl+yl+xl+"$"),wl=["material","materials","bones"];Object.assign(ra.prototype,{getValue:function(e,t){this.bind();var n=this._bindings[this._targetGroup.nCachedObjects_];void 0!==n&&n.getValue(e,t)},setValue:function(e,t){for(var n=this._bindings,i=this._targetGroup.nCachedObjects_,r=n.length;i!==r;++i)n[i].setValue(e,t)},bind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()},unbind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}),Object.assign(aa,{Composite:ra,create:function(e,t,n){return e&&e.isAnimationObjectGroup?new aa.Composite(e,t,n):new aa(e,t,n)},sanitizeNodeName:function(e){return e.replace(/\s/g,"_").replace(fl,"")},parseTrackName:function(e){var t=bl.exec(e);if(!t)throw Error("PropertyBinding: Cannot parse trackName: "+e);t={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]};var n=t.nodeName&&t.nodeName.lastIndexOf(".");if(void 0!==n&&-1!==n){var i=t.nodeName.substring(n+1);-1!==wl.indexOf(i)&&(t.nodeName=t.nodeName.substring(0,n),t.objectName=i)}if(null===t.propertyName||0===t.propertyName.length)throw Error("PropertyBinding: can not parse propertyName from trackName: "+e);return t},findNode:function(e,t){if(!t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){var n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){var i=function e(n){for(var i=0;i<n.length;i++){var r=n[i];if(r.name===t||r.uuid===t||(r=e(r.children)))return r}return null};if(e=i(e.children))return e}return null}}),Object.assign(aa.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(e,t){e[t]=this.node[this.propertyName]},function(e,t){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)e[t++]=n[i]},function(e,t){e[t]=this.resolvedProperty[this.propertyIndex]},function(e,t){this.resolvedProperty.toArray(e,t)}],SetterByBindingTypeAndVersioning:[[function(e,t){this.targetObject[this.propertyName]=e[t]},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=e[t++]},function(e,t){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=e[t++];this.targetObject.needsUpdate=!0},function(e,t){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty[this.propertyIndex]=e[t]},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty.fromArray(e,t)},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(e,t){this.bind(),this.getValue(e,t)},setValue:function(e,t){this.bind(),this.setValue(e,t)},bind:function(){var e=this.node,t=this.parsedPath,n=t.objectName,i=t.propertyName,r=t.propertyIndex;if(e||(this.node=e=aa.findNode(this.rootNode,t.nodeName)||this.rootNode),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,e){if(n){var a=t.objectIndex;switch(n){case"materials":if(!e.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);for(e=e.skeleton.bones,n=0;n<e.length;n++)if(e[n].name===a){a=n;break}break;default:if(void 0===e[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[n]}if(void 0!==a){if(void 0===e[a])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[a]}}if(a=e[i],void 0===a)console.error("THREE.PropertyBinding: Trying to update property for track: "+t.nodeName+"."+i+" but it wasn't found.",e);else{if(t=this.Versioning.None,this.targetObject=e,void 0!==e.needsUpdate?t=this.Versioning.NeedsUpdate:void 0!==e.matrixWorldNeedsUpdate&&(t=this.Versioning.MatrixWorldNeedsUpdate),n=this.BindingType.Direct,void 0!==r){if("morphTargetInfluences"===i){if(!e.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!e.geometry.isBufferGeometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",this);if(!e.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==e.morphTargetDictionary[r]&&(r=e.morphTargetDictionary[r])}n=this.BindingType.ArrayElement,this.resolvedProperty=a,this.propertyIndex=r}else void 0!==a.fromArray&&void 0!==a.toArray?(n=this.BindingType.HasFromToArray,this.resolvedProperty=a):Array.isArray(a)?(n=this.BindingType.EntireArray,this.resolvedProperty=a):this.propertyName=i;this.getValue=this.GetterByBindingType[n],this.setValue=this.SetterByBindingTypeAndVersioning[n][t]}}else console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.")},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),Object.assign(aa.prototype,{_getValue_unbound:aa.prototype.getValue,_setValue_unbound:aa.prototype.setValue}),Object.assign(oa.prototype,{isAnimationObjectGroup:!0,add:function(){for(var e=this._objects,t=this._indicesByUUID,n=this._paths,i=this._parsedPaths,r=this._bindings,a=r.length,o=void 0,s=e.length,c=this.nCachedObjects_,l=0,u=arguments.length;l!==u;++l){var h=arguments[l],d=h.uuid,p=t[d];if(void 0===p){p=s++,t[d]=p,e.push(h),p=0;for(var f=a;p!==f;++p)r[p].push(new aa(h,n[p],i[p]))}else if(p<c){o=e[p],f=--c;var m=e[f];for(t[m.uuid]=p,e[p]=m,t[d]=f,e[f]=h,d=0,m=a;d!==m;++d){var g=r[d],v=g[p];g[p]=g[f],void 0===v&&(v=new aa(h,n[d],i[d])),g[f]=v}}else e[p]!==o&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=c},remove:function(){for(var e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length,r=this.nCachedObjects_,a=0,o=arguments.length;a!==o;++a){var s=arguments[a],c=s.uuid,l=t[c];if(void 0!==l&&l>=r){var u=r++,h=e[u];for(t[h.uuid]=l,e[l]=h,t[c]=u,e[u]=s,s=0,c=i;s!==c;++s){h=n[s];var d=h[l];h[l]=h[u],h[u]=d}}}this.nCachedObjects_=r},uncache:function(){for(var e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length,r=this.nCachedObjects_,a=e.length,o=0,s=arguments.length;o!==s;++o){var c=arguments[o].uuid,l=t[c];if(void 0!==l)if(delete t[c],l<r){c=--r;var u=e[c],h=--a,d=e[h];for(t[u.uuid]=l,e[l]=u,t[d.uuid]=c,e[c]=d,e.pop(),u=0,d=i;u!==d;++u){var p=n[u],f=p[h];p[l]=p[c],p[c]=f,p.pop()}}else for(c=--a,h=e[c],t[h.uuid]=l,e[l]=h,e.pop(),h=0,u=i;h!==u;++h)d=n[h],d[l]=d[c],d.pop()}this.nCachedObjects_=r},subscribe_:function(e,t){var n=this._bindingsIndicesByPath,i=n[e],r=this._bindings;if(void 0!==i)return r[i];var a=this._paths,o=this._parsedPaths,s=this._objects,c=this.nCachedObjects_,l=Array(s.length);for(i=r.length,n[e]=i,a.push(e),o.push(t),r.push(l),n=c,i=s.length;n!==i;++n)l[n]=new aa(s[n],e,t);return l},unsubscribe_:function(e){var t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){var i=this._paths,r=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o];t[e[o]]=n,a[n]=s,a.pop(),r[n]=r[o],r.pop(),i[n]=i[o],i.pop()}}}),Object.assign(sa.prototype,{play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(e){return this._startTime=e,this},setLoop:function(e,t){return this.loop=e,this.repetitions=t,this},setEffectiveWeight:function(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(e){return this._scheduleFading(e,0,1)},fadeOut:function(e){return this._scheduleFading(e,1,0)},crossFadeFrom:function(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){n=this._clip.duration;var i=e._clip.duration,r=n/i;e.warp(1,i/n,t),this.warp(r,1,t)}return this},crossFadeTo:function(e,t,n){return e.crossFadeFrom(this,t,n)},stopFading:function(){var e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},setEffectiveTimeScale:function(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(e){return this.timeScale=this._clip.duration/e,this.stopWarping()},syncWith:function(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()},halt:function(e){return this.warp(this._effectiveTimeScale,0,e)},warp:function(e,t,n){var i=this._mixer,r=i.time,a=this.timeScale,o=this._timeScaleInterpolant;return null===o&&(this._timeScaleInterpolant=o=i._lendControlInterpolant()),i=o.parameterPositions,o=o.sampleValues,i[0]=r,i[1]=r+n,o[0]=e/a,o[1]=t/a,this},stopWarping:function(){var e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(e,t,n,i){if(this.enabled){var r=this._startTime;if(null!==r){if(t=(e-r)*n,0>t||0===n)return;this._startTime=null,t*=n}if(t*=this._updateTimeScale(e),n=this._updateTime(t),e=this._updateWeight(e),0<e)switch(t=this._interpolants,r=this._propertyBindings,this.blendMode){case 2501:i=0;for(var a=t.length;i!==a;++i)t[i].evaluate(n),r[i].accumulateAdditive(e);break;default:a=0;for(var o=t.length;a!==o;++a)t[a].evaluate(n),r[a].accumulate(i,e)}}else this._updateWeight(e)},_updateWeight:function(e){var t=0;if(this.enabled){t=this.weight;var n=this._weightInterpolant;if(null!==n){var i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=t},_updateTimeScale:function(e){var t=0;if(!this.paused){t=this.timeScale;var n=this._timeScaleInterpolant;if(null!==n){var i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t},_updateTime:function(e){var t=this._clip.duration,n=this.loop,i=this.time+e,r=this._loopCount,a=2202===n;if(0===e)return-1===r?i:a&&1===(1&r)?t-i:i;if(2200===n)e:{if(-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1)),i>=t)i=t;else{if(!(0>i)){this.time=i;break e}i=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:0>e?-1:1})}else{if(-1===r&&(0<=e?(r=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),i>=t||0>i){n=Math.floor(i/t),i-=t*n,r+=Math.abs(n);var o=this.repetitions-r;0>=o?(this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i=0<e?t:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:0<e?1:-1})):(1===o?(e=0>e,this._setEndings(e,!e,a)):this._setEndings(!1,!1,a),this._loopCount=r,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:n}))}else this.time=i;if(a&&1===(1&r))return t-i}return i},_setEndings:function(e,t,n){var i=this._interpolantSettings;n?(i.endingStart=2401,i.endingEnd=2401):(i.endingStart=e?this.zeroSlopeAtStart?2401:2400:2402,i.endingEnd=t?this.zeroSlopeAtEnd?2401:2400:2402)},_scheduleFading:function(e,t,n){var i=this._mixer,r=i.time,a=this._weightInterpolant;return null===a&&(this._weightInterpolant=a=i._lendControlInterpolant()),i=a.parameterPositions,a=a.sampleValues,i[0]=r,a[0]=t,i[1]=r+e,a[1]=n,this}}),ca.prototype=Object.assign(Object.create(t.prototype),{constructor:ca,_bindAction:function(e,t){var n=e._localRoot||this._root,i=e._clip.tracks,r=i.length,a=e._propertyBindings;e=e._interpolants;var o=n.uuid,s=this._bindingsByRootAndName,c=s[o];for(void 0===c&&(c={},s[o]=c),s=0;s!==r;++s){var l=i[s],u=l.name,h=c[u];if(void 0===h){if(h=a[s],void 0!==h){null===h._cacheIndex&&(++h.referenceCount,this._addInactiveBinding(h,o,u));continue}h=new ia(aa.create(n,u,t&&t._propertyBindings[s].binding.parsedPath),l.ValueTypeName,l.getValueSize()),++h.referenceCount,this._addInactiveBinding(h,o,u)}a[s]=h,e[s].resultBuffer=h.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){var t=(e._localRoot||this._root).uuid,n=e._clip.uuid,i=this._actionsByClip[n];this._bindAction(e,i&&i.knownActions[0]),this._addInactiveAction(e,n,t)}for(t=e._propertyBindings,n=0,i=t.length;n!==i;++n){var r=t[n];0===r.useCount++&&(this._lendBinding(r),r.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,n=0,i=t.length;n!==i;++n){var r=t[n];0===--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(e)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}},_isActiveAction:function(e){return e=e._cacheIndex,null!==e&&e<this._nActiveActions},_addInactiveAction:function(e,t,n){var i=this._actions,r=this._actionsByClip,a=r[t];void 0===a?(a={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,r[t]=a):(t=a.knownActions,e._byClipCacheIndex=t.length,t.push(e)),e._cacheIndex=i.length,i.push(e),a.actionByRoot[n]=e},_removeInactiveAction:function(e){var t=this._actions,n=t[t.length-1],i=e._cacheIndex;n._cacheIndex=i,t[i]=n,t.pop(),e._cacheIndex=null,t=e._clip.uuid,n=this._actionsByClip,i=n[t];var r=i.knownActions,a=r[r.length-1],o=e._byClipCacheIndex;a._byClipCacheIndex=o,r[o]=a,r.pop(),e._byClipCacheIndex=null,delete i.actionByRoot[(e._localRoot||this._root).uuid],0===r.length&&delete n[t],this._removeInactiveBindingsForAction(e)},_removeInactiveBindingsForAction:function(e){e=e._propertyBindings;for(var t=0,n=e.length;t!==n;++t){var i=e[t];0===--i.referenceCount&&this._removeInactiveBinding(i)}},_lendAction:function(e){var t=this._actions,n=e._cacheIndex,i=this._nActiveActions++,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r},_takeBackAction:function(e){var t=this._actions,n=e._cacheIndex,i=--this._nActiveActions,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r},_addInactiveBinding:function(e,t,n){var i=this._bindingsByRootAndName,r=this._bindings,a=i[t];void 0===a&&(a={},i[t]=a),a[n]=e,e._cacheIndex=r.length,r.push(e)},_removeInactiveBinding:function(e){var t=this._bindings,n=e.binding,i=n.rootNode.uuid;n=n.path;var r=this._bindingsByRootAndName,a=r[i],o=t[t.length-1];e=e._cacheIndex,o._cacheIndex=e,t[e]=o,t.pop(),delete a[n],0===Object.keys(a).length&&delete r[i]},_lendBinding:function(e){var t=this._bindings,n=e._cacheIndex,i=this._nActiveBindings++,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r},_takeBackBinding:function(e){var t=this._bindings,n=e._cacheIndex,i=--this._nActiveBindings,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r},_lendControlInterpolant:function(){var e=this._controlInterpolants,t=this._nActiveControlInterpolants++,n=e[t];return void 0===n&&(n=new zi(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),n.__cacheIndex=t,e[t]=n),n},_takeBackControlInterpolant:function(e){var t=this._controlInterpolants,n=e.__cacheIndex,i=--this._nActiveControlInterpolants,r=t[i];e.__cacheIndex=i,t[i]=e,r.__cacheIndex=n,t[n]=r},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(e,t,n){var i=t||this._root,r=i.uuid;i="string"===typeof e?Zi.findByName(i,e):e,e=null!==i?i.uuid:e;var a=this._actionsByClip[e],o=null;if(void 0===n&&(n=null!==i?i.blendMode:2500),void 0!==a){if(o=a.actionByRoot[r],void 0!==o&&o.blendMode===n)return o;o=a.knownActions[0],null===i&&(i=o._clip)}return null===i?null:(t=new sa(this,i,t,n),this._bindAction(t,o),this._addInactiveAction(t,e,r),t)},existingAction:function(e,t){var n=t||this._root;return t=n.uuid,n="string"===typeof e?Zi.findByName(n,e):e,e=this._actionsByClip[n?n.uuid:e],void 0!==e&&e.actionByRoot[t]||null},stopAllAction:function(){for(var e=this._actions,t=this._nActiveActions-1;0<=t;--t)e[t].stop();return this},update:function(e){e*=this.timeScale;for(var t=this._actions,n=this._nActiveActions,i=this.time+=e,r=Math.sign(e),a=this._accuIndex^=1,o=0;o!==n;++o)t[o]._update(i,e,r,a);for(e=this._bindings,t=this._nActiveBindings,n=0;n!==t;++n)e[n].apply(a);return this},setTime:function(e){for(var t=this.time=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)},getRoot:function(){return this._root},uncacheClip:function(e){var t=this._actions;e=e.uuid;var n=this._actionsByClip,i=n[e];if(void 0!==i){i=i.knownActions;for(var r=0,a=i.length;r!==a;++r){var o=i[r];this._deactivateAction(o);var s=o._cacheIndex,c=t[t.length-1];o._cacheIndex=null,o._byClipCacheIndex=null,c._cacheIndex=s,t[s]=c,t.pop(),this._removeInactiveBindingsForAction(o)}delete n[e]}},uncacheRoot:function(e){e=e.uuid;var t=this._actionsByClip;for(i in t){var n=t[i].actionByRoot[e];void 0!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}var i=this._bindingsByRootAndName[e];if(void 0!==i)for(var r in i)e=i[r],e.restoreOriginalState(),this._removeInactiveBinding(e)},uncacheAction:function(e,t){e=this.existingAction(e,t),null!==e&&(this._deactivateAction(e),this._removeInactiveAction(e))}}),la.prototype.clone=function(){return new la(void 0===this.value.clone?this.value:this.value.clone())},ua.prototype=Object.assign(Object.create(Kt.prototype),{constructor:ua,isInstancedInterleavedBuffer:!0,copy:function(e){return Kt.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this},clone:function(e){return e=Kt.prototype.clone.call(this,e),e.meshPerAttribute=this.meshPerAttribute,e},toJSON:function(e){return e=Kt.prototype.toJSON.call(this,e),e.isInstancedInterleavedBuffer=!0,e.meshPerAttribute=this.meshPerAttribute,e}}),Object.assign(ha.prototype,{set:function(e,t){this.ray.set(e,t)},setFromCamera:function(e,t){t&&t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t&&t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(e,t,n){return n=n||[],pa(e,this,n,t),n.sort(da),n},intersectObjects:function(e,t,n){if(n=n||[],!1===Array.isArray(e))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),n;for(var i=0,r=e.length;i<r;i++)pa(e[i],this,n,t);return n.sort(da),n}}),Object.assign(fa.prototype,{set:function(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this},makeSafe:function(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this},setFromVector3:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)},setFromCartesianCoords:function(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),0===this.radius?this.phi=this.theta=0:(this.theta=Math.atan2(e,n),this.phi=Math.acos(qa.clamp(t/this.radius,-1,1))),this}}),Object.assign(ma.prototype,{set:function(e,t,n){return this.radius=e,this.theta=t,this.y=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this},setFromVector3:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)},setFromCartesianCoords:function(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}});var _l=new n;Object.assign(ga.prototype,{set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(e,t){return t=_l.copy(t).multiplyScalar(.5),this.min.copy(e).sub(t),this.max.copy(e).add(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(e){return void 0===e&&(console.warn("THREE.Box2: .getCenter() target is now required"),e=new n),this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){return void 0===e&&(console.warn("THREE.Box2: .getSize() target is now required"),e=new n),this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y},getParameter:function(e,t){return void 0===t&&(console.warn("THREE.Box2: .getParameter() target is now required"),t=new n),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)},clampPoint:function(e,t){return void 0===t&&(console.warn("THREE.Box2: .clampPoint() target is now required"),t=new n),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(e){return _l.copy(e).clamp(this.min,this.max).sub(e).length()},intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}});var Ml=new u,Sl=new u;Object.assign(va.prototype,{set:function(e,t){return this.start.copy(e),this.end.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.start.copy(e.start),this.end.copy(e.end),this},getCenter:function(e){return void 0===e&&(console.warn("THREE.Line3: .getCenter() target is now required"),e=new u),e.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(e){return void 0===e&&(console.warn("THREE.Line3: .delta() target is now required"),e=new u),e.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(e,t){return void 0===t&&(console.warn("THREE.Line3: .at() target is now required"),t=new u),this.delta(t).multiplyScalar(e).add(this.start)},closestPointToPointParameter:function(e,t){return Ml.subVectors(e,this.start),Sl.subVectors(this.end,this.start),e=Sl.dot(Sl),e=Sl.dot(Ml)/e,t&&(e=qa.clamp(e,0,1)),e},closestPointToPoint:function(e,t,n){return e=this.closestPointToPointParameter(e,t),void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new u),this.delta(n).multiplyScalar(e).add(this.start)},applyMatrix4:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this},equals:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)}}),ya.prototype=Object.create(f.prototype),ya.prototype.constructor=ya,ya.prototype.isImmediateRenderObject=!0;var Tl=new u;xa.prototype=Object.create(f.prototype),xa.prototype.constructor=xa,xa.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},xa.prototype.update=function(){this.light.updateMatrixWorld();var e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),Tl.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Tl),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)};var El=new u,Al=new h,Ll=new h;wa.prototype=Object.create(hn.prototype),wa.prototype.constructor=wa,wa.prototype.isSkeletonHelper=!0,wa.prototype.updateMatrixWorld=function(e){var t=this.bones,n=this.geometry,i=n.getAttribute("position");Ll.getInverse(this.root.matrixWorld);for(var r=0,a=0;r<t.length;r++){var o=t[r];o.parent&&o.parent.isBone&&(Al.multiplyMatrices(Ll,o.matrixWorld),El.setFromMatrixPosition(Al),i.setXYZ(a,El.x,El.y,El.z),Al.multiplyMatrices(Ll,o.parent.matrixWorld),El.setFromMatrixPosition(Al),i.setXYZ(a+1,El.x,El.y,El.z),a+=2)}n.getAttribute("position").needsUpdate=!0,f.prototype.updateMatrixWorld.call(this,e)},_a.prototype=Object.create(H.prototype),_a.prototype.constructor=_a,_a.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},_a.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)};var Cl=new u,Rl=new _,Pl=new _;Ma.prototype=Object.create(f.prototype),Ma.prototype.constructor=Ma,Ma.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},Ma.prototype.update=function(){var e=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var t=e.geometry.getAttribute("color");Rl.copy(this.light.color),Pl.copy(this.light.groundColor);for(var n=0,i=t.count;n<i;n++){var r=n<i/2?Rl:Pl;t.setXYZ(n,r.r,r.g,r.b)}t.needsUpdate=!0}e.lookAt(Cl.setFromMatrixPosition(this.light.matrixWorld).negate())},Sa.prototype=Object.assign(Object.create(hn.prototype),{constructor:Sa,copy:function(e){return hn.prototype.copy.call(this,e),this.geometry.copy(e.geometry),this.material.copy(e.material),this},clone:function(){return(new this.constructor).copy(this)}}),Ta.prototype=Object.create(hn.prototype),Ta.prototype.constructor=Ta;var Ol=new u,Il=new u,Dl=new u;Ea.prototype=Object.create(f.prototype),Ea.prototype.constructor=Ea,Ea.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},Ea.prototype.update=function(){Ol.setFromMatrixPosition(this.light.matrixWorld),Il.setFromMatrixPosition(this.light.target.matrixWorld),Dl.subVectors(Il,Ol),this.lightPlane.lookAt(Il),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(Il),this.targetLine.scale.z=Dl.length()};var Nl=new u,Bl=new Z;Aa.prototype=Object.create(hn.prototype),Aa.prototype.constructor=Aa,Aa.prototype.update=function(){var e=this.geometry,t=this.pointMap;Bl.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),La("c",t,e,Bl,0,0,-1),La("t",t,e,Bl,0,0,1),La("n1",t,e,Bl,-1,-1,-1),La("n2",t,e,Bl,1,-1,-1),La("n3",t,e,Bl,-1,1,-1),La("n4",t,e,Bl,1,1,-1),La("f1",t,e,Bl,-1,-1,1),La("f2",t,e,Bl,1,-1,1),La("f3",t,e,Bl,-1,1,1),La("f4",t,e,Bl,1,1,1),La("u1",t,e,Bl,.7,1.1,-1),La("u2",t,e,Bl,-.7,1.1,-1),La("u3",t,e,Bl,0,2,-1),La("cf1",t,e,Bl,-1,0,1),La("cf2",t,e,Bl,1,0,1),La("cf3",t,e,Bl,0,-1,1),La("cf4",t,e,Bl,0,1,1),La("cn1",t,e,Bl,-1,0,-1),La("cn2",t,e,Bl,1,0,-1),La("cn3",t,e,Bl,0,-1,-1),La("cn4",t,e,Bl,0,1,-1),e.getAttribute("position").needsUpdate=!0};var Fl=new g;Ca.prototype=Object.create(hn.prototype),Ca.prototype.constructor=Ca,Ca.prototype.update=function(e){if(void 0!==e&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&Fl.setFromObject(this.object),!Fl.isEmpty()){e=Fl.min;var t=Fl.max,n=this.geometry.attributes.position,i=n.array;i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=e.x,i[4]=t.y,i[5]=t.z,i[6]=e.x,i[7]=e.y,i[8]=t.z,i[9]=t.x,i[10]=e.y,i[11]=t.z,i[12]=t.x,i[13]=t.y,i[14]=e.z,i[15]=e.x,i[16]=t.y,i[17]=e.z,i[18]=e.x,i[19]=e.y,i[20]=e.z,i[21]=t.x,i[22]=e.y,i[23]=e.z,n.needsUpdate=!0,this.geometry.computeBoundingSphere()}},Ca.prototype.setFromObject=function(e){return this.object=e,this.update(),this},Ca.prototype.copy=function(e){return hn.prototype.copy.call(this,e),this.object=e.object,this},Ca.prototype.clone=function(){return(new this.constructor).copy(this)},Ra.prototype=Object.create(hn.prototype),Ra.prototype.constructor=Ra,Ra.prototype.updateMatrixWorld=function(e){var t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),f.prototype.updateMatrixWorld.call(this,e))},Pa.prototype=Object.create(un.prototype),Pa.prototype.constructor=Pa,Pa.prototype.updateMatrixWorld=function(e){var t=-this.plane.constant;1e-8>Math.abs(t)&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=0>t?1:0,this.lookAt(this.plane.normal),f.prototype.updateMatrixWorld.call(this,e)};var Ul,zl,Gl=new u;Oa.prototype=Object.create(f.prototype),Oa.prototype.constructor=Oa,Oa.prototype.setDirection=function(e){.99999<e.y?this.quaternion.set(0,0,0,1):-.99999>e.y?this.quaternion.set(1,0,0,0):(Gl.set(e.z,0,-e.x).normalize(),this.quaternion.setFromAxisAngle(Gl,Math.acos(e.y)))},Oa.prototype.setLength=function(e,t,n){void 0===t&&(t=.2*e),void 0===n&&(n=.2*t),this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()},Oa.prototype.setColor=function(e){this.line.material.color.set(e),this.cone.material.color.set(e)},Oa.prototype.copy=function(e){return f.prototype.copy.call(this,e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this},Oa.prototype.clone=function(){return(new this.constructor).copy(this)},Ia.prototype=Object.create(hn.prototype),Ia.prototype.constructor=Ia;var kl=Math.pow(2,8),Hl=[.125,.215,.35,.446,.526,.582],jl=5+Hl.length,Vl={3e3:0,3001:1,3002:2,3004:3,3005:4,3006:5,3007:6},Wl=new Or,ql=function(){for(var e=[],t=[],n=[],i=8,r=0;r<jl;r++){var a=Math.pow(2,i);t.push(a);var o=1/a;4<r?o=Hl[r-8+4-1]:0==r&&(o=0),n.push(o),o=1/(a-1),a=-o/2,o=1+o/2;var s=[a,a,o,a,o,o,a,a,o,o,a,o];a=new Float32Array(108),o=new Float32Array(72);for(var c=new Float32Array(36),l=0;6>l;l++){var u=l%3*2/3-1,h=2<l?0:-1;a.set([u,h,0,u+2/3,h,0,u+2/3,h+1,0,u,h,0,u+2/3,h+1,0,u,h+1,0],18*l),o.set(s,12*l),c.set([l,l,l,l,l,l],6*l)}s=new k,s.setAttribute("position",new C(a,3)),s.setAttribute("uv",new C(o,2)),s.setAttribute("faceIndex",new C(c,1)),e.push(s),4<i&&i--}return{_lodPlanes:e,_sizeLods:t,_sigmas:n}}(),Yl=ql._lodPlanes,Xl=ql._sizeLods,Zl=ql._sigmas,Jl=null,Ql=(1+Math.sqrt(5))/2,Kl=1/Ql,$l=[new u(1,1,1),new u(-1,1,1),new u(1,1,-1),new u(-1,1,-1),new u(0,Ql,Kl),new u(0,Ql,-Kl),new u(Kl,0,Ql),new u(-Kl,0,Ql),new u(Ql,Kl,0),new u(-Ql,Kl,0)];Da.prototype={constructor:Da,fromScene:function(e,t,n,i){void 0===t&&(t=0),void 0===n&&(n=.1),void 0===i&&(i=100),Jl=this._renderer.getRenderTarget();var r=this._allocateTargets();return this._sceneToCubeUV(e,n,i,r),0<t&&this._blur(r,0,0,t),this._applyPMREM(r),this._cleanup(r),r},fromEquirectangular:function(e){return this._fromTexture(e)},fromCubemap:function(e){return this._fromTexture(e)},compileCubemapShader:function(){null===this._cubemapShader&&(this._cubemapShader=Ua(),this._compileMaterial(this._cubemapShader))},compileEquirectangularShader:function(){null===this._equirectShader&&(this._equirectShader=Fa(),this._compileMaterial(this._equirectShader))},dispose:function(){this._blurMaterial.dispose(),null!==this._cubemapShader&&this._cubemapShader.dispose(),null!==this._equirectShader&&this._equirectShader.dispose();for(var e=0;e<Yl.length;e++)Yl[e].dispose()},_cleanup:function(e){this._pingPongRenderTarget.dispose(),this._renderer.setRenderTarget(Jl),e.scissorTest=!1,Ba(e,0,0,e.width,e.height)},_fromTexture:function(e){Jl=this._renderer.getRenderTarget();var t=this._allocateTargets(e);return this._textureToCubeUV(e,t),this._applyPMREM(t),this._cleanup(t),t},_allocateTargets:function(e){var t=void 0!==e&&1009===e.type&&(3e3===e.encoding||3001===e.encoding||3007===e.encoding);t={magFilter:1003,minFilter:1003,generateMipmaps:!1,type:1009,format:1023,encoding:t?e.encoding:3002,depthBuffer:!1,stencilBuffer:!1};var n=Na(t);return n.depthBuffer=!e,this._pingPongRenderTarget=Na(t),n},_compileMaterial:function(e){e=new H(Yl[0],e),this._renderer.compile(e,Wl)},_sceneToCubeUV:function(e,t,n,i){t=new J(90,1,t,n),n=[1,-1,1,1,1,1];var r=[1,1,1,-1,-1,-1],a=this._renderer,o=a.outputEncoding,s=a.toneMapping,c=a.getClearColor(),l=a.getClearAlpha();a.toneMapping=0,a.outputEncoding=3e3;var u=e.background;if(u&&u.isColor){u.convertSRGBToLinear();var h=Math.min(Math.max(Math.ceil(Math.log2(Math.max(u.r,u.g,u.b))),-128),127);u=u.multiplyScalar(Math.pow(2,-h)),a.setClearColor(u,(h+128)/255),e.background=null}for(u=0;6>u;u++)h=u%3,0==h?(t.up.set(0,n[u],0),t.lookAt(r[u],0,0)):1==h?(t.up.set(0,0,n[u]),t.lookAt(0,r[u],0)):(t.up.set(0,n[u],0),t.lookAt(0,0,r[u])),Ba(i,h*kl,2<u?kl:0,kl,kl),a.setRenderTarget(i),a.render(e,t);a.toneMapping=s,a.outputEncoding=o,a.setClearColor(c,l)},_textureToCubeUV:function(e,t){var n=this._renderer;e.isCubeTexture?null==this._cubemapShader&&(this._cubemapShader=Ua()):null==this._equirectShader&&(this._equirectShader=Fa());var i=e.isCubeTexture?this._cubemapShader:this._equirectShader,r=new H(Yl[0],i);i=i.uniforms,i.envMap.value=e,e.isCubeTexture||i.texelSize.value.set(1/e.image.width,1/e.image.height),i.inputEncoding.value=Vl[e.encoding],i.outputEncoding.value=Vl[t.texture.encoding],Ba(t,0,0,3*kl,2*kl),n.setRenderTarget(t),n.render(r,Wl)},_applyPMREM:function(e){var t=this._renderer,n=t.autoClear;t.autoClear=!1;for(var i=1;i<jl;i++)this._blur(e,i-1,i,Math.sqrt(Zl[i]*Zl[i]-Zl[i-1]*Zl[i-1]),$l[(i-1)%$l.length]);t.autoClear=n},_blur:function(e,t,n,i,r){var a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,i,"latitudinal",r),this._halfBlur(a,e,n,n,i,"longitudinal",r)},_halfBlur:function(e,t,n,i,r,a,o){var s=this._renderer,c=this._blurMaterial;"latitudinal"!==a&&"longitudinal"!==a&&console.error("blur direction must be either latitudinal or longitudinal!");var l=new H(Yl[i],c);c=c.uniforms;var u=Xl[n]-1;u=isFinite(r)?Math.PI/(2*u):2*Math.PI/39;var h=r/u,d=isFinite(r)?1+Math.floor(3*h):20;20<d&&console.warn("sigmaRadians, "+r+", is too large and will clip, as it requested "+d+" samples when the maximum is set to 20"),r=[];for(var p=0,f=0;20>f;++f){var m=f/h;m=Math.exp(-m*m/2),r.push(m),0==f?p+=m:f<d&&(p+=2*m)}for(h=0;h<r.length;h++)r[h]/=p;c.envMap.value=e.texture,c.samples.value=d,c.weights.value=r,c.latitudinal.value="latitudinal"===a,o&&(c.poleAxis.value=o),c.dTheta.value=u,c.mipInt.value=8-n,c.inputEncoding.value=Vl[e.texture.encoding],c.outputEncoding.value=Vl[e.texture.encoding],e=Xl[i],Ba(t,3*Math.max(0,kl-2*e),(0===i?0:2*kl)+2*e*(4<i?i-8+4:0),3*e,2*e),s.setRenderTarget(t),s.render(l,Wl)}},sr.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(sr.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},Object.assign(_r.prototype,{createPointsGeometry:function(e){return console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead."),e=this.getPoints(e),this.createGeometry(e)},createSpacedPointsGeometry:function(e){return console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead."),e=this.getSpacedPoints(e),this.createGeometry(e)},createGeometry:function(e){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var t=new W,n=0,i=e.length;n<i;n++){var r=e[n];t.vertices.push(new u(r.x,r.y,r.z||0))}return t}}),Object.assign(Mr.prototype,{fromPoints:function(e){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)}}),ka.prototype=Object.create(hr.prototype),Ha.prototype=Object.create(hr.prototype),ja.prototype=Object.create(hr.prototype),Object.assign(ja.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),Sa.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},wa.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign($i.prototype,{extractUrlBase:function(e){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),Qc.extractUrlBase(e)}}),$i.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},Object.assign(jr.prototype,{setTexturePath:function(e){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}}),Object.assign(ga.prototype,{center:function(e){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},size:function(e){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(e)}}),Object.assign(g.prototype,{center:function(e){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionSphere:function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},size:function(e){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(e)}}),Object.assign(y.prototype,{empty:function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()}}),ee.prototype.setFromMatrix=function(e){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(e)},va.prototype.center=function(e){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(e)},Object.assign(qa,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(e){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),qa.floorPowerOfTwo(e)},nextPowerOfTwo:function(e){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),qa.ceilPowerOfTwo(e)}}),Object.assign(i.prototype,{flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},multiplyVector3:function(e){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(h.prototype,{extractPosition:function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},getPosition:function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new u).setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(e){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector4:function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},crossVector:function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(e,t,n,i,r,a){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,i,n,r,a)}}),b.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},l.prototype.multiplyVector3=function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},Object.assign(x.prototype,{isIntersectionBox:function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionPlane:function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},isIntersectionSphere:function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)}}),Object.assign(w.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(e,t){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(e,t)},midpoint:function(e){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(e)},normal:function(e){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(e)},plane:function(e){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(e)}}),Object.assign(w,{barycoordFromPoint:function(e,t,n,i,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),w.getBarycoord(e,t,n,i,r)},normal:function(e,t,n,i){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),w.getNormal(e,t,n,i)}}),Object.assign(Sr.prototype,{extractAllPoints:function(e){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(e)},extrude:function(e){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new oi(this,e)},makeGeometry:function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new vi(this,e)}}),Object.assign(n.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(u.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},getScaleFromMatrix:function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},getColumnFromMatrix:function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},applyProjection:function(e){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(e)},fromAttribute:function(e,t,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(o.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(W.prototype,{computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")},applyMatrix:function(e){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.assign(f.prototype,{getChildByName:function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},applyMatrix:function(e){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(f.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(e){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=e}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.assign(H.prototype,{setDrawMode:function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}),Object.defineProperties(H.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),0},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Object.defineProperties(rn.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(on.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),an.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(sr.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(e){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=e}}),J.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(Tr.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(e){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(e){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=e}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(e){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=e}}}),Object.defineProperties(C.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),35048===this.usage},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(35048)}}}),Object.assign(C.prototype,{setDynamic:function(e){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?35048:35044),this},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},setArray:function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(k.prototype,{addIndex:function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},addAttribute:function(e,t,n){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):this.setAttribute(e,t):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(e,new C(t,n)))},addDrawCall:function(e,t,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},removeAttribute:function(e){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(e)},applyMatrix:function(e){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(k.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(Gr.prototype,{maxInstancedCount:{get:function(){return console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount},set:function(e){console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount=e}}}),Object.defineProperties(ha.prototype,{linePrecision:{get:function(){return console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold},set:function(e){console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold=e}}}),Object.defineProperties(Kt.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),35048===this.usage},set:function(e){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(e)}}}),Object.assign(Kt.prototype,{setDynamic:function(e){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?35048:35044),this},setArray:function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(si.prototype,{getArrays:function(){console.error("THREE.ExtrudeBufferGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeBufferGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeBufferGeometry: .addShape() has been removed.")}}),Object.defineProperties(la.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(A.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new _}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===e}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(e){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=e}}}),Object.defineProperties(Pi.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(X.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(e){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=e}}}),Object.assign(Xt.prototype,{clearTarget:function(e,t,n,i){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(e),this.clear(t,n,i)},animate:function(e){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(e)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},allocTextureUnit:function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},setTexture2D:function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},setTextureCube:function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},getActiveMipMapLevel:function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()}}),Object.defineProperties(Xt.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(e){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===e?3001:3e3}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}}}),Object.defineProperties(zt.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(s.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=e}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=e}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=e}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=e}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(e){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=e}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(e){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=e}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(e){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=e}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(e){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=e}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(e){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=e}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(e){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=e}}}),Object.defineProperties(ea.prototype,{load:{value:function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var t=this;return(new Xr).load(e,(function(e){t.setBuffer(e)})),this}},startTime:{set:function(){console.warn("THREE.Audio: .startTime is now .play( delay ).")}}}),na.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},Q.prototype.updateCubeMap=function(e,t){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(e,t)},Xa.crossOrigin=void 0,Xa.loadTexture=function(e,t,n,i){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var r=new or;return r.setCrossOrigin(this.crossOrigin),e=r.load(e,n,void 0,i),t&&(e.mapping=t),e},Xa.loadTextureCube=function(e,t,n,i){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var r=new ar;return r.setCrossOrigin(this.crossOrigin),e=r.load(e,n,void 0,i),t&&(e.mapping=t),e},Xa.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},Xa.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"118dev"}})),e.ACESFilmicToneMapping=4,e.AddEquation=100,e.AddOperation=2,e.AdditiveAnimationBlendMode=2501,e.AdditiveBlending=2,e.AlphaFormat=1021,e.AlwaysDepth=1,e.AlwaysStencilFunc=519,e.AmbientLight=Nr,e.AmbientLightProbe=Jr,e.AnimationClip=Zi,e.AnimationLoader=tr,e.AnimationMixer=ca,e.AnimationObjectGroup=oa,e.AnimationUtils=Hc,e.ArcCurve=lr,e.ArrayCamera=jt,e.ArrowHelper=Oa,e.Audio=ea,e.AudioAnalyser=na,e.AudioContext=il,e.AudioListener=$r,e.AudioLoader=Xr,e.AxesHelper=Ia,e.AxisHelper=function(e){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new Ia(e)},e.BackSide=1,e.BasicDepthPacking=3200,e.BasicShadowMap=0,e.BinaryTextureLoader=function(e){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new ir(e)},e.Bone=sn,e.BooleanKeyframeTrack=Hi,e.BoundingBoxHelper=function(e,t){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new Ca(e,t)},e.Box2=ga,e.Box3=g,e.Box3Helper=Ra,e.BoxBufferGeometry=Bs,e.BoxGeometry=Ns,e.BoxHelper=Ca,e.BufferAttribute=C,e.BufferGeometry=k,e.BufferGeometryLoader=Hr,e.ByteType=1010,e.Cache=jc,e.Camera=Z,e.CameraHelper=Aa,e.CanvasRenderer=function(){console.error("THREE.CanvasRenderer has been removed")},e.CanvasTexture=yn,e.CatmullRomCurve3=hr,e.CineonToneMapping=3,e.CircleBufferGeometry=Ei,e.CircleGeometry=Ti,e.ClampToEdgeWrapping=1001,e.Clock=Kr,e.ClosedSplineCurve3=ka,e.Color=_,e.ColorKeyframeTrack=ji,e.CompressedTexture=vn,e.CompressedTextureLoader=nr,e.ConeBufferGeometry=Si,e.ConeGeometry=Mi,e.CubeCamera=Q,e.CubeGeometry=Ns,e.CubeReflectionMapping=301,e.CubeRefractionMapping=302,e.CubeTexture=ye,e.CubeTextureLoader=ar,e.CubeUVReflectionMapping=306,e.CubeUVRefractionMapping=307,e.CubicBezierCurve=mr,e.CubicBezierCurve3=gr,e.CubicInterpolant=Ui,e.CullFaceBack=1,e.CullFaceFront=2,e.CullFaceFrontBack=3,e.CullFaceNone=0,e.Curve=sr,e.CurvePath=_r,e.CustomBlending=5,e.CustomToneMapping=5,e.CylinderBufferGeometry=_i,e.CylinderGeometry=wi,e.Cylindrical=ma,e.DataTexture=$,e.DataTexture2DArray=xe,e.DataTexture3D=be,e.DataTextureLoader=ir,e.DecrementStencilOp=7683,e.DecrementWrapStencilOp=34056,e.DefaultLoadingManager=Vc,e.DepthFormat=1026,e.DepthStencilFormat=1027,e.DepthTexture=xn,e.DirectionalLight=Dr,e.DirectionalLightHelper=Ea,e.DirectionalLightShadow=Ir,e.DiscreteInterpolant=Gi,e.DodecahedronBufferGeometry=On,e.DodecahedronGeometry=Pn,e.DoubleSide=2,e.DstAlphaFactor=206,e.DstColorFactor=208,e.DynamicBufferAttribute=function(e,t){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),new C(e,t).setUsage(35048)},e.DynamicCopyUsage=35050,e.DynamicDrawUsage=35048,e.DynamicReadUsage=35049,e.EdgesGeometry=bi,e.EdgesHelper=function(e,t){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new hn(new bi(e.geometry),new ln({color:void 0!==t?t:16777215}))},e.EllipseCurve=cr,e.EqualDepth=4,e.EqualStencilFunc=514,e.EquirectangularReflectionMapping=303,e.EquirectangularRefractionMapping=304,e.Euler=d,e.EventDispatcher=t,e.ExtrudeBufferGeometry=si,e.ExtrudeGeometry=oi,e.Face3=E,e.Face4=function(e,t,n,i,r,a,o){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new E(e,t,n,r,a,o)},e.FaceColors=1,e.FileLoader=er,e.FlatShading=1,e.Float32Attribute=function(e,t){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new F(e,t)},e.Float32BufferAttribute=F,e.Float64Attribute=function(e,t){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new U(e,t)},e.Float64BufferAttribute=U,e.FloatType=1015,e.Fog=Qt,e.FogExp2=Jt,e.Font=qr,e.FontLoader=Yr,e.FrontFaceDirectionCCW=1,e.FrontFaceDirectionCW=0,e.FrontSide=0,e.Frustum=ee,e.GammaEncoding=3007,e.Geometry=W,e.GeometryUtils={merge:function(e,t,n){if(console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),t.isMesh){t.matrixAutoUpdate&&t.updateMatrix();var i=t.matrix;t=t.geometry}e.merge(t,i,n)},center:function(e){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),e.center()}},e.GreaterDepth=6,e.GreaterEqualDepth=5,e.GreaterEqualStencilFunc=518,e.GreaterStencilFunc=516,e.GridHelper=Sa,e.Group=Vt,e.HalfFloatType=1016,e.HemisphereLight=Er,e.HemisphereLightHelper=Ma,e.HemisphereLightProbe=Zr,e.IcosahedronBufferGeometry=Rn,e.IcosahedronGeometry=Cn,e.ImageBitmapLoader=Vr,e.ImageLoader=rr,e.ImageUtils=Xa,e.ImmediateRenderObject=ya,e.IncrementStencilOp=7682,e.IncrementWrapStencilOp=34055,e.InstancedBufferAttribute=kr,e.InstancedBufferGeometry=Gr,e.InstancedInterleavedBuffer=ua,e.InstancedMesh=cn,e.Int16Attribute=function(e,t){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new I(e,t)},e.Int16BufferAttribute=I,e.Int32Attribute=function(e,t){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new N(e,t)},e.Int32BufferAttribute=N,e.Int8Attribute=function(e,t){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new R(e,t)},e.Int8BufferAttribute=R,e.IntType=1013,e.InterleavedBuffer=Kt,e.InterleavedBufferAttribute=$t,e.Interpolant=Fi,e.InterpolateDiscrete=2300,e.InterpolateLinear=2301,e.InterpolateSmooth=2302,e.InvertStencilOp=5386,e.JSONLoader=function(){console.error("THREE.JSONLoader has been removed.")},e.KeepStencilOp=7680,e.KeyframeTrack=ki,e.LOD=rn,e.LatheBufferGeometry=gi,e.LatheGeometry=mi,e.Layers=p,e.LensFlare=function(){console.error("THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js")},e.LessDepth=2,e.LessEqualDepth=3,e.LessEqualStencilFunc=515,e.LessStencilFunc=513,e.Light=Tr,e.LightProbe=Ur,e.LightShadow=Ar,e.Line=un,e.Line3=va,e.LineBasicMaterial=ln,e.LineCurve=vr,e.LineCurve3=yr,e.LineDashedMaterial=Bi,e.LineLoop=dn,e.LinePieces=1,e.LineSegments=hn,e.LineStrip=0,e.LinearEncoding=3e3,e.LinearFilter=1006,e.LinearInterpolant=zi,e.LinearMipMapLinearFilter=1008,e.LinearMipMapNearestFilter=1007,e.LinearMipmapLinearFilter=1008,e.LinearMipmapNearestFilter=1007,e.LinearToneMapping=1,e.Loader=$i,e.LoaderUtils=Qc,e.LoadingManager=Ki,e.LogLuvEncoding=3003,e.LoopOnce=2200,e.LoopPingPong=2202,e.LoopRepeat=2201,e.LuminanceAlphaFormat=1025,e.LuminanceFormat=1024,e.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},e.Material=A,e.MaterialLoader=zr,e.Math=qa,e.MathUtils=qa,e.Matrix3=i,e.Matrix4=h,e.MaxEquation=104,e.Mesh=H,e.MeshBasicMaterial=L,e.MeshDepthMaterial=Ft,e.MeshDistanceMaterial=Ut,e.MeshFaceMaterial=function(e){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),e},e.MeshLambertMaterial=Di,e.MeshMatcapMaterial=Ni,e.MeshNormalMaterial=Ii,e.MeshPhongMaterial=Pi,e.MeshPhysicalMaterial=Ri,e.MeshStandardMaterial=Ci,e.MeshToonMaterial=Oi,e.MinEquation=103,e.MirroredRepeatWrapping=1002,e.MixOperation=1,e.MultiMaterial=function(e){return void 0===e&&(e=[]),console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),e.isMultiMaterial=!0,e.materials=e,e.clone=function(){return e.slice()},e},e.MultiplyBlending=4,e.MultiplyOperation=0,e.NearestFilter=1003,e.NearestMipMapLinearFilter=1005,e.NearestMipMapNearestFilter=1004,e.NearestMipmapLinearFilter=1005,e.NearestMipmapNearestFilter=1004,e.NeverDepth=0,e.NeverStencilFunc=512,e.NoBlending=0,e.NoColors=0,e.NoToneMapping=0,e.NormalAnimationBlendMode=2500,e.NormalBlending=1,e.NotEqualDepth=7,e.NotEqualStencilFunc=517,e.NumberKeyframeTrack=Vi,e.Object3D=f,e.ObjectLoader=jr,e.ObjectSpaceNormalMap=1,e.OctahedronBufferGeometry=Ln,e.OctahedronGeometry=An,e.OneFactor=201,e.OneMinusDstAlphaFactor=207,e.OneMinusDstColorFactor=209,e.OneMinusSrcAlphaFactor=205,e.OneMinusSrcColorFactor=203,e.OrthographicCamera=Or,e.PCFShadowMap=1,e.PCFSoftShadowMap=2,e.PMREMGenerator=Da,e.ParametricBufferGeometry=_n,e.ParametricGeometry=wn,e.Particle=function(e){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new tn(e)},e.ParticleBasicMaterial=function(e){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new pn(e)},e.ParticleSystem=function(e,t){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new fn(e,t)},e.ParticleSystemMaterial=function(e){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new pn(e)},e.Path=Mr,e.PerspectiveCamera=J,e.Plane=b,e.PlaneBufferGeometry=re,e.PlaneGeometry=ie,e.PlaneHelper=Pa,e.PointCloud=function(e,t){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new fn(e,t)},e.PointCloudMaterial=function(e){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new pn(e)},e.PointLight=Pr,e.PointLightHelper=_a,e.Points=fn,e.PointsMaterial=pn,e.PolarGridHelper=Ta,e.PolyhedronBufferGeometry=Sn,e.PolyhedronGeometry=Mn,e.PositionalAudio=ta,e.PropertyBinding=aa,e.PropertyMixer=ia,e.QuadraticBezierCurve=xr,e.QuadraticBezierCurve3=br,e.Quaternion=l,e.QuaternionKeyframeTrack=qi,e.QuaternionLinearInterpolant=Wi,e.REVISION="118dev",e.RGBADepthPacking=3201,e.RGBAFormat=1023,e.RGBAIntegerFormat=1033,e.RGBA_ASTC_10x10_Format=37819,e.RGBA_ASTC_10x5_Format=37816,e.RGBA_ASTC_10x6_Format=37817,e.RGBA_ASTC_10x8_Format=37818,e.RGBA_ASTC_12x10_Format=37820,e.RGBA_ASTC_12x12_Format=37821,e.RGBA_ASTC_4x4_Format=37808,e.RGBA_ASTC_5x4_Format=37809,e.RGBA_ASTC_5x5_Format=37810,e.RGBA_ASTC_6x5_Format=37811,e.RGBA_ASTC_6x6_Format=37812,e.RGBA_ASTC_8x5_Format=37813,e.RGBA_ASTC_8x6_Format=37814,e.RGBA_ASTC_8x8_Format=37815,e.RGBA_BPTC_Format=36492,e.RGBA_ETC2_EAC_Format=37496,e.RGBA_PVRTC_2BPPV1_Format=35843,e.RGBA_PVRTC_4BPPV1_Format=35842,e.RGBA_S3TC_DXT1_Format=33777,e.RGBA_S3TC_DXT3_Format=33778,e.RGBA_S3TC_DXT5_Format=33779,e.RGBDEncoding=3006,e.RGBEEncoding=3002,e.RGBEFormat=1023,e.RGBFormat=1022,e.RGBIntegerFormat=1032,e.RGBM16Encoding=3005,e.RGBM7Encoding=3004,e.RGB_ETC1_Format=36196,e.RGB_ETC2_Format=37492,e.RGB_PVRTC_2BPPV1_Format=35841,e.RGB_PVRTC_4BPPV1_Format=35840,e.RGB_S3TC_DXT1_Format=33776,e.RGFormat=1030,e.RGIntegerFormat=1031,e.RawShaderMaterial=Li,e.Ray=x,e.Raycaster=ha,e.RectAreaLight=Br,e.RedFormat=1028,e.RedIntegerFormat=1029,e.ReinhardToneMapping=2,e.RepeatWrapping=1e3,e.ReplaceStencilOp=7681,e.ReverseSubtractEquation=102,e.RingBufferGeometry=fi,e.RingGeometry=pi,e.SRGB8_ALPHA8_ASTC_10x10_Format=37851,e.SRGB8_ALPHA8_ASTC_10x5_Format=37848,e.SRGB8_ALPHA8_ASTC_10x6_Format=37849,e.SRGB8_ALPHA8_ASTC_10x8_Format=37850,e.SRGB8_ALPHA8_ASTC_12x10_Format=37852,e.SRGB8_ALPHA8_ASTC_12x12_Format=37853,e.SRGB8_ALPHA8_ASTC_4x4_Format=37840,e.SRGB8_ALPHA8_ASTC_5x4_Format=37841,e.SRGB8_ALPHA8_ASTC_5x5_Format=37842,e.SRGB8_ALPHA8_ASTC_6x5_Format=37843,e.SRGB8_ALPHA8_ASTC_6x6_Format=37844,e.SRGB8_ALPHA8_ASTC_8x5_Format=37845,e.SRGB8_ALPHA8_ASTC_8x6_Format=37846,e.SRGB8_ALPHA8_ASTC_8x8_Format=37847,e.Scene=m,e.SceneUtils={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")}},e.ShaderChunk=ks,e.ShaderLib=Hs,e.ShaderMaterial=X,e.ShadowMaterial=Ai,e.Shape=Sr,e.ShapeBufferGeometry=yi,e.ShapeGeometry=vi,e.ShapePath=Wr,e.ShapeUtils=Uc,e.ShortType=1011,e.Skeleton=on,e.SkeletonHelper=wa,e.SkinnedMesh=an,e.SmoothShading=2,e.Sphere=y,e.SphereBufferGeometry=di,e.SphereGeometry=hi,e.Spherical=fa,e.SphericalHarmonics3=Fr,e.Spline=ja,e.SplineCurve=wr,e.SplineCurve3=Ha,e.SpotLight=Cr,e.SpotLightHelper=xa,e.SpotLightShadow=Lr,e.Sprite=tn,e.SpriteMaterial=en,e.SrcAlphaFactor=204,e.SrcAlphaSaturateFactor=210,e.SrcColorFactor=202,e.StaticCopyUsage=35046,e.StaticDrawUsage=35044,e.StaticReadUsage=35045,e.StereoCamera=Qr,e.StreamCopyUsage=35042,e.StreamDrawUsage=35040,e.StreamReadUsage=35041,e.StringKeyframeTrack=Yi,e.SubtractEquation=101,e.SubtractiveBlending=3,e.TOUCH={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},e.TangentSpaceNormalMap=0,e.TetrahedronBufferGeometry=En,e.TetrahedronGeometry=Tn,e.TextBufferGeometry=ui,e.TextGeometry=li,e.Texture=r,e.TextureLoader=or,e.TorusBufferGeometry=Un,e.TorusGeometry=Fn,e.TorusKnotBufferGeometry=Bn,e.TorusKnotGeometry=Nn,e.Triangle=w,e.TriangleFanDrawMode=2,e.TriangleStripDrawMode=1,e.TrianglesDrawMode=0,e.TubeBufferGeometry=Dn,e.TubeGeometry=In,e.UVMapping=300,e.Uint16Attribute=function(e,t){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new D(e,t)},e.Uint16BufferAttribute=D,e.Uint32Attribute=function(e,t){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new B(e,t)},e.Uint32BufferAttribute=B,e.Uint8Attribute=function(e,t){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new P(e,t)},e.Uint8BufferAttribute=P,e.Uint8ClampedAttribute=function(e,t){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new O(e,t)},e.Uint8ClampedBufferAttribute=O,e.Uniform=la,e.UniformsLib=Gs,e.UniformsUtils=Fs,e.UnsignedByteType=1009,e.UnsignedInt248Type=1020,e.UnsignedIntType=1014,e.UnsignedShort4444Type=1017,e.UnsignedShort5551Type=1018,e.UnsignedShort565Type=1019,e.UnsignedShortType=1012,e.VSMShadowMap=3,e.Vector2=n,e.Vector3=u,e.Vector4=o,e.VectorKeyframeTrack=Xi,e.Vertex=function(e,t,n){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new u(e,t,n)},e.VertexColors=2,e.VideoTexture=gn,e.WebGL1Renderer=Zt,e.WebGLCubeRenderTarget=K,e.WebGLMultisampleRenderTarget=c,e.WebGLRenderTarget=s,e.WebGLRenderTargetCube=function(e,t,n){return console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."),new K(e,n)},e.WebGLRenderer=Xt,e.WebGLUtils=Ht,e.WireframeGeometry=bn,e.WireframeHelper=function(e,t){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new hn(new bn(e.geometry),new ln({color:void 0!==t?t:16777215}))},e.WrapAroundEnding=2402,e.XHRLoader=function(e){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new er(e)},e.ZeroCurvatureEnding=2400,e.ZeroFactor=200,e.ZeroSlopeEnding=2401,e.ZeroStencilOp=0,e.sRGBEncoding=3001,Object.defineProperty(e,"__esModule",{value:!0})}));var o=window.THREE,s={name:"ComStarAnimate",mounted:function(){},methods:{handleInitBgAnimate:function(){var e=0,t=document.getElementById("animateBg");t.width=window.innerWidth,t.height=window.innerHeight;var n=new o.WebGLRenderer({canvas:t,alpha:!0}),i=new o.Scene;i.fog=new o.Fog(11184810,50,2e3);for(var r=new o.PerspectiveCamera(70,1e3),a=new o.Geometry,s=0;s<6e3;s++){var c=new o.Vector3;c.x=o.Math.randFloatSpread(2e3),c.y=o.Math.randFloatSpread(2e3),c.z=o.Math.randFloatSpread(2e3),a.vertices.push(c)}var l=new o.PointsMaterial({color:16777215}),u=new o.Points(a,l);function h(){e+=.1;var t=e*Math.PI/180;r.position.x=1e3*Math.sin(t),r.position.z=1e3*Math.cos(t),r.lookAt(new o.Vector3(0,0,0)),n.render(i,r),requestAnimationFrame(h)}function d(){var e=window.innerWidth,t=window.innerHeight;n.setPixelRatio(window.devicePixelRatio),n.setSize(e,t),r.aspect=e/t,r.updateProjectionMatrix()}i.add(u),h(),window.addEventListener("resize",d),d()}}},c=s,l=(n("83d6"),n("2877")),u=Object(l["a"])(c,i,r,!1,null,"bb1e091e",null);t["default"]=u.exports},"0e02":function(e,t,n){"use strict";var i=n("6f26"),r=n.n(i);r.a},1:function(e,t){},10:function(e,t){},11:function(e,t){},12:function(e,t){},13:function(e,t){},"13ff":function(e,t,n){"use strict";n.r(t);var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"show",rawName:"v-show",value:e.goodsMask.show,expression:"goodsMask.show"}],staticClass:"goods-mask"},[n("div",{staticClass:"goods-mask-warp"},[n("div",{staticClass:"goods-mask-title"},[e._v("\n "+e._s(e.$t("common.congratulationsGet"))+" "+e._s("zh-cn"===e.$i18n.locale?e.goodsMask.info.title:e.goodsMask.info.title_en)+" "+e._s(e.$t("common.card"))+"\n "),n("div",{staticClass:"close-btn",on:{click:e.handleCloseGoodsMask}})]),e._v(" "),n("p",{staticClass:"goods-mask-num"},[e._v(e._s(e.$t("common.total")))]),e._v(" "),n("img",{staticClass:"card-img animate__flip animate__animated",attrs:{src:e.imgSite+e.goodsMask.info.pic}}),e._v(" "),n("div",{staticClass:"go-btn",on:{click:e.handleGoTo}},[e._v("\n "+e._s(e.$t("common.staking"))+">\n ")])])])},r=[],a=(n("8e6e"),n("ac6a"),n("456d"),n("ade3")),o=n("2f62");function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){Object(a["a"])(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var l={name:"GoodsMask",computed:c({},Object(o["b"])(["goodsMask"])),methods:{handleCloseGoodsMask:function(){this.$store.dispatch("goodsMask/setMaskInfo",{show:!1,info:{}})},handleGoTo:function(){this.handleCloseGoodsMask(),this.$router.push("/pledge")}}},u=l,h=(n("1e16"),n("2877")),d=Object(h["a"])(u,i,r,!1,null,"063801a2",null);t["default"]=d.exports},14:function(e,t){},15:function(e,t){},16:function(e,t){},17:function(e,t){},"17f1":function(e,t,n){},18:function(e,t){},19:function(e,t){},"1e16":function(e,t,n){"use strict";var i=n("a839"),r=n.n(i);r.a},2:function(e,t){},20:function(e,t){},21:function(e,t){},"220e":function(e,t,n){e.exports=n.p+"static/img/menu_icon7.9a974fb4.png"},2414:function(e,t,n){"use strict";var i=n("06ed"),r=n.n(i);r.a},3:function(e,t){},3051:function(e,t,n){e.exports=n.p+"static/img/gitbook_icon.c0add2b3.png"},3714:function(e,t,n){"use strict";var i=n("803f"),r=n.n(i);r.a},"3cb7":function(e,t,n){"use strict";n.r(t);var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"show",rawName:"v-show",value:e.loading.show,expression:"loading.show"}],staticClass:"com-loading"},[e._m(0),e._v(" "),n("div",{staticClass:"loaading-text"},[e._v("\n "+e._s(e.loading.text)+"\n ")])])},r=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"sk-folding-cube"},[n("div",{staticClass:"sk-cube sk-cube-1"}),e._v(" "),n("div",{staticClass:"sk-cube sk-cube-2"}),e._v(" "),n("div",{staticClass:"sk-cube sk-cube-4"}),e._v(" "),n("div",{staticClass:"sk-cube sk-cube-3"})])}],a=(n("8e6e"),n("ac6a"),n("456d"),n("ade3")),o=n("2f62");function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){Object(a["a"])(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var l={name:"ComLoading",computed:c({},Object(o["b"])(["loading"]))},u=l,h=(n("57b6"),n("2877")),d=Object(h["a"])(u,i,r,!1,null,"4871f53d",null);t["default"]=d.exports},"3da8":function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IArs4c6QAAD0VJREFUeF7tnQ2MXUUVgM+5761tIbREjAkGkVCkRKHu3nnbskJjY/kRKApGIJFEqmgtPwHBKBSaANGmaBCDQoDKriWoIFVpoC0/UmyEKtv3zt26LQ3V8qeNBBOIbaFN9+cec573LW8fb9/9eTPz7tu9k7xk086cOefMd2fmzj0zgzAJU3d39/HMfBIAzPF9fw4izgGAw6p+M6r+Fg8cCH4Hq/4+wMy7HMfZBQC7EPHlYrH46mRzF7a7QdLYo6OjPY7jLGLmbml0AOgwZNdwAEPR9/1NuVzur+0ORdsBEDzdCwFgPjOfDgCfMtTYUcXuRMQXAKAfETe3GxBtAcAJJ5wwbebMmRc4jnMhM18AANOito7lfIcQcZ3v+4/t27dv3e7duw9Zrj92dakGQCklT/iFACCNfnxs61pbQOYL6wDgMSKSHiKVKZUAuK672HGcpcx8fiq9FlMpRHzC9/3Vnuetj1nUePZUATDZGr629dIIQioAmOwNn2YQWgpAZ2fncfl8fjkzLzXe16WwAkRcPTIysmrbtm2vt0q9lgHguu5ViHgjABzTKuNTUu8eZr7d87x7WqGPdQCCmf1yADi3FQanuM6NALDK9huDVQAKhcLNzPzDFDdCy1VDxBWlUmmlLUWsANDV1fUZx3Gk4RfbMqzN61nv+/6KgYGBv5m2wzgASqllACCNf5RpYyaZ/LcBYAUR3WfSLqMAKKXWAMBlJg2YArIfJKIlpuw0BoBS6hkAONOU4lNM7h+J6CwTNhsBQCnlAUCXCYWnsMwBInJ1268dAKXUGwBwrG5FM3llD/yTiD6h0xdaAVBKvRdE2ujUMZM13gMHiOhwXU7RBoBS6r8AMEuXYpmchh7YS0RH6vCRFgCUUoMAcIoOhTIZkT2wnYjmRs49QcamAVBKyTfu85pVJCufyAMbiKipxbWmAFBKPQoAFyVSPSukywNriejipMISA5At8iR1uZFyiReLEgEQLO/ea8SUTGhSD1yRZNk4NgDBh51N2dp+0nYyVu5t3/cXxf2AFBsApdQT2Vc9Y43YrOD1RBQrkDYWANn3/Gbbx3z5uPEEkQEIInmeN29CVoMGDyyIGlkUB4ANWRiXhqaxI2IjEUVam4kEQBDAebcd3bNadHiAma+OEmgaCoCEbudyOen6p3r0ro52sSljz+jo6IKwkPNQAAqFwv1TNW7fZmuZqEv2HZRKpW83kt0QANmxI9uZNCu3BhGZmb+uWa4NcS8h4nW+73/WcZzFzFywUWkzdcj+ykZ7EhsCUCgUHte8QXMNEZUbXil1NDPfhIhXN2OgzbKO45xZLBafrdTpuu4SRPwGACywqUecuuQBLpVKX5yozIQAmHj6mfk2z/NurVamp6fnw0NDQ98HgBviGNaCvHcR0Xfq1eu67sUBCGe3QK/QKhv1AhMCYODph3oAVLSfP3/+zJGRkWsB4CYAmB5qld0Mr8hTTkRvNqrWdd3zAxDkPIPUpEa9QF0ATDz94o1GAFS81dPTM2NoaOiKAIRU7CWQSbDneb+I2qJdXV2LHMeRoeGrUcuYzjdRL1AXABNPf1QAKo5QSslBT98MhgatgZBxnM3Mj3ue96U4ZSp5u7q65PCqywFAYAh940pSR9QyE/UCH1DK5JJvlB6gnkFKKQHhuhYcCOU7jrOgWCz+Jaqj6+Xr7u7u9H1fIJCftoDOBDqdSkT91eXqAfATALg+gfDQIkkBqAiWWTcAXImIchycjSS7dWVOoiXNmzfvxNHRUYFAeoWPaBEaQ0g9/48DQE7jmjVr1k5TBzI1C0AVCJciovQKclycqbQdAOSJkUMktabu7u6PCwjBhNHmHop+Ijp1wh7Add1LEPERrdZWCdMFQBUIEgv3LUQ8w4DOlxLRbwzIHRM5b968o0ZGRiogyMmmNtK4YWBcD1AoFB5h5ktMaaEbgCoQviwTRkQ8R5PuDxORtRm8Uuow6Q2YWYYHo1vqmPlWz/Nuq/hpDAA5gdP3fen+jR3CaAqAKhDkPfzXAHBEEyC86zjOqcVi8aUmZCQuqpQqyUJpYgHhBccNA2MABDPtyO+64fV8MIdpAKRG13WXIuL9SfSTMnEjapLWM1E513VvRcRbdMutkaeISDbwvv9uqpT6JQAY24culdkAQOpRSv0p4QTxRSLqMez8huJtAICIN5RKpR/XAvB3APikSeNtAeC6rkJE6UpjpbAvZ7GEJcxsAwAAeIaIyt8tykNA8H4q5+IbTbYACHqBOwDguzEM6iUiebVsabIBADP7M2bMOHLLli37ywAUCoXLmfkB05bbBCBY05ADmz8Wwa63HMfpLhaL/4qQ12gWGwCUn3zEi0ql0u/KACilHgSArxm1zOIcoGKH67qyYPSrCHZdQ0Q/j5DPeBZbAABAucerACCrXiebts5mD1CxJcKHreeIaJFp26PKtwjADiI6pQLAkMFrVsZsbwUAwVa2bRM1gO/7nxsYGPhz1AYync8iAMNE9CEMFoAk4MF4agUAwRD3Azlzr9ZAZv6p53lGPnwldaZFAMBxnNlYKBTOZWbZ9GE8tQqAhQsX5vfv3y8reydWGflaPp/v7O/v32fc8BgV2AQAEc8TAK5j5jtj6Jg4a6sAEIXrfOhaQkQy+U1VsgzA9ei67n2I2DB2XJeHWglAMBSsBYCvyF0+RCR3EaUu2QSAme/HJpZNYzuv1QAUCoWTmXm77/udcffRxzY2YQGbAADAZgFAQoTmJdQ3VrFWAxAMBbdUfw6NZYCFzJYB2CoAWFkDEN/Vfou24M+2q8IyADsEAHkFtHInXwZAOI+WAXhVAPg3ABwdrlrzOTIAwn1oGYA3BQBrR7xmAKQOgL0CgJVl4GwOEN74wSTVRkRQRZnhDIBo7WItl+UhoAxANgRYa97wiiwDUB4CsklgeLtYy2EZgPIkMHsNtNa84RVZBqD8GpgtBIW3i7UclgEoLwRNqaVgay2ZsCLLAJSXgpPG0Mc2MVsHCHeZ67q3IOK4Y3TCSyXOsXlKfQ5O7CaLBW0CUP4cbDkgZNzGRBN+dV33857nPWdCtg2ZNgFAxOsnXUiYUooB4HlmXul53tM2Gk1nHZYBOM92UKjxHiAAoNIm/XJdfaODEnU2ng5ZNgEoB4WK0ra+B9gICKkBoNImXtAj/EFHI5mUYRGA/4eFBwBYWQuw8RYwAQCVNtuBiCtLpZKxU1CahcMiAO9vDLEVGNrCHqC2XXYx8488z5Mt8alKtgCQNwDP85ZVegC5XEAugDSaUtAD1Nonm0fvOHjwYO/OnTvls3jLky0A5N4nItpQBmDu3LmHd3R07AWAnEkPpKgHqDVzDyLemcvlelu9UcQSAKPDw8OzBgcH36s+IuYxADB6xm0Ke4BaEN4CgLvy+Xxff3+//G09WQJgbF9ENQDXiPEmLU5xDzDObER8h5nv9n2/b2Bg4A2TPqmVbQmAa4noZ1L3GABhu2h1OKENeoBaM99FRLkhtbdUKhk/QUUqtwFA9caYcecEKqVeBID5Ohq7nox26QHq6H4IAFb7vt9rekeRBQDqHxNniz5EXMbMfUQ0bAK0kHWAZquUZeYHRH/P8+Rh0Z5MA1D7ENb2APL0GzGsxlM7mLm3o6NDJltat2cbBmDMDDl6JgBZPqdrS6YBCM4/HjsxvN5p4UaHgRpPvSJO7OjokNcvLbNuWwBU7EBEWV6WOcJGHRQYBqDxYdHBMGAzLr3iMwlM7cvlcn1bt259rRlH2gagoiszP+k4joDw+2b0NwlA6HHxorhSytYwUM9PEqLeG7x+ybnFsVOrAKhSdDMi9pVKpYdiK2/+LSD8wghROsLJWklsi1NGZt19Mk/wPI/iFEwBABV15VN03+zZs3vXrl07GtUGUz1A5CtjgmHAxIWRUX1Qm29NMOuOdHN5igCo2DEoME+fPr1PTuYMc4IpAGJdGpWSXmCcrxDxt8Gs+5lGTkwhABV1/yEgDA8P9w0ODv5nIhtMABD72rgU9gJj/hJjAhDW1XNiigEoq4uIe0T/iZaZTQCQ6OLINPYC1Q3OzM86jiOTrYer/z3tAFTp+g4i9gYwv1z5d90AJL46Ns29QM2TvyWYdfcVCoWFzKx1YSZszNbw/wdlshvAPKAbgLAj8EMvM2yj6+N3A8BHAWCmhkZplQg5zPLTuipv+vp4UaSzs/O4XC4nM/BjdCmWybHigT2jo6MLtm3b9nqj2kJ7gGAouAoR77aidlaJFg8w89We590TJiwSACJEKSXnCZ8bJjD7/1R4YCMRSZxnaIoDwOmy4yZUYpYhDR6Qq+5fiKJIZABEWKFQuFl22kQRnOVpmQe+R0RyX1KkFAuAYCh4QkKKI0nPMln1ADM/5HlerKt/YgMQxA5uAoCjrFqXVRbmgcF8Pn9W3LiK2AAEvcAyAJBgySylxwNnE1HD7yT1VE0EQADBGgC4LD32T2lNYo371Z5KDEAAgRB35pR2feuNv5eIrkyqRlMABBDIJcRGrzxPatwUKLeBiJqakDcNQACB7J45dgo4PE0mbieiuc0qpAWAAIL3AOCwZhXKykfywF4iOjJSzpBM2gAIILB27rAO49tUhrbGF/u1AhBAIDFwp7Spc9OutpZuX9tbwETeUkrJYRORPkak3eMp0q/pCV89W7T3AJVKlFKPAsBFKXJgO6uyloguNmGAMQCC4SBbLGq+1R4koiXNi6kvwSgAAQSybCxfELNvB/Fa8W258JqI7otXLF5u4wCIOsEHJIGgqUWLeKa1de71vu+vMH0WgZG3gEZuz+IJwqFExBWlUmlleE49Oaz0ANWqKqUksmh5Fl72gQaU7eWrokby6Gl+A+sAURVzXVcCTW/Moo1BdgrdHiWAM6pv4+Sz3gNUKych5/l8fjkzL42j9GTJK3H7IyMjq8JCt03a21IAKoa5rrvYcZylsovFpLFpkS3btXzfX52GU8xTAcBUASFNDV/xeaoAmKwgpLHhUw1ARTk5roaZv4CI55g8v9DQ0CAnhDyFiE8S0dipXIbqSiw2lT1APWvaBIa2aPRq/7YNADVrCS4insHMi5j5DER0Ej8CTRRkZh8Rn0XETXJeARFJeFxbpbYEoNrDp5122hGHDh06W4aKYJiYAwAdhlpBTjeVM4P7EfGpadOmPR3l3B9DumgR2/YA1PNCd3f38cx8EgDM8X1/DiIKFBKuVvnNqPpbRBwIfger/j7AzLscx5EG34WILxeLRblgYlKl/wGPMQ0cRrjL8gAAAABJRU5ErkJggg=="},4:function(e,t){},4903:function(e,t,n){e.exports=n.p+"static/img/settings_icon.0fe960a9.png"},"4a34":function(e,t,n){e.exports=n.p+"static/img/email_icon.091485da.png"},5:function(e,t){},5075:function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IArs4c6QAAB8ZJREFUeF7tXU2IHEUUfq8nE0XZ7PSb2UCCYAxCvHgwIv4dVMxBbx5MYsSACpF484coASEr/hBF9KoielA0IAhCEISIOcS/CImoGBFUjHiIM12dXTFsYHueVpjV9We7q3u7Z2t6voI5zauq9736+r1veqq6mdDGOgI81ugBnionQBzHG+bn5zeMQ6xVdWbt2rXHRwlr6QSI4/gKVb2ema9U1RuJaCwWf2HRVfV3IjoSBMHRJEm+6HQ67/hMiFIJEEXRNDPvIaILfAY9ZN8Orlq16p41a9b0hjyv03SlEMAYM0lEHxLRFU6zjp/R2X6/f6eP2WDZBOh2u+sbjcYv47em+RGr6q52u/1K/p7V9Vg2AYwxPxDRJdW5WK+RgyDY2Gq1fvQF1bIIEEXRE8z8mC9gRsEPZv4gDMMtvvhamAC9Xu+uIAhe9wXIiPnxrIg86oPPhQlgjDlARNt9ADGCPpwUkYt98LswAeI4/l5VN2aA+I2IDqrqd8MGGwSBDntOVV1LRFuJaMph7stF5GsHu0pNChHg1KlTG5vN5vcZnn3dbDa3T0xMfFMpAs8GV9XzTp8+/aKq3p3mGjPfG4bhayvtfiECRFG0nZltCUhrL4nI7pUGuBLz29vfqpql9F8UkftXwr/FcxYlgL3jty/N+SRJbpqamjq80gBXan5jjL0xZm+FL9UOi8hNK+XfwrwgQEUrAAIgAyADoASgBEADQANUVGQ9HxYaABoAGgAaABoAGgAawPNiXZF70ADQANAA0ADQANAA0AAVFVnPh4UGgAaABoAGgAaABoAG8LxYV+ReXg0Qx/G+wVnKf3tk91MeY+YTc3NzJ9atW9ct02VsCCkzmovGKkiAaQd39ovIXgc7JxMQwClM+Y0qJIB15qtms7llYmLi1/ye/bMHCLDcCC7Rv2ICnJuVmTeEYfjTciCAAMuJXkrfYRCAiOIwDKeYOSkKAwQoGrmMfkMigM0Cr4RhuKsoDBCgaOQ8IYB1Q1Ufb7fbLgLyP16DADUgABG9LyK3FIECAhSJmkOfgiXg/w6SpB0uWfBkVkTsU1pyNxAgd8jcOuQlwFKjdrvdGxuNhj2FlUoEVb2u3W5/4ubd31YgQN6IOdqXRQA7nTFmBxG9mTY1Mz8UhuELju79ZQYC5I2Yo32ZBJiZmZEkSaK0qYsKQRDAcUHzmpVJgEEWSH3eAQiQd4UqtgcBsCGk1A0hxhhkgIov2lKHRwZABkAGwJaw8raEoQSUmqCrHwwlACUAJQAlACUAu4KXrja5nhIGDVB92S51BmgAaABoAGgAaABoAGiAUkvryAwGDQANAA0ADQANAA0ADTAyZbtUR6EBoAGgAaABoAGgAaABSi2tIzMYNAA0ADQANAA0ADQANMDIlO1SHYUGgAaABoAGgAaABoAGKLW0jsxg0ADQANAA0ADQANAA0AAjU7ZLdRQaABpgqBqAmafDMHw8L4vxjKC8EXO0H3YGAAEcF2ZYZiAASgBKAH4GDu9nIErAsHK74zwoASgB9S0BcRw/oKqpz6VV1W3tdvttxwumdmbGmJ+J6KIUYO+KyG2uwLMeEDHUEtDr9a4OguDTNOeZ+e0wDLe5AqyTXRRF9zHzS2mYVHVPu91+zhW3VwRQ1dVxHM8Q0fkZIAu/ycI1ML7ZGWNuJaL3svxKcpZIrwhgwcVxfEhVb84COvh+XP4TsCn/UoeYzBNRR0TsReTUvCNAFEXPMfPDTt7D6N8R+FhErs8TFu8IMDs7uylJkiOq2skDBLbnIrBDRA7kiYV3BLDOG2MeIaJn8gCBLR0QEfsGkFzNSwIMSHCEiHKls1zI62V8RkQuLALJWwIMSPAtEW0qAmyc+vT7/as7nc7RIpi9JoAF1Ov1bguC4FUiCosArHOfoq9zWRwT7wlgnY3juEVE+1T19oy7YHVe7wVs9n2+9mp/UkQy7wtkBWQkCLAYRLfb3dxoNK4homvHiAy/MfNR+yGiz1utVpy1sK7fjxwBXIHBzi0CIIBbnGprBQLUdmndgIEAbnGqrVWtCWBfkJy1cuO8vWxwryX1vYFD3Q+QtVh5v4/j2P50nE7rJyKFtrDn9cVX+1pngCiKppnZviJ9yQYCpL85FBnA10u3JL+QAVAC6qsBUAKy0wQyADJAfTMAfgWMeQYAAUAA3AfI4ECtNQAyADIAMgAyAG4Fp3Fg7EtAv9+/ptPpfJadLOtnEUXRRcxsD5su2fr9/s5Op/NGXvRe/MFi/w1sNBr2OPWSrYyNlXmD44t9FEXPM/ODaf4w8+YwDI/n9dkLAlinjTG/EtFUBshD/X7/o7wgR9memW8gSn3SiIU3Pzc3N7l+/fozebF6Q4Aoil5m5l15AcD+XASOi8jmIrHwhgDGmDuI6K0iINCH9orI/iJx8IYAgzKQ9ViVIhhr3YeZj7VareuY+WwRoF4RYGZm5qokSQodnSoCviZ9dopIbvW/gN0rAgyywLNEtKcmi1M1jEInjRc75R0BBiR4moj2Vh29ER//KRF5bLkYvCSABdXr9S5rNBpPDM4ZLhdn3frvFpHUh1C5AvaWAAsAoijaas8XMvPCOUNXbLWxY+YvVNXe/zj3EZGTZYHzngCLgarqeb1ezx42HZu2evXqLycnJ01VgEeKAFUFYZzHBQHGefX/xP4Hqo956mo0P2EAAAAASUVORK5CYII="},"56d7":function(e,t,n){"use strict";n.r(t);n("cadf"),n("551c"),n("f751"),n("097d");var i=n("8bbf"),r=n.n(i),a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"app"}},[n("router-view")],1)},o=[],s=n("2877"),c={},l=Object(s["a"])(c,a,o,!1,null,null,null),u=l.exports,h=n("8c4f"),d=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"layout"},[n("layout-header"),e._v(" "),n("router-view"),e._v(" "),n("com-loading"),e._v(" "),n("com-star-animate")],1)},p=[],f=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"layout-header"},[i("div",{staticClass:"menu-btn"},[i("div",{staticClass:"online-dot"}),e._v(" "),i("div",{class:["nav-open-btn"],on:{click:e.handleNavMenuSwitch}},[i("div",{staticClass:"nav-menu-line"}),e._v(" "),i("div",{staticClass:"nav-menu-line"}),e._v(" "),i("div",{staticClass:"nav-menu-line"})])]),e._v(" "),i("router-link",{staticClass:"logo",attrs:{to:"/"}},[i("img",{attrs:{src:n("9245")}})]),e._v(" "),i("div",{staticClass:"header-right"},[e.wallet.isConnected?[i("div",{staticClass:"connected-btn"},[i("van-popover",{attrs:{trigger:"click",placement:"bottom-end"},scopedSlots:e._u([{key:"reference",fn:function(){return[i("div",{staticClass:"connect-btn-wrap"},[i("div",{staticClass:"connect-btn com-submit-btn"},[i("span",[e._v(e._s(e.handlePlusXing(e.wallet.address,3,5)))])])])]},proxy:!0}]),model:{value:e.showPopover,callback:function(t){e.showPopover=t},expression:"showPopover"}},[i("div",{staticClass:"popover-wrap"},[i("div",{staticClass:"popover-item",on:{click:function(t){e.showPopover=!1}}},[i("div",{staticClass:"operate-wrap"},[i("div",{staticClass:"operate-item",on:{click:e.handleCopyAddress}},[i("img",{attrs:{src:n("5075")}})]),e._v(" "),i("a",{staticClass:"operate-item",attrs:{href:"https://bscscan.com/address/"+e.wallet.address}},[i("img",{attrs:{src:n("7bc7")}})]),e._v(" "),i("div",{staticClass:"operate-item",on:{click:e.handleCloseConnect}},[i("img",{attrs:{src:n("664b")}})])])]),e._v(" "),e._l(e.actions,(function(t,n){return i("div",{key:n,staticClass:"popover-item",on:{click:function(n){return e.handleWallteSelect(t.id)}}},[e._v("\n "+e._s(t.text)+"\n ")])}))],2)])],1)]:i("div",{staticClass:"connect-btn com-submit-btn",on:{click:e.handleConnectWallet}},[i("span",[e._v(e._s(e.$t("common.connect")))])]),e._v(" "),i("div",{staticClass:"lang-wrap"},[i("van-popover",{attrs:{trigger:"click",actions:e.language,placement:"bottom-end"},on:{select:e.handleLanguageSelect},scopedSlots:e._u([{key:"reference",fn:function(){return[i("div",{staticClass:"lang"},[e._v("\n "+e._s(e.langName)+"\n ")])]},proxy:!0}]),model:{value:e.showPopover2,callback:function(t){e.showPopover2=t},expression:"showPopover2"}})],1)],2),e._v(" "),i("div",{class:["nav-menu-mask",e.isShowMenu?"active":""]},[i("div",{staticClass:"mask",on:{click:function(t){e.isShowMenu=!1}}}),e._v(" "),i("div",{staticClass:"nav-menu-mask-scroll"},[i("div",{staticClass:"user-linker"},[i("van-collapse",{attrs:{border:!1,accordion:""},model:{value:e.activeName,callback:function(t){e.activeName=t},expression:"activeName"}},[e._l(e.linkList,(function(t,n){return[t.child?i("van-collapse-item",{key:n,attrs:{name:n},scopedSlots:e._u([{key:"title",fn:function(){return[i("div",{staticClass:"cell-link-item"},[i("img",{staticClass:"link-item-icon",attrs:{src:t.iconUrl}}),e._v("\n "+e._s(e.$t("common."+t.name))+"\n ")])]},proxy:!0}],null,!0)},[e._v(" "),i("div",{staticClass:"coll-content"},e._l(t.child,(function(t,r){return i("div",{key:n+"-"+r,class:["coll-item",e.currentPage===t.toLink?"active":""],on:{click:function(n){return e.handleGoToLink(t.toLink,t.href)}}},[e._v("\n "+e._s(e.$t("common."+t.name))+"\n ")])})),0)]):i("div",{key:n,class:["link-item",e.currentPage===t.toLink?"active":""],on:{click:function(n){return e.handleGoToLink(t.toLink,t.href)}}},[t.iconUrl?i("img",{staticClass:"link-item-icon",attrs:{src:t.iconUrl}}):e._e(),e._v("\n "+e._s(e.$t("common."+t.name))+"\n ")])]}))],2)],1),e._v(" "),i("div",{staticClass:"version"},[e._v("\n "+e._s(e.$t("common.version"))+"v1.5\n ")])])])],1)},m=[],g=(n("8e6e"),n("ac6a"),n("456d"),n("7f7f"),n("ade3"));n("f5766"),n("a481"),n("3b2b"),n("6b54"),n("c5f6"),n("53ca");function v(e){var t=document.createElement("input");t.readOnly="readonly",t.value=e,document.body.appendChild(t),t.select(),t.setSelectionRange(0,t.value.length),document.execCommand("Copy"),document.body.removeChild(t)}var y=function(e,t,n){var i="...";return e.substring(0,t)+i+e.substring(e.length-n)};var x=n("2f62");function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(Object(n),!0).forEach((function(t){Object(g["a"])(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var _={name:"SiteHeader",data:function(){return{isShowMenu:!1,actions:[{text:"1",id:1},{text:"2",id:2}],language:[{text:"简体中文",key:"zh-cn",name:"中"},{text:"English",key:"en",name:"EN"}],showPopover:!1,showPopover2:!1,linkList:[{name:"home",iconUrl:n("7571"),toLink:"/"},{name:"nftStore",iconUrl:n("6d04"),child:[{toLink:"/store?id=1",name:"nftStoreItem1"},{toLink:"/store?id=2",name:"nftStoreItem2"},{toLink:"/comingSoon",name:"nftStoreItem3"},{toLink:"/comingSoon",name:"nftStoreItem4"}]},{name:"trade",iconUrl:n("9a52"),child:[{toLink:"/swap",name:"exchange",href:"https://pancakeswap.finance/swap?inputCurrency=0x811b279463a89E4B6E35805174C9190763f72614"},{toLink:"/comingSoon",name:"fluidity",href:"https://pancakeswap.finance/add/BNB/0x811b279463a89E4B6E35805174C9190763f72614"}]},{name:"farms",iconUrl:n("c418"),child:[{toLink:"/pledge",name:"nftMining"},{toLink:"/Farms",name:"liquidityMining"},{toLink:"/energyPool",name:"syrup"}]},{name:"market",iconUrl:n("e098"),toLink:"/comingSoon"},{iconUrl:n("a9c8"),toLink:"/singleCurrency",name:"genesisAirdrop"},{name:"ido",iconUrl:n("602b"),toLink:"/spaceStation"},{name:"park",iconUrl:n("75dc"),toLink:"/portal"},{name:"info",iconUrl:n("220e"),toLink:"/comingSoon"},{name:"webSite",iconUrl:n("c875"),href:"https://blin.pro/#/"}],activeName:"",langName:"",currentPage:""}},computed:w({},Object(x["b"])(["wallet"])),watch:{$route:{handler:function(e){this.currentPage=e.path.indexOf("/store")>-1?e.fullPath:e.path,console.log(this.currentPage)},deep:!0,immediate:!0},"$i18n.locale":function(){this.handleTransCardBlindboxText()}},created:function(){var e=this;this.handleTransCardBlindboxText(),this.currentPage=this.$route.path;var t=this.language.filter((function(t){return t.key===e.$i18n.locale}))[0];this.langName=t.name},methods:{handleTransCardBlindboxText:function(){this.actions[0].text=this.$t("common.myCard"),this.actions[1].text=this.$t("common.myBlindbox")},handleConnectWallet:function(){var e=this;this.$w.connectWallet().then((function(t){e.wallet.isConnected=e.$w.getConnectStatus()}))},handleCloseConnect:function(){this.wallet.isConnected=this.$w.closeConnect(),this.isShowMenu=!1},handleCopyAddress:function(){v(this.wallet.address),this.$toast(this.$t("common.copySuccess"))},handleNavMenuSwitch:function(){this.isShowMenu=!this.isShowMenu},handleGoToLink:function(e,t){t?window.location.href=t:(this.isShowMenu=!1,this.$route.path!==e&&this.$router.push(e))},handleLanguageSelect:function(e){var t=e.key,n=this.language.filter((function(e){return e.key===t}))[0];this.langName=n.name,this.$i18n.locale=t,localStorage.setItem("lang",t)},handleWallteSelect:function(e){this.isShowMenu=!1,this.showPopover=!1;var t=["/userCard","/userBlindbox"];1===e&&this.$route.path===t[0]||2===e&&this.$route.path===t[1]||this.$router.push(t[e-1])},handlePlusXing:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4;return y(e,t,n)}}},M=_,S=(n("0afc"),n("6cc1"),Object(s["a"])(M,f,m,!1,null,"d1c1b1a8",null)),T=S.exports,E={name:"Layout",components:{LayoutHeader:T}},A=E,L=(n("3714"),Object(s["a"])(A,d,p,!1,null,"4e5ba56e",null)),C=L.exports;r.a.use(h["a"]);var R=[{path:"/",component:C,redirect:"/",children:[{path:"/",name:"home",meta:{title:"首页"},component:function(){return n.e("chunk-3264f6f4").then(n.bind(null,"16c0"))}},{path:"store",name:"Store",meta:{title:"NFT商店"},component:function(){return n.e("chunk-9e89cf20").then(n.bind(null,"a444"))}},{path:"farms",name:"Farms",meta:{title:"农场"},component:function(){return Promise.all([n.e("chunk-97007c50"),n.e("chunk-00549981")]).then(n.bind(null,"1ecb"))}},{path:"nftDetails",name:"NftDetails",meta:{title:"NFT详情"},component:function(){return n.e("chunk-12dcb2d8").then(n.bind(null,"f5c5"))}},{path:"blindbox",name:"BlindBox",meta:{title:"盲盒"},component:function(){return n.e("chunk-4e85371b").then(n.bind(null,"44a1"))}},{path:"pledge",name:"Pledge",meta:{title:"NFT质押"},component:function(){return n.e("chunk-4e24ac0d").then(n.bind(null,"bf5f"))}},{path:"spaceStation",name:"Ido",meta:{title:"blin预售"},component:function(){return n.e("chunk-e1dd7190").then(n.bind(null,"ed42"))}},{path:"singleCurrency",name:"SingleCurrency",meta:{title:"单币质押"},component:function(){return n.e("chunk-61fda6a5").then(n.bind(null,"362d"))}},{path:"energyPool",name:"EnergyPool",meta:{title:"能量池"},component:function(){return Promise.all([n.e("chunk-97007c50"),n.e("chunk-011e47e0")]).then(n.bind(null,"0c07"))}},{path:"connect",name:"Connect",meta:{title:"单币质押"},component:function(){return n.e("chunk-16efb693").then(n.bind(null,"c683"))}},{path:"userBlindbox",name:"UserBlindbox",meta:{title:"单币质押"},component:function(){return n.e("chunk-3bc7ccea").then(n.bind(null,"a738"))}},{path:"userCard",name:"UserCard",meta:{title:"单币质押"},component:function(){return n.e("chunk-750ce221").then(n.bind(null,"1fe9"))}},{path:"portal",name:"Portal",meta:{title:"传送门"},component:function(){return n.e("chunk-7c877820").then(n.bind(null,"3fae"))}}]},{path:"/comingSoon",name:"ComingSoon",meta:{title:"即将到来"},component:function(){return n.e("chunk-746bb540").then(n.bind(null,"dcca"))}},{path:"*",redirect:"/comingSoon"}],P=function(){return new h["a"]({mode:"history",scrollBehavior:function(){return{y:0}},routes:R})},O=P();var I=O,D={temp:0},N={},B={},F={namespaced:!0,state:D,mutations:N,actions:B},U={show:!1,text:""},z={SET_LOADING:function(e,t){e.show=t.show,e.text=t.text}},G={setLoading:function(e,t){var n=e.commit;n("SET_LOADING",t)}},k={namespaced:!0,state:U,mutations:z,actions:G},H={show:!1,info:{}},j={SET_MASK_INFO:function(e,t){e.show=t.show,e.info=t.info}},V={setMaskInfo:function(e,t){var n=e.commit;n("SET_MASK_INFO",t)}},W={namespaced:!0,state:H,mutations:j,actions:V},q={isConnected:!1,installed:!1,address:"",chainId:""},Y={SET_ALL:function(e,t){e.isConnected=t.isConnected,e.address=t.address,e.chainId=t.chainId,e.installed=t.installed},SET_SPECIFY_ITEM:function(e,t){for(var n in t)e[n]=t[n]}},X={setAll:function(e,t){var n=e.commit;n("SET_ALL",t)},setSpecifyItem:function(e,t){var n=e.commit;n("SET_SPECIFY_ITEM",t)}},Z={namespaced:!0,state:q,mutations:Y,actions:X},J={loading:function(e){return e.loading},goodsMask:function(e){return e.goodsMask},wallet:function(e){return e.wallet}},Q=J;r.a.use(x["a"]);var K=new x["a"].Store({modules:{app:F,loading:k,goodsMask:W,wallet:Z},getters:Q}),$=K;n("a4b1"),n("45dc");I.beforeEach((function(e,t,n){if($.getters.wallet.installed)n();else var i=setInterval((function(){$.getters.wallet.installed&&(n(),clearInterval(i))}),100)})),I.afterEach((function(){}));var ee=n("a925");r.a.use(ee["a"]);var te=localStorage.getItem("lang")?localStorage.getItem("lang"):"en",ne=new ee["a"]({locale:te,messages:{"zh-cn":n("098e"),en:n("d500")}}),ie=ne,re=n("2909"),ae=(n("96cf"),n("1da1")),oe=n("99e5"),se=n.n(oe),ce=n("f564"),le=n("d399"),ue=window.ethereum,he=0,de=function(){return new Promise(function(){var e=Object(ae["a"])(regeneratorRuntime.mark((function e(t,n){var i,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!ue){e.next=13;break}return i=new se.a(ue),e.prev=2,e.next=5,me();case 5:t(i),e.next=11;break;case 8:e.prev=8,e.t0=e["catch"](2),n(e.t0);case 11:e.next=14;break;case 13:window.web3?(r=window.web3,console.log("Injected web3 detected."),t(r)):Object(ce["a"])({type:"danger",message:ie.t("common.providerInfo")});case 14:case"end":return e.stop()}}),e,null,[[2,8]])})));return function(t,n){return e.apply(this,arguments)}}())},pe=function(){return localStorage.removeItem("isConnected"),!1},fe=function(){var e=Object(ae["a"])(regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(ue&&ge()){e.next=3;break}return $.dispatch("wallet/setSpecifyItem",{installed:!0}),e.abrupt("return");case 3:return e.next=5,ve();case 5:return t=e.sent,e.next=8,xe();case 8:n=e.sent,$.dispatch("wallet/setAll",{isConnected:!0,address:n[0],chainId:t,installed:!0}),ye(),e.next=17;break;case 15:e.next=20;break;case 17:if("0x38"===t){e.next=20;break}return e.next=20,me();case 20:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),me=function(){return new Promise((function(e,t){var n=[];n=[{chainId:"0x38",chainName:"BSC",nativeCurrency:{name:"BNB",symbol:"BNB",decimals:18},rpcUrls:["https://bsc-dataseed.binance.org/"],blockExplorerUrls:["https://bscscan.com/"]}],ue.request({method:"wallet_addEthereumChain",params:n}).then(function(){var t=Object(ae["a"])(regeneratorRuntime.mark((function t(n){var i,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return localStorage.setItem("isConnected","online"),t.next=3,ve();case 3:return i=t.sent,t.next=6,xe();case 6:r=t.sent,$.dispatch("wallet/setAll",{isConnected:!0,address:r[0],chainId:i.toString(),installed:!0}),window.location.reload(),e();case 10:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}))},ge=function(){return"online"===localStorage.getItem("isConnected")},ve=function(){var e=Object(ae["a"])(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,ue.request({method:"eth_chainId"});case 2:return t=e.sent,e.abrupt("return",t);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ye=function(){ue.on("disconnect",(function(){$.dispatch("wallet/setSpecifyItem",{isConnected:!1,address:"",chainId:""})})),ue.on("accountsChanged",(function(e){if(!e.length)return $.dispatch("wallet/setAll",{isConnected:!1,address:"",chainId:""}),void localStorage.removeItem("isConnected");$.dispatch("wallet/setSpecifyItem",{address:e[0]})})),ue.on("chainChanged",(function(e){}))},xe=function(){var e=Object(ae["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,ue.request({method:"eth_requestAccounts"});case 3:return e.abrupt("return",e.sent);case 6:return e.prev=6,e.t0=e["catch"](0),4001===e.t0.code?console.log("Please connect to MetaMask."):console.error(e.t0),e.abrupt("return",!1);case 10:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(){return e.apply(this,arguments)}}(),be=function(e){var t=e.methodName,i=e.options,r=void 0===i?[]:i,a=e.contractType,o=void 0===a?1:a,s=e.isCloseMask,c=void 0!==s&&s,l=e.showMask,u=void 0===l||l,h=e.zeroNum,d=void 0===h?"18":h;return new Promise(function(){var e=Object(ae["a"])(regeneratorRuntime.mark((function e(i,a){var s,l,h,p,f,m,g,v;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:s=n("b047"),l=["0x2806c6158d8c7602EDE92AA8E864E6Ab29AaCF0c","0xBC46984e980A4b4f1a600b7568a8f569e5fd5393","0x37C0099AF79303858A073aaFFa0FB178a5e969Ed","0x8622bEdBCFcBa7d0b9e3930fcbf3D7267C1Fb534","0x3A6F1f3C3AD117C05Cf72ed5DbCF9878C76a72bD","0x388991C4CD21534d8baC631EFB812153e130C845"],h=l[o-1],p=new s.providers.Web3Provider(ue),f=p.getSigner(),m=["function mint(address to, uint256 kindID) public payable","function openBlindBox(address to, uint256 id, uint256 kindID, bytes memory signature) public","function upgradeNFT(address to, uint256 id, uint256 upgrade_to, bytes memory signature) public","function getApproved(uint256 tokenId) external view returns (address operator)","function isApprovedForAll(address owner, address operator) external view returns (bool)","function WETH() public pure override returns (address)","function getAmountsOut(uint256 amountIn, address[] calldata path) public view override returns (uint256[] memory amounts)","function getAmountsIn(uint256 amountOut, address[] memory path) public view returns (uint256[] memory amounts)","function getReserves() public view returns (uint256 eth, uint256 blin)","function swapExactETHForBlin(address to, uint256 amountOutMin) public payable","function swapExactBlinForETH(address to, uint256 amountIn, uint256 amountOutMin) public","function getFeeType() public view returns (uint8)","function getFeePerThousand() public view returns (uint8)","function allowance(address owner, address spender) external view returns (uint256)","function approve(address spender, uint256 amount) external returns (bool)","function getBlinAmountOut(uint256 bnb, uint16 slip) public view returns (uint256 beforeSlip, uint256 afterSlip)","function getBlinAmountIn(uint256 bnb, uint16 slip) public view returns (uint256 blin, uint256 afterSlip)","function getBnbAmountOut(uint256 blin, uint16 slip) public view returns (uint256 beforeSlip, uint256 afterSlip)","function getBnbAmountIn(uint256 blin, uint16 slip) public view returns (uint256 bnb, uint256 afterSlip)","function getInfo() public view returns ( uint256, uint256, uint256, address, uint256, address, uint256, uint256, uint256, address)","function getBuyer(address user) public view returns ( uint256, uint256, uint256, bool)","function buy(uint256 value) public"],g=new s.Contract(h,m,f),"openBlindBox"!==t&&r.length&&(v=r[r.length-1],v.value&&(v.value=v.value._isBigNumber?v.value:s.utils.parseUnits(v.value.toString(),d))),u&&$.dispatch("loading/setLoading",{show:!0,text:"确认中"}),g[t].apply(g,Object(re["a"])(r)).then((function(e){c&&$.dispatch("loading/setLoading",{show:!1}),i({code:200,data:e,msg:"请求成功"})})).catch((function(e){switch(u&&$.dispatch("loading/setLoading",{show:!1}),e.code){case 4001:Object(le["a"])("用户拒绝了请求~");break;case 4100:Object(le["a"])("请求的方法和/或帐户未经用户授权~");break;case 4200:Object(le["a"])("提供者不支持请求的方法~");break;case 4900:Object(le["a"])("提供者与所有链断开连接~");break;case 4901:Object(le["a"])("提供者未连接到请求的链~");break;case-32700:Object(le["a"])("解析错误 无效的 JSON~");break;case-32e3:Object(le["a"])("购买失败余额不足~");break;default:Object(le["a"])("操作失败~");break}a(e)}));case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}())};if(ue)fe();else var we=setInterval((function(){he++,(window.ethereum||he>=20)&&(ue=window.ethereum,fe(),clearInterval(we))}),5);var _e={connectWallet:de,closeConnect:pe,switchChain:me,getConnectStatus:ge,getCurrentAccount:xe,callContractEthers:be},Me=function(e){for(var t in e.prototype.$w={},_e)e.prototype.$w[t]=_e[t]},Se={install:Me},Te=n("bc3a"),Ee=n.n(Te),Ae=function(e){var t=!1,n=null;return new Promise((function(i,r){function a(){return o.apply(this,arguments)}function o(){return o=Object(ae["a"])(regeneratorRuntime.mark((function r(){var a;return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(!t){r.next=2;break}return r.abrupt("return");case 2:return t=!0,r.prev=3,r.next=6,Ee()({method:"get",url:"https://api.blin.pro/nft/txhash",params:{hash:e}});case 6:if(a=r.sent,t=!1,200!==a.status){r.next=12;break}return i(a.data),clearInterval(n),r.abrupt("return");case 12:r.next=17;break;case 14:r.prev=14,r.t0=r["catch"](3),t=!1;case 17:case"end":return r.stop()}}),r,null,[[3,14]])}))),o.apply(this,arguments)}n=setInterval(a,1e3),a()}))},Le=n("b047"),Ce=function(e,t){if(window.ethereum){var n=new Le.providers.Web3Provider(window.ethereum),i=n.getSigner();return new Le.Contract(e,t,i)}},Re=null;Re={blin:"0x811b279463a89E4B6E35805174C9190763f72614",nft:"0x5363471aab72f9bbacF19A10DD9A4E857F4E9897",swap:"0xDeCF436AF34D37D51181fE14A13Bb8D6c207e562",ido:"0x0d788BE80a0f63FC5A033945d2c5798283cA3875",usdt:"0x55d398326f99059ff775485246999027b3197955",simpleCoin:"0xC1A1Ebc3547E5a510B331643084F3C30C7aD097c",lpStaking:"0x75Fa8A19F74cEcfD85A10cA347A915Fdc6f3431B",nftStaking:"0x07747405d279721AD4aD72706E061BaA818cf41c"};var Pe={nft:{contractAddress:Re.nft,abi:["function mint(address to, uint256 kindID) public payable","function openBlindBox(address to, uint256 id, uint256 toKind, uint256 deadline, bytes memory signature)","function upgradeNFT(address to, uint256 id, uint256 upgrade_to, uint256 deadline, bytes memory signature) public","function isApprovedForAll(address owner, address operator) external view returns (bool)","function getApproved(uint256 tokenId) external view returns (address operator)","function setApprovalForAll(address operator, bool _approved) external","function compound(address to, uint256[] memory ids, uint256 toKind, uint256 deadline, bytes memory signature) public","function transferFrom(address from, address to, uint256 tokenId)"]},exchange:{contractAddress:Re.swap,abi:["function getBlinAmountOut(uint256 bnb, uint16 slip) public view returns (uint256 beforeSlip, uint256 afterSlip)","function getBlinAmountIn(uint256 bnb, uint16 slip) public view returns (uint256 blin, uint256 afterSlip)","function getBnbAmountOut(uint256 blin, uint16 slip) public view returns (uint256 beforeSlip, uint256 afterSlip)","function getBnbAmountIn(uint256 blin, uint16 slip) public view returns (uint256 bnb, uint256 afterSlip)","function swapExactETHForBlin(address to, uint256 amountOutMin) public payable","function swapExactBlinForETH(address to, uint256 amountIn, uint256 amountOutMin) public"]},blin:{contractAddress:Re.blin,abi:["function allowance(address owner, address spender) external view returns (uint256)","function approve(address spender, uint256 amount) external returns (bool)","function balanceOf(address account) external view returns (uint256)"]},ido:{contractAddress:Re.ido,abi:["function getInfo() public view returns ( uint256, uint256, uint256, address, uint256, address, uint256, uint256, uint256, address, bool)","function getBuyer(address user) public view returns ( uint256, uint256, uint256, bool)","function buy(uint256 value) public","function inWhitelist(address account) public view returns (bool)"]},usdt:{contractAddress:Re.usdt,abi:["function allowance(address owner, address spender) external view returns (uint256)","function approve(address spender, uint256 amount) external returns (bool)","function balanceOf(address account) external view returns (uint256)"]},lp:{contractAddress:Re.lpStaking,abi:["function getPoolIndexes() public view returns (uint256[] memory)","function getPools(uint256[] memory indexes) public view returns (tuple(string, address, uint256, uint256, uint256, uint256)[] memory)","function stake(uint256 index, uint256 value) public payable","function getUser(uint256 index, address account) public view returns ( uint256 stakes, uint256 got, uint256 newReward)","function reward(uint256 index) public","function redeem(uint256 index) public"]},singleCurrency:{contractAddress:Re.simpleCoin,abi:["function getPoolIndexes() public view returns (uint256[] memory)","function getPools(uint256[] memory indexes) public view returns (tuple(string, address, uint256, uint256, uint256, uint256, uint256, uint256, uint256)[] memory)","function stake(uint256 index, uint256 value) public payable","function getUser(uint256 index, address account) public view returns ( uint256 stakes, uint256 got, uint256 newReward, uint256 boxes)","function claimBoxes(uint256 index, uint256 n) public","function reward(uint256 index) public","function redeem(uint256 index) public","function normal() public view returns (uint256, uint256)"]},nftPledge:{contractAddress:Re.nftStaking,abi:["function stake(uint256 id) public","function reward(uint256 id, uint256 amount, uint256 fromBlock, uint256 toBlock, bytes memory signature) public","function redeem(uint256 id, uint256 amount, uint256 fromBlock, uint256 toBlock, bytes memory signature) public","function charge(uint256 id, uint256 blocks, uint256 price, uint256 nonce, bytes memory signature) public"]}},Oe=function(e,t,n){var i=function(i){e[i]=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return new Promise((function(r,a){if("0x38"===$.getters.wallet.chainId){var o=Pe[t],s=o.contractAddress,c=o.abi,l=Ce(s,c);if(n[i].showLoading&&$.dispatch("loading/setLoading",{show:!0,text:n[i].loadingText?n[i].loadingText:ie.t("common.confirming")}),e.length){var u=e[e.length-1];u&&u.value&&(u.value=u.value._isBigNumber?u.value:Le.utils.parseUnits(u.value.toString(),"18"))}l[i].apply(l,Object(re["a"])(e)).then(function(){var e=Object(ae["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(n[i].isWait){e.next=4;break}return n[i].closeLoading&&$.dispatch("loading/setLoading",{show:!1}),r(t),e.abrupt("return");case 4:return e.next=6,t.wait();case 6:if(!n[i].queryHash){e.next=13;break}return e.next=9,Ae(t.hash);case 9:n[i].closeLoading&&$.dispatch("loading/setLoading",{show:!1}),r(t),e.next=15;break;case 13:n[i].closeLoading&&$.dispatch("loading/setLoading",{show:!1}),r(t);case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){if(console.log(e),$.dispatch("loading/setLoading",{show:!1}),e.data)Object(le["a"])(e.data.message);else{switch(e.code){case 4001:Object(le["a"])(ie.t("common.errMsg1"));break;case 4100:Object(le["a"])(ie.t("common.errMsg2"));break;case 4200:Object(le["a"])(ie.t("common.errMsg3"));break;case 4900:Object(le["a"])(ie.t("common.errMsg4"));break;case 4901:Object(le["a"])(ie.t("common.errMsg5"));break;case-32700:Object(le["a"])(ie.t("common.errMsg6"));break;case-32e3:Object(le["a"])(ie.t("common.errMsg7"));break;default:Object(le["a"])(ie.t("common.errMsg8"));break}a()}}))}else a()}))}};for(var r in n)i(r)},Ie=function(){var e={mint:{showLoading:!0,closeLoading:!1,isWait:!0},openBlindBox:{showLoading:!0,closeLoading:!0,isWait:!0,loadingText:ie.t("common.opening")},upgradeNFT:{showLoading:!0,closeLoading:!0,isWait:!0,queryHash:!0},isApprovedForAll:{showLoading:!0,closeLoading:!1},getApproved:{showLoading:!0,closeLoading:!1},setApprovalForAll:{showLoading:!0,isWait:!0},compound:{showLoading:!0,closeLoading:!1},transferFrom:{showLoading:!0,closeLoading:!0,isWait:!0,queryHash:!0}};this.mint2=function(e){var t=["function mint(address to, uint256 kindID, uint256 amount) public payable"],n=Pe["nft"].contractAddress,i=Ce(n,t);return new Promise((function(t,n){if($.dispatch("loading/setLoading",{show:!0,text:ie.t("common.confirming")}),e.length){var r=e[e.length-1];r.value&&(r.value=r.value._isBigNumber?r.value:Le.utils.parseUnits(r.value.toString(),"18"))}i.mint.apply(i,Object(re["a"])(e)).then((function(e){t(e)})).catch((function(e){$.dispatch("loading/setLoading",{show:!1}),n(e)}))}))},Oe(this,"nft",e)},De=function(){var e={getBlinAmountOut:{showLoading:!1},getBlinAmountIn:{showLoading:!1},getBnbAmountOut:{showLoading:!1},getBnbAmountIn:{showLoading:!1},swapExactETHForBlin:{},swapExactBlinForETH:{}};Oe(this,"exchange",e)},Ne=function(){var e={allowance:{},approve:{isWait:!0,showLoading:!0,closeLoading:!0},balanceOf:{showLoading:!1}};Oe(this,"blin",e)},Be=function(){var e={getInfo:{showLoading:!1},getBuyer:{showLoading:!1},buy:{showLoading:!0,closeLoading:!0,isWait:!0},inWhitelist:{showLoading:!1}};Oe(this,"ido",e)},Fe=function(){var e={allowance:{showLoading:!1},approve:{isWait:!0,showLoading:!0,closeLoading:!0},balanceOf:{showLoading:!1}};Oe(this,"usdt",e)},Ue=function(){var e={getPoolIndexes:{},getPools:{},stake:{isWait:!0,showLoading:!0,closeLoading:!0},getUser:{},reward:{isWait:!0,showLoading:!0,closeLoading:!0},redeem:{isWait:!0,showLoading:!0,closeLoading:!0}};Oe(this,"lp",e)},ze=function(){var e={getPoolIndexes:{},getPools:{},stake:{isWait:!0,showLoading:!0,closeLoading:!0},getUser:{},reward:{isWait:!0,showLoading:!0,closeLoading:!0},claimBoxes:{isWait:!0},redeem:{isWait:!0,showLoading:!0,closeLoading:!0},normal:{showLoading:!1}};Oe(this,"singleCurrency",e)},Ge=function(){var e={stake:{showLoading:!0,closeLoading:!0,isWait:!0,queryHash:!0},charge:{showLoading:!0,closeLoading:!0,isWait:!0,queryHash:!0},reward:{showLoading:!0,closeLoading:!0,isWait:!0,queryHash:!0},redeem:{showLoading:!0,closeLoading:!0,isWait:!0,queryHash:!0}};Oe(this,"nftPledge",e)},ke=function(e,t,n){return new Promise((function(i,r){var a=["function approve(address spender, uint256 amount) external returns (bool)"],o=Ce(e,a);o.approve(t,n).then(function(){var e=Object(ae["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.wait();case 2:i(t);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){r(e)}))}))},He=function(e,t,n){return new Promise((function(i,r){var a=["function allowance(address owner, address spender) external view returns (uint256)"],o=Ce(t,a);o.allowance(e,n).then((function(e){i(e)})).catch((function(e){r(e)}))}))},je=function(e,t){return new Promise((function(n,i){var r=["function balanceOf(address account) external view returns (uint256)"],a=Ce(t,r);a.balanceOf(e).then((function(e){n(e)})).catch((function(e){i(e)}))}))},Ve=function(e){return new Promise((function(t,n){var i=["function decimals() external view returns (uint8)"],r=Ce(e,i);r.decimals().then((function(e){t(e)})).catch((function(e){n(e)}))}))},We=function(e){return new Promise((function(t,n){var i=["function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast)"],r=Ce(e,i);r.getReserves().then((function(e){t(e)})).catch((function(e){n(e)}))}))},qe=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4;return!!e&&new Promise((function(n,i){var r=new Le.providers.Web3Provider(window.ethereum);r.getBalance(e).then((function(e){var i=Number(Le.utils.formatEther(e)).toFixed(t);n(i)})).catch((function(e){i(e)}))}))},Ye=function(e){return new Promise((function(t,n){var i=["function totalSupply() external view returns (uint)"],r=Ce(e,i);r.totalSupply().then((function(e){t(e)})).catch((function(e){n(e)}))}))},Xe={nft:new Ie,exchange:new De,blin:new Ne,ido:new Be,usdt:new Fe,lp:new Ue,singleCurrency:new ze,nftPledge:new Ge,getReserves:We,approve:ke,decimals:Ve,allowance:He,walletBalance:qe,balanceOf:je,totalSupply:Ye,contractInfo:Pe},Ze=function(e){for(var t in e.prototype.$contract={},Xe)e.prototype.$contract[t]=Xe[t]};window.contract=Xe;var Je={install:Ze},Qe=(n("157a"),n("b970")),Ke={responseType:"json",method:"post",baseURL:"https://api.blin.pro",headers:{"Content-type":"application/x-www-form-urlencoded"},data:{},timeout:1e4,withCredentials:!1},$e=n("4328"),et=n.n($e);function tt(e){return new Promise((function(t,n){var i=Ee.a.create({baseURL:Ke.baseURL,transformResponse:[function(e){}]});i.interceptors.request.use((function(e){var t=sessionStorage.getItem("token");if(t&&(e.headers["token"]=t),e.header){var n=e.header;for(var i in n)e.headers[i]=n[i]}return"post"!==e.method.toLocaleLowerCase()&&"put"!==e.method.toLocaleLowerCase()&&"delete"!==e.method.toLocaleLowerCase()||(e.data=et.a.stringify(e.data)),e}),(function(e){return Promise.reject(e)})),i.interceptors.response.use((function(e){var t=void 0===e.data?e.request.responseText:e.data;switch(t=JSON.parse(t),t.code){case 200:return t;default:Object(le["a"])(t.msg+"~"),n();break}}),(function(e){return Promise.reject(e)})),i(e).then((function(e){return t(e),!1})).catch((function(e){n(e)}))}))}var nt=function(e){return tt({url:"postUrl",method:"post",data:e})},it=function(e){return tt({url:"postUrl",method:"post",data:e})},rt=function(e){return tt({url:"postUrl",method:"post",params:e,header:{"Content-Type":"multipart/form-data"}})},at=function(e){return tt({url:"getUrl",method:"get",params:e})},ot=function(e){return tt({url:"putFn/".concat(e.id),method:"put",data:e})},st=function(e){return tt({url:"deleteUrl/".concat(e.id),method:"delete",params:e})},ct=function(e){return tt({url:"/user/banner",method:"get",params:e})},lt=function(e){return tt({url:"/user/cards",method:"get",params:e})},ut=function(e){return tt({url:"/user/category",method:"get",params:e})},ht=function(e){return tt({url:"/user/category_nft",method:"get",params:e})},dt=function(e){return tt({url:"/user/buy",method:"get",params:e})},pt=function(e){return tt({url:"/user/buy_all",method:"get",params:e})},ft=function(e){return tt({url:"/user/cards_details",method:"get",params:e})},mt=function(e){return tt({url:"/user/hash",method:"get",params:e})},gt=function(e){return tt({url:"/user/rand_cards",method:"get",params:e})},vt=function(e){return tt({url:"/user/open",method:"get",params:e})},yt=function(e){return tt({url:"/user/open_box",method:"get",params:e})},xt=function(e){return tt({url:"/user/buy_user",method:"get",params:e})},bt=function(e){return tt({url:"/user/buy_box_user",method:"get",params:e})},wt=function(e){return tt({url:"/user/upgrade",method:"get",params:e})},_t=function(e){return tt({url:"/user/airdrop",method:"get",params:e})},Mt=function(e){return tt({url:"/user/receive_box",method:"get",params:e})},St={postFn:it,upload:rt,getFn:at,putFn:ot,deleteFn:st,login:nt,homeBanner:ct,homeRecommendCard:lt,cardCategory:ut,cardList:ht,blindBoxList:dt,blindBoxAllList:pt,cardDetails:ft,queryHash:mt,queryBlindboxHash:gt,openBlindBox:vt,openBlindboxInfo:yt,userCardList:xt,userBlindboxList:bt,upgradeCard:wt,boxAirdropStatus:_t,receiveAirdrop:Mt},Tt=function e(t){e.installed||(e.installed=!0,Object.defineProperties(t.prototype,{$api:{get:function(){return St}}}))},Et=Tt,At=n("3835"),Lt=(n("ffc1"),{});function Ct(e){return e.keys().map((function(t){var n=t.replace(/^\.\//,"").replace(/.vue$/,"").replace(/[a-zA-Z]+\//,"").replace(/([A-Z])/g,"-$1").replace(/-/,"").toLowerCase();Lt[n]=e(t).default}))}Ct(n("a1b2"));var Rt=function(e){Object.entries(Lt).forEach((function(t){var n=Object(At["a"])(t,2),i=n[0],r=n[1];e.component(i,r)}))},Pt={install:Rt},Ot=n("7212"),It=n.n(Ot),Dt=(n("a7a3"),n("b047")),Nt=Dt.utils;r.a.prototype.$bn=Nt,r.a.use(Se),r.a.use(Je),r.a.use(Qe["a"]),r.a.use(Et),r.a.use(Pt),r.a.use(It.a),r.a.config.productionTip=!1,r.a.prototype.priceNum=1e18,r.a.prototype.coinZeroNum={bnb:"18",blin:"8"},r.a.prototype.imgSite="https://admindapp.blin.pro",r.a.prototype.$requestUrl="https://api.blin.pro",new r.a({router:I,store:$,i18n:ie,render:function(e){return e(u)}}).$mount("#app")},"57b6":function(e,t,n){"use strict";var i=n("f329"),r=n.n(i);r.a},6:function(e,t){},"602b":function(e,t,n){e.exports=n.p+"static/img/menu_icon12.5fe73023.png"},"62cb":function(e,t,n){"use strict";n.r(t);var i=function(){var e=this,t=e.$createElement;e._self._c;return e._m(0)},r=[function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"footer"},[i("div",{staticClass:"footer-nav"},[i("a",{attrs:{href:"https://twitter.com/BlinMetaverse"}},[i("img",{attrs:{src:n("9317")}}),e._v(" "),i("span",[e._v("Twitter")])]),e._v(" "),i("a",{attrs:{href:"https://t.me/Blin_Metaverse"}},[i("img",{attrs:{src:n("8f46")}}),e._v(" "),i("span",[e._v("Telegram")])]),e._v(" "),i("a",{attrs:{href:"https://medium.com/@Blin_Metaverse"}},[i("img",{attrs:{src:n("3da8")}}),e._v(" "),i("span",[e._v("Medium")])]),e._v(" "),i("a",{attrs:{href:"mailto:BlinMetaverse@outlook.com"}},[i("img",{attrs:{src:n("4a34")}}),e._v(" "),i("span",[e._v("Email")])]),e._v(" "),i("a",{attrs:{href:"https://blinmetaverse.gitbook.io/blin-metaverse/"}},[i("img",{attrs:{src:n("3051")}}),e._v(" "),i("span",[e._v("GitBook")])])])])}],a={name:"ComFooter"},o=a,s=(n("e2f6"),n("2877")),c=Object(s["a"])(o,i,r,!1,null,"766a1b1b",null);t["default"]=c.exports},"664b":function(e,t,n){e.exports=n.p+"static/img/shut_icon.7b5fe70a.png"},"6cc1":function(e,t,n){"use strict";var i=n("a3dc"),r=n.n(i);r.a},"6d04":function(e,t,n){e.exports=n.p+"static/img/menu_icon9.6ca19672.png"},"6f26":function(e,t,n){},7:function(e,t){},7571:function(e,t,n){e.exports=n.p+"static/img/menu_icon1.6ae34f74.png"},"75dc":function(e,t,n){e.exports=n.p+"static/img/menu_icon11.9ea9aeda.png"},"7bc7":function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IArs4c6QAACA1JREFUeF7tnU+IFEcUxl/1gLs6u4Html7/5KIeFCJECBoIRNGTxINJDgpBc8ghESIYbzm6Qk45xYRIQnIIRAnoJTEkhoBE1JOagIcIBqIGkjVOb/Vld5ZV2KrQZIRAnK7Xr7unq2vewLCHqffqve/7TXf1TNeOgBIfcRzvCoLgVQB4AQCi/rNd4hQup7oDAOnzD631n0EQnJVS3nK54LQ2UbTAXq+3dnFx8bAQ4jUhxKai+TyLPwcA56SU6V8nH4UAiON4JgiCNwFgnZPduVPURa31kSiKbrtT0r+VkAFQSl0GgB2uNeRqPcaY+VardWhqauq8SzWSAFBKxQDQcamRptRijHm30+m870q9uQFQSt0FgPWuNNDEOrTWJ6IomnGh9lwAKKXOAsB+Fwpveg2uQIAGoL/gO9504V2q3wUIUACkl3pLS0s3MKt9IcRVAPhqeXn51vj4+K+Tk5PpesH7h1LqGQDYAgDpX/ThvW4IUADkePeflFIe895tS4NKqT0A8B4AbMNoUScEKACUUr8DwMasZqSUqFwYQXwYo5R6CgA+x66Z6oLAalq3293barW+yzJFCHEoDMMzPhhXdg95Fs51QGAFQCn1CQAczhDmgpRyb9nC+ZTPZQgwAFwDgO2DDAmC4OjU1NRHPhlWRS+uQoABwPbBzx4p5Y9ViOZbThchwACwAAADv9IdGxtbMzEx8cA3s6rqxzUIMAAYXv2Xi4NLEDAA5XqLzuYKBAwA2rLyB7oAAQNQvq+5MtYNAQOQy65qBtcJAQNQjae5s9YFAQOQ26rqAuqAgAGozk9S5mFDwACQbKo2aJgQMADVeknOPiwIGACyRdUHDgMCBqB6HwvNkAcCIcSRMAxP5ZmQAcijVk1j80Cgtd4WRdHP2FIZAKxSNY/DQmCMiVeuXLm13W7fx5TMAGBUcmQMFgIhxLdhGO7DlM0AYFRyaAwWAgA4gNmVzAA4ZC62FCQE6bb0A7acDIBNIQdf799yfhGx72CL7Z9UMAAOGowpqb/55IessZjbzBkAjNqOjlFKpXs1s7ahfSGlfCOrfGcASJLka2NMevu56/9tZFYIcT0Mw1fq5iJJkoPGmNOD6hBCXArDcLfzACilMm88rVvoQfPXvR0uSZJnjTE3M/S5J6Xc4DQAyBWtqwygVtpVFm9789ggrf0UMDc397cQYnWVIlWV2xjzoNPprKkqPyZv4wFQSv3VgPP+IC9mpZRPY4yqakzjAegv/l6uSqAq8wohvql7Mdh4AFKDbE1UaWKR3Lbza5Hc2FibdrYaa18DPG40XQwaY3a6vh5Iz/tCiMuYj1mxJhYZ5w0ARUQY5VgGYJTdR5w+G3MKGHEfye3zEYAsnR+BDIAfPpK7YADI0vkRyAD44SO5CwaALJ0fgQyAHz6Su2AAyNL5EcgA+OEjuQsGgCydH4EMgB8+krtgAMjS+RHIAPjhI7kLBoAsnR+B3gDQoH0BRckpdV+BFwDYmiiquKvxtu/qMXXbtLPNUfstYQ3fF4DxKGtM4X0FjQegyfsCirpfxr6CxgPQ8H0BRRkovK+g8QA0eV9AUffL2FfQeABSEW1NFBXa1XjbAg1Tt0072xy1LwIfN9mUfQEYU7LGlL2vwBsAigo7qvEMwKg63++bAWAACv2qmzNrgBH3kdw+HwHI0vkRyAD44SO5CwaALJ0fgQyAHz6Su2AAyNL5EcgA+OEjuQsGgCydH4EMgB8+krtgAMjS+RHIAPjhI7kLBoAsnR+BDIAfPpK78AYA3hdAY8ALAGxN0KRxP8p2uxamA5t2tjlq/zqY9wXYf9krC4TGA8D7Aor93kDjAeB9AcV+b6DxAPC+gGI/PtV4ANLzm60JzGKoiWNsCzRMTzbtbHPUvgh83CTvC8DY/f8x3gBAa5+jGIARZ4ABYAB4X8AoM8BHgFF2H3EF1ZirgBH3kdw+HwHI0vkRyAD44SO5CwaALJ0fgQyAHz6Su2AAyNL5EcgA+OEjuQsGgCydH4EMgB8+krtgAMjS+RHIAPjhI7kLBoAsnR+BDIAfPpK7YADI0vkRyAD44SO5i2EAsAAA7UEVrlixYnpycjImd8CBZAXm5+ejR48edTMS9KSUE1kTYO4KvgsA6wcl0VrvjqLoErkLDiQrEMfxriAIfspIcE9KuaEoANcAYPugJEKII2EYniJ3wYFkBZIkedsY83FGgutSyueLAnASAI5mAHA1DMMd5C44kKxAkiRXjDEvZiT4UEr5TiEAEIeZNP9JKeUxciccmFsBpdQHAJBpLub0bF0DpJXNzc3dFkJsyqrSdvNh7g45IFMB2+rfGPNbp9PZbJMRBUAcxzNBEBy3JhPiUBiGZ2zj+HW6AkmSHDTGnLZl0FqfiKJoxjYOBUCv11u7tLR0AwDW2RICwIUgCC5orW+PjY3dnJiYeICI4SEDFFhYWFj98OHDrUEQbNZavwQA6dP2mB0fH9/Wbrfv2waiAEiTYI8Ctgn59eoVwL7700rQAKSDlVKXAYBX/NV7WGSGK1LKndgEuQDoQ5B+6tfBTsDjhqrAnJQyyjNjbgD6EGR+OpinAB5bmgLWT/2eNBMJgD4EZwFgf2nlc6IiCpB/hZwMQB+C9NLwLeTVQZEGOfbJCsxqrT/DXO4NErAQAGnS9BJxcXHxcBAErwPARnZqKArc0Vp/uWrVqk8xl3pZFRUG4L/Ju93u3lartQ8AngOAdDGSPgd+lTwUqZo/SS+9Cu8/f1leXj4/PT39fVlt/QMjMljMBTE8eQAAAABJRU5ErkJggiOheHv/23fRANjdugDBb1u2qWmnsPZGXZOPBgAajRwKCpNP3dUJNf3eFmD7QoOgHKBCpn27tfeyADsQgGPShoNleACzf5rizEQQAHY4OLbe6fazJcuIgl6p3znnF0IIcLKjn2AARtbgFD5Xwhh7GV2blsEhCYDiL1P0+nEh0QCMQIDpCsCwDUbA0a42RIRB/cQYgx7+yDmHmdd16EehXMUnA8BVUPu9TAk0AMrUS7ZaNQCyibrMghoAZeolW60aANlEXWZBDYAy9ZKtVg2AbKIus6AGQJl6yVarBkA2UZdZUAOgTL1kq1UDIJuoyyyoAVCmXrLV6n9CJorb5/YCEQAAAABJRU5ErkJggg=="},"7c94":function(e,t,n){"use strict";var i=n("b2d3"),r=n.n(i);r.a},8:function(e,t){},"803f":function(e,t,n){},"83d6":function(e,t,n){"use strict";var i=n("17f1"),r=n.n(i);r.a},"8bbf":function(e,t){e.exports=Vue},"8f46":function(e,t,n){e.exports=n.p+"static/img/telegram_icon.36f42f55.png"},9:function(e,t){},9245:function(e,t,n){e.exports=n.p+"static/img/blin_white_logo.773d09fd.png"},9317:function(e,t,n){e.exports=n.p+"static/img/twitter_icon.00d12653.png"},"9a52":function(e,t,n){e.exports=n.p+"static/img/menu_icon3.9c24ec87.png"},a1b2:function(e,t,n){var i={"./ComFooter.vue":"62cb","./ComHeader.vue":"c6b3","./ComLoading.vue":"3cb7","./ComNothing.vue":"ecf6","./ComPageTop.vue":"b8a6","./ComStarAnimate.vue":"0dd4","./GoodsMask.vue":"13ff","./SwapHeader.vue":"cab9","./SwapTool.vue":"099f"};function r(e){var t=a(e);return n(t)}function a(e){if(!n.o(i,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return i[e]}r.keys=function(){return Object.keys(i)},r.resolve=a,e.exports=r,r.id="a1b2"},a3dc:function(e,t,n){},a4b1:function(e,t,n){},a7c7:function(e,t,n){"use strict";var i=n("087a"),r=n.n(i);r.a},a839:function(e,t,n){},a9c8:function(e,t,n){e.exports=n.p+"static/img/menu_icon10.e162dd44.png"},b2d3:function(e,t,n){},b8a6:function(e,t,n){"use strict";n.r(t);var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"com-page-top"},[n("h2",{staticClass:"com-page-title",style:{color:e.color}},[e._v("\n "+e._s(e.title)+"\n ")]),e._v(" "),e.desc?n("p",{staticClass:"com-page-desc",style:{color:e.color}},[e._v(e._s(e.desc))]):e._e()])},r=[],a={name:"ComPageTop",props:{title:{type:String,default:""},desc:{type:String,default:""},color:{type:String,default:"#fff"}}},o=a,s=(n("0e02"),n("2877")),c=Object(s["a"])(o,i,r,!1,null,"30591bda",null);t["default"]=c.exports},c418:function(e,t,n){e.exports=n.p+"static/img/menu_icon4.ae703ef8.png"},c6b3:function(e,t,n){"use strict";n.r(t);var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("van-nav-bar",{staticClass:"header",attrs:{title:e.title,"left-text":"返回","left-arrow":""},on:{"click-left":e.handleBack},scopedSlots:e._u([{key:"right",fn:function(){return[n("van-icon",{attrs:{name:"search"}})]},proxy:!0}])})},r=[],a={name:"ComHeader",props:{title:{type:String,default:""}},methods:{handleBack:function(){this.$router.go(-1)}}},o=a,s=(n("db6c"),n("2877")),c=Object(s["a"])(o,i,r,!1,null,null,null);t["default"]=c.exports},c875:function(e,t,n){e.exports=n.p+"static/img/menu_icon8.e77d3049.png"},cab9:function(e,t,n){"use strict";n.r(t);var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"swap-header"},[n("router-link",{attrs:{to:"/swap"}},[e._v("兑换")])],1)},r=[],a={name:"SwapHeader"},o=a,s=(n("7c94"),n("2877")),c=Object(s["a"])(o,i,r,!1,null,"df15bfb6",null);t["default"]=c.exports},d2e7:function(e,t,n){},d4f7:function(e,t,n){},d500:function(e,t){e.exports={singleCurrency:{title:"Genesis Airdrop",desc:"Just stake some tokens to mine",pledge:"Staking",receive:"Receive",harvest:"Harvest",networkPledge:"Network Staking",blindBox:" Blind box",redeem:"Redeem",stakeTips1:"The amount of pledge cannot be greater than the current available balance",stakeTips2:"The pledge amount cannot be equal to 0",redeemTips:"You still have a blind box that has not been collected, please collect it first and then redeem it",pledgeNum:"Staking amount",balance:"Available balance",maskInput:"Please enter the pledge amount",pledgeAll:"Staking all",confirm:"Confirm",pledgeSuccess:"Staking success",receivedSuccess:"Received success",redeemSuccess:"Redemption successful",rulesTitle:"Airdrop Rules",rulesDesc:'The Genesis Airdrop officially ended at 12:00 UTC on September 16, 2021, and the "Mining Spaceship-Pools" was officially launched. The Pools now supports BLIN, USDT, BNB, BAKE, CHR, ETH, SKILL, TLM single currency staking to produce BLIN. Users who participate in the Genesis Airdrop activity are requested to receive the blind box as soon as possible and can redeem the staked assets at any time according to their wishes. This page will be closed after the user\'s related staked assets are all redeemed. ',rulesDesc1:"Special note: If the staking assets have the same currency in the Pools, the user does not need to redeem the staked assets, and the smart contract has been automatically switched to the Pools staked. ",rulesCoin:"Token",rulesCoinNum:"Quantity",viewAll:"Click to view all"},common:{confirming:"Confirming",errMsg1:"User rejected the request",errMsg2:"The requested method and/or account is not authorized by the user",errMsg3:"The provider does not support the requested method",errMsg4:"The provider is disconnected from all chains",errMsg5:"The provider is not connected to the requested chain",errMsg6:"Parse error invalid JSON",errMsg7:"Insufficient balance after purchase failed",errMsg8:"Operation failed",connect:"Connect wallet",farms:"Mining Spaceship",genesisAirdrop:"Genesis Airdrop",webSite:"Website",ido:"SpaceStation",home:"Home",nftStore:"NFT Galaxies",nftStoreItem1:"The Empire of Jade",nftStoreItem2:"The Star of Movie",nftStoreItem3:"THe Mainland of E-gaming",nftStoreItem4:"The Mailstone of Culture ",trade:"Exchange",exchange:"Swap",fluidity:"Liquidity",park:"Portal",info:"Info",market:"Open Market",nftMining:"NFT Mining",syrup:"Pools",liquidityMining:"Farms",copySuccess:"Copy Success",buy:"Buy",providerInfo:"Provider not found",myCard:"My NFTs",myBlindbox:"My blind box",comingSoon:"Coming soon",back:"Back",noData:"No Data",version:"Version",publicBeta:"Public Beta",requestErr:"An error occurred in the request",openBoxTips:"Click on the box to open the blind box",congratulationsGet:"Congratulations on getting",card:"card",total:"Total obtained: 1",staking:"Deactivate mining",opening:"Opening"},ido:{label1:"Amount",label2:"Price",label3:"Proportion",label4:"Start",label5:"End",submit:"Submit",submitEd:"Submitted",submitSuccess:"Submitted successfully",walletBalance:"Wallet balance",statusText1:"Not Start",statusText2:"On Going",statusText3:"Ended",statusText4:"Sold Out",statusText5:"已购买",aboutTitle:"Summry",timeFormat:"DD d HH h mm m ss s",aboutDesc1:"Blin Metaverse is a decentralized and comprehensive NFT infrastructure based on Binance Smart Chain. Aims to reshape through IP,virtual social networking, NFT assets casting, right confirmation and value circulation on the chain ,to realize the comprehensive decentralized NFT infrastructure of diversified virtual reality interaction.",aboutDesc2:"The BLIN is a platform token of Blin Metaverse based on DAO governance. ",stationTitle:"How to launch your own space station?",stationDesc:"Start your project with Blin Metaverse. Blin Metaverse is a decentralized trading platform using an automated market maker (AMM) model and one-click platform of NFT minting and auction."},home:{buy:"Buy now",staking:"Staking now",auditAuthority:"Audit",walletOfSupport:"Support",loadmoreCard:"View more cards"},blindbox:{title:"Blind box",desc:"Open blind boxes can obtain high-value NFT cards by randomly.",name:"Name",series:"Series",price:"Price",num:"Quantity",individual:"Individual",luckyDrawDesc:"When you open the blind box of the Empire of Jade,you have the chance to get the following series f NFT cards: Source of Empire Green,Source of Violet ,Source of Red,Source of Blue,Source of Black and Source of Warrior.",buy:"Buy now",buySuccess:"Successful purchase"},nftDetails:{title:"NFT cards",desc:"NFT cards have collection rights or can be pledged to mine to obtain BLIN.",name:"Name",id:"NFT ID",series:"Series",price:"Price",priceValue:"Value",num:"Quantity",sheet:"Sheet",buy:"Buy now",buySuccess:"Successful purchase",walletBalance:"Wallet balance",insufficientQuantity:"Insufficient quantity remaining"},swap:{title:"Swap",desc:"Trade tokens in an instant",from:"From",to:"To",balance:"Balance",slippage:"Slippage Tolerance",settings:"Set up",max:"Max",submit:"Submit",submitSuccess:"Submitted successfully",tips1:"Please enter the correct quantity",tips2:"The quantity entered cannot be greater than the balance"},farms:{title:"Liquidity Mining",desc:"Staking token to liquidity pool to earn.",quantityReceived:"Available",earningsReceived:"Income received",freshmanIncome:"Freshman income",stakingValue:"TVL"},userCard:{title:"My NFTs",desc:"All NFT cards are saved here.",wholeCardTitle:"Complete cards",goPledge:"De-stake mining",brokenCardTitle:"Fragmented cards",brokenCardDesc:"Cards fragmented but can be upgraded to complete.",synthesis:"Synthesis",notEnough:"Your Source of Fracture is not enough to synthesize",synthesisSuccess:"Successful synthesis"},userBlindbox:{title:"My Blinds boxes",desc:"Click here can open to get all sealed blinds boxes.",open:"Open",blindboxTips:"You have a blind box to be picked up",receiveSuccess:"Receive success"},pledge:{title:"NFT Mining",desc:"Check the NFT cards you own and earn mining income.",earned:"Earned",harvest:"Harvest",balance:"Balance",walletCardTitle:"NFT cards in the wallet",miningCardTitle:"NFT cards in mining",goView:"Go check",activation:"Activate mining",transfer:"Transfer",redeem:"Receive",activity:"Activity",profit:"income",upgrade:"Upgrade cards",receiveBox:"Get the peripheral box",increase:"Increase activity",receiveProfit:"Receive income",popupTitle1:"Increase activity",extendable:"Extendable",day:"day",popup1Input1:"Please enter active days",popup1Tips1:"Please enter active days",popup1Tips2:"The number of active days cannot be greater than the maximum number of days that can be extended",popup1Tips3:"Active days cannot be less than 1",popupTitle2:"Fill in the delivery address",popup2Input1:"Please enter your recipient name",popup2Input2:"Please enter your mobile number",popup2Input3:"Please enter your delivery address",popup2Tips1:"The recipient name cannot be empty",popup2Tips2:"Phone number cannot be empty",popup2Tips3:"The delivery address cannot be empty",popupTitle3:"Transfer card",popup3Input1:"Please enter your recipient address",popup3Tips1:"Please enter the address of the card recipient",pledgeSuccess:"Pledge success",notBeUpgraded:"The current card cannot be upgraded",updateSuccess:"Update successed",submitSuccess:"Submitted successfully",transferSuccess:"Successful transfer",insufficientBalance:"Insufficient balance",receivedSuccess:"Received successfully",redemptionSuccess:"Redemption successful",estimatePrice:"Expect to pay",dayToMore:"Days exceeded",toRedeem:"To Redeem"},energyPool:{title:"Pools",desc:"Just stake some tokens to earn.High APR,low risk.",pledge:"Staking",pledgeNum:"Staking Amount",receive:"Receive",harvest:"Harvest",networkPledge:"Network Staking",redeem:"Redeem",apr:"APR",stakeTips1:"The amount of pledge cannot be greater than the current available balance",stakeTips2:"The pledge amount cannot be equal to 0",balance:"Available balance",maskInput:"Please enter the pledge amount",pledgeAll:"Staking all",confirm:"Confirm",pledgeSuccess:"Staking success",receivedSuccess:"Received success",redeemSuccess:"Redemption successful",rulesDesc:"Users can pledge the corresponding amount of coins to conduct Pools mining.",rulesCoin:"Token",rulesCoinNum:"Quantity",viewAll:"Click to view all"},portal:{title:"The Mainland of E-gaming",desc:"About to teleport through the Portal."}}},db6c:function(e,t,n){"use strict";var i=n("ee57"),r=n.n(i);r.a},e098:function(e,t,n){e.exports=n.p+"static/img/menu_icon6.8ae23b5f.png"},e2f6:function(e,t,n){"use strict";var i=n("d4f7"),r=n.n(i);r.a},e5fc:function(e,t,n){e.exports=n.p+"static/img/time_icon.aee78ca4.png"},ecf6:function(e,t,n){"use strict";n.r(t);var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"com-nothing"},[n("van-empty",{staticClass:"custom-image",attrs:{image:"https://img01.yzcdn.cn/vant/custom-empty-image.png",description:e.$t("common.noData")}})],1)},r=[],a={name:"ComNothing"},o=a,s=(n("2414"),n("2877")),c=Object(s["a"])(o,i,r,!1,null,null,null);t["default"]=c.exports},ee57:function(e,t,n){},f329:function(e,t,n){}},[[0,"runtime","chunk-libs"]]]);