chunk-eec60f30.f3b6e4b5.js 1008 KB

123
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-eec60f30"],{"09fa":function(t,e,i){var n=i("4588"),r=i("9def");t.exports=function(t){if(void 0===t)return 0;var e=n(t),i=r(e);if(e!==i)throw RangeError("Wrong length!");return i}},"0f88":function(t,e,i){var n,r=i("7726"),o=i("32e9"),s=i("ca5a"),a=s("typed_array"),l=s("view"),c=!(!r.ArrayBuffer||!r.DataView),h=c,u=0,d=9,p="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");while(u<d)(n=r[p[u++]])?(o(n.prototype,a,!0),o(n.prototype,l,!0)):h=!1;t.exports={ABV:c,CONSTR:h,TYPED:a,VIEW:l}},"13b9a":function(t,e,i){"use strict";var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"c__color-picker"},[i("div",{staticClass:"c__block",style:{backgroundColor:t.curColor},on:{click:function(e){e.stopPropagation(),!t.disabled&&(t.showPanel=!0)}}}),t._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:t.showPanel,expression:"showPanel"}],staticClass:"c__panel",on:{click:function(t){t.stopPropagation()}}},[i("div",{staticClass:"c__canvas"},[i("canvas",{attrs:{id:t.canvasId,width:t.width,height:t.height},on:{click:t.onCanvasClick,mousedown:t.onCanvasMousedown}}),t._v(" "),i("em",{staticClass:"c__cur",attrs:{id:t.curId},on:{mousedown:function(e){t.onCanvasMousedown(e,"cur")}}}),t._v(" "),i("em",{staticClass:"c__bar",attrs:{id:t.barId},on:{mousedown:function(e){t.onCanvasMousedown(e,"bar")}}}),t._v(" "),t.showAlpha?i("div",{staticClass:"c__alpha-silder"},[i("div",{staticClass:"c__alpha-silder-bar",style:t.alphaBarStyle,on:{click:t.onAlphaClick,mousedown:t.onAlphaMousedown}}),t._v(" "),i("em",{staticClass:"c__alpha",style:{left:100*t.alpha+"%"},attrs:{id:t.alphaId},on:{mousedown:t.onAlphaMousedown}})]):t._e()]),t._v(" "),i("div",{staticClass:"c__control"},[i("input",{staticClass:"c__input",domProps:{value:t.curColor}}),t._v(" "),i("div",{staticClass:"c__btns"},[i("div",{staticClass:"c__btn-clear",on:{click:function(e){t.curColor=""}}},[t._v("清空")]),t._v(" "),i("div",{staticClass:"c__btn-confirm",on:{click:t.confirm}},[t._v("确定")])])])])])},r=[],o=(i("6b54"),i("a481"),i("28a5"),{name:"el-color-picker",props:{value:{type:String,default:"#ff0000"},disabled:{type:Boolean,default:!1},showAlpha:{type:Boolean,default:!1},colorFormat:{type:String,default:"hex"}},data:function(){return{canvasId:"canvas-"+Date.now(),curId:"cur-"+Date.now(),barId:"bar-"+Date.now(),alphaId:"alpha-"+Date.now(),canvas:null,ctx:null,curColor:"",activeColor:"",alpha:1,width:286,height:200,showPanel:!1}},computed:{alphaBarStyle:function(){return"background: linear-gradient(to right, rgba(255, 69, 0, 0) 0%, "+this.activeColor+" 100%);"}},watch:{value:function(t){this.curColor=t,this.resetCurColor()}},created:function(){var t=this,e=this;this.handler=function(t){e.showPanel=!1},document.body.addEventListener("click",this.handler),this.$nextTick((function(){t.curColor=t.value,t.activeColor="#ff0000",t.resetCurColor(),t.init()}))},beforeDestroy:function(){document.body.removeEventListener("click",this.handler)},methods:{init:function(){this.canvas=document.getElementById(this.canvasId),this.ctx=this.canvas.getContext("2d"),this.makeColorBar(),this.makeColorBox("#ff0000")},makeColorBar:function(){var t=this.ctx.createLinearGradient(0,0,0,this.height);t.addColorStop(0,"#f00"),t.addColorStop(1/6,"#f0f"),t.addColorStop(2/6,"#00f"),t.addColorStop(.5,"#0ff"),t.addColorStop(4/6,"#0f0"),t.addColorStop(5/6,"#ff0"),t.addColorStop(1,"#f00"),this.ctx.fillStyle=t,this.ctx.fillRect(0,0,20,this.height)},makeColorBox:function(t){var e=this.ctx.createLinearGradient(30,0,this.width,0);e.addColorStop(1,t),e.addColorStop(0,"rgba(255,255,255,1)"),this.ctx.fillStyle=e,this.ctx.fillRect(30,0,this.width,this.height);var i=this.ctx.createLinearGradient(0,0,0,this.height);i.addColorStop(0,"rgba(0,0,0,0)"),i.addColorStop(1,"rgba(0,0,0,1)"),this.ctx.fillStyle=i,this.ctx.fillRect(30,0,this.width,this.height)},onCanvasClick:function(t){var e={x:t.offsetX||t.layerX,y:t.offsetY||t.layerY},i="#000";if(e.x>=0&&e.x<20){i=this.getRgbaAtPoint(e,"bar");var n=document.getElementById(this.barId);n.style.top=e.y+"px",this.makeColorBox("rgb("+i.slice(0,3).join()+")"),this.$emit("active-change",this.rgb2hex("rgba("+i.slice(0,3).join()+","+this.alpha+")"))}else{if(!(e.x>=30))return;i=this.getRgbaAtPoint(e,"box");var r=document.getElementById(this.curId);r.style.left=e.x+"px",r.style.top=e.y+"px"}this.setCurColor(i)},onCanvasMousedown:function(t,e){var i=this,n={x:t.layerX||t.offsetX,y:t.layerY||t.offsetY},r=parseInt(t.target.offsetTop),o=parseInt(t.target.offsetLeft);if("cur"===e||n.x>=30&&n.x<30+this.width&&n.y>=0&&n.y<this.height){var s=document.getElementById(this.curId);document.onmouseup=function(){document.onmouseup=document.onmousemove=null},document.onmousemove=function(e){try{var n={x:e.clientX-t.clientX+t.offsetX+o,y:e.clientY-t.clientY+t.offsetY+r};n.x=n.x<=30?30:n.x&&(n.x>i.width?i.width:n.x),n.y=n.y<=0?0:n.y&&(n.y>i.height?i.height:n.y);var a=i.getRgbaAtPoint(n,"box");i.setCurColor(a),s.style.left=n.x+"px",s.style.top=n.y+"px"}catch(e){console.log(e)}}}else if(n.x<=20&&n.y<=this.height){var a=document.getElementById(this.barId);document.onmouseup=function(){document.onmouseup=document.onmousemove=null},document.onmousemove=function(e){try{var n={x:0,y:e.clientY-t.clientY+t.offsetY+r};n.y=n.y<=0?0:n.y&&(n.y>i.height?i.height:n.y);var o=i.getRgbaAtPoint(n,"box");a.style.top=n.y+"px",i.activeColor=i.rgb2hex("rgb("+o.slice(0,3).join()+")"),i.makeColorBox("rgb("+o.slice(0,3).join()+")"),i.$emit("active-change",i.activeColor)}catch(e){console.log(e)}}}},onAlphaClick:function(t){var e=t.offsetX||t.layerX,i=document.getElementById(this.alphaId),n=i.parentNode;this.alpha=parseFloat(e/n.clientWidth).toFixed(2),this.resetCurColor()},onAlphaMousedown:function(t){var e=this,i=(t.layerX||t.offsetX,t.layerY||t.offsetY,parseInt(t.target.offsetTop),parseInt(t.target.offsetLeft)),n=document.getElementById(this.alphaId),r=n.parentNode;document.onmouseup=function(){document.onmouseup=document.onmousemove=null},document.onmousemove=function(n){try{var o={x:n.clientX-t.clientX+t.offsetX+i,y:0};o.x=o.x<=0?0:o.x&&(o.x>r.clientWidth?r.clientWidth:o.x),e.alpha=parseFloat(o.x/r.clientWidth).toFixed(2),e.resetCurColor()}catch(n){console.log(n)}}},resetCurColor:function(){var t=this.curColor,e=this.alpha,i=/^(rgb|RGB)/;i.test(t)||(t=this.hex2rgb(t.slice(0,7)));var n=t.replace(/(?:rgba|rgb|RGBA|RGB|\(|\))*/g,"").split(",");n[3]=e,this.setCurColor(n)},setCurColor:function(t){var e="a";(4===t.length&&"1"==t[3]||!this.showAlpha)&&(t=t.slice(0,3),e=""),"hex"===this.colorFormat?this.curColor=this.rgb2hex("rgb"+e+"("+t.join()+")"):"rgb"===this.colorFormat&&(this.curColor="rgb"+e+"("+t.join()+")"),this.$emit("input",this.curColor),this.sendChange()},confirm:function(){this.sendChange(),this.showPanel=!1},sendChange:function(){this.$emit("change",this.curColor)},getRgbaAtPoint:function(t,e){if("bar"==e)var i=this.ctx.getImageData(0,0,20,this.height);else i=this.ctx.getImageData(0,0,this.width,this.height);var n=i.data,r=4*(t.y*i.width+t.x);return t.x>=30&&t.y>this.height-3?[0,0,0,this.alpha]:(t.x>=30&&t.y<=1&&(n[r]=255),t.x>=30&&t.x<=31?[n[r],n[r],n[r],this.alpha]:t.x>=this.width-1?[n[r],0,0,this.alpha]:[n[r],n[r+1],n[r+2],this.alpha])},rgb2hex:function(t){var e,i=/^(rgb|RGB)/;if(i.test(t)){var n=t.replace(/(?:rgba|rgb|RGBA|RGB|\(|\))*/g,"").split(","),r=(n&&n[3]||"").trim(),o="#"+((1<<24)+(parseInt(n[0])<<16)+(parseInt(n[1])<<8)+parseInt(n[2])).toString(16).slice(1);return""!=r&&"1"!=r&&(e=(255*r|256).toString(16).slice(1),o+=e),o}return t},hex2rgb:function(t){var e=/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/,i=t.toLowerCase();if(e.test(i)){if(4===i.length){for(var n="#",r=1;r<i.length;r+=1)n+=i.slice(r,r+1).concat(i.slice(r,r+1));i=n}var o=[];for(r=1;r<i.length;r+=2)o.push(parseInt("0x"+i.slice(r,r+2)));return"rgb("+o.join(",")+")"}return i}}}),s=o,a=(i("ba40"),i("2877")),l=Object(a["a"])(s,n,r,!1,null,null,null),c=l.exports;const h=function(t){h.installed||t.component(c.name,c)};"undefined"!==typeof window&&window.Vue&&h(window.Vue);e["a"]={install:h,...c}},"235d":function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const r=n(i("e834"));class o extends Error{constructor(t){t=t&&t.split("\n")[0],super(t)}}e.RunJSError=o;class s{title(...t){console.log(r.default.bold(...t))}log(...t){console.log(...t)}warning(...t){console.warn(r.default.yellow(...t))}error(...t){console.error(r.default.red(...t))}}e.Logger=s;class a{title(){}log(){}warning(){}error(){}}e.SilentLogger=a,e.logger=new s},"2fdb":function(t,e,i){"use strict";var n=i("5ca1"),r=i("d2c8"),o="includes";n(n.P+n.F*i("5147")(o),"String",{includes:function(t){return!!~r(this,t,o).indexOf(t,arguments.length>1?arguments[1]:void 0)}})},"36bd":function(t,e,i){"use strict";var n=i("4bf8"),r=i("77f1"),o=i("9def");t.exports=function(t){var e=n(this),i=o(e.length),s=arguments.length,a=r(s>1?arguments[1]:void 0,i),l=s>2?arguments[2]:void 0,c=void 0===l?i:r(l,i);while(c>a)e[a++]=t;return e}},"386b":function(t,e,i){var n=i("5ca1"),r=i("79e5"),o=i("be13"),s=/"/g,a=function(t,e,i,n){var r=String(o(t)),a="<"+e;return""!==i&&(a+=" "+i+'="'+String(n).replace(s,"&quot;")+'"'),a+">"+r+"</"+e+">"};t.exports=function(t,e){var i={};i[t]=e(a),n(n.P+n.F*r((function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3})),"String",i)}},"3b2b":function(t,e,i){var n=i("7726"),r=i("5dbc"),o=i("86cc").f,s=i("9093").f,a=i("aae3"),l=i("0bfb"),c=n.RegExp,h=c,u=c.prototype,d=/a/g,p=/a/g,f=new c(d)!==d;if(i("9e1e")&&(!f||i("79e5")((function(){return p[i("2b4c")("match")]=!1,c(d)!=d||c(p)==p||"/a/i"!=c(d,"i")})))){c=function(t,e){var i=this instanceof c,n=a(t),o=void 0===e;return!i&&n&&t.constructor===c&&o?t:r(f?new h(n&&!o?t.source:t,e):h((n=t instanceof c)?t.source:t,n&&o?l.call(t):e),i?this:u,c)};for(var m=function(t){t in c||o(c,t,{configurable:!0,get:function(){return h[t]},set:function(e){h[t]=e}})},g=s(h),v=0;g.length>v;)m(g[v++]);u.constructor=c,c.prototype=u,i("2aba")(n,"RegExp",c)}i("7a56")("RegExp")},"3e8f":function(t,e){},4721:function(t,e,i){"use strict";i.d(e,"a",(function(){return r}));var n=i("5a89"),r=function(t,e){void 0===e&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),e===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=t,this.domElement=e,this.enabled=!0,this.target=new n["y"],this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={LEFT:n["m"].ROTATE,MIDDLE:n["m"].DOLLY,RIGHT:n["m"].PAN},this.touches={ONE:n["w"].ROTATE,TWO:n["w"].DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return h.phi},this.getAzimuthalAngle=function(){return h.theta},this.saveState=function(){i.target0.copy(i.target),i.position0.copy(i.object.position),i.zoom0=i.object.zoom},this.reset=function(){i.target.copy(i.target0),i.object.position.copy(i.position0),i.object.zoom=i.zoom0,i.object.updateProjectionMatrix(),i.dispatchEvent(r),i.update(),l=a.NONE},this.update=function(){var e=new n["y"],o=(new n["t"]).setFromUnitVectors(t.up,new n["y"](0,1,0)),s=o.clone().inverse(),m=new n["y"],g=new n["t"],v=2*Math.PI;return function(){var t=i.object.position;e.copy(t).sub(i.target),e.applyQuaternion(o),h.setFromVector3(e),i.autoRotate&&l===a.NONE&&E(S()),i.enableDamping?(h.theta+=u.theta*i.dampingFactor,h.phi+=u.phi*i.dampingFactor):(h.theta+=u.theta,h.phi+=u.phi);var n=i.minAzimuthAngle,y=i.maxAzimuthAngle;return isFinite(n)&&isFinite(y)&&(n<-Math.PI?n+=v:n>Math.PI&&(n-=v),y<-Math.PI?y+=v:y>Math.PI&&(y-=v),h.theta=n<y?Math.max(n,Math.min(y,h.theta)):h.theta>(n+y)/2?Math.max(n,h.theta):Math.min(y,h.theta)),h.phi=Math.max(i.minPolarAngle,Math.min(i.maxPolarAngle,h.phi)),h.makeSafe(),h.radius*=d,h.radius=Math.max(i.minDistance,Math.min(i.maxDistance,h.radius)),!0===i.enableDamping?i.target.addScaledVector(p,i.dampingFactor):i.target.add(p),e.setFromSpherical(h),e.applyQuaternion(s),t.copy(i.target).add(e),i.object.lookAt(i.target),!0===i.enableDamping?(u.theta*=1-i.dampingFactor,u.phi*=1-i.dampingFactor,p.multiplyScalar(1-i.dampingFactor)):(u.set(0,0,0),p.set(0,0,0)),d=1,!!(f||m.distanceToSquared(i.object.position)>c||8*(1-g.dot(i.object.quaternion))>c)&&(i.dispatchEvent(r),m.copy(i.object.position),g.copy(i.object.quaternion),f=!1,!0)}}(),this.dispose=function(){i.domElement.removeEventListener("contextmenu",at,!1),i.domElement.removeEventListener("mousedown",Q,!1),i.domElement.removeEventListener("wheel",it,!1),i.domElement.removeEventListener("touchstart",rt,!1),i.domElement.removeEventListener("touchend",st,!1),i.domElement.removeEventListener("touchmove",ot,!1),i.domElement.ownerDocument.removeEventListener("mousemove",tt,!1),i.domElement.ownerDocument.removeEventListener("mouseup",et,!1),i.domElement.removeEventListener("keydown",nt,!1)};var i=this,r={type:"change"},o={type:"start"},s={type:"end"},a={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},l=a.NONE,c=1e-6,h=new n["v"],u=new n["v"],d=1,p=new n["y"],f=!1,m=new n["x"],g=new n["x"],v=new n["x"],y=new n["x"],x=new n["x"],b=new n["x"],w=new n["x"],_=new n["x"],M=new n["x"];function S(){return 2*Math.PI/60/60*i.autoRotateSpeed}function T(){return Math.pow(.95,i.zoomSpeed)}function E(t){u.theta-=t}function A(t){u.phi-=t}var L=function(){var t=new n["y"];return function(e,i){t.setFromMatrixColumn(i,0),t.multiplyScalar(-e),p.add(t)}}(),C=function(){var t=new n["y"];return function(e,n){!0===i.screenSpacePanning?t.setFromMatrixColumn(n,1):(t.setFromMatrixColumn(n,0),t.crossVectors(i.object.up,t)),t.multiplyScalar(e),p.add(t)}}(),P=function(){var t=new n["y"];return function(e,n){var r=i.domElement;if(i.object.isPerspectiveCamera){var o=i.object.position;t.copy(o).sub(i.target);var s=t.length();s*=Math.tan(i.object.fov/2*Math.PI/180),L(2*e*s/r.clientHeight,i.object.matrix),C(2*n*s/r.clientHeight,i.object.matrix)}else i.object.isOrthographicCamera?(L(e*(i.object.right-i.object.left)/i.object.zoom/r.clientWidth,i.object.matrix),C(n*(i.object.top-i.object.bottom)/i.object.zoom/r.clientHeight,i.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),i.enablePan=!1)}}();function R(t){i.object.isPerspectiveCamera?d/=t:i.object.isOrthographicCamera?(i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom*t)),i.object.updateProjectionMatrix(),f=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function O(t){i.object.isPerspectiveCamera?d*=t:i.object.isOrthographicCamera?(i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/t)),i.object.updateProjectionMatrix(),f=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function k(t){m.set(t.clientX,t.clientY)}function D(t){w.set(t.clientX,t.clientY)}function I(t){y.set(t.clientX,t.clientY)}function N(t){g.set(t.clientX,t.clientY),v.subVectors(g,m).multiplyScalar(i.rotateSpeed);var e=i.domElement;E(2*Math.PI*v.x/e.clientHeight),A(2*Math.PI*v.y/e.clientHeight),m.copy(g),i.update()}function B(t){_.set(t.clientX,t.clientY),M.subVectors(_,w),M.y>0?R(T()):M.y<0&&O(T()),w.copy(_),i.update()}function z(t){x.set(t.clientX,t.clientY),b.subVectors(x,y).multiplyScalar(i.panSpeed),P(b.x,b.y),y.copy(x),i.update()}function F(){}function U(t){t.deltaY<0?O(T()):t.deltaY>0&&R(T()),i.update()}function G(t){var e=!1;switch(t.keyCode){case i.keys.UP:P(0,i.keyPanSpeed),e=!0;break;case i.keys.BOTTOM:P(0,-i.keyPanSpeed),e=!0;break;case i.keys.LEFT:P(i.keyPanSpeed,0),e=!0;break;case i.keys.RIGHT:P(-i.keyPanSpeed,0),e=!0;break}e&&(t.preventDefault(),i.update())}function H(t){if(1==t.touches.length)m.set(t.touches[0].pageX,t.touches[0].pageY);else{var e=.5*(t.touches[0].pageX+t.touches[1].pageX),i=.5*(t.touches[0].pageY+t.touches[1].pageY);m.set(e,i)}}function j(t){if(1==t.touches.length)y.set(t.touches[0].pageX,t.touches[0].pageY);else{var e=.5*(t.touches[0].pageX+t.touches[1].pageX),i=.5*(t.touches[0].pageY+t.touches[1].pageY);y.set(e,i)}}function W(t){var e=t.touches[0].pageX-t.touches[1].pageX,i=t.touches[0].pageY-t.touches[1].pageY,n=Math.sqrt(e*e+i*i);w.set(0,n)}function V(t){i.enableZoom&&W(t),i.enablePan&&j(t)}function X(t){i.enableZoom&&W(t),i.enableRotate&&H(t)}function Y(t){if(1==t.touches.length)g.set(t.touches[0].pageX,t.touches[0].pageY);else{var e=.5*(t.touches[0].pageX+t.touches[1].pageX),n=.5*(t.touches[0].pageY+t.touches[1].pageY);g.set(e,n)}v.subVectors(g,m).multiplyScalar(i.rotateSpeed);var r=i.domElement;E(2*Math.PI*v.x/r.clientHeight),A(2*Math.PI*v.y/r.clientHeight),m.copy(g)}function q(t){if(1==t.touches.length)x.set(t.touches[0].pageX,t.touches[0].pageY);else{var e=.5*(t.touches[0].pageX+t.touches[1].pageX),n=.5*(t.touches[0].pageY+t.touches[1].pageY);x.set(e,n)}b.subVectors(x,y).multiplyScalar(i.panSpeed),P(b.x,b.y),y.copy(x)}function Z(t){var e=t.touches[0].pageX-t.touches[1].pageX,n=t.touches[0].pageY-t.touches[1].pageY,r=Math.sqrt(e*e+n*n);_.set(0,r),M.set(0,Math.pow(_.y/w.y,i.zoomSpeed)),R(M.y),w.copy(_)}function J(t){i.enableZoom&&Z(t),i.enablePan&&q(t)}function K(t){i.enableZoom&&Z(t),i.enableRotate&&Y(t)}function $(){}function Q(t){if(!1!==i.enabled){var e;switch(t.preventDefault(),i.domElement.focus?i.domElement.focus():window.focus(),t.button){case 0:e=i.mouseButtons.LEFT;break;case 1:e=i.mouseButtons.MIDDLE;break;case 2:e=i.mouseButtons.RIGHT;break;default:e=-1}switch(e){case n["m"].DOLLY:if(!1===i.enableZoom)return;D(t),l=a.DOLLY;break;case n["m"].ROTATE:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===i.enablePan)return;I(t),l=a.PAN}else{if(!1===i.enableRotate)return;k(t),l=a.ROTATE}break;case n["m"].PAN:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===i.enableRotate)return;k(t),l=a.ROTATE}else{if(!1===i.enablePan)return;I(t),l=a.PAN}break;default:l=a.NONE}l!==a.NONE&&(i.domElement.ownerDocument.addEventListener("mousemove",tt,!1),i.domElement.ownerDocument.addEventListener("mouseup",et,!1),i.dispatchEvent(o))}}function tt(t){if(!1!==i.enabled)switch(t.preventDefault(),l){case a.ROTATE:if(!1===i.enableRotate)return;N(t);break;case a.DOLLY:if(!1===i.enableZoom)return;B(t);break;case a.PAN:if(!1===i.enablePan)return;z(t);break}}function et(t){!1!==i.enabled&&(F(t),i.domElement.ownerDocument.removeEventListener("mousemove",tt,!1),i.domElement.ownerDocument.removeEventListener("mouseup",et,!1),i.dispatchEvent(s),l=a.NONE)}function it(t){!1===i.enabled||!1===i.enableZoom||l!==a.NONE&&l!==a.ROTATE||(t.preventDefault(),t.stopPropagation(),i.dispatchEvent(o),U(t),i.dispatchEvent(s))}function nt(t){!1!==i.enabled&&!1!==i.enableKeys&&!1!==i.enablePan&&G(t)}function rt(t){if(!1!==i.enabled){switch(t.preventDefault(),t.touches.length){case 1:switch(i.touches.ONE){case n["w"].ROTATE:if(!1===i.enableRotate)return;H(t),l=a.TOUCH_ROTATE;break;case n["w"].PAN:if(!1===i.enablePan)return;j(t),l=a.TOUCH_PAN;break;default:l=a.NONE}break;case 2:switch(i.touches.TWO){case n["w"].DOLLY_PAN:if(!1===i.enableZoom&&!1===i.enablePan)return;V(t),l=a.TOUCH_DOLLY_PAN;break;case n["w"].DOLLY_ROTATE:if(!1===i.enableZoom&&!1===i.enableRotate)return;X(t),l=a.TOUCH_DOLLY_ROTATE;break;default:l=a.NONE}break;default:l=a.NONE}l!==a.NONE&&i.dispatchEvent(o)}}function ot(t){if(!1!==i.enabled)switch(t.preventDefault(),t.stopPropagation(),l){case a.TOUCH_ROTATE:if(!1===i.enableRotate)return;Y(t),i.update();break;case a.TOUCH_PAN:if(!1===i.enablePan)return;q(t),i.update();break;case a.TOUCH_DOLLY_PAN:if(!1===i.enableZoom&&!1===i.enablePan)return;J(t),i.update();break;case a.TOUCH_DOLLY_ROTATE:if(!1===i.enableZoom&&!1===i.enableRotate)return;K(t),i.update();break;default:l=a.NONE}}function st(t){!1!==i.enabled&&($(t),i.dispatchEvent(s),l=a.NONE)}function at(t){!1!==i.enabled&&t.preventDefault()}i.domElement.addEventListener("contextmenu",at,!1),i.domElement.addEventListener("mousedown",Q,!1),i.domElement.addEventListener("wheel",it,!1),i.domElement.addEventListener("touchstart",rt,!1),i.domElement.addEventListener("touchend",st,!1),i.domElement.addEventListener("touchmove",ot,!1),i.domElement.addEventListener("keydown",nt,!1),-1===i.domElement.tabIndex&&(i.domElement.tabIndex=0),this.update()};r.prototype=Object.create(n["e"].prototype),r.prototype.constructor=r;var o=function(t,e){r.call(this,t,e),this.screenSpacePanning=!1,this.mouseButtons.LEFT=n["m"].PAN,this.mouseButtons.RIGHT=n["m"].ROTATE,this.touches.ONE=n["w"].PAN,this.touches.TWO=n["w"].DOLLY_ROTATE};o.prototype=Object.create(n["e"].prototype),o.prototype.constructor=o},4941:function(t,e,i){
  2. /*! WebUploader 0.1.6 */
  3. var n=i("1157");t.exports=function(t,e){var i={},r=function(t,e){var i,n,r;if("string"===typeof t)return a(t);for(i=[],n=t.length,r=0;r<n;r++)i.push(a(t[r]));return e.apply(null,i)},o=function(t,e,i){2===arguments.length&&(i=e,e=null),r(e||[],(function(){s(t,i,arguments)}))},s=function(t,e,n){var o,s={exports:e};"function"===typeof e&&(n.length||(n=[r,s.exports,s]),o=e.apply(null,n),void 0!==o&&(s.exports=o)),i[t]=s.exports},a=function(e){var n=i[e]||t[e];if(!n)throw new Error("`"+e+"` is undefined");return n},l=function(t){var e,n,r,o,s,a;for(e in a=function(t){return t&&t.charAt(0).toUpperCase()+t.substr(1)},i)if(n=t,i.hasOwnProperty(e)){r=e.split("/"),s=a(r.pop());while(o=a(r.shift()))n[o]=n[o]||{},n=n[o];n[s]=i[e]}return t},c=function(i){return t.__dollar=i,l(e(t,o,r))};return c(n)}(window,(function(t,e,i){e("dollar-third",[],(function(){var e=t.require,i=t.__dollar||t.jQuery||t.Zepto||e("jquery")||e("zepto");if(!i)throw new Error("jQuery or Zepto not found!");return i})),e("dollar",["dollar-third"],(function(t){return t})),e("promise-third",["dollar"],(function(t){return{Deferred:t.Deferred,when:t.when,isPromise:function(t){return t&&"function"===typeof t.then}}})),e("promise",["promise-third"],(function(t){return t})),e("base",["dollar","promise"],(function(e,i){var n=function(){},r=Function.call;function o(t){return function(){return r.apply(t,arguments)}}function s(t,e){return function(){return t.apply(e,arguments)}}function a(t){var e;return Object.create?Object.create(t):(e=function(){},e.prototype=t,new e)}return{version:"0.1.6",$:e,Deferred:i.Deferred,isPromise:i.isPromise,when:i.when,browser:function(t){var e={},i=t.match(/WebKit\/([\d.]+)/),n=t.match(/Chrome\/([\d.]+)/)||t.match(/CriOS\/([\d.]+)/),r=t.match(/MSIE\s([\d\.]+)/)||t.match(/(?:trident)(?:.*rv:([\w.]+))?/i),o=t.match(/Firefox\/([\d.]+)/),s=t.match(/Safari\/([\d.]+)/),a=t.match(/OPR\/([\d.]+)/);return i&&(e.webkit=parseFloat(i[1])),n&&(e.chrome=parseFloat(n[1])),r&&(e.ie=parseFloat(r[1])),o&&(e.firefox=parseFloat(o[1])),s&&(e.safari=parseFloat(s[1])),a&&(e.opera=parseFloat(a[1])),e}(navigator.userAgent),os:function(t){var e={},i=t.match(/(?:Android);?[\s\/]+([\d.]+)?/),n=t.match(/(?:iPad|iPod|iPhone).*OS\s([\d_]+)/);return i&&(e.android=parseFloat(i[1])),n&&(e.ios=parseFloat(n[1].replace(/_/g,"."))),e}(navigator.userAgent),inherits:function(t,i,n){var r;return"function"===typeof i?(r=i,i=null):r=i&&i.hasOwnProperty("constructor")?i.constructor:function(){return t.apply(this,arguments)},e.extend(!0,r,t,n||{}),r.__super__=t.prototype,r.prototype=a(t.prototype),i&&e.extend(!0,r.prototype,i),r},noop:n,bindFn:s,log:function(){return t.console?s(console.log,console):n}(),nextTick:function(){return function(t){setTimeout(t,1)}}(),slice:o([].slice),guid:function(){var t=0;return function(e){for(var i=(+new Date).toString(32),n=0;n<5;n++)i+=Math.floor(65535*Math.random()).toString(32);return(e||"wu_")+i+(t++).toString(32)}}(),formatSize:function(t,e,i){var n;i=i||["B","K","M","G","TB"];while((n=i.shift())&&t>1024)t/=1024;return("B"===n?t:t.toFixed(e||2))+n}}})),e("mediator",["base"],(function(t){var e,i=t.$,n=[].slice,r=/\s+/;function o(t,e,n,r){return i.grep(t,(function(t){return t&&(!e||t.e===e)&&(!n||t.cb===n||t.cb._cb===n)&&(!r||t.ctx===r)}))}function s(t,e,n){i.each((t||"").split(r),(function(t,i){n(i,e)}))}function a(t,e){var i,n=!1,r=-1,o=t.length;while(++r<o)if(i=t[r],!1===i.cb.apply(i.ctx2,e)){n=!0;break}return!n}return e={on:function(t,e,i){var n,r=this;return e?(n=this._events||(this._events=[]),s(t,e,(function(t,e){var o={e:t};o.cb=e,o.ctx=i,o.ctx2=i||r,o.id=n.length,n.push(o)})),this):this},once:function(t,e,i){var n=this;return e?(s(t,e,(function(t,e){var r=function(){return n.off(t,r),e.apply(i||n,arguments)};r._cb=e,n.on(t,r,i)})),n):n},off:function(t,e,n){var r=this._events;return r?t||e||n?(s(t,e,(function(t,e){i.each(o(r,t,e,n),(function(){delete r[this.id]}))})),this):(this._events=[],this):this},trigger:function(t){var e,i,r;return this._events&&t?(e=n.call(arguments,1),i=o(this._events,t),r=o(this._events,"all"),a(i,e)&&a(r,arguments)):this}},i.extend({installTo:function(t){return i.extend(t,e)}},e)})),e("uploader",["base","mediator"],(function(t,e){var i=t.$;function n(t){this.options=i.extend(!0,{},n.options,t),this._init(this.options)}return n.options={},e.installTo(n.prototype),i.each({upload:"start-upload",stop:"stop-upload",getFile:"get-file",getFiles:"get-files",addFile:"add-file",addFiles:"add-file",sort:"sort-files",removeFile:"remove-file",cancelFile:"cancel-file",skipFile:"skip-file",retry:"retry",isInProgress:"is-in-progress",makeThumb:"make-thumb",md5File:"md5-file",getDimension:"get-dimension",addButton:"add-btn",predictRuntimeType:"predict-runtime-type",refresh:"refresh",disable:"disable",enable:"enable",reset:"reset"},(function(t,e){n.prototype[t]=function(){return this.request(e,arguments)}})),i.extend(n.prototype,{state:"pending",_init:function(t){var e=this;e.request("init",t,(function(){e.state="ready",e.trigger("ready")}))},option:function(t,e){var n=this.options;if(!(arguments.length>1))return t?n[t]:n;i.isPlainObject(e)&&i.isPlainObject(n[t])?i.extend(n[t],e):n[t]=e},getStats:function(){var t=this.request("get-stats");return t?{successNum:t.numOfSuccess,progressNum:t.numOfProgress,cancelNum:t.numOfCancel,invalidNum:t.numOfInvalid,uploadFailNum:t.numOfUploadFailed,queueNum:t.numOfQueue,interruptNum:t.numofInterrupt}:{}},trigger:function(t){var n=[].slice.call(arguments,1),r=this.options,o="on"+t.substring(0,1).toUpperCase()+t.substring(1);return!(!1===e.trigger.apply(this,arguments)||i.isFunction(r[o])&&!1===r[o].apply(this,n)||i.isFunction(this[o])&&!1===this[o].apply(this,n)||!1===e.trigger.apply(e,[this,t].concat(n)))},destroy:function(){this.request("destroy",arguments),this.off()},request:t.noop}),t.create=n.create=function(t){return new n(t)},t.Uploader=n,n})),e("runtime/runtime",["base","mediator"],(function(t,e){var i=t.$,n={},r=function(t){for(var e in t)if(t.hasOwnProperty(e))return e;return null};function o(e){this.options=i.extend({container:document.body},e),this.uid=t.guid("rt_")}return i.extend(o.prototype,{getContainer:function(){var t,e,n=this.options;return this._container?this._container:(t=i(n.container||document.body),e=i(document.createElement("div")),e.attr("id","rt_"+this.uid),e.css({position:"absolute",top:"0px",left:"0px",width:"1px",height:"1px",overflow:"hidden"}),t.append(e),t.addClass("webuploader-container"),this._container=e,this._parent=t,e)},init:t.noop,exec:t.noop,destroy:function(){this._container&&this._container.remove(),this._parent&&this._parent.removeClass("webuploader-container"),this.off()}}),o.orders="html5,flash",o.addRuntime=function(t,e){n[t]=e},o.hasRuntime=function(t){return!!(t?n[t]:r(n))},o.create=function(t,e){var s,a;if(e=e||o.orders,i.each(e.split(/\s*,\s*/g),(function(){if(n[this])return s=this,!1})),s=s||r(n),!s)throw new Error("Runtime Error");return a=new n[s](t),a},e.installTo(o.prototype),o})),e("runtime/client",["base","mediator","runtime/runtime"],(function(t,e,i){var n;function r(e,r){var o,s=t.Deferred();this.uid=t.guid("client_"),this.runtimeReady=function(t){return s.done(t)},this.connectRuntime=function(e,a){if(o)throw new Error("already connected!");return s.done(a),"string"===typeof e&&n.get(e)&&(o=n.get(e)),o=o||n.get(null,r),o?(t.$.extend(o.options,e),o.__promise.then(s.resolve),o.__client++):(o=i.create(e,e.runtimeOrder),o.__promise=s.promise(),o.once("ready",s.resolve),o.init(),n.add(o),o.__client=1),r&&(o.__standalone=r),o},this.getRuntime=function(){return o},this.disconnectRuntime=function(){o&&(o.__client--,o.__client<=0&&(n.remove(o),delete o.__promise,o.destroy()),o=null)},this.exec=function(){if(o){var i=t.slice(arguments);return e&&i.unshift(e),o.exec.apply(this,i)}},this.getRuid=function(){return o&&o.uid},this.destroy=function(t){return function(){t&&t.apply(this,arguments),this.trigger("destroy"),this.off(),this.exec("destroy"),this.disconnectRuntime()}}(this.destroy)}return n=function(){var t={};return{add:function(e){t[e.uid]=e},get:function(e,i){var n;if(e)return t[e];for(n in t)if(!i||!t[n].__standalone)return t[n];return null},remove:function(e){delete t[e.uid]}}}(),e.installTo(r.prototype),r})),e("lib/dnd",["base","mediator","runtime/client"],(function(t,e,i){var n=t.$;function r(t){t=this.options=n.extend({},r.options,t),t.container=n(t.container),t.container.length&&i.call(this,"DragAndDrop")}return r.options={accept:null,disableGlobalDnd:!1},t.inherits(i,{constructor:r,init:function(){var t=this;t.connectRuntime(t.options,(function(){t.exec("init"),t.trigger("ready")}))}}),e.installTo(r.prototype),r})),e("widgets/widget",["base","uploader"],(function(t,e){var i=t.$,n=e.prototype._init,r=e.prototype.destroy,o={},s=[];function a(t){if(!t)return!1;var e=t.length,n=i.type(t);return!(1!==t.nodeType||!e)||("array"===n||"function"!==n&&"string"!==n&&(0===e||"number"===typeof e&&e>0&&e-1 in t))}function l(t){this.owner=t,this.options=t.options}return i.extend(l.prototype,{init:t.noop,invoke:function(t,e){var n=this.responseMap;return n&&t in n&&n[t]in this&&i.isFunction(this[n[t]])?this[n[t]].apply(this,e):o},request:function(){return this.owner.request.apply(this.owner,arguments)}}),i.extend(e.prototype,{_init:function(){var t=this,e=t._widgets=[],r=t.options.disableWidgets||"";return i.each(s,(function(i,n){(!r||!~r.indexOf(n._name))&&e.push(new n(t))})),n.apply(t,arguments)},request:function(e,i,n){var r,s,l,c,h=0,u=this._widgets,d=u&&u.length,p=[],f=[];for(i=a(i)?i:[i];h<d;h++)r=u[h],s=r.invoke(e,i),s!==o&&(t.isPromise(s)?f.push(s):p.push(s));return n||f.length?(l=t.when.apply(t,f),c=l.pipe?"pipe":"then",l[c]((function(){var e=t.Deferred(),i=arguments;return 1===i.length&&(i=i[0]),setTimeout((function(){e.resolve(i)}),1),e.promise()}))[n?c:"done"](n||t.noop)):p[0]},destroy:function(){r.apply(this,arguments),this._widgets=null}}),e.register=l.register=function(e,n){var r,o={init:"init",destroy:"destroy",name:"anonymous"};return 1===arguments.length?(n=e,i.each(n,(function(t){"_"!==t[0]&&"name"!==t?o[t.replace(/[A-Z]/g,"-$&").toLowerCase()]=t:"name"===t&&(o.name=n.name)}))):o=i.extend(o,e),n.responseMap=o,r=t.inherits(l,n),r._name=o.name,s.push(r),r},e.unRegister=l.unRegister=function(t){if(t&&"anonymous"!==t)for(var e=s.length;e--;)s[e]._name===t&&s.splice(e,1)},l})),e("widgets/filednd",["base","uploader","lib/dnd","widgets/widget"],(function(t,e,i){var n=t.$;return e.options.dnd="",e.register({name:"dnd",init:function(e){if(e.dnd&&"html5"===this.request("predict-runtime-type")){var r,o=this,s=t.Deferred(),a=n.extend({},{disableGlobalDnd:e.disableGlobalDnd,container:e.dnd,accept:e.accept});return this.dnd=r=new i(a),r.once("ready",s.resolve),r.on("drop",(function(t){o.request("add-file",[t])})),r.on("accept",(function(t){return o.owner.trigger("dndAccept",t)})),r.init(),s.promise()}},destroy:function(){this.dnd&&this.dnd.destroy()}})})),e("lib/filepaste",["base","mediator","runtime/client"],(function(t,e,i){var n=t.$;function r(t){t=this.options=n.extend({},t),t.container=n(t.container||document.body),i.call(this,"FilePaste")}return t.inherits(i,{constructor:r,init:function(){var t=this;t.connectRuntime(t.options,(function(){t.exec("init"),t.trigger("ready")}))}}),e.installTo(r.prototype),r})),e("widgets/filepaste",["base","uploader","lib/filepaste","widgets/widget"],(function(t,e,i){var n=t.$;return e.register({name:"paste",init:function(e){if(e.paste&&"html5"===this.request("predict-runtime-type")){var r,o=this,s=t.Deferred(),a=n.extend({},{container:e.paste,accept:e.accept});return this.paste=r=new i(a),r.once("ready",s.resolve),r.on("paste",(function(t){o.owner.request("add-file",[t])})),r.init(),s.promise()}},destroy:function(){this.paste&&this.paste.destroy()}})})),e("lib/blob",["base","runtime/client"],(function(t,e){function i(t,i){var n=this;n.source=i,n.ruid=t,this.size=i.size||0,!i.type&&this.ext&&~"jpg,jpeg,png,gif,bmp".indexOf(this.ext)?this.type="image/"+("jpg"===this.ext?"jpeg":this.ext):this.type=i.type||"application/octet-stream",e.call(n,"Blob"),this.uid=i.uid||this.uid,t&&n.connectRuntime(t)}return t.inherits(e,{constructor:i,slice:function(t,e){return this.exec("slice",t,e)},getSource:function(){return this.source}}),i})),e("lib/file",["base","lib/blob"],(function(t,e){var i=1,n=/\.([^.]+)$/;function r(t,r){var o;this.name=r.name||"untitled"+i++,o=n.exec(r.name)?RegExp.$1.toLowerCase():"",!o&&r.type&&(o=/\/(jpg|jpeg|png|gif|bmp)$/i.exec(r.type)?RegExp.$1.toLowerCase():"",this.name+="."+o),this.ext=o,this.lastModifiedDate=r.lastModifiedDate||(new Date).toLocaleString(),e.apply(this,arguments)}return t.inherits(e,r)})),e("lib/filepicker",["base","runtime/client","lib/file"],(function(e,i,n){var r=e.$;function o(t){if(t=this.options=r.extend({},o.options,t),t.container=r(t.id),!t.container.length)throw new Error("按钮指定错误");t.innerHTML=t.innerHTML||t.label||t.container.html()||"",t.button=r(t.button||document.createElement("div")),t.button.html(t.innerHTML),t.container.html(t.button),i.call(this,"FilePicker",!0)}return o.options={button:null,container:null,label:null,innerHTML:null,multiple:!0,accept:null,name:"file",style:"webuploader-pick"},e.inherits(i,{constructor:o,init:function(){var i=this,o=i.options,s=o.button,a=o.style;a&&s.addClass("webuploader-pick"),i.on("all",(function(t){var e;switch(t){case"mouseenter":a&&s.addClass("webuploader-pick-hover");break;case"mouseleave":a&&s.removeClass("webuploader-pick-hover");break;case"change":e=i.exec("getFiles"),i.trigger("select",r.map(e,(function(t){return t=new n(i.getRuid(),t),t._refer=o.container,t})),o.container);break}})),i.connectRuntime(o,(function(){i.refresh(),i.exec("init",o),i.trigger("ready")})),this._resizeHandler=e.bindFn(this.refresh,this),r(t).on("resize",this._resizeHandler)},refresh:function(){var t=this.getRuntime().getContainer(),e=this.options.button,i=e.outerWidth?e.outerWidth():e.width(),n=e.outerHeight?e.outerHeight():e.height(),r=e.offset();i&&n&&t.css({bottom:"auto",right:"auto",width:i+"px",height:n+"px"}).offset(r)},enable:function(){var t=this.options.button;t.removeClass("webuploader-pick-disable"),this.refresh()},disable:function(){var t=this.options.button;this.getRuntime().getContainer().css({top:"-99999px"}),t.addClass("webuploader-pick-disable")},destroy:function(){var e=this.options.button;r(t).off("resize",this._resizeHandler),e.removeClass("webuploader-pick-disable webuploader-pick-hover webuploader-pick")}}),o})),e("widgets/filepicker",["base","uploader","lib/filepicker","widgets/widget"],(function(t,e,i){var n=t.$;return n.extend(e.options,{pick:null,accept:null}),e.register({name:"picker",init:function(t){return this.pickers=[],t.pick&&this.addBtn(t.pick)},refresh:function(){n.each(this.pickers,(function(){this.refresh()}))},addBtn:function(e){var r=this,o=r.options,s=o.accept,a=[];if(e)return n.isPlainObject(e)||(e={id:e}),n(e.id).each((function(){var l,c,h;h=t.Deferred(),l=n.extend({},e,{accept:n.isPlainObject(s)?[s]:s,swf:o.swf,runtimeOrder:o.runtimeOrder,id:this}),c=new i(l),c.once("ready",h.resolve),c.on("select",(function(t){r.owner.request("add-file",[t])})),c.on("dialogopen",(function(){r.owner.trigger("dialogOpen",c.button)})),c.init(),r.pickers.push(c),a.push(h.promise())})),t.when.apply(t,a)},disable:function(){n.each(this.pickers,(function(){this.disable()}))},enable:function(){n.each(this.pickers,(function(){this.enable()}))},destroy:function(){n.each(this.pickers,(function(){this.destroy()})),this.pickers=null}})})),e("lib/image",["base","runtime/client","lib/blob"],(function(t,e,i){var n=t.$;function r(t){this.options=n.extend({},r.options,t),e.call(this,"Image"),this.on("load",(function(){this._info=this.exec("info"),this._meta=this.exec("meta")}))}return r.options={quality:90,crop:!1,preserveHeaders:!1,allowMagnify:!1},t.inherits(e,{constructor:r,info:function(t){return t?(this._info=t,this):this._info},meta:function(t){return t?(this._meta=t,this):this._meta},loadFromBlob:function(t){var e=this,i=t.getRuid();this.connectRuntime(i,(function(){e.exec("init",e.options),e.exec("loadFromBlob",t)}))},resize:function(){var e=t.slice(arguments);return this.exec.apply(this,["resize"].concat(e))},crop:function(){var e=t.slice(arguments);return this.exec.apply(this,["crop"].concat(e))},getAsDataUrl:function(t){return this.exec("getAsDataUrl",t)},getAsBlob:function(t){var e=this.exec("getAsBlob",t);return new i(this.getRuid(),e)}}),r})),e("widgets/image",["base","uploader","lib/image","widgets/widget"],(function(t,e,i){var n,r=t.$;return n=function(t){var e=0,i=[],n=function(){var n;while(i.length&&e<t)n=i.shift(),e+=n[0],n[1]()};return function(t,r,o){i.push([r,o]),t.once("destroy",(function(){e-=r,setTimeout(n,1)})),setTimeout(n,1)}}(5242880),r.extend(e.options,{thumb:{width:110,height:110,quality:70,allowMagnify:!0,crop:!0,preserveHeaders:!1,type:"image/jpeg"},compress:{width:1600,height:1600,quality:90,allowMagnify:!1,crop:!1,preserveHeaders:!0}}),e.register({name:"image",makeThumb:function(t,e,o,s){var a,l;t=this.request("get-file",t),t.type.match(/^image/)?(a=r.extend({},this.options.thumb),r.isPlainObject(o)&&(a=r.extend(a,o),o=null),o=o||a.width,s=s||a.height,l=new i(a),l.once("load",(function(){t._info=t._info||l.info(),t._meta=t._meta||l.meta(),o<=1&&o>0&&(o=t._info.width*o),s<=1&&s>0&&(s=t._info.height*s),l.resize(o,s)})),l.once("complete",(function(){e(!1,l.getAsDataUrl(a.type)),l.destroy()})),l.once("error",(function(t){e(t||!0),l.destroy()})),n(l,t.source.size,(function(){t._info&&l.info(t._info),t._meta&&l.meta(t._meta),l.loadFromBlob(t.source)}))):e(!0)},beforeSendFile:function(e){var n,o,s=this.options.compress||this.options.resize,a=s&&s.compressSize||0,l=s&&s.noCompressIfLarger||!1;if(e=this.request("get-file",e),s&&~"image/jpeg,image/jpg".indexOf(e.type)&&!(e.size<a)&&!e._compressed)return s=r.extend({},s),o=t.Deferred(),n=new i(s),o.always((function(){n.destroy(),n=null})),n.once("error",o.reject),n.once("load",(function(){var t=s.width,i=s.height;e._info=e._info||n.info(),e._meta=e._meta||n.meta(),t<=1&&t>0&&(t=e._info.width*t),i<=1&&i>0&&(i=e._info.height*i),n.resize(t,i)})),n.once("complete",(function(){var t,i;try{t=n.getAsBlob(s.type),i=e.size,(!l||t.size<i)&&(e.source=t,e.size=t.size,e.trigger("resize",t.size,i)),e._compressed=!0,o.resolve()}catch(r){o.resolve()}})),e._info&&n.info(e._info),e._meta&&n.meta(e._meta),n.loadFromBlob(e.source),o.promise()}})})),e("file",["base","mediator"],(function(t,e){var i=t.$,n="WU_FILE_",r=0,o=/\.([^.]+)$/,s={};function a(){return n+r++}function l(t){this.name=t.name||"Untitled",this.size=t.size||0,this.type=t.type||"application/octet-stream",this.lastModifiedDate=t.lastModifiedDate||1*new Date,this.id=a(),this.ext=o.exec(this.name)?RegExp.$1:"",this.statusText="",s[this.id]=l.Status.INITED,this.source=t,this.loaded=0,this.on("error",(function(t){this.setStatus(l.Status.ERROR,t)}))}return i.extend(l.prototype,{setStatus:function(t,e){var i=s[this.id];"undefined"!==typeof e&&(this.statusText=e),t!==i&&(s[this.id]=t,this.trigger("statuschange",t,i))},getStatus:function(){return s[this.id]},getSource:function(){return this.source},destroy:function(){this.off(),delete s[this.id]}}),e.installTo(l.prototype),l.Status={INITED:"inited",QUEUED:"queued",PROGRESS:"progress",ERROR:"error",COMPLETE:"complete",CANCELLED:"cancelled",INTERRUPT:"interrupt",INVALID:"invalid"},l})),e("queue",["base","mediator","file"],(function(t,e,i){var n=t.$,r=i.Status;function o(){this.stats={numOfQueue:0,numOfSuccess:0,numOfCancel:0,numOfProgress:0,numOfUploadFailed:0,numOfInvalid:0,numofDeleted:0,numofInterrupt:0},this._queue=[],this._map={}}return n.extend(o.prototype,{append:function(t){return this._queue.push(t),this._fileAdded(t),this},prepend:function(t){return this._queue.unshift(t),this._fileAdded(t),this},getFile:function(t){return"string"!==typeof t?t:this._map[t]},fetch:function(t){var e,i,n=this._queue.length;for(t=t||r.QUEUED,e=0;e<n;e++)if(i=this._queue[e],t===i.getStatus())return i;return null},sort:function(t){"function"===typeof t&&this._queue.sort(t)},getFiles:function(){for(var t,e=[].slice.call(arguments,0),i=[],r=0,o=this._queue.length;r<o;r++)t=this._queue[r],e.length&&!~n.inArray(t.getStatus(),e)||i.push(t);return i},removeFile:function(t){var e=this._map[t.id];e&&(delete this._map[t.id],t.destroy(),this.stats.numofDeleted++)},_fileAdded:function(t){var e=this,i=this._map[t.id];i||(this._map[t.id]=t,t.on("statuschange",(function(t,i){e._onFileStatusChange(t,i)})))},_onFileStatusChange:function(t,e){var i=this.stats;switch(e){case r.PROGRESS:i.numOfProgress--;break;case r.QUEUED:i.numOfQueue--;break;case r.ERROR:i.numOfUploadFailed--;break;case r.INVALID:i.numOfInvalid--;break;case r.INTERRUPT:i.numofInterrupt--;break}switch(t){case r.QUEUED:i.numOfQueue++;break;case r.PROGRESS:i.numOfProgress++;break;case r.ERROR:i.numOfUploadFailed++;break;case r.COMPLETE:i.numOfSuccess++;break;case r.CANCELLED:i.numOfCancel++;break;case r.INVALID:i.numOfInvalid++;break;case r.INTERRUPT:i.numofInterrupt++;break}}}),e.installTo(o.prototype),o})),e("widgets/queue",["base","uploader","queue","file","lib/file","runtime/client","widgets/widget"],(function(t,e,i,n,r,o){var s=t.$,a=/\.\w+$/,l=n.Status;return e.register({name:"queue",init:function(e){var n,r,a,l,c,h,u,d=this;if(s.isPlainObject(e.accept)&&(e.accept=[e.accept]),e.accept){for(c=[],a=0,r=e.accept.length;a<r;a++)l=e.accept[a].extensions,l&&c.push(l);c.length&&(h="\\."+c.join(",").replace(/,/g,"$|\\.").replace(/\*/g,".*")+"$"),d.accept=new RegExp(h,"i")}if(d.queue=new i,d.stats=d.queue.stats,"html5"===this.request("predict-runtime-type"))return n=t.Deferred(),this.placeholder=u=new o("Placeholder"),u.connectRuntime({runtimeOrder:"html5"},(function(){d._ruid=u.getRuid(),n.resolve()})),n.promise()},_wrapFile:function(t){if(!(t instanceof n)){if(!(t instanceof r)){if(!this._ruid)throw new Error("Can't add external files.");t=new r(this._ruid,t)}t=new n(t)}return t},acceptFile:function(t){var e=!t||!t.size||this.accept&&a.exec(t.name)&&!this.accept.test(t.name);return!e},_addFile:function(t){var e=this;if(t=e._wrapFile(t),e.owner.trigger("beforeFileQueued",t)){if(e.acceptFile(t))return e.queue.append(t),e.owner.trigger("fileQueued",t),t;e.owner.trigger("error","Q_TYPE_DENIED",t)}},getFile:function(t){return this.queue.getFile(t)},addFile:function(t){var e=this;t.length||(t=[t]),t=s.map(t,(function(t){return e._addFile(t)})),t.length&&(e.owner.trigger("filesQueued",t),e.options.auto&&setTimeout((function(){e.request("start-upload")}),20))},getStats:function(){return this.stats},removeFile:function(t,e){var i=this;t=t.id?t:i.queue.getFile(t),this.request("cancel-file",t),e&&this.queue.removeFile(t)},getFiles:function(){return this.queue.getFiles.apply(this.queue,arguments)},fetchFile:function(){return this.queue.fetch.apply(this.queue,arguments)},retry:function(t,e){var i,n,r,o=this;if(t)return t=t.id?t:o.queue.getFile(t),t.setStatus(l.QUEUED),void(e||o.request("start-upload"));for(i=o.queue.getFiles(l.ERROR),n=0,r=i.length;n<r;n++)t=i[n],t.setStatus(l.QUEUED);o.request("start-upload")},sortFiles:function(){return this.queue.sort.apply(this.queue,arguments)},reset:function(){this.owner.trigger("reset"),this.queue=new i,this.stats=this.queue.stats},destroy:function(){this.reset(),this.placeholder&&this.placeholder.destroy()}})})),e("widgets/runtime",["uploader","runtime/runtime","widgets/widget"],(function(t,e){return t.support=function(){return e.hasRuntime.apply(e,arguments)},t.register({name:"runtime",init:function(){if(!this.predictRuntimeType())throw Error("Runtime Error")},predictRuntimeType:function(){var t,i,n=this.options.runtimeOrder||e.orders,r=this.type;if(!r)for(n=n.split(/\s*,\s*/g),t=0,i=n.length;t<i;t++)if(e.hasRuntime(n[t])){this.type=r=n[t];break}return r}})})),e("lib/transport",["base","runtime/client","mediator"],(function(t,e,i){var n=t.$;function r(t){var i=this;t=i.options=n.extend(!0,{},r.options,t||{}),e.call(this,"Transport"),this._blob=null,this._formData=t.formData||{},this._headers=t.headers||{},this.on("progress",this._timeout),this.on("load error",(function(){i.trigger("progress",1),clearTimeout(i._timer)}))}return r.options={server:"",method:"POST",withCredentials:!1,fileVal:"file",timeout:12e4,formData:{},headers:{},sendAsBinary:!1},n.extend(r.prototype,{appendBlob:function(t,e,i){var n=this,r=n.options;n.getRuid()&&n.disconnectRuntime(),n.connectRuntime(e.ruid,(function(){n.exec("init")})),n._blob=e,r.fileVal=t||r.fileVal,r.filename=i||r.filename},append:function(t,e){"object"===typeof t?n.extend(this._formData,t):this._formData[t]=e},setRequestHeader:function(t,e){"object"===typeof t?n.extend(this._headers,t):this._headers[t]=e},send:function(t){this.exec("send",t),this._timeout()},abort:function(){return clearTimeout(this._timer),this.exec("abort")},destroy:function(){this.trigger("destroy"),this.off(),this.exec("destroy"),this.disconnectRuntime()},getResponse:function(){return this.exec("getResponse")},getResponseAsJson:function(){return this.exec("getResponseAsJson")},getStatus:function(){return this.exec("getStatus")},_timeout:function(){var t=this,e=t.options.timeout;e&&(clearTimeout(t._timer),t._timer=setTimeout((function(){t.abort(),t.trigger("error","timeout")}),e))}}),i.installTo(r.prototype),r})),e("widgets/upload",["base","uploader","file","lib/transport","widgets/widget"],(function(t,e,i,n){var r=t.$,o=t.isPromise,s=i.Status;function a(t,e){var i,n,r=[],o=t.source,s=o.size,a=e?Math.ceil(s/e):1,l=0,c=0;n={file:t,has:function(){return!!r.length},shift:function(){return r.shift()},unshift:function(t){r.unshift(t)}};while(c<a)i=Math.min(e,s-l),r.push({file:t,start:l,end:e?l+i:s,total:s,chunks:a,chunk:c++,cuted:n}),l+=i;return t.blocks=r.concat(),t.remaning=r.length,n}r.extend(e.options,{prepareNextFile:!1,chunked:!1,chunkSize:5242880,chunkRetry:2,threads:3,formData:{}}),e.register({name:"upload",init:function(){var e=this.owner,i=this;this.runing=!1,this.progress=!1,e.on("startUpload",(function(){i.progress=!0})).on("uploadFinished",(function(){i.progress=!1})),this.pool=[],this.stack=[],this.pending=[],this.remaning=0,this.__tick=t.bindFn(this._tick,this),e.on("uploadComplete",(function(t){t.blocks&&r.each(t.blocks,(function(t,e){e.transport&&(e.transport.abort(),e.transport.destroy()),delete e.transport})),delete t.blocks,delete t.remaning}))},reset:function(){this.request("stop-upload",!0),this.runing=!1,this.pool=[],this.stack=[],this.pending=[],this.remaning=0,this._trigged=!1,this._promise=null},startUpload:function(e){var i=this;if(r.each(i.request("get-files",s.INVALID),(function(){i.request("remove-file",this)})),e?(e=e.id?e:i.request("get-file",e),e.getStatus()===s.INTERRUPT?(e.setStatus(s.QUEUED),r.each(i.pool,(function(t,i){i.file===e&&(i.transport&&i.transport.send(),e.setStatus(s.PROGRESS))}))):e.getStatus()!==s.PROGRESS&&e.setStatus(s.QUEUED)):r.each(i.request("get-files",[s.INITED]),(function(){this.setStatus(s.QUEUED)})),i.runing)return t.nextTick(i.__tick);i.runing=!0;var n=[];e||r.each(i.pool,(function(t,e){var r=e.file;r.getStatus()===s.INTERRUPT&&(i._trigged=!1,n.push(r),e.transport&&e.transport.send())})),r.each(n,(function(){this.setStatus(s.PROGRESS)})),e||r.each(i.request("get-files",s.INTERRUPT),(function(){this.setStatus(s.PROGRESS)})),i._trigged=!1,t.nextTick(i.__tick),i.owner.trigger("startUpload")},stopUpload:function(e,i){var n,o=this;if(!0===e&&(i=e,e=null),!1!==o.runing){if(e){if(e=e.id?e:o.request("get-file",e),e.getStatus()!==s.PROGRESS&&e.getStatus()!==s.QUEUED)return;return e.setStatus(s.INTERRUPT),r.each(o.pool,(function(t,i){if(i.file===e)return n=i,!1})),n.transport&&n.transport.abort(),i&&(o._putback(n),o._popBlock(n)),t.nextTick(o.__tick)}o.runing=!1,this._promise&&this._promise.file&&this._promise.file.setStatus(s.INTERRUPT),i&&r.each(o.pool,(function(t,e){e.transport&&e.transport.abort(),e.file.setStatus(s.INTERRUPT)})),o.owner.trigger("stopUpload")}},cancelFile:function(t){t=t.id?t:this.request("get-file",t),t.blocks&&r.each(t.blocks,(function(t,e){var i=e.transport;i&&(i.abort(),i.destroy(),delete e.transport)})),t.setStatus(s.CANCELLED),this.owner.trigger("fileDequeued",t)},isInProgress:function(){return!!this.progress},_getStats:function(){return this.request("get-stats")},skipFile:function(t,e){t=t.id?t:this.request("get-file",t),t.setStatus(e||s.COMPLETE),t.skipped=!0,t.blocks&&r.each(t.blocks,(function(t,e){var i=e.transport;i&&(i.abort(),i.destroy(),delete e.transport)})),this.owner.trigger("uploadSkip",t)},_tick:function(){var e,i,n=this,r=n.options;if(n._promise)return n._promise.always(n.__tick);n.pool.length<r.threads&&(i=n._nextBlock())?(n._trigged=!1,e=function(e){n._promise=null,e&&e.file&&n._startSend(e),t.nextTick(n.__tick)},n._promise=o(i)?i.always(e):e(i)):n.remaning||n._getStats().numOfQueue||n._getStats().numofInterrupt||(n.runing=!1,n._trigged||t.nextTick((function(){n.owner.trigger("uploadFinished")})),n._trigged=!0)},_putback:function(t){var e;t.cuted.unshift(t),e=this.stack.indexOf(t.cuted),~e||this.stack.unshift(t.cuted)},_getStack:function(){var t,e=0;while(t=this.stack[e++]){if(t.has()&&t.file.getStatus()===s.PROGRESS)return t;(!t.has()||t.file.getStatus()!==s.PROGRESS&&t.file.getStatus()!==s.INTERRUPT)&&this.stack.splice(--e,1)}return null},_nextBlock:function(){var t,e,i,n,r=this,s=r.options;return(t=this._getStack())?(s.prepareNextFile&&!r.pending.length&&r._prepareNextFile(),t.shift()):r.runing?(!r.pending.length&&r._getStats().numOfQueue&&r._prepareNextFile(),e=r.pending.shift(),i=function(e){return e?(t=a(e,s.chunked?s.chunkSize:0),r.stack.push(t),t.shift()):null},o(e)?(n=e.file,e=e[e.pipe?"pipe":"then"](i),e.file=n,e):i(e)):void 0},_prepareNextFile:function(){var t,e=this,i=e.request("fetch-file"),n=e.pending;i&&(t=e.request("before-send-file",i,(function(){return i.getStatus()===s.PROGRESS||i.getStatus()===s.INTERRUPT?i:e._finishFile(i)})),e.owner.trigger("uploadStart",i),i.setStatus(s.PROGRESS),t.file=i,t.done((function(){var e=r.inArray(t,n);~e&&n.splice(e,1,i)})),t.fail((function(t){i.setStatus(s.ERROR,t),e.owner.trigger("uploadError",i,t),e.owner.trigger("uploadComplete",i)})),n.push(t))},_popBlock:function(t){var e=r.inArray(t,this.pool);this.pool.splice(e,1),t.file.remaning--,this.remaning--},_startSend:function(e){var i,n=this,r=e.file;r.getStatus()===s.PROGRESS?(n.pool.push(e),n.remaning++,e.blob=1===e.chunks?r.source:r.source.slice(e.start,e.end),i=n.request("before-send",e,(function(){r.getStatus()===s.PROGRESS?n._doSend(e):(n._popBlock(e),t.nextTick(n.__tick))})),i.fail((function(){1===r.remaning?n._finishFile(r).always((function(){e.percentage=1,n._popBlock(e),n.owner.trigger("uploadComplete",r),t.nextTick(n.__tick)})):(e.percentage=1,n.updateFileProgress(r),n._popBlock(e),t.nextTick(n.__tick))}))):r.getStatus()===s.INTERRUPT&&n._putback(e)},_doSend:function(e){var i,o,a=this,l=a.owner,c=a.options,h=e.file,u=new n(c),d=r.extend({},c.formData),p=r.extend({},c.headers);e.transport=u,u.on("destroy",(function(){delete e.transport,a._popBlock(e),t.nextTick(a.__tick)})),u.on("progress",(function(t){e.percentage=t,a.updateFileProgress(h)})),i=function(t){var i;return o=u.getResponseAsJson()||{},o._raw=u.getResponse(),i=function(e){t=e},l.trigger("uploadAccept",e,o,i)||(t=t||"server"),t},u.on("error",(function(t,n){e.retried=e.retried||0,e.chunks>1&&~"http,abort".indexOf(t)&&e.retried<c.chunkRetry?(e.retried++,u.send()):(n||"server"!==t||(t=i(t)),h.setStatus(s.ERROR,t),l.trigger("uploadError",h,t),l.trigger("uploadComplete",h))})),u.on("load",(function(){var t;(t=i())?u.trigger("error",t,!0):1===h.remaning?a._finishFile(h,o):u.destroy()})),d=r.extend(d,{id:h.id,name:h.name,type:h.type,lastModifiedDate:h.lastModifiedDate,size:h.size}),e.chunks>1&&r.extend(d,{chunks:e.chunks,chunk:e.chunk}),l.trigger("uploadBeforeSend",e,d,p),u.appendBlob(c.fileVal,e.blob,h.name),u.append(d),u.setRequestHeader(p),u.send()},_finishFile:function(t,e,i){var n=this.owner;return n.request("after-send-file",arguments,(function(){t.setStatus(s.COMPLETE),n.trigger("uploadSuccess",t,e,i)})).fail((function(e){t.getStatus()===s.PROGRESS&&t.setStatus(s.ERROR,e),n.trigger("uploadError",t,e)})).always((function(){n.trigger("uploadComplete",t)}))},updateFileProgress:function(t){var e=0,i=0;t.blocks&&(r.each(t.blocks,(function(t,e){i+=(e.percentage||0)*(e.end-e.start)})),e=i/t.size,this.owner.trigger("uploadProgress",t,e||0))}})})),e("widgets/validator",["base","uploader","file","widgets/widget"],(function(t,e,i){var n,r=t.$,o={};return n={addValidator:function(t,e){o[t]=e},removeValidator:function(t){delete o[t]}},e.register({name:"validator",init:function(){var e=this;t.nextTick((function(){r.each(o,(function(){this.call(e.owner)}))}))}}),n.addValidator("fileNumLimit",(function(){var t=this,e=t.options,i=0,n=parseInt(e.fileNumLimit,10),r=!0;n&&(t.on("beforeFileQueued",(function(t){return i>=n&&r&&(r=!1,this.trigger("error","Q_EXCEED_NUM_LIMIT",n,t),setTimeout((function(){r=!0}),1)),!(i>=n)})),t.on("fileQueued",(function(){i++})),t.on("fileDequeued",(function(){i--})),t.on("reset",(function(){i=0})))})),n.addValidator("fileSizeLimit",(function(){var t=this,e=t.options,i=0,n=parseInt(e.fileSizeLimit,10),r=!0;n&&(t.on("beforeFileQueued",(function(t){var e=i+t.size>n;return e&&r&&(r=!1,this.trigger("error","Q_EXCEED_SIZE_LIMIT",n,t),setTimeout((function(){r=!0}),1)),!e})),t.on("fileQueued",(function(t){i+=t.size})),t.on("fileDequeued",(function(t){i-=t.size})),t.on("reset",(function(){i=0})))})),n.addValidator("fileSingleSizeLimit",(function(){var t=this,e=t.options,n=e.fileSingleSizeLimit;n&&t.on("beforeFileQueued",(function(t){if(t.size>n)return t.setStatus(i.Status.INVALID,"exceed_size"),this.trigger("error","F_EXCEED_SIZE",n,t),!1}))})),n.addValidator("duplicate",(function(){var t=this,e=t.options,i={};function n(t){for(var e,i=0,n=0,r=t.length;n<r;n++)e=t.charCodeAt(n),i=e+(i<<6)+(i<<16)-i;return i}e.duplicate||(t.on("beforeFileQueued",(function(t){var e=t.__hash||(t.__hash=n(t.name+t.size+t.lastModifiedDate));if(i[e])return this.trigger("error","F_DUPLICATE",t),!1})),t.on("fileQueued",(function(t){var e=t.__hash;e&&(i[e]=!0)})),t.on("fileDequeued",(function(t){var e=t.__hash;e&&delete i[e]})),t.on("reset",(function(){i={}})))})),n})),e("lib/md5",["runtime/client","mediator"],(function(t,e){function i(){t.call(this,"Md5")}return e.installTo(i.prototype),i.prototype.loadFromBlob=function(t){var e=this;e.getRuid()&&e.disconnectRuntime(),e.connectRuntime(t.ruid,(function(){e.exec("init"),e.exec("loadFromBlob",t)}))},i.prototype.getResult=function(){return this.exec("getResult")},i})),e("widgets/md5",["base","uploader","lib/md5","lib/blob","widgets/widget"],(function(t,e,i,n){return e.register({name:"md5",md5File:function(e,r,o){var s=new i,a=t.Deferred(),l=e instanceof n?e:this.request("get-file",e).source;return s.on("progress load",(function(t){t=t||{},a.notify(t.total?t.loaded/t.total:1)})),s.on("complete",(function(){a.resolve(s.getResult())})),s.on("error",(function(t){a.reject(t)})),arguments.length>1&&(r=r||0,o=o||0,r<0&&(r=l.size+r),o<0&&(o=l.size+o),o=Math.min(o,l.size),l=l.slice(r,o)),s.loadFromBlob(l),a.promise()}})})),e("runtime/compbase",[],(function(){function t(t,e){this.owner=t,this.options=t.options,this.getRuntime=function(){return e},this.getRuid=function(){return e.uid},this.trigger=function(){return t.trigger.apply(t,arguments)}}return t})),e("runtime/html5/runtime",["base","runtime/runtime","runtime/compbase"],(function(e,i,n){var r="html5",o={};function s(){var t={},n=this,s=this.destroy;i.apply(n,arguments),n.type=r,n.exec=function(i,r){var s,a=this,l=a.uid,c=e.slice(arguments,2);if(o[i]&&(s=t[l]=t[l]||new o[i](a,n),s[r]))return s[r].apply(s,c)},n.destroy=function(){return s&&s.apply(this,arguments)}}return e.inherits(i,{constructor:s,init:function(){var t=this;setTimeout((function(){t.trigger("ready")}),1)}}),s.register=function(t,i){var r=o[t]=e.inherits(n,i);return r},t.Blob&&t.FileReader&&t.DataView&&i.addRuntime(r,s),s})),e("runtime/html5/blob",["runtime/html5/runtime","lib/blob"],(function(t,e){return t.register("Blob",{slice:function(t,i){var n=this.owner.source,r=n.slice||n.webkitSlice||n.mozSlice;return n=r.call(n,t,i),new e(this.getRuid(),n)}})})),e("runtime/html5/dnd",["base","runtime/html5/runtime","lib/file"],(function(t,e,i){var n=t.$,r="webuploader-dnd-";return e.register("DragAndDrop",{init:function(){var e=this.elem=this.options.container;this.dragEnterHandler=t.bindFn(this._dragEnterHandler,this),this.dragOverHandler=t.bindFn(this._dragOverHandler,this),this.dragLeaveHandler=t.bindFn(this._dragLeaveHandler,this),this.dropHandler=t.bindFn(this._dropHandler,this),this.dndOver=!1,e.on("dragenter",this.dragEnterHandler),e.on("dragover",this.dragOverHandler),e.on("dragleave",this.dragLeaveHandler),e.on("drop",this.dropHandler),this.options.disableGlobalDnd&&(n(document).on("dragover",this.dragOverHandler),n(document).on("drop",this.dropHandler))},_dragEnterHandler:function(t){var e,i=this,n=i._denied||!1;return t=t.originalEvent||t,i.dndOver||(i.dndOver=!0,e=t.dataTransfer.items,e&&e.length&&(i._denied=n=!i.trigger("accept",e)),i.elem.addClass(r+"over"),i.elem[n?"addClass":"removeClass"](r+"denied")),t.dataTransfer.dropEffect=n?"none":"copy",!1},_dragOverHandler:function(t){var e=this.elem.parent().get(0);return e&&!n.contains(e,t.currentTarget)||(clearTimeout(this._leaveTimer),this._dragEnterHandler.call(this,t)),!1},_dragLeaveHandler:function(){var t,e=this;return t=function(){e.dndOver=!1,e.elem.removeClass(r+"over "+r+"denied")},clearTimeout(e._leaveTimer),e._leaveTimer=setTimeout(t,100),!1},_dropHandler:function(t){var e,o,s=this,a=s.getRuid(),l=s.elem.parent().get(0);if(l&&!n.contains(l,t.currentTarget))return!1;t=t.originalEvent||t,e=t.dataTransfer;try{o=e.getData("text/html")}catch(c){}return s.dndOver=!1,s.elem.removeClass(r+"over"),o?void 0:(s._getTansferFiles(e,(function(t){s.trigger("drop",n.map(t,(function(t){return new i(a,t)})))})),!1)},_getTansferFiles:function(e,i){var n,r,o,s,a,l,c,h=[],u=[];for(n=e.items,r=e.files,c=!(!n||!n[0].webkitGetAsEntry),a=0,l=r.length;a<l;a++)o=r[a],s=n&&n[a],c&&s.webkitGetAsEntry().isDirectory?u.push(this._traverseDirectoryTree(s.webkitGetAsEntry(),h)):h.push(o);t.when.apply(t,u).done((function(){h.length&&i(h)}))},_traverseDirectoryTree:function(e,i){var n=t.Deferred(),r=this;return e.isFile?e.file((function(t){i.push(t),n.resolve()})):e.isDirectory&&e.createReader().readEntries((function(e){var o,s=e.length,a=[],l=[];for(o=0;o<s;o++)a.push(r._traverseDirectoryTree(e[o],l));t.when.apply(t,a).then((function(){i.push.apply(i,l),n.resolve()}),n.reject)})),n.promise()},destroy:function(){var t=this.elem;t&&(t.off("dragenter",this.dragEnterHandler),t.off("dragover",this.dragOverHandler),t.off("dragleave",this.dragLeaveHandler),t.off("drop",this.dropHandler),this.options.disableGlobalDnd&&(n(document).off("dragover",this.dragOverHandler),n(document).off("drop",this.dropHandler)))}})})),e("runtime/html5/filepaste",["base","runtime/html5/runtime","lib/file"],(function(t,e,i){return e.register("FilePaste",{init:function(){var e,i,n,r,o=this.options,s=this.elem=o.container,a=".*";if(o.accept){for(e=[],i=0,n=o.accept.length;i<n;i++)r=o.accept[i].mimeTypes,r&&e.push(r);e.length&&(a=e.join(","),a=a.replace(/,/g,"|").replace(/\*/g,".*"))}this.accept=a=new RegExp(a,"i"),this.hander=t.bindFn(this._pasteHander,this),s.on("paste",this.hander)},_pasteHander:function(t){var e,n,r,o,s,a=[],l=this.getRuid();for(t=t.originalEvent||t,e=t.clipboardData.items,o=0,s=e.length;o<s;o++)n=e[o],"file"===n.kind&&(r=n.getAsFile())&&a.push(new i(l,r));a.length&&(t.preventDefault(),t.stopPropagation(),this.trigger("paste",a))},destroy:function(){this.elem.off("paste",this.hander)}})})),e("runtime/html5/filepicker",["base","runtime/html5/runtime"],(function(t,e){var i=t.$;return e.register("FilePicker",{init:function(){var t,e,n,r,o=this.getRuntime().getContainer(),s=this,a=s.owner,l=s.options,c=this.label=i(document.createElement("label")),h=this.input=i(document.createElement("input"));if(h.attr("type","file"),h.attr("capture","camera"),h.attr("name",l.name),h.addClass("webuploader-element-invisible"),c.on("click",(function(t){h.trigger("click"),t.stopPropagation(),a.trigger("dialogopen")})),c.css({opacity:0,width:"100%",height:"100%",display:"block",cursor:"pointer",background:"#ffffff"}),l.multiple&&h.attr("multiple","multiple"),l.accept&&l.accept.length>0){for(t=[],e=0,n=l.accept.length;e<n;e++)t.push(l.accept[e].mimeTypes);h.attr("accept",t.join(","))}o.append(h),o.append(c),r=function(t){a.trigger(t.type)},h.on("change",(function(t){var e,n=arguments.callee;s.files=t.target.files,e=this.cloneNode(!0),e.value=null,this.parentNode.replaceChild(e,this),h.off(),h=i(e).on("change",n).on("mouseenter mouseleave",r),a.trigger("change")})),c.on("mouseenter mouseleave",r)},getFiles:function(){return this.files},destroy:function(){this.input.off(),this.label.off()}})})),e("runtime/html5/util",["base"],(function(e){var i=t.createObjectURL&&t||t.URL&&URL.revokeObjectURL&&URL||t.webkitURL,n=e.noop,r=n;return i&&(n=function(){return i.createObjectURL.apply(i,arguments)},r=function(){return i.revokeObjectURL.apply(i,arguments)}),{createObjectURL:n,revokeObjectURL:r,dataURL2Blob:function(t){var e,i,n,r,o,s;for(s=t.split(","),e=~s[0].indexOf("base64")?atob(s[1]):decodeURIComponent(s[1]),n=new ArrayBuffer(e.length),i=new Uint8Array(n),r=0;r<e.length;r++)i[r]=e.charCodeAt(r);return o=s[0].split(":")[1].split(";")[0],this.arrayBufferToBlob(n,o)},dataURL2ArrayBuffer:function(t){var e,i,n,r;for(r=t.split(","),e=~r[0].indexOf("base64")?atob(r[1]):decodeURIComponent(r[1]),i=new Uint8Array(e.length),n=0;n<e.length;n++)i[n]=e.charCodeAt(n);return i.buffer},arrayBufferToBlob:function(e,i){var n,r=t.BlobBuilder||t.WebKitBlobBuilder;return r?(n=new r,n.append(e),n.getBlob(i)):new Blob([e],i?{type:i}:{})},canvasToDataUrl:function(t,e,i){return t.toDataURL(e,i/100)},parseMeta:function(t,e){e(!1,{})},updateImageHead:function(t){return t}}})),e("runtime/html5/imagemeta",["runtime/html5/util"],(function(t){var e;return e={parsers:{65505:[]},maxMetaDataSize:262144,parse:function(t,e){var i=this,n=new FileReader;n.onload=function(){e(!1,i._parse(this.result)),n=n.onload=n.onerror=null},n.onerror=function(t){e(t.message),n=n.onload=n.onerror=null},t=t.slice(0,i.maxMetaDataSize),n.readAsArrayBuffer(t.getSource())},_parse:function(t,i){if(!(t.byteLength<6)){var n,r,o,s,a=new DataView(t),l=2,c=a.byteLength-4,h=l,u={};if(65496===a.getUint16(0)){while(l<c){if(n=a.getUint16(l),!(n>=65504&&n<=65519||65534===n))break;if(r=a.getUint16(l+2)+2,l+r>a.byteLength)break;if(o=e.parsers[n],!i&&o)for(s=0;s<o.length;s+=1)o[s].call(e,a,l,r,u);l+=r,h=l}h>6&&(t.slice?u.imageHead=t.slice(2,h):u.imageHead=new Uint8Array(t).subarray(2,h))}return u}},updateImageHead:function(t,e){var i,n,r,o=this._parse(t,!0);return r=2,o.imageHead&&(r=2+o.imageHead.byteLength),n=t.slice?t.slice(r):new Uint8Array(t).subarray(r),i=new Uint8Array(e.byteLength+2+n.byteLength),i[0]=255,i[1]=216,i.set(new Uint8Array(e),2),i.set(new Uint8Array(n),e.byteLength+2),i.buffer}},t.parseMeta=function(){return e.parse.apply(e,arguments)},t.updateImageHead=function(){return e.updateImageHead.apply(e,arguments)},e})),e("runtime/html5/imagemeta/exif",["base","runtime/html5/imagemeta"],(function(t,e){var i={ExifMap:function(){return this}};return i.ExifMap.prototype.map={Orientation:274},i.ExifMap.prototype.get=function(t){return this[t]||this[this.map[t]]},i.exifTagTypes={1:{getValue:function(t,e){return t.getUint8(e)},size:1},2:{getValue:function(t,e){return String.fromCharCode(t.getUint8(e))},size:1,ascii:!0},3:{getValue:function(t,e,i){return t.getUint16(e,i)},size:2},4:{getValue:function(t,e,i){return t.getUint32(e,i)},size:4},5:{getValue:function(t,e,i){return t.getUint32(e,i)/t.getUint32(e+4,i)},size:8},9:{getValue:function(t,e,i){return t.getInt32(e,i)},size:4},10:{getValue:function(t,e,i){return t.getInt32(e,i)/t.getInt32(e+4,i)},size:8}},i.exifTagTypes[7]=i.exifTagTypes[1],i.getExifValue=function(e,n,r,o,s,a){var l,c,h,u,d,p,f=i.exifTagTypes[o];if(f){if(l=f.size*s,c=l>4?n+e.getUint32(r+8,a):r+8,!(c+l>e.byteLength)){if(1===s)return f.getValue(e,c,a);for(h=[],u=0;u<s;u+=1)h[u]=f.getValue(e,c+u*f.size,a);if(f.ascii){for(d="",u=0;u<h.length;u+=1){if(p=h[u],"\0"===p)break;d+=p}return d}return h}t.log("Invalid Exif data: Invalid data offset.")}else t.log("Invalid Exif data: Invalid tag type.")},i.parseExifTag=function(t,e,n,r,o){var s=t.getUint16(n,r);o.exif[s]=i.getExifValue(t,e,n,t.getUint16(n+2,r),t.getUint32(n+4,r),r)},i.parseExifTags=function(e,i,n,r,o){var s,a,l;if(n+6>e.byteLength)t.log("Invalid Exif data: Invalid directory offset.");else{if(s=e.getUint16(n,r),a=n+2+12*s,!(a+4>e.byteLength)){for(l=0;l<s;l+=1)this.parseExifTag(e,i,n+2+12*l,r,o);return e.getUint32(a,r)}t.log("Invalid Exif data: Invalid directory size.")}},i.parseExifData=function(e,n,r,o){var s,a,l=n+10;if(1165519206===e.getUint32(n+4))if(l+8>e.byteLength)t.log("Invalid Exif data: Invalid segment size.");else if(0===e.getUint16(n+8)){switch(e.getUint16(l)){case 18761:s=!0;break;case 19789:s=!1;break;default:return void t.log("Invalid Exif data: Invalid byte alignment marker.")}42===e.getUint16(l+2,s)?(a=e.getUint32(l+4,s),o.exif=new i.ExifMap,a=i.parseExifTags(e,l,l+a,s,o)):t.log("Invalid Exif data: Missing TIFF marker.")}else t.log("Invalid Exif data: Missing byte alignment offset.")},e.parsers[65505].push(i.parseExifData),i})),e("runtime/html5/jpegencoder",[],(function(t,e,i){function n(t){Math.round;var e,i,n,r,o,s=Math.floor,a=new Array(64),l=new Array(64),c=new Array(64),h=new Array(64),u=new Array(65535),d=new Array(65535),p=new Array(64),f=new Array(64),m=[],g=0,v=7,y=new Array(64),x=new Array(64),b=new Array(64),w=new Array(256),_=new Array(2048),M=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],S=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],T=[0,1,2,3,4,5,6,7,8,9,10,11],E=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],A=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],L=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],C=[0,1,2,3,4,5,6,7,8,9,10,11],P=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],R=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function O(t){for(var e=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],i=0;i<64;i++){var n=s((e[i]*t+50)/100);n<1?n=1:n>255&&(n=255),a[M[i]]=n}for(var r=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],o=0;o<64;o++){var u=s((r[o]*t+50)/100);u<1?u=1:u>255&&(u=255),l[M[o]]=u}for(var d=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],p=0,f=0;f<8;f++)for(var m=0;m<8;m++)c[p]=1/(a[M[p]]*d[f]*d[m]*8),h[p]=1/(l[M[p]]*d[f]*d[m]*8),p++}function k(t,e){for(var i=0,n=0,r=new Array,o=1;o<=16;o++){for(var s=1;s<=t[o];s++)r[e[n]]=[],r[e[n]][0]=i,r[e[n]][1]=o,n++,i++;i*=2}return r}function D(){e=k(S,T),i=k(L,C),n=k(E,A),r=k(P,R)}function I(){for(var t=1,e=2,i=1;i<=15;i++){for(var n=t;n<e;n++)d[32767+n]=i,u[32767+n]=[],u[32767+n][1]=i,u[32767+n][0]=n;for(var r=-(e-1);r<=-t;r++)d[32767+r]=i,u[32767+r]=[],u[32767+r][1]=i,u[32767+r][0]=e-1+r;t<<=1,e<<=1}}function N(){for(var t=0;t<256;t++)_[t]=19595*t,_[t+256>>0]=38470*t,_[t+512>>0]=7471*t+32768,_[t+768>>0]=-11059*t,_[t+1024>>0]=-21709*t,_[t+1280>>0]=32768*t+8421375,_[t+1536>>0]=-27439*t,_[t+1792>>0]=-5329*t}function B(t){var e=t[0],i=t[1]-1;while(i>=0)e&1<<i&&(g|=1<<v),i--,v--,v<0&&(255==g?(z(255),z(0)):z(g),v=7,g=0)}function z(t){m.push(w[t])}function F(t){z(t>>8&255),z(255&t)}function U(t,e){var i,n,r,o,s,a,l,c,h,u,d=0,f=8,m=64;for(h=0;h<f;++h){i=t[d],n=t[d+1],r=t[d+2],o=t[d+3],s=t[d+4],a=t[d+5],l=t[d+6],c=t[d+7];var g=i+c,v=i-c,y=n+l,x=n-l,b=r+a,w=r-a,_=o+s,M=o-s,S=g+_,T=g-_,E=y+b,A=y-b;t[d]=S+E,t[d+4]=S-E;var L=.707106781*(A+T);t[d+2]=T+L,t[d+6]=T-L,S=M+w,E=w+x,A=x+v;var C=.382683433*(S-A),P=.5411961*S+C,R=1.306562965*A+C,O=.707106781*E,k=v+O,D=v-O;t[d+5]=D+P,t[d+3]=D-P,t[d+1]=k+R,t[d+7]=k-R,d+=8}for(d=0,h=0;h<f;++h){i=t[d],n=t[d+8],r=t[d+16],o=t[d+24],s=t[d+32],a=t[d+40],l=t[d+48],c=t[d+56];var I=i+c,N=i-c,B=n+l,z=n-l,F=r+a,U=r-a,G=o+s,H=o-s,j=I+G,W=I-G,V=B+F,X=B-F;t[d]=j+V,t[d+32]=j-V;var Y=.707106781*(X+W);t[d+16]=W+Y,t[d+48]=W-Y,j=H+U,V=U+z,X=z+N;var q=.382683433*(j-X),Z=.5411961*j+q,J=1.306562965*X+q,K=.707106781*V,$=N+K,Q=N-K;t[d+40]=Q+Z,t[d+24]=Q-Z,t[d+8]=$+J,t[d+56]=$-J,d++}for(h=0;h<m;++h)u=t[h]*e[h],p[h]=u>0?u+.5|0:u-.5|0;return p}function G(){F(65504),F(16),z(74),z(70),z(73),z(70),z(0),z(1),z(1),z(0),F(1),F(1),z(0),z(0)}function H(t,e){F(65472),F(17),z(8),F(e),F(t),z(3),z(1),z(17),z(0),z(2),z(17),z(1),z(3),z(17),z(1)}function j(){F(65499),F(132),z(0);for(var t=0;t<64;t++)z(a[t]);z(1);for(var e=0;e<64;e++)z(l[e])}function W(){F(65476),F(418),z(0);for(var t=0;t<16;t++)z(S[t+1]);for(var e=0;e<=11;e++)z(T[e]);z(16);for(var i=0;i<16;i++)z(E[i+1]);for(var n=0;n<=161;n++)z(A[n]);z(1);for(var r=0;r<16;r++)z(L[r+1]);for(var o=0;o<=11;o++)z(C[o]);z(17);for(var s=0;s<16;s++)z(P[s+1]);for(var a=0;a<=161;a++)z(R[a])}function V(){F(65498),F(12),z(3),z(1),z(0),z(2),z(17),z(3),z(17),z(0),z(63),z(0)}function X(t,e,i,n,r){for(var o,s=r[0],a=r[240],l=16,c=63,h=64,p=U(t,e),m=0;m<h;++m)f[M[m]]=p[m];var g=f[0]-i;i=f[0],0==g?B(n[0]):(o=32767+g,B(n[d[o]]),B(u[o]));for(var v=63;v>0&&0==f[v];v--);if(0==v)return B(s),i;var y,x=1;while(x<=v){for(var b=x;0==f[x]&&x<=v;++x);var w=x-b;if(w>=l){y=w>>4;for(var _=1;_<=y;++_)B(a);w&=15}o=32767+f[x],B(r[(w<<4)+d[o]]),B(u[o]),x++}return v!=c&&B(s),i}function Y(){for(var t=String.fromCharCode,e=0;e<256;e++)w[e]=t(e)}function q(t){if(t<=0&&(t=1),t>100&&(t=100),o!=t){var e=0;e=t<50?Math.floor(5e3/t):Math.floor(200-2*t),O(e),o=t}}function Z(){t||(t=50),Y(),D(),I(),N(),q(t)}this.encode=function(t,o){o&&q(o),m=new Array,g=0,v=7,F(65496),G(),j(),H(t.width,t.height),W(),V();var s=0,a=0,l=0;g=0,v=7,this.encode.displayName="_encode_";var u,d,p,f,w,M,S,T,E,A=t.data,L=t.width,C=t.height,P=4*L,R=0;while(R<C){u=0;while(u<P){for(w=P*R+u,M=w,S=-1,T=0,E=0;E<64;E++)T=E>>3,S=4*(7&E),M=w+T*P+S,R+T>=C&&(M-=P*(R+1+T-C)),u+S>=P&&(M-=u+S-P+4),d=A[M++],p=A[M++],f=A[M++],y[E]=(_[d]+_[p+256>>0]+_[f+512>>0]>>16)-128,x[E]=(_[d+768>>0]+_[p+1024>>0]+_[f+1280>>0]>>16)-128,b[E]=(_[d+1280>>0]+_[p+1536>>0]+_[f+1792>>0]>>16)-128;s=X(y,c,s,e,n),a=X(x,h,a,i,r),l=X(b,h,l,i,r),u+=32}R+=8}if(v>=0){var O=[];O[1]=v+1,O[0]=(1<<v+1)-1,B(O)}F(65497);var k="data:image/jpeg;base64,"+btoa(m.join(""));return m=[],k},Z()}return n.encode=function(t,e){var i=new n(e);return i.encode(t)},n})),e("runtime/html5/androidpatch",["runtime/html5/util","runtime/html5/jpegencoder","base"],(function(t,e,i){var n,r=t.canvasToDataUrl;t.canvasToDataUrl=function(t,o,s){var a,l,c,h,u;return i.os.android?("image/jpeg"===o&&"undefined"===typeof n&&(h=r.apply(null,arguments),u=h.split(","),h=~u[0].indexOf("base64")?atob(u[1]):decodeURIComponent(u[1]),h=h.substring(0,2),n=255===h.charCodeAt(0)&&216===h.charCodeAt(1)),"image/jpeg"!==o||n?r.apply(null,arguments):(l=t.width,c=t.height,a=t.getContext("2d"),e.encode(a.getImageData(0,0,l,c),s))):r.apply(null,arguments)}})),e("runtime/html5/image",["base","runtime/html5/runtime","runtime/html5/util"],(function(t,e,i){var n="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs%3D";return e.register("Image",{modified:!1,init:function(){var t=this,e=new Image;e.onload=function(){t._info={type:t.type,width:this.width,height:this.height},t._metas||"image/jpeg"!==t.type?t.owner.trigger("load"):i.parseMeta(t._blob,(function(e,i){t._metas=i,t.owner.trigger("load")}))},e.onerror=function(){t.owner.trigger("error")},t._img=e},loadFromBlob:function(t){var e=this,n=e._img;e._blob=t,e.type=t.type,n.src=i.createObjectURL(t.getSource()),e.owner.once("load",(function(){i.revokeObjectURL(n.src)}))},resize:function(t,e){var i=this._canvas||(this._canvas=document.createElement("canvas"));this._resize(this._img,i,t,e),this._blob=null,this.modified=!0,this.owner.trigger("complete","resize")},crop:function(t,e,i,n,r){var o=this._canvas||(this._canvas=document.createElement("canvas")),s=this.options,a=this._img,l=a.naturalWidth,c=a.naturalHeight,h=this.getOrientation();r=r||1,o.width=i,o.height=n,s.preserveHeaders||this._rotate2Orientaion(o,h),this._renderImageToCanvas(o,a,-t,-e,l*r,c*r),this._blob=null,this.modified=!0,this.owner.trigger("complete","crop")},getAsBlob:function(t){var e,n=this._blob,r=this.options;if(t=t||this.type,this.modified||this.type!==t){if(e=this._canvas,"image/jpeg"===t){if(n=i.canvasToDataUrl(e,t,r.quality),r.preserveHeaders&&this._metas&&this._metas.imageHead)return n=i.dataURL2ArrayBuffer(n),n=i.updateImageHead(n,this._metas.imageHead),n=i.arrayBufferToBlob(n,t),n}else n=i.canvasToDataUrl(e,t);n=i.dataURL2Blob(n)}return n},getAsDataUrl:function(t){var e=this.options;return t=t||this.type,"image/jpeg"===t?i.canvasToDataUrl(this._canvas,t,e.quality):this._canvas.toDataURL(t)},getOrientation:function(){return this._metas&&this._metas.exif&&this._metas.exif.get("Orientation")||1},info:function(t){return t?(this._info=t,this):this._info},meta:function(t){return t?(this._metas=t,this):this._metas},destroy:function(){var t=this._canvas;this._img.onload=null,t&&(t.getContext("2d").clearRect(0,0,t.width,t.height),t.width=t.height=0,this._canvas=null),this._img.src=n,this._img=this._blob=null},_resize:function(t,e,i,n){var r,o,s,a,l,c=this.options,h=t.width,u=t.height,d=this.getOrientation();~[5,6,7,8].indexOf(d)&&(i^=n,n^=i,i^=n),r=Math[c.crop?"max":"min"](i/h,n/u),c.allowMagnify||(r=Math.min(1,r)),o=h*r,s=u*r,c.crop?(e.width=i,e.height=n):(e.width=o,e.height=s),a=(e.width-o)/2,l=(e.height-s)/2,c.preserveHeaders||this._rotate2Orientaion(e,d),this._renderImageToCanvas(e,t,a,l,o,s)},_rotate2Orientaion:function(t,e){var i=t.width,n=t.height,r=t.getContext("2d");switch(e){case 5:case 6:case 7:case 8:t.width=n,t.height=i;break}switch(e){case 2:r.translate(i,0),r.scale(-1,1);break;case 3:r.translate(i,n),r.rotate(Math.PI);break;case 4:r.translate(0,n),r.scale(1,-1);break;case 5:r.rotate(.5*Math.PI),r.scale(1,-1);break;case 6:r.rotate(.5*Math.PI),r.translate(0,-n);break;case 7:r.rotate(.5*Math.PI),r.translate(i,-n),r.scale(-1,1);break;case 8:r.rotate(-.5*Math.PI),r.translate(-i,0);break}},_renderImageToCanvas:function(){if(!t.os.ios)return function(e){var i=t.slice(arguments,1),n=e.getContext("2d");n.drawImage.apply(n,i)};function e(t,e,i){var n,r,o,s=document.createElement("canvas"),a=s.getContext("2d"),l=0,c=i,h=i;s.width=1,s.height=i,a.drawImage(t,0,0),n=a.getImageData(0,0,1,i).data;while(h>l)r=n[4*(h-1)+3],0===r?c=h:l=h,h=c+l>>1;return o=h/i,0===o?1:o}if(t.os.ios>=7)return function(t,i,n,r,o,s){var a=i.naturalWidth,l=i.naturalHeight,c=e(i,a,l);return t.getContext("2d").drawImage(i,0,0,a*c,l*c,n,r,o,s)};function i(t){var e,i,n=t.naturalWidth,r=t.naturalHeight;return n*r>1048576&&(e=document.createElement("canvas"),e.width=e.height=1,i=e.getContext("2d"),i.drawImage(t,1-n,0),0===i.getImageData(0,0,1,1).data[3])}return function(t,n,r,o,s,a){var l,c,h,u,d,p,f,m=n.naturalWidth,g=n.naturalHeight,v=t.getContext("2d"),y=i(n),x="image/jpeg"===this.type,b=1024,w=0,_=0;y&&(m/=2,g/=2),v.save(),l=document.createElement("canvas"),l.width=l.height=b,c=l.getContext("2d"),h=x?e(n,m,g):1,u=Math.ceil(b*s/m),d=Math.ceil(b*a/g/h);while(w<g){p=0,f=0;while(p<m)c.clearRect(0,0,b,b),c.drawImage(n,-p,-w),v.drawImage(l,0,0,b,b,r+f,o+_,u,d),p+=b,f+=u;w+=b,_+=d}v.restore(),l=c=null}}()})})),e("runtime/html5/transport",["base","runtime/html5/runtime"],(function(t,e){var i=t.noop,n=t.$;return e.register("Transport",{init:function(){this._status=0,this._response=null},send:function(){var e,i,r,o=this.owner,s=this.options,a=this._initAjax(),l=o._blob,c=s.server;s.sendAsBinary?(c+=(/\?/.test(c)?"&":"?")+n.param(o._formData),i=l.getSource()):(e=new FormData,n.each(o._formData,(function(t,i){e.append(t,i)})),e.append(s.fileVal,l.getSource(),s.filename||o._formData.name||"")),s.withCredentials&&"withCredentials"in a?(a.open(s.method,c,!0),a.withCredentials=!0):a.open(s.method,c),this._setRequestHeader(a,s.headers),i?(a.overrideMimeType&&a.overrideMimeType("application/octet-stream"),t.os.android?(r=new FileReader,r.onload=function(){a.send(this.result),r=r.onload=null},r.readAsArrayBuffer(i)):a.send(i)):a.send(e)},getResponse:function(){return this._response},getResponseAsJson:function(){return this._parseJson(this._response)},getStatus:function(){return this._status},abort:function(){var t=this._xhr;t&&(t.upload.onprogress=i,t.onreadystatechange=i,t.abort(),this._xhr=t=null)},destroy:function(){this.abort()},_initAjax:function(){var t=this,e=new XMLHttpRequest,n=this.options;return n.withCredentials&&!("withCredentials"in e)&&"undefined"!==typeof XDomainRequest&&(e=new XDomainRequest),e.upload.onprogress=function(e){var i=0;return e.lengthComputable&&(i=e.loaded/e.total),t.trigger("progress",i)},e.onreadystatechange=function(){if(4===e.readyState)return e.upload.onprogress=i,e.onreadystatechange=i,t._xhr=null,t._status=e.status,e.status>=200&&e.status<300?(t._response=e.responseText,t.trigger("load")):e.status>=500&&e.status<600?(t._response=e.responseText,t.trigger("error","server")):t.trigger("error",t._status?"http":"abort")},t._xhr=e,e},_setRequestHeader:function(t,e){n.each(e,(function(e,i){t.setRequestHeader(e,i)}))},_parseJson:function(t){var e;try{e=JSON.parse(t)}catch(i){e={}}return e}})})),e("runtime/html5/md5",["runtime/html5/runtime"],(function(t){var e=function(t,e){return t+e&4294967295},i=function(t,i,n,r,o,s){return i=e(e(i,t),e(r,s)),e(i<<o|i>>>32-o,n)},n=function(t,e,n,r,o,s,a){return i(e&n|~e&r,t,e,o,s,a)},r=function(t,e,n,r,o,s,a){return i(e&r|n&~r,t,e,o,s,a)},o=function(t,e,n,r,o,s,a){return i(e^n^r,t,e,o,s,a)},s=function(t,e,n,r,o,s,a){return i(n^(e|~r),t,e,o,s,a)},a=function(t,i){var a=t[0],l=t[1],c=t[2],h=t[3];a=n(a,l,c,h,i[0],7,-680876936),h=n(h,a,l,c,i[1],12,-389564586),c=n(c,h,a,l,i[2],17,606105819),l=n(l,c,h,a,i[3],22,-1044525330),a=n(a,l,c,h,i[4],7,-176418897),h=n(h,a,l,c,i[5],12,1200080426),c=n(c,h,a,l,i[6],17,-1473231341),l=n(l,c,h,a,i[7],22,-45705983),a=n(a,l,c,h,i[8],7,1770035416),h=n(h,a,l,c,i[9],12,-1958414417),c=n(c,h,a,l,i[10],17,-42063),l=n(l,c,h,a,i[11],22,-1990404162),a=n(a,l,c,h,i[12],7,1804603682),h=n(h,a,l,c,i[13],12,-40341101),c=n(c,h,a,l,i[14],17,-1502002290),l=n(l,c,h,a,i[15],22,1236535329),a=r(a,l,c,h,i[1],5,-165796510),h=r(h,a,l,c,i[6],9,-1069501632),c=r(c,h,a,l,i[11],14,643717713),l=r(l,c,h,a,i[0],20,-373897302),a=r(a,l,c,h,i[5],5,-701558691),h=r(h,a,l,c,i[10],9,38016083),c=r(c,h,a,l,i[15],14,-660478335),l=r(l,c,h,a,i[4],20,-405537848),a=r(a,l,c,h,i[9],5,568446438),h=r(h,a,l,c,i[14],9,-1019803690),c=r(c,h,a,l,i[3],14,-187363961),l=r(l,c,h,a,i[8],20,1163531501),a=r(a,l,c,h,i[13],5,-1444681467),h=r(h,a,l,c,i[2],9,-51403784),c=r(c,h,a,l,i[7],14,1735328473),l=r(l,c,h,a,i[12],20,-1926607734),a=o(a,l,c,h,i[5],4,-378558),h=o(h,a,l,c,i[8],11,-2022574463),c=o(c,h,a,l,i[11],16,1839030562),l=o(l,c,h,a,i[14],23,-35309556),a=o(a,l,c,h,i[1],4,-1530992060),h=o(h,a,l,c,i[4],11,1272893353),c=o(c,h,a,l,i[7],16,-155497632),l=o(l,c,h,a,i[10],23,-1094730640),a=o(a,l,c,h,i[13],4,681279174),h=o(h,a,l,c,i[0],11,-358537222),c=o(c,h,a,l,i[3],16,-722521979),l=o(l,c,h,a,i[6],23,76029189),a=o(a,l,c,h,i[9],4,-640364487),h=o(h,a,l,c,i[12],11,-421815835),c=o(c,h,a,l,i[15],16,530742520),l=o(l,c,h,a,i[2],23,-995338651),a=s(a,l,c,h,i[0],6,-198630844),h=s(h,a,l,c,i[7],10,1126891415),c=s(c,h,a,l,i[14],15,-1416354905),l=s(l,c,h,a,i[5],21,-57434055),a=s(a,l,c,h,i[12],6,1700485571),h=s(h,a,l,c,i[3],10,-1894986606),c=s(c,h,a,l,i[10],15,-1051523),l=s(l,c,h,a,i[1],21,-2054922799),a=s(a,l,c,h,i[8],6,1873313359),h=s(h,a,l,c,i[15],10,-30611744),c=s(c,h,a,l,i[6],15,-1560198380),l=s(l,c,h,a,i[13],21,1309151649),a=s(a,l,c,h,i[4],6,-145523070),h=s(h,a,l,c,i[11],10,-1120210379),c=s(c,h,a,l,i[2],15,718787259),l=s(l,c,h,a,i[9],21,-343485551),t[0]=e(a,t[0]),t[1]=e(l,t[1]),t[2]=e(c,t[2]),t[3]=e(h,t[3])},l=function(t){var e,i=[];for(e=0;e<64;e+=4)i[e>>2]=t.charCodeAt(e)+(t.charCodeAt(e+1)<<8)+(t.charCodeAt(e+2)<<16)+(t.charCodeAt(e+3)<<24);return i},c=function(t){var e,i=[];for(e=0;e<64;e+=4)i[e>>2]=t[e]+(t[e+1]<<8)+(t[e+2]<<16)+(t[e+3]<<24);return i},h=function(t){var e,i,n,r,o,s,c=t.length,h=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=c;e+=64)a(h,l(t.substring(e-64,e)));for(t=t.substring(e-64),i=t.length,n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e=0;e<i;e+=1)n[e>>2]|=t.charCodeAt(e)<<(e%4<<3);if(n[e>>2]|=128<<(e%4<<3),e>55)for(a(h,n),e=0;e<16;e+=1)n[e]=0;return r=8*c,r=r.toString(16).match(/(.*?)(.{0,8})$/),o=parseInt(r[2],16),s=parseInt(r[1],16)||0,n[14]=o,n[15]=s,a(h,n),h},u=function(t){var e,i,n,r,o,s,l=t.length,h=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=l;e+=64)a(h,c(t.subarray(e-64,e)));for(t=e-64<l?t.subarray(e-64):new Uint8Array(0),i=t.length,n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e=0;e<i;e+=1)n[e>>2]|=t[e]<<(e%4<<3);if(n[e>>2]|=128<<(e%4<<3),e>55)for(a(h,n),e=0;e<16;e+=1)n[e]=0;return r=8*l,r=r.toString(16).match(/(.*?)(.{0,8})$/),o=parseInt(r[2],16),s=parseInt(r[1],16)||0,n[14]=o,n[15]=s,a(h,n),h},d=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],p=function(t){var e,i="";for(e=0;e<4;e+=1)i+=d[t>>8*e+4&15]+d[t>>8*e&15];return i},f=function(t){var e;for(e=0;e<t.length;e+=1)t[e]=p(t[e]);return t.join("")},m=function(t){return f(h(t))},g=function(){this.reset()};return"5d41402abc4b2a76b9719d911017c592"!==m("hello")&&(e=function(t,e){var i=(65535&t)+(65535&e),n=(t>>16)+(e>>16)+(i>>16);return n<<16|65535&i}),g.prototype.append=function(t){return/[\u0080-\uFFFF]/.test(t)&&(t=unescape(encodeURIComponent(t))),this.appendBinary(t),this},g.prototype.appendBinary=function(t){this._buff+=t,this._length+=t.length;var e,i=this._buff.length;for(e=64;e<=i;e+=64)a(this._state,l(this._buff.substring(e-64,e)));return this._buff=this._buff.substr(e-64),this},g.prototype.end=function(t){var e,i,n=this._buff,r=n.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e<r;e+=1)o[e>>2]|=n.charCodeAt(e)<<(e%4<<3);return this._finish(o,r),i=t?this._state:f(this._state),this.reset(),i},g.prototype._finish=function(t,e){var i,n,r,o=e;if(t[o>>2]|=128<<(o%4<<3),o>55)for(a(this._state,t),o=0;o<16;o+=1)t[o]=0;i=8*this._length,i=i.toString(16).match(/(.*?)(.{0,8})$/),n=parseInt(i[2],16),r=parseInt(i[1],16)||0,t[14]=n,t[15]=r,a(this._state,t)},g.prototype.reset=function(){return this._buff="",this._length=0,this._state=[1732584193,-271733879,-1732584194,271733878],this},g.prototype.destroy=function(){delete this._state,delete this._buff,delete this._length},g.hash=function(t,e){/[\u0080-\uFFFF]/.test(t)&&(t=unescape(encodeURIComponent(t)));var i=h(t);return e?i:f(i)},g.hashBinary=function(t,e){var i=h(t);return e?i:f(i)},g.ArrayBuffer=function(){this.reset()},g.ArrayBuffer.prototype.append=function(t){var e,i=this._concatArrayBuffer(this._buff,t),n=i.length;for(this._length+=t.byteLength,e=64;e<=n;e+=64)a(this._state,c(i.subarray(e-64,e)));return this._buff=e-64<n?i.subarray(e-64):new Uint8Array(0),this},g.ArrayBuffer.prototype.end=function(t){var e,i,n=this._buff,r=n.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e<r;e+=1)o[e>>2]|=n[e]<<(e%4<<3);return this._finish(o,r),i=t?this._state:f(this._state),this.reset(),i},g.ArrayBuffer.prototype._finish=g.prototype._finish,g.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._state=[1732584193,-271733879,-1732584194,271733878],this},g.ArrayBuffer.prototype.destroy=g.prototype.destroy,g.ArrayBuffer.prototype._concatArrayBuffer=function(t,e){var i=t.length,n=new Uint8Array(i+e.byteLength);return n.set(t),n.set(new Uint8Array(e),i),n},g.ArrayBuffer.hash=function(t,e){var i=u(new Uint8Array(t));return e?i:f(i)},t.register("Md5",{init:function(){},loadFromBlob:function(t){var e,i,n=t.getSource(),r=2097152,o=Math.ceil(n.size/r),s=0,a=this.owner,l=new g.ArrayBuffer,c=this,h=n.mozSlice||n.webkitSlice||n.slice;i=new FileReader,e=function(){var u,d;u=s*r,d=Math.min(u+r,n.size),i.onload=function(e){l.append(e.target.result),a.trigger("progress",{total:t.size,loaded:d})},i.onloadend=function(){i.onloadend=i.onload=null,++s<o?setTimeout(e,1):setTimeout((function(){a.trigger("load"),c.result=l.end(),e=t=n=l=null,a.trigger("complete")}),50)},i.readAsArrayBuffer(h.call(n,u,d))},e()},getResult:function(){return this.result}})})),e("runtime/flash/runtime",["base","runtime/runtime","runtime/compbase"],(function(e,i,n){var r=e.$,o="flash",s={};function a(){var t;try{t=navigator.plugins["Shockwave Flash"],t=t.description}catch(e){try{t=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")}catch(i){t="0.0"}}return t=t.match(/\d+/g),parseFloat(t[0]+"."+t[1],10)}function l(){var n={},r={},a=this.destroy,l=this,c=e.guid("webuploader_");function h(t,e){var i,n,o=t.type||t;i=o.split("::"),n=i[0],o=i[1],"Ready"===o&&n===l.uid?l.trigger("ready"):r[n]&&r[n].trigger(o.toLowerCase(),t,e)}i.apply(l,arguments),l.type=o,l.exec=function(t,i){var o,a=this,c=a.uid,h=e.slice(arguments,2);return r[c]=a,s[t]&&(n[c]||(n[c]=new s[t](a,l)),o=n[c],o[i])?o[i].apply(o,h):l.flashExec.apply(a,arguments)},t[c]=function(){var t=arguments;setTimeout((function(){h.apply(null,t)}),1)},this.jsreciver=c,this.destroy=function(){return a&&a.apply(this,arguments)},this.flashExec=function(t,i){var n=l.getFlash(),r=e.slice(arguments,2);return n.exec(this.uid,t,i,r)}}return e.inherits(i,{constructor:l,init:function(){var t,i=this.getContainer(),n=this.options;i.css({position:"absolute",top:"-8px",left:"-8px",width:"9px",height:"9px",overflow:"hidden"}),t='<object id="'+this.uid+'" type="application/x-shockwave-flash" data="'+n.swf+'" ',e.browser.ie&&(t+='classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '),t+='width="100%" height="100%" style="outline:0"><param name="movie" value="'+n.swf+'" /><param name="flashvars" value="uid='+this.uid+"&jsreciver="+this.jsreciver+'" /><param name="wmode" value="transparent" /><param name="allowscriptaccess" value="always" /></object>',i.html(t)},getFlash:function(){return this._flash||(this._flash=r("#"+this.uid).get(0)),this._flash}}),l.register=function(t,i){return i=s[t]=e.inherits(n,r.extend({flashExec:function(){var t=this.owner,e=this.getRuntime();return e.flashExec.apply(t,arguments)}},i)),i},a()>=11.4&&i.addRuntime(o,l),l})),e("runtime/flash/filepicker",["base","runtime/flash/runtime"],(function(t,e){var i=t.$;return e.register("FilePicker",{init:function(t){var e,n,r=i.extend({},t);for(e=r.accept&&r.accept.length,n=0;n<e;n++)r.accept[n].title||(r.accept[n].title="Files");delete r.button,delete r.id,delete r.container,this.flashExec("FilePicker","init",r)},destroy:function(){this.flashExec("FilePicker","destroy")}})})),e("runtime/flash/image",["runtime/flash/runtime"],(function(t){return t.register("Image",{loadFromBlob:function(t){var e=this.owner;e.info()&&this.flashExec("Image","info",e.info()),e.meta()&&this.flashExec("Image","meta",e.meta()),this.flashExec("Image","loadFromBlob",t.uid)}})})),e("runtime/flash/transport",["base","runtime/flash/runtime","runtime/client"],(function(e,i,n){var r=e.$;return i.register("Transport",{init:function(){this._status=0,this._response=null,this._responseJson=null},send:function(){var t,e=this.owner,i=this.options,n=this._initAjax(),o=e._blob,s=i.server;n.connectRuntime(o.ruid),i.sendAsBinary?(s+=(/\?/.test(s)?"&":"?")+r.param(e._formData),t=o.uid):(r.each(e._formData,(function(t,e){n.exec("append",t,e)})),n.exec("appendBlob",i.fileVal,o.uid,i.filename||e._formData.name||"")),this._setRequestHeader(n,i.headers),n.exec("send",{method:i.method,url:s,forceURLStream:i.forceURLStream,mimeType:"application/octet-stream"},t)},getStatus:function(){return this._status},getResponse:function(){return this._response||""},getResponseAsJson:function(){return this._responseJson},abort:function(){var t=this._xhr;t&&(t.exec("abort"),t.destroy(),this._xhr=t=null)},destroy:function(){this.abort()},_initAjax:function(){var e=this,i=new n("XMLHttpRequest");return i.on("uploadprogress progress",(function(t){var i=t.loaded/t.total;return i=Math.min(1,Math.max(0,i)),e.trigger("progress",i)})),i.on("load",(function(){var n,r=i.exec("getStatus"),o=!1,s="";return i.off(),e._xhr=null,r>=200&&r<300?o=!0:r>=500&&r<600?(o=!0,s="server"):s="http",o&&(e._response=i.exec("getResponse"),e._response=decodeURIComponent(e._response),n=function(e){try{return t.JSON&&t.JSON.parse?JSON.parse(e):new Function("return "+e).call()}catch(s){return{}}},e._responseJson=e._response?n(e._response):{}),i.destroy(),i=null,s?e.trigger("error",s):e.trigger("load")})),i.on("error",(function(){i.off(),e._xhr=null,e.trigger("error","http")})),e._xhr=i,i},_setRequestHeader:function(t,e){r.each(e,(function(e,i){t.exec("setRequestHeader",e,i)}))}})})),e("runtime/flash/blob",["runtime/flash/runtime","lib/blob"],(function(t,e){return t.register("Blob",{slice:function(t,i){var n=this.flashExec("Blob","slice",t,i);return new e(this.getRuid(),n)}})})),e("runtime/flash/md5",["runtime/flash/runtime"],(function(t){return t.register("Md5",{init:function(){},loadFromBlob:function(t){return this.flashExec("Md5","loadFromBlob",t.uid)}})})),e("preset/all",["base","widgets/filednd","widgets/filepaste","widgets/filepicker","widgets/image","widgets/queue","widgets/runtime","widgets/upload","widgets/validator","widgets/md5","runtime/html5/blob","runtime/html5/dnd","runtime/html5/filepaste","runtime/html5/filepicker","runtime/html5/imagemeta/exif","runtime/html5/androidpatch","runtime/html5/image","runtime/html5/transport","runtime/html5/md5","runtime/flash/filepicker","runtime/flash/image","runtime/flash/transport","runtime/flash/blob","runtime/flash/md5"],(function(t){return t})),e("widgets/log",["base","uploader","widgets/widget"],(function(t,e){var i,n=t.$,r=" http://static.tieba.baidu.com/tb/pms/img/st.gif??",o=(location.hostname||location.host||"protected").toLowerCase(),s=o&&/baidu/i.exec(o);if(s)return i={dv:3,master:"webuploader",online:/test/.exec(o)?0:1,module:"",product:o,type:0},e.register({name:"log",init:function(){var t=this.owner,e=0,i=0;t.on("error",(function(t){a({type:2,c_error_code:t})})).on("uploadError",(function(t,e){a({type:2,c_error_code:"UPLOAD_ERROR",c_reason:""+e})})).on("uploadComplete",(function(t){e++,i+=t.size})).on("uploadFinished",(function(){a({c_count:e,c_size:i}),e=i=0})),a({c_usage:1})}});function a(t){var e=n.extend({},i,t),o=r.replace(/^(.*)\?/,"$1"+n.param(e)),s=new Image;s.src=o}})),e("webuploader",["preset/all","widgets/log"],(function(t){return t}));var n=i;return n("webuploader")}))},"4c46":function(t,e,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const r=i("3e8f"),o=n(i("df7c")),s=i("235d"),a=s.logger;function l(t,e){try{const i={cwd:e.cwd,env:e.env,stdio:e.stdio,timeout:e.timeout},n=r.execSync(t,i);return n?n.toString():null}catch(i){throw new s.RunJSError(i.message)}}function c(t,e){return new Promise((i,n)=>{const o={cwd:e.cwd,env:e.env,shell:!0,stdio:e.stdio},s=r.spawn(t,o);let a=null;s.on("error",e=>{n(new Error(`Failed to start command: ${t}; ${e.toString()}`))}),s.on("close",e=>{0===e?i(a):n(new Error(`Command failed: ${t} with exit code ${e}`))}),"pipe"===e.stdio&&s.stdout.on("data",t=>{a=t.toString()}),e.timeout&&setTimeout(()=>{s.kill(),n(new Error("Command timeout: "+t))},e.timeout)})}function h(t,e={},i=a){const n=o.default.resolve("./node_modules/.bin"),r={async:!!e.async,cwd:e.cwd,env:e.env||Object({NODE_ENV:"production",VUE_APP_BASE_API:"/tadi",BASE_URL:""}),stdio:e.stdio||"inherit",timeout:e.timeout},s=r.env;return s&&(s.PATH=[n,s.PATH||Object({NODE_ENV:"production",VUE_APP_BASE_API:"/tadi",BASE_URL:""}).PATH].join(o.default.delimiter)),i.title(t),e.async?c(t,r):l(t,r)}function u(t,e=""){return t&&t.options&&t.options[e]||null}function d(t){return t&&t.options||{}}function p(t,e){if("function"!==typeof t)throw new Error("first help() argument must be a function");t.help=e}e.run=h,e.option=u,e.options=d,e.help=p},"4f4d":function(t,e,i){"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},5147:function(t,e,i){var n=i("2b4c")("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(i){try{return e[n]=!1,!"/./"[t](e)}catch(r){}}return!0}},"5a89":function(t,e,i){"use strict";i.d(e,"a",(function(){return sn})),i.d(e,"b",(function(){return ur})),i.d(e,"c",(function(){return Nn})),i.d(e,"d",(function(){return f})),i.d(e,"e",(function(){return ni})),i.d(e,"f",(function(){return Un})),i.d(e,"g",(function(){return Xd})),i.d(e,"h",(function(){return tr})),i.d(e,"i",(function(){return Nr})),i.d(e,"j",(function(){return tm})),i.d(e,"k",(function(){return Mh})),i.d(e,"l",(function(){return Oh})),i.d(e,"m",(function(){return r})),i.d(e,"n",(function(){return Cr})),i.d(e,"o",(function(){return jn})),i.d(e,"p",(function(){return Xr})),i.d(e,"q",(function(){return wn})),i.d(e,"r",(function(){return Fh})),i.d(e,"s",(function(){return Dh})),i.d(e,"t",(function(){return mi})),i.d(e,"u",(function(){return Vi})),i.d(e,"v",(function(){return qf})),i.d(e,"w",(function(){return o})),i.d(e,"x",(function(){return si})),i.d(e,"y",(function(){return yi})),i.d(e,"z",(function(){return rg})),i.d(e,"A",(function(){return Gc})),i.d(e,"B",(function(){return Vh})),void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(t){return"number"===typeof t&&isFinite(t)&&Math.floor(t)===t}),void 0===Math.sign&&(Math.sign=function(t){return t<0?-1:t>0?1:+t}),"name"in Function.prototype===!1&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(t){if(void 0===t||null===t)throw new TypeError("Cannot convert undefined or null to object");const e=Object(t);for(let i=1;i<arguments.length;i++){const t=arguments[i];if(void 0!==t&&null!==t)for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e});const n="118",r={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},o={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},s=0,a=1,l=2,c=1,h=2,u=3,d=0,p=1,f=2,m=1,g=0,v=1,y=2,x=3,b=4,w=5,_=100,M=101,S=102,T=103,E=104,A=200,L=201,C=202,P=203,R=204,O=205,k=206,D=207,I=208,N=209,B=210,z=0,F=1,U=2,G=3,H=4,j=5,W=6,V=7,X=0,Y=1,q=2,Z=0,J=1,K=2,$=3,Q=4,tt=5,et=300,it=301,nt=302,rt=303,ot=304,st=306,at=307,lt=1e3,ct=1001,ht=1002,ut=1003,dt=1004,pt=1005,ft=1006,mt=1007,gt=1008,vt=1009,yt=1010,xt=1011,bt=1012,wt=1013,_t=1014,Mt=1015,St=1016,Tt=1017,Et=1018,At=1019,Lt=1020,Ct=1021,Pt=1022,Rt=1023,Ot=1024,kt=1025,Dt=Rt,It=1026,Nt=1027,Bt=1028,zt=1029,Ft=1030,Ut=1031,Gt=1032,Ht=1033,jt=33776,Wt=33777,Vt=33778,Xt=33779,Yt=35840,qt=35841,Zt=35842,Jt=35843,Kt=36196,$t=37492,Qt=37496,te=37808,ee=37809,ie=37810,ne=37811,re=37812,oe=37813,se=37814,ae=37815,le=37816,ce=37817,he=37818,ue=37819,de=37820,pe=37821,fe=36492,me=37840,ge=37841,ve=37842,ye=37843,xe=37844,be=37845,we=37846,_e=37847,Me=37848,Se=37849,Te=37850,Ee=37851,Ae=37852,Le=37853,Ce=2200,Pe=2201,Re=2202,Oe=2300,ke=2301,De=2302,Ie=2400,Ne=2401,Be=2402,ze=2500,Fe=2501,Ue=0,Ge=3e3,He=3001,je=3007,We=3002,Ve=3003,Xe=3004,Ye=3005,qe=3006,Ze=3200,Je=3201,Ke=0,$e=1,Qe=7680,ti=519,ei=35044,ii=35048;function ni(){}Object.assign(ni.prototype,{addEventListener:function(t,e){void 0===this._listeners&&(this._listeners={});const i=this._listeners;void 0===i[t]&&(i[t]=[]),-1===i[t].indexOf(e)&&i[t].push(e)},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;const i=this._listeners;return void 0!==i[t]&&-1!==i[t].indexOf(e)},removeEventListener:function(t,e){if(void 0===this._listeners)return;const i=this._listeners,n=i[t];if(void 0!==n){const t=n.indexOf(e);-1!==t&&n.splice(t,1)}},dispatchEvent:function(t){if(void 0===this._listeners)return;const e=this._listeners,i=e[t.type];if(void 0!==i){t.target=this;const e=i.slice(0);for(let i=0,n=e.length;i<n;i++)e[i].call(this,t)}}});const ri=[];for(let lg=0;lg<256;lg++)ri[lg]=(lg<16?"0":"")+lg.toString(16);const oi={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){const t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,i=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=ri[255&t]+ri[t>>8&255]+ri[t>>16&255]+ri[t>>24&255]+"-"+ri[255&e]+ri[e>>8&255]+"-"+ri[e>>16&15|64]+ri[e>>24&255]+"-"+ri[63&i|128]+ri[i>>8&255]+"-"+ri[i>>16&255]+ri[i>>24&255]+ri[255&n]+ri[n>>8&255]+ri[n>>16&255]+ri[n>>24&255];return r.toUpperCase()},clamp:function(t,e,i){return Math.max(e,Math.min(i,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,i,n,r){return n+(t-e)*(r-n)/(i-e)},lerp:function(t,e,i){return(1-i)*t+i*e},smoothstep:function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e),t*t*(3-2*t))},smootherstep:function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e),t*t*t*(t*(6*t-15)+10))},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(t){return t*oi.DEG2RAD},radToDeg:function(t){return t*oi.RAD2DEG},isPowerOfTwo:function(t){return 0===(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},setQuaternionFromProperEuler:function(t,e,i,n,r){const o=Math.cos,s=Math.sin,a=o(i/2),l=s(i/2),c=o((e+n)/2),h=s((e+n)/2),u=o((e-n)/2),d=s((e-n)/2),p=o((n-e)/2),f=s((n-e)/2);switch(r){case"XYX":t.set(a*h,l*u,l*d,a*c);break;case"YZY":t.set(l*d,a*h,l*u,a*c);break;case"ZXZ":t.set(l*u,l*d,a*h,a*c);break;case"XZX":t.set(a*h,l*f,l*p,a*c);break;case"YXY":t.set(l*p,a*h,l*f,a*c);break;case"ZYZ":t.set(l*f,l*p,a*h,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}};function si(t=0,e=0){this.x=t,this.y=e}function ai(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}let li;Object.defineProperties(si.prototype,{width:{get:function(){return this.x},set:function(t){this.x=t}},height:{get:function(){return this.y},set:function(t){this.y=t}}}),Object.assign(si.prototype,{isVector2:!0,set:function(t,e){return this.x=t,this.y=e,this},setScalar:function(t){return this.x=t,this.y=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(t){return this.x=t.x,this.y=t.y,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(t){return this.x+=t,this.y+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(t){return this.x-=t,this.y-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},divideScalar:function(t){return this.multiplyScalar(1/t)},applyMatrix3:function(t){const e=this.x,i=this.y,n=t.elements;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this},clampLength:function(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){const t=Math.atan2(-this.y,-this.x)+Math.PI;return t},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){const e=this.x-t.x,i=this.y-t.y;return e*e+i*i},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},lerpVectors:function(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t},fromBufferAttribute:function(t,e,i){return void 0!==i&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this},rotateAround:function(t,e){const i=Math.cos(e),n=Math.sin(e),r=this.x-t.x,o=this.y-t.y;return this.x=r*i-o*n+t.x,this.y=r*n+o*i+t.y,this},random:function(){return this.x=Math.random(),this.y=Math.random(),this}}),Object.assign(ai.prototype,{isMatrix3:!0,set:function(t,e,i,n,r,o,s,a,l){const c=this.elements;return c[0]=t,c[1]=n,c[2]=s,c[3]=e,c[4]=r,c[5]=a,c[6]=i,c[7]=o,c[8]=l,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},extractBasis:function(t,e,i){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this},setFromMatrix4:function(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},multiply:function(t){return this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){const i=t.elements,n=e.elements,r=this.elements,o=i[0],s=i[3],a=i[6],l=i[1],c=i[4],h=i[7],u=i[2],d=i[5],p=i[8],f=n[0],m=n[3],g=n[6],v=n[1],y=n[4],x=n[7],b=n[2],w=n[5],_=n[8];return r[0]=o*f+s*v+a*b,r[3]=o*m+s*y+a*w,r[6]=o*g+s*x+a*_,r[1]=l*f+c*v+h*b,r[4]=l*m+c*y+h*w,r[7]=l*g+c*x+h*_,r[2]=u*f+d*v+p*b,r[5]=u*m+d*y+p*w,r[8]=u*g+d*x+p*_,this},multiplyScalar:function(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this},determinant:function(){const t=this.elements,e=t[0],i=t[1],n=t[2],r=t[3],o=t[4],s=t[5],a=t[6],l=t[7],c=t[8];return e*o*c-e*s*l-i*r*c+i*s*a+n*r*l-n*o*a},getInverse:function(t,e){void 0!==e&&console.warn("THREE.Matrix3: .getInverse() can no longer be configured to throw on degenerate.");const i=t.elements,n=this.elements,r=i[0],o=i[1],s=i[2],a=i[3],l=i[4],c=i[5],h=i[6],u=i[7],d=i[8],p=d*l-c*u,f=c*h-d*a,m=u*a-l*h,g=r*p+o*f+s*m;if(0===g)return this.set(0,0,0,0,0,0,0,0,0);const v=1/g;return n[0]=p*v,n[1]=(s*u-d*o)*v,n[2]=(c*o-s*l)*v,n[3]=f*v,n[4]=(d*r-s*h)*v,n[5]=(s*a-c*r)*v,n[6]=m*v,n[7]=(o*h-u*r)*v,n[8]=(l*r-o*a)*v,this},transpose:function(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},getNormalMatrix:function(t){return this.setFromMatrix4(t).getInverse(this).transpose()},transposeIntoArray:function(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this},setUvTransform:function(t,e,i,n,r,o,s){const a=Math.cos(r),l=Math.sin(r);this.set(i*a,i*l,-i*(a*o+l*s)+o+t,-n*l,n*a,-n*(-l*o+a*s)+s+e,0,0,1)},scale:function(t,e){const i=this.elements;return i[0]*=t,i[3]*=t,i[6]*=t,i[1]*=e,i[4]*=e,i[7]*=e,this},rotate:function(t){const e=Math.cos(t),i=Math.sin(t),n=this.elements,r=n[0],o=n[3],s=n[6],a=n[1],l=n[4],c=n[7];return n[0]=e*r+i*a,n[3]=e*o+i*l,n[6]=e*s+i*c,n[1]=-i*r+e*a,n[4]=-i*o+e*l,n[7]=-i*s+e*c,this},translate:function(t,e){const i=this.elements;return i[0]+=t*i[2],i[3]+=t*i[5],i[6]+=t*i[8],i[1]+=e*i[2],i[4]+=e*i[5],i[7]+=e*i[8],this},equals:function(t){const e=this.elements,i=t.elements;for(let n=0;n<9;n++)if(e[n]!==i[n])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(let i=0;i<9;i++)this.elements[i]=t[i+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}});const ci={getDataURL:function(t){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{void 0===li&&(li=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),li.width=t.width,li.height=t.height;const i=li.getContext("2d");t instanceof ImageData?i.putImageData(t,0,0):i.drawImage(t,0,0,t.width,t.height),e=li}return e.width>2048||e.height>2048?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}};let hi=0;function ui(t,e,i,n,r,o,s,a,l,c){Object.defineProperty(this,"id",{value:hi++}),this.uuid=oi.generateUUID(),this.name="",this.image=void 0!==t?t:ui.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:ui.DEFAULT_MAPPING,this.wrapS=void 0!==i?i:ct,this.wrapT=void 0!==n?n:ct,this.magFilter=void 0!==r?r:ft,this.minFilter=void 0!==o?o:gt,this.anisotropy=void 0!==l?l:1,this.format=void 0!==s?s:Rt,this.internalFormat=null,this.type=void 0!==a?a:vt,this.offset=new si(0,0),this.repeat=new si(1,1),this.center=new si(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new ai,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==c?c:Ge,this.version=0,this.onUpdate=null}function di(t=0,e=0,i=0,n=1){this.x=t,this.y=e,this.z=i,this.w=n}function pi(t,e,i){this.width=t,this.height=e,this.scissor=new di(0,0,t,e),this.scissorTest=!1,this.viewport=new di(0,0,t,e),i=i||{},this.texture=new ui(void 0,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.texture.image={},this.texture.image.width=t,this.texture.image.height=e,this.texture.generateMipmaps=void 0!==i.generateMipmaps&&i.generateMipmaps,this.texture.minFilter=void 0!==i.minFilter?i.minFilter:ft,this.depthBuffer=void 0===i.depthBuffer||i.depthBuffer,this.stencilBuffer=void 0===i.stencilBuffer||i.stencilBuffer,this.depthTexture=void 0!==i.depthTexture?i.depthTexture:null}function fi(t,e,i){pi.call(this,t,e,i),this.samples=4}function mi(t=0,e=0,i=0,n=1){this._x=t,this._y=e,this._z=i,this._w=n}ui.DEFAULT_IMAGE=void 0,ui.DEFAULT_MAPPING=et,ui.prototype=Object.assign(Object.create(ni.prototype),{constructor:ui,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},toJSON:function(t){const e=void 0===t||"string"===typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];const i={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){const n=this.image;if(void 0===n.uuid&&(n.uuid=oi.generateUUID()),!e&&void 0===t.images[n.uuid]){let e;if(Array.isArray(n)){e=[];for(let t=0,i=n.length;t<i;t++)e.push(ci.getDataURL(n[t]))}else e=ci.getDataURL(n);t.images[n.uuid]={uuid:n.uuid,url:e}}i.image=n.uuid}return e||(t.textures[this.uuid]=i),i},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(t){if(this.mapping!==et)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case lt:t.x=t.x-Math.floor(t.x);break;case ct:t.x=t.x<0?0:1;break;case ht:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case lt:t.y=t.y-Math.floor(t.y);break;case ct:t.y=t.y<0?0:1;break;case ht:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}}),Object.defineProperty(ui.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.defineProperties(di.prototype,{width:{get:function(){return this.z},set:function(t){this.z=t}},height:{get:function(){return this.w},set:function(t){this.w=t}}}),Object.assign(di.prototype,{isVector4:!0,set:function(t,e,i,n){return this.x=t,this.y=e,this.z=i,this.w=n,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setW:function(t){return this.w=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},applyMatrix4:function(t){const e=this.x,i=this.y,n=this.z,r=this.w,o=t.elements;return this.x=o[0]*e+o[4]*i+o[8]*n+o[12]*r,this.y=o[1]*e+o[5]*i+o[9]*n+o[13]*r,this.z=o[2]*e+o[6]*i+o[10]*n+o[14]*r,this.w=o[3]*e+o[7]*i+o[11]*n+o[15]*r,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this},setAxisAngleFromRotationMatrix:function(t){let e,i,n,r;const o=.01,s=.1,a=t.elements,l=a[0],c=a[4],h=a[8],u=a[1],d=a[5],p=a[9],f=a[2],m=a[6],g=a[10];if(Math.abs(c-u)<o&&Math.abs(h-f)<o&&Math.abs(p-m)<o){if(Math.abs(c+u)<s&&Math.abs(h+f)<s&&Math.abs(p+m)<s&&Math.abs(l+d+g-3)<s)return this.set(1,0,0,0),this;e=Math.PI;const t=(l+1)/2,a=(d+1)/2,v=(g+1)/2,y=(c+u)/4,x=(h+f)/4,b=(p+m)/4;return t>a&&t>v?t<o?(i=0,n=.707106781,r=.707106781):(i=Math.sqrt(t),n=y/i,r=x/i):a>v?a<o?(i=.707106781,n=0,r=.707106781):(n=Math.sqrt(a),i=y/n,r=b/n):v<o?(i=.707106781,n=.707106781,r=0):(r=Math.sqrt(v),i=x/r,n=b/r),this.set(i,n,r,e),this}let v=Math.sqrt((m-p)*(m-p)+(h-f)*(h-f)+(u-c)*(u-c));return Math.abs(v)<.001&&(v=1),this.x=(m-p)/v,this.y=(h-f)/v,this.z=(u-c)/v,this.w=Math.acos((l+d+g-1)/2),this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this},clampLength:function(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},lerpVectors:function(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this.w=t.w+(e.w-t.w)*i,this},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t},fromBufferAttribute:function(t,e,i){return void 0!==i&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this},random:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}}),pi.prototype=Object.assign(Object.create(ni.prototype),{constructor:pi,isWebGLRenderTarget:!0,setSize:function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.texture.image.width=t,this.texture.image.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.width=t.width,this.height=t.height,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),fi.prototype=Object.assign(Object.create(pi.prototype),{constructor:fi,isWebGLMultisampleRenderTarget:!0,copy:function(t){return pi.prototype.copy.call(this,t),this.samples=t.samples,this}}),Object.assign(mi,{slerp:function(t,e,i,n){return i.copy(t).slerp(e,n)},slerpFlat:function(t,e,i,n,r,o,s){let a=i[n+0],l=i[n+1],c=i[n+2],h=i[n+3];const u=r[o+0],d=r[o+1],p=r[o+2],f=r[o+3];if(h!==f||a!==u||l!==d||c!==p){let t=1-s,e=a*u+l*d+c*p+h*f,i=e>=0?1:-1,n=1-e*e;if(n>Number.EPSILON){const r=Math.sqrt(n),o=Math.atan2(r,e*i);t=Math.sin(t*o)/r,s=Math.sin(s*o)/r}const r=s*i;if(a=a*t+u*r,l=l*t+d*r,c=c*t+p*r,h=h*t+f*r,t===1-s){const t=1/Math.sqrt(a*a+l*l+c*c+h*h);a*=t,l*=t,c*=t,h*=t}}t[e]=a,t[e+1]=l,t[e+2]=c,t[e+3]=h},multiplyQuaternionsFlat:function(t,e,i,n,r,o){const s=i[n],a=i[n+1],l=i[n+2],c=i[n+3],h=r[o],u=r[o+1],d=r[o+2],p=r[o+3];return t[e]=s*p+c*h+a*d-l*u,t[e+1]=a*p+c*u+l*h-s*d,t[e+2]=l*p+c*d+s*u-a*h,t[e+3]=c*p-s*h-a*u-l*d,t}}),Object.defineProperties(mi.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},w:{get:function(){return this._w},set:function(t){this._w=t,this._onChangeCallback()}}}),Object.assign(mi.prototype,{isQuaternion:!0,set:function(t,e,i,n){return this._x=t,this._y=e,this._z=i,this._w=n,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this},setFromEuler:function(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const i=t._x,n=t._y,r=t._z,o=t.order,s=Math.cos,a=Math.sin,l=s(i/2),c=s(n/2),h=s(r/2),u=a(i/2),d=a(n/2),p=a(r/2);switch(o){case"XYZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"YXZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"ZXY":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"ZYX":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"YZX":this._x=u*c*h+l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h-u*d*p;break;case"XZY":this._x=u*c*h-l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h+u*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return!1!==e&&this._onChangeCallback(),this},setFromAxisAngle:function(t,e){const i=e/2,n=Math.sin(i);return this._x=t.x*n,this._y=t.y*n,this._z=t.z*n,this._w=Math.cos(i),this._onChangeCallback(),this},setFromRotationMatrix:function(t){const e=t.elements,i=e[0],n=e[4],r=e[8],o=e[1],s=e[5],a=e[9],l=e[2],c=e[6],h=e[10],u=i+s+h;if(u>0){const t=.5/Math.sqrt(u+1);this._w=.25/t,this._x=(c-a)*t,this._y=(r-l)*t,this._z=(o-n)*t}else if(i>s&&i>h){const t=2*Math.sqrt(1+i-s-h);this._w=(c-a)/t,this._x=.25*t,this._y=(n+o)/t,this._z=(r+l)/t}else if(s>h){const t=2*Math.sqrt(1+s-i-h);this._w=(r-l)/t,this._x=(n+o)/t,this._y=.25*t,this._z=(a+c)/t}else{const t=2*Math.sqrt(1+h-i-s);this._w=(o-n)/t,this._x=(r+l)/t,this._y=(a+c)/t,this._z=.25*t}return this._onChangeCallback(),this},setFromUnitVectors:function(t,e){const i=1e-6;let n=t.dot(e)+1;return n<i?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()},angleTo:function(t){return 2*Math.acos(Math.abs(oi.clamp(this.dot(t),-1,1)))},rotateTowards:function(t,e){const i=this.angleTo(t);if(0===i)return this;const n=Math.min(1,e/i);return this.slerp(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(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){let t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)},premultiply:function(t){return this.multiplyQuaternions(t,this)},multiplyQuaternions:function(t,e){const i=t._x,n=t._y,r=t._z,o=t._w,s=e._x,a=e._y,l=e._z,c=e._w;return this._x=i*c+o*s+n*l-r*a,this._y=n*c+o*a+r*s-i*l,this._z=r*c+o*l+i*a-n*s,this._w=o*c-i*s-n*a-r*l,this._onChangeCallback(),this},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);const i=this._x,n=this._y,r=this._z,o=this._w;let s=o*t._w+i*t._x+n*t._y+r*t._z;if(s<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,s=-s):this.copy(t),s>=1)return this._w=o,this._x=i,this._y=n,this._z=r,this;const a=1-s*s;if(a<=Number.EPSILON){const t=1-e;return this._w=t*o+e*this._w,this._x=t*i+e*this._x,this._y=t*n+e*this._y,this._z=t*r+e*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(a),c=Math.atan2(l,s),h=Math.sin((1-e)*c)/l,u=Math.sin(e*c)/l;return this._w=o*h+this._w*u,this._x=i*h+this._x*u,this._y=n*h+this._y*u,this._z=r*h+this._z*u,this._onChangeCallback(),this},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},fromArray:function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},fromBufferAttribute:function(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this},_onChange:function(t){return this._onChangeCallback=t,this},_onChangeCallback:function(){}});const gi=new yi,vi=new mi;function yi(t=0,e=0,i=0){this.x=t,this.y=e,this.z=i}Object.assign(yi.prototype,{isVector3:!0,set:function(t,e,i){return this.x=t,this.y=e,this.z=i,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this},multiplyVectors:function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},applyEuler:function(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(vi.setFromEuler(t))},applyAxisAngle:function(t,e){return this.applyQuaternion(vi.setFromAxisAngle(t,e))},applyMatrix3:function(t){const e=this.x,i=this.y,n=this.z,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6]*n,this.y=r[1]*e+r[4]*i+r[7]*n,this.z=r[2]*e+r[5]*i+r[8]*n,this},applyNormalMatrix:function(t){return this.applyMatrix3(t).normalize()},applyMatrix4:function(t){const e=this.x,i=this.y,n=this.z,r=t.elements,o=1/(r[3]*e+r[7]*i+r[11]*n+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*n+r[12])*o,this.y=(r[1]*e+r[5]*i+r[9]*n+r[13])*o,this.z=(r[2]*e+r[6]*i+r[10]*n+r[14])*o,this},applyQuaternion:function(t){const e=this.x,i=this.y,n=this.z,r=t.x,o=t.y,s=t.z,a=t.w,l=a*e+o*n-s*i,c=a*i+s*e-r*n,h=a*n+r*i-o*e,u=-r*e-o*i-s*n;return this.x=l*a+u*-r+c*-s-h*-o,this.y=c*a+u*-o+h*-r-l*-s,this.z=h*a+u*-s+l*-o-c*-r,this},project:function(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)},unproject:function(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)},transformDirection:function(t){const e=this.x,i=this.y,n=this.z,r=t.elements;return this.x=r[0]*e+r[4]*i+r[8]*n,this.y=r[1]*e+r[5]*i+r[9]*n,this.z=r[2]*e+r[6]*i+r[10]*n,this.normalize()},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this},clampLength:function(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},lerpVectors:function(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this},cross:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)},crossVectors:function(t,e){const i=t.x,n=t.y,r=t.z,o=e.x,s=e.y,a=e.z;return this.x=n*a-r*s,this.y=r*o-i*a,this.z=i*s-n*o,this},projectOnVector:function(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)},projectOnPlane:function(t){return gi.copy(this).projectOnVector(t),this.sub(gi)},reflect:function(t){return this.sub(gi.copy(t).multiplyScalar(2*this.dot(t)))},angleTo:function(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(oi.clamp(i,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){const e=this.x-t.x,i=this.y-t.y,n=this.z-t.z;return e*e+i*i+n*n},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)},setFromSpherical:function(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)},setFromSphericalCoords:function(t,e,i){const n=Math.sin(e)*t;return this.x=n*Math.sin(i),this.y=Math.cos(e)*t,this.z=n*Math.cos(i),this},setFromCylindrical:function(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)},setFromCylindricalCoords:function(t,e,i){return this.x=t*Math.sin(e),this.y=i,this.z=t*Math.cos(e),this},setFromMatrixPosition:function(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this},setFromMatrixScale:function(t){const e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),n=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=n,this},setFromMatrixColumn:function(t,e){return this.fromArray(t.elements,4*e)},setFromMatrix3Column:function(t,e){return this.fromArray(t.elements,3*e)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},fromBufferAttribute:function(t,e,i){return void 0!==i&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this},random:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}});const xi=new yi,bi=new Ei,wi=new yi(0,0,0),_i=new yi(1,1,1),Mi=new yi,Si=new yi,Ti=new yi;function Ei(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}Object.assign(Ei.prototype,{isMatrix4:!0,set:function(t,e,i,n,r,o,s,a,l,c,h,u,d,p,f,m){const g=this.elements;return g[0]=t,g[4]=e,g[8]=i,g[12]=n,g[1]=r,g[5]=o,g[9]=s,g[13]=a,g[2]=l,g[6]=c,g[10]=h,g[14]=u,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 Ei).fromArray(this.elements)},copy:function(t){const e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this},copyPosition:function(t){const e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this},extractBasis:function(t,e,i){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this},makeBasis:function(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this},extractRotation:function(t){const e=this.elements,i=t.elements,n=1/xi.setFromMatrixColumn(t,0).length(),r=1/xi.setFromMatrixColumn(t,1).length(),o=1/xi.setFromMatrixColumn(t,2).length();return e[0]=i[0]*n,e[1]=i[1]*n,e[2]=i[2]*n,e[3]=0,e[4]=i[4]*r,e[5]=i[5]*r,e[6]=i[6]*r,e[7]=0,e[8]=i[8]*o,e[9]=i[9]*o,e[10]=i[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromEuler:function(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const e=this.elements,i=t.x,n=t.y,r=t.z,o=Math.cos(i),s=Math.sin(i),a=Math.cos(n),l=Math.sin(n),c=Math.cos(r),h=Math.sin(r);if("XYZ"===t.order){const t=o*c,i=o*h,n=s*c,r=s*h;e[0]=a*c,e[4]=-a*h,e[8]=l,e[1]=i+n*l,e[5]=t-r*l,e[9]=-s*a,e[2]=r-t*l,e[6]=n+i*l,e[10]=o*a}else if("YXZ"===t.order){const t=a*c,i=a*h,n=l*c,r=l*h;e[0]=t+r*s,e[4]=n*s-i,e[8]=o*l,e[1]=o*h,e[5]=o*c,e[9]=-s,e[2]=i*s-n,e[6]=r+t*s,e[10]=o*a}else if("ZXY"===t.order){const t=a*c,i=a*h,n=l*c,r=l*h;e[0]=t-r*s,e[4]=-o*h,e[8]=n+i*s,e[1]=i+n*s,e[5]=o*c,e[9]=r-t*s,e[2]=-o*l,e[6]=s,e[10]=o*a}else if("ZYX"===t.order){const t=o*c,i=o*h,n=s*c,r=s*h;e[0]=a*c,e[4]=n*l-i,e[8]=t*l+r,e[1]=a*h,e[5]=r*l+t,e[9]=i*l-n,e[2]=-l,e[6]=s*a,e[10]=o*a}else if("YZX"===t.order){const t=o*a,i=o*l,n=s*a,r=s*l;e[0]=a*c,e[4]=r-t*h,e[8]=n*h+i,e[1]=h,e[5]=o*c,e[9]=-s*c,e[2]=-l*c,e[6]=i*h+n,e[10]=t-r*h}else if("XZY"===t.order){const t=o*a,i=o*l,n=s*a,r=s*l;e[0]=a*c,e[4]=-h,e[8]=l*c,e[1]=t*h+r,e[5]=o*c,e[9]=i*h-n,e[2]=n*h-i,e[6]=s*c,e[10]=r*h+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromQuaternion:function(t){return this.compose(wi,t,_i)},lookAt:function(t,e,i){const n=this.elements;return Ti.subVectors(t,e),0===Ti.lengthSq()&&(Ti.z=1),Ti.normalize(),Mi.crossVectors(i,Ti),0===Mi.lengthSq()&&(1===Math.abs(i.z)?Ti.x+=1e-4:Ti.z+=1e-4,Ti.normalize(),Mi.crossVectors(i,Ti)),Mi.normalize(),Si.crossVectors(Ti,Mi),n[0]=Mi.x,n[4]=Si.x,n[8]=Ti.x,n[1]=Mi.y,n[5]=Si.y,n[9]=Ti.y,n[2]=Mi.z,n[6]=Si.z,n[10]=Ti.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){const i=t.elements,n=e.elements,r=this.elements,o=i[0],s=i[4],a=i[8],l=i[12],c=i[1],h=i[5],u=i[9],d=i[13],p=i[2],f=i[6],m=i[10],g=i[14],v=i[3],y=i[7],x=i[11],b=i[15],w=n[0],_=n[4],M=n[8],S=n[12],T=n[1],E=n[5],A=n[9],L=n[13],C=n[2],P=n[6],R=n[10],O=n[14],k=n[3],D=n[7],I=n[11],N=n[15];return r[0]=o*w+s*T+a*C+l*k,r[4]=o*_+s*E+a*P+l*D,r[8]=o*M+s*A+a*R+l*I,r[12]=o*S+s*L+a*O+l*N,r[1]=c*w+h*T+u*C+d*k,r[5]=c*_+h*E+u*P+d*D,r[9]=c*M+h*A+u*R+d*I,r[13]=c*S+h*L+u*O+d*N,r[2]=p*w+f*T+m*C+g*k,r[6]=p*_+f*E+m*P+g*D,r[10]=p*M+f*A+m*R+g*I,r[14]=p*S+f*L+m*O+g*N,r[3]=v*w+y*T+x*C+b*k,r[7]=v*_+y*E+x*P+b*D,r[11]=v*M+y*A+x*R+b*I,r[15]=v*S+y*L+x*O+b*N,this},multiplyScalar:function(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},determinant:function(){const t=this.elements,e=t[0],i=t[4],n=t[8],r=t[12],o=t[1],s=t[5],a=t[9],l=t[13],c=t[2],h=t[6],u=t[10],d=t[14],p=t[3],f=t[7],m=t[11],g=t[15];return p*(+r*a*h-n*l*h-r*s*u+i*l*u+n*s*d-i*a*d)+f*(+e*a*d-e*l*u+r*o*u-n*o*d+n*l*c-r*a*c)+m*(+e*l*h-e*s*d-r*o*h+i*o*d+r*s*c-i*l*c)+g*(-n*s*c-e*a*h+e*s*u+n*o*h-i*o*u+i*a*c)},transpose:function(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this},setPosition:function(t,e,i){const n=this.elements;return t.isVector3?(n[12]=t.x,n[13]=t.y,n[14]=t.z):(n[12]=t,n[13]=e,n[14]=i),this},getInverse:function(t,e){void 0!==e&&console.warn("THREE.Matrix4: .getInverse() can no longer be configured to throw on degenerate.");const i=this.elements,n=t.elements,r=n[0],o=n[1],s=n[2],a=n[3],l=n[4],c=n[5],h=n[6],u=n[7],d=n[8],p=n[9],f=n[10],m=n[11],g=n[12],v=n[13],y=n[14],x=n[15],b=p*y*u-v*f*u+v*h*m-c*y*m-p*h*x+c*f*x,w=g*f*u-d*y*u-g*h*m+l*y*m+d*h*x-l*f*x,_=d*v*u-g*p*u+g*c*m-l*v*m-d*c*x+l*p*x,M=g*p*h-d*v*h-g*c*f+l*v*f+d*c*y-l*p*y,S=r*b+o*w+s*_+a*M;if(0===S)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const T=1/S;return i[0]=b*T,i[1]=(v*f*a-p*y*a-v*s*m+o*y*m+p*s*x-o*f*x)*T,i[2]=(c*y*a-v*h*a+v*s*u-o*y*u-c*s*x+o*h*x)*T,i[3]=(p*h*a-c*f*a-p*s*u+o*f*u+c*s*m-o*h*m)*T,i[4]=w*T,i[5]=(d*y*a-g*f*a+g*s*m-r*y*m-d*s*x+r*f*x)*T,i[6]=(g*h*a-l*y*a-g*s*u+r*y*u+l*s*x-r*h*x)*T,i[7]=(l*f*a-d*h*a+d*s*u-r*f*u-l*s*m+r*h*m)*T,i[8]=_*T,i[9]=(g*p*a-d*v*a-g*o*m+r*v*m+d*o*x-r*p*x)*T,i[10]=(l*v*a-g*c*a+g*o*u-r*v*u-l*o*x+r*c*x)*T,i[11]=(d*c*a-l*p*a-d*o*u+r*p*u+l*o*m-r*c*m)*T,i[12]=M*T,i[13]=(d*v*s-g*p*s+g*o*f-r*v*f-d*o*y+r*p*y)*T,i[14]=(g*c*s-l*v*s-g*o*h+r*v*h+l*o*y-r*c*y)*T,i[15]=(l*p*s-d*c*s+d*o*h-r*p*h-l*o*f+r*c*f)*T,this},scale:function(t){const e=this.elements,i=t.x,n=t.y,r=t.z;return e[0]*=i,e[4]*=n,e[8]*=r,e[1]*=i,e[5]*=n,e[9]*=r,e[2]*=i,e[6]*=n,e[10]*=r,e[3]*=i,e[7]*=n,e[11]*=r,this},getMaxScaleOnAxis:function(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],n=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,n))},makeTranslation:function(t,e,i){return this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this},makeRotationX:function(t){const e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1),this},makeRotationY:function(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1),this},makeRotationZ:function(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(t,e){const i=Math.cos(e),n=Math.sin(e),r=1-i,o=t.x,s=t.y,a=t.z,l=r*o,c=r*s;return this.set(l*o+i,l*s-n*a,l*a+n*s,0,l*s+n*a,c*s+i,c*a-n*o,0,l*a-n*s,c*a+n*o,r*a*a+i,0,0,0,0,1),this},makeScale:function(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this},makeShear:function(t,e,i){return this.set(1,e,i,0,t,1,i,0,t,e,1,0,0,0,0,1),this},compose:function(t,e,i){const n=this.elements,r=e._x,o=e._y,s=e._z,a=e._w,l=r+r,c=o+o,h=s+s,u=r*l,d=r*c,p=r*h,f=o*c,m=o*h,g=s*h,v=a*l,y=a*c,x=a*h,b=i.x,w=i.y,_=i.z;return n[0]=(1-(f+g))*b,n[1]=(d+x)*b,n[2]=(p-y)*b,n[3]=0,n[4]=(d-x)*w,n[5]=(1-(u+g))*w,n[6]=(m+v)*w,n[7]=0,n[8]=(p+y)*_,n[9]=(m-v)*_,n[10]=(1-(u+f))*_,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,this},decompose:function(t,e,i){const n=this.elements;let r=xi.set(n[0],n[1],n[2]).length(),o=xi.set(n[4],n[5],n[6]).length(),s=xi.set(n[8],n[9],n[10]).length();const a=this.determinant();a<0&&(r=-r),t.x=n[12],t.y=n[13],t.z=n[14],bi.copy(this);const l=1/r,c=1/o,h=1/s;return bi.elements[0]*=l,bi.elements[1]*=l,bi.elements[2]*=l,bi.elements[4]*=c,bi.elements[5]*=c,bi.elements[6]*=c,bi.elements[8]*=h,bi.elements[9]*=h,bi.elements[10]*=h,e.setFromRotationMatrix(bi),i.x=r,i.y=o,i.z=s,this},makePerspective:function(t,e,i,n,r,o){void 0===o&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");const s=this.elements,a=2*r/(e-t),l=2*r/(i-n),c=(e+t)/(e-t),h=(i+n)/(i-n),u=-(o+r)/(o-r),d=-2*o*r/(o-r);return s[0]=a,s[4]=0,s[8]=c,s[12]=0,s[1]=0,s[5]=l,s[9]=h,s[13]=0,s[2]=0,s[6]=0,s[10]=u,s[14]=d,s[3]=0,s[7]=0,s[11]=-1,s[15]=0,this},makeOrthographic:function(t,e,i,n,r,o){const s=this.elements,a=1/(e-t),l=1/(i-n),c=1/(o-r),h=(e+t)*a,u=(i+n)*l,d=(o+r)*c;return s[0]=2*a,s[4]=0,s[8]=0,s[12]=-h,s[1]=0,s[5]=2*l,s[9]=0,s[13]=-u,s[2]=0,s[6]=0,s[10]=-2*c,s[14]=-d,s[3]=0,s[7]=0,s[11]=0,s[15]=1,this},equals:function(t){const e=this.elements,i=t.elements;for(let n=0;n<16;n++)if(e[n]!==i[n])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(let i=0;i<16;i++)this.elements[i]=t[i+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t}});const Ai=new Ei,Li=new mi;function Ci(t=0,e=0,i=0,n=Ci.DefaultOrder){this._x=t,this._y=e,this._z=i,this._order=n}function Pi(){this.mask=1}Ci.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],Ci.DefaultOrder="XYZ",Object.defineProperties(Ci.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},order:{get:function(){return this._order},set:function(t){this._order=t,this._onChangeCallback()}}}),Object.assign(Ci.prototype,{isEuler:!0,set:function(t,e,i,n){return this._x=t,this._y=e,this._z=i,this._order=n||this._order,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this},setFromRotationMatrix:function(t,e,i){const n=oi.clamp,r=t.elements,o=r[0],s=r[4],a=r[8],l=r[1],c=r[5],h=r[9],u=r[2],d=r[6],p=r[10];switch(e=e||this._order,e){case"XYZ":this._y=Math.asin(n(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-h,p),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-n(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(a,p),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-u,o),this._z=0);break;case"ZXY":this._x=Math.asin(n(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,p),this._z=Math.atan2(-s,c)):(this._y=0,this._z=Math.atan2(l,o));break;case"ZYX":this._y=Math.asin(-n(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,p),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-s,c));break;case"YZX":this._z=Math.asin(n(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-u,o)):(this._x=0,this._y=Math.atan2(a,p));break;case"XZY":this._z=Math.asin(-n(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(a,o)):(this._x=Math.atan2(-h,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!1!==i&&this._onChangeCallback(),this},setFromQuaternion:function(t,e,i){return Ai.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Ai,e,i)},setFromVector3:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},reorder:function(t){return Li.setFromEuler(this),this.setFromQuaternion(Li,t)},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order},fromArray:function(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t},toVector3:function(t){return t?t.set(this._x,this._y,this._z):new yi(this._x,this._y,this._z)},_onChange:function(t){return this._onChangeCallback=t,this},_onChangeCallback:function(){}}),Object.assign(Pi.prototype,{set:function(t){this.mask=1<<t|0},enable:function(t){this.mask|=1<<t|0},enableAll:function(){this.mask=-1},toggle:function(t){this.mask^=1<<t|0},disable:function(t){this.mask&=~(1<<t|0)},disableAll:function(){this.mask=0},test:function(t){return 0!==(this.mask&t.mask)}});let Ri=0;const Oi=new yi,ki=new mi,Di=new Ei,Ii=new yi,Ni=new yi,Bi=new yi,zi=new mi,Fi=new yi(1,0,0),Ui=new yi(0,1,0),Gi=new yi(0,0,1),Hi={type:"added"},ji={type:"removed"};function Wi(){Object.defineProperty(this,"id",{value:Ri++}),this.uuid=oi.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Wi.DefaultUp.clone();const t=new yi,e=new Ci,i=new mi,n=new yi(1,1,1);function r(){i.setFromEuler(e,!1)}function o(){e.setFromQuaternion(i,void 0,!1)}e._onChange(r),i._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:n},modelViewMatrix:{value:new Ei},normalMatrix:{value:new ai}}),this.matrix=new Ei,this.matrixWorld=new Ei,this.matrixAutoUpdate=Wi.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new Pi,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function Vi(){Wi.call(this),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}Wi.DefaultUp=new yi(0,1,0),Wi.DefaultMatrixAutoUpdate=!0,Wi.prototype=Object.assign(Object.create(ni.prototype),{constructor:Wi,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix4:function(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(t){return this.quaternion.premultiply(t),this},setRotationFromAxisAngle:function(t,e){this.quaternion.setFromAxisAngle(t,e)},setRotationFromEuler:function(t){this.quaternion.setFromEuler(t,!0)},setRotationFromMatrix:function(t){this.quaternion.setFromRotationMatrix(t)},setRotationFromQuaternion:function(t){this.quaternion.copy(t)},rotateOnAxis:function(t,e){return ki.setFromAxisAngle(t,e),this.quaternion.multiply(ki),this},rotateOnWorldAxis:function(t,e){return ki.setFromAxisAngle(t,e),this.quaternion.premultiply(ki),this},rotateX:function(t){return this.rotateOnAxis(Fi,t)},rotateY:function(t){return this.rotateOnAxis(Ui,t)},rotateZ:function(t){return this.rotateOnAxis(Gi,t)},translateOnAxis:function(t,e){return Oi.copy(t).applyQuaternion(this.quaternion),this.position.add(Oi.multiplyScalar(e)),this},translateX:function(t){return this.translateOnAxis(Fi,t)},translateY:function(t){return this.translateOnAxis(Ui,t)},translateZ:function(t){return this.translateOnAxis(Gi,t)},localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:function(t){return t.applyMatrix4(Di.getInverse(this.matrixWorld))},lookAt:function(t,e,i){t.isVector3?Ii.copy(t):Ii.set(t,e,i);const n=this.parent;this.updateWorldMatrix(!0,!1),Ni.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Di.lookAt(Ni,Ii,this.up):Di.lookAt(Ii,Ni,this.up),this.quaternion.setFromRotationMatrix(Di),n&&(Di.extractRotation(n.matrixWorld),ki.setFromRotationMatrix(Di),this.quaternion.premultiply(ki.inverse()))},add:function(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,this.children.push(t),t.dispatchEvent(Hi)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)},remove:function(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}const e=this.children.indexOf(t);return-1!==e&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(ji)),this},attach:function(t){return this.updateWorldMatrix(!0,!1),Di.getInverse(this.matrixWorld),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),Di.multiply(t.parent.matrixWorld)),t.applyMatrix4(Di),t.updateWorldMatrix(!1,!1),this.add(t),this},getObjectById:function(t){return this.getObjectByProperty("id",t)},getObjectByName:function(t){return this.getObjectByProperty("name",t)},getObjectByProperty:function(t,e){if(this[t]===e)return this;for(let i=0,n=this.children.length;i<n;i++){const n=this.children[i],r=n.getObjectByProperty(t,e);if(void 0!==r)return r}},getWorldPosition:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),t=new yi),this.updateMatrixWorld(!0),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),t=new mi),this.updateMatrixWorld(!0),this.matrixWorld.decompose(Ni,t,Bi),t},getWorldScale:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),t=new yi),this.updateMatrixWorld(!0),this.matrixWorld.decompose(Ni,zi,t),t},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),t=new yi),this.updateMatrixWorld(!0);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()},raycast:function(){},traverse:function(t){t(this);const e=this.children;for(let i=0,n=e.length;i<n;i++)e[i].traverse(t)},traverseVisible:function(t){if(!1===this.visible)return;t(this);const e=this.children;for(let i=0,n=e.length;i<n;i++)e[i].traverseVisible(t)},traverseAncestors:function(t){const e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);const e=this.children;for(let i=0,n=e.length;i<n;i++)e[i].updateMatrixWorld(t)},updateWorldMatrix:function(t,e){const i=this.parent;if(!0===t&&null!==i&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===e){const t=this.children;for(let e=0,i=t.length;e<i;e++)t[e].updateWorldMatrix(!1,!0)}},toJSON:function(t){const e=void 0===t||"string"===typeof t,i={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{}},i.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});const n={};function r(e,i){return void 0===e[i.uuid]&&(e[i.uuid]=i.toJSON(t)),i.uuid}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),!0===this.castShadow&&(n.castShadow=!0),!0===this.receiveShadow&&(n.receiveShadow=!0),!1===this.visible&&(n.visible=!1),!1===this.frustumCulled&&(n.frustumCulled=!1),0!==this.renderOrder&&(n.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(n.matrixAutoUpdate=!1),this.isInstancedMesh&&(n.type="InstancedMesh",n.count=this.count,n.instanceMatrix=this.instanceMatrix.toJSON()),this.isMesh||this.isLine||this.isPoints){n.geometry=r(t.geometries,this.geometry);const e=this.geometry.parameters;if(void 0!==e&&void 0!==e.shapes){const i=e.shapes;if(Array.isArray(i))for(let e=0,n=i.length;e<n;e++){const n=i[e];r(t.shapes,n)}else r(t.shapes,i)}}if(void 0!==this.material)if(Array.isArray(this.material)){const e=[];for(let i=0,n=this.material.length;i<n;i++)e.push(r(t.materials,this.material[i]));n.material=e}else n.material=r(t.materials,this.material);if(this.children.length>0){n.children=[];for(let e=0;e<this.children.length;e++)n.children.push(this.children[e].toJSON(t).object)}if(e){const e=o(t.geometries),n=o(t.materials),r=o(t.textures),s=o(t.images),a=o(t.shapes);e.length>0&&(i.geometries=e),n.length>0&&(i.materials=n),r.length>0&&(i.textures=r),s.length>0&&(i.images=s),a.length>0&&(i.shapes=a)}return i.object=n,i;function o(t){const e=[];for(const i in t){const n=t[i];delete n.metadata,e.push(n)}return e}},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,e){if(void 0===e&&(e=!0),this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let i=0;i<t.children.length;i++){const e=t.children[i];this.add(e.clone())}return this}}),Vi.prototype=Object.assign(Object.create(Wi.prototype),{constructor:Vi,isScene:!0,copy:function(t,e){return Wi.prototype.copy.call(this,t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this},toJSON:function(t){const e=Wi.prototype.toJSON.call(this,t);return null!==this.background&&(e.object.background=this.background.toJSON(t)),null!==this.environment&&(e.object.environment=this.environment.toJSON(t)),null!==this.fog&&(e.object.fog=this.fog.toJSON()),e},dispose:function(){this.dispatchEvent({type:"dispose"})}});const Xi=[new yi,new yi,new yi,new yi,new yi,new yi,new yi,new yi],Yi=new yi,qi=new sn,Zi=new yi,Ji=new yi,Ki=new yi,$i=new yi,Qi=new yi,tn=new yi,en=new yi,nn=new yi,rn=new yi,on=new yi;function sn(t,e){this.min=void 0!==t?t:new yi(1/0,1/0,1/0),this.max=void 0!==e?e:new yi(-1/0,-1/0,-1/0)}function an(t,e,i,n,r){for(let o=0,s=t.length-3;o<=s;o+=3){on.fromArray(t,o);const s=r.x*Math.abs(on.x)+r.y*Math.abs(on.y)+r.z*Math.abs(on.z),a=e.dot(on),l=i.dot(on),c=n.dot(on);if(Math.max(-Math.max(a,l,c),Math.min(a,l,c))>s)return!1}return!0}Object.assign(sn.prototype,{isBox3:!0,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromArray:function(t){let e=1/0,i=1/0,n=1/0,r=-1/0,o=-1/0,s=-1/0;for(let a=0,l=t.length;a<l;a+=3){const l=t[a],c=t[a+1],h=t[a+2];l<e&&(e=l),c<i&&(i=c),h<n&&(n=h),l>r&&(r=l),c>o&&(o=c),h>s&&(s=h)}return this.min.set(e,i,n),this.max.set(r,o,s),this},setFromBufferAttribute:function(t){let e=1/0,i=1/0,n=1/0,r=-1/0,o=-1/0,s=-1/0;for(let a=0,l=t.count;a<l;a++){const l=t.getX(a),c=t.getY(a),h=t.getZ(a);l<e&&(e=l),c<i&&(i=c),h<n&&(n=h),l>r&&(r=l),c>o&&(o=c),h>s&&(s=h)}return this.min.set(e,i,n),this.max.set(r,o,s),this},setFromPoints:function(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(t,e){const i=Yi.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this},setFromObject:function(t){return this.makeEmpty(),this.expandByObject(t)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.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(t){return void 0===t&&(console.warn("THREE.Box3: .getCenter() target is now required"),t=new yi),this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(console.warn("THREE.Box3: .getSize() target is now required"),t=new yi),this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},expandByObject:function(t){t.updateWorldMatrix(!1,!1);const e=t.geometry;void 0!==e&&(null===e.boundingBox&&e.computeBoundingBox(),qi.copy(e.boundingBox),qi.applyMatrix4(t.matrixWorld),this.union(qi));const i=t.children;for(let n=0,r=i.length;n<r;n++)this.expandByObject(i[n]);return this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},getParameter:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .getParameter() target is now required"),e=new yi),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)},intersectsSphere:function(t){return this.clampPoint(t.center,Yi),Yi.distanceToSquared(t.center)<=t.radius*t.radius},intersectsPlane:function(t){let e,i;return t.normal.x>0?(e=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),e<=-t.constant&&i>=-t.constant},intersectsTriangle:function(t){if(this.isEmpty())return!1;this.getCenter(en),nn.subVectors(this.max,en),Zi.subVectors(t.a,en),Ji.subVectors(t.b,en),Ki.subVectors(t.c,en),$i.subVectors(Ji,Zi),Qi.subVectors(Ki,Ji),tn.subVectors(Zi,Ki);let e=[0,-$i.z,$i.y,0,-Qi.z,Qi.y,0,-tn.z,tn.y,$i.z,0,-$i.x,Qi.z,0,-Qi.x,tn.z,0,-tn.x,-$i.y,$i.x,0,-Qi.y,Qi.x,0,-tn.y,tn.x,0];return!!an(e,Zi,Ji,Ki,nn)&&(e=[1,0,0,0,1,0,0,0,1],!!an(e,Zi,Ji,Ki,nn)&&(rn.crossVectors($i,Qi),e=[rn.x,rn.y,rn.z],an(e,Zi,Ji,Ki,nn)))},clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .clampPoint() target is now required"),e=new yi),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){const e=Yi.copy(t).clamp(this.min,this.max);return e.sub(t).length()},getBoundingSphere:function(t){return void 0===t&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(t.center),t.radius=.5*this.getSize(Yi).length(),t},intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:function(t){return this.isEmpty()||(Xi[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Xi[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Xi[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Xi[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Xi[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Xi[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Xi[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Xi[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Xi)),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}});const ln=new sn;function cn(t,e){this.center=void 0!==t?t:new yi,this.radius=void 0!==e?e:-1}Object.assign(cn.prototype,{set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:function(t,e){const i=this.center;void 0!==e?i.copy(e):ln.setFromPoints(t).getCenter(i);let n=0;for(let r=0,o=t.length;r<o;r++)n=Math.max(n,i.distanceToSquared(t[r]));return this.radius=Math.sqrt(n),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},isEmpty:function(){return this.radius<0},makeEmpty:function(){return this.center.set(0,0,0),this.radius=-1,this},containsPoint:function(t){return t.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(t){return t.distanceTo(this.center)-this.radius},intersectsSphere:function(t){const e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e},intersectsBox:function(t){return t.intersectsSphere(this)},intersectsPlane:function(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius},clampPoint:function(t,e){const i=this.center.distanceToSquared(t);return void 0===e&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),e=new yi),e.copy(t),i>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e},getBoundingBox:function(t){return void 0===t&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),t=new sn),this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)},applyMatrix4:function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},translate:function(t){return this.center.add(t),this},equals:function(t){return t.center.equals(this.center)&&t.radius===this.radius}});const hn=new yi,un=new yi,dn=new yi,pn=new yi,fn=new yi,mn=new yi,gn=new yi;function vn(t,e){this.origin=void 0!==t?t:new yi,this.direction=void 0!==e?e:new yi(0,0,-1)}Object.assign(vn.prototype,{set:function(t,e){return this.origin.copy(t),this.direction.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this},at:function(t,e){return void 0===e&&(console.warn("THREE.Ray: .at() target is now required"),e=new yi),e.copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},recast:function(t){return this.origin.copy(this.at(t,hn)),this},closestPointToPoint:function(t,e){void 0===e&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),e=new yi),e.subVectors(t,this.origin);const i=e.dot(this.direction);return i<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(i).add(this.origin)},distanceToPoint:function(t){return Math.sqrt(this.distanceSqToPoint(t))},distanceSqToPoint:function(t){const e=hn.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(hn.copy(this.direction).multiplyScalar(e).add(this.origin),hn.distanceToSquared(t))},distanceSqToSegment:function(t,e,i,n){un.copy(t).add(e).multiplyScalar(.5),dn.copy(e).sub(t).normalize(),pn.copy(this.origin).sub(un);const r=.5*t.distanceTo(e),o=-this.direction.dot(dn),s=pn.dot(this.direction),a=-pn.dot(dn),l=pn.lengthSq(),c=Math.abs(1-o*o);let h,u,d,p;if(c>0)if(h=o*a-s,u=o*s-a,p=r*c,h>=0)if(u>=-p)if(u<=p){const t=1/c;h*=t,u*=t,d=h*(h+o*u+2*s)+u*(o*h+u+2*a)+l}else u=r,h=Math.max(0,-(o*u+s)),d=-h*h+u*(u+2*a)+l;else u=-r,h=Math.max(0,-(o*u+s)),d=-h*h+u*(u+2*a)+l;else u<=-p?(h=Math.max(0,-(-o*r+s)),u=h>0?-r:Math.min(Math.max(-r,-a),r),d=-h*h+u*(u+2*a)+l):u<=p?(h=0,u=Math.min(Math.max(-r,-a),r),d=u*(u+2*a)+l):(h=Math.max(0,-(o*r+s)),u=h>0?r:Math.min(Math.max(-r,-a),r),d=-h*h+u*(u+2*a)+l);else u=o>0?-r:r,h=Math.max(0,-(o*u+s)),d=-h*h+u*(u+2*a)+l;return i&&i.copy(this.direction).multiplyScalar(h).add(this.origin),n&&n.copy(dn).multiplyScalar(u).add(un),d},intersectSphere:function(t,e){hn.subVectors(t.center,this.origin);const i=hn.dot(this.direction),n=hn.dot(hn)-i*i,r=t.radius*t.radius;if(n>r)return null;const o=Math.sqrt(r-n),s=i-o,a=i+o;return s<0&&a<0?null:s<0?this.at(a,e):this.at(s,e)},intersectsSphere:function(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius},distanceToPlane:function(t){const e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;const i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null},intersectPlane:function(t,e){const i=this.distanceToPlane(t);return null===i?null:this.at(i,e)},intersectsPlane:function(t){const e=t.distanceToPoint(this.origin);if(0===e)return!0;const i=t.normal.dot(this.direction);return i*e<0},intersectBox:function(t,e){let i,n,r,o,s,a;const l=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,u=this.origin;return l>=0?(i=(t.min.x-u.x)*l,n=(t.max.x-u.x)*l):(i=(t.max.x-u.x)*l,n=(t.min.x-u.x)*l),c>=0?(r=(t.min.y-u.y)*c,o=(t.max.y-u.y)*c):(r=(t.max.y-u.y)*c,o=(t.min.y-u.y)*c),i>o||r>n?null:((r>i||i!==i)&&(i=r),(o<n||n!==n)&&(n=o),h>=0?(s=(t.min.z-u.z)*h,a=(t.max.z-u.z)*h):(s=(t.max.z-u.z)*h,a=(t.min.z-u.z)*h),i>a||s>n?null:((s>i||i!==i)&&(i=s),(a<n||n!==n)&&(n=a),n<0?null:this.at(i>=0?i:n,e)))},intersectsBox:function(t){return null!==this.intersectBox(t,hn)},intersectTriangle:function(t,e,i,n,r){fn.subVectors(e,t),mn.subVectors(i,t),gn.crossVectors(fn,mn);let o,s=this.direction.dot(gn);if(s>0){if(n)return null;o=1}else{if(!(s<0))return null;o=-1,s=-s}pn.subVectors(this.origin,t);const a=o*this.direction.dot(mn.crossVectors(pn,mn));if(a<0)return null;const l=o*this.direction.dot(fn.cross(pn));if(l<0)return null;if(a+l>s)return null;const c=-o*pn.dot(gn);return c<0?null:this.at(c/s,r)},applyMatrix4:function(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this},equals:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}});const yn=new yi,xn=new yi,bn=new ai;function wn(t,e){this.normal=void 0!==t?t:new yi(1,0,0),this.constant=void 0!==e?e:0}Object.assign(wn.prototype,{isPlane:!0,set:function(t,e){return this.normal.copy(t),this.constant=e,this},setComponents:function(t,e,i,n){return this.normal.set(t,e,i),this.constant=n,this},setFromNormalAndCoplanarPoint:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this},setFromCoplanarPoints:function(t,e,i){const n=yn.subVectors(i,e).cross(xn.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(n,t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this},normalize:function(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(t){return this.normal.dot(t)+this.constant},distanceToSphere:function(t){return this.distanceToPoint(t.center)-t.radius},projectPoint:function(t,e){return void 0===e&&(console.warn("THREE.Plane: .projectPoint() target is now required"),e=new yi),e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)},intersectLine:function(t,e){void 0===e&&(console.warn("THREE.Plane: .intersectLine() target is now required"),e=new yi);const i=t.delta(yn),n=this.normal.dot(i);if(0===n)return 0===this.distanceToPoint(t.start)?e.copy(t.start):void 0;const r=-(t.start.dot(this.normal)+this.constant)/n;return r<0||r>1?void 0:e.copy(i).multiplyScalar(r).add(t.start)},intersectsLine:function(t){const e=this.distanceToPoint(t.start),i=this.distanceToPoint(t.end);return e<0&&i>0||i<0&&e>0},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){return void 0===t&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),t=new yi),t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(t,e){const i=e||bn.getNormalMatrix(t),n=this.coplanarPoint(yn).applyMatrix4(t),r=this.normal.applyMatrix3(i).normalize();return this.constant=-n.dot(r),this},translate:function(t){return this.constant-=t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}});const _n=new yi,Mn=new yi,Sn=new yi,Tn=new yi,En=new yi,An=new yi,Ln=new yi,Cn=new yi,Pn=new yi,Rn=new yi;function On(t,e,i){this.a=void 0!==t?t:new yi,this.b=void 0!==e?e:new yi,this.c=void 0!==i?i:new yi}Object.assign(On,{getNormal:function(t,e,i,n){void 0===n&&(console.warn("THREE.Triangle: .getNormal() target is now required"),n=new yi),n.subVectors(i,e),_n.subVectors(t,e),n.cross(_n);const r=n.lengthSq();return r>0?n.multiplyScalar(1/Math.sqrt(r)):n.set(0,0,0)},getBarycoord:function(t,e,i,n,r){_n.subVectors(n,e),Mn.subVectors(i,e),Sn.subVectors(t,e);const o=_n.dot(_n),s=_n.dot(Mn),a=_n.dot(Sn),l=Mn.dot(Mn),c=Mn.dot(Sn),h=o*l-s*s;if(void 0===r&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),r=new yi),0===h)return r.set(-2,-1,-1);const u=1/h,d=(l*a-s*c)*u,p=(o*c-s*a)*u;return r.set(1-d-p,p,d)},containsPoint:function(t,e,i,n){return On.getBarycoord(t,e,i,n,Tn),Tn.x>=0&&Tn.y>=0&&Tn.x+Tn.y<=1},getUV:function(t,e,i,n,r,o,s,a){return this.getBarycoord(t,e,i,n,Tn),a.set(0,0),a.addScaledVector(r,Tn.x),a.addScaledVector(o,Tn.y),a.addScaledVector(s,Tn.z),a},isFrontFacing:function(t,e,i,n){return _n.subVectors(i,e),Mn.subVectors(t,e),_n.cross(Mn).dot(n)<0}}),Object.assign(On.prototype,{set:function(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this},setFromPointsAndIndices:function(t,e,i,n){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[n]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this},getArea:function(){return _n.subVectors(this.c,this.b),Mn.subVectors(this.a,this.b),.5*_n.cross(Mn).length()},getMidpoint:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),t=new yi),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(t){return On.getNormal(this.a,this.b,this.c,t)},getPlane:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getPlane() target is now required"),t=new wn),t.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(t,e){return On.getBarycoord(t,this.a,this.b,this.c,e)},getUV:function(t,e,i,n,r){return On.getUV(t,this.a,this.b,this.c,e,i,n,r)},containsPoint:function(t){return On.containsPoint(t,this.a,this.b,this.c)},isFrontFacing:function(t){return On.isFrontFacing(this.a,this.b,this.c,t)},intersectsBox:function(t){return t.intersectsTriangle(this)},closestPointToPoint:function(t,e){void 0===e&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),e=new yi);const i=this.a,n=this.b,r=this.c;let o,s;En.subVectors(n,i),An.subVectors(r,i),Cn.subVectors(t,i);const a=En.dot(Cn),l=An.dot(Cn);if(a<=0&&l<=0)return e.copy(i);Pn.subVectors(t,n);const c=En.dot(Pn),h=An.dot(Pn);if(c>=0&&h<=c)return e.copy(n);const u=a*h-c*l;if(u<=0&&a>=0&&c<=0)return o=a/(a-c),e.copy(i).addScaledVector(En,o);Rn.subVectors(t,r);const d=En.dot(Rn),p=An.dot(Rn);if(p>=0&&d<=p)return e.copy(r);const f=d*l-a*p;if(f<=0&&l>=0&&p<=0)return s=l/(l-p),e.copy(i).addScaledVector(An,s);const m=c*p-d*h;if(m<=0&&h-c>=0&&d-p>=0)return Ln.subVectors(r,n),s=(h-c)/(h-c+(d-p)),e.copy(n).addScaledVector(Ln,s);const g=1/(m+f+u);return o=f*g,s=u*g,e.copy(i).addScaledVector(En,o).addScaledVector(An,s)},equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}});const kn={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},Dn={h:0,s:0,l:0},In={h:0,s:0,l:0};function Nn(t,e,i){return void 0===e&&void 0===i?this.set(t):this.setRGB(t,e,i)}function Bn(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+6*(e-t)*(2/3-i):t}function zn(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Fn(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}function Un(t,e,i,n,r,o){this.a=t,this.b=e,this.c=i,this.normal=n&&n.isVector3?n:new yi,this.vertexNormals=Array.isArray(n)?n:[],this.color=r&&r.isColor?r:new Nn,this.vertexColors=Array.isArray(r)?r:[],this.materialIndex=void 0!==o?o:0}Object.assign(Nn.prototype,{isColor:!0,r:1,g:1,b:1,set:function(t){return t&&t.isColor?this.copy(t):"number"===typeof t?this.setHex(t):"string"===typeof t&&this.setStyle(t),this},setScalar:function(t){return this.r=t,this.g=t,this.b=t,this},setHex:function(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,e,i){return this.r=t,this.g=e,this.b=i,this},setHSL:function(t,e,i){if(t=oi.euclideanModulo(t,1),e=oi.clamp(e,0,1),i=oi.clamp(i,0,1),0===e)this.r=this.g=this.b=i;else{const n=i<=.5?i*(1+e):i+e-i*e,r=2*i-n;this.r=Bn(r,n,t+1/3),this.g=Bn(r,n,t),this.b=Bn(r,n,t-1/3)}return this},setStyle:function(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let i;if(i=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)){let t;const n=i[1],r=i[2];switch(n){case"rgb":case"rgba":if(t=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(r))return this.r=Math.min(255,parseInt(t[1],10))/255,this.g=Math.min(255,parseInt(t[2],10))/255,this.b=Math.min(255,parseInt(t[3],10))/255,e(t[5]),this;if(t=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(r))return this.r=Math.min(100,parseInt(t[1],10))/100,this.g=Math.min(100,parseInt(t[2],10))/100,this.b=Math.min(100,parseInt(t[3],10))/100,e(t[5]),this;break;case"hsl":case"hsla":if(t=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(r)){const i=parseFloat(t[1])/360,n=parseInt(t[2],10)/100,r=parseInt(t[3],10)/100;return e(t[5]),this.setHSL(i,n,r)}break}}else if(i=/^\#([A-Fa-f0-9]+)$/.exec(t)){const t=i[1],e=t.length;if(3===e)return this.r=parseInt(t.charAt(0)+t.charAt(0),16)/255,this.g=parseInt(t.charAt(1)+t.charAt(1),16)/255,this.b=parseInt(t.charAt(2)+t.charAt(2),16)/255,this;if(6===e)return this.r=parseInt(t.charAt(0)+t.charAt(1),16)/255,this.g=parseInt(t.charAt(2)+t.charAt(3),16)/255,this.b=parseInt(t.charAt(4)+t.charAt(5),16)/255,this}return t&&t.length>0?this.setColorName(t):this},setColorName:function(t){const e=kn[t];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},copyGammaToLinear:function(t,e){return void 0===e&&(e=2),this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this},copyLinearToGamma:function(t,e){void 0===e&&(e=2);const i=e>0?1/e:1;return this.r=Math.pow(t.r,i),this.g=Math.pow(t.g,i),this.b=Math.pow(t.b,i),this},convertGammaToLinear:function(t){return this.copyGammaToLinear(this,t),this},convertLinearToGamma:function(t){return this.copyLinearToGamma(this,t),this},copySRGBToLinear:function(t){return this.r=zn(t.r),this.g=zn(t.g),this.b=zn(t.b),this},copyLinearToSRGB:function(t){return this.r=Fn(t.r),this.g=Fn(t.g),this.b=Fn(t.b),this},convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(t){void 0===t&&(console.warn("THREE.Color: .getHSL() target is now required"),t={h:0,s:0,l:0});const e=this.r,i=this.g,n=this.b,r=Math.max(e,i,n),o=Math.min(e,i,n);let s,a;const l=(o+r)/2;if(o===r)s=0,a=0;else{const t=r-o;switch(a=l<=.5?t/(r+o):t/(2-r-o),r){case e:s=(i-n)/t+(i<n?6:0);break;case i:s=(n-e)/t+2;break;case n:s=(e-i)/t+4;break}s/=6}return t.h=s,t.s=a,t.l=l,t},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(t,e,i){return this.getHSL(Dn),Dn.h+=t,Dn.s+=e,Dn.l+=i,this.setHSL(Dn.h,Dn.s,Dn.l),this},add:function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this},addColors:function(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this},addScalar:function(t){return this.r+=t,this.g+=t,this.b+=t,this},sub:function(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this},multiply:function(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this},multiplyScalar:function(t){return this.r*=t,this.g*=t,this.b*=t,this},lerp:function(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this},lerpHSL:function(t,e){this.getHSL(Dn),t.getHSL(In);const i=oi.lerp(Dn.h,In.h,e),n=oi.lerp(Dn.s,In.s,e),r=oi.lerp(Dn.l,In.l,e);return this.setHSL(i,n,r),this},equals:function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b},fromArray:function(t,e){return void 0===e&&(e=0),this.r=t[e],this.g=t[e+1],this.b=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t},fromBufferAttribute:function(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),!0===t.normalized&&(this.r/=255,this.g/=255,this.b/=255),this},toJSON:function(){return this.getHex()}}),Nn.NAMES=kn,Object.assign(Un.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.a=t.a,this.b=t.b,this.c=t.c,this.normal.copy(t.normal),this.color.copy(t.color),this.materialIndex=t.materialIndex;for(let e=0,i=t.vertexNormals.length;e<i;e++)this.vertexNormals[e]=t.vertexNormals[e].clone();for(let e=0,i=t.vertexColors.length;e<i;e++)this.vertexColors[e]=t.vertexColors[e].clone();return this}});let Gn=0;function Hn(){Object.defineProperty(this,"id",{value:Gn++}),this.uuid=oi.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.blending=v,this.side=d,this.flatShading=!1,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=R,this.blendDst=O,this.blendEquation=_,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=G,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=ti,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Qe,this.stencilZFail=Qe,this.stencilZPass=Qe,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}function jn(t){Hn.call(this),this.type="MeshBasicMaterial",this.color=new Nn(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=X,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.setValues(t)}Hn.prototype=Object.assign(Object.create(ni.prototype),{constructor:Hn,isMaterial:!0,onBeforeCompile:function(){},customProgramCacheKey:function(){return this.onBeforeCompile.toString()},setValues:function(t){if(void 0!==t)for(const e in t){const i=t[e];if(void 0===i){console.warn("THREE.Material: '"+e+"' parameter is undefined.");continue}if("shading"===e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=i===m;continue}const n=this[e];void 0!==n?n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[e]=i:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.")}},toJSON:function(t){const e=void 0===t||"string"===typeof t;e&&(t={textures:{},images:{}});const i={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function n(t){const e=[];for(const i in t){const n=t[i];delete n.metadata,e.push(n)}return e}if(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(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(t).uuid),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(t).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(t).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(t).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(t).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(t).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(t).uuid),void 0!==this.size&&(i.size=this.size),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==v&&(i.blending=this.blending),!0===this.flatShading&&(i.flatShading=this.flatShading),this.side!==d&&(i.side=this.side),this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(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),this.alphaTest>0&&(i.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(i.wireframe=this.wireframe),this.wireframeLinewidth>1&&(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),e){const e=n(t.textures),r=n(t.images);e.length>0&&(i.textures=e),r.length>0&&(i.images=r)}return i},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.blending=t.blending,this.side=t.side,this.flatShading=t.flatShading,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let i=null;if(null!==e){const t=e.length;i=new Array(t);for(let n=0;n!==t;++n)i[n]=e[n].clone()}return this.clippingPlanes=i,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(Hn.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),jn.prototype=Object.create(Hn.prototype),jn.prototype.constructor=jn,jn.prototype.isMeshBasicMaterial=!0,jn.prototype.copy=function(t){return Hn.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this};const Wn=new yi,Vn=new si;function Xn(t,e,i){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===i,this.usage=ei,this.updateRange={offset:0,count:-1},this.version=0}function Yn(t,e,i){Xn.call(this,new Int8Array(t),e,i)}function qn(t,e,i){Xn.call(this,new Uint8Array(t),e,i)}function Zn(t,e,i){Xn.call(this,new Uint8ClampedArray(t),e,i)}function Jn(t,e,i){Xn.call(this,new Int16Array(t),e,i)}function Kn(t,e,i){Xn.call(this,new Uint16Array(t),e,i)}function $n(t,e,i){Xn.call(this,new Int32Array(t),e,i)}function Qn(t,e,i){Xn.call(this,new Uint32Array(t),e,i)}function tr(t,e,i){Xn.call(this,new Float32Array(t),e,i)}function er(t,e,i){Xn.call(this,new Float64Array(t),e,i)}function ir(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function nr(t){if(0===t.length)return-1/0;let e=t[0];for(let i=1,n=t.length;i<n;++i)t[i]>e&&(e=t[i]);return e}Object.defineProperty(Xn.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Xn.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this},copyAt:function(t,e,i){t*=this.itemSize,i*=e.itemSize;for(let n=0,r=this.itemSize;n<r;n++)this.array[t+n]=e.array[i+n];return this},copyArray:function(t){return this.array.set(t),this},copyColorsArray:function(t){const e=this.array;let i=0;for(let n=0,r=t.length;n<r;n++){let r=t[n];void 0===r&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",n),r=new Nn),e[i++]=r.r,e[i++]=r.g,e[i++]=r.b}return this},copyVector2sArray:function(t){const e=this.array;let i=0;for(let n=0,r=t.length;n<r;n++){let r=t[n];void 0===r&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",n),r=new si),e[i++]=r.x,e[i++]=r.y}return this},copyVector3sArray:function(t){const e=this.array;let i=0;for(let n=0,r=t.length;n<r;n++){let r=t[n];void 0===r&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",n),r=new yi),e[i++]=r.x,e[i++]=r.y,e[i++]=r.z}return this},copyVector4sArray:function(t){const e=this.array;let i=0;for(let n=0,r=t.length;n<r;n++){let r=t[n];void 0===r&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",n),r=new di),e[i++]=r.x,e[i++]=r.y,e[i++]=r.z,e[i++]=r.w}return this},applyMatrix3:function(t){if(2===this.itemSize)for(let e=0,i=this.count;e<i;e++)Vn.fromBufferAttribute(this,e),Vn.applyMatrix3(t),this.setXY(e,Vn.x,Vn.y);else if(3===this.itemSize)for(let e=0,i=this.count;e<i;e++)Wn.fromBufferAttribute(this,e),Wn.applyMatrix3(t),this.setXYZ(e,Wn.x,Wn.y,Wn.z);return this},applyMatrix4:function(t){for(let e=0,i=this.count;e<i;e++)Wn.x=this.getX(e),Wn.y=this.getY(e),Wn.z=this.getZ(e),Wn.applyMatrix4(t),this.setXYZ(e,Wn.x,Wn.y,Wn.z);return this},applyNormalMatrix:function(t){for(let e=0,i=this.count;e<i;e++)Wn.x=this.getX(e),Wn.y=this.getY(e),Wn.z=this.getZ(e),Wn.applyNormalMatrix(t),this.setXYZ(e,Wn.x,Wn.y,Wn.z);return this},transformDirection:function(t){for(let e=0,i=this.count;e<i;e++)Wn.x=this.getX(e),Wn.y=this.getY(e),Wn.z=this.getZ(e),Wn.transformDirection(t),this.setXYZ(e,Wn.x,Wn.y,Wn.z);return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},getX:function(t){return this.array[t*this.itemSize]},setX:function(t,e){return this.array[t*this.itemSize]=e,this},getY:function(t){return this.array[t*this.itemSize+1]},setY:function(t,e){return this.array[t*this.itemSize+1]=e,this},getZ:function(t){return this.array[t*this.itemSize+2]},setZ:function(t,e){return this.array[t*this.itemSize+2]=e,this},getW:function(t){return this.array[t*this.itemSize+3]},setW:function(t,e){return this.array[t*this.itemSize+3]=e,this},setXY:function(t,e,i){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=i,this},setXYZ:function(t,e,i,n){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=n,this},setXYZW:function(t,e,i,n,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=n,this.array[t+3]=r,this},onUpload:function(t){return this.onUploadCallback=t,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}}}),Yn.prototype=Object.create(Xn.prototype),Yn.prototype.constructor=Yn,qn.prototype=Object.create(Xn.prototype),qn.prototype.constructor=qn,Zn.prototype=Object.create(Xn.prototype),Zn.prototype.constructor=Zn,Jn.prototype=Object.create(Xn.prototype),Jn.prototype.constructor=Jn,Kn.prototype=Object.create(Xn.prototype),Kn.prototype.constructor=Kn,$n.prototype=Object.create(Xn.prototype),$n.prototype.constructor=$n,Qn.prototype=Object.create(Xn.prototype),Qn.prototype.constructor=Qn,tr.prototype=Object.create(Xn.prototype),tr.prototype.constructor=tr,er.prototype=Object.create(Xn.prototype),er.prototype.constructor=er,Object.assign(ir.prototype,{computeGroups:function(t){const e=[];let i,n,r=void 0;const o=t.faces;for(n=0;n<o.length;n++){const t=o[n];t.materialIndex!==r&&(r=t.materialIndex,void 0!==i&&(i.count=3*n-i.start,e.push(i)),i={start:3*n,materialIndex:r})}void 0!==i&&(i.count=3*n-i.start,e.push(i)),this.groups=e},fromGeometry:function(t){const e=t.faces,i=t.vertices,n=t.faceVertexUvs,r=n[0]&&n[0].length>0,o=n[1]&&n[1].length>0,s=t.morphTargets,a=s.length;let l;if(a>0){l=[];for(let t=0;t<a;t++)l[t]={name:s[t].name,data:[]};this.morphTargets.position=l}const c=t.morphNormals,h=c.length;let u;if(h>0){u=[];for(let t=0;t<h;t++)u[t]={name:c[t].name,data:[]};this.morphTargets.normal=u}const d=t.skinIndices,p=t.skinWeights,f=d.length===i.length,m=p.length===i.length;i.length>0&&0===e.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(let g=0;g<e.length;g++){const t=e[g];this.vertices.push(i[t.a],i[t.b],i[t.c]);const v=t.vertexNormals;if(3===v.length)this.normals.push(v[0],v[1],v[2]);else{const e=t.normal;this.normals.push(e,e,e)}const y=t.vertexColors;if(3===y.length)this.colors.push(y[0],y[1],y[2]);else{const e=t.color;this.colors.push(e,e,e)}if(!0===r){const t=n[0][g];void 0!==t?this.uvs.push(t[0],t[1],t[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",g),this.uvs.push(new si,new si,new si))}if(!0===o){const t=n[1][g];void 0!==t?this.uvs2.push(t[0],t[1],t[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",g),this.uvs2.push(new si,new si,new si))}for(let e=0;e<a;e++){const i=s[e].vertices;l[e].data.push(i[t.a],i[t.b],i[t.c])}for(let e=0;e<h;e++){const t=c[e].vertexNormals[g];u[e].data.push(t.a,t.b,t.c)}f&&this.skinIndices.push(d[t.a],d[t.b],d[t.c]),m&&this.skinWeights.push(p[t.a],p[t.b],p[t.c])}return this.computeGroups(t),this.verticesNeedUpdate=t.verticesNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this}});let rr=1;const or=new Ei,sr=new Wi,ar=new yi,lr=new sn,cr=new sn,hr=new yi;function ur(){Object.defineProperty(this,"id",{value:rr+=2}),this.uuid=oi.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}ur.prototype=Object.assign(Object.create(ni.prototype),{constructor:ur,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(t){Array.isArray(t)?this.index=new(nr(t)>65535?Qn:Kn)(t,1):this.index=t},getAttribute:function(t){return this.attributes[t]},setAttribute:function(t,e){return this.attributes[t]=e,this},deleteAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,e,i){this.groups.push({start:t,count:e,materialIndex:void 0!==i?i:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix4:function(t){const e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);const i=this.attributes.normal;if(void 0!==i){const e=(new ai).getNormalMatrix(t);i.applyNormalMatrix(e),i.needsUpdate=!0}const n=this.attributes.tangent;return void 0!==n&&(n.transformDirection(t),n.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(t){return or.makeRotationX(t),this.applyMatrix4(or),this},rotateY:function(t){return or.makeRotationY(t),this.applyMatrix4(or),this},rotateZ:function(t){return or.makeRotationZ(t),this.applyMatrix4(or),this},translate:function(t,e,i){return or.makeTranslation(t,e,i),this.applyMatrix4(or),this},scale:function(t,e,i){return or.makeScale(t,e,i),this.applyMatrix4(or),this},lookAt:function(t){return sr.lookAt(t),sr.updateMatrix(),this.applyMatrix4(sr.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(ar).negate(),this.translate(ar.x,ar.y,ar.z),this},setFromObject:function(t){const e=t.geometry;if(t.isPoints||t.isLine){const t=new tr(3*e.vertices.length,3),i=new tr(3*e.colors.length,3);if(this.setAttribute("position",t.copyVector3sArray(e.vertices)),this.setAttribute("color",i.copyColorsArray(e.colors)),e.lineDistances&&e.lineDistances.length===e.vertices.length){const t=new tr(e.lineDistances.length,1);this.setAttribute("lineDistance",t.copyArray(e.lineDistances))}null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone())}else t.isMesh&&e&&e.isGeometry&&this.fromGeometry(e);return this},setFromPoints:function(t){const e=[];for(let i=0,n=t.length;i<n;i++){const n=t[i];e.push(n.x,n.y,n.z||0)}return this.setAttribute("position",new tr(e,3)),this},updateFromObject:function(t){let e=t.geometry;if(t.isMesh){let t=e.__directGeometry;if(!0===e.elementsNeedUpdate&&(t=void 0,e.elementsNeedUpdate=!1),void 0===t)return this.fromGeometry(e);t.verticesNeedUpdate=e.verticesNeedUpdate,t.normalsNeedUpdate=e.normalsNeedUpdate,t.colorsNeedUpdate=e.colorsNeedUpdate,t.uvsNeedUpdate=e.uvsNeedUpdate,t.groupsNeedUpdate=e.groupsNeedUpdate,e.verticesNeedUpdate=!1,e.normalsNeedUpdate=!1,e.colorsNeedUpdate=!1,e.uvsNeedUpdate=!1,e.groupsNeedUpdate=!1,e=t}if(!0===e.verticesNeedUpdate){const t=this.attributes.position;void 0!==t&&(t.copyVector3sArray(e.vertices),t.needsUpdate=!0),e.verticesNeedUpdate=!1}if(!0===e.normalsNeedUpdate){const t=this.attributes.normal;void 0!==t&&(t.copyVector3sArray(e.normals),t.needsUpdate=!0),e.normalsNeedUpdate=!1}if(!0===e.colorsNeedUpdate){const t=this.attributes.color;void 0!==t&&(t.copyColorsArray(e.colors),t.needsUpdate=!0),e.colorsNeedUpdate=!1}if(e.uvsNeedUpdate){const t=this.attributes.uv;void 0!==t&&(t.copyVector2sArray(e.uvs),t.needsUpdate=!0),e.uvsNeedUpdate=!1}if(e.lineDistancesNeedUpdate){const t=this.attributes.lineDistance;void 0!==t&&(t.copyArray(e.lineDistances),t.needsUpdate=!0),e.lineDistancesNeedUpdate=!1}return e.groupsNeedUpdate&&(e.computeGroups(t.geometry),this.groups=e.groups,e.groupsNeedUpdate=!1),this},fromGeometry:function(t){return t.__directGeometry=(new ir).fromGeometry(t),this.fromDirectGeometry(t.__directGeometry)},fromDirectGeometry:function(t){const e=new Float32Array(3*t.vertices.length);if(this.setAttribute("position",new Xn(e,3).copyVector3sArray(t.vertices)),t.normals.length>0){const e=new Float32Array(3*t.normals.length);this.setAttribute("normal",new Xn(e,3).copyVector3sArray(t.normals))}if(t.colors.length>0){const e=new Float32Array(3*t.colors.length);this.setAttribute("color",new Xn(e,3).copyColorsArray(t.colors))}if(t.uvs.length>0){const e=new Float32Array(2*t.uvs.length);this.setAttribute("uv",new Xn(e,2).copyVector2sArray(t.uvs))}if(t.uvs2.length>0){const e=new Float32Array(2*t.uvs2.length);this.setAttribute("uv2",new Xn(e,2).copyVector2sArray(t.uvs2))}this.groups=t.groups;for(const i in t.morphTargets){const e=[],n=t.morphTargets[i];for(let t=0,i=n.length;t<i;t++){const i=n[t],r=new tr(3*i.data.length,3);r.name=i.name,e.push(r.copyVector3sArray(i.data))}this.morphAttributes[i]=e}if(t.skinIndices.length>0){const e=new tr(4*t.skinIndices.length,4);this.setAttribute("skinIndex",e.copyVector4sArray(t.skinIndices))}if(t.skinWeights.length>0){const e=new tr(4*t.skinWeights.length,4);this.setAttribute("skinWeight",e.copyVector4sArray(t.skinWeights))}return null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new sn);const t=this.attributes.position,e=this.morphAttributes.position;if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(let i=0,n=e.length;i<n;i++){const t=e[i];lr.setFromBufferAttribute(t),this.morphTargetsRelative?(hr.addVectors(this.boundingBox.min,lr.min),this.boundingBox.expandByPoint(hr),hr.addVectors(this.boundingBox.max,lr.max),this.boundingBox.expandByPoint(hr)):(this.boundingBox.expandByPoint(lr.min),this.boundingBox.expandByPoint(lr.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 cn);const t=this.attributes.position,e=this.morphAttributes.position;if(t){const i=this.boundingSphere.center;if(lr.setFromBufferAttribute(t),e)for(let t=0,r=e.length;t<r;t++){const i=e[t];cr.setFromBufferAttribute(i),this.morphTargetsRelative?(hr.addVectors(lr.min,cr.min),lr.expandByPoint(hr),hr.addVectors(lr.max,cr.max),lr.expandByPoint(hr)):(lr.expandByPoint(cr.min),lr.expandByPoint(cr.max))}lr.getCenter(i);let n=0;for(let e=0,r=t.count;e<r;e++)hr.fromBufferAttribute(t,e),n=Math.max(n,i.distanceToSquared(hr));if(e)for(let r=0,o=e.length;r<o;r++){const o=e[r],s=this.morphTargetsRelative;for(let e=0,r=o.count;e<r;e++)hr.fromBufferAttribute(o,e),s&&(ar.fromBufferAttribute(t,e),hr.add(ar)),n=Math.max(n,i.distanceToSquared(hr))}this.boundingSphere.radius=Math.sqrt(n),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(){const t=this.index,e=this.getAttribute("position");if(void 0!==e){let i=this.getAttribute("normal");if(void 0===i)i=new Xn(new Float32Array(3*e.count),3),this.setAttribute("normal",i);else for(let t=0,e=i.count;t<e;t++)i.setXYZ(t,0,0,0);const n=new yi,r=new yi,o=new yi,s=new yi,a=new yi,l=new yi,c=new yi,h=new yi;if(t)for(let u=0,d=t.count;u<d;u+=3){const d=t.getX(u+0),p=t.getX(u+1),f=t.getX(u+2);n.fromBufferAttribute(e,d),r.fromBufferAttribute(e,p),o.fromBufferAttribute(e,f),c.subVectors(o,r),h.subVectors(n,r),c.cross(h),s.fromBufferAttribute(i,d),a.fromBufferAttribute(i,p),l.fromBufferAttribute(i,f),s.add(c),a.add(c),l.add(c),i.setXYZ(d,s.x,s.y,s.z),i.setXYZ(p,a.x,a.y,a.z),i.setXYZ(f,l.x,l.y,l.z)}else for(let t=0,u=e.count;t<u;t+=3)n.fromBufferAttribute(e,t+0),r.fromBufferAttribute(e,t+1),o.fromBufferAttribute(e,t+2),c.subVectors(o,r),h.subVectors(n,r),c.cross(h),i.setXYZ(t+0,c.x,c.y,c.z),i.setXYZ(t+1,c.x,c.y,c.z),i.setXYZ(t+2,c.x,c.y,c.z);this.normalizeNormals(),i.needsUpdate=!0}},merge:function(t,e){if(!t||!t.isBufferGeometry)return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t);void 0===e&&(e=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));const i=this.attributes;for(const n in i){if(void 0===t.attributes[n])continue;const r=i[n],o=r.array,s=t.attributes[n],a=s.array,l=s.itemSize*e,c=Math.min(a.length,o.length-l);for(let t=0,e=l;t<c;t++,e++)o[e]=a[t]}return this},normalizeNormals:function(){const t=this.attributes.normal;for(let e=0,i=t.count;e<i;e++)hr.fromBufferAttribute(t,e),hr.normalize(),t.setXYZ(e,hr.x,hr.y,hr.z)},toNonIndexed:function(){function t(t,e){const i=t.array,n=t.itemSize,r=t.normalized,o=new i.constructor(e.length*n);let s=0,a=0;for(let l=0,c=e.length;l<c;l++){s=e[l]*n;for(let t=0;t<n;t++)o[a++]=i[s++]}return new Xn(o,n,r)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;const e=new ur,i=this.index.array,n=this.attributes;for(const s in n){const r=n[s],o=t(r,i);e.setAttribute(s,o)}const r=this.morphAttributes;for(const s in r){const n=[],o=r[s];for(let e=0,r=o.length;e<r;e++){const r=o[e],s=t(r,i);n.push(s)}e.morphAttributes[s]=n}e.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let s=0,a=o.length;s<a;s++){const t=o[s];e.addGroup(t.start,t.count,t.materialIndex)}return e},toJSON:function(){const t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){const e=this.parameters;for(const i in e)void 0!==e[i]&&(t[i]=e[i]);return t}t.data={attributes:{}};const e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const i=this.attributes;for(const a in i){const e=i[a],n=e.toJSON(t.data);""!==e.name&&(n.name=e.name),t.data.attributes[a]=n}const n={};let r=!1;for(const a in this.morphAttributes){const e=this.morphAttributes[a],i=[];for(let n=0,r=e.length;n<r;n++){const r=e[n],o=r.toJSON(t.data);""!==r.name&&(o.name=r.name),i.push(o)}i.length>0&&(n[a]=i,r=!0)}r&&(t.data.morphAttributes=n,t.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(t.data.groups=JSON.parse(JSON.stringify(o)));const s=this.boundingSphere;return null!==s&&(t.data.boundingSphere={center:s.center.toArray(),radius:s.radius}),t},clone:function(){return(new ur).copy(this)},copy:function(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const i=t.index;null!==i&&this.setIndex(i.clone(e));const n=t.attributes;for(const l in n){const t=n[l];this.setAttribute(l,t.clone(e))}const r=t.morphAttributes;for(const l in r){const t=[],i=r[l];for(let n=0,r=i.length;n<r;n++)t.push(i[n].clone(e));this.morphAttributes[l]=t}this.morphTargetsRelative=t.morphTargetsRelative;const o=t.groups;for(let l=0,c=o.length;l<c;l++){const t=o[l];this.addGroup(t.start,t.count,t.materialIndex)}const s=t.boundingBox;null!==s&&(this.boundingBox=s.clone());const a=t.boundingSphere;return null!==a&&(this.boundingSphere=a.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});const dr=new Ei,pr=new vn,fr=new cn,mr=new yi,gr=new yi,vr=new yi,yr=new yi,xr=new yi,br=new yi,wr=new yi,_r=new yi,Mr=new yi,Sr=new si,Tr=new si,Er=new si,Ar=new yi,Lr=new yi;function Cr(t,e){Wi.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new ur,this.material=void 0!==e?e:new jn,this.updateMorphTargets()}function Pr(t,e,i,n,r,o,s,a){let l;if(l=e.side===p?n.intersectTriangle(s,o,r,!0,a):n.intersectTriangle(r,o,s,e.side!==f,a),null===l)return null;Lr.copy(a),Lr.applyMatrix4(t.matrixWorld);const c=i.ray.origin.distanceTo(Lr);return c<i.near||c>i.far?null:{distance:c,point:Lr.clone(),object:t}}function Rr(t,e,i,n,r,o,s,a,l,c,h,u){mr.fromBufferAttribute(r,c),gr.fromBufferAttribute(r,h),vr.fromBufferAttribute(r,u);const d=t.morphTargetInfluences;if(e.morphTargets&&o&&d){wr.set(0,0,0),_r.set(0,0,0),Mr.set(0,0,0);for(let t=0,e=o.length;t<e;t++){const e=d[t],i=o[t];0!==e&&(yr.fromBufferAttribute(i,c),xr.fromBufferAttribute(i,h),br.fromBufferAttribute(i,u),s?(wr.addScaledVector(yr,e),_r.addScaledVector(xr,e),Mr.addScaledVector(br,e)):(wr.addScaledVector(yr.sub(mr),e),_r.addScaledVector(xr.sub(gr),e),Mr.addScaledVector(br.sub(vr),e)))}mr.add(wr),gr.add(_r),vr.add(Mr)}t.isSkinnedMesh&&(t.boneTransform(c,mr),t.boneTransform(h,gr),t.boneTransform(u,vr));const p=Pr(t,e,i,n,mr,gr,vr,Ar);if(p){a&&(Sr.fromBufferAttribute(a,c),Tr.fromBufferAttribute(a,h),Er.fromBufferAttribute(a,u),p.uv=On.getUV(Ar,mr,gr,vr,Sr,Tr,Er,new si)),l&&(Sr.fromBufferAttribute(l,c),Tr.fromBufferAttribute(l,h),Er.fromBufferAttribute(l,u),p.uv2=On.getUV(Ar,mr,gr,vr,Sr,Tr,Er,new si));const t=new Un(c,h,u);On.getNormal(mr,gr,vr,t.normal),p.face=t}return p}Cr.prototype=Object.assign(Object.create(Wi.prototype),{constructor:Cr,isMesh:!0,copy:function(t){return Wi.prototype.copy.call(this,t),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=t.material,this.geometry=t.geometry,this},updateMorphTargets:function(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,i=Object.keys(e);if(i.length>0){const t=e[i[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,i=t.length;e<i;e++){const i=t[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[i]=e}}}}else{const e=t.morphTargets;void 0!==e&&e.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(t,e){const i=this.geometry,n=this.material,r=this.matrixWorld;if(void 0===n)return;if(null===i.boundingSphere&&i.computeBoundingSphere(),fr.copy(i.boundingSphere),fr.applyMatrix4(r),!1===t.ray.intersectsSphere(fr))return;if(dr.getInverse(r),pr.copy(t.ray).applyMatrix4(dr),null!==i.boundingBox&&!1===pr.intersectsBox(i.boundingBox))return;let o;if(i.isBufferGeometry){const r=i.index,s=i.attributes.position,a=i.morphAttributes.position,l=i.morphTargetsRelative,c=i.attributes.uv,h=i.attributes.uv2,u=i.groups,d=i.drawRange;if(null!==r)if(Array.isArray(n))for(let i=0,p=u.length;i<p;i++){const p=u[i],f=n[p.materialIndex],m=Math.max(p.start,d.start),g=Math.min(p.start+p.count,d.start+d.count);for(let i=m,n=g;i<n;i+=3){const n=r.getX(i),u=r.getX(i+1),d=r.getX(i+2);o=Rr(this,f,t,pr,s,a,l,c,h,n,u,d),o&&(o.faceIndex=Math.floor(i/3),o.face.materialIndex=p.materialIndex,e.push(o))}}else{const i=Math.max(0,d.start),u=Math.min(r.count,d.start+d.count);for(let d=i,p=u;d<p;d+=3){const i=r.getX(d),u=r.getX(d+1),p=r.getX(d+2);o=Rr(this,n,t,pr,s,a,l,c,h,i,u,p),o&&(o.faceIndex=Math.floor(d/3),e.push(o))}}else if(void 0!==s)if(Array.isArray(n))for(let i=0,p=u.length;i<p;i++){const r=u[i],p=n[r.materialIndex],f=Math.max(r.start,d.start),m=Math.min(r.start+r.count,d.start+d.count);for(let i=f,n=m;i<n;i+=3){const n=i,u=i+1,d=i+2;o=Rr(this,p,t,pr,s,a,l,c,h,n,u,d),o&&(o.faceIndex=Math.floor(i/3),o.face.materialIndex=r.materialIndex,e.push(o))}}else{const i=Math.max(0,d.start),r=Math.min(s.count,d.start+d.count);for(let u=i,d=r;u<d;u+=3){const i=u,r=u+1,d=u+2;o=Rr(this,n,t,pr,s,a,l,c,h,i,r,d),o&&(o.faceIndex=Math.floor(u/3),e.push(o))}}}else if(i.isGeometry){const r=Array.isArray(n),s=i.vertices,a=i.faces;let l;const c=i.faceVertexUvs[0];c.length>0&&(l=c);for(let i=0,h=a.length;i<h;i++){const c=a[i],h=r?n[c.materialIndex]:n;if(void 0===h)continue;const u=s[c.a],d=s[c.b],p=s[c.c];if(o=Pr(this,h,t,pr,u,d,p,Ar),o){if(l&&l[i]){const t=l[i];Sr.copy(t[0]),Tr.copy(t[1]),Er.copy(t[2]),o.uv=On.getUV(Ar,u,d,p,Sr,Tr,Er,new si)}o.face=c,o.faceIndex=i,e.push(o)}}}}});let Or=0;const kr=new Ei,Dr=new Wi,Ir=new yi;function Nr(){Object.defineProperty(this,"id",{value:Or+=2}),this.uuid=oi.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.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}Nr.prototype=Object.assign(Object.create(ni.prototype),{constructor:Nr,isGeometry:!0,applyMatrix4:function(t){const e=(new ai).getNormalMatrix(t);for(let i=0,n=this.vertices.length;i<n;i++){const e=this.vertices[i];e.applyMatrix4(t)}for(let i=0,n=this.faces.length;i<n;i++){const t=this.faces[i];t.normal.applyMatrix3(e).normalize();for(let i=0,n=t.vertexNormals.length;i<n;i++)t.vertexNormals[i].applyMatrix3(e).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(t){return kr.makeRotationX(t),this.applyMatrix4(kr),this},rotateY:function(t){return kr.makeRotationY(t),this.applyMatrix4(kr),this},rotateZ:function(t){return kr.makeRotationZ(t),this.applyMatrix4(kr),this},translate:function(t,e,i){return kr.makeTranslation(t,e,i),this.applyMatrix4(kr),this},scale:function(t,e,i){return kr.makeScale(t,e,i),this.applyMatrix4(kr),this},lookAt:function(t){return Dr.lookAt(t),Dr.updateMatrix(),this.applyMatrix4(Dr.matrix),this},fromBufferGeometry:function(t){const e=this,i=null!==t.index?t.index:void 0,n=t.attributes;if(void 0===n.position)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;const r=n.position,o=n.normal,s=n.color,a=n.uv,l=n.uv2;void 0!==l&&(this.faceVertexUvs[1]=[]);for(let u=0;u<r.count;u++)e.vertices.push((new yi).fromBufferAttribute(r,u)),void 0!==s&&e.colors.push((new Nn).fromBufferAttribute(s,u));function c(t,i,n,r){const c=void 0===s?[]:[e.colors[t].clone(),e.colors[i].clone(),e.colors[n].clone()],h=void 0===o?[]:[(new yi).fromBufferAttribute(o,t),(new yi).fromBufferAttribute(o,i),(new yi).fromBufferAttribute(o,n)],u=new Un(t,i,n,h,c,r);e.faces.push(u),void 0!==a&&e.faceVertexUvs[0].push([(new si).fromBufferAttribute(a,t),(new si).fromBufferAttribute(a,i),(new si).fromBufferAttribute(a,n)]),void 0!==l&&e.faceVertexUvs[1].push([(new si).fromBufferAttribute(l,t),(new si).fromBufferAttribute(l,i),(new si).fromBufferAttribute(l,n)])}const h=t.groups;if(h.length>0)for(let u=0;u<h.length;u++){const t=h[u],e=t.start,n=t.count;for(let r=e,o=e+n;r<o;r+=3)void 0!==i?c(i.getX(r),i.getX(r+1),i.getX(r+2),t.materialIndex):c(r,r+1,r+2,t.materialIndex)}else if(void 0!==i)for(let u=0;u<i.count;u+=3)c(i.getX(u),i.getX(u+1),i.getX(u+2));else for(let u=0;u<r.count;u+=3)c(u,u+1,u+2);return this.computeFaceNormals(),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Ir).negate(),this.translate(Ir.x,Ir.y,Ir.z),this},normalize:function(){this.computeBoundingSphere();const t=this.boundingSphere.center,e=this.boundingSphere.radius,i=0===e?1:1/e,n=new Ei;return n.set(i,0,0,-i*t.x,0,i,0,-i*t.y,0,0,i,-i*t.z,0,0,0,1),this.applyMatrix4(n),this},computeFaceNormals:function(){const t=new yi,e=new yi;for(let i=0,n=this.faces.length;i<n;i++){const n=this.faces[i],r=this.vertices[n.a],o=this.vertices[n.b],s=this.vertices[n.c];t.subVectors(s,o),e.subVectors(r,o),t.cross(e),t.normalize(),n.normal.copy(t)}},computeVertexNormals:function(t){void 0===t&&(t=!0);const e=new Array(this.vertices.length);for(let i=0,n=this.vertices.length;i<n;i++)e[i]=new yi;if(t){const t=new yi,i=new yi;for(let n=0,r=this.faces.length;n<r;n++){const r=this.faces[n],o=this.vertices[r.a],s=this.vertices[r.b],a=this.vertices[r.c];t.subVectors(a,s),i.subVectors(o,s),t.cross(i),e[r.a].add(t),e[r.b].add(t),e[r.c].add(t)}}else{this.computeFaceNormals();for(let t=0,i=this.faces.length;t<i;t++){const i=this.faces[t];e[i.a].add(i.normal),e[i.b].add(i.normal),e[i.c].add(i.normal)}}for(let i=0,n=this.vertices.length;i<n;i++)e[i].normalize();for(let i=0,n=this.faces.length;i<n;i++){const t=this.faces[i],n=t.vertexNormals;3===n.length?(n[0].copy(e[t.a]),n[1].copy(e[t.b]),n[2].copy(e[t.c])):(n[0]=e[t.a].clone(),n[1]=e[t.b].clone(),n[2]=e[t.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){this.computeFaceNormals();for(let t=0,e=this.faces.length;t<e;t++){const e=this.faces[t],i=e.vertexNormals;3===i.length?(i[0].copy(e.normal),i[1].copy(e.normal),i[2].copy(e.normal)):(i[0]=e.normal.clone(),i[1]=e.normal.clone(),i[2]=e.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){for(let e=0,i=this.faces.length;e<i;e++){const t=this.faces[e];t.__originalFaceNormal?t.__originalFaceNormal.copy(t.normal):t.__originalFaceNormal=t.normal.clone(),t.__originalVertexNormals||(t.__originalVertexNormals=[]);for(let e=0,i=t.vertexNormals.length;e<i;e++)t.__originalVertexNormals[e]?t.__originalVertexNormals[e].copy(t.vertexNormals[e]):t.__originalVertexNormals[e]=t.vertexNormals[e].clone()}const t=new Nr;t.faces=this.faces;for(let e=0,i=this.morphTargets.length;e<i;e++){if(!this.morphNormals[e]){this.morphNormals[e]={},this.morphNormals[e].faceNormals=[],this.morphNormals[e].vertexNormals=[];const t=this.morphNormals[e].faceNormals,i=this.morphNormals[e].vertexNormals;for(let e=0,n=this.faces.length;e<n;e++){const e=new yi,n={a:new yi,b:new yi,c:new yi};t.push(e),i.push(n)}}const i=this.morphNormals[e];t.vertices=this.morphTargets[e].vertices,t.computeFaceNormals(),t.computeVertexNormals();for(let t=0,e=this.faces.length;t<e;t++){const e=this.faces[t],n=i.faceNormals[t],r=i.vertexNormals[t];n.copy(e.normal),r.a.copy(e.vertexNormals[0]),r.b.copy(e.vertexNormals[1]),r.c.copy(e.vertexNormals[2])}}for(let e=0,i=this.faces.length;e<i;e++){const t=this.faces[e];t.normal=t.__originalFaceNormal,t.vertexNormals=t.__originalVertexNormals}},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new sn),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new cn),this.boundingSphere.setFromPoints(this.vertices)},merge:function(t,e,i){if(!t||!t.isGeometry)return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",t);let n,r=this.vertices.length,o=this.vertices,s=t.vertices,a=this.faces,l=t.faces,c=this.colors,h=t.colors;void 0===i&&(i=0),void 0!==e&&(n=(new ai).getNormalMatrix(e));for(let u=0,d=s.length;u<d;u++){const t=s[u],i=t.clone();void 0!==e&&i.applyMatrix4(e),o.push(i)}for(let u=0,d=h.length;u<d;u++)c.push(h[u].clone());for(let u=0,d=l.length;u<d;u++){let t,e,o,s=l[u],c=s.vertexNormals,h=s.vertexColors;t=new Un(s.a+r,s.b+r,s.c+r),t.normal.copy(s.normal),void 0!==n&&t.normal.applyMatrix3(n).normalize();for(let i=0,r=c.length;i<r;i++)e=c[i].clone(),void 0!==n&&e.applyMatrix3(n).normalize(),t.vertexNormals.push(e);t.color.copy(s.color);for(let i=0,n=h.length;i<n;i++)o=h[i],t.vertexColors.push(o.clone());t.materialIndex=s.materialIndex+i,a.push(t)}for(let u=0,d=t.faceVertexUvs.length;u<d;u++){const e=t.faceVertexUvs[u];void 0===this.faceVertexUvs[u]&&(this.faceVertexUvs[u]=[]);for(let t=0,i=e.length;t<i;t++){const i=e[t],n=[];for(let t=0,e=i.length;t<e;t++)n.push(i[t].clone());this.faceVertexUvs[u].push(n)}}},mergeMesh:function(t){t&&t.isMesh?(t.matrixAutoUpdate&&t.updateMatrix(),this.merge(t.geometry,t.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",t)},mergeVertices:function(){const t={},e=[],i=[],n=4,r=Math.pow(10,n);for(let a=0,l=this.vertices.length;a<l;a++){const n=this.vertices[a],o=Math.round(n.x*r)+"_"+Math.round(n.y*r)+"_"+Math.round(n.z*r);void 0===t[o]?(t[o]=a,e.push(this.vertices[a]),i[a]=e.length-1):i[a]=i[t[o]]}const o=[];for(let a=0,l=this.faces.length;a<l;a++){const t=this.faces[a];t.a=i[t.a],t.b=i[t.b],t.c=i[t.c];const e=[t.a,t.b,t.c];for(let i=0;i<3;i++)if(e[i]===e[(i+1)%3]){o.push(a);break}}for(let a=o.length-1;a>=0;a--){const t=o[a];this.faces.splice(t,1);for(let e=0,i=this.faceVertexUvs.length;e<i;e++)this.faceVertexUvs[e].splice(t,1)}const s=this.vertices.length-e.length;return this.vertices=e,s},setFromPoints:function(t){this.vertices=[];for(let e=0,i=t.length;e<i;e++){const i=t[e];this.vertices.push(new yi(i.x,i.y,i.z||0))}return this},sortFacesByMaterialIndex:function(){const t=this.faces,e=t.length;for(let a=0;a<e;a++)t[a]._id=a;function i(t,e){return t.materialIndex-e.materialIndex}t.sort(i);const n=this.faceVertexUvs[0],r=this.faceVertexUvs[1];let o,s;n&&n.length===e&&(o=[]),r&&r.length===e&&(s=[]);for(let a=0;a<e;a++){const e=t[a]._id;o&&o.push(n[e]),s&&s.push(r[e])}o&&(this.faceVertexUvs[0]=o),s&&(this.faceVertexUvs[1]=s)},toJSON:function(){const t={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),void 0!==this.parameters){const e=this.parameters;for(const i in e)void 0!==e[i]&&(t[i]=e[i]);return t}const e=[];for(let p=0;p<this.vertices.length;p++){const t=this.vertices[p];e.push(t.x,t.y,t.z)}const i=[],n=[],r={},o=[],s={},a=[],l={};for(let p=0;p<this.faces.length;p++){const t=this.faces[p],e=!0,n=!1,r=void 0!==this.faceVertexUvs[0][p],o=t.normal.length()>0,s=t.vertexNormals.length>0,a=1!==t.color.r||1!==t.color.g||1!==t.color.b,l=t.vertexColors.length>0;let f=0;if(f=c(f,0,0),f=c(f,1,e),f=c(f,2,n),f=c(f,3,r),f=c(f,4,o),f=c(f,5,s),f=c(f,6,a),f=c(f,7,l),i.push(f),i.push(t.a,t.b,t.c),i.push(t.materialIndex),r){const t=this.faceVertexUvs[0][p];i.push(d(t[0]),d(t[1]),d(t[2]))}if(o&&i.push(h(t.normal)),s){const e=t.vertexNormals;i.push(h(e[0]),h(e[1]),h(e[2]))}if(a&&i.push(u(t.color)),l){const e=t.vertexColors;i.push(u(e[0]),u(e[1]),u(e[2]))}}function c(t,e,i){return i?t|1<<e:t&~(1<<e)}function h(t){const e=t.x.toString()+t.y.toString()+t.z.toString();return void 0!==r[e]||(r[e]=n.length/3,n.push(t.x,t.y,t.z)),r[e]}function u(t){const e=t.r.toString()+t.g.toString()+t.b.toString();return void 0!==s[e]||(s[e]=o.length,o.push(t.getHex())),s[e]}function d(t){const e=t.x.toString()+t.y.toString();return void 0!==l[e]||(l[e]=a.length/2,a.push(t.x,t.y)),l[e]}return t.data={},t.data.vertices=e,t.data.normals=n,o.length>0&&(t.data.colors=o),a.length>0&&(t.data.uvs=[a]),t.data.faces=i,t},clone:function(){return(new Nr).copy(this)},copy:function(t){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;const e=t.vertices;for(let u=0,d=e.length;u<d;u++)this.vertices.push(e[u].clone());const i=t.colors;for(let u=0,d=i.length;u<d;u++)this.colors.push(i[u].clone());const n=t.faces;for(let u=0,d=n.length;u<d;u++)this.faces.push(n[u].clone());for(let u=0,d=t.faceVertexUvs.length;u<d;u++){const e=t.faceVertexUvs[u];void 0===this.faceVertexUvs[u]&&(this.faceVertexUvs[u]=[]);for(let t=0,i=e.length;t<i;t++){const i=e[t],n=[];for(let t=0,e=i.length;t<e;t++){const e=i[t];n.push(e.clone())}this.faceVertexUvs[u].push(n)}}const r=t.morphTargets;for(let u=0,d=r.length;u<d;u++){const t={};if(t.name=r[u].name,void 0!==r[u].vertices){t.vertices=[];for(let e=0,i=r[u].vertices.length;e<i;e++)t.vertices.push(r[u].vertices[e].clone())}if(void 0!==r[u].normals){t.normals=[];for(let e=0,i=r[u].normals.length;e<i;e++)t.normals.push(r[u].normals[e].clone())}this.morphTargets.push(t)}const o=t.morphNormals;for(let u=0,d=o.length;u<d;u++){const t={};if(void 0!==o[u].vertexNormals){t.vertexNormals=[];for(let e=0,i=o[u].vertexNormals.length;e<i;e++){const i=o[u].vertexNormals[e],n={};n.a=i.a.clone(),n.b=i.b.clone(),n.c=i.c.clone(),t.vertexNormals.push(n)}}if(void 0!==o[u].faceNormals){t.faceNormals=[];for(let e=0,i=o[u].faceNormals.length;e<i;e++)t.faceNormals.push(o[u].faceNormals[e].clone())}this.morphNormals.push(t)}const s=t.skinWeights;for(let u=0,d=s.length;u<d;u++)this.skinWeights.push(s[u].clone());const a=t.skinIndices;for(let u=0,d=a.length;u<d;u++)this.skinIndices.push(a[u].clone());const l=t.lineDistances;for(let u=0,d=l.length;u<d;u++)this.lineDistances.push(l[u]);const c=t.boundingBox;null!==c&&(this.boundingBox=c.clone());const h=t.boundingSphere;return null!==h&&(this.boundingSphere=h.clone()),this.elementsNeedUpdate=t.elementsNeedUpdate,this.verticesNeedUpdate=t.verticesNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.lineDistancesNeedUpdate=t.lineDistancesNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});class Br extends Nr{constructor(t,e,i,n,r,o){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:n,heightSegments:r,depthSegments:o},this.fromBufferGeometry(new zr(t,e,i,n,r,o)),this.mergeVertices()}}class zr extends ur{constructor(t,e,i,n,r,o){super(),this.type="BoxBufferGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:n,heightSegments:r,depthSegments:o};const s=this;t=t||1,e=e||1,i=i||1,n=Math.floor(n)||1,r=Math.floor(r)||1,o=Math.floor(o)||1;const a=[],l=[],c=[],h=[];let u=0,d=0;function p(t,e,i,n,r,o,p,f,m,g,v){const y=o/m,x=p/g,b=o/2,w=p/2,_=f/2,M=m+1,S=g+1;let T=0,E=0;const A=new yi;for(let s=0;s<S;s++){const o=s*x-w;for(let a=0;a<M;a++){const u=a*y-b;A[t]=u*n,A[e]=o*r,A[i]=_,l.push(A.x,A.y,A.z),A[t]=0,A[e]=0,A[i]=f>0?1:-1,c.push(A.x,A.y,A.z),h.push(a/m),h.push(1-s/g),T+=1}}for(let s=0;s<g;s++)for(let t=0;t<m;t++){const e=u+t+M*s,i=u+t+M*(s+1),n=u+(t+1)+M*(s+1),r=u+(t+1)+M*s;a.push(e,i,r),a.push(i,n,r),E+=6}s.addGroup(d,E,v),d+=E,u+=T}p("z","y","x",-1,-1,i,e,t,o,r,0),p("z","y","x",1,-1,i,e,-t,o,r,1),p("x","z","y",1,1,t,i,e,n,o,2),p("x","z","y",1,-1,t,i,-e,n,o,3),p("x","y","z",1,-1,t,e,i,n,r,4),p("x","y","z",-1,-1,t,e,-i,n,r,5),this.setIndex(a),this.setAttribute("position",new tr(l,3)),this.setAttribute("normal",new tr(c,3)),this.setAttribute("uv",new tr(h,2))}}function Fr(t){const e={};for(const i in t){e[i]={};for(const n in t[i]){const r=t[i][n];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture)?e[i][n]=r.clone():Array.isArray(r)?e[i][n]=r.slice():e[i][n]=r}}return e}function Ur(t){const e={};for(let i=0;i<t.length;i++){const n=Fr(t[i]);for(const t in n)e[t]=n[t]}return e}const Gr={clone:Fr,merge:Ur};var Hr="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",jr="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}";function Wr(t){Hn.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=Hr,this.fragmentShader=jr,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!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!==t&&(void 0!==t.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(t))}function Vr(){Wi.call(this),this.type="Camera",this.matrixWorldInverse=new Ei,this.projectionMatrix=new Ei,this.projectionMatrixInverse=new Ei}function Xr(t,e,i,n){Vr.call(this),this.type="PerspectiveCamera",this.fov=void 0!==t?t:50,this.zoom=1,this.near=void 0!==i?i:.1,this.far=void 0!==n?n:2e3,this.focus=10,this.aspect=void 0!==e?e:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}Wr.prototype=Object.create(Hn.prototype),Wr.prototype.constructor=Wr,Wr.prototype.isShaderMaterial=!0,Wr.prototype.copy=function(t){return Hn.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Fr(t.uniforms),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.lights=t.lights,this.clipping=t.clipping,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.extensions=Object.assign({},t.extensions),this},Wr.prototype.toJSON=function(t){const e=Hn.prototype.toJSON.call(this,t);e.uniforms={};for(const n in this.uniforms){const i=this.uniforms[n],r=i.value;r&&r.isTexture?e.uniforms[n]={type:"t",value:r.toJSON(t).uuid}:r&&r.isColor?e.uniforms[n]={type:"c",value:r.getHex()}:r&&r.isVector2?e.uniforms[n]={type:"v2",value:r.toArray()}:r&&r.isVector3?e.uniforms[n]={type:"v3",value:r.toArray()}:r&&r.isVector4?e.uniforms[n]={type:"v4",value:r.toArray()}:r&&r.isMatrix3?e.uniforms[n]={type:"m3",value:r.toArray()}:r&&r.isMatrix4?e.uniforms[n]={type:"m4",value:r.toArray()}:e.uniforms[n]={value:r}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;const i={};for(const n in this.extensions)!0===this.extensions[n]&&(i[n]=!0);return Object.keys(i).length>0&&(e.extensions=i),e},Vr.prototype=Object.assign(Object.create(Wi.prototype),{constructor:Vr,isCamera:!0,copy:function(t,e){return Wi.prototype.copy.call(this,t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),t=new yi),this.updateMatrixWorld(!0);const e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()},updateMatrixWorld:function(t){Wi.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},updateWorldMatrix:function(t,e){Wi.prototype.updateWorldMatrix.call(this,t,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),Xr.prototype=Object.assign(Object.create(Vr.prototype),{constructor:Xr,isPerspectiveCamera:!0,copy:function(t,e){return Vr.prototype.copy.call(this,t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},setFocalLength:function(t){const e=.5*this.getFilmHeight()/t;this.fov=2*oi.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){const t=Math.tan(.5*oi.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*oi.RAD2DEG*Math.atan(Math.tan(.5*oi.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(t,e,i,n,r,o){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){let t=this.near,e=t*Math.tan(.5*oi.DEG2RAD*this.fov)/this.zoom,i=2*e,n=this.aspect*i,r=-.5*n,o=this.view;if(null!==this.view&&this.view.enabled){const t=o.fullWidth,s=o.fullHeight;r+=o.offsetX*n/t,e-=o.offsetY*i/s,n*=o.width/t,i*=o.height/s}const s=this.filmOffset;0!==s&&(r+=t*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+n,e,e-i,t,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){const e=Wi.prototype.toJSON.call(this,t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}});const Yr=90,qr=1;function Zr(t,e,i){if(Wi.call(this),this.type="CubeCamera",!0!==i.isWebGLCubeRenderTarget)return void console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");this.renderTarget=i;const n=new Xr(Yr,qr,t,e);n.layers=this.layers,n.up.set(0,-1,0),n.lookAt(new yi(1,0,0)),this.add(n);const r=new Xr(Yr,qr,t,e);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new yi(-1,0,0)),this.add(r);const o=new Xr(Yr,qr,t,e);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new yi(0,1,0)),this.add(o);const s=new Xr(Yr,qr,t,e);s.layers=this.layers,s.up.set(0,0,-1),s.lookAt(new yi(0,-1,0)),this.add(s);const a=new Xr(Yr,qr,t,e);a.layers=this.layers,a.up.set(0,-1,0),a.lookAt(new yi(0,0,1)),this.add(a);const l=new Xr(Yr,qr,t,e);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new yi(0,0,-1)),this.add(l),this.update=function(t,e){null===this.parent&&this.updateMatrixWorld();const c=t.xr.enabled,h=t.getRenderTarget();t.xr.enabled=!1;const u=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,t.setRenderTarget(i,0),t.render(e,n),t.setRenderTarget(i,1),t.render(e,r),t.setRenderTarget(i,2),t.render(e,o),t.setRenderTarget(i,3),t.render(e,s),t.setRenderTarget(i,4),t.render(e,a),i.texture.generateMipmaps=u,t.setRenderTarget(i,5),t.render(e,l),t.setRenderTarget(h),t.xr.enabled=c},this.clear=function(t,e,n,r){const o=t.getRenderTarget();for(let s=0;s<6;s++)t.setRenderTarget(i,s),t.clear(e,n,r);t.setRenderTarget(o)}}function Jr(t,e,i){Number.isInteger(e)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),e=i),pi.call(this,t,t,e)}function Kr(t,e,i,n,r,o,s,a,l,c,h,u){ui.call(this,null,o,s,a,l,c,n,r,h,u),this.image={data:t||null,width:e||1,height:i||1},this.magFilter=void 0!==l?l:ut,this.minFilter=void 0!==c?c:ut,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}Zr.prototype=Object.create(Wi.prototype),Zr.prototype.constructor=Zr,Jr.prototype=Object.create(pi.prototype),Jr.prototype.constructor=Jr,Jr.prototype.isWebGLCubeRenderTarget=!0,Jr.prototype.fromEquirectangularTexture=function(t,e){this.texture.type=e.type,this.texture.format=e.format,this.texture.encoding=e.encoding;const i=new Vi,n={uniforms:{tEquirect:{value:null}},vertexShader:["varying vec3 vWorldDirection;","vec3 transformDirection( in vec3 dir, in mat4 matrix ) {","\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );","}","void main() {","\tvWorldDirection = transformDirection( position, modelMatrix );","\t#include <begin_vertex>","\t#include <project_vertex>","}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;","varying vec3 vWorldDirection;","#include <common>","void main() {","\tvec3 direction = normalize( vWorldDirection );","\tvec2 sampleUV = equirectUv( direction );","\tgl_FragColor = texture2D( tEquirect, sampleUV );","}"].join("\n")},r=new Wr({name:"CubemapFromEquirect",uniforms:Fr(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:p,blending:g});r.uniforms.tEquirect.value=e;const o=new Cr(new zr(5,5,5),r);i.add(o);const s=new Zr(1,10,this);return s.update(t,i),o.geometry.dispose(),o.material.dispose(),this},Kr.prototype=Object.create(ui.prototype),Kr.prototype.constructor=Kr,Kr.prototype.isDataTexture=!0;const $r=new cn,Qr=new yi;function to(t,e,i,n,r,o){this.planes=[void 0!==t?t:new wn,void 0!==e?e:new wn,void 0!==i?i:new wn,void 0!==n?n:new wn,void 0!==r?r:new wn,void 0!==o?o:new wn]}Object.assign(to.prototype,{set:function(t,e,i,n,r,o){const s=this.planes;return s[0].copy(t),s[1].copy(e),s[2].copy(i),s[3].copy(n),s[4].copy(r),s[5].copy(o),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){const e=this.planes;for(let i=0;i<6;i++)e[i].copy(t.planes[i]);return this},setFromProjectionMatrix:function(t){const e=this.planes,i=t.elements,n=i[0],r=i[1],o=i[2],s=i[3],a=i[4],l=i[5],c=i[6],h=i[7],u=i[8],d=i[9],p=i[10],f=i[11],m=i[12],g=i[13],v=i[14],y=i[15];return e[0].setComponents(s-n,h-a,f-u,y-m).normalize(),e[1].setComponents(s+n,h+a,f+u,y+m).normalize(),e[2].setComponents(s+r,h+l,f+d,y+g).normalize(),e[3].setComponents(s-r,h-l,f-d,y-g).normalize(),e[4].setComponents(s-o,h-c,f-p,y-v).normalize(),e[5].setComponents(s+o,h+c,f+p,y+v).normalize(),this},intersectsObject:function(t){const e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),$r.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere($r)},intersectsSprite:function(t){return $r.center.set(0,0,0),$r.radius=.7071067811865476,$r.applyMatrix4(t.matrixWorld),this.intersectsSphere($r)},intersectsSphere:function(t){const e=this.planes,i=t.center,n=-t.radius;for(let r=0;r<6;r++){const t=e[r].distanceToPoint(i);if(t<n)return!1}return!0},intersectsBox:function(t){const e=this.planes;for(let i=0;i<6;i++){const n=e[i];if(Qr.x=n.normal.x>0?t.max.x:t.min.x,Qr.y=n.normal.y>0?t.max.y:t.min.y,Qr.z=n.normal.z>0?t.max.z:t.min.z,n.distanceToPoint(Qr)<0)return!1}return!0},containsPoint:function(t){const e=this.planes;for(let i=0;i<6;i++)if(e[i].distanceToPoint(t)<0)return!1;return!0}});const eo={common:{diffuse:{value:new Nn(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new ai},uv2Transform:{value:new ai},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 si(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 Nn(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 Nn(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new ai}},sprite:{diffuse:{value:new Nn(15658734)},opacity:{value:1},center:{value:new si(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new ai}}};function io(){let t=null,e=!1,i=null,n=null;function r(e,o){i(e,o),n=t.requestAnimationFrame(r)}return{start:function(){!0!==e&&null!==i&&(n=t.requestAnimationFrame(r),e=!0)},stop:function(){t.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(t){i=t},setContext:function(e){t=e}}}function no(t,e){const i=e.isWebGL2,n=new WeakMap;function r(e,i){const n=e.array,r=e.usage,o=t.createBuffer();t.bindBuffer(i,o),t.bufferData(i,n,r),e.onUploadCallback();let s=5126;return n instanceof Float32Array?s=5126:n instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):n instanceof Uint16Array?s=5123:n instanceof Int16Array?s=5122:n instanceof Uint32Array?s=5125:n instanceof Int32Array?s=5124:n instanceof Int8Array?s=5120:n instanceof Uint8Array&&(s=5121),{buffer:o,type:s,bytesPerElement:n.BYTES_PER_ELEMENT,version:e.version}}function o(e,n,r){const o=n.array,s=n.updateRange;t.bindBuffer(r,e),-1===s.count?t.bufferSubData(r,0,o):(i?t.bufferSubData(r,s.offset*o.BYTES_PER_ELEMENT,o,s.offset,s.count):t.bufferSubData(r,s.offset*o.BYTES_PER_ELEMENT,o.subarray(s.offset,s.offset+s.count)),s.count=-1)}function s(t){return t.isInterleavedBufferAttribute&&(t=t.data),n.get(t)}function a(e){e.isInterleavedBufferAttribute&&(e=e.data);const i=n.get(e);i&&(t.deleteBuffer(i.buffer),n.delete(e))}function l(t,e){t.isInterleavedBufferAttribute&&(t=t.data);const i=n.get(t);void 0===i?n.set(t,r(t,e)):i.version<t.version&&(o(i.buffer,t,e),i.version=t.version)}return{get:s,remove:a,update:l}}function ro(t,e,i,n){Nr.call(this),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:i,heightSegments:n},this.fromBufferGeometry(new oo(t,e,i,n)),this.mergeVertices()}function oo(t,e,i,n){ur.call(this),this.type="PlaneBufferGeometry",this.parameters={width:t,height:e,widthSegments:i,heightSegments:n},t=t||1,e=e||1;const r=t/2,o=e/2,s=Math.floor(i)||1,a=Math.floor(n)||1,l=s+1,c=a+1,h=t/s,u=e/a,d=[],p=[],f=[],m=[];for(let g=0;g<c;g++){const t=g*u-o;for(let e=0;e<l;e++){const i=e*h-r;p.push(i,-t,0),f.push(0,0,1),m.push(e/s),m.push(1-g/a)}}for(let g=0;g<a;g++)for(let t=0;t<s;t++){const e=t+l*g,i=t+l*(g+1),n=t+1+l*(g+1),r=t+1+l*g;d.push(e,i,r),d.push(i,n,r)}this.setIndex(d),this.setAttribute("position",new tr(p,3)),this.setAttribute("normal",new tr(f,3)),this.setAttribute("uv",new tr(m,2))}ro.prototype=Object.create(Nr.prototype),ro.prototype.constructor=ro,oo.prototype=Object.create(ur.prototype),oo.prototype.constructor=oo;var so="#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",ao="#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",lo="#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif",co="#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",ho="#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",uo="vec3 transformed = vec3( position );",po="vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",fo="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",mo="#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",go="#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",vo="#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",yo="#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",xo="#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",bo="#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",wo="#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",_o="#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",Mo="#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",So="#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}",To="#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",Eo="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",Ao="#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",Lo="#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",Co="#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",Po="#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",Ro="gl_FragColor = linearToOutputTexel( gl_FragColor );",Oo="\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}",ko="#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",Do="#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",Io="#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",No="#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",Bo="#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",zo="#ifdef USE_FOG\n\tfogDepth = -mvPosition.z;\n#endif",Fo="#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",Uo="#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",Go="#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",Ho="#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}",jo="#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif",Wo="#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",Vo="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",Xo="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",Yo="#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",qo="ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",Zo="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)",Jo="BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",Ko="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)",$o="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",Qo="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}",ts="\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",es="#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",is="#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",ns="#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",rs="#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",os="#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",ss="#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",as="#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",ls="#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",cs="#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",hs="#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",us="float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",ds="#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",ps="#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",fs="#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",ms="#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",gs="#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;",vs="#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",ys="#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",xs="#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",bs="#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",ws="#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",_s="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}",Ms="#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",Ss="vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",Ts="#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",Es="#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",As="float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",Ls="#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",Cs="#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",Ps="#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",Rs="#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",Os="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}",ks="#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",Ds="#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",Is="#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",Ns="#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",Bs="float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",zs="#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",Fs="#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",Us="#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; }",Gs="#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",Hs="#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",js="#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",Ws="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",Vs="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",Xs="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",Ys="#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",qs="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}",Zs="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}",Js="#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}",Ks="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}",$s="#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}",Qs="#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}",ta="#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}",ea="#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}",ia="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}",na="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",ra="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}",oa="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}",sa="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}",aa="#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}",la="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}",ca="#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}",ha="#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}",ua="#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}",da="#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}",pa="#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}",fa="#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}",ma="#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}",ga="#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}",va="#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}",ya="#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}",xa="#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}",ba="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}",wa="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}",_a="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}",Ma="#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}",Sa="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}",Ta="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}";const Ea={alphamap_fragment:so,alphamap_pars_fragment:ao,alphatest_fragment:lo,aomap_fragment:co,aomap_pars_fragment:ho,begin_vertex:uo,beginnormal_vertex:po,bsdfs:fo,bumpmap_pars_fragment:mo,clipping_planes_fragment:go,clipping_planes_pars_fragment:vo,clipping_planes_pars_vertex:yo,clipping_planes_vertex:xo,color_fragment:bo,color_pars_fragment:wo,color_pars_vertex:_o,color_vertex:Mo,common:So,cube_uv_reflection_fragment:To,defaultnormal_vertex:Eo,displacementmap_pars_vertex:Ao,displacementmap_vertex:Lo,emissivemap_fragment:Co,emissivemap_pars_fragment:Po,encodings_fragment:Ro,encodings_pars_fragment:Oo,envmap_fragment:ko,envmap_common_pars_fragment:Do,envmap_pars_fragment:Io,envmap_pars_vertex:No,envmap_physical_pars_fragment:Yo,envmap_vertex:Bo,fog_vertex:zo,fog_pars_vertex:Fo,fog_fragment:Uo,fog_pars_fragment:Go,gradientmap_pars_fragment:Ho,lightmap_fragment:jo,lightmap_pars_fragment:Wo,lights_lambert_vertex:Vo,lights_pars_begin:Xo,lights_toon_fragment:qo,lights_toon_pars_fragment:Zo,lights_phong_fragment:Jo,lights_phong_pars_fragment:Ko,lights_physical_fragment:$o,lights_physical_pars_fragment:Qo,lights_fragment_begin:ts,lights_fragment_maps:es,lights_fragment_end:is,logdepthbuf_fragment:ns,logdepthbuf_pars_fragment:rs,logdepthbuf_pars_vertex:os,logdepthbuf_vertex:ss,map_fragment:as,map_pars_fragment:ls,map_particle_fragment:cs,map_particle_pars_fragment:hs,metalnessmap_fragment:us,metalnessmap_pars_fragment:ds,morphnormal_vertex:ps,morphtarget_pars_vertex:fs,morphtarget_vertex:ms,normal_fragment_begin:gs,normal_fragment_maps:vs,normalmap_pars_fragment:ys,clearcoat_normal_fragment_begin:xs,clearcoat_normal_fragment_maps:bs,clearcoat_pars_fragment:ws,packing:_s,premultiplied_alpha_fragment:Ms,project_vertex:Ss,dithering_fragment:Ts,dithering_pars_fragment:Es,roughnessmap_fragment:As,roughnessmap_pars_fragment:Ls,shadowmap_pars_fragment:Cs,shadowmap_pars_vertex:Ps,shadowmap_vertex:Rs,shadowmask_pars_fragment:Os,skinbase_vertex:ks,skinning_pars_vertex:Ds,skinning_vertex:Is,skinnormal_vertex:Ns,specularmap_fragment:Bs,specularmap_pars_fragment:zs,tonemapping_fragment:Fs,tonemapping_pars_fragment:Us,uv_pars_fragment:Gs,uv_pars_vertex:Hs,uv_vertex:js,uv2_pars_fragment:Ws,uv2_pars_vertex:Vs,uv2_vertex:Xs,worldpos_vertex:Ys,background_frag:qs,background_vert:Zs,cube_frag:Js,cube_vert:Ks,depth_frag:$s,depth_vert:Qs,distanceRGBA_frag:ta,distanceRGBA_vert:ea,equirect_frag:ia,equirect_vert:na,linedashed_frag:ra,linedashed_vert:oa,meshbasic_frag:sa,meshbasic_vert:aa,meshlambert_frag:la,meshlambert_vert:ca,meshmatcap_frag:ha,meshmatcap_vert:ua,meshtoon_frag:da,meshtoon_vert:pa,meshphong_frag:fa,meshphong_vert:ma,meshphysical_frag:ga,meshphysical_vert:va,normal_frag:ya,normal_vert:xa,points_frag:ba,points_vert:wa,shadow_frag:_a,shadow_vert:Ma,sprite_frag:Sa,sprite_vert:Ta},Aa={basic:{uniforms:Ur([eo.common,eo.specularmap,eo.envmap,eo.aomap,eo.lightmap,eo.fog]),vertexShader:Ea.meshbasic_vert,fragmentShader:Ea.meshbasic_frag},lambert:{uniforms:Ur([eo.common,eo.specularmap,eo.envmap,eo.aomap,eo.lightmap,eo.emissivemap,eo.fog,eo.lights,{emissive:{value:new Nn(0)}}]),vertexShader:Ea.meshlambert_vert,fragmentShader:Ea.meshlambert_frag},phong:{uniforms:Ur([eo.common,eo.specularmap,eo.envmap,eo.aomap,eo.lightmap,eo.emissivemap,eo.bumpmap,eo.normalmap,eo.displacementmap,eo.fog,eo.lights,{emissive:{value:new Nn(0)},specular:{value:new Nn(1118481)},shininess:{value:30}}]),vertexShader:Ea.meshphong_vert,fragmentShader:Ea.meshphong_frag},standard:{uniforms:Ur([eo.common,eo.envmap,eo.aomap,eo.lightmap,eo.emissivemap,eo.bumpmap,eo.normalmap,eo.displacementmap,eo.roughnessmap,eo.metalnessmap,eo.fog,eo.lights,{emissive:{value:new Nn(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Ea.meshphysical_vert,fragmentShader:Ea.meshphysical_frag},toon:{uniforms:Ur([eo.common,eo.aomap,eo.lightmap,eo.emissivemap,eo.bumpmap,eo.normalmap,eo.displacementmap,eo.gradientmap,eo.fog,eo.lights,{emissive:{value:new Nn(0)}}]),vertexShader:Ea.meshtoon_vert,fragmentShader:Ea.meshtoon_frag},matcap:{uniforms:Ur([eo.common,eo.bumpmap,eo.normalmap,eo.displacementmap,eo.fog,{matcap:{value:null}}]),vertexShader:Ea.meshmatcap_vert,fragmentShader:Ea.meshmatcap_frag},points:{uniforms:Ur([eo.points,eo.fog]),vertexShader:Ea.points_vert,fragmentShader:Ea.points_frag},dashed:{uniforms:Ur([eo.common,eo.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Ea.linedashed_vert,fragmentShader:Ea.linedashed_frag},depth:{uniforms:Ur([eo.common,eo.displacementmap]),vertexShader:Ea.depth_vert,fragmentShader:Ea.depth_frag},normal:{uniforms:Ur([eo.common,eo.bumpmap,eo.normalmap,eo.displacementmap,{opacity:{value:1}}]),vertexShader:Ea.normal_vert,fragmentShader:Ea.normal_frag},sprite:{uniforms:Ur([eo.sprite,eo.fog]),vertexShader:Ea.sprite_vert,fragmentShader:Ea.sprite_frag},background:{uniforms:{uvTransform:{value:new ai},t2D:{value:null}},vertexShader:Ea.background_vert,fragmentShader:Ea.background_frag},cube:{uniforms:Ur([eo.envmap,{opacity:{value:1}}]),vertexShader:Ea.cube_vert,fragmentShader:Ea.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Ea.equirect_vert,fragmentShader:Ea.equirect_frag},distanceRGBA:{uniforms:Ur([eo.common,eo.displacementmap,{referencePosition:{value:new yi},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Ea.distanceRGBA_vert,fragmentShader:Ea.distanceRGBA_frag},shadow:{uniforms:Ur([eo.lights,eo.fog,{color:{value:new Nn(0)},opacity:{value:1}}]),vertexShader:Ea.shadow_vert,fragmentShader:Ea.shadow_frag}};function La(t,e,i,n){const r=new Nn(0);let o,s,a=0,l=null,c=0,h=null;function u(e,n,u,m){let g=!0===n.isScene?n.background:null;const v=t.xr,y=v.getSession&&v.getSession();if(y&&"additive"===y.environmentBlendMode&&(g=null),null===g?f(r,a):g&&g.isColor&&(f(g,1),m=!0),(t.autoClear||m)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),g&&(g.isCubeTexture||g.isWebGLCubeRenderTarget||g.mapping===st)){void 0===s&&(s=new Cr(new zr(1,1,1),new Wr({name:"BackgroundCubeMaterial",uniforms:Fr(Aa.cube.uniforms),vertexShader:Aa.cube.vertexShader,fragmentShader:Aa.cube.fragmentShader,side:p,depthTest:!1,depthWrite:!1,fog:!1})),s.geometry.deleteAttribute("normal"),s.geometry.deleteAttribute("uv"),s.onBeforeRender=function(t,e,i){this.matrixWorld.copyPosition(i.matrixWorld)},Object.defineProperty(s.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(s));const n=g.isWebGLCubeRenderTarget?g.texture:g;s.material.uniforms.envMap.value=n,s.material.uniforms.flipEnvMap.value=n.isCubeTexture?-1:1,l===g&&c===n.version&&h===t.toneMapping||(s.material.needsUpdate=!0,l=g,c=n.version,h=t.toneMapping),e.unshift(s,s.geometry,s.material,0,0,null)}else g&&g.isTexture&&(void 0===o&&(o=new Cr(new oo(2,2),new Wr({name:"BackgroundMaterial",uniforms:Fr(Aa.background.uniforms),vertexShader:Aa.background.vertexShader,fragmentShader:Aa.background.fragmentShader,side:d,depthTest:!1,depthWrite:!1,fog:!1})),o.geometry.deleteAttribute("normal"),Object.defineProperty(o.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(o)),o.material.uniforms.t2D.value=g,!0===g.matrixAutoUpdate&&g.updateMatrix(),o.material.uniforms.uvTransform.value.copy(g.matrix),l===g&&c===g.version&&h===t.toneMapping||(o.material.needsUpdate=!0,l=g,c=g.version,h=t.toneMapping),e.unshift(o,o.geometry,o.material,0,0,null))}function f(t,i){e.buffers.color.setClear(t.r,t.g,t.b,i,n)}return{getClearColor:function(){return r},setClearColor:function(t,e){r.set(t),a=void 0!==e?e:1,f(r,a)},getClearAlpha:function(){return a},setClearAlpha:function(t){a=t,f(r,a)},render:u}}function Ca(t,e,i,n){const r=t.getParameter(34921),o=n.isWebGL2?null:e.get("OES_vertex_array_object"),s=n.isWebGL2||null!==o,a={},l=m(null);let c=l;function h(e,n,r,o,a){let l=!1;if(s){const t=f(o,r,n);c!==t&&(c=t,d(c.object)),l=g(o),l&&v(o)}else{const t=!0===n.wireframe;c.geometry===o.id&&c.program===r.id&&c.wireframe===t||(c.geometry=o.id,c.program=r.id,c.wireframe=t,l=!0)}!0===e.isInstancedMesh&&(l=!0),null!==a&&i.update(a,34963),l&&(M(e,n,r,o),null!==a&&t.bindBuffer(34963,i.get(a).buffer))}function u(){return n.isWebGL2?t.createVertexArray():o.createVertexArrayOES()}function d(e){return n.isWebGL2?t.bindVertexArray(e):o.bindVertexArrayOES(e)}function p(e){return n.isWebGL2?t.deleteVertexArray(e):o.deleteVertexArrayOES(e)}function f(t,e,i){const n=!0===i.wireframe;let r=a[t.id];void 0===r&&(r={},a[t.id]=r);let o=r[e.id];void 0===o&&(o={},r[e.id]=o);let s=o[n];return void 0===s&&(s=m(u()),o[n]=s),s}function m(t){const e=[],i=[],n=[];for(let o=0;o<r;o++)e[o]=0,i[o]=0,n[o]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:e,enabledAttributes:i,attributeDivisors:n,object:t,attributes:{}}}function g(t){const e=c.attributes,i=t.attributes;if(Object.keys(e).length!==Object.keys(i).length)return!0;for(const n in i){const t=e[n],r=i[n];if(t.attribute!==r)return!0;if(t.data!==r.data)return!0}return!1}function v(t){const e={},i=t.attributes;for(const n in i){const t=i[n],r={};r.attribute=t,t.data&&(r.data=t.data),e[n]=r}c.attributes=e}function y(){const t=c.newAttributes;for(let e=0,i=t.length;e<i;e++)t[e]=0}function x(t){b(t,0)}function b(i,r){const o=c.newAttributes,s=c.enabledAttributes,a=c.attributeDivisors;if(o[i]=1,0===s[i]&&(t.enableVertexAttribArray(i),s[i]=1),a[i]!==r){const o=n.isWebGL2?t:e.get("ANGLE_instanced_arrays");o[n.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](i,r),a[i]=r}}function w(){const e=c.newAttributes,i=c.enabledAttributes;for(let n=0,r=i.length;n<r;n++)i[n]!==e[n]&&(t.disableVertexAttribArray(n),i[n]=0)}function _(e,i,r,o,s,a){!0!==n.isWebGL2||5124!==r&&5125!==r?t.vertexAttribPointer(e,i,r,o,s,a):t.vertexAttribIPointer(e,i,r,o,s,a)}function M(r,o,s,a){if(!1===n.isWebGL2&&(r.isInstancedMesh||a.isInstancedBufferGeometry)&&null===e.get("ANGLE_instanced_arrays"))return;y();const l=a.attributes,c=s.getAttributes(),h=o.defaultAttributeValues;for(const e in c){const n=c[e];if(n>=0){const o=l[e];if(void 0!==o){const e=o.normalized,r=o.itemSize,s=i.get(o);if(void 0===s)continue;const l=s.buffer,c=s.type,h=s.bytesPerElement;if(o.isInterleavedBufferAttribute){const i=o.data,s=i.stride,u=o.offset;i&&i.isInstancedInterleavedBuffer?(b(n,i.meshPerAttribute),void 0===a._maxInstanceCount&&(a._maxInstanceCount=i.meshPerAttribute*i.count)):x(n),t.bindBuffer(34962,l),_(n,r,c,e,s*h,u*h)}else o.isInstancedBufferAttribute?(b(n,o.meshPerAttribute),void 0===a._maxInstanceCount&&(a._maxInstanceCount=o.meshPerAttribute*o.count)):x(n),t.bindBuffer(34962,l),_(n,r,c,e,0,0)}else if("instanceMatrix"===e){const e=i.get(r.instanceMatrix);if(void 0===e)continue;const o=e.buffer,s=e.type;b(n+0,1),b(n+1,1),b(n+2,1),b(n+3,1),t.bindBuffer(34962,o),t.vertexAttribPointer(n+0,4,s,!1,64,0),t.vertexAttribPointer(n+1,4,s,!1,64,16),t.vertexAttribPointer(n+2,4,s,!1,64,32),t.vertexAttribPointer(n+3,4,s,!1,64,48)}else if(void 0!==h){const i=h[e];if(void 0!==i)switch(i.length){case 2:t.vertexAttrib2fv(n,i);break;case 3:t.vertexAttrib3fv(n,i);break;case 4:t.vertexAttrib4fv(n,i);break;default:t.vertexAttrib1fv(n,i)}}}}w()}function S(){A();for(const t in a){const e=a[t];for(const t in e){const i=e[t];for(const t in i)p(i[t].object),delete i[t];delete e[t]}delete a[t]}}function T(t){if(void 0===a[t.id])return;const e=a[t.id];for(const i in e){const t=e[i];for(const e in t)p(t[e].object),delete t[e];delete e[i]}delete a[t.id]}function E(t){for(const e in a){const i=a[e];if(void 0===i[t.id])continue;const n=i[t.id];for(const t in n)p(n[t].object),delete n[t];delete i[t.id]}}function A(){L(),c!==l&&(c=l,d(c.object))}function L(){l.geometry=null,l.program=null,l.wireframe=!1}return{setup:h,reset:A,resetDefaultState:L,dispose:S,releaseStatesOfGeometry:T,releaseStatesOfProgram:E,initAttributes:y,enableAttribute:x,disableUnusedAttributes:w}}function Pa(t,e,i,n){const r=n.isWebGL2;let o;function s(t){o=t}function a(e,n){t.drawArrays(o,e,n),i.update(n,o)}function l(n,s,a,l){if(0===l)return;let c,h;if(r)c=t,h="drawArraysInstanced";else if(c=e.get("ANGLE_instanced_arrays"),h="drawArraysInstancedANGLE",null===c)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");c[h](o,s,a,l),i.update(a,o,l)}this.setMode=s,this.render=a,this.renderInstances=l}function Ra(t,e,i){let n;function r(){if(void 0!==n)return n;const i=e.get("EXT_texture_filter_anisotropic");return n=null!==i?t.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,n}function o(e){if("highp"===e){if(t.getShaderPrecisionFormat(35633,36338).precision>0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const s="undefined"!==typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||"undefined"!==typeof WebGL2ComputeRenderingContext&&t instanceof WebGL2ComputeRenderingContext;let a=void 0!==i.precision?i.precision:"highp";const l=o(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);const c=!0===i.logarithmicDepthBuffer,h=t.getParameter(34930),u=t.getParameter(35660),d=t.getParameter(3379),p=t.getParameter(34076),f=t.getParameter(34921),m=t.getParameter(36347),g=t.getParameter(36348),v=t.getParameter(36349),y=u>0,x=s||!!e.get("OES_texture_float"),b=y&&x,w=s?t.getParameter(36183):0;return{isWebGL2:s,getMaxAnisotropy:r,getMaxPrecision:o,precision:a,logarithmicDepthBuffer:c,maxTextures:h,maxVertexTextures:u,maxTextureSize:d,maxCubemapSize:p,maxAttributes:f,maxVertexUniforms:m,maxVaryings:g,maxFragmentUniforms:v,vertexTextures:y,floatFragmentTextures:x,floatVertexTextures:b,maxSamples:w}}function Oa(){const t=this;let e=null,i=0,n=!1,r=!1;const o=new wn,s=new ai,a={value:null,needsUpdate:!1};function l(){a.value!==e&&(a.value=e,a.needsUpdate=i>0),t.numPlanes=i,t.numIntersection=0}function c(e,i,n,r){let l=null!==e?e.length:0,c=null;if(0!==l){if(c=a.value,!0!==r||null===c){const t=n+4*l,r=i.matrixWorldInverse;s.getNormalMatrix(r),(null===c||c.length<t)&&(c=new Float32Array(t));for(let i=0,a=n;i!==l;++i,a+=4)o.copy(e[i]).applyMatrix4(r,s),o.normal.toArray(c,a),c[a+3]=o.constant}a.value=c,a.needsUpdate=!0}return t.numPlanes=l,t.numIntersection=0,c}this.uniform=a,this.numPlanes=0,this.numIntersection=0,this.init=function(t,r,o){const s=0!==t.length||r||0!==i||n;return n=r,e=c(t,o,0),i=t.length,s},this.beginShadows=function(){r=!0,c(null)},this.endShadows=function(){r=!1,l()},this.setState=function(t,o,s,h,u,d){if(!n||null===t||0===t.length||r&&!s)r?c(null):l();else{const n=r?0:i,s=4*n;let l=u.clippingState||null;a.value=l,l=c(t,h,s,d);for(let t=0;t!==s;++t)l[t]=e[t];u.clippingState=l,this.numIntersection=o?this.numPlanes:0,this.numPlanes+=n}}}function ka(t){const e={};return{get:function(i){if(void 0!==e[i])return e[i];let n;switch(i){case"WEBGL_depth_texture":n=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":n=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":n=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":n=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:n=t.getExtension(i)}return null===n&&console.warn("THREE.WebGLRenderer: "+i+" extension not supported."),e[i]=n,n}}}function Da(t,e,i,n){const r=new WeakMap,o=new WeakMap;function s(t){const a=t.target,l=r.get(a);null!==l.index&&e.remove(l.index);for(const i in l.attributes)e.remove(l.attributes[i]);a.removeEventListener("dispose",s),r.delete(a);const c=o.get(l);c&&(e.remove(c),o.delete(l)),n.releaseStatesOfGeometry(a),!0===a.isInstancedBufferGeometry&&delete a._maxInstanceCount,i.memory.geometries--}function a(t,e){let n=r.get(e);return n||(e.addEventListener("dispose",s),e.isBufferGeometry?n=e:e.isGeometry&&(void 0===e._bufferGeometry&&(e._bufferGeometry=(new ur).setFromObject(t)),n=e._bufferGeometry),r.set(e,n),i.memory.geometries++,n)}function l(t){const i=t.attributes;for(const r in i)e.update(i[r],34962);const n=t.morphAttributes;for(const r in n){const t=n[r];for(let i=0,n=t.length;i<n;i++)e.update(t[i],34962)}}function c(t){const i=[],n=t.index,r=t.attributes.position;let s=0;if(null!==n){const t=n.array;s=n.version;for(let e=0,n=t.length;e<n;e+=3){const n=t[e+0],r=t[e+1],o=t[e+2];i.push(n,r,r,o,o,n)}}else{const t=r.array;s=r.version;for(let e=0,n=t.length/3-1;e<n;e+=3){const t=e+0,n=e+1,r=e+2;i.push(t,n,n,r,r,t)}}const a=new(nr(i)>65535?Qn:Kn)(i,1);a.version=s;const l=o.get(t);l&&e.remove(l),o.set(t,a)}function h(t){const e=o.get(t);if(e){const i=t.index;null!==i&&e.version<i.version&&c(t)}else c(t);return o.get(t)}return{get:a,update:l,getWireframeAttribute:h}}function Ia(t,e,i,n){const r=n.isWebGL2;let o,s,a;function l(t){o=t}function c(t){s=t.type,a=t.bytesPerElement}function h(e,n){t.drawElements(o,n,s,e*a),i.update(n,o)}function u(n,l,c,h){if(0===h)return;let u,d;if(r)u=t,d="drawElementsInstanced";else if(u=e.get("ANGLE_instanced_arrays"),d="drawElementsInstancedANGLE",null===u)return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");u[d](o,c,s,l*a,h),i.update(c,o,h)}this.setMode=l,this.setIndex=c,this.render=h,this.renderInstances=u}function Na(t){const e={geometries:0,textures:0},i={frame:0,calls:0,triangles:0,points:0,lines:0};function n(t,e,n){switch(n=n||1,i.calls++,e){case 4:i.triangles+=n*(t/3);break;case 1:i.lines+=n*(t/2);break;case 3:i.lines+=n*(t-1);break;case 2:i.lines+=n*t;break;case 0:i.points+=n*t;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",e);break}}function r(){i.frame++,i.calls=0,i.triangles=0,i.points=0,i.lines=0}return{memory:e,render:i,programs:null,autoReset:!0,reset:r,update:n}}function Ba(t,e){return t[0]-e[0]}function za(t,e){return Math.abs(e[1])-Math.abs(t[1])}function Fa(t){const e={},i=new Float32Array(8),n=[];for(let o=0;o<8;o++)n[o]=[o,0];function r(r,o,s,a){const l=r.morphTargetInfluences,c=void 0===l?0:l.length;let h=e[o.id];if(void 0===h){h=[];for(let t=0;t<c;t++)h[t]=[t,0];e[o.id]=h}for(let t=0;t<c;t++){const e=h[t];e[0]=t,e[1]=l[t]}h.sort(za);for(let t=0;t<8;t++)t<c&&h[t][1]?(n[t][0]=h[t][0],n[t][1]=h[t][1]):(n[t][0]=Number.MAX_SAFE_INTEGER,n[t][1]=0);n.sort(Ba);const u=s.morphTargets&&o.morphAttributes.position,d=s.morphNormals&&o.morphAttributes.normal;let p=0;for(let t=0;t<8;t++){const e=n[t],r=e[0],s=e[1];r!==Number.MAX_SAFE_INTEGER&&s?(u&&o.getAttribute("morphTarget"+t)!==u[r]&&o.setAttribute("morphTarget"+t,u[r]),d&&o.getAttribute("morphNormal"+t)!==d[r]&&o.setAttribute("morphNormal"+t,d[r]),i[t]=s,p+=s):(u&&void 0!==o.getAttribute("morphTarget"+t)&&o.deleteAttribute("morphTarget"+t),d&&void 0!==o.getAttribute("morphNormal"+t)&&o.deleteAttribute("morphNormal"+t),i[t]=0)}const f=o.morphTargetsRelative?1:1-p;a.getUniforms().setValue(t,"morphTargetBaseInfluence",f),a.getUniforms().setValue(t,"morphTargetInfluences",i)}return{update:r}}function Ua(t,e,i,n){let r=new WeakMap;function o(t){const o=n.render.frame,s=t.geometry,a=e.get(t,s);return r.get(a)!==o&&(s.isGeometry&&a.updateFromObject(t),e.update(a),r.set(a,o)),t.isInstancedMesh&&i.update(t.instanceMatrix,34962),a}function s(){r=new WeakMap}return{update:o,dispose:s}}function Ga(t,e,i,n,r,o,s,a,l,c){t=void 0!==t?t:[],e=void 0!==e?e:it,s=void 0!==s?s:Pt,ui.call(this,t,e,i,n,r,o,s,a,l,c),this.flipY=!1}function Ha(t,e,i,n){ui.call(this,null),this.image={data:t||null,width:e||1,height:i||1,depth:n||1},this.magFilter=ut,this.minFilter=ut,this.wrapR=ct,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}function ja(t,e,i,n){ui.call(this,null),this.image={data:t||null,width:e||1,height:i||1,depth:n||1},this.magFilter=ut,this.minFilter=ut,this.wrapR=ct,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}Aa.physical={uniforms:Ur([Aa.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new si(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new Nn(0)},transparency:{value:0}}]),vertexShader:Ea.meshphysical_vert,fragmentShader:Ea.meshphysical_frag},Ga.prototype=Object.create(ui.prototype),Ga.prototype.constructor=Ga,Ga.prototype.isCubeTexture=!0,Object.defineProperty(Ga.prototype,"images",{get:function(){return this.image},set:function(t){this.image=t}}),Ha.prototype=Object.create(ui.prototype),Ha.prototype.constructor=Ha,Ha.prototype.isDataTexture2DArray=!0,ja.prototype=Object.create(ui.prototype),ja.prototype.constructor=ja,ja.prototype.isDataTexture3D=!0;const Wa=new ui,Va=new Ha,Xa=new ja,Ya=new Ga,qa=[],Za=[],Ja=new Float32Array(16),Ka=new Float32Array(9),$a=new Float32Array(4);function Qa(t,e,i){const n=t[0];if(n<=0||n>0)return t;let r=e*i,o=qa[r];if(void 0===o&&(o=new Float32Array(r),qa[r]=o),0!==e){n.toArray(o,0);for(let n=1,r=0;n!==e;++n)r+=i,t[n].toArray(o,r)}return o}function tl(t,e){if(t.length!==e.length)return!1;for(let i=0,n=t.length;i<n;i++)if(t[i]!==e[i])return!1;return!0}function el(t,e){for(let i=0,n=e.length;i<n;i++)t[i]=e[i]}function il(t,e){let i=Za[e];void 0===i&&(i=new Int32Array(e),Za[e]=i);for(let n=0;n!==e;++n)i[n]=t.allocateTextureUnit();return i}function nl(t,e){const i=this.cache;i[0]!==e&&(t.uniform1f(this.addr,e),i[0]=e)}function rl(t,e){const i=this.cache;if(void 0!==e.x)i[0]===e.x&&i[1]===e.y||(t.uniform2f(this.addr,e.x,e.y),i[0]=e.x,i[1]=e.y);else{if(tl(i,e))return;t.uniform2fv(this.addr,e),el(i,e)}}function ol(t,e){const i=this.cache;if(void 0!==e.x)i[0]===e.x&&i[1]===e.y&&i[2]===e.z||(t.uniform3f(this.addr,e.x,e.y,e.z),i[0]=e.x,i[1]=e.y,i[2]=e.z);else if(void 0!==e.r)i[0]===e.r&&i[1]===e.g&&i[2]===e.b||(t.uniform3f(this.addr,e.r,e.g,e.b),i[0]=e.r,i[1]=e.g,i[2]=e.b);else{if(tl(i,e))return;t.uniform3fv(this.addr,e),el(i,e)}}function sl(t,e){const i=this.cache;if(void 0!==e.x)i[0]===e.x&&i[1]===e.y&&i[2]===e.z&&i[3]===e.w||(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),i[0]=e.x,i[1]=e.y,i[2]=e.z,i[3]=e.w);else{if(tl(i,e))return;t.uniform4fv(this.addr,e),el(i,e)}}function al(t,e){const i=this.cache,n=e.elements;if(void 0===n){if(tl(i,e))return;t.uniformMatrix2fv(this.addr,!1,e),el(i,e)}else{if(tl(i,n))return;$a.set(n),t.uniformMatrix2fv(this.addr,!1,$a),el(i,n)}}function ll(t,e){const i=this.cache,n=e.elements;if(void 0===n){if(tl(i,e))return;t.uniformMatrix3fv(this.addr,!1,e),el(i,e)}else{if(tl(i,n))return;Ka.set(n),t.uniformMatrix3fv(this.addr,!1,Ka),el(i,n)}}function cl(t,e){const i=this.cache,n=e.elements;if(void 0===n){if(tl(i,e))return;t.uniformMatrix4fv(this.addr,!1,e),el(i,e)}else{if(tl(i,n))return;Ja.set(n),t.uniformMatrix4fv(this.addr,!1,Ja),el(i,n)}}function hl(t,e,i){const n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(t.uniform1i(this.addr,r),n[0]=r),i.safeSetTexture2D(e||Wa,r)}function ul(t,e,i){const n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(t.uniform1i(this.addr,r),n[0]=r),i.setTexture2DArray(e||Va,r)}function dl(t,e,i){const n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(t.uniform1i(this.addr,r),n[0]=r),i.setTexture3D(e||Xa,r)}function pl(t,e,i){const n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(t.uniform1i(this.addr,r),n[0]=r),i.safeSetTextureCube(e||Ya,r)}function fl(t,e){const i=this.cache;i[0]!==e&&(t.uniform1i(this.addr,e),i[0]=e)}function ml(t,e){const i=this.cache;tl(i,e)||(t.uniform2iv(this.addr,e),el(i,e))}function gl(t,e){const i=this.cache;tl(i,e)||(t.uniform3iv(this.addr,e),el(i,e))}function vl(t,e){const i=this.cache;tl(i,e)||(t.uniform4iv(this.addr,e),el(i,e))}function yl(t,e){const i=this.cache;i[0]!==e&&(t.uniform1ui(this.addr,e),i[0]=e)}function xl(t){switch(t){case 5126:return nl;case 35664:return rl;case 35665:return ol;case 35666:return sl;case 35674:return al;case 35675:return ll;case 35676:return cl;case 5124:case 35670:return fl;case 35667:case 35671:return ml;case 35668:case 35672:return gl;case 35669:case 35673:return vl;case 5125:return yl;case 35678:case 36198:case 36298:case 36306:case 35682:return hl;case 35679:case 36299:case 36307:return dl;case 35680:case 36300:case 36308:case 36293:return pl;case 36289:case 36303:case 36311:case 36292:return ul}}function bl(t,e){t.uniform1fv(this.addr,e)}function wl(t,e){t.uniform1iv(this.addr,e)}function _l(t,e){t.uniform2iv(this.addr,e)}function Ml(t,e){t.uniform3iv(this.addr,e)}function Sl(t,e){t.uniform4iv(this.addr,e)}function Tl(t,e){const i=Qa(e,this.size,2);t.uniform2fv(this.addr,i)}function El(t,e){const i=Qa(e,this.size,3);t.uniform3fv(this.addr,i)}function Al(t,e){const i=Qa(e,this.size,4);t.uniform4fv(this.addr,i)}function Ll(t,e){const i=Qa(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,i)}function Cl(t,e){const i=Qa(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,i)}function Pl(t,e){const i=Qa(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,i)}function Rl(t,e,i){const n=e.length,r=il(i,n);t.uniform1iv(this.addr,r);for(let o=0;o!==n;++o)i.safeSetTexture2D(e[o]||Wa,r[o])}function Ol(t,e,i){const n=e.length,r=il(i,n);t.uniform1iv(this.addr,r);for(let o=0;o!==n;++o)i.safeSetTextureCube(e[o]||Ya,r[o])}function kl(t){switch(t){case 5126:return bl;case 35664:return Tl;case 35665:return El;case 35666:return Al;case 35674:return Ll;case 35675:return Cl;case 35676:return Pl;case 5124:case 35670:return wl;case 35667:case 35671:return _l;case 35668:case 35672:return Ml;case 35669:case 35673:return Sl;case 35678:case 36198:case 36298:case 36306:case 35682:return Rl;case 35680:case 36300:case 36308:case 36293:return Ol}}function Dl(t,e,i){this.id=t,this.addr=i,this.cache=[],this.setValue=xl(e.type)}function Il(t,e,i){this.id=t,this.addr=i,this.cache=[],this.size=e.size,this.setValue=kl(e.type)}function Nl(t){this.id=t,this.seq=[],this.map={}}Il.prototype.updateCache=function(t){let e=this.cache;t instanceof Float32Array&&e.length!==t.length&&(this.cache=new Float32Array(t.length)),el(e,t)},Nl.prototype.setValue=function(t,e,i){const n=this.seq;for(let r=0,o=n.length;r!==o;++r){const o=n[r];o.setValue(t,e[o.id],i)}};const Bl=/([\w\d_]+)(\])?(\[|\.)?/g;function zl(t,e){t.seq.push(e),t.map[e.id]=e}function Fl(t,e,i){const n=t.name,r=n.length;Bl.lastIndex=0;while(1){const o=Bl.exec(n),s=Bl.lastIndex;let a=o[1],l="]"===o[2],c=o[3];if(l&&(a|=0),void 0===c||"["===c&&s+2===r){zl(i,void 0===c?new Dl(a,t,e):new Il(a,t,e));break}{const t=i.map;let e=t[a];void 0===e&&(e=new Nl(a),zl(i,e)),i=e}}}function Ul(t,e){this.seq=[],this.map={};const i=t.getProgramParameter(e,35718);for(let n=0;n<i;++n){const i=t.getActiveUniform(e,n),r=t.getUniformLocation(e,i.name);Fl(i,r,this)}}function Gl(t,e,i){const n=t.createShader(e);return t.shaderSource(n,i),t.compileShader(n),n}Ul.prototype.setValue=function(t,e,i,n){const r=this.map[e];void 0!==r&&r.setValue(t,i,n)},Ul.prototype.setOptional=function(t,e,i){const n=e[i];void 0!==n&&this.setValue(t,i,n)},Ul.upload=function(t,e,i,n){for(let r=0,o=e.length;r!==o;++r){const o=e[r],s=i[o.id];!1!==s.needsUpdate&&o.setValue(t,s.value,n)}},Ul.seqWithValue=function(t,e){const i=[];for(let n=0,r=t.length;n!==r;++n){const r=t[n];r.id in e&&i.push(r)}return i};let Hl=0;function jl(t){const e=t.split("\n");for(let i=0;i<e.length;i++)e[i]=i+1+": "+e[i];return e.join("\n")}function Wl(t){switch(t){case Ge:return["Linear","( value )"];case He:return["sRGB","( value )"];case We:return["RGBE","( value )"];case Xe:return["RGBM","( value, 7.0 )"];case Ye:return["RGBM","( value, 16.0 )"];case qe:return["RGBD","( value, 256.0 )"];case je:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case Ve:return["LogLuv","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",t),["Linear","( value )"]}}function Vl(t,e,i){const n=t.getShaderParameter(e,35713),r=t.getShaderInfoLog(e).trim();if(n&&""===r)return"";const o=t.getShaderSource(e);return"THREE.WebGLShader: gl.getShaderInfoLog() "+i+"\n"+r+jl(o)}function Xl(t,e){const i=Wl(e);return"vec4 "+t+"( vec4 value ) { return "+i[0]+"ToLinear"+i[1]+"; }"}function Yl(t,e){const i=Wl(e);return"vec4 "+t+"( vec4 value ) { return LinearTo"+i[0]+i[1]+"; }"}function ql(t,e){let i;switch(e){case J:i="Linear";break;case K:i="Reinhard";break;case $:i="OptimizedCineon";break;case Q:i="ACESFilmic";break;case tt:i="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),i="Linear"}return"vec3 "+t+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}function Zl(t){const e=[t.extensionDerivatives||t.envMapCubeUV||t.bumpMap||t.tangentSpaceNormalMap||t.clearcoatNormalMap||t.flatShading||"physical"===t.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""];return e.filter($l).join("\n")}function Jl(t){const e=[];for(const i in t){const n=t[i];!1!==n&&e.push("#define "+i+" "+n)}return e.join("\n")}function Kl(t,e){const i={},n=t.getProgramParameter(e,35721);for(let r=0;r<n;r++){const n=t.getActiveAttrib(e,r),o=n.name;i[o]=t.getAttribLocation(e,o)}return i}function $l(t){return""!==t}function Ql(t,e){return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function tc(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const ec=/^[ \t]*#include +<([\w\d./]+)>/gm;function ic(t){return t.replace(ec,nc)}function nc(t,e){const i=Ea[e];if(void 0===i)throw new Error("Can not resolve #include <"+e+">");return ic(i)}const rc=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,oc=/#pragma unroll_loop_start[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}[\s]+?#pragma unroll_loop_end/g;function sc(t){return t.replace(oc,lc).replace(rc,ac)}function ac(t,e,i,n){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),lc(t,e,i,n)}function lc(t,e,i,n){let r="";for(let o=parseInt(e);o<parseInt(i);o++)r+=n.replace(/\[ i \]/g,"[ "+o+" ]").replace(/UNROLLED_LOOP_INDEX/g,o);return r}function cc(t){let e="precision "+t.precision+" float;\nprecision "+t.precision+" int;";return"highp"===t.precision?e+="\n#define HIGH_PRECISION":"mediump"===t.precision?e+="\n#define MEDIUM_PRECISION":"lowp"===t.precision&&(e+="\n#define LOW_PRECISION"),e}function hc(t){let e="SHADOWMAP_TYPE_BASIC";return t.shadowMapType===c?e="SHADOWMAP_TYPE_PCF":t.shadowMapType===h?e="SHADOWMAP_TYPE_PCF_SOFT":t.shadowMapType===u&&(e="SHADOWMAP_TYPE_VSM"),e}function uc(t){let e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case it:case nt:e="ENVMAP_TYPE_CUBE";break;case st:case at:e="ENVMAP_TYPE_CUBE_UV";break;case rt:case ot:e="ENVMAP_TYPE_EQUIREC";break}return e}function dc(t){let e="ENVMAP_MODE_REFLECTION";if(t.envMap)switch(t.envMapMode){case nt:case ot:e="ENVMAP_MODE_REFRACTION";break}return e}function pc(t){let e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case X:e="ENVMAP_BLENDING_MULTIPLY";break;case Y:e="ENVMAP_BLENDING_MIX";break;case q:e="ENVMAP_BLENDING_ADD";break}return e}function fc(t,e,i,n){const r=t.getContext(),o=i.defines;let s=i.vertexShader,a=i.fragmentShader;const l=hc(i),c=uc(i),h=dc(i),u=pc(i),d=t.gammaFactor>0?t.gammaFactor:1,p=i.isWebGL2?"":Zl(i),f=Jl(o),m=r.createProgram();let g,v;if(i.isRawShaderMaterial?(g=[f].filter($l).join("\n"),g.length>0&&(g+="\n"),v=[p,f].filter($l).join("\n"),v.length>0&&(v+="\n")):(g=[cc(i),"#define SHADER_NAME "+i.shaderName,f,i.instancing?"#define USE_INSTANCING":"",i.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+d,"#define MAX_BONES "+i.maxBones,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+h:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMap&&i.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",i.normalMap&&i.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.displacementMap&&i.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.vertexTangents?"#define USE_TANGENT":"",i.vertexColors?"#define USE_COLOR":"",i.vertexUvs?"#define USE_UV":"",i.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",i.flatShading?"#define FLAT_SHADED":"",i.skinning?"#define USE_SKINNING":"",i.useVertexTexture?"#define BONE_TEXTURE":"",i.morphTargets?"#define USE_MORPHTARGETS":"",i.morphNormals&&!1===i.flatShading?"#define USE_MORPHNORMALS":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+l:"",i.sizeAttenuation?"#define USE_SIZEATTENUATION":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&i.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($l).join("\n"),v=[p,cc(i),"#define SHADER_NAME "+i.shaderName,f,i.alphaTest?"#define ALPHATEST "+i.alphaTest+(i.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+d,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.matcap?"#define USE_MATCAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+c:"",i.envMap?"#define "+h:"",i.envMap?"#define "+u:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMap&&i.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",i.normalMap&&i.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.sheen?"#define USE_SHEEN":"",i.vertexTangents?"#define USE_TANGENT":"",i.vertexColors?"#define USE_COLOR":"",i.vertexUvs?"#define USE_UV":"",i.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",i.gradientMap?"#define USE_GRADIENTMAP":"",i.flatShading?"#define FLAT_SHADED":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+l:"",i.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",i.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&i.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(i.extensionShaderTextureLOD||i.envMap)&&i.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",i.toneMapping!==Z?"#define TONE_MAPPING":"",i.toneMapping!==Z?Ea["tonemapping_pars_fragment"]:"",i.toneMapping!==Z?ql("toneMapping",i.toneMapping):"",i.dithering?"#define DITHERING":"",Ea["encodings_pars_fragment"],i.map?Xl("mapTexelToLinear",i.mapEncoding):"",i.matcap?Xl("matcapTexelToLinear",i.matcapEncoding):"",i.envMap?Xl("envMapTexelToLinear",i.envMapEncoding):"",i.emissiveMap?Xl("emissiveMapTexelToLinear",i.emissiveMapEncoding):"",i.lightMap?Xl("lightMapTexelToLinear",i.lightMapEncoding):"",Yl("linearToOutputTexel",i.outputEncoding),i.depthPacking?"#define DEPTH_PACKING "+i.depthPacking:"","\n"].filter($l).join("\n")),s=ic(s),s=Ql(s,i),s=tc(s,i),a=ic(a),a=Ql(a,i),a=tc(a,i),s=sc(s),a=sc(a),i.isWebGL2&&!i.isRawShaderMaterial){let t=!1;const e=/^\s*#version\s+300\s+es\s*\n/;i.isShaderMaterial&&null!==s.match(e)&&null!==a.match(e)&&(t=!0,s=s.replace(e,""),a=a.replace(e,"")),g=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+g,v=["#version 300 es\n","#define varying in",t?"":"out highp vec4 pc_fragColor;",t?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+v}const y=g+s,x=v+a,b=Gl(r,35633,y),w=Gl(r,35632,x);if(r.attachShader(m,b),r.attachShader(m,w),void 0!==i.index0AttributeName?r.bindAttribLocation(m,0,i.index0AttributeName):!0===i.morphTargets&&r.bindAttribLocation(m,0,"position"),r.linkProgram(m),t.debug.checkShaderErrors){const t=r.getProgramInfoLog(m).trim(),e=r.getShaderInfoLog(b).trim(),i=r.getShaderInfoLog(w).trim();let n=!0,o=!0;if(!1===r.getProgramParameter(m,35714)){n=!1;const e=Vl(r,b,"vertex"),i=Vl(r,w,"fragment");console.error("THREE.WebGLProgram: shader error: ",r.getError(),"35715",r.getProgramParameter(m,35715),"gl.getProgramInfoLog",t,e,i)}else""!==t?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",t):""!==e&&""!==i||(o=!1);o&&(this.diagnostics={runnable:n,programLog:t,vertexShader:{log:e,prefix:g},fragmentShader:{log:i,prefix:v}})}let _,M;return r.deleteShader(b),r.deleteShader(w),this.getUniforms=function(){return void 0===_&&(_=new Ul(r,m)),_},this.getAttributes=function(){return void 0===M&&(M=Kl(r,m)),M},this.destroy=function(){n.releaseStatesOfProgram(this),r.deleteProgram(m),this.program=void 0},this.name=i.shaderName,this.id=Hl++,this.cacheKey=e,this.usedTimes=1,this.program=m,this.vertexShader=b,this.fragmentShader=w,this}function mc(t,e,i,n){const r=[],o=i.isWebGL2,s=i.logarithmicDepthBuffer,a=i.floatVertexTextures,l=i.maxVertexUniforms,c=i.vertexTextures;let h=i.precision;const u={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"},d=["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"];function m(t,e){let i;if(e){const n=Aa[e];i={name:t.name||t.type,uniforms:Gr.clone(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader}}else i={name:t.name||t.type,uniforms:t.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader};return i}function g(t){const e=t.skeleton,i=e.bones;if(a)return 1024;{const t=l,e=Math.floor((t-20)/4),n=Math.min(e,i.length);return n<i.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+i.length+" bones. This GPU supports "+n+"."),0):n}}function v(t){let e;return t?t.isTexture?e=t.encoding:t.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),e=t.texture.encoding):e=Ge,e}function y(n,r,l,d,y,x,b){const w=d.fog,_=n.isMeshStandardMaterial?d.environment:null,M=n.envMap||_,S=u[n.type],T=b.isSkinnedMesh?g(b):0;null!==n.precision&&(h=i.getMaxPrecision(n.precision),h!==n.precision&&console.warn("THREE.WebGLProgram.getParameters:",n.precision,"not supported, using",h,"instead."));const E=m(n,S);n.onBeforeCompile(E,t);const A=t.getRenderTarget(),L={isWebGL2:o,shaderID:S,shaderName:E.name,uniforms:E.uniforms,vertexShader:E.vertexShader,fragmentShader:E.fragmentShader,defines:n.defines,isRawShaderMaterial:n.isRawShaderMaterial,isShaderMaterial:n.isShaderMaterial,precision:h,instancing:!0===b.isInstancedMesh,supportsVertexTextures:c,outputEncoding:null!==A?v(A.texture):t.outputEncoding,map:!!n.map,mapEncoding:v(n.map),matcap:!!n.matcap,matcapEncoding:v(n.matcap),envMap:!!M,envMapMode:M&&M.mapping,envMapEncoding:v(M),envMapCubeUV:!!M&&(M.mapping===st||M.mapping===at),lightMap:!!n.lightMap,lightMapEncoding:v(n.lightMap),aoMap:!!n.aoMap,emissiveMap:!!n.emissiveMap,emissiveMapEncoding:v(n.emissiveMap),bumpMap:!!n.bumpMap,normalMap:!!n.normalMap,objectSpaceNormalMap:n.normalMapType===$e,tangentSpaceNormalMap:n.normalMapType===Ke,clearcoatMap:!!n.clearcoatMap,clearcoatRoughnessMap:!!n.clearcoatRoughnessMap,clearcoatNormalMap:!!n.clearcoatNormalMap,displacementMap:!!n.displacementMap,roughnessMap:!!n.roughnessMap,metalnessMap:!!n.metalnessMap,specularMap:!!n.specularMap,alphaMap:!!n.alphaMap,gradientMap:!!n.gradientMap,sheen:!!n.sheen,combine:n.combine,vertexTangents:n.normalMap&&n.vertexTangents,vertexColors:n.vertexColors,vertexUvs:!!n.map||!!n.bumpMap||!!n.normalMap||!!n.specularMap||!!n.alphaMap||!!n.emissiveMap||!!n.roughnessMap||!!n.metalnessMap||!!n.clearcoatMap||!!n.clearcoatRoughnessMap||!!n.clearcoatNormalMap||!!n.displacementMap,uvsVertexOnly:!(n.map||n.bumpMap||n.normalMap||n.specularMap||n.alphaMap||n.emissiveMap||n.roughnessMap||n.metalnessMap||n.clearcoatNormalMap)&&!!n.displacementMap,fog:!!w,useFog:n.fog,fogExp2:w&&w.isFogExp2,flatShading:n.flatShading,sizeAttenuation:n.sizeAttenuation,logarithmicDepthBuffer:s,skinning:n.skinning&&T>0,maxBones:T,useVertexTexture:a,morphTargets:n.morphTargets,morphNormals:n.morphNormals,maxMorphTargets:t.maxMorphTargets,maxMorphNormals:t.maxMorphNormals,numDirLights:r.directional.length,numPointLights:r.point.length,numSpotLights:r.spot.length,numRectAreaLights:r.rectArea.length,numHemiLights:r.hemi.length,numDirLightShadows:r.directionalShadowMap.length,numPointLightShadows:r.pointShadowMap.length,numSpotLightShadows:r.spotShadowMap.length,numClippingPlanes:y,numClipIntersection:x,dithering:n.dithering,shadowMapEnabled:t.shadowMap.enabled&&l.length>0,shadowMapType:t.shadowMap.type,toneMapping:n.toneMapped?t.toneMapping:Z,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:n.premultipliedAlpha,alphaTest:n.alphaTest,doubleSided:n.side===f,flipSided:n.side===p,depthPacking:void 0!==n.depthPacking&&n.depthPacking,index0AttributeName:n.index0AttributeName,extensionDerivatives:n.extensions&&n.extensions.derivatives,extensionFragDepth:n.extensions&&n.extensions.fragDepth,extensionDrawBuffers:n.extensions&&n.extensions.drawBuffers,extensionShaderTextureLOD:n.extensions&&n.extensions.shaderTextureLOD,rendererExtensionFragDepth:o||null!==e.get("EXT_frag_depth"),rendererExtensionDrawBuffers:o||null!==e.get("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:o||null!==e.get("EXT_shader_texture_lod"),customProgramCacheKey:n.customProgramCacheKey()};return L}function x(e){const i=[];if(e.shaderID?i.push(e.shaderID):(i.push(e.fragmentShader),i.push(e.vertexShader)),void 0!==e.defines)for(const t in e.defines)i.push(t),i.push(e.defines[t]);if(void 0===e.isRawShaderMaterial){for(let t=0;t<d.length;t++)i.push(e[d[t]]);i.push(t.outputEncoding),i.push(t.gammaFactor)}return i.push(e.customProgramCacheKey),i.join()}function b(e,i){let o;for(let t=0,n=r.length;t<n;t++){const e=r[t];if(e.cacheKey===i){o=e,++o.usedTimes;break}}return void 0===o&&(o=new fc(t,i,e,n),r.push(o)),o}function w(t){if(0===--t.usedTimes){const e=r.indexOf(t);r[e]=r[r.length-1],r.pop(),t.destroy()}}return{getParameters:y,getProgramCacheKey:x,acquireProgram:b,releaseProgram:w,programs:r}}function gc(){let t=new WeakMap;function e(e){let i=t.get(e);return void 0===i&&(i={},t.set(e,i)),i}function i(e){t.delete(e)}function n(e,i,n){t.get(e)[i]=n}function r(){t=new WeakMap}return{get:e,remove:i,update:n,dispose:r}}function vc(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.program!==e.program?t.program.id-e.program.id:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function yc(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function xc(){const t=[];let e=0;const i=[],n=[],r={id:-1};function o(){e=0,i.length=0,n.length=0}function s(i,n,o,s,a,l){let c=t[e];return void 0===c?(c={id:i.id,object:i,geometry:n,material:o,program:o.program||r,groupOrder:s,renderOrder:i.renderOrder,z:a,group:l},t[e]=c):(c.id=i.id,c.object=i,c.geometry=n,c.material=o,c.program=o.program||r,c.groupOrder=s,c.renderOrder=i.renderOrder,c.z=a,c.group=l),e++,c}function a(t,e,r,o,a,l){const c=s(t,e,r,o,a,l);(!0===r.transparent?n:i).push(c)}function l(t,e,r,o,a,l){const c=s(t,e,r,o,a,l);(!0===r.transparent?n:i).unshift(c)}function c(t,e){i.length>1&&i.sort(t||vc),n.length>1&&n.sort(e||yc)}function h(){for(let i=e,n=t.length;i<n;i++){const e=t[i];if(null===e.id)break;e.id=null,e.object=null,e.geometry=null,e.material=null,e.program=null,e.group=null}}return{opaque:i,transparent:n,init:o,push:a,unshift:l,finish:h,sort:c}}function bc(){let t=new WeakMap;function e(i){const n=i.target;n.removeEventListener("dispose",e),t.delete(n)}function i(i,n){const r=t.get(i);let o;return void 0===r?(o=new xc,t.set(i,new WeakMap),t.get(i).set(n,o),i.addEventListener("dispose",e)):(o=r.get(n),void 0===o&&(o=new xc,r.set(n,o))),o}function n(){t=new WeakMap}return{get:i,dispose:n}}function wc(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let i;switch(e.type){case"DirectionalLight":i={direction:new yi,color:new Nn};break;case"SpotLight":i={position:new yi,direction:new yi,color:new Nn,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":i={position:new yi,color:new Nn,distance:0,decay:0};break;case"HemisphereLight":i={direction:new yi,skyColor:new Nn,groundColor:new Nn};break;case"RectAreaLight":i={color:new Nn,position:new yi,halfWidth:new yi,halfHeight:new yi};break}return t[e.id]=i,i}}}function _c(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let i;switch(e.type){case"DirectionalLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new si};break;case"SpotLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new si};break;case"PointLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new si,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=i,i}}}let Mc=0;function Sc(t,e){return(e.castShadow?1:0)-(t.castShadow?1:0)}function Tc(){const t=new wc,e=_c(),i={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:[]};for(let a=0;a<9;a++)i.probe.push(new yi);const n=new yi,r=new Ei,o=new Ei;function s(s,a,l){let c=0,h=0,u=0;for(let t=0;t<9;t++)i.probe[t].set(0,0,0);let d=0,p=0,f=0,m=0,g=0,v=0,y=0,x=0;const b=l.matrixWorldInverse;s.sort(Sc);for(let _=0,M=s.length;_<M;_++){const a=s[_],l=a.color,w=a.intensity,M=a.distance,S=a.shadow&&a.shadow.map?a.shadow.map.texture:null;if(a.isAmbientLight)c+=l.r*w,h+=l.g*w,u+=l.b*w;else if(a.isLightProbe)for(let t=0;t<9;t++)i.probe[t].addScaledVector(a.sh.coefficients[t],w);else if(a.isDirectionalLight){const r=t.get(a);if(r.color.copy(a.color).multiplyScalar(a.intensity),r.direction.setFromMatrixPosition(a.matrixWorld),n.setFromMatrixPosition(a.target.matrixWorld),r.direction.sub(n),r.direction.transformDirection(b),a.castShadow){const t=a.shadow,n=e.get(a);n.shadowBias=t.bias,n.shadowNormalBias=t.normalBias,n.shadowRadius=t.radius,n.shadowMapSize=t.mapSize,i.directionalShadow[d]=n,i.directionalShadowMap[d]=S,i.directionalShadowMatrix[d]=a.shadow.matrix,v++}i.directional[d]=r,d++}else if(a.isSpotLight){const r=t.get(a);if(r.position.setFromMatrixPosition(a.matrixWorld),r.position.applyMatrix4(b),r.color.copy(l).multiplyScalar(w),r.distance=M,r.direction.setFromMatrixPosition(a.matrixWorld),n.setFromMatrixPosition(a.target.matrixWorld),r.direction.sub(n),r.direction.transformDirection(b),r.coneCos=Math.cos(a.angle),r.penumbraCos=Math.cos(a.angle*(1-a.penumbra)),r.decay=a.decay,a.castShadow){const t=a.shadow,n=e.get(a);n.shadowBias=t.bias,n.shadowNormalBias=t.normalBias,n.shadowRadius=t.radius,n.shadowMapSize=t.mapSize,i.spotShadow[f]=n,i.spotShadowMap[f]=S,i.spotShadowMatrix[f]=a.shadow.matrix,x++}i.spot[f]=r,f++}else if(a.isRectAreaLight){const e=t.get(a);e.color.copy(l).multiplyScalar(w),e.position.setFromMatrixPosition(a.matrixWorld),e.position.applyMatrix4(b),o.identity(),r.copy(a.matrixWorld),r.premultiply(b),o.extractRotation(r),e.halfWidth.set(.5*a.width,0,0),e.halfHeight.set(0,.5*a.height,0),e.halfWidth.applyMatrix4(o),e.halfHeight.applyMatrix4(o),i.rectArea[m]=e,m++}else if(a.isPointLight){const n=t.get(a);if(n.position.setFromMatrixPosition(a.matrixWorld),n.position.applyMatrix4(b),n.color.copy(a.color).multiplyScalar(a.intensity),n.distance=a.distance,n.decay=a.decay,a.castShadow){const t=a.shadow,n=e.get(a);n.shadowBias=t.bias,n.shadowNormalBias=t.normalBias,n.shadowRadius=t.radius,n.shadowMapSize=t.mapSize,n.shadowCameraNear=t.camera.near,n.shadowCameraFar=t.camera.far,i.pointShadow[p]=n,i.pointShadowMap[p]=S,i.pointShadowMatrix[p]=a.shadow.matrix,y++}i.point[p]=n,p++}else if(a.isHemisphereLight){const e=t.get(a);e.direction.setFromMatrixPosition(a.matrixWorld),e.direction.transformDirection(b),e.direction.normalize(),e.skyColor.copy(a.color).multiplyScalar(w),e.groundColor.copy(a.groundColor).multiplyScalar(w),i.hemi[g]=e,g++}}i.ambient[0]=c,i.ambient[1]=h,i.ambient[2]=u;const w=i.hash;w.directionalLength===d&&w.pointLength===p&&w.spotLength===f&&w.rectAreaLength===m&&w.hemiLength===g&&w.numDirectionalShadows===v&&w.numPointShadows===y&&w.numSpotShadows===x||(i.directional.length=d,i.spot.length=f,i.rectArea.length=m,i.point.length=p,i.hemi.length=g,i.directionalShadow.length=v,i.directionalShadowMap.length=v,i.pointShadow.length=y,i.pointShadowMap.length=y,i.spotShadow.length=x,i.spotShadowMap.length=x,i.directionalShadowMatrix.length=v,i.pointShadowMatrix.length=y,i.spotShadowMatrix.length=x,w.directionalLength=d,w.pointLength=p,w.spotLength=f,w.rectAreaLength=m,w.hemiLength=g,w.numDirectionalShadows=v,w.numPointShadows=y,w.numSpotShadows=x,i.version=Mc++)}return{setup:s,state:i}}function Ec(){const t=new Tc,e=[],i=[];function n(){e.length=0,i.length=0}function r(t){e.push(t)}function o(t){i.push(t)}function s(n){t.setup(e,i,n)}const a={lightsArray:e,shadowsArray:i,lights:t};return{init:n,state:a,setupLights:s,pushLight:r,pushShadow:o}}function Ac(){let t=new WeakMap;function e(i){const n=i.target;n.removeEventListener("dispose",e),t.delete(n)}function i(i,n){let r;return!1===t.has(i)?(r=new Ec,t.set(i,new WeakMap),t.get(i).set(n,r),i.addEventListener("dispose",e)):!1===t.get(i).has(n)?(r=new Ec,t.get(i).set(n,r)):r=t.get(i).get(n),r}function n(){t=new WeakMap}return{get:i,dispose:n}}function Lc(t){Hn.call(this),this.type="MeshDepthMaterial",this.depthPacking=Ze,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(t)}function Cc(t){Hn.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new yi,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(t)}Lc.prototype=Object.create(Hn.prototype),Lc.prototype.constructor=Lc,Lc.prototype.isMeshDepthMaterial=!0,Lc.prototype.copy=function(t){return Hn.prototype.copy.call(this,t),this.depthPacking=t.depthPacking,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},Cc.prototype=Object.create(Hn.prototype),Cc.prototype.constructor=Cc,Cc.prototype.isMeshDistanceMaterial=!0,Cc.prototype.copy=function(t){return Hn.prototype.copy.call(this,t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this};var Pc="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}",Rc="void main() {\n\tgl_Position = vec4( position, 1.0 );\n}";function Oc(t,e,i){let n=new to;const r=new si,o=new si,s=new di,a=[],l=[],h={},m={0:p,1:d,2:f},v=new Wr({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new si},radius:{value:4}},vertexShader:Rc,fragmentShader:Pc}),y=v.clone();y.defines.HORIZONAL_PASS=1;const x=new ur;x.setAttribute("position",new Xn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const b=new Cr(x,v),w=this;function _(i,n){const r=e.update(b);v.uniforms.shadow_pass.value=i.map.texture,v.uniforms.resolution.value=i.mapSize,v.uniforms.radius.value=i.radius,t.setRenderTarget(i.mapPass),t.clear(),t.renderBufferDirect(n,null,r,v,b,null),y.uniforms.shadow_pass.value=i.mapPass.texture,y.uniforms.resolution.value=i.mapSize,y.uniforms.radius.value=i.radius,t.setRenderTarget(i.map),t.clear(),t.renderBufferDirect(n,null,r,y,b,null)}function M(t,e,i){const n=t<<0|e<<1|i<<2;let r=a[n];return void 0===r&&(r=new Lc({depthPacking:Je,morphTargets:t,skinning:e}),a[n]=r),r}function S(t,e,i){const n=t<<0|e<<1|i<<2;let r=l[n];return void 0===r&&(r=new Cc({morphTargets:t,skinning:e}),l[n]=r),r}function T(e,i,n,r,o,s,a){let l=null,c=M,d=e.customDepthMaterial;if(!0===r.isPointLight&&(c=S,d=e.customDistanceMaterial),void 0===d){let t=!1;!0===n.morphTargets&&(t=i.morphAttributes&&i.morphAttributes.position&&i.morphAttributes.position.length>0);let r=!1;!0===e.isSkinnedMesh&&(!0===n.skinning?r=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",e));const o=!0===e.isInstancedMesh;l=c(t,r,o)}else l=d;if(t.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length){const t=l.uuid,e=n.uuid;let i=h[t];void 0===i&&(i={},h[t]=i);let r=i[e];void 0===r&&(r=l.clone(),i[e]=r),l=r}return l.visible=n.visible,l.wireframe=n.wireframe,l.side=a===u?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:m[n.side],l.clipShadows=n.clipShadows,l.clippingPlanes=n.clippingPlanes,l.clipIntersection=n.clipIntersection,l.wireframeLinewidth=n.wireframeLinewidth,l.linewidth=n.linewidth,!0===r.isPointLight&&!0===l.isMeshDistanceMaterial&&(l.referencePosition.setFromMatrixPosition(r.matrixWorld),l.nearDistance=o,l.farDistance=s),l}function E(i,r,o,s,a){if(!1===i.visible)return;const l=i.layers.test(r.layers);if(l&&(i.isMesh||i.isLine||i.isPoints)&&(i.castShadow||i.receiveShadow&&a===u)&&(!i.frustumCulled||n.intersectsObject(i))){i.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,i.matrixWorld);const n=e.update(i),r=i.material;if(Array.isArray(r)){const e=n.groups;for(let l=0,c=e.length;l<c;l++){const c=e[l],h=r[c.materialIndex];if(h&&h.visible){const e=T(i,n,h,s,o.near,o.far,a);t.renderBufferDirect(o,null,n,e,i,c)}}}else if(r.visible){const e=T(i,n,r,s,o.near,o.far,a);t.renderBufferDirect(o,null,n,e,i,null)}}const c=i.children;for(let t=0,e=c.length;t<e;t++)E(c[t],r,o,s,a)}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=c,this.render=function(e,a,l){if(!1===w.enabled)return;if(!1===w.autoUpdate&&!1===w.needsUpdate)return;if(0===e.length)return;const c=t.getRenderTarget(),h=t.getActiveCubeFace(),d=t.getActiveMipmapLevel(),p=t.state;p.setBlending(g),p.buffers.color.setClear(1,1,1,1),p.buffers.depth.setTest(!0),p.setScissorTest(!1);for(let f=0,m=e.length;f<m;f++){const c=e[f],h=c.shadow;if(!1===h.autoUpdate&&!1===h.needsUpdate)continue;if(void 0===h){console.warn("THREE.WebGLShadowMap:",c,"has no shadow.");continue}r.copy(h.mapSize);const d=h.getFrameExtents();if(r.multiply(d),o.copy(h.mapSize),(r.x>i||r.y>i)&&(r.x>i&&(o.x=Math.floor(i/d.x),r.x=o.x*d.x,h.mapSize.x=o.x),r.y>i&&(o.y=Math.floor(i/d.y),r.y=o.y*d.y,h.mapSize.y=o.y)),null===h.map&&!h.isPointLightShadow&&this.type===u){const t={minFilter:ft,magFilter:ft,format:Rt};h.map=new pi(r.x,r.y,t),h.map.texture.name=c.name+".shadowMap",h.mapPass=new pi(r.x,r.y,t),h.camera.updateProjectionMatrix()}if(null===h.map){const t={minFilter:ut,magFilter:ut,format:Rt};h.map=new pi(r.x,r.y,t),h.map.texture.name=c.name+".shadowMap",h.camera.updateProjectionMatrix()}t.setRenderTarget(h.map),t.clear();const m=h.getViewportCount();for(let t=0;t<m;t++){const e=h.getViewport(t);s.set(o.x*e.x,o.y*e.y,o.x*e.z,o.y*e.w),p.viewport(s),h.updateMatrices(c,t),n=h.getFrustum(),E(a,l,h.camera,c,this.type)}h.isPointLightShadow||this.type!==u||_(h,l),h.needsUpdate=!1}w.needsUpdate=!1,t.setRenderTarget(c,h,d)}}function kc(t,e,i){const n=i.isWebGL2;function r(){let e=!1;const i=new di;let n=null;const r=new di(0,0,0,0);return{setMask:function(i){n===i||e||(t.colorMask(i,i,i,i),n=i)},setLocked:function(t){e=t},setClear:function(e,n,o,s,a){!0===a&&(e*=s,n*=s,o*=s),i.set(e,n,o,s),!1===r.equals(i)&&(t.clearColor(e,n,o,s),r.copy(i))},reset:function(){e=!1,n=null,r.set(-1,0,0,0)}}}function o(){let e=!1,i=null,n=null,r=null;return{setTest:function(t){t?vt(2929):yt(2929)},setMask:function(n){i===n||e||(t.depthMask(n),i=n)},setFunc:function(e){if(n!==e){if(e)switch(e){case z:t.depthFunc(512);break;case F:t.depthFunc(519);break;case U:t.depthFunc(513);break;case G:t.depthFunc(515);break;case H:t.depthFunc(514);break;case j:t.depthFunc(518);break;case W:t.depthFunc(516);break;case V:t.depthFunc(517);break;default:t.depthFunc(515)}else t.depthFunc(515);n=e}},setLocked:function(t){e=t},setClear:function(e){r!==e&&(t.clearDepth(e),r=e)},reset:function(){e=!1,i=null,n=null,r=null}}}function c(){let e=!1,i=null,n=null,r=null,o=null,s=null,a=null,l=null,c=null;return{setTest:function(t){e||(t?vt(2960):yt(2960))},setMask:function(n){i===n||e||(t.stencilMask(n),i=n)},setFunc:function(e,i,s){n===e&&r===i&&o===s||(t.stencilFunc(e,i,s),n=e,r=i,o=s)},setOp:function(e,i,n){s===e&&a===i&&l===n||(t.stencilOp(e,i,n),s=e,a=i,l=n)},setLocked:function(t){e=t},setClear:function(e){c!==e&&(t.clearStencil(e),c=e)},reset:function(){e=!1,i=null,n=null,r=null,o=null,s=null,a=null,l=null,c=null}}}const h=new r,u=new o,d=new c;let m={},X=null,Y=null,q=null,Z=null,J=null,K=null,$=null,Q=null,tt=null,et=!1,it=null,nt=null,rt=null,ot=null,st=null;const at=t.getParameter(35661);let lt=!1,ct=0;const ht=t.getParameter(7938);-1!==ht.indexOf("WebGL")?(ct=parseFloat(/^WebGL\ ([0-9])/.exec(ht)[1]),lt=ct>=1):-1!==ht.indexOf("OpenGL ES")&&(ct=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(ht)[1]),lt=ct>=2);let ut=null,dt={};const pt=new di,ft=new di;function mt(e,i,n){const r=new Uint8Array(4),o=t.createTexture();t.bindTexture(e,o),t.texParameteri(e,10241,9728),t.texParameteri(e,10240,9728);for(let s=0;s<n;s++)t.texImage2D(i+s,0,6408,1,1,0,6408,5121,r);return o}const gt={};function vt(e){!0!==m[e]&&(t.enable(e),m[e]=!0)}function yt(e){!1!==m[e]&&(t.disable(e),m[e]=!1)}function xt(e){return X!==e&&(t.useProgram(e),X=e,!0)}gt[3553]=mt(3553,3553,1),gt[34067]=mt(34067,34069,6),h.setClear(0,0,0,1),u.setClear(1),d.setClear(0),vt(2929),u.setFunc(G),St(!1),Tt(a),vt(2884),_t(g);const bt={[_]:32774,[M]:32778,[S]:32779};if(n)bt[T]=32775,bt[E]=32776;else{const t=e.get("EXT_blend_minmax");null!==t&&(bt[T]=t.MIN_EXT,bt[E]=t.MAX_EXT)}const wt={[A]:0,[L]:1,[C]:768,[R]:770,[B]:776,[I]:774,[k]:772,[P]:769,[O]:771,[N]:775,[D]:773};function _t(e,i,n,r,o,s,a,l){if(e!==g){if(Y||(vt(3042),Y=!0),e===w)o=o||i,s=s||n,a=a||r,i===Z&&o===$||(t.blendEquationSeparate(bt[i],bt[o]),Z=i,$=o),n===J&&r===K&&s===Q&&a===tt||(t.blendFuncSeparate(wt[n],wt[r],wt[s],wt[a]),J=n,K=r,Q=s,tt=a),q=e,et=null;else if(e!==q||l!==et){if(Z===_&&$===_||(t.blendEquation(32774),Z=_,$=_),l)switch(e){case v:t.blendFuncSeparate(1,771,1,771);break;case y:t.blendFunc(1,1);break;case x:t.blendFuncSeparate(0,0,769,771);break;case b:t.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",e);break}else switch(e){case v:t.blendFuncSeparate(770,771,1,771);break;case y:t.blendFunc(770,1);break;case x:t.blendFunc(0,769);break;case b:t.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",e);break}J=null,K=null,Q=null,tt=null,q=e,et=l}}else Y&&(yt(3042),Y=!1)}function Mt(t,e){t.side===f?yt(2884):vt(2884);let i=t.side===p;e&&(i=!i),St(i),t.blending===v&&!1===t.transparent?_t(g):_t(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha),u.setFunc(t.depthFunc),u.setTest(t.depthTest),u.setMask(t.depthWrite),h.setMask(t.colorWrite);const n=t.stencilWrite;d.setTest(n),n&&(d.setMask(t.stencilWriteMask),d.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),d.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),At(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)}function St(e){it!==e&&(e?t.frontFace(2304):t.frontFace(2305),it=e)}function Tt(e){e!==s?(vt(2884),e!==nt&&(e===a?t.cullFace(1029):e===l?t.cullFace(1028):t.cullFace(1032))):yt(2884),nt=e}function Et(e){e!==rt&&(lt&&t.lineWidth(e),rt=e)}function At(e,i,n){e?(vt(32823),ot===i&&st===n||(t.polygonOffset(i,n),ot=i,st=n)):yt(32823)}function Lt(t){t?vt(3089):yt(3089)}function Ct(e){void 0===e&&(e=33984+at-1),ut!==e&&(t.activeTexture(e),ut=e)}function Pt(e,i){null===ut&&Ct();let n=dt[ut];void 0===n&&(n={type:void 0,texture:void 0},dt[ut]=n),n.type===e&&n.texture===i||(t.bindTexture(e,i||gt[e]),n.type=e,n.texture=i)}function Rt(){const e=dt[ut];void 0!==e&&void 0!==e.type&&(t.bindTexture(e.type,null),e.type=void 0,e.texture=void 0)}function Ot(){try{t.compressedTexImage2D.apply(t,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function kt(){try{t.texImage2D.apply(t,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function Dt(){try{t.texImage3D.apply(t,arguments)}catch(e){console.error("THREE.WebGLState:",e)}}function It(e){!1===pt.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),pt.copy(e))}function Nt(e){!1===ft.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),ft.copy(e))}function Bt(){m={},ut=null,dt={},X=null,q=null,it=null,nt=null,h.reset(),u.reset(),d.reset()}return{buffers:{color:h,depth:u,stencil:d},enable:vt,disable:yt,useProgram:xt,setBlending:_t,setMaterial:Mt,setFlipSided:St,setCullFace:Tt,setLineWidth:Et,setPolygonOffset:At,setScissorTest:Lt,activeTexture:Ct,bindTexture:Pt,unbindTexture:Rt,compressedTexImage2D:Ot,texImage2D:kt,texImage3D:Dt,scissor:It,viewport:Nt,reset:Bt}}function Dc(t,e,i,n,r,o,s){const a=r.isWebGL2,l=r.maxTextures,c=r.maxCubemapSize,h=r.maxTextureSize,u=r.maxSamples,d=new WeakMap;let p,f=!1;try{f="undefined"!==typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(Q){}function m(t,e){return f?new OffscreenCanvas(t,e):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function g(t,e,i,n){let r=1;if((t.width>n||t.height>n)&&(r=n/Math.max(t.width,t.height)),r<1||!0===e){if("undefined"!==typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&t instanceof ImageBitmap){const n=e?oi.floorPowerOfTwo:Math.floor,o=n(r*t.width),s=n(r*t.height);void 0===p&&(p=m(o,s));const a=i?m(o,s):p;a.width=o,a.height=s;const l=a.getContext("2d");return l.drawImage(t,0,0,o,s),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+o+"x"+s+")."),a}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function v(t){return oi.isPowerOfTwo(t.width)&&oi.isPowerOfTwo(t.height)}function y(t){return!a&&(t.wrapS!==ct||t.wrapT!==ct||t.minFilter!==ut&&t.minFilter!==ft)}function x(t,e){return t.generateMipmaps&&e&&t.minFilter!==ut&&t.minFilter!==ft}function b(e,i,r,o){t.generateMipmap(e);const s=n.get(i);s.__maxMipLevel=Math.log(Math.max(r,o))*Math.LOG2E}function w(i,n,r){if(!1===a)return n;if(null!==i){if(void 0!==t[i])return t[i];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+i+"'")}let o=n;return 6403===n&&(5126===r&&(o=33326),5131===r&&(o=33325),5121===r&&(o=33321)),6407===n&&(5126===r&&(o=34837),5131===r&&(o=34843),5121===r&&(o=32849)),6408===n&&(5126===r&&(o=34836),5131===r&&(o=34842),5121===r&&(o=32856)),33325!==o&&33326!==o&&34842!==o&&34836!==o||e.get("EXT_color_buffer_float"),o}function _(t){return t===ut||t===dt||t===pt?9728:9729}function M(t){const e=t.target;e.removeEventListener("dispose",M),T(e),e.isVideoTexture&&d.delete(e),s.memory.textures--}function S(t){const e=t.target;e.removeEventListener("dispose",S),E(e),s.memory.textures--}function T(e){const i=n.get(e);void 0!==i.__webglInit&&(t.deleteTexture(i.__webglTexture),n.remove(e))}function E(e){const i=n.get(e),r=n.get(e.texture);if(e){if(void 0!==r.__webglTexture&&t.deleteTexture(r.__webglTexture),e.depthTexture&&e.depthTexture.dispose(),e.isWebGLCubeRenderTarget)for(let e=0;e<6;e++)t.deleteFramebuffer(i.__webglFramebuffer[e]),i.__webglDepthbuffer&&t.deleteRenderbuffer(i.__webglDepthbuffer[e]);else t.deleteFramebuffer(i.__webglFramebuffer),i.__webglDepthbuffer&&t.deleteRenderbuffer(i.__webglDepthbuffer),i.__webglMultisampledFramebuffer&&t.deleteFramebuffer(i.__webglMultisampledFramebuffer),i.__webglColorRenderbuffer&&t.deleteRenderbuffer(i.__webglColorRenderbuffer),i.__webglDepthRenderbuffer&&t.deleteRenderbuffer(i.__webglDepthRenderbuffer);n.remove(e.texture),n.remove(e)}}let A=0;function L(){A=0}function C(){const t=A;return t>=l&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+l),A+=1,t}function P(t,e){const r=n.get(t);if(t.isVideoTexture&&q(t),t.version>0&&r.__version!==t.version){const i=t.image;if(void 0===i)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==i.complete)return void F(r,t,e);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}i.activeTexture(33984+e),i.bindTexture(3553,r.__webglTexture)}function R(t,e){const r=n.get(t);t.version>0&&r.__version!==t.version?F(r,t,e):(i.activeTexture(33984+e),i.bindTexture(35866,r.__webglTexture))}function O(t,e){const r=n.get(t);t.version>0&&r.__version!==t.version?F(r,t,e):(i.activeTexture(33984+e),i.bindTexture(32879,r.__webglTexture))}function k(e,r){if(6!==e.image.length)return;const s=n.get(e);if(e.version>0&&s.__version!==e.version){z(s,e),i.activeTexture(33984+r),i.bindTexture(34067,s.__webglTexture),t.pixelStorei(37440,e.flipY);const n=e&&(e.isCompressedTexture||e.image[0].isCompressedTexture),l=e.image[0]&&e.image[0].isDataTexture,h=[];for(let t=0;t<6;t++)h[t]=n||l?l?e.image[t].image:e.image[t]:g(e.image[t],!1,!0,c);const u=h[0],d=v(u)||a,p=o.convert(e.format),f=o.convert(e.type),m=w(e.internalFormat,p,f);let y;if(B(34067,e,d),n){for(let t=0;t<6;t++){y=h[t].mipmaps;for(let n=0;n<y.length;n++){const r=y[n];e.format!==Rt&&e.format!==Pt?null!==p?i.compressedTexImage2D(34069+t,n,m,r.width,r.height,0,r.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):i.texImage2D(34069+t,n,m,r.width,r.height,0,p,f,r.data)}}s.__maxMipLevel=y.length-1}else{y=e.mipmaps;for(let t=0;t<6;t++)if(l){i.texImage2D(34069+t,0,m,h[t].width,h[t].height,0,p,f,h[t].data);for(let e=0;e<y.length;e++){const n=y[e],r=n.image[t].image;i.texImage2D(34069+t,e+1,m,r.width,r.height,0,p,f,r.data)}}else{i.texImage2D(34069+t,0,m,p,f,h[t]);for(let e=0;e<y.length;e++){const n=y[e];i.texImage2D(34069+t,e+1,m,p,f,n.image[t])}}s.__maxMipLevel=y.length}x(e,d)&&b(34067,e,u.width,u.height),s.__version=e.version,e.onUpdate&&e.onUpdate(e)}else i.activeTexture(33984+r),i.bindTexture(34067,s.__webglTexture)}function D(t,e){i.activeTexture(33984+e),i.bindTexture(34067,n.get(t).__webglTexture)}const I={[lt]:10497,[ct]:33071,[ht]:33648},N={[ut]:9728,[dt]:9984,[pt]:9986,[ft]:9729,[mt]:9985,[gt]:9987};function B(i,o,s){s?(t.texParameteri(i,10242,I[o.wrapS]),t.texParameteri(i,10243,I[o.wrapT]),32879!==i&&35866!==i||t.texParameteri(i,32882,I[o.wrapR]),t.texParameteri(i,10240,N[o.magFilter]),t.texParameteri(i,10241,N[o.minFilter])):(t.texParameteri(i,10242,33071),t.texParameteri(i,10243,33071),32879!==i&&35866!==i||t.texParameteri(i,32882,33071),o.wrapS===ct&&o.wrapT===ct||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(i,10240,_(o.magFilter)),t.texParameteri(i,10241,_(o.minFilter)),o.minFilter!==ut&&o.minFilter!==ft&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter."));const l=e.get("EXT_texture_filter_anisotropic");if(l){if(o.type===Mt&&null===e.get("OES_texture_float_linear"))return;if(o.type===St&&null===(a||e.get("OES_texture_half_float_linear")))return;(o.anisotropy>1||n.get(o).__currentAnisotropy)&&(t.texParameterf(i,l.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,r.getMaxAnisotropy())),n.get(o).__currentAnisotropy=o.anisotropy)}}function z(e,i){void 0===e.__webglInit&&(e.__webglInit=!0,i.addEventListener("dispose",M),e.__webglTexture=t.createTexture(),s.memory.textures++)}function F(e,n,r){let s=3553;n.isDataTexture2DArray&&(s=35866),n.isDataTexture3D&&(s=32879),z(e,n),i.activeTexture(33984+r),i.bindTexture(s,e.__webglTexture),t.pixelStorei(37440,n.flipY),t.pixelStorei(37441,n.premultiplyAlpha),t.pixelStorei(3317,n.unpackAlignment);const l=y(n)&&!1===v(n.image),c=g(n.image,l,!1,h),u=v(c)||a,d=o.convert(n.format);let p,f=o.convert(n.type),m=w(n.internalFormat,d,f);B(s,n,u);const _=n.mipmaps;if(n.isDepthTexture)m=6402,a?m=n.type===Mt?36012:n.type===_t?33190:n.type===Lt?35056:33189:n.type===Mt&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),n.format===It&&6402===m&&n.type!==bt&&n.type!==_t&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),n.type=bt,f=o.convert(n.type)),n.format===Nt&&6402===m&&(m=34041,n.type!==Lt&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),n.type=Lt,f=o.convert(n.type))),i.texImage2D(3553,0,m,c.width,c.height,0,d,f,null);else if(n.isDataTexture)if(_.length>0&&u){for(let t=0,e=_.length;t<e;t++)p=_[t],i.texImage2D(3553,t,m,p.width,p.height,0,d,f,p.data);n.generateMipmaps=!1,e.__maxMipLevel=_.length-1}else i.texImage2D(3553,0,m,c.width,c.height,0,d,f,c.data),e.__maxMipLevel=0;else if(n.isCompressedTexture){for(let t=0,e=_.length;t<e;t++)p=_[t],n.format!==Rt&&n.format!==Pt?null!==d?i.compressedTexImage2D(3553,t,m,p.width,p.height,0,p.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):i.texImage2D(3553,t,m,p.width,p.height,0,d,f,p.data);e.__maxMipLevel=_.length-1}else if(n.isDataTexture2DArray)i.texImage3D(35866,0,m,c.width,c.height,c.depth,0,d,f,c.data),e.__maxMipLevel=0;else if(n.isDataTexture3D)i.texImage3D(32879,0,m,c.width,c.height,c.depth,0,d,f,c.data),e.__maxMipLevel=0;else if(_.length>0&&u){for(let t=0,e=_.length;t<e;t++)p=_[t],i.texImage2D(3553,t,m,d,f,p);n.generateMipmaps=!1,e.__maxMipLevel=_.length-1}else i.texImage2D(3553,0,m,d,f,c),e.__maxMipLevel=0;x(n,u)&&b(s,n,c.width,c.height),e.__version=n.version,n.onUpdate&&n.onUpdate(n)}function U(e,r,s,a){const l=o.convert(r.texture.format),c=o.convert(r.texture.type),h=w(r.texture.internalFormat,l,c);i.texImage2D(a,0,h,r.width,r.height,0,l,c,null),t.bindFramebuffer(36160,e),t.framebufferTexture2D(36160,s,a,n.get(r.texture).__webglTexture,0),t.bindFramebuffer(36160,null)}function G(e,i,n){if(t.bindRenderbuffer(36161,e),i.depthBuffer&&!i.stencilBuffer){let r=33189;if(n){const e=i.depthTexture;e&&e.isDepthTexture&&(e.type===Mt?r=36012:e.type===_t&&(r=33190));const n=Y(i);t.renderbufferStorageMultisample(36161,n,r,i.width,i.height)}else t.renderbufferStorage(36161,r,i.width,i.height);t.framebufferRenderbuffer(36160,36096,36161,e)}else if(i.depthBuffer&&i.stencilBuffer){if(n){const e=Y(i);t.renderbufferStorageMultisample(36161,e,35056,i.width,i.height)}else t.renderbufferStorage(36161,34041,i.width,i.height);t.framebufferRenderbuffer(36160,33306,36161,e)}else{const e=o.convert(i.texture.format),r=o.convert(i.texture.type),s=w(i.texture.internalFormat,e,r);if(n){const e=Y(i);t.renderbufferStorageMultisample(36161,e,s,i.width,i.height)}else t.renderbufferStorage(36161,s,i.width,i.height)}t.bindRenderbuffer(36161,null)}function H(e,i){const r=i&&i.isWebGLCubeRenderTarget;if(r)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,e),!i.depthTexture||!i.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");n.get(i.depthTexture).__webglTexture&&i.depthTexture.image.width===i.width&&i.depthTexture.image.height===i.height||(i.depthTexture.image.width=i.width,i.depthTexture.image.height=i.height,i.depthTexture.needsUpdate=!0),P(i.depthTexture,0);const o=n.get(i.depthTexture).__webglTexture;if(i.depthTexture.format===It)t.framebufferTexture2D(36160,36096,3553,o,0);else{if(i.depthTexture.format!==Nt)throw new Error("Unknown depthTexture format");t.framebufferTexture2D(36160,33306,3553,o,0)}}function j(e){const i=n.get(e),r=!0===e.isWebGLCubeRenderTarget;if(e.depthTexture){if(r)throw new Error("target.depthTexture not supported in Cube render targets");H(i.__webglFramebuffer,e)}else if(r){i.__webglDepthbuffer=[];for(let n=0;n<6;n++)t.bindFramebuffer(36160,i.__webglFramebuffer[n]),i.__webglDepthbuffer[n]=t.createRenderbuffer(),G(i.__webglDepthbuffer[n],e,!1)}else t.bindFramebuffer(36160,i.__webglFramebuffer),i.__webglDepthbuffer=t.createRenderbuffer(),G(i.__webglDepthbuffer,e,!1);t.bindFramebuffer(36160,null)}function W(e){const r=n.get(e),l=n.get(e.texture);e.addEventListener("dispose",S),l.__webglTexture=t.createTexture(),s.memory.textures++;const c=!0===e.isWebGLCubeRenderTarget,h=!0===e.isWebGLMultisampleRenderTarget,u=v(e)||a;if(!a||e.texture.format!==Pt||e.texture.type!==Mt&&e.texture.type!==St||(e.texture.format=Rt,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),c){r.__webglFramebuffer=[];for(let e=0;e<6;e++)r.__webglFramebuffer[e]=t.createFramebuffer()}else if(r.__webglFramebuffer=t.createFramebuffer(),h)if(a){r.__webglMultisampledFramebuffer=t.createFramebuffer(),r.__webglColorRenderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,r.__webglColorRenderbuffer);const i=o.convert(e.texture.format),n=o.convert(e.texture.type),s=w(e.texture.internalFormat,i,n),a=Y(e);t.renderbufferStorageMultisample(36161,a,s,e.width,e.height),t.bindFramebuffer(36160,r.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(36160,36064,36161,r.__webglColorRenderbuffer),t.bindRenderbuffer(36161,null),e.depthBuffer&&(r.__webglDepthRenderbuffer=t.createRenderbuffer(),G(r.__webglDepthRenderbuffer,e,!0)),t.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(c){i.bindTexture(34067,l.__webglTexture),B(34067,e.texture,u);for(let t=0;t<6;t++)U(r.__webglFramebuffer[t],e,36064,34069+t);x(e.texture,u)&&b(34067,e.texture,e.width,e.height),i.bindTexture(34067,null)}else i.bindTexture(3553,l.__webglTexture),B(3553,e.texture,u),U(r.__webglFramebuffer,e,36064,3553),x(e.texture,u)&&b(3553,e.texture,e.width,e.height),i.bindTexture(3553,null);e.depthBuffer&&j(e)}function V(t){const e=t.texture,r=v(t)||a;if(x(e,r)){const r=t.isWebGLCubeRenderTarget?34067:3553,o=n.get(e).__webglTexture;i.bindTexture(r,o),b(r,e,t.width,t.height),i.bindTexture(r,null)}}function X(e){if(e.isWebGLMultisampleRenderTarget)if(a){const i=n.get(e);t.bindFramebuffer(36008,i.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,i.__webglFramebuffer);const r=e.width,o=e.height;let s=16384;e.depthBuffer&&(s|=256),e.stencilBuffer&&(s|=1024),t.blitFramebuffer(0,0,r,o,0,0,r,o,s,9728),t.bindFramebuffer(36160,i.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")}function Y(t){return a&&t.isWebGLMultisampleRenderTarget?Math.min(u,t.samples):0}function q(t){const e=s.render.frame;d.get(t)!==e&&(d.set(t,e),t.update())}let Z=!1,J=!1;function K(t,e){t&&t.isWebGLRenderTarget&&(!1===Z&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),Z=!0),t=t.texture),P(t,e)}function $(t,e){t&&t.isWebGLCubeRenderTarget&&(!1===J&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),J=!0),t=t.texture),t&&t.isCubeTexture||Array.isArray(t.image)&&6===t.image.length?k(t,e):D(t,e)}this.allocateTextureUnit=C,this.resetTextureUnits=L,this.setTexture2D=P,this.setTexture2DArray=R,this.setTexture3D=O,this.setTextureCube=k,this.setTextureCubeDynamic=D,this.setupRenderTarget=W,this.updateRenderTargetMipmap=V,this.updateMultisampleRenderTarget=X,this.safeSetTexture2D=K,this.safeSetTextureCube=$}function Ic(t,e,i){const n=i.isWebGL2;function r(t){let i;if(t===vt)return 5121;if(t===Tt)return 32819;if(t===Et)return 32820;if(t===At)return 33635;if(t===yt)return 5120;if(t===xt)return 5122;if(t===bt)return 5123;if(t===wt)return 5124;if(t===_t)return 5125;if(t===Mt)return 5126;if(t===St)return n?5131:(i=e.get("OES_texture_half_float"),null!==i?i.HALF_FLOAT_OES:null);if(t===Ct)return 6406;if(t===Pt)return 6407;if(t===Rt)return 6408;if(t===Ot)return 6409;if(t===kt)return 6410;if(t===It)return 6402;if(t===Nt)return 34041;if(t===Bt)return 6403;if(t===zt)return 36244;if(t===Ft)return 33319;if(t===Ut)return 33320;if(t===Gt)return 36248;if(t===Ht)return 36249;if(t===jt||t===Wt||t===Vt||t===Xt){if(i=e.get("WEBGL_compressed_texture_s3tc"),null===i)return null;if(t===jt)return i.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===Wt)return i.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===Vt)return i.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===Xt)return i.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(t===Yt||t===qt||t===Zt||t===Jt){if(i=e.get("WEBGL_compressed_texture_pvrtc"),null===i)return null;if(t===Yt)return i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(t===qt)return i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(t===Zt)return i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(t===Jt)return i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(t===Kt)return i=e.get("WEBGL_compressed_texture_etc1"),null!==i?i.COMPRESSED_RGB_ETC1_WEBGL:null;if((t===$t||t===Qt)&&(i=e.get("WEBGL_compressed_texture_etc"),null!==i)){if(t===$t)return i.COMPRESSED_RGB8_ETC2;if(t===Qt)return i.COMPRESSED_RGBA8_ETC2_EAC}return t===te||t===ee||t===ie||t===ne||t===re||t===oe||t===se||t===ae||t===le||t===ce||t===he||t===ue||t===de||t===pe||t===me||t===ge||t===ve||t===ye||t===xe||t===be||t===we||t===_e||t===Me||t===Se||t===Te||t===Ee||t===Ae||t===Le?(i=e.get("WEBGL_compressed_texture_astc"),null!==i?t:null):t===fe?(i=e.get("EXT_texture_compression_bptc"),null!==i?t:null):t===Lt?n?34042:(i=e.get("WEBGL_depth_texture"),null!==i?i.UNSIGNED_INT_24_8_WEBGL:null):void 0}return{convert:r}}function Nc(t){Xr.call(this),this.cameras=t||[]}function Bc(){Wi.call(this),this.type="Group"}function zc(){this._targetRay=null,this._grip=null}function Fc(t,e){const i=this;let n=null,r=1,o=null,s="local-floor",a=null;const l=[],c=new Map,h=new Xr;h.layers.enable(1),h.viewport=new di;const u=new Xr;u.layers.enable(2),u.viewport=new di;const d=[h,u],p=new Nc;p.layers.enable(1),p.layers.enable(2);let f=null,m=null;function g(t){const e=c.get(t.inputSource);e&&e.dispatchEvent({type:t.type})}function v(){c.forEach((function(t,e){t.disconnect(e)})),c.clear(),t.setFramebuffer(null),t.setRenderTarget(t.getRenderTarget()),E.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}function y(t){o=t,E.setContext(n),E.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}function x(t){const e=n.inputSources;for(let i=0;i<l.length;i++)c.set(e[i],l[i]);for(let i=0;i<t.removed.length;i++){const e=t.removed[i],n=c.get(e);n&&(n.dispatchEvent({type:"disconnected",data:e}),c.delete(e))}for(let i=0;i<t.added.length;i++){const e=t.added[i],n=c.get(e);n&&n.dispatchEvent({type:"connected",data:e})}}this.enabled=!1,this.isPresenting=!1,this.getController=function(t){let e=l[t];return void 0===e&&(e=new zc,l[t]=e),e.getTargetRaySpace()},this.getControllerGrip=function(t){let e=l[t];return void 0===e&&(e=new zc,l[t]=e),e.getGripSpace()},this.setFramebufferScaleFactor=function(t){r=t,!0===i.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(t){s=t,!0===i.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return o},this.getSession=function(){return n},this.setSession=function(t){if(n=t,null!==n){n.addEventListener("select",g),n.addEventListener("selectstart",g),n.addEventListener("selectend",g),n.addEventListener("squeeze",g),n.addEventListener("squeezestart",g),n.addEventListener("squeezeend",g),n.addEventListener("end",v);const t=e.getContextAttributes();!0!==t.xrCompatible&&e.makeXRCompatible();const i={antialias:t.antialias,alpha:t.alpha,depth:t.depth,stencil:t.stencil,framebufferScaleFactor:r},o=new XRWebGLLayer(n,e,i);n.updateRenderState({baseLayer:o}),n.requestReferenceSpace(s).then(y),n.addEventListener("inputsourceschange",x)}};const b=new yi,w=new yi;function _(t,e,i){b.setFromMatrixPosition(e.matrixWorld),w.setFromMatrixPosition(i.matrixWorld);const n=b.distanceTo(w),r=e.projectionMatrix.elements,o=i.projectionMatrix.elements,s=r[14]/(r[10]-1),a=r[14]/(r[10]+1),l=(r[9]+1)/r[5],c=(r[9]-1)/r[5],h=(r[8]-1)/r[0],u=(o[8]+1)/o[0],d=s*h,p=s*u,f=n/(-h+u),m=f*-h;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(m),t.translateZ(f),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);const g=s+f,v=a+f,y=d-m,x=p+(n-m),_=l*a/v*g,M=c*a/v*g;t.projectionMatrix.makePerspective(y,x,_,M,g,v)}function M(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.getInverse(t.matrixWorld)}this.getCamera=function(t){p.near=u.near=h.near=t.near,p.far=u.far=h.far=t.far,f===p.near&&m===p.far||(n.updateRenderState({depthNear:p.near,depthFar:p.far}),f=p.near,m=p.far);const e=t.parent,i=p.cameras;M(p,e);for(let n=0;n<i.length;n++)M(i[n],e);t.matrixWorld.copy(p.matrixWorld);const r=t.children;for(let n=0,o=r.length;n<o;n++)r[n].updateMatrixWorld(!0);return 2===i.length?_(p,h,u):p.projectionMatrix.copy(h.projectionMatrix),p};let S=null;function T(e,i){if(a=i.getViewerPose(o),null!==a){const e=a.views,i=n.renderState.baseLayer;t.setFramebuffer(i.framebuffer);let r=!1;e.length!==p.cameras.length&&(p.cameras.length=0,r=!0);for(let t=0;t<e.length;t++){const n=e[t],o=i.getViewport(n),s=d[t];s.matrix.fromArray(n.transform.matrix),s.projectionMatrix.fromArray(n.projectionMatrix),s.viewport.set(o.x,o.y,o.width,o.height),0===t&&p.matrix.copy(s.matrix),!0===r&&p.cameras.push(s)}}const r=n.inputSources;for(let t=0;t<l.length;t++){const e=l[t],n=r[t];e.update(n,i,o)}S&&S(e,i)}const E=new io;E.setAnimationLoop(T),this.setAnimationLoop=function(t){S=t},this.dispose=function(){}}function Uc(t){function e(t,e){t.fogColor.value.copy(e.color),e.isFog?(t.fogNear.value=e.near,t.fogFar.value=e.far):e.isFogExp2&&(t.fogDensity.value=e.density)}function i(t,e,i,p,y){e.isMeshBasicMaterial?n(t,e):e.isMeshLambertMaterial?(n(t,e),l(t,e)):e.isMeshToonMaterial?(n(t,e),h(t,e)):e.isMeshPhongMaterial?(n(t,e),c(t,e)):e.isMeshStandardMaterial?(n(t,e,i),e.isMeshPhysicalMaterial?d(t,e,i):u(t,e,i)):e.isMeshMatcapMaterial?(n(t,e),f(t,e)):e.isMeshDepthMaterial?(n(t,e),m(t,e)):e.isMeshDistanceMaterial?(n(t,e),g(t,e)):e.isMeshNormalMaterial?(n(t,e),v(t,e)):e.isLineBasicMaterial?(r(t,e),e.isLineDashedMaterial&&o(t,e)):e.isPointsMaterial?s(t,e,p,y):e.isSpriteMaterial?a(t,e):e.isShadowMaterial?(t.color.value.copy(e.color),t.opacity.value=e.opacity):e.isShaderMaterial&&(e.uniformsNeedUpdate=!1)}function n(e,i,n){e.opacity.value=i.opacity,i.color&&e.diffuse.value.copy(i.color),i.emissive&&e.emissive.value.copy(i.emissive).multiplyScalar(i.emissiveIntensity),i.map&&(e.map.value=i.map),i.alphaMap&&(e.alphaMap.value=i.alphaMap),i.specularMap&&(e.specularMap.value=i.specularMap);const r=i.envMap||n;let o,s;r&&(e.envMap.value=r,e.flipEnvMap.value=r.isCubeTexture?-1:1,e.reflectivity.value=i.reflectivity,e.refractionRatio.value=i.refractionRatio,e.maxMipLevel.value=t.get(r).__maxMipLevel),i.lightMap&&(e.lightMap.value=i.lightMap,e.lightMapIntensity.value=i.lightMapIntensity),i.aoMap&&(e.aoMap.value=i.aoMap,e.aoMapIntensity.value=i.aoMapIntensity),i.map?o=i.map:i.specularMap?o=i.specularMap:i.displacementMap?o=i.displacementMap:i.normalMap?o=i.normalMap:i.bumpMap?o=i.bumpMap:i.roughnessMap?o=i.roughnessMap:i.metalnessMap?o=i.metalnessMap:i.alphaMap?o=i.alphaMap:i.emissiveMap&&(o=i.emissiveMap),void 0!==o&&(o.isWebGLRenderTarget&&(o=o.texture),!0===o.matrixAutoUpdate&&o.updateMatrix(),e.uvTransform.value.copy(o.matrix)),i.aoMap?s=i.aoMap:i.lightMap&&(s=i.lightMap),void 0!==s&&(s.isWebGLRenderTarget&&(s=s.texture),!0===s.matrixAutoUpdate&&s.updateMatrix(),e.uv2Transform.value.copy(s.matrix))}function r(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity}function o(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}function s(t,e,i,n){let r;t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*i,t.scale.value=.5*n,e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.map?r=e.map:e.alphaMap&&(r=e.alphaMap),void 0!==r&&(!0===r.matrixAutoUpdate&&r.updateMatrix(),t.uvTransform.value.copy(r.matrix))}function a(t,e){let i;t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.map?i=e.map:e.alphaMap&&(i=e.alphaMap),void 0!==i&&(!0===i.matrixAutoUpdate&&i.updateMatrix(),t.uvTransform.value.copy(i.matrix))}function l(t,e){e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap)}function c(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===p&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===p&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function h(t,e){e.gradientMap&&(t.gradientMap.value=e.gradientMap),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===p&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===p&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function u(t,e,i){t.roughness.value=e.roughness,t.metalness.value=e.metalness,e.roughnessMap&&(t.roughnessMap.value=e.roughnessMap),e.metalnessMap&&(t.metalnessMap.value=e.metalnessMap),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===p&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===p&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),(e.envMap||i)&&(t.envMapIntensity.value=e.envMapIntensity)}function d(t,e,i){u(t,e,i),t.reflectivity.value=e.reflectivity,t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.sheen&&t.sheen.value.copy(e.sheen),e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap),e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap),e.clearcoatNormalMap&&(t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),t.clearcoatNormalMap.value=e.clearcoatNormalMap,e.side===p&&t.clearcoatNormalScale.value.negate()),t.transparency.value=e.transparency}function f(t,e){e.matcap&&(t.matcap.value=e.matcap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===p&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===p&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function m(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function g(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),t.referencePosition.value.copy(e.referencePosition),t.nearDistance.value=e.nearDistance,t.farDistance.value=e.farDistance}function v(t,e){e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===p&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===p&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}return{refreshFogUniforms:e,refreshMaterialUniforms:i}}function Gc(t){t=t||{};const e=void 0!==t.canvas?t.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),i=void 0!==t.context?t.context:null,n=void 0!==t.alpha&&t.alpha,r=void 0===t.depth||t.depth,o=void 0===t.stencil||t.stencil,s=void 0!==t.antialias&&t.antialias,a=void 0===t.premultipliedAlpha||t.premultipliedAlpha,l=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,c=void 0!==t.powerPreference?t.powerPreference:"default",h=void 0!==t.failIfMajorPerformanceCaveat&&t.failIfMajorPerformanceCaveat;let u=null,d=null;this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=Ge,this.physicallyCorrectLights=!1,this.toneMapping=Z,this.toneMappingExposure=1,this.maxMorphTargets=8,this.maxMorphNormals=4;const p=this;let f=!1,m=null,g=0,v=0,y=null,x=null,b=-1,w=null,_=null;const M=new di,S=new di;let T=null,E=e.width,A=e.height,L=1,C=null,P=null;const R=new di(0,0,E,A),O=new di(0,0,E,A);let k=!1;const D=new to,I=new Oa;let N=!1,B=!1;const z=new Ei,F=new yi,U={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function G(){return null===y?L:1}let H,j,W,V,X,Y,q,J,K,$,Q,tt,et,it,nt,rt,ot,st,at,lt=i;function ct(t,i){for(let n=0;n<t.length;n++){const r=t[n],o=e.getContext(r,i);if(null!==o)return o}return null}try{const t={alpha:n,depth:r,stencil:o,antialias:s,premultipliedAlpha:a,preserveDrawingBuffer:l,powerPreference:c,failIfMajorPerformanceCaveat:h};if(e.addEventListener("webglcontextlost",pt,!1),e.addEventListener("webglcontextrestored",ft,!1),null===lt){const e=["webgl2","webgl","experimental-webgl"];if(!0===p.isWebGL1Renderer&&e.shift(),lt=ct(e,t),null===lt)throw ct(e)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}void 0===lt.getShaderPrecisionFormat&&(lt.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(kt){throw console.error("THREE.WebGLRenderer: "+kt.message),kt}function ht(){H=new ka(lt),j=new Ra(lt,H,t),!1===j.isWebGL2&&(H.get("WEBGL_depth_texture"),H.get("OES_texture_float"),H.get("OES_texture_half_float"),H.get("OES_texture_half_float_linear"),H.get("OES_standard_derivatives"),H.get("OES_element_index_uint"),H.get("OES_vertex_array_object"),H.get("ANGLE_instanced_arrays")),H.get("OES_texture_float_linear"),st=new Ic(lt,H,j),W=new kc(lt,H,j),W.scissor(S.copy(O).multiplyScalar(L).floor()),W.viewport(M.copy(R).multiplyScalar(L).floor()),V=new Na(lt),X=new gc,Y=new Dc(lt,H,W,X,j,st,V),q=new no(lt,j),at=new Ca(lt,H,q,j),J=new Da(lt,q,V,at),K=new Ua(lt,J,q,V),nt=new Fa(lt),$=new mc(p,H,j,at),Q=new Uc(X),tt=new bc,et=new Ac,it=new La(p,W,K,a),rt=new Pa(lt,H,V,j),ot=new Ia(lt,H,V,j),V.programs=$.programs,p.capabilities=j,p.extensions=H,p.properties=X,p.renderLists=tt,p.state=W,p.info=V}ht();const ut=new Fc(p,lt);this.xr=ut;const dt=new Oc(p,K,j.maxTextureSize);function pt(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),f=!0}function ft(){console.log("THREE.WebGLRenderer: Context Restored."),f=!1,ht()}function mt(t){const e=t.target;e.removeEventListener("dispose",mt),gt(e)}function gt(t){yt(t),X.remove(t)}function yt(t){const e=X.get(t).program;t.program=void 0,void 0!==e&&$.releaseProgram(e)}function xt(t,e){t.render((function(t){p.renderBufferImmediate(t,e)}))}this.shadowMap=dt,this.getContext=function(){return lt},this.getContextAttributes=function(){return lt.getContextAttributes()},this.forceContextLoss=function(){const t=H.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){const t=H.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return L},this.setPixelRatio=function(t){void 0!==t&&(L=t,this.setSize(E,A,!1))},this.getSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),t=new si),t.set(E,A)},this.setSize=function(t,i,n){ut.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(E=t,A=i,e.width=Math.floor(t*L),e.height=Math.floor(i*L),!1!==n&&(e.style.width=t+"px",e.style.height=i+"px"),this.setViewport(0,0,t,i))},this.getDrawingBufferSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),t=new si),t.set(E*L,A*L).floor()},this.setDrawingBufferSize=function(t,i,n){E=t,A=i,L=n,e.width=Math.floor(t*n),e.height=Math.floor(i*n),this.setViewport(0,0,t,i)},this.getCurrentViewport=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),t=new di),t.copy(M)},this.getViewport=function(t){return t.copy(R)},this.setViewport=function(t,e,i,n){t.isVector4?R.set(t.x,t.y,t.z,t.w):R.set(t,e,i,n),W.viewport(M.copy(R).multiplyScalar(L).floor())},this.getScissor=function(t){return t.copy(O)},this.setScissor=function(t,e,i,n){t.isVector4?O.set(t.x,t.y,t.z,t.w):O.set(t,e,i,n),W.scissor(S.copy(O).multiplyScalar(L).floor())},this.getScissorTest=function(){return k},this.setScissorTest=function(t){W.setScissorTest(k=t)},this.setOpaqueSort=function(t){C=t},this.setTransparentSort=function(t){P=t},this.getClearColor=function(){return it.getClearColor()},this.setClearColor=function(){it.setClearColor.apply(it,arguments)},this.getClearAlpha=function(){return it.getClearAlpha()},this.setClearAlpha=function(){it.setClearAlpha.apply(it,arguments)},this.clear=function(t,e,i){let n=0;(void 0===t||t)&&(n|=16384),(void 0===e||e)&&(n|=256),(void 0===i||i)&&(n|=1024),lt.clear(n)},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(){e.removeEventListener("webglcontextlost",pt,!1),e.removeEventListener("webglcontextrestored",ft,!1),tt.dispose(),et.dispose(),X.dispose(),K.dispose(),at.dispose(),ut.dispose(),_t.stop()},this.renderBufferImmediate=function(t,e){at.initAttributes();const i=X.get(t);t.hasPositions&&!i.position&&(i.position=lt.createBuffer()),t.hasNormals&&!i.normal&&(i.normal=lt.createBuffer()),t.hasUvs&&!i.uv&&(i.uv=lt.createBuffer()),t.hasColors&&!i.color&&(i.color=lt.createBuffer());const n=e.getAttributes();t.hasPositions&&(lt.bindBuffer(34962,i.position),lt.bufferData(34962,t.positionArray,35048),at.enableAttribute(n.position),lt.vertexAttribPointer(n.position,3,5126,!1,0,0)),t.hasNormals&&(lt.bindBuffer(34962,i.normal),lt.bufferData(34962,t.normalArray,35048),at.enableAttribute(n.normal),lt.vertexAttribPointer(n.normal,3,5126,!1,0,0)),t.hasUvs&&(lt.bindBuffer(34962,i.uv),lt.bufferData(34962,t.uvArray,35048),at.enableAttribute(n.uv),lt.vertexAttribPointer(n.uv,2,5126,!1,0,0)),t.hasColors&&(lt.bindBuffer(34962,i.color),lt.bufferData(34962,t.colorArray,35048),at.enableAttribute(n.color),lt.vertexAttribPointer(n.color,3,5126,!1,0,0)),at.disableUnusedAttributes(),lt.drawArrays(4,0,t.count),t.count=0},this.renderBufferDirect=function(t,e,i,n,r,o){null===e&&(e=U);const s=r.isMesh&&r.matrixWorld.determinant()<0,a=Ct(t,e,n,r);W.setMaterial(n,s);let l=i.index;const c=i.attributes.position;if(null===l){if(void 0===c||0===c.count)return}else if(0===l.count)return;let h,u=1;!0===n.wireframe&&(l=J.getWireframeAttribute(i),u=2),(n.morphTargets||n.morphNormals)&&nt.update(r,i,n,a),at.setup(r,n,a,i,l);let d=rt;null!==l&&(h=q.get(l),d=ot,d.setIndex(h));const p=null!==l?l.count:c.count,f=i.drawRange.start*u,m=i.drawRange.count*u,g=null!==o?o.start*u:0,v=null!==o?o.count*u:1/0,y=Math.max(f,g),x=Math.min(p,f+m,g+v)-1,b=Math.max(0,x-y+1);if(0!==b){if(r.isMesh)!0===n.wireframe?(W.setLineWidth(n.wireframeLinewidth*G()),d.setMode(1)):d.setMode(4);else if(r.isLine){let t=n.linewidth;void 0===t&&(t=1),W.setLineWidth(t*G()),r.isLineSegments?d.setMode(1):r.isLineLoop?d.setMode(2):d.setMode(3)}else r.isPoints?d.setMode(0):r.isSprite&&d.setMode(4);if(r.isInstancedMesh)d.renderInstances(i,y,b,r.count);else if(i.isInstancedBufferGeometry){const t=Math.min(i.instanceCount,i._maxInstanceCount);d.renderInstances(i,y,b,t)}else d.render(y,b)}},this.compile=function(t,e){d=et.get(t,e),d.init(),t.traverse((function(t){t.isLight&&(d.pushLight(t),t.castShadow&&d.pushShadow(t))})),d.setupLights(e);const i=new WeakMap;t.traverse((function(e){let n=e.material;if(n)if(Array.isArray(n))for(let r=0;r<n.length;r++){let o=n[r];!1===i.has(o)&&(Lt(o,t,e),i.set(o))}else!1===i.has(n)&&(Lt(n,t,e),i.set(n))}))};let bt=null;function wt(t){ut.isPresenting||bt&&bt(t)}const _t=new io;function Tt(t,e,i,n){if(!1===t.visible)return;const r=t.layers.test(e.layers);if(r)if(t.isGroup)i=t.renderOrder;else if(t.isLOD)!0===t.autoUpdate&&t.update(e);else if(t.isLight)d.pushLight(t),t.castShadow&&d.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||D.intersectsSprite(t)){n&&F.setFromMatrixPosition(t.matrixWorld).applyMatrix4(z);const e=K.update(t),r=t.material;r.visible&&u.push(t,e,r,i,F.z,null)}}else if(t.isImmediateRenderObject)n&&F.setFromMatrixPosition(t.matrixWorld).applyMatrix4(z),u.push(t,null,t.material,i,F.z,null);else if((t.isMesh||t.isLine||t.isPoints)&&(t.isSkinnedMesh&&t.skeleton.frame!==V.render.frame&&(t.skeleton.update(),t.skeleton.frame=V.render.frame),!t.frustumCulled||D.intersectsObject(t))){n&&F.setFromMatrixPosition(t.matrixWorld).applyMatrix4(z);const e=K.update(t),r=t.material;if(Array.isArray(r)){const n=e.groups;for(let o=0,s=n.length;o<s;o++){const s=n[o],a=r[s.materialIndex];a&&a.visible&&u.push(t,e,a,i,F.z,s)}}else r.visible&&u.push(t,e,r,i,F.z,null)}const o=t.children;for(let s=0,a=o.length;s<a;s++)Tt(o[s],e,i,n)}function Et(t,e,i){const n=!0===e.isScene?e.overrideMaterial:null;for(let r=0,o=t.length;r<o;r++){const o=t[r],s=o.object,a=o.geometry,l=null===n?o.material:n,c=o.group;if(i.isArrayCamera){_=i;const t=i.cameras;for(let i=0,n=t.length;i<n;i++){const n=t[i];s.layers.test(n.layers)&&(W.viewport(M.copy(n.viewport)),d.setupLights(n),At(s,e,n,a,l,c))}}else _=null,At(s,e,i,a,l,c)}}function At(t,e,i,n,r,o){if(t.onBeforeRender(p,e,i,n,r,o),d=et.get(e,_||i),t.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),t.isImmediateRenderObject){const n=Ct(i,e,r,t);W.setMaterial(r),at.reset(),xt(t,n)}else p.renderBufferDirect(i,e,n,r,t,o);t.onAfterRender(p,e,i,n,r,o),d=et.get(e,_||i)}function Lt(t,e,i){!0!==e.isScene&&(e=U);const n=X.get(t),r=d.state.lights,o=d.state.shadowsArray,s=r.state.version,a=$.getParameters(t,r.state,o,e,I.numPlanes,I.numIntersection,i),l=$.getProgramCacheKey(a);let c=n.program,h=!0;if(void 0===c)t.addEventListener("dispose",mt);else if(c.cacheKey!==l)yt(t);else if(n.lightsStateVersion!==s)n.lightsStateVersion=s,h=!1;else{if(void 0!==a.shaderID)return;h=!1}h&&(c=$.acquireProgram(a,l),n.program=c,n.uniforms=a.uniforms,n.outputEncoding=a.outputEncoding,t.program=c);const u=c.getAttributes();if(t.morphTargets){t.numSupportedMorphTargets=0;for(let e=0;e<p.maxMorphTargets;e++)u["morphTarget"+e]>=0&&t.numSupportedMorphTargets++}if(t.morphNormals){t.numSupportedMorphNormals=0;for(let e=0;e<p.maxMorphNormals;e++)u["morphNormal"+e]>=0&&t.numSupportedMorphNormals++}const f=n.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(n.numClippingPlanes=I.numPlanes,n.numIntersection=I.numIntersection,f.clippingPlanes=I.uniform),n.environment=t.isMeshStandardMaterial?e.environment:null,n.fog=e.fog,n.needsLights=Ot(t),n.lightsStateVersion=s,n.needsLights&&(f.ambientLightColor.value=r.state.ambient,f.lightProbe.value=r.state.probe,f.directionalLights.value=r.state.directional,f.directionalLightShadows.value=r.state.directionalShadow,f.spotLights.value=r.state.spot,f.spotLightShadows.value=r.state.spotShadow,f.rectAreaLights.value=r.state.rectArea,f.pointLights.value=r.state.point,f.pointLightShadows.value=r.state.pointShadow,f.hemisphereLights.value=r.state.hemi,f.directionalShadowMap.value=r.state.directionalShadowMap,f.directionalShadowMatrix.value=r.state.directionalShadowMatrix,f.spotShadowMap.value=r.state.spotShadowMap,f.spotShadowMatrix.value=r.state.spotShadowMatrix,f.pointShadowMap.value=r.state.pointShadowMap,f.pointShadowMatrix.value=r.state.pointShadowMatrix);const m=n.program.getUniforms(),g=Ul.seqWithValue(m.seq,f);n.uniformsList=g}function Ct(t,e,i,n){!0!==e.isScene&&(e=U),Y.resetTextureUnits();const r=e.fog,o=i.isMeshStandardMaterial?e.environment:null,s=null===y?p.outputEncoding:y.texture.encoding,a=X.get(i),l=d.state.lights;if(!0===N&&(!0===B||t!==w)){const e=t===w&&i.id===b;I.setState(i.clippingPlanes,i.clipIntersection,i.clipShadows,t,a,e)}i.version===a.__version?void 0===a.program||i.fog&&a.fog!==r||a.environment!==o||a.needsLights&&a.lightsStateVersion!==l.state.version?Lt(i,e,n):void 0===a.numClippingPlanes||a.numClippingPlanes===I.numPlanes&&a.numIntersection===I.numIntersection?a.outputEncoding!==s&&Lt(i,e,n):Lt(i,e,n):(Lt(i,e,n),a.__version=i.version);let c=!1,h=!1,u=!1;const f=a.program,m=f.getUniforms(),g=a.uniforms;if(W.useProgram(f.program)&&(c=!0,h=!0,u=!0),i.id!==b&&(b=i.id,h=!0),c||w!==t){if(m.setValue(lt,"projectionMatrix",t.projectionMatrix),j.logarithmicDepthBuffer&&m.setValue(lt,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),w!==t&&(w=t,h=!0,u=!0),i.isShaderMaterial||i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshStandardMaterial||i.envMap){const e=m.map.cameraPosition;void 0!==e&&e.setValue(lt,F.setFromMatrixPosition(t.matrixWorld))}(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial)&&m.setValue(lt,"isOrthographic",!0===t.isOrthographicCamera),(i.isMeshPhongMaterial||i.isMeshToonMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial||i.isShadowMaterial||i.skinning)&&m.setValue(lt,"viewMatrix",t.matrixWorldInverse)}if(i.skinning){m.setOptional(lt,n,"bindMatrix"),m.setOptional(lt,n,"bindMatrixInverse");const t=n.skeleton;if(t){const e=t.bones;if(j.floatVertexTextures){if(void 0===t.boneTexture){let i=Math.sqrt(4*e.length);i=oi.ceilPowerOfTwo(i),i=Math.max(i,4);const n=new Float32Array(i*i*4);n.set(t.boneMatrices);const r=new Kr(n,i,i,Rt,Mt);t.boneMatrices=n,t.boneTexture=r,t.boneTextureSize=i}m.setValue(lt,"boneTexture",t.boneTexture,Y),m.setValue(lt,"boneTextureSize",t.boneTextureSize)}else m.setOptional(lt,t,"boneMatrices")}}return(h||a.receiveShadow!==n.receiveShadow)&&(a.receiveShadow=n.receiveShadow,m.setValue(lt,"receiveShadow",n.receiveShadow)),h&&(m.setValue(lt,"toneMappingExposure",p.toneMappingExposure),a.needsLights&&Pt(g,u),r&&i.fog&&Q.refreshFogUniforms(g,r),Q.refreshMaterialUniforms(g,i,o,L,A),void 0!==g.ltc_1&&(g.ltc_1.value=eo.LTC_1),void 0!==g.ltc_2&&(g.ltc_2.value=eo.LTC_2),Ul.upload(lt,a.uniformsList,g,Y)),i.isShaderMaterial&&!0===i.uniformsNeedUpdate&&(Ul.upload(lt,a.uniformsList,g,Y),i.uniformsNeedUpdate=!1),i.isSpriteMaterial&&m.setValue(lt,"center",n.center),m.setValue(lt,"modelViewMatrix",n.modelViewMatrix),m.setValue(lt,"normalMatrix",n.normalMatrix),m.setValue(lt,"modelMatrix",n.matrixWorld),f}function Pt(t,e){t.ambientLightColor.needsUpdate=e,t.lightProbe.needsUpdate=e,t.directionalLights.needsUpdate=e,t.directionalLightShadows.needsUpdate=e,t.pointLights.needsUpdate=e,t.pointLightShadows.needsUpdate=e,t.spotLights.needsUpdate=e,t.spotLightShadows.needsUpdate=e,t.rectAreaLights.needsUpdate=e,t.hemisphereLights.needsUpdate=e}function Ot(t){return t.isMeshLambertMaterial||t.isMeshToonMaterial||t.isMeshPhongMaterial||t.isMeshStandardMaterial||t.isShadowMaterial||t.isShaderMaterial&&!0===t.lights}_t.setAnimationLoop(wt),"undefined"!==typeof window&&_t.setContext(window),this.setAnimationLoop=function(t){bt=t,ut.setAnimationLoop(t),null===t?_t.stop():_t.start()},this.render=function(t,e){let i,n;if(void 0!==arguments[2]&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),i=arguments[2]),void 0!==arguments[3]&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),n=arguments[3]),void 0!==e&&!0!==e.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===f)return;at.resetDefaultState(),b=-1,w=null,!0===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),!0===ut.enabled&&!0===ut.isPresenting&&(e=ut.getCamera(e)),!0===t.isScene&&t.onBeforeRender(p,t,e,i||y),d=et.get(t,e),d.init(),z.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),D.setFromProjectionMatrix(z),B=this.localClippingEnabled,N=I.init(this.clippingPlanes,B,e),u=tt.get(t,e),u.init(),Tt(t,e,0,p.sortObjects),u.finish(),!0===p.sortObjects&&u.sort(C,P),!0===N&&I.beginShadows();const r=d.state.shadowsArray;dt.render(r,t,e),d.setupLights(e),!0===N&&I.endShadows(),!0===this.info.autoReset&&this.info.reset(),void 0!==i&&this.setRenderTarget(i),it.render(u,t,e,n);const o=u.opaque,s=u.transparent;o.length>0&&Et(o,t,e),s.length>0&&Et(s,t,e),!0===t.isScene&&t.onAfterRender(p,t,e),null!==y&&(Y.updateRenderTargetMipmap(y),Y.updateMultisampleRenderTarget(y)),W.buffers.depth.setTest(!0),W.buffers.depth.setMask(!0),W.buffers.color.setMask(!0),W.setPolygonOffset(!1),u=null,d=null},this.setFramebuffer=function(t){m!==t&&null===y&&lt.bindFramebuffer(36160,t),m=t},this.getActiveCubeFace=function(){return g},this.getActiveMipmapLevel=function(){return v},this.getRenderTarget=function(){return y},this.setRenderTarget=function(t,e,i){y=t,g=e,v=i,t&&void 0===X.get(t).__webglFramebuffer&&Y.setupRenderTarget(t);let n=m,r=!1;if(t){const i=X.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(n=i[e||0],r=!0):n=t.isWebGLMultisampleRenderTarget?X.get(t).__webglMultisampledFramebuffer:i,M.copy(t.viewport),S.copy(t.scissor),T=t.scissorTest}else M.copy(R).multiplyScalar(L).floor(),S.copy(O).multiplyScalar(L).floor(),T=k;if(x!==n&&(lt.bindFramebuffer(36160,n),x=n),W.viewport(M),W.scissor(S),W.setScissorTest(T),r){const n=X.get(t.texture);lt.framebufferTexture2D(36160,36064,34069+(e||0),n.__webglTexture,i||0)}},this.readRenderTargetPixels=function(t,e,i,n,r,o,s){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let a=X.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==s&&(a=a[s]),a){let s=!1;a!==x&&(lt.bindFramebuffer(36160,a),s=!0);try{const a=t.texture,l=a.format,c=a.type;if(l!==Rt&&st.convert(l)!==lt.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(c!==vt&&st.convert(c)!==lt.getParameter(35738)&&(c!==Mt||!(j.isWebGL2||H.get("OES_texture_float")||H.get("WEBGL_color_buffer_float")))&&(c!==St||!(j.isWebGL2?H.get("EXT_color_buffer_float"):H.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===lt.checkFramebufferStatus(36160)?e>=0&&e<=t.width-n&&i>=0&&i<=t.height-r&&lt.readPixels(e,i,n,r,st.convert(l),st.convert(c),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{s&&lt.bindFramebuffer(36160,x)}}},this.copyFramebufferToTexture=function(t,e,i){void 0===i&&(i=0);const n=Math.pow(2,-i),r=Math.floor(e.image.width*n),o=Math.floor(e.image.height*n),s=st.convert(e.format);Y.setTexture2D(e,0),lt.copyTexImage2D(3553,i,s,t.x,t.y,r,o,0),W.unbindTexture()},this.copyTextureToTexture=function(t,e,i,n){void 0===n&&(n=0);const r=e.image.width,o=e.image.height,s=st.convert(i.format),a=st.convert(i.type);Y.setTexture2D(i,0),lt.pixelStorei(37440,i.flipY),lt.pixelStorei(37441,i.premultiplyAlpha),lt.pixelStorei(3317,i.unpackAlignment),e.isDataTexture?lt.texSubImage2D(3553,n,t.x,t.y,r,o,s,a,e.image.data):e.isCompressedTexture?lt.compressedTexSubImage2D(3553,n,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,s,e.mipmaps[0].data):lt.texSubImage2D(3553,n,t.x,t.y,s,a,e.image),0===n&&i.generateMipmaps&&lt.generateMipmap(3553),W.unbindTexture()},this.initTexture=function(t){Y.setTexture2D(t,0),W.unbindTexture()},"undefined"!==typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function Hc(t){Gc.call(this,t)}function jc(t,e){this.name="",this.color=new Nn(t),this.density=void 0!==e?e:25e-5}function Wc(t,e,i){this.name="",this.color=new Nn(t),this.near=void 0!==e?e:1,this.far=void 0!==i?i:1e3}function Vc(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=ei,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=oi.generateUUID()}Nc.prototype=Object.assign(Object.create(Xr.prototype),{constructor:Nc,isArrayCamera:!0}),Bc.prototype=Object.assign(Object.create(Wi.prototype),{constructor:Bc,isGroup:!0}),Object.assign(zc.prototype,{constructor:zc,getTargetRaySpace:function(){return null===this._targetRay&&(this._targetRay=new Bc,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1),this._targetRay},getGripSpace:function(){return null===this._grip&&(this._grip=new Bc,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1),this._grip},dispatchEvent:function(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),this},disconnect:function(t){return this.dispatchEvent({type:"disconnected",data:t}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),this},update:function(t,e,i){let n=null,r=null;const o=this._targetRay,s=this._grip;return t&&(null!==o&&(n=e.getPose(t.targetRaySpace,i),null!==n&&(o.matrix.fromArray(n.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale))),null!==s&&t.gripSpace&&(r=e.getPose(t.gripSpace,i),null!==r&&(s.matrix.fromArray(r.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale)))),null!==o&&(o.visible=null!==n),null!==s&&(s.visible=null!==r),this}}),Object.assign(Fc.prototype,ni.prototype),Hc.prototype=Object.assign(Object.create(Gc.prototype),{constructor:Hc,isWebGL1Renderer:!0}),Object.assign(jc.prototype,{isFogExp2:!0,clone:function(){return new jc(this.color,this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}),Object.assign(Wc.prototype,{isFog:!0,clone:function(){return new Wc(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}),Object.defineProperty(Vc.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Vc.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this},copyAt:function(t,e,i){t*=this.stride,i*=e.stride;for(let n=0,r=this.stride;n<r;n++)this.array[t+n]=e.array[i+n];return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},clone:function(t){void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=oi.generateUUID()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),i=new Vc(e,this.stride);return i.setUsage(this.usage),i},onUpload:function(t){return this.onUploadCallback=t,this},toJSON:function(t){return void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=oi.generateUUID()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.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}}});const Xc=new yi;function Yc(t,e,i,n){this.name="",this.data=t,this.itemSize=e,this.offset=i,this.normalized=!0===n}function qc(t){Hn.call(this),this.type="SpriteMaterial",this.color=new Nn(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(t)}let Zc;Object.defineProperties(Yc.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(Yc.prototype,{isInterleavedBufferAttribute:!0,applyMatrix4:function(t){for(let e=0,i=this.data.count;e<i;e++)Xc.x=this.getX(e),Xc.y=this.getY(e),Xc.z=this.getZ(e),Xc.applyMatrix4(t),this.setXYZ(e,Xc.x,Xc.y,Xc.z);return this},setX:function(t,e){return this.data.array[t*this.data.stride+this.offset]=e,this},setY:function(t,e){return this.data.array[t*this.data.stride+this.offset+1]=e,this},setZ:function(t,e){return this.data.array[t*this.data.stride+this.offset+2]=e,this},setW:function(t,e){return this.data.array[t*this.data.stride+this.offset+3]=e,this},getX:function(t){return this.data.array[t*this.data.stride+this.offset]},getY:function(t){return this.data.array[t*this.data.stride+this.offset+1]},getZ:function(t){return this.data.array[t*this.data.stride+this.offset+2]},getW:function(t){return this.data.array[t*this.data.stride+this.offset+3]},setXY:function(t,e,i){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=i,this},setXYZ:function(t,e,i,n){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=n,this},setXYZW:function(t,e,i,n,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=n,this.data.array[t+3]=r,this},clone:function(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let e=0;e<this.count;e++){const i=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[i+e])}return new Xn(new this.array.constructor(t),this.itemSize,this.normalized)}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new Yc(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)},toJSON:function(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let e=0;e<this.count;e++){const i=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[i+e])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}),qc.prototype=Object.create(Hn.prototype),qc.prototype.constructor=qc,qc.prototype.isSpriteMaterial=!0,qc.prototype.copy=function(t){return Hn.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this};const Jc=new yi,Kc=new yi,$c=new yi,Qc=new si,th=new si,eh=new Ei,ih=new yi,nh=new yi,rh=new yi,oh=new si,sh=new si,ah=new si;function lh(t){if(Wi.call(this),this.type="Sprite",void 0===Zc){Zc=new ur;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),e=new Vc(t,5);Zc.setIndex([0,1,2,0,2,3]),Zc.setAttribute("position",new Yc(e,3,0,!1)),Zc.setAttribute("uv",new Yc(e,2,3,!1))}this.geometry=Zc,this.material=void 0!==t?t:new qc,this.center=new si(.5,.5)}function ch(t,e,i,n,r,o){Qc.subVectors(t,i).addScalar(.5).multiply(n),void 0!==r?(th.x=o*Qc.x-r*Qc.y,th.y=r*Qc.x+o*Qc.y):th.copy(Qc),t.copy(e),t.x+=th.x,t.y+=th.y,t.applyMatrix4(eh)}lh.prototype=Object.assign(Object.create(Wi.prototype),{constructor:lh,isSprite:!0,raycast:function(t,e){null===t.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Kc.setFromMatrixScale(this.matrixWorld),eh.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),$c.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&Kc.multiplyScalar(-$c.z);const i=this.material.rotation;let n,r;0!==i&&(r=Math.cos(i),n=Math.sin(i));const o=this.center;ch(ih.set(-.5,-.5,0),$c,o,Kc,n,r),ch(nh.set(.5,-.5,0),$c,o,Kc,n,r),ch(rh.set(.5,.5,0),$c,o,Kc,n,r),oh.set(0,0),sh.set(1,0),ah.set(1,1);let s=t.ray.intersectTriangle(ih,nh,rh,!1,Jc);if(null===s&&(ch(nh.set(-.5,.5,0),$c,o,Kc,n,r),sh.set(0,1),s=t.ray.intersectTriangle(ih,rh,nh,!1,Jc),null===s))return;const a=t.ray.origin.distanceTo(Jc);a<t.near||a>t.far||e.push({distance:a,point:Jc.clone(),uv:On.getUV(Jc,ih,nh,rh,oh,sh,ah,new si),face:null,object:this})},copy:function(t){return Wi.prototype.copy.call(this,t),void 0!==t.center&&this.center.copy(t.center),this.material=t.material,this}});const hh=new yi,uh=new yi;function dh(){Wi.call(this),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}function ph(t,e){t&&t.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),Cr.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Ei,this.bindMatrixInverse=new Ei}dh.prototype=Object.assign(Object.create(Wi.prototype),{constructor:dh,isLOD:!0,copy:function(t){Wi.prototype.copy.call(this,t,!1);const e=t.levels;for(let i=0,n=e.length;i<n;i++){const t=e[i];this.addLevel(t.object.clone(),t.distance)}return this.autoUpdate=t.autoUpdate,this},addLevel:function(t,e){void 0===e&&(e=0),e=Math.abs(e);const i=this.levels;let n;for(n=0;n<i.length;n++)if(e<i[n].distance)break;return i.splice(n,0,{distance:e,object:t}),this.add(t),this},getCurrentLevel:function(){return this._currentLevel},getObjectForDistance:function(t){const e=this.levels;if(e.length>0){let i,n;for(i=1,n=e.length;i<n;i++)if(t<e[i].distance)break;return e[i-1].object}return null},raycast:function(t,e){const i=this.levels;if(i.length>0){hh.setFromMatrixPosition(this.matrixWorld);const i=t.ray.origin.distanceTo(hh);this.getObjectForDistance(i).raycast(t,e)}},update:function(t){const e=this.levels;if(e.length>1){hh.setFromMatrixPosition(t.matrixWorld),uh.setFromMatrixPosition(this.matrixWorld);const i=hh.distanceTo(uh)/t.zoom;let n,r;for(e[0].object.visible=!0,n=1,r=e.length;n<r;n++){if(!(i>=e[n].distance))break;e[n-1].object.visible=!1,e[n].object.visible=!0}for(this._currentLevel=n-1;n<r;n++)e[n].object.visible=!1}},toJSON:function(t){const e=Wi.prototype.toJSON.call(this,t);!1===this.autoUpdate&&(e.object.autoUpdate=!1),e.object.levels=[];const i=this.levels;for(let n=0,r=i.length;n<r;n++){const t=i[n];e.object.levels.push({object:t.object.uuid,distance:t.distance})}return e}}),ph.prototype=Object.assign(Object.create(Cr.prototype),{constructor:ph,isSkinnedMesh:!0,copy:function(t){return Cr.prototype.copy.call(this,t),this.bindMode=t.bindMode,this.bindMatrix.copy(t.bindMatrix),this.bindMatrixInverse.copy(t.bindMatrixInverse),this.skeleton=t.skeleton,this},bind:function(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.getInverse(e)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){const t=new di,e=this.geometry.attributes.skinWeight;for(let i=0,n=e.count;i<n;i++){t.x=e.getX(i),t.y=e.getY(i),t.z=e.getZ(i),t.w=e.getW(i);const n=1/t.manhattanLength();n!==1/0?t.multiplyScalar(n):t.set(1,0,0,0),e.setXYZW(i,t.x,t.y,t.z,t.w)}},updateMatrixWorld:function(t){Cr.prototype.updateMatrixWorld.call(this,t),"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(){const t=new yi,e=new di,i=new di,n=new yi,r=new Ei;return function(o,s){const a=this.skeleton,l=this.geometry;e.fromBufferAttribute(l.attributes.skinIndex,o),i.fromBufferAttribute(l.attributes.skinWeight,o),t.fromBufferAttribute(l.attributes.position,o).applyMatrix4(this.bindMatrix),s.set(0,0,0);for(let c=0;c<4;c++){const o=i.getComponent(c);if(0!==o){const i=e.getComponent(c);r.multiplyMatrices(a.bones[i].matrixWorld,a.boneInverses[i]),s.addScaledVector(n.copy(t).applyMatrix4(r),o)}}return s.applyMatrix4(this.bindMatrixInverse)}}()});const fh=new Ei,mh=new Ei;function gh(t,e){if(t=t||[],this.bones=t.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),this.frame=-1,void 0===e)this.calculateInverses();else if(this.bones.length===e.length)this.boneInverses=e.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(let t=0,e=this.bones.length;t<e;t++)this.boneInverses.push(new Ei)}}function vh(){Wi.call(this),this.type="Bone"}Object.assign(gh.prototype,{calculateInverses:function(){this.boneInverses=[];for(let t=0,e=this.bones.length;t<e;t++){const e=new Ei;this.bones[t]&&e.getInverse(this.bones[t].matrixWorld),this.boneInverses.push(e)}},pose:function(){for(let t=0,e=this.bones.length;t<e;t++){const e=this.bones[t];e&&e.matrixWorld.getInverse(this.boneInverses[t])}for(let t=0,e=this.bones.length;t<e;t++){const e=this.bones[t];e&&(e.parent&&e.parent.isBone?(e.matrix.getInverse(e.parent.matrixWorld),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))}},update:function(){const t=this.bones,e=this.boneInverses,i=this.boneMatrices,n=this.boneTexture;for(let r=0,o=t.length;r<o;r++){const n=t[r]?t[r].matrixWorld:mh;fh.multiplyMatrices(n,e[r]),fh.toArray(i,16*r)}void 0!==n&&(n.needsUpdate=!0)},clone:function(){return new gh(this.bones,this.boneInverses)},getBoneByName:function(t){for(let e=0,i=this.bones.length;e<i;e++){const i=this.bones[e];if(i.name===t)return i}},dispose:function(){this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=void 0)}}),vh.prototype=Object.assign(Object.create(Wi.prototype),{constructor:vh,isBone:!0});const yh=new Ei,xh=new Ei,bh=[],wh=new Cr;function _h(t,e,i){Cr.call(this,t,e),this.instanceMatrix=new Xn(new Float32Array(16*i),16),this.count=i,this.frustumCulled=!1}function Mh(t){Hn.call(this),this.type="LineBasicMaterial",this.color=new Nn(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.morphTargets=!1,this.setValues(t)}_h.prototype=Object.assign(Object.create(Cr.prototype),{constructor:_h,isInstancedMesh:!0,copy:function(t){return Cr.prototype.copy.call(this,t),this.instanceMatrix.copy(t.instanceMatrix),this.count=t.count,this},getMatrixAt:function(t,e){e.fromArray(this.instanceMatrix.array,16*t)},raycast:function(t,e){const i=this.matrixWorld,n=this.count;if(wh.geometry=this.geometry,wh.material=this.material,void 0!==wh.material)for(let r=0;r<n;r++){this.getMatrixAt(r,yh),xh.multiplyMatrices(i,yh),wh.matrixWorld=xh,wh.raycast(t,bh);for(let t=0,i=bh.length;t<i;t++){const i=bh[t];i.instanceId=r,i.object=this,e.push(i)}bh.length=0}},setMatrixAt:function(t,e){e.toArray(this.instanceMatrix.array,16*t)},updateMorphTargets:function(){}}),Mh.prototype=Object.create(Hn.prototype),Mh.prototype.constructor=Mh,Mh.prototype.isLineBasicMaterial=!0,Mh.prototype.copy=function(t){return Hn.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.morphTargets=t.morphTargets,this};const Sh=new yi,Th=new yi,Eh=new Ei,Ah=new vn,Lh=new cn;function Ch(t,e,i){1===i&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),Wi.call(this),this.type="Line",this.geometry=void 0!==t?t:new ur,this.material=void 0!==e?e:new Mh,this.updateMorphTargets()}Ch.prototype=Object.assign(Object.create(Wi.prototype),{constructor:Ch,isLine:!0,copy:function(t){return Wi.prototype.copy.call(this,t),this.material=t.material,this.geometry=t.geometry,this},computeLineDistances:function(){const t=this.geometry;if(t.isBufferGeometry)if(null===t.index){const e=t.attributes.position,i=[0];for(let t=1,n=e.count;t<n;t++)Sh.fromBufferAttribute(e,t-1),Th.fromBufferAttribute(e,t),i[t]=i[t-1],i[t]+=Sh.distanceTo(Th);t.setAttribute("lineDistance",new tr(i,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(t.isGeometry){const e=t.vertices,i=t.lineDistances;i[0]=0;for(let t=1,n=e.length;t<n;t++)i[t]=i[t-1],i[t]+=e[t-1].distanceTo(e[t])}return this},raycast:function(t,e){const i=this.geometry,n=this.matrixWorld,r=t.params.Line.threshold;if(null===i.boundingSphere&&i.computeBoundingSphere(),Lh.copy(i.boundingSphere),Lh.applyMatrix4(n),Lh.radius+=r,!1===t.ray.intersectsSphere(Lh))return;Eh.getInverse(n),Ah.copy(t.ray).applyMatrix4(Eh);const o=r/((this.scale.x+this.scale.y+this.scale.z)/3),s=o*o,a=new yi,l=new yi,c=new yi,h=new yi,u=this&&this.isLineSegments?2:1;if(i.isBufferGeometry){const n=i.index,r=i.attributes,o=r.position.array;if(null!==n){const i=n.array;for(let n=0,r=i.length-1;n<r;n+=u){const r=i[n],u=i[n+1];a.fromArray(o,3*r),l.fromArray(o,3*u);const d=Ah.distanceSqToSegment(a,l,h,c);if(d>s)continue;h.applyMatrix4(this.matrixWorld);const p=t.ray.origin.distanceTo(h);p<t.near||p>t.far||e.push({distance:p,point:c.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}else for(let i=0,d=o.length/3-1;i<d;i+=u){a.fromArray(o,3*i),l.fromArray(o,3*i+3);const n=Ah.distanceSqToSegment(a,l,h,c);if(n>s)continue;h.applyMatrix4(this.matrixWorld);const r=t.ray.origin.distanceTo(h);r<t.near||r>t.far||e.push({distance:r,point:c.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}else if(i.isGeometry){const n=i.vertices,r=n.length;for(let i=0;i<r-1;i+=u){const r=Ah.distanceSqToSegment(n[i],n[i+1],h,c);if(r>s)continue;h.applyMatrix4(this.matrixWorld);const o=t.ray.origin.distanceTo(h);o<t.near||o>t.far||e.push({distance:o,point:c.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}},updateMorphTargets:function(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,i=Object.keys(e);if(i.length>0){const t=e[i[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,i=t.length;e<i;e++){const i=t[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[i]=e}}}}else{const e=t.morphTargets;void 0!==e&&e.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}});const Ph=new yi,Rh=new yi;function Oh(t,e){Ch.call(this,t,e),this.type="LineSegments"}function kh(t,e){Ch.call(this,t,e),this.type="LineLoop"}function Dh(t){Hn.call(this),this.type="PointsMaterial",this.color=new Nn(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(t)}Oh.prototype=Object.assign(Object.create(Ch.prototype),{constructor:Oh,isLineSegments:!0,computeLineDistances:function(){const t=this.geometry;if(t.isBufferGeometry)if(null===t.index){const e=t.attributes.position,i=[];for(let t=0,n=e.count;t<n;t+=2)Ph.fromBufferAttribute(e,t),Rh.fromBufferAttribute(e,t+1),i[t]=0===t?0:i[t-1],i[t+1]=i[t]+Ph.distanceTo(Rh);t.setAttribute("lineDistance",new tr(i,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(t.isGeometry){const e=t.vertices,i=t.lineDistances;for(let t=0,n=e.length;t<n;t+=2)Ph.copy(e[t]),Rh.copy(e[t+1]),i[t]=0===t?0:i[t-1],i[t+1]=i[t]+Ph.distanceTo(Rh)}return this}}),kh.prototype=Object.assign(Object.create(Ch.prototype),{constructor:kh,isLineLoop:!0}),Dh.prototype=Object.create(Hn.prototype),Dh.prototype.constructor=Dh,Dh.prototype.isPointsMaterial=!0,Dh.prototype.copy=function(t){return Hn.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.morphTargets=t.morphTargets,this};const Ih=new Ei,Nh=new vn,Bh=new cn,zh=new yi;function Fh(t,e){Wi.call(this),this.type="Points",this.geometry=void 0!==t?t:new ur,this.material=void 0!==e?e:new Dh,this.updateMorphTargets()}function Uh(t,e,i,n,r,o,s){const a=Nh.distanceSqToPoint(t);if(a<i){const i=new yi;Nh.closestPointToPoint(t,i),i.applyMatrix4(n);const l=r.ray.origin.distanceTo(i);if(l<r.near||l>r.far)return;o.push({distance:l,distanceToRay:Math.sqrt(a),point:i,index:e,face:null,object:s})}}function Gh(t,e,i,n,r,o,s,a,l){ui.call(this,t,e,i,n,r,o,s,a,l),this.format=void 0!==s?s:Pt,this.minFilter=void 0!==o?o:ft,this.magFilter=void 0!==r?r:ft,this.generateMipmaps=!1}function Hh(t,e,i,n,r,o,s,a,l,c,h,u){ui.call(this,null,o,s,a,l,c,n,r,h,u),this.image={width:e,height:i},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}function jh(t,e,i,n,r,o,s,a,l){ui.call(this,t,e,i,n,r,o,s,a,l),this.needsUpdate=!0}function Wh(t,e,i,n,r,o,s,a,l,c){if(c=void 0!==c?c:It,c!==It&&c!==Nt)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===i&&c===It&&(i=bt),void 0===i&&c===Nt&&(i=Lt),ui.call(this,null,n,r,o,s,a,c,i,l),this.image={width:t,height:e},this.magFilter=void 0!==s?s:ut,this.minFilter=void 0!==a?a:ut,this.flipY=!1,this.generateMipmaps=!1}function Vh(t){ur.call(this),this.type="WireframeGeometry";const e=[],i=[0,0],n={},r=["a","b","c"];if(t&&t.isGeometry){const o=t.faces;for(let t=0,e=o.length;t<e;t++){const e=o[t];for(let t=0;t<3;t++){const o=e[r[t]],s=e[r[(t+1)%3]];i[0]=Math.min(o,s),i[1]=Math.max(o,s);const a=i[0]+","+i[1];void 0===n[a]&&(n[a]={index1:i[0],index2:i[1]})}}for(const i in n){const r=n[i];let o=t.vertices[r.index1];e.push(o.x,o.y,o.z),o=t.vertices[r.index2],e.push(o.x,o.y,o.z)}}else if(t&&t.isBufferGeometry){let r=new yi;if(null!==t.index){const o=t.attributes.position,s=t.index;let a=t.groups;0===a.length&&(a=[{start:0,count:s.count,materialIndex:0}]);for(let t=0,e=a.length;t<e;++t){const e=a[t],r=e.start,o=e.count;for(let t=r,a=r+o;t<a;t+=3)for(let e=0;e<3;e++){const r=s.getX(t+e),o=s.getX(t+(e+1)%3);i[0]=Math.min(r,o),i[1]=Math.max(r,o);const a=i[0]+","+i[1];void 0===n[a]&&(n[a]={index1:i[0],index2:i[1]})}}for(const t in n){const i=n[t];r.fromBufferAttribute(o,i.index1),e.push(r.x,r.y,r.z),r.fromBufferAttribute(o,i.index2),e.push(r.x,r.y,r.z)}}else{const i=t.attributes.position;for(let t=0,n=i.count/3;t<n;t++)for(let o=0;o<3;o++){const n=3*t+o;r.fromBufferAttribute(i,n),e.push(r.x,r.y,r.z);const s=3*t+(o+1)%3;r.fromBufferAttribute(i,s),e.push(r.x,r.y,r.z)}}}this.setAttribute("position",new tr(e,3))}function Xh(t,e,i){Nr.call(this),this.type="ParametricGeometry",this.parameters={func:t,slices:e,stacks:i},this.fromBufferGeometry(new Yh(t,e,i)),this.mergeVertices()}function Yh(t,e,i){ur.call(this),this.type="ParametricBufferGeometry",this.parameters={func:t,slices:e,stacks:i};const n=[],r=[],o=[],s=[],a=1e-5,l=new yi,c=new yi,h=new yi,u=new yi,d=new yi;t.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");const p=e+1;for(let f=0;f<=i;f++){const n=f/i;for(let i=0;i<=e;i++){const p=i/e;t(p,n,c),r.push(c.x,c.y,c.z),p-a>=0?(t(p-a,n,h),u.subVectors(c,h)):(t(p+a,n,h),u.subVectors(h,c)),n-a>=0?(t(p,n-a,h),d.subVectors(c,h)):(t(p,n+a,h),d.subVectors(h,c)),l.crossVectors(u,d).normalize(),o.push(l.x,l.y,l.z),s.push(p,n)}}for(let f=0;f<i;f++)for(let t=0;t<e;t++){const e=f*p+t,i=f*p+t+1,r=(f+1)*p+t+1,o=(f+1)*p+t;n.push(e,i,o),n.push(i,r,o)}this.setIndex(n),this.setAttribute("position",new tr(r,3)),this.setAttribute("normal",new tr(o,3)),this.setAttribute("uv",new tr(s,2))}function qh(t,e,i,n){Nr.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:i,detail:n},this.fromBufferGeometry(new Zh(t,e,i,n)),this.mergeVertices()}function Zh(t,e,i,n){ur.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:t,indices:e,radius:i,detail:n},i=i||1,n=n||0;const r=[],o=[];function s(t){const i=new yi,n=new yi,r=new yi;for(let o=0;o<e.length;o+=3)d(e[o+0],i),d(e[o+1],n),d(e[o+2],r),a(i,n,r,t)}function a(t,e,i,n){const r=Math.pow(2,n),o=[];for(let s=0;s<=r;s++){o[s]=[];const n=t.clone().lerp(i,s/r),a=e.clone().lerp(i,s/r),l=r-s;for(let t=0;t<=l;t++)o[s][t]=0===t&&s===r?n:n.clone().lerp(a,t/l)}for(let s=0;s<r;s++)for(let t=0;t<2*(r-s)-1;t++){const e=Math.floor(t/2);t%2===0?(u(o[s][e+1]),u(o[s+1][e]),u(o[s][e])):(u(o[s][e+1]),u(o[s+1][e+1]),u(o[s+1][e]))}}function l(t){const e=new yi;for(let i=0;i<r.length;i+=3)e.x=r[i+0],e.y=r[i+1],e.z=r[i+2],e.normalize().multiplyScalar(t),r[i+0]=e.x,r[i+1]=e.y,r[i+2]=e.z}function c(){const t=new yi;for(let e=0;e<r.length;e+=3){t.x=r[e+0],t.y=r[e+1],t.z=r[e+2];const i=m(t)/2/Math.PI+.5,n=g(t)/Math.PI+.5;o.push(i,1-n)}p(),h()}function h(){for(let t=0;t<o.length;t+=6){const e=o[t+0],i=o[t+2],n=o[t+4],r=Math.max(e,i,n),s=Math.min(e,i,n);r>.9&&s<.1&&(e<.2&&(o[t+0]+=1),i<.2&&(o[t+2]+=1),n<.2&&(o[t+4]+=1))}}function u(t){r.push(t.x,t.y,t.z)}function d(e,i){const n=3*e;i.x=t[n+0],i.y=t[n+1],i.z=t[n+2]}function p(){const t=new yi,e=new yi,i=new yi,n=new yi,s=new si,a=new si,l=new si;for(let c=0,h=0;c<r.length;c+=9,h+=6){t.set(r[c+0],r[c+1],r[c+2]),e.set(r[c+3],r[c+4],r[c+5]),i.set(r[c+6],r[c+7],r[c+8]),s.set(o[h+0],o[h+1]),a.set(o[h+2],o[h+3]),l.set(o[h+4],o[h+5]),n.copy(t).add(e).add(i).divideScalar(3);const u=m(n);f(s,h+0,t,u),f(a,h+2,e,u),f(l,h+4,i,u)}}function f(t,e,i,n){n<0&&1===t.x&&(o[e]=t.x-1),0===i.x&&0===i.z&&(o[e]=n/2/Math.PI+.5)}function m(t){return Math.atan2(t.z,-t.x)}function g(t){return Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))}s(n),l(i),c(),this.setAttribute("position",new tr(r,3)),this.setAttribute("normal",new tr(r.slice(),3)),this.setAttribute("uv",new tr(o,2)),0===n?this.computeVertexNormals():this.normalizeNormals()}function Jh(t,e){Nr.call(this),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Kh(t,e)),this.mergeVertices()}function Kh(t,e){const i=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],n=[2,1,0,0,3,2,1,3,0,2,3,1];Zh.call(this,i,n,t,e),this.type="TetrahedronBufferGeometry",this.parameters={radius:t,detail:e}}function $h(t,e){Nr.call(this),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Qh(t,e)),this.mergeVertices()}function Qh(t,e){const i=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],n=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];Zh.call(this,i,n,t,e),this.type="OctahedronBufferGeometry",this.parameters={radius:t,detail:e}}function tu(t,e){Nr.call(this),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new eu(t,e)),this.mergeVertices()}function eu(t,e){const i=(1+Math.sqrt(5))/2,n=[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],r=[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];Zh.call(this,n,r,t,e),this.type="IcosahedronBufferGeometry",this.parameters={radius:t,detail:e}}function iu(t,e){Nr.call(this),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new nu(t,e)),this.mergeVertices()}function nu(t,e){const i=(1+Math.sqrt(5))/2,n=1/i,r=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-n,-i,0,-n,i,0,n,-i,0,n,i,-n,-i,0,-n,i,0,n,-i,0,n,i,0,-i,0,-n,i,0,-n,-i,0,n,i,0,n],o=[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];Zh.call(this,r,o,t,e),this.type="DodecahedronBufferGeometry",this.parameters={radius:t,detail:e}}function ru(t,e,i,n,r,o){Nr.call(this),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:i,radialSegments:n,closed:r},void 0!==o&&console.warn("THREE.TubeGeometry: taper has been removed.");const s=new ou(t,e,i,n,r);this.tangents=s.tangents,this.normals=s.normals,this.binormals=s.binormals,this.fromBufferGeometry(s),this.mergeVertices()}function ou(t,e,i,n,r){ur.call(this),this.type="TubeBufferGeometry",this.parameters={path:t,tubularSegments:e,radius:i,radialSegments:n,closed:r},e=e||64,i=i||1,n=n||8,r=r||!1;const o=t.computeFrenetFrames(e,r);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;const s=new yi,a=new yi,l=new si;let c=new yi;const h=[],u=[],d=[],p=[];function f(){for(let t=0;t<e;t++)m(t);m(!1===r?e:0),v(),g()}function m(r){c=t.getPointAt(r/e,c);const l=o.normals[r],d=o.binormals[r];for(let t=0;t<=n;t++){const e=t/n*Math.PI*2,r=Math.sin(e),o=-Math.cos(e);a.x=o*l.x+r*d.x,a.y=o*l.y+r*d.y,a.z=o*l.z+r*d.z,a.normalize(),u.push(a.x,a.y,a.z),s.x=c.x+i*a.x,s.y=c.y+i*a.y,s.z=c.z+i*a.z,h.push(s.x,s.y,s.z)}}function g(){for(let t=1;t<=e;t++)for(let e=1;e<=n;e++){const i=(n+1)*(t-1)+(e-1),r=(n+1)*t+(e-1),o=(n+1)*t+e,s=(n+1)*(t-1)+e;p.push(i,r,s),p.push(r,o,s)}}function v(){for(let t=0;t<=e;t++)for(let i=0;i<=n;i++)l.x=t/e,l.y=i/n,d.push(l.x,l.y)}f(),this.setIndex(p),this.setAttribute("position",new tr(h,3)),this.setAttribute("normal",new tr(u,3)),this.setAttribute("uv",new tr(d,2))}function su(t,e,i,n,r,o,s){Nr.call(this),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:i,radialSegments:n,p:r,q:o},void 0!==s&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new au(t,e,i,n,r,o)),this.mergeVertices()}function au(t,e,i,n,r,o){ur.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:t,tube:e,tubularSegments:i,radialSegments:n,p:r,q:o},t=t||1,e=e||.4,i=Math.floor(i)||64,n=Math.floor(n)||8,r=r||2,o=o||3;const s=[],a=[],l=[],c=[],h=new yi,u=new yi,d=new yi,p=new yi,f=new yi,m=new yi,g=new yi;for(let y=0;y<=i;++y){const s=y/i*r*Math.PI*2;v(s,r,o,t,d),v(s+.01,r,o,t,p),m.subVectors(p,d),g.addVectors(p,d),f.crossVectors(m,g),g.crossVectors(f,m),f.normalize(),g.normalize();for(let t=0;t<=n;++t){const r=t/n*Math.PI*2,o=-e*Math.cos(r),s=e*Math.sin(r);h.x=d.x+(o*g.x+s*f.x),h.y=d.y+(o*g.y+s*f.y),h.z=d.z+(o*g.z+s*f.z),a.push(h.x,h.y,h.z),u.subVectors(h,d).normalize(),l.push(u.x,u.y,u.z),c.push(y/i),c.push(t/n)}}for(let y=1;y<=i;y++)for(let t=1;t<=n;t++){const e=(n+1)*(y-1)+(t-1),i=(n+1)*y+(t-1),r=(n+1)*y+t,o=(n+1)*(y-1)+t;s.push(e,i,o),s.push(i,r,o)}function v(t,e,i,n,r){const o=Math.cos(t),s=Math.sin(t),a=i/e*t,l=Math.cos(a);r.x=n*(2+l)*.5*o,r.y=n*(2+l)*s*.5,r.z=n*Math.sin(a)*.5}this.setIndex(s),this.setAttribute("position",new tr(a,3)),this.setAttribute("normal",new tr(l,3)),this.setAttribute("uv",new tr(c,2))}function lu(t,e,i,n,r){Nr.call(this),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:i,tubularSegments:n,arc:r},this.fromBufferGeometry(new cu(t,e,i,n,r)),this.mergeVertices()}function cu(t,e,i,n,r){ur.call(this),this.type="TorusBufferGeometry",this.parameters={radius:t,tube:e,radialSegments:i,tubularSegments:n,arc:r},t=t||1,e=e||.4,i=Math.floor(i)||8,n=Math.floor(n)||6,r=r||2*Math.PI;const o=[],s=[],a=[],l=[],c=new yi,h=new yi,u=new yi;for(let d=0;d<=i;d++)for(let o=0;o<=n;o++){const p=o/n*r,f=d/i*Math.PI*2;h.x=(t+e*Math.cos(f))*Math.cos(p),h.y=(t+e*Math.cos(f))*Math.sin(p),h.z=e*Math.sin(f),s.push(h.x,h.y,h.z),c.x=t*Math.cos(p),c.y=t*Math.sin(p),u.subVectors(h,c).normalize(),a.push(u.x,u.y,u.z),l.push(o/n),l.push(d/i)}for(let d=1;d<=i;d++)for(let t=1;t<=n;t++){const e=(n+1)*d+t-1,i=(n+1)*(d-1)+t-1,r=(n+1)*(d-1)+t,s=(n+1)*d+t;o.push(e,i,s),o.push(i,r,s)}this.setIndex(o),this.setAttribute("position",new tr(s,3)),this.setAttribute("normal",new tr(a,3)),this.setAttribute("uv",new tr(l,2))}Fh.prototype=Object.assign(Object.create(Wi.prototype),{constructor:Fh,isPoints:!0,copy:function(t){return Wi.prototype.copy.call(this,t),this.material=t.material,this.geometry=t.geometry,this},raycast:function(t,e){const i=this.geometry,n=this.matrixWorld,r=t.params.Points.threshold;if(null===i.boundingSphere&&i.computeBoundingSphere(),Bh.copy(i.boundingSphere),Bh.applyMatrix4(n),Bh.radius+=r,!1===t.ray.intersectsSphere(Bh))return;Ih.getInverse(n),Nh.copy(t.ray).applyMatrix4(Ih);const o=r/((this.scale.x+this.scale.y+this.scale.z)/3),s=o*o;if(i.isBufferGeometry){const r=i.index,o=i.attributes,a=o.position.array;if(null!==r){const i=r.array;for(let r=0,o=i.length;r<o;r++){const o=i[r];zh.fromArray(a,3*o),Uh(zh,o,s,n,t,e,this)}}else for(let i=0,l=a.length/3;i<l;i++)zh.fromArray(a,3*i),Uh(zh,i,s,n,t,e,this)}else{const r=i.vertices;for(let i=0,o=r.length;i<o;i++)Uh(r[i],i,s,n,t,e,this)}},updateMorphTargets:function(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,i=Object.keys(e);if(i.length>0){const t=e[i[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,i=t.length;e<i;e++){const i=t[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[i]=e}}}}else{const e=t.morphTargets;void 0!==e&&e.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}),Gh.prototype=Object.assign(Object.create(ui.prototype),{constructor:Gh,isVideoTexture:!0,update:function(){const t=this.image;t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),Hh.prototype=Object.create(ui.prototype),Hh.prototype.constructor=Hh,Hh.prototype.isCompressedTexture=!0,jh.prototype=Object.create(ui.prototype),jh.prototype.constructor=jh,jh.prototype.isCanvasTexture=!0,Wh.prototype=Object.create(ui.prototype),Wh.prototype.constructor=Wh,Wh.prototype.isDepthTexture=!0,Vh.prototype=Object.create(ur.prototype),Vh.prototype.constructor=Vh,Xh.prototype=Object.create(Nr.prototype),Xh.prototype.constructor=Xh,Yh.prototype=Object.create(ur.prototype),Yh.prototype.constructor=Yh,qh.prototype=Object.create(Nr.prototype),qh.prototype.constructor=qh,Zh.prototype=Object.create(ur.prototype),Zh.prototype.constructor=Zh,Jh.prototype=Object.create(Nr.prototype),Jh.prototype.constructor=Jh,Kh.prototype=Object.create(Zh.prototype),Kh.prototype.constructor=Kh,$h.prototype=Object.create(Nr.prototype),$h.prototype.constructor=$h,Qh.prototype=Object.create(Zh.prototype),Qh.prototype.constructor=Qh,tu.prototype=Object.create(Nr.prototype),tu.prototype.constructor=tu,eu.prototype=Object.create(Zh.prototype),eu.prototype.constructor=eu,iu.prototype=Object.create(Nr.prototype),iu.prototype.constructor=iu,nu.prototype=Object.create(Zh.prototype),nu.prototype.constructor=nu,ru.prototype=Object.create(Nr.prototype),ru.prototype.constructor=ru,ou.prototype=Object.create(ur.prototype),ou.prototype.constructor=ou,ou.prototype.toJSON=function(){const t=ur.prototype.toJSON.call(this);return t.path=this.parameters.path.toJSON(),t},su.prototype=Object.create(Nr.prototype),su.prototype.constructor=su,au.prototype=Object.create(ur.prototype),au.prototype.constructor=au,lu.prototype=Object.create(Nr.prototype),lu.prototype.constructor=lu,cu.prototype=Object.create(ur.prototype),cu.prototype.constructor=cu;const hu={triangulate:function(t,e,i){i=i||2;let n,r,o,s,a,l,c,h=e&&e.length,u=h?e[0]*i:t.length,d=uu(t,0,u,i,!0),p=[];if(!d||d.next===d.prev)return p;if(h&&(d=yu(t,e,d,i)),t.length>80*i){n=o=t[0],r=s=t[1];for(let e=i;e<u;e+=i)a=t[e],l=t[e+1],a<n&&(n=a),l<r&&(r=l),a>o&&(o=a),l>s&&(s=l);c=Math.max(o-n,s-r),c=0!==c?1/c:0}return pu(d,p,i,n,r,c),p}};function uu(t,e,i,n,r){let o,s;if(r===Gu(t,e,i,n)>0)for(o=e;o<i;o+=n)s=zu(o,t[o],t[o+1],s);else for(o=i-n;o>=e;o-=n)s=zu(o,t[o],t[o+1],s);return s&&Pu(s,s.next)&&(Fu(s),s=s.next),s}function du(t,e){if(!t)return t;e||(e=t);let i,n=t;do{if(i=!1,n.steiner||!Pu(n,n.next)&&0!==Cu(n.prev,n,n.next))n=n.next;else{if(Fu(n),n=e=n.prev,n===n.next)break;i=!0}}while(i||n!==e);return e}function pu(t,e,i,n,r,o,s){if(!t)return;!s&&o&&Mu(t,n,r,o);let a,l,c=t;while(t.prev!==t.next)if(a=t.prev,l=t.next,o?mu(t,n,r,o):fu(t))e.push(a.i/i),e.push(t.i/i),e.push(l.i/i),Fu(t),t=l.next,c=l.next;else if(t=l,t===c){s?1===s?(t=gu(du(t),e,i),pu(t,e,i,n,r,o,2)):2===s&&vu(t,e,i,n,r,o):pu(du(t),e,i,n,r,o,1);break}}function fu(t){let e=t.prev,i=t,n=t.next;if(Cu(e,i,n)>=0)return!1;let r=t.next.next;while(r!==t.prev){if(Au(e.x,e.y,i.x,i.y,n.x,n.y,r.x,r.y)&&Cu(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function mu(t,e,i,n){let r=t.prev,o=t,s=t.next;if(Cu(r,o,s)>=0)return!1;let a=r.x<o.x?r.x<s.x?r.x:s.x:o.x<s.x?o.x:s.x,l=r.y<o.y?r.y<s.y?r.y:s.y:o.y<s.y?o.y:s.y,c=r.x>o.x?r.x>s.x?r.x:s.x:o.x>s.x?o.x:s.x,h=r.y>o.y?r.y>s.y?r.y:s.y:o.y>s.y?o.y:s.y,u=Tu(a,l,e,i,n),d=Tu(c,h,e,i,n),p=t.prevZ,f=t.nextZ;while(p&&p.z>=u&&f&&f.z<=d){if(p!==t.prev&&p!==t.next&&Au(r.x,r.y,o.x,o.y,s.x,s.y,p.x,p.y)&&Cu(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==t.prev&&f!==t.next&&Au(r.x,r.y,o.x,o.y,s.x,s.y,f.x,f.y)&&Cu(f.prev,f,f.next)>=0)return!1;f=f.nextZ}while(p&&p.z>=u){if(p!==t.prev&&p!==t.next&&Au(r.x,r.y,o.x,o.y,s.x,s.y,p.x,p.y)&&Cu(p.prev,p,p.next)>=0)return!1;p=p.prevZ}while(f&&f.z<=d){if(f!==t.prev&&f!==t.next&&Au(r.x,r.y,o.x,o.y,s.x,s.y,f.x,f.y)&&Cu(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function gu(t,e,i){let n=t;do{let r=n.prev,o=n.next.next;!Pu(r,o)&&Ru(r,n,n.next,o)&&Iu(r,o)&&Iu(o,r)&&(e.push(r.i/i),e.push(n.i/i),e.push(o.i/i),Fu(n),Fu(n.next),n=t=o),n=n.next}while(n!==t);return du(n)}function vu(t,e,i,n,r,o){let s=t;do{let t=s.next.next;while(t!==s.prev){if(s.i!==t.i&&Lu(s,t)){let a=Bu(s,t);return s=du(s,s.next),a=du(a,a.next),pu(s,e,i,n,r,o),void pu(a,e,i,n,r,o)}t=t.next}s=s.next}while(s!==t)}function yu(t,e,i,n){let r,o,s,a,l,c=[];for(r=0,o=e.length;r<o;r++)s=e[r]*n,a=r<o-1?e[r+1]*n:t.length,l=uu(t,s,a,n,!1),l===l.next&&(l.steiner=!0),c.push(Eu(l));for(c.sort(xu),r=0;r<c.length;r++)bu(c[r],i),i=du(i,i.next);return i}function xu(t,e){return t.x-e.x}function bu(t,e){if(e=wu(t,e),e){const i=Bu(e,t);du(e,e.next),du(i,i.next)}}function wu(t,e){let i,n=e,r=t.x,o=t.y,s=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){let t=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(t<=r&&t>s){if(s=t,t===r){if(o===n.y)return n;if(o===n.next.y)return n.next}i=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!i)return null;if(r===s)return i;let a,l=i,c=i.x,h=i.y,u=1/0;n=i;do{r>=n.x&&n.x>=c&&r!==n.x&&Au(o<h?r:s,o,c,h,o<h?s:r,o,n.x,n.y)&&(a=Math.abs(o-n.y)/(r-n.x),Iu(n,t)&&(a<u||a===u&&(n.x>i.x||n.x===i.x&&_u(i,n)))&&(i=n,u=a)),n=n.next}while(n!==l);return i}function _u(t,e){return Cu(t.prev,t,e.prev)<0&&Cu(e.next,t,t.next)<0}function Mu(t,e,i,n){let r=t;do{null===r.z&&(r.z=Tu(r.x,r.y,e,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,Su(r)}function Su(t){let e,i,n,r,o,s,a,l,c=1;do{i=t,t=null,o=null,s=0;while(i){for(s++,n=i,a=0,e=0;e<c;e++)if(a++,n=n.nextZ,!n)break;l=c;while(a>0||l>0&&n)0!==a&&(0===l||!n||i.z<=n.z)?(r=i,i=i.nextZ,a--):(r=n,n=n.nextZ,l--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;i=n}o.nextZ=null,c*=2}while(s>1);return t}function Tu(t,e,i,n,r){return t=32767*(t-i)*r,e=32767*(e-n)*r,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function Eu(t){let e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function Au(t,e,i,n,r,o,s,a){return(r-s)*(e-a)-(t-s)*(o-a)>=0&&(t-s)*(n-a)-(i-s)*(e-a)>=0&&(i-s)*(o-a)-(r-s)*(n-a)>=0}function Lu(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!Du(t,e)&&(Iu(t,e)&&Iu(e,t)&&Nu(t,e)&&(Cu(t.prev,t,e.prev)||Cu(t,e.prev,e))||Pu(t,e)&&Cu(t.prev,t,t.next)>0&&Cu(e.prev,e,e.next)>0)}function Cu(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function Pu(t,e){return t.x===e.x&&t.y===e.y}function Ru(t,e,i,n){const r=ku(Cu(t,e,i)),o=ku(Cu(t,e,n)),s=ku(Cu(i,n,t)),a=ku(Cu(i,n,e));return r!==o&&s!==a||(!(0!==r||!Ou(t,i,e))||(!(0!==o||!Ou(t,n,e))||(!(0!==s||!Ou(i,t,n))||!(0!==a||!Ou(i,e,n)))))}function Ou(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function ku(t){return t>0?1:t<0?-1:0}function Du(t,e){let i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&Ru(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}function Iu(t,e){return Cu(t.prev,t,t.next)<0?Cu(t,e,t.next)>=0&&Cu(t,t.prev,e)>=0:Cu(t,e,t.prev)<0||Cu(t,t.next,e)<0}function Nu(t,e){let i=t,n=!1,r=(t.x+e.x)/2,o=(t.y+e.y)/2;do{i.y>o!==i.next.y>o&&i.next.y!==i.y&&r<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}function Bu(t,e){let i=new Uu(t.i,t.x,t.y),n=new Uu(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,n.next=i,i.prev=n,o.next=n,n.prev=o,n}function zu(t,e,i,n){const r=new Uu(t,e,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function Fu(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Uu(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Gu(t,e,i,n){let r=0;for(let o=e,s=i-n;o<i;o+=n)r+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return r}const Hu={area:function(t){const e=t.length;let i=0;for(let n=e-1,r=0;r<e;n=r++)i+=t[n].x*t[r].y-t[r].x*t[n].y;return.5*i},isClockWise:function(t){return Hu.area(t)<0},triangulateShape:function(t,e){const i=[],n=[],r=[];ju(t),Wu(i,t);let o=t.length;e.forEach(ju);for(let a=0;a<e.length;a++)n.push(o),o+=e[a].length,Wu(i,e[a]);const s=hu.triangulate(i,n);for(let a=0;a<s.length;a+=3)r.push(s.slice(a,a+3));return r}};function ju(t){const e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function Wu(t,e){for(let i=0;i<e.length;i++)t.push(e[i].x),t.push(e[i].y)}function Vu(t,e){Nr.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},this.fromBufferGeometry(new Xu(t,e)),this.mergeVertices()}function Xu(t,e){ur.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:t,options:e},t=Array.isArray(t)?t:[t];const i=this,n=[],r=[];for(let s=0,a=t.length;s<a;s++){const e=t[s];o(e)}function o(t){const o=[],s=void 0!==e.curveSegments?e.curveSegments:12,a=void 0!==e.steps?e.steps:1;let l=void 0!==e.depth?e.depth:100,c=void 0===e.bevelEnabled||e.bevelEnabled,h=void 0!==e.bevelThickness?e.bevelThickness:6,u=void 0!==e.bevelSize?e.bevelSize:h-2,d=void 0!==e.bevelOffset?e.bevelOffset:0,p=void 0!==e.bevelSegments?e.bevelSegments:3;const f=e.extrudePath,m=void 0!==e.UVGenerator?e.UVGenerator:Yu;void 0!==e.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),l=e.amount);let g,v,y,x,b,w=!1;f&&(g=f.getSpacedPoints(a),w=!0,c=!1,v=f.computeFrenetFrames(a,!1),y=new yi,x=new yi,b=new yi),c||(p=0,h=0,u=0,d=0);const _=t.extractPoints(s);let M=_.shape;const S=_.holes,T=!Hu.isClockWise(M);if(T){M=M.reverse();for(let t=0,e=S.length;t<e;t++){const e=S[t];Hu.isClockWise(e)&&(S[t]=e.reverse())}}const E=Hu.triangulateShape(M,S),A=M;for(let e=0,i=S.length;e<i;e++){const t=S[e];M=M.concat(t)}function L(t,e,i){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().multiplyScalar(i).add(t)}const C=M.length,P=E.length;function R(t,e,i){let n,r,o;const s=t.x-e.x,a=t.y-e.y,l=i.x-t.x,c=i.y-t.y,h=s*s+a*a,u=s*c-a*l;if(Math.abs(u)>Number.EPSILON){const u=Math.sqrt(h),d=Math.sqrt(l*l+c*c),p=e.x-a/u,f=e.y+s/u,m=i.x-c/d,g=i.y+l/d,v=((m-p)*c-(g-f)*l)/(s*c-a*l);n=p+s*v-t.x,r=f+a*v-t.y;const y=n*n+r*r;if(y<=2)return new si(n,r);o=Math.sqrt(y/2)}else{let t=!1;s>Number.EPSILON?l>Number.EPSILON&&(t=!0):s<-Number.EPSILON?l<-Number.EPSILON&&(t=!0):Math.sign(a)===Math.sign(c)&&(t=!0),t?(n=-a,r=s,o=Math.sqrt(h)):(n=s,r=a,o=Math.sqrt(h/2))}return new si(n/o,r/o)}const O=[];for(let e=0,i=A.length,n=i-1,r=e+1;e<i;e++,n++,r++)n===i&&(n=0),r===i&&(r=0),O[e]=R(A[e],A[n],A[r]);const k=[];let D,I=O.concat();for(let e=0,i=S.length;e<i;e++){const t=S[e];D=[];for(let e=0,i=t.length,n=i-1,r=e+1;e<i;e++,n++,r++)n===i&&(n=0),r===i&&(r=0),D[e]=R(t[e],t[n],t[r]);k.push(D),I=I.concat(D)}for(let e=0;e<p;e++){const t=e/p,i=h*Math.cos(t*Math.PI/2),n=u*Math.sin(t*Math.PI/2)+d;for(let e=0,r=A.length;e<r;e++){const t=L(A[e],O[e],n);U(t.x,t.y,-i)}for(let e=0,r=S.length;e<r;e++){const t=S[e];D=k[e];for(let e=0,r=t.length;e<r;e++){const r=L(t[e],D[e],n);U(r.x,r.y,-i)}}}const N=u+d;for(let e=0;e<C;e++){const t=c?L(M[e],I[e],N):M[e];w?(x.copy(v.normals[0]).multiplyScalar(t.x),y.copy(v.binormals[0]).multiplyScalar(t.y),b.copy(g[0]).add(x).add(y),U(b.x,b.y,b.z)):U(t.x,t.y,0)}for(let e=1;e<=a;e++)for(let t=0;t<C;t++){const i=c?L(M[t],I[t],N):M[t];w?(x.copy(v.normals[e]).multiplyScalar(i.x),y.copy(v.binormals[e]).multiplyScalar(i.y),b.copy(g[e]).add(x).add(y),U(b.x,b.y,b.z)):U(i.x,i.y,l/a*e)}for(let e=p-1;e>=0;e--){const t=e/p,i=h*Math.cos(t*Math.PI/2),n=u*Math.sin(t*Math.PI/2)+d;for(let e=0,r=A.length;e<r;e++){const t=L(A[e],O[e],n);U(t.x,t.y,l+i)}for(let e=0,r=S.length;e<r;e++){const t=S[e];D=k[e];for(let e=0,r=t.length;e<r;e++){const r=L(t[e],D[e],n);w?U(r.x,r.y+g[a-1].y,g[a-1].x+i):U(r.x,r.y,l+i)}}}function B(){const t=n.length/3;if(c){let t=0,e=C*t;for(let i=0;i<P;i++){const t=E[i];G(t[2]+e,t[1]+e,t[0]+e)}t=a+2*p,e=C*t;for(let i=0;i<P;i++){const t=E[i];G(t[0]+e,t[1]+e,t[2]+e)}}else{for(let t=0;t<P;t++){const e=E[t];G(e[2],e[1],e[0])}for(let t=0;t<P;t++){const e=E[t];G(e[0]+C*a,e[1]+C*a,e[2]+C*a)}}i.addGroup(t,n.length/3-t,0)}function z(){const t=n.length/3;let e=0;F(A,e),e+=A.length;for(let i=0,n=S.length;i<n;i++){const t=S[i];F(t,e),e+=t.length}i.addGroup(t,n.length/3-t,1)}function F(t,e){let i=t.length;while(--i>=0){const n=i;let r=i-1;r<0&&(r=t.length-1);for(let t=0,i=a+2*p;t<i;t++){const i=C*t,o=C*(t+1),s=e+n+i,a=e+r+i,l=e+r+o,c=e+n+o;H(s,a,l,c)}}}function U(t,e,i){o.push(t),o.push(e),o.push(i)}function G(t,e,r){j(t),j(e),j(r);const o=n.length/3,s=m.generateTopUV(i,n,o-3,o-2,o-1);W(s[0]),W(s[1]),W(s[2])}function H(t,e,r,o){j(t),j(e),j(o),j(e),j(r),j(o);const s=n.length/3,a=m.generateSideWallUV(i,n,s-6,s-3,s-2,s-1);W(a[0]),W(a[1]),W(a[3]),W(a[1]),W(a[2]),W(a[3])}function j(t){n.push(o[3*t+0]),n.push(o[3*t+1]),n.push(o[3*t+2])}function W(t){r.push(t.x),r.push(t.y)}B(),z()}this.setAttribute("position",new tr(n,3)),this.setAttribute("uv",new tr(r,2)),this.computeVertexNormals()}Vu.prototype=Object.create(Nr.prototype),Vu.prototype.constructor=Vu,Vu.prototype.toJSON=function(){const t=Nr.prototype.toJSON.call(this),e=this.parameters.shapes,i=this.parameters.options;return qu(e,i,t)},Xu.prototype=Object.create(ur.prototype),Xu.prototype.constructor=Xu,Xu.prototype.toJSON=function(){const t=ur.prototype.toJSON.call(this),e=this.parameters.shapes,i=this.parameters.options;return qu(e,i,t)};const Yu={generateTopUV:function(t,e,i,n,r){const o=e[3*i],s=e[3*i+1],a=e[3*n],l=e[3*n+1],c=e[3*r],h=e[3*r+1];return[new si(o,s),new si(a,l),new si(c,h)]},generateSideWallUV:function(t,e,i,n,r,o){const s=e[3*i],a=e[3*i+1],l=e[3*i+2],c=e[3*n],h=e[3*n+1],u=e[3*n+2],d=e[3*r],p=e[3*r+1],f=e[3*r+2],m=e[3*o],g=e[3*o+1],v=e[3*o+2];return Math.abs(a-h)<.01?[new si(s,1-l),new si(c,1-u),new si(d,1-f),new si(m,1-v)]:[new si(a,1-l),new si(h,1-u),new si(p,1-f),new si(g,1-v)]}};function qu(t,e,i){if(i.shapes=[],Array.isArray(t))for(let n=0,r=t.length;n<r;n++){const e=t[n];i.shapes.push(e.uuid)}else i.shapes.push(t.uuid);return void 0!==e.extrudePath&&(i.options.extrudePath=e.extrudePath.toJSON()),i}function Zu(t,e){Nr.call(this),this.type="TextGeometry",this.parameters={text:t,parameters:e},this.fromBufferGeometry(new Ju(t,e)),this.mergeVertices()}function Ju(t,e){e=e||{};const i=e.font;if(!i||!i.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new Nr;const n=i.generateShapes(t,e.size);e.depth=void 0!==e.height?e.height:50,void 0===e.bevelThickness&&(e.bevelThickness=10),void 0===e.bevelSize&&(e.bevelSize=8),void 0===e.bevelEnabled&&(e.bevelEnabled=!1),Xu.call(this,n,e),this.type="TextBufferGeometry"}function Ku(t,e,i,n,r,o,s){Nr.call(this),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:i,phiStart:n,phiLength:r,thetaStart:o,thetaLength:s},this.fromBufferGeometry(new $u(t,e,i,n,r,o,s)),this.mergeVertices()}function $u(t,e,i,n,r,o,s){ur.call(this),this.type="SphereBufferGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:i,phiStart:n,phiLength:r,thetaStart:o,thetaLength:s},t=t||1,e=Math.max(3,Math.floor(e)||8),i=Math.max(2,Math.floor(i)||6),n=void 0!==n?n:0,r=void 0!==r?r:2*Math.PI,o=void 0!==o?o:0,s=void 0!==s?s:Math.PI;const a=Math.min(o+s,Math.PI);let l=0;const c=[],h=new yi,u=new yi,d=[],p=[],f=[],m=[];for(let g=0;g<=i;g++){const d=[],v=g/i;let y=0;0==g&&0==o?y=.5/e:g==i&&a==Math.PI&&(y=-.5/e);for(let i=0;i<=e;i++){const a=i/e;h.x=-t*Math.cos(n+a*r)*Math.sin(o+v*s),h.y=t*Math.cos(o+v*s),h.z=t*Math.sin(n+a*r)*Math.sin(o+v*s),p.push(h.x,h.y,h.z),u.copy(h).normalize(),f.push(u.x,u.y,u.z),m.push(a+y,1-v),d.push(l++)}c.push(d)}for(let g=0;g<i;g++)for(let t=0;t<e;t++){const e=c[g][t+1],n=c[g][t],r=c[g+1][t],s=c[g+1][t+1];(0!==g||o>0)&&d.push(e,n,s),(g!==i-1||a<Math.PI)&&d.push(n,r,s)}this.setIndex(d),this.setAttribute("position",new tr(p,3)),this.setAttribute("normal",new tr(f,3)),this.setAttribute("uv",new tr(m,2))}function Qu(t,e,i,n,r,o){Nr.call(this),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:i,phiSegments:n,thetaStart:r,thetaLength:o},this.fromBufferGeometry(new td(t,e,i,n,r,o)),this.mergeVertices()}function td(t,e,i,n,r,o){ur.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:i,phiSegments:n,thetaStart:r,thetaLength:o},t=t||.5,e=e||1,r=void 0!==r?r:0,o=void 0!==o?o:2*Math.PI,i=void 0!==i?Math.max(3,i):8,n=void 0!==n?Math.max(1,n):1;const s=[],a=[],l=[],c=[];let h=t;const u=(e-t)/n,d=new yi,p=new si;for(let f=0;f<=n;f++){for(let t=0;t<=i;t++){const n=r+t/i*o;d.x=h*Math.cos(n),d.y=h*Math.sin(n),a.push(d.x,d.y,d.z),l.push(0,0,1),p.x=(d.x/e+1)/2,p.y=(d.y/e+1)/2,c.push(p.x,p.y)}h+=u}for(let f=0;f<n;f++){const t=f*(i+1);for(let e=0;e<i;e++){const n=e+t,r=n,o=n+i+1,a=n+i+2,l=n+1;s.push(r,o,l),s.push(o,a,l)}}this.setIndex(s),this.setAttribute("position",new tr(a,3)),this.setAttribute("normal",new tr(l,3)),this.setAttribute("uv",new tr(c,2))}function ed(t,e,i,n){Nr.call(this),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:i,phiLength:n},this.fromBufferGeometry(new id(t,e,i,n)),this.mergeVertices()}function id(t,e,i,n){ur.call(this),this.type="LatheBufferGeometry",this.parameters={points:t,segments:e,phiStart:i,phiLength:n},e=Math.floor(e)||12,i=i||0,n=n||2*Math.PI,n=oi.clamp(n,0,2*Math.PI);const r=[],o=[],s=[],a=1/e,l=new yi,c=new si;for(let h=0;h<=e;h++){const r=i+h*a*n,u=Math.sin(r),d=Math.cos(r);for(let i=0;i<=t.length-1;i++)l.x=t[i].x*u,l.y=t[i].y,l.z=t[i].x*d,o.push(l.x,l.y,l.z),c.x=h/e,c.y=i/(t.length-1),s.push(c.x,c.y)}for(let h=0;h<e;h++)for(let e=0;e<t.length-1;e++){const i=e+h*t.length,n=i,o=i+t.length,s=i+t.length+1,a=i+1;r.push(n,o,a),r.push(o,s,a)}if(this.setIndex(r),this.setAttribute("position",new tr(o,3)),this.setAttribute("uv",new tr(s,2)),this.computeVertexNormals(),n===2*Math.PI){const i=this.attributes.normal.array,n=new yi,r=new yi,o=new yi,s=e*t.length*3;for(let e=0,a=0;e<t.length;e++,a+=3)n.x=i[a+0],n.y=i[a+1],n.z=i[a+2],r.x=i[s+a+0],r.y=i[s+a+1],r.z=i[s+a+2],o.addVectors(n,r).normalize(),i[a+0]=i[s+a+0]=o.x,i[a+1]=i[s+a+1]=o.y,i[a+2]=i[s+a+2]=o.z}}function nd(t,e){Nr.call(this),this.type="ShapeGeometry","object"===typeof e&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),e=e.curveSegments),this.parameters={shapes:t,curveSegments:e},this.fromBufferGeometry(new rd(t,e)),this.mergeVertices()}function rd(t,e){ur.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:t,curveSegments:e},e=e||12;const i=[],n=[],r=[],o=[];let s=0,a=0;if(!1===Array.isArray(t))l(t);else for(let c=0;c<t.length;c++)l(t[c]),this.addGroup(s,a,c),s+=a,a=0;function l(t){const s=n.length/3,l=t.extractPoints(e);let c=l.shape;const h=l.holes;!1===Hu.isClockWise(c)&&(c=c.reverse());for(let e=0,i=h.length;e<i;e++){const t=h[e];!0===Hu.isClockWise(t)&&(h[e]=t.reverse())}const u=Hu.triangulateShape(c,h);for(let e=0,i=h.length;e<i;e++){const t=h[e];c=c.concat(t)}for(let e=0,i=c.length;e<i;e++){const t=c[e];n.push(t.x,t.y,0),r.push(0,0,1),o.push(t.x,t.y)}for(let e=0,n=u.length;e<n;e++){const t=u[e],n=t[0]+s,r=t[1]+s,o=t[2]+s;i.push(n,r,o),a+=3}}this.setIndex(i),this.setAttribute("position",new tr(n,3)),this.setAttribute("normal",new tr(r,3)),this.setAttribute("uv",new tr(o,2))}function od(t,e){if(e.shapes=[],Array.isArray(t))for(let i=0,n=t.length;i<n;i++){const n=t[i];e.shapes.push(n.uuid)}else e.shapes.push(t.uuid);return e}function sd(t,e){ur.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:e},e=void 0!==e?e:1;const i=[],n=Math.cos(oi.DEG2RAD*e),r=[0,0],o={};let s,a,l;const c=["a","b","c"];let h;t.isBufferGeometry?(h=new Nr,h.fromBufferGeometry(t)):h=t.clone(),h.mergeVertices(),h.computeFaceNormals();const u=h.vertices,d=h.faces;for(let p=0,f=d.length;p<f;p++){const t=d[p];for(let e=0;e<3;e++)s=t[c[e]],a=t[c[(e+1)%3]],r[0]=Math.min(s,a),r[1]=Math.max(s,a),l=r[0]+","+r[1],void 0===o[l]?o[l]={index1:r[0],index2:r[1],face1:p,face2:void 0}:o[l].face2=p}for(l in o){const t=o[l];if(void 0===t.face2||d[t.face1].normal.dot(d[t.face2].normal)<=n){let e=u[t.index1];i.push(e.x,e.y,e.z),e=u[t.index2],i.push(e.x,e.y,e.z)}}this.setAttribute("position",new tr(i,3))}function ad(t,e,i,n,r,o,s,a){Nr.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:i,radialSegments:n,heightSegments:r,openEnded:o,thetaStart:s,thetaLength:a},this.fromBufferGeometry(new ld(t,e,i,n,r,o,s,a)),this.mergeVertices()}function ld(t,e,i,n,r,o,s,a){ur.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:i,radialSegments:n,heightSegments:r,openEnded:o,thetaStart:s,thetaLength:a};const l=this;t=void 0!==t?t:1,e=void 0!==e?e:1,i=i||1,n=Math.floor(n)||8,r=Math.floor(r)||1,o=void 0!==o&&o,s=void 0!==s?s:0,a=void 0!==a?a:2*Math.PI;const c=[],h=[],u=[],d=[];let p=0;const f=[],m=i/2;let g=0;function v(){const o=new yi,v=new yi;let y=0;const x=(e-t)/i;for(let l=0;l<=r;l++){const c=[],g=l/r,y=g*(e-t)+t;for(let t=0;t<=n;t++){const e=t/n,r=e*a+s,l=Math.sin(r),f=Math.cos(r);v.x=y*l,v.y=-g*i+m,v.z=y*f,h.push(v.x,v.y,v.z),o.set(l,x,f).normalize(),u.push(o.x,o.y,o.z),d.push(e,1-g),c.push(p++)}f.push(c)}for(let t=0;t<n;t++)for(let e=0;e<r;e++){const i=f[e][t],n=f[e+1][t],r=f[e+1][t+1],o=f[e][t+1];c.push(i,n,o),c.push(n,r,o),y+=6}l.addGroup(g,y,0),g+=y}function y(i){let r,o;const f=new si,v=new yi;let y=0;const x=!0===i?t:e,b=!0===i?1:-1;r=p;for(let t=1;t<=n;t++)h.push(0,m*b,0),u.push(0,b,0),d.push(.5,.5),p++;o=p;for(let t=0;t<=n;t++){const e=t/n,i=e*a+s,r=Math.cos(i),o=Math.sin(i);v.x=x*o,v.y=m*b,v.z=x*r,h.push(v.x,v.y,v.z),u.push(0,b,0),f.x=.5*r+.5,f.y=.5*o*b+.5,d.push(f.x,f.y),p++}for(let t=0;t<n;t++){const e=r+t,n=o+t;!0===i?c.push(n,n+1,e):c.push(n+1,n,e),y+=3}l.addGroup(g,y,!0===i?1:2),g+=y}v(),!1===o&&(t>0&&y(!0),e>0&&y(!1)),this.setIndex(c),this.setAttribute("position",new tr(h,3)),this.setAttribute("normal",new tr(u,3)),this.setAttribute("uv",new tr(d,2))}function cd(t,e,i,n,r,o,s){ad.call(this,0,t,e,i,n,r,o,s),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:i,heightSegments:n,openEnded:r,thetaStart:o,thetaLength:s}}function hd(t,e,i,n,r,o,s){ld.call(this,0,t,e,i,n,r,o,s),this.type="ConeBufferGeometry",this.parameters={radius:t,height:e,radialSegments:i,heightSegments:n,openEnded:r,thetaStart:o,thetaLength:s}}function ud(t,e,i,n){Nr.call(this),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:i,thetaLength:n},this.fromBufferGeometry(new dd(t,e,i,n)),this.mergeVertices()}function dd(t,e,i,n){ur.call(this),this.type="CircleBufferGeometry",this.parameters={radius:t,segments:e,thetaStart:i,thetaLength:n},t=t||1,e=void 0!==e?Math.max(3,e):8,i=void 0!==i?i:0,n=void 0!==n?n:2*Math.PI;const r=[],o=[],s=[],a=[],l=new yi,c=new si;o.push(0,0,0),s.push(0,0,1),a.push(.5,.5);for(let h=0,u=3;h<=e;h++,u+=3){const r=i+h/e*n;l.x=t*Math.cos(r),l.y=t*Math.sin(r),o.push(l.x,l.y,l.z),s.push(0,0,1),c.x=(o[u]/t+1)/2,c.y=(o[u+1]/t+1)/2,a.push(c.x,c.y)}for(let h=1;h<=e;h++)r.push(h,h+1,0);this.setIndex(r),this.setAttribute("position",new tr(o,3)),this.setAttribute("normal",new tr(s,3)),this.setAttribute("uv",new tr(a,2))}Zu.prototype=Object.create(Nr.prototype),Zu.prototype.constructor=Zu,Ju.prototype=Object.create(Xu.prototype),Ju.prototype.constructor=Ju,Ku.prototype=Object.create(Nr.prototype),Ku.prototype.constructor=Ku,$u.prototype=Object.create(ur.prototype),$u.prototype.constructor=$u,Qu.prototype=Object.create(Nr.prototype),Qu.prototype.constructor=Qu,td.prototype=Object.create(ur.prototype),td.prototype.constructor=td,ed.prototype=Object.create(Nr.prototype),ed.prototype.constructor=ed,id.prototype=Object.create(ur.prototype),id.prototype.constructor=id,nd.prototype=Object.create(Nr.prototype),nd.prototype.constructor=nd,nd.prototype.toJSON=function(){const t=Nr.prototype.toJSON.call(this),e=this.parameters.shapes;return od(e,t)},rd.prototype=Object.create(ur.prototype),rd.prototype.constructor=rd,rd.prototype.toJSON=function(){const t=ur.prototype.toJSON.call(this),e=this.parameters.shapes;return od(e,t)},sd.prototype=Object.create(ur.prototype),sd.prototype.constructor=sd,ad.prototype=Object.create(Nr.prototype),ad.prototype.constructor=ad,ld.prototype=Object.create(ur.prototype),ld.prototype.constructor=ld,cd.prototype=Object.create(ad.prototype),cd.prototype.constructor=cd,hd.prototype=Object.create(ld.prototype),hd.prototype.constructor=hd,ud.prototype=Object.create(Nr.prototype),ud.prototype.constructor=ud,dd.prototype=Object.create(ur.prototype),dd.prototype.constructor=dd;var pd=Object.freeze({__proto__:null,WireframeGeometry:Vh,ParametricGeometry:Xh,ParametricBufferGeometry:Yh,TetrahedronGeometry:Jh,TetrahedronBufferGeometry:Kh,OctahedronGeometry:$h,OctahedronBufferGeometry:Qh,IcosahedronGeometry:tu,IcosahedronBufferGeometry:eu,DodecahedronGeometry:iu,DodecahedronBufferGeometry:nu,PolyhedronGeometry:qh,PolyhedronBufferGeometry:Zh,TubeGeometry:ru,TubeBufferGeometry:ou,TorusKnotGeometry:su,TorusKnotBufferGeometry:au,TorusGeometry:lu,TorusBufferGeometry:cu,TextGeometry:Zu,TextBufferGeometry:Ju,SphereGeometry:Ku,SphereBufferGeometry:$u,RingGeometry:Qu,RingBufferGeometry:td,PlaneGeometry:ro,PlaneBufferGeometry:oo,LatheGeometry:ed,LatheBufferGeometry:id,ShapeGeometry:nd,ShapeBufferGeometry:rd,ExtrudeGeometry:Vu,ExtrudeBufferGeometry:Xu,EdgesGeometry:sd,ConeGeometry:cd,ConeBufferGeometry:hd,CylinderGeometry:ad,CylinderBufferGeometry:ld,CircleGeometry:ud,CircleBufferGeometry:dd,BoxGeometry:Br,BoxBufferGeometry:zr});function fd(t){Hn.call(this),this.type="ShadowMaterial",this.color=new Nn(0),this.transparent=!0,this.setValues(t)}function md(t){Wr.call(this,t),this.type="RawShaderMaterial"}function gd(t){Hn.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Nn(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Nn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ke,this.normalScale=new si(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.vertexTangents=!1,this.setValues(t)}function vd(t){gd.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new si(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,this.sheen=null,this.transparency=0,this.setValues(t)}function yd(t){Hn.call(this),this.type="MeshPhongMaterial",this.color=new Nn(16777215),this.specular=new Nn(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Nn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ke,this.normalScale=new si(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=X,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function xd(t){Hn.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Nn(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Nn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ke,this.normalScale=new si(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function bd(t){Hn.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ke,this.normalScale=new si(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function wd(t){Hn.call(this),this.type="MeshLambertMaterial",this.color=new Nn(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Nn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=X,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function _d(t){Hn.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Nn(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ke,this.normalScale=new si(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Md(t){Mh.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}fd.prototype=Object.create(Hn.prototype),fd.prototype.constructor=fd,fd.prototype.isShadowMaterial=!0,fd.prototype.copy=function(t){return Hn.prototype.copy.call(this,t),this.color.copy(t.color),this},md.prototype=Object.create(Wr.prototype),md.prototype.constructor=md,md.prototype.isRawShaderMaterial=!0,gd.prototype=Object.create(Hn.prototype),gd.prototype.constructor=gd,gd.prototype.isMeshStandardMaterial=!0,gd.prototype.copy=function(t){return Hn.prototype.copy.call(this,t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.vertexTangents=t.vertexTangents,this},vd.prototype=Object.create(gd.prototype),vd.prototype.constructor=vd,vd.prototype.isMeshPhysicalMaterial=!0,vd.prototype.copy=function(t){return gd.prototype.copy.call(this,t),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.reflectivity=t.reflectivity,t.sheen?this.sheen=(this.sheen||new Nn).copy(t.sheen):this.sheen=null,this.transparency=t.transparency,this},yd.prototype=Object.create(Hn.prototype),yd.prototype.constructor=yd,yd.prototype.isMeshPhongMaterial=!0,yd.prototype.copy=function(t){return Hn.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},xd.prototype=Object.create(Hn.prototype),xd.prototype.constructor=xd,xd.prototype.isMeshToonMaterial=!0,xd.prototype.copy=function(t){return Hn.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},bd.prototype=Object.create(Hn.prototype),bd.prototype.constructor=bd,bd.prototype.isMeshNormalMaterial=!0,bd.prototype.copy=function(t){return Hn.prototype.copy.call(this,t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},wd.prototype=Object.create(Hn.prototype),wd.prototype.constructor=wd,wd.prototype.isMeshLambertMaterial=!0,wd.prototype.copy=function(t){return Hn.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},_d.prototype=Object.create(Hn.prototype),_d.prototype.constructor=_d,_d.prototype.isMeshMatcapMaterial=!0,_d.prototype.copy=function(t){return Hn.prototype.copy.call(this,t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Md.prototype=Object.create(Mh.prototype),Md.prototype.constructor=Md,Md.prototype.isLineDashedMaterial=!0,Md.prototype.copy=function(t){return Mh.prototype.copy.call(this,t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this};var Sd=Object.freeze({__proto__:null,ShadowMaterial:fd,SpriteMaterial:qc,RawShaderMaterial:md,ShaderMaterial:Wr,PointsMaterial:Dh,MeshPhysicalMaterial:vd,MeshStandardMaterial:gd,MeshPhongMaterial:yd,MeshToonMaterial:xd,MeshNormalMaterial:bd,MeshLambertMaterial:wd,MeshDepthMaterial:Lc,MeshDistanceMaterial:Cc,MeshBasicMaterial:jn,MeshMatcapMaterial:_d,LineDashedMaterial:Md,LineBasicMaterial:Mh,Material:Hn});const Td={arraySlice:function(t,e,i){return Td.isTypedArray(t)?new t.constructor(t.subarray(e,void 0!==i?i:t.length)):t.slice(e,i)},convertArray:function(t,e,i){return!t||!i&&t.constructor===e?t:"number"===typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(t){function e(e,i){return t[e]-t[i]}const i=t.length,n=new Array(i);for(let r=0;r!==i;++r)n[r]=r;return n.sort(e),n},sortedArray:function(t,e,i){const n=t.length,r=new t.constructor(n);for(let o=0,s=0;s!==n;++o){const n=i[o]*e;for(let i=0;i!==e;++i)r[s++]=t[n+i]}return r},flattenJSON:function(t,e,i,n){let r=1,o=t[0];while(void 0!==o&&void 0===o[n])o=t[r++];if(void 0===o)return;let s=o[n];if(void 0!==s)if(Array.isArray(s))do{s=o[n],void 0!==s&&(e.push(o.time),i.push.apply(i,s)),o=t[r++]}while(void 0!==o);else if(void 0!==s.toArray)do{s=o[n],void 0!==s&&(e.push(o.time),s.toArray(i,i.length)),o=t[r++]}while(void 0!==o);else do{s=o[n],void 0!==s&&(e.push(o.time),i.push(s)),o=t[r++]}while(void 0!==o)},subclip:function(t,e,i,n,r){r=r||30;const o=t.clone();o.name=e;const s=[];for(let l=0;l<o.tracks.length;++l){const t=o.tracks[l],e=t.getValueSize(),a=[],c=[];for(let o=0;o<t.times.length;++o){const s=t.times[o]*r;if(!(s<i||s>=n)){a.push(t.times[o]);for(let i=0;i<e;++i)c.push(t.values[o*e+i])}}0!==a.length&&(t.times=Td.convertArray(a,t.times.constructor),t.values=Td.convertArray(c,t.values.constructor),s.push(t))}o.tracks=s;let a=1/0;for(let l=0;l<o.tracks.length;++l)a>o.tracks[l].times[0]&&(a=o.tracks[l].times[0]);for(let l=0;l<o.tracks.length;++l)o.tracks[l].shift(-1*a);return o.resetDuration(),o},makeClipAdditive:function(t,e,i,n){void 0===e&&(e=0),void 0===i&&(i=t),(void 0===n||n<=0)&&(n=30);const r=t.tracks.length,o=e/n;for(let s=0;s<r;++s){const e=i.tracks[s],n=e.ValueTypeName;if("bool"===n||"string"===n)continue;const r=t.tracks.find((function(t){return t.name===e.name&&t.ValueTypeName===n}));if(void 0===r)continue;const a=e.getValueSize(),l=e.times.length-1;let c;if(o<=e.times[0])c=Td.arraySlice(e.values,0,e.valueSize);else if(o>=e.times[l]){const t=l*a;c=Td.arraySlice(e.values,t)}else{const t=e.createInterpolant();t.evaluate(o),c=t.resultBuffer}if("quaternion"===n){const t=new mi(c[0],c[1],c[2],c[3]).normalize().conjugate();t.toArray(c)}const h=r.times.length;for(let t=0;t<h;++t){const e=t*a;if("quaternion"===n)mi.multiplyQuaternionsFlat(r.values,e,c,0,r.values,e);else for(let t=0;t<a;++t)r.values[e+t]-=c[t]}}return t.blendMode=Fe,t}};function Ed(t,e,i,n){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==n?n:new e.constructor(i),this.sampleValues=e,this.valueSize=i}function Ad(t,e,i,n){Ed.call(this,t,e,i,n),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function Ld(t,e,i,n){Ed.call(this,t,e,i,n)}function Cd(t,e,i,n){Ed.call(this,t,e,i,n)}function Pd(t,e,i,n){if(void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=Td.convertArray(e,this.TimeBufferType),this.values=Td.convertArray(i,this.ValueBufferType),this.setInterpolation(n||this.DefaultInterpolation)}function Rd(t,e,i){Pd.call(this,t,e,i)}function Od(t,e,i,n){Pd.call(this,t,e,i,n)}function kd(t,e,i,n){Pd.call(this,t,e,i,n)}function Dd(t,e,i,n){Ed.call(this,t,e,i,n)}function Id(t,e,i,n){Pd.call(this,t,e,i,n)}function Nd(t,e,i,n){Pd.call(this,t,e,i,n)}function Bd(t,e,i,n){Pd.call(this,t,e,i,n)}function zd(t,e,i,n){this.name=t,this.tracks=i,this.duration=void 0!==e?e:-1,this.blendMode=void 0!==n?n:ze,this.uuid=oi.generateUUID(),this.duration<0&&this.resetDuration()}function Fd(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return kd;case"vector":case"vector2":case"vector3":case"vector4":return Bd;case"color":return Od;case"quaternion":return Id;case"bool":case"boolean":return Rd;case"string":return Nd}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}function Ud(t){if(void 0===t.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=Fd(t.type);if(void 0===t.times){const e=[],i=[];Td.flattenJSON(t.keys,e,i,"value"),t.times=e,t.values=i}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}Object.assign(Ed.prototype,{evaluate:function(t){let e=this.parameterPositions,i=this._cachedIndex,n=e[i],r=e[i-1];t:{e:{let o;i:{n:if(!(t<n)){for(let o=i+2;;){if(void 0===n){if(t<r)break n;return i=e.length,this._cachedIndex=i,this.afterEnd_(i-1,t,r)}if(i===o)break;if(r=n,n=e[++i],t<n)break e}o=e.length;break i}if(t>=r)break t;{const s=e[1];t<s&&(i=2,r=s);for(let o=i-2;;){if(void 0===r)return this._cachedIndex=0,this.beforeStart_(0,t,n);if(i===o)break;if(n=r,r=e[--i-1],t>=r)break e}o=i,i=0}}while(i<o){const n=i+o>>>1;t<e[n]?o=n:i=n+1}if(n=e[i],r=e[i-1],void 0===r)return this._cachedIndex=0,this.beforeStart_(0,t,n);if(void 0===n)return i=e.length,this._cachedIndex=i,this.afterEnd_(i-1,r,t)}this._cachedIndex=i,this.intervalChanged_(i,r,n)}return this.interpolate_(i,r,t,n)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(t){const e=this.resultBuffer,i=this.sampleValues,n=this.valueSize,r=t*n;for(let o=0;o!==n;++o)e[o]=i[r+o];return e},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),Object.assign(Ed.prototype,{beforeStart_:Ed.prototype.copySampleValue_,afterEnd_:Ed.prototype.copySampleValue_}),Ad.prototype=Object.assign(Object.create(Ed.prototype),{constructor:Ad,DefaultSettings_:{endingStart:Ie,endingEnd:Ie},intervalChanged_:function(t,e,i){let n=this.parameterPositions,r=t-2,o=t+1,s=n[r],a=n[o];if(void 0===s)switch(this.getSettings_().endingStart){case Ne:r=t,s=2*e-i;break;case Be:r=n.length-2,s=e+n[r]-n[r+1];break;default:r=t,s=i}if(void 0===a)switch(this.getSettings_().endingEnd){case Ne:o=t,a=2*i-e;break;case Be:o=1,a=i+n[1]-n[0];break;default:o=t-1,a=e}const l=.5*(i-e),c=this.valueSize;this._weightPrev=l/(e-s),this._weightNext=l/(a-i),this._offsetPrev=r*c,this._offsetNext=o*c},interpolate_:function(t,e,i,n){const r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=t*s,l=a-s,c=this._offsetPrev,h=this._offsetNext,u=this._weightPrev,d=this._weightNext,p=(i-e)/(n-e),f=p*p,m=f*p,g=-u*m+2*u*f-u*p,v=(1+u)*m+(-1.5-2*u)*f+(-.5+u)*p+1,y=(-1-d)*m+(1.5+d)*f+.5*p,x=d*m-d*f;for(let b=0;b!==s;++b)r[b]=g*o[c+b]+v*o[l+b]+y*o[a+b]+x*o[h+b];return r}}),Ld.prototype=Object.assign(Object.create(Ed.prototype),{constructor:Ld,interpolate_:function(t,e,i,n){const r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=t*s,l=a-s,c=(i-e)/(n-e),h=1-c;for(let u=0;u!==s;++u)r[u]=o[l+u]*h+o[a+u]*c;return r}}),Cd.prototype=Object.assign(Object.create(Ed.prototype),{constructor:Cd,interpolate_:function(t){return this.copySampleValue_(t-1)}}),Object.assign(Pd,{toJSON:function(t){const e=t.constructor;let i;if(void 0!==e.toJSON)i=e.toJSON(t);else{i={name:t.name,times:Td.convertArray(t.times,Array),values:Td.convertArray(t.values,Array)};const e=t.getInterpolation();e!==t.DefaultInterpolation&&(i.interpolation=e)}return i.type=t.ValueTypeName,i}}),Object.assign(Pd.prototype,{constructor:Pd,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:ke,InterpolantFactoryMethodDiscrete:function(t){return new Cd(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodLinear:function(t){return new Ld(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:function(t){return new Ad(this.times,this.values,this.getValueSize(),t)},setInterpolation:function(t){let e;switch(t){case Oe:e=this.InterpolantFactoryMethodDiscrete;break;case ke:e=this.InterpolantFactoryMethodLinear;break;case De:e=this.InterpolantFactoryMethodSmooth;break}if(void 0===e){const e="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(e);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",e),this}return this.createInterpolant=e,this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Oe;case this.InterpolantFactoryMethodLinear:return ke;case this.InterpolantFactoryMethodSmooth:return De}},getValueSize:function(){return this.values.length/this.times.length},shift:function(t){if(0!==t){const e=this.times;for(let i=0,n=e.length;i!==n;++i)e[i]+=t}return this},scale:function(t){if(1!==t){const e=this.times;for(let i=0,n=e.length;i!==n;++i)e[i]*=t}return this},trim:function(t,e){const i=this.times,n=i.length;let r=0,o=n-1;while(r!==n&&i[r]<t)++r;while(-1!==o&&i[o]>e)--o;if(++o,0!==r||o!==n){r>=o&&(o=Math.max(o,1),r=o-1);const t=this.getValueSize();this.times=Td.arraySlice(i,r,o),this.values=Td.arraySlice(this.values,r*t,o*t)}return this},validate:function(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);const i=this.times,n=this.values,r=i.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let o=null;for(let s=0;s!==r;s++){const e=i[s];if("number"===typeof e&&isNaN(e)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,s,e),t=!1;break}if(null!==o&&o>e){console.error("THREE.KeyframeTrack: Out of order keys.",this,s,e,o),t=!1;break}o=e}if(void 0!==n&&Td.isTypedArray(n))for(let s=0,a=n.length;s!==a;++s){const e=n[s];if(isNaN(e)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,s,e),t=!1;break}}return t},optimize:function(){const t=Td.arraySlice(this.times),e=Td.arraySlice(this.values),i=this.getValueSize(),n=this.getInterpolation()===De,r=t.length-1;let o=1;for(let s=1;s<r;++s){let r=!1;const a=t[s],l=t[s+1];if(a!==l&&(1!==s||a!==a[0]))if(n)r=!0;else{const t=s*i,n=t-i,o=t+i;for(let s=0;s!==i;++s){const i=e[t+s];if(i!==e[n+s]||i!==e[o+s]){r=!0;break}}}if(r){if(s!==o){t[o]=t[s];const n=s*i,r=o*i;for(let t=0;t!==i;++t)e[r+t]=e[n+t]}++o}}if(r>0){t[o]=t[r];for(let t=r*i,n=o*i,s=0;s!==i;++s)e[n+s]=e[t+s];++o}return o!==t.length?(this.times=Td.arraySlice(t,0,o),this.values=Td.arraySlice(e,0,o*i)):(this.times=t,this.values=e),this},clone:function(){const t=Td.arraySlice(this.times,0),e=Td.arraySlice(this.values,0),i=this.constructor,n=new i(this.name,t,e);return n.createInterpolant=this.createInterpolant,n}}),Rd.prototype=Object.assign(Object.create(Pd.prototype),{constructor:Rd,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:Oe,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Od.prototype=Object.assign(Object.create(Pd.prototype),{constructor:Od,ValueTypeName:"color"}),kd.prototype=Object.assign(Object.create(Pd.prototype),{constructor:kd,ValueTypeName:"number"}),Dd.prototype=Object.assign(Object.create(Ed.prototype),{constructor:Dd,interpolate_:function(t,e,i,n){const r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=(i-e)/(n-e);let l=t*s;for(let c=l+s;l!==c;l+=4)mi.slerpFlat(r,0,o,l-s,o,l,a);return r}}),Id.prototype=Object.assign(Object.create(Pd.prototype),{constructor:Id,ValueTypeName:"quaternion",DefaultInterpolation:ke,InterpolantFactoryMethodLinear:function(t){return new Dd(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),Nd.prototype=Object.assign(Object.create(Pd.prototype),{constructor:Nd,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:Oe,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Bd.prototype=Object.assign(Object.create(Pd.prototype),{constructor:Bd,ValueTypeName:"vector"}),Object.assign(zd,{parse:function(t){const e=[],i=t.tracks,n=1/(t.fps||1);for(let r=0,o=i.length;r!==o;++r)e.push(Ud(i[r]).scale(n));return new zd(t.name,t.duration,e,t.blendMode)},toJSON:function(t){const e=[],i=t.tracks,n={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let r=0,o=i.length;r!==o;++r)e.push(Pd.toJSON(i[r]));return n},CreateFromMorphTargetSequence:function(t,e,i,n){const r=e.length,o=[];for(let s=0;s<r;s++){let t=[],a=[];t.push((s+r-1)%r,s,(s+1)%r),a.push(0,1,0);const l=Td.getKeyframeOrder(t);t=Td.sortedArray(t,1,l),a=Td.sortedArray(a,1,l),n||0!==t[0]||(t.push(r),a.push(a[0])),o.push(new kd(".morphTargetInfluences["+e[s].name+"]",t,a).scale(1/i))}return new zd(t,-1,o)},findByName:function(t,e){let i=t;if(!Array.isArray(t)){const e=t;i=e.geometry&&e.geometry.animations||e.animations}for(let n=0;n<i.length;n++)if(i[n].name===e)return i[n];return null},CreateClipsFromMorphTargetSequences:function(t,e,i){const n={},r=/^([\w-]*?)([\d]+)$/;for(let s=0,a=t.length;s<a;s++){const e=t[s],i=e.name.match(r);if(i&&i.length>1){const t=i[1];let r=n[t];r||(n[t]=r=[]),r.push(e)}}const o=[];for(const s in n)o.push(zd.CreateFromMorphTargetSequence(s,n[s],e,i));return o},parseAnimation:function(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(t,e,i,n,r){if(0!==i.length){const o=[],s=[];Td.flattenJSON(i,o,s,n),0!==o.length&&r.push(new t(e,o,s))}},n=[],r=t.name||"default",o=t.fps||30,s=t.blendMode;let a=t.length||-1;const l=t.hierarchy||[];for(let h=0;h<l.length;h++){const t=l[h].keys;if(t&&0!==t.length)if(t[0].morphTargets){const e={};let i;for(i=0;i<t.length;i++)if(t[i].morphTargets)for(let n=0;n<t[i].morphTargets.length;n++)e[t[i].morphTargets[n]]=-1;for(const r in e){const e=[],o=[];for(let n=0;n!==t[i].morphTargets.length;++n){const n=t[i];e.push(n.time),o.push(n.morphTarget===r?1:0)}n.push(new kd(".morphTargetInfluence["+r+"]",e,o))}a=e.length*(o||1)}else{const r=".bones["+e[h].name+"]";i(Bd,r+".position",t,"pos",n),i(Id,r+".quaternion",t,"rot",n),i(Bd,r+".scale",t,"scl",n)}}if(0===n.length)return null;const c=new zd(r,a,n,s);return c}}),Object.assign(zd.prototype,{resetDuration:function(){const t=this.tracks;let e=0;for(let i=0,n=t.length;i!==n;++i){const t=this.tracks[i];e=Math.max(e,t.times[t.times.length-1])}return this.duration=e,this},trim:function(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this},validate:function(){let t=!0;for(let e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t},optimize:function(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this},clone:function(){const t=[];for(let e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new zd(this.name,this.duration,t,this.blendMode)}});const Gd={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};function Hd(t,e,i){const n=this;let r=!1,o=0,s=0,a=void 0;const l=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=i,this.itemStart=function(t){s++,!1===r&&void 0!==n.onStart&&n.onStart(t,o,s),r=!0},this.itemEnd=function(t){o++,void 0!==n.onProgress&&n.onProgress(t,o,s),o===s&&(r=!1,void 0!==n.onLoad&&n.onLoad())},this.itemError=function(t){void 0!==n.onError&&n.onError(t)},this.resolveURL=function(t){return a?a(t):t},this.setURLModifier=function(t){return a=t,this},this.addHandler=function(t,e){return l.push(t,e),this},this.removeHandler=function(t){const e=l.indexOf(t);return-1!==e&&l.splice(e,2),this},this.getHandler=function(t){for(let e=0,i=l.length;e<i;e+=2){const i=l[e],n=l[e+1];if(i.global&&(i.lastIndex=0),i.test(t))return n}return null}}const jd=new Hd;function Wd(t){this.manager=void 0!==t?t:jd,this.crossOrigin="anonymous",this.path="",this.resourcePath="",this.requestHeader={}}Object.assign(Wd.prototype,{load:function(){},loadAsync:function(t,e){const i=this;return new Promise((function(n,r){i.load(t,n,e,r)}))},parse:function(){},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this},setResourcePath:function(t){return this.resourcePath=t,this},setRequestHeader:function(t){return this.requestHeader=t,this}});const Vd={};function Xd(t){Wd.call(this,t)}function Yd(t){Wd.call(this,t)}function qd(t){Wd.call(this,t)}function Zd(t){Wd.call(this,t)}function Jd(t){Wd.call(this,t)}function Kd(t){Wd.call(this,t)}function $d(t){Wd.call(this,t)}function Qd(){this.type="Curve",this.arcLengthDivisions=200}function tp(t,e,i,n,r,o,s,a){Qd.call(this),this.type="EllipseCurve",this.aX=t||0,this.aY=e||0,this.xRadius=i||1,this.yRadius=n||1,this.aStartAngle=r||0,this.aEndAngle=o||2*Math.PI,this.aClockwise=s||!1,this.aRotation=a||0}function ep(t,e,i,n,r,o){tp.call(this,t,e,i,i,n,r,o),this.type="ArcCurve"}function ip(){let t=0,e=0,i=0,n=0;function r(r,o,s,a){t=r,e=s,i=-3*r+3*o-2*s-a,n=2*r-2*o+s+a}return{initCatmullRom:function(t,e,i,n,o){r(e,i,o*(i-t),o*(n-e))},initNonuniformCatmullRom:function(t,e,i,n,o,s,a){let l=(e-t)/o-(i-t)/(o+s)+(i-e)/s,c=(i-e)/s-(n-e)/(s+a)+(n-i)/a;l*=s,c*=s,r(e,i,l,c)},calc:function(r){const o=r*r,s=o*r;return t+e*r+i*o+n*s}}}Xd.prototype=Object.assign(Object.create(Wd.prototype),{constructor:Xd,load:function(t,e,i,n){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=this,o=Gd.get(t);if(void 0!==o)return r.manager.itemStart(t),setTimeout((function(){e&&e(o),r.manager.itemEnd(t)}),0),o;if(void 0!==Vd[t])return void Vd[t].push({onLoad:e,onProgress:i,onError:n});const s=/^data:(.*?)(;base64)?,(.*)$/,a=t.match(s);let l;if(a){const i=a[1],o=!!a[2];let s=a[3];s=decodeURIComponent(s),o&&(s=atob(s));try{let n;const o=(this.responseType||"").toLowerCase();switch(o){case"arraybuffer":case"blob":const t=new Uint8Array(s.length);for(let i=0;i<s.length;i++)t[i]=s.charCodeAt(i);n="blob"===o?new Blob([t.buffer],{type:i}):t.buffer;break;case"document":const e=new DOMParser;n=e.parseFromString(s,i);break;case"json":n=JSON.parse(s);break;default:n=s;break}setTimeout((function(){e&&e(n),r.manager.itemEnd(t)}),0)}catch(c){setTimeout((function(){n&&n(c),r.manager.itemError(t),r.manager.itemEnd(t)}),0)}}else{Vd[t]=[],Vd[t].push({onLoad:e,onProgress:i,onError:n}),l=new XMLHttpRequest,l.open("GET",t,!0),l.addEventListener("load",(function(e){const i=this.response,n=Vd[t];if(delete Vd[t],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),Gd.add(t,i);for(let t=0,e=n.length;t<e;t++){const e=n[t];e.onLoad&&e.onLoad(i)}r.manager.itemEnd(t)}else{for(let t=0,i=n.length;t<i;t++){const i=n[t];i.onError&&i.onError(e)}r.manager.itemError(t),r.manager.itemEnd(t)}}),!1),l.addEventListener("progress",(function(e){const i=Vd[t];for(let t=0,n=i.length;t<n;t++){const n=i[t];n.onProgress&&n.onProgress(e)}}),!1),l.addEventListener("error",(function(e){const i=Vd[t];delete Vd[t];for(let t=0,n=i.length;t<n;t++){const n=i[t];n.onError&&n.onError(e)}r.manager.itemError(t),r.manager.itemEnd(t)}),!1),l.addEventListener("abort",(function(e){const i=Vd[t];delete Vd[t];for(let t=0,n=i.length;t<n;t++){const n=i[t];n.onError&&n.onError(e)}r.manager.itemError(t),r.manager.itemEnd(t)}),!1),void 0!==this.responseType&&(l.responseType=this.responseType),void 0!==this.withCredentials&&(l.withCredentials=this.withCredentials),l.overrideMimeType&&l.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain");for(const t in this.requestHeader)l.setRequestHeader(t,this.requestHeader[t]);l.send(null)}return r.manager.itemStart(t),l},setResponseType:function(t){return this.responseType=t,this},setWithCredentials:function(t){return this.withCredentials=t,this},setMimeType:function(t){return this.mimeType=t,this}}),Yd.prototype=Object.assign(Object.create(Wd.prototype),{constructor:Yd,load:function(t,e,i,n){const r=this,o=new Xd(r.manager);o.setPath(r.path),o.load(t,(function(i){try{e(r.parse(JSON.parse(i)))}catch(o){n?n(o):console.error(o),r.manager.itemError(t)}}),i,n)},parse:function(t){const e=[];for(let i=0;i<t.length;i++){const n=zd.parse(t[i]);e.push(n)}return e}}),qd.prototype=Object.assign(Object.create(Wd.prototype),{constructor:qd,load:function(t,e,i,n){const r=this,o=[],s=new Hh;s.image=o;const a=new Xd(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer");let l=0;function c(c){a.load(t[c],(function(t){const i=r.parse(t,!0);o[c]={width:i.width,height:i.height,format:i.format,mipmaps:i.mipmaps},l+=1,6===l&&(1===i.mipmapCount&&(s.minFilter=ft),s.format=i.format,s.needsUpdate=!0,e&&e(s))}),i,n)}if(Array.isArray(t))for(let h=0,u=t.length;h<u;++h)c(h);else a.load(t,(function(t){const i=r.parse(t,!0);if(i.isCubemap){const t=i.mipmaps.length/i.mipmapCount;for(let e=0;e<t;e++){o[e]={mipmaps:[]};for(let t=0;t<i.mipmapCount;t++)o[e].mipmaps.push(i.mipmaps[e*i.mipmapCount+t]),o[e].format=i.format,o[e].width=i.width,o[e].height=i.height}}else s.image.width=i.width,s.image.height=i.height,s.mipmaps=i.mipmaps;1===i.mipmapCount&&(s.minFilter=ft),s.format=i.format,s.needsUpdate=!0,e&&e(s)}),i,n);return s}}),Zd.prototype=Object.assign(Object.create(Wd.prototype),{constructor:Zd,load:function(t,e,i,n){const r=this,o=new Kr,s=new Xd(this.manager);return s.setResponseType("arraybuffer"),s.setPath(this.path),s.load(t,(function(t){const i=r.parse(t);i&&(void 0!==i.image?o.image=i.image:void 0!==i.data&&(o.image.width=i.width,o.image.height=i.height,o.image.data=i.data),o.wrapS=void 0!==i.wrapS?i.wrapS:ct,o.wrapT=void 0!==i.wrapT?i.wrapT:ct,o.magFilter=void 0!==i.magFilter?i.magFilter:ft,o.minFilter=void 0!==i.minFilter?i.minFilter:ft,o.anisotropy=void 0!==i.anisotropy?i.anisotropy:1,void 0!==i.format&&(o.format=i.format),void 0!==i.type&&(o.type=i.type),void 0!==i.mipmaps&&(o.mipmaps=i.mipmaps,o.minFilter=gt),1===i.mipmapCount&&(o.minFilter=ft),o.needsUpdate=!0,e&&e(o,i))}),i,n),o}}),Jd.prototype=Object.assign(Object.create(Wd.prototype),{constructor:Jd,load:function(t,e,i,n){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=this,o=Gd.get(t);if(void 0!==o)return r.manager.itemStart(t),setTimeout((function(){e&&e(o),r.manager.itemEnd(t)}),0),o;const s=document.createElementNS("http://www.w3.org/1999/xhtml","img");function a(){s.removeEventListener("load",a,!1),s.removeEventListener("error",l,!1),Gd.add(t,this),e&&e(this),r.manager.itemEnd(t)}function l(e){s.removeEventListener("load",a,!1),s.removeEventListener("error",l,!1),n&&n(e),r.manager.itemError(t),r.manager.itemEnd(t)}return s.addEventListener("load",a,!1),s.addEventListener("error",l,!1),"data:"!==t.substr(0,5)&&void 0!==this.crossOrigin&&(s.crossOrigin=this.crossOrigin),r.manager.itemStart(t),s.src=t,s}}),Kd.prototype=Object.assign(Object.create(Wd.prototype),{constructor:Kd,load:function(t,e,i,n){const r=new Ga,o=new Jd(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let s=0;function a(i){o.load(t[i],(function(t){r.images[i]=t,s++,6===s&&(r.needsUpdate=!0,e&&e(r))}),void 0,n)}for(let l=0;l<t.length;++l)a(l);return r}}),$d.prototype=Object.assign(Object.create(Wd.prototype),{constructor:$d,load:function(t,e,i,n){const r=new ui,o=new Jd(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(t,(function(i){r.image=i;const n=t.search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/);r.format=n?Pt:Rt,r.needsUpdate=!0,void 0!==e&&e(r)}),i,n),r}}),Object.assign(Qd.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(t,e){const i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t){void 0===t&&(t=5);const e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return e},getSpacedPoints:function(t){void 0===t&&(t=5);const e=[];for(let i=0;i<=t;i++)e.push(this.getPointAt(i/t));return e},getLength:function(){const t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let i,n=this.getPoint(0),r=0;e.push(0);for(let o=1;o<=t;o++)i=this.getPoint(o/t),r+=i.distanceTo(n),e.push(r),n=i;return this.cacheArcLengths=e,e},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){const i=this.getLengths();let n,r=0,o=i.length;n=e||t*i[o-1];let s,a=0,l=o-1;while(a<=l)if(r=Math.floor(a+(l-a)/2),s=i[r]-n,s<0)a=r+1;else{if(!(s>0)){l=r;break}l=r-1}if(r=l,i[r]===n)return r/(o-1);const c=i[r],h=i[r+1],u=h-c,d=(n-c)/u,p=(r+d)/(o-1);return p},getTangent:function(t,e){const i=1e-4;let n=t-i,r=t+i;n<0&&(n=0),r>1&&(r=1);const o=this.getPoint(n),s=this.getPoint(r),a=e||(o.isVector2?new si:new yi);return a.copy(s).sub(o).normalize(),a},getTangentAt:function(t,e){const i=this.getUtoTmapping(t);return this.getTangent(i,e)},computeFrenetFrames:function(t,e){const i=new yi,n=[],r=[],o=[],s=new yi,a=new Ei;for(let d=0;d<=t;d++){const e=d/t;n[d]=this.getTangentAt(e,new yi),n[d].normalize()}r[0]=new yi,o[0]=new yi;let l=Number.MAX_VALUE;const c=Math.abs(n[0].x),h=Math.abs(n[0].y),u=Math.abs(n[0].z);c<=l&&(l=c,i.set(1,0,0)),h<=l&&(l=h,i.set(0,1,0)),u<=l&&i.set(0,0,1),s.crossVectors(n[0],i).normalize(),r[0].crossVectors(n[0],s),o[0].crossVectors(n[0],r[0]);for(let d=1;d<=t;d++){if(r[d]=r[d-1].clone(),o[d]=o[d-1].clone(),s.crossVectors(n[d-1],n[d]),s.length()>Number.EPSILON){s.normalize();const t=Math.acos(oi.clamp(n[d-1].dot(n[d]),-1,1));r[d].applyMatrix4(a.makeRotationAxis(s,t))}o[d].crossVectors(n[d],r[d])}if(!0===e){let e=Math.acos(oi.clamp(r[0].dot(r[t]),-1,1));e/=t,n[0].dot(s.crossVectors(r[0],r[t]))>0&&(e=-e);for(let i=1;i<=t;i++)r[i].applyMatrix4(a.makeRotationAxis(n[i],e*i)),o[i].crossVectors(n[i],r[i])}return{tangents:n,normals:r,binormals:o}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this},toJSON:function(){const t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t},fromJSON:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}),tp.prototype=Object.create(Qd.prototype),tp.prototype.constructor=tp,tp.prototype.isEllipseCurve=!0,tp.prototype.getPoint=function(t,e){const i=e||new si,n=2*Math.PI;let r=this.aEndAngle-this.aStartAngle;const o=Math.abs(r)<Number.EPSILON;while(r<0)r+=n;while(r>n)r-=n;r<Number.EPSILON&&(r=o?0:n),!0!==this.aClockwise||o||(r===n?r=-n:r-=n);const s=this.aStartAngle+t*r;let a=this.aX+this.xRadius*Math.cos(s),l=this.aY+this.yRadius*Math.sin(s);if(0!==this.aRotation){const t=Math.cos(this.aRotation),e=Math.sin(this.aRotation),i=a-this.aX,n=l-this.aY;a=i*t-n*e+this.aX,l=i*e+n*t+this.aY}return i.set(a,l)},tp.prototype.copy=function(t){return Qd.prototype.copy.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},tp.prototype.toJSON=function(){const t=Qd.prototype.toJSON.call(this);return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t},tp.prototype.fromJSON=function(t){return Qd.prototype.fromJSON.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},ep.prototype=Object.create(tp.prototype),ep.prototype.constructor=ep,ep.prototype.isArcCurve=!0;const np=new yi,rp=new ip,op=new ip,sp=new ip;function ap(t,e,i,n){Qd.call(this),this.type="CatmullRomCurve3",this.points=t||[],this.closed=e||!1,this.curveType=i||"centripetal",this.tension=n||.5}function lp(t,e,i,n,r){const o=.5*(n-e),s=.5*(r-i),a=t*t,l=t*a;return(2*i-2*n+o+s)*l+(-3*i+3*n-2*o-s)*a+o*t+i}function cp(t,e){const i=1-t;return i*i*e}function hp(t,e){return 2*(1-t)*t*e}function up(t,e){return t*t*e}function dp(t,e,i,n){return cp(t,e)+hp(t,i)+up(t,n)}function pp(t,e){const i=1-t;return i*i*i*e}function fp(t,e){const i=1-t;return 3*i*i*t*e}function mp(t,e){return 3*(1-t)*t*t*e}function gp(t,e){return t*t*t*e}function vp(t,e,i,n,r){return pp(t,e)+fp(t,i)+mp(t,n)+gp(t,r)}function yp(t,e,i,n){Qd.call(this),this.type="CubicBezierCurve",this.v0=t||new si,this.v1=e||new si,this.v2=i||new si,this.v3=n||new si}function xp(t,e,i,n){Qd.call(this),this.type="CubicBezierCurve3",this.v0=t||new yi,this.v1=e||new yi,this.v2=i||new yi,this.v3=n||new yi}function bp(t,e){Qd.call(this),this.type="LineCurve",this.v1=t||new si,this.v2=e||new si}function wp(t,e){Qd.call(this),this.type="LineCurve3",this.v1=t||new yi,this.v2=e||new yi}function _p(t,e,i){Qd.call(this),this.type="QuadraticBezierCurve",this.v0=t||new si,this.v1=e||new si,this.v2=i||new si}function Mp(t,e,i){Qd.call(this),this.type="QuadraticBezierCurve3",this.v0=t||new yi,this.v1=e||new yi,this.v2=i||new yi}function Sp(t){Qd.call(this),this.type="SplineCurve",this.points=t||[]}ap.prototype=Object.create(Qd.prototype),ap.prototype.constructor=ap,ap.prototype.isCatmullRomCurve3=!0,ap.prototype.getPoint=function(t,e){const i=e||new yi,n=this.points,r=n.length,o=(r-(this.closed?0:1))*t;let s,a,l,c,h=Math.floor(o),u=o-h;if(this.closed?h+=h>0?0:(Math.floor(Math.abs(h)/r)+1)*r:0===u&&h===r-1&&(h=r-2,u=1),this.closed||h>0?s=n[(h-1)%r]:(np.subVectors(n[0],n[1]).add(n[0]),s=np),a=n[h%r],l=n[(h+1)%r],this.closed||h+2<r?c=n[(h+2)%r]:(np.subVectors(n[r-1],n[r-2]).add(n[r-1]),c=np),"centripetal"===this.curveType||"chordal"===this.curveType){const t="chordal"===this.curveType?.5:.25;let e=Math.pow(s.distanceToSquared(a),t),i=Math.pow(a.distanceToSquared(l),t),n=Math.pow(l.distanceToSquared(c),t);i<1e-4&&(i=1),e<1e-4&&(e=i),n<1e-4&&(n=i),rp.initNonuniformCatmullRom(s.x,a.x,l.x,c.x,e,i,n),op.initNonuniformCatmullRom(s.y,a.y,l.y,c.y,e,i,n),sp.initNonuniformCatmullRom(s.z,a.z,l.z,c.z,e,i,n)}else"catmullrom"===this.curveType&&(rp.initCatmullRom(s.x,a.x,l.x,c.x,this.tension),op.initCatmullRom(s.y,a.y,l.y,c.y,this.tension),sp.initCatmullRom(s.z,a.z,l.z,c.z,this.tension));return i.set(rp.calc(u),op.calc(u),sp.calc(u)),i},ap.prototype.copy=function(t){Qd.prototype.copy.call(this,t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){const i=t.points[e];this.points.push(i.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},ap.prototype.toJSON=function(){const t=Qd.prototype.toJSON.call(this);t.points=[];for(let e=0,i=this.points.length;e<i;e++){const i=this.points[e];t.points.push(i.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t},ap.prototype.fromJSON=function(t){Qd.prototype.fromJSON.call(this,t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){const i=t.points[e];this.points.push((new yi).fromArray(i))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},yp.prototype=Object.create(Qd.prototype),yp.prototype.constructor=yp,yp.prototype.isCubicBezierCurve=!0,yp.prototype.getPoint=function(t,e){const i=e||new si,n=this.v0,r=this.v1,o=this.v2,s=this.v3;return i.set(vp(t,n.x,r.x,o.x,s.x),vp(t,n.y,r.y,o.y,s.y)),i},yp.prototype.copy=function(t){return Qd.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},yp.prototype.toJSON=function(){const t=Qd.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},yp.prototype.fromJSON=function(t){return Qd.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},xp.prototype=Object.create(Qd.prototype),xp.prototype.constructor=xp,xp.prototype.isCubicBezierCurve3=!0,xp.prototype.getPoint=function(t,e){const i=e||new yi,n=this.v0,r=this.v1,o=this.v2,s=this.v3;return i.set(vp(t,n.x,r.x,o.x,s.x),vp(t,n.y,r.y,o.y,s.y),vp(t,n.z,r.z,o.z,s.z)),i},xp.prototype.copy=function(t){return Qd.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},xp.prototype.toJSON=function(){const t=Qd.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},xp.prototype.fromJSON=function(t){return Qd.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},bp.prototype=Object.create(Qd.prototype),bp.prototype.constructor=bp,bp.prototype.isLineCurve=!0,bp.prototype.getPoint=function(t,e){const i=e||new si;return 1===t?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i},bp.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},bp.prototype.getTangent=function(t,e){const i=e||new si;return i.copy(this.v2).sub(this.v1).normalize(),i},bp.prototype.copy=function(t){return Qd.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},bp.prototype.toJSON=function(){const t=Qd.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},bp.prototype.fromJSON=function(t){return Qd.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},wp.prototype=Object.create(Qd.prototype),wp.prototype.constructor=wp,wp.prototype.isLineCurve3=!0,wp.prototype.getPoint=function(t,e){const i=e||new yi;return 1===t?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i},wp.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},wp.prototype.copy=function(t){return Qd.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},wp.prototype.toJSON=function(){const t=Qd.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},wp.prototype.fromJSON=function(t){return Qd.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},_p.prototype=Object.create(Qd.prototype),_p.prototype.constructor=_p,_p.prototype.isQuadraticBezierCurve=!0,_p.prototype.getPoint=function(t,e){const i=e||new si,n=this.v0,r=this.v1,o=this.v2;return i.set(dp(t,n.x,r.x,o.x),dp(t,n.y,r.y,o.y)),i},_p.prototype.copy=function(t){return Qd.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},_p.prototype.toJSON=function(){const t=Qd.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},_p.prototype.fromJSON=function(t){return Qd.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},Mp.prototype=Object.create(Qd.prototype),Mp.prototype.constructor=Mp,Mp.prototype.isQuadraticBezierCurve3=!0,Mp.prototype.getPoint=function(t,e){const i=e||new yi,n=this.v0,r=this.v1,o=this.v2;return i.set(dp(t,n.x,r.x,o.x),dp(t,n.y,r.y,o.y),dp(t,n.z,r.z,o.z)),i},Mp.prototype.copy=function(t){return Qd.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Mp.prototype.toJSON=function(){const t=Qd.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Mp.prototype.fromJSON=function(t){return Qd.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},Sp.prototype=Object.create(Qd.prototype),Sp.prototype.constructor=Sp,Sp.prototype.isSplineCurve=!0,Sp.prototype.getPoint=function(t,e){const i=e||new si,n=this.points,r=(n.length-1)*t,o=Math.floor(r),s=r-o,a=n[0===o?o:o-1],l=n[o],c=n[o>n.length-2?n.length-1:o+1],h=n[o>n.length-3?n.length-1:o+2];return i.set(lp(s,a.x,l.x,c.x,h.x),lp(s,a.y,l.y,c.y,h.y)),i},Sp.prototype.copy=function(t){Qd.prototype.copy.call(this,t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){const i=t.points[e];this.points.push(i.clone())}return this},Sp.prototype.toJSON=function(){const t=Qd.prototype.toJSON.call(this);t.points=[];for(let e=0,i=this.points.length;e<i;e++){const i=this.points[e];t.points.push(i.toArray())}return t},Sp.prototype.fromJSON=function(t){Qd.prototype.fromJSON.call(this,t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){const i=t.points[e];this.points.push((new si).fromArray(i))}return this};var Tp=Object.freeze({__proto__:null,ArcCurve:ep,CatmullRomCurve3:ap,CubicBezierCurve:yp,CubicBezierCurve3:xp,EllipseCurve:tp,LineCurve:bp,LineCurve3:wp,QuadraticBezierCurve:_p,QuadraticBezierCurve3:Mp,SplineCurve:Sp});function Ep(){Qd.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function Ap(t){Ep.call(this),this.type="Path",this.currentPoint=new si,t&&this.setFromPoints(t)}function Lp(t){Ap.call(this,t),this.uuid=oi.generateUUID(),this.type="Shape",this.holes=[]}function Cp(t,e){Wi.call(this),this.type="Light",this.color=new Nn(t),this.intensity=void 0!==e?e:1,this.receiveShadow=void 0}function Pp(t,e,i){Cp.call(this,t,i),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(Wi.DefaultUp),this.updateMatrix(),this.groundColor=new Nn(e)}function Rp(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.mapSize=new si(512,512),this.map=null,this.mapPass=null,this.matrix=new Ei,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new to,this._frameExtents=new si(1,1),this._viewportCount=1,this._viewports=[new di(0,0,1,1)]}function Op(){Rp.call(this,new Xr(50,1,.5,500))}function kp(t,e,i,n,r,o){Cp.call(this,t,e),this.type="SpotLight",this.position.copy(Wi.DefaultUp),this.updateMatrix(),this.target=new Wi,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(t){this.intensity=t/Math.PI}}),this.distance=void 0!==i?i:0,this.angle=void 0!==n?n:Math.PI/3,this.penumbra=void 0!==r?r:0,this.decay=void 0!==o?o:1,this.shadow=new Op}function Dp(){Rp.call(this,new Xr(90,1,.5,500)),this._frameExtents=new si(4,2),this._viewportCount=6,this._viewports=[new di(2,1,1,1),new di(0,1,1,1),new di(3,1,1,1),new di(1,1,1,1),new di(3,0,1,1),new di(1,0,1,1)],this._cubeDirections=[new yi(1,0,0),new yi(-1,0,0),new yi(0,0,1),new yi(0,0,-1),new yi(0,1,0),new yi(0,-1,0)],this._cubeUps=[new yi(0,1,0),new yi(0,1,0),new yi(0,1,0),new yi(0,1,0),new yi(0,0,1),new yi(0,0,-1)]}function Ip(t,e,i,n){Cp.call(this,t,e),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(t){this.intensity=t/(4*Math.PI)}}),this.distance=void 0!==i?i:0,this.decay=void 0!==n?n:1,this.shadow=new Dp}function Np(t,e,i,n,r,o){Vr.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=void 0!==t?t:-1,this.right=void 0!==e?e:1,this.top=void 0!==i?i:1,this.bottom=void 0!==n?n:-1,this.near=void 0!==r?r:.1,this.far=void 0!==o?o:2e3,this.updateProjectionMatrix()}function Bp(){Rp.call(this,new Np(-5,5,5,-5,.5,500))}function zp(t,e){Cp.call(this,t,e),this.type="DirectionalLight",this.position.copy(Wi.DefaultUp),this.updateMatrix(),this.target=new Wi,this.shadow=new Bp}function Fp(t,e){Cp.call(this,t,e),this.type="AmbientLight",this.castShadow=void 0}function Up(t,e,i,n){Cp.call(this,t,e),this.type="RectAreaLight",this.width=void 0!==i?i:10,this.height=void 0!==n?n:10}function Gp(){this.coefficients=[];for(let t=0;t<9;t++)this.coefficients.push(new yi)}function Hp(t,e){Cp.call(this,void 0,e),this.type="LightProbe",this.sh=void 0!==t?t:new Gp}function jp(t){Wd.call(this,t),this.textures={}}Ep.prototype=Object.assign(Object.create(Qd.prototype),{constructor:Ep,add:function(t){this.curves.push(t)},closePath:function(){const t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new bp(e,t))},getPoint:function(t){const e=t*this.getLength(),i=this.getCurveLengths();let n=0;while(n<i.length){if(i[n]>=e){const t=i[n]-e,r=this.curves[n],o=r.getLength(),s=0===o?0:1-t/o;return r.getPointAt(s)}n++}return null},getLength:function(){const t=this.getCurveLengths();return t[t.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const t=[];let e=0;for(let i=0,n=this.curves.length;i<n;i++)e+=this.curves[i].getLength(),t.push(e);return this.cacheLengths=t,t},getSpacedPoints:function(t){void 0===t&&(t=40);const e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getPoints:function(t){t=t||12;const e=[];let i;for(let n=0,r=this.curves;n<r.length;n++){const o=r[n],s=o&&o.isEllipseCurve?2*t:o&&(o.isLineCurve||o.isLineCurve3)?1:o&&o.isSplineCurve?t*o.points.length:t,a=o.getPoints(s);for(let t=0;t<a.length;t++){const n=a[t];i&&i.equals(n)||(e.push(n),i=n)}}return this.autoClose&&e.length>1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e},copy:function(t){Qd.prototype.copy.call(this,t),this.curves=[];for(let e=0,i=t.curves.length;e<i;e++){const i=t.curves[e];this.curves.push(i.clone())}return this.autoClose=t.autoClose,this},toJSON:function(){const t=Qd.prototype.toJSON.call(this);t.autoClose=this.autoClose,t.curves=[];for(let e=0,i=this.curves.length;e<i;e++){const i=this.curves[e];t.curves.push(i.toJSON())}return t},fromJSON:function(t){Qd.prototype.fromJSON.call(this,t),this.autoClose=t.autoClose,this.curves=[];for(let e=0,i=t.curves.length;e<i;e++){const i=t.curves[e];this.curves.push((new Tp[i.type]).fromJSON(i))}return this}}),Ap.prototype=Object.assign(Object.create(Ep.prototype),{constructor:Ap,setFromPoints:function(t){this.moveTo(t[0].x,t[0].y);for(let e=1,i=t.length;e<i;e++)this.lineTo(t[e].x,t[e].y);return this},moveTo:function(t,e){return this.currentPoint.set(t,e),this},lineTo:function(t,e){const i=new bp(this.currentPoint.clone(),new si(t,e));return this.curves.push(i),this.currentPoint.set(t,e),this},quadraticCurveTo:function(t,e,i,n){const r=new _p(this.currentPoint.clone(),new si(t,e),new si(i,n));return this.curves.push(r),this.currentPoint.set(i,n),this},bezierCurveTo:function(t,e,i,n,r,o){const s=new yp(this.currentPoint.clone(),new si(t,e),new si(i,n),new si(r,o));return this.curves.push(s),this.currentPoint.set(r,o),this},splineThru:function(t){const e=[this.currentPoint.clone()].concat(t),i=new Sp(e);return this.curves.push(i),this.currentPoint.copy(t[t.length-1]),this},arc:function(t,e,i,n,r,o){const s=this.currentPoint.x,a=this.currentPoint.y;return this.absarc(t+s,e+a,i,n,r,o),this},absarc:function(t,e,i,n,r,o){return this.absellipse(t,e,i,i,n,r,o),this},ellipse:function(t,e,i,n,r,o,s,a){const l=this.currentPoint.x,c=this.currentPoint.y;return this.absellipse(t+l,e+c,i,n,r,o,s,a),this},absellipse:function(t,e,i,n,r,o,s,a){const l=new tp(t,e,i,n,r,o,s,a);if(this.curves.length>0){const t=l.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this},copy:function(t){return Ep.prototype.copy.call(this,t),this.currentPoint.copy(t.currentPoint),this},toJSON:function(){const t=Ep.prototype.toJSON.call(this);return t.currentPoint=this.currentPoint.toArray(),t},fromJSON:function(t){return Ep.prototype.fromJSON.call(this,t),this.currentPoint.fromArray(t.currentPoint),this}}),Lp.prototype=Object.assign(Object.create(Ap.prototype),{constructor:Lp,getPointsHoles:function(t){const e=[];for(let i=0,n=this.holes.length;i<n;i++)e[i]=this.holes[i].getPoints(t);return e},extractPoints:function(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}},copy:function(t){Ap.prototype.copy.call(this,t),this.holes=[];for(let e=0,i=t.holes.length;e<i;e++){const i=t.holes[e];this.holes.push(i.clone())}return this},toJSON:function(){const t=Ap.prototype.toJSON.call(this);t.uuid=this.uuid,t.holes=[];for(let e=0,i=this.holes.length;e<i;e++){const i=this.holes[e];t.holes.push(i.toJSON())}return t},fromJSON:function(t){Ap.prototype.fromJSON.call(this,t),this.uuid=t.uuid,this.holes=[];for(let e=0,i=t.holes.length;e<i;e++){const i=t.holes[e];this.holes.push((new Ap).fromJSON(i))}return this}}),Cp.prototype=Object.assign(Object.create(Wi.prototype),{constructor:Cp,isLight:!0,copy:function(t){return Wi.prototype.copy.call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this},toJSON:function(t){const e=Wi.prototype.toJSON.call(this,t);return 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}}),Pp.prototype=Object.assign(Object.create(Cp.prototype),{constructor:Pp,isHemisphereLight:!0,copy:function(t){return Cp.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}),Object.assign(Rp.prototype,{_projScreenMatrix:new Ei,_lightPositionWorld:new yi,_lookTarget:new yi,getViewportCount:function(){return this._viewportCount},getFrustum:function(){return this._frustum},updateMatrices:function(t){const e=this.camera,i=this.matrix,n=this._projScreenMatrix,r=this._lookTarget,o=this._lightPositionWorld;o.setFromMatrixPosition(t.matrixWorld),e.position.copy(o),r.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(r),e.updateMatrixWorld(),n.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(n),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(e.projectionMatrix),i.multiply(e.matrixWorldInverse)},getViewport:function(t){return this._viewports[t]},getFrameExtents:function(){return this._frameExtents},copy:function(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){const t={};return 0!==this.bias&&(t.bias=this.bias),0!==this.normalBias&&(t.normalBias=this.normalBias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}),Op.prototype=Object.assign(Object.create(Rp.prototype),{constructor:Op,isSpotLightShadow:!0,updateMatrices:function(t){const e=this.camera,i=2*oi.RAD2DEG*t.angle,n=this.mapSize.width/this.mapSize.height,r=t.distance||e.far;i===e.fov&&n===e.aspect&&r===e.far||(e.fov=i,e.aspect=n,e.far=r,e.updateProjectionMatrix()),Rp.prototype.updateMatrices.call(this,t)}}),kp.prototype=Object.assign(Object.create(Cp.prototype),{constructor:kp,isSpotLight:!0,copy:function(t){return Cp.prototype.copy.call(this,t),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),Dp.prototype=Object.assign(Object.create(Rp.prototype),{constructor:Dp,isPointLightShadow:!0,updateMatrices:function(t,e){void 0===e&&(e=0);const i=this.camera,n=this.matrix,r=this._lightPositionWorld,o=this._lookTarget,s=this._projScreenMatrix;r.setFromMatrixPosition(t.matrixWorld),i.position.copy(r),o.copy(i.position),o.add(this._cubeDirections[e]),i.up.copy(this._cubeUps[e]),i.lookAt(o),i.updateMatrixWorld(),n.makeTranslation(-r.x,-r.y,-r.z),s.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(s)}}),Ip.prototype=Object.assign(Object.create(Cp.prototype),{constructor:Ip,isPointLight:!0,copy:function(t){return Cp.prototype.copy.call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}),Np.prototype=Object.assign(Object.create(Vr.prototype),{constructor:Np,isOrthographicCamera:!0,copy:function(t,e){return Vr.prototype.copy.call(this,t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this},setViewOffset:function(t,e,i,n,r,o){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2;let r=i-t,o=i+t,s=n+e,a=n-e;if(null!==this.view&&this.view.enabled){const t=(this.right-this.left)/this.view.fullWidth/this.zoom,e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=t*this.view.offsetX,o=r+t*this.view.width,s-=e*this.view.offsetY,a=s-e*this.view.height}this.projectionMatrix.makeOrthographic(r,o,s,a,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){const e=Wi.prototype.toJSON.call(this,t);return 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}}),Bp.prototype=Object.assign(Object.create(Rp.prototype),{constructor:Bp,isDirectionalLightShadow:!0,updateMatrices:function(t){Rp.prototype.updateMatrices.call(this,t)}}),zp.prototype=Object.assign(Object.create(Cp.prototype),{constructor:zp,isDirectionalLight:!0,copy:function(t){return Cp.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),Fp.prototype=Object.assign(Object.create(Cp.prototype),{constructor:Fp,isAmbientLight:!0}),Up.prototype=Object.assign(Object.create(Cp.prototype),{constructor:Up,isRectAreaLight:!0,copy:function(t){return Cp.prototype.copy.call(this,t),this.width=t.width,this.height=t.height,this},toJSON:function(t){const e=Cp.prototype.toJSON.call(this,t);return e.object.width=this.width,e.object.height=this.height,e}}),Object.assign(Gp.prototype,{isSphericalHarmonics3:!0,set:function(t){for(let e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this},zero:function(){for(let t=0;t<9;t++)this.coefficients[t].set(0,0,0);return this},getAt:function(t,e){const i=t.x,n=t.y,r=t.z,o=this.coefficients;return e.copy(o[0]).multiplyScalar(.282095),e.addScaledVector(o[1],.488603*n),e.addScaledVector(o[2],.488603*r),e.addScaledVector(o[3],.488603*i),e.addScaledVector(o[4],i*n*1.092548),e.addScaledVector(o[5],n*r*1.092548),e.addScaledVector(o[6],.315392*(3*r*r-1)),e.addScaledVector(o[7],i*r*1.092548),e.addScaledVector(o[8],.546274*(i*i-n*n)),e},getIrradianceAt:function(t,e){const i=t.x,n=t.y,r=t.z,o=this.coefficients;return e.copy(o[0]).multiplyScalar(.886227),e.addScaledVector(o[1],1.023328*n),e.addScaledVector(o[2],1.023328*r),e.addScaledVector(o[3],1.023328*i),e.addScaledVector(o[4],.858086*i*n),e.addScaledVector(o[5],.858086*n*r),e.addScaledVector(o[6],.743125*r*r-.247708),e.addScaledVector(o[7],.858086*i*r),e.addScaledVector(o[8],.429043*(i*i-n*n)),e},add:function(t){for(let e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this},addScaledSH:function(t,e){for(let i=0;i<9;i++)this.coefficients[i].addScaledVector(t.coefficients[i],e);return this},scale:function(t){for(let e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this},lerp:function(t,e){for(let i=0;i<9;i++)this.coefficients[i].lerp(t.coefficients[i],e);return this},equals:function(t){for(let e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0},copy:function(t){return this.set(t.coefficients)},clone:function(){return(new this.constructor).copy(this)},fromArray:function(t,e){void 0===e&&(e=0);const i=this.coefficients;for(let n=0;n<9;n++)i[n].fromArray(t,e+3*n);return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);const i=this.coefficients;for(let n=0;n<9;n++)i[n].toArray(t,e+3*n);return t}}),Object.assign(Gp,{getBasisAt:function(t,e){const i=t.x,n=t.y,r=t.z;e[0]=.282095,e[1]=.488603*n,e[2]=.488603*r,e[3]=.488603*i,e[4]=1.092548*i*n,e[5]=1.092548*n*r,e[6]=.315392*(3*r*r-1),e[7]=1.092548*i*r,e[8]=.546274*(i*i-n*n)}}),Hp.prototype=Object.assign(Object.create(Cp.prototype),{constructor:Hp,isLightProbe:!0,copy:function(t){return Cp.prototype.copy.call(this,t),this.sh.copy(t.sh),this},fromJSON:function(t){return this.intensity=t.intensity,this.sh.fromArray(t.sh),this},toJSON:function(t){const e=Cp.prototype.toJSON.call(this,t);return e.object.sh=this.sh.toArray(),e}}),jp.prototype=Object.assign(Object.create(Wd.prototype),{constructor:jp,load:function(t,e,i,n){const r=this,o=new Xd(r.manager);o.setPath(r.path),o.load(t,(function(i){try{e(r.parse(JSON.parse(i)))}catch(o){n?n(o):console.error(o),r.manager.itemError(t)}}),i,n)},parse:function(t){const e=this.textures;function i(t){return void 0===e[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),e[t]}const n=new Sd[t.type];if(void 0!==t.uuid&&(n.uuid=t.uuid),void 0!==t.name&&(n.name=t.name),void 0!==t.color&&n.color.setHex(t.color),void 0!==t.roughness&&(n.roughness=t.roughness),void 0!==t.metalness&&(n.metalness=t.metalness),void 0!==t.sheen&&(n.sheen=(new Nn).setHex(t.sheen)),void 0!==t.emissive&&n.emissive.setHex(t.emissive),void 0!==t.specular&&n.specular.setHex(t.specular),void 0!==t.shininess&&(n.shininess=t.shininess),void 0!==t.clearcoat&&(n.clearcoat=t.clearcoat),void 0!==t.clearcoatRoughness&&(n.clearcoatRoughness=t.clearcoatRoughness),void 0!==t.fog&&(n.fog=t.fog),void 0!==t.flatShading&&(n.flatShading=t.flatShading),void 0!==t.blending&&(n.blending=t.blending),void 0!==t.combine&&(n.combine=t.combine),void 0!==t.side&&(n.side=t.side),void 0!==t.opacity&&(n.opacity=t.opacity),void 0!==t.transparent&&(n.transparent=t.transparent),void 0!==t.alphaTest&&(n.alphaTest=t.alphaTest),void 0!==t.depthTest&&(n.depthTest=t.depthTest),void 0!==t.depthWrite&&(n.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(n.colorWrite=t.colorWrite),void 0!==t.stencilWrite&&(n.stencilWrite=t.stencilWrite),void 0!==t.stencilWriteMask&&(n.stencilWriteMask=t.stencilWriteMask),void 0!==t.stencilFunc&&(n.stencilFunc=t.stencilFunc),void 0!==t.stencilRef&&(n.stencilRef=t.stencilRef),void 0!==t.stencilFuncMask&&(n.stencilFuncMask=t.stencilFuncMask),void 0!==t.stencilFail&&(n.stencilFail=t.stencilFail),void 0!==t.stencilZFail&&(n.stencilZFail=t.stencilZFail),void 0!==t.stencilZPass&&(n.stencilZPass=t.stencilZPass),void 0!==t.wireframe&&(n.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(n.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(n.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(n.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(n.rotation=t.rotation),1!==t.linewidth&&(n.linewidth=t.linewidth),void 0!==t.dashSize&&(n.dashSize=t.dashSize),void 0!==t.gapSize&&(n.gapSize=t.gapSize),void 0!==t.scale&&(n.scale=t.scale),void 0!==t.polygonOffset&&(n.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(n.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(n.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.skinning&&(n.skinning=t.skinning),void 0!==t.morphTargets&&(n.morphTargets=t.morphTargets),void 0!==t.morphNormals&&(n.morphNormals=t.morphNormals),void 0!==t.dithering&&(n.dithering=t.dithering),void 0!==t.vertexTangents&&(n.vertexTangents=t.vertexTangents),void 0!==t.visible&&(n.visible=t.visible),void 0!==t.toneMapped&&(n.toneMapped=t.toneMapped),void 0!==t.userData&&(n.userData=t.userData),void 0!==t.vertexColors&&("number"===typeof t.vertexColors?n.vertexColors=t.vertexColors>0:n.vertexColors=t.vertexColors),void 0!==t.uniforms)for(const r in t.uniforms){const e=t.uniforms[r];switch(n.uniforms[r]={},e.type){case"t":n.uniforms[r].value=i(e.value);break;case"c":n.uniforms[r].value=(new Nn).setHex(e.value);break;case"v2":n.uniforms[r].value=(new si).fromArray(e.value);break;case"v3":n.uniforms[r].value=(new yi).fromArray(e.value);break;case"v4":n.uniforms[r].value=(new di).fromArray(e.value);break;case"m3":n.uniforms[r].value=(new ai).fromArray(e.value);case"m4":n.uniforms[r].value=(new Ei).fromArray(e.value);break;default:n.uniforms[r].value=e.value}}if(void 0!==t.defines&&(n.defines=t.defines),void 0!==t.vertexShader&&(n.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(n.fragmentShader=t.fragmentShader),void 0!==t.extensions)for(const r in t.extensions)n.extensions[r]=t.extensions[r];if(void 0!==t.shading&&(n.flatShading=1===t.shading),void 0!==t.size&&(n.size=t.size),void 0!==t.sizeAttenuation&&(n.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(n.map=i(t.map)),void 0!==t.matcap&&(n.matcap=i(t.matcap)),void 0!==t.alphaMap&&(n.alphaMap=i(t.alphaMap)),void 0!==t.bumpMap&&(n.bumpMap=i(t.bumpMap)),void 0!==t.bumpScale&&(n.bumpScale=t.bumpScale),void 0!==t.normalMap&&(n.normalMap=i(t.normalMap)),void 0!==t.normalMapType&&(n.normalMapType=t.normalMapType),void 0!==t.normalScale){let e=t.normalScale;!1===Array.isArray(e)&&(e=[e,e]),n.normalScale=(new si).fromArray(e)}return void 0!==t.displacementMap&&(n.displacementMap=i(t.displacementMap)),void 0!==t.displacementScale&&(n.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(n.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(n.roughnessMap=i(t.roughnessMap)),void 0!==t.metalnessMap&&(n.metalnessMap=i(t.metalnessMap)),void 0!==t.emissiveMap&&(n.emissiveMap=i(t.emissiveMap)),void 0!==t.emissiveIntensity&&(n.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(n.specularMap=i(t.specularMap)),void 0!==t.envMap&&(n.envMap=i(t.envMap)),void 0!==t.envMapIntensity&&(n.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(n.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(n.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(n.lightMap=i(t.lightMap)),void 0!==t.lightMapIntensity&&(n.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(n.aoMap=i(t.aoMap)),void 0!==t.aoMapIntensity&&(n.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(n.gradientMap=i(t.gradientMap)),void 0!==t.clearcoatMap&&(n.clearcoatMap=i(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(n.clearcoatRoughnessMap=i(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(n.clearcoatNormalMap=i(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(n.clearcoatNormalScale=(new si).fromArray(t.clearcoatNormalScale)),n},setTextures:function(t){return this.textures=t,this}});const Wp={decodeText:function(t){if("undefined"!==typeof TextDecoder)return(new TextDecoder).decode(t);let e="";for(let n=0,r=t.length;n<r;n++)e+=String.fromCharCode(t[n]);try{return decodeURIComponent(escape(e))}catch(i){return e}},extractUrlBase:function(t){const e=t.lastIndexOf("/");return-1===e?"./":t.substr(0,e+1)}};function Vp(){ur.call(this),this.type="InstancedBufferGeometry",this.instanceCount=1/0}function Xp(t,e,i,n){"number"===typeof i&&(n=i,i=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),Xn.call(this,t,e,i),this.meshPerAttribute=n||1}function Yp(t){Wd.call(this,t)}Vp.prototype=Object.assign(Object.create(ur.prototype),{constructor:Vp,isInstancedBufferGeometry:!0,copy:function(t){return ur.prototype.copy.call(this,t),this.instanceCount=t.instanceCount,this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){const t=ur.prototype.toJSON.call(this);return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}}),Xp.prototype=Object.assign(Object.create(Xn.prototype),{constructor:Xp,isInstancedBufferAttribute:!0,copy:function(t){return Xn.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this},toJSON:function(){const t=Xn.prototype.toJSON.call(this);return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}),Yp.prototype=Object.assign(Object.create(Wd.prototype),{constructor:Yp,load:function(t,e,i,n){const r=this,o=new Xd(r.manager);o.setPath(r.path),o.load(t,(function(i){try{e(r.parse(JSON.parse(i)))}catch(o){n?n(o):console.error(o),r.manager.itemError(t)}}),i,n)},parse:function(t){const e={},i={};function n(t,i){if(void 0!==e[i])return e[i];const n=t.interleavedBuffers,o=n[i],s=r(t,o.buffer),a=new qp[o.type](s),l=new Vc(a,o.stride);return l.uuid=o.uuid,e[i]=l,l}function r(t,e){if(void 0!==i[e])return i[e];const n=t.arrayBuffers,r=n[e],o=new Uint32Array(r).buffer;return i[e]=o,o}const o=t.isInstancedBufferGeometry?new Vp:new ur,s=t.data.index;if(void 0!==s){const t=new qp[s.type](s.array);o.setIndex(new Xn(t,1))}const a=t.data.attributes;for(const d in a){const e=a[d];let i;if(e.isInterleavedBufferAttribute){const r=n(t.data,e.data);i=new Yc(r,e.itemSize,e.offset,e.normalized)}else{const t=new qp[e.type](e.array),n=e.isInstancedBufferAttribute?Xp:Xn;i=new n(t,e.itemSize,e.normalized)}void 0!==e.name&&(i.name=e.name),o.setAttribute(d,i)}const l=t.data.morphAttributes;if(l)for(const d in l){const e=l[d],i=[];for(let r=0,o=e.length;r<o;r++){const o=e[r];let s;if(o.isInterleavedBufferAttribute){const e=n(t.data,o.data);s=new Yc(e,o.itemSize,o.offset,o.normalized)}else{const t=new qp[o.type](o.array);s=new Xn(t,o.itemSize,o.normalized)}void 0!==o.name&&(s.name=o.name),i.push(s)}o.morphAttributes[d]=i}const c=t.data.morphTargetsRelative;c&&(o.morphTargetsRelative=!0);const h=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==h)for(let d=0,p=h.length;d!==p;++d){const t=h[d];o.addGroup(t.start,t.count,t.materialIndex)}const u=t.data.boundingSphere;if(void 0!==u){const t=new yi;void 0!==u.center&&t.fromArray(u.center),o.boundingSphere=new cn(t,u.radius)}return t.name&&(o.name=t.name),t.userData&&(o.userData=t.userData),o}});const qp={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!==typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function Zp(t){Wd.call(this,t)}Zp.prototype=Object.assign(Object.create(Wd.prototype),{constructor:Zp,load:function(t,e,i,n){const r=this,o=""===this.path?Wp.extractUrlBase(t):this.path;this.resourcePath=this.resourcePath||o;const s=new Xd(r.manager);s.setPath(this.path),s.load(t,(function(i){let o=null;try{o=JSON.parse(i)}catch(a){return void 0!==n&&n(a),void console.error("THREE:ObjectLoader: Can't parse "+t+".",a.message)}const s=o.metadata;void 0!==s&&void 0!==s.type&&"geometry"!==s.type.toLowerCase()?r.parse(o,e):console.error("THREE.ObjectLoader: Can't load "+t)}),i,n)},parse:function(t,e){const i=this.parseShape(t.shapes),n=this.parseGeometries(t.geometries,i),r=this.parseImages(t.images,(function(){void 0!==e&&e(a)})),o=this.parseTextures(t.textures,r),s=this.parseMaterials(t.materials,o),a=this.parseObject(t.object,n,s);return t.animations&&(a.animations=this.parseAnimations(t.animations)),void 0!==t.images&&0!==t.images.length||void 0!==e&&e(a),a},parseShape:function(t){const e={};if(void 0!==t)for(let i=0,n=t.length;i<n;i++){const n=(new Lp).fromJSON(t[i]);e[n.uuid]=n}return e},parseGeometries:function(t,e){const i={};let n;if(void 0!==t){const r=new Yp;for(let o=0,s=t.length;o<s;o++){let s;const a=t[o];switch(a.type){case"PlaneGeometry":case"PlaneBufferGeometry":s=new pd[a.type](a.width,a.height,a.widthSegments,a.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":s=new pd[a.type](a.width,a.height,a.depth,a.widthSegments,a.heightSegments,a.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":s=new pd[a.type](a.radius,a.segments,a.thetaStart,a.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":s=new pd[a.type](a.radiusTop,a.radiusBottom,a.height,a.radialSegments,a.heightSegments,a.openEnded,a.thetaStart,a.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":s=new pd[a.type](a.radius,a.height,a.radialSegments,a.heightSegments,a.openEnded,a.thetaStart,a.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":s=new pd[a.type](a.radius,a.widthSegments,a.heightSegments,a.phiStart,a.phiLength,a.thetaStart,a.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":s=new pd[a.type](a.radius,a.detail);break;case"RingGeometry":case"RingBufferGeometry":s=new pd[a.type](a.innerRadius,a.outerRadius,a.thetaSegments,a.phiSegments,a.thetaStart,a.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":s=new pd[a.type](a.radius,a.tube,a.radialSegments,a.tubularSegments,a.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":s=new pd[a.type](a.radius,a.tube,a.tubularSegments,a.radialSegments,a.p,a.q);break;case"TubeGeometry":case"TubeBufferGeometry":s=new pd[a.type]((new Tp[a.path.type]).fromJSON(a.path),a.tubularSegments,a.radius,a.radialSegments,a.closed);break;case"LatheGeometry":case"LatheBufferGeometry":s=new pd[a.type](a.points,a.segments,a.phiStart,a.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":s=new pd[a.type](a.vertices,a.indices,a.radius,a.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":n=[];for(let i=0,r=a.shapes.length;i<r;i++){const t=e[a.shapes[i]];n.push(t)}s=new pd[a.type](n,a.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":n=[];for(let i=0,r=a.shapes.length;i<r;i++){const t=e[a.shapes[i]];n.push(t)}const t=a.options.extrudePath;void 0!==t&&(a.options.extrudePath=(new Tp[t.type]).fromJSON(t)),s=new pd[a.type](n,a.options);break;case"BufferGeometry":case"InstancedBufferGeometry":s=r.parse(a);break;case"Geometry":console.error('THREE.ObjectLoader: Loading "Geometry" is not supported anymore.');break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+a.type+'"');continue}s.uuid=a.uuid,void 0!==a.name&&(s.name=a.name),!0===s.isBufferGeometry&&void 0!==a.userData&&(s.userData=a.userData),i[a.uuid]=s}}return i},parseMaterials:function(t,e){const i={},n={};if(void 0!==t){const r=new jp;r.setTextures(e);for(let e=0,o=t.length;e<o;e++){const o=t[e];if("MultiMaterial"===o.type){const t=[];for(let e=0;e<o.materials.length;e++){const n=o.materials[e];void 0===i[n.uuid]&&(i[n.uuid]=r.parse(n)),t.push(i[n.uuid])}n[o.uuid]=t}else void 0===i[o.uuid]&&(i[o.uuid]=r.parse(o)),n[o.uuid]=i[o.uuid]}}return n},parseAnimations:function(t){const e=[];for(let i=0;i<t.length;i++){const n=t[i],r=zd.parse(n);void 0!==n.uuid&&(r.uuid=n.uuid),e.push(r)}return e},parseImages:function(t,e){const i=this,n={};let r;function o(t){return i.manager.itemStart(t),r.load(t,(function(){i.manager.itemEnd(t)}),void 0,(function(){i.manager.itemError(t),i.manager.itemEnd(t)}))}if(void 0!==t&&t.length>0){const s=new Hd(e);r=new Jd(s),r.setCrossOrigin(this.crossOrigin);for(let e=0,r=t.length;e<r;e++){const r=t[e],s=r.url;if(Array.isArray(s)){n[r.uuid]=[];for(let t=0,e=s.length;t<e;t++){const e=s[t],a=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(e)?e:i.resourcePath+e;n[r.uuid].push(o(a))}}else{const t=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(r.url)?r.url:i.resourcePath+r.url;n[r.uuid]=o(t)}}}return n},parseTextures:function(t,e){function i(t,e){return"number"===typeof t?t:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",t),e[t])}const n={};if(void 0!==t)for(let r=0,o=t.length;r<o;r++){const o=t[r];let s;void 0===o.image&&console.warn('THREE.ObjectLoader: No "image" specified for',o.uuid),void 0===e[o.image]&&console.warn("THREE.ObjectLoader: Undefined image",o.image),s=Array.isArray(e[o.image])?new Ga(e[o.image]):new ui(e[o.image]),s.needsUpdate=!0,s.uuid=o.uuid,void 0!==o.name&&(s.name=o.name),void 0!==o.mapping&&(s.mapping=i(o.mapping,Jp)),void 0!==o.offset&&s.offset.fromArray(o.offset),void 0!==o.repeat&&s.repeat.fromArray(o.repeat),void 0!==o.center&&s.center.fromArray(o.center),void 0!==o.rotation&&(s.rotation=o.rotation),void 0!==o.wrap&&(s.wrapS=i(o.wrap[0],Kp),s.wrapT=i(o.wrap[1],Kp)),void 0!==o.format&&(s.format=o.format),void 0!==o.type&&(s.type=o.type),void 0!==o.encoding&&(s.encoding=o.encoding),void 0!==o.minFilter&&(s.minFilter=i(o.minFilter,$p)),void 0!==o.magFilter&&(s.magFilter=i(o.magFilter,$p)),void 0!==o.anisotropy&&(s.anisotropy=o.anisotropy),void 0!==o.flipY&&(s.flipY=o.flipY),void 0!==o.premultiplyAlpha&&(s.premultiplyAlpha=o.premultiplyAlpha),void 0!==o.unpackAlignment&&(s.unpackAlignment=o.unpackAlignment),n[o.uuid]=s}return n},parseObject:function(t,e,i){let n,r,o;function s(t){return void 0===e[t]&&console.warn("THREE.ObjectLoader: Undefined geometry",t),e[t]}function a(t){if(void 0!==t){if(Array.isArray(t)){const e=[];for(let n=0,r=t.length;n<r;n++){const r=t[n];void 0===i[r]&&console.warn("THREE.ObjectLoader: Undefined material",r),e.push(i[r])}return e}return void 0===i[t]&&console.warn("THREE.ObjectLoader: Undefined material",t),i[t]}}switch(t.type){case"Scene":n=new Vi,void 0!==t.background&&Number.isInteger(t.background)&&(n.background=new Nn(t.background)),void 0!==t.fog&&("Fog"===t.fog.type?n.fog=new Wc(t.fog.color,t.fog.near,t.fog.far):"FogExp2"===t.fog.type&&(n.fog=new jc(t.fog.color,t.fog.density)));break;case"PerspectiveCamera":n=new Xr(t.fov,t.aspect,t.near,t.far),void 0!==t.focus&&(n.focus=t.focus),void 0!==t.zoom&&(n.zoom=t.zoom),void 0!==t.filmGauge&&(n.filmGauge=t.filmGauge),void 0!==t.filmOffset&&(n.filmOffset=t.filmOffset),void 0!==t.view&&(n.view=Object.assign({},t.view));break;case"OrthographicCamera":n=new Np(t.left,t.right,t.top,t.bottom,t.near,t.far),void 0!==t.zoom&&(n.zoom=t.zoom),void 0!==t.view&&(n.view=Object.assign({},t.view));break;case"AmbientLight":n=new Fp(t.color,t.intensity);break;case"DirectionalLight":n=new zp(t.color,t.intensity);break;case"PointLight":n=new Ip(t.color,t.intensity,t.distance,t.decay);break;case"RectAreaLight":n=new Up(t.color,t.intensity,t.width,t.height);break;case"SpotLight":n=new kp(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);break;case"HemisphereLight":n=new Pp(t.color,t.groundColor,t.intensity);break;case"LightProbe":n=(new Hp).fromJSON(t);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":r=s(t.geometry),o=a(t.material),n=new Cr(r,o);break;case"InstancedMesh":r=s(t.geometry),o=a(t.material);const e=t.count,i=t.instanceMatrix;n=new _h(r,o,e),n.instanceMatrix=new Xn(new Float32Array(i.array),16);break;case"LOD":n=new dh;break;case"Line":n=new Ch(s(t.geometry),a(t.material),t.mode);break;case"LineLoop":n=new kh(s(t.geometry),a(t.material));break;case"LineSegments":n=new Oh(s(t.geometry),a(t.material));break;case"PointCloud":case"Points":n=new Fh(s(t.geometry),a(t.material));break;case"Sprite":n=new lh(a(t.material));break;case"Group":n=new Bc;break;default:n=new Wi}if(n.uuid=t.uuid,void 0!==t.name&&(n.name=t.name),void 0!==t.matrix?(n.matrix.fromArray(t.matrix),void 0!==t.matrixAutoUpdate&&(n.matrixAutoUpdate=t.matrixAutoUpdate),n.matrixAutoUpdate&&n.matrix.decompose(n.position,n.quaternion,n.scale)):(void 0!==t.position&&n.position.fromArray(t.position),void 0!==t.rotation&&n.rotation.fromArray(t.rotation),void 0!==t.quaternion&&n.quaternion.fromArray(t.quaternion),void 0!==t.scale&&n.scale.fromArray(t.scale)),void 0!==t.castShadow&&(n.castShadow=t.castShadow),void 0!==t.receiveShadow&&(n.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.bias&&(n.shadow.bias=t.shadow.bias),void 0!==t.shadow.normalBias&&(n.shadow.normalBias=t.shadow.normalBias),void 0!==t.shadow.radius&&(n.shadow.radius=t.shadow.radius),void 0!==t.shadow.mapSize&&n.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(n.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(n.visible=t.visible),void 0!==t.frustumCulled&&(n.frustumCulled=t.frustumCulled),void 0!==t.renderOrder&&(n.renderOrder=t.renderOrder),void 0!==t.userData&&(n.userData=t.userData),void 0!==t.layers&&(n.layers.mask=t.layers),void 0!==t.children){const r=t.children;for(let t=0;t<r.length;t++)n.add(this.parseObject(r[t],e,i))}if("LOD"===t.type){void 0!==t.autoUpdate&&(n.autoUpdate=t.autoUpdate);const e=t.levels;for(let t=0;t<e.length;t++){const i=e[t],r=n.getObjectByProperty("uuid",i.object);void 0!==r&&n.addLevel(r,i.distance)}}return n}});const Jp={UVMapping:et,CubeReflectionMapping:it,CubeRefractionMapping:nt,EquirectangularReflectionMapping:rt,EquirectangularRefractionMapping:ot,CubeUVReflectionMapping:st,CubeUVRefractionMapping:at},Kp={RepeatWrapping:lt,ClampToEdgeWrapping:ct,MirroredRepeatWrapping:ht},$p={NearestFilter:ut,NearestMipmapNearestFilter:dt,NearestMipmapLinearFilter:pt,LinearFilter:ft,LinearMipmapNearestFilter:mt,LinearMipmapLinearFilter:gt};function Qp(t){"undefined"===typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"===typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),Wd.call(this,t),this.options={premultiplyAlpha:"none"}}function tf(){this.type="ShapePath",this.color=new Nn,this.subPaths=[],this.currentPath=null}function ef(t){this.type="Font",this.data=t}function nf(t,e,i){const n=Array.from?Array.from(t):String(t).split(""),r=e/i.resolution,o=(i.boundingBox.yMax-i.boundingBox.yMin+i.underlineThickness)*r,s=[];let a=0,l=0;for(let c=0;c<n.length;c++){const t=n[c];if("\n"===t)a=0,l-=o;else{const e=rf(t,r,a,l,i);a+=e.offsetX,s.push(e.path)}}return s}function rf(t,e,i,n,r){const o=r.glyphs[t]||r.glyphs["?"];if(!o)return void console.error('THREE.Font: character "'+t+'" does not exists in font family '+r.familyName+".");const s=new tf;let a,l,c,h,u,d,p,f;if(o.o){const t=o._cachedOutline||(o._cachedOutline=o.o.split(" "));for(let r=0,o=t.length;r<o;){const o=t[r++];switch(o){case"m":a=t[r++]*e+i,l=t[r++]*e+n,s.moveTo(a,l);break;case"l":a=t[r++]*e+i,l=t[r++]*e+n,s.lineTo(a,l);break;case"q":c=t[r++]*e+i,h=t[r++]*e+n,u=t[r++]*e+i,d=t[r++]*e+n,s.quadraticCurveTo(u,d,c,h);break;case"b":c=t[r++]*e+i,h=t[r++]*e+n,u=t[r++]*e+i,d=t[r++]*e+n,p=t[r++]*e+i,f=t[r++]*e+n,s.bezierCurveTo(u,d,p,f,c,h);break}}}return{offsetX:o.ha*e,path:s}}function of(t){Wd.call(this,t)}let sf;Qp.prototype=Object.assign(Object.create(Wd.prototype),{constructor:Qp,isImageBitmapLoader:!0,setOptions:function(t){return this.options=t,this},load:function(t,e,i,n){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=this,o=Gd.get(t);if(void 0!==o)return r.manager.itemStart(t),setTimeout((function(){e&&e(o),r.manager.itemEnd(t)}),0),o;fetch(t).then((function(t){return t.blob()})).then((function(t){return createImageBitmap(t,r.options)})).then((function(i){Gd.add(t,i),e&&e(i),r.manager.itemEnd(t)})).catch((function(e){n&&n(e),r.manager.itemError(t),r.manager.itemEnd(t)})),r.manager.itemStart(t)}}),Object.assign(tf.prototype,{moveTo:function(t,e){return this.currentPath=new Ap,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this},lineTo:function(t,e){return this.currentPath.lineTo(t,e),this},quadraticCurveTo:function(t,e,i,n){return this.currentPath.quadraticCurveTo(t,e,i,n),this},bezierCurveTo:function(t,e,i,n,r,o){return this.currentPath.bezierCurveTo(t,e,i,n,r,o),this},splineThru:function(t){return this.currentPath.splineThru(t),this},toShapes:function(t,e){function i(t){const e=[];for(let i=0,n=t.length;i<n;i++){const n=t[i],r=new Lp;r.curves=n.curves,e.push(r)}return e}function n(t,e){const i=e.length;let n=!1;for(let r=i-1,o=0;o<i;r=o++){let i=e[r],s=e[o],a=s.x-i.x,l=s.y-i.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(i=e[o],a=-a,s=e[r],l=-l),t.y<i.y||t.y>s.y)continue;if(t.y===i.y){if(t.x===i.x)return!0}else{const e=l*(t.x-i.x)-a*(t.y-i.y);if(0===e)return!0;if(e<0)continue;n=!n}}else{if(t.y!==i.y)continue;if(s.x<=t.x&&t.x<=i.x||i.x<=t.x&&t.x<=s.x)return!0}}return n}const r=Hu.isClockWise,o=this.subPaths;if(0===o.length)return[];if(!0===e)return i(o);let s,a,l,c=[];if(1===o.length)return a=o[0],l=new Lp,l.curves=a.curves,c.push(l),c;let h=!r(o[0].getPoints());h=t?!h:h;const u=[],d=[];let p,f,m=[],g=0;d[g]=void 0,m[g]=[];for(let v=0,y=o.length;v<y;v++)a=o[v],p=a.getPoints(),s=r(p),s=t?!s:s,s?(!h&&d[g]&&g++,d[g]={s:new Lp,p:p},d[g].s.curves=a.curves,h&&g++,m[g]=[]):m[g].push({h:a,p:p[0]});if(!d[0])return i(o);if(d.length>1){let t=!1;const e=[];for(let i=0,n=d.length;i<n;i++)u[i]=[];for(let i=0,r=d.length;i<r;i++){const r=m[i];for(let o=0;o<r.length;o++){const s=r[o];let a=!0;for(let r=0;r<d.length;r++)n(s.p,d[r].p)&&(i!==r&&e.push({froms:i,tos:r,hole:o}),a?(a=!1,u[r].push(s)):t=!0);a&&u[i].push(s)}}e.length>0&&(t||(m=u))}for(let v=0,y=d.length;v<y;v++){l=d[v].s,c.push(l),f=m[v];for(let t=0,e=f.length;t<e;t++)l.holes.push(f[t].h)}return c}}),Object.assign(ef.prototype,{isFont:!0,generateShapes:function(t,e){void 0===e&&(e=100);const i=[],n=nf(t,e,this.data);for(let r=0,o=n.length;r<o;r++)Array.prototype.push.apply(i,n[r].toShapes());return i}}),of.prototype=Object.assign(Object.create(Wd.prototype),{constructor:of,load:function(t,e,i,n){const r=this,o=new Xd(this.manager);o.setPath(this.path),o.load(t,(function(t){let i;try{i=JSON.parse(t)}catch(o){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),i=JSON.parse(t.substring(65,t.length-2))}const n=r.parse(i);e&&e(n)}),i,n)},parse:function(t){return new ef(t)}});const af={getContext:function(){return void 0===sf&&(sf=new(window.AudioContext||window.webkitAudioContext)),sf},setContext:function(t){sf=t}};function lf(t){Wd.call(this,t)}function cf(t,e,i){Hp.call(this,void 0,i);const n=(new Nn).set(t),r=(new Nn).set(e),o=new yi(n.r,n.g,n.b),s=new yi(r.r,r.g,r.b),a=Math.sqrt(Math.PI),l=a*Math.sqrt(.75);this.sh.coefficients[0].copy(o).add(s).multiplyScalar(a),this.sh.coefficients[1].copy(o).sub(s).multiplyScalar(l)}function hf(t,e){Hp.call(this,void 0,e);const i=(new Nn).set(t);this.sh.coefficients[0].set(i.r,i.g,i.b).multiplyScalar(2*Math.sqrt(Math.PI))}lf.prototype=Object.assign(Object.create(Wd.prototype),{constructor:lf,load:function(t,e,i,n){const r=this,o=new Xd(r.manager);o.setResponseType("arraybuffer"),o.setPath(r.path),o.load(t,(function(i){try{const t=i.slice(0),n=af.getContext();n.decodeAudioData(t,(function(t){e(t)}))}catch(o){n?n(o):console.error(o),r.manager.itemError(t)}}),i,n)}}),cf.prototype=Object.assign(Object.create(Hp.prototype),{constructor:cf,isHemisphereLightProbe:!0,copy:function(t){return Hp.prototype.copy.call(this,t),this},toJSON:function(t){const e=Hp.prototype.toJSON.call(this,t);return e}}),hf.prototype=Object.assign(Object.create(Hp.prototype),{constructor:hf,isAmbientLightProbe:!0,copy:function(t){return Hp.prototype.copy.call(this,t),this},toJSON:function(t){const e=Hp.prototype.toJSON.call(this,t);return e}});const uf=new Ei,df=new Ei;function pf(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Xr,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Xr,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 ff(t){this.autoStart=void 0===t||t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}Object.assign(pf.prototype,{update:function(t){const e=this._cache,i=e.focus!==t.focus||e.fov!==t.fov||e.aspect!==t.aspect*this.aspect||e.near!==t.near||e.far!==t.far||e.zoom!==t.zoom||e.eyeSep!==this.eyeSep;if(i){e.focus=t.focus,e.fov=t.fov,e.aspect=t.aspect*this.aspect,e.near=t.near,e.far=t.far,e.zoom=t.zoom,e.eyeSep=this.eyeSep;const i=t.projectionMatrix.clone(),n=e.eyeSep/2,r=n*e.near/e.focus,o=e.near*Math.tan(oi.DEG2RAD*e.fov*.5)/e.zoom;let s,a;df.elements[12]=-n,uf.elements[12]=n,s=-o*e.aspect+r,a=o*e.aspect+r,i.elements[0]=2*e.near/(a-s),i.elements[8]=(a+s)/(a-s),this.cameraL.projectionMatrix.copy(i),s=-o*e.aspect-r,a=o*e.aspect-r,i.elements[0]=2*e.near/(a-s),i.elements[8]=(a+s)/(a-s),this.cameraR.projectionMatrix.copy(i)}this.cameraL.matrixWorld.copy(t.matrixWorld).multiply(df),this.cameraR.matrixWorld.copy(t.matrixWorld).multiply(uf)}}),Object.assign(ff.prototype,{start:function(){this.startTime=("undefined"===typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const e=("undefined"===typeof performance?Date:performance).now();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}});const mf=new yi,gf=new mi,vf=new yi,yf=new yi;function xf(){Wi.call(this),this.type="AudioListener",this.context=af.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new ff}function bf(t){Wi.call(this),this.type="Audio",this.listener=t,this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this._startedAt=0,this._progress=0,this.filters=[]}xf.prototype=Object.assign(Object.create(Wi.prototype),{constructor:xf,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(t){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this},updateMatrixWorld:function(t){Wi.prototype.updateMatrixWorld.call(this,t);const e=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(mf,gf,vf),yf.set(0,0,-1).applyQuaternion(gf),e.positionX){const t=this.context.currentTime+this.timeDelta;e.positionX.linearRampToValueAtTime(mf.x,t),e.positionY.linearRampToValueAtTime(mf.y,t),e.positionZ.linearRampToValueAtTime(mf.z,t),e.forwardX.linearRampToValueAtTime(yf.x,t),e.forwardY.linearRampToValueAtTime(yf.y,t),e.forwardZ.linearRampToValueAtTime(yf.z,t),e.upX.linearRampToValueAtTime(i.x,t),e.upY.linearRampToValueAtTime(i.y,t),e.upZ.linearRampToValueAtTime(i.z,t)}else e.setPosition(mf.x,mf.y,mf.z),e.setOrientation(yf.x,yf.y,yf.z,i.x,i.y,i.z)}}),bf.prototype=Object.assign(Object.create(Wi.prototype),{constructor:bf,getOutput:function(){return this.gain},setNodeSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this},setMediaElementSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this},setMediaStreamSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(t),this.connect(),this},setBuffer:function(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(t){if(void 0===t&&(t=0),!0===this.isPlaying)return void console.warn("THREE.Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+t;const e=this.context.createBufferSource();return 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()},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._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(this.filters.length>0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(t){return t||(t=[]),!0===this.isPlaying?(this.disconnect(),this.filters=t,this.connect()):this.filters=t,this},setDetune:function(t){if(this.detune=t,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(t){return this.setFilters(t?[t]:[])},setPlaybackRate:function(t){if(!1!==this.hasPlaybackControl)return this.playbackRate=t,!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(t){if(!1!==this.hasPlaybackControl)return this.loop=t,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")},setLoopStart:function(t){return this.loopStart=t,this},setLoopEnd:function(t){return this.loopEnd=t,this},getVolume:function(){return this.gain.gain.value},setVolume:function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}});const wf=new yi,_f=new mi,Mf=new yi,Sf=new yi;function Tf(t){bf.call(this,t),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}function Ef(t,e){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=void 0!==e?e:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}function Af(t,e,i){let n,r,o;switch(this.binding=t,this.valueSize=i,e){case"quaternion":n=this._slerp,r=this._slerpAdditive,o=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*i),this._workIndex=5;break;case"string":case"bool":n=this._select,r=this._select,o=this._setAdditiveIdentityOther,this.buffer=new Array(5*i);break;default:n=this._lerp,r=this._lerpAdditive,o=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*i)}this._mixBufferRegion=n,this._mixBufferRegionAdditive=r,this._setIdentity=o,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}Tf.prototype=Object.assign(Object.create(bf.prototype),{constructor:Tf,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(t){return this.panner.refDistance=t,this},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(t){return this.panner.rolloffFactor=t,this},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(t){return this.panner.distanceModel=t,this},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(t){return this.panner.maxDistance=t,this},setDirectionalCone:function(t,e,i){return this.panner.coneInnerAngle=t,this.panner.coneOuterAngle=e,this.panner.coneOuterGain=i,this},updateMatrixWorld:function(t){if(Wi.prototype.updateMatrixWorld.call(this,t),!0===this.hasPlaybackControl&&!1===this.isPlaying)return;this.matrixWorld.decompose(wf,_f,Mf),Sf.set(0,0,1).applyQuaternion(_f);const e=this.panner;if(e.positionX){const t=this.context.currentTime+this.listener.timeDelta;e.positionX.linearRampToValueAtTime(wf.x,t),e.positionY.linearRampToValueAtTime(wf.y,t),e.positionZ.linearRampToValueAtTime(wf.z,t),e.orientationX.linearRampToValueAtTime(Sf.x,t),e.orientationY.linearRampToValueAtTime(Sf.y,t),e.orientationZ.linearRampToValueAtTime(Sf.z,t)}else e.setPosition(wf.x,wf.y,wf.z),e.setOrientation(Sf.x,Sf.y,Sf.z)}}),Object.assign(Ef.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){let t=0;const e=this.getFrequencyData();for(let i=0;i<e.length;i++)t+=e[i];return t/e.length}}),Object.assign(Af.prototype,{accumulate:function(t,e){const i=this.buffer,n=this.valueSize,r=t*n+n;let o=this.cumulativeWeight;if(0===o){for(let t=0;t!==n;++t)i[r+t]=i[t];o=e}else{o+=e;const t=e/o;this._mixBufferRegion(i,r,0,t,n)}this.cumulativeWeight=o},accumulateAdditive:function(t){const e=this.buffer,i=this.valueSize,n=i*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(e,n,0,t,i),this.cumulativeWeightAdditive+=t},apply:function(t){const e=this.valueSize,i=this.buffer,n=t*e+e,r=this.cumulativeWeight,o=this.cumulativeWeightAdditive,s=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,r<1){const t=e*this._origIndex;this._mixBufferRegion(i,n,t,1-r,e)}o>0&&this._mixBufferRegionAdditive(i,n,this._addIndex*e,1,e);for(let a=e,l=e+e;a!==l;++a)if(i[a]!==i[a+e]){s.setValue(i,n);break}},saveOriginalState:function(){const t=this.binding,e=this.buffer,i=this.valueSize,n=i*this._origIndex;t.getValue(e,n);for(let r=i,o=n;r!==o;++r)e[r]=e[n+r%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0},restoreOriginalState:function(){const t=3*this.valueSize;this.binding.setValue(this.buffer,t)},_setAdditiveIdentityNumeric:function(){const t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let i=t;i<e;i++)this.buffer[i]=0},_setAdditiveIdentityQuaternion:function(){this._setAdditiveIdentityNumeric(),this.buffer[4*this._addIndex+3]=1},_setAdditiveIdentityOther:function(){const t=this._origIndex*this.valueSize,e=this._addIndex*this.valueSize;for(let i=0;i<this.valueSize;i++)this.buffer[e+i]=this.buffer[t+i]},_select:function(t,e,i,n,r){if(n>=.5)for(let o=0;o!==r;++o)t[e+o]=t[i+o]},_slerp:function(t,e,i,n){mi.slerpFlat(t,e,t,e,t,i,n)},_slerpAdditive:function(t,e,i,n,r){const o=this._workIndex*r;mi.multiplyQuaternionsFlat(t,o,t,e,t,i),mi.slerpFlat(t,e,t,e,t,o,n)},_lerp:function(t,e,i,n,r){const o=1-n;for(let s=0;s!==r;++s){const r=e+s;t[r]=t[r]*o+t[i+s]*n}},_lerpAdditive:function(t,e,i,n,r){for(let o=0;o!==r;++o){const r=e+o;t[r]=t[r]+t[i+o]*n}}});const Lf="\\[\\]\\.:\\/",Cf=new RegExp("["+Lf+"]","g"),Pf="[^"+Lf+"]",Rf="[^"+Lf.replace("\\.","")+"]",Of=/((?:WC+[\/:])*)/.source.replace("WC",Pf),kf=/(WCOD+)?/.source.replace("WCOD",Rf),Df=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Pf),If=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Pf),Nf=new RegExp("^"+Of+kf+Df+If+"$"),Bf=["material","materials","bones"];function zf(t,e,i){const n=i||Ff.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,n)}function Ff(t,e,i){this.path=e,this.parsedPath=i||Ff.parseTrackName(e),this.node=Ff.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}function Uf(){this.uuid=oi.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const t={};this._indicesByUUID=t;for(let i=0,n=arguments.length;i!==n;++i)t[arguments[i].uuid]=i;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const e=this;this.stats={objects:{get total(){return e._objects.length},get inUse(){return this.total-e.nCachedObjects_}},get bindingsPerObject(){return e._bindings.length}}}function Gf(t,e,i,n){this._mixer=t,this._clip=e,this._localRoot=i||null,this.blendMode=n||e.blendMode;const r=e.tracks,o=r.length,s=new Array(o),a={endingStart:Ie,endingEnd:Ie};for(let l=0;l!==o;++l){const t=r[l].createInterpolant(null);s[l]=t,t.settings=a}this._interpolantSettings=a,this._interpolants=s,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Pe,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function Hf(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function jf(t){"string"===typeof t&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),t=arguments[1]),this.value=t}function Wf(t,e,i){Vc.call(this,t,e),this.meshPerAttribute=i||1}function Vf(t,e,i,n){this.ray=new vn(t,e),this.near=i||0,this.far=n||1/0,this.camera=null,this.layers=new Pi,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 Xf(t,e){return t.distance-e.distance}function Yf(t,e,i,n){if(t.layers.test(e.layers)&&t.raycast(e,i),!0===n){const n=t.children;for(let t=0,r=n.length;t<r;t++)Yf(n[t],e,i,!0)}}function qf(t,e,i){return this.radius=void 0!==t?t:1,this.phi=void 0!==e?e:0,this.theta=void 0!==i?i:0,this}function Zf(t,e,i){return this.radius=void 0!==t?t:1,this.theta=void 0!==e?e:0,this.y=void 0!==i?i:0,this}Object.assign(zf.prototype,{getValue:function(t,e){this.bind();const i=this._targetGroup.nCachedObjects_,n=this._bindings[i];void 0!==n&&n.getValue(t,e)},setValue:function(t,e){const i=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=i.length;n!==r;++n)i[n].setValue(t,e)},bind:function(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].bind()},unbind:function(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].unbind()}}),Object.assign(Ff,{Composite:zf,create:function(t,e,i){return t&&t.isAnimationObjectGroup?new Ff.Composite(t,e,i):new Ff(t,e,i)},sanitizeNodeName:function(t){return t.replace(/\s/g,"_").replace(Cf,"")},parseTrackName:function(t){const e=Nf.exec(t);if(!e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const i={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},n=i.nodeName&&i.nodeName.lastIndexOf(".");if(void 0!==n&&-1!==n){const t=i.nodeName.substring(n+1);-1!==Bf.indexOf(t)&&(i.nodeName=i.nodeName.substring(0,n),i.objectName=t)}if(null===i.propertyName||0===i.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return i},findNode:function(t,e){if(!e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){const i=t.skeleton.getBoneByName(e);if(void 0!==i)return i}if(t.children){const i=function(t){for(let n=0;n<t.length;n++){const r=t[n];if(r.name===e||r.uuid===e)return r;const o=i(r.children);if(o)return o}return null},n=i(t.children);if(n)return n}return null}}),Object.assign(Ff.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(t,e){t[e]=this.node[this.propertyName]},function(t,e){const i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)t[e++]=i[n]},function(t,e){t[e]=this.resolvedProperty[this.propertyIndex]},function(t,e){this.resolvedProperty.toArray(t,e)}],SetterByBindingTypeAndVersioning:[[function(t,e){this.targetObject[this.propertyName]=t[e]},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){const i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)i[n]=t[e++]},function(t,e){const i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)i[n]=t[e++];this.targetObject.needsUpdate=!0},function(t,e){const i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)i[n]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty[this.propertyIndex]=t[e]},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty.fromArray(t,e)},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(t,e){this.bind(),this.getValue(t,e)},setValue:function(t,e){this.bind(),this.setValue(t,e)},bind:function(){let t=this.node,e=this.parsedPath,i=e.objectName,n=e.propertyName,r=e.propertyIndex;if(t||(t=Ff.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t)return void console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");if(i){let n=e.objectIndex;switch(i){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(let e=0;e<t.length;e++)if(t[e].name===n){n=e;break}break;default:if(void 0===t[i])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[i]}if(void 0!==n){if(void 0===t[n])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[n]}}const o=t[n];if(void 0===o){const i=e.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+i+"."+n+" but it wasn't found.",t)}let s=this.Versioning.None;this.targetObject=t,void 0!==t.needsUpdate?s=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(s=this.Versioning.MatrixWorldNeedsUpdate);let a=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===n){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!t.geometry.isBufferGeometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",this);if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==t.morphTargetDictionary[r]&&(r=t.morphTargetDictionary[r])}a=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=r}else void 0!==o.fromArray&&void 0!==o.toArray?(a=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(a=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=n;this.getValue=this.GetterByBindingType[a],this.setValue=this.SetterByBindingTypeAndVersioning[a][s]},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),Object.assign(Ff.prototype,{_getValue_unbound:Ff.prototype.getValue,_setValue_unbound:Ff.prototype.setValue}),Object.assign(Uf.prototype,{isAnimationObjectGroup:!0,add:function(){const t=this._objects,e=this._indicesByUUID,i=this._paths,n=this._parsedPaths,r=this._bindings,o=r.length;let s=void 0,a=t.length,l=this.nCachedObjects_;for(let c=0,h=arguments.length;c!==h;++c){const h=arguments[c],u=h.uuid;let d=e[u];if(void 0===d){d=a++,e[u]=d,t.push(h);for(let t=0,e=o;t!==e;++t)r[t].push(new Ff(h,i[t],n[t]))}else if(d<l){s=t[d];const a=--l,c=t[a];e[c.uuid]=d,t[d]=c,e[u]=a,t[a]=h;for(let t=0,e=o;t!==e;++t){const e=r[t],o=e[a];let s=e[d];e[d]=o,void 0===s&&(s=new Ff(h,i[t],n[t])),e[a]=s}}else t[d]!==s&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=l},remove:function(){const t=this._objects,e=this._indicesByUUID,i=this._bindings,n=i.length;let r=this.nCachedObjects_;for(let o=0,s=arguments.length;o!==s;++o){const s=arguments[o],a=s.uuid,l=e[a];if(void 0!==l&&l>=r){const o=r++,c=t[o];e[c.uuid]=l,t[l]=c,e[a]=o,t[o]=s;for(let t=0,e=n;t!==e;++t){const e=i[t],n=e[o],r=e[l];e[l]=n,e[o]=r}}}this.nCachedObjects_=r},uncache:function(){const t=this._objects,e=this._indicesByUUID,i=this._bindings,n=i.length;let r=this.nCachedObjects_,o=t.length;for(let s=0,a=arguments.length;s!==a;++s){const a=arguments[s],l=a.uuid,c=e[l];if(void 0!==c)if(delete e[l],c<r){const s=--r,a=t[s],l=--o,h=t[l];e[a.uuid]=c,t[c]=a,e[h.uuid]=s,t[s]=h,t.pop();for(let t=0,e=n;t!==e;++t){const e=i[t],n=e[s],r=e[l];e[c]=n,e[s]=r,e.pop()}}else{const r=--o,s=t[r];e[s.uuid]=c,t[c]=s,t.pop();for(let t=0,e=n;t!==e;++t){const e=i[t];e[c]=e[r],e.pop()}}}this.nCachedObjects_=r},subscribe_:function(t,e){let i=this._bindingsIndicesByPath,n=i[t],r=this._bindings;if(void 0!==n)return r[n];const o=this._paths,s=this._parsedPaths,a=this._objects,l=a.length,c=this.nCachedObjects_,h=new Array(l);n=r.length,i[t]=n,o.push(t),s.push(e),r.push(h);for(let u=c,d=a.length;u!==d;++u){const i=a[u];h[u]=new Ff(i,t,e)}return h},unsubscribe_:function(t){const e=this._bindingsIndicesByPath,i=e[t];if(void 0!==i){const n=this._paths,r=this._parsedPaths,o=this._bindings,s=o.length-1,a=o[s],l=t[s];e[l]=i,o[i]=a,o.pop(),r[i]=r[s],r.pop(),n[i]=n[s],n.pop()}}}),Object.assign(Gf.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(t){return this._startTime=t,this},setLoop:function(t,e){return this.loop=t,this.repetitions=e,this},setEffectiveWeight:function(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(t){return this._scheduleFading(t,0,1)},fadeOut:function(t){return this._scheduleFading(t,1,0)},crossFadeFrom:function(t,e,i){if(t.fadeOut(e),this.fadeIn(e),i){const i=this._clip.duration,n=t._clip.duration,r=n/i,o=i/n;t.warp(1,r,e),this.warp(o,1,e)}return this},crossFadeTo:function(t,e,i){return t.crossFadeFrom(this,e,i)},stopFading:function(){let t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},setEffectiveTimeScale:function(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(t){return this.timeScale=this._clip.duration/t,this.stopWarping()},syncWith:function(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()},halt:function(t){return this.warp(this._effectiveTimeScale,0,t)},warp:function(t,e,i){const n=this._mixer,r=n.time,o=this.timeScale;let s=this._timeScaleInterpolant;null===s&&(s=n._lendControlInterpolant(),this._timeScaleInterpolant=s);const a=s.parameterPositions,l=s.sampleValues;return a[0]=r,a[1]=r+i,l[0]=t/o,l[1]=e/o,this},stopWarping:function(){let t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(t,e,i,n){if(!this.enabled)return void this._updateWeight(t);const r=this._startTime;if(null!==r){const n=(t-r)*i;if(n<0||0===i)return;this._startTime=null,e=i*n}e*=this._updateTimeScale(t);const o=this._updateTime(e),s=this._updateWeight(t);if(s>0){const t=this._interpolants,e=this._propertyBindings;switch(this.blendMode){case Fe:for(let i=0,n=t.length;i!==n;++i)t[i].evaluate(o),e[i].accumulateAdditive(s);break;case ze:default:for(let i=0,r=t.length;i!==r;++i)t[i].evaluate(o),e[i].accumulate(n,s)}}},_updateWeight:function(t){let e=0;if(this.enabled){e=this.weight;const i=this._weightInterpolant;if(null!==i){const n=i.evaluate(t)[0];e*=n,t>i.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=e,e},_updateTimeScale:function(t){let e=0;if(!this.paused){e=this.timeScale;const i=this._timeScaleInterpolant;if(null!==i){const n=i.evaluate(t)[0];e*=n,t>i.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e},_updateTime:function(t){const e=this._clip.duration,i=this.loop;let n=this.time+t,r=this._loopCount;const o=i===Re;if(0===t)return-1===r?n:o&&1===(1&r)?e-n:n;if(i===Ce){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(n>=e)n=e;else{if(!(n<0)){this.time=n;break t}n=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===r&&(t>=0?(r=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),n>=e||n<0){const i=Math.floor(n/e);n-=e*i,r+=Math.abs(i);const s=this.repetitions-r;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,n=t>0?e:0,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===s){const e=t<0;this._setEndings(e,!e,o)}else this._setEndings(!1,!1,o);this._loopCount=r,this.time=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:i})}}else this.time=n;if(o&&1===(1&r))return e-n}return n},_setEndings:function(t,e,i){const n=this._interpolantSettings;i?(n.endingStart=Ne,n.endingEnd=Ne):(n.endingStart=t?this.zeroSlopeAtStart?Ne:Ie:Be,n.endingEnd=e?this.zeroSlopeAtEnd?Ne:Ie:Be)},_scheduleFading:function(t,e,i){const n=this._mixer,r=n.time;let o=this._weightInterpolant;null===o&&(o=n._lendControlInterpolant(),this._weightInterpolant=o);const s=o.parameterPositions,a=o.sampleValues;return s[0]=r,a[0]=e,s[1]=r+t,a[1]=i,this}}),Hf.prototype=Object.assign(Object.create(ni.prototype),{constructor:Hf,_bindAction:function(t,e){const i=t._localRoot||this._root,n=t._clip.tracks,r=n.length,o=t._propertyBindings,s=t._interpolants,a=i.uuid,l=this._bindingsByRootAndName;let c=l[a];void 0===c&&(c={},l[a]=c);for(let h=0;h!==r;++h){const t=n[h],r=t.name;let l=c[r];if(void 0!==l)o[h]=l;else{if(l=o[h],void 0!==l){null===l._cacheIndex&&(++l.referenceCount,this._addInactiveBinding(l,a,r));continue}const n=e&&e._propertyBindings[h].binding.parsedPath;l=new Af(Ff.create(i,r,n),t.ValueTypeName,t.getValueSize()),++l.referenceCount,this._addInactiveBinding(l,a,r),o[h]=l}s[h].resultBuffer=l.buffer}},_activateAction:function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){const e=(t._localRoot||this._root).uuid,i=t._clip.uuid,n=this._actionsByClip[i];this._bindAction(t,n&&n.knownActions[0]),this._addInactiveAction(t,i,e)}const e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){const i=e[t];0===i.useCount++&&(this._lendBinding(i),i.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){const e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){const i=e[t];0===--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(t)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}},_isActiveAction:function(t){const e=t._cacheIndex;return null!==e&&e<this._nActiveActions},_addInactiveAction:function(t,e,i){const n=this._actions,r=this._actionsByClip;let o=r[e];if(void 0===o)o={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,r[e]=o;else{const e=o.knownActions;t._byClipCacheIndex=e.length,e.push(t)}t._cacheIndex=n.length,n.push(t),o.actionByRoot[i]=t},_removeInactiveAction:function(t){const e=this._actions,i=e[e.length-1],n=t._cacheIndex;i._cacheIndex=n,e[n]=i,e.pop(),t._cacheIndex=null;const r=t._clip.uuid,o=this._actionsByClip,s=o[r],a=s.knownActions,l=a[a.length-1],c=t._byClipCacheIndex;l._byClipCacheIndex=c,a[c]=l,a.pop(),t._byClipCacheIndex=null;const h=s.actionByRoot,u=(t._localRoot||this._root).uuid;delete h[u],0===a.length&&delete o[r],this._removeInactiveBindingsForAction(t)},_removeInactiveBindingsForAction:function(t){const e=t._propertyBindings;for(let i=0,n=e.length;i!==n;++i){const t=e[i];0===--t.referenceCount&&this._removeInactiveBinding(t)}},_lendAction:function(t){const e=this._actions,i=t._cacheIndex,n=this._nActiveActions++,r=e[n];t._cacheIndex=n,e[n]=t,r._cacheIndex=i,e[i]=r},_takeBackAction:function(t){const e=this._actions,i=t._cacheIndex,n=--this._nActiveActions,r=e[n];t._cacheIndex=n,e[n]=t,r._cacheIndex=i,e[i]=r},_addInactiveBinding:function(t,e,i){const n=this._bindingsByRootAndName,r=this._bindings;let o=n[e];void 0===o&&(o={},n[e]=o),o[i]=t,t._cacheIndex=r.length,r.push(t)},_removeInactiveBinding:function(t){const e=this._bindings,i=t.binding,n=i.rootNode.uuid,r=i.path,o=this._bindingsByRootAndName,s=o[n],a=e[e.length-1],l=t._cacheIndex;a._cacheIndex=l,e[l]=a,e.pop(),delete s[r],0===Object.keys(s).length&&delete o[n]},_lendBinding:function(t){const e=this._bindings,i=t._cacheIndex,n=this._nActiveBindings++,r=e[n];t._cacheIndex=n,e[n]=t,r._cacheIndex=i,e[i]=r},_takeBackBinding:function(t){const e=this._bindings,i=t._cacheIndex,n=--this._nActiveBindings,r=e[n];t._cacheIndex=n,e[n]=t,r._cacheIndex=i,e[i]=r},_lendControlInterpolant:function(){const t=this._controlInterpolants,e=this._nActiveControlInterpolants++;let i=t[e];return void 0===i&&(i=new Ld(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),i.__cacheIndex=e,t[e]=i),i},_takeBackControlInterpolant:function(t){const e=this._controlInterpolants,i=t.__cacheIndex,n=--this._nActiveControlInterpolants,r=e[n];t.__cacheIndex=n,e[n]=t,r.__cacheIndex=i,e[i]=r},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(t,e,i){const n=e||this._root,r=n.uuid;let o="string"===typeof t?zd.findByName(n,t):t;const s=null!==o?o.uuid:t;let a=this._actionsByClip[s],l=null;if(void 0===i&&(i=null!==o?o.blendMode:ze),void 0!==a){const t=a.actionByRoot[r];if(void 0!==t&&t.blendMode===i)return t;l=a.knownActions[0],null===o&&(o=l._clip)}if(null===o)return null;const c=new Gf(this,o,e,i);return this._bindAction(c,l),this._addInactiveAction(c,s,r),c},existingAction:function(t,e){const i=e||this._root,n=i.uuid,r="string"===typeof t?zd.findByName(i,t):t,o=r?r.uuid:t,s=this._actionsByClip[o];return void 0!==s&&s.actionByRoot[n]||null},stopAllAction:function(){const t=this._actions,e=this._nActiveActions;for(let i=e-1;i>=0;--i)t[i].stop();return this},update:function(t){t*=this.timeScale;const e=this._actions,i=this._nActiveActions,n=this.time+=t,r=Math.sign(t),o=this._accuIndex^=1;for(let l=0;l!==i;++l){const i=e[l];i._update(n,t,r,o)}const s=this._bindings,a=this._nActiveBindings;for(let l=0;l!==a;++l)s[l].apply(o);return this},setTime:function(t){this.time=0;for(let e=0;e<this._actions.length;e++)this._actions[e].time=0;return this.update(t)},getRoot:function(){return this._root},uncacheClip:function(t){const e=this._actions,i=t.uuid,n=this._actionsByClip,r=n[i];if(void 0!==r){const t=r.knownActions;for(let i=0,n=t.length;i!==n;++i){const n=t[i];this._deactivateAction(n);const r=n._cacheIndex,o=e[e.length-1];n._cacheIndex=null,n._byClipCacheIndex=null,o._cacheIndex=r,e[r]=o,e.pop(),this._removeInactiveBindingsForAction(n)}delete n[i]}},uncacheRoot:function(t){const e=t.uuid,i=this._actionsByClip;for(const o in i){const t=i[o].actionByRoot,n=t[e];void 0!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}const n=this._bindingsByRootAndName,r=n[e];if(void 0!==r)for(const o in r){const t=r[o];t.restoreOriginalState(),this._removeInactiveBinding(t)}},uncacheAction:function(t,e){const i=this.existingAction(t,e);null!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}}),jf.prototype.clone=function(){return new jf(void 0===this.value.clone?this.value:this.value.clone())},Wf.prototype=Object.assign(Object.create(Vc.prototype),{constructor:Wf,isInstancedInterleavedBuffer:!0,copy:function(t){return Vc.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this},clone:function(t){const e=Vc.prototype.clone.call(this,t);return e.meshPerAttribute=this.meshPerAttribute,e},toJSON:function(t){const e=Vc.prototype.toJSON.call(this,t);return e.isInstancedInterleavedBuffer=!0,e.meshPerAttribute=this.meshPerAttribute,e}}),Object.assign(Vf.prototype,{set:function(t,e){this.ray.set(t,e)},setFromCamera:function(t,e){e&&e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e&&e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(t,e,i){const n=i||[];return Yf(t,this,n,e),n.sort(Xf),n},intersectObjects:function(t,e,i){const n=i||[];if(!1===Array.isArray(t))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),n;for(let r=0,o=t.length;r<o;r++)Yf(t[r],this,n,e);return n.sort(Xf),n}}),Object.assign(qf.prototype,{set:function(t,e,i){return this.radius=t,this.phi=e,this.theta=i,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this},makeSafe:function(){const t=1e-6;return this.phi=Math.max(t,Math.min(Math.PI-t,this.phi)),this},setFromVector3:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},setFromCartesianCoords:function(t,e,i){return this.radius=Math.sqrt(t*t+e*e+i*i),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,i),this.phi=Math.acos(oi.clamp(e/this.radius,-1,1))),this}}),Object.assign(Zf.prototype,{set:function(t,e,i){return this.radius=t,this.theta=e,this.y=i,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.theta=t.theta,this.y=t.y,this},setFromVector3:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},setFromCartesianCoords:function(t,e,i){return this.radius=Math.sqrt(t*t+i*i),this.theta=Math.atan2(t,i),this.y=e,this}});const Jf=new si;function Kf(t,e){this.min=void 0!==t?t:new si(1/0,1/0),this.max=void 0!==e?e:new si(-1/0,-1/0)}Object.assign(Kf.prototype,{set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromPoints:function(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(t,e){const i=Jf.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.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(t){return void 0===t&&(console.warn("THREE.Box2: .getCenter() target is now required"),t=new si),this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(console.warn("THREE.Box2: .getSize() target is now required"),t=new si),this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y},getParameter:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .getParameter() target is now required"),e=new si),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)},clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .clampPoint() target is now required"),e=new si),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){const e=Jf.copy(t).clamp(this.min,this.max);return e.sub(t).length()},intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}});const $f=new yi,Qf=new yi;function tm(t,e){this.start=void 0!==t?t:new yi,this.end=void 0!==e?e:new yi}function em(t){Wi.call(this),this.material=t,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}Object.assign(tm.prototype,{set:function(t,e){return this.start.copy(t),this.end.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.start.copy(t.start),this.end.copy(t.end),this},getCenter:function(t){return void 0===t&&(console.warn("THREE.Line3: .getCenter() target is now required"),t=new yi),t.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){return void 0===t&&(console.warn("THREE.Line3: .delta() target is now required"),t=new yi),t.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,e){return void 0===e&&(console.warn("THREE.Line3: .at() target is now required"),e=new yi),this.delta(e).multiplyScalar(t).add(this.start)},closestPointToPointParameter:function(t,e){$f.subVectors(t,this.start),Qf.subVectors(this.end,this.start);const i=Qf.dot(Qf),n=Qf.dot($f);let r=n/i;return e&&(r=oi.clamp(r,0,1)),r},closestPointToPoint:function(t,e,i){const n=this.closestPointToPointParameter(t,e);return void 0===i&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),i=new yi),this.delta(i).multiplyScalar(n).add(this.start)},applyMatrix4:function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},equals:function(t){return t.start.equals(this.start)&&t.end.equals(this.end)}}),em.prototype=Object.create(Wi.prototype),em.prototype.constructor=em,em.prototype.isImmediateRenderObject=!0;const im=new yi;function nm(t,e){Wi.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e;const i=new ur,n=[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(let o=0,s=1,a=32;o<a;o++,s++){const t=o/a*Math.PI*2,e=s/a*Math.PI*2;n.push(Math.cos(t),Math.sin(t),1,Math.cos(e),Math.sin(e),1)}i.setAttribute("position",new tr(n,3));const r=new Mh({fog:!1,toneMapped:!1});this.cone=new Oh(i,r),this.add(this.cone),this.update()}nm.prototype=Object.create(Wi.prototype),nm.prototype.constructor=nm,nm.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},nm.prototype.update=function(){this.light.updateMatrixWorld();const t=this.light.distance?this.light.distance:1e3,e=t*Math.tan(this.light.angle);this.cone.scale.set(e,e,t),im.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(im),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)};const rm=new yi,om=new Ei,sm=new Ei;function am(t){const e=[];t&&t.isBone&&e.push(t);for(let i=0;i<t.children.length;i++)e.push.apply(e,am(t.children[i]));return e}function lm(t){const e=am(t),i=new ur,n=[],r=[],o=new Nn(0,0,1),s=new Nn(0,1,0);for(let l=0;l<e.length;l++){const t=e[l];t.parent&&t.parent.isBone&&(n.push(0,0,0),n.push(0,0,0),r.push(o.r,o.g,o.b),r.push(s.r,s.g,s.b))}i.setAttribute("position",new tr(n,3)),i.setAttribute("color",new tr(r,3));const a=new Mh({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});Oh.call(this,i,a),this.type="SkeletonHelper",this.root=t,this.bones=e,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1}function cm(t,e,i){this.light=t,this.light.updateMatrixWorld(),this.color=i;const n=new $u(e,4,2),r=new jn({wireframe:!0,fog:!1,toneMapped:!1});Cr.call(this,n,r),this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}lm.prototype=Object.create(Oh.prototype),lm.prototype.constructor=lm,lm.prototype.isSkeletonHelper=!0,lm.prototype.updateMatrixWorld=function(t){const e=this.bones,i=this.geometry,n=i.getAttribute("position");sm.getInverse(this.root.matrixWorld);for(let r=0,o=0;r<e.length;r++){const t=e[r];t.parent&&t.parent.isBone&&(om.multiplyMatrices(sm,t.matrixWorld),rm.setFromMatrixPosition(om),n.setXYZ(o,rm.x,rm.y,rm.z),om.multiplyMatrices(sm,t.parent.matrixWorld),rm.setFromMatrixPosition(om),n.setXYZ(o+1,rm.x,rm.y,rm.z),o+=2)}i.getAttribute("position").needsUpdate=!0,Wi.prototype.updateMatrixWorld.call(this,t)},cm.prototype=Object.create(Cr.prototype),cm.prototype.constructor=cm,cm.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},cm.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)};const hm=new yi,um=new Nn,dm=new Nn;function pm(t,e,i){Wi.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=i;const n=new Qh(e);n.rotateY(.5*Math.PI),this.material=new jn({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0);const r=n.getAttribute("position"),o=new Float32Array(3*r.count);n.setAttribute("color",new Xn(o,3)),this.add(new Cr(n,this.material)),this.update()}function fm(t,e,i,n){t=t||10,e=e||10,i=new Nn(void 0!==i?i:4473924),n=new Nn(void 0!==n?n:8947848);const r=e/2,o=t/e,s=t/2,a=[],l=[];for(let u=0,d=0,p=-s;u<=e;u++,p+=o){a.push(-s,0,p,s,0,p),a.push(p,0,-s,p,0,s);const t=u===r?i:n;t.toArray(l,d),d+=3,t.toArray(l,d),d+=3,t.toArray(l,d),d+=3,t.toArray(l,d),d+=3}const c=new ur;c.setAttribute("position",new tr(a,3)),c.setAttribute("color",new tr(l,3));const h=new Mh({vertexColors:!0,toneMapped:!1});Oh.call(this,c,h),this.type="GridHelper"}function mm(t,e,i,n,r,o){t=t||10,e=e||16,i=i||8,n=n||64,r=new Nn(void 0!==r?r:4473924),o=new Nn(void 0!==o?o:8947848);const s=[],a=[];for(let h=0;h<=e;h++){const i=h/e*(2*Math.PI),n=Math.sin(i)*t,l=Math.cos(i)*t;s.push(0,0,0),s.push(n,0,l);const c=1&h?r:o;a.push(c.r,c.g,c.b),a.push(c.r,c.g,c.b)}for(let h=0;h<=i;h++){const e=1&h?r:o,l=t-t/i*h;for(let t=0;t<n;t++){let i=t/n*(2*Math.PI),r=Math.sin(i)*l,o=Math.cos(i)*l;s.push(r,0,o),a.push(e.r,e.g,e.b),i=(t+1)/n*(2*Math.PI),r=Math.sin(i)*l,o=Math.cos(i)*l,s.push(r,0,o),a.push(e.r,e.g,e.b)}}const l=new ur;l.setAttribute("position",new tr(s,3)),l.setAttribute("color",new tr(a,3));const c=new Mh({vertexColors:!0,toneMapped:!1});Oh.call(this,l,c),this.type="PolarGridHelper"}pm.prototype=Object.create(Wi.prototype),pm.prototype.constructor=pm,pm.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},pm.prototype.update=function(){const t=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{const e=t.geometry.getAttribute("color");um.copy(this.light.color),dm.copy(this.light.groundColor);for(let t=0,i=e.count;t<i;t++){const n=t<i/2?um:dm;e.setXYZ(t,n.r,n.g,n.b)}e.needsUpdate=!0}t.lookAt(hm.setFromMatrixPosition(this.light.matrixWorld).negate())},fm.prototype=Object.assign(Object.create(Oh.prototype),{constructor:fm,copy:function(t){return Oh.prototype.copy.call(this,t),this.geometry.copy(t.geometry),this.material.copy(t.material),this},clone:function(){return(new this.constructor).copy(this)}}),mm.prototype=Object.create(Oh.prototype),mm.prototype.constructor=mm;const gm=new yi,vm=new yi,ym=new yi;function xm(t,e,i){Wi.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,void 0===e&&(e=1);let n=new ur;n.setAttribute("position",new tr([-e,e,0,e,e,0,e,-e,0,-e,-e,0,-e,e,0],3));const r=new Mh({fog:!1,toneMapped:!1});this.lightPlane=new Ch(n,r),this.add(this.lightPlane),n=new ur,n.setAttribute("position",new tr([0,0,0,0,0,1],3)),this.targetLine=new Ch(n,r),this.add(this.targetLine),this.update()}xm.prototype=Object.create(Wi.prototype),xm.prototype.constructor=xm,xm.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},xm.prototype.update=function(){gm.setFromMatrixPosition(this.light.matrixWorld),vm.setFromMatrixPosition(this.light.target.matrixWorld),ym.subVectors(vm,gm),this.lightPlane.lookAt(vm),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(vm),this.targetLine.scale.z=ym.length()};const bm=new yi,wm=new Vr;function _m(t){const e=new ur,i=new Mh({color:16777215,vertexColors:!0,toneMapped:!1}),n=[],r=[],o={},s=new Nn(16755200),a=new Nn(16711680),l=new Nn(43775),c=new Nn(16777215),h=new Nn(3355443);function u(t,e,i){d(t,i),d(e,i)}function d(t,e){n.push(0,0,0),r.push(e.r,e.g,e.b),void 0===o[t]&&(o[t]=[]),o[t].push(n.length/3-1)}u("n1","n2",s),u("n2","n4",s),u("n4","n3",s),u("n3","n1",s),u("f1","f2",s),u("f2","f4",s),u("f4","f3",s),u("f3","f1",s),u("n1","f1",s),u("n2","f2",s),u("n3","f3",s),u("n4","f4",s),u("p","n1",a),u("p","n2",a),u("p","n3",a),u("p","n4",a),u("u1","u2",l),u("u2","u3",l),u("u3","u1",l),u("c","t",c),u("p","c",h),u("cn1","cn2",h),u("cn3","cn4",h),u("cf1","cf2",h),u("cf3","cf4",h),e.setAttribute("position",new tr(n,3)),e.setAttribute("color",new tr(r,3)),Oh.call(this,e,i),this.type="CameraHelper",this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()}function Mm(t,e,i,n,r,o,s){bm.set(r,o,s).unproject(n);const a=e[t];if(void 0!==a){const t=i.getAttribute("position");for(let e=0,i=a.length;e<i;e++)t.setXYZ(a[e],bm.x,bm.y,bm.z)}}_m.prototype=Object.create(Oh.prototype),_m.prototype.constructor=_m,_m.prototype.update=function(){const t=this.geometry,e=this.pointMap,i=1,n=1;wm.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Mm("c",e,t,wm,0,0,-1),Mm("t",e,t,wm,0,0,1),Mm("n1",e,t,wm,-i,-n,-1),Mm("n2",e,t,wm,i,-n,-1),Mm("n3",e,t,wm,-i,n,-1),Mm("n4",e,t,wm,i,n,-1),Mm("f1",e,t,wm,-i,-n,1),Mm("f2",e,t,wm,i,-n,1),Mm("f3",e,t,wm,-i,n,1),Mm("f4",e,t,wm,i,n,1),Mm("u1",e,t,wm,.7*i,1.1*n,-1),Mm("u2",e,t,wm,.7*-i,1.1*n,-1),Mm("u3",e,t,wm,0,2*n,-1),Mm("cf1",e,t,wm,-i,0,1),Mm("cf2",e,t,wm,i,0,1),Mm("cf3",e,t,wm,0,-n,1),Mm("cf4",e,t,wm,0,n,1),Mm("cn1",e,t,wm,-i,0,-1),Mm("cn2",e,t,wm,i,0,-1),Mm("cn3",e,t,wm,0,-n,-1),Mm("cn4",e,t,wm,0,n,-1),t.getAttribute("position").needsUpdate=!0};const Sm=new sn;function Tm(t,e){this.object=t,void 0===e&&(e=16776960);const i=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]),n=new Float32Array(24),r=new ur;r.setIndex(new Xn(i,1)),r.setAttribute("position",new Xn(n,3)),Oh.call(this,r,new Mh({color:e,toneMapped:!1})),this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}function Em(t,e){this.type="Box3Helper",this.box=t,e=e||16776960;const i=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]),n=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],r=new ur;r.setIndex(new Xn(i,1)),r.setAttribute("position",new tr(n,3)),Oh.call(this,r,new Mh({color:e,toneMapped:!1})),this.type="Box3Helper",this.geometry.computeBoundingSphere()}function Am(t,e,i){this.plane=t,this.size=void 0===e?1:e;const n=void 0!==i?i:16776960,r=[1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],o=new ur;o.setAttribute("position",new tr(r,3)),o.computeBoundingSphere(),Ch.call(this,o,new Mh({color:n,toneMapped:!1})),this.type="PlaneHelper";const s=[1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],a=new ur;a.setAttribute("position",new tr(s,3)),a.computeBoundingSphere(),this.add(new Cr(a,new jn({color:n,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}Tm.prototype=Object.create(Oh.prototype),Tm.prototype.constructor=Tm,Tm.prototype.update=function(t){if(void 0!==t&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&Sm.setFromObject(this.object),Sm.isEmpty())return;const e=Sm.min,i=Sm.max,n=this.geometry.attributes.position,r=n.array;r[0]=i.x,r[1]=i.y,r[2]=i.z,r[3]=e.x,r[4]=i.y,r[5]=i.z,r[6]=e.x,r[7]=e.y,r[8]=i.z,r[9]=i.x,r[10]=e.y,r[11]=i.z,r[12]=i.x,r[13]=i.y,r[14]=e.z,r[15]=e.x,r[16]=i.y,r[17]=e.z,r[18]=e.x,r[19]=e.y,r[20]=e.z,r[21]=i.x,r[22]=e.y,r[23]=e.z,n.needsUpdate=!0,this.geometry.computeBoundingSphere()},Tm.prototype.setFromObject=function(t){return this.object=t,this.update(),this},Tm.prototype.copy=function(t){return Oh.prototype.copy.call(this,t),this.object=t.object,this},Tm.prototype.clone=function(){return(new this.constructor).copy(this)},Em.prototype=Object.create(Oh.prototype),Em.prototype.constructor=Em,Em.prototype.updateMatrixWorld=function(t){const e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5),Wi.prototype.updateMatrixWorld.call(this,t))},Am.prototype=Object.create(Ch.prototype),Am.prototype.constructor=Am,Am.prototype.updateMatrixWorld=function(t){let e=-this.plane.constant;Math.abs(e)<1e-8&&(e=1e-8),this.scale.set(.5*this.size,.5*this.size,e),this.children[0].material.side=e<0?p:d,this.lookAt(this.plane.normal),Wi.prototype.updateMatrixWorld.call(this,t)};const Lm=new yi;let Cm,Pm;function Rm(t,e,i,n,r,o){Wi.call(this),this.type="ArrowHelper",void 0===t&&(t=new yi(0,0,1)),void 0===e&&(e=new yi(0,0,0)),void 0===i&&(i=1),void 0===n&&(n=16776960),void 0===r&&(r=.2*i),void 0===o&&(o=.2*r),void 0===Cm&&(Cm=new ur,Cm.setAttribute("position",new tr([0,0,0,0,1,0],3)),Pm=new ld(0,.5,1,5,1),Pm.translate(0,-.5,0)),this.position.copy(e),this.line=new Ch(Cm,new Mh({color:n,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Cr(Pm,new jn({color:n,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(i,r,o)}function Om(t){t=t||1;const e=[0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],n=new ur;n.setAttribute("position",new tr(e,3)),n.setAttribute("color",new tr(i,3));const r=new Mh({vertexColors:!0,toneMapped:!1});Oh.call(this,n,r),this.type="AxesHelper"}Rm.prototype=Object.create(Wi.prototype),Rm.prototype.constructor=Rm,Rm.prototype.setDirection=function(t){if(t.y>.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{Lm.set(t.z,0,-t.x).normalize();const e=Math.acos(t.y);this.quaternion.setFromAxisAngle(Lm,e)}},Rm.prototype.setLength=function(t,e,i){void 0===e&&(e=.2*t),void 0===i&&(i=.2*e),this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(i,e,i),this.cone.position.y=t,this.cone.updateMatrix()},Rm.prototype.setColor=function(t){this.line.material.color.set(t),this.cone.material.color.set(t)},Rm.prototype.copy=function(t){return Wi.prototype.copy.call(this,t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this},Rm.prototype.clone=function(){return(new this.constructor).copy(this)},Om.prototype=Object.create(Oh.prototype),Om.prototype.constructor=Om;const km=4,Dm=8,Im=Math.pow(2,Dm),Nm=[.125,.215,.35,.446,.526,.582],Bm=Dm-km+1+Nm.length,zm=20,Fm={[Ge]:0,[He]:1,[We]:2,[Xe]:3,[Ye]:4,[qe]:5,[je]:6},Um=new Np,{_lodPlanes:Gm,_sizeLods:Hm,_sigmas:jm}=Jm();let Wm=null;const Vm=(1+Math.sqrt(5))/2,Xm=1/Vm,Ym=[new yi(1,1,1),new yi(-1,1,1),new yi(1,1,-1),new yi(-1,1,-1),new yi(0,Vm,Xm),new yi(0,Vm,-Xm),new yi(Xm,0,Vm),new yi(-Xm,0,Vm),new yi(Vm,Xm,0),new yi(-Vm,Xm,0)];function qm(t){this._renderer=t,this._pingPongRenderTarget=null,this._blurMaterial=Qm(zm),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}function Zm(t){return void 0!==t&&t.type===vt&&(t.encoding===Ge||t.encoding===He||t.encoding===je)}function Jm(){const t=[],e=[],i=[];let n=Dm;for(let r=0;r<Bm;r++){const o=Math.pow(2,n);e.push(o);let s=1/o;r>Dm-km?s=Nm[r-Dm+km-1]:0==r&&(s=0),i.push(s);const a=1/(o-1),l=-a/2,c=1+a/2,h=[l,l,c,l,c,c,l,l,c,c,l,c],u=6,d=6,p=3,f=2,m=1,g=new Float32Array(p*d*u),v=new Float32Array(f*d*u),y=new Float32Array(m*d*u);for(let t=0;t<u;t++){const e=t%3*2/3-1,i=t>2?0:-1,n=[e,i,0,e+2/3,i,0,e+2/3,i+1,0,e,i,0,e+2/3,i+1,0,e,i+1,0];g.set(n,p*d*t),v.set(h,f*d*t);const r=[t,t,t,t,t,t];y.set(r,m*d*t)}const x=new ur;x.setAttribute("position",new Xn(g,p)),x.setAttribute("uv",new Xn(v,f)),x.setAttribute("faceIndex",new Xn(y,m)),t.push(x),n>km&&n--}return{_lodPlanes:t,_sizeLods:e,_sigmas:i}}function Km(t){const e=new pi(3*Im,3*Im,t);return e.texture.mapping=st,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function $m(t,e,i,n,r){t.viewport.set(e,i,n,r),t.scissor.set(e,i,n,r)}function Qm(t){const e=new Float32Array(t),i=new yi(0,1,0),n=new md({name:"SphericalGaussianBlur",defines:{n:t},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i},inputEncoding:{value:Fm[Ge]},outputEncoding:{value:Fm[Ge]}},vertexShader:ig(),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${ng()}\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:g,depthTest:!1,depthWrite:!1});return n}function tg(){const t=new si(1,1),e=new md({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:t},inputEncoding:{value:Fm[Ge]},outputEncoding:{value:Fm[Ge]}},vertexShader:ig(),fragmentShader:`\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform vec2 texelSize;\n\n${ng()}\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:g,depthTest:!1,depthWrite:!1});return e}function eg(){const t=new md({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:Fm[Ge]},outputEncoding:{value:Fm[Ge]}},vertexShader:ig(),fragmentShader:`\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform samplerCube envMap;\n\n${ng()}\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:g,depthTest:!1,depthWrite:!1});return t}function ig(){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 ng(){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"}qm.prototype={constructor:qm,fromScene:function(t,e=0,i=.1,n=100){Wm=this._renderer.getRenderTarget();const r=this._allocateTargets();return this._sceneToCubeUV(t,i,n,r),e>0&&this._blur(r,0,0,e),this._applyPMREM(r),this._cleanup(r),r},fromEquirectangular:function(t){return this._fromTexture(t)},fromCubemap:function(t){return this._fromTexture(t)},compileCubemapShader:function(){null===this._cubemapShader&&(this._cubemapShader=eg(),this._compileMaterial(this._cubemapShader))},compileEquirectangularShader:function(){null===this._equirectShader&&(this._equirectShader=tg(),this._compileMaterial(this._equirectShader))},dispose:function(){this._blurMaterial.dispose(),null!==this._cubemapShader&&this._cubemapShader.dispose(),null!==this._equirectShader&&this._equirectShader.dispose();for(let t=0;t<Gm.length;t++)Gm[t].dispose()},_cleanup:function(t){this._pingPongRenderTarget.dispose(),this._renderer.setRenderTarget(Wm),t.scissorTest=!1,$m(t,0,0,t.width,t.height)},_fromTexture:function(t){Wm=this._renderer.getRenderTarget();const e=this._allocateTargets(t);return this._textureToCubeUV(t,e),this._applyPMREM(e),this._cleanup(e),e},_allocateTargets:function(t){const e={magFilter:ut,minFilter:ut,generateMipmaps:!1,type:vt,format:Dt,encoding:Zm(t)?t.encoding:We,depthBuffer:!1,stencilBuffer:!1},i=Km(e);return i.depthBuffer=!t,this._pingPongRenderTarget=Km(e),i},_compileMaterial:function(t){const e=new Cr(Gm[0],t);this._renderer.compile(e,Um)},_sceneToCubeUV:function(t,e,i,n){const r=90,o=1,s=new Xr(r,o,e,i),a=[1,-1,1,1,1,1],l=[1,1,1,-1,-1,-1],c=this._renderer,h=c.outputEncoding,u=c.toneMapping,d=c.getClearColor(),p=c.getClearAlpha();c.toneMapping=Z,c.outputEncoding=Ge;let f=t.background;if(f&&f.isColor){f.convertSRGBToLinear();const e=Math.max(f.r,f.g,f.b),i=Math.min(Math.max(Math.ceil(Math.log2(e)),-128),127);f=f.multiplyScalar(Math.pow(2,-i));const n=(i+128)/255;c.setClearColor(f,n),t.background=null}for(let m=0;m<6;m++){const e=m%3;0==e?(s.up.set(0,a[m],0),s.lookAt(l[m],0,0)):1==e?(s.up.set(0,0,a[m]),s.lookAt(0,l[m],0)):(s.up.set(0,a[m],0),s.lookAt(0,0,l[m])),$m(n,e*Im,m>2?Im:0,Im,Im),c.setRenderTarget(n),c.render(t,s)}c.toneMapping=u,c.outputEncoding=h,c.setClearColor(d,p)},_textureToCubeUV:function(t,e){const i=this._renderer;t.isCubeTexture?null==this._cubemapShader&&(this._cubemapShader=eg()):null==this._equirectShader&&(this._equirectShader=tg());const n=t.isCubeTexture?this._cubemapShader:this._equirectShader,r=new Cr(Gm[0],n),o=n.uniforms;o["envMap"].value=t,t.isCubeTexture||o["texelSize"].value.set(1/t.image.width,1/t.image.height),o["inputEncoding"].value=Fm[t.encoding],o["outputEncoding"].value=Fm[e.texture.encoding],$m(e,0,0,3*Im,2*Im),i.setRenderTarget(e),i.render(r,Um)},_applyPMREM:function(t){const e=this._renderer,i=e.autoClear;e.autoClear=!1;for(let n=1;n<Bm;n++){const e=Math.sqrt(jm[n]*jm[n]-jm[n-1]*jm[n-1]),i=Ym[(n-1)%Ym.length];this._blur(t,n-1,n,e,i)}e.autoClear=i},_blur:function(t,e,i,n,r){const o=this._pingPongRenderTarget;this._halfBlur(t,o,e,i,n,"latitudinal",r),this._halfBlur(o,t,i,i,n,"longitudinal",r)},_halfBlur:function(t,e,i,n,r,o,s){const a=this._renderer,l=this._blurMaterial;"latitudinal"!==o&&"longitudinal"!==o&&console.error("blur direction must be either latitudinal or longitudinal!");const c=3,h=new Cr(Gm[n],l),u=l.uniforms,d=Hm[i]-1,p=isFinite(r)?Math.PI/(2*d):2*Math.PI/(2*zm-1),f=r/p,m=isFinite(r)?1+Math.floor(c*f):zm;m>zm&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${zm}`);const g=[];let v=0;for(let w=0;w<zm;++w){const t=w/f,e=Math.exp(-t*t/2);g.push(e),0==w?v+=e:w<m&&(v+=2*e)}for(let w=0;w<g.length;w++)g[w]=g[w]/v;u["envMap"].value=t.texture,u["samples"].value=m,u["weights"].value=g,u["latitudinal"].value="latitudinal"===o,s&&(u["poleAxis"].value=s),u["dTheta"].value=p,u["mipInt"].value=Dm-i,u["inputEncoding"].value=Fm[t.texture.encoding],u["outputEncoding"].value=Fm[t.texture.encoding];const y=Hm[n],x=3*Math.max(0,Im-2*y),b=(0===n?0:2*Im)+2*y*(n>Dm-km?n-Dm+km:0);$m(e,x,b,3*y,2*y),a.setRenderTarget(e),a.render(h,Um)}};const rg=2;function og(t){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),ap.call(this,t),this.type="catmullrom",this.closed=!0}function sg(t){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),ap.call(this,t),this.type="catmullrom"}function ag(t){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),ap.call(this,t),this.type="catmullrom"}Qd.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(Qd.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},Object.assign(Ep.prototype,{createPointsGeometry:function(t){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");const e=this.getPoints(t);return this.createGeometry(e)},createSpacedPointsGeometry:function(t){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");const e=this.getSpacedPoints(t);return this.createGeometry(e)},createGeometry:function(t){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");const e=new Nr;for(let i=0,n=t.length;i<n;i++){const n=t[i];e.vertices.push(new yi(n.x,n.y,n.z||0))}return e}}),Object.assign(Ap.prototype,{fromPoints:function(t){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(t)}}),og.prototype=Object.create(ap.prototype),sg.prototype=Object.create(ap.prototype),ag.prototype=Object.create(ap.prototype),Object.assign(ag.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.")}}),fm.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},lm.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(Wd.prototype,{extractUrlBase:function(t){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),Wp.extractUrlBase(t)}}),Wd.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(Zp.prototype,{setTexturePath:function(t){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(t)}}),Object.assign(Kf.prototype,{center:function(t){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},size:function(t){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign(sn.prototype,{center:function(t){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionSphere:function(t){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)},size:function(t){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign(cn.prototype,{empty:function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()}}),to.prototype.setFromMatrix=function(t){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(t)},tm.prototype.center=function(t){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(t)},Object.assign(oi,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(t){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),oi.floorPowerOfTwo(t)},nextPowerOfTwo:function(t){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),oi.ceilPowerOfTwo(t)}}),Object.assign(ai.prototype,{flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},multiplyVector3:function(t){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBufferAttribute:function(t){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(Ei.prototype,{extractPosition:function(t){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)},flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},getPosition:function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new yi).setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(t){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(t)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(t){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector4:function(t){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(t){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),t.transformDirection(this)},crossVector:function(t){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.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(t){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(t,e,i,n,r,o){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(t,e,n,i,r,o)}}),wn.prototype.isIntersectionLine=function(t){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(t)},mi.prototype.multiplyVector3=function(t){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)},Object.assign(vn.prototype,{isIntersectionBox:function(t){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionPlane:function(t){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(t)},isIntersectionSphere:function(t){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)}}),Object.assign(On.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(t,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(t,e)},midpoint:function(t){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(t)},normal:function(t){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(t)},plane:function(t){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(t)}}),Object.assign(On,{barycoordFromPoint:function(t,e,i,n,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),On.getBarycoord(t,e,i,n,r)},normal:function(t,e,i,n){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),On.getNormal(t,e,i,n)}}),Object.assign(Lp.prototype,{extractAllPoints:function(t){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(t)},extrude:function(t){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Vu(this,t)},makeGeometry:function(t){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new nd(this,t)}}),Object.assign(si.prototype,{fromAttribute:function(t,e,i){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,i)},distanceToManhattan:function(t){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(yi.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(t){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)},getScaleFromMatrix:function(t){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)},getColumnFromMatrix:function(t,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,t)},applyProjection:function(t){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(t)},fromAttribute:function(t,e,i){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,i)},distanceToManhattan:function(t){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(di.prototype,{fromAttribute:function(t,e,i){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,i)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Nr.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(t){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.assign(Wi.prototype,{getChildByName:function(t){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(t)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(t,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,t)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},applyMatrix:function(t){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.defineProperties(Wi.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(t){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=t}},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(Cr.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(Cr.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),Ue},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(dh.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(gh.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),ph.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(Qd.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(t){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=t}}),Xr.prototype.setLens=function(t,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==e&&(this.filmGauge=e),this.setFocalLength(t)},Object.defineProperties(Cp.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(t){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=t}},shadowCameraLeft:{set:function(t){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=t}},shadowCameraRight:{set:function(t){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=t}},shadowCameraTop:{set:function(t){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=t}},shadowCameraBottom:{set:function(t){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=t}},shadowCameraNear:{set:function(t){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=t}},shadowCameraFar:{set:function(t){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=t}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(t){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=t}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(t){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=t}},shadowMapHeight:{set:function(t){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=t}}}),Object.defineProperties(Xn.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."),this.usage===ii},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(ii)}}}),Object.assign(Xn.prototype,{setDynamic:function(t){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?ii:ei),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(ur.prototype,{addIndex:function(t){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(t)},addAttribute:function(t,e){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?"index"===t?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):this.setAttribute(t,e):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(t,new Xn(arguments[1],arguments[2])))},addDrawCall:function(t,e,i){void 0!==i&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(t,e)},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(t){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(t)},applyMatrix:function(t){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.defineProperties(ur.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(Vp.prototype,{maxInstancedCount:{get:function(){return console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount},set:function(t){console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount=t}}}),Object.defineProperties(Vf.prototype,{linePrecision:{get:function(){return console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold},set:function(t){console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold=t}}}),Object.defineProperties(Vc.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.usage===ii},set:function(t){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(t)}}}),Object.assign(Vc.prototype,{setDynamic:function(t){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?ii:ei),this},setArray:function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(Xu.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(jf.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(Hn.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 Nn}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=t===m}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(t){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=t}}}),Object.defineProperties(yd.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(Wr.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(t){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=t}}}),Object.assign(Gc.prototype,{clearTarget:function(t,e,i,n){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(t),this.clear(e,i,n)},animate:function(t){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(t)},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(t){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(t)},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(Gc.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=t}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=t}},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(t){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===t?He:Ge}},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(Oc.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(pi.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=t}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=t}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=t}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=t}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(t){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=t}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(t){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=t}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(t){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=t}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(t){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=t}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(t){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=t}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(t){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=t}}}),Object.defineProperties(bf.prototype,{load:{value:function(t){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");const e=this,i=new lf;return i.load(t,(function(t){e.setBuffer(t)})),this}},startTime:{set:function(){console.warn("THREE.Audio: .startTime is now .play( delay ).")}}}),Ef.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},Zr.prototype.updateCubeMap=function(t,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(t,e)};ci.crossOrigin=void 0,ci.loadTexture=function(t,e,i,n){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");const r=new $d;r.setCrossOrigin(this.crossOrigin);const o=r.load(t,i,void 0,n);return e&&(o.mapping=e),o},ci.loadTextureCube=function(t,e,i,n){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");const r=new Kd;r.setCrossOrigin(this.crossOrigin);const o=r.load(t,i,void 0,n);return e&&(o.mapping=e),o},ci.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},ci.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:n}}))},"5dbc":function(t,e,i){var n=i("d3f4"),r=i("8b97").set;t.exports=function(t,e,i){var o,s=e.constructor;return s!==i&&"function"==typeof s&&(o=s.prototype)!==i.prototype&&n(o)&&r&&r(t,o),t}},"5df3":function(t,e,i){"use strict";var n=i("02f4")(!0);i("01f9")(String,"String",(function(t){this._t=String(t),this._i=0}),(function(){var t,e=this._t,i=this._i;return i>=e.length?{value:void 0,done:!0}:(t=n(e,i),this._i+=t.length,{value:t,done:!1})}))},"63d9":function(t,e,i){i("ec30")("Float32",4,(function(t){return function(e,i,n){return t(this,e,i,n)}}))},7839:function(t,e,i){},"8a30":function(t,e,i){"use strict";(function(t){const e=i("bb15"),n=(t,i)=>function(){const n=t.apply(e,arguments);return`[${n+i}m`},r=(t,i)=>function(){const n=t.apply(e,arguments);return`[${38+i};5;${n}m`},o=(t,i)=>function(){const n=t.apply(e,arguments);return`[${38+i};2;${n[0]};${n[1]};${n[2]}m`};function s(){const t=new Map,i={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};i.color.grey=i.color.gray;for(const e of Object.keys(i)){const n=i[e];for(const e of Object.keys(n)){const r=n[e];i[e]={open:`[${r[0]}m`,close:`[${r[1]}m`},n[e]=i[e],t.set(r[0],r[1])}Object.defineProperty(i,e,{value:n,enumerable:!1}),Object.defineProperty(i,"codes",{value:t,enumerable:!1})}const s=t=>t,a=(t,e,i)=>[t,e,i];i.color.close="",i.bgColor.close="",i.color.ansi={ansi:n(s,0)},i.color.ansi256={ansi256:r(s,0)},i.color.ansi16m={rgb:o(a,0)},i.bgColor.ansi={ansi:n(s,10)},i.bgColor.ansi256={ansi256:r(s,10)},i.bgColor.ansi16m={rgb:o(a,10)};for(let l of Object.keys(e)){if("object"!==typeof e[l])continue;const t=e[l];"ansi16"===l&&(l="ansi"),"ansi16"in t&&(i.color.ansi[l]=n(t.ansi16,0),i.bgColor.ansi[l]=n(t.ansi16,10)),"ansi256"in t&&(i.color.ansi256[l]=r(t.ansi256,0),i.bgColor.ansi256[l]=r(t.ansi256,10)),"rgb"in t&&(i.color.ansi16m[l]=o(t.rgb,0),i.bgColor.ansi16m[l]=o(t.rgb,10))}return i}Object.defineProperty(t,"exports",{enumerable:!0,get:s})}).call(this,i("62e4")(t))},"8b97":function(t,e,i){var n=i("d3f4"),r=i("cb7c"),o=function(t,e){if(r(t),!n(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,n){try{n=i("9b43")(Function.call,i("11e9").f(Object.prototype,"__proto__").set,2),n(t,[]),e=!(t instanceof Array)}catch(r){e=!0}return function(t,i){return o(t,i),e?t.__proto__=i:n(t,i),t}}({},!1):void 0),check:o}},a279:function(t,e,i){var n=i("b753");function r(){for(var t={},e=Object.keys(n),i=e.length,r=0;r<i;r++)t[e[r]]={distance:-1,parent:null};return t}function o(t){var e=r(),i=[t];e[t].distance=0;while(i.length)for(var o=i.pop(),s=Object.keys(n[o]),a=s.length,l=0;l<a;l++){var c=s[l],h=e[c];-1===h.distance&&(h.distance=e[o].distance+1,h.parent=o,i.unshift(c))}return e}function s(t,e){return function(i){return e(t(i))}}function a(t,e){var i=[e[t].parent,t],r=n[e[t].parent][t],o=e[t].parent;while(e[o].parent)i.unshift(e[o].parent),r=s(n[e[o].parent][o],r),o=e[o].parent;return r.conversion=i,r}t.exports=function(t){for(var e=o(t),i={},n=Object.keys(e),r=n.length,s=0;s<r;s++){var l=n[s],c=e[l];null!==c.parent&&(i[l]=a(l,e))}return i}},a318:function(t,e,i){"use strict";var n=/[|\\{}()[\]^$+*?.]/g;t.exports=function(t){if("string"!==typeof t)throw new TypeError("Expected a string");return t.replace(n,"\\$&")}},a853:function(t,e,i){"use strict";const n=/(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,r=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,o=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,s=/\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi,a=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function l(t){return"u"===t[0]&&5===t.length||"x"===t[0]&&3===t.length?String.fromCharCode(parseInt(t.slice(1),16)):a.get(t)||t}function c(t,e){const i=[],n=e.trim().split(/\s*,\s*/g);let r;for(const a of n)if(isNaN(a)){if(!(r=a.match(o)))throw new Error(`Invalid Chalk template style argument: ${a} (in style '${t}')`);i.push(r[2].replace(s,(t,e,i)=>e?l(e):i))}else i.push(Number(a));return i}function h(t){r.lastIndex=0;const e=[];let i;while(null!==(i=r.exec(t))){const t=i[1];if(i[2]){const n=c(t,i[2]);e.push([t].concat(n))}else e.push([t])}return e}function u(t,e){const i={};for(const r of e)for(const t of r.styles)i[t[0]]=r.inverse?null:t.slice(1);let n=t;for(const r of Object.keys(i))if(Array.isArray(i[r])){if(!(r in n))throw new Error("Unknown Chalk style: "+r);n=i[r].length>0?n[r].apply(n,i[r]):n[r]}return n}t.exports=(t,e)=>{const i=[],r=[];let o=[];if(e.replace(n,(e,n,s,a,c,d)=>{if(n)o.push(l(n));else if(a){const e=o.join("");o=[],r.push(0===i.length?e:u(t,i)(e)),i.push({inverse:s,styles:h(a)})}else if(c){if(0===i.length)throw new Error("Found extraneous } in Chalk template literal");r.push(u(t,i)(o.join(""))),o=[],i.pop()}else o.push(d)}),r.push(o.join("")),i.length>0){const t=`Chalk template literal is missing ${i.length} closing bracket${1===i.length?"":"s"} (\`}\`)`;throw new Error(t)}return r.join("")}},aa77:function(t,e,i){var n=i("5ca1"),r=i("be13"),o=i("79e5"),s=i("fdef"),a="["+s+"]",l="​…",c=RegExp("^"+a+a+"*"),h=RegExp(a+a+"*$"),u=function(t,e,i){var r={},a=o((function(){return!!s[t]()||l[t]()!=l})),c=r[t]=a?e(d):s[t];i&&(r[i]=c),n(n.P+n.F*a,"String",r)},d=u.trim=function(t,e){return t=String(r(t)),1&e&&(t=t.replace(c,"")),2&e&&(t=t.replace(h,"")),t};t.exports=u},af56:function(t,e,i){i("ec30")("Uint16",2,(function(t){return function(e,i,n){return t(this,e,i,n)}}))},b39a:function(t,e,i){var n=i("d3f4");t.exports=function(t,e){if(!n(t)||t._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return t}},b753:function(t,e,i){var n=i("4f4d"),r={};for(var o in n)n.hasOwnProperty(o)&&(r[n[o]]=o);var s=t.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var a in s)if(s.hasOwnProperty(a)){if(!("channels"in s[a]))throw new Error("missing channels property: "+a);if(!("labels"in s[a]))throw new Error("missing channel labels property: "+a);if(s[a].labels.length!==s[a].channels)throw new Error("channel and label counts mismatch: "+a);var l=s[a].channels,c=s[a].labels;delete s[a].channels,delete s[a].labels,Object.defineProperty(s[a],"channels",{value:l}),Object.defineProperty(s[a],"labels",{value:c})}function h(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2)}s.rgb.hsl=function(t){var e,i,n,r=t[0]/255,o=t[1]/255,s=t[2]/255,a=Math.min(r,o,s),l=Math.max(r,o,s),c=l-a;return l===a?e=0:r===l?e=(o-s)/c:o===l?e=2+(s-r)/c:s===l&&(e=4+(r-o)/c),e=Math.min(60*e,360),e<0&&(e+=360),n=(a+l)/2,i=l===a?0:n<=.5?c/(l+a):c/(2-l-a),[e,100*i,100*n]},s.rgb.hsv=function(t){var e,i,n,r,o,s=t[0]/255,a=t[1]/255,l=t[2]/255,c=Math.max(s,a,l),h=c-Math.min(s,a,l),u=function(t){return(c-t)/6/h+.5};return 0===h?r=o=0:(o=h/c,e=u(s),i=u(a),n=u(l),s===c?r=n-i:a===c?r=1/3+e-n:l===c&&(r=2/3+i-e),r<0?r+=1:r>1&&(r-=1)),[360*r,100*o,100*c]},s.rgb.hwb=function(t){var e=t[0],i=t[1],n=t[2],r=s.rgb.hsl(t)[0],o=1/255*Math.min(e,Math.min(i,n));return n=1-1/255*Math.max(e,Math.max(i,n)),[r,100*o,100*n]},s.rgb.cmyk=function(t){var e,i,n,r,o=t[0]/255,s=t[1]/255,a=t[2]/255;return r=Math.min(1-o,1-s,1-a),e=(1-o-r)/(1-r)||0,i=(1-s-r)/(1-r)||0,n=(1-a-r)/(1-r)||0,[100*e,100*i,100*n,100*r]},s.rgb.keyword=function(t){var e=r[t];if(e)return e;var i,o=1/0;for(var s in n)if(n.hasOwnProperty(s)){var a=n[s],l=h(t,a);l<o&&(o=l,i=s)}return i},s.keyword.rgb=function(t){return n[t]},s.rgb.xyz=function(t){var e=t[0]/255,i=t[1]/255,n=t[2]/255;e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;var r=.4124*e+.3576*i+.1805*n,o=.2126*e+.7152*i+.0722*n,s=.0193*e+.1192*i+.9505*n;return[100*r,100*o,100*s]},s.rgb.lab=function(t){var e,i,n,r=s.rgb.xyz(t),o=r[0],a=r[1],l=r[2];return o/=95.047,a/=100,l/=108.883,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,l=l>.008856?Math.pow(l,1/3):7.787*l+16/116,e=116*a-16,i=500*(o-a),n=200*(a-l),[e,i,n]},s.hsl.rgb=function(t){var e,i,n,r,o,s=t[0]/360,a=t[1]/100,l=t[2]/100;if(0===a)return o=255*l,[o,o,o];i=l<.5?l*(1+a):l+a-l*a,e=2*l-i,r=[0,0,0];for(var c=0;c<3;c++)n=s+1/3*-(c-1),n<0&&n++,n>1&&n--,o=6*n<1?e+6*(i-e)*n:2*n<1?i:3*n<2?e+(i-e)*(2/3-n)*6:e,r[c]=255*o;return r},s.hsl.hsv=function(t){var e,i,n=t[0],r=t[1]/100,o=t[2]/100,s=r,a=Math.max(o,.01);return o*=2,r*=o<=1?o:2-o,s*=a<=1?a:2-a,i=(o+r)/2,e=0===o?2*s/(a+s):2*r/(o+r),[n,100*e,100*i]},s.hsv.rgb=function(t){var e=t[0]/60,i=t[1]/100,n=t[2]/100,r=Math.floor(e)%6,o=e-Math.floor(e),s=255*n*(1-i),a=255*n*(1-i*o),l=255*n*(1-i*(1-o));switch(n*=255,r){case 0:return[n,l,s];case 1:return[a,n,s];case 2:return[s,n,l];case 3:return[s,a,n];case 4:return[l,s,n];case 5:return[n,s,a]}},s.hsv.hsl=function(t){var e,i,n,r=t[0],o=t[1]/100,s=t[2]/100,a=Math.max(s,.01);return n=(2-o)*s,e=(2-o)*a,i=o*a,i/=e<=1?e:2-e,i=i||0,n/=2,[r,100*i,100*n]},s.hwb.rgb=function(t){var e,i,n,r,o,s,a,l=t[0]/360,c=t[1]/100,h=t[2]/100,u=c+h;switch(u>1&&(c/=u,h/=u),e=Math.floor(6*l),i=1-h,n=6*l-e,0!==(1&e)&&(n=1-n),r=c+n*(i-c),e){default:case 6:case 0:o=i,s=r,a=c;break;case 1:o=r,s=i,a=c;break;case 2:o=c,s=i,a=r;break;case 3:o=c,s=r,a=i;break;case 4:o=r,s=c,a=i;break;case 5:o=i,s=c,a=r;break}return[255*o,255*s,255*a]},s.cmyk.rgb=function(t){var e,i,n,r=t[0]/100,o=t[1]/100,s=t[2]/100,a=t[3]/100;return e=1-Math.min(1,r*(1-a)+a),i=1-Math.min(1,o*(1-a)+a),n=1-Math.min(1,s*(1-a)+a),[255*e,255*i,255*n]},s.xyz.rgb=function(t){var e,i,n,r=t[0]/100,o=t[1]/100,s=t[2]/100;return e=3.2406*r+-1.5372*o+-.4986*s,i=-.9689*r+1.8758*o+.0415*s,n=.0557*r+-.204*o+1.057*s,e=e>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:12.92*i,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,e=Math.min(Math.max(0,e),1),i=Math.min(Math.max(0,i),1),n=Math.min(Math.max(0,n),1),[255*e,255*i,255*n]},s.xyz.lab=function(t){var e,i,n,r=t[0],o=t[1],s=t[2];return r/=95.047,o/=100,s/=108.883,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,s=s>.008856?Math.pow(s,1/3):7.787*s+16/116,e=116*o-16,i=500*(r-o),n=200*(o-s),[e,i,n]},s.lab.xyz=function(t){var e,i,n,r=t[0],o=t[1],s=t[2];i=(r+16)/116,e=o/500+i,n=i-s/200;var a=Math.pow(i,3),l=Math.pow(e,3),c=Math.pow(n,3);return i=a>.008856?a:(i-16/116)/7.787,e=l>.008856?l:(e-16/116)/7.787,n=c>.008856?c:(n-16/116)/7.787,e*=95.047,i*=100,n*=108.883,[e,i,n]},s.lab.lch=function(t){var e,i,n,r=t[0],o=t[1],s=t[2];return e=Math.atan2(s,o),i=360*e/2/Math.PI,i<0&&(i+=360),n=Math.sqrt(o*o+s*s),[r,n,i]},s.lch.lab=function(t){var e,i,n,r=t[0],o=t[1],s=t[2];return n=s/360*2*Math.PI,e=o*Math.cos(n),i=o*Math.sin(n),[r,e,i]},s.rgb.ansi16=function(t){var e=t[0],i=t[1],n=t[2],r=1 in arguments?arguments[1]:s.rgb.hsv(t)[2];if(r=Math.round(r/50),0===r)return 30;var o=30+(Math.round(n/255)<<2|Math.round(i/255)<<1|Math.round(e/255));return 2===r&&(o+=60),o},s.hsv.ansi16=function(t){return s.rgb.ansi16(s.hsv.rgb(t),t[2])},s.rgb.ansi256=function(t){var e=t[0],i=t[1],n=t[2];if(e===i&&i===n)return e<8?16:e>248?231:Math.round((e-8)/247*24)+232;var r=16+36*Math.round(e/255*5)+6*Math.round(i/255*5)+Math.round(n/255*5);return r},s.ansi16.rgb=function(t){var e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];var i=.5*(1+~~(t>50)),n=(1&e)*i*255,r=(e>>1&1)*i*255,o=(e>>2&1)*i*255;return[n,r,o]},s.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}var i;t-=16;var n=Math.floor(t/36)/5*255,r=Math.floor((i=t%36)/6)/5*255,o=i%6/5*255;return[n,r,o]},s.rgb.hex=function(t){var e=((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2])),i=e.toString(16).toUpperCase();return"000000".substring(i.length)+i},s.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var i=e[0];3===e[0].length&&(i=i.split("").map((function(t){return t+t})).join(""));var n=parseInt(i,16),r=n>>16&255,o=n>>8&255,s=255&n;return[r,o,s]},s.rgb.hcg=function(t){var e,i,n=t[0]/255,r=t[1]/255,o=t[2]/255,s=Math.max(Math.max(n,r),o),a=Math.min(Math.min(n,r),o),l=s-a;return e=l<1?a/(1-l):0,i=l<=0?0:s===n?(r-o)/l%6:s===r?2+(o-n)/l:4+(n-r)/l+4,i/=6,i%=1,[360*i,100*l,100*e]},s.hsl.hcg=function(t){var e=t[1]/100,i=t[2]/100,n=1,r=0;return n=i<.5?2*e*i:2*e*(1-i),n<1&&(r=(i-.5*n)/(1-n)),[t[0],100*n,100*r]},s.hsv.hcg=function(t){var e=t[1]/100,i=t[2]/100,n=e*i,r=0;return n<1&&(r=(i-n)/(1-n)),[t[0],100*n,100*r]},s.hcg.rgb=function(t){var e=t[0]/360,i=t[1]/100,n=t[2]/100;if(0===i)return[255*n,255*n,255*n];var r=[0,0,0],o=e%1*6,s=o%1,a=1-s,l=0;switch(Math.floor(o)){case 0:r[0]=1,r[1]=s,r[2]=0;break;case 1:r[0]=a,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=s;break;case 3:r[0]=0,r[1]=a,r[2]=1;break;case 4:r[0]=s,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=a}return l=(1-i)*n,[255*(i*r[0]+l),255*(i*r[1]+l),255*(i*r[2]+l)]},s.hcg.hsv=function(t){var e=t[1]/100,i=t[2]/100,n=e+i*(1-e),r=0;return n>0&&(r=e/n),[t[0],100*r,100*n]},s.hcg.hsl=function(t){var e=t[1]/100,i=t[2]/100,n=i*(1-e)+.5*e,r=0;return n>0&&n<.5?r=e/(2*n):n>=.5&&n<1&&(r=e/(2*(1-n))),[t[0],100*r,100*n]},s.hcg.hwb=function(t){var e=t[1]/100,i=t[2]/100,n=e+i*(1-e);return[t[0],100*(n-e),100*(1-n)]},s.hwb.hcg=function(t){var e=t[1]/100,i=t[2]/100,n=1-i,r=n-e,o=0;return r<1&&(o=(n-r)/(1-r)),[t[0],100*r,100*o]},s.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},s.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},s.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},s.gray.hsl=s.gray.hsv=function(t){return[0,0,t[0]]},s.gray.hwb=function(t){return[0,100,t[0]]},s.gray.cmyk=function(t){return[0,0,0,t[0]]},s.gray.lab=function(t){return[t[0],0,0]},s.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),i=(e<<16)+(e<<8)+e,n=i.toString(16).toUpperCase();return"000000".substring(n.length)+n},s.rgb.gray=function(t){var e=(t[0]+t[1]+t[2])/3;return[e/255*100]}},ba40:function(t,e,i){"use strict";var n=i("7839"),r=i.n(n);r.a},ba92:function(t,e,i){"use strict";var n=i("4bf8"),r=i("77f1"),o=i("9def");t.exports=[].copyWithin||function(t,e){var i=n(this),s=o(i.length),a=r(t,s),l=r(e,s),c=arguments.length>2?arguments[2]:void 0,h=Math.min((void 0===c?s:r(c,s))-l,s-a),u=1;l<a&&a<l+h&&(u=-1,l+=h-1,a+=h-1);while(h-- >0)l in i?i[a]=i[l]:delete i[a],a+=u,l+=u;return i}},bb15:function(t,e,i){var n=i("b753"),r=i("a279"),o={},s=Object.keys(n);function a(t){var e=function(e){return void 0===e||null===e?e:(arguments.length>1&&(e=Array.prototype.slice.call(arguments)),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}function l(t){var e=function(e){if(void 0===e||null===e)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var i=t(e);if("object"===typeof i)for(var n=i.length,r=0;r<n;r++)i[r]=Math.round(i[r]);return i};return"conversion"in t&&(e.conversion=t.conversion),e}s.forEach((function(t){o[t]={},Object.defineProperty(o[t],"channels",{value:n[t].channels}),Object.defineProperty(o[t],"labels",{value:n[t].labels});var e=r(t),i=Object.keys(e);i.forEach((function(i){var n=e[i];o[t][i]=l(n),o[t][i].raw=a(n)}))})),t.exports=o},c26b:function(t,e,i){"use strict";var n=i("86cc").f,r=i("2aeb"),o=i("dcbc"),s=i("9b43"),a=i("f605"),l=i("4a59"),c=i("01f9"),h=i("d53b"),u=i("7a56"),d=i("9e1e"),p=i("67ab").fastKey,f=i("b39a"),m=d?"_s":"size",g=function(t,e){var i,n=p(e);if("F"!==n)return t._i[n];for(i=t._f;i;i=i.n)if(i.k==e)return i};t.exports={getConstructor:function(t,e,i,c){var h=t((function(t,n){a(t,h,e,"_i"),t._t=e,t._i=r(null),t._f=void 0,t._l=void 0,t[m]=0,void 0!=n&&l(n,i,t[c],t)}));return o(h.prototype,{clear:function(){for(var t=f(this,e),i=t._i,n=t._f;n;n=n.n)n.r=!0,n.p&&(n.p=n.p.n=void 0),delete i[n.i];t._f=t._l=void 0,t[m]=0},delete:function(t){var i=f(this,e),n=g(i,t);if(n){var r=n.n,o=n.p;delete i._i[n.i],n.r=!0,o&&(o.n=r),r&&(r.p=o),i._f==n&&(i._f=r),i._l==n&&(i._l=o),i[m]--}return!!n},forEach:function(t){f(this,e);var i,n=s(t,arguments.length>1?arguments[1]:void 0,3);while(i=i?i.n:this._f){n(i.v,i.k,this);while(i&&i.r)i=i.p}},has:function(t){return!!g(f(this,e),t)}}),d&&n(h.prototype,"size",{get:function(){return f(this,e)[m]}}),h},def:function(t,e,i){var n,r,o=g(t,e);return o?o.v=i:(t._l=o={i:r=p(e,!0),k:e,v:i,p:n=t._l,n:void 0,r:!1},t._f||(t._f=o),n&&(n.n=o),t[m]++,"F"!==r&&(t._i[r]=o)),t},getEntry:g,setStrong:function(t,e,i){c(t,e,(function(t,i){this._t=f(t,e),this._k=i,this._l=void 0}),(function(){var t=this,e=t._k,i=t._l;while(i&&i.r)i=i.p;return t._t&&(t._l=i=i?i.n:t._t._f)?h(0,"keys"==e?i.k:"values"==e?i.v:[i.k,i.v]):(t._t=void 0,h(1))}),i?"entries":"values",!i,!0),u(e)}}},c5f6:function(t,e,i){"use strict";var n=i("7726"),r=i("69a8"),o=i("2d95"),s=i("5dbc"),a=i("6a99"),l=i("79e5"),c=i("9093").f,h=i("11e9").f,u=i("86cc").f,d=i("aa77").trim,p="Number",f=n[p],m=f,g=f.prototype,v=o(i("2aeb")(g))==p,y="trim"in String.prototype,x=function(t){var e=a(t,!1);if("string"==typeof e&&e.length>2){e=y?e.trim():d(e,3);var i,n,r,o=e.charCodeAt(0);if(43===o||45===o){if(i=e.charCodeAt(2),88===i||120===i)return NaN}else if(48===o){switch(e.charCodeAt(1)){case 66:case 98:n=2,r=49;break;case 79:case 111:n=8,r=55;break;default:return+e}for(var s,l=e.slice(2),c=0,h=l.length;c<h;c++)if(s=l.charCodeAt(c),s<48||s>r)return NaN;return parseInt(l,n)}}return+e};if(!f(" 0o1")||!f("0b1")||f("+0x1")){f=function(t){var e=arguments.length<1?0:t,i=this;return i instanceof f&&(v?l((function(){g.valueOf.call(i)})):o(i)!=p)?s(new m(x(e)),i,f):x(e)};for(var b,w=i("9e1e")?c(m):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),_=0;w.length>_;_++)r(m,b=w[_])&&!r(f,b)&&u(f,b,h(m,b));f.prototype=g,g.constructor=f,i("2aba")(n,p,f)}},d2c8:function(t,e,i){var n=i("aae3"),r=i("be13");t.exports=function(t,e,i){if(n(e))throw TypeError("String#"+i+" doesn't accept regex!");return String(r(t))}},e0b8:function(t,e,i){"use strict";var n=i("7726"),r=i("5ca1"),o=i("2aba"),s=i("dcbc"),a=i("67ab"),l=i("4a59"),c=i("f605"),h=i("d3f4"),u=i("79e5"),d=i("5cc5"),p=i("7f20"),f=i("5dbc");t.exports=function(t,e,i,m,g,v){var y=n[t],x=y,b=g?"set":"add",w=x&&x.prototype,_={},M=function(t){var e=w[t];o(w,t,"delete"==t||"has"==t?function(t){return!(v&&!h(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return v&&!h(t)?void 0:e.call(this,0===t?0:t)}:"add"==t?function(t){return e.call(this,0===t?0:t),this}:function(t,i){return e.call(this,0===t?0:t,i),this})};if("function"==typeof x&&(v||w.forEach&&!u((function(){(new x).entries().next()})))){var S=new x,T=S[b](v?{}:-0,1)!=S,E=u((function(){S.has(1)})),A=d((function(t){new x(t)})),L=!v&&u((function(){var t=new x,e=5;while(e--)t[b](e,e);return!t.has(-0)}));A||(x=e((function(e,i){c(e,x,t);var n=f(new y,e,x);return void 0!=i&&l(i,g,n[b],n),n})),x.prototype=w,w.constructor=x),(E||L)&&(M("delete"),M("has"),g&&M("get")),(L||T)&&M(b),v&&w.clear&&delete w.clear}else x=m.getConstructor(e,t,g,b),s(x.prototype,i),a.NEED=!0;return p(x,t),_[t]=x,r(r.G+r.W+r.F*(x!=y),_),v||m.setStrong(x,t,g),x}},e834:function(t,e,i){"use strict";(function(e){const n=i("a318"),r=i("8a30"),o=i("edde"),s=i("a853"),a="win32"===e.platform&&!(Object({NODE_ENV:"production",VUE_APP_BASE_API:"/tadi",BASE_URL:""}).TERM||"").toLowerCase().startsWith("xterm"),l=["ansi","ansi","ansi256","ansi16m"],c=new Set(["gray"]),h=Object.create(null);function u(t,e){e=e||{};const i=o?o.level:0;t.level=void 0===e.level?i:e.level,t.enabled="enabled"in e?e.enabled:t.level>0}function d(t){if(!this||!(this instanceof d)||this.template){const e={};return u(e,t),e.template=function(){const t=[].slice.call(arguments);return g.apply(null,[e.template].concat(t))},Object.setPrototypeOf(e,d.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=d,e.template}u(this,t)}a&&(r.blue.open="");for(const t of Object.keys(r))r[t].closeRe=new RegExp(n(r[t].close),"g"),h[t]={get(){const e=r[t];return f.call(this,this._styles?this._styles.concat(e):[e],this._empty,t)}};h.visible={get(){return f.call(this,this._styles||[],!0,"visible")}},r.color.closeRe=new RegExp(n(r.color.close),"g");for(const t of Object.keys(r.color.ansi))c.has(t)||(h[t]={get(){const e=this.level;return function(){const i=r.color[l[e]][t].apply(null,arguments),n={open:i,close:r.color.close,closeRe:r.color.closeRe};return f.call(this,this._styles?this._styles.concat(n):[n],this._empty,t)}}});r.bgColor.closeRe=new RegExp(n(r.bgColor.close),"g");for(const t of Object.keys(r.bgColor.ansi)){if(c.has(t))continue;const e="bg"+t[0].toUpperCase()+t.slice(1);h[e]={get(){const e=this.level;return function(){const i=r.bgColor[l[e]][t].apply(null,arguments),n={open:i,close:r.bgColor.close,closeRe:r.bgColor.closeRe};return f.call(this,this._styles?this._styles.concat(n):[n],this._empty,t)}}}}const p=Object.defineProperties(()=>{},h);function f(t,e,i){const n=function(){return m.apply(n,arguments)};n._styles=t,n._empty=e;const r=this;return Object.defineProperty(n,"level",{enumerable:!0,get(){return r.level},set(t){r.level=t}}),Object.defineProperty(n,"enabled",{enumerable:!0,get(){return r.enabled},set(t){r.enabled=t}}),n.hasGrey=this.hasGrey||"gray"===i||"grey"===i,n.__proto__=p,n}function m(){const t=arguments,e=t.length;let i=String(arguments[0]);if(0===e)return"";if(e>1)for(let r=1;r<e;r++)i+=" "+t[r];if(!this.enabled||this.level<=0||!i)return this._empty?"":i;const n=r.dim.open;a&&this.hasGrey&&(r.dim.open="");for(const r of this._styles.slice().reverse())i=r.open+i.replace(r.closeRe,r.open)+r.close,i=i.replace(/\r?\n/g,`${r.close}$&${r.open}`);return r.dim.open=n,i}function g(t,e){if(!Array.isArray(e))return[].slice.call(arguments,1).join(" ");const i=[].slice.call(arguments,2),n=[e.raw[0]];for(let r=1;r<e.length;r++)n.push(String(i[r-1]).replace(/[{}\\]/g,"\\$&")),n.push(String(e.raw[r]));return s(t,n.join(""))}Object.defineProperties(d.prototype,h),t.exports=d(),t.exports.supportsColor=o,t.exports.default=t.exports}).call(this,i("4362"))},ea7f:function(t,e,i){var n;(function(r,o){t.exports?(o["default"]=o,t.exports=r.document?o(r):o):(n=function(){return o(r)}.call(e,i,e,t),void 0===n||(t.exports=n))})("undefined"!==typeof window?window:this,(function(t){function e(t,e,i,n){t.hasOwnProperty(e)||(t[e]=n.apply(null,i))}var i={};return e(i,"Core/Globals.js",[],(function(){var e="undefined"!==typeof t?t:"undefined"!==typeof window?window:{},i=e.document,n=e.navigator&&e.navigator.userAgent||"",r=i&&i.createElementNS&&!!i.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,o=/(edge|msie|trident)/i.test(n)&&!e.opera,s=-1!==n.indexOf("Firefox"),a=-1!==n.indexOf("Chrome"),l=s&&4>parseInt(n.split("Firefox/")[1],10);return{product:"Highcharts",version:"8.2.2",deg2rad:2*Math.PI/360,doc:i,hasBidiBug:l,hasTouch:!!e.TouchEvent,isMS:o,isWebKit:-1!==n.indexOf("AppleWebKit"),isFirefox:s,isChrome:a,isSafari:!a&&-1!==n.indexOf("Safari"),isTouchDevice:/(Mobile|Android|Windows Phone)/.test(n),SVG_NS:"http://www.w3.org/2000/svg",chartCount:0,seriesTypes:{},symbolSizes:{},svg:r,win:e,marginNames:["plotTop","marginRight","marginBottom","plotLeft"],noop:function(){},charts:[],dateFormats:{}}})),e(i,"Core/Utilities.js",[i["Core/Globals.js"]],(function(t){function e(t,i,n,r){var o=i?"Highcharts error":"Highcharts warning";32===t&&(t=o+": Deprecated member");var s=m(t),a=s?o+" #"+t+": www.highcharts.com/errors/"+t+"/":t.toString();if(o=function(){if(i)throw Error(a);c.console&&-1===e.messages.indexOf(a)&&console.log(a)},"undefined"!==typeof r){var l="";s&&(a+="?"),j(r,(function(t,e){l+="\n - "+e+": "+t,s&&(a+=encodeURI(e)+"="+encodeURI(t))})),a+=l}n?Y(n,"displayError",{code:t,message:a,params:r},o):o(),e.messages.push(a)}function i(){var t,e=arguments,i={},r=function(t,e){return"object"!==typeof t&&(t={}),j(e,(function(i,o){!n(i,!0)||f(i)||p(i)?t[o]=e[o]:t[o]=r(t[o]||{},i)})),t};!0===e[0]&&(i=e[1],e=Array.prototype.slice.call(e,2));var o=e.length;for(t=0;t<o;t++)i=r(i,e[t]);return i}function n(t,e){return!!t&&"object"===typeof t&&(!e||!d(t))}function r(t,e,i){var n;return u(e)?v(i)?t.setAttribute(e,i):t&&t.getAttribute&&((n=t.getAttribute(e))||"class"!==e||(n=t.getAttribute(e+"Name"))):j(e,(function(e,i){t.setAttribute(i,e)})),n}function o(){for(var t=arguments,e=t.length,i=0;i<e;i++){var n=t[i];if("undefined"!==typeof n&&null!==n)return n}}function s(t,e){if(!t)return e;var i=t.split(".").reverse();if(1===i.length)return e[t];for(t=i.pop();"undefined"!==typeof t&&"undefined"!==typeof e&&null!==e;)e=e[t],t=i.pop();return e}t.timers=[];var a=t.charts,l=t.doc,c=t.win;(e||(e={})).messages=[],t.error=e,t.merge=i;var h=t.pInt=function(t,e){return parseInt(t,e||10)},u=t.isString=function(t){return"string"===typeof t},d=t.isArray=function(t){return t=Object.prototype.toString.call(t),"[object Array]"===t||"[object Array Iterator]"===t};t.isObject=n;var p=t.isDOMElement=function(t){return n(t)&&"number"===typeof t.nodeType},f=t.isClass=function(t){var e=t&&t.constructor;return!(!n(t,!0)||p(t)||!e||!e.name||"Object"===e.name)},m=t.isNumber=function(t){return"number"===typeof t&&!isNaN(t)&&1/0>t&&-1/0<t},g=t.erase=function(t,e){for(var i=t.length;i--;)if(t[i]===e){t.splice(i,1);break}},v=t.defined=function(t){return"undefined"!==typeof t&&null!==t};t.attr=r;var y=t.splat=function(t){return d(t)?t:[t]},x=t.syncTimeout=function(t,e,i){return 0<e?setTimeout(t,e,i):(t.call(0,i),-1)},b=t.clearTimeout=function(t){v(t)&&clearTimeout(t)},w=t.extend=function(t,e){var i;for(i in t||(t={}),e)t[i]=e[i];return t};t.pick=o;var _=t.css=function(e,i){t.isMS&&!t.svg&&i&&"undefined"!==typeof i.opacity&&(i.filter="alpha(opacity="+100*i.opacity+")"),w(e.style,i)},M=t.createElement=function(t,e,i,n,r){return t=l.createElement(t),e&&w(t,e),r&&_(t,{padding:"0",border:"none",margin:"0"}),i&&_(t,i),n&&n.appendChild(t),t},S=t.extendClass=function(t,e){var i=function(){};return i.prototype=new t,w(i.prototype,e),i},T=t.pad=function(t,e,i){return Array((e||2)+1-String(t).replace("-","").length).join(i||"0")+t},E=t.relativeLength=function(t,e,i){return/%$/.test(t)?e*parseFloat(t)/100+(i||0):parseFloat(t)},A=t.wrap=function(t,e,i){var n=t[e];t[e]=function(){var t=Array.prototype.slice.call(arguments),e=arguments,r=this;return r.proceed=function(){n.apply(r,arguments.length?arguments:e)},t.unshift(n),t=i.apply(this,t),r.proceed=null,t}},L=t.format=function(e,i,n){var r="{",o=!1,a=[],l=/f$/,c=/\.([0-9])/,h=t.defaultOptions.lang,u=n&&n.time||t.time;for(n=n&&n.numberFormatter||z;e;){var d=e.indexOf(r);if(-1===d)break;var p=e.slice(0,d);if(o){if(p=p.split(":"),r=s(p.shift()||"",i),p.length&&"number"===typeof r)if(p=p.join(":"),l.test(p)){var f=parseInt((p.match(c)||["","-1"])[1],10);null!==r&&(r=n(r,f,h.decimalPoint,-1<p.indexOf(",")?h.thousandsSep:""))}else r=u.dateFormat(p,r);a.push(r)}else a.push(p);e=e.slice(d+1),r=(o=!o)?"}":"{"}return a.push(e),a.join("")},C=t.getMagnitude=function(t){return Math.pow(10,Math.floor(Math.log(t)/Math.LN10))},P=t.normalizeTickInterval=function(t,e,i,n,r){var s=t;i=o(i,1);var a=t/i;for(e||(e=r?[1,1.2,1.5,2,2.5,3,4,5,6,8,10]:[1,2,2.5,5,10],!1===n&&(1===i?e=e.filter((function(t){return 0===t%1})):.1>=i&&(e=[1/i]))),n=0;n<e.length&&(s=e[n],!(r&&s*i>=t||!r&&a<=(e[n]+(e[n+1]||e[n]))/2));n++);return N(s*i,-Math.round(Math.log(.001)/Math.LN10))},R=t.stableSort=function(t,e){var i,n,r=t.length;for(n=0;n<r;n++)t[n].safeI=n;for(t.sort((function(t,n){return i=e(t,n),0===i?t.safeI-n.safeI:i})),n=0;n<r;n++)delete t[n].safeI},O=t.arrayMin=function(t){for(var e=t.length,i=t[0];e--;)t[e]<i&&(i=t[e]);return i},k=t.arrayMax=function(t){for(var e=t.length,i=t[0];e--;)t[e]>i&&(i=t[e]);return i},D=t.destroyObjectProperties=function(t,e){j(t,(function(i,n){i&&i!==e&&i.destroy&&i.destroy(),delete t[n]}))},I=t.discardElement=function(e){var i=t.garbageBin;i||(i=M("div")),e&&i.appendChild(e),i.innerHTML=""},N=t.correctFloat=function(t,e){return parseFloat(t.toPrecision(e||14))},B=t.timeUnits={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:24192e5,year:314496e5},z=t.numberFormat=function(e,i,n,r){e=+e||0,i=+i;var s=t.defaultOptions.lang,a=(e.toString().split(".")[1]||"").split("e")[0].length,l=e.toString().split("e");if(-1===i)i=Math.min(a,20);else if(m(i)){if(i&&l[1]&&0>l[1]){var c=i+ +l[1];0<=c?(l[0]=(+l[0]).toExponential(c).split("e")[0],i=c):(l[0]=l[0].split(".")[0]||0,e=20>i?(l[0]*Math.pow(10,l[1])).toFixed(i):0,l[1]=0)}}else i=2;var u=(Math.abs(l[1]?l[0]:e)+Math.pow(10,-Math.max(i,a)-1)).toFixed(i);return a=String(h(u)),c=3<a.length?a.length%3:0,n=o(n,s.decimalPoint),r=o(r,s.thousandsSep),e=(0>e?"-":"")+(c?a.substr(0,c)+r:""),e+=a.substr(c).replace(/(\d{3})(?=\d)/g,"$1"+r),i&&(e+=n+u.slice(-i)),l[1]&&0!==+e&&(e+="e"+l[1]),e};Math.easeInOutSine=function(t){return-.5*(Math.cos(Math.PI*t)-1)};var F=t.getStyle=function(i,n,r){return"width"===n?(n=Math.min(i.offsetWidth,i.scrollWidth),r=i.getBoundingClientRect&&i.getBoundingClientRect().width,r<n&&r>=n-1&&(n=Math.floor(r)),Math.max(0,n-t.getStyle(i,"padding-left")-t.getStyle(i,"padding-right"))):"height"===n?Math.max(0,Math.min(i.offsetHeight,i.scrollHeight)-t.getStyle(i,"padding-top")-t.getStyle(i,"padding-bottom")):(c.getComputedStyle||e(27,!0),(i=c.getComputedStyle(i,void 0))&&(i=i.getPropertyValue(n),o(r,"opacity"!==n)&&(i=h(i))),i)},U=t.inArray=function(t,i,n){return e(32,!1,void 0,{"Highcharts.inArray":"use Array.indexOf"}),i.indexOf(t,n)},G=t.find=Array.prototype.find?function(t,e){return t.find(e)}:function(t,e){var i,n=t.length;for(i=0;i<n;i++)if(e(t[i],i))return t[i]};t.keys=function(t){return e(32,!1,void 0,{"Highcharts.keys":"use Object.keys"}),Object.keys(t)};var H=t.offset=function(t){var e=l.documentElement;return t=t.parentElement||t.parentNode?t.getBoundingClientRect():{top:0,left:0},{top:t.top+(c.pageYOffset||e.scrollTop)-(e.clientTop||0),left:t.left+(c.pageXOffset||e.scrollLeft)-(e.clientLeft||0)}},j=t.objectEach=function(t,e,i){for(var n in t)Object.hasOwnProperty.call(t,n)&&e.call(i||t[n],t[n],n,t)};j({map:"map",each:"forEach",grep:"filter",reduce:"reduce",some:"some"},(function(i,n){t[n]=function(t){var r;return e(32,!1,void 0,(r={},r["Highcharts."+n]="use Array."+i,r)),Array.prototype[i].apply(t,[].slice.call(arguments,1))}}));var W,V=t.addEvent=function(e,i,n,r){void 0===r&&(r={});var o=e.addEventListener||t.addEventListenerPolyfill,s="function"===typeof e&&e.prototype?e.prototype.protoEvents=e.prototype.protoEvents||{}:e.hcEvents=e.hcEvents||{};return t.Point&&e instanceof t.Point&&e.series&&e.series.chart&&(e.series.chart.runTrackerClick=!0),o&&o.call(e,i,n,!1),s[i]||(s[i]=[]),s[i].push({fn:n,order:"number"===typeof r.order?r.order:1/0}),s[i].sort((function(t,e){return t.order-e.order})),function(){X(e,i,n)}},X=t.removeEvent=function(e,i,n){function r(i,n){var r=e.removeEventListener||t.removeEventListenerPolyfill;r&&r.call(e,i,n,!1)}function o(t){var n;if(e.nodeName){if(i){var o={};o[i]=!0}else o=t;j(o,(function(e,i){if(t[i])for(n=t[i].length;n--;)r(i,t[i][n].fn)}))}}var s;["protoEvents","hcEvents"].forEach((function(t,a){var l=(a=a?e:e.prototype)&&a[t];l&&(i?(s=l[i]||[],n?(l[i]=s.filter((function(t){return n!==t.fn})),r(i,n)):(o(l),l[i]=[])):(o(l),a[t]={}))}))},Y=t.fireEvent=function(t,e,i,n){var r;if(i=i||{},l.createEvent&&(t.dispatchEvent||t.fireEvent)){var o=l.createEvent("Events");o.initEvent(e,!0,!0),w(o,i),t.dispatchEvent?t.dispatchEvent(o):t.fireEvent(e,o)}else i.target||w(i,{preventDefault:function(){i.defaultPrevented=!0},target:t,type:e}),function(e,n){void 0===e&&(e=[]),void 0===n&&(n=[]);var o=0,s=0,a=e.length+n.length;for(r=0;r<a;r++)!1===(e[o]?n[s]?e[o].order<=n[s].order?e[o++]:n[s++]:e[o++]:n[s++]).fn.call(t,i)&&i.preventDefault()}(t.protoEvents&&t.protoEvents[e],t.hcEvents&&t.hcEvents[e]);n&&!i.defaultPrevented&&n.call(t,i)},q=t.uniqueKey=function(){var t=Math.random().toString(36).substring(2,9)+"-",e=0;return function(){return"highcharts-"+(W?"":t)+e++}}(),Z=t.useSerialIds=function(t){return W=o(t,W)},J=t.isFunction=function(t){return"function"===typeof t},K=t.getOptions=function(){return t.defaultOptions},$=t.setOptions=function(e){return t.defaultOptions=i(!0,t.defaultOptions,e),(e.time||e.global)&&t.time.update(i(t.defaultOptions.global,t.defaultOptions.time,e.global,e.time)),t.defaultOptions};return c.jQuery&&(c.jQuery.fn.highcharts=function(){var e=[].slice.call(arguments);if(this[0])return e[0]?(new(t[u(e[0])?e.shift():"Chart"])(this[0],e[0],e[1]),this):a[r(this[0],"data-highcharts-chart")]}),{addEvent:V,arrayMax:k,arrayMin:O,attr:r,clamp:function(t,e,i){return t>e?t<i?t:i:e},clearTimeout:b,correctFloat:N,createElement:M,css:_,defined:v,destroyObjectProperties:D,discardElement:I,erase:g,error:e,extend:w,extendClass:S,find:G,fireEvent:Y,format:L,getMagnitude:C,getNestedProperty:s,getOptions:K,getStyle:F,inArray:U,isArray:d,isClass:f,isDOMElement:p,isFunction:J,isNumber:m,isObject:n,isString:u,merge:i,normalizeTickInterval:P,numberFormat:z,objectEach:j,offset:H,pad:T,pick:o,pInt:h,relativeLength:E,removeEvent:X,setOptions:$,splat:y,stableSort:R,syncTimeout:x,timeUnits:B,uniqueKey:q,useSerialIds:Z,wrap:A}})),e(i,"Core/Color/Color.js",[i["Core/Globals.js"],i["Core/Utilities.js"]],(function(t,e){var i=e.isNumber,n=e.merge,r=e.pInt;return e=function(){function e(i){return this.parsers=[{regex:/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]?(?:\.[0-9]+)?)\s*\)/,parse:function(t){return[r(t[1]),r(t[2]),r(t[3]),parseFloat(t[4],10)]}},{regex:/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/,parse:function(t){return[r(t[1]),r(t[2]),r(t[3]),1]}}],this.rgba=[],t.Color!==e?new t.Color(i):this instanceof e?void this.init(i):new e(i)}return e.parse=function(t){return new e(t)},e.prototype.init=function(t){var i,n;if((this.input=t=e.names[t&&t.toLowerCase?t.toLowerCase():""]||t)&&t.stops)this.stops=t.stops.map((function(t){return new e(t[1])}));else{if(t&&t.charAt&&"#"===t.charAt()){var r=t.length;t=parseInt(t.substr(1),16),7===r?i=[(16711680&t)>>16,(65280&t)>>8,255&t,1]:4===r&&(i=[(3840&t)>>4|(3840&t)>>8,(240&t)>>4|240&t,(15&t)<<4|15&t,1])}if(!i)for(n=this.parsers.length;n--&&!i;){var o=this.parsers[n];(r=o.regex.exec(t))&&(i=o.parse(r))}}this.rgba=i||[]},e.prototype.get=function(t){var e=this.input,r=this.rgba;if("undefined"!==typeof this.stops){var o=n(e);o.stops=[].concat(o.stops),this.stops.forEach((function(e,i){o.stops[i]=[o.stops[i][0],e.get(t)]}))}else o=r&&i(r[0])?"rgb"===t||!t&&1===r[3]?"rgb("+r[0]+","+r[1]+","+r[2]+")":"a"===t?r[3]:"rgba("+r.join(",")+")":e;return o},e.prototype.brighten=function(t){var e,n=this.rgba;if(this.stops)this.stops.forEach((function(e){e.brighten(t)}));else if(i(t)&&0!==t)for(e=0;3>e;e++)n[e]+=r(255*t),0>n[e]&&(n[e]=0),255<n[e]&&(n[e]=255);return this},e.prototype.setOpacity=function(t){return this.rgba[3]=t,this},e.prototype.tweenTo=function(t,e){var i=this.rgba,n=t.rgba;return n.length&&i&&i.length?(t=1!==n[3]||1!==i[3],e=(t?"rgba(":"rgb(")+Math.round(n[0]+(i[0]-n[0])*(1-e))+","+Math.round(n[1]+(i[1]-n[1])*(1-e))+","+Math.round(n[2]+(i[2]-n[2])*(1-e))+(t?","+(n[3]+(i[3]-n[3])*(1-e)):"")+")"):e=t.input||"none",e},e.names={white:"#ffffff",black:"#000000"},e}(),t.Color=e,t.color=e.parse,e})),e(i,"Core/Animation/Fx.js",[i["Core/Globals.js"],i["Core/Utilities.js"]],(function(t,e){var i=t.win,n=e.isNumber,r=e.objectEach;return e=function(){function e(t,e,i){this.pos=NaN,this.options=e,this.elem=t,this.prop=i}return e.prototype.dSetter=function(){var t=this.paths,e=t&&t[0];t=t&&t[1];var i=[],n=this.now||0;if(1!==n&&e&&t)if(e.length===t.length&&1>n)for(var r=0;r<t.length;r++){for(var o=e[r],s=t[r],a=[],l=0;l<s.length;l++){var c=o[l],h=s[l];a[l]="number"===typeof c&&"number"===typeof h&&("A"!==s[0]||4!==l&&5!==l)?c+n*(h-c):h}i.push(a)}else i=t;else i=this.toD||[];this.elem.attr("d",i,void 0,!0)},e.prototype.update=function(){var t=this.elem,e=this.prop,i=this.now,n=this.options.step;this[e+"Setter"]?this[e+"Setter"]():t.attr?t.element&&t.attr(e,i,null,!0):t.style[e]=i+this.unit,n&&n.call(t,i,this)},e.prototype.run=function(e,n,r){var o=this,s=o.options,a=function(t){return!a.stopped&&o.step(t)},l=i.requestAnimationFrame||function(t){setTimeout(t,13)},c=function(){for(var e=0;e<t.timers.length;e++)t.timers[e]()||t.timers.splice(e--,1);t.timers.length&&l(c)};e!==n||this.elem["forceAnimate:"+this.prop]?(this.startTime=+new Date,this.start=e,this.end=n,this.unit=r,this.now=this.start,this.pos=0,a.elem=this.elem,a.prop=this.prop,a()&&1===t.timers.push(a)&&l(c)):(delete s.curAnim[this.prop],s.complete&&0===Object.keys(s.curAnim).length&&s.complete.call(this.elem))},e.prototype.step=function(t){var e=+new Date,i=this.options,n=this.elem,o=i.complete,s=i.duration,a=i.curAnim;if(n.attr&&!n.element)t=!1;else if(t||e>=s+this.startTime){this.now=this.end,this.pos=1,this.update();var l=a[this.prop]=!0;r(a,(function(t){!0!==t&&(l=!1)})),l&&o&&o.call(n),t=!1}else this.pos=i.easing((e-this.startTime)/s),this.now=this.start+(this.end-this.start)*this.pos,this.update(),t=!0;return t},e.prototype.initPath=function(t,e,i){function r(t,e){for(;t.length<d;){var i=t[0],n=e[d-t.length];n&&"M"===i[0]&&(t[0]="C"===n[0]?["C",i[1],i[2],i[1],i[2],i[1],i[2]]:["L",i[1],i[2]]),t.unshift(i),l&&t.push(t[t.length-1])}}function o(t,e){for(;t.length<d;)if(e=t[t.length/c-1].slice(),"C"===e[0]&&(e[1]=e[5],e[2]=e[6]),l){var i=t[t.length/c].slice();t.splice(t.length/2,0,e,i)}else t.push(e)}var s=t.startX,a=t.endX;e=e&&e.slice(),i=i.slice();var l=t.isArea,c=l?2:1;if(!e)return[i,i];if(s&&a){for(t=0;t<s.length;t++){if(s[t]===a[0]){var h=t;break}if(s[0]===a[a.length-s.length+t]){h=t;var u=!0;break}if(s[s.length-1]===a[a.length-s.length+t]){h=s.length-t;break}}"undefined"===typeof h&&(e=[])}if(e.length&&n(h)){var d=i.length+h*c;u?(r(e,i),o(i,e)):(r(i,e),o(e,i))}return[e,i]},e.prototype.fillSetter=function(){e.prototype.strokeSetter.apply(this,arguments)},e.prototype.strokeSetter=function(){this.elem.attr(this.prop,t.color(this.start).tweenTo(t.color(this.end),this.pos),null,!0)},e}(),t.Fx=e})),e(i,"Core/Animation/AnimationUtilities.js",[i["Core/Animation/Fx.js"],i["Core/Globals.js"],i["Core/Utilities.js"]],(function(t,e,i){var n=i.defined,r=i.getStyle,o=i.isArray,s=i.isNumber,a=i.isObject,l=i.merge,c=i.objectEach,h=i.pick;i=e.setAnimation=function(t,e){e.renderer.globalAnimation=h(t,e.options.chart.animation,!0)};var u=e.animObject=function(t){return a(t)?e.merge({duration:500,defer:0},t):{duration:t?500:0,defer:0}},d=e.getDeferredAnimation=function(t,e,i){var r=u(e),o=0,s=0;return(i?[i]:t.series).forEach((function(t){t=u(t.options.animation),o=e&&n(e.defer)?r.defer:Math.max(o,t.duration+t.defer),s=Math.min(r.duration,t.duration)})),t.renderer.forExport&&(o=0),{defer:Math.max(0,o-s),duration:Math.min(o,s)}},p=e.animate=function(e,i,n){var h,u,d,p="";if(!a(n)){var m=arguments;n={duration:m[2],easing:m[3],complete:m[4]}}s(n.duration)||(n.duration=400),n.easing="function"===typeof n.easing?n.easing:Math[n.easing]||Math.easeInOutSine,n.curAnim=l(i),c(i,(function(s,a){f(e,a),d=new t(e,n,a),u=null,"d"===a&&o(i.d)?(d.paths=d.initPath(e,e.pathArray,i.d),d.toD=i.d,h=0,u=1):e.attr?h=e.attr(a):(h=parseFloat(r(e,a))||0,"opacity"!==a&&(p="px")),u||(u=s),u&&u.match&&u.match("px")&&(u=u.replace(/px/g,"")),d.run(h,u,p)}))},f=e.stop=function(t,i){for(var n=e.timers.length;n--;)e.timers[n].elem!==t||i&&i!==e.timers[n].prop||(e.timers[n].stopped=!0)};return{animate:p,animObject:u,getDeferredAnimation:d,setAnimation:i,stop:f}})),e(i,"Core/Renderer/SVG/SVGElement.js",[i["Core/Animation/AnimationUtilities.js"],i["Core/Color/Color.js"],i["Core/Globals.js"],i["Core/Utilities.js"]],(function(t,e,i,n){var r=t.animate,o=t.animObject,s=t.stop,a=i.deg2rad,l=i.doc,c=i.hasTouch,h=i.isFirefox,u=i.noop,d=i.svg,p=i.SVG_NS,f=i.win,m=n.attr,g=n.createElement,v=n.css,y=n.defined,x=n.erase,b=n.extend,w=n.fireEvent,_=n.isArray,M=n.isFunction,S=n.isNumber,T=n.isString,E=n.merge,A=n.objectEach,L=n.pick,C=n.pInt,P=n.syncTimeout,R=n.uniqueKey;return t=function(){function t(){this.height=this.element=void 0,this.opacity=1,this.renderer=void 0,this.SVG_NS=p,this.symbolCustomAttribs="x y width height r start end innerR anchorX anchorY rounded".split(" "),this.width=void 0}return t.prototype._defaultGetter=function(t){return t=L(this[t+"Value"],this[t],this.element?this.element.getAttribute(t):null,0),/^[\-0-9\.]+$/.test(t)&&(t=parseFloat(t)),t},t.prototype._defaultSetter=function(t,e,i){i.setAttribute(e,t)},t.prototype.add=function(t){var e=this.renderer,i=this.element;if(t&&(this.parentGroup=t),this.parentInverted=t&&t.inverted,"undefined"!==typeof this.textStr&&"text"===this.element.nodeName&&e.buildText(this),this.added=!0,!t||t.handleZ||this.zIndex)var n=this.zIndexSetter();return n||(t?t.element:e.box).appendChild(i),this.onAdd&&this.onAdd(),this},t.prototype.addClass=function(t,e){var i=e?"":this.attr("class")||"";return t=(t||"").split(/ /g).reduce((function(t,e){return-1===i.indexOf(e)&&t.push(e),t}),i?[i]:[]).join(" "),t!==i&&this.attr("class",t),this},t.prototype.afterSetters=function(){this.doTransform&&(this.updateTransform(),this.doTransform=!1)},t.prototype.align=function(t,e,i){var n,r,o,s={},a=this.renderer,l=a.alignedObjects;t?(this.alignOptions=t,this.alignByTranslate=e,(!i||T(i))&&(this.alignTo=n=i||"renderer",x(l,this),l.push(this),i=void 0)):(t=this.alignOptions,e=this.alignByTranslate,n=this.alignTo),i=L(i,a[n],a),n=t.align,a=t.verticalAlign,l=(i.x||0)+(t.x||0);var c=(i.y||0)+(t.y||0);return"right"===n?r=1:"center"===n&&(r=2),r&&(l+=(i.width-(t.width||0))/r),s[e?"translateX":"x"]=Math.round(l),"bottom"===a?o=1:"middle"===a&&(o=2),o&&(c+=(i.height-(t.height||0))/o),s[e?"translateY":"y"]=Math.round(c),this[this.placed?"animate":"attr"](s),this.placed=!0,this.alignAttr=s,this},t.prototype.alignSetter=function(t){var e={left:"start",center:"middle",right:"end"};e[t]&&(this.alignValue=t,this.element.setAttribute("text-anchor",e[t]))},t.prototype.animate=function(t,e,i){var n=this,s=o(L(e,this.renderer.globalAnimation,!0));return e=s.defer,L(l.hidden,l.msHidden,l.webkitHidden,!1)&&(s.duration=0),0!==s.duration?(i&&(s.complete=i),P((function(){n.element&&r(n,t,s)}),e)):(this.attr(t,void 0,i),A(t,(function(t,e){s.step&&s.step.call(this,t,{prop:e,pos:1})}),this)),this},t.prototype.applyTextOutline=function(t){var e,n=this.element;-1!==t.indexOf("contrast")&&(t=t.replace(/contrast/g,this.renderer.getContrast(n.style.fill))),t=t.split(" ");var r=t[t.length-1];if((e=t[0])&&"none"!==e&&i.svg){this.fakeTS=!0,t=[].slice.call(n.getElementsByTagName("tspan")),this.ySetter=this.xSetter,e=e.replace(/(^[\d\.]+)(.*?)$/g,(function(t,e,i){return 2*e+i})),this.removeTextOutline(t);var o=!!n.textContent&&/^[\u0591-\u065F\u066A-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC]/.test(n.textContent),s=n.firstChild;t.forEach((function(t,i){0===i&&(t.setAttribute("x",n.getAttribute("x")),i=n.getAttribute("y"),t.setAttribute("y",i||0),null===i&&n.setAttribute("y",0)),i=t.cloneNode(!0),m(o&&!h?t:i,{class:"highcharts-text-outline",fill:r,stroke:r,"stroke-width":e,"stroke-linejoin":"round"}),n.insertBefore(i,s)})),o&&h&&t[0]&&(t=t[0].cloneNode(!0),t.textContent=" ",n.insertBefore(t,s))}},t.prototype.attr=function(t,e,i,n){var r,o,a,l=this.element,c=this,h=this.symbolCustomAttribs;if("string"===typeof t&&"undefined"!==typeof e){var u=t;t={},t[u]=e}return"string"===typeof t?c=(this[t+"Getter"]||this._defaultGetter).call(this,t,l):(A(t,(function(e,i){o=!1,n||s(this,i),this.symbolName&&-1!==h.indexOf(i)&&(r||(this.symbolAttr(t),r=!0),o=!0),!this.rotation||"x"!==i&&"y"!==i||(this.doTransform=!0),o||(a=this[i+"Setter"]||this._defaultSetter,a.call(this,e,i,l),!this.styledMode&&this.shadows&&/^(width|height|visibility|x|y|d|transform|cx|cy|r)$/.test(i)&&this.updateShadows(i,e,a))}),this),this.afterSetters()),i&&i.call(this),c},t.prototype.clip=function(t){return this.attr("clip-path",t?"url("+this.renderer.url+"#"+t.id+")":"none")},t.prototype.crisp=function(t,e){e=e||t.strokeWidth||0;var i=Math.round(e)%2/2;return t.x=Math.floor(t.x||this.x||0)+i,t.y=Math.floor(t.y||this.y||0)+i,t.width=Math.floor((t.width||this.width||0)-2*i),t.height=Math.floor((t.height||this.height||0)-2*i),y(t.strokeWidth)&&(t.strokeWidth=e),t},t.prototype.complexColor=function(t,i,n){var r,o,s,a,l,c,h,u,d,p,f,m=this.renderer,g=[];w(this.renderer,"complexColor",{args:arguments},(function(){if(t.radialGradient?o="radialGradient":t.linearGradient&&(o="linearGradient"),o){if(s=t[o],l=m.gradients,c=t.stops,d=n.radialReference,_(s)&&(t[o]=s={x1:s[0],y1:s[1],x2:s[2],y2:s[3],gradientUnits:"userSpaceOnUse"}),"radialGradient"===o&&d&&!y(s.gradientUnits)&&(a=s,s=E(s,m.getRadialAttr(d,a),{gradientUnits:"userSpaceOnUse"})),A(s,(function(t,e){"id"!==e&&g.push(e,t)})),A(c,(function(t){g.push(t)})),g=g.join(","),l[g])p=l[g].attr("id");else{s.id=p=R();var v=l[g]=m.createElement(o).attr(s).add(m.defs);v.radAttr=a,v.stops=[],c.forEach((function(t){0===t[1].indexOf("rgba")?(r=e.parse(t[1]),h=r.get("rgb"),u=r.get("a")):(h=t[1],u=1),t=m.createElement("stop").attr({offset:t[0],"stop-color":h,"stop-opacity":u}).add(v),v.stops.push(t)}))}f="url("+m.url+"#"+p+")",n.setAttribute(i,f),n.gradient=g,t.toString=function(){return f}}}))},t.prototype.css=function(t){var e=this.styles,i={},n=this.element,r="",o=!e,s=["textOutline","textOverflow","width"];if(t&&t.color&&(t.fill=t.color),e&&A(t,(function(t,n){e&&e[n]!==t&&(i[n]=t,o=!0)})),o){if(e&&(t=b(e,i)),t)if(null===t.width||"auto"===t.width)delete this.textWidth;else if("text"===n.nodeName.toLowerCase()&&t.width)var a=this.textWidth=C(t.width);if(this.styles=t,a&&!d&&this.renderer.forExport&&delete t.width,n.namespaceURI===this.SVG_NS){var l=function(t,e){return"-"+e.toLowerCase()};A(t,(function(t,e){-1===s.indexOf(e)&&(r+=e.replace(/([A-Z])/g,l)+":"+t+";")})),r&&m(n,"style",r)}else v(n,t);this.added&&("text"===this.element.nodeName&&this.renderer.buildText(this),t&&t.textOutline&&this.applyTextOutline(t.textOutline))}return this},t.prototype.dashstyleSetter=function(t){var e=this["stroke-width"];if("inherit"===e&&(e=1),t=t&&t.toLowerCase()){var i=t.replace("shortdashdotdot","3,1,1,1,1,1,").replace("shortdashdot","3,1,1,1").replace("shortdot","1,1,").replace("shortdash","3,1,").replace("longdash","8,3,").replace(/dot/g,"1,3,").replace("dash","4,3,").replace(/,$/,"").split(",");for(t=i.length;t--;)i[t]=""+C(i[t])*L(e,NaN);t=i.join(",").replace(/NaN/g,"none"),this.element.setAttribute("stroke-dasharray",t)}},t.prototype.destroy=function(){var t=this,e=t.element||{},i=t.renderer,n=i.isSVG&&"SPAN"===e.nodeName&&t.parentGroup||void 0,r=e.ownerSVGElement;if(e.onclick=e.onmouseout=e.onmouseover=e.onmousemove=e.point=null,s(t),t.clipPath&&r){var o=t.clipPath;[].forEach.call(r.querySelectorAll("[clip-path],[CLIP-PATH]"),(function(t){-1<t.getAttribute("clip-path").indexOf(o.element.id)&&t.removeAttribute("clip-path")})),t.clipPath=o.destroy()}if(t.stops){for(r=0;r<t.stops.length;r++)t.stops[r].destroy();t.stops.length=0,t.stops=void 0}for(t.safeRemoveChild(e),i.styledMode||t.destroyShadows();n&&n.div&&0===n.div.childNodes.length;)e=n.parentGroup,t.safeRemoveChild(n.div),delete n.div,n=e;t.alignTo&&x(i.alignedObjects,t),A(t,(function(e,i){t[i]&&t[i].parentGroup===t&&t[i].destroy&&t[i].destroy(),delete t[i]}))},t.prototype.destroyShadows=function(){(this.shadows||[]).forEach((function(t){this.safeRemoveChild(t)}),this),this.shadows=void 0},t.prototype.destroyTextPath=function(t,e){var i=t.getElementsByTagName("text")[0];if(i){if(i.removeAttribute("dx"),i.removeAttribute("dy"),e.element.setAttribute("id",""),this.textPathWrapper&&i.getElementsByTagName("textPath").length){for(t=this.textPathWrapper.element.childNodes;t.length;)i.appendChild(t[0]);i.removeChild(this.textPathWrapper.element)}}else(t.getAttribute("dx")||t.getAttribute("dy"))&&(t.removeAttribute("dx"),t.removeAttribute("dy"));this.textPathWrapper&&(this.textPathWrapper=this.textPathWrapper.destroy())},t.prototype.dSetter=function(t,e,i){_(t)&&("string"===typeof t[0]&&(t=this.renderer.pathToSegments(t)),this.pathArray=t,t=t.reduce((function(t,e,i){return e&&e.join?(i?t+" ":"")+e.join(" "):(e||"").toString()}),"")),/(NaN| {2}|^$)/.test(t)&&(t="M 0 0"),this[e]!==t&&(i.setAttribute(e,t),this[e]=t)},t.prototype.fadeOut=function(t){var e=this;e.animate({opacity:0},{duration:L(t,150),complete:function(){e.attr({y:-9999}).hide()}})},t.prototype.fillSetter=function(t,e,i){"string"===typeof t?i.setAttribute(e,t):t&&this.complexColor(t,e,i)},t.prototype.getBBox=function(e,i){var n,r=this.renderer,o=this.element,s=this.styles,l=this.textStr,c=r.cache,h=r.cacheKeys,u=o.namespaceURI===this.SVG_NS;i=L(i,this.rotation,0);var d=r.styledMode?o&&t.prototype.getStyle.call(o,"font-size"):s&&s.fontSize;if(y(l)){var p=l.toString();-1===p.indexOf("<")&&(p=p.replace(/[0-9]/g,"0")),p+=["",i,d,this.textWidth,s&&s.textOverflow,s&&s.fontWeight].join()}if(p&&!e&&(n=c[p]),!n){if(u||r.forExport){try{var f=this.fakeTS&&function(t){[].forEach.call(o.querySelectorAll(".highcharts-text-outline"),(function(e){e.style.display=t}))};M(f)&&f("none"),n=o.getBBox?b({},o.getBBox()):{width:o.offsetWidth,height:o.offsetHeight},M(f)&&f("")}catch(m){}(!n||0>n.width)&&(n={width:0,height:0})}else n=this.htmlGetBBox();if(r.isSVG&&(e=n.width,r=n.height,u&&(n.height=r={"11px,17":14,"13px,20":16}[s&&s.fontSize+","+Math.round(r)]||r),i&&(s=i*a,n.width=Math.abs(r*Math.sin(s))+Math.abs(e*Math.cos(s)),n.height=Math.abs(r*Math.cos(s))+Math.abs(e*Math.sin(s)))),p&&0<n.height){for(;250<h.length;)delete c[h.shift()];c[p]||h.push(p),c[p]=n}}return n},t.prototype.getStyle=function(t){return f.getComputedStyle(this.element||this,"").getPropertyValue(t)},t.prototype.hasClass=function(t){return-1!==(""+this.attr("class")).split(" ").indexOf(t)},t.prototype.hide=function(t){return t?this.attr({y:-9999}):this.attr({visibility:"hidden"}),this},t.prototype.htmlGetBBox=function(){return{height:0,width:0,x:0,y:0}},t.prototype.init=function(t,e){this.element="span"===e?g(e):l.createElementNS(this.SVG_NS,e),this.renderer=t,w(this,"afterInit")},t.prototype.invert=function(t){return this.inverted=t,this.updateTransform(),this},t.prototype.on=function(t,e){var i,n,r,o=this.element;return c&&"click"===t?(o.ontouchstart=function(t){i=t.touches[0].clientX,n=t.touches[0].clientY},o.ontouchend=function(t){i&&4<=Math.sqrt(Math.pow(i-t.changedTouches[0].clientX,2)+Math.pow(n-t.changedTouches[0].clientY,2))||e.call(o,t),r=!0,!1!==t.cancelable&&t.preventDefault()},o.onclick=function(t){r||e.call(o,t)}):o["on"+t]=e,this},t.prototype.opacitySetter=function(t,e,i){this.opacity=t=Number(Number(t).toFixed(3)),i.setAttribute(e,t)},t.prototype.removeClass=function(t){return this.attr("class",(""+this.attr("class")).replace(T(t)?new RegExp("(^| )"+t+"( |$)"):t," ").replace(/ +/g," ").trim())},t.prototype.removeTextOutline=function(t){for(var e,i=t.length;i--;)e=t[i],"highcharts-text-outline"===e.getAttribute("class")&&x(t,this.element.removeChild(e))},t.prototype.safeRemoveChild=function(t){var e=t.parentNode;e&&e.removeChild(t)},t.prototype.setRadialReference=function(t){var e=this.element.gradient&&this.renderer.gradients[this.element.gradient];return this.element.radialReference=t,e&&e.radAttr&&e.animate(this.renderer.getRadialAttr(t,e.radAttr)),this},t.prototype.setTextPath=function(t,e){var i=this.element,n={textAnchor:"text-anchor"},r=!1,o=this.textPathWrapper,s=!o;e=E(!0,{enabled:!0,attributes:{dy:-5,startOffset:"50%",textAnchor:"middle"}},e);var a=e.attributes;if(t&&e&&e.enabled){o&&null===o.element.parentNode?(s=!0,o=o.destroy()):o&&this.removeTextOutline.call(o.parentGroup,[].slice.call(i.getElementsByTagName("tspan"))),this.options&&this.options.padding&&(a.dx=-this.options.padding),o||(this.textPathWrapper=o=this.renderer.createElement("textPath"),r=!0);var l=o.element;if((e=t.element.getAttribute("id"))||t.element.setAttribute("id",e=R()),s)for(t=i.getElementsByTagName("tspan");t.length;)t[0].setAttribute("y",0),S(a.dx)&&t[0].setAttribute("x",-a.dx),l.appendChild(t[0]);r&&o&&o.add({element:this.text?this.text.element:i}),l.setAttributeNS("http://www.w3.org/1999/xlink","href",this.renderer.url+"#"+e),y(a.dy)&&(l.parentNode.setAttribute("dy",a.dy),delete a.dy),y(a.dx)&&(l.parentNode.setAttribute("dx",a.dx),delete a.dx),A(a,(function(t,e){l.setAttribute(n[e]||e,t)})),i.removeAttribute("transform"),this.removeTextOutline.call(o,[].slice.call(i.getElementsByTagName("tspan"))),this.text&&!this.renderer.styledMode&&this.attr({fill:"none","stroke-width":0}),this.applyTextOutline=this.updateTransform=u}else o&&(delete this.updateTransform,delete this.applyTextOutline,this.destroyTextPath(i,t),this.updateTransform(),this.options&&this.options.rotation&&this.applyTextOutline(this.options.style.textOutline));return this},t.prototype.shadow=function(t,e,i){var n,r=[],o=this.element,s=!1,a=this.oldShadowOptions,l={color:"#000000",offsetX:1,offsetY:1,opacity:.15,width:3};if(!0===t?n=l:"object"===typeof t&&(n=b(l,t)),n&&(n&&a&&A(n,(function(t,e){t!==a[e]&&(s=!0)})),s&&this.destroyShadows(),this.oldShadowOptions=n),n){if(!this.shadows){var c=n.opacity/n.width,h=this.parentInverted?"translate(-1,-1)":"translate("+n.offsetX+", "+n.offsetY+")";for(l=1;l<=n.width;l++){var u=o.cloneNode(!1),d=2*n.width+1-2*l;m(u,{stroke:t.color||"#000000","stroke-opacity":c*l,"stroke-width":d,transform:h,fill:"none"}),u.setAttribute("class",(u.getAttribute("class")||"")+" highcharts-shadow"),i&&(m(u,"height",Math.max(m(u,"height")-d,0)),u.cutHeight=d),e?e.element.appendChild(u):o.parentNode&&o.parentNode.insertBefore(u,o),r.push(u)}this.shadows=r}}else this.destroyShadows();return this},t.prototype.show=function(t){return this.attr({visibility:t?"inherit":"visible"})},t.prototype.strokeSetter=function(e,i,n){this[i]=e,this.stroke&&this["stroke-width"]?(t.prototype.fillSetter.call(this,this.stroke,"stroke",n),n.setAttribute("stroke-width",this["stroke-width"]),this.hasStroke=!0):"stroke-width"===i&&0===e&&this.hasStroke?(n.removeAttribute("stroke"),this.hasStroke=!1):this.renderer.styledMode&&this["stroke-width"]&&(n.setAttribute("stroke-width",this["stroke-width"]),this.hasStroke=!0)},t.prototype.strokeWidth=function(){if(!this.renderer.styledMode)return this["stroke-width"]||0;var t=this.getStyle("stroke-width"),e=0;if(t.indexOf("px")===t.length-2)e=C(t);else if(""!==t){var i=l.createElementNS(p,"rect");m(i,{width:t,"stroke-width":0}),this.element.parentNode.appendChild(i),e=i.getBBox().width,i.parentNode.removeChild(i)}return e},t.prototype.symbolAttr=function(t){var e=this;"x y r start end width height innerR anchorX anchorY clockwise".split(" ").forEach((function(i){e[i]=L(t[i],e[i])})),e.attr({d:e.renderer.symbols[e.symbolName](e.x,e.y,e.width,e.height,e)})},t.prototype.textSetter=function(t){t!==this.textStr&&(delete this.textPxLength,this.textStr=t,this.added&&this.renderer.buildText(this))},t.prototype.titleSetter=function(t){var e=this.element.getElementsByTagName("title")[0];e||(e=l.createElementNS(this.SVG_NS,"title"),this.element.appendChild(e)),e.firstChild&&e.removeChild(e.firstChild),e.appendChild(l.createTextNode(String(L(t,"")).replace(/<[^>]*>/g,"").replace(/&lt;/g,"<").replace(/&gt;/g,">")))},t.prototype.toFront=function(){var t=this.element;return t.parentNode.appendChild(t),this},t.prototype.translate=function(t,e){return this.attr({translateX:t,translateY:e})},t.prototype.updateShadows=function(t,e,i){var n=this.shadows;if(n)for(var r=n.length;r--;)i.call(n[r],"height"===t?Math.max(e-(n[r].cutHeight||0),0):"d"===t?this.d:e,t,n[r])},t.prototype.updateTransform=function(){var t=this.translateX||0,e=this.translateY||0,i=this.scaleX,n=this.scaleY,r=this.inverted,o=this.rotation,s=this.matrix,a=this.element;r&&(t+=this.width,e+=this.height),t=["translate("+t+","+e+")"],y(s)&&t.push("matrix("+s.join(",")+")"),r?t.push("rotate(90) scale(-1,1)"):o&&t.push("rotate("+o+" "+L(this.rotationOriginX,a.getAttribute("x"),0)+" "+L(this.rotationOriginY,a.getAttribute("y")||0)+")"),(y(i)||y(n))&&t.push("scale("+L(i,1)+" "+L(n,1)+")"),t.length&&a.setAttribute("transform",t.join(" "))},t.prototype.visibilitySetter=function(t,e,i){"inherit"===t?i.removeAttribute(e):this[e]!==t&&i.setAttribute(e,t),this[e]=t},t.prototype.xGetter=function(t){return"circle"===this.element.nodeName&&("x"===t?t="cx":"y"===t&&(t="cy")),this._defaultGetter(t)},t.prototype.zIndexSetter=function(t,e){var i=this.renderer,n=this.parentGroup,r=(n||i).element||i.box,o=this.element,s=!1;i=r===i.box;var a,l=this.added;if(y(t)?(o.setAttribute("data-z-index",t),t=+t,this[e]===t&&(l=!1)):y(this[e])&&o.removeAttribute("data-z-index"),this[e]=t,l){for((t=this.zIndex)&&n&&(n.handleZ=!0),e=r.childNodes,a=e.length-1;0<=a&&!s;a--){n=e[a],l=n.getAttribute("data-z-index");var c=!y(l);n!==o&&(0>t&&c&&!i&&!a?(r.insertBefore(o,e[a]),s=!0):(C(l)<=t||c&&(!y(t)||0<=t))&&(r.insertBefore(o,e[a+1]||null),s=!0))}s||(r.insertBefore(o,e[i?3:0]||null),s=!0)}return s},t}(),t.prototype["stroke-widthSetter"]=t.prototype.strokeSetter,t.prototype.yGetter=t.prototype.xGetter,t.prototype.matrixSetter=t.prototype.rotationOriginXSetter=t.prototype.rotationOriginYSetter=t.prototype.rotationSetter=t.prototype.scaleXSetter=t.prototype.scaleYSetter=t.prototype.translateXSetter=t.prototype.translateYSetter=t.prototype.verticalAlignSetter=function(t,e){this[e]=t,this.doTransform=!0},i.SVGElement=t,i.SVGElement})),e(i,"Core/Renderer/SVG/SVGLabel.js",[i["Core/Renderer/SVG/SVGElement.js"],i["Core/Utilities.js"]],(function(t,e){var i=this&&this.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},t(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),n=e.defined,r=e.extend,o=e.isNumber,s=e.merge,a=e.removeEvent;return function(e){function l(t,i,n,r,o,s,a,c,h,u){var d=e.call(this)||this;if(d.init(t,"g"),d.textStr=i,d.x=n,d.y=r,d.anchorX=s,d.anchorY=a,d.baseline=h,d.className=u,"button"!==u&&d.addClass("highcharts-label"),u&&d.addClass("highcharts-"+u),d.text=t.text("",0,0,c).attr({zIndex:1}),"string"===typeof o){var p=/^url\((.*?)\)$/.test(o);(d.renderer.symbols[o]||p)&&(d.symbolKey=o)}return d.bBox=l.emptyBBox,d.padding=3,d.paddingLeft=0,d.baselineOffset=0,d.needsBox=t.styledMode||p,d.deferredAttr={},d.alignFactor=0,d}return i(l,e),l.prototype.alignSetter=function(t){t={left:0,center:.5,right:1}[t],t!==this.alignFactor&&(this.alignFactor=t,this.bBox&&o(this.xSetting)&&this.attr({x:this.xSetting}))},l.prototype.anchorXSetter=function(t,e){this.anchorX=t,this.boxAttr(e,Math.round(t)-this.getCrispAdjust()-this.xSetting)},l.prototype.anchorYSetter=function(t,e){this.anchorY=t,this.boxAttr(e,t-this.ySetting)},l.prototype.boxAttr=function(t,e){this.box?this.box.attr(t,e):this.deferredAttr[t]=e},l.prototype.css=function(e){if(e){var i={};e=s(e),l.textProps.forEach((function(t){"undefined"!==typeof e[t]&&(i[t]=e[t],delete e[t])})),this.text.css(i);var n="fontSize"in i||"fontWeight"in i;("width"in i||n)&&(this.updateBoxSize(),n&&this.updateTextPadding())}return t.prototype.css.call(this,e)},l.prototype.destroy=function(){a(this.element,"mouseenter"),a(this.element,"mouseleave"),this.text&&this.text.destroy(),this.box&&(this.box=this.box.destroy()),t.prototype.destroy.call(this)},l.prototype.fillSetter=function(t,e){t&&(this.needsBox=!0),this.fill=t,this.boxAttr(e,t)},l.prototype.getBBox=function(){var t=this.bBox,e=this.padding;return{width:t.width+2*e,height:t.height+2*e,x:t.x-e,y:t.y-e}},l.prototype.getCrispAdjust=function(){return this.renderer.styledMode&&this.box?this.box.strokeWidth()%2/2:(this["stroke-width"]?parseInt(this["stroke-width"],10):0)%2/2},l.prototype.heightSetter=function(t){this.heightSetting=t},l.prototype.on=function(e,i){var n=this,r=n.text,o=r&&"SPAN"===r.element.tagName?r:void 0;if(o){var s=function(t){("mouseenter"===e||"mouseleave"===e)&&t.relatedTarget instanceof Element&&(n.element.contains(t.relatedTarget)||o.element.contains(t.relatedTarget))||i.call(n.element,t)};o.on(e,s)}return t.prototype.on.call(n,e,s||i),n},l.prototype.onAdd=function(){var t=this.textStr;this.text.add(this),this.attr({text:n(t)?t:"",x:this.x,y:this.y}),this.box&&n(this.anchorX)&&this.attr({anchorX:this.anchorX,anchorY:this.anchorY})},l.prototype.paddingSetter=function(t){n(t)&&t!==this.padding&&(this.padding=t,this.updateTextPadding())},l.prototype.paddingLeftSetter=function(t){n(t)&&t!==this.paddingLeft&&(this.paddingLeft=t,this.updateTextPadding())},l.prototype.rSetter=function(t,e){this.boxAttr(e,t)},l.prototype.shadow=function(t){return t&&!this.renderer.styledMode&&(this.updateBoxSize(),this.box&&this.box.shadow(t)),this},l.prototype.strokeSetter=function(t,e){this.stroke=t,this.boxAttr(e,t)},l.prototype["stroke-widthSetter"]=function(t,e){t&&(this.needsBox=!0),this["stroke-width"]=t,this.boxAttr(e,t)},l.prototype["text-alignSetter"]=function(t){this.textAlign=t},l.prototype.textSetter=function(t){"undefined"!==typeof t&&this.text.attr({text:t}),this.updateBoxSize(),this.updateTextPadding()},l.prototype.updateBoxSize=function(){var t=this.text.element.style,e={},i=this.padding,s=this.paddingLeft,a=o(this.widthSetting)&&o(this.heightSetting)&&!this.textAlign||!n(this.text.textStr)?l.emptyBBox:this.text.getBBox();this.width=(this.widthSetting||a.width||0)+2*i+s,this.height=(this.heightSetting||a.height||0)+2*i,this.baselineOffset=i+Math.min(this.renderer.fontMetrics(t&&t.fontSize,this.text).b,a.height||1/0),this.needsBox&&(this.box||(t=this.box=this.symbolKey?this.renderer.symbol(this.symbolKey):this.renderer.rect(),t.addClass(("button"===this.className?"":"highcharts-label-box")+(this.className?" highcharts-"+this.className+"-box":"")),t.add(this),t=this.getCrispAdjust(),e.x=t,e.y=(this.baseline?-this.baselineOffset:0)+t),e.width=Math.round(this.width),e.height=Math.round(this.height),this.box.attr(r(e,this.deferredAttr)),this.deferredAttr={}),this.bBox=a},l.prototype.updateTextPadding=function(){var t=this.text,e=this.baseline?0:this.baselineOffset,i=this.paddingLeft+this.padding;n(this.widthSetting)&&this.bBox&&("center"===this.textAlign||"right"===this.textAlign)&&(i+={center:.5,right:1}[this.textAlign]*(this.widthSetting-this.bBox.width)),i===t.x&&e===t.y||(t.attr("x",i),t.hasBoxWidthChanged&&(this.bBox=t.getBBox(!0),this.updateBoxSize()),"undefined"!==typeof e&&t.attr("y",e)),t.x=i,t.y=e},l.prototype.widthSetter=function(t){this.widthSetting=o(t)?t:void 0},l.prototype.xSetter=function(t){this.x=t,this.alignFactor&&(t-=this.alignFactor*((this.widthSetting||this.bBox.width)+2*this.padding),this["forceAnimate:x"]=!0),this.xSetting=Math.round(t),this.attr("translateX",this.xSetting)},l.prototype.ySetter=function(t){this.ySetting=this.y=Math.round(t),this.attr("translateY",this.ySetting)},l.emptyBBox={width:0,height:0,x:0,y:0},l.textProps="color cursor direction fontFamily fontSize fontStyle fontWeight lineHeight textAlign textDecoration textOutline textOverflow width".split(" "),l}(t)})),e(i,"Core/Renderer/SVG/SVGRenderer.js",[i["Core/Color/Color.js"],i["Core/Globals.js"],i["Core/Renderer/SVG/SVGElement.js"],i["Core/Renderer/SVG/SVGLabel.js"],i["Core/Utilities.js"]],(function(t,e,i,n,r){var o=r.addEvent,s=r.attr,a=r.createElement,l=r.css,c=r.defined,h=r.destroyObjectProperties,u=r.extend,d=r.isArray,p=r.isNumber,f=r.isObject,m=r.isString,g=r.merge,v=r.objectEach,y=r.pick,x=r.pInt,b=r.splat,w=r.uniqueKey,_=e.charts,M=e.deg2rad,S=e.doc,T=e.isFirefox,E=e.isMS,A=e.isWebKit;r=e.noop;var L=e.svg,C=e.SVG_NS,P=e.symbolSizes,R=e.win,O=function(){function e(t,e,i,n,r,o,s){this.width=this.url=this.style=this.isSVG=this.imgCount=this.height=this.gradients=this.globalAnimation=this.defs=this.chartIndex=this.cacheKeys=this.cache=this.boxWrapper=this.box=this.alignedObjects=void 0,this.init(t,e,i,n,r,o,s)}return e.prototype.init=function(t,e,i,n,r,a,c){var h,u=this.createElement("svg").attr({version:"1.1",class:"highcharts-root"});c||u.css(this.getStyle(n)),n=u.element,t.appendChild(n),s(t,"dir","ltr"),-1===t.innerHTML.indexOf("xmlns")&&s(n,"xmlns",this.SVG_NS),this.isSVG=!0,this.box=n,this.boxWrapper=u,this.alignedObjects=[],this.url=(T||A)&&S.getElementsByTagName("base").length?R.location.href.split("#")[0].replace(/<[^>]*>/g,"").replace(/([\('\)])/g,"\\$1").replace(/ /g,"%20"):"",this.createElement("desc").add().element.appendChild(S.createTextNode("Created with Highcharts 8.2.2")),this.defs=this.createElement("defs").add(),this.allowHTML=a,this.forExport=r,this.styledMode=c,this.gradients={},this.cache={},this.cacheKeys=[],this.imgCount=0,this.setSize(e,i,!1),T&&t.getBoundingClientRect&&(e=function(){l(t,{left:0,top:0}),h=t.getBoundingClientRect(),l(t,{left:Math.ceil(h.left)-h.left+"px",top:Math.ceil(h.top)-h.top+"px"})},e(),this.unSubPixelFix=o(R,"resize",e))},e.prototype.definition=function(t){function e(t,n){var r;return b(t).forEach((function(t){var o=i.createElement(t.tagName),s={};v(t,(function(t,e){"tagName"!==e&&"children"!==e&&"textContent"!==e&&(s[e]=t)})),o.attr(s),o.add(n||i.defs),t.textContent&&o.element.appendChild(S.createTextNode(t.textContent)),e(t.children||[],o),r=o})),r}var i=this;return e(t)},e.prototype.getStyle=function(t){return this.style=u({fontFamily:'"Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif',fontSize:"12px"},t)},e.prototype.setStyle=function(t){this.boxWrapper.css(this.getStyle(t))},e.prototype.isHidden=function(){return!this.boxWrapper.getBBox().width},e.prototype.destroy=function(){var t=this.defs;return this.box=null,this.boxWrapper=this.boxWrapper.destroy(),h(this.gradients||{}),this.gradients=null,t&&(this.defs=t.destroy()),this.unSubPixelFix&&this.unSubPixelFix(),this.alignedObjects=null},e.prototype.createElement=function(t){var e=new this.Element;return e.init(this,t),e},e.prototype.getRadialAttr=function(t,e){return{cx:t[0]-t[2]/2+e.cx*t[2],cy:t[1]-t[2]/2+e.cy*t[2],r:e.r*t[2]}},e.prototype.truncate=function(t,e,i,n,r,o,s){var a,l,c=this,h=t.rotation,u=n?1:0,d=(i||n).length,p=d,f=[],m=function(t){e.firstChild&&e.removeChild(e.firstChild),t&&e.appendChild(S.createTextNode(t))},g=function(o,a){if(a=a||o,"undefined"===typeof f[a])if(e.getSubStringLength)try{f[a]=r+e.getSubStringLength(0,n?a+1:a)}catch(l){}else c.getSpanWidth&&(m(s(i||n,o)),f[a]=r+c.getSpanWidth(t,e));return f[a]};t.rotation=0;var v=g(e.textContent.length);if(l=r+v>o){for(;u<=d;)p=Math.ceil((u+d)/2),n&&(a=s(n,p)),v=g(p,a&&a.length-1),u===d?u=d+1:v>o?d=p-1:u=p;0===d?m(""):i&&d===i.length-1||m(a||s(i||n,p))}return n&&n.splice(0,p),t.actualWidth=v,t.rotation=h,l},e.prototype.buildText=function(t){var e,i,n=t.element,r=this,o=r.forExport,a=y(t.textStr,"").toString(),c=-1!==a.indexOf("<"),h=n.childNodes,u=s(n,"x"),d=t.styles,p=t.textWidth,f=d&&d.lineHeight,g=d&&d.textOutline,b=d&&"ellipsis"===d.textOverflow,w=d&&"nowrap"===d.whiteSpace,_=d&&d.fontSize,M=h.length;d=p&&!t.added&&this.box;var T=function(t){var e;return r.styledMode||(e=/(px|em)$/.test(t&&t.style.fontSize)?t.style.fontSize:_||r.style.fontSize||12),f?x(f):r.fontMetrics(e,t.getAttribute("style")?t:n).h},E=function(t,e){return v(r.escapes,(function(i,n){e&&-1!==e.indexOf(i)||(t=t.toString().replace(new RegExp(i,"g"),n))})),t},A=function(t,e){var i=t.indexOf("<");if(t=t.substring(i,t.indexOf(">")-i),i=t.indexOf(e+"="),-1!==i&&(i=i+e.length+1,e=t.charAt(i),'"'===e||"'"===e))return t=t.substring(i+1),t.substring(0,t.indexOf(e))},P=/<br.*?>/g,R=[a,b,w,f,g,_,p].join();if(R!==t.textCache){for(t.textCache=R;M--;)n.removeChild(h[M]);c||g||b||p||-1!==a.indexOf(" ")&&(!w||P.test(a))?(d&&d.appendChild(n),c?(a=r.styledMode?a.replace(/<(b|strong)>/g,'<span class="highcharts-strong">').replace(/<(i|em)>/g,'<span class="highcharts-emphasized">'):a.replace(/<(b|strong)>/g,'<span style="font-weight:bold">').replace(/<(i|em)>/g,'<span style="font-style:italic">'),a=a.replace(/<a/g,"<span").replace(/<\/(b|strong|i|em|a)>/g,"</span>").split(P)):a=[a],a=a.filter((function(t){return""!==t})),a.forEach((function(a,c){var h=0,d=0;a=a.replace(/^\s+|\s+$/g,"").replace(/<span/g,"|||<span").replace(/<\/span>/g,"</span>|||");var f=a.split("|||");f.forEach((function(a){if(""!==a||1===f.length){var m,g,v={},y=S.createElementNS(r.SVG_NS,"tspan");if((m=A(a,"class"))&&s(y,"class",m),(m=A(a,"style"))&&(m=m.replace(/(;| |^)color([ :])/,"$1fill$2"),s(y,"style",m)),(g=A(a,"href"))&&!o&&-1===g.split(":")[0].toLowerCase().indexOf("javascript")){var x=S.createElementNS(r.SVG_NS,"a");s(x,"href",g),s(y,"class","highcharts-anchor"),x.appendChild(y),r.styledMode||l(y,{cursor:"pointer"})}if(a=E(a.replace(/<[a-zA-Z\/](.|\n)*?>/g,"")||" ")," "!==a){if(y.appendChild(S.createTextNode(a)),h?v.dx=0:c&&null!==u&&(v.x=u),s(y,v),n.appendChild(x||y),!h&&i&&(!L&&o&&l(y,{display:"block"}),s(y,"dy",T(y))),p){var M=a.replace(/([^\^])-/g,"$1- ").split(" ");if(v=!w&&(1<f.length||c||1<M.length),x=0,g=T(y),b)e=r.truncate(t,y,a,void 0,0,Math.max(0,p-parseInt(_||12,10)),(function(t,e){return t.substring(0,e)+"…"}));else if(v)for(;M.length;)M.length&&!w&&0<x&&(y=S.createElementNS(C,"tspan"),s(y,{dy:g,x:u}),m&&s(y,"style",m),y.appendChild(S.createTextNode(M.join(" ").replace(/- /g,"-"))),n.appendChild(y)),r.truncate(t,y,null,M,0===x?d:0,p,(function(t,e){return M.slice(0,e).join(" ").replace(/- /g,"-")})),d=t.actualWidth,x++}h++}}})),i=i||n.childNodes.length})),b&&e&&t.attr("title",E(t.textStr||"",["&lt;","&gt;"])),d&&d.removeChild(n),m(g)&&t.applyTextOutline&&t.applyTextOutline(g)):n.appendChild(S.createTextNode(E(a)))}},e.prototype.getContrast=function(e){return e=t.parse(e).rgba,e[0]*=1,e[1]*=1.2,e[2]*=.5,459<e[0]+e[1]+e[2]?"#000000":"#FFFFFF"},e.prototype.button=function(t,e,i,n,r,s,a,l,c,h){var d=this.label(t,e,i,c,void 0,void 0,h,void 0,"button"),p=0,f=this.styledMode;if(t=(r=r?g(r):r)&&r.style||{},r&&r.style&&delete r.style,d.attr(g({padding:8,r:2},r)),!f){r=g({fill:"#f7f7f7",stroke:"#cccccc","stroke-width":1,style:{color:"#333333",cursor:"pointer",fontWeight:"normal"}},{style:t},r);var m=r.style;delete r.style,s=g(r,{fill:"#e6e6e6"},s);var v=s.style;delete s.style,a=g(r,{fill:"#e6ebf5",style:{color:"#000000",fontWeight:"bold"}},a);var y=a.style;delete a.style,l=g(r,{style:{color:"#cccccc"}},l);var x=l.style;delete l.style}return o(d.element,E?"mouseover":"mouseenter",(function(){3!==p&&d.setState(1)})),o(d.element,E?"mouseout":"mouseleave",(function(){3!==p&&d.setState(p)})),d.setState=function(t){1!==t&&(d.state=p=t),d.removeClass(/highcharts-button-(normal|hover|pressed|disabled)/).addClass("highcharts-button-"+["normal","hover","pressed","disabled"][t||0]),f||d.attr([r,s,a,l][t||0]).css([m,v,y,x][t||0])},f||d.attr(r).css(u({cursor:"default"},m)),d.on("click",(function(t){3!==p&&n.call(d,t)}))},e.prototype.crispLine=function(t,e,i){void 0===i&&(i="round");var n=t[0],r=t[1];return n[1]===r[1]&&(n[1]=r[1]=Math[i](n[1])-e%2/2),n[2]===r[2]&&(n[2]=r[2]=Math[i](n[2])+e%2/2),t},e.prototype.path=function(t){var e=this.styledMode?{}:{fill:"none"};return d(t)?e.d=t:f(t)&&u(e,t),this.createElement("path").attr(e)},e.prototype.circle=function(t,e,i){return t=f(t)?t:"undefined"===typeof t?{}:{x:t,y:e,r:i},e=this.createElement("circle"),e.xSetter=e.ySetter=function(t,e,i){i.setAttribute("c"+e,t)},e.attr(t)},e.prototype.arc=function(t,e,i,n,r,o){return f(t)?(n=t,e=n.y,i=n.r,t=n.x):n={innerR:n,start:r,end:o},t=this.symbol("arc",t,e,i,i,n),t.r=i,t},e.prototype.rect=function(t,e,i,n,r,o){r=f(t)?t.r:r;var a=this.createElement("rect");return t=f(t)?t:"undefined"===typeof t?{}:{x:t,y:e,width:Math.max(i,0),height:Math.max(n,0)},this.styledMode||("undefined"!==typeof o&&(t.strokeWidth=o,t=a.crisp(t)),t.fill="none"),r&&(t.r=r),a.rSetter=function(t,e,i){a.r=t,s(i,{rx:t,ry:t})},a.rGetter=function(){return a.r},a.attr(t)},e.prototype.setSize=function(t,e,i){var n=this.alignedObjects,r=n.length;for(this.width=t,this.height=e,this.boxWrapper.animate({width:t,height:e},{step:function(){this.attr({viewBox:"0 0 "+this.attr("width")+" "+this.attr("height")})},duration:y(i,!0)?void 0:0});r--;)n[r].align()},e.prototype.g=function(t){var e=this.createElement("g");return t?e.attr({class:"highcharts-"+t}):e},e.prototype.image=function(t,e,i,n,r,s){var a={preserveAspectRatio:"none"},l=function(t,e){t.setAttributeNS?t.setAttributeNS("http://www.w3.org/1999/xlink","href",e):t.setAttribute("hc-svg-href",e)},c=function(e){l(h.element,t),s.call(h,e)};1<arguments.length&&u(a,{x:e,y:i,width:n,height:r});var h=this.createElement("image").attr(a);return s?(l(h.element,"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),a=new R.Image,o(a,"load",c),a.src=t,a.complete&&c({})):l(h.element,t),h},e.prototype.symbol=function(t,e,i,n,r,o){var s,h=this,d=/^url\((.*?)\)$/,p=d.test(t),f=!p&&(this.symbols[t]?t:"circle"),m=f&&this.symbols[f];if(m){"number"===typeof e&&(s=m.call(this.symbols,Math.round(e||0),Math.round(i||0),n||0,r||0,o));var g=this.path(s);h.styledMode||g.attr("fill","none"),u(g,{symbolName:f,x:e,y:i,width:n,height:r}),o&&u(g,o)}else if(p){var v=t.match(d)[1];g=this.image(v),g.imgwidth=y(P[v]&&P[v].width,o&&o.width),g.imgheight=y(P[v]&&P[v].height,o&&o.height);var x=function(){g.attr({width:g.width,height:g.height})};["width","height"].forEach((function(t){g[t+"Setter"]=function(t,e){var i={},n=this["img"+e],r="width"===e?"translateX":"translateY";this[e]=t,c(n)&&(o&&"within"===o.backgroundSize&&this.width&&this.height&&(n=Math.round(n*Math.min(this.width/this.imgwidth,this.height/this.imgheight))),this.element&&this.element.setAttribute(e,n),this.alignByTranslate||(i[r]=((this[e]||0)-n)/2,this.attr(i)))}})),c(e)&&g.attr({x:e,y:i}),g.isImg=!0,c(g.imgwidth)&&c(g.imgheight)?x():(g.attr({width:0,height:0}),a("img",{onload:function(){var t=_[h.chartIndex];0===this.width&&(l(this,{position:"absolute",top:"-999em"}),S.body.appendChild(this)),P[v]={width:this.width,height:this.height},g.imgwidth=this.width,g.imgheight=this.height,g.element&&x(),this.parentNode&&this.parentNode.removeChild(this),h.imgCount--,h.imgCount||!t||t.hasLoaded||t.onload()},src:v}),this.imgCount++)}return g},e.prototype.clipRect=function(t,e,i,n){var r=w()+"-",o=this.createElement("clipPath").attr({id:r}).add(this.defs);return t=this.rect(t,e,i,n,0).add(o),t.id=r,t.clipPath=o,t.count=0,t},e.prototype.text=function(t,e,i,n){var r={};return!n||!this.allowHTML&&this.forExport?(r.x=Math.round(e||0),i&&(r.y=Math.round(i)),c(t)&&(r.text=t),t=this.createElement("text").attr(r),n||(t.xSetter=function(t,e,i){var n,r=i.getElementsByTagName("tspan"),o=i.getAttribute(e);for(n=0;n<r.length;n++){var s=r[n];s.getAttribute(e)===o&&s.setAttribute(e,t)}i.setAttribute(e,t)}),t):this.html(t,e,i)},e.prototype.fontMetrics=function(t,e){return t=!this.styledMode&&/px/.test(t)||!R.getComputedStyle?t||e&&e.style&&e.style.fontSize||this.style&&this.style.fontSize:e&&i.prototype.getStyle.call(e,"font-size"),t=/px/.test(t)?x(t):12,e=24>t?t+3:Math.round(1.2*t),{h:e,b:Math.round(.8*e),f:t}},e.prototype.rotCorr=function(t,e,i){var n=t;return e&&i&&(n=Math.max(n*Math.cos(e*M),4)),{x:-t/3*Math.sin(e*M),y:n}},e.prototype.pathToSegments=function(t){for(var e=[],i=[],n={A:8,C:7,H:2,L:3,M:3,Q:5,S:5,T:3,V:2},r=0;r<t.length;r++)m(i[0])&&p(t[r])&&i.length===n[i[0].toUpperCase()]&&t.splice(r,0,i[0].replace("M","L").replace("m","l")),"string"===typeof t[r]&&(i.length&&e.push(i.slice(0)),i.length=0),i.push(t[r]);return e.push(i.slice(0)),e},e.prototype.label=function(t,e,i,r,o,s,a,l,c){return new n(this,t,e,i,r,o,s,a,l,c)},e}();return O.prototype.Element=i,O.prototype.SVG_NS=C,O.prototype.draw=r,O.prototype.escapes={"&":"&amp;","<":"&lt;",">":"&gt;","'":"&#39;",'"':"&quot;"},O.prototype.symbols={circle:function(t,e,i,n){return this.arc(t+i/2,e+n/2,i/2,n/2,{start:.5*Math.PI,end:2.5*Math.PI,open:!1})},square:function(t,e,i,n){return[["M",t,e],["L",t+i,e],["L",t+i,e+n],["L",t,e+n],["Z"]]},triangle:function(t,e,i,n){return[["M",t+i/2,e],["L",t+i,e+n],["L",t,e+n],["Z"]]},"triangle-down":function(t,e,i,n){return[["M",t,e],["L",t+i,e],["L",t+i/2,e+n],["Z"]]},diamond:function(t,e,i,n){return[["M",t+i/2,e],["L",t+i,e+n/2],["L",t+i/2,e+n],["L",t,e+n/2],["Z"]]},arc:function(t,e,i,n,r){var o=[];if(r){var s=r.start||0,a=r.end||0,l=r.r||i;i=r.r||n||i;var h=.001>Math.abs(a-s-2*Math.PI);a-=.001,n=r.innerR,h=y(r.open,h);var u=Math.cos(s),d=Math.sin(s),p=Math.cos(a),f=Math.sin(a);s=y(r.longArc,.001>a-s-Math.PI?0:1),o.push(["M",t+l*u,e+i*d],["A",l,i,0,s,y(r.clockwise,1),t+l*p,e+i*f]),c(n)&&o.push(h?["M",t+n*p,e+n*f]:["L",t+n*p,e+n*f],["A",n,n,0,s,c(r.clockwise)?1-r.clockwise:0,t+n*u,e+n*d]),h||o.push(["Z"])}return o},callout:function(t,e,i,n,r){var o=Math.min(r&&r.r||0,i,n),s=o+6,a=r&&r.anchorX||0;r=r&&r.anchorY||0;var l=[["M",t+o,e],["L",t+i-o,e],["C",t+i,e,t+i,e,t+i,e+o],["L",t+i,e+n-o],["C",t+i,e+n,t+i,e+n,t+i-o,e+n],["L",t+o,e+n],["C",t,e+n,t,e+n,t,e+n-o],["L",t,e+o],["C",t,e,t,e,t+o,e]];return a&&a>i?r>e+s&&r<e+n-s?l.splice(3,1,["L",t+i,r-6],["L",t+i+6,r],["L",t+i,r+6],["L",t+i,e+n-o]):l.splice(3,1,["L",t+i,n/2],["L",a,r],["L",t+i,n/2],["L",t+i,e+n-o]):a&&0>a?r>e+s&&r<e+n-s?l.splice(7,1,["L",t,r+6],["L",t-6,r],["L",t,r-6],["L",t,e+o]):l.splice(7,1,["L",t,n/2],["L",a,r],["L",t,n/2],["L",t,e+o]):r&&r>n&&a>t+s&&a<t+i-s?l.splice(5,1,["L",a+6,e+n],["L",a,e+n+6],["L",a-6,e+n],["L",t+o,e+n]):r&&0>r&&a>t+s&&a<t+i-s&&l.splice(1,1,["L",a-6,e],["L",a,e-6],["L",a+6,e],["L",i-o,e]),l}},e.SVGRenderer=O,e.Renderer=e.SVGRenderer,e.Renderer})),e(i,"Core/Renderer/HTML/HTMLElement.js",[i["Core/Globals.js"],i["Core/Renderer/SVG/SVGElement.js"],i["Core/Utilities.js"]],(function(t,e,i){var n=i.css,r=i.defined,o=i.extend,s=i.pick,a=i.pInt,l=t.isFirefox;return o(e.prototype,{htmlCss:function(t){var e="SPAN"===this.element.tagName&&t&&"width"in t,i=s(e&&t.width,void 0);if(e){delete t.width,this.textWidth=i;var r=!0}return t&&"ellipsis"===t.textOverflow&&(t.whiteSpace="nowrap",t.overflow="hidden"),this.styles=o(this.styles,t),n(this.element,t),r&&this.htmlUpdateTransform(),this},htmlGetBBox:function(){var t=this.element;return{x:t.offsetLeft,y:t.offsetTop,width:t.offsetWidth,height:t.offsetHeight}},htmlUpdateTransform:function(){if(this.added){var t=this.renderer,e=this.element,i=this.translateX||0,o=this.translateY||0,s=this.x||0,l=this.y||0,c=this.textAlign||"left",h={left:0,center:.5,right:1}[c],u=this.styles,d=u&&u.whiteSpace;if(n(e,{marginLeft:i,marginTop:o}),!t.styledMode&&this.shadows&&this.shadows.forEach((function(t){n(t,{marginLeft:i+1,marginTop:o+1})})),this.inverted&&[].forEach.call(e.childNodes,(function(i){t.invertChild(i,e)})),"SPAN"===e.tagName){u=this.rotation;var p,f=this.textWidth&&a(this.textWidth),m=[u,c,e.innerHTML,this.textWidth,this.textAlign].join();(p=f!==this.oldTextWidth)&&!(p=f>this.oldTextWidth)&&((p=this.textPxLength)||(n(e,{width:"",whiteSpace:d||"nowrap"}),p=e.offsetWidth),p=p>f),p&&(/[ \-]/.test(e.textContent||e.innerText)||"ellipsis"===e.style.textOverflow)?(n(e,{width:f+"px",display:"block",whiteSpace:d||"normal"}),this.oldTextWidth=f,this.hasBoxWidthChanged=!0):this.hasBoxWidthChanged=!1,m!==this.cTT&&(d=t.fontMetrics(e.style.fontSize,e).b,!r(u)||u===(this.oldRotation||0)&&c===this.oldAlign||this.setSpanRotation(u,h,d),this.getSpanCorrection(!r(u)&&this.textPxLength||e.offsetWidth,d,h,u,c)),n(e,{left:s+(this.xCorr||0)+"px",top:l+(this.yCorr||0)+"px"}),this.cTT=m,this.oldRotation=u,this.oldAlign=c}}else this.alignOnAdd=!0},setSpanRotation:function(t,e,i){var r={},o=this.renderer.getTransformKey();r[o]=r.transform="rotate("+t+"deg)",r[o+(l?"Origin":"-origin")]=r.transformOrigin=100*e+"% "+i+"px",n(this.element,r)},getSpanCorrection:function(t,e,i){this.xCorr=-t*i,this.yCorr=-e}}),e})),e(i,"Core/Renderer/HTML/HTMLRenderer.js",[i["Core/Globals.js"],i["Core/Renderer/SVG/SVGElement.js"],i["Core/Renderer/SVG/SVGRenderer.js"],i["Core/Utilities.js"]],(function(t,e,i,n){var r=t.isFirefox,o=t.isMS,s=t.isWebKit,a=t.win,l=n.attr,c=n.createElement,h=n.extend,u=n.pick;return h(i.prototype,{getTransformKey:function(){return o&&!/Edge/.test(a.navigator.userAgent)?"-ms-transform":s?"-webkit-transform":r?"MozTransform":a.opera?"-o-transform":""},html:function(t,i,n){var r=this.createElement("span"),o=r.element,s=r.renderer,a=s.isSVG,d=function(t,i){["opacity","visibility"].forEach((function(n){t[n+"Setter"]=function(r,o,s){var a=t.div?t.div.style:i;e.prototype[n+"Setter"].call(this,r,o,s),a&&(a[o]=r)}})),t.addedSetters=!0};return r.textSetter=function(t){t!==o.innerHTML&&(delete this.bBox,delete this.oldTextWidth),this.textStr=t,o.innerHTML=u(t,""),r.doTransform=!0},a&&d(r,r.element.style),r.xSetter=r.ySetter=r.alignSetter=r.rotationSetter=function(t,e){"align"===e?r.alignValue=r.textAlign=t:r[e]=t,r.doTransform=!0},r.afterSetters=function(){this.doTransform&&(this.htmlUpdateTransform(),this.doTransform=!1)},r.attr({text:t,x:Math.round(i),y:Math.round(n)}).css({position:"absolute"}),s.styledMode||r.css({fontFamily:this.style.fontFamily,fontSize:this.style.fontSize}),o.style.whiteSpace="nowrap",r.css=r.htmlCss,a&&(r.add=function(t){var e=s.box.parentNode,i=[];if(this.parentGroup=t){var n=t.div;if(!n){for(;t;)i.push(t),t=t.parentGroup;i.reverse().forEach((function(t){function o(e,i){t[i]=e,"translateX"===i?a.left=e+"px":a.top=e+"px",t.doTransform=!0}var s=l(t.element,"class");n=t.div=t.div||c("div",s?{className:s}:void 0,{position:"absolute",left:(t.translateX||0)+"px",top:(t.translateY||0)+"px",display:t.display,opacity:t.opacity,pointerEvents:t.styles&&t.styles.pointerEvents},n||e);var a=n.style;h(t,{classSetter:function(t){return function(e){this.element.setAttribute("class",e),t.className=e}}(n),on:function(){return i[0].div&&r.on.apply({element:i[0].div},arguments),t},translateXSetter:o,translateYSetter:o}),t.addedSetters||d(t)}))}}else n=e;return n.appendChild(o),r.added=!0,r.alignOnAdd&&r.htmlUpdateTransform(),r}),r}}),i})),e(i,"Core/Axis/Tick.js",[i["Core/Globals.js"],i["Core/Utilities.js"]],(function(t,e){var i=e.clamp,n=e.correctFloat,r=e.defined,o=e.destroyObjectProperties,s=e.extend,a=e.fireEvent,l=e.isNumber,c=e.merge,h=e.objectEach,u=e.pick,d=t.deg2rad;return e=function(){function t(t,e,i,n,r){this.isNewLabel=this.isNew=!0,this.axis=t,this.pos=e,this.type=i||"",this.parameters=r||{},this.tickmarkOffset=this.parameters.tickmarkOffset,this.options=this.parameters.options,a(this,"init"),i||n||this.addLabel()}return t.prototype.addLabel=function(){var t=this,e=t.axis,i=e.options,o=e.chart,a=e.categories,l=e.logarithmic,c=e.names,h=t.pos,d=u(t.options&&t.options.labels,i.labels),p=e.tickPositions,f=h===p[0],m=h===p[p.length-1];c=this.parameters.category||(a?u(a[h],c[h],h):h);var g,v,y=t.label;if(a=(!d.step||1===d.step)&&1===e.tickInterval,p=p.info,e.dateTime&&p)var x=o.time.resolveDTLFormat(i.dateTimeLabelFormats[!i.grid&&p.higherRanks[h]||p.unitName]),b=x.main;t.isFirst=f,t.isLast=m,t.formatCtx={axis:e,chart:o,isFirst:f,isLast:m,dateTimeLabelFormat:b,tickPositionInfo:p,value:l?n(l.lin2log(c)):c,pos:h},i=e.labelFormatter.call(t.formatCtx,this.formatCtx),(v=x&&x.list)&&(t.shortenLabel=function(){for(g=0;g<v.length;g++)if(y.attr({text:e.labelFormatter.call(s(t.formatCtx,{dateTimeLabelFormat:v[g]}))}),y.getBBox().width<e.getSlotWidth(t)-2*u(d.padding,5))return;y.attr({text:""})}),a&&e._addedPlotLB&&t.moveLabel(i,d),r(y)||t.movedLabel?y&&y.textStr!==i&&!a&&(!y.textWidth||d.style&&d.style.width||y.styles.width||y.css({width:null}),y.attr({text:i}),y.textPxLength=y.getBBox().width):(t.label=y=t.createLabel({x:0,y:0},i,d),t.rotation=0)},t.prototype.createLabel=function(t,e,i){var n=this.axis,o=n.chart;return(t=r(e)&&i.enabled?o.renderer.text(e,t.x,t.y,i.useHTML).add(n.labelGroup):null)&&(o.styledMode||t.css(c(i.style)),t.textPxLength=t.getBBox().width),t},t.prototype.destroy=function(){o(this,this.axis)},t.prototype.getPosition=function(t,e,r,o){var s=this.axis,l=s.chart,c=o&&l.oldChartHeight||l.chartHeight;return t={x:t?n(s.translate(e+r,null,null,o)+s.transB):s.left+s.offset+(s.opposite?(o&&l.oldChartWidth||l.chartWidth)-s.right-s.left:0),y:t?c-s.bottom+s.offset-(s.opposite?s.height:0):n(c-s.translate(e+r,null,null,o)-s.transB)},t.y=i(t.y,-1e5,1e5),a(this,"afterGetPosition",{pos:t}),t},t.prototype.getLabelPosition=function(t,e,i,n,o,s,l,c){var h=this.axis,u=h.transA,p=h.isLinked&&h.linkedParent?h.linkedParent.reversed:h.reversed,f=h.staggerLines,m=h.tickRotCorr||{x:0,y:0},g=o.y,v=n||h.reserveSpaceDefault?0:-h.labelOffset*("center"===h.labelAlign?.5:1),y={};return r(g)||(g=0===h.side?i.rotation?-8:-i.getBBox().height:2===h.side?m.y+8:Math.cos(i.rotation*d)*(m.y-i.getBBox(!1,0).height/2)),t=t+o.x+v+m.x-(s&&n?s*u*(p?-1:1):0),e=e+g-(s&&!n?s*u*(p?1:-1):0),f&&(i=l/(c||1)%f,h.opposite&&(i=f-i-1),e+=h.labelOffset/f*i),y.x=t,y.y=Math.round(e),a(this,"afterGetLabelPosition",{pos:y,tickmarkOffset:s,index:l}),y},t.prototype.getLabelSize=function(){return this.label?this.label.getBBox()[this.axis.horiz?"height":"width"]:0},t.prototype.getMarkPath=function(t,e,i,n,r,o){return o.crispLine([["M",t,e],["L",t+(r?0:-i),e+(r?i:0)]],n)},t.prototype.handleOverflow=function(t){var e=this.axis,i=e.options.labels,n=t.x,r=e.chart.chartWidth,o=e.chart.spacing,s=u(e.labelLeft,Math.min(e.pos,o[3]));o=u(e.labelRight,Math.max(e.isRadial?0:e.pos+e.len,r-o[1]));var a,l=this.label,c=this.rotation,h={left:0,center:.5,right:1}[e.labelAlign||l.attr("align")],p=l.getBBox().width,f=e.getSlotWidth(this),m=f,g=1,v={};c||"justify"!==u(i.overflow,"justify")?0>c&&n-h*p<s?a=Math.round(n/Math.cos(c*d)-s):0<c&&n+h*p>o&&(a=Math.round((r-n)/Math.cos(c*d))):(r=n+(1-h)*p,n-h*p<s?m=t.x+m*(1-h)-s:r>o&&(m=o-t.x+m*h,g=-1),m=Math.min(f,m),m<f&&"center"===e.labelAlign&&(t.x+=g*(f-m-h*(f-Math.min(p,m)))),(p>m||e.autoRotation&&(l.styles||{}).width)&&(a=m)),a&&(this.shortenLabel?this.shortenLabel():(v.width=Math.floor(a)+"px",(i.style||{}).textOverflow||(v.textOverflow="ellipsis"),l.css(v)))},t.prototype.moveLabel=function(t,e){var i=this,n=i.label,r=!1,o=i.axis,s=o.reversed;if(n&&n.textStr===t?(i.movedLabel=n,r=!0,delete i.label):h(o.ticks,(function(e){r||e.isNew||e===i||!e.label||e.label.textStr!==t||(i.movedLabel=e.label,r=!0,e.labelPos=i.movedLabel.xy,delete e.label)})),!r&&(i.labelPos||n)){var a=i.labelPos||n.xy;n=o.horiz?s?0:o.width+o.left:a.x,o=o.horiz?a.y:s?o.width+o.left:0,i.movedLabel=i.createLabel({x:n,y:o},t,e),i.movedLabel&&i.movedLabel.attr({opacity:0})}},t.prototype.render=function(t,e,i){var n=this.axis,r=n.horiz,o=this.pos,s=u(this.tickmarkOffset,n.tickmarkOffset);o=this.getPosition(r,o,s,e),s=o.x;var l=o.y;n=r&&s===n.pos+n.len||!r&&l===n.pos?-1:1,i=u(i,1),this.isActive=!0,this.renderGridLine(e,i,n),this.renderMark(o,i,n),this.renderLabel(o,e,i,t),this.isNew=!1,a(this,"afterRender")},t.prototype.renderGridLine=function(t,e,i){var n=this.axis,r=n.options,o=this.gridLine,s={},a=this.pos,l=this.type,c=u(this.tickmarkOffset,n.tickmarkOffset),h=n.chart.renderer,d=l?l+"Grid":"grid",p=r[d+"LineWidth"],f=r[d+"LineColor"];r=r[d+"LineDashStyle"],o||(n.chart.styledMode||(s.stroke=f,s["stroke-width"]=p,r&&(s.dashstyle=r)),l||(s.zIndex=1),t&&(e=0),this.gridLine=o=h.path().attr(s).addClass("highcharts-"+(l?l+"-":"")+"grid-line").add(n.gridGroup)),o&&(i=n.getPlotLinePath({value:a+c,lineWidth:o.strokeWidth()*i,force:"pass",old:t}))&&o[t||this.isNew?"attr":"animate"]({d:i,opacity:e})},t.prototype.renderMark=function(t,e,i){var n=this.axis,r=n.options,o=n.chart.renderer,s=this.type,a=s?s+"Tick":"tick",l=n.tickSize(a),c=this.mark,h=!c,d=t.x;t=t.y;var p=u(r[a+"Width"],!s&&n.isXAxis?1:0);r=r[a+"Color"],l&&(n.opposite&&(l[0]=-l[0]),h&&(this.mark=c=o.path().addClass("highcharts-"+(s?s+"-":"")+"tick").add(n.axisGroup),n.chart.styledMode||c.attr({stroke:r,"stroke-width":p})),c[h?"attr":"animate"]({d:this.getMarkPath(d,t,l[0],c.strokeWidth()*i,n.horiz,o),opacity:e}))},t.prototype.renderLabel=function(t,e,i,n){var r=this.axis,o=r.horiz,s=r.options,a=this.label,c=s.labels,h=c.step;r=u(this.tickmarkOffset,r.tickmarkOffset);var d=!0,p=t.x;t=t.y,a&&l(p)&&(a.xy=t=this.getLabelPosition(p,t,a,o,c,r,n,h),this.isFirst&&!this.isLast&&!u(s.showFirstLabel,1)||this.isLast&&!this.isFirst&&!u(s.showLastLabel,1)?d=!1:!o||c.step||c.rotation||e||0===i||this.handleOverflow(t),h&&n%h&&(d=!1),d&&l(t.y)?(t.opacity=i,a[this.isNewLabel?"attr":"animate"](t),this.isNewLabel=!1):(a.attr("y",-9999),this.isNewLabel=!0))},t.prototype.replaceMovedLabel=function(){var t=this.label,e=this.axis,i=e.reversed;if(t&&!this.isNew){var n=e.horiz?i?e.left:e.width+e.left:t.xy.x;i=e.horiz?t.xy.y:i?e.width+e.top:e.top,t.animate({x:n,y:i,opacity:0},void 0,t.destroy),delete this.label}e.isDirty=!0,this.label=this.movedLabel,delete this.movedLabel},t}(),t.Tick=e,t.Tick})),e(i,"Core/Time.js",[i["Core/Globals.js"],i["Core/Utilities.js"]],(function(t,e){var i=e.defined,n=e.error,r=e.extend,o=e.isObject,s=e.merge,a=e.objectEach,l=e.pad,c=e.pick,h=e.splat,u=e.timeUnits,d=t.win;return e=function(){function e(t){this.options={},this.variableTimezone=this.useUTC=!1,this.Date=d.Date,this.getTimezoneOffset=this.timezoneOffsetFunction(),this.update(t)}return e.prototype.get=function(t,e){if(this.variableTimezone||this.timezoneOffset){var i=e.getTime(),n=i-this.getTimezoneOffset(e);return e.setTime(n),t=e["getUTC"+t](),e.setTime(i),t}return this.useUTC?e["getUTC"+t]():e["get"+t]()},e.prototype.set=function(t,e,i){if(this.variableTimezone||this.timezoneOffset){if("Milliseconds"===t||"Seconds"===t||"Minutes"===t)return e["setUTC"+t](i);var n=this.getTimezoneOffset(e);return n=e.getTime()-n,e.setTime(n),e["setUTC"+t](i),t=this.getTimezoneOffset(e),n=e.getTime()+t,e.setTime(n)}return this.useUTC?e["setUTC"+t](i):e["set"+t](i)},e.prototype.update=function(t){var e=c(t&&t.useUTC,!0);this.options=t=s(!0,this.options||{},t),this.Date=t.Date||d.Date||Date,this.timezoneOffset=(this.useUTC=e)&&t.timezoneOffset,this.getTimezoneOffset=this.timezoneOffsetFunction(),this.variableTimezone=!(e&&!t.getTimezoneOffset&&!t.timezone)},e.prototype.makeTime=function(e,i,n,r,o,s){if(this.useUTC){var a=this.Date.UTC.apply(0,arguments),l=this.getTimezoneOffset(a);a+=l;var h=this.getTimezoneOffset(a);l!==h?a+=h-l:l-36e5!==this.getTimezoneOffset(a-36e5)||t.isSafari||(a-=36e5)}else a=new this.Date(e,i,c(n,1),c(r,0),c(o,0),c(s,0)).getTime();return a},e.prototype.timezoneOffsetFunction=function(){var t=this,e=this.options,i=e.moment||d.moment;if(!this.useUTC)return function(t){return 6e4*new Date(t.toString()).getTimezoneOffset()};if(e.timezone){if(i)return function(t){return 6e4*-i.tz(t,e.timezone).utcOffset()};n(25)}return this.useUTC&&e.getTimezoneOffset?function(t){return 6e4*e.getTimezoneOffset(t.valueOf())}:function(){return 6e4*(t.timezoneOffset||0)}},e.prototype.dateFormat=function(e,n,o){var s;if(!i(n)||isNaN(n))return(null===(s=t.defaultOptions.lang)||void 0===s?void 0:s.invalidDate)||"";e=c(e,"%Y-%m-%d %H:%M:%S");var h=this;s=new this.Date(n);var u=this.get("Hours",s),d=this.get("Day",s),p=this.get("Date",s),f=this.get("Month",s),m=this.get("FullYear",s),g=t.defaultOptions.lang,v=null===g||void 0===g?void 0:g.weekdays,y=null===g||void 0===g?void 0:g.shortWeekdays;return s=r({a:y?y[d]:v[d].substr(0,3),A:v[d],d:l(p),e:l(p,2," "),w:d,b:g.shortMonths[f],B:g.months[f],m:l(f+1),o:f+1,y:m.toString().substr(2,2),Y:m,H:l(u),k:u,I:l(u%12||12),l:u%12||12,M:l(this.get("Minutes",s)),p:12>u?"AM":"PM",P:12>u?"am":"pm",S:l(s.getSeconds()),L:l(Math.floor(n%1e3),3)},t.dateFormats),a(s,(function(t,i){for(;-1!==e.indexOf("%"+i);)e=e.replace("%"+i,"function"===typeof t?t.call(h,n):t)})),o?e.substr(0,1).toUpperCase()+e.substr(1):e},e.prototype.resolveDTLFormat=function(t){return o(t,!0)?t:(t=h(t),{main:t[0],from:t[1],to:t[2]})},e.prototype.getTimeTicks=function(t,e,n,o){var s,a=this,l=[],h={},d=new a.Date(e),p=t.unitRange,f=t.count||1;if(o=c(o,1),i(e)){if(a.set("Milliseconds",d,p>=u.second?0:f*Math.floor(a.get("Milliseconds",d)/f)),p>=u.second&&a.set("Seconds",d,p>=u.minute?0:f*Math.floor(a.get("Seconds",d)/f)),p>=u.minute&&a.set("Minutes",d,p>=u.hour?0:f*Math.floor(a.get("Minutes",d)/f)),p>=u.hour&&a.set("Hours",d,p>=u.day?0:f*Math.floor(a.get("Hours",d)/f)),p>=u.day&&a.set("Date",d,p>=u.month?1:Math.max(1,f*Math.floor(a.get("Date",d)/f))),p>=u.month){a.set("Month",d,p>=u.year?0:f*Math.floor(a.get("Month",d)/f));var m=a.get("FullYear",d)}p>=u.year&&a.set("FullYear",d,m-m%f),p===u.week&&(m=a.get("Day",d),a.set("Date",d,a.get("Date",d)-m+o+(m<o?-7:0))),m=a.get("FullYear",d),o=a.get("Month",d);var g=a.get("Date",d),v=a.get("Hours",d);for(e=d.getTime(),a.variableTimezone&&(s=n-e>4*u.month||a.getTimezoneOffset(e)!==a.getTimezoneOffset(n)),e=d.getTime(),d=1;e<n;)l.push(e),e=p===u.year?a.makeTime(m+d*f,0):p===u.month?a.makeTime(m,o+d*f):!s||p!==u.day&&p!==u.week?s&&p===u.hour&&1<f?a.makeTime(m,o,g,v+d*f):e+p*f:a.makeTime(m,o,g+d*f*(p===u.day?1:7)),d++;l.push(e),p<=u.hour&&1e4>l.length&&l.forEach((function(t){0===t%18e5&&"000000000"===a.dateFormat("%H%M%S%L",t)&&(h[t]="day")}))}return l.info=r(t,{higherRanks:h,totalRange:p*f}),l},e}(),t.Time=e,t.Time})),e(i,"Core/Options.js",[i["Core/Globals.js"],i["Core/Color/Color.js"],i["Core/Time.js"],i["Core/Utilities.js"]],(function(t,e,i,n){var r=t.isTouchDevice,o=t.svg;return e=e.parse,n=n.merge,t.defaultOptions={colors:"#7cb5ec #434348 #90ed7d #f7a35c #8085e9 #f15c80 #e4d354 #2b908f #f45b5b #91e8e1".split(" "),symbols:["circle","diamond","square","triangle","triangle-down"],lang:{loading:"Loading...",months:"January February March April May June July August September October November December".split(" "),shortMonths:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),weekdays:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),decimalPoint:".",numericSymbols:"kMGTPE".split(""),resetZoom:"Reset zoom",resetZoomTitle:"Reset zoom level 1:1",thousandsSep:" "},global:{},time:{Date:void 0,getTimezoneOffset:void 0,timezone:void 0,timezoneOffset:0,useUTC:!0},chart:{styledMode:!1,borderRadius:0,colorCount:10,defaultSeriesType:"line",ignoreHiddenSeries:!0,spacing:[10,10,15,10],resetZoomButton:{theme:{zIndex:6},position:{align:"right",x:-10,y:10}},width:null,height:null,borderColor:"#335cad",backgroundColor:"#ffffff",plotBorderColor:"#cccccc"},title:{text:"Chart title",align:"center",margin:15,widthAdjust:-44},subtitle:{text:"",align:"center",widthAdjust:-44},caption:{margin:15,text:"",align:"left",verticalAlign:"bottom"},plotOptions:{},labels:{style:{position:"absolute",color:"#333333"}},legend:{enabled:!0,align:"center",alignColumns:!0,layout:"horizontal",labelFormatter:function(){return this.name},borderColor:"#999999",borderRadius:0,navigation:{activeColor:"#003399",inactiveColor:"#cccccc"},itemStyle:{color:"#333333",cursor:"pointer",fontSize:"12px",fontWeight:"bold",textOverflow:"ellipsis"},itemHoverStyle:{color:"#000000"},itemHiddenStyle:{color:"#cccccc"},shadow:!1,itemCheckboxStyle:{position:"absolute",width:"13px",height:"13px"},squareSymbol:!0,symbolPadding:5,verticalAlign:"bottom",x:0,y:0,title:{style:{fontWeight:"bold"}}},loading:{labelStyle:{fontWeight:"bold",position:"relative",top:"45%"},style:{position:"absolute",backgroundColor:"#ffffff",opacity:.5,textAlign:"center"}},tooltip:{enabled:!0,animation:o,borderRadius:3,dateTimeLabelFormats:{millisecond:"%A, %b %e, %H:%M:%S.%L",second:"%A, %b %e, %H:%M:%S",minute:"%A, %b %e, %H:%M",hour:"%A, %b %e, %H:%M",day:"%A, %b %e, %Y",week:"Week from %A, %b %e, %Y",month:"%B %Y",year:"%Y"},footerFormat:"",padding:8,snap:r?25:10,headerFormat:'<span style="font-size: 10px">{point.key}</span><br/>',pointFormat:'<span style="color:{point.color}">●</span> {series.name}: <b>{point.y}</b><br/>',backgroundColor:e("#f7f7f7").setOpacity(.85).get(),borderWidth:1,shadow:!0,style:{color:"#333333",cursor:"default",fontSize:"12px",whiteSpace:"nowrap"}},credits:{enabled:!0,href:"https://www.highcharts.com?credits",position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",color:"#999999",fontSize:"9px"},text:"Highcharts.com"}},t.time=new i(n(t.defaultOptions.global,t.defaultOptions.time)),t.dateFormat=function(e,i,n){return t.time.dateFormat(e,i,n)},{dateFormat:t.dateFormat,defaultOptions:t.defaultOptions,time:t.time}})),e(i,"Core/Axis/Axis.js",[i["Core/Animation/AnimationUtilities.js"],i["Core/Color/Color.js"],i["Core/Globals.js"],i["Core/Axis/Tick.js"],i["Core/Utilities.js"],i["Core/Options.js"]],(function(t,e,i,n,r,o){var s=t.animObject,a=r.addEvent,l=r.arrayMax,c=r.arrayMin,h=r.clamp,u=r.correctFloat,d=r.defined,p=r.destroyObjectProperties,f=r.error,m=r.extend,g=r.fireEvent,v=r.format,y=r.getMagnitude,x=r.isArray,b=r.isFunction,w=r.isNumber,_=r.isString,M=r.merge,S=r.normalizeTickInterval,T=r.objectEach,E=r.pick,A=r.relativeLength,L=r.removeEvent,C=r.splat,P=r.syncTimeout,R=o.defaultOptions,O=i.deg2rad;return t=function(){function t(t,e){this.zoomEnabled=this.width=this.visible=this.userOptions=this.translationSlope=this.transB=this.transA=this.top=this.ticks=this.tickRotCorr=this.tickPositions=this.tickmarkOffset=this.tickInterval=this.tickAmount=this.side=this.series=this.right=this.positiveValuesOnly=this.pos=this.pointRangePadding=this.pointRange=this.plotLinesAndBandsGroups=this.plotLinesAndBands=this.paddedTicks=this.overlap=this.options=this.oldMin=this.oldMax=this.offset=this.names=this.minPixelPadding=this.minorTicks=this.minorTickInterval=this.min=this.maxLabelLength=this.max=this.len=this.left=this.labelFormatter=this.labelEdge=this.isLinked=this.height=this.hasVisibleSeries=this.hasNames=this.coll=this.closestPointRange=this.chart=this.categories=this.bottom=this.alternateBands=void 0,this.init(t,e)}return t.prototype.init=function(t,e){var i=e.isX,n=this;n.chart=t,n.horiz=t.inverted&&!n.isZAxis?!i:i,n.isXAxis=i,n.coll=n.coll||(i?"xAxis":"yAxis"),g(this,"init",{userOptions:e}),n.opposite=e.opposite,n.side=e.side||(n.horiz?n.opposite?0:2:n.opposite?1:3),n.setOptions(e);var r=this.options,o=r.type;n.labelFormatter=r.labels.formatter||n.defaultLabelFormatter,n.userOptions=e,n.minPixelPadding=0,n.reversed=r.reversed,n.visible=!1!==r.visible,n.zoomEnabled=!1!==r.zoomEnabled,n.hasNames="category"===o||!0===r.categories,n.categories=r.categories||n.hasNames,n.names||(n.names=[],n.names.keys={}),n.plotLinesAndBandsGroups={},n.positiveValuesOnly=!!n.logarithmic,n.isLinked=d(r.linkedTo),n.ticks={},n.labelEdge=[],n.minorTicks={},n.plotLinesAndBands=[],n.alternateBands={},n.len=0,n.minRange=n.userMinRange=r.minRange||r.maxZoom,n.range=r.range,n.offset=r.offset||0,n.max=null,n.min=null,n.crosshair=E(r.crosshair,C(t.options.tooltip.crosshairs)[i?0:1],!1),e=n.options.events,-1===t.axes.indexOf(n)&&(i?t.axes.splice(t.xAxis.length,0,n):t.axes.push(n),t[n.coll].push(n)),n.series=n.series||[],t.inverted&&!n.isZAxis&&i&&"undefined"===typeof n.reversed&&(n.reversed=!0),n.labelRotation=n.options.labels.rotation,T(e,(function(t,e){b(t)&&a(n,e,t)})),g(this,"afterInit")},t.prototype.setOptions=function(e){this.options=M(t.defaultOptions,"yAxis"===this.coll&&t.defaultYAxisOptions,[t.defaultTopAxisOptions,t.defaultRightAxisOptions,t.defaultBottomAxisOptions,t.defaultLeftAxisOptions][this.side],M(R[this.coll],e)),g(this,"afterSetOptions",{userOptions:e})},t.prototype.defaultLabelFormatter=function(){var t=this.axis,e=w(this.value)?this.value:NaN,i=t.chart.time,n=t.categories,r=this.dateTimeLabelFormat,o=R.lang,s=o.numericSymbols;o=o.numericSymbolMagnitude||1e3;var a=s&&s.length,l=t.options.labels.format;t=t.logarithmic?Math.abs(e):t.tickInterval;var c=this.chart,h=c.numberFormatter;if(l)var u=v(l,this,c);else if(n)u=""+this.value;else if(r)u=i.dateFormat(r,e);else if(a&&1e3<=t)for(;a--&&"undefined"===typeof u;)i=Math.pow(o,a+1),t>=i&&0===10*e%i&&null!==s[a]&&0!==e&&(u=h(e/i,-1)+s[a]);return"undefined"===typeof u&&(u=1e4<=Math.abs(e)?h(e,-1):h(e,-1,void 0,"")),u},t.prototype.getSeriesExtremes=function(){var t,e=this,i=e.chart;g(this,"getSeriesExtremes",null,(function(){e.hasVisibleSeries=!1,e.dataMin=e.dataMax=e.threshold=null,e.softThreshold=!e.isXAxis,e.stacking&&e.stacking.buildStacks(),e.series.forEach((function(n){if(n.visible||!i.options.chart.ignoreHiddenSeries){var r=n.options,o=r.threshold;if(e.hasVisibleSeries=!0,e.positiveValuesOnly&&0>=o&&(o=null),e.isXAxis){if(r=n.xData,r.length){r=e.logarithmic?r.filter(e.validatePositiveValue):r,t=n.getXExtremes(r);var s=t.min,a=t.max;w(s)||s instanceof Date||(r=r.filter(w),t=n.getXExtremes(r),s=t.min,a=t.max),r.length&&(e.dataMin=Math.min(E(e.dataMin,s),s),e.dataMax=Math.max(E(e.dataMax,a),a))}}else n=n.applyExtremes(),w(n.dataMin)&&(s=n.dataMin,e.dataMin=Math.min(E(e.dataMin,s),s)),w(n.dataMax)&&(a=n.dataMax,e.dataMax=Math.max(E(e.dataMax,a),a)),d(o)&&(e.threshold=o),(!r.softThreshold||e.positiveValuesOnly)&&(e.softThreshold=!1)}}))})),g(this,"afterGetSeriesExtremes")},t.prototype.translate=function(t,e,i,n,r,o){var s=this.linkedParent||this,a=1,l=0,c=n?s.oldTransA:s.transA;n=n?s.oldMin:s.min;var h=s.minPixelPadding;return r=(s.isOrdinal||s.brokenAxis&&s.brokenAxis.hasBreaks||s.logarithmic&&r)&&s.lin2val,c||(c=s.transA),i&&(a*=-1,l=s.len),s.reversed&&(a*=-1,l-=a*(s.sector||s.len)),e?(t=(t*a+l-h)/c+n,r&&(t=s.lin2val(t))):(r&&(t=s.val2lin(t)),t=w(n)?a*(t-n)*c+l+a*h+(w(o)?c*o:0):void 0),t},t.prototype.toPixels=function(t,e){return this.translate(t,!1,!this.horiz,null,!0)+(e?0:this.pos)},t.prototype.toValue=function(t,e){return this.translate(t-(e?0:this.pos),!0,!this.horiz,null,!0)},t.prototype.getPlotLinePath=function(t){function e(t,e,i){return("pass"!==v&&t<e||t>i)&&(v?t=h(t,e,i):s=!0),t}var i,n,r,o,s,a=this,l=a.chart,c=a.left,u=a.top,d=t.old,p=t.value,f=t.translatedValue,m=t.lineWidth,v=t.force,y=d&&l.oldChartHeight||l.chartHeight,x=d&&l.oldChartWidth||l.chartWidth,b=a.transB;return t={value:p,lineWidth:m,old:d,force:v,acrossPanes:t.acrossPanes,translatedValue:f},g(this,"getPlotLinePath",t,(function(t){f=E(f,a.translate(p,null,null,d)),f=h(f,-1e5,1e5),i=r=Math.round(f+b),n=o=Math.round(y-f-b),w(f)?a.horiz?(n=u,o=y-a.bottom,i=r=e(i,c,c+a.width)):(i=c,r=x-a.right,n=o=e(n,u,u+a.height)):(s=!0,v=!1),t.path=s&&!v?null:l.renderer.crispLine([["M",i,n],["L",r,o]],m||1)})),t.path},t.prototype.getLinearTickPositions=function(t,e,i){var n=u(Math.floor(e/t)*t);i=u(Math.ceil(i/t)*t);var r,o=[];if(u(n+t)===n&&(r=20),this.single)return[e];for(e=n;e<=i;){if(o.push(e),e=u(e+t,r),e===s)break;var s=e}return o},t.prototype.getMinorTickInterval=function(){var t=this.options;return!0===t.minorTicks?E(t.minorTickInterval,"auto"):!1===t.minorTicks?null:t.minorTickInterval},t.prototype.getMinorTickPositions=function(){var t=this.options,e=this.tickPositions,i=this.minorTickInterval,n=[],r=this.pointRangePadding||0,o=this.min-r;r=this.max+r;var s=r-o;if(s&&s/i<this.len/3){var a=this.logarithmic;if(a)this.paddedTicks.forEach((function(t,e,r){e&&n.push.apply(n,a.getLogTickPositions(i,r[e-1],r[e],!0))}));else if(this.dateTime&&"auto"===this.getMinorTickInterval())n=n.concat(this.getTimeTicks(this.dateTime.normalizeTimeTickInterval(i),o,r,t.startOfWeek));else for(t=o+(e[0]-o)%i;t<=r&&t!==n[0];t+=i)n.push(t)}return 0!==n.length&&this.trimTicks(n),n},t.prototype.adjustForMinRange=function(){var t,e,i,n,r=this.options,o=this.min,s=this.max,a=this.logarithmic;if(this.isXAxis&&"undefined"===typeof this.minRange&&!a&&(d(r.min)||d(r.max)?this.minRange=null:(this.series.forEach((function(r){for(n=r.xData,e=r.xIncrement?1:n.length-1;0<e;e--)i=n[e]-n[e-1],("undefined"===typeof t||i<t)&&(t=i)})),this.minRange=Math.min(5*t,this.dataMax-this.dataMin))),s-o<this.minRange){var h=this.dataMax-this.dataMin>=this.minRange,u=this.minRange,p=(u-s+o)/2;p=[o-p,E(r.min,o-p)],h&&(p[2]=this.logarithmic?this.logarithmic.log2lin(this.dataMin):this.dataMin),o=l(p),s=[o+u,E(r.max,o+u)],h&&(s[2]=a?a.log2lin(this.dataMax):this.dataMax),s=c(s),s-o<u&&(p[0]=s-u,p[1]=E(r.min,s-u),o=l(p))}this.min=o,this.max=s},t.prototype.getClosest=function(){var t;return this.categories?t=1:this.series.forEach((function(e){var i=e.closestPointRange,n=e.visible||!e.chart.options.chart.ignoreHiddenSeries;!e.noSharedTooltip&&d(i)&&n&&(t=d(t)?Math.min(t,i):i)})),t},t.prototype.nameToX=function(t){var e=x(this.categories),i=e?this.categories:this.names,n=t.options.x;if(t.series.requireSorting=!1,d(n)||(n=!1===this.options.uniqueNames?t.series.autoIncrement():e?i.indexOf(t.name):E(i.keys[t.name],-1)),-1===n){if(!e)var r=i.length}else r=n;return"undefined"!==typeof r&&(this.names[r]=t.name,this.names.keys[t.name]=r),r},t.prototype.updateNames=function(){var t=this,e=this.names;0<e.length&&(Object.keys(e.keys).forEach((function(t){delete e.keys[t]})),e.length=0,this.minRange=this.userMinRange,(this.series||[]).forEach((function(e){e.xIncrement=null,e.points&&!e.isDirtyData||(t.max=Math.max(t.max,e.xData.length-1),e.processData(),e.generatePoints()),e.data.forEach((function(i,n){if(i&&i.options&&"undefined"!==typeof i.name){var r=t.nameToX(i);"undefined"!==typeof r&&r!==i.x&&(i.x=r,e.xData[n]=r)}}))})))},t.prototype.setAxisTranslation=function(t){var e=this,i=e.max-e.min,n=e.axisPointRange||0,r=0,o=0,s=e.linkedParent,a=!!e.categories,l=e.transA,c=e.isXAxis;if(c||a||n){var h=e.getClosest();s?(r=s.minPointOffset,o=s.pointRangePadding):e.series.forEach((function(t){var i=a?1:c?E(t.options.pointRange,h,0):e.axisPointRange||0,s=t.options.pointPlacement;n=Math.max(n,i),e.single&&!a||(t=t.is("xrange")?!c:c,r=Math.max(r,t&&_(s)?0:i/2),o=Math.max(o,t&&"on"===s?0:i))})),s=e.ordinal&&e.ordinal.slope&&h?e.ordinal.slope/h:1,e.minPointOffset=r*=s,e.pointRangePadding=o*=s,e.pointRange=Math.min(n,e.single&&a?1:i),c&&(e.closestPointRange=h)}t&&(e.oldTransA=l),e.translationSlope=e.transA=l=e.staticScale||e.len/(i+o||1),e.transB=e.horiz?e.left:e.bottom,e.minPixelPadding=l*r,g(this,"afterSetAxisTranslation")},t.prototype.minFromRange=function(){return this.max-this.range},t.prototype.setTickInterval=function(t){var e=this,i=e.chart,n=e.logarithmic,r=e.options,o=e.isXAxis,s=e.isLinked,a=r.maxPadding,l=r.minPadding,c=r.tickInterval,h=r.tickPixelInterval,p=e.categories,m=w(e.threshold)?e.threshold:null,v=e.softThreshold;e.dateTime||p||s||this.getTickAmount();var x=E(e.userMin,r.min),b=E(e.userMax,r.max);if(s){e.linkedParent=i[e.coll][r.linkedTo];var _=e.linkedParent.getExtremes();e.min=E(_.min,_.dataMin),e.max=E(_.max,_.dataMax),r.type!==e.linkedParent.options.type&&f(11,1,i)}else{if(v&&d(m))if(e.dataMin>=m)_=m,l=0;else if(e.dataMax<=m){var M=m;a=0}e.min=E(x,_,e.dataMin),e.max=E(b,M,e.dataMax)}n&&(e.positiveValuesOnly&&!t&&0>=Math.min(e.min,E(e.dataMin,e.min))&&f(10,1,i),e.min=u(n.log2lin(e.min),16),e.max=u(n.log2lin(e.max),16)),e.range&&d(e.max)&&(e.userMin=e.min=x=Math.max(e.dataMin,e.minFromRange()),e.userMax=b=e.max,e.range=null),g(e,"foundExtremes"),e.beforePadding&&e.beforePadding(),e.adjustForMinRange(),!(p||e.axisPointRange||e.stacking&&e.stacking.usePercentage||s)&&d(e.min)&&d(e.max)&&(i=e.max-e.min)&&(!d(x)&&l&&(e.min-=i*l),!d(b)&&a&&(e.max+=i*a)),w(e.userMin)||(w(r.softMin)&&r.softMin<e.min&&(e.min=x=r.softMin),w(r.floor)&&(e.min=Math.max(e.min,r.floor))),w(e.userMax)||(w(r.softMax)&&r.softMax>e.max&&(e.max=b=r.softMax),w(r.ceiling)&&(e.max=Math.min(e.max,r.ceiling))),v&&d(e.dataMin)&&(m=m||0,!d(x)&&e.min<m&&e.dataMin>=m?e.min=e.options.minRange?Math.min(m,e.max-e.minRange):m:!d(b)&&e.max>m&&e.dataMax<=m&&(e.max=e.options.minRange?Math.max(m,e.min+e.minRange):m)),e.tickInterval=e.min===e.max||"undefined"===typeof e.min||"undefined"===typeof e.max?1:s&&!c&&h===e.linkedParent.options.tickPixelInterval?c=e.linkedParent.tickInterval:E(c,this.tickAmount?(e.max-e.min)/Math.max(this.tickAmount-1,1):void 0,p?1:(e.max-e.min)*h/Math.max(e.len,h)),o&&!t&&e.series.forEach((function(t){t.processData(e.min!==e.oldMin||e.max!==e.oldMax)})),e.setAxisTranslation(!0),g(this,"initialAxisTranslation"),e.pointRange&&!c&&(e.tickInterval=Math.max(e.pointRange,e.tickInterval)),t=E(r.minTickInterval,e.dateTime&&!e.series.some((function(t){return t.noSharedTooltip}))?e.closestPointRange:0),!c&&e.tickInterval<t&&(e.tickInterval=t),e.dateTime||e.logarithmic||c||(e.tickInterval=S(e.tickInterval,void 0,y(e.tickInterval),E(r.allowDecimals,.5>e.tickInterval||void 0!==this.tickAmount),!!this.tickAmount)),this.tickAmount||(e.tickInterval=e.unsquish()),this.setTickPositions()},t.prototype.setTickPositions=function(){var t=this.options,e=t.tickPositions,i=this.getMinorTickInterval(),n=t.tickPositioner,r=this.hasVerticalPanning(),o="colorAxis"===this.coll,s=(o||!r)&&t.startOnTick;r=(o||!r)&&t.endOnTick,this.tickmarkOffset=this.categories&&"between"===t.tickmarkPlacement&&1===this.tickInterval?.5:0,this.minorTickInterval="auto"===i&&this.tickInterval?this.tickInterval/5:i,this.single=this.min===this.max&&d(this.min)&&!this.tickAmount&&(parseInt(this.min,10)===this.min||!1!==t.allowDecimals),this.tickPositions=i=e&&e.slice(),!i&&(this.ordinal&&this.ordinal.positions||!((this.max-this.min)/this.tickInterval>Math.max(2*this.len,200))?i=this.dateTime?this.getTimeTicks(this.dateTime.normalizeTimeTickInterval(this.tickInterval,t.units),this.min,this.max,t.startOfWeek,this.ordinal&&this.ordinal.positions,this.closestPointRange,!0):this.logarithmic?this.logarithmic.getLogTickPositions(this.tickInterval,this.min,this.max):this.getLinearTickPositions(this.tickInterval,this.min,this.max):(i=[this.min,this.max],f(19,!1,this.chart)),i.length>this.len&&(i=[i[0],i.pop()],i[0]===i[1]&&(i.length=1)),this.tickPositions=i,n&&(n=n.apply(this,[this.min,this.max])))&&(this.tickPositions=i=n),this.paddedTicks=i.slice(0),this.trimTicks(i,s,r),this.isLinked||(this.single&&2>i.length&&!this.categories&&!this.series.some((function(t){return t.is("heatmap")&&"between"===t.options.pointPlacement}))&&(this.min-=.5,this.max+=.5),e||n||this.adjustTickAmount()),g(this,"afterSetTickPositions")},t.prototype.trimTicks=function(t,e,i){var n=t[0],r=t[t.length-1],o=!this.isOrdinal&&this.minPointOffset||0;if(g(this,"trimTicks"),!this.isLinked){if(e&&-1/0!==n)this.min=n;else for(;this.min-o>t[0];)t.shift();if(i)this.max=r;else for(;this.max+o<t[t.length-1];)t.pop();0===t.length&&d(n)&&!this.options.tickPositions&&t.push((r+n)/2)}},t.prototype.alignToOthers=function(){var t,e={},i=this.options;return!1===this.chart.options.chart.alignTicks||!1===i.alignTicks||!1===i.startOnTick||!1===i.endOnTick||this.logarithmic||this.chart[this.coll].forEach((function(i){var n=i.options;n=[i.horiz?n.left:n.top,n.width,n.height,n.pane].join(),i.series.length&&(e[n]?t=!0:e[n]=1)})),t},t.prototype.getTickAmount=function(){var t=this.options,e=t.tickAmount,i=t.tickPixelInterval;!d(t.tickInterval)&&!e&&this.len<i&&!this.isRadial&&!this.logarithmic&&t.startOnTick&&t.endOnTick&&(e=2),!e&&this.alignToOthers()&&(e=Math.ceil(this.len/i)+1),4>e&&(this.finalTickAmt=e,e=5),this.tickAmount=e},t.prototype.adjustTickAmount=function(){var t,e=this.options,i=this.tickInterval,n=this.tickPositions,r=this.tickAmount,o=this.finalTickAmt,s=n&&n.length,a=E(this.threshold,this.softThreshold?0:null);if(this.hasData()){if(s<r){for(t=this.min;n.length<r;)n.length%2||t===a?n.push(u(n[n.length-1]+i)):n.unshift(u(n[0]-i));this.transA*=(s-1)/(r-1),this.min=e.startOnTick?n[0]:Math.min(this.min,n[0]),this.max=e.endOnTick?n[n.length-1]:Math.max(this.max,n[n.length-1])}else s>r&&(this.tickInterval*=2,this.setTickPositions());if(d(o)){for(i=e=n.length;i--;)(3===o&&1===i%2||2>=o&&0<i&&i<e-1)&&n.splice(i,1);this.finalTickAmt=void 0}}},t.prototype.setScale=function(){var t,e=!1,i=!1;this.series.forEach((function(t){var n;e=e||t.isDirtyData||t.isDirty,i=i||(null===(n=t.xAxis)||void 0===n?void 0:n.isDirty)||!1})),this.oldMin=this.min,this.oldMax=this.max,this.oldAxisLength=this.len,this.setAxisSize(),(t=this.len!==this.oldAxisLength)||e||i||this.isLinked||this.forceRedraw||this.userMin!==this.oldUserMin||this.userMax!==this.oldUserMax||this.alignToOthers()?(this.stacking&&this.stacking.resetStacks(),this.forceRedraw=!1,this.getSeriesExtremes(),this.setTickInterval(),this.oldUserMin=this.userMin,this.oldUserMax=this.userMax,this.isDirty||(this.isDirty=t||this.min!==this.oldMin||this.max!==this.oldMax)):this.stacking&&this.stacking.cleanStacks(),e&&this.panningState&&(this.panningState.isDirty=!0),g(this,"afterSetScale")},t.prototype.setExtremes=function(t,e,i,n,r){var o=this,s=o.chart;i=E(i,!0),o.series.forEach((function(t){delete t.kdTree})),r=m(r,{min:t,max:e}),g(o,"setExtremes",r,(function(){o.userMin=t,o.userMax=e,o.eventArgs=r,i&&s.redraw(n)}))},t.prototype.zoom=function(t,e){var i=this,n=this.dataMin,r=this.dataMax,o=this.options,s=Math.min(n,E(o.min,n)),a=Math.max(r,E(o.max,r));return t={newMin:t,newMax:e},g(this,"zoom",t,(function(t){var e=t.newMin,o=t.newMax;e===i.min&&o===i.max||(i.allowZoomOutside||(d(n)&&(e<s&&(e=s),e>a&&(e=a)),d(r)&&(o<s&&(o=s),o>a&&(o=a))),i.displayBtn="undefined"!==typeof e||"undefined"!==typeof o,i.setExtremes(e,o,!1,void 0,{trigger:"zoom"})),t.zoomed=!0})),t.zoomed},t.prototype.setAxisSize=function(){var t=this.chart,e=this.options,i=e.offsets||[0,0,0,0],n=this.horiz,r=this.width=Math.round(A(E(e.width,t.plotWidth-i[3]+i[1]),t.plotWidth)),o=this.height=Math.round(A(E(e.height,t.plotHeight-i[0]+i[2]),t.plotHeight)),s=this.top=Math.round(A(E(e.top,t.plotTop+i[0]),t.plotHeight,t.plotTop));e=this.left=Math.round(A(E(e.left,t.plotLeft+i[3]),t.plotWidth,t.plotLeft)),this.bottom=t.chartHeight-o-s,this.right=t.chartWidth-r-e,this.len=Math.max(n?r:o,0),this.pos=n?e:s},t.prototype.getExtremes=function(){var t=this.logarithmic;return{min:t?u(t.lin2log(this.min)):this.min,max:t?u(t.lin2log(this.max)):this.max,dataMin:this.dataMin,dataMax:this.dataMax,userMin:this.userMin,userMax:this.userMax}},t.prototype.getThreshold=function(t){var e=this.logarithmic,i=e?e.lin2log(this.min):this.min;return e=e?e.lin2log(this.max):this.max,null===t||-1/0===t?t=i:1/0===t?t=e:i>t?t=i:e<t&&(t=e),this.translate(t,0,1,0,1)},t.prototype.autoLabelAlign=function(t){var e=(E(t,0)-90*this.side+720)%360;return t={align:"center"},g(this,"autoLabelAlign",t,(function(t){15<e&&165>e?t.align="right":195<e&&345>e&&(t.align="left")})),t.align},t.prototype.tickSize=function(t){var e=this.options,i=e["tick"===t?"tickLength":"minorTickLength"],n=E(e["tick"===t?"tickWidth":"minorTickWidth"],"tick"===t&&this.isXAxis&&!this.categories?1:0);if(n&&i){"inside"===e[t+"Position"]&&(i=-i);var r=[i,n]}return t={tickSize:r},g(this,"afterTickSize",t),t.tickSize},t.prototype.labelMetrics=function(){var t=this.tickPositions&&this.tickPositions[0]||0;return this.chart.renderer.fontMetrics(this.options.labels.style&&this.options.labels.style.fontSize,this.ticks[t]&&this.ticks[t].label)},t.prototype.unsquish=function(){var t,e,i,n=this.options.labels,r=this.horiz,o=this.tickInterval,s=o,a=this.len/(((this.categories?1:0)+this.max-this.min)/o),l=n.rotation,c=this.labelMetrics(),h=Number.MAX_VALUE,p=this.max-this.min,f=function(t){var e=t/(a||1);return e=1<e?Math.ceil(e):1,e*o>p&&1/0!==t&&1/0!==a&&p&&(e=Math.ceil(p/o)),u(e*o)};return r?(i=!n.staggerLines&&!n.step&&(d(l)?[l]:a<E(n.autoRotationLimit,80)&&n.autoRotation))&&i.forEach((function(i){if(i===l||i&&-90<=i&&90>=i){e=f(Math.abs(c.h/Math.sin(O*i)));var n=e+Math.abs(i/360);n<h&&(h=n,t=i,s=e)}})):n.step||(s=f(c.h)),this.autoRotation=i,this.labelRotation=E(t,l),s},t.prototype.getSlotWidth=function(t){var e,i=this.chart,n=this.horiz,r=this.options.labels,o=Math.max(this.tickPositions.length-(this.categories?0:1),1),s=i.margin[3];if(t&&w(t.slotWidth))return t.slotWidth;if(n&&r&&2>(r.step||0))return r.rotation?0:(this.staggerLines||1)*this.len/o;if(!n){if(t=null===(e=null===r||void 0===r?void 0:r.style)||void 0===e?void 0:e.width,void 0!==t)return parseInt(t,10);if(s)return s-i.spacing[3]}return.33*i.chartWidth},t.prototype.renderUnsquish=function(){var t=this.chart,e=t.renderer,i=this.tickPositions,n=this.ticks,r=this.options.labels,o=r&&r.style||{},s=this.horiz,a=this.getSlotWidth(),l=Math.max(1,Math.round(a-2*(r.padding||5))),c={},h=this.labelMetrics(),u=r.style&&r.style.textOverflow,d=0;if(_(r.rotation)||(c.rotation=r.rotation||0),i.forEach((function(t){t=n[t],t.movedLabel&&t.replaceMovedLabel(),t&&t.label&&t.label.textPxLength>d&&(d=t.label.textPxLength)})),this.maxLabelLength=d,this.autoRotation)d>l&&d>h.h?c.rotation=this.labelRotation:this.labelRotation=0;else if(a){var p=l;if(!u){var f="clip";for(l=i.length;!s&&l--;){var m=i[l];(m=n[m].label)&&(m.styles&&"ellipsis"===m.styles.textOverflow?m.css({textOverflow:"clip"}):m.textPxLength>a&&m.css({width:a+"px"}),m.getBBox().height>this.len/i.length-(h.h-h.f)&&(m.specificTextOverflow="ellipsis"))}}}c.rotation&&(p=d>.5*t.chartHeight?.33*t.chartHeight:d,u||(f="ellipsis")),(this.labelAlign=r.align||this.autoLabelAlign(this.labelRotation))&&(c.align=this.labelAlign),i.forEach((function(t){var e=(t=n[t])&&t.label,i=o.width,r={};e&&(e.attr(c),t.shortenLabel?t.shortenLabel():p&&!i&&"nowrap"!==o.whiteSpace&&(p<e.textPxLength||"SPAN"===e.element.tagName)?(r.width=p+"px",u||(r.textOverflow=e.specificTextOverflow||f),e.css(r)):e.styles&&e.styles.width&&!r.width&&!i&&e.css({width:null}),delete e.specificTextOverflow,t.rotation=c.rotation)}),this),this.tickRotCorr=e.rotCorr(h.b,this.labelRotation||0,0!==this.side)},t.prototype.hasData=function(){return this.series.some((function(t){return t.hasData()}))||this.options.showEmpty&&d(this.min)&&d(this.max)},t.prototype.addTitle=function(t){var e,i=this.chart.renderer,n=this.horiz,r=this.opposite,o=this.options.title,s=this.chart.styledMode;this.axisTitle||((e=o.textAlign)||(e=(n?{low:"left",middle:"center",high:"right"}:{low:r?"right":"left",middle:"center",high:r?"left":"right"})[o.align]),this.axisTitle=i.text(o.text,0,0,o.useHTML).attr({zIndex:7,rotation:o.rotation||0,align:e}).addClass("highcharts-axis-title"),s||this.axisTitle.css(M(o.style)),this.axisTitle.add(this.axisGroup),this.axisTitle.isNew=!0),s||o.style.width||this.isRadial||this.axisTitle.css({width:this.len+"px"}),this.axisTitle[t?"show":"hide"](t)},t.prototype.generateTick=function(t){var e=this.ticks;e[t]?e[t].addLabel():e[t]=new n(this,t)},t.prototype.getOffset=function(){var t,e=this,i=e.chart,n=i.renderer,r=e.options,o=e.tickPositions,s=e.ticks,a=e.horiz,l=e.side,c=i.inverted&&!e.isZAxis?[1,0,3,2][l]:l,h=0,u=0,p=r.title,f=r.labels,m=0,v=i.axisOffset;i=i.clipOffset;var y=[-1,1,1,-1][l],x=r.className,b=e.axisParent,w=e.hasData();if(e.showAxis=t=w||E(r.showEmpty,!0),e.staggerLines=e.horiz&&f.staggerLines,e.axisGroup||(e.gridGroup=n.g("grid").attr({zIndex:r.gridZIndex||1}).addClass("highcharts-"+this.coll.toLowerCase()+"-grid "+(x||"")).add(b),e.axisGroup=n.g("axis").attr({zIndex:r.zIndex||2}).addClass("highcharts-"+this.coll.toLowerCase()+" "+(x||"")).add(b),e.labelGroup=n.g("axis-labels").attr({zIndex:f.zIndex||7}).addClass("highcharts-"+e.coll.toLowerCase()+"-labels "+(x||"")).add(b)),w||e.isLinked?(o.forEach((function(t,i){e.generateTick(t,i)})),e.renderUnsquish(),e.reserveSpaceDefault=0===l||2===l||{1:"left",3:"right"}[l]===e.labelAlign,E(f.reserveSpace,"center"===e.labelAlign||null,e.reserveSpaceDefault)&&o.forEach((function(t){m=Math.max(s[t].getLabelSize(),m)})),e.staggerLines&&(m*=e.staggerLines),e.labelOffset=m*(e.opposite?-1:1)):T(s,(function(t,e){t.destroy(),delete s[e]})),p&&p.text&&!1!==p.enabled&&(e.addTitle(t),t&&!1!==p.reserveSpace)){e.titleOffset=h=e.axisTitle.getBBox()[a?"height":"width"];var _=p.offset;u=d(_)?0:E(p.margin,a?5:10)}e.renderLine(),e.offset=y*E(r.offset,v[l]?v[l]+(r.margin||0):0),e.tickRotCorr=e.tickRotCorr||{x:0,y:0},n=0===l?-e.labelMetrics().h:2===l?e.tickRotCorr.y:0,u=Math.abs(m)+u,m&&(u=u-n+y*(a?E(f.y,e.tickRotCorr.y+8*y):f.x)),e.axisTitleMargin=E(_,u),e.getMaxLabelDimensions&&(e.maxLabelDimensions=e.getMaxLabelDimensions(s,o)),a=this.tickSize("tick"),v[l]=Math.max(v[l],e.axisTitleMargin+h+y*e.offset,u,o&&o.length&&a?a[0]+y*e.offset:0),r=r.offset?0:2*Math.floor(e.axisLine.strokeWidth()/2),i[c]=Math.max(i[c],r),g(this,"afterGetOffset")},t.prototype.getLinePath=function(t){var e=this.chart,i=this.opposite,n=this.offset,r=this.horiz,o=this.left+(i?this.width:0)+n;return n=e.chartHeight-this.bottom-(i?this.height:0)+n,i&&(t*=-1),e.renderer.crispLine([["M",r?this.left:o,r?n:this.top],["L",r?e.chartWidth-this.right:o,r?n:e.chartHeight-this.bottom]],t)},t.prototype.renderLine=function(){this.axisLine||(this.axisLine=this.chart.renderer.path().addClass("highcharts-axis-line").add(this.axisGroup),this.chart.styledMode||this.axisLine.attr({stroke:this.options.lineColor,"stroke-width":this.options.lineWidth,zIndex:7}))},t.prototype.getTitlePosition=function(){var t=this.horiz,e=this.left,i=this.top,n=this.len,r=this.options.title,o=t?e:i,s=this.opposite,a=this.offset,l=r.x||0,c=r.y||0,h=this.axisTitle,u=this.chart.renderer.fontMetrics(r.style&&r.style.fontSize,h);return h=Math.max(h.getBBox(null,0).height-u.h-1,0),n={low:o+(t?0:n),middle:o+n/2,high:o+(t?n:0)}[r.align],e=(t?i+this.height:e)+(t?1:-1)*(s?-1:1)*this.axisTitleMargin+[-h,h,u.f,-h][this.side],t={x:t?n+l:e+(s?this.width:0)+a+l,y:t?e+c-(s?this.height:0)+a:n+c},g(this,"afterGetTitlePosition",{titlePosition:t}),t},t.prototype.renderMinorTick=function(t){var e=this.chart.hasRendered&&w(this.oldMin),i=this.minorTicks;i[t]||(i[t]=new n(this,t,"minor")),e&&i[t].isNew&&i[t].render(null,!0),i[t].render(null,!1,1)},t.prototype.renderTick=function(t,e){var i,r=this.isLinked,o=this.ticks,s=this.chart.hasRendered&&w(this.oldMin);(!r||t>=this.min&&t<=this.max||null!==(i=this.grid)&&void 0!==i&&i.isColumn)&&(o[t]||(o[t]=new n(this,t)),s&&o[t].isNew&&o[t].render(e,!0,-1),o[t].render(e))},t.prototype.render=function(){var t,e,r=this,o=r.chart,a=r.logarithmic,l=r.options,c=r.isLinked,h=r.tickPositions,u=r.axisTitle,d=r.ticks,p=r.minorTicks,f=r.alternateBands,m=l.stackLabels,v=l.alternateGridColor,y=r.tickmarkOffset,x=r.axisLine,b=r.showAxis,_=s(o.renderer.globalAnimation);r.labelEdge.length=0,r.overlap=!1,[d,p,f].forEach((function(t){T(t,(function(t){t.isActive=!1}))})),(r.hasData()||c)&&(r.minorTickInterval&&!r.categories&&r.getMinorTickPositions().forEach((function(t){r.renderMinorTick(t)})),h.length&&(h.forEach((function(t,e){r.renderTick(t,e)})),y&&(0===r.min||r.single)&&(d[-1]||(d[-1]=new n(r,-1,null,!0)),d[-1].render(-1))),v&&h.forEach((function(n,s){e="undefined"!==typeof h[s+1]?h[s+1]+y:r.max-y,0===s%2&&n<r.max&&e<=r.max+(o.polar?-y:y)&&(f[n]||(f[n]=new i.PlotLineOrBand(r)),t=n+y,f[n].options={from:a?a.lin2log(t):t,to:a?a.lin2log(e):e,color:v,className:"highcharts-alternate-grid"},f[n].render(),f[n].isActive=!0)})),r._addedPlotLB||((l.plotLines||[]).concat(l.plotBands||[]).forEach((function(t){r.addPlotBandOrLine(t)})),r._addedPlotLB=!0)),[d,p,f].forEach((function(t){var e,i=[],n=_.duration;T(t,(function(t,e){t.isActive||(t.render(e,!1,0),t.isActive=!1,i.push(e))})),P((function(){for(e=i.length;e--;)t[i[e]]&&!t[i[e]].isActive&&(t[i[e]].destroy(),delete t[i[e]])}),t!==f&&o.hasRendered&&n?n:0)})),x&&(x[x.isPlaced?"animate":"attr"]({d:this.getLinePath(x.strokeWidth())}),x.isPlaced=!0,x[b?"show":"hide"](b)),u&&b&&(l=r.getTitlePosition(),w(l.y)?(u[u.isNew?"attr":"animate"](l),u.isNew=!1):(u.attr("y",-9999),u.isNew=!0)),m&&m.enabled&&r.stacking&&r.stacking.renderStackTotals(),r.isDirty=!1,g(this,"afterRender")},t.prototype.redraw=function(){this.visible&&(this.render(),this.plotLinesAndBands.forEach((function(t){t.render()}))),this.series.forEach((function(t){t.isDirty=!0}))},t.prototype.getKeepProps=function(){return this.keepProps||t.keepProps},t.prototype.destroy=function(t){var e,i=this,n=i.plotLinesAndBands;if(g(this,"destroy",{keepEvents:t}),t||L(i),[i.ticks,i.minorTicks,i.alternateBands].forEach((function(t){p(t)})),n)for(t=n.length;t--;)n[t].destroy();for(e in"axisLine axisTitle axisGroup gridGroup labelGroup cross scrollbar".split(" ").forEach((function(t){i[t]&&(i[t]=i[t].destroy())})),i.plotLinesAndBandsGroups)i.plotLinesAndBandsGroups[e]=i.plotLinesAndBandsGroups[e].destroy();T(i,(function(t,e){-1===i.getKeepProps().indexOf(e)&&delete i[e]}))},t.prototype.drawCrosshair=function(t,i){var n,r=this.crosshair,o=E(r.snap,!0),s=this.cross,a=this.chart;if(g(this,"drawCrosshair",{e:t,point:i}),t||(t=this.cross&&this.cross.e),this.crosshair&&!1!==(d(i)||!o)){if(o?d(i)&&(n=E("colorAxis"!==this.coll?i.crosshairPos:null,this.isXAxis?i.plotX:this.len-i.plotY)):n=t&&(this.horiz?t.chartX-this.pos:this.len-t.chartY+this.pos),d(n)){var l={value:i&&(this.isXAxis?i.x:E(i.stackY,i.y)),translatedValue:n};a.polar&&m(l,{isCrosshair:!0,chartX:t&&t.chartX,chartY:t&&t.chartY,point:i}),l=this.getPlotLinePath(l)||null}if(!d(l))return void this.hideCrosshair();o=this.categories&&!this.isRadial,s||(this.cross=s=a.renderer.path().addClass("highcharts-crosshair highcharts-crosshair-"+(o?"category ":"thin ")+r.className).attr({zIndex:E(r.zIndex,2)}).add(),a.styledMode||(s.attr({stroke:r.color||(o?e.parse("#ccd6eb").setOpacity(.25).get():"#cccccc"),"stroke-width":E(r.width,1)}).css({"pointer-events":"none"}),r.dashStyle&&s.attr({dashstyle:r.dashStyle}))),s.show().attr({d:l}),o&&!r.width&&s.attr({"stroke-width":this.transA}),this.cross.e=t}else this.hideCrosshair();g(this,"afterDrawCrosshair",{e:t,point:i})},t.prototype.hideCrosshair=function(){this.cross&&this.cross.hide(),g(this,"afterHideCrosshair")},t.prototype.hasVerticalPanning=function(){var t,e;return/y/.test((null===(e=null===(t=this.chart.options.chart)||void 0===t?void 0:t.panning)||void 0===e?void 0:e.type)||"")},t.prototype.validatePositiveValue=function(t){return w(t)&&0<t},t.defaultOptions={dateTimeLabelFormats:{millisecond:{main:"%H:%M:%S.%L",range:!1},second:{main:"%H:%M:%S",range:!1},minute:{main:"%H:%M",range:!1},hour:{main:"%H:%M",range:!1},day:{main:"%e. %b"},week:{main:"%e. %b"},month:{main:"%b '%y"},year:{main:"%Y"}},endOnTick:!1,labels:{enabled:!0,indentation:10,x:0,style:{color:"#666666",cursor:"default",fontSize:"11px"}},maxPadding:.01,minorTickLength:2,minorTickPosition:"outside",minPadding:.01,showEmpty:!0,startOfWeek:1,startOnTick:!1,tickLength:10,tickPixelInterval:100,tickmarkPlacement:"between",tickPosition:"outside",title:{align:"middle",style:{color:"#666666"}},type:"linear",minorGridLineColor:"#f2f2f2",minorGridLineWidth:1,minorTickColor:"#999999",lineColor:"#ccd6eb",lineWidth:1,gridLineColor:"#e6e6e6",tickColor:"#ccd6eb"},t.defaultYAxisOptions={endOnTick:!0,maxPadding:.05,minPadding:.05,tickPixelInterval:72,showLastLabel:!0,labels:{x:-8},startOnTick:!0,title:{rotation:270,text:"Values"},stackLabels:{animation:{},allowOverlap:!1,enabled:!1,crop:!0,overflow:"justify",formatter:function(){var t=this.axis.chart.numberFormatter;return t(this.total,-1)},style:{color:"#000000",fontSize:"11px",fontWeight:"bold",textOutline:"1px contrast"}},gridLineWidth:1,lineWidth:0},t.defaultLeftAxisOptions={labels:{x:-15},title:{rotation:270}},t.defaultRightAxisOptions={labels:{x:15},title:{rotation:90}},t.defaultBottomAxisOptions={labels:{autoRotation:[-45],x:0},margin:15,title:{rotation:0}},t.defaultTopAxisOptions={labels:{autoRotation:[-45],x:0},margin:15,title:{rotation:0}},t.keepProps="extKey hcEvents names series userMax userMin".split(" "),t}(),i.Axis=t,i.Axis})),e(i,"Core/Axis/DateTimeAxis.js",[i["Core/Axis/Axis.js"],i["Core/Utilities.js"]],(function(t,e){var i=e.addEvent,n=e.getMagnitude,r=e.normalizeTickInterval,o=e.timeUnits,s=function(){function t(t){this.axis=t}return t.prototype.normalizeTimeTickInterval=function(t,e){var i=e||[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1,2]],["week",[1,2]],["month",[1,2,3,4,6]],["year",null]];e=i[i.length-1];var s,a=o[e[0]],l=e[1];for(s=0;s<i.length&&(e=i[s],a=o[e[0]],l=e[1],!(i[s+1]&&t<=(a*l[l.length-1]+o[i[s+1][0]])/2));s++);return a===o.year&&t<5*a&&(l=[1,2,5]),t=r(t/a,l,"year"===e[0]?Math.max(n(t/a),1):1),{unitRange:a,count:t,unitName:e[0]}},t}();return e=function(){function t(){}return t.compose=function(t){t.keepProps.push("dateTime"),t.prototype.getTimeTicks=function(){return this.chart.time.getTimeTicks.apply(this.chart.time,arguments)},i(t,"init",(function(t){"datetime"!==t.userOptions.type?this.dateTime=void 0:this.dateTime||(this.dateTime=new s(this))}))},t.AdditionsClass=s,t}(),e.compose(t),e})),e(i,"Core/Axis/LogarithmicAxis.js",[i["Core/Axis/Axis.js"],i["Core/Utilities.js"]],(function(t,e){var i=e.addEvent,n=e.getMagnitude,r=e.normalizeTickInterval,o=e.pick,s=function(){function t(t){this.axis=t}return t.prototype.getLogTickPositions=function(t,e,i,s){var a=this.axis,l=a.len,c=a.options,h=[];if(s||(this.minorAutoInterval=void 0),.5<=t)t=Math.round(t),h=a.getLinearTickPositions(t,e,i);else if(.08<=t){var u,d;for(c=Math.floor(e),l=.3<t?[1,2,4]:.15<t?[1,2,4,6,8]:[1,2,3,4,5,6,7,8,9];c<i+1&&!d;c++){var p=l.length;for(u=0;u<p&&!d;u++){var f=this.log2lin(this.lin2log(c)*l[u]);f>e&&(!s||m<=i)&&"undefined"!==typeof m&&h.push(m),m>i&&(d=!0);var m=f}}}else e=this.lin2log(e),i=this.lin2log(i),t=s?a.getMinorTickInterval():c.tickInterval,t=o("auto"===t?null:t,this.minorAutoInterval,c.tickPixelInterval/(s?5:1)*(i-e)/((s?l/a.tickPositions.length:l)||1)),t=r(t,void 0,n(t)),h=a.getLinearTickPositions(t,e,i).map(this.log2lin),s||(this.minorAutoInterval=t/5);return s||(a.tickInterval=t),h},t.prototype.lin2log=function(t){return Math.pow(10,t)},t.prototype.log2lin=function(t){return Math.log(t)/Math.LN10},t}();return e=function(){function t(){}return t.compose=function(t){t.keepProps.push("logarithmic");var e=t.prototype,n=s.prototype;e.log2lin=n.log2lin,e.lin2log=n.lin2log,i(t,"init",(function(t){var e=this.logarithmic;"logarithmic"!==t.userOptions.type?this.logarithmic=void 0:(e||(e=this.logarithmic=new s(this)),this.log2lin!==e.log2lin&&(e.log2lin=this.log2lin.bind(this)),this.lin2log!==e.lin2log&&(e.lin2log=this.lin2log.bind(this)))})),i(t,"afterInit",(function(){var t=this.logarithmic;t&&(this.lin2val=function(e){return t.lin2log(e)},this.val2lin=function(e){return t.log2lin(e)})}))},t}(),e.compose(t),e})),e(i,"Core/Axis/PlotLineOrBand.js",[i["Core/Axis/Axis.js"],i["Core/Globals.js"],i["Core/Utilities.js"]],(function(t,e,i){var n=i.arrayMax,r=i.arrayMin,o=i.defined,s=i.destroyObjectProperties,a=i.erase,l=i.extend,c=i.merge,h=i.objectEach,u=i.pick;return i=function(){function t(t,e){this.axis=t,e&&(this.options=e,this.id=e.id)}return t.prototype.render=function(){e.fireEvent(this,"render");var t=this,i=t.axis,n=i.horiz,r=i.logarithmic,s=t.options,a=s.label,l=t.label,d=s.to,p=s.from,f=s.value,m=o(p)&&o(d),g=o(f),v=t.svgElem,y=!v,x=[],b=s.color,w=u(s.zIndex,0),_=s.events;x={class:"highcharts-plot-"+(m?"band ":"line ")+(s.className||"")};var M={},S=i.chart.renderer,T=m?"bands":"lines";if(r&&(p=r.log2lin(p),d=r.log2lin(d),f=r.log2lin(f)),i.chart.styledMode||(g?(x.stroke=b||"#999999",x["stroke-width"]=u(s.width,1),s.dashStyle&&(x.dashstyle=s.dashStyle)):m&&(x.fill=b||"#e6ebf5",s.borderWidth&&(x.stroke=s.borderColor,x["stroke-width"]=s.borderWidth))),M.zIndex=w,T+="-"+w,(r=i.plotLinesAndBandsGroups[T])||(i.plotLinesAndBandsGroups[T]=r=S.g("plot-"+T).attr(M).add()),y&&(t.svgElem=v=S.path().attr(x).add(r)),g)x=i.getPlotLinePath({value:f,lineWidth:v.strokeWidth(),acrossPanes:s.acrossPanes});else{if(!m)return;x=i.getPlotBandPath(p,d,s)}return!t.eventsAdded&&_&&(h(_,(function(e,i){v.on(i,(function(e){_[i].apply(t,[e])}))})),t.eventsAdded=!0),(y||!v.d)&&x&&x.length?v.attr({d:x}):v&&(x?(v.show(!0),v.animate({d:x})):v.d&&(v.hide(),l&&(t.label=l=l.destroy()))),a&&(o(a.text)||o(a.formatter))&&x&&x.length&&0<i.width&&0<i.height&&!x.isFlat?(a=c({align:n&&m&&"center",x:n?!m&&4:10,verticalAlign:!n&&m&&"middle",y:n?m?16:10:m?6:-4,rotation:n&&!m&&90},a),this.renderLabel(a,x,m,w)):l&&l.hide(),t},t.prototype.renderLabel=function(t,e,i,o){var s=this.label,a=this.axis.chart.renderer;s||(s={align:t.textAlign||t.align,rotation:t.rotation,class:"highcharts-plot-"+(i?"band":"line")+"-label "+(t.className||"")},s.zIndex=o,o=this.getLabelText(t),this.label=s=a.text(o,0,0,t.useHTML).attr(s).add(),this.axis.chart.styledMode||s.css(t.style)),a=e.xBounds||[e[0][1],e[1][1],i?e[2][1]:e[0][1]],e=e.yBounds||[e[0][2],e[1][2],i?e[2][2]:e[0][2]],i=r(a),o=r(e),s.align(t,!1,{x:i,y:o,width:n(a)-i,height:n(e)-o}),s.show(!0)},t.prototype.getLabelText=function(t){return o(t.formatter)?t.formatter.call(this):t.text},t.prototype.destroy=function(){a(this.axis.plotLinesAndBands,this),delete this.axis,s(this)},t}(),l(t.prototype,{getPlotBandPath:function(t,e,i){void 0===i&&(i=this.options);var n=this.getPlotLinePath({value:e,force:!0,acrossPanes:i.acrossPanes});i=this.getPlotLinePath({value:t,force:!0,acrossPanes:i.acrossPanes});var r=[],o=this.horiz,s=1;if(t=t<this.min&&e<this.min||t>this.max&&e>this.max,i&&n){if(t){var a=i.toString()===n.toString();s=0}for(t=0;t<i.length;t+=2){e=i[t];var l=i[t+1],c=n[t],h=n[t+1];"M"!==e[0]&&"L"!==e[0]||"M"!==l[0]&&"L"!==l[0]||"M"!==c[0]&&"L"!==c[0]||"M"!==h[0]&&"L"!==h[0]||(o&&c[1]===e[1]?(c[1]+=s,h[1]+=s):o||c[2]!==e[2]||(c[2]+=s,h[2]+=s),r.push(["M",e[1],e[2]],["L",l[1],l[2]],["L",h[1],h[2]],["L",c[1],c[2]],["Z"])),r.isFlat=a}}return r},addPlotBand:function(t){return this.addPlotBandOrLine(t,"plotBands")},addPlotLine:function(t){return this.addPlotBandOrLine(t,"plotLines")},addPlotBandOrLine:function(t,i){var n=new e.PlotLineOrBand(this,t),r=this.userOptions;if(this.visible&&(n=n.render()),n){if(i){var o=r[i]||[];o.push(t),r[i]=o}this.plotLinesAndBands.push(n),this._addedPlotLB=!0}return n},removePlotBandOrLine:function(t){for(var e=this.plotLinesAndBands,i=this.options,n=this.userOptions,r=e.length;r--;)e[r].id===t&&e[r].destroy();[i.plotLines||[],n.plotLines||[],i.plotBands||[],n.plotBands||[]].forEach((function(e){for(r=e.length;r--;)(e[r]||{}).id===t&&a(e,e[r])}))},removePlotBand:function(t){this.removePlotBandOrLine(t)},removePlotLine:function(t){this.removePlotBandOrLine(t)}}),e.PlotLineOrBand=i,e.PlotLineOrBand})),e(i,"Core/Tooltip.js",[i["Core/Globals.js"],i["Core/Utilities.js"]],(function(t,e){var i=t.doc,n=e.clamp,r=e.css,o=e.defined,s=e.discardElement,a=e.extend,l=e.fireEvent,c=e.format,h=e.isNumber,u=e.isString,d=e.merge,p=e.pick,f=e.splat,m=e.syncTimeout,g=e.timeUnits,v=function(){function v(t,e){this.container=void 0,this.crosshairs=[],this.distance=0,this.isHidden=!0,this.isSticky=!1,this.now={},this.options={},this.outside=!1,this.chart=t,this.init(t,e)}return v.prototype.applyFilter=function(){var t=this.chart;t.renderer.definition({tagName:"filter",id:"drop-shadow-"+t.index,opacity:.5,children:[{tagName:"feGaussianBlur",in:"SourceAlpha",stdDeviation:1},{tagName:"feOffset",dx:1,dy:1},{tagName:"feComponentTransfer",children:[{tagName:"feFuncA",type:"linear",slope:.3}]},{tagName:"feMerge",children:[{tagName:"feMergeNode"},{tagName:"feMergeNode",in:"SourceGraphic"}]}]}),t.renderer.definition({tagName:"style",textContent:".highcharts-tooltip-"+t.index+"{filter:url(#drop-shadow-"+t.index+")}"})},v.prototype.bodyFormatter=function(t){return t.map((function(t){var e=t.series.tooltipOptions;return(e[(t.point.formatPrefix||"point")+"Formatter"]||t.point.tooltipFormatter).call(t.point,e[(t.point.formatPrefix||"point")+"Format"]||"")}))},v.prototype.cleanSplit=function(t){this.chart.series.forEach((function(e){var i=e&&e.tt;i&&(!i.isActive||t?e.tt=i.destroy():i.isActive=!1)}))},v.prototype.defaultFormatter=function(t){var e=this.points||f(this),i=[t.tooltipFooterHeaderFormatter(e[0])];return i=i.concat(t.bodyFormatter(e)),i.push(t.tooltipFooterHeaderFormatter(e[0],!0)),i},v.prototype.destroy=function(){this.label&&(this.label=this.label.destroy()),this.split&&this.tt&&(this.cleanSplit(this.chart,!0),this.tt=this.tt.destroy()),this.renderer&&(this.renderer=this.renderer.destroy(),s(this.container)),e.clearTimeout(this.hideTimer),e.clearTimeout(this.tooltipTimeout)},v.prototype.getAnchor=function(t,e){var i,n,r=this.chart,o=r.pointer,s=r.inverted,a=r.plotTop,l=r.plotLeft,c=0,h=0;return t=f(t),this.followPointer&&e?("undefined"===typeof e.chartX&&(e=o.normalize(e)),t=[e.chartX-l,e.chartY-a]):t[0].tooltipPos?t=t[0].tooltipPos:(t.forEach((function(t){i=t.series.yAxis,n=t.series.xAxis,c+=t.plotX+(!s&&n?n.left-l:0),h+=(t.plotLow?(t.plotLow+t.plotHigh)/2:t.plotY)+(!s&&i?i.top-a:0)})),c/=t.length,h/=t.length,t=[s?r.plotWidth-h:c,this.shared&&!s&&1<t.length&&e?e.chartY-a:s?r.plotHeight-c:h]),t.map(Math.round)},v.prototype.getDateFormat=function(t,e,i,n){var r=this.chart.time,o=r.dateFormat("%m-%d %H:%M:%S.%L",e),s={millisecond:15,second:12,minute:9,hour:6,day:3},a="millisecond";for(l in g){if(t===g.week&&+r.dateFormat("%w",e)===i&&"00:00:00.000"===o.substr(6)){var l="week";break}if(g[l]>t){l=a;break}if(s[l]&&o.substr(s[l])!=="01-01 00:00:00.000".substr(s[l]))break;"week"!==l&&(a=l)}if(l)var c=r.resolveDTLFormat(n[l]).main;return c},v.prototype.getLabel=function(){var e,i,n,s=this,a=this.chart.renderer,l=this.chart.styledMode,c=this.options,h="tooltip"+(o(c.className)?" "+c.className:""),u=(null===(e=c.style)||void 0===e?void 0:e.pointerEvents)||(!this.followPointer&&c.stickOnContact?"auto":"none");e=function(){s.inContact=!0};var d=function(){var t=s.chart.hoverSeries;s.inContact=!1,t&&t.onMouseOut&&t.onMouseOut()};if(!this.label){if(this.outside&&(this.container=n=t.doc.createElement("div"),n.className="highcharts-tooltip-container",r(n,{position:"absolute",top:"1px",pointerEvents:u,zIndex:3}),t.doc.body.appendChild(n),this.renderer=a=new t.Renderer(n,0,0,null===(i=this.chart.options.chart)||void 0===i?void 0:i.style,void 0,void 0,a.styledMode)),this.split?this.label=a.g(h):(this.label=a.label("",0,0,c.shape||"callout",null,null,c.useHTML,null,h).attr({padding:c.padding,r:c.borderRadius}),l||this.label.attr({fill:c.backgroundColor,"stroke-width":c.borderWidth}).css(c.style).css({pointerEvents:u}).shadow(c.shadow)),l&&(this.applyFilter(),this.label.addClass("highcharts-tooltip-"+this.chart.index)),s.outside&&!s.split){var p=this.label,f=p.xSetter,m=p.ySetter;p.xSetter=function(t){f.call(p,s.distance),n.style.left=t+"px"},p.ySetter=function(t){m.call(p,s.distance),n.style.top=t+"px"}}this.label.on("mouseenter",e).on("mouseleave",d).attr({zIndex:8}).add()}return this.label},v.prototype.getPosition=function(t,e,n){var r,o=this.chart,s=this.distance,a={},l=o.inverted&&n.h||0,c=this.outside,h=c?i.documentElement.clientWidth-2*s:o.chartWidth,u=c?Math.max(i.body.scrollHeight,i.documentElement.scrollHeight,i.body.offsetHeight,i.documentElement.offsetHeight,i.documentElement.clientHeight):o.chartHeight,d=o.pointer.getChartPosition(),f=o.containerScaling,m=function(t){return f?t*f.scaleX:t},g=function(t){return f?t*f.scaleY:t},v=function(i){var r="x"===i;return[i,r?h:u,r?t:e].concat(c?[r?m(t):g(e),r?d.left-s+m(n.plotX+o.plotLeft):d.top-s+g(n.plotY+o.plotTop),0,r?h:u]:[r?t:e,r?n.plotX+o.plotLeft:n.plotY+o.plotTop,r?o.plotLeft:o.plotTop,r?o.plotLeft+o.plotWidth:o.plotTop+o.plotHeight])},y=v("y"),x=v("x"),b=!this.followPointer&&p(n.ttBelow,!o.inverted===!!n.negative),w=function(t,e,i,n,r,o,c){var h="y"===t?g(s):m(s),u=(i-n)/2,d=n<r-s,p=r+s+n<e,f=r-h-i+u;if(r=r+h-u,b&&p)a[t]=r;else if(!b&&d)a[t]=f;else if(d)a[t]=Math.min(c-n,0>f-l?f:f-l);else{if(!p)return!1;a[t]=Math.max(o,r+l+i>e?r:r+l)}},_=function(t,e,i,n,r){var o;return r<s||r>e-s?o=!1:a[t]=r<i/2?1:r>e-n/2?e-n-2:r-i/2,o},M=function(t){var e=y;y=x,x=e,r=t},S=function(){!1!==w.apply(0,y)?!1!==_.apply(0,x)||r||(M(!0),S()):r?a.x=a.y=0:(M(!0),S())};return(o.inverted||1<this.len)&&M(),S(),a},v.prototype.getXDateFormat=function(t,e,i){e=e.dateTimeLabelFormats;var n=i&&i.closestPointRange;return(n?this.getDateFormat(n,t.x,i.options.startOfWeek,e):e.day)||e.year},v.prototype.hide=function(t){var i=this;e.clearTimeout(this.hideTimer),t=p(t,this.options.hideDelay,500),this.isHidden||(this.hideTimer=m((function(){i.getLabel().fadeOut(t?void 0:t),i.isHidden=!0}),t))},v.prototype.init=function(t,e){this.chart=t,this.options=e,this.crosshairs=[],this.now={x:0,y:0},this.isHidden=!0,this.split=e.split&&!t.inverted&&!t.polar,this.shared=e.shared||this.split,this.outside=p(e.outside,!(!t.scrollablePixelsX&&!t.scrollablePixelsY))},v.prototype.isStickyOnContact=function(){return!(this.followPointer||!this.options.stickOnContact||!this.inContact)},v.prototype.move=function(t,i,n,r){var o=this,s=o.now,l=!1!==o.options.animation&&!o.isHidden&&(1<Math.abs(t-s.x)||1<Math.abs(i-s.y)),c=o.followPointer||1<o.len;a(s,{x:l?(2*s.x+t)/3:t,y:l?(s.y+i)/2:i,anchorX:c?void 0:l?(2*s.anchorX+n)/3:n,anchorY:c?void 0:l?(s.anchorY+r)/2:r}),o.getLabel().attr(s),o.drawTracker(),l&&(e.clearTimeout(this.tooltipTimeout),this.tooltipTimeout=setTimeout((function(){o&&o.move(t,i,n,r)}),32))},v.prototype.refresh=function(t,i){var n=this.chart,r=this.options,o=t,s={},a=[],c=r.formatter||this.defaultFormatter;s=this.shared;var h=n.styledMode;if(r.enabled){e.clearTimeout(this.hideTimer),this.followPointer=f(o)[0].series.tooltipOptions.followPointer;var u=this.getAnchor(o,i);i=u[0];var d=u[1];!s||o.series&&o.series.noSharedTooltip?s=o.getLabelConfig():(n.pointer.applyInactiveState(o),o.forEach((function(t){t.setState("hover"),a.push(t.getLabelConfig())})),s={x:o[0].category,y:o[0].y},s.points=a,o=o[0]),this.len=a.length,n=c.call(s,this),c=o.series,this.distance=p(c.tooltipOptions.distance,16),!1===n?this.hide():(this.split?this.renderSplit(n,f(t)):(t=this.getLabel(),r.style.width&&!h||t.css({width:this.chart.spacingBox.width+"px"}),t.attr({text:n&&n.join?n.join(""):n}),t.removeClass(/highcharts-color-[\d]+/g).addClass("highcharts-color-"+p(o.colorIndex,c.colorIndex)),h||t.attr({stroke:r.borderColor||o.color||c.color||"#666666"}),this.updatePosition({plotX:i,plotY:d,negative:o.negative,ttBelow:o.ttBelow,h:u[2]||0})),this.isHidden&&this.label&&this.label.attr({opacity:1}).show(),this.isHidden=!1),l(this,"refresh")}},v.prototype.renderSplit=function(e,i){function r(t,e,i,r,o){return void 0===o&&(o=!0),i?(e=E?0:C,t=n(t-r/2,S.left,S.right-r)):(e-=A,t=o?t-r-w:t+w,t=n(t,o?t:S.left,S.right)),{x:t,y:e}}var o=this,s=o.chart,l=o.chart,c=l.plotHeight,h=l.plotLeft,d=l.plotTop,f=l.pointer,m=l.renderer,g=l.scrollablePixelsY,v=void 0===g?0:g;g=l.scrollingContainer,g=void 0===g?{scrollLeft:0,scrollTop:0}:g;var y=g.scrollLeft,x=g.scrollTop,b=l.styledMode,w=o.distance,_=o.options,M=o.options.positioner,S={left:y,right:y+l.chartWidth,top:x,bottom:x+l.chartHeight},T=o.getLabel(),E=!(!s.xAxis[0]||!s.xAxis[0].opposite),A=d+x,L=0,C=c-v;u(e)&&(e=[!1,e]),e=e.slice(0,i.length+1).reduce((function(t,e,s){if(!1!==e&&""!==e){s=i[s-1]||{isHeader:!0,plotX:i[0].plotX,plotY:c,series:{}};var a=s.isHeader,l=a?o:s.series,u=l.tt,f=s.isHeader,g=s.series,y="highcharts-color-"+p(s.colorIndex,g.colorIndex,"none");u||(u={padding:_.padding,r:_.borderRadius},b||(u.fill=_.backgroundColor,u["stroke-width"]=_.borderWidth),u=m.label("",0,0,_[f?"headerShape":"shape"]||"callout",void 0,void 0,_.useHTML).addClass((f?"highcharts-tooltip-header ":"")+"highcharts-tooltip-box "+y).attr(u).add(T)),u.isActive=!0,u.attr({text:e}),b||u.css(_.style).shadow(_.shadow).attr({stroke:_.borderColor||s.color||g.color||"#333333"}),e=l.tt=u,f=e.getBBox(),l=f.width+e.strokeWidth(),a&&(L=f.height,C+=L,E&&(A-=L)),g=s.plotX,g=void 0===g?0:g,y=s.plotY,y=void 0===y?0:y;var P=s.series;if(s.isHeader){g=h+g;var R=d+c/2}else u=P.xAxis,P=P.yAxis,g=u.pos+n(g,-w,u.len+w),P.pos+y>=x+d&&P.pos+y<=x+d+c-v&&(R=P.pos+y);g=n(g,S.left-w,S.right+w),"number"===typeof R?(f=f.height+1,y=M?M.call(o,l,f,s):r(g,R,a,l),t.push({align:M?0:void 0,anchorX:g,anchorY:R,boxWidth:l,point:s,rank:p(y.rank,a?1:0),size:f,target:y.y,tt:e,x:y.x})):e.isActive=!1}return t}),[]),!M&&e.some((function(t){return t.x<S.left}))&&(e=e.map((function(t){var e=r(t.anchorX,t.anchorY,t.point.isHeader,t.boxWidth,!1);return a(t,{target:e.y,x:e.x})}))),o.cleanSplit(),t.distribute(e,C),e.forEach((function(t){var e=t.pos;t.tt.attr({visibility:"undefined"===typeof e?"hidden":"inherit",x:t.x,y:e+A,anchorX:t.anchorX,anchorY:t.anchorY})})),e=o.container,s=o.renderer,o.outside&&e&&s&&(l=T.getBBox(),s.setSize(l.width+l.x,l.height+l.y,!1),f=f.getChartPosition(),e.style.left=f.left+"px",e.style.top=f.top+"px")},v.prototype.drawTracker=function(){if(this.followPointer||!this.options.stickOnContact)this.tracker&&this.tracker.destroy();else{var t=this.chart,e=this.label,i=t.hoverPoint;if(e&&i){var n={x:0,y:0,width:0,height:0};i=this.getAnchor(i);var r=e.getBBox();i[0]+=t.plotLeft-e.translateX,i[1]+=t.plotTop-e.translateY,n.x=Math.min(0,i[0]),n.y=Math.min(0,i[1]),n.width=0>i[0]?Math.max(Math.abs(i[0]),r.width-i[0]):Math.max(Math.abs(i[0]),r.width),n.height=0>i[1]?Math.max(Math.abs(i[1]),r.height-Math.abs(i[1])):Math.max(Math.abs(i[1]),r.height),this.tracker?this.tracker.attr(n):(this.tracker=e.renderer.rect(n).addClass("highcharts-tracker").add(e),t.styledMode||this.tracker.attr({fill:"rgba(0,0,0,0)"}))}}},v.prototype.styledModeFormat=function(t){return t.replace('style="font-size: 10px"','class="highcharts-header"').replace(/style="color:{(point|series)\.color}"/g,'class="highcharts-color-{$1.colorIndex}"')},v.prototype.tooltipFooterHeaderFormatter=function(t,e){var i=e?"footer":"header",n=t.series,r=n.tooltipOptions,o=r.xDateFormat,s=n.xAxis,a=s&&"datetime"===s.options.type&&h(t.key),u=r[i+"Format"];return e={isFooter:e,labelConfig:t},l(this,"headerFormatter",e,(function(e){a&&!o&&(o=this.getXDateFormat(t,r,s)),a&&o&&(t.point&&t.point.tooltipDateKeys||["key"]).forEach((function(t){u=u.replace("{point."+t+"}","{point."+t+":"+o+"}")})),n.chart.styledMode&&(u=this.styledModeFormat(u)),e.text=c(u,{point:t,series:n},this.chart)})),e.text},v.prototype.update=function(t){this.destroy(),d(!0,this.chart.options.tooltip.userOptions,t),this.init(this.chart,d(!0,this.options,t))},v.prototype.updatePosition=function(t){var e=this.chart,i=e.pointer,n=this.getLabel(),o=t.plotX+e.plotLeft,s=t.plotY+e.plotTop;if(i=i.getChartPosition(),t=(this.options.positioner||this.getPosition).call(this,n.width,n.height,t),this.outside){var a=(this.options.borderWidth||0)+2*this.distance;this.renderer.setSize(n.width+a,n.height+a,!1),(e=e.containerScaling)&&(r(this.container,{transform:"scale("+e.scaleX+", "+e.scaleY+")"}),o*=e.scaleX,s*=e.scaleY),o+=i.left-t.x,s+=i.top-t.y}this.move(Math.round(t.x),Math.round(t.y||0),o,s)},v}();return t.Tooltip=v,t.Tooltip})),e(i,"Core/Pointer.js",[i["Core/Color/Color.js"],i["Core/Globals.js"],i["Core/Tooltip.js"],i["Core/Utilities.js"]],(function(t,e,i,n){var r=t.parse,o=e.charts,s=e.noop,a=n.addEvent,l=n.attr,c=n.css,h=n.defined,u=n.extend,d=n.find,p=n.fireEvent,f=n.isNumber,m=n.isObject,g=n.objectEach,v=n.offset,y=n.pick,x=n.splat;return t=function(){function t(t,e){this.lastValidTouch={},this.pinchDown=[],this.runChartClick=!1,this.chart=t,this.hasDragged=!1,this.options=e,this.unbindContainerMouseLeave=function(){},this.unbindContainerMouseEnter=function(){},this.init(t,e)}return t.prototype.applyInactiveState=function(t){var e,i=[];(t||[]).forEach((function(t){e=t.series,i.push(e),e.linkedParent&&i.push(e.linkedParent),e.linkedSeries&&(i=i.concat(e.linkedSeries)),e.navigatorSeries&&i.push(e.navigatorSeries)})),this.chart.series.forEach((function(t){-1===i.indexOf(t)?t.setState("inactive",!0):t.options.inactiveOtherPoints&&t.setAllPointsToState("inactive")}))},t.prototype.destroy=function(){var t=this;"undefined"!==typeof t.unDocMouseMove&&t.unDocMouseMove(),this.unbindContainerMouseLeave(),e.chartCount||(e.unbindDocumentMouseUp&&(e.unbindDocumentMouseUp=e.unbindDocumentMouseUp()),e.unbindDocumentTouchEnd&&(e.unbindDocumentTouchEnd=e.unbindDocumentTouchEnd())),clearInterval(t.tooltipTimeout),g(t,(function(e,i){t[i]=void 0}))},t.prototype.drag=function(t){var e=this.chart,i=e.options.chart,n=t.chartX,o=t.chartY,s=this.zoomHor,a=this.zoomVert,l=e.plotLeft,c=e.plotTop,h=e.plotWidth,u=e.plotHeight,d=this.selectionMarker,p=this.mouseDownX||0,f=this.mouseDownY||0,g=m(i.panning)?i.panning&&i.panning.enabled:i.panning,v=i.panKey&&t[i.panKey+"Key"];if((!d||!d.touch)&&(n<l?n=l:n>l+h&&(n=l+h),o<c?o=c:o>c+u&&(o=c+u),this.hasDragged=Math.sqrt(Math.pow(p-n,2)+Math.pow(f-o,2)),10<this.hasDragged)){var y=e.isInsidePlot(p-l,f-c);e.hasCartesianSeries&&(this.zoomX||this.zoomY)&&y&&!v&&!d&&(this.selectionMarker=d=e.renderer.rect(l,c,s?1:h,a?1:u,0).attr({class:"highcharts-selection-marker",zIndex:7}).add(),e.styledMode||d.attr({fill:i.selectionMarkerFill||r("#335cad").setOpacity(.25).get()})),d&&s&&(n-=p,d.attr({width:Math.abs(n),x:(0<n?0:n)+p})),d&&a&&(n=o-f,d.attr({height:Math.abs(n),y:(0<n?0:n)+f})),y&&!d&&g&&e.pan(t,i.panning)}},t.prototype.dragStart=function(t){var e=this.chart;e.mouseIsDown=t.type,e.cancelClick=!1,e.mouseDownX=this.mouseDownX=t.chartX,e.mouseDownY=this.mouseDownY=t.chartY},t.prototype.drop=function(t){var e=this,i=this.chart,n=this.hasPinched;if(this.selectionMarker){var r,o={originalEvent:t,xAxis:[],yAxis:[]},s=this.selectionMarker,a=s.attr?s.attr("x"):s.x,l=s.attr?s.attr("y"):s.y,d=s.attr?s.attr("width"):s.width,m=s.attr?s.attr("height"):s.height;(this.hasDragged||n)&&(i.axes.forEach((function(i){if(i.zoomEnabled&&h(i.min)&&(n||e[{xAxis:"zoomX",yAxis:"zoomY"}[i.coll]])&&f(a)&&f(l)){var s=i.horiz,c="touchend"===t.type?i.minPixelPadding:0,u=i.toValue((s?a:l)+c);s=i.toValue((s?a+d:l+m)-c),o[i.coll].push({axis:i,min:Math.min(u,s),max:Math.max(u,s)}),r=!0}})),r&&p(i,"selection",o,(function(t){i.zoom(u(t,n?{animation:!1}:null))}))),f(i.index)&&(this.selectionMarker=this.selectionMarker.destroy()),n&&this.scaleGroups()}i&&f(i.index)&&(c(i.container,{cursor:i._cursor}),i.cancelClick=10<this.hasDragged,i.mouseIsDown=this.hasDragged=this.hasPinched=!1,this.pinchDown=[])},t.prototype.findNearestKDPoint=function(t,e,i){var n,r=this.chart,o=r.hoverPoint;return r=r.tooltip,o&&r&&r.isStickyOnContact()?o:(t.forEach((function(t){var r=!(t.noSharedTooltip&&e)&&0>t.options.findNearestPointBy.indexOf("y");if(t=t.searchPoint(i,r),(r=m(t,!0))&&!(r=!m(n,!0))){r=n.distX-t.distX;var o=n.dist-t.dist,s=(t.series.group&&t.series.group.zIndex)-(n.series.group&&n.series.group.zIndex);r=0<(0!==r&&e?r:0!==o?o:0!==s?s:n.series.index>t.series.index?-1:1)}r&&(n=t)})),n)},t.prototype.getChartCoordinatesFromPoint=function(t,e){var i=t.series,n=i.xAxis;i=i.yAxis;var r=y(t.clientX,t.plotX),o=t.shapeArgs;return n&&i?e?{chartX:n.len+n.pos-r,chartY:i.len+i.pos-t.plotY}:{chartX:r+n.pos,chartY:t.plotY+i.pos}:o&&o.x&&o.y?{chartX:o.x,chartY:o.y}:void 0},t.prototype.getChartPosition=function(){return this.chartPosition||(this.chartPosition=v(this.chart.container))},t.prototype.getCoordinates=function(t){var e={xAxis:[],yAxis:[]};return this.chart.axes.forEach((function(i){e[i.isXAxis?"xAxis":"yAxis"].push({axis:i,value:i.toValue(t[i.horiz?"chartX":"chartY"])})})),e},t.prototype.getHoverData=function(t,e,i,n,r,o){var s,a=[];n=!(!n||!t);var l=e&&!e.stickyTracking,c={chartX:o?o.chartX:void 0,chartY:o?o.chartY:void 0,shared:r};return p(this,"beforeGetHoverData",c),l=l?[e]:i.filter((function(t){return c.filter?c.filter(t):t.visible&&!(!r&&t.directTouch)&&y(t.options.enableMouseTracking,!0)&&t.stickyTracking})),e=(s=n||!o?t:this.findNearestKDPoint(l,r,o))&&s.series,s&&(r&&!e.noSharedTooltip?(l=i.filter((function(t){return c.filter?c.filter(t):t.visible&&!(!r&&t.directTouch)&&y(t.options.enableMouseTracking,!0)&&!t.noSharedTooltip})),l.forEach((function(t){var e=d(t.points,(function(t){return t.x===s.x&&!t.isNull}));m(e)&&(t.chart.isBoosting&&(e=t.getPoint(e)),a.push(e))}))):a.push(s)),c={hoverPoint:s},p(this,"afterGetHoverData",c),{hoverPoint:c.hoverPoint,hoverSeries:e,hoverPoints:a}},t.prototype.getPointFromEvent=function(t){t=t.target;for(var e;t&&!e;)e=t.point,t=t.parentNode;return e},t.prototype.onTrackerMouseOut=function(t){t=t.relatedTarget||t.toElement;var e=this.chart.hoverSeries;this.isDirectTouch=!1,!e||!t||e.stickyTracking||this.inClass(t,"highcharts-tooltip")||this.inClass(t,"highcharts-series-"+e.index)&&this.inClass(t,"highcharts-tracker")||e.onMouseOut()},t.prototype.inClass=function(t,e){for(var i;t;){if(i=l(t,"class")){if(-1!==i.indexOf(e))return!0;if(-1!==i.indexOf("highcharts-container"))return!1}t=t.parentNode}},t.prototype.init=function(t,e){this.options=e,this.chart=t,this.runChartClick=e.chart.events&&!!e.chart.events.click,this.pinchDown=[],this.lastValidTouch={},i&&(t.tooltip=new i(t,e.tooltip),this.followTouchMove=y(e.tooltip.followTouchMove,!0)),this.setDOMEvents()},t.prototype.normalize=function(t,e){var i=t.touches,n=i?i.length?i.item(0):y(i.changedTouches,t.changedTouches)[0]:t;return e||(e=this.getChartPosition()),i=n.pageX-e.left,e=n.pageY-e.top,(n=this.chart.containerScaling)&&(i/=n.scaleX,e/=n.scaleY),u(t,{chartX:Math.round(i),chartY:Math.round(e)})},t.prototype.onContainerClick=function(t){var e=this.chart,i=e.hoverPoint;t=this.normalize(t);var n=e.plotLeft,r=e.plotTop;e.cancelClick||(i&&this.inClass(t.target,"highcharts-tracker")?(p(i.series,"click",u(t,{point:i})),e.hoverPoint&&i.firePointEvent("click",t)):(u(t,this.getCoordinates(t)),e.isInsidePlot(t.chartX-n,t.chartY-r)&&p(e,"click",t)))},t.prototype.onContainerMouseDown=function(t){var i=1===(1&(t.buttons||t.button));t=this.normalize(t),e.isFirefox&&0!==t.button&&this.onContainerMouseMove(t),("undefined"===typeof t.button||i)&&(this.zoomOption(t),i&&t.preventDefault&&t.preventDefault(),this.dragStart(t))},t.prototype.onContainerMouseLeave=function(t){var i=o[y(e.hoverChartIndex,-1)],n=this.chart.tooltip;t=this.normalize(t),i&&(t.relatedTarget||t.toElement)&&(i.pointer.reset(),i.pointer.chartPosition=void 0),n&&!n.isHidden&&this.reset()},t.prototype.onContainerMouseEnter=function(t){delete this.chartPosition},t.prototype.onContainerMouseMove=function(t){var e=this.chart;t=this.normalize(t),this.setHoverChartIndex(),t.preventDefault||(t.returnValue=!1),"mousedown"===e.mouseIsDown&&this.drag(t),e.openMenu||!this.inClass(t.target,"highcharts-tracker")&&!e.isInsidePlot(t.chartX-e.plotLeft,t.chartY-e.plotTop)||this.runPointActions(t)},t.prototype.onDocumentTouchEnd=function(t){o[e.hoverChartIndex]&&o[e.hoverChartIndex].pointer.drop(t)},t.prototype.onContainerTouchMove=function(t){this.touch(t)},t.prototype.onContainerTouchStart=function(t){this.zoomOption(t),this.touch(t,!0)},t.prototype.onDocumentMouseMove=function(t){var e=this.chart,i=this.chartPosition;t=this.normalize(t,i);var n=e.tooltip;!i||n&&n.isStickyOnContact()||e.isInsidePlot(t.chartX-e.plotLeft,t.chartY-e.plotTop)||this.inClass(t.target,"highcharts-tracker")||this.reset()},t.prototype.onDocumentMouseUp=function(t){var i=o[y(e.hoverChartIndex,-1)];i&&i.pointer.drop(t)},t.prototype.pinch=function(t){var e=this,i=e.chart,n=e.pinchDown,r=t.touches||[],o=r.length,a=e.lastValidTouch,l=e.hasZoom,c=e.selectionMarker,h={},d=1===o&&(e.inClass(t.target,"highcharts-tracker")&&i.runTrackerClick||e.runChartClick),p={};1<o&&(e.initiated=!0),l&&e.initiated&&!d&&!1!==t.cancelable&&t.preventDefault(),[].map.call(r,(function(t){return e.normalize(t)})),"touchstart"===t.type?([].forEach.call(r,(function(t,e){n[e]={chartX:t.chartX,chartY:t.chartY}})),a.x=[n[0].chartX,n[1]&&n[1].chartX],a.y=[n[0].chartY,n[1]&&n[1].chartY],i.axes.forEach((function(t){if(t.zoomEnabled){var e=i.bounds[t.horiz?"h":"v"],n=t.minPixelPadding,r=t.toPixels(Math.min(y(t.options.min,t.dataMin),t.dataMin)),o=t.toPixels(Math.max(y(t.options.max,t.dataMax),t.dataMax)),s=Math.max(r,o);e.min=Math.min(t.pos,Math.min(r,o)-n),e.max=Math.max(t.pos+t.len,s+n)}})),e.res=!0):e.followTouchMove&&1===o?this.runPointActions(e.normalize(t)):n.length&&(c||(e.selectionMarker=c=u({destroy:s,touch:!0},i.plotBox)),e.pinchTranslate(n,r,h,c,p,a),e.hasPinched=l,e.scaleGroups(h,p),e.res&&(e.res=!1,this.reset(!1,0)))},t.prototype.pinchTranslate=function(t,e,i,n,r,o){this.zoomHor&&this.pinchTranslateDirection(!0,t,e,i,n,r,o),this.zoomVert&&this.pinchTranslateDirection(!1,t,e,i,n,r,o)},t.prototype.pinchTranslateDirection=function(t,e,i,n,r,o,s,a){var l,c,h=this.chart,u=t?"x":"y",d=t?"X":"Y",p="chart"+d,f=t?"width":"height",m=h["plot"+(t?"Left":"Top")],g=a||1,v=h.inverted,y=h.bounds[t?"h":"v"],x=1===e.length,b=e[0][p],w=i[0][p],_=!x&&e[1][p],M=!x&&i[1][p];if(i=function(){"number"===typeof M&&20<Math.abs(b-_)&&(g=a||Math.abs(w-M)/Math.abs(b-_)),c=(m-w)/g+b,l=h["plot"+(t?"Width":"Height")]/g},i(),e=c,e<y.min){e=y.min;var S=!0}else e+l>y.max&&(e=y.max-l,S=!0);S?(w-=.8*(w-s[u][0]),"number"===typeof M&&(M-=.8*(M-s[u][1])),i()):s[u]=[w,M],v||(o[u]=c-m,o[f]=l),o=v?1/g:g,r[f]=l,r[u]=e,n[v?t?"scaleY":"scaleX":"scale"+d]=g,n["translate"+d]=o*m+(w-o*b)},t.prototype.reset=function(t,e){var i=this.chart,n=i.hoverSeries,r=i.hoverPoint,o=i.hoverPoints,s=i.tooltip,a=s&&s.shared?o:r;t&&a&&x(a).forEach((function(e){e.series.isCartesian&&"undefined"===typeof e.plotX&&(t=!1)})),t?s&&a&&x(a).length&&(s.refresh(a),s.shared&&o?o.forEach((function(t){t.setState(t.state,!0),t.series.isCartesian&&(t.series.xAxis.crosshair&&t.series.xAxis.drawCrosshair(null,t),t.series.yAxis.crosshair&&t.series.yAxis.drawCrosshair(null,t))})):r&&(r.setState(r.state,!0),i.axes.forEach((function(t){t.crosshair&&r.series[t.coll]===t&&t.drawCrosshair(null,r)})))):(r&&r.onMouseOut(),o&&o.forEach((function(t){t.setState()})),n&&n.onMouseOut(),s&&s.hide(e),this.unDocMouseMove&&(this.unDocMouseMove=this.unDocMouseMove()),i.axes.forEach((function(t){t.hideCrosshair()})),this.hoverX=i.hoverPoints=i.hoverPoint=null)},t.prototype.runPointActions=function(t,i){var n=this.chart,r=n.tooltip&&n.tooltip.options.enabled?n.tooltip:void 0,s=!!r&&r.shared,l=i||n.hoverPoint,c=l&&l.series||n.hoverSeries;c=this.getHoverData(l,c,n.series,(!t||"touchmove"!==t.type)&&(!!i||c&&c.directTouch&&this.isDirectTouch),s,t),l=c.hoverPoint;var h=c.hoverPoints;if(i=(c=c.hoverSeries)&&c.tooltipOptions.followPointer,s=s&&c&&!c.noSharedTooltip,l&&(l!==n.hoverPoint||r&&r.isHidden)){if((n.hoverPoints||[]).forEach((function(t){-1===h.indexOf(t)&&t.setState()})),n.hoverSeries!==c&&c.onMouseOver(),this.applyInactiveState(h),(h||[]).forEach((function(t){t.setState("hover")})),n.hoverPoint&&n.hoverPoint.firePointEvent("mouseOut"),!l.series)return;n.hoverPoints=h,n.hoverPoint=l,l.firePointEvent("mouseOver"),r&&r.refresh(s?h:l,t)}else i&&r&&!r.isHidden&&(l=r.getAnchor([{}],t),r.updatePosition({plotX:l[0],plotY:l[1]}));this.unDocMouseMove||(this.unDocMouseMove=a(n.container.ownerDocument,"mousemove",(function(t){var i=o[e.hoverChartIndex];i&&i.pointer.onDocumentMouseMove(t)}))),n.axes.forEach((function(e){var i,r=y((e.crosshair||{}).snap,!0);r&&((i=n.hoverPoint)&&i.series[e.coll]===e||(i=d(h,(function(t){return t.series[e.coll]===e})))),i||!r?e.drawCrosshair(t,i):e.hideCrosshair()}))},t.prototype.scaleGroups=function(t,e){var i,n=this.chart;n.series.forEach((function(r){i=t||r.getPlotBox(),r.xAxis&&r.xAxis.zoomEnabled&&r.group&&(r.group.attr(i),r.markerGroup&&(r.markerGroup.attr(i),r.markerGroup.clip(e?n.clipRect:null)),r.dataLabelsGroup&&r.dataLabelsGroup.attr(i))})),n.clipRect.attr(e||n.clipBox)},t.prototype.setDOMEvents=function(){var t=this.chart.container,i=t.ownerDocument;t.onmousedown=this.onContainerMouseDown.bind(this),t.onmousemove=this.onContainerMouseMove.bind(this),t.onclick=this.onContainerClick.bind(this),this.unbindContainerMouseEnter=a(t,"mouseenter",this.onContainerMouseEnter.bind(this)),this.unbindContainerMouseLeave=a(t,"mouseleave",this.onContainerMouseLeave.bind(this)),e.unbindDocumentMouseUp||(e.unbindDocumentMouseUp=a(i,"mouseup",this.onDocumentMouseUp.bind(this))),e.hasTouch&&(a(t,"touchstart",this.onContainerTouchStart.bind(this)),a(t,"touchmove",this.onContainerTouchMove.bind(this)),e.unbindDocumentTouchEnd||(e.unbindDocumentTouchEnd=a(i,"touchend",this.onDocumentTouchEnd.bind(this))))},t.prototype.setHoverChartIndex=function(){var t=this.chart,i=e.charts[y(e.hoverChartIndex,-1)];i&&i!==t&&i.pointer.onContainerMouseLeave({relatedTarget:!0}),i&&i.mouseIsDown||(e.hoverChartIndex=t.index)},t.prototype.touch=function(t,e){var i=this.chart;if(this.setHoverChartIndex(),1===t.touches.length)if(t=this.normalize(t),i.isInsidePlot(t.chartX-i.plotLeft,t.chartY-i.plotTop)&&!i.openMenu){if(e&&this.runPointActions(t),"touchmove"===t.type){e=this.pinchDown;var n=!!e[0]&&4<=Math.sqrt(Math.pow(e[0].chartX-t.chartX,2)+Math.pow(e[0].chartY-t.chartY,2))}y(n,!0)&&this.pinch(t)}else e&&this.reset();else 2===t.touches.length&&this.pinch(t)},t.prototype.zoomOption=function(t){var e=this.chart,i=e.options.chart,n=i.zoomType||"";e=e.inverted,/touch/.test(t.type)&&(n=y(i.pinchType,n)),this.zoomX=t=/x/.test(n),this.zoomY=n=/y/.test(n),this.zoomHor=t&&!e||n&&e,this.zoomVert=n&&!e||t&&e,this.hasZoom=t||n},t}(),e.Pointer=t})),e(i,"Core/MSPointer.js",[i["Core/Globals.js"],i["Core/Pointer.js"],i["Core/Utilities.js"]],(function(t,e,i){function n(){var t=[];return t.item=function(t){return this[t]},u(p,(function(e){t.push({pageX:e.pageX,pageY:e.pageY,target:e.target})})),t}function r(e,i,r,o){"touch"!==e.pointerType&&e.pointerType!==e.MSPOINTER_TYPE_TOUCH||!s[t.hoverChartIndex]||(o(e),o=s[t.hoverChartIndex].pointer,o[i]({type:r,target:e.currentTarget,preventDefault:l,touches:n()}))}var o=this&&this.__extends||function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},t(e,i)};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),s=t.charts,a=t.doc,l=t.noop,c=i.addEvent,h=i.css,u=i.objectEach,d=i.removeEvent,p={},f=!!t.win.PointerEvent;return function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.batchMSEvents=function(t){t(this.chart.container,f?"pointerdown":"MSPointerDown",this.onContainerPointerDown),t(this.chart.container,f?"pointermove":"MSPointerMove",this.onContainerPointerMove),t(a,f?"pointerup":"MSPointerUp",this.onDocumentPointerUp)},e.prototype.destroy=function(){this.batchMSEvents(d),t.prototype.destroy.call(this)},e.prototype.init=function(e,i){t.prototype.init.call(this,e,i),this.hasZoom&&h(e.container,{"-ms-touch-action":"none","touch-action":"none"})},e.prototype.onContainerPointerDown=function(t){r(t,"onContainerTouchStart","touchstart",(function(t){p[t.pointerId]={pageX:t.pageX,pageY:t.pageY,target:t.currentTarget}}))},e.prototype.onContainerPointerMove=function(t){r(t,"onContainerTouchMove","touchmove",(function(t){p[t.pointerId]={pageX:t.pageX,pageY:t.pageY},p[t.pointerId].target||(p[t.pointerId].target=t.currentTarget)}))},e.prototype.onDocumentPointerUp=function(t){r(t,"onDocumentTouchEnd","touchend",(function(t){delete p[t.pointerId]}))},e.prototype.setDOMEvents=function(){t.prototype.setDOMEvents.call(this),(this.hasZoom||this.followTouchMove)&&this.batchMSEvents(c)},e}(e)})),e(i,"Core/Legend.js",[i["Core/Animation/AnimationUtilities.js"],i["Core/Globals.js"],i["Core/Utilities.js"]],(function(t,e,i){var n=t.animObject,r=t.setAnimation,o=i.addEvent,s=i.css,a=i.defined,l=i.discardElement,c=i.find,h=i.fireEvent,u=i.format,d=i.isNumber,p=i.merge,f=i.pick,m=i.relativeLength,g=i.stableSort,v=i.syncTimeout;t=i.wrap,i=e.isFirefox;var y=e.marginNames,x=e.win,b=function(){function t(t,e){this.allItems=[],this.contentGroup=this.box=void 0,this.display=!1,this.group=void 0,this.offsetWidth=this.maxLegendWidth=this.maxItemWidth=this.legendWidth=this.legendHeight=this.lastLineHeight=this.lastItemY=this.itemY=this.itemX=this.itemMarginTop=this.itemMarginBottom=this.itemHeight=this.initialItemY=0,this.options={},this.padding=0,this.pages=[],this.proximate=!1,this.scrollGroup=void 0,this.widthOption=this.totalItemWidth=this.titleHeight=this.symbolWidth=this.symbolHeight=0,this.chart=t,this.init(t,e)}return t.prototype.init=function(t,e){this.chart=t,this.setOptions(e),e.enabled&&(this.render(),o(this.chart,"endResize",(function(){this.legend.positionCheckboxes()})),this.proximate?this.unchartrender=o(this.chart,"render",(function(){this.legend.proximatePositions(),this.legend.positionItems()})):this.unchartrender&&this.unchartrender())},t.prototype.setOptions=function(t){var e=f(t.padding,8);this.options=t,this.chart.styledMode||(this.itemStyle=t.itemStyle,this.itemHiddenStyle=p(this.itemStyle,t.itemHiddenStyle)),this.itemMarginTop=t.itemMarginTop||0,this.itemMarginBottom=t.itemMarginBottom||0,this.padding=e,this.initialItemY=e-5,this.symbolWidth=f(t.symbolWidth,16),this.pages=[],this.proximate="proximate"===t.layout&&!this.chart.inverted,this.baseline=void 0},t.prototype.update=function(t,e){var i=this.chart;this.setOptions(p(!0,this.options,t)),this.destroy(),i.isDirtyLegend=i.isDirtyBox=!0,f(e,!0)&&i.redraw(),h(this,"afterUpdate")},t.prototype.colorizeItem=function(t,e){if(t.legendGroup[e?"removeClass":"addClass"]("highcharts-legend-item-hidden"),!this.chart.styledMode){var i=this.options,n=t.legendItem,r=t.legendLine,o=t.legendSymbol,s=this.itemHiddenStyle.color;i=e?i.itemStyle.color:s;var a=e&&t.color||s,l=t.options&&t.options.marker,c={fill:a};n&&n.css({fill:i,color:i}),r&&r.attr({stroke:a}),o&&(l&&o.isMarker&&(c=t.pointAttribs(),e||(c.stroke=c.fill=s)),o.attr(c))}h(this,"afterColorizeItem",{item:t,visible:e})},t.prototype.positionItems=function(){this.allItems.forEach(this.positionItem,this),this.chart.isResizing||this.positionCheckboxes()},t.prototype.positionItem=function(t){var e=this,i=this.options,n=i.symbolPadding,r=!i.rtl,o=t._legendItemPos;i=o[0],o=o[1];var s=t.checkbox,l=t.legendGroup;l&&l.element&&(n={translateX:r?i:this.legendWidth-i-2*n-4,translateY:o},r=function(){h(e,"afterPositionItem",{item:t})},a(l.translateY)?l.animate(n,void 0,r):(l.attr(n),r())),s&&(s.x=i,s.y=o)},t.prototype.destroyItem=function(t){var e=t.checkbox;["legendItem","legendLine","legendSymbol","legendGroup"].forEach((function(e){t[e]&&(t[e]=t[e].destroy())})),e&&l(t.checkbox)},t.prototype.destroy=function(){function t(t){this[t]&&(this[t]=this[t].destroy())}this.getAllItems().forEach((function(e){["legendItem","legendGroup"].forEach(t,e)})),"clipRect up down pager nav box title group".split(" ").forEach(t,this),this.display=null},t.prototype.positionCheckboxes=function(){var t=this.group&&this.group.alignAttr,e=this.clipHeight||this.legendHeight,i=this.titleHeight;if(t){var n=t.translateY;this.allItems.forEach((function(r){var o=r.checkbox;if(o){var a=n+i+o.y+(this.scrollOffset||0)+3;s(o,{left:t.translateX+r.checkboxOffset+o.x-20+"px",top:a+"px",display:this.proximate||a>n-6&&a<n+e-6?"":"none"})}}),this)}},t.prototype.renderTitle=function(){var t=this.options,e=this.padding,i=t.title,n=0;i.text&&(this.title||(this.title=this.chart.renderer.label(i.text,e-3,e-4,null,null,null,t.useHTML,null,"legend-title").attr({zIndex:1}),this.chart.styledMode||this.title.css(i.style),this.title.add(this.group)),i.width||this.title.css({width:this.maxLegendWidth+"px"}),t=this.title.getBBox(),n=t.height,this.offsetWidth=t.width,this.contentGroup.attr({translateY:n})),this.titleHeight=n},t.prototype.setText=function(t){var e=this.options;t.legendItem.attr({text:e.labelFormat?u(e.labelFormat,t,this.chart):e.labelFormatter.call(t)})},t.prototype.renderItem=function(t){var e=this.chart,i=e.renderer,n=this.options,r=this.symbolWidth,o=n.symbolPadding,s=this.itemStyle,a=this.itemHiddenStyle,l="horizontal"===n.layout?f(n.itemDistance,20):0,c=!n.rtl,h=t.legendItem,u=!t.series,d=!u&&t.series.drawLegendSymbol?t.series:t,m=d.options;m=this.createCheckboxForItem&&m&&m.showCheckbox,l=r+o+l+(m?20:0);var g=n.useHTML,v=t.options.className;h||(t.legendGroup=i.g("legend-item").addClass("highcharts-"+d.type+"-series highcharts-color-"+t.colorIndex+(v?" "+v:"")+(u?" highcharts-series-"+t.index:"")).attr({zIndex:1}).add(this.scrollGroup),t.legendItem=h=i.text("",c?r+o:-o,this.baseline||0,g),e.styledMode||h.css(p(t.visible?s:a)),h.attr({align:c?"left":"right",zIndex:2}).add(t.legendGroup),this.baseline||(this.fontMetrics=i.fontMetrics(e.styledMode?12:s.fontSize,h),this.baseline=this.fontMetrics.f+3+this.itemMarginTop,h.attr("y",this.baseline)),this.symbolHeight=n.symbolHeight||this.fontMetrics.f,d.drawLegendSymbol(this,t),this.setItemEvents&&this.setItemEvents(t,h,g)),m&&!t.checkbox&&this.createCheckboxForItem&&this.createCheckboxForItem(t),this.colorizeItem(t,t.visible),!e.styledMode&&s.width||h.css({width:(n.itemWidth||this.widthOption||e.spacingBox.width)-l+"px"}),this.setText(t),e=h.getBBox(),t.itemWidth=t.checkboxOffset=n.itemWidth||t.legendItemWidth||e.width+l,this.maxItemWidth=Math.max(this.maxItemWidth,t.itemWidth),this.totalItemWidth+=t.itemWidth,this.itemHeight=t.itemHeight=Math.round(t.legendItemHeight||e.height||this.symbolHeight)},t.prototype.layoutItem=function(t){var e=this.options,i=this.padding,n="horizontal"===e.layout,r=t.itemHeight,o=this.itemMarginBottom,s=this.itemMarginTop,a=n?f(e.itemDistance,20):0,l=this.maxLegendWidth;e=e.alignColumns&&this.totalItemWidth>l?this.maxItemWidth:t.itemWidth,n&&this.itemX-i+e>l&&(this.itemX=i,this.lastLineHeight&&(this.itemY+=s+this.lastLineHeight+o),this.lastLineHeight=0),this.lastItemY=s+this.itemY+o,this.lastLineHeight=Math.max(r,this.lastLineHeight),t._legendItemPos=[this.itemX,this.itemY],n?this.itemX+=e:(this.itemY+=s+r+o,this.lastLineHeight=r),this.offsetWidth=this.widthOption||Math.max((n?this.itemX-i-(t.checkbox?0:a):e)+i,this.offsetWidth)},t.prototype.getAllItems=function(){var t=[];return this.chart.series.forEach((function(e){var i=e&&e.options;e&&f(i.showInLegend,!a(i.linkedTo)&&void 0,!0)&&(t=t.concat(e.legendItems||("point"===i.legendType?e.data:e)))})),h(this,"afterGetAllItems",{allItems:t}),t},t.prototype.getAlignment=function(){var t=this.options;return this.proximate?t.align.charAt(0)+"tv":t.floating?"":t.align.charAt(0)+t.verticalAlign.charAt(0)+t.layout.charAt(0)},t.prototype.adjustMargins=function(t,e){var i=this.chart,n=this.options,r=this.getAlignment();r&&[/(lth|ct|rth)/,/(rtv|rm|rbv)/,/(rbh|cb|lbh)/,/(lbv|lm|ltv)/].forEach((function(o,s){o.test(r)&&!a(t[s])&&(i[y[s]]=Math.max(i[y[s]],i.legend[(s+1)%2?"legendHeight":"legendWidth"]+[1,-1,-1,1][s]*n[s%2?"x":"y"]+f(n.margin,12)+e[s]+(i.titleOffset[s]||0)))}))},t.prototype.proximatePositions=function(){var t=this.chart,i=[],n="left"===this.options.align;this.allItems.forEach((function(e){var r,o=n;if(e.yAxis){e.xAxis.options.reversed&&(o=!o),e.points&&(r=c(o?e.points:e.points.slice(0).reverse(),(function(t){return d(t.plotY)}))),o=this.itemMarginTop+e.legendItem.getBBox().height+this.itemMarginBottom;var s=e.yAxis.top-t.plotTop;e.visible?(r=r?r.plotY:e.yAxis.height,r+=s-.3*o):r=s+e.yAxis.height,i.push({target:r,size:o,item:e})}}),this),e.distribute(i,t.plotHeight),i.forEach((function(e){e.item._legendItemPos[1]=t.plotTop-t.spacing[0]+e.pos}))},t.prototype.render=function(){var t=this.chart,e=t.renderer,i=this.group,n=this.box,r=this.options,o=this.padding;this.itemX=o,this.itemY=this.initialItemY,this.lastItemY=this.offsetWidth=0,this.widthOption=m(r.width,t.spacingBox.width-o);var s=t.spacingBox.width-2*o-r.x;-1<["rm","lm"].indexOf(this.getAlignment().substring(0,2))&&(s/=2),this.maxLegendWidth=this.widthOption||s,i||(this.group=i=e.g("legend").attr({zIndex:7}).add(),this.contentGroup=e.g().attr({zIndex:1}).add(i),this.scrollGroup=e.g().add(this.contentGroup)),this.renderTitle();var a=this.getAllItems();g(a,(function(t,e){return(t.options&&t.options.legendIndex||0)-(e.options&&e.options.legendIndex||0)})),r.reversed&&a.reverse(),this.allItems=a,this.display=s=!!a.length,this.itemHeight=this.totalItemWidth=this.maxItemWidth=this.lastLineHeight=0,a.forEach(this.renderItem,this),a.forEach(this.layoutItem,this),a=(this.widthOption||this.offsetWidth)+o;var l=this.lastItemY+this.lastLineHeight+this.titleHeight;l=this.handleOverflow(l),l+=o,n||(this.box=n=e.rect().addClass("highcharts-legend-box").attr({r:r.borderRadius}).add(i),n.isNew=!0),t.styledMode||n.attr({stroke:r.borderColor,"stroke-width":r.borderWidth||0,fill:r.backgroundColor||"none"}).shadow(r.shadow),0<a&&0<l&&(n[n.isNew?"attr":"animate"](n.crisp.call({},{x:0,y:0,width:a,height:l},n.strokeWidth())),n.isNew=!1),n[s?"show":"hide"](),t.styledMode&&"none"===i.getStyle("display")&&(a=l=0),this.legendWidth=a,this.legendHeight=l,s&&this.align(),this.proximate||this.positionItems(),h(this,"afterRender")},t.prototype.align=function(t){void 0===t&&(t=this.chart.spacingBox);var e=this.chart,i=this.options,n=t.y;/(lth|ct|rth)/.test(this.getAlignment())&&0<e.titleOffset[0]?n+=e.titleOffset[0]:/(lbh|cb|rbh)/.test(this.getAlignment())&&0<e.titleOffset[2]&&(n-=e.titleOffset[2]),n!==t.y&&(t=p(t,{y:n})),this.group.align(p(i,{width:this.legendWidth,height:this.legendHeight,verticalAlign:this.proximate?"top":i.verticalAlign}),!0,t)},t.prototype.handleOverflow=function(t){var e=this,i=this.chart,n=i.renderer,r=this.options,o=r.y,s=this.padding;o=i.spacingBox.height+("top"===r.verticalAlign?-o:o)-s;var a,l,c=r.maxHeight,h=this.clipRect,u=r.navigation,d=f(u.animation,!0),p=u.arrowSize||12,m=this.nav,g=this.pages,v=this.allItems,y=function(t){"number"===typeof t?h.attr({height:t}):h&&(e.clipRect=h.destroy(),e.contentGroup.clip()),e.contentGroup.div&&(e.contentGroup.div.style.clip=t?"rect("+s+"px,9999px,"+(s+t)+"px,0)":"auto")},x=function(t){return e[t]=n.circle(0,0,1.3*p).translate(p/2,p/2).add(m),i.styledMode||e[t].attr("fill","rgba(0,0,0,0.0001)"),e[t]};return"horizontal"!==r.layout||"middle"===r.verticalAlign||r.floating||(o/=2),c&&(o=Math.min(o,c)),g.length=0,t>o&&!1!==u.enabled?(this.clipHeight=a=Math.max(o-20-this.titleHeight-s,0),this.currentPage=f(this.currentPage,1),this.fullHeight=t,v.forEach((function(t,e){var i=t._legendItemPos[1],n=Math.round(t.legendItem.getBBox().height),r=g.length;(!r||i-g[r-1]>a&&(l||i)!==g[r-1])&&(g.push(l||i),r++),t.pageIx=r-1,l&&(v[e-1].pageIx=r-1),e===v.length-1&&i+n-g[r-1]>a&&i!==l&&(g.push(i),t.pageIx=r),i!==l&&(l=i)})),h||(h=e.clipRect=n.clipRect(0,s,9999,0),e.contentGroup.clip(h)),y(a),m||(this.nav=m=n.g().attr({zIndex:1}).add(this.group),this.up=n.symbol("triangle",0,0,p,p).add(m),x("upTracker").on("click",(function(){e.scroll(-1,d)})),this.pager=n.text("",15,10).addClass("highcharts-legend-navigation"),i.styledMode||this.pager.css(u.style),this.pager.add(m),this.down=n.symbol("triangle-down",0,0,p,p).add(m),x("downTracker").on("click",(function(){e.scroll(1,d)}))),e.scroll(0),t=o):m&&(y(),this.nav=m.destroy(),this.scrollGroup.attr({translateY:1}),this.clipHeight=0),t},t.prototype.scroll=function(t,e){var i=this,o=this.chart,s=this.pages,a=s.length,l=this.currentPage+t;t=this.clipHeight;var c=this.options.navigation,u=this.pager,d=this.padding;l>a&&(l=a),0<l&&("undefined"!==typeof e&&r(e,o),this.nav.attr({translateX:d,translateY:t+this.padding+7+this.titleHeight,visibility:"visible"}),[this.up,this.upTracker].forEach((function(t){t.attr({class:1===l?"highcharts-legend-nav-inactive":"highcharts-legend-nav-active"})})),u.attr({text:l+"/"+a}),[this.down,this.downTracker].forEach((function(t){t.attr({x:18+this.pager.getBBox().width,class:l===a?"highcharts-legend-nav-inactive":"highcharts-legend-nav-active"})}),this),o.styledMode||(this.up.attr({fill:1===l?c.inactiveColor:c.activeColor}),this.upTracker.css({cursor:1===l?"default":"pointer"}),this.down.attr({fill:l===a?c.inactiveColor:c.activeColor}),this.downTracker.css({cursor:l===a?"default":"pointer"})),this.scrollOffset=-s[l-1]+this.initialItemY,this.scrollGroup.animate({translateY:this.scrollOffset}),this.currentPage=l,this.positionCheckboxes(),e=n(f(e,o.renderer.globalAnimation,!0)),v((function(){h(i,"afterScroll",{currentPage:l})}),e.duration))},t}();return(/Trident\/7\.0/.test(x.navigator&&x.navigator.userAgent)||i)&&t(b.prototype,"positionItem",(function(t,e){var i=this,n=function(){e._legendItemPos&&t.call(i,e)};n(),i.bubbleLegend||setTimeout(n)})),e.Legend=b,e.Legend})),e(i,"Core/Series/Point.js",[i["Core/Animation/AnimationUtilities.js"],i["Core/Globals.js"],i["Core/Utilities.js"]],(function(t,e,i){var n=t.animObject,r=i.defined,o=i.erase,s=i.extend,a=i.fireEvent,l=i.format,c=i.getNestedProperty,h=i.isArray,u=i.isNumber,d=i.isObject,p=i.syncTimeout,f=i.pick,m=i.removeEvent,g=i.uniqueKey;return t=function(){function t(){this.colorIndex=this.category=void 0,this.formatPrefix="point",this.id=void 0,this.isNull=!1,this.percentage=this.options=this.name=void 0,this.selected=!1,this.total=this.series=void 0,this.visible=!0,this.x=void 0}return t.prototype.animateBeforeDestroy=function(){var t,e=this,i={x:e.startXPos,opacity:0},n=e.getGraphicalProps();n.singular.forEach((function(n){t="dataLabel"===n,e[n]=e[n].animate(t?{x:e[n].startXPos,y:e[n].startYPos,opacity:0}:i)})),n.plural.forEach((function(t){e[t].forEach((function(t){t.element&&t.animate(s({x:e.startXPos},t.startYPos?{x:t.startXPos,y:t.startYPos}:{}))}))}))},t.prototype.applyOptions=function(e,i){var n=this.series,r=n.options.pointValKey||n.pointValKey;return e=t.prototype.optionsToObject.call(this,e),s(this,e),this.options=this.options?s(this.options,e):e,e.group&&delete this.group,e.dataLabels&&delete this.dataLabels,r&&(this.y=t.prototype.getNestedProperty.call(this,r)),this.formatPrefix=(this.isNull=f(this.isValid&&!this.isValid(),null===this.x||!u(this.y)))?"null":"point",this.selected&&(this.state="select"),"name"in this&&"undefined"===typeof i&&n.xAxis&&n.xAxis.hasNames&&(this.x=n.xAxis.nameToX(this)),"undefined"===typeof this.x&&n&&(this.x="undefined"===typeof i?n.autoIncrement(this):i),this},t.prototype.destroy=function(){function t(){for(s in(e.graphic||e.dataLabel||e.dataLabels)&&(m(e),e.destroyElements()),e)e[s]=null}var e=this,i=e.series,r=i.chart;i=i.options.dataSorting;var s,a=r.hoverPoints,l=n(e.series.chart.renderer.globalAnimation);e.legendItem&&r.legend.destroyItem(e),a&&(e.setState(),o(a,e),a.length||(r.hoverPoints=null)),e===r.hoverPoint&&e.onMouseOut(),i&&i.enabled?(this.animateBeforeDestroy(),p(t,l.duration)):t(),r.pointCount--},t.prototype.destroyElements=function(t){var e=this;t=e.getGraphicalProps(t),t.singular.forEach((function(t){e[t]=e[t].destroy()})),t.plural.forEach((function(t){e[t].forEach((function(t){t.element&&t.destroy()})),delete e[t]}))},t.prototype.firePointEvent=function(t,e,i){var n=this,r=this.series.options;(r.point.events[t]||n.options&&n.options.events&&n.options.events[t])&&n.importEvents(),"click"===t&&r.allowPointSelect&&(i=function(t){n.select&&n.select(null,t.ctrlKey||t.metaKey||t.shiftKey)}),a(n,t,e,i)},t.prototype.getClassName=function(){return"highcharts-point"+(this.selected?" highcharts-point-select":"")+(this.negative?" highcharts-negative":"")+(this.isNull?" highcharts-null-point":"")+("undefined"!==typeof this.colorIndex?" highcharts-color-"+this.colorIndex:"")+(this.options.className?" "+this.options.className:"")+(this.zone&&this.zone.className?" "+this.zone.className.replace("highcharts-negative",""):"")},t.prototype.getGraphicalProps=function(t){var e,i=this,n=[],r={singular:[],plural:[]};for(t=t||{graphic:1,dataLabel:1},t.graphic&&n.push("graphic","shadowGroup"),t.dataLabel&&n.push("dataLabel","dataLabelUpper","connector"),e=n.length;e--;){var o=n[e];i[o]&&r.singular.push(o)}return["dataLabel","connector"].forEach((function(e){var n=e+"s";t[e]&&i[n]&&r.plural.push(n)})),r},t.prototype.getLabelConfig=function(){return{x:this.category,y:this.y,color:this.color,colorIndex:this.colorIndex,key:this.name||this.category,series:this.series,point:this,percentage:this.percentage,total:this.total||this.stackTotal}},t.prototype.getNestedProperty=function(t){if(t)return 0===t.indexOf("custom.")?c(t,this.options):this[t]},t.prototype.getZone=function(){var t=this.series,e=t.zones;t=t.zoneAxis||"y";var i,n=0;for(i=e[n];this[t]>=i.value;)i=e[++n];return this.nonZonedColor||(this.nonZonedColor=this.color),this.color=i&&i.color&&!this.options.color?i.color:this.nonZonedColor,i},t.prototype.hasNewShapeType=function(){return(this.graphic&&(this.graphic.symbolName||this.graphic.element.nodeName))!==this.shapeType},t.prototype.init=function(t,e,i){return this.series=t,this.applyOptions(e,i),this.id=r(this.id)?this.id:g(),this.resolveColor(),t.chart.pointCount++,a(this,"afterInit"),this},t.prototype.optionsToObject=function(e){var i={},n=this.series,r=n.options.keys,o=r||n.pointArrayMap||["y"],s=o.length,a=0,l=0;if(u(e)||null===e)i[o[0]]=e;else if(h(e))for(!r&&e.length>s&&(n=typeof e[0],"string"===n?i.name=e[0]:"number"===n&&(i.x=e[0]),a++);l<s;)r&&"undefined"===typeof e[a]||(0<o[l].indexOf(".")?t.prototype.setNestedProperty(i,e[a],o[l]):i[o[l]]=e[a]),a++,l++;else"object"===typeof e&&(i=e,e.dataLabels&&(n._hasPointLabels=!0),e.marker&&(n._hasPointMarkers=!0));return i},t.prototype.resolveColor=function(){var t=this.series,e=t.chart.options.chart.colorCount,i=t.chart.styledMode;delete this.nonZonedColor,i||this.options.color||(this.color=t.color),t.options.colorByPoint?(i||(e=t.options.colors||t.chart.options.colors,this.color=this.color||e[t.colorCounter],e=e.length),i=t.colorCounter,t.colorCounter++,t.colorCounter===e&&(t.colorCounter=0)):i=t.colorIndex,this.colorIndex=f(this.colorIndex,i)},t.prototype.setNestedProperty=function(t,e,i){return i.split(".").reduce((function(t,i,n,r){return t[i]=r.length-1===n?e:d(t[i],!0)?t[i]:{},t[i]}),t),t},t.prototype.tooltipFormatter=function(t){var e=this.series,i=e.tooltipOptions,n=f(i.valueDecimals,""),r=i.valuePrefix||"",o=i.valueSuffix||"";return e.chart.styledMode&&(t=e.chart.tooltip.styledModeFormat(t)),(e.pointArrayMap||["y"]).forEach((function(e){e="{point."+e,(r||o)&&(t=t.replace(RegExp(e+"}","g"),r+e+"}"+o)),t=t.replace(RegExp(e+"}","g"),e+":,."+n+"f}")})),l(t,{point:this,series:this.series},e.chart)},t}(),e.Point=t})),e(i,"Core/Series/Series.js",[i["Core/Globals.js"],i["Core/Series/Point.js"],i["Core/Utilities.js"]],(function(t,e,i){var n=i.error,r=i.extendClass,o=i.fireEvent,s=i.getOptions,a=i.isObject,l=i.merge,c=i.objectEach;return i=function(){function t(e,i){var n=l(t.defaultOptions,i);this.chart=e,this._i=e.series.length,e.series.push(this),this.options=n,this.userOptions=l(i)}return t.addSeries=function(e,i){t.seriesTypes[e]=i},t.cleanRecursively=function(e,i){var n={};return c(e,(function(r,o){a(e[o],!0)&&!e.nodeType&&i[o]?(r=t.cleanRecursively(e[o],i[o]),Object.keys(r).length&&(n[o]=r)):(a(e[o])||e[o]!==i[o])&&(n[o]=e[o])})),n},t.getSeries=function(e,i){void 0===i&&(i={});var r=e.options.chart;r=i.type||r.type||r.defaultSeriesType||"";var o=t.seriesTypes[r];return o||n(17,!0,e,{missingModuleFor:r}),new o(e,i)},t.seriesType=function(i,n,o,a,c){var h=s().plotOptions||{},u=t.seriesTypes;return n=n||"",h[i]=l(h[n],o),t.addSeries(i,r(u[n]||function(){},a)),u[i].prototype.type=i,c&&(u[i].prototype.pointClass=r(e,c)),u[i]},t.prototype.update=function(e,i){void 0===i&&(i=!0);var n=this;e=t.cleanRecursively(e,this.userOptions);var r=e.type;return"undefined"!==typeof r&&r!==n.type&&(n=t.getSeries(n.chart,e)),o(n,"update",{newOptions:e}),n.userOptions=l(e),o(n,"afterUpdate",{newOptions:e}),i&&n.chart.redraw(),n},t.defaultOptions={type:"base"},t.seriesTypes={},t}(),i.prototype.pointClass=e,t.seriesType=i.seriesType,t.seriesTypes=i.seriesTypes,i})),e(i,"Core/Chart/Chart.js",[i["Core/Animation/AnimationUtilities.js"],i["Core/Axis/Axis.js"],i["Core/Series/Series.js"],i["Core/Globals.js"],i["Core/Legend.js"],i["Core/MSPointer.js"],i["Core/Options.js"],i["Core/Pointer.js"],i["Core/Time.js"],i["Core/Utilities.js"]],(function(t,e,i,n,r,o,s,a,l,c){var h=t.animate,u=t.animObject,d=t.setAnimation,p=n.charts,f=n.doc,m=n.win,g=s.defaultOptions,v=c.addEvent,y=c.attr,x=c.createElement,b=c.css,w=c.defined,_=c.discardElement,M=c.erase,S=c.error,T=c.extend,E=c.find,A=c.fireEvent,L=c.getStyle,C=c.isArray,P=c.isFunction,R=c.isNumber,O=c.isObject,k=c.isString,D=c.merge,I=c.numberFormat,N=c.objectEach,B=c.pick,z=c.pInt,F=c.relativeLength,U=c.removeEvent,G=c.splat,H=c.syncTimeout,j=c.uniqueKey,W=n.marginNames,V=function(){function t(t,e,i){this.yAxis=this.xAxis=this.userOptions=this.titleOffset=this.time=this.symbolCounter=this.spacingBox=this.spacing=this.series=this.renderTo=this.renderer=this.pointer=this.pointCount=this.plotWidth=this.plotTop=this.plotLeft=this.plotHeight=this.plotBox=this.options=this.numberFormatter=this.margin=this.legend=this.labelCollectors=this.isResizing=this.index=this.container=this.colorCounter=this.clipBox=this.chartWidth=this.chartHeight=this.bounds=this.axisOffset=this.axes=void 0,this.getArgs(t,e,i)}return t.prototype.getArgs=function(t,e,i){k(t)||t.nodeName?(this.renderTo=t,this.init(e,i)):this.init(t,e)},t.prototype.init=function(t,e){var i,r=t.series,o=t.plotOptions||{};A(this,"init",{args:arguments},(function(){t.series=null,i=D(g,t);var s=i.chart||{};N(i.plotOptions,(function(t,e){O(t)&&(t.tooltip=o[e]&&D(o[e].tooltip)||void 0)})),i.tooltip.userOptions=t.chart&&t.chart.forExport&&t.tooltip.userOptions||t.tooltip,i.series=t.series=r,this.userOptions=t;var a=s.events;this.margin=[],this.spacing=[],this.bounds={h:{},v:{}},this.labelCollectors=[],this.callback=e,this.isResizing=0,this.options=i,this.axes=[],this.series=[],this.time=t.time&&Object.keys(t.time).length?new l(t.time):n.time,this.numberFormatter=s.numberFormatter||I,this.styledMode=s.styledMode,this.hasCartesianSeries=s.showAxes;var c=this;c.index=p.length,p.push(c),n.chartCount++,a&&N(a,(function(t,e){P(t)&&v(c,e,t)})),c.xAxis=[],c.yAxis=[],c.pointCount=c.colorCounter=c.symbolCounter=0,A(c,"afterInit"),c.firstRender()}))},t.prototype.initSeries=function(t){var e=this.options.chart;e=t.type||e.type||e.defaultSeriesType;var n=i.seriesTypes[e];return n||S(17,!0,this,{missingModuleFor:e}),e=new n(this,t),"function"===typeof e.init&&e.init(this,t),e},t.prototype.setSeriesData=function(){this.getSeriesOrderByLinks().forEach((function(t){t.points||t.data||!t.enabledDataSorting||t.setData(t.options.data,!1)}))},t.prototype.getSeriesOrderByLinks=function(){return this.series.concat().sort((function(t,e){return t.linkedSeries.length||e.linkedSeries.length?e.linkedSeries.length-t.linkedSeries.length:0}))},t.prototype.orderSeries=function(t){var e=this.series;for(t=t||0;t<e.length;t++)e[t]&&(e[t].index=t,e[t].name=e[t].getName())},t.prototype.isInsidePlot=function(t,e,i){var n=i?e:t;return t=i?t:e,n={x:n,y:t,isInsidePlot:0<=n&&n<=this.plotWidth&&0<=t&&t<=this.plotHeight},A(this,"afterIsInsidePlot",n),n.isInsidePlot},t.prototype.redraw=function(t){A(this,"beforeRedraw");var e=this,i=e.axes,n=e.series,r=e.pointer,o=e.legend,s=e.userOptions.legend,a=e.isDirtyLegend,l=e.hasCartesianSeries,c=e.isDirtyBox,h=e.renderer,u=h.isHidden(),p=[];for(e.setResponsive&&e.setResponsive(!1),d(!!e.hasRendered&&t,e),u&&e.temporaryDisplay(),e.layOutTitles(),t=n.length;t--;){var f=n[t];if(f.options.stacking){var m=!0;if(f.isDirty){var g=!0;break}}}if(g)for(t=n.length;t--;)f=n[t],f.options.stacking&&(f.isDirty=!0);n.forEach((function(t){t.isDirty&&("point"===t.options.legendType?("function"===typeof t.updateTotals&&t.updateTotals(),a=!0):s&&(s.labelFormatter||s.labelFormat)&&(a=!0)),t.isDirtyData&&A(t,"updatedData")})),a&&o&&o.options.enabled&&(o.render(),e.isDirtyLegend=!1),m&&e.getStacks(),l&&i.forEach((function(t){e.isResizing&&R(t.min)||(t.updateNames(),t.setScale())})),e.getMargins(),l&&(i.forEach((function(t){t.isDirty&&(c=!0)})),i.forEach((function(t){var e=t.min+","+t.max;t.extKey!==e&&(t.extKey=e,p.push((function(){A(t,"afterSetExtremes",T(t.eventArgs,t.getExtremes())),delete t.eventArgs}))),(c||m)&&t.redraw()}))),c&&e.drawChartBox(),A(e,"predraw"),n.forEach((function(t){(c||t.isDirty)&&t.visible&&t.redraw(),t.isDirtyData=!1})),r&&r.reset(!0),h.draw(),A(e,"redraw"),A(e,"render"),u&&e.temporaryDisplay(!0),p.forEach((function(t){t.call()}))},t.prototype.get=function(t){function e(e){return e.id===t||e.options&&e.options.id===t}var i,n=this.series,r=E(this.axes,e)||E(this.series,e);for(i=0;!r&&i<n.length;i++)r=E(n[i].points||[],e);return r},t.prototype.getAxes=function(){var t=this,i=this.options,n=i.xAxis=G(i.xAxis||{});i=i.yAxis=G(i.yAxis||{}),A(this,"getAxes"),n.forEach((function(t,e){t.index=e,t.isX=!0})),i.forEach((function(t,e){t.index=e})),n.concat(i).forEach((function(i){new e(t,i)})),A(this,"afterGetAxes")},t.prototype.getSelectedPoints=function(){var t=[];return this.series.forEach((function(e){t=t.concat(e.getPointsCollection().filter((function(t){return B(t.selectedStaging,t.selected)})))})),t},t.prototype.getSelectedSeries=function(){return this.series.filter((function(t){return t.selected}))},t.prototype.setTitle=function(t,e,i){this.applyDescription("title",t),this.applyDescription("subtitle",e),this.applyDescription("caption",void 0),this.layOutTitles(i)},t.prototype.applyDescription=function(t,e){var i=this,n="title"===t?{color:"#333333",fontSize:this.options.isStock?"16px":"18px"}:{color:"#666666"};n=this.options[t]=D(!this.styledMode&&{style:n},this.options[t],e);var r=this[t];r&&e&&(this[t]=r=r.destroy()),n&&!r&&(r=this.renderer.text(n.text,0,0,n.useHTML).attr({align:n.align,class:"highcharts-"+t,zIndex:n.zIndex||4}).add(),r.update=function(e){i[{title:"setTitle",subtitle:"setSubtitle",caption:"setCaption"}[t]](e)},this.styledMode||r.css(n.style),this[t]=r)},t.prototype.layOutTitles=function(t){var e=[0,0,0],i=this.renderer,n=this.spacingBox;["title","subtitle","caption"].forEach((function(t){var r=this[t],o=this.options[t],s=o.verticalAlign||"top";if(t="title"===t?-3:"top"===s?e[0]+2:0,r){if(!this.styledMode)var a=o.style.fontSize;a=i.fontMetrics(a,r).b,r.css({width:(o.width||n.width+(o.widthAdjust||0))+"px"});var l=Math.round(r.getBBox(o.useHTML).height);r.align(T({y:"bottom"===s?a:t+a,height:l},o),!1,"spacingBox"),o.floating||("top"===s?e[0]=Math.ceil(e[0]+l):"bottom"===s&&(e[2]=Math.ceil(e[2]+l)))}}),this),e[0]&&"top"===(this.options.title.verticalAlign||"top")&&(e[0]+=this.options.title.margin),e[2]&&"bottom"===this.options.caption.verticalAlign&&(e[2]+=this.options.caption.margin);var r=!this.titleOffset||this.titleOffset.join(",")!==e.join(",");this.titleOffset=e,A(this,"afterLayOutTitles"),!this.isDirtyBox&&r&&(this.isDirtyBox=this.isDirtyLegend=r,this.hasRendered&&B(t,!0)&&this.isDirtyBox&&this.redraw())},t.prototype.getChartSize=function(){var t=this.options.chart,e=t.width;t=t.height;var i=this.renderTo;w(e)||(this.containerWidth=L(i,"width")),w(t)||(this.containerHeight=L(i,"height")),this.chartWidth=Math.max(0,e||this.containerWidth||600),this.chartHeight=Math.max(0,F(t,this.chartWidth)||(1<this.containerHeight?this.containerHeight:400))},t.prototype.temporaryDisplay=function(t){var e=this.renderTo;if(t)for(;e&&e.style;)e.hcOrigStyle&&(b(e,e.hcOrigStyle),delete e.hcOrigStyle),e.hcOrigDetached&&(f.body.removeChild(e),e.hcOrigDetached=!1),e=e.parentNode;else for(;e&&e.style;)if(f.body.contains(e)||e.parentNode||(e.hcOrigDetached=!0,f.body.appendChild(e)),("none"===L(e,"display",!1)||e.hcOricDetached)&&(e.hcOrigStyle={display:e.style.display,height:e.style.height,overflow:e.style.overflow},t={display:"block",overflow:"hidden"},e!==this.renderTo&&(t.height=0),b(e,t),e.offsetWidth||e.style.setProperty("display","block","important")),e=e.parentNode,e===f.body)break},t.prototype.setClassName=function(t){this.container.className="highcharts-container "+(t||"")},t.prototype.getContainer=function(){var t,e,i=this.options,r=i.chart,o=this.renderTo,s=j();o||(this.renderTo=o=r.renderTo),k(o)&&(this.renderTo=o=f.getElementById(o)),o||S(13,!0,this);var a=z(y(o,"data-highcharts-chart"));R(a)&&p[a]&&p[a].hasRendered&&p[a].destroy(),y(o,"data-highcharts-chart",this.index),o.innerHTML="",r.skipClone||o.offsetWidth||this.temporaryDisplay(),this.getChartSize(),a=this.chartWidth;var l=this.chartHeight;if(b(o,{overflow:"hidden"}),this.styledMode||(t=T({position:"relative",overflow:"hidden",width:a+"px",height:l+"px",textAlign:"left",lineHeight:"normal",zIndex:0,"-webkit-tap-highlight-color":"rgba(0,0,0,0)",userSelect:"none"},r.style)),this.container=o=x("div",{id:s},t,o),this._cursor=o.style.cursor,this.renderer=new(n[r.renderer]||n.Renderer)(o,a,l,null,r.forExport,i.exporting&&i.exporting.allowHTML,this.styledMode),d(void 0,this),this.setClassName(r.className),this.styledMode)for(e in i.defs)this.renderer.definition(i.defs[e]);else this.renderer.setStyle(r.style);this.renderer.chartIndex=this.index,A(this,"afterGetContainer")},t.prototype.getMargins=function(t){var e=this.spacing,i=this.margin,n=this.titleOffset;this.resetMargins(),n[0]&&!w(i[0])&&(this.plotTop=Math.max(this.plotTop,n[0]+e[0])),n[2]&&!w(i[2])&&(this.marginBottom=Math.max(this.marginBottom,n[2]+e[2])),this.legend&&this.legend.display&&this.legend.adjustMargins(i,e),A(this,"getMargins"),t||this.getAxisMargins()},t.prototype.getAxisMargins=function(){var t=this,e=t.axisOffset=[0,0,0,0],i=t.colorAxis,n=t.margin,r=function(t){t.forEach((function(t){t.visible&&t.getOffset()}))};t.hasCartesianSeries?r(t.axes):i&&i.length&&r(i),W.forEach((function(i,r){w(n[r])||(t[i]+=e[r])})),t.setChartSize()},t.prototype.reflow=function(t){var e=this,i=e.options.chart,n=e.renderTo,r=w(i.width)&&w(i.height),o=i.width||L(n,"width");i=i.height||L(n,"height"),n=t?t.target:m,r||e.isPrinting||!o||!i||n!==m&&n!==f||(o===e.containerWidth&&i===e.containerHeight||(c.clearTimeout(e.reflowTimeout),e.reflowTimeout=H((function(){e.container&&e.setSize(void 0,void 0,!1)}),t?100:0)),e.containerWidth=o,e.containerHeight=i)},t.prototype.setReflow=function(t){var e=this;!1===t||this.unbindReflow?!1===t&&this.unbindReflow&&(this.unbindReflow=this.unbindReflow()):(this.unbindReflow=v(m,"resize",(function(t){e.options&&e.reflow(t)})),v(this,"destroy",this.unbindReflow))},t.prototype.setSize=function(t,e,i){var n=this,r=n.renderer;n.isResizing+=1,d(i,n),i=r.globalAnimation,n.oldChartHeight=n.chartHeight,n.oldChartWidth=n.chartWidth,"undefined"!==typeof t&&(n.options.chart.width=t),"undefined"!==typeof e&&(n.options.chart.height=e),n.getChartSize(),n.styledMode||(i?h:b)(n.container,{width:n.chartWidth+"px",height:n.chartHeight+"px"},i),n.setChartSize(!0),r.setSize(n.chartWidth,n.chartHeight,i),n.axes.forEach((function(t){t.isDirty=!0,t.setScale()})),n.isDirtyLegend=!0,n.isDirtyBox=!0,n.layOutTitles(),n.getMargins(),n.redraw(i),n.oldChartHeight=null,A(n,"resize"),H((function(){n&&A(n,"endResize",null,(function(){--n.isResizing}))}),u(i).duration)},t.prototype.setChartSize=function(t){var e,i,n,r,o=this.inverted,s=this.renderer,a=this.chartWidth,l=this.chartHeight,c=this.options.chart,h=this.spacing,u=this.clipOffset;this.plotLeft=e=Math.round(this.plotLeft),this.plotTop=i=Math.round(this.plotTop),this.plotWidth=n=Math.max(0,Math.round(a-e-this.marginRight)),this.plotHeight=r=Math.max(0,Math.round(l-i-this.marginBottom)),this.plotSizeX=o?r:n,this.plotSizeY=o?n:r,this.plotBorderWidth=c.plotBorderWidth||0,this.spacingBox=s.spacingBox={x:h[3],y:h[0],width:a-h[3]-h[1],height:l-h[0]-h[2]},this.plotBox=s.plotBox={x:e,y:i,width:n,height:r},a=2*Math.floor(this.plotBorderWidth/2),o=Math.ceil(Math.max(a,u[3])/2),s=Math.ceil(Math.max(a,u[0])/2),this.clipBox={x:o,y:s,width:Math.floor(this.plotSizeX-Math.max(a,u[1])/2-o),height:Math.max(0,Math.floor(this.plotSizeY-Math.max(a,u[2])/2-s))},t||this.axes.forEach((function(t){t.setAxisSize(),t.setAxisTranslation()})),A(this,"afterSetChartSize",{skipAxes:t})},t.prototype.resetMargins=function(){A(this,"resetMargins");var t=this,e=t.options.chart;["margin","spacing"].forEach((function(i){var n=e[i],r=O(n)?n:[n,n,n,n];["Top","Right","Bottom","Left"].forEach((function(n,o){t[i][o]=B(e[i+n],r[o])}))})),W.forEach((function(e,i){t[e]=B(t.margin[i],t.spacing[i])})),t.axisOffset=[0,0,0,0],t.clipOffset=[0,0,0,0]},t.prototype.drawChartBox=function(){var t,e=this.options.chart,i=this.renderer,n=this.chartWidth,r=this.chartHeight,o=this.chartBackground,s=this.plotBackground,a=this.plotBorder,l=this.styledMode,c=this.plotBGImage,h=e.backgroundColor,u=e.plotBackgroundColor,d=e.plotBackgroundImage,p=this.plotLeft,f=this.plotTop,m=this.plotWidth,g=this.plotHeight,v=this.plotBox,y=this.clipRect,x=this.clipBox,b="animate";if(o||(this.chartBackground=o=i.rect().addClass("highcharts-background").add(),b="attr"),l)var w=t=o.strokeWidth();else w=e.borderWidth||0,t=w+(e.shadow?8:0),h={fill:h||"none"},(w||o["stroke-width"])&&(h.stroke=e.borderColor,h["stroke-width"]=w),o.attr(h).shadow(e.shadow);o[b]({x:t/2,y:t/2,width:n-t-w%2,height:r-t-w%2,r:e.borderRadius}),b="animate",s||(b="attr",this.plotBackground=s=i.rect().addClass("highcharts-plot-background").add()),s[b](v),l||(s.attr({fill:u||"none"}).shadow(e.plotShadow),d&&(c?(d!==c.attr("href")&&c.attr("href",d),c.animate(v)):this.plotBGImage=i.image(d,p,f,m,g).add())),y?y.animate({width:x.width,height:x.height}):this.clipRect=i.clipRect(x),b="animate",a||(b="attr",this.plotBorder=a=i.rect().addClass("highcharts-plot-border").attr({zIndex:1}).add()),l||a.attr({stroke:e.plotBorderColor,"stroke-width":e.plotBorderWidth||0,fill:"none"}),a[b](a.crisp({x:p,y:f,width:m,height:g},-a.strokeWidth())),this.isDirtyBox=!1,A(this,"afterDrawChartBox")},t.prototype.propFromSeries=function(){var t,e,n,r=this,o=r.options.chart,s=r.options.series;["inverted","angular","polar"].forEach((function(a){for(t=i.seriesTypes[o.type||o.defaultSeriesType],n=o[a]||t&&t.prototype[a],e=s&&s.length;!n&&e--;)(t=i.seriesTypes[s[e].type])&&t.prototype[a]&&(n=!0);r[a]=n}))},t.prototype.linkSeries=function(){var t=this,e=t.series;e.forEach((function(t){t.linkedSeries.length=0})),e.forEach((function(e){var i=e.options.linkedTo;k(i)&&(i=":previous"===i?t.series[e.index-1]:t.get(i))&&i.linkedParent!==e&&(i.linkedSeries.push(e),e.linkedParent=i,i.enabledDataSorting&&e.setDataSortingOptions(),e.visible=B(e.options.visible,i.options.visible,e.visible))})),A(this,"afterLinkSeries")},t.prototype.renderSeries=function(){this.series.forEach((function(t){t.translate(),t.render()}))},t.prototype.renderLabels=function(){var t=this,e=t.options.labels;e.items&&e.items.forEach((function(i){var n=T(e.style,i.style),r=z(n.left)+t.plotLeft,o=z(n.top)+t.plotTop+12;delete n.left,delete n.top,t.renderer.text(i.html,r,o).attr({zIndex:2}).css(n).add()}))},t.prototype.render=function(){var t=this.axes,e=this.colorAxis,i=this.renderer,n=this.options,o=0,s=function(t){t.forEach((function(t){t.visible&&t.render()}))};this.setTitle(),this.legend=new r(this,n.legend),this.getStacks&&this.getStacks(),this.getMargins(!0),this.setChartSize(),n=this.plotWidth,t.some((function(t){if(t.horiz&&t.visible&&t.options.labels.enabled&&t.series.length)return o=21,!0}));var a=this.plotHeight=Math.max(this.plotHeight-o,0);t.forEach((function(t){t.setScale()})),this.getAxisMargins();var l=1.1<n/this.plotWidth,c=1.05<a/this.plotHeight;(l||c)&&(t.forEach((function(t){(t.horiz&&l||!t.horiz&&c)&&t.setTickInterval(!0)})),this.getMargins()),this.drawChartBox(),this.hasCartesianSeries?s(t):e&&e.length&&s(e),this.seriesGroup||(this.seriesGroup=i.g("series-group").attr({zIndex:3}).add()),this.renderSeries(),this.renderLabels(),this.addCredits(),this.setResponsive&&this.setResponsive(),this.updateContainerScaling(),this.hasRendered=!0},t.prototype.addCredits=function(t){var e=this,i=D(!0,this.options.credits,t);i.enabled&&!this.credits&&(this.credits=this.renderer.text(i.text+(this.mapCredits||""),0,0).addClass("highcharts-credits").on("click",(function(){i.href&&(m.location.href=i.href)})).attr({align:i.position.align,zIndex:8}),e.styledMode||this.credits.css(i.style),this.credits.add().align(i.position),this.credits.update=function(t){e.credits=e.credits.destroy(),e.addCredits(t)})},t.prototype.updateContainerScaling=function(){var t=this.container;if(2<t.offsetWidth&&2<t.offsetHeight&&t.getBoundingClientRect){var e=t.getBoundingClientRect(),i=e.width/t.offsetWidth;t=e.height/t.offsetHeight,1!==i||1!==t?this.containerScaling={scaleX:i,scaleY:t}:delete this.containerScaling}},t.prototype.destroy=function(){var t,e=this,i=e.axes,r=e.series,o=e.container,s=o&&o.parentNode;for(A(e,"destroy"),e.renderer.forExport?M(p,e):p[e.index]=void 0,n.chartCount--,e.renderTo.removeAttribute("data-highcharts-chart"),U(e),t=i.length;t--;)i[t]=i[t].destroy();for(this.scroller&&this.scroller.destroy&&this.scroller.destroy(),t=r.length;t--;)r[t]=r[t].destroy();"title subtitle chartBackground plotBackground plotBGImage plotBorder seriesGroup clipRect credits pointer rangeSelector legend resetZoomButton tooltip renderer".split(" ").forEach((function(t){var i=e[t];i&&i.destroy&&(e[t]=i.destroy())})),o&&(o.innerHTML="",U(o),s&&_(o)),N(e,(function(t,i){delete e[i]}))},t.prototype.firstRender=function(){var t=this,e=t.options;t.isReadyToRender&&!t.isReadyToRender()||(t.getContainer(),t.resetMargins(),t.setChartSize(),t.propFromSeries(),t.getAxes(),(C(e.series)?e.series:[]).forEach((function(e){t.initSeries(e)})),t.linkSeries(),t.setSeriesData(),A(t,"beforeRender"),a&&(t.pointer=n.hasTouch||!m.PointerEvent&&!m.MSPointerEvent?new a(t,e):new o(t,e)),t.render(),t.renderer.imgCount||t.hasLoaded||t.onload(),t.temporaryDisplay(!0))},t.prototype.onload=function(){this.callbacks.concat([this.callback]).forEach((function(t){t&&"undefined"!==typeof this.index&&t.apply(this,[this])}),this),A(this,"load"),A(this,"render"),w(this.index)&&this.setReflow(this.options.chart.reflow),this.hasLoaded=!0},t}();return V.prototype.callbacks=[],n.chart=function(t,e,i){return new V(t,e,i)},n.Chart=V})),e(i,"Extensions/ScrollablePlotArea.js",[i["Core/Animation/AnimationUtilities.js"],i["Core/Chart/Chart.js"],i["Core/Globals.js"],i["Core/Utilities.js"]],(function(t,e,i,n){var r=t.stop,o=n.addEvent,s=n.createElement,a=n.pick;o(e,"afterSetChartSize",(function(t){var e=this.options.chart.scrollablePlotArea,n=e&&e.minWidth;if(e=e&&e.minHeight,!this.renderer.forExport){if(n){if(this.scrollablePixelsX=n=Math.max(0,n-this.chartWidth)){this.plotWidth+=n,this.inverted?(this.clipBox.height+=n,this.plotBox.height+=n):(this.clipBox.width+=n,this.plotBox.width+=n);var r={1:{name:"right",value:n}}}}else e&&(this.scrollablePixelsY=n=Math.max(0,e-this.chartHeight))&&(this.plotHeight+=n,this.inverted?(this.clipBox.width+=n,this.plotBox.width+=n):(this.clipBox.height+=n,this.plotBox.height+=n),r={2:{name:"bottom",value:n}});r&&!t.skipAxes&&this.axes.forEach((function(t){r[t.side]?t.getPlotLinePath=function(){var e=r[t.side].name,n=this[e];this[e]=n-r[t.side].value;var o=i.Axis.prototype.getPlotLinePath.apply(this,arguments);return this[e]=n,o}:(t.setAxisSize(),t.setAxisTranslation())}))}})),o(e,"render",(function(){this.scrollablePixelsX||this.scrollablePixelsY?(this.setUpScrolling&&this.setUpScrolling(),this.applyFixed()):this.fixedDiv&&this.applyFixed()})),e.prototype.setUpScrolling=function(){var t=this,e={WebkitOverflowScrolling:"touch",overflowX:"hidden",overflowY:"hidden"};this.scrollablePixelsX&&(e.overflowX="auto"),this.scrollablePixelsY&&(e.overflowY="auto"),this.scrollingParent=s("div",{className:"highcharts-scrolling-parent"},{position:"relative"},this.renderTo),this.scrollingContainer=s("div",{className:"highcharts-scrolling"},e,this.scrollingParent),o(this.scrollingContainer,"scroll",(function(){t.pointer&&delete t.pointer.chartPosition})),this.innerContainer=s("div",{className:"highcharts-inner-container"},null,this.scrollingContainer),this.innerContainer.appendChild(this.container),this.setUpScrolling=null},e.prototype.moveFixedElements=function(){var t,e=this.container,i=this.fixedRenderer,n=".highcharts-contextbutton .highcharts-credits .highcharts-legend .highcharts-legend-checkbox .highcharts-navigator-series .highcharts-navigator-xaxis .highcharts-navigator-yaxis .highcharts-navigator .highcharts-reset-zoom .highcharts-scrollbar .highcharts-subtitle .highcharts-title".split(" ");this.scrollablePixelsX&&!this.inverted?t=".highcharts-yaxis":this.scrollablePixelsX&&this.inverted||this.scrollablePixelsY&&!this.inverted?t=".highcharts-xaxis":this.scrollablePixelsY&&this.inverted&&(t=".highcharts-yaxis"),n.push(t,t+"-labels"),n.forEach((function(t){[].forEach.call(e.querySelectorAll(t),(function(t){(t.namespaceURI===i.SVG_NS?i.box:i.box.parentNode).appendChild(t),t.style.pointerEvents="auto"}))}))},e.prototype.applyFixed=function(){var t,e,n=!this.fixedDiv,l=this.options.chart.scrollablePlotArea;n?(this.fixedDiv=s("div",{className:"highcharts-fixed"},{position:"absolute",overflow:"hidden",pointerEvents:"none",zIndex:2,top:0},null,!0),null===(t=this.scrollingContainer)||void 0===t||t.parentNode.insertBefore(this.fixedDiv,this.scrollingContainer),this.renderTo.style.overflow="visible",this.fixedRenderer=t=new i.Renderer(this.fixedDiv,this.chartWidth,this.chartHeight,null===(e=this.options.chart)||void 0===e?void 0:e.style),this.scrollableMask=t.path().attr({fill:this.options.chart.backgroundColor||"#fff","fill-opacity":a(l.opacity,.85),zIndex:-1}).addClass("highcharts-scrollable-mask").add(),this.moveFixedElements(),o(this,"afterShowResetZoom",this.moveFixedElements),o(this,"afterLayOutTitles",this.moveFixedElements)):this.fixedRenderer.setSize(this.chartWidth,this.chartHeight),e=this.chartWidth+(this.scrollablePixelsX||0),t=this.chartHeight+(this.scrollablePixelsY||0),r(this.container),this.container.style.width=e+"px",this.container.style.height=t+"px",this.renderer.boxWrapper.attr({width:e,height:t,viewBox:[0,0,e,t].join(" ")}),this.chartBackground.attr({width:e,height:t}),this.scrollingContainer.style.height=this.chartHeight+"px",n&&(l.scrollPositionX&&(this.scrollingContainer.scrollLeft=this.scrollablePixelsX*l.scrollPositionX),l.scrollPositionY&&(this.scrollingContainer.scrollTop=this.scrollablePixelsY*l.scrollPositionY)),t=this.axisOffset,n=this.plotTop-t[0]-1,l=this.plotLeft-t[3]-1,e=this.plotTop+this.plotHeight+t[2]+1,t=this.plotLeft+this.plotWidth+t[1]+1;var c=this.plotLeft+this.plotWidth-(this.scrollablePixelsX||0),h=this.plotTop+this.plotHeight-(this.scrollablePixelsY||0);n=this.scrollablePixelsX?[["M",0,n],["L",this.plotLeft-1,n],["L",this.plotLeft-1,e],["L",0,e],["Z"],["M",c,n],["L",this.chartWidth,n],["L",this.chartWidth,e],["L",c,e],["Z"]]:this.scrollablePixelsY?[["M",l,0],["L",l,this.plotTop-1],["L",t,this.plotTop-1],["L",t,0],["Z"],["M",l,h],["L",l,this.chartHeight],["L",t,this.chartHeight],["L",t,h],["Z"]]:[["M",0,0]],"adjustHeight"!==this.redrawTrigger&&this.scrollableMask.attr({d:n})}})),e(i,"Core/Axis/StackingAxis.js",[i["Core/Animation/AnimationUtilities.js"],i["Core/Utilities.js"]],(function(t,e){var i=t.getDeferredAnimation,n=e.addEvent,r=e.destroyObjectProperties,o=e.fireEvent,s=e.objectEach,a=e.pick,l=function(){function t(t){this.oldStacks={},this.stacks={},this.stacksTouched=0,this.axis=t}return t.prototype.buildStacks=function(){var t,e=this.axis,i=e.series,n=a(e.options.reversedStacks,!0),r=i.length;if(!e.isXAxis){for(this.usePercentage=!1,t=r;t--;){var s=i[n?t:r-t-1];s.setStackedPoints(),s.setGroupedPoints()}for(t=0;t<r;t++)i[t].modifyStacks();o(e,"afterBuildStacks")}},t.prototype.cleanStacks=function(){if(!this.axis.isXAxis){if(this.oldStacks)var t=this.stacks=this.oldStacks;s(t,(function(t){s(t,(function(t){t.cumulative=t.total}))}))}},t.prototype.resetStacks=function(){var t=this,e=t.stacks;t.axis.isXAxis||s(e,(function(e){s(e,(function(i,n){i.touched<t.stacksTouched?(i.destroy(),delete e[n]):(i.total=null,i.cumulative=null)}))}))},t.prototype.renderStackTotals=function(){var t=this.axis,e=t.chart,n=e.renderer,r=this.stacks;t=i(e,t.options.stackLabels.animation);var o=this.stackTotalGroup=this.stackTotalGroup||n.g("stack-labels").attr({visibility:"visible",zIndex:6,opacity:0}).add();o.translate(e.plotLeft,e.plotTop),s(r,(function(t){s(t,(function(t){t.render(o)}))})),o.animate({opacity:1},t)},t}();return function(){function t(){}return t.compose=function(e){n(e,"init",t.onInit),n(e,"destroy",t.onDestroy)},t.onDestroy=function(){var t=this.stacking;if(t){var e=t.stacks;s(e,(function(t,i){r(t),e[i]=null})),t&&t.stackTotalGroup&&t.stackTotalGroup.destroy()}},t.onInit=function(){this.stacking||(this.stacking=new l(this))},t}()})),e(i,"Mixins/LegendSymbol.js",[i["Core/Globals.js"],i["Core/Utilities.js"]],(function(t,e){var i=e.merge,n=e.pick;return t.LegendSymbolMixin={drawRectangle:function(t,e){var i=t.symbolHeight,r=t.options.squareSymbol;e.legendSymbol=this.chart.renderer.rect(r?(t.symbolWidth-i)/2:0,t.baseline-i+1,r?i:t.symbolWidth,i,n(t.options.symbolRadius,i/2)).addClass("highcharts-point").attr({zIndex:3}).add(e.legendGroup)},drawLineMarker:function(t){var e=this.options,r=e.marker,o=t.symbolWidth,s=t.symbolHeight,a=s/2,l=this.chart.renderer,c=this.legendGroup;t=t.baseline-Math.round(.3*t.fontMetrics.b);var h={};this.chart.styledMode||(h={"stroke-width":e.lineWidth||0},e.dashStyle&&(h.dashstyle=e.dashStyle)),this.legendLine=l.path([["M",0,t],["L",o,t]]).addClass("highcharts-graph").attr(h).add(c),r&&!1!==r.enabled&&o&&(e=Math.min(n(r.radius,a),a),0===this.symbol.indexOf("url")&&(r=i(r,{width:s,height:s}),e=0),this.legendSymbol=r=l.symbol(this.symbol,o/2-e,t-e,2*e,2*e,r).addClass("highcharts-point").add(c),r.isMarker=!0)}}})),e(i,"Core/Series/CartesianSeries.js",[i["Core/Animation/AnimationUtilities.js"],i["Core/Series/Series.js"],i["Core/Globals.js"],i["Mixins/LegendSymbol.js"],i["Core/Options.js"],i["Core/Series/Point.js"],i["Core/Renderer/SVG/SVGElement.js"],i["Core/Utilities.js"]],(function(t,e,i,n,r,o,s,a){var l=t.animObject,c=r.defaultOptions,h=a.addEvent,u=a.arrayMax,d=a.arrayMin,p=a.clamp,f=a.correctFloat,m=a.defined,g=a.erase,v=a.error,y=a.extend,x=a.find,b=a.fireEvent,w=a.getNestedProperty,_=a.isArray,M=a.isFunction,S=a.isNumber,T=a.isString,E=a.merge,A=a.objectEach,L=a.pick,C=a.removeEvent,P=a.splat,R=a.syncTimeout,O=e.seriesTypes,k=i.win;return t=e.seriesType("line",void 0,{lineWidth:2,allowPointSelect:!1,crisp:!0,showCheckbox:!1,animation:{duration:1e3},events:{},marker:{enabledThreshold:2,lineColor:"#ffffff",lineWidth:0,radius:4,states:{normal:{animation:!0},hover:{animation:{duration:50},enabled:!0,radiusPlus:2,lineWidthPlus:1},select:{fillColor:"#cccccc",lineColor:"#000000",lineWidth:2}}},point:{events:{}},dataLabels:{animation:{},align:"center",defer:!0,formatter:function(){var t=this.series.chart.numberFormatter;return"number"!==typeof this.y?"":t(this.y,-1)},padding:5,style:{fontSize:"11px",fontWeight:"bold",color:"contrast",textOutline:"1px contrast"},verticalAlign:"bottom",x:0,y:0},cropThreshold:300,opacity:1,pointRange:0,softThreshold:!0,states:{normal:{animation:!0},hover:{animation:{duration:50},lineWidthPlus:1,marker:{},halo:{size:10,opacity:.25}},select:{animation:{duration:0}},inactive:{animation:{duration:50},opacity:.2}},stickyTracking:!0,turboThreshold:1e3,findNearestPointBy:"x"},{axisTypes:["xAxis","yAxis"],coll:"series",colorCounter:0,cropShoulder:1,directTouch:!1,isCartesian:!0,parallelArrays:["x","y"],pointClass:o,requireSorting:!0,sorted:!0,init:function(t,e){b(this,"init",{options:e});var i,n=this,r=t.series;this.eventOptions=this.eventOptions||{},this.eventsToUnbind=[],n.chart=t,n.options=e=n.setOptions(e),n.linkedSeries=[],n.bindAxes(),y(n,{name:e.name,state:"",visible:!1!==e.visible,selected:!0===e.selected});var o=e.events;A(o,(function(t,e){M(t)&&n.eventOptions[e]!==t&&(M(n.eventOptions[e])&&C(n,e,n.eventOptions[e]),n.eventOptions[e]=t,h(n,e,t))})),(o&&o.click||e.point&&e.point.events&&e.point.events.click||e.allowPointSelect)&&(t.runTrackerClick=!0),n.getColor(),n.getSymbol(),n.parallelArrays.forEach((function(t){n[t+"Data"]||(n[t+"Data"]=[])})),n.isCartesian&&(t.hasCartesianSeries=!0),r.length&&(i=r[r.length-1]),n._i=L(i&&i._i,-1)+1,n.opacity=n.options.opacity,t.orderSeries(this.insert(r)),e.dataSorting&&e.dataSorting.enabled?n.setDataSortingOptions():n.points||n.data||n.setData(e.data,!1),b(this,"afterInit")},is:function(t){return O[t]&&this instanceof O[t]},insert:function(t){var e,i=this.options.index;if(S(i)){for(e=t.length;e--;)if(i>=L(t[e].options.index,t[e]._i)){t.splice(e+1,0,this);break}-1===e&&t.unshift(this),e+=1}else t.push(this);return L(e,t.length-1)},bindAxes:function(){var t,e=this,i=e.options,n=e.chart;b(this,"bindAxes",null,(function(){(e.axisTypes||[]).forEach((function(r){n[r].forEach((function(n){t=n.options,(i[r]===t.index||"undefined"!==typeof i[r]&&i[r]===t.id||"undefined"===typeof i[r]&&0===t.index)&&(e.insert(n.series),e[r]=n,n.isDirty=!0)})),e[r]||e.optionalAxis===r||v(18,!0,n)}))})),b(this,"afterBindAxes")},updateParallelArrays:function(t,e){var i=t.series,n=arguments,r=S(e)?function(n){var r="y"===n&&i.toYData?i.toYData(t):t[n];i[n+"Data"][e]=r}:function(t){Array.prototype[e].apply(i[t+"Data"],Array.prototype.slice.call(n,2))};i.parallelArrays.forEach(r)},hasData:function(){return this.visible&&"undefined"!==typeof this.dataMax&&"undefined"!==typeof this.dataMin||this.visible&&this.yData&&0<this.yData.length},autoIncrement:function(){var t,e=this.options,i=this.xIncrement,n=e.pointIntervalUnit,r=this.chart.time;return i=L(i,e.pointStart,0),this.pointInterval=t=L(this.pointInterval,e.pointInterval,1),n&&(e=new r.Date(i),"day"===n?r.set("Date",e,r.get("Date",e)+t):"month"===n?r.set("Month",e,r.get("Month",e)+t):"year"===n&&r.set("FullYear",e,r.get("FullYear",e)+t),t=e.getTime()-i),this.xIncrement=i+t,i},setDataSortingOptions:function(){var t=this.options;y(this,{requireSorting:!1,sorted:!1,enabledDataSorting:!0,allowDG:!1}),m(t.pointRange)||(t.pointRange=1)},setOptions:function(t){var e=this.chart,i=e.options,n=i.plotOptions,r=e.userOptions||{};t=E(t),e=e.styledMode;var o={plotOptions:n,userOptions:t};b(this,"setOptions",o);var s=o.plotOptions[this.type],a=r.plotOptions||{};return this.userOptions=o.userOptions,r=E(s,n.series,r.plotOptions&&r.plotOptions[this.type],t),this.tooltipOptions=E(c.tooltip,c.plotOptions.series&&c.plotOptions.series.tooltip,c.plotOptions[this.type].tooltip,i.tooltip.userOptions,n.series&&n.series.tooltip,n[this.type].tooltip,t.tooltip),this.stickyTracking=L(t.stickyTracking,a[this.type]&&a[this.type].stickyTracking,a.series&&a.series.stickyTracking,!(!this.tooltipOptions.shared||this.noSharedTooltip)||r.stickyTracking),null===s.marker&&delete r.marker,this.zoneAxis=r.zoneAxis,i=this.zones=(r.zones||[]).slice(),!r.negativeColor&&!r.negativeFillColor||r.zones||(n={value:r[this.zoneAxis+"Threshold"]||r.threshold||0,className:"highcharts-negative"},e||(n.color=r.negativeColor,n.fillColor=r.negativeFillColor),i.push(n)),i.length&&m(i[i.length-1].value)&&i.push(e?{}:{color:this.color,fillColor:this.fillColor}),b(this,"afterSetOptions",{options:r}),r},getName:function(){return L(this.options.name,"Series "+(this.index+1))},getCyclic:function(t,e,i){var n=this.chart,r=this.userOptions,o=t+"Index",s=t+"Counter",a=i?i.length:L(n.options.chart[t+"Count"],n[t+"Count"]);if(!e){var l=L(r[o],r["_"+o]);m(l)||(n.series.length||(n[s]=0),r["_"+o]=l=n[s]%a,n[s]+=1),i&&(e=i[l])}"undefined"!==typeof l&&(this[o]=l),this[t]=e},getColor:function(){this.chart.styledMode?this.getCyclic("color"):this.options.colorByPoint?this.options.color=null:this.getCyclic("color",this.options.color||c.plotOptions[this.type].color,this.chart.options.colors)},getPointsCollection:function(){return(this.hasGroupedData?this.points:this.data)||[]},getSymbol:function(){this.getCyclic("symbol",this.options.marker.symbol,this.chart.options.symbols)},findPointIndex:function(t,e){var i,n=t.id,r=t.x,o=this.points,s=this.options.dataSorting;if(n)var a=this.chart.get(n);else if(this.linkedParent||this.enabledDataSorting){var l=s&&s.matchByName?"name":"index";if(a=x(o,(function(e){return!e.touched&&e[l]===t[l]})),!a)return}if(a){var c=a&&a.index;"undefined"!==typeof c&&(i=!0)}return"undefined"===typeof c&&S(r)&&(c=this.xData.indexOf(r,e)),-1!==c&&"undefined"!==typeof c&&this.cropped&&(c=c>=this.cropStart?c-this.cropStart:c),!i&&o[c]&&o[c].touched&&(c=void 0),c},drawLegendSymbol:n.drawLineMarker,updateData:function(t,e){var i,n,r,o=this.options,s=o.dataSorting,a=this.points,l=[],c=this.requireSorting,h=t.length===a.length,d=!0;if(this.xIncrement=null,t.forEach((function(t,e){var n=m(t)&&this.pointClass.prototype.optionsToObject.call({series:this},t)||{},u=n.x;n.id||S(u)?(u=this.findPointIndex(n,r),-1===u||"undefined"===typeof u?l.push(t):a[u]&&t!==o.data[u]?(a[u].update(t,!1,null,!1),a[u].touched=!0,c&&(r=u+1)):a[u]&&(a[u].touched=!0),(!h||e!==u||s&&s.enabled||this.hasDerivedData)&&(i=!0)):l.push(t)}),this),i)for(t=a.length;t--;)(n=a[t])&&!n.touched&&n.remove&&n.remove(!1,e);else!h||s&&s.enabled?d=!1:(t.forEach((function(t,e){a[e].update&&t!==a[e].y&&a[e].update(t,!1,null,!1)})),l.length=0);return a.forEach((function(t){t&&(t.touched=!1)})),!!d&&(l.forEach((function(t){this.addPoint(t,!1,null,null,!1)}),this),null===this.xIncrement&&this.xData&&this.xData.length&&(this.xIncrement=u(this.xData),this.autoIncrement()),!0)},setData:function(t,e,i,n){var r,o=this,s=o.points,a=s&&s.length||0,l=o.options,c=o.chart,h=l.dataSorting,u=null,d=o.xAxis;u=l.turboThreshold;var p,f=this.xData,m=this.yData,g=(r=o.pointArrayMap)&&r.length,y=l.keys,x=0,b=1;if(t=t||[],r=t.length,e=L(e,!0),h&&h.enabled&&(t=this.sortData(t)),!1!==n&&r&&a&&!o.cropped&&!o.hasGroupedData&&o.visible&&!o.isSeriesBoosting&&(p=this.updateData(t,i)),!p){if(o.xIncrement=null,o.colorCounter=0,this.parallelArrays.forEach((function(t){o[t+"Data"].length=0})),u&&r>u)if(u=o.getFirstValidPoint(t),S(u))for(i=0;i<r;i++)f[i]=this.autoIncrement(),m[i]=t[i];else if(_(u))if(g)for(i=0;i<r;i++)n=t[i],f[i]=n[0],m[i]=n.slice(1,g+1);else for(y&&(x=y.indexOf("x"),b=y.indexOf("y"),x=0<=x?x:0,b=0<=b?b:1),i=0;i<r;i++)n=t[i],f[i]=n[x],m[i]=n[b];else v(12,!1,c);else for(i=0;i<r;i++)"undefined"!==typeof t[i]&&(n={series:o},o.pointClass.prototype.applyOptions.apply(n,[t[i]]),o.updateParallelArrays(n,i));for(m&&T(m[0])&&v(14,!0,c),o.data=[],o.options.data=o.userOptions.data=t,i=a;i--;)s[i]&&s[i].destroy&&s[i].destroy();d&&(d.minRange=d.userMinRange),o.isDirty=c.isDirtyBox=!0,o.isDirtyData=!!s,i=!1}"point"===l.legendType&&(this.processData(),this.generatePoints()),e&&c.redraw(i)},sortData:function(t){var e=this,i=e.options.dataSorting.sortKey||"y",n=function(t,e){return m(e)&&t.pointClass.prototype.optionsToObject.call({series:t},e)||{}};return t.forEach((function(i,r){t[r]=n(e,i),t[r].index=r}),this),t.concat().sort((function(t,e){return t=w(i,t),e=w(i,e),e<t?-1:e>t?1:0})).forEach((function(t,e){t.x=e}),this),e.linkedSeries&&e.linkedSeries.forEach((function(e){var i=e.options,r=i.data;i.dataSorting&&i.dataSorting.enabled||!r||(r.forEach((function(i,o){r[o]=n(e,i),t[o]&&(r[o].x=t[o].x,r[o].index=o)})),e.setData(r,!1))})),t},getProcessedData:function(t){var e=this.xData,i=this.yData,n=e.length,r=0,o=this.xAxis,s=this.options,a=s.cropThreshold,l=t||this.getExtremesFromAll||s.getExtremesFromAll,c=this.isCartesian;t=o&&o.val2lin,s=!(!o||!o.logarithmic);var h=this.requireSorting;if(o){o=o.getExtremes();var u=o.min,d=o.max}if(c&&this.sorted&&!l&&(!a||n>a||this.forceCrop))if(e[n-1]<u||e[0]>d)e=[],i=[];else if(this.yData&&(e[0]<u||e[n-1]>d)){r=this.cropData(this.xData,this.yData,u,d),e=r.xData,i=r.yData,r=r.start;var p=!0}for(a=e.length||1;--a;)if(n=s?t(e[a])-t(e[a-1]):e[a]-e[a-1],0<n&&("undefined"===typeof f||n<f))var f=n;else 0>n&&h&&(v(15,!1,this.chart),h=!1);return{xData:e,yData:i,cropped:p,cropStart:r,closestPointRange:f}},processData:function(t){var e=this.xAxis;if(this.isCartesian&&!this.isDirty&&!e.isDirty&&!this.yAxis.isDirty&&!t)return!1;t=this.getProcessedData(),this.cropped=t.cropped,this.cropStart=t.cropStart,this.processedXData=t.xData,this.processedYData=t.yData,this.closestPointRange=this.basePointRange=t.closestPointRange},cropData:function(t,e,i,n,r){var o,s=t.length,a=0,l=s;for(r=L(r,this.cropShoulder),o=0;o<s;o++)if(t[o]>=i){a=Math.max(0,o-r);break}for(i=o;i<s;i++)if(t[i]>n){l=i+r;break}return{xData:t.slice(a,l),yData:e.slice(a,l),start:a,end:l}},generatePoints:function(){var t,e=this.options,i=e.data,n=this.data,r=this.processedXData,o=this.processedYData,s=this.pointClass,a=r.length,l=this.cropStart||0,c=this.hasGroupedData;e=e.keys;var h,u=[];for(n||c||(n=[],n.length=i.length,n=this.data=n),e&&c&&(this.options.keys=!1),h=0;h<a;h++){var d=l+h;if(c){var p=(new s).init(this,[r[h]].concat(P(o[h])));p.dataGroup=this.groupMap[h],p.dataGroup.options&&(p.options=p.dataGroup.options,y(p,p.dataGroup.options),delete p.dataLabels)}else(p=n[d])||"undefined"===typeof i[d]||(n[d]=p=(new s).init(this,i[d],r[h]));p&&(p.index=d,u[h]=p)}if(this.options.keys=e,n&&(a!==(t=n.length)||c))for(h=0;h<t;h++)h!==l||c||(h+=a),n[h]&&(n[h].destroyElements(),n[h].plotX=void 0);this.data=n,this.points=u,b(this,"afterGeneratePoints")},getXExtremes:function(t){return{min:d(t),max:u(t)}},getExtremes:function(t,e){var i,n=this.xAxis,r=this.yAxis,o=this.processedXData||this.xData,s=[],a=0,l=0,c=0,h=this.requireSorting?this.cropShoulder:0,p=!!r&&r.positiveValuesOnly;for(t=t||this.stackedYData||this.processedYData||[],r=t.length,n&&(c=n.getExtremes(),l=c.min,c=c.max),i=0;i<r;i++){var f=o[i],m=t[i],g=(S(m)||_(m))&&(m.length||0<m||!p);if(f=e||this.getExtremesFromAll||this.options.getExtremesFromAll||this.cropped||!n||(o[i+h]||f)>=l&&(o[i-h]||f)<=c,g&&f)if(g=m.length)for(;g--;)S(m[g])&&(s[a++]=m[g]);else s[a++]=m}return t={dataMin:d(s),dataMax:u(s)},b(this,"afterGetExtremes",{dataExtremes:t}),t},applyExtremes:function(){var t=this.getExtremes();return this.dataMin=t.dataMin,this.dataMax=t.dataMax,t},getFirstValidPoint:function(t){for(var e=null,i=t.length,n=0;null===e&&n<i;)e=t[n],n++;return e},translate:function(){this.processedXData||this.processData(),this.generatePoints();var t,e,i=this.options,n=i.stacking,r=this.xAxis,o=r.categories,s=this.enabledDataSorting,a=this.yAxis,l=this.points,c=l.length,h=!!this.modifyValue,u=this.pointPlacementToXValue(),d=!!u,g=i.threshold,v=i.startFromThreshold?g:0,y=this.zoneAxis||"y",x=Number.MAX_VALUE;for(t=0;t<c;t++){var w=l[t],M=w.x,T=w.y,E=w.low,A=n&&a.stacking&&a.stacking.stacks[(this.negStacks&&T<(v?0:g)?"-":"")+this.stackKey];if((a.positiveValuesOnly&&!a.validatePositiveValue(T)||r.positiveValuesOnly&&!r.validatePositiveValue(M))&&(w.isNull=!0),w.plotX=e=f(p(r.translate(M,0,0,0,1,u,"flags"===this.type),-1e5,1e5)),n&&this.visible&&A&&A[M]){var C=this.getStackIndicator(C,M,this.index);if(!w.isNull)var P=A[M],R=P.points[C.key]}if(_(R)&&(E=R[0],T=R[1],E===v&&C.key===A[M].base&&(E=L(S(g)&&g,a.min)),a.positiveValuesOnly&&0>=E&&(E=null),w.total=w.stackTotal=P.total,w.percentage=P.total&&w.y/P.total*100,w.stackY=T,this.irregularWidths||P.setOffset(this.pointXOffset||0,this.barW||0)),w.yBottom=m(E)?p(a.translate(E,0,1,0,1),-1e5,1e5):null,h&&(T=this.modifyValue(T,w)),w.plotY="number"===typeof T&&1/0!==T?p(a.translate(T,0,1,0,1),-1e5,1e5):void 0,w.isInside=this.isPointInside(w),w.clientX=d?f(r.translate(M,0,0,0,1,u)):e,w.negative=w[y]<(i[y+"Threshold"]||g||0),w.category=o&&"undefined"!==typeof o[w.x]?o[w.x]:w.x,!w.isNull&&!1!==w.visible){"undefined"!==typeof O&&(x=Math.min(x,Math.abs(e-O)));var O=e}w.zone=this.zones.length&&w.getZone(),!w.graphic&&this.group&&s&&(w.isNew=!0)}this.closestPointRangePx=x,b(this,"afterTranslate")},getValidPoints:function(t,e,i){var n=this.chart;return(t||this.points||[]).filter((function(t){return!(e&&!n.isInsidePlot(t.plotX,t.plotY,n.inverted))&&(!1!==t.visible&&(i||!t.isNull))}))},getClipBox:function(t,e){var i=this.options,n=this.chart,r=n.inverted,o=this.xAxis,s=o&&this.yAxis,a=n.options.chart.scrollablePlotArea||{};return t&&!1===i.clip&&s?t=r?{y:-n.chartWidth+s.len+s.pos,height:n.chartWidth,width:n.chartHeight,x:-n.chartHeight+o.len+o.pos}:{y:-s.pos,height:n.chartHeight,width:n.chartWidth,x:-o.pos}:(t=this.clipBox||n.clipBox,e&&(t.width=n.plotSizeX,t.x=(n.scrollablePixelsX||0)*(a.scrollPositionX||0))),e?{width:t.width,x:t.x}:t},setClip:function(t){var e=this.chart,i=this.options,n=e.renderer,r=e.inverted,o=this.clipBox,s=this.getClipBox(t),a=this.sharedClipKey||["_sharedClip",t&&t.duration,t&&t.easing,s.height,i.xAxis,i.yAxis].join(),l=e[a],c=e[a+"m"];t&&(s.width=0,r&&(s.x=e.plotHeight+(!1!==i.clip?0:e.plotTop))),l?e.hasLoaded||l.attr(s):(t&&(e[a+"m"]=c=n.clipRect(r?e.plotSizeX+99:-99,r?-e.plotLeft:-e.plotTop,99,r?e.chartWidth:e.chartHeight)),e[a]=l=n.clipRect(s),l.count={length:0}),t&&!l.count[this.index]&&(l.count[this.index]=!0,l.count.length+=1),(!1!==i.clip||t)&&(this.group.clip(t||o?l:e.clipRect),this.markerGroup.clip(c),this.sharedClipKey=a),t||(l.count[this.index]&&(delete l.count[this.index],--l.count.length),0===l.count.length&&a&&e[a]&&(o||(e[a]=e[a].destroy()),e[a+"m"]&&(e[a+"m"]=e[a+"m"].destroy())))},animate:function(t){var e=this.chart,i=l(this.options.animation);if(!e.hasRendered)if(t)this.setClip(i);else{var n=this.sharedClipKey;t=e[n];var r=this.getClipBox(i,!0);t&&t.animate(r,i),e[n+"m"]&&e[n+"m"].animate({width:r.width+99,x:r.x-(e.inverted?0:99)},i)}},afterAnimate:function(){this.setClip(),b(this,"afterAnimate"),this.finishedAnimating=!0},drawPoints:function(){var t,e,i=this.points,n=this.chart,r=this.options.marker,o=this[this.specialGroup]||this.markerGroup,s=this.xAxis,a=L(r.enabled,!(s&&!s.isRadial)||null,this.closestPointRangePx>=r.enabledThreshold*r.radius);if(!1!==r.enabled||this._hasPointMarkers)for(t=0;t<i.length;t++){var l=i[t],c=(e=l.graphic)?"animate":"attr",h=l.marker||{},u=!!l.marker;if((a&&"undefined"===typeof h.enabled||h.enabled)&&!l.isNull&&!1!==l.visible){var d=L(h.symbol,this.symbol),p=this.markerAttribs(l,l.selected&&"select");this.enabledDataSorting&&(l.startXPos=s.reversed?-p.width:s.width);var f=!1!==l.isInside;e?e[f?"show":"hide"](f).animate(p):f&&(0<p.width||l.hasImage)&&(l.graphic=e=n.renderer.symbol(d,p.x,p.y,p.width,p.height,u?h:r).add(o),this.enabledDataSorting&&n.hasRendered&&(e.attr({x:l.startXPos}),c="animate")),e&&"animate"===c&&e[f?"show":"hide"](f).animate(p),e&&!n.styledMode&&e[c](this.pointAttribs(l,l.selected&&"select")),e&&e.addClass(l.getClassName(),!0)}else e&&(l.graphic=e.destroy())}},markerAttribs:function(t,e){var i=this.options,n=i.marker,r=t.marker||{},o=r.symbol||n.symbol,s=L(r.radius,n.radius);return e&&(n=n.states[e],e=r.states&&r.states[e],s=L(e&&e.radius,n&&n.radius,s+(n&&n.radiusPlus||0))),t.hasImage=o&&0===o.indexOf("url"),t.hasImage&&(s=0),t={x:i.crisp?Math.floor(t.plotX)-s:t.plotX-s,y:t.plotY-s},s&&(t.width=t.height=2*s),t},pointAttribs:function(t,e){var i=this.options.marker,n=t&&t.options,r=n&&n.marker||{},o=this.color,s=n&&n.color,a=t&&t.color;n=L(r.lineWidth,i.lineWidth);var l=t&&t.zone&&t.zone.color;return t=1,o=s||l||a||o,s=r.fillColor||i.fillColor||o,o=r.lineColor||i.lineColor||o,e=e||"normal",i=i.states[e],e=r.states&&r.states[e]||{},n=L(e.lineWidth,i.lineWidth,n+L(e.lineWidthPlus,i.lineWidthPlus,0)),s=e.fillColor||i.fillColor||s,o=e.lineColor||i.lineColor||o,t=L(e.opacity,i.opacity,t),{stroke:o,"stroke-width":n,fill:s,opacity:t}},destroy:function(t){var e,i,n,r,o=this,l=o.chart,c=/AppleWebKit\/533/.test(k.navigator.userAgent),h=o.data||[];for(b(o,"destroy"),this.removeEvents(t),(o.axisTypes||[]).forEach((function(t){(r=o[t])&&r.series&&(g(r.series,o),r.isDirty=r.forceRedraw=!0)})),o.legendItem&&o.chart.legend.destroyItem(o),i=h.length;i--;)(n=h[i])&&n.destroy&&n.destroy();o.points=null,a.clearTimeout(o.animationTimeout),A(o,(function(t,i){t instanceof s&&!t.survive&&(e=c&&"group"===i?"hide":"destroy",t[e]())})),l.hoverSeries===o&&(l.hoverSeries=null),g(l.series,o),l.orderSeries(),A(o,(function(e,i){t&&"hcEvents"===i||delete o[i]}))},getGraphPath:function(t,e,i){var n,r,o=this,s=o.options,a=s.step,l=[],c=[];return t=t||o.points,(n=t.reversed)&&t.reverse(),(a={right:1,center:2}[a]||a&&3)&&n&&(a=4-a),t=this.getValidPoints(t,!1,!(s.connectNulls&&!e&&!i)),t.forEach((function(n,h){var u=n.plotX,d=n.plotY,p=t[h-1];(n.leftCliff||p&&p.rightCliff)&&!i&&(r=!0),n.isNull&&!m(e)&&0<h?r=!s.connectNulls:n.isNull&&!e?r=!0:(0===h||r?h=[["M",n.plotX,n.plotY]]:o.getPointSpline?h=[o.getPointSpline(t,n,h)]:a?(h=1===a?[["L",p.plotX,d]]:2===a?[["L",(p.plotX+u)/2,p.plotY],["L",(p.plotX+u)/2,d]]:[["L",u,p.plotY]],h.push(["L",u,d])):h=[["L",u,d]],c.push(n.x),a&&(c.push(n.x),2===a&&c.push(n.x)),l.push.apply(l,h),r=!1)})),l.xMap=c,o.graphPath=l},drawGraph:function(){var t=this,e=this.options,i=(this.gappedPath||this.getGraphPath).call(this),n=this.chart.styledMode,r=[["graph","highcharts-graph"]];n||r[0].push(e.lineColor||this.color||"#cccccc",e.dashStyle),r=t.getZonesGraphs(r),r.forEach((function(r,o){var s=r[0],a=t[s],l=a?"animate":"attr";a?(a.endX=t.preventGraphAnimation?null:i.xMap,a.animate({d:i})):i.length&&(t[s]=a=t.chart.renderer.path(i).addClass(r[1]).attr({zIndex:1}).add(t.group)),a&&!n&&(s={stroke:r[2],"stroke-width":e.lineWidth,fill:t.fillGraph&&t.color||"none"},r[3]?s.dashstyle=r[3]:"square"!==e.linecap&&(s["stroke-linecap"]=s["stroke-linejoin"]="round"),a[l](s).shadow(2>o&&e.shadow)),a&&(a.startX=i.xMap,a.isArea=i.isArea)}))},getZonesGraphs:function(t){return this.zones.forEach((function(e,i){i=["zone-graph-"+i,"highcharts-graph highcharts-zone-graph-"+i+" "+(e.className||"")],this.chart.styledMode||i.push(e.color||this.color,e.dashStyle||this.options.dashStyle),t.push(i)}),this),t},applyZones:function(){var t,e,i,n,r,o,s,a,l=this,c=this.chart,h=c.renderer,u=this.zones,d=this.clips||[],f=this.graph,m=this.area,g=Math.max(c.chartWidth,c.chartHeight),v=this[(this.zoneAxis||"y")+"Axis"],y=c.inverted,x=!1;if(u.length&&(f||m)&&v&&"undefined"!==typeof v.min){var b=v.reversed,w=v.horiz;f&&!this.showLine&&f.hide(),m&&m.hide();var _=v.getExtremes();u.forEach((function(u,M){t=b?w?c.plotWidth:0:w?0:v.toPixels(_.min)||0,t=p(L(e,t),0,g),e=p(Math.round(v.toPixels(L(u.value,_.max),!0)||0),0,g),x&&(t=e=v.toPixels(_.max)),n=Math.abs(t-e),r=Math.min(t,e),o=Math.max(t,e),v.isXAxis?(i={x:y?o:r,y:0,width:n,height:g},w||(i.x=c.plotHeight-i.x)):(i={x:0,y:y?o:r,width:g,height:n},w&&(i.y=c.plotWidth-i.y)),y&&h.isVML&&(i=v.isXAxis?{x:0,y:b?r:o,height:i.width,width:c.chartWidth}:{x:i.y-c.plotLeft-c.spacingBox.x,y:0,width:i.height,height:c.chartHeight}),d[M]?d[M].animate(i):d[M]=h.clipRect(i),s=l["zone-area-"+M],a=l["zone-graph-"+M],f&&a&&a.clip(d[M]),m&&s&&s.clip(d[M]),x=u.value>_.max,l.resetZones&&0===e&&(e=void 0)})),this.clips=d}else l.visible&&(f&&f.show(!0),m&&m.show(!0))},invertGroups:function(t){function e(){["group","markerGroup"].forEach((function(e){i[e]&&(n.renderer.isVML&&i[e].attr({width:i.yAxis.len,height:i.xAxis.len}),i[e].width=i.yAxis.len,i[e].height=i.xAxis.len,i[e].invert(!i.isRadialSeries&&t))}))}var i=this,n=i.chart;i.xAxis&&(i.eventsToUnbind.push(h(n,"resize",e)),e(),i.invertGroups=e)},plotGroup:function(t,e,i,n,r){var o=this[t],s=!o;return i={visibility:i,zIndex:n||.1},"undefined"===typeof this.opacity||this.chart.styledMode||"inactive"===this.state||(i.opacity=this.opacity),s&&(this[t]=o=this.chart.renderer.g().add(r)),o.addClass("highcharts-"+e+" highcharts-series-"+this.index+" highcharts-"+this.type+"-series "+(m(this.colorIndex)?"highcharts-color-"+this.colorIndex+" ":"")+(this.options.className||"")+(o.hasClass("highcharts-tracker")?" highcharts-tracker":""),!0),o.attr(i)[s?"attr":"animate"](this.getPlotBox()),o},getPlotBox:function(){var t=this.chart,e=this.xAxis,i=this.yAxis;return t.inverted&&(e=i,i=this.xAxis),{translateX:e?e.left:t.plotLeft,translateY:i?i.top:t.plotTop,scaleX:1,scaleY:1}},removeEvents:function(t){t?this.eventsToUnbind.length&&(this.eventsToUnbind.forEach((function(t){t()})),this.eventsToUnbind.length=0):C(this)},render:function(){var t=this,e=t.chart,i=t.options,n=l(i.animation),r=!t.finishedAnimating&&e.renderer.isSVG&&n.duration,o=t.visible?"inherit":"hidden",s=i.zIndex,a=t.hasRendered,c=e.seriesGroup,h=e.inverted;b(this,"render");var u=t.plotGroup("group","series",o,s,c);t.markerGroup=t.plotGroup("markerGroup","markers",o,s,c),r&&t.animate&&t.animate(!0),u.inverted=!(!t.isCartesian&&!t.invertable)&&h,t.drawGraph&&(t.drawGraph(),t.applyZones()),t.visible&&t.drawPoints(),t.drawDataLabels&&t.drawDataLabels(),t.redrawPoints&&t.redrawPoints(),t.drawTracker&&!1!==t.options.enableMouseTracking&&t.drawTracker(),t.invertGroups(h),!1===i.clip||t.sharedClipKey||a||u.clip(e.clipRect),r&&t.animate&&t.animate(),a||(r&&n.defer&&(r+=n.defer),t.animationTimeout=R((function(){t.afterAnimate()}),r||0)),t.isDirty=!1,t.hasRendered=!0,b(t,"afterRender")},redraw:function(){var t=this.chart,e=this.isDirty||this.isDirtyData,i=this.group,n=this.xAxis,r=this.yAxis;i&&(t.inverted&&i.attr({width:t.plotWidth,height:t.plotHeight}),i.animate({translateX:L(n&&n.left,t.plotLeft),translateY:L(r&&r.top,t.plotTop)})),this.translate(),this.render(),e&&delete this.kdTree},kdAxisArray:["clientX","plotY"],searchPoint:function(t,e){var i=this.xAxis,n=this.yAxis,r=this.chart.inverted;return this.searchKDTree({clientX:r?i.len-t.chartY+i.pos:t.chartX-i.pos,plotY:r?n.len-t.chartX+n.pos:t.chartY-n.pos},e,t)},buildKDTree:function(t){function e(t,n,r){var o;if(o=t&&t.length){var s=i.kdAxisArray[n%r];return t.sort((function(t,e){return t[s]-e[s]})),o=Math.floor(o/2),{point:t[o],left:e(t.slice(0,o),n+1,r),right:e(t.slice(o+1),n+1,r)}}}this.buildingKdTree=!0;var i=this,n=-1<i.options.findNearestPointBy.indexOf("y")?2:1;delete i.kdTree,R((function(){i.kdTree=e(i.getValidPoints(null,!i.directTouch),n,n),i.buildingKdTree=!1}),i.options.kdNow||t&&"touchstart"===t.type?0:1)},searchKDTree:function(t,e,i){function n(t,e,i,l){var c=e.point,h=r.kdAxisArray[i%l],u=c,d=m(t[o])&&m(c[o])?Math.pow(t[o]-c[o],2):null,p=m(t[s])&&m(c[s])?Math.pow(t[s]-c[s],2):null;return p=(d||0)+(p||0),c.dist=m(p)?Math.sqrt(p):Number.MAX_VALUE,c.distX=m(d)?Math.sqrt(d):Number.MAX_VALUE,h=t[h]-c[h],p=0>h?"left":"right",d=0>h?"right":"left",e[p]&&(p=n(t,e[p],i+1,l),u=p[a]<u[a]?p:c),e[d]&&Math.sqrt(h*h)<u[a]&&(t=n(t,e[d],i+1,l),u=t[a]<u[a]?t:u),u}var r=this,o=this.kdAxisArray[0],s=this.kdAxisArray[1],a=e?"distX":"dist";if(e=-1<r.options.findNearestPointBy.indexOf("y")?2:1,this.kdTree||this.buildingKdTree||this.buildKDTree(i),this.kdTree)return n(t,this.kdTree,e,e)},pointPlacementToXValue:function(){var t=this.options,e=t.pointRange,i=this.xAxis;return t=t.pointPlacement,"between"===t&&(t=i.reversed?-.5:.5),S(t)?t*L(e,i.pointRange):0},isPointInside:function(t){return"undefined"!==typeof t.plotY&&"undefined"!==typeof t.plotX&&0<=t.plotY&&t.plotY<=this.yAxis.len&&0<=t.plotX&&t.plotX<=this.xAxis.len}}),t})),e(i,"Series/LineSeries.js",[i["Core/Series/CartesianSeries.js"],i["Core/Globals.js"]],(function(t,e){return e.Series=t,e.Series})),e(i,"Extensions/Stacking.js",[i["Core/Axis/Axis.js"],i["Core/Chart/Chart.js"],i["Core/Globals.js"],i["Core/Axis/StackingAxis.js"],i["Core/Utilities.js"]],(function(t,e,i,n,r){var o=r.correctFloat,s=r.defined,a=r.destroyObjectProperties,l=r.format,c=r.isNumber,h=r.pick,u=i.Series,d=function(){function t(t,e,i,n,r){var o=t.chart.inverted;this.axis=t,this.isNegative=i,this.options=e=e||{},this.x=n,this.total=null,this.points={},this.hasValidPoints=!1,this.stack=r,this.rightCliff=this.leftCliff=0,this.alignOptions={align:e.align||(o?i?"left":"right":"center"),verticalAlign:e.verticalAlign||(o?"middle":i?"bottom":"top"),y:e.y,x:e.x},this.textAlign=e.textAlign||(o?i?"right":"left":"center")}return t.prototype.destroy=function(){a(this,this.axis)},t.prototype.render=function(t){var e=this.axis.chart,i=this.options,n=i.format;n=n?l(n,this,e):i.formatter.call(this),this.label?this.label.attr({text:n,visibility:"hidden"}):(this.label=e.renderer.label(n,null,null,i.shape,null,null,i.useHTML,!1,"stack-labels"),n={r:i.borderRadius||0,text:n,rotation:i.rotation,padding:h(i.padding,5),visibility:"hidden"},e.styledMode||(n.fill=i.backgroundColor,n.stroke=i.borderColor,n["stroke-width"]=i.borderWidth,this.label.css(i.style)),this.label.attr(n),this.label.added||this.label.add(t)),this.label.labelrank=e.plotHeight},t.prototype.setOffset=function(t,e,i,n,r){var o=this.axis,a=o.chart;n=o.translate(o.stacking.usePercentage?100:n||this.total,0,0,0,1),i=o.translate(i||0),i=s(n)&&Math.abs(n-i),t=h(r,a.xAxis[0].translate(this.x))+t,o=s(n)&&this.getStackBox(a,this,t,n,e,i,o),e=this.label,i=this.isNegative,t="justify"===h(this.options.overflow,"justify");var l=this.textAlign;e&&o&&(r=e.getBBox(),n=e.padding,l="left"===l?a.inverted?-n:n:"right"===l?r.width:a.inverted&&"center"===l?r.width/2:a.inverted?i?r.width+n:-n:r.width/2,i=a.inverted?r.height/2:i?-n:r.height,this.alignOptions.x=h(this.options.x,0),this.alignOptions.y=h(this.options.y,0),o.x-=l,o.y-=i,e.align(this.alignOptions,null,o),a.isInsidePlot(e.alignAttr.x+l-this.alignOptions.x,e.alignAttr.y+i-this.alignOptions.y)?e.show():(e.alignAttr.y=-9999,t=!1),t&&u.prototype.justifyDataLabel.call(this.axis,e,this.alignOptions,e.alignAttr,r,o),e.attr({x:e.alignAttr.x,y:e.alignAttr.y}),h(!t&&this.options.crop,!0)&&((a=c(e.x)&&c(e.y)&&a.isInsidePlot(e.x-n+e.width,e.y)&&a.isInsidePlot(e.x+n,e.y))||e.hide()))},t.prototype.getStackBox=function(t,e,i,n,r,o,s){var a=e.axis.reversed,l=t.inverted,c=s.height+s.pos-(l?t.plotLeft:t.plotTop);return e=e.isNegative&&!a||!e.isNegative&&a,{x:l?e?n-s.right:n-o+s.pos-t.plotLeft:i+t.xAxis[0].transB-t.plotLeft,y:l?s.height-i-r:e?c-n-o:c-n,width:l?o:r,height:l?r:o}},t}();return e.prototype.getStacks=function(){var t=this,e=t.inverted;t.yAxis.forEach((function(t){t.stacking&&t.stacking.stacks&&t.hasVisibleSeries&&(t.stacking.oldStacks=t.stacking.stacks)})),t.series.forEach((function(i){var n=i.xAxis&&i.xAxis.options||{};!i.options.stacking||!0!==i.visible&&!1!==t.options.chart.ignoreHiddenSeries||(i.stackKey=[i.type,h(i.options.stack,""),e?n.top:n.left,e?n.height:n.width].join())}))},n.compose(t),u.prototype.setGroupedPoints=function(){this.options.centerInCategory&&(this.is("column")||this.is("columnrange"))&&!this.options.stacking&&1<this.chart.series.length&&u.prototype.setStackedPoints.call(this,"group")},u.prototype.setStackedPoints=function(t){var e=t||this.options.stacking;if(e&&(!0===this.visible||!1===this.chart.options.chart.ignoreHiddenSeries)){var i=this.processedXData,n=this.processedYData,r=[],a=n.length,l=this.options,c=l.threshold,u=h(l.startFromThreshold&&c,0);l=l.stack,t=t?this.type+","+e:this.stackKey;var p,f,m="-"+t,g=this.negStacks,v=this.yAxis,y=v.stacking.stacks,x=v.stacking.oldStacks;for(v.stacking.stacksTouched+=1,f=0;f<a;f++){var b=i[f],w=n[f],_=this.getStackIndicator(_,b,this.index),M=_.key,S=(p=g&&w<(u?0:c))?m:t;y[S]||(y[S]={}),y[S][b]||(x[S]&&x[S][b]?(y[S][b]=x[S][b],y[S][b].total=null):y[S][b]=new d(v,v.options.stackLabels,p,b,l)),S=y[S][b],null!==w?(S.points[M]=S.points[this.index]=[h(S.cumulative,u)],s(S.cumulative)||(S.base=M),S.touched=v.stacking.stacksTouched,0<_.index&&!1===this.singleStacks&&(S.points[M][0]=S.points[this.index+","+b+",0"][0])):S.points[M]=S.points[this.index]=null,"percent"===e?(p=p?t:m,g&&y[p]&&y[p][b]?(p=y[p][b],S.total=p.total=Math.max(p.total,S.total)+Math.abs(w)||0):S.total=o(S.total+(Math.abs(w)||0))):"group"===e?null!==w&&(S.total=(S.total||0)+1):S.total=o(S.total+(w||0)),S.cumulative="group"===e?(S.total||1)-1:h(S.cumulative,u)+(w||0),null!==w&&(S.points[M].push(S.cumulative),r[f]=S.cumulative,S.hasValidPoints=!0)}"percent"===e&&(v.stacking.usePercentage=!0),"group"!==e&&(this.stackedYData=r),v.stacking.oldStacks={}}},u.prototype.modifyStacks=function(){var t,e=this,i=e.stackKey,n=e.yAxis.stacking.stacks,r=e.processedXData,o=e.options.stacking;e[o+"Stacker"]&&[i,"-"+i].forEach((function(i){for(var s,a,l=r.length;l--;)s=r[l],t=e.getStackIndicator(t,s,e.index,i),(a=(s=n[i]&&n[i][s])&&s.points[t.key])&&e[o+"Stacker"](a,s,l)}))},u.prototype.percentStacker=function(t,e,i){e=e.total?100/e.total:0,t[0]=o(t[0]*e),t[1]=o(t[1]*e),this.stackedYData[i]=t[1]},u.prototype.getStackIndicator=function(t,e,i,n){return!s(t)||t.x!==e||n&&t.key!==n?t={x:e,index:0,key:n}:t.index++,t.key=[i,e,t.index].join(),t},i.StackItem=d,i.StackItem})),e(i,"Core/Dynamics.js",[i["Core/Animation/AnimationUtilities.js"],i["Core/Axis/Axis.js"],i["Core/Series/Series.js"],i["Core/Chart/Chart.js"],i["Core/Globals.js"],i["Series/LineSeries.js"],i["Core/Options.js"],i["Core/Series/Point.js"],i["Core/Time.js"],i["Core/Utilities.js"]],(function(t,e,i,n,r,o,s,a,l,c){var h=t.animate,u=t.setAnimation,d=i.seriesTypes,p=s.time,f=c.addEvent,m=c.createElement,g=c.css,v=c.defined,y=c.erase,x=c.error,b=c.extend,w=c.fireEvent,_=c.isArray,M=c.isNumber,S=c.isObject,T=c.isString,E=c.merge,A=c.objectEach,L=c.pick,C=c.relativeLength,P=c.splat;r.cleanRecursively=function(t,e){var i={};return A(t,(function(n,o){S(t[o],!0)&&!t.nodeType&&e[o]?(n=r.cleanRecursively(t[o],e[o]),Object.keys(n).length&&(i[o]=n)):(S(t[o])||t[o]!==e[o])&&(i[o]=t[o])})),i},b(n.prototype,{addSeries:function(t,e,i){var n,r=this;return t&&(e=L(e,!0),w(r,"addSeries",{options:t},(function(){n=r.initSeries(t),r.isDirtyLegend=!0,r.linkSeries(),n.enabledDataSorting&&n.setData(t.data,!1),w(r,"afterAddSeries",{series:n}),e&&r.redraw(i)}))),n},addAxis:function(t,e,i,n){return this.createAxis(e?"xAxis":"yAxis",{axis:t,redraw:i,animation:n})},addColorAxis:function(t,e,i){return this.createAxis("colorAxis",{axis:t,redraw:e,animation:i})},createAxis:function(t,i){var n=this.options,o="colorAxis"===t,s=i.redraw,a=i.animation;i=E(i.axis,{index:this[t].length,isX:"xAxis"===t});var l=o?new r.ColorAxis(this,i):new e(this,i);return n[t]=P(n[t]||{}),n[t].push(i),o&&(this.isDirtyLegend=!0,this.axes.forEach((function(t){t.series=[]})),this.series.forEach((function(t){t.bindAxes(),t.isDirtyData=!0}))),L(s,!0)&&this.redraw(a),l},showLoading:function(t){var e=this,i=e.options,n=e.loadingDiv,r=i.loading,o=function(){n&&g(n,{left:e.plotLeft+"px",top:e.plotTop+"px",width:e.plotWidth+"px",height:e.plotHeight+"px"})};n||(e.loadingDiv=n=m("div",{className:"highcharts-loading highcharts-loading-hidden"},null,e.container),e.loadingSpan=m("span",{className:"highcharts-loading-inner"},null,n),f(e,"redraw",o)),n.className="highcharts-loading",e.loadingSpan.innerHTML=L(t,i.lang.loading,""),e.styledMode||(g(n,b(r.style,{zIndex:10})),g(e.loadingSpan,r.labelStyle),e.loadingShown||(g(n,{opacity:0,display:""}),h(n,{opacity:r.style.opacity||.5},{duration:r.showDuration||0}))),e.loadingShown=!0,o()},hideLoading:function(){var t=this.options,e=this.loadingDiv;e&&(e.className="highcharts-loading highcharts-loading-hidden",this.styledMode||h(e,{opacity:0},{duration:t.loading.hideDuration||100,complete:function(){g(e,{display:"none"})}})),this.loadingShown=!1},propsRequireDirtyBox:"backgroundColor borderColor borderWidth borderRadius plotBackgroundColor plotBackgroundImage plotBorderColor plotBorderWidth plotShadow shadow".split(" "),propsRequireReflow:"margin marginTop marginRight marginBottom marginLeft spacing spacingTop spacingRight spacingBottom spacingLeft".split(" "),propsRequireUpdateSeries:"chart.inverted chart.polar chart.ignoreHiddenSeries chart.type colors plotOptions time tooltip".split(" "),collectionsWithUpdate:["xAxis","yAxis","zAxis","series"],update:function(t,e,i,n){var o,s,a,c=this,h={credits:"addCredits",title:"setTitle",subtitle:"setSubtitle",caption:"setCaption"},u=t.isResponsiveOptions,d=[];if(w(c,"update",{options:t}),u||c.setResponsive(!1,!0),t=r.cleanRecursively(t,c.options),E(!0,c.userOptions,t),o=t.chart){if(E(!0,c.options.chart,o),"className"in o&&c.setClassName(o.className),"reflow"in o&&c.setReflow(o.reflow),"inverted"in o||"polar"in o||"type"in o){c.propFromSeries();var f=!0}"alignTicks"in o&&(f=!0),A(o,(function(t,e){-1!==c.propsRequireUpdateSeries.indexOf("chart."+e)&&(s=!0),-1!==c.propsRequireDirtyBox.indexOf(e)&&(c.isDirtyBox=!0),-1!==c.propsRequireReflow.indexOf(e)&&(u?c.isDirtyBox=!0:a=!0)})),!c.styledMode&&"style"in o&&c.renderer.setStyle(o.style)}!c.styledMode&&t.colors&&(this.options.colors=t.colors),t.time&&(this.time===p&&(this.time=new l(t.time)),E(!0,c.options.time,t.time)),A(t,(function(e,i){c[i]&&"function"===typeof c[i].update?c[i].update(e,!1):"function"===typeof c[h[i]]?c[h[i]](e):"color"!==i&&-1===c.collectionsWithUpdate.indexOf(i)&&E(!0,c.options[i],t[i]),"chart"!==i&&-1!==c.propsRequireUpdateSeries.indexOf(i)&&(s=!0)})),this.collectionsWithUpdate.forEach((function(e){if(t[e]){if("series"===e){var n=[];c[e].forEach((function(t,e){t.options.isInternal||n.push(L(t.options.index,e))}))}P(t[e]).forEach((function(t,r){var o,s=v(t.id);s&&(o=c.get(t.id)),o||(o=c[e][n?n[r]:r])&&s&&v(o.options.id)&&(o=void 0),o&&o.coll===e&&(o.update(t,!1),i&&(o.touched=!0)),!o&&i&&c.collectionsWithInit[e]&&(c.collectionsWithInit[e][0].apply(c,[t].concat(c.collectionsWithInit[e][1]||[]).concat([!1])).touched=!0)})),i&&c[e].forEach((function(t){t.touched||t.options.isInternal?delete t.touched:d.push(t)}))}})),d.forEach((function(t){t.remove&&t.remove(!1)})),f&&c.axes.forEach((function(t){t.update({},!1)})),s&&c.getSeriesOrderByLinks().forEach((function(t){t.chart&&t.update({},!1)}),this),f=o&&o.width,o=o&&o.height,T(o)&&(o=C(o,f||c.chartWidth)),a||M(f)&&f!==c.chartWidth||M(o)&&o!==c.chartHeight?c.setSize(f,o,n):L(e,!0)&&c.redraw(n),w(c,"afterUpdate",{options:t,redraw:e,animation:n})},setSubtitle:function(t,e){this.applyDescription("subtitle",t),this.layOutTitles(e)},setCaption:function(t,e){this.applyDescription("caption",t),this.layOutTitles(e)}}),n.prototype.collectionsWithInit={xAxis:[n.prototype.addAxis,[!0]],yAxis:[n.prototype.addAxis,[!1]],series:[n.prototype.addSeries]},b(a.prototype,{update:function(t,e,i,n){function r(){s.applyOptions(t);var n=l&&s.hasDummyGraphic;n=null===s.y?!n:n,l&&n&&(s.graphic=l.destroy(),delete s.hasDummyGraphic),S(t,!0)&&(l&&l.element&&t&&t.marker&&"undefined"!==typeof t.marker.symbol&&(s.graphic=l.destroy()),t&&t.dataLabels&&s.dataLabel&&(s.dataLabel=s.dataLabel.destroy()),s.connector&&(s.connector=s.connector.destroy())),o=s.index,a.updateParallelArrays(s,o),h.data[o]=S(h.data[o],!0)||S(t,!0)?s.options:L(t,h.data[o]),a.isDirty=a.isDirtyData=!0,!a.fixedBox&&a.hasCartesianSeries&&(c.isDirtyBox=!0),"point"===h.legendType&&(c.isDirtyLegend=!0),e&&c.redraw(i)}var o,s=this,a=s.series,l=s.graphic,c=a.chart,h=a.options;e=L(e,!0),!1===n?r():s.firePointEvent("update",{options:t},r)},remove:function(t,e){this.series.removePoint(this.series.data.indexOf(this),t,e)}}),b(o.prototype,{addPoint:function(t,e,i,n,r){var o=this.options,s=this.data,a=this.chart,l=this.xAxis;l=l&&l.hasNames&&l.names;var c,h=o.data,u=this.xData;e=L(e,!0);var d={series:this};this.pointClass.prototype.applyOptions.apply(d,[t]);var p=d.x,f=u.length;if(this.requireSorting&&p<u[f-1])for(c=!0;f&&u[f-1]>p;)f--;this.updateParallelArrays(d,"splice",f,0,0),this.updateParallelArrays(d,f),l&&d.name&&(l[p]=d.name),h.splice(f,0,t),c&&(this.data.splice(f,0,null),this.processData()),"point"===o.legendType&&this.generatePoints(),i&&(s[0]&&s[0].remove?s[0].remove(!1):(s.shift(),this.updateParallelArrays(d,"shift"),h.shift())),!1!==r&&w(this,"addPoint",{point:d}),this.isDirtyData=this.isDirty=!0,e&&a.redraw(n)},removePoint:function(t,e,i){var n=this,r=n.data,o=r[t],s=n.points,a=n.chart,l=function(){s&&s.length===r.length&&s.splice(t,1),r.splice(t,1),n.options.data.splice(t,1),n.updateParallelArrays(o||{series:n},"splice",t,1),o&&o.destroy(),n.isDirty=!0,n.isDirtyData=!0,e&&a.redraw()};u(i,a),e=L(e,!0),o?o.firePointEvent("remove",null,l):l()},remove:function(t,e,i,n){function r(){o.destroy(n),o.remove=null,s.isDirtyLegend=s.isDirtyBox=!0,s.linkSeries(),L(t,!0)&&s.redraw(e)}var o=this,s=o.chart;!1!==i?w(o,"remove",null,r):r()},update:function(t,e){t=r.cleanRecursively(t,this.userOptions),w(this,"update",{options:t});var i,n=this,o=n.chart,s=n.userOptions,a=n.initialType||n.type,l=o.options.plotOptions,c=t.type||s.type||o.options.chart.type,h=!(this.hasDerivedData||c&&c!==this.type||"undefined"!==typeof t.pointStart||"undefined"!==typeof t.pointInterval||n.hasOptionChanged("dataGrouping")||n.hasOptionChanged("pointStart")||n.hasOptionChanged("pointInterval")||n.hasOptionChanged("pointIntervalUnit")||n.hasOptionChanged("keys")),u=d[a].prototype,p=["eventOptions","navigatorSeries","baseSeries"],f=n.finishedAnimating&&{animation:!1},m={};for(i in h&&(p.push("data","isDirtyData","points","processedXData","processedYData","xIncrement","cropped","_hasPointMarkers","_hasPointLabels","mapMap","mapData","minY","maxY","minX","maxX"),!1!==t.visible&&p.push("area","graph"),n.parallelArrays.forEach((function(t){p.push(t+"Data")})),t.data&&(t.dataSorting&&b(n.options.dataSorting,t.dataSorting),this.setData(t.data,!1))),t=E(s,f,{index:"undefined"===typeof s.index?n.index:s.index,pointStart:L(l&&l.series&&l.series.pointStart,s.pointStart,n.xData[0])},!h&&{data:n.options.data},t),h&&t.data&&(t.data=n.options.data),p=["group","markerGroup","dataLabelsGroup","transformGroup"].concat(p),p.forEach((function(t){p[t]=n[t],delete n[t]})),n.remove(!1,null,!1,!0),u)n[i]=void 0;if(d[c||a]?b(n,d[c||a].prototype):x(17,!0,o,{missingModuleFor:c||a}),p.forEach((function(t){n[t]=p[t]})),n.init(o,t),h&&this.points){var g=n.options;!1===g.visible?(m.graphic=1,m.dataLabel=1):n._hasPointLabels||(t=g.marker,s=g.dataLabels,t&&(!1===t.enabled||"symbol"in t)&&(m.graphic=1),s&&!1===s.enabled&&(m.dataLabel=1)),this.points.forEach((function(t){t&&t.series&&(t.resolveColor(),Object.keys(m).length&&t.destroyElements(m),!1===g.showInLegend&&t.legendItem&&o.legend.destroyItem(t))}),this)}n.initialType=a,o.linkSeries(),w(this,"afterUpdate"),L(e,!0)&&o.redraw(!!h&&void 0)},setName:function(t){this.name=this.options.name=this.userOptions.name=t,this.chart.isDirtyLegend=!0},hasOptionChanged:function(t){var e=this.options[t],i=this.chart.options.plotOptions,n=this.userOptions[t];return n?e!==n:e!==L(i&&i[this.type]&&i[this.type][t],i&&i.series&&i.series[t],e)}}),b(e.prototype,{update:function(t,e){var i=this.chart,n=t&&t.events||{};t=E(this.userOptions,t),i.options[this.coll].indexOf&&(i.options[this.coll][i.options[this.coll].indexOf(this.userOptions)]=t),A(i.options[this.coll].events,(function(t,e){"undefined"===typeof n[e]&&(n[e]=void 0)})),this.destroy(!0),this.init(i,b(t,{events:n})),i.isDirtyBox=!0,L(e,!0)&&i.redraw()},remove:function(t){for(var e=this.chart,i=this.coll,n=this.series,r=n.length;r--;)n[r]&&n[r].remove(!1);y(e.axes,this),y(e[i],this),_(e.options[i])?e.options[i].splice(this.options.index,1):delete e.options[i],e[i].forEach((function(t,e){t.options.index=t.userOptions.index=e})),this.destroy(),e.isDirtyBox=!0,L(t,!0)&&e.redraw()},setTitle:function(t,e){this.update({title:t},e)},setCategories:function(t,e){this.update({categories:t},e)}})})),e(i,"Series/AreaSeries.js",[i["Core/Series/Series.js"],i["Core/Color/Color.js"],i["Core/Globals.js"],i["Mixins/LegendSymbol.js"],i["Core/Utilities.js"]],(function(t,e,i,n,r){var o=e.parse,s=r.objectEach,a=r.pick,l=i.Series;t.seriesType("area","line",{threshold:0},{singleStacks:!1,getStackPoints:function(t){var e,i=[],n=[],r=this.xAxis,o=this.yAxis,l=o.stacking.stacks[this.stackKey],c={},h=this.index,u=o.series,d=u.length,p=a(o.options.reversedStacks,!0)?1:-1;if(t=t||this.points,this.options.stacking){for(e=0;e<t.length;e++)t[e].leftNull=t[e].rightNull=void 0,c[t[e].x]=t[e];s(l,(function(t,e){null!==t.total&&n.push(e)})),n.sort((function(t,e){return t-e}));var f=u.map((function(t){return t.visible}));n.forEach((function(t,s){var a,u,m=0;if(c[t]&&!c[t].isNull)i.push(c[t]),[-1,1].forEach((function(i){var r=1===i?"rightNull":"leftNull",o=0,m=l[n[s+i]];if(m)for(e=h;0<=e&&e<d;)a=m.points[e],a||(e===h?c[t][r]=!0:f[e]&&(u=l[t].points[e])&&(o-=u[1]-u[0])),e+=p;c[t][1===i?"rightCliff":"leftCliff"]=o}));else{for(e=h;0<=e&&e<d;){if(a=l[t].points[e]){m=a[1];break}e+=p}m=o.translate(m,0,1,0,1),i.push({isNull:!0,plotX:r.translate(t,0,0,0,1),x:t,plotY:m,yBottom:m})}}))}return i},getGraphPath:function(t){var e,i=l.prototype.getGraphPath,n=this.options,r=n.stacking,o=this.yAxis,s=[],c=[],h=this.index,u=o.stacking.stacks[this.stackKey],d=n.threshold,p=Math.round(o.getThreshold(n.threshold));n=a(n.connectNulls,"percent"===r);var f=function(e,i,n){var a=t[e];e=r&&u[a.x].points[h];var l=a[n+"Null"]||0;if(n=a[n+"Cliff"]||0,a=!0,n||l){var f=(l?e[0]:e[1])+n,m=e[0]+n;a=!!l}else!r&&t[i]&&t[i].isNull&&(f=m=d);"undefined"!==typeof f&&(c.push({plotX:g,plotY:null===f?p:o.getThreshold(f),isNull:a,isCliff:!0}),s.push({plotX:g,plotY:null===m?p:o.getThreshold(m),doCurve:!1}))};for(t=t||this.points,r&&(t=this.getStackPoints(t)),e=0;e<t.length;e++){r||(t[e].leftCliff=t[e].rightCliff=t[e].leftNull=t[e].rightNull=void 0);var m=t[e].isNull,g=a(t[e].rectPlotX,t[e].plotX),v=r?t[e].yBottom:p;m&&!n||(n||f(e,e-1,"left"),m&&!r&&n||(c.push(t[e]),s.push({x:e,plotX:g,plotY:v})),n||f(e,e+1,"right"))}return e=i.call(this,c,!0,!0),s.reversed=!0,m=i.call(this,s,!0,!0),(v=m[0])&&"M"===v[0]&&(m[0]=["L",v[1],v[2]]),m=e.concat(m),i=i.call(this,c,!1,n),m.xMap=e.xMap,this.areaPath=m,i},drawGraph:function(){this.areaPath=[],l.prototype.drawGraph.apply(this);var t=this,e=this.areaPath,i=this.options,n=[["area","highcharts-area",this.color,i.fillColor]];this.zones.forEach((function(e,r){n.push(["zone-area-"+r,"highcharts-area highcharts-zone-area-"+r+" "+e.className,e.color||t.color,e.fillColor||i.fillColor])})),n.forEach((function(n){var r=n[0],s=t[r],l=s?"animate":"attr",c={};s?(s.endX=t.preventGraphAnimation?null:e.xMap,s.animate({d:e})):(c.zIndex=0,s=t[r]=t.chart.renderer.path(e).addClass(n[1]).add(t.group),s.isArea=!0),t.chart.styledMode||(c.fill=a(n[3],o(n[2]).setOpacity(a(i.fillOpacity,.75)).get())),s[l](c),s.startX=e.xMap,s.shiftUnit=i.step?2:1}))},drawLegendSymbol:n.drawRectangle})})),e(i,"Series/SplineSeries.js",[i["Core/Series/Series.js"],i["Core/Utilities.js"]],(function(t,e){var i=e.pick;t.seriesType("spline","line",{},{getPointSpline:function(t,e,n){var r=e.plotX||0,o=e.plotY||0,s=t[n-1];if(n=t[n+1],s&&!s.isNull&&!1!==s.doCurve&&!e.isCliff&&n&&!n.isNull&&!1!==n.doCurve&&!e.isCliff){t=s.plotY||0;var a=n.plotX||0;n=n.plotY||0;var l=0,c=(1.5*r+(s.plotX||0))/2.5,h=(1.5*o+t)/2.5;a=(1.5*r+a)/2.5;var u=(1.5*o+n)/2.5;a!==c&&(l=(u-h)*(a-r)/(a-c)+o-u),h+=l,u+=l,h>t&&h>o?(h=Math.max(t,o),u=2*o-h):h<t&&h<o&&(h=Math.min(t,o),u=2*o-h),u>n&&u>o?(u=Math.max(n,o),h=2*o-u):u<n&&u<o&&(u=Math.min(n,o),h=2*o-u),e.rightContX=a,e.rightContY=u}return e=["C",i(s.rightContX,s.plotX,0),i(s.rightContY,s.plotY,0),i(c,r,0),i(h,o,0),r,o],s.rightContX=s.rightContY=void 0,e}})})),e(i,"Series/AreaSplineSeries.js",[i["Core/Series/Series.js"],i["Mixins/LegendSymbol.js"],i["Core/Options.js"]],(function(t,e,i){var n=t.seriesTypes.area.prototype;t.seriesType("areaspline","spline",i.defaultOptions.plotOptions.area,{getStackPoints:n.getStackPoints,getGraphPath:n.getGraphPath,drawGraph:n.drawGraph,drawLegendSymbol:e.drawRectangle})})),e(i,"Series/ColumnSeries.js",[i["Core/Animation/AnimationUtilities.js"],i["Core/Series/Series.js"],i["Core/Color/Color.js"],i["Core/Globals.js"],i["Mixins/LegendSymbol.js"],i["Series/LineSeries.js"],i["Core/Utilities.js"]],(function(t,e,i,n,r,o,s){var a=t.animObject,l=i.parse;t=n.noop;var c=s.clamp,h=s.defined,u=s.extend,d=s.isArray,p=s.isNumber,f=s.merge,m=s.pick,g=s.objectEach;return e=e.seriesType("column","line",{borderRadius:0,centerInCategory:!1,groupPadding:.2,marker:null,pointPadding:.1,minPointLength:0,cropThreshold:50,pointRange:null,states:{hover:{halo:!1,brightness:.1},select:{color:"#cccccc",borderColor:"#000000"}},dataLabels:{align:void 0,verticalAlign:void 0,y:void 0},startFromThreshold:!0,stickyTracking:!1,tooltip:{distance:6},threshold:0,borderColor:"#ffffff"},{cropShoulder:0,directTouch:!0,trackerGroups:["group","dataLabelsGroup"],negStacks:!0,init:function(){o.prototype.init.apply(this,arguments);var t=this,e=t.chart;e.hasRendered&&e.series.forEach((function(e){e.type===t.type&&(e.isDirty=!0)}))},getColumnMetrics:function(){var t=this,e=t.options,i=t.xAxis,n=t.yAxis,r=i.options.reversedStacks;r=i.reversed&&!r||!i.reversed&&r;var o,s={},a=0;!1===e.grouping?a=1:t.chart.series.forEach((function(e){var i=e.yAxis,r=e.options;if(e.type===t.type&&(e.visible||!t.chart.options.chart.ignoreHiddenSeries)&&n.len===i.len&&n.pos===i.pos){if(r.stacking&&"group"!==r.stacking){o=e.stackKey,"undefined"===typeof s[o]&&(s[o]=a++);var l=s[o]}else!1!==r.grouping&&(l=a++);e.columnIndex=l}}));var l=Math.min(Math.abs(i.transA)*(i.ordinal&&i.ordinal.slope||e.pointRange||i.closestPointRange||i.tickInterval||1),i.len),c=l*e.groupPadding,h=(l-2*c)/(a||1);return e=Math.min(e.maxPointWidth||i.len,m(e.pointWidth,h*(1-2*e.pointPadding))),t.columnMetrics={width:e,offset:(h-e)/2+(c+((t.columnIndex||0)+(r?1:0))*h-l/2)*(r?-1:1),paddedWidth:h,columnCount:a},t.columnMetrics},crispCol:function(t,e,i,n){var r=this.chart,o=this.borderWidth,s=-(o%2?.5:0);return o=o%2?.5:1,r.inverted&&r.renderer.isVML&&(o+=1),this.options.crisp&&(i=Math.round(t+i)+s,t=Math.round(t)+s,i-=t),n=Math.round(e+n)+o,s=.5>=Math.abs(e)&&.5<n,e=Math.round(e)+o,n-=e,s&&n&&(--e,n+=1),{x:t,y:e,width:i,height:n}},adjustForMissingColumns:function(t,e,i,n){var r=this,o=this.options.stacking;if(!i.isNull&&1<n.columnCount){var s=0,a=0;g(this.yAxis.stacking&&this.yAxis.stacking.stacks,(function(t){if("number"===typeof i.x&&(t=t[i.x.toString()])){var e=t.points[r.index],n=t.total;o?(e&&(s=a),t.hasValidPoints&&a++):d(e)&&(s=e[1],a=n||0)}})),t=(i.plotX||0)+((a-1)*n.paddedWidth+e)/2-e-s*n.paddedWidth}return t},translate:function(){var t=this,e=t.chart,i=t.options,n=t.dense=2>t.closestPointRange*t.xAxis.transA;n=t.borderWidth=m(i.borderWidth,n?0:1);var r=t.xAxis,s=t.yAxis,a=i.threshold,l=t.translatedThreshold=s.getThreshold(a),u=m(i.minPointLength,5),d=t.getColumnMetrics(),f=d.width,g=t.barW=Math.max(f,1+2*n),v=t.pointXOffset=d.offset,y=t.dataMin,x=t.dataMax;e.inverted&&(l-=.5),i.pointPadding&&(g=Math.ceil(g)),o.prototype.translate.apply(t),t.points.forEach((function(n){var o=m(n.yBottom,l),b=999+Math.abs(o),w=f,_=n.plotX||0;b=c(n.plotY,-b,s.len+b);var M=_+v,S=g,T=Math.min(b,o),E=Math.max(b,o)-T;if(u&&Math.abs(E)<u){E=u;var A=!s.reversed&&!n.negative||s.reversed&&n.negative;p(a)&&p(x)&&n.y===a&&x<=a&&(s.min||0)<a&&y!==x&&(A=!A),T=Math.abs(T-l)>u?o-u:l-(A?u:0)}h(n.options.pointWidth)&&(w=S=Math.ceil(n.options.pointWidth),M-=Math.round((w-f)/2)),i.centerInCategory&&(M=t.adjustForMissingColumns(M,w,n,d)),n.barX=M,n.pointWidth=w,n.tooltipPos=e.inverted?[s.len+s.pos-e.plotLeft-b,r.len+r.pos-e.plotTop-(_||0)-v-S/2,E]:[M+S/2,b+s.pos-e.plotTop,E],n.shapeType=t.pointClass.prototype.shapeType||"rect",n.shapeArgs=t.crispCol.apply(t,n.isNull?[M,l,S,0]:[M,T,S,E])}))},getSymbol:t,drawLegendSymbol:r.drawRectangle,drawGraph:function(){this.group[this.dense?"addClass":"removeClass"]("highcharts-dense-data")},pointAttribs:function(t,e){var i=this.options,n=this.pointAttrToOptions||{},r=n.stroke||"borderColor",o=n["stroke-width"]||"borderWidth",s=t&&t.color||this.color,a=t&&t[r]||i[r]||this.color||s,c=t&&t[o]||i[o]||this[o]||0;n=t&&t.options.dashStyle||i.dashStyle;var h=m(t&&t.opacity,i.opacity,1);if(t&&this.zones.length){var u=t.getZone();s=t.options.color||u&&(u.color||t.nonZonedColor)||this.color,u&&(a=u.borderColor||a,n=u.dashStyle||n,c=u.borderWidth||c)}return e&&t&&(t=f(i.states[e],t.options.states&&t.options.states[e]||{}),e=t.brightness,s=t.color||"undefined"!==typeof e&&l(s).brighten(t.brightness).get()||s,a=t[r]||a,c=t[o]||c,n=t.dashStyle||n,h=m(t.opacity,h)),r={fill:s,stroke:a,"stroke-width":c,opacity:h},n&&(r.dashstyle=n),r},drawPoints:function(){var t,e=this,i=this.chart,n=e.options,r=i.renderer,o=n.animationLimit||250;e.points.forEach((function(s){var a=s.graphic,l=!!a,c=a&&i.pointCount<o?"animate":"attr";p(s.plotY)&&null!==s.y?(t=s.shapeArgs,a&&s.hasNewShapeType()&&(a=a.destroy()),e.enabledDataSorting&&(s.startXPos=e.xAxis.reversed?-(t?t.width:0):e.xAxis.width),a||(s.graphic=a=r[s.shapeType](t).add(s.group||e.group))&&e.enabledDataSorting&&i.hasRendered&&i.pointCount<o&&(a.attr({x:s.startXPos}),l=!0,c="animate"),a&&l&&a[c](f(t)),n.borderRadius&&a[c]({r:n.borderRadius}),i.styledMode||a[c](e.pointAttribs(s,s.selected&&"select")).shadow(!1!==s.allowShadow&&n.shadow,null,n.stacking&&!n.borderRadius),a.addClass(s.getClassName(),!0)):a&&(s.graphic=a.destroy())}))},animate:function(t){var e=this,i=this.yAxis,n=e.options,r=this.chart.inverted,o={},s=r?"translateX":"translateY";if(t)o.scaleY=.001,t=c(i.toPixels(n.threshold),i.pos,i.pos+i.len),r?o.translateX=t-i.len:o.translateY=t,e.clipBox&&e.setClip(),e.group.attr(o);else{var l=e.group.attr(s);e.group.animate({scaleY:1},u(a(e.options.animation),{step:function(t,n){e.group&&(o[s]=l+n.pos*(i.pos-l),e.group.attr(o))}}))}},remove:function(){var t=this,e=t.chart;e.hasRendered&&e.series.forEach((function(e){e.type===t.type&&(e.isDirty=!0)})),o.prototype.remove.apply(t,arguments)}}),e})),e(i,"Series/BarSeries.js",[i["Core/Series/Series.js"]],(function(t){t.seriesType("bar","column",null,{inverted:!0})})),e(i,"Series/ScatterSeries.js",[i["Core/Series/Series.js"],i["Core/Globals.js"],i["Core/Utilities.js"]],(function(t,e,i){i=i.addEvent;var n=e.Series;t.seriesType("scatter","line",{lineWidth:0,findNearestPointBy:"xy",jitter:{x:0,y:0},marker:{enabled:!0},tooltip:{headerFormat:'<span style="color:{point.color}">●</span> <span style="font-size: 10px"> {series.name}</span><br/>',pointFormat:"x: <b>{point.x}</b><br/>y: <b>{point.y}</b><br/>"}},{sorted:!1,requireSorting:!1,noSharedTooltip:!0,trackerGroups:["group","markerGroup","dataLabelsGroup"],takeOrdinalPosition:!1,drawGraph:function(){(this.options.lineWidth||0===this.options.lineWidth&&this.graph&&this.graph.strokeWidth())&&n.prototype.drawGraph.call(this)},applyJitter:function(){var t=this,e=this.options.jitter,i=this.points.length;e&&this.points.forEach((function(n,r){["x","y"].forEach((function(o,s){var a="plot"+o.toUpperCase();if(e[o]&&!n.isNull){var l=t[o+"Axis"],c=e[o]*l.transA;if(l&&!l.isLog){var h=Math.max(0,n[a]-c);l=Math.min(l.len,n[a]+c),s=1e4*Math.sin(r+s*i),n[a]=h+(l-h)*(s-Math.floor(s)),"x"===o&&(n.clientX=n.plotX)}}}))}))}}),i(n,"afterTranslate",(function(){this.applyJitter&&this.applyJitter()}))})),e(i,"Mixins/CenteredSeries.js",[i["Core/Globals.js"],i["Core/Utilities.js"]],(function(t,e){var i=e.isNumber,n=e.pick,r=e.relativeLength,o=t.deg2rad;return t.CenteredSeriesMixin={getCenter:function(){var e=this.options,i=this.chart,o=2*(e.slicedOffset||0),s=i.plotWidth-2*o,a=i.plotHeight-2*o,l=e.center,c=Math.min(s,a),h=e.size,u=e.innerSize||0;for("string"===typeof h&&(h=parseFloat(h)),"string"===typeof u&&(u=parseFloat(u)),e=[n(l[0],"50%"),n(l[1],"50%"),n(h&&0>h?void 0:e.size,"100%"),n(u&&0>u?void 0:e.innerSize||0,"0%")],!i.angular||this instanceof t.Series||(e[3]=0),l=0;4>l;++l)h=e[l],i=2>l||2===l&&/%$/.test(h),e[l]=r(h,[s,a,c,e[2]][l])+(i?o:0);return e[3]>e[2]&&(e[3]=e[2]),e},getStartAndEndRadians:function(t,e){return t=i(t)?t:0,e=i(e)&&e>t&&360>e-t?e:t+360,{start:o*(t+-90),end:o*(e+-90)}}}})),e(i,"Series/PieSeries.js",[i["Core/Animation/AnimationUtilities.js"],i["Core/Series/Series.js"],i["Mixins/CenteredSeries.js"],i["Core/Globals.js"],i["Mixins/LegendSymbol.js"],i["Series/LineSeries.js"],i["Core/Series/Point.js"],i["Core/Renderer/SVG/SVGRenderer.js"],i["Core/Utilities.js"]],(function(t,e,i,n,r,o,s,a,l){var c=t.setAnimation,h=i.getStartAndEndRadians;t=n.noop;var u=l.addEvent,d=l.clamp,p=l.defined,f=l.fireEvent,m=l.isNumber,g=l.merge,v=l.pick,y=l.relativeLength;e.seriesType("pie","line",{center:[null,null],clip:!1,colorByPoint:!0,dataLabels:{allowOverlap:!0,connectorPadding:5,connectorShape:"fixedOffset",crookDistance:"70%",distance:30,enabled:!0,formatter:function(){return this.point.isNull?void 0:this.point.name},softConnector:!0,x:0},fillColor:void 0,ignoreHiddenPoint:!0,inactiveOtherPoints:!0,legendType:"point",marker:null,size:null,showInLegend:!1,slicedOffset:10,stickyTracking:!1,tooltip:{followPointer:!0},borderColor:"#ffffff",borderWidth:1,lineWidth:void 0,states:{hover:{brightness:.1}}},{isCartesian:!1,requireSorting:!1,directTouch:!0,noSharedTooltip:!0,trackerGroups:["group","dataLabelsGroup"],axisTypes:[],pointAttribs:e.seriesTypes.column.prototype.pointAttribs,animate:function(t){var e=this,i=e.points,n=e.startAngleRad;t||i.forEach((function(t){var i=t.graphic,r=t.shapeArgs;i&&r&&(i.attr({r:v(t.startR,e.center&&e.center[3]/2),start:n,end:n}),i.animate({r:r.r,start:r.start,end:r.end},e.options.animation))}))},hasData:function(){return!!this.processedXData.length},updateTotals:function(){var t,e=0,i=this.points,n=i.length,r=this.options.ignoreHiddenPoint;for(t=0;t<n;t++){var o=i[t];e+=r&&!o.visible||o.isNull?0:o.y}for(this.total=e,t=0;t<n;t++)o=i[t],o.percentage=0<e&&(o.visible||!r)?o.y/e*100:0,o.total=e},generatePoints:function(){o.prototype.generatePoints.call(this),this.updateTotals()},getX:function(t,e,i){var n=this.center,r=this.radii?this.radii[i.index]:n[2]/2;return t=Math.asin(d((t-n[1])/(r+i.labelDistance),-1,1)),n[0]+(e?-1:1)*Math.cos(t)*(r+i.labelDistance)+(0<i.labelDistance?(e?-1:1)*this.options.dataLabels.padding:0)},translate:function(t){this.generatePoints();var e=0,i=this.options,n=i.slicedOffset,r=n+(i.borderWidth||0),o=h(i.startAngle,i.endAngle),s=this.startAngleRad=o.start;o=(this.endAngleRad=o.end)-s;var a=this.points,l=i.dataLabels.distance;i=i.ignoreHiddenPoint;var c,u=a.length;for(t||(this.center=t=this.getCenter()),c=0;c<u;c++){var d=a[c],p=s+e*o;i&&!d.visible||(e+=d.percentage/100);var m=s+e*o;d.shapeType="arc",d.shapeArgs={x:t[0],y:t[1],r:t[2]/2,innerR:t[3]/2,start:Math.round(1e3*p)/1e3,end:Math.round(1e3*m)/1e3},d.labelDistance=v(d.options.dataLabels&&d.options.dataLabels.distance,l),d.labelDistance=y(d.labelDistance,d.shapeArgs.r),this.maxLabelDistance=Math.max(this.maxLabelDistance||0,d.labelDistance),m=(m+p)/2,m>1.5*Math.PI?m-=2*Math.PI:m<-Math.PI/2&&(m+=2*Math.PI),d.slicedTranslation={translateX:Math.round(Math.cos(m)*n),translateY:Math.round(Math.sin(m)*n)};var g=Math.cos(m)*t[2]/2,x=Math.sin(m)*t[2]/2;d.tooltipPos=[t[0]+.7*g,t[1]+.7*x],d.half=m<-Math.PI/2||m>Math.PI/2?1:0,d.angle=m,p=Math.min(r,d.labelDistance/5),d.labelPosition={natural:{x:t[0]+g+Math.cos(m)*d.labelDistance,y:t[1]+x+Math.sin(m)*d.labelDistance},final:{},alignment:0>d.labelDistance?"center":d.half?"right":"left",connectorPosition:{breakAt:{x:t[0]+g+Math.cos(m)*p,y:t[1]+x+Math.sin(m)*p},touchingSliceAt:{x:t[0]+g,y:t[1]+x}}}}f(this,"afterTranslate")},drawEmpty:function(){var t=this.startAngleRad,e=this.endAngleRad,i=this.options;if(0===this.total&&this.center){var n=this.center[0],r=this.center[1];this.graph||(this.graph=this.chart.renderer.arc(n,r,this.center[1]/2,0,t,e).addClass("highcharts-empty-series").add(this.group)),this.graph.attr({d:a.prototype.symbols.arc(n,r,this.center[2]/2,0,{start:t,end:e,innerR:this.center[3]/2})}),this.chart.styledMode||this.graph.attr({"stroke-width":i.borderWidth,fill:i.fillColor||"none",stroke:i.color||"#cccccc"})}else this.graph&&(this.graph=this.graph.destroy())},redrawPoints:function(){var t,e,i,n,r=this,o=r.chart,s=o.renderer,a=r.options.shadow;this.drawEmpty(),!a||r.shadowGroup||o.styledMode||(r.shadowGroup=s.g("shadow").attr({zIndex:-1}).add(r.group)),r.points.forEach((function(l){var c={};if(e=l.graphic,!l.isNull&&e){if(n=l.shapeArgs,t=l.getTranslate(),!o.styledMode){var h=l.shadowGroup;a&&!h&&(h=l.shadowGroup=s.g("shadow").add(r.shadowGroup)),h&&h.attr(t),i=r.pointAttribs(l,l.selected&&"select")}l.delayedRendering?(e.setRadialReference(r.center).attr(n).attr(t),o.styledMode||e.attr(i).attr({"stroke-linejoin":"round"}).shadow(a,h),l.delayedRendering=!1):(e.setRadialReference(r.center),o.styledMode||g(!0,c,i),g(!0,c,n,t),e.animate(c)),e.attr({visibility:l.visible?"inherit":"hidden"}),e.addClass(l.getClassName())}else e&&(l.graphic=e.destroy())}))},drawPoints:function(){var t=this.chart.renderer;this.points.forEach((function(e){e.graphic&&e.hasNewShapeType()&&(e.graphic=e.graphic.destroy()),e.graphic||(e.graphic=t[e.shapeType](e.shapeArgs).add(e.series.group),e.delayedRendering=!0)}))},searchPoint:t,sortByAngle:function(t,e){t.sort((function(t,i){return"undefined"!==typeof t.angle&&(i.angle-t.angle)*e}))},drawLegendSymbol:r.drawRectangle,getCenter:i.getCenter,getSymbol:t,drawGraph:null},{init:function(){s.prototype.init.apply(this,arguments);var t=this;t.name=v(t.name,"Slice");var e=function(e){t.slice("select"===e.type)};return u(t,"select",e),u(t,"unselect",e),t},isValid:function(){return m(this.y)&&0<=this.y},setVisible:function(t,e){var i=this,n=i.series,r=n.chart,o=n.options.ignoreHiddenPoint;e=v(e,o),t!==i.visible&&(i.visible=i.options.visible=t="undefined"===typeof t?!i.visible:t,n.options.data[n.data.indexOf(i)]=i.options,["graphic","dataLabel","connector","shadowGroup"].forEach((function(e){i[e]&&i[e][t?"show":"hide"](!0)})),i.legendItem&&r.legend.colorizeItem(i,t),t||"hover"!==i.state||i.setState(""),o&&(n.isDirty=!0),e&&r.redraw())},slice:function(t,e,i){var n=this.series;c(i,n.chart),v(e,!0),this.sliced=this.options.sliced=p(t)?t:!this.sliced,n.options.data[n.data.indexOf(this)]=this.options,this.graphic&&this.graphic.animate(this.getTranslate()),this.shadowGroup&&this.shadowGroup.animate(this.getTranslate())},getTranslate:function(){return this.sliced?this.slicedTranslation:{translateX:0,translateY:0}},haloPath:function(t){var e=this.shapeArgs;return this.sliced||!this.visible?[]:this.series.chart.renderer.symbols.arc(e.x,e.y,e.r+t,e.r+t,{innerR:e.r-1,start:e.start,end:e.end})},connectorShapes:{fixedOffset:function(t,e,i){var n=e.breakAt;return e=e.touchingSliceAt,[["M",t.x,t.y],i.softConnector?["C",t.x+("left"===t.alignment?-5:5),t.y,2*n.x-e.x,2*n.y-e.y,n.x,n.y]:["L",n.x,n.y],["L",e.x,e.y]]},straight:function(t,e){return e=e.touchingSliceAt,[["M",t.x,t.y],["L",e.x,e.y]]},crookedLine:function(t,e,i){e=e.touchingSliceAt;var n=this.series,r=n.center[0],o=n.chart.plotWidth,s=n.chart.plotLeft;n=t.alignment;var a=this.shapeArgs.r;return i=y(i.crookDistance,1),o="left"===n?r+a+(o+s-r-a)*(1-i):s+(r-a)*i,i=["L",o,t.y],r=!0,("left"===n?o>t.x||o<e.x:o<t.x||o>e.x)&&(r=!1),t=[["M",t.x,t.y]],r&&t.push(i),t.push(["L",e.x,e.y]),t}},getConnectorPath:function(){var t=this.labelPosition,e=this.series.options.dataLabels,i=e.connectorShape,n=this.connectorShapes;return n[i]&&(i=n[i]),i.call(this,{x:t.final.x,y:t.final.y,alignment:t.alignment},t.connectorPosition,e)}})})),e(i,"Core/Series/DataLabels.js",[i["Core/Animation/AnimationUtilities.js"],i["Core/Globals.js"],i["Core/Series/CartesianSeries.js"],i["Core/Utilities.js"]],(function(t,e,i,n){var r=t.getDeferredAnimation;t=e.noop;var o=e.seriesTypes,s=n.arrayMax,a=n.clamp,l=n.defined,c=n.extend,h=n.fireEvent,u=n.format,d=n.isArray,p=n.merge,f=n.objectEach,m=n.pick,g=n.relativeLength,v=n.splat,y=n.stableSort;e.distribute=function(t,i,n){function r(t,e){return t.target-e.target}var o,s=!0,l=t,c=[],h=0,u=l.reducedLen||i;for(o=t.length;o--;)h+=t[o].size;if(h>u){for(y(t,(function(t,e){return(e.rank||0)-(t.rank||0)})),h=o=0;h<=u;)h+=t[o].size,o++;c=t.splice(o-1,t.length)}for(y(t,r),t=t.map((function(t){return{size:t.size,targets:[t.target],align:m(t.align,.5)}}));s;){for(o=t.length;o--;)s=t[o],h=(Math.min.apply(0,s.targets)+Math.max.apply(0,s.targets))/2,s.pos=a(h-s.size*s.align,0,i-s.size);for(o=t.length,s=!1;o--;)0<o&&t[o-1].pos+t[o-1].size>t[o].pos&&(t[o-1].size+=t[o].size,t[o-1].targets=t[o-1].targets.concat(t[o].targets),t[o-1].align=.5,t[o-1].pos+t[o-1].size>i&&(t[o-1].pos=i-t[o-1].size),t.splice(o,1),s=!0)}l.push.apply(l,c),o=0,t.some((function(t){var r=0;if(t.targets.some((function(){if(l[o].pos=t.pos+r,"undefined"!==typeof n&&Math.abs(l[o].pos-l[o].target)>n)return l.slice(0,o+1).forEach((function(t){delete t.pos})),l.reducedLen=(l.reducedLen||i)-.1*i,l.reducedLen>.1*i&&e.distribute(l,i,n),!0;r+=l[o].size,o++})))return!0})),y(l,r)},i.prototype.drawDataLabels=function(){function t(t,e){var i=e.filter;return!i||(e=i.operator,t=t[i.property],i=i.value,">"===e&&t>i||"<"===e&&t<i||">="===e&&t>=i||"<="===e&&t<=i||"=="===e&&t==i||"==="===e&&t===i)}function e(t,e){var i,n=[];if(d(t)&&!d(e))n=t.map((function(t){return p(t,e)}));else if(d(e)&&!d(t))n=e.map((function(e){return p(t,e)}));else if(d(t)||d(e))for(i=Math.max(t.length,e.length);i--;)n[i]=p(t[i],e[i]);else n=p(t,e);return n}var i,n=this,o=n.chart,s=n.options,a=s.dataLabels,c=n.points,g=n.hasRendered||0,y=a.animation;y=a.defer?r(o,y,n):{defer:0,duration:0};var x=o.renderer;if(a=e(e(o.options.plotOptions&&o.options.plotOptions.series&&o.options.plotOptions.series.dataLabels,o.options.plotOptions&&o.options.plotOptions[n.type]&&o.options.plotOptions[n.type].dataLabels),a),h(this,"drawDataLabels"),d(a)||a.enabled||n._hasPointLabels){var b=n.plotGroup("dataLabelsGroup","data-labels",g?"inherit":"hidden",a.zIndex||6);b.attr({opacity:+g}),!g&&(g=n.dataLabelsGroup)&&(n.visible&&b.show(!0),g[s.animation?"animate":"attr"]({opacity:1},y)),c.forEach((function(r){i=v(e(a,r.dlOptions||r.options&&r.options.dataLabels)),i.forEach((function(e,i){var a=e.enabled&&(!r.isNull||r.dataLabelOnNull)&&t(r,e),c=r.dataLabels?r.dataLabels[i]:r.dataLabel,h=r.connectors?r.connectors[i]:r.connector,d=m(e.distance,r.labelDistance),p=!c;if(a){var g=r.getLabelConfig(),v=m(e[r.formatPrefix+"Format"],e.format);g=l(v)?u(v,g,o):(e[r.formatPrefix+"Formatter"]||e.formatter).call(g,e),v=e.style;var y=e.rotation;o.styledMode||(v.color=m(e.color,v.color,n.color,"#000000"),"contrast"===v.color?(r.contrastColor=x.getContrast(r.color||n.color),v.color=!l(d)&&e.inside||0>d||s.stacking?r.contrastColor:"#000000"):delete r.contrastColor,s.cursor&&(v.cursor=s.cursor));var w={r:e.borderRadius||0,rotation:y,padding:e.padding,zIndex:1};o.styledMode||(w.fill=e.backgroundColor,w.stroke=e.borderColor,w["stroke-width"]=e.borderWidth),f(w,(function(t,e){"undefined"===typeof t&&delete w[e]}))}!c||a&&l(g)?a&&l(g)&&(c?w.text=g:(r.dataLabels=r.dataLabels||[],c=r.dataLabels[i]=y?x.text(g,0,-9999,e.useHTML).addClass("highcharts-data-label"):x.label(g,0,-9999,e.shape,null,null,e.useHTML,null,"data-label"),i||(r.dataLabel=c),c.addClass(" highcharts-data-label-color-"+r.colorIndex+" "+(e.className||"")+(e.useHTML?" highcharts-tracker":""))),c.options=e,c.attr(w),o.styledMode||c.css(v).shadow(e.shadow),c.added||c.add(b),e.textPath&&!e.useHTML&&(c.setTextPath(r.getDataLabelPath&&r.getDataLabelPath(c)||r.graphic,e.textPath),r.dataLabelPath&&!e.textPath.enabled&&(r.dataLabelPath=r.dataLabelPath.destroy())),n.alignDataLabel(r,c,e,null,p)):(r.dataLabel=r.dataLabel&&r.dataLabel.destroy(),r.dataLabels&&(1===r.dataLabels.length?delete r.dataLabels:delete r.dataLabels[i]),i||delete r.dataLabel,h&&(r.connector=r.connector.destroy(),r.connectors&&(1===r.connectors.length?delete r.connectors:delete r.connectors[i])))}))}))}h(this,"afterDrawDataLabels")},i.prototype.alignDataLabel=function(t,e,i,n,r){var o=this,s=this.chart,a=this.isCartesian&&s.inverted,l=this.enabledDataSorting,h=m(t.dlBox&&t.dlBox.centerX,t.plotX,-9999),u=m(t.plotY,-9999),d=e.getBBox(),p=i.rotation,f=i.align,g=s.isInsidePlot(h,Math.round(u),a),v="justify"===m(i.overflow,l?"none":"justify"),y=this.visible&&!1!==t.visible&&(t.series.forceDL||l&&!v||g||i.inside&&n&&s.isInsidePlot(h,a?n.x+1:n.y+n.height-1,a)),x=function(i){l&&o.xAxis&&!v&&o.setDataLabelStartPos(t,e,r,g,i)};if(y){var b=s.renderer.fontMetrics(s.styledMode?void 0:i.style.fontSize,e).b;n=c({x:a?this.yAxis.len-u:h,y:Math.round(a?this.xAxis.len-h:u),width:0,height:0},n),c(i,{width:d.width,height:d.height}),p?(v=!1,h=s.renderer.rotCorr(b,p),h={x:n.x+(i.x||0)+n.width/2+h.x,y:n.y+(i.y||0)+{top:0,middle:.5,bottom:1}[i.verticalAlign]*n.height},x(h),e[r?"attr":"animate"](h).attr({align:f}),x=(p+720)%360,x=180<x&&360>x,"left"===f?h.y-=x?d.height:0:"center"===f?(h.x-=d.width/2,h.y-=d.height/2):"right"===f&&(h.x-=d.width,h.y-=x?0:d.height),e.placed=!0,e.alignAttr=h):(x(n),e.align(i,null,n),h=e.alignAttr),v&&0<=n.height?this.justifyDataLabel(e,i,h,d,n,r):m(i.crop,!0)&&(y=s.isInsidePlot(h.x,h.y)&&s.isInsidePlot(h.x+d.width,h.y+d.height)),i.shape&&!p&&e[r?"attr":"animate"]({anchorX:a?s.plotWidth-t.plotY:t.plotX,anchorY:a?s.plotHeight-t.plotX:t.plotY})}r&&l&&(e.placed=!1),y||l&&!v||(e.hide(!0),e.placed=!1)},i.prototype.setDataLabelStartPos=function(t,e,i,n,r){var o=this.chart,s=o.inverted,a=this.xAxis,l=a.reversed,c=s?e.height/2:e.width/2;t=(t=t.pointWidth)?t/2:0,a=s?r.x:l?-c-t:a.width-c+t,r=s?l?this.yAxis.height-c+t:-c-t:r.y,e.startXPos=a,e.startYPos=r,n?"hidden"===e.visibility&&(e.show(),e.attr({opacity:0}).animate({opacity:1})):e.attr({opacity:1}).animate({opacity:0},void 0,e.hide),o.hasRendered&&(i&&e.attr({x:e.startXPos,y:e.startYPos}),e.placed=!0)},i.prototype.justifyDataLabel=function(t,e,i,n,r,o){var s=this.chart,a=e.align,l=e.verticalAlign,c=t.box?0:t.padding||0,h=e.x;h=void 0===h?0:h;var u=e.y,d=void 0===u?0:u;if(u=i.x+c,0>u){"right"===a&&0<=h?(e.align="left",e.inside=!0):h-=u;var p=!0}return u=i.x+n.width-c,u>s.plotWidth&&("left"===a&&0>=h?(e.align="right",e.inside=!0):h+=s.plotWidth-u,p=!0),u=i.y+c,0>u&&("bottom"===l&&0<=d?(e.verticalAlign="top",e.inside=!0):d-=u,p=!0),u=i.y+n.height-c,u>s.plotHeight&&("top"===l&&0>=d?(e.verticalAlign="bottom",e.inside=!0):d+=s.plotHeight-u,p=!0),p&&(e.x=h,e.y=d,t.placed=!o,t.align(e,void 0,r)),p},o.pie&&(o.pie.prototype.dataLabelPositioners={radialDistributionY:function(t){return t.top+t.distributeBox.pos},radialDistributionX:function(t,e,i,n){return t.getX(i<e.top+2||i>e.bottom-2?n:i,e.half,e)},justify:function(t,e,i){return i[0]+(t.half?-1:1)*(e+t.labelDistance)},alignToPlotEdges:function(t,e,i,n){return t=t.getBBox().width,e?t+n:i-t-n},alignToConnectors:function(t,e,i,n){var r,o=0;return t.forEach((function(t){r=t.dataLabel.getBBox().width,r>o&&(o=r)})),e?o+n:i-o-n}},o.pie.prototype.drawDataLabels=function(){var t,n,r,o,a,c,h,u,d,f,g,v,y=this,x=y.data,b=y.chart,w=y.options.dataLabels||{},_=w.connectorPadding,M=b.plotWidth,S=b.plotHeight,T=b.plotLeft,E=Math.round(b.chartWidth/3),A=y.center,L=A[2]/2,C=A[1],P=[[],[]],R=[0,0,0,0],O=y.dataLabelPositioners;y.visible&&(w.enabled||y._hasPointLabels)&&(x.forEach((function(t){t.dataLabel&&t.visible&&t.dataLabel.shortened&&(t.dataLabel.attr({width:"auto"}).css({width:"auto",textOverflow:"clip"}),t.dataLabel.shortened=!1)})),i.prototype.drawDataLabels.apply(y),x.forEach((function(t){t.dataLabel&&(t.visible?(P[t.half].push(t),t.dataLabel._pos=null,!l(w.style.width)&&!l(t.options.dataLabels&&t.options.dataLabels.style&&t.options.dataLabels.style.width)&&t.dataLabel.getBBox().width>E&&(t.dataLabel.css({width:Math.round(.7*E)+"px"}),t.dataLabel.shortened=!0)):(t.dataLabel=t.dataLabel.destroy(),t.dataLabels&&1===t.dataLabels.length&&delete t.dataLabels))})),P.forEach((function(i,n){var r,s=i.length,p=[];if(s){if(y.sortByAngle(i,n-.5),0<y.maxLabelDistance){var x=Math.max(0,C-L-y.maxLabelDistance),E=Math.min(C+L+y.maxLabelDistance,b.plotHeight);i.forEach((function(t){0<t.labelDistance&&t.dataLabel&&(t.top=Math.max(0,C-L-t.labelDistance),t.bottom=Math.min(C+L+t.labelDistance,b.plotHeight),r=t.dataLabel.getBBox().height||21,t.distributeBox={target:t.labelPosition.natural.y-t.top+r/2,size:r,rank:t.y},p.push(t.distributeBox))})),x=E+r-x,e.distribute(p,x,x/5)}for(g=0;g<s;g++){if(t=i[g],c=t.labelPosition,o=t.dataLabel,f=!1===t.visible?"hidden":"inherit",d=x=c.natural.y,p&&l(t.distributeBox)&&("undefined"===typeof t.distributeBox.pos?f="hidden":(h=t.distributeBox.size,d=O.radialDistributionY(t))),delete t.positionIndex,w.justify)u=O.justify(t,L,A);else switch(w.alignTo){case"connectors":u=O.alignToConnectors(i,n,M,T);break;case"plotEdges":u=O.alignToPlotEdges(o,n,M,T);break;default:u=O.radialDistributionX(y,t,d,x)}o._attr={visibility:f,align:c.alignment},v=t.options.dataLabels||{},o._pos={x:u+m(v.x,w.x)+({left:_,right:-_}[c.alignment]||0),y:d+m(v.y,w.y)-10},c.final.x=u,c.final.y=d,m(w.crop,!0)&&(a=o.getBBox().width,x=null,u-a<_&&1===n?(x=Math.round(a-u+_),R[3]=Math.max(x,R[3])):u+a>M-_&&0===n&&(x=Math.round(u+a-M+_),R[1]=Math.max(x,R[1])),0>d-h/2?R[0]=Math.max(Math.round(h/2-d),R[0]):d+h/2>S&&(R[2]=Math.max(Math.round(d+h/2-S),R[2])),o.sideOverflow=x)}}})),0===s(R)||this.verifyDataLabelOverflow(R))&&(this.placeDataLabels(),this.points.forEach((function(t){var e;(v=p(w,t.options.dataLabels),n=m(v.connectorWidth,1))&&(r=t.connector,(o=t.dataLabel)&&o._pos&&t.visible&&0<t.labelDistance?(f=o._attr.visibility,(e=!r)&&(t.connector=r=b.renderer.path().addClass("highcharts-data-label-connector highcharts-color-"+t.colorIndex+(t.className?" "+t.className:"")).add(y.dataLabelsGroup),b.styledMode||r.attr({"stroke-width":n,stroke:v.connectorColor||t.color||"#666666"})),r[e?"attr":"animate"]({d:t.getConnectorPath()}),r.attr("visibility",f)):r&&(t.connector=r.destroy()))})))},o.pie.prototype.placeDataLabels=function(){this.points.forEach((function(t){var e,i=t.dataLabel;i&&t.visible&&((e=i._pos)?(i.sideOverflow&&(i._attr.width=Math.max(i.getBBox().width-i.sideOverflow,0),i.css({width:i._attr.width+"px",textOverflow:(this.options.dataLabels.style||{}).textOverflow||"ellipsis"}),i.shortened=!0),i.attr(i._attr),i[i.moved?"animate":"attr"](e),i.moved=!0):i&&i.attr({y:-9999})),delete t.distributeBox}),this)},o.pie.prototype.alignDataLabel=t,o.pie.prototype.verifyDataLabelOverflow=function(t){var e=this.center,i=this.options,n=i.center,r=i.minSize||80,o=null!==i.size;if(!o){if(null!==n[0])var s=Math.max(e[2]-Math.max(t[1],t[3]),r);else s=Math.max(e[2]-t[1]-t[3],r),e[0]+=(t[3]-t[1])/2;null!==n[1]?s=a(s,r,e[2]-Math.max(t[0],t[2])):(s=a(s,r,e[2]-t[0]-t[2]),e[1]+=(t[0]-t[2])/2),s<e[2]?(e[2]=s,e[3]=Math.min(g(i.innerSize||0,s),s),this.translate(e),this.drawDataLabels&&this.drawDataLabels()):o=!0}return o}),o.column&&(o.column.prototype.alignDataLabel=function(t,e,n,r,o){var s=this.chart.inverted,a=t.series,l=t.dlBox||t.shapeArgs,c=m(t.below,t.plotY>m(this.translatedThreshold,a.yAxis.len)),h=m(n.inside,!!this.options.stacking);l&&(r=p(l),0>r.y&&(r.height+=r.y,r.y=0),l=r.y+r.height-a.yAxis.len,0<l&&l<r.height&&(r.height-=l),s&&(r={x:a.yAxis.len-r.y-r.height,y:a.xAxis.len-r.x-r.width,width:r.height,height:r.width}),h||(s?(r.x+=c?0:r.width,r.width=0):(r.y+=c?r.height:0,r.height=0))),n.align=m(n.align,!s||h?"center":c?"right":"left"),n.verticalAlign=m(n.verticalAlign,s||h?"middle":c?"top":"bottom"),i.prototype.alignDataLabel.call(this,t,e,n,r,o),n.inside&&t.contrastColor&&e.css({color:t.contrastColor})})})),e(i,"Extensions/OverlappingDataLabels.js",[i["Core/Chart/Chart.js"],i["Core/Utilities.js"]],(function(t,e){var i=e.addEvent,n=e.fireEvent,r=e.isArray,o=e.isNumber,s=e.objectEach,a=e.pick;i(t,"render",(function(){var t=[];(this.labelCollectors||[]).forEach((function(e){t=t.concat(e())})),(this.yAxis||[]).forEach((function(e){e.stacking&&e.options.stackLabels&&!e.options.stackLabels.allowOverlap&&s(e.stacking.stacks,(function(e){s(e,(function(e){t.push(e.label)}))}))})),(this.series||[]).forEach((function(e){var i=e.options.dataLabels;e.visible&&(!1!==i.enabled||e._hasPointLabels)&&(e.nodes||e.points).forEach((function(e){e.visible&&(r(e.dataLabels)?e.dataLabels:e.dataLabel?[e.dataLabel]:[]).forEach((function(i){var n=i.options;i.labelrank=a(n.labelrank,e.labelrank,e.shapeArgs&&e.shapeArgs.height),n.allowOverlap||t.push(i)}))}))})),this.hideOverlappingLabels(t)})),t.prototype.hideOverlappingLabels=function(t){var e,i,r,s=this,a=t.length,l=s.renderer,c=!1,h=function(t){var e,i,n=t.box?0:t.padding||0,r=e=0;if(t&&(!t.alignAttr||t.placed)){var s=t.alignAttr||{x:t.attr("x"),y:t.attr("y")},a=t.parentGroup;t.width||(e=t.getBBox(),t.width=e.width,t.height=e.height,e=l.fontMetrics(null,t.element).h);var c=t.width-2*n;return(i={left:"0",center:"0.5",right:"1"}[t.alignValue])?r=+i*c:o(t.x)&&Math.round(t.x)!==t.translateX&&(r=t.x-t.translateX),{x:s.x+(a.translateX||0)+n-(r||0),y:s.y+(a.translateY||0)+n-e,width:t.width-2*n,height:t.height-2*n}}};for(i=0;i<a;i++)(e=t[i])&&(e.oldOpacity=e.opacity,e.newOpacity=1,e.absoluteBox=h(e));for(t.sort((function(t,e){return(e.labelrank||0)-(t.labelrank||0)})),i=0;i<a;i++){var u=(h=t[i])&&h.absoluteBox;for(e=i+1;e<a;++e){var d=(r=t[e])&&r.absoluteBox;!u||!d||h===r||0===h.newOpacity||0===r.newOpacity||d.x>=u.x+u.width||d.x+d.width<=u.x||d.y>=u.y+u.height||d.y+d.height<=u.y||((h.labelrank<r.labelrank?h:r).newOpacity=0)}}t.forEach((function(t){if(t){var e=t.newOpacity;t.oldOpacity!==e&&(t.alignAttr&&t.placed?(t[e?"removeClass":"addClass"]("highcharts-data-label-hidden"),c=!0,t.alignAttr.opacity=e,t[t.isOld?"animate":"attr"](t.alignAttr,null,(function(){s.styledMode||t.css({pointerEvents:e?"auto":"none"}),t.visibility=e?"inherit":"hidden"})),n(s,"afterHideOverlappingLabel")):t.attr({opacity:e})),t.isOld=!0}})),c&&n(s,"afterHideAllOverlappingLabels")}})),e(i,"Core/Interaction.js",[i["Core/Series/Series.js"],i["Core/Chart/Chart.js"],i["Core/Globals.js"],i["Core/Legend.js"],i["Series/LineSeries.js"],i["Core/Options.js"],i["Core/Series/Point.js"],i["Core/Utilities.js"]],(function(t,e,i,n,r,o,s,a){t=t.seriesTypes;var l=i.hasTouch,c=i.svg,h=o.defaultOptions,u=a.addEvent,d=a.createElement,p=a.css,f=a.defined,m=a.extend,g=a.fireEvent,v=a.isArray,y=a.isFunction,x=a.isNumber,b=a.isObject,w=a.merge,_=a.objectEach,M=a.pick;i=i.TrackerMixin={drawTrackerPoint:function(){var t,e=this,i=e.chart,n=i.pointer,r=function(t){var e=n.getPointFromEvent(t);"undefined"!==typeof e&&(n.isDirectTouch=!0,e.onMouseOver(t))};e.points.forEach((function(e){t=v(e.dataLabels)?e.dataLabels:e.dataLabel?[e.dataLabel]:[],e.graphic&&(e.graphic.element.point=e),t.forEach((function(t){t.div?t.div.point=e:t.element.point=e}))})),e._hasTracking||(e.trackerGroups.forEach((function(t){e[t]&&(e[t].addClass("highcharts-tracker").on("mouseover",r).on("mouseout",(function(t){n.onTrackerMouseOut(t)})),l&&e[t].on("touchstart",r),!i.styledMode&&e.options.cursor&&e[t].css(p).css({cursor:e.options.cursor}))})),e._hasTracking=!0),g(this,"afterDrawTracker")},drawTrackerGraph:function(){var t=this,e=t.options,i=e.trackByArea,n=[].concat(i?t.areaPath:t.graphPath),r=t.chart,o=r.pointer,s=r.renderer,a=r.options.tooltip.snap,h=t.tracker,u=function(e){r.hoverSeries!==t&&t.onMouseOver()},d="rgba(192,192,192,"+(c?1e-4:.002)+")";h?h.attr({d:n}):t.graph&&(t.tracker=s.path(n).attr({visibility:t.visible?"visible":"hidden",zIndex:2}).addClass(i?"highcharts-tracker-area":"highcharts-tracker-line").add(t.group),r.styledMode||t.tracker.attr({"stroke-linecap":"round","stroke-linejoin":"round",stroke:d,fill:i?d:"none","stroke-width":t.graph.strokeWidth()+(i?0:2*a)}),[t.tracker,t.markerGroup].forEach((function(t){t.addClass("highcharts-tracker").on("mouseover",u).on("mouseout",(function(t){o.onTrackerMouseOut(t)})),e.cursor&&!r.styledMode&&t.css({cursor:e.cursor}),l&&t.on("touchstart",u)}))),g(this,"afterDrawTracker")}},t.column&&(t.column.prototype.drawTracker=i.drawTrackerPoint),t.pie&&(t.pie.prototype.drawTracker=i.drawTrackerPoint),t.scatter&&(t.scatter.prototype.drawTracker=i.drawTrackerPoint),m(n.prototype,{setItemEvents:function(t,e,i){var n=this,r=n.chart.renderer.boxWrapper,o=t instanceof s,a="highcharts-legend-"+(o?"point":"series")+"-active",l=n.chart.styledMode;(i?[e,t.legendSymbol]:[t.legendGroup]).forEach((function(i){i&&i.on("mouseover",(function(){t.visible&&n.allItems.forEach((function(e){t!==e&&e.setState("inactive",!o)})),t.setState("hover"),t.visible&&r.addClass(a),l||e.css(n.options.itemHoverStyle)})).on("mouseout",(function(){n.chart.styledMode||e.css(w(t.visible?n.itemStyle:n.itemHiddenStyle)),n.allItems.forEach((function(e){t!==e&&e.setState("",!o)})),r.removeClass(a),t.setState()})).on("click",(function(e){var i=function(){t.setVisible&&t.setVisible(),n.allItems.forEach((function(e){t!==e&&e.setState(t.visible?"inactive":"",!o)}))};r.removeClass(a),e={browserEvent:e},t.firePointEvent?t.firePointEvent("legendItemClick",e,i):g(t,"legendItemClick",e,i)}))}))},createCheckboxForItem:function(t){t.checkbox=d("input",{type:"checkbox",className:"highcharts-legend-checkbox",checked:t.selected,defaultChecked:t.selected},this.options.itemCheckboxStyle,this.chart.container),u(t.checkbox,"click",(function(e){g(t.series||t,"checkboxClick",{checked:e.target.checked,item:t},(function(){t.select()}))}))}}),m(e.prototype,{showResetZoom:function(){function t(){e.zoomOut()}var e=this,i=h.lang,n=e.options.chart.resetZoomButton,r=n.theme,o=r.states,s="chart"===n.relativeTo||"spaceBox"===n.relativeTo?null:"plotBox";g(this,"beforeShowResetZoom",null,(function(){e.resetZoomButton=e.renderer.button(i.resetZoom,null,null,t,r,o&&o.hover).attr({align:n.position.align,title:i.resetZoomTitle}).addClass("highcharts-reset-zoom").add().align(n.position,!1,s)})),g(this,"afterShowResetZoom")},zoomOut:function(){g(this,"selection",{resetSelection:!0},this.zoom)},zoom:function(t){var e,i=this,n=i.pointer,r=!1,o=i.inverted?n.mouseDownX:n.mouseDownY;!t||t.resetSelection?(i.axes.forEach((function(t){e=t.zoom()})),n.initiated=!1):t.xAxis.concat(t.yAxis).forEach((function(t){var s=t.axis,a=i.inverted?s.left:s.top,l=i.inverted?a+s.width:a+s.height,c=s.isXAxis,h=!1;(!c&&o>=a&&o<=l||c||!f(o))&&(h=!0),n[c?"zoomX":"zoomY"]&&h&&(e=s.zoom(t.min,t.max),s.displayBtn&&(r=!0))}));var s=i.resetZoomButton;r&&!s?i.showResetZoom():!r&&b(s)&&(i.resetZoomButton=s.destroy()),e&&i.redraw(M(i.options.chart.animation,t&&t.animation,100>i.pointCount))},pan:function(t,e){var i,n=this,r=n.hoverPoints,o=n.options.chart,s=n.options.mapNavigation&&n.options.mapNavigation.enabled;e="object"===typeof e?e:{enabled:e,type:"x"},o&&o.panning&&(o.panning=e);var a=e.type;g(this,"pan",{originalEvent:t},(function(){r&&r.forEach((function(t){t.setState()}));var e=[1];"xy"===a?e=[1,0]:"y"===a&&(e=[0]),e.forEach((function(e){var r=n[e?"xAxis":"yAxis"][0],o=r.horiz,l=t[o?"chartX":"chartY"];o=o?"mouseDownX":"mouseDownY";var c=n[o],h=(r.pointRange||0)/2,u=r.reversed&&!n.inverted||!r.reversed&&n.inverted?-1:1,d=r.getExtremes(),p=r.toValue(c-l,!0)+h*u;u=r.toValue(c+r.len-l,!0)-h*u;var f=u<p;c=f?u:p,p=f?p:u;var m=r.hasVerticalPanning(),g=r.panningState;r.series.forEach((function(t){if(m&&!e&&(!g||g.isDirty)){var i=t.getProcessedData(!0);t=t.getExtremes(i.yData,!0),g||(g={startMin:Number.MAX_VALUE,startMax:-Number.MAX_VALUE}),x(t.dataMin)&&x(t.dataMax)&&(g.startMin=Math.min(t.dataMin,g.startMin),g.startMax=Math.max(t.dataMax,g.startMax))}})),u=Math.min(M(null===g||void 0===g?void 0:g.startMin,d.dataMin),h?d.min:r.toValue(r.toPixels(d.min)-r.minPixelPadding)),h=Math.max(M(null===g||void 0===g?void 0:g.startMax,d.dataMax),h?d.max:r.toValue(r.toPixels(d.max)+r.minPixelPadding)),r.panningState=g,r.isOrdinal||(f=u-c,0<f&&(p+=f,c=u),f=p-h,0<f&&(p=h,c-=f),r.series.length&&c!==d.min&&p!==d.max&&c>=u&&p<=h&&(r.setExtremes(c,p,!1,!1,{trigger:"pan"}),n.resetZoomButton||s||c===u||p===h||!a.match("y")||(n.showResetZoom(),r.displayBtn=!1),i=!0),n[o]=l)})),i&&n.redraw(!1),p(n.container,{cursor:"move"})}))}}),m(s.prototype,{select:function(t,e){var i=this,n=i.series,r=n.chart;this.selectedStaging=t=M(t,!i.selected),i.firePointEvent(t?"select":"unselect",{accumulate:e},(function(){i.selected=i.options.selected=t,n.options.data[n.data.indexOf(i)]=i.options,i.setState(t&&"select"),e||r.getSelectedPoints().forEach((function(t){var e=t.series;t.selected&&t!==i&&(t.selected=t.options.selected=!1,e.options.data[e.data.indexOf(t)]=t.options,t.setState(r.hoverPoints&&e.options.inactiveOtherPoints?"inactive":""),t.firePointEvent("unselect"))}))})),delete this.selectedStaging},onMouseOver:function(t){var e=this.series.chart,i=e.pointer;t=t?i.normalize(t):i.getChartCoordinatesFromPoint(this,e.inverted),i.runPointActions(t,this)},onMouseOut:function(){var t=this.series.chart;this.firePointEvent("mouseOut"),this.series.options.inactiveOtherPoints||(t.hoverPoints||[]).forEach((function(t){t.setState()})),t.hoverPoints=t.hoverPoint=null},importEvents:function(){if(!this.hasImportedEvents){var t=this,e=w(t.series.options.point,t.options).events;t.events=e,_(e,(function(e,i){y(e)&&u(t,i,e)})),this.hasImportedEvents=!0}},setState:function(t,e){var i,n=this.series,r=this.state,o=n.options.states[t||"normal"]||{},s=h.plotOptions[n.type].marker&&n.options.marker,a=s&&!1===s.enabled,l=s&&s.states&&s.states[t||"normal"]||{},c=!1===l.enabled,u=n.stateMarkerGraphic,d=this.marker||{},p=n.chart,f=n.halo,v=s&&n.markerAttribs;if(t=t||"",!(t===this.state&&!e||this.selected&&"select"!==t||!1===o.enabled||t&&(c||a&&!1===l.enabled)||t&&d.states&&d.states[t]&&!1===d.states[t].enabled)){if(this.state=t,v&&(i=n.markerAttribs(this,t)),this.graphic){if(r&&this.graphic.removeClass("highcharts-point-"+r),t&&this.graphic.addClass("highcharts-point-"+t),!p.styledMode){var y=n.pointAttribs(this,t),x=M(p.options.chart.animation,o.animation);n.options.inactiveOtherPoints&&y.opacity&&((this.dataLabels||[]).forEach((function(t){t&&t.animate({opacity:y.opacity},x)})),this.connector&&this.connector.animate({opacity:y.opacity},x)),this.graphic.animate(y,x)}i&&this.graphic.animate(i,M(p.options.chart.animation,l.animation,s.animation)),u&&u.hide()}else t&&l&&(r=d.symbol||n.symbol,u&&u.currentSymbol!==r&&(u=u.destroy()),i&&(u?u[e?"animate":"attr"]({x:i.x,y:i.y}):r&&(n.stateMarkerGraphic=u=p.renderer.symbol(r,i.x,i.y,i.width,i.height).add(n.markerGroup),u.currentSymbol=r)),!p.styledMode&&u&&u.attr(n.pointAttribs(this,t))),u&&(u[t&&this.isInside?"show":"hide"](),u.element.point=this);t=o.halo,o=(u=this.graphic||u)&&u.visibility||"inherit",t&&t.size&&u&&"hidden"!==o&&!this.isCluster?(f||(n.halo=f=p.renderer.path().add(u.parentGroup)),f.show()[e?"animate":"attr"]({d:this.haloPath(t.size)}),f.attr({class:"highcharts-halo highcharts-color-"+M(this.colorIndex,n.colorIndex)+(this.className?" "+this.className:""),visibility:o,zIndex:-1}),f.point=this,p.styledMode||f.attr(m({fill:this.color||n.color,"fill-opacity":t.opacity},t.attributes))):f&&f.point&&f.point.haloPath&&f.animate({d:f.point.haloPath(0)},null,f.hide),g(this,"afterSetState")}},haloPath:function(t){return this.series.chart.renderer.symbols.circle(Math.floor(this.plotX)-t,this.plotY-t,2*t,2*t)}}),m(r.prototype,{onMouseOver:function(){var t=this.chart,e=t.hoverSeries;t.pointer.setHoverChartIndex(),e&&e!==this&&e.onMouseOut(),this.options.events.mouseOver&&g(this,"mouseOver"),this.setState("hover"),t.hoverSeries=this},onMouseOut:function(){var t=this.options,e=this.chart,i=e.tooltip,n=e.hoverPoint;e.hoverSeries=null,n&&n.onMouseOut(),this&&t.events.mouseOut&&g(this,"mouseOut"),!i||this.stickyTracking||i.shared&&!this.noSharedTooltip||i.hide(),e.series.forEach((function(t){t.setState("",!0)}))},setState:function(t,e){var i=this,n=i.options,r=i.graph,o=n.inactiveOtherPoints,s=n.states,a=n.lineWidth,l=n.opacity,c=M(s[t||"normal"]&&s[t||"normal"].animation,i.chart.options.chart.animation);if(n=0,t=t||"",i.state!==t&&([i.group,i.markerGroup,i.dataLabelsGroup].forEach((function(e){e&&(i.state&&e.removeClass("highcharts-series-"+i.state),t&&e.addClass("highcharts-series-"+t))})),i.state=t,!i.chart.styledMode)){if(s[t]&&!1===s[t].enabled)return;if(t&&(a=s[t].lineWidth||a+(s[t].lineWidthPlus||0),l=M(s[t].opacity,l)),r&&!r.dashstyle)for(s={"stroke-width":a},r.animate(s,c);i["zone-graph-"+n];)i["zone-graph-"+n].attr(s),n+=1;o||[i.group,i.markerGroup,i.dataLabelsGroup,i.labelBySeries].forEach((function(t){t&&t.animate({opacity:l},c)}))}e&&o&&i.points&&i.setAllPointsToState(t)},setAllPointsToState:function(t){this.points.forEach((function(e){e.setState&&e.setState(t)}))},setVisible:function(t,e){var i=this,n=i.chart,r=i.legendItem,o=n.options.chart.ignoreHiddenSeries,s=i.visible,a=(i.visible=t=i.options.visible=i.userOptions.visible="undefined"===typeof t?!s:t)?"show":"hide";["group","dataLabelsGroup","markerGroup","tracker","tt"].forEach((function(t){i[t]&&i[t][a]()})),n.hoverSeries!==i&&(n.hoverPoint&&n.hoverPoint.series)!==i||i.onMouseOut(),r&&n.legend.colorizeItem(i,t),i.isDirty=!0,i.options.stacking&&n.series.forEach((function(t){t.options.stacking&&t.visible&&(t.isDirty=!0)})),i.linkedSeries.forEach((function(e){e.setVisible(t,!1)})),o&&(n.isDirtyBox=!0),g(i,a),!1!==e&&n.redraw()},show:function(){this.setVisible(!0)},hide:function(){this.setVisible(!1)},select:function(t){this.selected=t=this.options.selected="undefined"===typeof t?!this.selected:t,this.checkbox&&(this.checkbox.checked=t),g(this,t?"select":"unselect")},drawTracker:i.drawTrackerGraph})})),e(i,"Core/Responsive.js",[i["Core/Chart/Chart.js"],i["Core/Utilities.js"]],(function(t,e){var i=e.find,n=e.isArray,r=e.isObject,o=e.merge,s=e.objectEach,a=e.pick,l=e.splat,c=e.uniqueKey;t.prototype.setResponsive=function(t,e){var n=this.options.responsive,r=[],s=this.currentResponsive;!e&&n&&n.rules&&n.rules.forEach((function(t){"undefined"===typeof t._id&&(t._id=c()),this.matchResponsiveRule(t,r)}),this),e=o.apply(0,r.map((function(t){return i(n.rules,(function(e){return e._id===t})).chartOptions}))),e.isResponsiveOptions=!0,r=r.toString()||void 0,r!==(s&&s.ruleIds)&&(s&&this.update(s.undoOptions,t,!0),r?(s=this.currentOptions(e),s.isResponsiveOptions=!0,this.currentResponsive={ruleIds:r,mergedOptions:e,undoOptions:s},this.update(e,t,!0)):this.currentResponsive=void 0)},t.prototype.matchResponsiveRule=function(t,e){var i=t.condition;(i.callback||function(){return this.chartWidth<=a(i.maxWidth,Number.MAX_VALUE)&&this.chartHeight<=a(i.maxHeight,Number.MAX_VALUE)&&this.chartWidth>=a(i.minWidth,0)&&this.chartHeight>=a(i.minHeight,0)}).call(this)&&e.push(t._id)},t.prototype.currentOptions=function(t){function e(t,o,a,c){var h;s(t,(function(t,s){if(!c&&-1<i.collectionsWithUpdate.indexOf(s))for(t=l(t),a[s]=[],h=0;h<Math.max(t.length,o[s].length);h++)o[s][h]&&(void 0===t[h]?a[s][h]=o[s][h]:(a[s][h]={},e(t[h],o[s][h],a[s][h],c+1)));else r(t)?(a[s]=n(t)?[]:{},e(t,o[s]||{},a[s],c+1)):a[s]="undefined"===typeof o[s]?null:o[s]}))}var i=this,o={};return e(t,this.options,o,0),o}})),e(i,"masters/highcharts.src.js",[i["Core/Globals.js"]],(function(t){return t})),i["masters/highcharts.src.js"]._modules=i,i["masters/highcharts.src.js"]}))},ec30:function(t,e,i){"use strict";if(i("9e1e")){var n=i("2d00"),r=i("7726"),o=i("79e5"),s=i("5ca1"),a=i("0f88"),l=i("ed0b"),c=i("9b43"),h=i("f605"),u=i("4630"),d=i("32e9"),p=i("dcbc"),f=i("4588"),m=i("9def"),g=i("09fa"),v=i("77f1"),y=i("6a99"),x=i("69a8"),b=i("23c6"),w=i("d3f4"),_=i("4bf8"),M=i("33a4"),S=i("2aeb"),T=i("38fd"),E=i("9093").f,A=i("27ee"),L=i("ca5a"),C=i("2b4c"),P=i("0a49"),R=i("c366"),O=i("ebd6"),k=i("cadf"),D=i("84f2"),I=i("5cc5"),N=i("7a56"),B=i("36bd"),z=i("ba92"),F=i("86cc"),U=i("11e9"),G=F.f,H=U.f,j=r.RangeError,W=r.TypeError,V=r.Uint8Array,X="ArrayBuffer",Y="Shared"+X,q="BYTES_PER_ELEMENT",Z="prototype",J=Array[Z],K=l.ArrayBuffer,$=l.DataView,Q=P(0),tt=P(2),et=P(3),it=P(4),nt=P(5),rt=P(6),ot=R(!0),st=R(!1),at=k.values,lt=k.keys,ct=k.entries,ht=J.lastIndexOf,ut=J.reduce,dt=J.reduceRight,pt=J.join,ft=J.sort,mt=J.slice,gt=J.toString,vt=J.toLocaleString,yt=C("iterator"),xt=C("toStringTag"),bt=L("typed_constructor"),wt=L("def_constructor"),_t=a.CONSTR,Mt=a.TYPED,St=a.VIEW,Tt="Wrong length!",Et=P(1,(function(t,e){return Rt(O(t,t[wt]),e)})),At=o((function(){return 1===new V(new Uint16Array([1]).buffer)[0]})),Lt=!!V&&!!V[Z].set&&o((function(){new V(1).set({})})),Ct=function(t,e){var i=f(t);if(i<0||i%e)throw j("Wrong offset!");return i},Pt=function(t){if(w(t)&&Mt in t)return t;throw W(t+" is not a typed array!")},Rt=function(t,e){if(!w(t)||!(bt in t))throw W("It is not a typed array constructor!");return new t(e)},Ot=function(t,e){return kt(O(t,t[wt]),e)},kt=function(t,e){var i=0,n=e.length,r=Rt(t,n);while(n>i)r[i]=e[i++];return r},Dt=function(t,e,i){G(t,e,{get:function(){return this._d[i]}})},It=function(t){var e,i,n,r,o,s,a=_(t),l=arguments.length,h=l>1?arguments[1]:void 0,u=void 0!==h,d=A(a);if(void 0!=d&&!M(d)){for(s=d.call(a),n=[],e=0;!(o=s.next()).done;e++)n.push(o.value);a=n}for(u&&l>2&&(h=c(h,arguments[2],2)),e=0,i=m(a.length),r=Rt(this,i);i>e;e++)r[e]=u?h(a[e],e):a[e];return r},Nt=function(){var t=0,e=arguments.length,i=Rt(this,e);while(e>t)i[t]=arguments[t++];return i},Bt=!!V&&o((function(){vt.call(new V(1))})),zt=function(){return vt.apply(Bt?mt.call(Pt(this)):Pt(this),arguments)},Ft={copyWithin:function(t,e){return z.call(Pt(this),t,e,arguments.length>2?arguments[2]:void 0)},every:function(t){return it(Pt(this),t,arguments.length>1?arguments[1]:void 0)},fill:function(t){return B.apply(Pt(this),arguments)},filter:function(t){return Ot(this,tt(Pt(this),t,arguments.length>1?arguments[1]:void 0))},find:function(t){return nt(Pt(this),t,arguments.length>1?arguments[1]:void 0)},findIndex:function(t){return rt(Pt(this),t,arguments.length>1?arguments[1]:void 0)},forEach:function(t){Q(Pt(this),t,arguments.length>1?arguments[1]:void 0)},indexOf:function(t){return st(Pt(this),t,arguments.length>1?arguments[1]:void 0)},includes:function(t){return ot(Pt(this),t,arguments.length>1?arguments[1]:void 0)},join:function(t){return pt.apply(Pt(this),arguments)},lastIndexOf:function(t){return ht.apply(Pt(this),arguments)},map:function(t){return Et(Pt(this),t,arguments.length>1?arguments[1]:void 0)},reduce:function(t){return ut.apply(Pt(this),arguments)},reduceRight:function(t){return dt.apply(Pt(this),arguments)},reverse:function(){var t,e=this,i=Pt(e).length,n=Math.floor(i/2),r=0;while(r<n)t=e[r],e[r++]=e[--i],e[i]=t;return e},some:function(t){return et(Pt(this),t,arguments.length>1?arguments[1]:void 0)},sort:function(t){return ft.call(Pt(this),t)},subarray:function(t,e){var i=Pt(this),n=i.length,r=v(t,n);return new(O(i,i[wt]))(i.buffer,i.byteOffset+r*i.BYTES_PER_ELEMENT,m((void 0===e?n:v(e,n))-r))}},Ut=function(t,e){return Ot(this,mt.call(Pt(this),t,e))},Gt=function(t){Pt(this);var e=Ct(arguments[1],1),i=this.length,n=_(t),r=m(n.length),o=0;if(r+e>i)throw j(Tt);while(o<r)this[e+o]=n[o++]},Ht={entries:function(){return ct.call(Pt(this))},keys:function(){return lt.call(Pt(this))},values:function(){return at.call(Pt(this))}},jt=function(t,e){return w(t)&&t[Mt]&&"symbol"!=typeof e&&e in t&&String(+e)==String(e)},Wt=function(t,e){return jt(t,e=y(e,!0))?u(2,t[e]):H(t,e)},Vt=function(t,e,i){return!(jt(t,e=y(e,!0))&&w(i)&&x(i,"value"))||x(i,"get")||x(i,"set")||i.configurable||x(i,"writable")&&!i.writable||x(i,"enumerable")&&!i.enumerable?G(t,e,i):(t[e]=i.value,t)};_t||(U.f=Wt,F.f=Vt),s(s.S+s.F*!_t,"Object",{getOwnPropertyDescriptor:Wt,defineProperty:Vt}),o((function(){gt.call({})}))&&(gt=vt=function(){return pt.call(this)});var Xt=p({},Ft);p(Xt,Ht),d(Xt,yt,Ht.values),p(Xt,{slice:Ut,set:Gt,constructor:function(){},toString:gt,toLocaleString:zt}),Dt(Xt,"buffer","b"),Dt(Xt,"byteOffset","o"),Dt(Xt,"byteLength","l"),Dt(Xt,"length","e"),G(Xt,xt,{get:function(){return this[Mt]}}),t.exports=function(t,e,i,l){l=!!l;var c=t+(l?"Clamped":"")+"Array",u="get"+t,p="set"+t,f=r[c],v=f||{},y=f&&T(f),x=!f||!a.ABV,_={},M=f&&f[Z],A=function(t,i){var n=t._d;return n.v[u](i*e+n.o,At)},L=function(t,i,n){var r=t._d;l&&(n=(n=Math.round(n))<0?0:n>255?255:255&n),r.v[p](i*e+r.o,n,At)},C=function(t,e){G(t,e,{get:function(){return A(this,e)},set:function(t){return L(this,e,t)},enumerable:!0})};x?(f=i((function(t,i,n,r){h(t,f,c,"_d");var o,s,a,l,u=0,p=0;if(w(i)){if(!(i instanceof K||(l=b(i))==X||l==Y))return Mt in i?kt(f,i):It.call(f,i);o=i,p=Ct(n,e);var v=i.byteLength;if(void 0===r){if(v%e)throw j(Tt);if(s=v-p,s<0)throw j(Tt)}else if(s=m(r)*e,s+p>v)throw j(Tt);a=s/e}else a=g(i),s=a*e,o=new K(s);d(t,"_d",{b:o,o:p,l:s,e:a,v:new $(o)});while(u<a)C(t,u++)})),M=f[Z]=S(Xt),d(M,"constructor",f)):o((function(){f(1)}))&&o((function(){new f(-1)}))&&I((function(t){new f,new f(null),new f(1.5),new f(t)}),!0)||(f=i((function(t,i,n,r){var o;return h(t,f,c),w(i)?i instanceof K||(o=b(i))==X||o==Y?void 0!==r?new v(i,Ct(n,e),r):void 0!==n?new v(i,Ct(n,e)):new v(i):Mt in i?kt(f,i):It.call(f,i):new v(g(i))})),Q(y!==Function.prototype?E(v).concat(E(y)):E(v),(function(t){t in f||d(f,t,v[t])})),f[Z]=M,n||(M.constructor=f));var P=M[yt],R=!!P&&("values"==P.name||void 0==P.name),O=Ht.values;d(f,bt,!0),d(M,Mt,c),d(M,St,!0),d(M,wt,f),(l?new f(1)[xt]==c:xt in M)||G(M,xt,{get:function(){return c}}),_[c]=f,s(s.G+s.W+s.F*(f!=v),_),s(s.S,c,{BYTES_PER_ELEMENT:e}),s(s.S+s.F*o((function(){v.of.call(f,1)})),c,{from:It,of:Nt}),q in M||d(M,q,e),s(s.P,c,Ft),N(c),s(s.P+s.F*Lt,c,{set:Gt}),s(s.P+s.F*!R,c,Ht),n||M.toString==gt||(M.toString=gt),s(s.P+s.F*o((function(){new f(1).slice()})),c,{slice:Ut}),s(s.P+s.F*(o((function(){return[1,2].toLocaleString()!=new f([1,2]).toLocaleString()}))||!o((function(){M.toLocaleString.call([1,2])}))),c,{toLocaleString:zt}),D[c]=R?P:O,n||R||d(M,yt,O)}}else t.exports=function(){}},ed0b:function(t,e,i){"use strict";var n=i("7726"),r=i("9e1e"),o=i("2d00"),s=i("0f88"),a=i("32e9"),l=i("dcbc"),c=i("79e5"),h=i("f605"),u=i("4588"),d=i("9def"),p=i("09fa"),f=i("9093").f,m=i("86cc").f,g=i("36bd"),v=i("7f20"),y="ArrayBuffer",x="DataView",b="prototype",w="Wrong length!",_="Wrong index!",M=n[y],S=n[x],T=n.Math,E=n.RangeError,A=n.Infinity,L=M,C=T.abs,P=T.pow,R=T.floor,O=T.log,k=T.LN2,D="buffer",I="byteLength",N="byteOffset",B=r?"_b":D,z=r?"_l":I,F=r?"_o":N;function U(t,e,i){var n,r,o,s=new Array(i),a=8*i-e-1,l=(1<<a)-1,c=l>>1,h=23===e?P(2,-24)-P(2,-77):0,u=0,d=t<0||0===t&&1/t<0?1:0;for(t=C(t),t!=t||t===A?(r=t!=t?1:0,n=l):(n=R(O(t)/k),t*(o=P(2,-n))<1&&(n--,o*=2),t+=n+c>=1?h/o:h*P(2,1-c),t*o>=2&&(n++,o/=2),n+c>=l?(r=0,n=l):n+c>=1?(r=(t*o-1)*P(2,e),n+=c):(r=t*P(2,c-1)*P(2,e),n=0));e>=8;s[u++]=255&r,r/=256,e-=8);for(n=n<<e|r,a+=e;a>0;s[u++]=255&n,n/=256,a-=8);return s[--u]|=128*d,s}function G(t,e,i){var n,r=8*i-e-1,o=(1<<r)-1,s=o>>1,a=r-7,l=i-1,c=t[l--],h=127&c;for(c>>=7;a>0;h=256*h+t[l],l--,a-=8);for(n=h&(1<<-a)-1,h>>=-a,a+=e;a>0;n=256*n+t[l],l--,a-=8);if(0===h)h=1-s;else{if(h===o)return n?NaN:c?-A:A;n+=P(2,e),h-=s}return(c?-1:1)*n*P(2,h-e)}function H(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]}function j(t){return[255&t]}function W(t){return[255&t,t>>8&255]}function V(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function X(t){return U(t,52,8)}function Y(t){return U(t,23,4)}function q(t,e,i){m(t[b],e,{get:function(){return this[i]}})}function Z(t,e,i,n){var r=+i,o=p(r);if(o+e>t[z])throw E(_);var s=t[B]._b,a=o+t[F],l=s.slice(a,a+e);return n?l:l.reverse()}function J(t,e,i,n,r,o){var s=+i,a=p(s);if(a+e>t[z])throw E(_);for(var l=t[B]._b,c=a+t[F],h=n(+r),u=0;u<e;u++)l[c+u]=h[o?u:e-u-1]}if(s.ABV){if(!c((function(){M(1)}))||!c((function(){new M(-1)}))||c((function(){return new M,new M(1.5),new M(NaN),M.name!=y}))){M=function(t){return h(this,M),new L(p(t))};for(var K,$=M[b]=L[b],Q=f(L),tt=0;Q.length>tt;)(K=Q[tt++])in M||a(M,K,L[K]);o||($.constructor=M)}var et=new S(new M(2)),it=S[b].setInt8;et.setInt8(0,2147483648),et.setInt8(1,2147483649),!et.getInt8(0)&&et.getInt8(1)||l(S[b],{setInt8:function(t,e){it.call(this,t,e<<24>>24)},setUint8:function(t,e){it.call(this,t,e<<24>>24)}},!0)}else M=function(t){h(this,M,y);var e=p(t);this._b=g.call(new Array(e),0),this[z]=e},S=function(t,e,i){h(this,S,x),h(t,M,x);var n=t[z],r=u(e);if(r<0||r>n)throw E("Wrong offset!");if(i=void 0===i?n-r:d(i),r+i>n)throw E(w);this[B]=t,this[F]=r,this[z]=i},r&&(q(M,I,"_l"),q(S,D,"_b"),q(S,I,"_l"),q(S,N,"_o")),l(S[b],{getInt8:function(t){return Z(this,1,t)[0]<<24>>24},getUint8:function(t){return Z(this,1,t)[0]},getInt16:function(t){var e=Z(this,2,t,arguments[1]);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=Z(this,2,t,arguments[1]);return e[1]<<8|e[0]},getInt32:function(t){return H(Z(this,4,t,arguments[1]))},getUint32:function(t){return H(Z(this,4,t,arguments[1]))>>>0},getFloat32:function(t){return G(Z(this,4,t,arguments[1]),23,4)},getFloat64:function(t){return G(Z(this,8,t,arguments[1]),52,8)},setInt8:function(t,e){J(this,1,t,j,e)},setUint8:function(t,e){J(this,1,t,j,e)},setInt16:function(t,e){J(this,2,t,W,e,arguments[2])},setUint16:function(t,e){J(this,2,t,W,e,arguments[2])},setInt32:function(t,e){J(this,4,t,V,e,arguments[2])},setUint32:function(t,e){J(this,4,t,V,e,arguments[2])},setFloat32:function(t,e){J(this,4,t,Y,e,arguments[2])},setFloat64:function(t,e){J(this,8,t,X,e,arguments[2])}});v(M,y),v(S,x),a(S[b],s.VIEW,!0),e[y]=M,e[x]=S},edde:function(t,e,i){"use strict";t.exports=!1},f386:function(t,e,i){"use strict";i("386b")("small",(function(t){return function(){return t(this,"small","","")}}))},f400:function(t,e,i){"use strict";var n=i("c26b"),r=i("b39a"),o="Map";t.exports=i("e0b8")(o,(function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}}),{get:function(t){var e=n.getEntry(r(this,o),t);return e&&e.v},set:function(t,e){return n.def(r(this,o),0===t?0:t,e)}},n,!0)},fdef:function(t,e){t.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"}}]);